@wyxos/vibe 1.6.7 → 1.6.9
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/README.md +45 -6
- package/lib/index.js +557 -492
- package/package.json +1 -1
- package/src/components/MasonryItem.vue +174 -57
- package/src/views/Home.vue +1 -1
package/lib/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
let
|
|
1
|
+
import { nextTick as J, defineComponent as Le, ref as k, computed as te, onMounted as Se, onUnmounted as Ne, watch as He, createElementBlock as B, openBlock as D, renderSlot as $e, createElementVNode as E, createCommentVNode as X, normalizeClass as Y, toDisplayString as ie, withModifiers as ze, normalizeStyle as Re, createVNode as Te, TransitionGroup as _e, withCtx as Ce, Fragment as qe, renderList as Ve, mergeProps as Ge, unref as Ue } from "vue";
|
|
2
|
+
let fe = null;
|
|
3
3
|
function Xe() {
|
|
4
|
-
if (
|
|
4
|
+
if (fe != null) return fe;
|
|
5
5
|
const e = document.createElement("div");
|
|
6
6
|
e.style.visibility = "hidden", e.style.overflow = "scroll", e.style.msOverflowStyle = "scrollbar", e.style.width = "100px", e.style.height = "100px", document.body.appendChild(e);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
return document.body.removeChild(e),
|
|
7
|
+
const r = document.createElement("div");
|
|
8
|
+
r.style.width = "100%", e.appendChild(r);
|
|
9
|
+
const l = e.offsetWidth - r.offsetWidth;
|
|
10
|
+
return document.body.removeChild(e), fe = l, l;
|
|
11
11
|
}
|
|
12
|
-
function Ye(e, l, s
|
|
12
|
+
function Ye(e, r, l, s = {}) {
|
|
13
13
|
const {
|
|
14
|
-
gutterX:
|
|
15
|
-
gutterY:
|
|
14
|
+
gutterX: w = 0,
|
|
15
|
+
gutterY: v = 0,
|
|
16
16
|
header: a = 0,
|
|
17
17
|
footer: n = 0,
|
|
18
|
-
paddingLeft:
|
|
19
|
-
paddingRight:
|
|
20
|
-
sizes:
|
|
18
|
+
paddingLeft: h = 0,
|
|
19
|
+
paddingRight: c = 0,
|
|
20
|
+
sizes: f = {
|
|
21
21
|
base: 1,
|
|
22
22
|
sm: 2,
|
|
23
23
|
md: 3,
|
|
@@ -25,95 +25,95 @@ function Ye(e, l, s, i = {}) {
|
|
|
25
25
|
xl: 5,
|
|
26
26
|
"2xl": 6
|
|
27
27
|
},
|
|
28
|
-
placement:
|
|
29
|
-
} =
|
|
30
|
-
let
|
|
28
|
+
placement: T = "masonry"
|
|
29
|
+
} = s;
|
|
30
|
+
let m = 0, d = 0;
|
|
31
31
|
try {
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
if (r && r.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
|
|
33
|
+
const P = window.getComputedStyle(r);
|
|
34
|
+
m = parseFloat(P.paddingLeft) || 0, d = parseFloat(P.paddingRight) || 0;
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return Math.round(
|
|
38
|
+
const N = (h || 0) + m, z = (c || 0) + d, $ = r.offsetWidth - r.clientWidth, L = $ > 0 ? $ + 2 : Xe() + 2, i = r.offsetWidth - L - N - z, p = w * (l - 1), M = Math.floor((i - p) / l), I = e.map((P) => {
|
|
39
|
+
const H = P.width, S = P.height;
|
|
40
|
+
return Math.round(M * S / H) + n + a;
|
|
41
41
|
});
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
for (let
|
|
50
|
-
const U =
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
else if (
|
|
42
|
+
if (T === "sequential-balanced") {
|
|
43
|
+
const P = I.length;
|
|
44
|
+
if (P === 0) return [];
|
|
45
|
+
const H = (x, F, R) => x + (F > 0 ? v : 0) + R;
|
|
46
|
+
let S = Math.max(...I), _ = I.reduce((x, F) => x + F, 0) + v * Math.max(0, P - 1);
|
|
47
|
+
const ae = (x) => {
|
|
48
|
+
let F = 1, R = 0, q = 0;
|
|
49
|
+
for (let j = 0; j < P; j++) {
|
|
50
|
+
const U = I[j], V = H(R, q, U);
|
|
51
|
+
if (V <= x)
|
|
52
|
+
R = V, q++;
|
|
53
|
+
else if (F++, R = U, q = 1, U > x || F > l) return !1;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return F <= l;
|
|
56
56
|
};
|
|
57
|
-
for (;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
for (let
|
|
64
|
-
const
|
|
65
|
-
!(
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
for (let
|
|
70
|
-
const
|
|
71
|
-
for (let
|
|
72
|
-
const
|
|
73
|
-
...e[
|
|
74
|
-
columnWidth:
|
|
57
|
+
for (; S < _; ) {
|
|
58
|
+
const x = Math.floor((S + _) / 2);
|
|
59
|
+
ae(x) ? _ = x : S = x + 1;
|
|
60
|
+
}
|
|
61
|
+
const ne = _, K = new Array(l).fill(0);
|
|
62
|
+
let oe = l - 1, Q = 0, Z = 0;
|
|
63
|
+
for (let x = P - 1; x >= 0; x--) {
|
|
64
|
+
const F = I[x], R = x < oe;
|
|
65
|
+
!(H(Q, Z, F) <= ne) || R ? (K[oe] = x + 1, oe--, Q = F, Z = 1) : (Q = H(Q, Z, F), Z++);
|
|
66
|
+
}
|
|
67
|
+
K[0] = 0;
|
|
68
|
+
const C = [], re = new Array(l).fill(0);
|
|
69
|
+
for (let x = 0; x < l; x++) {
|
|
70
|
+
const F = K[x], R = x + 1 < l ? K[x + 1] : P, q = x * (M + w);
|
|
71
|
+
for (let j = F; j < R; j++) {
|
|
72
|
+
const V = {
|
|
73
|
+
...e[j],
|
|
74
|
+
columnWidth: M,
|
|
75
75
|
imageHeight: 0,
|
|
76
76
|
columnHeight: 0,
|
|
77
77
|
left: 0,
|
|
78
78
|
top: 0
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
V.imageHeight = I[j] - (n + a), V.columnHeight = I[j], V.left = q, V.top = re[x], re[x] += V.columnHeight + (j + 1 < R ? v : 0), C.push(V);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return C;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
for (let
|
|
87
|
-
const
|
|
88
|
-
...
|
|
85
|
+
const b = new Array(l).fill(0), A = [];
|
|
86
|
+
for (let P = 0; P < e.length; P++) {
|
|
87
|
+
const H = e[P], S = {
|
|
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
|
+
}, _ = b.indexOf(Math.min(...b)), ae = H.width, ne = H.height;
|
|
95
|
+
S.columnWidth = M, S.left = _ * (M + w), S.imageHeight = Math.round(M * ne / ae), S.columnHeight = S.imageHeight + n + a, S.top = b[_], b[_] += S.columnHeight + v, A.push(S);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return A;
|
|
98
98
|
}
|
|
99
|
-
var Je = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self,
|
|
99
|
+
var Je = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Ae = Je || Ke || Function("return this")(), ce = Ae.Symbol, Fe = Object.prototype, Qe = Fe.hasOwnProperty, Ze = Fe.toString, se = ce ? ce.toStringTag : void 0;
|
|
100
100
|
function et(e) {
|
|
101
|
-
var
|
|
101
|
+
var r = Qe.call(e, se), l = e[se];
|
|
102
102
|
try {
|
|
103
|
-
e[
|
|
104
|
-
var
|
|
103
|
+
e[se] = void 0;
|
|
104
|
+
var s = !0;
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
|
-
var
|
|
108
|
-
return
|
|
107
|
+
var w = Ze.call(e);
|
|
108
|
+
return s && (r ? e[se] = l : delete e[se]), w;
|
|
109
109
|
}
|
|
110
110
|
var tt = Object.prototype, at = tt.toString;
|
|
111
111
|
function nt(e) {
|
|
112
112
|
return at.call(e);
|
|
113
113
|
}
|
|
114
|
-
var
|
|
114
|
+
var ot = "[object Null]", rt = "[object Undefined]", Me = ce ? ce.toStringTag : void 0;
|
|
115
115
|
function lt(e) {
|
|
116
|
-
return e == null ? e === void 0 ?
|
|
116
|
+
return e == null ? e === void 0 ? rt : ot : Me && Me in Object(e) ? et(e) : nt(e);
|
|
117
117
|
}
|
|
118
118
|
function st(e) {
|
|
119
119
|
return e != null && typeof e == "object";
|
|
@@ -124,90 +124,90 @@ function ut(e) {
|
|
|
124
124
|
}
|
|
125
125
|
var ct = /\s/;
|
|
126
126
|
function ft(e) {
|
|
127
|
-
for (var
|
|
127
|
+
for (var r = e.length; r-- && ct.test(e.charAt(r)); )
|
|
128
128
|
;
|
|
129
|
-
return
|
|
129
|
+
return r;
|
|
130
130
|
}
|
|
131
131
|
var dt = /^\s+/;
|
|
132
132
|
function vt(e) {
|
|
133
133
|
return e && e.slice(0, ft(e) + 1).replace(dt, "");
|
|
134
134
|
}
|
|
135
135
|
function me(e) {
|
|
136
|
-
var
|
|
137
|
-
return e != null && (
|
|
136
|
+
var r = typeof e;
|
|
137
|
+
return e != null && (r == "object" || r == "function");
|
|
138
138
|
}
|
|
139
|
-
var Ie = NaN, mt = /^[-+]0x[0-9a-f]+$/i,
|
|
139
|
+
var Ie = NaN, mt = /^[-+]0x[0-9a-f]+$/i, pt = /^0b[01]+$/i, gt = /^0o[0-7]+$/i, yt = parseInt;
|
|
140
140
|
function Pe(e) {
|
|
141
141
|
if (typeof e == "number")
|
|
142
142
|
return e;
|
|
143
143
|
if (ut(e))
|
|
144
144
|
return Ie;
|
|
145
145
|
if (me(e)) {
|
|
146
|
-
var
|
|
147
|
-
e = me(
|
|
146
|
+
var r = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
147
|
+
e = me(r) ? r + "" : r;
|
|
148
148
|
}
|
|
149
149
|
if (typeof e != "string")
|
|
150
150
|
return e === 0 ? e : +e;
|
|
151
151
|
e = vt(e);
|
|
152
|
-
var
|
|
153
|
-
return
|
|
152
|
+
var l = pt.test(e);
|
|
153
|
+
return l || gt.test(e) ? yt(e.slice(2), l ? 2 : 8) : mt.test(e) ? Ie : +e;
|
|
154
154
|
}
|
|
155
|
-
var
|
|
156
|
-
return
|
|
155
|
+
var de = function() {
|
|
156
|
+
return Ae.Date.now();
|
|
157
157
|
}, ht = "Expected a function", bt = Math.max, xt = Math.min;
|
|
158
|
-
function
|
|
159
|
-
var
|
|
158
|
+
function ke(e, r, l) {
|
|
159
|
+
var s, w, v, a, n, h, c = 0, f = !1, T = !1, m = !0;
|
|
160
160
|
if (typeof e != "function")
|
|
161
161
|
throw new TypeError(ht);
|
|
162
|
-
|
|
163
|
-
function
|
|
164
|
-
var
|
|
165
|
-
return
|
|
162
|
+
r = Pe(r) || 0, me(l) && (f = !!l.leading, T = "maxWait" in l, v = T ? bt(Pe(l.maxWait) || 0, r) : v, m = "trailing" in l ? !!l.trailing : m);
|
|
163
|
+
function d(b) {
|
|
164
|
+
var A = s, P = w;
|
|
165
|
+
return s = w = void 0, c = b, a = e.apply(P, A), a;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return
|
|
167
|
+
function N(b) {
|
|
168
|
+
return c = b, n = setTimeout(L, r), f ? d(b) : a;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
return
|
|
170
|
+
function z(b) {
|
|
171
|
+
var A = b - h, P = b - c, H = r - A;
|
|
172
|
+
return T ? xt(H, v - P) : H;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
return
|
|
174
|
+
function $(b) {
|
|
175
|
+
var A = b - h, P = b - c;
|
|
176
|
+
return h === void 0 || A >= r || A < 0 || T && P >= v;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
var
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
182
|
-
n = setTimeout(
|
|
178
|
+
function L() {
|
|
179
|
+
var b = de();
|
|
180
|
+
if ($(b))
|
|
181
|
+
return i(b);
|
|
182
|
+
n = setTimeout(L, z(b));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return n = void 0,
|
|
184
|
+
function i(b) {
|
|
185
|
+
return n = void 0, m && s ? d(b) : (s = w = void 0, a);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
n !== void 0 && clearTimeout(n),
|
|
187
|
+
function p() {
|
|
188
|
+
n !== void 0 && clearTimeout(n), c = 0, s = h = w = n = void 0;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return n === void 0 ? a :
|
|
190
|
+
function M() {
|
|
191
|
+
return n === void 0 ? a : i(de());
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
var
|
|
195
|
-
if (
|
|
193
|
+
function I() {
|
|
194
|
+
var b = de(), A = $(b);
|
|
195
|
+
if (s = arguments, w = this, h = b, A) {
|
|
196
196
|
if (n === void 0)
|
|
197
|
-
return
|
|
198
|
-
if (
|
|
199
|
-
return clearTimeout(n), n = setTimeout(
|
|
197
|
+
return N(h);
|
|
198
|
+
if (T)
|
|
199
|
+
return clearTimeout(n), n = setTimeout(L, r), d(h);
|
|
200
200
|
}
|
|
201
|
-
return n === void 0 && (n = setTimeout(
|
|
201
|
+
return n === void 0 && (n = setTimeout(L, r)), a;
|
|
202
202
|
}
|
|
203
|
-
return
|
|
203
|
+
return I.cancel = p, I.flush = M, I;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
return
|
|
205
|
+
function ve(e) {
|
|
206
|
+
const r = window.innerWidth, l = e.sizes;
|
|
207
|
+
return r >= 1536 && l["2xl"] ? l["2xl"] : r >= 1280 && l.xl ? l.xl : r >= 1024 && l.lg ? l.lg : r >= 768 && l.md ? l.md : r >= 640 && l.sm ? l.sm : l.base;
|
|
208
208
|
}
|
|
209
209
|
function wt(e) {
|
|
210
|
-
return e.reduce((
|
|
210
|
+
return e.reduce((l, s) => Math.max(l, s.top + s.columnHeight), 0) + 500;
|
|
211
211
|
}
|
|
212
212
|
function Tt(e) {
|
|
213
213
|
return {
|
|
@@ -218,111 +218,114 @@ function Tt(e) {
|
|
|
218
218
|
height: `${e.columnHeight}px`
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
function Mt(e,
|
|
221
|
+
function Mt(e, r = 0) {
|
|
222
222
|
return {
|
|
223
223
|
style: Tt(e),
|
|
224
224
|
"data-top": e.top,
|
|
225
225
|
"data-left": e.left,
|
|
226
226
|
"data-id": `${e.page}-${e.id}`,
|
|
227
|
-
"data-index":
|
|
227
|
+
"data-index": r
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
if (!e.length ||
|
|
232
|
-
return new Array(Math.max(1,
|
|
233
|
-
const
|
|
234
|
-
for (let a = 0; a <
|
|
235
|
-
const
|
|
230
|
+
function pe(e, r) {
|
|
231
|
+
if (!e.length || r <= 0)
|
|
232
|
+
return new Array(Math.max(1, r)).fill(0);
|
|
233
|
+
const s = Array.from(new Set(e.map((a) => a.left))).sort((a, n) => a - n).slice(0, r), w = /* @__PURE__ */ new Map();
|
|
234
|
+
for (let a = 0; a < s.length; a++) w.set(s[a], a);
|
|
235
|
+
const v = new Array(s.length).fill(0);
|
|
236
236
|
for (const a of e) {
|
|
237
|
-
const n =
|
|
238
|
-
n != null && (
|
|
237
|
+
const n = w.get(a.left);
|
|
238
|
+
n != null && (v[n] = Math.max(v[n], a.top + a.columnHeight));
|
|
239
239
|
}
|
|
240
|
-
for (;
|
|
241
|
-
return
|
|
240
|
+
for (; v.length < r; ) v.push(0);
|
|
241
|
+
return v;
|
|
242
242
|
}
|
|
243
|
-
function It(e,
|
|
244
|
-
function
|
|
245
|
-
const
|
|
246
|
-
a.style.setProperty("--masonry-opacity-delay", `${
|
|
247
|
-
a.style.opacity = "1", a.style.transform = `translate3d(${
|
|
248
|
-
const
|
|
249
|
-
|
|
243
|
+
function It(e, r) {
|
|
244
|
+
function l(a, n) {
|
|
245
|
+
const h = parseInt(a.dataset.left || "0", 10), c = parseInt(a.dataset.top || "0", 10), f = parseInt(a.dataset.index || "0", 10), T = Math.min(f * 20, 160), m = a.style.getPropertyValue("--masonry-opacity-delay");
|
|
246
|
+
a.style.setProperty("--masonry-opacity-delay", `${T}ms`), requestAnimationFrame(() => {
|
|
247
|
+
a.style.opacity = "1", a.style.transform = `translate3d(${h}px, ${c}px, 0) scale(1)`;
|
|
248
|
+
const d = () => {
|
|
249
|
+
m ? a.style.setProperty("--masonry-opacity-delay", m) : a.style.removeProperty("--masonry-opacity-delay"), a.removeEventListener("transitionend", d), n();
|
|
250
250
|
};
|
|
251
|
-
a.addEventListener("transitionend",
|
|
251
|
+
a.addEventListener("transitionend", d);
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const n = parseInt(a.dataset.left || "0", 10),
|
|
256
|
-
a.style.opacity = "0", a.style.transform = `translate3d(${n}px, ${
|
|
254
|
+
function s(a) {
|
|
255
|
+
const n = parseInt(a.dataset.left || "0", 10), h = parseInt(a.dataset.top || "0", 10);
|
|
256
|
+
a.style.opacity = "0", a.style.transform = `translate3d(${n}px, ${h + 10}px, 0) scale(0.985)`;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const n = parseInt(a.dataset.left || "0", 10),
|
|
260
|
-
a.style.transition = "none", a.style.opacity = "1", a.style.transform = `translate3d(${n}px, ${
|
|
258
|
+
function w(a) {
|
|
259
|
+
const n = parseInt(a.dataset.left || "0", 10), h = parseInt(a.dataset.top || "0", 10);
|
|
260
|
+
a.style.transition = "none", a.style.opacity = "1", a.style.transform = `translate3d(${n}px, ${h}px, 0) scale(1)`, a.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
261
261
|
a.style.transition = "";
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
const
|
|
266
|
-
let
|
|
267
|
-
if (!Number.isFinite(
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
const
|
|
272
|
-
a.removeEventListener("transitionend",
|
|
273
|
-
},
|
|
274
|
-
(
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
264
|
+
function v(a, n) {
|
|
265
|
+
const h = parseInt(a.dataset.left || "0", 10), c = parseInt(a.dataset.top || "0", 10), f = typeof (r == null ? void 0 : r.leaveDurationMs) == "number" ? r.leaveDurationMs : NaN;
|
|
266
|
+
let T = Number.isFinite(f) && f > 0 ? f : NaN;
|
|
267
|
+
if (!Number.isFinite(T)) {
|
|
268
|
+
const L = getComputedStyle(a).getPropertyValue("--masonry-leave-duration") || "", i = parseFloat(L);
|
|
269
|
+
T = Number.isFinite(i) && i > 0 ? i : 200;
|
|
270
|
+
}
|
|
271
|
+
const m = a.style.transitionDuration, d = () => {
|
|
272
|
+
a.removeEventListener("transitionend", N), clearTimeout(z), a.style.transitionDuration = m || "";
|
|
273
|
+
}, N = ($) => {
|
|
274
|
+
(!$ || $.target === a) && (d(), n());
|
|
275
|
+
}, z = setTimeout(() => {
|
|
276
|
+
d(), n();
|
|
277
|
+
}, T + 100);
|
|
278
278
|
requestAnimationFrame(() => {
|
|
279
|
-
a.style.transitionDuration = `${
|
|
279
|
+
a.style.transitionDuration = `${T}ms`, a.style.opacity = "0", a.style.transform = `translate3d(${h}px, ${c + 10}px, 0) scale(0.985)`, a.addEventListener("transitionend", N);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
return {
|
|
283
|
-
onEnter:
|
|
284
|
-
onBeforeEnter:
|
|
285
|
-
onBeforeLeave:
|
|
286
|
-
onLeave:
|
|
283
|
+
onEnter: l,
|
|
284
|
+
onBeforeEnter: s,
|
|
285
|
+
onBeforeLeave: w,
|
|
286
|
+
onLeave: v
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
function Pt({
|
|
290
290
|
container: e,
|
|
291
|
-
masonry:
|
|
292
|
-
columns:
|
|
293
|
-
containerHeight:
|
|
294
|
-
isLoading:
|
|
295
|
-
pageSize:
|
|
291
|
+
masonry: r,
|
|
292
|
+
columns: l,
|
|
293
|
+
containerHeight: s,
|
|
294
|
+
isLoading: w,
|
|
295
|
+
pageSize: v,
|
|
296
296
|
refreshLayout: a,
|
|
297
297
|
setItemsRaw: n,
|
|
298
|
-
loadNext:
|
|
299
|
-
loadThresholdPx:
|
|
298
|
+
loadNext: h,
|
|
299
|
+
loadThresholdPx: c
|
|
300
300
|
}) {
|
|
301
|
-
let
|
|
302
|
-
async function
|
|
301
|
+
let f = 0;
|
|
302
|
+
async function T(m) {
|
|
303
303
|
if (!e.value) return;
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
await
|
|
304
|
+
const d = m ?? pe(r.value, l.value), N = d.length ? Math.max(...d) : 0, z = e.value.scrollTop + e.value.clientHeight, $ = e.value.scrollTop > f + 1;
|
|
305
|
+
f = e.value.scrollTop;
|
|
306
|
+
const L = typeof c == "number" ? c : 200, i = L >= 0 ? Math.max(0, N - L) : Math.max(0, N + L);
|
|
307
|
+
if (z >= i && $ && !w.value) {
|
|
308
|
+
await h(), await J();
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
return {
|
|
313
|
-
handleScroll:
|
|
313
|
+
handleScroll: T
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
const
|
|
316
|
+
const kt = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 bg-white relative" }, Et = {
|
|
317
317
|
key: 0,
|
|
318
318
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-100 text-slate-400 text-sm p-4 text-center"
|
|
319
319
|
}, Lt = {
|
|
320
320
|
key: 1,
|
|
321
|
-
class: "
|
|
322
|
-
}, Nt = {
|
|
323
|
-
key:
|
|
321
|
+
class: "relative w-full h-full"
|
|
322
|
+
}, St = ["src"], Nt = ["src"], Ht = { class: "flex flex-col items-center justify-center gap-2 text-slate-400" }, $t = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, At = { class: "text-xs font-medium uppercase" }, Ft = {
|
|
323
|
+
key: 3,
|
|
324
|
+
class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center"
|
|
325
|
+
}, Wt = {
|
|
326
|
+
key: 4,
|
|
324
327
|
class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
|
|
325
|
-
},
|
|
328
|
+
}, jt = ["title"], Ot = { class: "absolute bottom-0 left-0 right-0 p-3 opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-300 delay-75 pointer-events-none" }, Bt = { class: "text-white text-xs font-medium truncate drop-shadow-md" }, ge = /* @__PURE__ */ Le({
|
|
326
329
|
__name: "MasonryItem",
|
|
327
330
|
props: {
|
|
328
331
|
item: {},
|
|
@@ -331,148 +334,210 @@ const Et = { class: "relative w-full h-full group" }, kt = { class: "w-full h-fu
|
|
|
331
334
|
notFound: { type: Boolean, default: void 0 }
|
|
332
335
|
},
|
|
333
336
|
setup(e) {
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
const r = e, l = k(!1), s = k(!1), w = k(null), v = k(!1), a = k(!1), n = k(null), h = k(!1), c = k(!1), f = k(!1), T = k(null);
|
|
338
|
+
let m = null;
|
|
339
|
+
const d = te(() => {
|
|
340
|
+
var i;
|
|
341
|
+
return r.type ?? ((i = r.item) == null ? void 0 : i.type) ?? "image";
|
|
342
|
+
}), N = te(() => {
|
|
343
|
+
var i;
|
|
344
|
+
return r.notFound ?? ((i = r.item) == null ? void 0 : i.notFound) ?? !1;
|
|
340
345
|
});
|
|
341
|
-
function
|
|
342
|
-
return new Promise((
|
|
343
|
-
if (!
|
|
344
|
-
|
|
346
|
+
function z(i) {
|
|
347
|
+
return new Promise((p, M) => {
|
|
348
|
+
if (!i) {
|
|
349
|
+
M(new Error("No image source provided"));
|
|
345
350
|
return;
|
|
346
351
|
}
|
|
347
|
-
const I = new Image(),
|
|
352
|
+
const I = new Image(), b = Date.now(), A = 300;
|
|
348
353
|
I.onload = () => {
|
|
349
|
-
const P = Date.now() -
|
|
350
|
-
setTimeout(() => {
|
|
351
|
-
|
|
352
|
-
},
|
|
354
|
+
const P = Date.now() - b, H = Math.max(0, A - P);
|
|
355
|
+
setTimeout(async () => {
|
|
356
|
+
l.value = !0, s.value = !1, c.value = !1, await J(), await new Promise((S) => setTimeout(S, 100)), f.value = !0, p();
|
|
357
|
+
}, H);
|
|
353
358
|
}, I.onerror = () => {
|
|
354
|
-
|
|
355
|
-
}, I.src =
|
|
359
|
+
s.value = !0, l.value = !1, c.value = !1, M(new Error("Failed to load image"));
|
|
360
|
+
}, I.src = i;
|
|
356
361
|
});
|
|
357
362
|
}
|
|
358
|
-
function
|
|
359
|
-
return new Promise((
|
|
360
|
-
if (!
|
|
361
|
-
|
|
363
|
+
function $(i) {
|
|
364
|
+
return new Promise((p, M) => {
|
|
365
|
+
if (!i) {
|
|
366
|
+
M(new Error("No video source provided"));
|
|
362
367
|
return;
|
|
363
368
|
}
|
|
364
|
-
const I = document.createElement("video"),
|
|
369
|
+
const I = document.createElement("video"), b = Date.now(), A = 300;
|
|
365
370
|
I.preload = "metadata", I.muted = !0, I.onloadedmetadata = () => {
|
|
366
|
-
const P = Date.now() -
|
|
367
|
-
setTimeout(() => {
|
|
368
|
-
|
|
369
|
-
},
|
|
371
|
+
const P = Date.now() - b, H = Math.max(0, A - P);
|
|
372
|
+
setTimeout(async () => {
|
|
373
|
+
v.value = !0, a.value = !1, c.value = !1, await J(), await new Promise((S) => setTimeout(S, 100)), f.value = !0, p();
|
|
374
|
+
}, H);
|
|
370
375
|
}, I.onerror = () => {
|
|
371
|
-
a.value = !0,
|
|
372
|
-
}, I.src =
|
|
376
|
+
a.value = !0, v.value = !1, c.value = !1, M(new Error("Failed to load video"));
|
|
377
|
+
}, I.src = i;
|
|
373
378
|
});
|
|
374
379
|
}
|
|
375
|
-
|
|
376
|
-
var
|
|
377
|
-
if (
|
|
380
|
+
async function L() {
|
|
381
|
+
var p;
|
|
382
|
+
if (!h.value || c.value || N.value || d.value === "video" && v.value || d.value === "image" && l.value)
|
|
378
383
|
return;
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
if (
|
|
382
|
-
n.value =
|
|
384
|
+
const i = (p = r.item) == null ? void 0 : p.src;
|
|
385
|
+
if (i)
|
|
386
|
+
if (c.value = !0, f.value = !1, d.value === "video") {
|
|
387
|
+
n.value = i, v.value = !1, a.value = !1;
|
|
383
388
|
try {
|
|
384
|
-
await
|
|
389
|
+
await $(i);
|
|
385
390
|
} catch {
|
|
386
391
|
}
|
|
387
392
|
} else {
|
|
388
|
-
|
|
393
|
+
w.value = i, l.value = !1, s.value = !1;
|
|
389
394
|
try {
|
|
390
|
-
await
|
|
395
|
+
await z(i);
|
|
391
396
|
} catch {
|
|
392
397
|
}
|
|
393
398
|
}
|
|
394
|
-
}
|
|
399
|
+
}
|
|
400
|
+
return Se(() => {
|
|
401
|
+
T.value && (m = new IntersectionObserver(
|
|
402
|
+
(i) => {
|
|
403
|
+
i.forEach((p) => {
|
|
404
|
+
p.isIntersecting && p.intersectionRatio >= 1 ? h.value || (h.value = !0, L()) : p.isIntersecting;
|
|
405
|
+
});
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
// Only trigger when item is 100% visible (full height in view)
|
|
409
|
+
threshold: [1]
|
|
410
|
+
}
|
|
411
|
+
), m.observe(T.value));
|
|
412
|
+
}), Ne(() => {
|
|
413
|
+
m && (m.disconnect(), m = null);
|
|
414
|
+
}), He(
|
|
395
415
|
() => {
|
|
396
|
-
var
|
|
397
|
-
return (
|
|
416
|
+
var i;
|
|
417
|
+
return (i = r.item) == null ? void 0 : i.src;
|
|
398
418
|
},
|
|
399
|
-
async (
|
|
400
|
-
if (!(!
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
403
|
-
|
|
419
|
+
async (i) => {
|
|
420
|
+
if (!(!i || N.value)) {
|
|
421
|
+
if (d.value === "video") {
|
|
422
|
+
if (i !== n.value && (v.value = !1, a.value = !1, n.value = i, h.value)) {
|
|
423
|
+
c.value = !0;
|
|
404
424
|
try {
|
|
405
|
-
await
|
|
425
|
+
await $(i);
|
|
406
426
|
} catch {
|
|
407
427
|
}
|
|
408
428
|
}
|
|
409
|
-
} else if (
|
|
410
|
-
|
|
429
|
+
} else if (i !== w.value && (l.value = !1, s.value = !1, w.value = i, h.value)) {
|
|
430
|
+
c.value = !0;
|
|
411
431
|
try {
|
|
412
|
-
await
|
|
432
|
+
await z(i);
|
|
413
433
|
} catch {
|
|
414
434
|
}
|
|
415
435
|
}
|
|
416
436
|
}
|
|
417
437
|
}
|
|
418
|
-
), (
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
438
|
+
), (i, p) => (D(), B("div", {
|
|
439
|
+
ref_key: "containerRef",
|
|
440
|
+
ref: T,
|
|
441
|
+
class: "relative w-full h-full group"
|
|
442
|
+
}, [
|
|
443
|
+
$e(i.$slots, "default", {
|
|
444
|
+
item: i.item,
|
|
445
|
+
remove: i.remove,
|
|
446
|
+
imageLoaded: l.value,
|
|
447
|
+
imageError: s.value,
|
|
448
|
+
videoLoaded: v.value,
|
|
425
449
|
videoError: a.value,
|
|
426
|
-
showNotFound:
|
|
450
|
+
showNotFound: N.value,
|
|
451
|
+
isLoading: c.value,
|
|
452
|
+
mediaType: d.value
|
|
427
453
|
}, () => [
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
]))) :
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
class:
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
454
|
+
E("div", kt, [
|
|
455
|
+
N.value ? (D(), B("div", Et, p[4] || (p[4] = [
|
|
456
|
+
E("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
|
|
457
|
+
E("span", { class: "font-medium" }, "Not Found", -1),
|
|
458
|
+
E("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
|
|
459
|
+
]))) : (D(), B("div", Lt, [
|
|
460
|
+
d.value === "image" && w.value ? (D(), B("img", {
|
|
461
|
+
key: 0,
|
|
462
|
+
src: w.value,
|
|
463
|
+
class: Y([
|
|
464
|
+
"w-full h-full object-cover transition-opacity duration-700 ease-in-out group-hover:scale-105",
|
|
465
|
+
l.value && f.value ? "opacity-100" : "opacity-0"
|
|
466
|
+
]),
|
|
467
|
+
style: { position: "absolute", top: "0", left: "0" },
|
|
468
|
+
loading: "lazy",
|
|
469
|
+
decoding: "async",
|
|
470
|
+
alt: ""
|
|
471
|
+
}, null, 10, St)) : X("", !0),
|
|
472
|
+
d.value === "video" && n.value ? (D(), B("video", {
|
|
473
|
+
key: 1,
|
|
474
|
+
src: n.value,
|
|
475
|
+
class: Y([
|
|
476
|
+
"w-full h-full object-cover transition-opacity duration-700 ease-in-out group-hover:scale-105",
|
|
477
|
+
v.value && f.value ? "opacity-100" : "opacity-0"
|
|
478
|
+
]),
|
|
479
|
+
style: { position: "absolute", top: "0", left: "0" },
|
|
480
|
+
muted: "",
|
|
481
|
+
loop: "",
|
|
482
|
+
playsinline: "",
|
|
483
|
+
onMouseenter: p[0] || (p[0] = (M) => M.target.play()),
|
|
484
|
+
onMouseleave: p[1] || (p[1] = (M) => M.target.pause()),
|
|
485
|
+
onError: p[2] || (p[2] = (M) => a.value = !0)
|
|
486
|
+
}, null, 42, Nt)) : X("", !0),
|
|
487
|
+
!l.value && !v.value && !s.value && !a.value ? (D(), B("div", {
|
|
488
|
+
key: 2,
|
|
489
|
+
class: Y([
|
|
490
|
+
"absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
|
|
491
|
+
f.value ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
492
|
+
])
|
|
493
|
+
}, [
|
|
494
|
+
E("div", Ht, [
|
|
495
|
+
E("div", $t, [
|
|
496
|
+
E("i", {
|
|
497
|
+
class: Y(d.value === "video" ? "fas fa-video text-xl" : "fas fa-image text-xl")
|
|
498
|
+
}, null, 2)
|
|
499
|
+
]),
|
|
500
|
+
E("span", At, ie(d.value), 1)
|
|
501
|
+
])
|
|
502
|
+
], 2)) : X("", !0),
|
|
503
|
+
c.value ? (D(), B("div", Ft, p[5] || (p[5] = [
|
|
504
|
+
E("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
|
|
505
|
+
E("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
|
|
506
|
+
], -1)
|
|
507
|
+
]))) : X("", !0),
|
|
508
|
+
d.value === "image" && s.value || d.value === "video" && a.value ? (D(), B("div", Wt, [
|
|
509
|
+
E("i", {
|
|
510
|
+
class: Y(d.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
|
|
511
|
+
}, null, 2),
|
|
512
|
+
E("span", null, "Failed to load " + ie(d.value), 1)
|
|
513
|
+
])) : X("", !0)
|
|
514
|
+
])),
|
|
515
|
+
!N.value && (l.value || v.value || c.value) ? (D(), B("div", {
|
|
516
|
+
key: 2,
|
|
517
|
+
class: "absolute top-2 left-2 w-7 h-7 flex items-center justify-center bg-black/60 backdrop-blur-sm text-white rounded-full shadow-sm opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",
|
|
518
|
+
title: d.value === "video" ? "Video" : "Image"
|
|
519
|
+
}, [
|
|
520
|
+
E("i", {
|
|
521
|
+
class: Y(d.value === "video" ? "fas fa-video text-xs" : "fas fa-image text-xs")
|
|
522
|
+
}, null, 2)
|
|
523
|
+
], 8, jt)) : X("", !0),
|
|
524
|
+
p[7] || (p[7] = E("div", { class: "absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none" }, null, -1)),
|
|
525
|
+
i.remove ? (D(), B("button", {
|
|
442
526
|
key: 3,
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
loading: "lazy",
|
|
446
|
-
decoding: "async"
|
|
447
|
-
}, null, 8, Ht)) : le("", !0),
|
|
448
|
-
v.value === "video" && m.value && n.value && !f.value ? (G(), V("video", {
|
|
449
|
-
key: 4,
|
|
450
|
-
src: n.value,
|
|
451
|
-
class: "w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",
|
|
452
|
-
muted: "",
|
|
453
|
-
loop: "",
|
|
454
|
-
playsinline: "",
|
|
455
|
-
onMouseenter: c[0] || (c[0] = (w) => w.target.play()),
|
|
456
|
-
onMouseleave: c[1] || (c[1] = (w) => w.target.pause()),
|
|
457
|
-
onError: c[2] || (c[2] = (w) => a.value = !0)
|
|
458
|
-
}, null, 40, $t)) : le("", !0),
|
|
459
|
-
c[7] || (c[7] = A("div", { class: "absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none" }, null, -1)),
|
|
460
|
-
r.remove ? (G(), V("button", {
|
|
461
|
-
key: 5,
|
|
462
|
-
class: "absolute top-2 right-2 w-8 h-8 flex items-center justify-center bg-white/90 backdrop-blur-sm text-slate-700 rounded-full shadow-sm opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-300 hover:bg-red-500 hover:text-white cursor-pointer",
|
|
463
|
-
onClick: c[3] || (c[3] = je((w) => r.remove(r.item), ["stop"])),
|
|
527
|
+
class: "absolute top-2 right-2 w-8 h-8 flex items-center justify-center bg-white/90 backdrop-blur-sm text-slate-700 rounded-full shadow-sm opacity-0 group-hover:opacity-100 transform translate-y-2 group-hover:translate-y-0 transition-all duration-300 hover:bg-red-500 hover:text-white cursor-pointer z-10",
|
|
528
|
+
onClick: p[3] || (p[3] = ze((M) => i.remove(i.item), ["stop"])),
|
|
464
529
|
"aria-label": "Remove item"
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
]))) :
|
|
468
|
-
|
|
469
|
-
|
|
530
|
+
}, p[6] || (p[6] = [
|
|
531
|
+
E("i", { class: "fas fa-times text-sm" }, null, -1)
|
|
532
|
+
]))) : X("", !0),
|
|
533
|
+
E("div", Ot, [
|
|
534
|
+
E("p", Bt, "Item #" + ie(String(i.item.id).split("-")[0]), 1)
|
|
470
535
|
])
|
|
471
536
|
])
|
|
472
537
|
])
|
|
473
|
-
]));
|
|
538
|
+
], 512));
|
|
474
539
|
}
|
|
475
|
-
}),
|
|
540
|
+
}), Dt = /* @__PURE__ */ Le({
|
|
476
541
|
__name: "Masonry",
|
|
477
542
|
props: {
|
|
478
543
|
getNextPage: {
|
|
@@ -572,8 +637,8 @@ const Et = { class: "relative w-full h-full group" }, kt = { class: "w-full h-fu
|
|
|
572
637
|
"retry:stop",
|
|
573
638
|
"remove-all:complete"
|
|
574
639
|
],
|
|
575
|
-
setup(e, { expose:
|
|
576
|
-
const
|
|
640
|
+
setup(e, { expose: r, emit: l }) {
|
|
641
|
+
const s = e, w = {
|
|
577
642
|
sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
|
|
578
643
|
gutterX: 10,
|
|
579
644
|
gutterY: 10,
|
|
@@ -582,41 +647,41 @@ const Et = { class: "relative w-full h-full group" }, kt = { class: "w-full h-fu
|
|
|
582
647
|
paddingLeft: 0,
|
|
583
648
|
paddingRight: 0,
|
|
584
649
|
placement: "masonry"
|
|
585
|
-
},
|
|
650
|
+
}, v = te(() => {
|
|
586
651
|
var t;
|
|
587
652
|
return {
|
|
588
|
-
...
|
|
589
|
-
...
|
|
653
|
+
...w,
|
|
654
|
+
...s.layout,
|
|
590
655
|
sizes: {
|
|
591
|
-
...
|
|
592
|
-
...((t =
|
|
656
|
+
...w.sizes,
|
|
657
|
+
...((t = s.layout) == null ? void 0 : t.sizes) || {}
|
|
593
658
|
}
|
|
594
659
|
};
|
|
595
|
-
}), a =
|
|
596
|
-
get: () =>
|
|
660
|
+
}), a = l, n = te({
|
|
661
|
+
get: () => s.items,
|
|
597
662
|
set: (t) => a("update:items", t)
|
|
598
|
-
}),
|
|
599
|
-
function
|
|
663
|
+
}), h = k(7), c = k(null), f = k([]), T = k(null), m = k(!1), d = k(0), N = k(/* @__PURE__ */ new Set());
|
|
664
|
+
function z(t) {
|
|
600
665
|
return typeof t == "number" && Number.isFinite(t) && t > 0;
|
|
601
666
|
}
|
|
602
|
-
function
|
|
667
|
+
function $(t, o) {
|
|
603
668
|
try {
|
|
604
669
|
if (!Array.isArray(t) || t.length === 0) return;
|
|
605
|
-
const u = t.filter((
|
|
670
|
+
const u = t.filter((y) => !z(y == null ? void 0 : y.width) || !z(y == null ? void 0 : y.height));
|
|
606
671
|
if (u.length === 0) return;
|
|
607
672
|
const g = [];
|
|
608
|
-
for (const
|
|
609
|
-
const
|
|
610
|
-
|
|
673
|
+
for (const y of u) {
|
|
674
|
+
const O = (y == null ? void 0 : y.id) ?? `idx:${t.indexOf(y)}`;
|
|
675
|
+
N.value.has(O) || (N.value.add(O), g.push(O));
|
|
611
676
|
}
|
|
612
677
|
if (g.length > 0) {
|
|
613
|
-
const
|
|
678
|
+
const y = g.slice(0, 10);
|
|
614
679
|
console.warn(
|
|
615
680
|
"[Masonry] Items missing width/height detected:",
|
|
616
681
|
{
|
|
617
682
|
context: o,
|
|
618
683
|
count: g.length,
|
|
619
|
-
sampleIds:
|
|
684
|
+
sampleIds: y,
|
|
620
685
|
hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
|
|
621
686
|
}
|
|
622
687
|
);
|
|
@@ -624,336 +689,336 @@ const Et = { class: "relative w-full h-full group" }, kt = { class: "w-full h-fu
|
|
|
624
689
|
} catch {
|
|
625
690
|
}
|
|
626
691
|
}
|
|
627
|
-
const
|
|
692
|
+
const L = k(0), i = k(0), p = s.virtualBufferPx, M = k(!1), I = k({
|
|
628
693
|
distanceToTrigger: 0,
|
|
629
694
|
isNearTrigger: !1
|
|
630
|
-
}),
|
|
631
|
-
if (!
|
|
632
|
-
const { scrollTop: o, clientHeight: u } =
|
|
633
|
-
|
|
695
|
+
}), b = (t) => {
|
|
696
|
+
if (!c.value) return;
|
|
697
|
+
const { scrollTop: o, clientHeight: u } = c.value, g = o + u, y = t ?? pe(n.value, h.value), O = y.length ? Math.max(...y) : 0, G = typeof s.loadThresholdPx == "number" ? s.loadThresholdPx : 200, ee = G >= 0 ? Math.max(0, O - G) : Math.max(0, O + G), we = Math.max(0, ee - g), De = we <= 100;
|
|
698
|
+
I.value = {
|
|
634
699
|
distanceToTrigger: Math.round(we),
|
|
635
|
-
isNearTrigger:
|
|
700
|
+
isNearTrigger: De
|
|
636
701
|
};
|
|
637
|
-
}, { onEnter:
|
|
638
|
-
function
|
|
639
|
-
if (
|
|
702
|
+
}, { onEnter: A, onBeforeEnter: P, onBeforeLeave: H, onLeave: S } = It(n, { leaveDurationMs: s.leaveDurationMs });
|
|
703
|
+
function _(t, o) {
|
|
704
|
+
if (M.value) {
|
|
640
705
|
const u = parseInt(t.dataset.left || "0", 10), g = parseInt(t.dataset.top || "0", 10);
|
|
641
706
|
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${u}px, ${g}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), requestAnimationFrame(() => {
|
|
642
707
|
t.style.transition = "", o();
|
|
643
708
|
});
|
|
644
709
|
} else
|
|
645
|
-
|
|
710
|
+
A(t, o);
|
|
646
711
|
}
|
|
647
|
-
function
|
|
648
|
-
if (
|
|
712
|
+
function ae(t) {
|
|
713
|
+
if (M.value) {
|
|
649
714
|
const o = parseInt(t.dataset.left || "0", 10), u = parseInt(t.dataset.top || "0", 10);
|
|
650
715
|
t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${o}px, ${u}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
|
|
651
716
|
} else
|
|
652
|
-
|
|
717
|
+
P(t);
|
|
653
718
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
719
|
+
function ne(t) {
|
|
720
|
+
M.value || H(t);
|
|
656
721
|
}
|
|
657
|
-
function
|
|
658
|
-
|
|
722
|
+
function K(t, o) {
|
|
723
|
+
M.value ? o() : S(t, o);
|
|
659
724
|
}
|
|
660
|
-
const
|
|
661
|
-
const t =
|
|
725
|
+
const oe = te(() => {
|
|
726
|
+
const t = L.value - p, o = L.value + i.value + p, u = n.value;
|
|
662
727
|
return !u || u.length === 0 ? [] : u.filter((g) => {
|
|
663
|
-
const
|
|
664
|
-
return g.top + g.columnHeight >= t &&
|
|
728
|
+
const y = g.top;
|
|
729
|
+
return g.top + g.columnHeight >= t && y <= o;
|
|
665
730
|
});
|
|
666
|
-
}), { handleScroll:
|
|
667
|
-
container:
|
|
731
|
+
}), { handleScroll: Q } = Pt({
|
|
732
|
+
container: c,
|
|
668
733
|
masonry: n,
|
|
669
|
-
columns:
|
|
670
|
-
containerHeight:
|
|
671
|
-
isLoading:
|
|
672
|
-
pageSize:
|
|
673
|
-
refreshLayout:
|
|
734
|
+
columns: h,
|
|
735
|
+
containerHeight: d,
|
|
736
|
+
isLoading: m,
|
|
737
|
+
pageSize: s.pageSize,
|
|
738
|
+
refreshLayout: C,
|
|
674
739
|
setItemsRaw: (t) => {
|
|
675
740
|
n.value = t;
|
|
676
741
|
},
|
|
677
|
-
loadNext:
|
|
678
|
-
loadThresholdPx:
|
|
742
|
+
loadNext: q,
|
|
743
|
+
loadThresholdPx: s.loadThresholdPx
|
|
679
744
|
});
|
|
680
|
-
|
|
681
|
-
isLoading:
|
|
682
|
-
refreshLayout:
|
|
683
|
-
containerHeight:
|
|
745
|
+
r({
|
|
746
|
+
isLoading: m,
|
|
747
|
+
refreshLayout: C,
|
|
748
|
+
containerHeight: d,
|
|
684
749
|
remove: U,
|
|
685
|
-
removeMany:
|
|
686
|
-
removeAll:
|
|
687
|
-
loadNext:
|
|
688
|
-
loadPage:
|
|
689
|
-
refreshCurrentPage:
|
|
690
|
-
reset:
|
|
691
|
-
init:
|
|
692
|
-
paginationHistory:
|
|
750
|
+
removeMany: V,
|
|
751
|
+
removeAll: We,
|
|
752
|
+
loadNext: q,
|
|
753
|
+
loadPage: R,
|
|
754
|
+
refreshCurrentPage: j,
|
|
755
|
+
reset: Oe,
|
|
756
|
+
init: Be,
|
|
757
|
+
paginationHistory: f,
|
|
693
758
|
cancelLoad: he,
|
|
694
759
|
scrollToTop: ye,
|
|
695
|
-
totalItems:
|
|
760
|
+
totalItems: te(() => n.value.length)
|
|
696
761
|
});
|
|
697
|
-
function
|
|
762
|
+
function Z(t) {
|
|
698
763
|
const o = wt(t);
|
|
699
764
|
let u = 0;
|
|
700
|
-
if (
|
|
701
|
-
const { scrollTop: g, clientHeight:
|
|
702
|
-
u = g +
|
|
765
|
+
if (c.value) {
|
|
766
|
+
const { scrollTop: g, clientHeight: y } = c.value;
|
|
767
|
+
u = g + y + 100;
|
|
703
768
|
}
|
|
704
|
-
|
|
769
|
+
d.value = Math.max(o, u);
|
|
705
770
|
}
|
|
706
|
-
function
|
|
707
|
-
if (!
|
|
708
|
-
|
|
709
|
-
const o = t.map((g,
|
|
771
|
+
function C(t) {
|
|
772
|
+
if (!c.value) return;
|
|
773
|
+
$(t, "refreshLayout");
|
|
774
|
+
const o = t.map((g, y) => ({
|
|
710
775
|
...g,
|
|
711
|
-
originalIndex: g.originalIndex ??
|
|
712
|
-
})), u = Ye(o,
|
|
713
|
-
|
|
776
|
+
originalIndex: g.originalIndex ?? y
|
|
777
|
+
})), u = Ye(o, c.value, h.value, v.value);
|
|
778
|
+
Z(u), n.value = u;
|
|
714
779
|
}
|
|
715
|
-
function
|
|
780
|
+
function re(t, o) {
|
|
716
781
|
return new Promise((u) => {
|
|
717
|
-
const g = Math.max(0, t | 0),
|
|
782
|
+
const g = Math.max(0, t | 0), y = Date.now();
|
|
718
783
|
o(g, g);
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
clearInterval(
|
|
784
|
+
const O = setInterval(() => {
|
|
785
|
+
if (W.value) {
|
|
786
|
+
clearInterval(O), u();
|
|
722
787
|
return;
|
|
723
788
|
}
|
|
724
|
-
const
|
|
725
|
-
o(
|
|
789
|
+
const G = Date.now() - y, ee = Math.max(0, g - G);
|
|
790
|
+
o(ee, g), ee <= 0 && (clearInterval(O), u());
|
|
726
791
|
}, 100);
|
|
727
792
|
});
|
|
728
793
|
}
|
|
729
|
-
async function
|
|
794
|
+
async function x(t) {
|
|
730
795
|
try {
|
|
731
|
-
const o = await
|
|
732
|
-
return
|
|
796
|
+
const o = await F(() => s.getNextPage(t));
|
|
797
|
+
return C([...n.value, ...o.items]), o;
|
|
733
798
|
} catch (o) {
|
|
734
799
|
throw console.error("Error in getContent:", o), o;
|
|
735
800
|
}
|
|
736
801
|
}
|
|
737
|
-
async function
|
|
802
|
+
async function F(t) {
|
|
738
803
|
let o = 0;
|
|
739
|
-
const u =
|
|
740
|
-
let g =
|
|
804
|
+
const u = s.retryMaxAttempts;
|
|
805
|
+
let g = s.retryInitialDelayMs;
|
|
741
806
|
for (; ; )
|
|
742
807
|
try {
|
|
743
|
-
const
|
|
744
|
-
return o > 0 && a("retry:stop", { attempt: o, success: !0 }),
|
|
745
|
-
} catch (
|
|
808
|
+
const y = await t();
|
|
809
|
+
return o > 0 && a("retry:stop", { attempt: o, success: !0 }), y;
|
|
810
|
+
} catch (y) {
|
|
746
811
|
if (o++, o > u)
|
|
747
|
-
throw a("retry:stop", { attempt: o - 1, success: !1 }),
|
|
748
|
-
a("retry:start", { attempt: o, max: u, totalMs: g }), await
|
|
749
|
-
a("retry:tick", { attempt: o, remainingMs:
|
|
750
|
-
}), g +=
|
|
812
|
+
throw a("retry:stop", { attempt: o - 1, success: !1 }), y;
|
|
813
|
+
a("retry:start", { attempt: o, max: u, totalMs: g }), await re(g, (O, G) => {
|
|
814
|
+
a("retry:tick", { attempt: o, remainingMs: O, totalMs: G });
|
|
815
|
+
}), g += s.retryBackoffStepMs;
|
|
751
816
|
}
|
|
752
817
|
}
|
|
753
|
-
async function
|
|
754
|
-
if (!
|
|
755
|
-
|
|
818
|
+
async function R(t) {
|
|
819
|
+
if (!m.value) {
|
|
820
|
+
W.value = !1, m.value = !0;
|
|
756
821
|
try {
|
|
757
822
|
const o = n.value.length;
|
|
758
|
-
if (
|
|
759
|
-
const u = await
|
|
760
|
-
return
|
|
823
|
+
if (W.value) return;
|
|
824
|
+
const u = await x(t);
|
|
825
|
+
return W.value ? void 0 : (T.value = t, f.value.push(u.nextPage), await le(o), u);
|
|
761
826
|
} catch (o) {
|
|
762
827
|
throw console.error("Error loading page:", o), o;
|
|
763
828
|
} finally {
|
|
764
|
-
|
|
829
|
+
m.value = !1;
|
|
765
830
|
}
|
|
766
831
|
}
|
|
767
832
|
}
|
|
768
|
-
async function
|
|
769
|
-
if (!
|
|
770
|
-
|
|
833
|
+
async function q() {
|
|
834
|
+
if (!m.value) {
|
|
835
|
+
W.value = !1, m.value = !0;
|
|
771
836
|
try {
|
|
772
837
|
const t = n.value.length;
|
|
773
|
-
if (
|
|
774
|
-
const o =
|
|
775
|
-
return
|
|
838
|
+
if (W.value) return;
|
|
839
|
+
const o = f.value[f.value.length - 1], u = await x(o);
|
|
840
|
+
return W.value ? void 0 : (T.value = o, f.value.push(u.nextPage), await le(t), u);
|
|
776
841
|
} catch (t) {
|
|
777
842
|
throw console.error("Error loading next page:", t), t;
|
|
778
843
|
} finally {
|
|
779
|
-
|
|
844
|
+
m.value = !1;
|
|
780
845
|
}
|
|
781
846
|
}
|
|
782
847
|
}
|
|
783
|
-
async function
|
|
784
|
-
if (console.log("[Masonry] refreshCurrentPage called, isLoading:",
|
|
785
|
-
|
|
848
|
+
async function j() {
|
|
849
|
+
if (console.log("[Masonry] refreshCurrentPage called, isLoading:", m.value, "currentPage:", T.value), !m.value) {
|
|
850
|
+
W.value = !1, m.value = !0;
|
|
786
851
|
try {
|
|
787
|
-
const t =
|
|
852
|
+
const t = T.value;
|
|
788
853
|
if (console.log("[Masonry] pageToRefresh:", t), t == null) {
|
|
789
|
-
console.warn("[Masonry] No current page to refresh - currentPage:",
|
|
854
|
+
console.warn("[Masonry] No current page to refresh - currentPage:", T.value, "paginationHistory:", f.value);
|
|
790
855
|
return;
|
|
791
856
|
}
|
|
792
|
-
n.value = [],
|
|
793
|
-
const o = await
|
|
794
|
-
if (
|
|
795
|
-
|
|
857
|
+
n.value = [], d.value = 0, f.value = [t], await J();
|
|
858
|
+
const o = await x(t);
|
|
859
|
+
if (W.value) return;
|
|
860
|
+
T.value = t, f.value.push(o.nextPage);
|
|
796
861
|
const u = n.value.length;
|
|
797
|
-
return await
|
|
862
|
+
return await le(u), o;
|
|
798
863
|
} catch (t) {
|
|
799
864
|
throw console.error("[Masonry] Error refreshing current page:", t), t;
|
|
800
865
|
} finally {
|
|
801
|
-
|
|
866
|
+
m.value = !1;
|
|
802
867
|
}
|
|
803
868
|
}
|
|
804
869
|
}
|
|
805
870
|
async function U(t) {
|
|
806
871
|
const o = n.value.filter((u) => u.id !== t.id);
|
|
807
|
-
if (n.value = o, await
|
|
808
|
-
if (
|
|
809
|
-
console.log("[Masonry] All items removed, calling refreshCurrentPage"), await
|
|
872
|
+
if (n.value = o, await J(), console.log("[Masonry] remove - next.length:", o.length, "paginationHistory.length:", f.value.length), o.length === 0 && f.value.length > 0) {
|
|
873
|
+
if (s.autoRefreshOnEmpty)
|
|
874
|
+
console.log("[Masonry] All items removed, calling refreshCurrentPage"), await j();
|
|
810
875
|
else {
|
|
811
876
|
console.log("[Masonry] All items removed, calling loadNext and forcing backfill");
|
|
812
877
|
try {
|
|
813
|
-
await
|
|
878
|
+
await q(), await le(0, !0);
|
|
814
879
|
} catch {
|
|
815
880
|
}
|
|
816
881
|
}
|
|
817
882
|
return;
|
|
818
883
|
}
|
|
819
884
|
await new Promise((u) => requestAnimationFrame(() => u())), requestAnimationFrame(() => {
|
|
820
|
-
|
|
885
|
+
C(o);
|
|
821
886
|
});
|
|
822
887
|
}
|
|
823
|
-
async function
|
|
888
|
+
async function V(t) {
|
|
824
889
|
if (!t || t.length === 0) return;
|
|
825
890
|
const o = new Set(t.map((g) => g.id)), u = n.value.filter((g) => !o.has(g.id));
|
|
826
|
-
if (n.value = u, await
|
|
827
|
-
if (
|
|
828
|
-
await
|
|
891
|
+
if (n.value = u, await J(), u.length === 0 && f.value.length > 0) {
|
|
892
|
+
if (s.autoRefreshOnEmpty)
|
|
893
|
+
await j();
|
|
829
894
|
else
|
|
830
895
|
try {
|
|
831
|
-
await
|
|
896
|
+
await q(), await le(0, !0);
|
|
832
897
|
} catch {
|
|
833
898
|
}
|
|
834
899
|
return;
|
|
835
900
|
}
|
|
836
901
|
await new Promise((g) => requestAnimationFrame(() => g())), requestAnimationFrame(() => {
|
|
837
|
-
|
|
902
|
+
C(u);
|
|
838
903
|
});
|
|
839
904
|
}
|
|
840
905
|
function ye(t) {
|
|
841
|
-
|
|
906
|
+
c.value && c.value.scrollTo({
|
|
842
907
|
top: 0,
|
|
843
908
|
behavior: (t == null ? void 0 : t.behavior) ?? "smooth",
|
|
844
909
|
...t
|
|
845
910
|
});
|
|
846
911
|
}
|
|
847
|
-
async function
|
|
848
|
-
ye({ behavior: "smooth" }), n.value = [],
|
|
912
|
+
async function We() {
|
|
913
|
+
ye({ behavior: "smooth" }), n.value = [], d.value = 0, await J(), a("remove-all:complete");
|
|
849
914
|
}
|
|
850
|
-
function
|
|
851
|
-
|
|
915
|
+
function je() {
|
|
916
|
+
h.value = ve(v.value), C(n.value), c.value && (L.value = c.value.scrollTop, i.value = c.value.clientHeight);
|
|
852
917
|
}
|
|
853
|
-
let
|
|
854
|
-
const
|
|
855
|
-
async function
|
|
856
|
-
if (!o && !
|
|
857
|
-
const u = (t || 0) + (
|
|
858
|
-
if (!(!
|
|
859
|
-
|
|
918
|
+
let ue = !1;
|
|
919
|
+
const W = k(!1);
|
|
920
|
+
async function le(t, o = !1) {
|
|
921
|
+
if (!o && !s.backfillEnabled || ue || W.value) return;
|
|
922
|
+
const u = (t || 0) + (s.pageSize || 0);
|
|
923
|
+
if (!(!s.pageSize || s.pageSize <= 0 || f.value[f.value.length - 1] == null) && !(n.value.length >= u)) {
|
|
924
|
+
ue = !0;
|
|
860
925
|
try {
|
|
861
|
-
let
|
|
862
|
-
for (a("backfill:start", { target: u, fetched: n.value.length, calls:
|
|
926
|
+
let y = 0;
|
|
927
|
+
for (a("backfill:start", { target: u, fetched: n.value.length, calls: y }); n.value.length < u && y < s.backfillMaxCalls && f.value[f.value.length - 1] != null && !W.value && (await re(s.backfillDelayMs, (G, ee) => {
|
|
863
928
|
a("backfill:tick", {
|
|
864
929
|
fetched: n.value.length,
|
|
865
930
|
target: u,
|
|
866
|
-
calls:
|
|
867
|
-
remainingMs:
|
|
868
|
-
totalMs:
|
|
931
|
+
calls: y,
|
|
932
|
+
remainingMs: G,
|
|
933
|
+
totalMs: ee
|
|
869
934
|
});
|
|
870
|
-
}),
|
|
871
|
-
const
|
|
935
|
+
}), !W.value); ) {
|
|
936
|
+
const O = f.value[f.value.length - 1];
|
|
872
937
|
try {
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
876
|
-
|
|
938
|
+
m.value = !0;
|
|
939
|
+
const G = await x(O);
|
|
940
|
+
if (W.value) break;
|
|
941
|
+
f.value.push(G.nextPage);
|
|
877
942
|
} finally {
|
|
878
|
-
|
|
943
|
+
m.value = !1;
|
|
879
944
|
}
|
|
880
|
-
|
|
945
|
+
y++;
|
|
881
946
|
}
|
|
882
|
-
a("backfill:stop", { fetched: n.value.length, calls:
|
|
947
|
+
a("backfill:stop", { fetched: n.value.length, calls: y });
|
|
883
948
|
} finally {
|
|
884
|
-
|
|
949
|
+
ue = !1;
|
|
885
950
|
}
|
|
886
951
|
}
|
|
887
952
|
}
|
|
888
953
|
function he() {
|
|
889
|
-
|
|
954
|
+
W.value = !0, m.value = !1, ue = !1;
|
|
890
955
|
}
|
|
891
|
-
function
|
|
892
|
-
he(),
|
|
956
|
+
function Oe() {
|
|
957
|
+
he(), W.value = !1, c.value && c.value.scrollTo({
|
|
893
958
|
top: 0,
|
|
894
959
|
behavior: "smooth"
|
|
895
|
-
}), n.value = [],
|
|
960
|
+
}), n.value = [], d.value = 0, T.value = s.loadAtPage, f.value = [s.loadAtPage], I.value = {
|
|
896
961
|
distanceToTrigger: 0,
|
|
897
962
|
isNearTrigger: !1
|
|
898
963
|
};
|
|
899
964
|
}
|
|
900
|
-
const be =
|
|
901
|
-
|
|
902
|
-
const t =
|
|
903
|
-
|
|
904
|
-
}, 200), xe =
|
|
905
|
-
function
|
|
906
|
-
|
|
965
|
+
const be = ke(async () => {
|
|
966
|
+
c.value && (L.value = c.value.scrollTop, i.value = c.value.clientHeight), M.value = !0, await J(), await new Promise((o) => requestAnimationFrame(() => o())), M.value = !1;
|
|
967
|
+
const t = pe(n.value, h.value);
|
|
968
|
+
Q(t), b(t);
|
|
969
|
+
}, 200), xe = ke(je, 200);
|
|
970
|
+
function Be(t, o, u) {
|
|
971
|
+
T.value = o, f.value = [o], f.value.push(u), $(t, "init"), C([...n.value, ...t]), b();
|
|
907
972
|
}
|
|
908
|
-
return
|
|
909
|
-
|
|
973
|
+
return He(
|
|
974
|
+
v,
|
|
910
975
|
() => {
|
|
911
|
-
|
|
976
|
+
c.value && (h.value = ve(v.value), C(n.value));
|
|
912
977
|
},
|
|
913
978
|
{ deep: !0 }
|
|
914
|
-
),
|
|
979
|
+
), Se(async () => {
|
|
915
980
|
var t;
|
|
916
981
|
try {
|
|
917
|
-
|
|
918
|
-
const o =
|
|
919
|
-
|
|
982
|
+
h.value = ve(v.value), c.value && (L.value = c.value.scrollTop, i.value = c.value.clientHeight);
|
|
983
|
+
const o = s.loadAtPage;
|
|
984
|
+
f.value = [o], s.skipInitialLoad || await R(f.value[0]), b();
|
|
920
985
|
} catch (o) {
|
|
921
|
-
console.error("Error during component initialization:", o),
|
|
986
|
+
console.error("Error during component initialization:", o), m.value = !1;
|
|
922
987
|
}
|
|
923
|
-
(t =
|
|
924
|
-
}),
|
|
988
|
+
(t = c.value) == null || t.addEventListener("scroll", be, { passive: !0 }), window.addEventListener("resize", xe);
|
|
989
|
+
}), Ne(() => {
|
|
925
990
|
var t;
|
|
926
|
-
(t =
|
|
927
|
-
}), (t, o) => (
|
|
928
|
-
class:
|
|
991
|
+
(t = c.value) == null || t.removeEventListener("scroll", be), window.removeEventListener("resize", xe);
|
|
992
|
+
}), (t, o) => (D(), B("div", {
|
|
993
|
+
class: Y(["overflow-auto w-full flex-1 masonry-container", { "force-motion": s.forceMotion }]),
|
|
929
994
|
ref_key: "container",
|
|
930
|
-
ref:
|
|
995
|
+
ref: c
|
|
931
996
|
}, [
|
|
932
|
-
|
|
997
|
+
E("div", {
|
|
933
998
|
class: "relative",
|
|
934
|
-
style: Re({ height: `${
|
|
999
|
+
style: Re({ height: `${d.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
|
|
935
1000
|
}, [
|
|
936
|
-
Te(
|
|
1001
|
+
Te(_e, {
|
|
937
1002
|
name: "masonry",
|
|
938
1003
|
css: !1,
|
|
939
|
-
onEnter:
|
|
940
|
-
onBeforeEnter:
|
|
941
|
-
onLeave:
|
|
942
|
-
onBeforeLeave:
|
|
1004
|
+
onEnter: _,
|
|
1005
|
+
onBeforeEnter: ae,
|
|
1006
|
+
onLeave: K,
|
|
1007
|
+
onBeforeLeave: ne
|
|
943
1008
|
}, {
|
|
944
|
-
default:
|
|
945
|
-
(
|
|
1009
|
+
default: Ce(() => [
|
|
1010
|
+
(D(!0), B(qe, null, Ve(oe.value, (u, g) => (D(), B("div", Ge({
|
|
946
1011
|
key: `${u.page}-${u.id}`,
|
|
947
1012
|
class: "absolute masonry-item",
|
|
948
1013
|
ref_for: !0
|
|
949
1014
|
}, Ue(Mt)(u, g), {
|
|
950
|
-
style: { paddingTop: `${
|
|
1015
|
+
style: { paddingTop: `${v.value.header}px`, paddingBottom: `${v.value.footer}px` }
|
|
951
1016
|
}), [
|
|
952
|
-
|
|
1017
|
+
$e(t.$slots, "default", {
|
|
953
1018
|
item: u,
|
|
954
1019
|
remove: U
|
|
955
1020
|
}, () => [
|
|
956
|
-
Te(
|
|
1021
|
+
Te(ge, {
|
|
957
1022
|
item: u,
|
|
958
1023
|
remove: U
|
|
959
1024
|
}, null, 8, ["item"])
|
|
@@ -962,29 +1027,29 @@ const Et = { class: "relative w-full h-full group" }, kt = { class: "w-full h-fu
|
|
|
962
1027
|
]),
|
|
963
1028
|
_: 3
|
|
964
1029
|
}),
|
|
965
|
-
|
|
1030
|
+
d.value > 0 ? (D(), B("div", {
|
|
966
1031
|
key: 0,
|
|
967
|
-
class:
|
|
1032
|
+
class: Y(["fixed bottom-4 right-4 bg-gray-800 text-white text-xs rounded-full px-3 py-1.5 shadow-lg z-10 transition-opacity duration-300", { "opacity-50 hover:opacity-100": !I.value.isNearTrigger, "opacity-100": I.value.isNearTrigger }])
|
|
968
1033
|
}, [
|
|
969
|
-
|
|
970
|
-
o[0] || (o[0] =
|
|
971
|
-
|
|
972
|
-
], 2)) :
|
|
1034
|
+
E("span", null, ie(n.value.length) + " items", 1),
|
|
1035
|
+
o[0] || (o[0] = E("span", { class: "mx-2" }, "|", -1)),
|
|
1036
|
+
E("span", null, ie(I.value.distanceToTrigger) + "px to load", 1)
|
|
1037
|
+
], 2)) : X("", !0)
|
|
973
1038
|
], 4)
|
|
974
1039
|
], 2));
|
|
975
1040
|
}
|
|
976
|
-
}),
|
|
977
|
-
const
|
|
978
|
-
for (const [
|
|
979
|
-
s
|
|
980
|
-
return
|
|
981
|
-
},
|
|
1041
|
+
}), zt = (e, r) => {
|
|
1042
|
+
const l = e.__vccOpts || e;
|
|
1043
|
+
for (const [s, w] of r)
|
|
1044
|
+
l[s] = w;
|
|
1045
|
+
return l;
|
|
1046
|
+
}, Ee = /* @__PURE__ */ zt(Dt, [["__scopeId", "data-v-110c3294"]]), _t = {
|
|
982
1047
|
install(e) {
|
|
983
|
-
e.component("WyxosMasonry",
|
|
1048
|
+
e.component("WyxosMasonry", Ee), e.component("WMasonry", Ee), e.component("WyxosMasonryItem", ge), e.component("WMasonryItem", ge);
|
|
984
1049
|
}
|
|
985
1050
|
};
|
|
986
1051
|
export {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1052
|
+
Ee as Masonry,
|
|
1053
|
+
ge as MasonryItem,
|
|
1054
|
+
_t as default
|
|
990
1055
|
};
|