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