@wyxos/vibe 1.6.17 → 1.6.19
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 +763 -700
- package/lib/vibe.css +1 -1
- package/package.json +3 -3
- package/src/Masonry.vue +1439 -1334
- package/src/useMasonryScroll.ts +60 -60
package/lib/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { nextTick as
|
|
1
|
+
import { nextTick as J, defineComponent as tt, ref as T, computed as Z, onMounted as at, onUnmounted as nt, watch as re, createElementBlock as D, openBlock as F, createCommentVNode as ne, createElementVNode as O, normalizeStyle as we, renderSlot as Q, normalizeClass as ue, withModifiers as _e, toDisplayString as He, Fragment as Ue, renderList as Ge, createVNode as $e, withCtx as ge, mergeProps as pe, TransitionGroup as Tt, unref as Lt } from "vue";
|
|
2
2
|
let Se = null;
|
|
3
|
-
function
|
|
3
|
+
function kt() {
|
|
4
4
|
if (Se != null) return Se;
|
|
5
5
|
const t = document.createElement("div");
|
|
6
6
|
t.style.visibility = "hidden", t.style.overflow = "scroll", t.style.msOverflowStyle = "scrollbar", t.style.width = "100px", t.style.height = "100px", document.body.appendChild(t);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
return document.body.removeChild(t), Se =
|
|
7
|
+
const v = document.createElement("div");
|
|
8
|
+
v.style.width = "100%", t.appendChild(v);
|
|
9
|
+
const c = t.offsetWidth - v.offsetWidth;
|
|
10
|
+
return document.body.removeChild(t), Se = c, c;
|
|
11
11
|
}
|
|
12
|
-
function Xe(t,
|
|
12
|
+
function Xe(t, v, c, r = {}) {
|
|
13
13
|
const {
|
|
14
|
-
gutterX:
|
|
15
|
-
gutterY:
|
|
16
|
-
header:
|
|
14
|
+
gutterX: L = 0,
|
|
15
|
+
gutterY: p = 0,
|
|
16
|
+
header: l = 0,
|
|
17
17
|
footer: s = 0,
|
|
18
|
-
paddingLeft:
|
|
19
|
-
paddingRight:
|
|
20
|
-
sizes:
|
|
18
|
+
paddingLeft: b = 0,
|
|
19
|
+
paddingRight: E = 0,
|
|
20
|
+
sizes: S = {
|
|
21
21
|
base: 1,
|
|
22
22
|
sm: 2,
|
|
23
23
|
md: 3,
|
|
@@ -25,195 +25,195 @@ function Xe(t, c, v, l = {}) {
|
|
|
25
25
|
xl: 5,
|
|
26
26
|
"2xl": 6
|
|
27
27
|
},
|
|
28
|
-
placement:
|
|
29
|
-
} =
|
|
30
|
-
let
|
|
28
|
+
placement: I = "masonry"
|
|
29
|
+
} = r;
|
|
30
|
+
let d = 0, W = 0;
|
|
31
31
|
try {
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
if (v && v.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
|
|
33
|
+
const w = window.getComputedStyle(v);
|
|
34
|
+
d = parseFloat(w.paddingLeft) || 0, W = parseFloat(w.paddingRight) || 0;
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return Math.round(x *
|
|
38
|
+
const R = (b || 0) + d, q = (E || 0) + W, g = v.offsetWidth - v.clientWidth, o = g > 0 ? g + 2 : kt() + 2, $ = v.offsetWidth - o - R - q, y = L * (c - 1), x = Math.floor(($ - y) / c), H = t.map((w) => {
|
|
39
|
+
const M = w.width, j = w.height;
|
|
40
|
+
return Math.round(x * j / M) + s + l;
|
|
41
41
|
});
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
for (let
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
else if (
|
|
42
|
+
if (I === "sequential-balanced") {
|
|
43
|
+
const w = H.length;
|
|
44
|
+
if (w === 0) return [];
|
|
45
|
+
const M = (k, z, K) => k + (z > 0 ? p : 0) + K;
|
|
46
|
+
let j = Math.max(...H), n = H.reduce((k, z) => k + z, 0) + p * Math.max(0, w - 1);
|
|
47
|
+
const f = (k) => {
|
|
48
|
+
let z = 1, K = 0, G = 0;
|
|
49
|
+
for (let X = 0; X < w; X++) {
|
|
50
|
+
const ee = H[X], te = M(K, G, ee);
|
|
51
|
+
if (te <= k)
|
|
52
|
+
K = te, G++;
|
|
53
|
+
else if (z++, K = ee, G = 1, ee > k || z > c) return !1;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return z <= c;
|
|
56
56
|
};
|
|
57
|
-
for (;
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
for (; j < n; ) {
|
|
58
|
+
const k = Math.floor((j + n) / 2);
|
|
59
|
+
f(k) ? n = k : j = k + 1;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
for (let
|
|
64
|
-
const
|
|
65
|
-
!(
|
|
61
|
+
const P = n, A = new Array(c).fill(0);
|
|
62
|
+
let U = c - 1, C = 0, N = 0;
|
|
63
|
+
for (let k = w - 1; k >= 0; k--) {
|
|
64
|
+
const z = H[k], K = k < U;
|
|
65
|
+
!(M(C, N, z) <= P) || K ? (A[U] = k + 1, U--, C = z, N = 1) : (C = M(C, N, z), N++);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
for (let
|
|
70
|
-
const
|
|
71
|
-
for (let
|
|
72
|
-
const
|
|
73
|
-
...t[
|
|
67
|
+
A[0] = 0;
|
|
68
|
+
const oe = [], ie = new Array(c).fill(0);
|
|
69
|
+
for (let k = 0; k < c; k++) {
|
|
70
|
+
const z = A[k], K = k + 1 < c ? A[k + 1] : w, G = k * (x + L);
|
|
71
|
+
for (let X = z; X < K; X++) {
|
|
72
|
+
const te = {
|
|
73
|
+
...t[X],
|
|
74
74
|
columnWidth: x,
|
|
75
75
|
imageHeight: 0,
|
|
76
76
|
columnHeight: 0,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
te.imageHeight = H[X] - (s + l), te.columnHeight = H[X], te.left = G, te.top = ie[k], ie[k] += te.columnHeight + (X + 1 < K ? p : 0), oe.push(te);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return oe;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
for (let
|
|
87
|
-
const
|
|
88
|
-
...
|
|
85
|
+
const h = new Array(c).fill(0), B = [];
|
|
86
|
+
for (let w = 0; w < t.length; w++) {
|
|
87
|
+
const M = t[w], j = {
|
|
88
|
+
...M,
|
|
89
89
|
columnWidth: 0,
|
|
90
90
|
imageHeight: 0,
|
|
91
91
|
columnHeight: 0,
|
|
92
92
|
left: 0,
|
|
93
93
|
top: 0
|
|
94
|
-
}, n =
|
|
95
|
-
|
|
94
|
+
}, n = h.indexOf(Math.min(...h)), f = M.width, P = M.height;
|
|
95
|
+
j.columnWidth = x, j.left = n * (x + L), j.imageHeight = Math.round(x * P / f), j.columnHeight = j.imageHeight + s + l, j.top = h[n], h[n] += j.columnHeight + p, B.push(j);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return B;
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
function
|
|
101
|
-
var
|
|
99
|
+
var It = typeof global == "object" && global && global.Object === Object && global, $t = typeof self == "object" && self && self.Object === Object && self, lt = It || $t || Function("return this")(), xe = lt.Symbol, rt = Object.prototype, St = rt.hasOwnProperty, Pt = rt.toString, ye = xe ? xe.toStringTag : void 0;
|
|
100
|
+
function Ht(t) {
|
|
101
|
+
var v = St.call(t, ye), c = t[ye];
|
|
102
102
|
try {
|
|
103
|
-
t[
|
|
104
|
-
var
|
|
103
|
+
t[ye] = void 0;
|
|
104
|
+
var r = !0;
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
|
-
var
|
|
108
|
-
return
|
|
107
|
+
var L = Pt.call(t);
|
|
108
|
+
return r && (v ? t[ye] = c : delete t[ye]), L;
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function $t(t) {
|
|
112
|
-
return Ht.call(t);
|
|
113
|
-
}
|
|
114
|
-
var Nt = "[object Null]", Wt = "[object Undefined]", _e = xe ? xe.toStringTag : void 0;
|
|
110
|
+
var Nt = Object.prototype, Wt = Nt.toString;
|
|
115
111
|
function Dt(t) {
|
|
116
|
-
return
|
|
112
|
+
return Wt.call(t);
|
|
113
|
+
}
|
|
114
|
+
var Ft = "[object Null]", Bt = "[object Undefined]", Je = xe ? xe.toStringTag : void 0;
|
|
115
|
+
function zt(t) {
|
|
116
|
+
return t == null ? t === void 0 ? Bt : Ft : Je && Je in Object(t) ? Ht(t) : Dt(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function At(t) {
|
|
119
119
|
return t != null && typeof t == "object";
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return typeof t == "symbol" ||
|
|
121
|
+
var Ot = "[object Symbol]";
|
|
122
|
+
function Rt(t) {
|
|
123
|
+
return typeof t == "symbol" || At(t) && zt(t) == Ot;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
126
|
-
function
|
|
127
|
-
for (var
|
|
125
|
+
var jt = /\s/;
|
|
126
|
+
function Ct(t) {
|
|
127
|
+
for (var v = t.length; v-- && jt.test(t.charAt(v)); )
|
|
128
128
|
;
|
|
129
|
-
return
|
|
129
|
+
return v;
|
|
130
130
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
133
|
-
return t && t.slice(0,
|
|
131
|
+
var Yt = /^\s+/;
|
|
132
|
+
function qt(t) {
|
|
133
|
+
return t && t.slice(0, Ct(t) + 1).replace(Yt, "");
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
137
|
-
return t != null && (
|
|
135
|
+
function Ne(t) {
|
|
136
|
+
var v = typeof t;
|
|
137
|
+
return t != null && (v == "object" || v == "function");
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var Ke = NaN, Vt = /^[-+]0x[0-9a-f]+$/i, _t = /^0b[01]+$/i, Ut = /^0o[0-7]+$/i, Gt = parseInt;
|
|
140
|
+
function Qe(t) {
|
|
141
141
|
if (typeof t == "number")
|
|
142
142
|
return t;
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
145
|
-
if (
|
|
146
|
-
var
|
|
147
|
-
t =
|
|
143
|
+
if (Rt(t))
|
|
144
|
+
return Ke;
|
|
145
|
+
if (Ne(t)) {
|
|
146
|
+
var v = typeof t.valueOf == "function" ? t.valueOf() : t;
|
|
147
|
+
t = Ne(v) ? v + "" : v;
|
|
148
148
|
}
|
|
149
149
|
if (typeof t != "string")
|
|
150
150
|
return t === 0 ? t : +t;
|
|
151
|
-
t =
|
|
152
|
-
var
|
|
153
|
-
return
|
|
151
|
+
t = qt(t);
|
|
152
|
+
var c = _t.test(t);
|
|
153
|
+
return c || Ut.test(t) ? Gt(t.slice(2), c ? 2 : 8) : Vt.test(t) ? Ke : +t;
|
|
154
154
|
}
|
|
155
155
|
var Pe = function() {
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
function
|
|
159
|
-
var
|
|
156
|
+
return lt.Date.now();
|
|
157
|
+
}, Xt = "Expected a function", Jt = Math.max, Kt = Math.min;
|
|
158
|
+
function Ze(t, v, c) {
|
|
159
|
+
var r, L, p, l, s, b, E = 0, S = !1, I = !1, d = !0;
|
|
160
160
|
if (typeof t != "function")
|
|
161
|
-
throw new TypeError(
|
|
162
|
-
|
|
163
|
-
function
|
|
164
|
-
var
|
|
165
|
-
return
|
|
161
|
+
throw new TypeError(Xt);
|
|
162
|
+
v = Qe(v) || 0, Ne(c) && (S = !!c.leading, I = "maxWait" in c, p = I ? Jt(Qe(c.maxWait) || 0, v) : p, d = "trailing" in c ? !!c.trailing : d);
|
|
163
|
+
function W(h) {
|
|
164
|
+
var B = r, w = L;
|
|
165
|
+
return r = L = void 0, E = h, l = t.apply(w, B), l;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return
|
|
167
|
+
function R(h) {
|
|
168
|
+
return E = h, s = setTimeout(o, v), S ? W(h) : l;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
return
|
|
170
|
+
function q(h) {
|
|
171
|
+
var B = h - b, w = h - E, M = v - B;
|
|
172
|
+
return I ? Kt(M, p - w) : M;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
return
|
|
174
|
+
function g(h) {
|
|
175
|
+
var B = h - b, w = h - E;
|
|
176
|
+
return b === void 0 || B >= v || B < 0 || I && w >= p;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
182
|
-
s = setTimeout(
|
|
178
|
+
function o() {
|
|
179
|
+
var h = Pe();
|
|
180
|
+
if (g(h))
|
|
181
|
+
return $(h);
|
|
182
|
+
s = setTimeout(o, q(h));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return s = void 0,
|
|
184
|
+
function $(h) {
|
|
185
|
+
return s = void 0, d && r ? W(h) : (r = L = void 0, l);
|
|
186
186
|
}
|
|
187
187
|
function y() {
|
|
188
|
-
s !== void 0 && clearTimeout(s),
|
|
188
|
+
s !== void 0 && clearTimeout(s), E = 0, r = b = L = s = void 0;
|
|
189
189
|
}
|
|
190
190
|
function x() {
|
|
191
|
-
return s === void 0 ?
|
|
191
|
+
return s === void 0 ? l : $(Pe());
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
var
|
|
195
|
-
if (
|
|
193
|
+
function H() {
|
|
194
|
+
var h = Pe(), B = g(h);
|
|
195
|
+
if (r = arguments, L = this, b = h, B) {
|
|
196
196
|
if (s === void 0)
|
|
197
|
-
return
|
|
198
|
-
if (
|
|
199
|
-
return clearTimeout(s), s = setTimeout(
|
|
197
|
+
return R(b);
|
|
198
|
+
if (I)
|
|
199
|
+
return clearTimeout(s), s = setTimeout(o, v), W(b);
|
|
200
200
|
}
|
|
201
|
-
return s === void 0 && (s = setTimeout(
|
|
201
|
+
return s === void 0 && (s = setTimeout(o, v)), l;
|
|
202
202
|
}
|
|
203
|
-
return
|
|
203
|
+
return H.cancel = y, H.flush = x, H;
|
|
204
204
|
}
|
|
205
|
-
function fe(t,
|
|
206
|
-
const
|
|
207
|
-
return
|
|
205
|
+
function fe(t, v) {
|
|
206
|
+
const c = v ?? (typeof window < "u" ? window.innerWidth : 1024), r = t.sizes;
|
|
207
|
+
return c >= 1536 && r["2xl"] ? r["2xl"] : c >= 1280 && r.xl ? r.xl : c >= 1024 && r.lg ? r.lg : c >= 768 && r.md ? r.md : c >= 640 && r.sm ? r.sm : r.base;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
const
|
|
211
|
-
return
|
|
209
|
+
function Qt(t) {
|
|
210
|
+
const v = t ?? (typeof window < "u" ? window.innerWidth : 1024);
|
|
211
|
+
return v >= 1536 ? "2xl" : v >= 1280 ? "xl" : v >= 1024 ? "lg" : v >= 768 ? "md" : v >= 640 ? "sm" : "base";
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return t.reduce((
|
|
213
|
+
function Zt(t) {
|
|
214
|
+
return t.reduce((c, r) => Math.max(c, r.top + r.columnHeight), 0) + 500;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function ea(t) {
|
|
217
217
|
return {
|
|
218
218
|
transform: `translate3d(${t.left}px, ${t.top}px, 0)`,
|
|
219
219
|
top: "0px",
|
|
@@ -222,114 +222,114 @@ function Kt(t) {
|
|
|
222
222
|
height: `${t.columnHeight}px`
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function ta(t, v = 0) {
|
|
226
226
|
return {
|
|
227
|
-
style:
|
|
227
|
+
style: ea(t),
|
|
228
228
|
"data-top": t.top,
|
|
229
229
|
"data-left": t.left,
|
|
230
230
|
"data-id": `${t.page}-${t.id}`,
|
|
231
|
-
"data-index":
|
|
231
|
+
"data-index": v
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
if (!t.length ||
|
|
236
|
-
return new Array(Math.max(1,
|
|
237
|
-
const
|
|
238
|
-
for (let
|
|
239
|
-
const
|
|
240
|
-
for (const
|
|
241
|
-
const s =
|
|
242
|
-
s != null && (
|
|
234
|
+
function We(t, v) {
|
|
235
|
+
if (!t.length || v <= 0)
|
|
236
|
+
return new Array(Math.max(1, v)).fill(0);
|
|
237
|
+
const r = Array.from(new Set(t.map((l) => l.left))).sort((l, s) => l - s).slice(0, v), L = /* @__PURE__ */ new Map();
|
|
238
|
+
for (let l = 0; l < r.length; l++) L.set(r[l], l);
|
|
239
|
+
const p = new Array(r.length).fill(0);
|
|
240
|
+
for (const l of t) {
|
|
241
|
+
const s = L.get(l.left);
|
|
242
|
+
s != null && (p[s] = Math.max(p[s], l.top + l.columnHeight));
|
|
243
243
|
}
|
|
244
|
-
for (;
|
|
245
|
-
return
|
|
244
|
+
for (; p.length < v; ) p.push(0);
|
|
245
|
+
return p;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
function
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
247
|
+
function aa(t, v) {
|
|
248
|
+
function c(l, s) {
|
|
249
|
+
const b = parseInt(l.dataset.left || "0", 10), E = parseInt(l.dataset.top || "0", 10), S = parseInt(l.dataset.index || "0", 10), I = Math.min(S * 20, 160), d = l.style.getPropertyValue("--masonry-opacity-delay");
|
|
250
|
+
l.style.setProperty("--masonry-opacity-delay", `${I}ms`), requestAnimationFrame(() => {
|
|
251
|
+
l.style.opacity = "1", l.style.transform = `translate3d(${b}px, ${E}px, 0) scale(1)`;
|
|
252
|
+
const W = () => {
|
|
253
|
+
d ? l.style.setProperty("--masonry-opacity-delay", d) : l.style.removeProperty("--masonry-opacity-delay"), l.removeEventListener("transitionend", W), s();
|
|
254
254
|
};
|
|
255
|
-
|
|
255
|
+
l.addEventListener("transitionend", W);
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
function l
|
|
259
|
-
const s = parseInt(
|
|
260
|
-
|
|
258
|
+
function r(l) {
|
|
259
|
+
const s = parseInt(l.dataset.left || "0", 10), b = parseInt(l.dataset.top || "0", 10);
|
|
260
|
+
l.style.opacity = "0", l.style.transform = `translate3d(${s}px, ${b + 10}px, 0) scale(0.985)`;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const s = parseInt(
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
function L(l) {
|
|
263
|
+
const s = parseInt(l.dataset.left || "0", 10), b = parseInt(l.dataset.top || "0", 10);
|
|
264
|
+
l.style.transition = "none", l.style.opacity = "1", l.style.transform = `translate3d(${s}px, ${b}px, 0) scale(1)`, l.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
265
|
+
l.style.transition = "";
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
const
|
|
270
|
-
let
|
|
271
|
-
if (!Number.isFinite(
|
|
272
|
-
const
|
|
273
|
-
|
|
268
|
+
function p(l, s) {
|
|
269
|
+
const b = parseInt(l.dataset.left || "0", 10), E = parseInt(l.dataset.top || "0", 10), S = typeof (v == null ? void 0 : v.leaveDurationMs) == "number" ? v.leaveDurationMs : NaN;
|
|
270
|
+
let I = Number.isFinite(S) && S > 0 ? S : NaN;
|
|
271
|
+
if (!Number.isFinite(I)) {
|
|
272
|
+
const o = getComputedStyle(l).getPropertyValue("--masonry-leave-duration") || "", $ = parseFloat(o);
|
|
273
|
+
I = Number.isFinite($) && $ > 0 ? $ : 200;
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
(!
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
},
|
|
275
|
+
const d = l.style.transitionDuration, W = () => {
|
|
276
|
+
l.removeEventListener("transitionend", R), clearTimeout(q), l.style.transitionDuration = d || "";
|
|
277
|
+
}, R = (g) => {
|
|
278
|
+
(!g || g.target === l) && (W(), s());
|
|
279
|
+
}, q = setTimeout(() => {
|
|
280
|
+
W(), s();
|
|
281
|
+
}, I + 100);
|
|
282
282
|
requestAnimationFrame(() => {
|
|
283
|
-
|
|
283
|
+
l.style.transitionDuration = `${I}ms`, l.style.opacity = "0", l.style.transform = `translate3d(${b}px, ${E + 10}px, 0) scale(0.985)`, l.addEventListener("transitionend", R);
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
return {
|
|
287
|
-
onEnter:
|
|
288
|
-
onBeforeEnter:
|
|
289
|
-
onBeforeLeave:
|
|
290
|
-
onLeave:
|
|
287
|
+
onEnter: c,
|
|
288
|
+
onBeforeEnter: r,
|
|
289
|
+
onBeforeLeave: L,
|
|
290
|
+
onLeave: p
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function na({
|
|
294
294
|
container: t,
|
|
295
|
-
masonry:
|
|
296
|
-
columns:
|
|
297
|
-
containerHeight:
|
|
298
|
-
isLoading:
|
|
299
|
-
pageSize:
|
|
300
|
-
refreshLayout:
|
|
295
|
+
masonry: v,
|
|
296
|
+
columns: c,
|
|
297
|
+
containerHeight: r,
|
|
298
|
+
isLoading: L,
|
|
299
|
+
pageSize: p,
|
|
300
|
+
refreshLayout: l,
|
|
301
301
|
setItemsRaw: s,
|
|
302
|
-
loadNext:
|
|
303
|
-
loadThresholdPx:
|
|
302
|
+
loadNext: b,
|
|
303
|
+
loadThresholdPx: E
|
|
304
304
|
}) {
|
|
305
|
-
let
|
|
306
|
-
async function
|
|
305
|
+
let S = 0;
|
|
306
|
+
async function I(d) {
|
|
307
307
|
if (!t.value) return;
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
await
|
|
308
|
+
const W = d ?? We(v.value, c.value), R = W.length ? Math.max(...W) : 0, q = t.value.scrollTop + t.value.clientHeight, g = t.value.scrollTop > S + 1;
|
|
309
|
+
S = t.value.scrollTop;
|
|
310
|
+
const o = typeof E == "number" ? E : 200, $ = o >= 0 ? Math.max(0, R - o) : Math.max(0, R + o);
|
|
311
|
+
if (q >= $ && g && !L.value) {
|
|
312
|
+
await b(), await J();
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
return {
|
|
317
|
-
handleScroll:
|
|
317
|
+
handleScroll: I
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const la = { 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" }, oa = {
|
|
321
321
|
key: 0,
|
|
322
322
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-100 text-slate-400 text-sm p-4 text-center"
|
|
323
|
-
},
|
|
323
|
+
}, ia = {
|
|
324
324
|
key: 1,
|
|
325
325
|
class: "relative w-full h-full"
|
|
326
|
-
},
|
|
326
|
+
}, sa = ["src"], ua = ["src", "autoplay", "controls"], va = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ca = {
|
|
327
327
|
key: 3,
|
|
328
328
|
class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
|
|
329
|
-
},
|
|
329
|
+
}, fa = {
|
|
330
330
|
key: 4,
|
|
331
331
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
|
|
332
|
-
}, Me = /* @__PURE__ */
|
|
332
|
+
}, Me = /* @__PURE__ */ tt({
|
|
333
333
|
__name: "MasonryItem",
|
|
334
334
|
props: {
|
|
335
335
|
item: {},
|
|
@@ -342,264 +342,276 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
342
342
|
inSwipeMode: { type: Boolean, default: !1 }
|
|
343
343
|
},
|
|
344
344
|
emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave"],
|
|
345
|
-
setup(t, { emit:
|
|
346
|
-
const
|
|
347
|
-
let
|
|
348
|
-
const
|
|
345
|
+
setup(t, { emit: v }) {
|
|
346
|
+
const c = t, r = v, L = T(!1), p = T(!1), l = T(null), s = T(!1), b = T(!1), E = T(null), S = T(!1), I = T(!1), d = T(!1), W = T(null), R = T(null);
|
|
347
|
+
let q = null;
|
|
348
|
+
const g = Z(() => {
|
|
349
349
|
var n;
|
|
350
|
-
return
|
|
351
|
-
}),
|
|
350
|
+
return c.type ?? ((n = c.item) == null ? void 0 : n.type) ?? "image";
|
|
351
|
+
}), o = Z(() => {
|
|
352
352
|
var n;
|
|
353
|
-
return
|
|
354
|
-
}),
|
|
353
|
+
return c.notFound ?? ((n = c.item) == null ? void 0 : n.notFound) ?? !1;
|
|
354
|
+
}), $ = Z(() => !!c.inSwipeMode);
|
|
355
355
|
function y(n) {
|
|
356
|
-
|
|
356
|
+
r("mouse-enter", { item: c.item, type: n });
|
|
357
357
|
}
|
|
358
358
|
function x(n) {
|
|
359
|
-
|
|
359
|
+
r("mouse-leave", { item: c.item, type: n });
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
363
|
-
const
|
|
364
|
-
|
|
361
|
+
function H(n) {
|
|
362
|
+
if ($.value) return;
|
|
363
|
+
const f = n.target;
|
|
364
|
+
f && (f.paused ? f.play() : f.pause());
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
368
|
-
|
|
366
|
+
function h(n) {
|
|
367
|
+
const f = n.target;
|
|
368
|
+
f && ($.value || f.play(), y("video"));
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
const
|
|
372
|
-
|
|
370
|
+
function B(n) {
|
|
371
|
+
const f = n.target;
|
|
372
|
+
f && ($.value || f.pause(), x("video"));
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
return new Promise((
|
|
374
|
+
function w(n) {
|
|
375
|
+
return new Promise((f, P) => {
|
|
376
376
|
if (!n) {
|
|
377
|
-
const
|
|
378
|
-
|
|
377
|
+
const N = new Error("No image source provided");
|
|
378
|
+
r("preload:error", { item: c.item, type: "image", src: n, error: N }), P(N);
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
const
|
|
381
|
+
const A = new Image(), U = Date.now(), C = 300;
|
|
382
|
+
A.onload = () => {
|
|
383
|
+
const N = Date.now() - U, oe = Math.max(0, C - N);
|
|
384
384
|
setTimeout(async () => {
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
},
|
|
385
|
+
L.value = !0, p.value = !1, I.value = !1, await J(), await new Promise((ie) => setTimeout(ie, 100)), d.value = !0, r("preload:success", { item: c.item, type: "image", src: n }), f();
|
|
386
|
+
}, oe);
|
|
387
|
+
}, A.onerror = () => {
|
|
388
|
+
p.value = !0, L.value = !1, I.value = !1;
|
|
389
|
+
const N = new Error("Failed to load image");
|
|
390
|
+
r("preload:error", { item: c.item, type: "image", src: n, error: N }), P(N);
|
|
391
|
+
}, A.src = n;
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
return new Promise((
|
|
394
|
+
function M(n) {
|
|
395
|
+
return new Promise((f, P) => {
|
|
396
396
|
if (!n) {
|
|
397
|
-
const
|
|
398
|
-
|
|
397
|
+
const N = new Error("No video source provided");
|
|
398
|
+
r("preload:error", { item: c.item, type: "video", src: n, error: N }), P(N);
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
const
|
|
401
|
+
const A = document.createElement("video"), U = Date.now(), C = 300;
|
|
402
|
+
A.preload = "metadata", A.muted = !0, A.onloadedmetadata = () => {
|
|
403
|
+
const N = Date.now() - U, oe = Math.max(0, C - N);
|
|
404
404
|
setTimeout(async () => {
|
|
405
|
-
s.value = !0,
|
|
406
|
-
},
|
|
407
|
-
},
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
},
|
|
405
|
+
s.value = !0, b.value = !1, I.value = !1, await J(), await new Promise((ie) => setTimeout(ie, 100)), d.value = !0, r("preload:success", { item: c.item, type: "video", src: n }), f();
|
|
406
|
+
}, oe);
|
|
407
|
+
}, A.onerror = () => {
|
|
408
|
+
b.value = !0, s.value = !1, I.value = !1;
|
|
409
|
+
const N = new Error("Failed to load video");
|
|
410
|
+
r("preload:error", { item: c.item, type: "video", src: n, error: N }), P(N);
|
|
411
|
+
}, A.src = n;
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
async function
|
|
415
|
-
var
|
|
416
|
-
if (!
|
|
414
|
+
async function j() {
|
|
415
|
+
var f;
|
|
416
|
+
if (!S.value || I.value || o.value || g.value === "video" && s.value || g.value === "image" && L.value)
|
|
417
417
|
return;
|
|
418
|
-
const n = (
|
|
418
|
+
const n = (f = c.item) == null ? void 0 : f.src;
|
|
419
419
|
if (n)
|
|
420
|
-
if (
|
|
421
|
-
|
|
420
|
+
if (I.value = !0, d.value = !1, g.value === "video") {
|
|
421
|
+
E.value = n, s.value = !1, b.value = !1;
|
|
422
422
|
try {
|
|
423
|
-
await
|
|
423
|
+
await M(n);
|
|
424
424
|
} catch {
|
|
425
425
|
}
|
|
426
426
|
} else {
|
|
427
|
-
|
|
427
|
+
l.value = n, L.value = !1, p.value = !1;
|
|
428
428
|
try {
|
|
429
|
-
await
|
|
429
|
+
await w(n);
|
|
430
430
|
} catch {
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
return
|
|
435
|
-
|
|
434
|
+
return at(() => {
|
|
435
|
+
W.value && (q = new IntersectionObserver(
|
|
436
436
|
(n) => {
|
|
437
|
-
n.forEach((
|
|
438
|
-
|
|
437
|
+
n.forEach((f) => {
|
|
438
|
+
f.isIntersecting && f.intersectionRatio >= 1 ? S.value || (S.value = !0, j()) : f.isIntersecting;
|
|
439
439
|
});
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
442
|
// Only trigger when item is 100% visible (full height in view)
|
|
443
443
|
threshold: [1]
|
|
444
444
|
}
|
|
445
|
-
),
|
|
446
|
-
}),
|
|
447
|
-
|
|
448
|
-
}),
|
|
445
|
+
), q.observe(W.value));
|
|
446
|
+
}), nt(() => {
|
|
447
|
+
q && (q.disconnect(), q = null);
|
|
448
|
+
}), re(
|
|
449
449
|
() => {
|
|
450
450
|
var n;
|
|
451
|
-
return (n =
|
|
451
|
+
return (n = c.item) == null ? void 0 : n.src;
|
|
452
452
|
},
|
|
453
453
|
async (n) => {
|
|
454
|
-
if (!(!n ||
|
|
455
|
-
if (
|
|
456
|
-
if (n !==
|
|
457
|
-
|
|
454
|
+
if (!(!n || o.value)) {
|
|
455
|
+
if (g.value === "video") {
|
|
456
|
+
if (n !== E.value && (s.value = !1, b.value = !1, E.value = n, S.value)) {
|
|
457
|
+
I.value = !0;
|
|
458
458
|
try {
|
|
459
|
-
await
|
|
459
|
+
await M(n);
|
|
460
460
|
} catch {
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
} else if (n !==
|
|
464
|
-
|
|
463
|
+
} else if (n !== l.value && (L.value = !1, p.value = !1, l.value = n, S.value)) {
|
|
464
|
+
I.value = !0;
|
|
465
465
|
try {
|
|
466
|
-
await
|
|
466
|
+
await w(n);
|
|
467
467
|
} catch {
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
),
|
|
473
|
-
() =>
|
|
472
|
+
), re(
|
|
473
|
+
() => c.isActive,
|
|
474
474
|
(n) => {
|
|
475
|
-
|
|
475
|
+
!$.value || !R.value || (n ? R.value.play() : R.value.pause());
|
|
476
476
|
}
|
|
477
|
-
), (n,
|
|
477
|
+
), (n, f) => (F(), D("div", {
|
|
478
478
|
ref_key: "containerRef",
|
|
479
|
-
ref:
|
|
479
|
+
ref: W,
|
|
480
480
|
class: "relative w-full h-full flex flex-col"
|
|
481
481
|
}, [
|
|
482
|
-
n.headerHeight > 0 ? (
|
|
482
|
+
n.headerHeight > 0 ? (F(), D("div", {
|
|
483
483
|
key: 0,
|
|
484
484
|
class: "relative z-10",
|
|
485
|
-
style:
|
|
485
|
+
style: we({ height: `${n.headerHeight}px` })
|
|
486
486
|
}, [
|
|
487
|
-
|
|
487
|
+
Q(n.$slots, "header", {
|
|
488
488
|
item: n.item,
|
|
489
489
|
remove: n.remove,
|
|
490
|
-
imageLoaded:
|
|
491
|
-
imageError:
|
|
490
|
+
imageLoaded: L.value,
|
|
491
|
+
imageError: p.value,
|
|
492
492
|
videoLoaded: s.value,
|
|
493
|
-
videoError:
|
|
494
|
-
showNotFound:
|
|
495
|
-
isLoading:
|
|
496
|
-
mediaType:
|
|
493
|
+
videoError: b.value,
|
|
494
|
+
showNotFound: o.value,
|
|
495
|
+
isLoading: I.value,
|
|
496
|
+
mediaType: g.value
|
|
497
497
|
})
|
|
498
|
-
], 4)) :
|
|
499
|
-
|
|
500
|
-
|
|
498
|
+
], 4)) : ne("", !0),
|
|
499
|
+
O("div", la, [
|
|
500
|
+
Q(n.$slots, "default", {
|
|
501
501
|
item: n.item,
|
|
502
502
|
remove: n.remove,
|
|
503
|
-
imageLoaded:
|
|
504
|
-
imageError:
|
|
503
|
+
imageLoaded: L.value,
|
|
504
|
+
imageError: p.value,
|
|
505
505
|
videoLoaded: s.value,
|
|
506
|
-
videoError:
|
|
507
|
-
showNotFound:
|
|
508
|
-
isLoading:
|
|
509
|
-
mediaType:
|
|
510
|
-
imageSrc:
|
|
511
|
-
videoSrc:
|
|
512
|
-
showMedia:
|
|
506
|
+
videoError: b.value,
|
|
507
|
+
showNotFound: o.value,
|
|
508
|
+
isLoading: I.value,
|
|
509
|
+
mediaType: g.value,
|
|
510
|
+
imageSrc: l.value,
|
|
511
|
+
videoSrc: E.value,
|
|
512
|
+
showMedia: d.value
|
|
513
513
|
}, () => [
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
]))) : (
|
|
520
|
-
|
|
514
|
+
O("div", ra, [
|
|
515
|
+
o.value ? (F(), D("div", oa, f[3] || (f[3] = [
|
|
516
|
+
O("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
|
|
517
|
+
O("span", { class: "font-medium" }, "Not Found", -1),
|
|
518
|
+
O("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
|
|
519
|
+
]))) : (F(), D("div", ia, [
|
|
520
|
+
g.value === "image" && l.value ? (F(), D("img", {
|
|
521
521
|
key: 0,
|
|
522
|
-
src:
|
|
523
|
-
class:
|
|
522
|
+
src: l.value,
|
|
523
|
+
class: ue([
|
|
524
524
|
"w-full h-full object-cover transition-opacity duration-700 ease-in-out",
|
|
525
|
-
|
|
525
|
+
L.value && d.value ? "opacity-100" : "opacity-0"
|
|
526
526
|
]),
|
|
527
527
|
style: { position: "absolute", top: "0", left: "0" },
|
|
528
528
|
loading: "lazy",
|
|
529
529
|
decoding: "async",
|
|
530
530
|
alt: "",
|
|
531
|
-
onMouseenter:
|
|
532
|
-
onMouseleave:
|
|
533
|
-
}, null, 42,
|
|
534
|
-
|
|
531
|
+
onMouseenter: f[0] || (f[0] = (P) => y("image")),
|
|
532
|
+
onMouseleave: f[1] || (f[1] = (P) => x("image"))
|
|
533
|
+
}, null, 42, sa)) : ne("", !0),
|
|
534
|
+
g.value === "video" && E.value ? (F(), D("video", {
|
|
535
535
|
key: 1,
|
|
536
536
|
ref_key: "videoEl",
|
|
537
|
-
ref:
|
|
538
|
-
src:
|
|
539
|
-
class:
|
|
537
|
+
ref: R,
|
|
538
|
+
src: E.value,
|
|
539
|
+
class: ue([
|
|
540
540
|
"w-full h-full object-cover transition-opacity duration-700 ease-in-out",
|
|
541
|
-
s.value &&
|
|
541
|
+
s.value && d.value ? "opacity-100" : "opacity-0"
|
|
542
542
|
]),
|
|
543
543
|
style: { position: "absolute", top: "0", left: "0" },
|
|
544
544
|
muted: "",
|
|
545
545
|
loop: "",
|
|
546
546
|
playsinline: "",
|
|
547
|
-
autoplay:
|
|
548
|
-
controls:
|
|
549
|
-
onClick:
|
|
550
|
-
onTouchend:
|
|
551
|
-
onMouseenter:
|
|
552
|
-
onMouseleave:
|
|
553
|
-
onError:
|
|
554
|
-
}, null, 42,
|
|
555
|
-
!
|
|
547
|
+
autoplay: $.value && c.isActive,
|
|
548
|
+
controls: $.value,
|
|
549
|
+
onClick: _e(H, ["stop"]),
|
|
550
|
+
onTouchend: _e(H, ["stop", "prevent"]),
|
|
551
|
+
onMouseenter: h,
|
|
552
|
+
onMouseleave: B,
|
|
553
|
+
onError: f[2] || (f[2] = (P) => b.value = !0)
|
|
554
|
+
}, null, 42, ua)) : ne("", !0),
|
|
555
|
+
!L.value && !s.value && !p.value && !b.value ? (F(), D("div", {
|
|
556
556
|
key: 2,
|
|
557
|
-
class:
|
|
557
|
+
class: ue([
|
|
558
558
|
"absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
|
|
559
|
-
|
|
559
|
+
d.value ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
560
560
|
])
|
|
561
561
|
}, [
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
class:
|
|
562
|
+
O("div", va, [
|
|
563
|
+
O("i", {
|
|
564
|
+
class: ue(g.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
|
|
565
565
|
}, null, 2)
|
|
566
566
|
])
|
|
567
|
-
], 2)) :
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
567
|
+
], 2)) : ne("", !0),
|
|
568
|
+
I.value ? (F(), D("div", ca, f[4] || (f[4] = [
|
|
569
|
+
O("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
|
|
570
|
+
O("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
|
|
571
571
|
], -1)
|
|
572
|
-
]))) :
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
class:
|
|
572
|
+
]))) : ne("", !0),
|
|
573
|
+
g.value === "image" && p.value || g.value === "video" && b.value ? (F(), D("div", fa, [
|
|
574
|
+
O("i", {
|
|
575
|
+
class: ue(g.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
|
|
576
576
|
}, null, 2),
|
|
577
|
-
|
|
578
|
-
])) :
|
|
577
|
+
O("span", null, "Failed to load " + He(g.value), 1)
|
|
578
|
+
])) : ne("", !0)
|
|
579
579
|
]))
|
|
580
580
|
])
|
|
581
581
|
])
|
|
582
582
|
]),
|
|
583
|
-
n.footerHeight > 0 ? (
|
|
583
|
+
n.footerHeight > 0 ? (F(), D("div", {
|
|
584
584
|
key: 1,
|
|
585
585
|
class: "relative z-10",
|
|
586
|
-
style:
|
|
586
|
+
style: we({ height: `${n.footerHeight}px` })
|
|
587
587
|
}, [
|
|
588
|
-
|
|
588
|
+
Q(n.$slots, "footer", {
|
|
589
589
|
item: n.item,
|
|
590
590
|
remove: n.remove,
|
|
591
|
-
imageLoaded:
|
|
592
|
-
imageError:
|
|
591
|
+
imageLoaded: L.value,
|
|
592
|
+
imageError: p.value,
|
|
593
593
|
videoLoaded: s.value,
|
|
594
|
-
videoError:
|
|
595
|
-
showNotFound:
|
|
596
|
-
isLoading:
|
|
597
|
-
mediaType:
|
|
594
|
+
videoError: b.value,
|
|
595
|
+
showNotFound: o.value,
|
|
596
|
+
isLoading: I.value,
|
|
597
|
+
mediaType: g.value
|
|
598
598
|
})
|
|
599
|
-
], 4)) :
|
|
599
|
+
], 4)) : ne("", !0)
|
|
600
600
|
], 512));
|
|
601
601
|
}
|
|
602
|
-
}),
|
|
602
|
+
}), da = { class: "w-full h-full flex items-center justify-center p-4" }, ma = { class: "w-full h-full max-w-full max-h-full relative" }, ha = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "w-full py-8 text-center"
|
|
605
|
+
}, ga = {
|
|
606
|
+
key: 1,
|
|
607
|
+
class: "w-full py-8 text-center"
|
|
608
|
+
}, pa = { class: "text-red-500 dark:text-red-400" }, ya = {
|
|
609
|
+
key: 0,
|
|
610
|
+
class: "w-full py-8 text-center"
|
|
611
|
+
}, wa = {
|
|
612
|
+
key: 1,
|
|
613
|
+
class: "w-full py-8 text-center"
|
|
614
|
+
}, ba = { class: "text-red-500 dark:text-red-400" }, xa = /* @__PURE__ */ tt({
|
|
603
615
|
__name: "Masonry",
|
|
604
616
|
props: {
|
|
605
617
|
getNextPage: {
|
|
@@ -717,8 +729,8 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
717
729
|
"item:mouse-enter",
|
|
718
730
|
"item:mouse-leave"
|
|
719
731
|
],
|
|
720
|
-
setup(t, { expose:
|
|
721
|
-
const
|
|
732
|
+
setup(t, { expose: v, emit: c }) {
|
|
733
|
+
const r = t, L = {
|
|
722
734
|
sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
|
|
723
735
|
gutterX: 10,
|
|
724
736
|
gutterY: 10,
|
|
@@ -727,19 +739,19 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
727
739
|
paddingLeft: 0,
|
|
728
740
|
paddingRight: 0,
|
|
729
741
|
placement: "masonry"
|
|
730
|
-
},
|
|
742
|
+
}, p = Z(() => {
|
|
731
743
|
var e;
|
|
732
744
|
return {
|
|
733
|
-
...
|
|
734
|
-
...
|
|
745
|
+
...L,
|
|
746
|
+
...r.layout,
|
|
735
747
|
sizes: {
|
|
736
|
-
...
|
|
737
|
-
...((e =
|
|
748
|
+
...L.sizes,
|
|
749
|
+
...((e = r.layout) == null ? void 0 : e.sizes) || {}
|
|
738
750
|
}
|
|
739
751
|
};
|
|
740
|
-
}),
|
|
741
|
-
let
|
|
742
|
-
function
|
|
752
|
+
}), l = T(null), s = T(typeof window < "u" ? window.innerWidth : 1024), b = T(typeof window < "u" ? window.innerHeight : 768), E = T(null);
|
|
753
|
+
let S = null;
|
|
754
|
+
function I(e) {
|
|
743
755
|
return {
|
|
744
756
|
sm: 640,
|
|
745
757
|
md: 768,
|
|
@@ -748,47 +760,47 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
748
760
|
"2xl": 1536
|
|
749
761
|
}[e] || 768;
|
|
750
762
|
}
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
if (
|
|
754
|
-
const e = typeof
|
|
763
|
+
const d = Z(() => {
|
|
764
|
+
if (r.layoutMode === "masonry") return !1;
|
|
765
|
+
if (r.layoutMode === "swipe") return !0;
|
|
766
|
+
const e = typeof r.mobileBreakpoint == "string" ? I(r.mobileBreakpoint) : r.mobileBreakpoint;
|
|
755
767
|
return s.value < e;
|
|
756
|
-
}),
|
|
757
|
-
if (!
|
|
758
|
-
const e = Math.max(0, Math.min(
|
|
759
|
-
return
|
|
760
|
-
}),
|
|
761
|
-
if (!
|
|
762
|
-
const e =
|
|
763
|
-
return e >=
|
|
764
|
-
}),
|
|
765
|
-
if (!
|
|
766
|
-
const e =
|
|
767
|
-
return e < 0 ? null :
|
|
768
|
-
}),
|
|
769
|
-
get: () =>
|
|
770
|
-
set: (e) =>
|
|
771
|
-
}),
|
|
772
|
-
function
|
|
768
|
+
}), W = Z(() => {
|
|
769
|
+
if (!d.value || o.value.length === 0) return null;
|
|
770
|
+
const e = Math.max(0, Math.min(n.value, o.value.length - 1));
|
|
771
|
+
return o.value[e] || null;
|
|
772
|
+
}), R = Z(() => {
|
|
773
|
+
if (!d.value || !W.value) return null;
|
|
774
|
+
const e = n.value + 1;
|
|
775
|
+
return e >= o.value.length ? null : o.value[e] || null;
|
|
776
|
+
}), q = Z(() => {
|
|
777
|
+
if (!d.value || !W.value) return null;
|
|
778
|
+
const e = n.value - 1;
|
|
779
|
+
return e < 0 ? null : o.value[e] || null;
|
|
780
|
+
}), g = c, o = Z({
|
|
781
|
+
get: () => r.items,
|
|
782
|
+
set: (e) => g("update:items", e)
|
|
783
|
+
}), $ = T(7), y = T(null), x = T([]), H = T(null), h = T(!1), B = T(0), w = T(!1), M = T(null), j = Z(() => Qt(s.value)), n = T(0), f = T(0), P = T(!1), A = T(0), U = T(0), C = T(null), N = T(/* @__PURE__ */ new Set());
|
|
784
|
+
function oe(e) {
|
|
773
785
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
774
786
|
}
|
|
775
|
-
function
|
|
787
|
+
function ie(e, a) {
|
|
776
788
|
try {
|
|
777
789
|
if (!Array.isArray(e) || e.length === 0) return;
|
|
778
|
-
const i = e.filter((u) => !
|
|
790
|
+
const i = e.filter((u) => !oe(u == null ? void 0 : u.width) || !oe(u == null ? void 0 : u.height));
|
|
779
791
|
if (i.length === 0) return;
|
|
780
|
-
const
|
|
792
|
+
const m = [];
|
|
781
793
|
for (const u of i) {
|
|
782
|
-
const
|
|
783
|
-
|
|
794
|
+
const Y = (u == null ? void 0 : u.id) ?? `idx:${e.indexOf(u)}`;
|
|
795
|
+
N.value.has(Y) || (N.value.add(Y), m.push(Y));
|
|
784
796
|
}
|
|
785
|
-
if (
|
|
786
|
-
const u =
|
|
797
|
+
if (m.length > 0) {
|
|
798
|
+
const u = m.slice(0, 10);
|
|
787
799
|
console.warn(
|
|
788
800
|
"[Masonry] Items missing width/height detected:",
|
|
789
801
|
{
|
|
790
802
|
context: a,
|
|
791
|
-
count:
|
|
803
|
+
count: m.length,
|
|
792
804
|
sampleIds: u,
|
|
793
805
|
hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
|
|
794
806
|
}
|
|
@@ -797,451 +809,482 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
797
809
|
} catch {
|
|
798
810
|
}
|
|
799
811
|
}
|
|
800
|
-
const
|
|
812
|
+
const k = T(0), z = T(0), K = r.virtualBufferPx, G = T(!1), X = T({
|
|
801
813
|
distanceToTrigger: 0,
|
|
802
814
|
isNearTrigger: !1
|
|
803
|
-
}),
|
|
815
|
+
}), ee = (e) => {
|
|
804
816
|
if (!y.value) return;
|
|
805
|
-
const { scrollTop: a, clientHeight: i } = y.value,
|
|
806
|
-
|
|
817
|
+
const { scrollTop: a, clientHeight: i } = y.value, m = a + i, u = e ?? We(o.value, $.value), Y = u.length ? Math.max(...u) : 0, _ = typeof r.loadThresholdPx == "number" ? r.loadThresholdPx : 200, ce = _ >= 0 ? Math.max(0, Y - _) : Math.max(0, Y + _), Ve = Math.max(0, ce - m), Et = Ve <= 100;
|
|
818
|
+
X.value = {
|
|
807
819
|
distanceToTrigger: Math.round(Ve),
|
|
808
|
-
isNearTrigger:
|
|
820
|
+
isNearTrigger: Et
|
|
809
821
|
};
|
|
810
|
-
}, { onEnter:
|
|
811
|
-
function
|
|
812
|
-
if (
|
|
813
|
-
const i = parseInt(e.dataset.left || "0", 10),
|
|
814
|
-
e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${i}px, ${
|
|
822
|
+
}, { onEnter: te, onBeforeEnter: ot, onBeforeLeave: it, onLeave: st } = aa(o, { leaveDurationMs: r.leaveDurationMs });
|
|
823
|
+
function ut(e, a) {
|
|
824
|
+
if (G.value) {
|
|
825
|
+
const i = parseInt(e.dataset.left || "0", 10), m = parseInt(e.dataset.top || "0", 10);
|
|
826
|
+
e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${i}px, ${m}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
815
827
|
e.style.transition = "", a();
|
|
816
828
|
});
|
|
817
829
|
} else
|
|
818
|
-
|
|
830
|
+
te(e, a);
|
|
819
831
|
}
|
|
820
|
-
function
|
|
821
|
-
if (
|
|
832
|
+
function vt(e) {
|
|
833
|
+
if (G.value) {
|
|
822
834
|
const a = parseInt(e.dataset.left || "0", 10), i = parseInt(e.dataset.top || "0", 10);
|
|
823
835
|
e.style.transition = "none", e.style.opacity = "1", e.style.transform = `translate3d(${a}px, ${i}px, 0) scale(1)`, e.style.removeProperty("--masonry-opacity-delay");
|
|
824
836
|
} else
|
|
825
|
-
|
|
837
|
+
ot(e);
|
|
826
838
|
}
|
|
827
|
-
function
|
|
828
|
-
|
|
839
|
+
function ct(e) {
|
|
840
|
+
G.value || it(e);
|
|
829
841
|
}
|
|
830
|
-
function
|
|
831
|
-
|
|
842
|
+
function ft(e, a) {
|
|
843
|
+
G.value ? a() : st(e, a);
|
|
832
844
|
}
|
|
833
|
-
const
|
|
834
|
-
const e =
|
|
835
|
-
return !i || i.length === 0 ? [] : i.filter((
|
|
836
|
-
const u =
|
|
837
|
-
return
|
|
845
|
+
const dt = Z(() => {
|
|
846
|
+
const e = k.value - K, a = k.value + z.value + K, i = o.value;
|
|
847
|
+
return !i || i.length === 0 ? [] : i.filter((m) => {
|
|
848
|
+
const u = m.top;
|
|
849
|
+
return m.top + m.columnHeight >= e && u <= a;
|
|
838
850
|
});
|
|
839
|
-
}), { handleScroll:
|
|
851
|
+
}), { handleScroll: mt } = na({
|
|
840
852
|
container: y,
|
|
841
|
-
masonry:
|
|
842
|
-
columns:
|
|
843
|
-
containerHeight:
|
|
844
|
-
isLoading:
|
|
845
|
-
pageSize:
|
|
846
|
-
refreshLayout:
|
|
853
|
+
masonry: o,
|
|
854
|
+
columns: $,
|
|
855
|
+
containerHeight: B,
|
|
856
|
+
isLoading: h,
|
|
857
|
+
pageSize: r.pageSize,
|
|
858
|
+
refreshLayout: ae,
|
|
847
859
|
setItemsRaw: (e) => {
|
|
848
|
-
|
|
860
|
+
o.value = e;
|
|
849
861
|
},
|
|
850
|
-
loadNext:
|
|
851
|
-
loadThresholdPx:
|
|
862
|
+
loadNext: ve,
|
|
863
|
+
loadThresholdPx: r.loadThresholdPx
|
|
852
864
|
});
|
|
853
|
-
function
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
})) :
|
|
865
|
+
function ht(e) {
|
|
866
|
+
E.value = e, e ? (e.width !== void 0 && (s.value = e.width), e.height !== void 0 && (b.value = e.height), !d.value && y.value && o.value.length > 0 && J(() => {
|
|
867
|
+
$.value = fe(p.value, s.value), ae(o.value), ee();
|
|
868
|
+
})) : l.value && (s.value = l.value.clientWidth, b.value = l.value.clientHeight);
|
|
857
869
|
}
|
|
858
|
-
|
|
859
|
-
isLoading:
|
|
860
|
-
refreshLayout:
|
|
870
|
+
v({
|
|
871
|
+
isLoading: h,
|
|
872
|
+
refreshLayout: ae,
|
|
861
873
|
// Container dimensions (wrapper element)
|
|
862
874
|
containerWidth: s,
|
|
863
|
-
containerHeight:
|
|
875
|
+
containerHeight: b,
|
|
864
876
|
// Masonry content height (for backward compatibility, old containerHeight)
|
|
865
|
-
contentHeight:
|
|
877
|
+
contentHeight: B,
|
|
866
878
|
// Current page
|
|
867
|
-
currentPage:
|
|
879
|
+
currentPage: H,
|
|
880
|
+
// End of list tracking
|
|
881
|
+
hasReachedEnd: w,
|
|
882
|
+
// Load error tracking
|
|
883
|
+
loadError: M,
|
|
868
884
|
// Set fixed dimensions (overrides ResizeObserver)
|
|
869
|
-
setFixedDimensions:
|
|
885
|
+
setFixedDimensions: ht,
|
|
870
886
|
remove: de,
|
|
871
|
-
removeMany:
|
|
872
|
-
removeAll:
|
|
873
|
-
loadNext:
|
|
874
|
-
loadPage:
|
|
875
|
-
refreshCurrentPage:
|
|
876
|
-
reset:
|
|
877
|
-
|
|
887
|
+
removeMany: pt,
|
|
888
|
+
removeAll: yt,
|
|
889
|
+
loadNext: ve,
|
|
890
|
+
loadPage: Ee,
|
|
891
|
+
refreshCurrentPage: Te,
|
|
892
|
+
reset: bt,
|
|
893
|
+
destroy: xt,
|
|
894
|
+
init: Mt,
|
|
878
895
|
paginationHistory: x,
|
|
879
|
-
cancelLoad:
|
|
880
|
-
scrollToTop:
|
|
881
|
-
totalItems:
|
|
882
|
-
currentBreakpoint:
|
|
896
|
+
cancelLoad: Le,
|
|
897
|
+
scrollToTop: Be,
|
|
898
|
+
totalItems: Z(() => o.value.length),
|
|
899
|
+
currentBreakpoint: j
|
|
883
900
|
});
|
|
884
|
-
function
|
|
885
|
-
const a =
|
|
901
|
+
function De(e) {
|
|
902
|
+
const a = Zt(e);
|
|
886
903
|
let i = 0;
|
|
887
904
|
if (y.value) {
|
|
888
|
-
const { scrollTop:
|
|
889
|
-
i =
|
|
905
|
+
const { scrollTop: m, clientHeight: u } = y.value;
|
|
906
|
+
i = m + u + 100;
|
|
890
907
|
}
|
|
891
|
-
|
|
908
|
+
B.value = Math.max(a, i);
|
|
892
909
|
}
|
|
893
|
-
function
|
|
894
|
-
if (
|
|
895
|
-
|
|
910
|
+
function ae(e) {
|
|
911
|
+
if (d.value) {
|
|
912
|
+
o.value = e;
|
|
896
913
|
return;
|
|
897
914
|
}
|
|
898
915
|
if (!y.value) return;
|
|
899
|
-
|
|
900
|
-
const a = e.map((
|
|
901
|
-
...
|
|
902
|
-
originalIndex:
|
|
916
|
+
ie(e, "refreshLayout");
|
|
917
|
+
const a = e.map((m, u) => ({
|
|
918
|
+
...m,
|
|
919
|
+
originalIndex: m.originalIndex ?? u
|
|
903
920
|
})), i = y.value;
|
|
904
|
-
if (
|
|
905
|
-
const
|
|
906
|
-
i.style.boxSizing = "border-box", i.style.width = `${
|
|
907
|
-
const
|
|
908
|
-
i.style.width =
|
|
921
|
+
if (E.value && E.value.width !== void 0) {
|
|
922
|
+
const m = i.style.width, u = i.style.boxSizing;
|
|
923
|
+
i.style.boxSizing = "border-box", i.style.width = `${E.value.width}px`, i.offsetWidth;
|
|
924
|
+
const Y = Xe(a, i, $.value, p.value);
|
|
925
|
+
i.style.width = m, i.style.boxSizing = u, De(Y), o.value = Y;
|
|
909
926
|
} else {
|
|
910
|
-
const
|
|
911
|
-
|
|
927
|
+
const m = Xe(a, i, $.value, p.value);
|
|
928
|
+
De(m), o.value = m;
|
|
912
929
|
}
|
|
913
930
|
}
|
|
914
|
-
function
|
|
931
|
+
function Fe(e, a) {
|
|
915
932
|
return new Promise((i) => {
|
|
916
|
-
const
|
|
917
|
-
a(
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
clearInterval(
|
|
933
|
+
const m = Math.max(0, e | 0), u = Date.now();
|
|
934
|
+
a(m, m);
|
|
935
|
+
const Y = setInterval(() => {
|
|
936
|
+
if (V.value) {
|
|
937
|
+
clearInterval(Y), i();
|
|
921
938
|
return;
|
|
922
939
|
}
|
|
923
|
-
const
|
|
924
|
-
a(
|
|
940
|
+
const _ = Date.now() - u, ce = Math.max(0, m - _);
|
|
941
|
+
a(ce, m), ce <= 0 && (clearInterval(Y), i());
|
|
925
942
|
}, 100);
|
|
926
943
|
});
|
|
927
944
|
}
|
|
928
|
-
async function
|
|
945
|
+
async function be(e) {
|
|
929
946
|
try {
|
|
930
|
-
const a = await
|
|
931
|
-
return
|
|
947
|
+
const a = await gt(() => r.getNextPage(e));
|
|
948
|
+
return ae([...o.value, ...a.items]), a;
|
|
932
949
|
} catch (a) {
|
|
933
950
|
throw console.error("Error in getContent:", a), a;
|
|
934
951
|
}
|
|
935
952
|
}
|
|
936
|
-
async function
|
|
953
|
+
async function gt(e) {
|
|
937
954
|
let a = 0;
|
|
938
|
-
const i =
|
|
939
|
-
let
|
|
955
|
+
const i = r.retryMaxAttempts;
|
|
956
|
+
let m = r.retryInitialDelayMs;
|
|
940
957
|
for (; ; )
|
|
941
958
|
try {
|
|
942
959
|
const u = await e();
|
|
943
|
-
return a > 0 &&
|
|
960
|
+
return a > 0 && g("retry:stop", { attempt: a, success: !0 }), u;
|
|
944
961
|
} catch (u) {
|
|
945
962
|
if (a++, a > i)
|
|
946
|
-
throw
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}),
|
|
963
|
+
throw g("retry:stop", { attempt: a - 1, success: !1 }), u;
|
|
964
|
+
g("retry:start", { attempt: a, max: i, totalMs: m }), await Fe(m, (Y, _) => {
|
|
965
|
+
g("retry:tick", { attempt: a, remainingMs: Y, totalMs: _ });
|
|
966
|
+
}), m += r.retryBackoffStepMs;
|
|
950
967
|
}
|
|
951
968
|
}
|
|
952
|
-
async function
|
|
953
|
-
if (!
|
|
954
|
-
|
|
969
|
+
async function Ee(e) {
|
|
970
|
+
if (!h.value) {
|
|
971
|
+
V.value = !1, h.value = !0, w.value = !1, M.value = null;
|
|
955
972
|
try {
|
|
956
|
-
const a =
|
|
957
|
-
if (
|
|
958
|
-
const i = await
|
|
959
|
-
return
|
|
973
|
+
const a = o.value.length;
|
|
974
|
+
if (V.value) return;
|
|
975
|
+
const i = await be(e);
|
|
976
|
+
return V.value ? void 0 : (M.value = null, H.value = e, x.value.push(i.nextPage), i.nextPage == null && (w.value = !0), await he(a), i);
|
|
960
977
|
} catch (a) {
|
|
961
|
-
throw console.error("Error loading page:", a), a;
|
|
978
|
+
throw console.error("Error loading page:", a), M.value = a instanceof Error ? a : new Error(String(a)), a;
|
|
962
979
|
} finally {
|
|
963
|
-
|
|
980
|
+
h.value = !1;
|
|
964
981
|
}
|
|
965
982
|
}
|
|
966
983
|
}
|
|
967
|
-
async function
|
|
968
|
-
if (!
|
|
969
|
-
|
|
984
|
+
async function ve() {
|
|
985
|
+
if (!h.value && !w.value) {
|
|
986
|
+
V.value = !1, h.value = !0, M.value = null;
|
|
970
987
|
try {
|
|
971
|
-
const e =
|
|
972
|
-
if (
|
|
973
|
-
const a = x.value[x.value.length - 1]
|
|
974
|
-
|
|
988
|
+
const e = o.value.length;
|
|
989
|
+
if (V.value) return;
|
|
990
|
+
const a = x.value[x.value.length - 1];
|
|
991
|
+
if (a == null) {
|
|
992
|
+
w.value = !0, h.value = !1;
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
const i = await be(a);
|
|
996
|
+
return V.value ? void 0 : (M.value = null, H.value = a, x.value.push(i.nextPage), i.nextPage == null && (w.value = !0), await he(e), i);
|
|
975
997
|
} catch (e) {
|
|
976
|
-
throw console.error("Error loading next page:", e), e;
|
|
998
|
+
throw console.error("Error loading next page:", e), M.value = e instanceof Error ? e : new Error(String(e)), e;
|
|
977
999
|
} finally {
|
|
978
|
-
|
|
1000
|
+
h.value = !1;
|
|
979
1001
|
}
|
|
980
1002
|
}
|
|
981
1003
|
}
|
|
982
|
-
async function
|
|
983
|
-
if (!
|
|
984
|
-
|
|
1004
|
+
async function Te() {
|
|
1005
|
+
if (!h.value) {
|
|
1006
|
+
V.value = !1, h.value = !0;
|
|
985
1007
|
try {
|
|
986
|
-
const e =
|
|
1008
|
+
const e = H.value;
|
|
987
1009
|
if (e == null) {
|
|
988
|
-
console.warn("[Masonry] No current page to refresh - currentPage:",
|
|
1010
|
+
console.warn("[Masonry] No current page to refresh - currentPage:", H.value, "paginationHistory:", x.value);
|
|
989
1011
|
return;
|
|
990
1012
|
}
|
|
991
|
-
|
|
992
|
-
const a = await
|
|
993
|
-
if (
|
|
994
|
-
|
|
995
|
-
const i =
|
|
996
|
-
return await
|
|
1013
|
+
o.value = [], B.value = 0, w.value = !1, M.value = null, x.value = [e], await J();
|
|
1014
|
+
const a = await be(e);
|
|
1015
|
+
if (V.value) return;
|
|
1016
|
+
M.value = null, H.value = e, x.value.push(a.nextPage), a.nextPage == null && (w.value = !0);
|
|
1017
|
+
const i = o.value.length;
|
|
1018
|
+
return await he(i), a;
|
|
997
1019
|
} catch (e) {
|
|
998
|
-
throw console.error("[Masonry] Error refreshing current page:", e), e;
|
|
1020
|
+
throw console.error("[Masonry] Error refreshing current page:", e), M.value = e instanceof Error ? e : new Error(String(e)), e;
|
|
999
1021
|
} finally {
|
|
1000
|
-
|
|
1022
|
+
h.value = !1;
|
|
1001
1023
|
}
|
|
1002
1024
|
}
|
|
1003
1025
|
}
|
|
1004
1026
|
async function de(e) {
|
|
1005
|
-
const a =
|
|
1006
|
-
if (
|
|
1007
|
-
if (
|
|
1008
|
-
await
|
|
1027
|
+
const a = o.value.filter((i) => i.id !== e.id);
|
|
1028
|
+
if (o.value = a, await J(), a.length === 0 && x.value.length > 0) {
|
|
1029
|
+
if (r.autoRefreshOnEmpty)
|
|
1030
|
+
await Te();
|
|
1009
1031
|
else
|
|
1010
1032
|
try {
|
|
1011
|
-
await
|
|
1033
|
+
await ve(), await he(0, !0);
|
|
1012
1034
|
} catch {
|
|
1013
1035
|
}
|
|
1014
1036
|
return;
|
|
1015
1037
|
}
|
|
1016
1038
|
await new Promise((i) => requestAnimationFrame(() => i())), requestAnimationFrame(() => {
|
|
1017
|
-
|
|
1039
|
+
ae(a);
|
|
1018
1040
|
});
|
|
1019
1041
|
}
|
|
1020
|
-
async function
|
|
1042
|
+
async function pt(e) {
|
|
1021
1043
|
if (!e || e.length === 0) return;
|
|
1022
|
-
const a = new Set(e.map((
|
|
1023
|
-
if (
|
|
1024
|
-
if (
|
|
1025
|
-
await
|
|
1044
|
+
const a = new Set(e.map((m) => m.id)), i = o.value.filter((m) => !a.has(m.id));
|
|
1045
|
+
if (o.value = i, await J(), i.length === 0 && x.value.length > 0) {
|
|
1046
|
+
if (r.autoRefreshOnEmpty)
|
|
1047
|
+
await Te();
|
|
1026
1048
|
else
|
|
1027
1049
|
try {
|
|
1028
|
-
await
|
|
1050
|
+
await ve(), await he(0, !0);
|
|
1029
1051
|
} catch {
|
|
1030
1052
|
}
|
|
1031
1053
|
return;
|
|
1032
1054
|
}
|
|
1033
|
-
await new Promise((
|
|
1034
|
-
|
|
1055
|
+
await new Promise((m) => requestAnimationFrame(() => m())), requestAnimationFrame(() => {
|
|
1056
|
+
ae(i);
|
|
1035
1057
|
});
|
|
1036
1058
|
}
|
|
1037
|
-
function
|
|
1059
|
+
function Be(e) {
|
|
1038
1060
|
y.value && y.value.scrollTo({
|
|
1039
1061
|
top: 0,
|
|
1040
1062
|
behavior: (e == null ? void 0 : e.behavior) ?? "smooth",
|
|
1041
1063
|
...e
|
|
1042
1064
|
});
|
|
1043
1065
|
}
|
|
1044
|
-
async function
|
|
1045
|
-
|
|
1066
|
+
async function yt() {
|
|
1067
|
+
Be({ behavior: "smooth" }), o.value = [], b.value = 0, await J(), g("remove-all:complete");
|
|
1046
1068
|
}
|
|
1047
|
-
function
|
|
1048
|
-
|
|
1069
|
+
function wt() {
|
|
1070
|
+
$.value = fe(p.value, s.value), ae(o.value), y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight);
|
|
1049
1071
|
}
|
|
1050
|
-
let
|
|
1051
|
-
const
|
|
1052
|
-
async function
|
|
1053
|
-
if (!a && !
|
|
1054
|
-
const i = (e || 0) + (
|
|
1055
|
-
if (!
|
|
1056
|
-
|
|
1072
|
+
let me = !1;
|
|
1073
|
+
const V = T(!1);
|
|
1074
|
+
async function he(e, a = !1) {
|
|
1075
|
+
if (!a && !r.backfillEnabled || me || V.value || w.value) return;
|
|
1076
|
+
const i = (e || 0) + (r.pageSize || 0);
|
|
1077
|
+
if (!r.pageSize || r.pageSize <= 0) return;
|
|
1078
|
+
if (x.value[x.value.length - 1] == null) {
|
|
1079
|
+
w.value = !0;
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
if (!(o.value.length >= i)) {
|
|
1083
|
+
me = !0;
|
|
1057
1084
|
try {
|
|
1058
1085
|
let u = 0;
|
|
1059
|
-
for (
|
|
1060
|
-
|
|
1061
|
-
fetched:
|
|
1086
|
+
for (g("backfill:start", { target: i, fetched: o.value.length, calls: u }); o.value.length < i && u < r.backfillMaxCalls && x.value[x.value.length - 1] != null && !V.value && !w.value && (await Fe(r.backfillDelayMs, (_, ce) => {
|
|
1087
|
+
g("backfill:tick", {
|
|
1088
|
+
fetched: o.value.length,
|
|
1062
1089
|
target: i,
|
|
1063
1090
|
calls: u,
|
|
1064
|
-
remainingMs:
|
|
1065
|
-
totalMs:
|
|
1091
|
+
remainingMs: _,
|
|
1092
|
+
totalMs: ce
|
|
1066
1093
|
});
|
|
1067
|
-
}), !
|
|
1068
|
-
const
|
|
1094
|
+
}), !V.value); ) {
|
|
1095
|
+
const Y = x.value[x.value.length - 1];
|
|
1096
|
+
if (Y == null) {
|
|
1097
|
+
w.value = !0;
|
|
1098
|
+
break;
|
|
1099
|
+
}
|
|
1069
1100
|
try {
|
|
1070
|
-
|
|
1071
|
-
const
|
|
1072
|
-
if (
|
|
1073
|
-
x.value.push(
|
|
1101
|
+
h.value = !0;
|
|
1102
|
+
const _ = await be(Y);
|
|
1103
|
+
if (V.value) break;
|
|
1104
|
+
M.value = null, x.value.push(_.nextPage), _.nextPage == null && (w.value = !0);
|
|
1105
|
+
} catch (_) {
|
|
1106
|
+
M.value = _ instanceof Error ? _ : new Error(String(_));
|
|
1074
1107
|
} finally {
|
|
1075
|
-
|
|
1108
|
+
h.value = !1;
|
|
1076
1109
|
}
|
|
1077
1110
|
u++;
|
|
1078
1111
|
}
|
|
1079
|
-
|
|
1112
|
+
g("backfill:stop", { fetched: o.value.length, calls: u });
|
|
1080
1113
|
} finally {
|
|
1081
|
-
|
|
1114
|
+
me = !1;
|
|
1082
1115
|
}
|
|
1083
1116
|
}
|
|
1084
1117
|
}
|
|
1085
|
-
function
|
|
1086
|
-
|
|
1118
|
+
function Le() {
|
|
1119
|
+
V.value = !0, h.value = !1, me = !1;
|
|
1087
1120
|
}
|
|
1088
|
-
function
|
|
1089
|
-
|
|
1121
|
+
function bt() {
|
|
1122
|
+
Le(), V.value = !1, y.value && y.value.scrollTo({
|
|
1090
1123
|
top: 0,
|
|
1091
1124
|
behavior: "smooth"
|
|
1092
|
-
}),
|
|
1125
|
+
}), o.value = [], b.value = 0, H.value = r.loadAtPage, x.value = [r.loadAtPage], w.value = !1, M.value = null, X.value = {
|
|
1093
1126
|
distanceToTrigger: 0,
|
|
1094
1127
|
isNearTrigger: !1
|
|
1095
1128
|
};
|
|
1096
1129
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1130
|
+
function xt() {
|
|
1131
|
+
Le(), o.value = [], B.value = 0, H.value = null, x.value = [], w.value = !1, M.value = null, h.value = !1, me = !1, V.value = !1, n.value = 0, f.value = 0, P.value = !1, k.value = 0, z.value = 0, G.value = !1, X.value = {
|
|
1132
|
+
distanceToTrigger: 0,
|
|
1133
|
+
isNearTrigger: !1
|
|
1134
|
+
}, N.value.clear(), y.value && y.value.scrollTo({
|
|
1135
|
+
top: 0,
|
|
1136
|
+
behavior: "auto"
|
|
1137
|
+
// Instant scroll for destroy
|
|
1138
|
+
});
|
|
1105
1139
|
}
|
|
1140
|
+
const se = Ze(async () => {
|
|
1141
|
+
if (d.value) return;
|
|
1142
|
+
y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight), G.value = !0, await J(), await new Promise((a) => requestAnimationFrame(() => a())), G.value = !1;
|
|
1143
|
+
const e = We(o.value, $.value);
|
|
1144
|
+
mt(e), ee(e);
|
|
1145
|
+
}, 200), ze = Ze(wt, 200);
|
|
1106
1146
|
function Ae(e) {
|
|
1107
|
-
|
|
1108
|
-
const a = e.touches[0].clientY - w.value;
|
|
1109
|
-
S.value = F.value + a, e.preventDefault();
|
|
1147
|
+
d.value && (P.value = !0, A.value = e.touches[0].clientY, U.value = f.value, e.preventDefault());
|
|
1110
1148
|
}
|
|
1111
1149
|
function Oe(e) {
|
|
1112
|
-
if (!
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
Math.abs(a) > 100 ? a > 0 && O.value ? Ce() : a < 0 && A.value ? je() : ne() : ne(), e.preventDefault();
|
|
1150
|
+
if (!d.value || !P.value) return;
|
|
1151
|
+
const a = e.touches[0].clientY - A.value;
|
|
1152
|
+
f.value = U.value + a, e.preventDefault();
|
|
1116
1153
|
}
|
|
1117
1154
|
function Re(e) {
|
|
1118
|
-
|
|
1155
|
+
if (!d.value || !P.value) return;
|
|
1156
|
+
P.value = !1;
|
|
1157
|
+
const a = f.value - U.value;
|
|
1158
|
+
Math.abs(a) > 100 ? a > 0 && q.value ? Ye() : a < 0 && R.value ? Ce() : le() : le(), e.preventDefault();
|
|
1119
1159
|
}
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1160
|
+
function je(e) {
|
|
1161
|
+
d.value && (P.value = !0, A.value = e.clientY, U.value = f.value, e.preventDefault());
|
|
1162
|
+
}
|
|
1163
|
+
function ke(e) {
|
|
1164
|
+
if (!d.value || !P.value) return;
|
|
1165
|
+
const a = e.clientY - A.value;
|
|
1166
|
+
f.value = U.value + a, e.preventDefault();
|
|
1124
1167
|
}
|
|
1125
1168
|
function Ie(e) {
|
|
1126
|
-
if (!
|
|
1127
|
-
|
|
1128
|
-
const a =
|
|
1129
|
-
Math.abs(a) > 100 ? a > 0 &&
|
|
1169
|
+
if (!d.value || !P.value) return;
|
|
1170
|
+
P.value = !1;
|
|
1171
|
+
const a = f.value - U.value;
|
|
1172
|
+
Math.abs(a) > 100 ? a > 0 && q.value ? Ye() : a < 0 && R.value ? Ce() : le() : le(), e.preventDefault();
|
|
1130
1173
|
}
|
|
1131
|
-
function
|
|
1132
|
-
if (!
|
|
1133
|
-
|
|
1174
|
+
function Ce() {
|
|
1175
|
+
if (!R.value) {
|
|
1176
|
+
ve();
|
|
1134
1177
|
return;
|
|
1135
1178
|
}
|
|
1136
|
-
|
|
1179
|
+
n.value++, le(), n.value >= o.value.length - 5 && ve();
|
|
1137
1180
|
}
|
|
1138
|
-
function
|
|
1139
|
-
|
|
1181
|
+
function Ye() {
|
|
1182
|
+
q.value && (n.value--, le());
|
|
1140
1183
|
}
|
|
1141
|
-
function
|
|
1142
|
-
if (
|
|
1143
|
-
const e =
|
|
1144
|
-
|
|
1184
|
+
function le() {
|
|
1185
|
+
if (!C.value) return;
|
|
1186
|
+
const e = C.value.clientHeight;
|
|
1187
|
+
f.value = -n.value * e;
|
|
1145
1188
|
}
|
|
1146
1189
|
function qe() {
|
|
1147
|
-
!
|
|
1190
|
+
!d.value && n.value > 0 && (n.value = 0, f.value = 0), d.value && o.value.length === 0 && !h.value && Ee(x.value[0]), d.value && le();
|
|
1148
1191
|
}
|
|
1149
|
-
function
|
|
1150
|
-
|
|
1192
|
+
function Mt(e, a, i) {
|
|
1193
|
+
H.value = a, x.value = [a], x.value.push(i), w.value = i == null, ie(e, "init"), d.value ? (o.value = [...o.value, ...e], n.value === 0 && o.value.length > 0 && (f.value = 0)) : (ae([...o.value, ...e]), ee());
|
|
1151
1194
|
}
|
|
1152
|
-
return
|
|
1153
|
-
|
|
1195
|
+
return re(
|
|
1196
|
+
p,
|
|
1154
1197
|
() => {
|
|
1155
|
-
|
|
1198
|
+
d.value || y.value && ($.value = fe(p.value, s.value), ae(o.value));
|
|
1156
1199
|
},
|
|
1157
1200
|
{ deep: !0 }
|
|
1158
|
-
),
|
|
1159
|
-
|
|
1160
|
-
}),
|
|
1161
|
-
e && !
|
|
1162
|
-
}, { immediate: !0 }),
|
|
1163
|
-
a === void 0 && e === !1 ||
|
|
1164
|
-
e ? (document.addEventListener("mousemove",
|
|
1201
|
+
), re(() => r.layoutMode, () => {
|
|
1202
|
+
E.value && E.value.width !== void 0 ? s.value = E.value.width : l.value && (s.value = l.value.clientWidth);
|
|
1203
|
+
}), re(y, (e) => {
|
|
1204
|
+
e && !d.value ? (e.removeEventListener("scroll", se), e.addEventListener("scroll", se, { passive: !0 })) : e && e.removeEventListener("scroll", se);
|
|
1205
|
+
}, { immediate: !0 }), re(d, (e, a) => {
|
|
1206
|
+
a === void 0 && e === !1 || J(() => {
|
|
1207
|
+
e ? (document.addEventListener("mousemove", ke), document.addEventListener("mouseup", Ie), y.value && y.value.removeEventListener("scroll", se), n.value = 0, f.value = 0, o.value.length > 0 && le()) : (document.removeEventListener("mousemove", ke), document.removeEventListener("mouseup", Ie), y.value && l.value && (E.value && E.value.width !== void 0 ? s.value = E.value.width : s.value = l.value.clientWidth, y.value.removeEventListener("scroll", se), y.value.addEventListener("scroll", se, { passive: !0 }), o.value.length > 0 && ($.value = fe(p.value, s.value), ae(o.value), k.value = y.value.scrollTop, z.value = y.value.clientHeight, ee())));
|
|
1165
1208
|
});
|
|
1166
|
-
}, { immediate: !0 }),
|
|
1167
|
-
e && (e.addEventListener("touchstart",
|
|
1168
|
-
}),
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1171
|
-
|
|
1172
|
-
if (!
|
|
1209
|
+
}, { immediate: !0 }), re(C, (e) => {
|
|
1210
|
+
e && (e.addEventListener("touchstart", Ae, { passive: !1 }), e.addEventListener("touchmove", Oe, { passive: !1 }), e.addEventListener("touchend", Re), e.addEventListener("mousedown", je));
|
|
1211
|
+
}), re(() => o.value.length, (e, a) => {
|
|
1212
|
+
d.value && e > 0 && a === 0 && (n.value = 0, J(() => le()));
|
|
1213
|
+
}), re(l, (e) => {
|
|
1214
|
+
S && (S.disconnect(), S = null), e && typeof ResizeObserver < "u" ? (S = new ResizeObserver((a) => {
|
|
1215
|
+
if (!E.value)
|
|
1173
1216
|
for (const i of a) {
|
|
1174
|
-
const
|
|
1175
|
-
s.value !==
|
|
1217
|
+
const m = i.contentRect.width, u = i.contentRect.height;
|
|
1218
|
+
s.value !== m && (s.value = m), b.value !== u && (b.value = u);
|
|
1176
1219
|
}
|
|
1177
|
-
}),
|
|
1178
|
-
}, { immediate: !0 }),
|
|
1179
|
-
e !== a && e > 0 && !
|
|
1180
|
-
|
|
1220
|
+
}), S.observe(e), E.value || (s.value = e.clientWidth, b.value = e.clientHeight)) : e && (E.value || (s.value = e.clientWidth, b.value = e.clientHeight));
|
|
1221
|
+
}, { immediate: !0 }), re(s, (e, a) => {
|
|
1222
|
+
e !== a && e > 0 && !d.value && y.value && o.value.length > 0 && J(() => {
|
|
1223
|
+
$.value = fe(p.value, e), ae(o.value), ee();
|
|
1181
1224
|
});
|
|
1182
|
-
}),
|
|
1225
|
+
}), at(async () => {
|
|
1183
1226
|
try {
|
|
1184
|
-
await
|
|
1185
|
-
const e =
|
|
1186
|
-
x.value = [e],
|
|
1227
|
+
await J(), l.value && !S && (s.value = l.value.clientWidth, b.value = l.value.clientHeight), d.value || ($.value = fe(p.value, s.value), y.value && (k.value = y.value.scrollTop, z.value = y.value.clientHeight));
|
|
1228
|
+
const e = r.loadAtPage;
|
|
1229
|
+
x.value = [e], r.skipInitialLoad || await Ee(x.value[0]), d.value ? J(() => le()) : ee();
|
|
1187
1230
|
} catch (e) {
|
|
1188
|
-
console.error("Error during component initialization:", e),
|
|
1231
|
+
console.error("Error during component initialization:", e), h.value = !1;
|
|
1189
1232
|
}
|
|
1190
1233
|
window.addEventListener("resize", ze), window.addEventListener("resize", qe);
|
|
1191
|
-
}),
|
|
1234
|
+
}), nt(() => {
|
|
1192
1235
|
var e;
|
|
1193
|
-
|
|
1194
|
-
}), (e, a) => (
|
|
1236
|
+
S && (S.disconnect(), S = null), (e = y.value) == null || e.removeEventListener("scroll", se), window.removeEventListener("resize", ze), window.removeEventListener("resize", qe), C.value && (C.value.removeEventListener("touchstart", Ae), C.value.removeEventListener("touchmove", Oe), C.value.removeEventListener("touchend", Re), C.value.removeEventListener("mousedown", je)), document.removeEventListener("mousemove", ke), document.removeEventListener("mouseup", Ie);
|
|
1237
|
+
}), (e, a) => (F(), D("div", {
|
|
1195
1238
|
ref_key: "wrapper",
|
|
1196
|
-
ref:
|
|
1239
|
+
ref: l,
|
|
1197
1240
|
class: "w-full h-full flex flex-col relative"
|
|
1198
1241
|
}, [
|
|
1199
|
-
|
|
1242
|
+
d.value ? (F(), D("div", {
|
|
1200
1243
|
key: 0,
|
|
1201
|
-
class:
|
|
1244
|
+
class: ue(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": r.forceMotion, "cursor-grab": !P.value, "cursor-grabbing": P.value }]),
|
|
1202
1245
|
ref_key: "swipeContainer",
|
|
1203
|
-
ref:
|
|
1246
|
+
ref: C,
|
|
1204
1247
|
style: { height: "100%", "max-height": "100%", position: "relative" }
|
|
1205
1248
|
}, [
|
|
1206
|
-
|
|
1249
|
+
O("div", {
|
|
1207
1250
|
class: "relative w-full",
|
|
1208
|
-
style:
|
|
1209
|
-
transform: `translateY(${
|
|
1210
|
-
transition:
|
|
1211
|
-
height: `${
|
|
1251
|
+
style: we({
|
|
1252
|
+
transform: `translateY(${f.value}px)`,
|
|
1253
|
+
transition: P.value ? "none" : `transform ${t.transitionDurationMs}ms ${t.transitionEasing}`,
|
|
1254
|
+
height: `${o.value.length * 100}%`
|
|
1212
1255
|
})
|
|
1213
1256
|
}, [
|
|
1214
|
-
(
|
|
1257
|
+
(F(!0), D(Ue, null, Ge(o.value, (i, m) => (F(), D("div", {
|
|
1215
1258
|
key: `${i.page}-${i.id}`,
|
|
1216
1259
|
class: "absolute top-0 left-0 w-full",
|
|
1217
|
-
style:
|
|
1218
|
-
top: `${
|
|
1219
|
-
height: `${100 /
|
|
1260
|
+
style: we({
|
|
1261
|
+
top: `${m * (100 / o.value.length)}%`,
|
|
1262
|
+
height: `${100 / o.value.length}%`
|
|
1220
1263
|
})
|
|
1221
1264
|
}, [
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1265
|
+
O("div", da, [
|
|
1266
|
+
O("div", ma, [
|
|
1267
|
+
Q(e.$slots, "default", {
|
|
1225
1268
|
item: i,
|
|
1226
1269
|
remove: de
|
|
1227
1270
|
}, () => [
|
|
1228
|
-
|
|
1271
|
+
$e(Me, {
|
|
1229
1272
|
item: i,
|
|
1230
1273
|
remove: de,
|
|
1231
|
-
"header-height":
|
|
1232
|
-
"footer-height":
|
|
1274
|
+
"header-height": p.value.header,
|
|
1275
|
+
"footer-height": p.value.footer,
|
|
1233
1276
|
"in-swipe-mode": !0,
|
|
1234
|
-
"is-active":
|
|
1235
|
-
"onPreload:success": a[0] || (a[0] = (u) =>
|
|
1236
|
-
"onPreload:error": a[1] || (a[1] = (u) =>
|
|
1237
|
-
onMouseEnter: a[2] || (a[2] = (u) =>
|
|
1238
|
-
onMouseLeave: a[3] || (a[3] = (u) =>
|
|
1277
|
+
"is-active": m === n.value,
|
|
1278
|
+
"onPreload:success": a[0] || (a[0] = (u) => g("item:preload:success", u)),
|
|
1279
|
+
"onPreload:error": a[1] || (a[1] = (u) => g("item:preload:error", u)),
|
|
1280
|
+
onMouseEnter: a[2] || (a[2] = (u) => g("item:mouse-enter", u)),
|
|
1281
|
+
onMouseLeave: a[3] || (a[3] = (u) => g("item:mouse-leave", u))
|
|
1239
1282
|
}, {
|
|
1240
|
-
header:
|
|
1241
|
-
|
|
1283
|
+
header: ge((u) => [
|
|
1284
|
+
Q(e.$slots, "item-header", pe({ ref_for: !0 }, u), void 0, !0)
|
|
1242
1285
|
]),
|
|
1243
|
-
footer:
|
|
1244
|
-
|
|
1286
|
+
footer: ge((u) => [
|
|
1287
|
+
Q(e.$slots, "item-footer", pe({ ref_for: !0 }, u), void 0, !0)
|
|
1245
1288
|
]),
|
|
1246
1289
|
_: 2
|
|
1247
1290
|
}, 1032, ["item", "header-height", "footer-height", "is-active"])
|
|
@@ -1249,52 +1292,62 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
1249
1292
|
])
|
|
1250
1293
|
])
|
|
1251
1294
|
], 4))), 128))
|
|
1252
|
-
], 4)
|
|
1253
|
-
|
|
1295
|
+
], 4),
|
|
1296
|
+
w.value && o.value.length > 0 ? (F(), D("div", ha, [
|
|
1297
|
+
Q(e.$slots, "end-message", {}, () => [
|
|
1298
|
+
a[8] || (a[8] = O("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1299
|
+
], !0)
|
|
1300
|
+
])) : ne("", !0),
|
|
1301
|
+
M.value && o.value.length > 0 ? (F(), D("div", ga, [
|
|
1302
|
+
Q(e.$slots, "error-message", { error: M.value }, () => [
|
|
1303
|
+
O("p", pa, "Failed to load content: " + He(M.value.message), 1)
|
|
1304
|
+
], !0)
|
|
1305
|
+
])) : ne("", !0)
|
|
1306
|
+
], 2)) : (F(), D("div", {
|
|
1254
1307
|
key: 1,
|
|
1255
|
-
class:
|
|
1308
|
+
class: ue(["overflow-auto w-full flex-1 masonry-container", { "force-motion": r.forceMotion }]),
|
|
1256
1309
|
ref_key: "container",
|
|
1257
1310
|
ref: y
|
|
1258
1311
|
}, [
|
|
1259
|
-
|
|
1312
|
+
O("div", {
|
|
1260
1313
|
class: "relative",
|
|
1261
|
-
style:
|
|
1314
|
+
style: we({ height: `${B.value}px`, "--masonry-duration": `${t.transitionDurationMs}ms`, "--masonry-leave-duration": `${t.leaveDurationMs}ms`, "--masonry-ease": t.transitionEasing })
|
|
1262
1315
|
}, [
|
|
1263
|
-
|
|
1316
|
+
$e(Tt, {
|
|
1264
1317
|
name: "masonry",
|
|
1265
1318
|
css: !1,
|
|
1266
|
-
onEnter:
|
|
1267
|
-
onBeforeEnter:
|
|
1268
|
-
onLeave:
|
|
1269
|
-
onBeforeLeave:
|
|
1319
|
+
onEnter: ut,
|
|
1320
|
+
onBeforeEnter: vt,
|
|
1321
|
+
onLeave: ft,
|
|
1322
|
+
onBeforeLeave: ct
|
|
1270
1323
|
}, {
|
|
1271
|
-
default:
|
|
1272
|
-
(
|
|
1324
|
+
default: ge(() => [
|
|
1325
|
+
(F(!0), D(Ue, null, Ge(dt.value, (i, m) => (F(), D("div", pe({
|
|
1273
1326
|
key: `${i.page}-${i.id}`,
|
|
1274
1327
|
class: "absolute masonry-item",
|
|
1275
1328
|
ref_for: !0
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1329
|
+
}, Lt(ta)(i, m)), [
|
|
1330
|
+
Q(e.$slots, "default", {
|
|
1278
1331
|
item: i,
|
|
1279
1332
|
remove: de
|
|
1280
1333
|
}, () => [
|
|
1281
|
-
|
|
1334
|
+
$e(Me, {
|
|
1282
1335
|
item: i,
|
|
1283
1336
|
remove: de,
|
|
1284
|
-
"header-height":
|
|
1285
|
-
"footer-height":
|
|
1337
|
+
"header-height": p.value.header,
|
|
1338
|
+
"footer-height": p.value.footer,
|
|
1286
1339
|
"in-swipe-mode": !1,
|
|
1287
1340
|
"is-active": !1,
|
|
1288
|
-
"onPreload:success": a[4] || (a[4] = (u) =>
|
|
1289
|
-
"onPreload:error": a[5] || (a[5] = (u) =>
|
|
1290
|
-
onMouseEnter: a[6] || (a[6] = (u) =>
|
|
1291
|
-
onMouseLeave: a[7] || (a[7] = (u) =>
|
|
1341
|
+
"onPreload:success": a[4] || (a[4] = (u) => g("item:preload:success", u)),
|
|
1342
|
+
"onPreload:error": a[5] || (a[5] = (u) => g("item:preload:error", u)),
|
|
1343
|
+
onMouseEnter: a[6] || (a[6] = (u) => g("item:mouse-enter", u)),
|
|
1344
|
+
onMouseLeave: a[7] || (a[7] = (u) => g("item:mouse-leave", u))
|
|
1292
1345
|
}, {
|
|
1293
|
-
header:
|
|
1294
|
-
|
|
1346
|
+
header: ge((u) => [
|
|
1347
|
+
Q(e.$slots, "item-header", pe({ ref_for: !0 }, u), void 0, !0)
|
|
1295
1348
|
]),
|
|
1296
|
-
footer:
|
|
1297
|
-
|
|
1349
|
+
footer: ge((u) => [
|
|
1350
|
+
Q(e.$slots, "item-footer", pe({ ref_for: !0 }, u), void 0, !0)
|
|
1298
1351
|
]),
|
|
1299
1352
|
_: 2
|
|
1300
1353
|
}, 1032, ["item", "header-height", "footer-height"])
|
|
@@ -1303,22 +1356,32 @@ const ta = { class: "flex-1 relative min-h-0" }, aa = { class: "w-full h-full ro
|
|
|
1303
1356
|
]),
|
|
1304
1357
|
_: 3
|
|
1305
1358
|
})
|
|
1306
|
-
], 4)
|
|
1359
|
+
], 4),
|
|
1360
|
+
w.value && o.value.length > 0 ? (F(), D("div", ya, [
|
|
1361
|
+
Q(e.$slots, "end-message", {}, () => [
|
|
1362
|
+
a[9] || (a[9] = O("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
|
|
1363
|
+
], !0)
|
|
1364
|
+
])) : ne("", !0),
|
|
1365
|
+
M.value && o.value.length > 0 ? (F(), D("div", wa, [
|
|
1366
|
+
Q(e.$slots, "error-message", { error: M.value }, () => [
|
|
1367
|
+
O("p", ba, "Failed to load content: " + He(M.value.message), 1)
|
|
1368
|
+
], !0)
|
|
1369
|
+
])) : ne("", !0)
|
|
1307
1370
|
], 2))
|
|
1308
1371
|
], 512));
|
|
1309
1372
|
}
|
|
1310
|
-
}),
|
|
1311
|
-
const
|
|
1312
|
-
for (const [
|
|
1313
|
-
|
|
1314
|
-
return
|
|
1315
|
-
},
|
|
1373
|
+
}), Ma = (t, v) => {
|
|
1374
|
+
const c = t.__vccOpts || t;
|
|
1375
|
+
for (const [r, L] of v)
|
|
1376
|
+
c[r] = L;
|
|
1377
|
+
return c;
|
|
1378
|
+
}, et = /* @__PURE__ */ Ma(xa, [["__scopeId", "data-v-01598521"]]), Ta = {
|
|
1316
1379
|
install(t) {
|
|
1317
|
-
t.component("WyxosMasonry",
|
|
1380
|
+
t.component("WyxosMasonry", et), t.component("WMasonry", et), t.component("WyxosMasonryItem", Me), t.component("WMasonryItem", Me);
|
|
1318
1381
|
}
|
|
1319
1382
|
};
|
|
1320
1383
|
export {
|
|
1321
|
-
|
|
1384
|
+
et as Masonry,
|
|
1322
1385
|
Me as MasonryItem,
|
|
1323
|
-
|
|
1386
|
+
Ta as default
|
|
1324
1387
|
};
|