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