@cntrl-site/components 1.0.116 → 1.0.117
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/dist/{ChroniclesComponent-D4_6w8f7.js → ChroniclesComponent-CoOgQZx2.js} +1 -1
- package/dist/{ChroniclesComponent-0ZWBPdbh.mjs → ChroniclesComponent-Szt0H-op.mjs} +3 -3
- package/dist/{Grid-OvzWvUW9.js → Grid-C4hO8KCr.js} +14 -9
- package/dist/{Grid-t07NDMzY.mjs → Grid-Dud7PLS9.mjs} +201 -196
- package/dist/{LightboxJournal-gePVKQJ4.mjs → LightboxJournal-BDUs6T0B.mjs} +340 -334
- package/dist/{LightboxJournal-Bmw2zm4t.js → LightboxJournal-Bf_rZzmz.js} +14 -8
- package/dist/{LightboxStrip-BPQiQhd3.mjs → LightboxStrip-Cuhb2fIR.mjs} +258 -252
- package/dist/{LightboxStrip-CTxRwLYk.js → LightboxStrip-RA4ABUC-.js} +14 -8
- package/dist/{components-BQjon_-7.mjs → components-DSHc15vW.mjs} +1 -1
- package/dist/{components-B8MjlzLL.js → components-iORMB3kt.js} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +3 -3
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/sources.js +30 -16
- package/dist/sources.mjs +30 -16
- package/package.json +1 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsxs as w, jsx as f, Fragment as yt } from "react/jsx-runtime";
|
|
2
|
-
import { useState as wt, useRef as p, useMemo as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { u as
|
|
5
|
-
import { i as
|
|
2
|
+
import { useState as wt, useRef as p, useMemo as z, useCallback as W, useEffect as ft, useLayoutEffect as le } from "react";
|
|
3
|
+
import { createPortal as kn } from "react-dom";
|
|
4
|
+
import { u as En } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
+
import { i as Et, g as Ve, u as Kn } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
|
|
6
6
|
import { s as _t } from "./scalingValue-C9JH5L6O.mjs";
|
|
7
|
-
import { S as
|
|
8
|
-
import { u as
|
|
7
|
+
import { S as Fn } from "./SvgImage-B5mR9y6q.mjs";
|
|
8
|
+
import { u as Bn } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
9
9
|
import { t as Dn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
|
-
const
|
|
10
|
+
const Hn = (e, o, a, c) => {
|
|
11
11
|
const s = Math.min(Math.abs(e) / Math.max(c, 1), 1);
|
|
12
12
|
return o + (a - o) * s;
|
|
13
|
-
},
|
|
13
|
+
}, Xn = (e) => {
|
|
14
14
|
e.style.transition = "", e.style.transform = "", e.style.willChange = "";
|
|
15
|
-
},
|
|
15
|
+
}, jn = (e) => {
|
|
16
16
|
const o = getComputedStyle(e).transform;
|
|
17
17
|
return o === "none" ? 0 : new DOMMatrixReadOnly(o).m41;
|
|
18
|
-
},
|
|
19
|
-
const m = e.scrollLeft, $ = a - m, A = m - a,
|
|
20
|
-
|
|
18
|
+
}, Gn = (e, o, a, { duration: c, easing: s, onComplete: d }) => {
|
|
19
|
+
const m = e.scrollLeft, $ = a - m, A = m - a, K = (M, tt) => {
|
|
20
|
+
Xn(o), e.scrollLeft = M, tt && (d == null || d());
|
|
21
21
|
};
|
|
22
22
|
if (Math.abs($) < 0.5)
|
|
23
|
-
return
|
|
23
|
+
return K(a, !0), () => {
|
|
24
24
|
};
|
|
25
|
-
let
|
|
25
|
+
let O = !1, P = 0;
|
|
26
26
|
const R = () => {
|
|
27
|
-
o.removeEventListener("transitionend",
|
|
28
|
-
},
|
|
29
|
-
M.target !== o || M.propertyName !== "transform" ||
|
|
27
|
+
o.removeEventListener("transitionend", F), clearTimeout(P);
|
|
28
|
+
}, F = (M) => {
|
|
29
|
+
M.target !== o || M.propertyName !== "transform" || O || (O = !0, R(), K(a, !0));
|
|
30
30
|
};
|
|
31
|
-
return o.addEventListener("transitionend",
|
|
32
|
-
|
|
31
|
+
return o.addEventListener("transitionend", F), o.style.willChange = "transform", o.style.transition = "none", o.style.transform = "translate3d(0, 0, 0)", o.offsetHeight, o.style.transition = `transform ${c}ms ${s}`, o.style.transform = `translate3d(${A}px, 0, 0)`, P = window.setTimeout(() => {
|
|
32
|
+
O || (O = !0, R(), K(a, !0));
|
|
33
33
|
}, c + 64), () => {
|
|
34
|
-
|
|
34
|
+
O || (O = !0, R(), K(m - jn(o), !1));
|
|
35
35
|
};
|
|
36
|
-
}, $t = 300,
|
|
36
|
+
}, $t = 300, Vn = 900, Yn = 1500, qn = "cubic-bezier(0.16, 1, 0.3, 1)", Un = 3e3, Zn = 2, Jn = 16, Qn = 0.05, Pn = 1, zt = 0.3, tr = 50, er = 20, ut = 4e-3, nr = ["title1", "title2", "title3"], rr = {
|
|
37
37
|
title1: "1",
|
|
38
38
|
title2: "2",
|
|
39
39
|
title3: "3"
|
|
40
|
-
},
|
|
40
|
+
}, or = {
|
|
41
41
|
title1: "title1Color",
|
|
42
42
|
title2: "title2Color",
|
|
43
43
|
title3: "title3Color"
|
|
44
|
-
},
|
|
44
|
+
}, ir = {
|
|
45
45
|
title1: 0.02,
|
|
46
46
|
title2: 0.02,
|
|
47
47
|
title3: 0.02
|
|
48
|
-
},
|
|
48
|
+
}, Ot = (e) => `max(${e}, ${er}px)`, lr = (e) => {
|
|
49
49
|
if (!Array.isArray(e) || e.length === 0) return {};
|
|
50
50
|
const o = e.find((s) => (s == null ? void 0 : s.type) === "paragraph") ?? e[0], a = o == null ? void 0 : o.children;
|
|
51
51
|
if (!Array.isArray(a)) return {};
|
|
@@ -55,7 +55,7 @@ const Xn = (e, o, a, c) => {
|
|
|
55
55
|
title2: c[1],
|
|
56
56
|
title3: c[2]
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, sr = (e) => {
|
|
59
59
|
if (!e)
|
|
60
60
|
return { title1: "", title2: "", title3: "" };
|
|
61
61
|
if (e.title1 || e.title2 || e.title3)
|
|
@@ -64,13 +64,13 @@ const Xn = (e, o, a, c) => {
|
|
|
64
64
|
title2: e.title2 ?? "",
|
|
65
65
|
title3: e.title3 ?? ""
|
|
66
66
|
};
|
|
67
|
-
const o =
|
|
67
|
+
const o = lr(e.text);
|
|
68
68
|
return {
|
|
69
69
|
title1: o.title1 ?? "",
|
|
70
70
|
title2: o.title2 ?? "",
|
|
71
71
|
title3: o.title3 ?? ""
|
|
72
72
|
};
|
|
73
|
-
}, X = (e, o) => `${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,
|
|
73
|
+
}, X = (e, o) => `${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`, ar = (e) => [
|
|
74
74
|
X(e, "fontFamily"),
|
|
75
75
|
X(e, "fontSettings"),
|
|
76
76
|
{
|
|
@@ -84,13 +84,13 @@ const Xn = (e, o, a, c) => {
|
|
|
84
84
|
},
|
|
85
85
|
X(e, "textAlign"),
|
|
86
86
|
X(e, "textAppearance")
|
|
87
|
-
],
|
|
87
|
+
], Sr = () => ({
|
|
88
88
|
type: "tab",
|
|
89
89
|
id: "stripTextStyle",
|
|
90
90
|
tabs: Object.fromEntries(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
nr.map((e) => [
|
|
92
|
+
rr[e],
|
|
93
|
+
ar(e)
|
|
94
94
|
])
|
|
95
95
|
)
|
|
96
96
|
}), fe = (e, o) => {
|
|
@@ -112,7 +112,7 @@ const Xn = (e, o, a, c) => {
|
|
|
112
112
|
{ overflow: c - 1, widths: [] }
|
|
113
113
|
);
|
|
114
114
|
return s;
|
|
115
|
-
}, Ye = (e, o) => fe(e, o),
|
|
115
|
+
}, Ye = (e, o) => fe(e, o), kt = (e, o) => {
|
|
116
116
|
const a = o.filter((c, s) => s !== e).reduce((c, s) => c + s, 0);
|
|
117
117
|
return Math.max(1 - a, 0);
|
|
118
118
|
}, Ge = (e, o) => {
|
|
@@ -121,7 +121,7 @@ const Xn = (e, o, a, c) => {
|
|
|
121
121
|
resolved: fe(e.length, a),
|
|
122
122
|
effective: Ye(e.length, a)
|
|
123
123
|
};
|
|
124
|
-
},
|
|
124
|
+
}, cr = (e, o, a, c, s, d, m) => {
|
|
125
125
|
const $ = [];
|
|
126
126
|
return o && $.push({
|
|
127
127
|
prefix: "title1",
|
|
@@ -144,7 +144,7 @@ const Xn = (e, o, a, c) => {
|
|
|
144
144
|
style: m,
|
|
145
145
|
text: c
|
|
146
146
|
}), $;
|
|
147
|
-
},
|
|
147
|
+
}, se = (e, o) => {
|
|
148
148
|
const a = (c) => {
|
|
149
149
|
const s = X(o, c);
|
|
150
150
|
return e[s];
|
|
@@ -161,12 +161,12 @@ const Xn = (e, o, a, c) => {
|
|
|
161
161
|
wordSpacing: a("wordSpacing") ?? 0,
|
|
162
162
|
textAlign: a("textAlign") ?? "left",
|
|
163
163
|
textAppearance: a("textAppearance"),
|
|
164
|
-
color: e[
|
|
164
|
+
color: e[or[o]]
|
|
165
165
|
};
|
|
166
|
-
},
|
|
166
|
+
}, ur = (e, o, a, c) => e.slice(0, c).reduce(
|
|
167
167
|
(s, d, m) => s + (d != null && d.marginLeftKey ? a[d.marginLeftKey] ?? 0 : 0) + (o[m] ?? 0),
|
|
168
168
|
0
|
|
169
|
-
),
|
|
169
|
+
), ae = (e, o, a) => {
|
|
170
170
|
var s, d;
|
|
171
171
|
const c = {
|
|
172
172
|
fontSettings: {
|
|
@@ -174,7 +174,7 @@ const Xn = (e, o, a, c) => {
|
|
|
174
174
|
fontWeight: ((s = o.fontSettings) == null ? void 0 : s.fontWeight) ?? 400,
|
|
175
175
|
fontStyle: ((d = o.fontSettings) == null ? void 0 : d.fontStyle) ?? "normal"
|
|
176
176
|
},
|
|
177
|
-
fontSize: o.fontSize ??
|
|
177
|
+
fontSize: o.fontSize ?? ir[e],
|
|
178
178
|
lineHeight: o.lineHeight,
|
|
179
179
|
letterSpacing: o.letterSpacing,
|
|
180
180
|
wordSpacing: o.wordSpacing,
|
|
@@ -183,7 +183,7 @@ const Xn = (e, o, a, c) => {
|
|
|
183
183
|
color: o.color ?? "#ffffff"
|
|
184
184
|
};
|
|
185
185
|
return Dn(c, a);
|
|
186
|
-
},
|
|
186
|
+
}, fr = ({
|
|
187
187
|
prefix: e,
|
|
188
188
|
images: o,
|
|
189
189
|
settings: a,
|
|
@@ -195,19 +195,19 @@ const Xn = (e, o, a, c) => {
|
|
|
195
195
|
const {
|
|
196
196
|
backgroundColor: $,
|
|
197
197
|
thumbnailSize: A,
|
|
198
|
-
thumbnailGap:
|
|
199
|
-
thumbnailMarginBottom:
|
|
198
|
+
thumbnailGap: K,
|
|
199
|
+
thumbnailMarginBottom: O,
|
|
200
200
|
imageGap: P,
|
|
201
201
|
closeIcon: R,
|
|
202
|
-
closeIconMaxWidth:
|
|
202
|
+
closeIconMaxWidth: F,
|
|
203
203
|
closeIconColor: M,
|
|
204
204
|
closeIconHoverColor: tt,
|
|
205
205
|
thumbnailTrigger: St,
|
|
206
206
|
thumbnailVisibility: ht,
|
|
207
207
|
thumbnailObjectFit: Lt,
|
|
208
|
-
thumbnailActive:
|
|
209
|
-
thumbnailActiveColor:
|
|
210
|
-
title1Width:
|
|
208
|
+
thumbnailActive: qe,
|
|
209
|
+
thumbnailActiveColor: Ue,
|
|
210
|
+
title1Width: Kt,
|
|
211
211
|
title2Width: he,
|
|
212
212
|
title3Width: de,
|
|
213
213
|
title1MarginLeft: C = 0,
|
|
@@ -215,37 +215,37 @@ const Xn = (e, o, a, c) => {
|
|
|
215
215
|
title3MarginLeft: pe = 0,
|
|
216
216
|
titleRowMarginBottom: ge = 0,
|
|
217
217
|
titleHeaderLayout: ve = "desktop",
|
|
218
|
-
contentMarginTop:
|
|
219
|
-
iconMarginLeft:
|
|
220
|
-
} = a, et = (t) => _t(t, c ?? !1),
|
|
218
|
+
contentMarginTop: Ze,
|
|
219
|
+
iconMarginLeft: Je
|
|
220
|
+
} = a, et = (t) => _t(t, c ?? !1), Qe = A ?? a.thumnailSize ?? 0.03, be = et(Qe), Ft = et(K), Bt = et(O ?? 0.02), dt = et(P ?? 0), xe = et(Ze ?? 0), Pe = Ot(xe), ye = et(Je ?? 0), [nt, Dt] = wt(0), N = p(nt);
|
|
221
221
|
N.current = nt;
|
|
222
|
-
const
|
|
223
|
-
() =>
|
|
224
|
-
[e, nt,
|
|
225
|
-
), rt =
|
|
222
|
+
const tn = o[nt], { title1: Ht, title2: Xt, title3: jt } = sr(tn), we = ae("title1", se(a, "title1"), c), $e = ae("title2", se(a, "title2"), c), Se = ae("title3", se(a, "title3"), c), _ = ve === "mobile", q = !s && (!c || d), mt = q, pt = q, en = q, Le = Et(Lt), nn = Le ? { "--image-aspect-ratio": Ve(Lt) } : void 0, Te = !!(Ht || Xt || jt), v = z(
|
|
223
|
+
() => cr(e, Ht, Xt, jt, we, $e, Se),
|
|
224
|
+
[e, nt, Ht, Xt, jt, we, $e, Se]
|
|
225
|
+
), rt = z(() => ({ title1Width: Kt, title2Width: he, title3Width: de }), [Kt, he, de]), Tt = z(() => v.map((t) => rt[t.widthKey]), [v, rt]), B = z(() => fe(v.length, Tt), [v.length, Tt]), Ie = z(() => Ye(v.length, Tt), [v.length, Tt]), It = z(() => v.filter((t) => t.prefix === "title1"), [v]), k = z(() => v.filter((t) => t.prefix === "title2" || t.prefix === "title3"), [v]), Wt = z(() => Ge(It, rt), [It, rt]), j = z(() => Ge(k, rt), [k, rt]), Gt = W((t, n) => {
|
|
226
226
|
const r = v.indexOf(t);
|
|
227
227
|
if (!_ || n === "single-row")
|
|
228
228
|
return {
|
|
229
229
|
effectiveWidth: Ie[r] ?? 0,
|
|
230
230
|
resolvedWidth: B[r] ?? 0,
|
|
231
|
-
maxWidth:
|
|
231
|
+
maxWidth: kt(r, B)
|
|
232
232
|
};
|
|
233
233
|
if (n === "two-row-top") {
|
|
234
234
|
const l = It.indexOf(t);
|
|
235
235
|
return {
|
|
236
236
|
effectiveWidth: Wt.effective[l] ?? 0,
|
|
237
237
|
resolvedWidth: Wt.resolved[l] ?? 0,
|
|
238
|
-
maxWidth:
|
|
238
|
+
maxWidth: kt(l, Wt.resolved)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const i =
|
|
241
|
+
const i = k.indexOf(t);
|
|
242
242
|
return {
|
|
243
243
|
effectiveWidth: j.effective[i] ?? 0,
|
|
244
244
|
resolvedWidth: j.resolved[i] ?? 0,
|
|
245
|
-
maxWidth:
|
|
245
|
+
maxWidth: kt(i, j.resolved)
|
|
246
246
|
};
|
|
247
247
|
}, [
|
|
248
|
-
|
|
248
|
+
k,
|
|
249
249
|
j,
|
|
250
250
|
Ie,
|
|
251
251
|
B,
|
|
@@ -256,36 +256,36 @@ const Xn = (e, o, a, c) => {
|
|
|
256
256
|
]), y = W(
|
|
257
257
|
(t) => _t(t, c ?? !1),
|
|
258
258
|
[c]
|
|
259
|
-
),
|
|
259
|
+
), rn = y(ge ?? 0), E = z(
|
|
260
260
|
() => ({
|
|
261
261
|
title1MarginLeft: C,
|
|
262
262
|
title2MarginLeft: me,
|
|
263
263
|
title3MarginLeft: pe
|
|
264
264
|
}),
|
|
265
265
|
[C, me, pe]
|
|
266
|
-
),
|
|
266
|
+
), on = W(
|
|
267
267
|
(t) => v.slice(0, t + 1).reduce(
|
|
268
|
-
(n, r, i) => n + (r != null && r.marginLeftKey ?
|
|
268
|
+
(n, r, i) => n + (r != null && r.marginLeftKey ? E[r.marginLeftKey] ?? 0 : 0) + (B[i] ?? 0),
|
|
269
269
|
0
|
|
270
270
|
) + (_ ? 0 : C ?? 0),
|
|
271
|
-
[v,
|
|
272
|
-
),
|
|
271
|
+
[v, E, B, _, C]
|
|
272
|
+
), ln = W(
|
|
273
273
|
() => _ ? 0 : C ?? 0,
|
|
274
274
|
[_, C]
|
|
275
|
-
),
|
|
276
|
-
(t) =>
|
|
277
|
-
(n, r, i) => n + (r.marginLeftKey ?
|
|
275
|
+
), Vt = W(
|
|
276
|
+
(t) => k.slice(0, t).reduce(
|
|
277
|
+
(n, r, i) => n + (r.marginLeftKey ? E[r.marginLeftKey] ?? 0 : 0) + (j.resolved[i] ?? 0),
|
|
278
278
|
0
|
|
279
279
|
),
|
|
280
|
-
[
|
|
281
|
-
),
|
|
280
|
+
[k, j.resolved, E]
|
|
281
|
+
), sn = W(
|
|
282
282
|
(t) => {
|
|
283
|
-
const n =
|
|
284
|
-
return
|
|
283
|
+
const n = k[t];
|
|
284
|
+
return Vt(t) + (n.marginLeftKey ? E[n.marginLeftKey] ?? 0 : 0) + (j.resolved[t] ?? 0);
|
|
285
285
|
},
|
|
286
|
-
[
|
|
287
|
-
),
|
|
288
|
-
const r = t.marginLeftKey ?
|
|
286
|
+
[k, j.resolved, Vt, E]
|
|
287
|
+
), Yt = (t, n) => {
|
|
288
|
+
const r = t.marginLeftKey ? E[t.marginLeftKey] ?? 0 : 0, { effectiveWidth: i, resolvedWidth: l, maxWidth: u } = Gt(t, n), h = s && n === "two-row-top";
|
|
289
289
|
return /* @__PURE__ */ w(
|
|
290
290
|
"div",
|
|
291
291
|
{
|
|
@@ -337,9 +337,9 @@ const Xn = (e, o, a, c) => {
|
|
|
337
337
|
},
|
|
338
338
|
t.className
|
|
339
339
|
);
|
|
340
|
-
},
|
|
340
|
+
}, an = () => {
|
|
341
341
|
const t = _ ? -1 : v.findIndex((i) => i.prefix === "title1"), n = !_ && (s || (C ?? 0) > 0) ? (() => {
|
|
342
|
-
const i = C ?? 0, l = t >= 0 ? B[t] :
|
|
342
|
+
const i = C ?? 0, l = t >= 0 ? B[t] : Kt ?? 0;
|
|
343
343
|
return /* @__PURE__ */ f(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
@@ -360,12 +360,12 @@ const Xn = (e, o, a, c) => {
|
|
|
360
360
|
);
|
|
361
361
|
})() : null, r = v.flatMap((i, l) => {
|
|
362
362
|
if (!i.marginLeftKey) return [];
|
|
363
|
-
const u =
|
|
363
|
+
const u = E[i.marginLeftKey] ?? 0, h = ur(
|
|
364
364
|
v,
|
|
365
365
|
B,
|
|
366
|
-
|
|
366
|
+
E,
|
|
367
367
|
l
|
|
368
|
-
) +
|
|
368
|
+
) + ln();
|
|
369
369
|
return /* @__PURE__ */ f(
|
|
370
370
|
"div",
|
|
371
371
|
{
|
|
@@ -386,11 +386,11 @@ const Xn = (e, o, a, c) => {
|
|
|
386
386
|
);
|
|
387
387
|
});
|
|
388
388
|
return n ? [n, ...r] : r;
|
|
389
|
-
},
|
|
390
|
-
const r =
|
|
389
|
+
}, cn = () => v.map((t, n) => {
|
|
390
|
+
const r = kt(
|
|
391
391
|
n,
|
|
392
392
|
B
|
|
393
|
-
), l =
|
|
393
|
+
), l = on(n) - ut / 2;
|
|
394
394
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
395
395
|
"div",
|
|
396
396
|
{
|
|
@@ -409,9 +409,9 @@ const Xn = (e, o, a, c) => {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
) }, `${t.widthKey}-junction`);
|
|
412
|
-
}),
|
|
412
|
+
}), un = () => k.flatMap((t, n) => {
|
|
413
413
|
if (!t.marginLeftKey) return [];
|
|
414
|
-
const r =
|
|
414
|
+
const r = E[t.marginLeftKey] ?? 0, i = Vt(n), { resolvedWidth: l } = Gt(t, "two-row-bottom");
|
|
415
415
|
return /* @__PURE__ */ f(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
@@ -430,8 +430,8 @@ const Xn = (e, o, a, c) => {
|
|
|
430
430
|
},
|
|
431
431
|
t.marginLeftKey
|
|
432
432
|
);
|
|
433
|
-
}),
|
|
434
|
-
const { maxWidth: r } =
|
|
433
|
+
}), fn = () => k.map((t, n) => {
|
|
434
|
+
const { maxWidth: r } = Gt(t, "two-row-bottom"), l = sn(n) - ut / 2;
|
|
435
435
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
436
436
|
"div",
|
|
437
437
|
{
|
|
@@ -450,21 +450,21 @@ const Xn = (e, o, a, c) => {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
) }, `${t.widthKey}-junction`);
|
|
453
|
-
}),
|
|
453
|
+
}), hn = p(null), b = p(null), qt = p(null), We = p(null), At = p([]), S = p([]), ot = p(0), Rt = p(null), x = p({
|
|
454
454
|
isActive: !1,
|
|
455
455
|
startX: 0,
|
|
456
456
|
scrollLeft: 0,
|
|
457
457
|
startActiveIndex: 0,
|
|
458
458
|
hasMoved: !1
|
|
459
|
-
}), gt = p(null), it = p(null),
|
|
460
|
-
() => Array.from({ length:
|
|
461
|
-
[o,
|
|
462
|
-
), [
|
|
463
|
-
mt && (
|
|
464
|
-
x.current.isActive ||
|
|
465
|
-
},
|
|
459
|
+
}), gt = p(null), it = p(null), Ut = p(0), Zt = p("forward"), G = p(0), V = p(null), U = p(!1), L = o.length > 1 && (!s || !!d), Jt = L ? 3 : 1, dn = z(
|
|
460
|
+
() => Array.from({ length: Jt }, () => o).flat(),
|
|
461
|
+
[o, Jt]
|
|
462
|
+
), [mn, Ae] = wt(!1), [Re, Me] = wt(!1), [pn, Qt] = wt(!0), Z = p(null), lt = p(null), Pt = p(!1), Ce = p(!1), te = p(null), J = p(null), Ne = mt && !pn, D = W(() => {
|
|
463
|
+
mt && (Qt(!0), J.current && clearTimeout(J.current), J.current = setTimeout(() => {
|
|
464
|
+
x.current.isActive || Qt(!1);
|
|
465
|
+
}, Un));
|
|
466
466
|
}, [mt]), vt = W(() => {
|
|
467
|
-
s || Ce.current || (Ce.current = !0, Me(!1),
|
|
467
|
+
s || Ce.current || (Ce.current = !0, Me(!1), te.current = setTimeout(() => {
|
|
468
468
|
m();
|
|
469
469
|
}, $t));
|
|
470
470
|
}, [s, m]), _e = () => /* @__PURE__ */ w(
|
|
@@ -473,8 +473,8 @@ const Xn = (e, o, a, c) => {
|
|
|
473
473
|
className: `${e}-close-icon`,
|
|
474
474
|
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
475
475
|
style: {
|
|
476
|
-
width: _t(
|
|
477
|
-
height: _t(
|
|
476
|
+
width: _t(F ?? 0, c),
|
|
477
|
+
height: _t(F ?? 0, c),
|
|
478
478
|
marginRight: ye,
|
|
479
479
|
"--close-icon-hover-color": tt
|
|
480
480
|
},
|
|
@@ -487,7 +487,7 @@ const Xn = (e, o, a, c) => {
|
|
|
487
487
|
onClick: vt,
|
|
488
488
|
"aria-label": "Close",
|
|
489
489
|
children: /* @__PURE__ */ f(
|
|
490
|
-
|
|
490
|
+
Fn,
|
|
491
491
|
{
|
|
492
492
|
url: R,
|
|
493
493
|
fill: M,
|
|
@@ -516,7 +516,7 @@ const Xn = (e, o, a, c) => {
|
|
|
516
516
|
)
|
|
517
517
|
]
|
|
518
518
|
}
|
|
519
|
-
),
|
|
519
|
+
), ze = (t = "two-row") => /* @__PURE__ */ f(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
522
|
...t === "two-row" && s ? {
|
|
@@ -530,20 +530,20 @@ const Xn = (e, o, a, c) => {
|
|
|
530
530
|
...t === "two-row" && s ? { pointerEvents: "auto" } : {}
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
),
|
|
533
|
+
), gn = () => {
|
|
534
534
|
const t = v.find((i) => i.prefix === "title1"), n = v.filter((i) => i.prefix === "title2" || i.prefix === "title3"), r = n.length > 0 || s || (ge ?? 0) > 0;
|
|
535
535
|
return /* @__PURE__ */ w(yt, { children: [
|
|
536
536
|
/* @__PURE__ */ w("div", { className: `${e}-header-row-top`, children: [
|
|
537
|
-
(C ?? 0) > 0 || s ?
|
|
538
|
-
t &&
|
|
537
|
+
(C ?? 0) > 0 || s ? ze() : null,
|
|
538
|
+
t && Yt(t, "two-row-top"),
|
|
539
539
|
R && _e()
|
|
540
540
|
] }),
|
|
541
541
|
r ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom-wrap`, children: [
|
|
542
542
|
n.length > 0 ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom`, children: [
|
|
543
|
-
n.map((i) =>
|
|
543
|
+
n.map((i) => Yt(i, "two-row-bottom")),
|
|
544
544
|
s && /* @__PURE__ */ w(yt, { children: [
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
un(),
|
|
546
|
+
fn()
|
|
547
547
|
] })
|
|
548
548
|
] }) : null,
|
|
549
549
|
/* @__PURE__ */ f(
|
|
@@ -554,7 +554,7 @@ const Xn = (e, o, a, c) => {
|
|
|
554
554
|
"data-controls-reverse": s ? "" : void 0,
|
|
555
555
|
className: s ? `${e}-control` : void 0,
|
|
556
556
|
style: {
|
|
557
|
-
height:
|
|
557
|
+
height: rn,
|
|
558
558
|
width: "100%",
|
|
559
559
|
flexShrink: 0,
|
|
560
560
|
pointerEvents: s ? "auto" : "none"
|
|
@@ -563,27 +563,27 @@ const Xn = (e, o, a, c) => {
|
|
|
563
563
|
)
|
|
564
564
|
] }) : null
|
|
565
565
|
] });
|
|
566
|
-
},
|
|
567
|
-
(C ?? 0) > 0 || s ?
|
|
568
|
-
v.map((t) =>
|
|
566
|
+
}, vn = () => /* @__PURE__ */ w(yt, { children: [
|
|
567
|
+
(C ?? 0) > 0 || s ? ze("single-row") : null,
|
|
568
|
+
v.map((t) => Yt(t, "single-row")),
|
|
569
569
|
s ? /* @__PURE__ */ w(yt, { children: [
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
an(),
|
|
571
|
+
cn()
|
|
572
572
|
] }) : null,
|
|
573
573
|
R ? _e() : null
|
|
574
|
-
] }),
|
|
575
|
-
isSwipeDragging:
|
|
576
|
-
backdropStyle:
|
|
577
|
-
mediaAreaStyle:
|
|
578
|
-
overlayContentStyle:
|
|
579
|
-
swipeHandlers:
|
|
580
|
-
dismissAreaStyle:
|
|
574
|
+
] }), ee = W((t) => !!(t.closest("[data-controls]") || t.closest(`.${e}-thumbnails`) || t.closest(`.${e}-close-icon`)), [e]), {
|
|
575
|
+
isSwipeDragging: bn,
|
|
576
|
+
backdropStyle: xn,
|
|
577
|
+
mediaAreaStyle: yn,
|
|
578
|
+
overlayContentStyle: wn,
|
|
579
|
+
swipeHandlers: $n,
|
|
580
|
+
dismissAreaStyle: Sn
|
|
581
581
|
} = Kn({
|
|
582
582
|
enabled: q ?? !1,
|
|
583
583
|
onClose: vt,
|
|
584
584
|
animMs: $t,
|
|
585
|
-
isBlockedTarget:
|
|
586
|
-
}),
|
|
585
|
+
isBlockedTarget: ee
|
|
586
|
+
}), ne = () => {
|
|
587
587
|
if (!L || o.length === 0)
|
|
588
588
|
return ot.current = 0, 0;
|
|
589
589
|
const t = S.current[0], n = S.current[o.length];
|
|
@@ -592,30 +592,30 @@ const Xn = (e, o, a, c) => {
|
|
|
592
592
|
return r > 0 && (ot.current = r), ot.current;
|
|
593
593
|
}, Q = (t = !1) => {
|
|
594
594
|
if (!L) return;
|
|
595
|
-
const n = b.current, r =
|
|
595
|
+
const n = b.current, r = ne();
|
|
596
596
|
!n || r <= 0 || r < n.clientWidth * 0.25 || (n.scrollLeft <= 0 ? (n.scrollLeft += r, t && (x.current.scrollLeft += r), U.current && (G.current += r)) : n.scrollLeft >= r * 2 && (n.scrollLeft -= r, t && (x.current.scrollLeft -= r), U.current && (G.current -= r)));
|
|
597
|
-
},
|
|
597
|
+
}, Oe = (t, n = ((r) => (r = b.current) == null ? void 0 : r.scrollLeft)() ?? 0) => {
|
|
598
598
|
if (!L) return t;
|
|
599
599
|
let i = o.length + t, l = 1 / 0;
|
|
600
|
-
for (let u = 0; u <
|
|
600
|
+
for (let u = 0; u < Jt; u++) {
|
|
601
601
|
const h = u * o.length + t, g = S.current[h];
|
|
602
602
|
if (!g) continue;
|
|
603
603
|
const T = Math.abs(g.offsetLeft - n);
|
|
604
604
|
T < l && (l = T, i = h);
|
|
605
605
|
}
|
|
606
606
|
return i;
|
|
607
|
-
},
|
|
607
|
+
}, ke = (t) => {
|
|
608
608
|
const n = b.current;
|
|
609
609
|
return !t || !n ? !1 : t.offsetWidth > n.clientWidth + 1;
|
|
610
|
-
},
|
|
610
|
+
}, re = (t) => {
|
|
611
611
|
const n = b.current;
|
|
612
|
-
if (!t || !n || !
|
|
612
|
+
if (!t || !n || !ke(t)) return !1;
|
|
613
613
|
const r = t.offsetLeft, i = r + t.offsetWidth;
|
|
614
614
|
return n.scrollLeft >= r - 1 && n.scrollLeft + n.clientWidth <= i + 1;
|
|
615
615
|
}, st = (t = ((n) => (n = b.current) == null ? void 0 : n.scrollLeft)() ?? 0) => {
|
|
616
616
|
for (let i = 0; i < S.current.length; i += 1) {
|
|
617
617
|
const l = S.current[i];
|
|
618
|
-
if (l &&
|
|
618
|
+
if (l && re(l))
|
|
619
619
|
return i;
|
|
620
620
|
}
|
|
621
621
|
let r = { flatIndex: 0, distance: 1 / 0 };
|
|
@@ -624,17 +624,17 @@ const Xn = (e, o, a, c) => {
|
|
|
624
624
|
const u = Math.abs(i.offsetLeft - t);
|
|
625
625
|
u < r.distance && (r = { flatIndex: l, distance: u });
|
|
626
626
|
}), r.flatIndex;
|
|
627
|
-
},
|
|
627
|
+
}, Ee = (t) => {
|
|
628
628
|
b.current && S.current.forEach((n) => {
|
|
629
|
-
n && (n.style.scrollSnapAlign =
|
|
629
|
+
n && (n.style.scrollSnapAlign = ke(n) && t === "backward" ? "end" : "start");
|
|
630
630
|
});
|
|
631
|
-
},
|
|
631
|
+
}, Ln = (t, n, r) => {
|
|
632
632
|
const i = t - n, l = st(n), u = S.current[l];
|
|
633
|
-
if (
|
|
633
|
+
if (re(u))
|
|
634
634
|
return st(t) % o.length;
|
|
635
|
-
const h = S.current[l + 1], g = u ? h ? h.offsetLeft - u.offsetLeft : u.offsetWidth : 0, T = g > 0 ? i > g *
|
|
635
|
+
const h = S.current[l + 1], g = u ? h ? h.offsetLeft - u.offsetLeft : u.offsetWidth : 0, T = g > 0 ? i > g * zt ? 1 : i < -g * zt ? -1 : 0 : 0;
|
|
636
636
|
return T === 0 ? r : L ? (r + T + o.length) % o.length : Math.max(0, Math.min(o.length - 1, r + T));
|
|
637
|
-
},
|
|
637
|
+
}, Ke = W((t = !1) => {
|
|
638
638
|
if (ht !== "on" || s) return;
|
|
639
639
|
const n = We.current, r = N.current, i = At.current[r];
|
|
640
640
|
if (!n || !i || n.scrollWidth <= n.clientWidth) return;
|
|
@@ -647,23 +647,23 @@ const Xn = (e, o, a, c) => {
|
|
|
647
647
|
g > u ? I += Nt : h < l && (I -= Nt);
|
|
648
648
|
} else g > u ? I = g - n.clientWidth : I = h;
|
|
649
649
|
n.scrollLeft = Math.max(0, Math.min(T, I));
|
|
650
|
-
}, [s, ht]),
|
|
651
|
-
t && (
|
|
650
|
+
}, [s, ht]), oe = W((t = !1) => {
|
|
651
|
+
t && (Pt.current = !0), lt.current === null && (lt.current = requestAnimationFrame(() => {
|
|
652
652
|
lt.current = null;
|
|
653
|
-
const n =
|
|
654
|
-
|
|
653
|
+
const n = Pt.current;
|
|
654
|
+
Pt.current = !1, Ke(n);
|
|
655
655
|
}));
|
|
656
|
-
}, [
|
|
656
|
+
}, [Ke]), Tn = W((t) => {
|
|
657
657
|
if (t === N.current) return;
|
|
658
658
|
const n = N.current;
|
|
659
659
|
N.current = t;
|
|
660
660
|
const r = Math.abs(t - n) > 1, i = L && o.length > 1 && (n === o.length - 1 && t === 0 || n === 0 && t === o.length - 1);
|
|
661
|
-
|
|
662
|
-
}, [o.length, L,
|
|
661
|
+
Dt(t), oe(r || i);
|
|
662
|
+
}, [o.length, L, oe]), H = () => {
|
|
663
663
|
if (!b.current || o.length === 0 || Z.current !== null || x.current.isActive && x.current.hasMoved) return;
|
|
664
664
|
const t = b.current.scrollLeft, n = st(t) % o.length;
|
|
665
|
-
n !== N.current &&
|
|
666
|
-
},
|
|
665
|
+
n !== N.current && Tn(n);
|
|
666
|
+
}, In = () => {
|
|
667
667
|
Z.current = null;
|
|
668
668
|
}, Y = (t) => {
|
|
669
669
|
const n = b.current;
|
|
@@ -673,7 +673,7 @@ const Xn = (e, o, a, c) => {
|
|
|
673
673
|
(t = it.current) == null || t.call(it), it.current = null;
|
|
674
674
|
}, Mt = () => {
|
|
675
675
|
V.current !== null && (cancelAnimationFrame(V.current), V.current = null), U.current = !1;
|
|
676
|
-
},
|
|
676
|
+
}, Fe = () => {
|
|
677
677
|
const t = b.current;
|
|
678
678
|
if (!t) {
|
|
679
679
|
V.current = null, U.current = !1;
|
|
@@ -681,83 +681,83 @@ const Xn = (e, o, a, c) => {
|
|
|
681
681
|
}
|
|
682
682
|
const n = G.current - t.scrollLeft;
|
|
683
683
|
if (Math.abs(n) < 0.5) {
|
|
684
|
-
t.scrollLeft = G.current, Q(),
|
|
684
|
+
t.scrollLeft = G.current, Q(), H(), V.current = null, U.current = !1;
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
t.scrollLeft += n *
|
|
687
|
+
t.scrollLeft += n * Qn, Q(), H(), D(), V.current = requestAnimationFrame(Fe);
|
|
688
688
|
}, Be = () => {
|
|
689
|
-
const t =
|
|
689
|
+
const t = qt.current;
|
|
690
690
|
t && (t.style.transition = "", t.style.transform = "", t.style.willChange = "");
|
|
691
|
-
},
|
|
692
|
-
Be(), t.scrollLeft = n,
|
|
693
|
-
},
|
|
694
|
-
const l = b.current, u =
|
|
691
|
+
}, De = (t, n, r, i) => {
|
|
692
|
+
Be(), t.scrollLeft = n, Ut.current = t.scrollLeft, Q(), r !== void 0 ? (N.current = r, Dt(r)) : H(), Y(!0), i == null || i();
|
|
693
|
+
}, He = (t, { behavior: n = "smooth", activeIndex: r, onComplete: i } = {}) => {
|
|
694
|
+
const l = b.current, u = qt.current;
|
|
695
695
|
if (!l || !u) return;
|
|
696
696
|
if (Mt(), bt(), Y(!1), n === "auto") {
|
|
697
|
-
|
|
697
|
+
De(l, t, r, i);
|
|
698
698
|
return;
|
|
699
699
|
}
|
|
700
|
-
const h = Math.abs(t - l.scrollLeft), g =
|
|
700
|
+
const h = Math.abs(t - l.scrollLeft), g = Hn(
|
|
701
701
|
h,
|
|
702
|
+
Vn,
|
|
702
703
|
Yn,
|
|
703
|
-
qn,
|
|
704
704
|
l.clientWidth * 0.55
|
|
705
705
|
);
|
|
706
|
-
it.current =
|
|
706
|
+
it.current = Gn(l, u, t, {
|
|
707
707
|
duration: g,
|
|
708
|
-
easing:
|
|
708
|
+
easing: qn,
|
|
709
709
|
onComplete: () => {
|
|
710
|
-
it.current = null,
|
|
710
|
+
it.current = null, De(l, t, r, i);
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
},
|
|
713
|
+
}, Wn = (t = "smooth") => {
|
|
714
714
|
const n = b.current;
|
|
715
715
|
if (!n || o.length === 0) return;
|
|
716
|
-
const r = st() % o.length, i =
|
|
717
|
-
l &&
|
|
718
|
-
},
|
|
716
|
+
const r = st() % o.length, i = Oe(r, n.scrollLeft), l = S.current[i];
|
|
717
|
+
l && He(l.offsetLeft, { behavior: t, activeIndex: r });
|
|
718
|
+
}, An = (t, n = "smooth", r, i) => {
|
|
719
719
|
const l = b.current;
|
|
720
720
|
if (!l || o.length === 0) return;
|
|
721
721
|
const u = (i ?? l.scrollLeft) - t, h = st(t), g = S.current[h];
|
|
722
|
-
if (
|
|
723
|
-
Y(!0),
|
|
722
|
+
if (re(g)) {
|
|
723
|
+
Y(!0), H();
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
726
|
const T = S.current[h + 1], I = g ? T ? T.offsetLeft - g.offsetLeft : g.offsetWidth : 0;
|
|
727
|
-
if ((I > 0 ? u > I *
|
|
728
|
-
const
|
|
727
|
+
if ((I > 0 ? u > I * zt ? 1 : u < -I * zt ? -1 : 0 : 0) !== 0) {
|
|
728
|
+
const zn = r ?? h % o.length, On = Ln(
|
|
729
729
|
i ?? l.scrollLeft,
|
|
730
730
|
t,
|
|
731
|
-
|
|
731
|
+
zn
|
|
732
732
|
);
|
|
733
|
-
at(
|
|
733
|
+
at(On, n);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
736
|
const xt = i ?? l.scrollLeft, Nt = st(xt), je = S.current[Nt];
|
|
737
737
|
if (je && Math.abs(je.offsetLeft - xt) < 1) {
|
|
738
|
-
Y(!0),
|
|
738
|
+
Y(!0), H();
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
741
|
+
Wn("auto");
|
|
742
742
|
}, at = (t, n = "smooth") => {
|
|
743
743
|
const r = b.current;
|
|
744
744
|
if (!r || o.length === 0) return;
|
|
745
|
-
const i =
|
|
746
|
-
l && (n === "smooth" ? Z.current = t : Z.current = null, N.current = t,
|
|
745
|
+
const i = Oe(t, r.scrollLeft), l = S.current[i];
|
|
746
|
+
l && (n === "smooth" ? Z.current = t : Z.current = null, N.current = t, Dt(t), oe(!0), He(l.offsetLeft, {
|
|
747
747
|
behavior: n,
|
|
748
748
|
activeIndex: t,
|
|
749
|
-
onComplete: n === "smooth" ?
|
|
749
|
+
onComplete: n === "smooth" ? In : void 0
|
|
750
750
|
}));
|
|
751
|
-
},
|
|
751
|
+
}, ie = () => {
|
|
752
752
|
gt.current && (window.removeEventListener("pointerup", gt.current), window.removeEventListener("pointercancel", gt.current), gt.current = null);
|
|
753
|
-
},
|
|
753
|
+
}, Rn = (t, n, r, i, l) => {
|
|
754
754
|
const u = r - t, h = i - n, g = Math.abs(u), T = Math.abs(h);
|
|
755
|
-
if (g <
|
|
755
|
+
if (g < tr || g <= T) return !1;
|
|
756
756
|
const I = u < 0 ? 1 : -1, ct = L ? (l + I + o.length) % o.length : Math.max(0, Math.min(o.length - 1, l + I));
|
|
757
757
|
return ct === l ? !1 : (at(ct), !0);
|
|
758
758
|
}, Ct = (t) => {
|
|
759
759
|
if (!x.current.isActive) return;
|
|
760
|
-
|
|
760
|
+
ie();
|
|
761
761
|
const n = b.current;
|
|
762
762
|
if (!n) return;
|
|
763
763
|
const { scrollLeft: r, startActiveIndex: i, hasMoved: l } = x.current, u = n.scrollLeft;
|
|
@@ -767,20 +767,20 @@ const Xn = (e, o, a, c) => {
|
|
|
767
767
|
scrollLeft: 0,
|
|
768
768
|
startActiveIndex: 0,
|
|
769
769
|
hasMoved: !1
|
|
770
|
-
}, Ae(!1), t !== void 0 && n.hasPointerCapture(t) && n.releasePointerCapture(t), l ?
|
|
771
|
-
},
|
|
770
|
+
}, Ae(!1), t !== void 0 && n.hasPointerCapture(t) && n.releasePointerCapture(t), l ? An(r, "smooth", i, u) : (Y(!0), H()), D();
|
|
771
|
+
}, Mn = (t, n) => {
|
|
772
772
|
const r = Rt.current;
|
|
773
|
-
Rt.current = null, r && (
|
|
773
|
+
Rt.current = null, r && (Rn(
|
|
774
774
|
r.startX,
|
|
775
775
|
r.startY,
|
|
776
776
|
t,
|
|
777
777
|
n,
|
|
778
778
|
r.startActiveIndex
|
|
779
|
-
),
|
|
780
|
-
},
|
|
779
|
+
), D());
|
|
780
|
+
}, Cn = (t) => {
|
|
781
781
|
if (!pt) return;
|
|
782
782
|
if (t.pointerType === "touch") {
|
|
783
|
-
if (Mt(), Y(!0),
|
|
783
|
+
if (Mt(), Y(!0), ee(t.target)) return;
|
|
784
784
|
Rt.current = {
|
|
785
785
|
startX: t.clientX,
|
|
786
786
|
startY: t.clientY,
|
|
@@ -788,7 +788,7 @@ const Xn = (e, o, a, c) => {
|
|
|
788
788
|
};
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
if (t.pointerType !== "mouse" || t.button !== 0 ||
|
|
791
|
+
if (t.pointerType !== "mouse" || t.button !== 0 || ee(t.target)) return;
|
|
792
792
|
const n = b.current;
|
|
793
793
|
if (!n) return;
|
|
794
794
|
Mt(), bt(), Be(), Z.current = null, x.current = {
|
|
@@ -797,12 +797,12 @@ const Xn = (e, o, a, c) => {
|
|
|
797
797
|
scrollLeft: n.scrollLeft,
|
|
798
798
|
startActiveIndex: N.current,
|
|
799
799
|
hasMoved: !1
|
|
800
|
-
}, Y(!1),
|
|
800
|
+
}, Y(!1), D(), n.setPointerCapture(t.pointerId), ie();
|
|
801
801
|
const r = (i) => {
|
|
802
802
|
i.pointerType === "mouse" && Ct(i.pointerId);
|
|
803
803
|
};
|
|
804
804
|
gt.current = r, window.addEventListener("pointerup", r), window.addEventListener("pointercancel", r);
|
|
805
|
-
},
|
|
805
|
+
}, Nn = (t) => {
|
|
806
806
|
if (!pt || t.pointerType !== "mouse") return;
|
|
807
807
|
const n = b.current;
|
|
808
808
|
if (!n || !x.current.isActive) return;
|
|
@@ -811,56 +811,56 @@ const Xn = (e, o, a, c) => {
|
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
const r = t.clientX - x.current.startX;
|
|
814
|
-
Math.abs(r) >
|
|
814
|
+
Math.abs(r) > Pn && (x.current.hasMoved = !0, Ae(!0)), x.current.hasMoved && (t.preventDefault(), n.scrollLeft = x.current.scrollLeft - r, Q(!0), H(), D());
|
|
815
815
|
}, Xe = (t) => {
|
|
816
816
|
if (pt) {
|
|
817
817
|
if (t.pointerType === "touch") {
|
|
818
|
-
t.type === "pointerup" ?
|
|
818
|
+
t.type === "pointerup" ? Mn(t.clientX, t.clientY) : Rt.current = null;
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
821
|
t.pointerType === "mouse" && Ct(t.pointerId);
|
|
822
822
|
}
|
|
823
|
-
},
|
|
823
|
+
}, _n = (t) => {
|
|
824
824
|
!pt || t.pointerType !== "mouse" || Ct(t.pointerId);
|
|
825
825
|
};
|
|
826
|
-
return
|
|
826
|
+
return Bn(), ft(() => {
|
|
827
827
|
const t = requestAnimationFrame(() => Me(!0));
|
|
828
828
|
return () => {
|
|
829
|
-
cancelAnimationFrame(t), bt(),
|
|
829
|
+
cancelAnimationFrame(t), bt(), ie(), lt.current !== null && (cancelAnimationFrame(lt.current), lt.current = null), te.current && clearTimeout(te.current), J.current && clearTimeout(J.current);
|
|
830
830
|
};
|
|
831
831
|
}, []), ft(() => {
|
|
832
832
|
if (!mt) {
|
|
833
|
-
|
|
833
|
+
Qt(!0);
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
const t = () =>
|
|
836
|
+
D();
|
|
837
|
+
const t = () => D();
|
|
838
838
|
return document.addEventListener("pointermove", t, { passive: !0 }), document.addEventListener("pointerdown", t, { passive: !0 }), () => {
|
|
839
839
|
document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t), J.current && clearTimeout(J.current);
|
|
840
840
|
};
|
|
841
|
-
}, [mt,
|
|
841
|
+
}, [mt, D]), ft(() => {
|
|
842
842
|
const t = (n) => {
|
|
843
843
|
n.key === "Escape" && vt();
|
|
844
844
|
};
|
|
845
845
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
846
|
-
}, [vt]),
|
|
847
|
-
|
|
848
|
-
}, [dt, o.length, L]),
|
|
846
|
+
}, [vt]), le(() => {
|
|
847
|
+
ne();
|
|
848
|
+
}, [dt, o.length, L]), le(() => {
|
|
849
849
|
s || at(N.current, "auto");
|
|
850
|
-
}, [dt, s]),
|
|
850
|
+
}, [dt, s]), le(() => {
|
|
851
851
|
at(0, "auto");
|
|
852
852
|
}, [o.length, L]), ft(() => {
|
|
853
853
|
const t = b.current;
|
|
854
854
|
if (!t || s || !q) return;
|
|
855
855
|
const n = (r) => {
|
|
856
856
|
if (r.preventDefault(), Math.abs(r.deltaY) <= Math.abs(r.deltaX)) return;
|
|
857
|
-
const i = r.deltaMode === 1 ?
|
|
857
|
+
const i = r.deltaMode === 1 ? Jn : r.deltaMode === 2 ? t.clientHeight : 1, l = r.deltaY * i * Zn;
|
|
858
858
|
if (l !== 0) {
|
|
859
859
|
if (bt(), U.current || (U.current = !0, G.current = t.scrollLeft, Z.current = null, Y(!1)), G.current += l, !L) {
|
|
860
860
|
const u = t.scrollWidth - t.clientWidth;
|
|
861
861
|
G.current = Math.max(0, Math.min(u, G.current));
|
|
862
862
|
}
|
|
863
|
-
|
|
863
|
+
D(), V.current === null && (V.current = requestAnimationFrame(Fe));
|
|
864
864
|
}
|
|
865
865
|
};
|
|
866
866
|
return t.addEventListener("wheel", n, { passive: !1 }), () => {
|
|
@@ -871,18 +871,18 @@ const Xn = (e, o, a, c) => {
|
|
|
871
871
|
if (!t) return;
|
|
872
872
|
const n = () => {
|
|
873
873
|
Q(x.current.isActive);
|
|
874
|
-
const i = t.scrollLeft, l = i -
|
|
875
|
-
|
|
874
|
+
const i = t.scrollLeft, l = i - Ut.current;
|
|
875
|
+
Ut.current = i;
|
|
876
876
|
const u = ot.current > 0 ? ot.current * 0.5 : 1 / 0;
|
|
877
877
|
if (l !== 0 && Math.abs(l) < u) {
|
|
878
878
|
const h = l > 0 ? "forward" : "backward";
|
|
879
|
-
h !==
|
|
879
|
+
h !== Zt.current && (Zt.current = h, Ee(h));
|
|
880
880
|
}
|
|
881
|
-
x.current.isActive && x.current.hasMoved ||
|
|
881
|
+
x.current.isActive && x.current.hasMoved || H();
|
|
882
882
|
};
|
|
883
883
|
t.addEventListener("scroll", n, { passive: !0 });
|
|
884
884
|
const r = new ResizeObserver(() => {
|
|
885
|
-
|
|
885
|
+
ne(), Q(x.current.isActive), Ee(Zt.current), H();
|
|
886
886
|
});
|
|
887
887
|
return r.observe(t), () => {
|
|
888
888
|
bt(), t.removeEventListener("scroll", n), r.disconnect();
|
|
@@ -893,7 +893,7 @@ const Xn = (e, o, a, c) => {
|
|
|
893
893
|
"data-selection": "none",
|
|
894
894
|
className: `${e}-lightbox${c ? ` ${e}-lightbox-editor` : ""}${s ? ` ${e}-lightbox-edit-mode` : ""}`,
|
|
895
895
|
onClick: () => {
|
|
896
|
-
|
|
896
|
+
bn || vt();
|
|
897
897
|
},
|
|
898
898
|
role: "dialog",
|
|
899
899
|
"aria-modal": "true",
|
|
@@ -904,30 +904,30 @@ const Xn = (e, o, a, c) => {
|
|
|
904
904
|
pointerEvents: Re ? "auto" : "none"
|
|
905
905
|
},
|
|
906
906
|
children: [
|
|
907
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor: $, ...
|
|
907
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor: $, ...xn } }),
|
|
908
908
|
/* @__PURE__ */ w(
|
|
909
909
|
"div",
|
|
910
910
|
{
|
|
911
|
-
ref:
|
|
911
|
+
ref: hn,
|
|
912
912
|
className: `${e}-lightbox-dismiss-area`,
|
|
913
|
-
style:
|
|
914
|
-
|
|
913
|
+
style: Sn,
|
|
914
|
+
...$n,
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style:
|
|
916
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style: yn, onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ f(
|
|
917
917
|
"div",
|
|
918
918
|
{
|
|
919
919
|
ref: b,
|
|
920
920
|
className: `${e}-lightbox-strip`,
|
|
921
921
|
"data-lightbox-scrollable": "",
|
|
922
922
|
"data-mouse-draggable": pt && o.length > 0 ? "true" : "false",
|
|
923
|
-
"data-mouse-dragging":
|
|
924
|
-
onPointerDown:
|
|
925
|
-
onPointerMove:
|
|
923
|
+
"data-mouse-dragging": mn ? "true" : "false",
|
|
924
|
+
onPointerDown: Cn,
|
|
925
|
+
onPointerMove: Nn,
|
|
926
926
|
onPointerUp: Xe,
|
|
927
927
|
onPointerCancel: Xe,
|
|
928
|
-
onLostPointerCapture:
|
|
929
|
-
children: /* @__PURE__ */ f("div", { ref:
|
|
930
|
-
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u =
|
|
928
|
+
onLostPointerCapture: _n,
|
|
929
|
+
children: /* @__PURE__ */ f("div", { ref: qt, className: `${e}-lightbox-strip-track`, style: { gap: dt }, children: dn.map((t, n) => {
|
|
930
|
+
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u = Ot(dt), h = `calc(-0.5 * (${u} + ${dt}))`;
|
|
931
931
|
return /* @__PURE__ */ w(
|
|
932
932
|
"div",
|
|
933
933
|
{
|
|
@@ -976,7 +976,7 @@ const Xn = (e, o, a, c) => {
|
|
|
976
976
|
{
|
|
977
977
|
className: `${e}-lightbox-content-inner`,
|
|
978
978
|
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
979
|
-
style:
|
|
979
|
+
style: wn,
|
|
980
980
|
children: [
|
|
981
981
|
/* @__PURE__ */ f(
|
|
982
982
|
"div",
|
|
@@ -999,7 +999,7 @@ const Xn = (e, o, a, c) => {
|
|
|
999
999
|
left: 0,
|
|
1000
1000
|
right: 0,
|
|
1001
1001
|
top: 0,
|
|
1002
|
-
height:
|
|
1002
|
+
height: Pe,
|
|
1003
1003
|
pointerEvents: "auto",
|
|
1004
1004
|
zIndex: 3
|
|
1005
1005
|
}
|
|
@@ -1007,17 +1007,17 @@ const Xn = (e, o, a, c) => {
|
|
|
1007
1007
|
)
|
|
1008
1008
|
}
|
|
1009
1009
|
),
|
|
1010
|
-
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${_ ? ` ${e}-lightbox-content-area-stacked` : ""}`, children: (Te || R) && /* @__PURE__ */ f("div", { className: `${e}-header ${_ ? `${e}-header-two-row` : `${e}-header-single-row`}`, children: _ ?
|
|
1010
|
+
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${_ ? ` ${e}-lightbox-content-area-stacked` : ""}`, children: (Te || R) && /* @__PURE__ */ f("div", { className: `${e}-header ${_ ? `${e}-header-two-row` : `${e}-header-single-row`}`, children: _ ? gn() : Te || R ? vn() : null }) }) })
|
|
1011
1011
|
]
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
1014
|
o.length > 1 && ht === "on" && (() => {
|
|
1015
|
-
const t =
|
|
1015
|
+
const t = Ot(Bt), n = `calc(-0.5 * (${Bt} + ${t}))`;
|
|
1016
1016
|
return /* @__PURE__ */ f(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
className: `${e}-thumbnails-wrap`,
|
|
1020
|
-
style: { bottom:
|
|
1020
|
+
style: { bottom: Bt },
|
|
1021
1021
|
children: /* @__PURE__ */ f(
|
|
1022
1022
|
"div",
|
|
1023
1023
|
{
|
|
@@ -1029,14 +1029,14 @@ const Xn = (e, o, a, c) => {
|
|
|
1029
1029
|
"div",
|
|
1030
1030
|
{
|
|
1031
1031
|
className: `${e}-thumbnails-track`,
|
|
1032
|
-
"data-thumbnail-active":
|
|
1032
|
+
"data-thumbnail-active": qe,
|
|
1033
1033
|
style: {
|
|
1034
|
-
gap:
|
|
1035
|
-
"--thumbnail-active-color":
|
|
1034
|
+
gap: Ft,
|
|
1035
|
+
"--thumbnail-active-color": Ue
|
|
1036
1036
|
},
|
|
1037
1037
|
children: [
|
|
1038
1038
|
o.map((r, i) => {
|
|
1039
|
-
const l =
|
|
1039
|
+
const l = Ot(Ft), u = `calc(-0.5 * (${l} + ${Ft}))`;
|
|
1040
1040
|
return /* @__PURE__ */ w(
|
|
1041
1041
|
"div",
|
|
1042
1042
|
{
|
|
@@ -1052,7 +1052,7 @@ const Xn = (e, o, a, c) => {
|
|
|
1052
1052
|
className: `${e}-thumb`,
|
|
1053
1053
|
"data-active": nt === i ? "true" : "false",
|
|
1054
1054
|
onClick: () => q && St === "click" && at(i),
|
|
1055
|
-
onMouseEnter: () =>
|
|
1055
|
+
onMouseEnter: () => en && St === "hover" && at(i),
|
|
1056
1056
|
"aria-label": r.image.name ? `View ${r.image.name}` : `View image ${i + 1}`,
|
|
1057
1057
|
"aria-current": nt === i ? "true" : void 0,
|
|
1058
1058
|
children: /* @__PURE__ */ f(
|
|
@@ -1063,7 +1063,7 @@ const Xn = (e, o, a, c) => {
|
|
|
1063
1063
|
alt: "",
|
|
1064
1064
|
draggable: !1,
|
|
1065
1065
|
style: {
|
|
1066
|
-
...
|
|
1066
|
+
...nn,
|
|
1067
1067
|
maxWidth: be,
|
|
1068
1068
|
maxHeight: be,
|
|
1069
1069
|
width: Lt.display === "cover" ? "auto" : "100%",
|
|
@@ -1126,8 +1126,8 @@ const Xn = (e, o, a, c) => {
|
|
|
1126
1126
|
]
|
|
1127
1127
|
}
|
|
1128
1128
|
);
|
|
1129
|
-
},
|
|
1130
|
-
function
|
|
1129
|
+
}, ce = 400, ue = "cubic-bezier(0.25, 0.1, 0.25, 1)", hr = 1.1;
|
|
1130
|
+
function dr(e) {
|
|
1131
1131
|
return `
|
|
1132
1132
|
.${e}-wrapper {
|
|
1133
1133
|
position: relative;
|
|
@@ -1173,23 +1173,29 @@ function mr(e) {
|
|
|
1173
1173
|
max-width: 100%;
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
+
@property --${e}-hover-zoom {
|
|
1177
|
+
syntax: '<number>';
|
|
1178
|
+
inherits: false;
|
|
1179
|
+
initial-value: 1;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1176
1182
|
.${e}-hover-zoom-in .${e}-cover-image {
|
|
1177
|
-
|
|
1178
|
-
|
|
1183
|
+
transform: scale(var(--${e}-hover-zoom));
|
|
1184
|
+
clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)));
|
|
1185
|
+
transition: --${e}-hover-zoom ${ce}ms ${ue};
|
|
1179
1186
|
}
|
|
1180
1187
|
|
|
1181
1188
|
.${e}-hover-scale-down .${e}-cover-image {
|
|
1182
|
-
transition: transform ${
|
|
1189
|
+
transition: transform ${ce}ms ${ue};
|
|
1183
1190
|
}
|
|
1184
1191
|
|
|
1185
1192
|
.${e}-hover-greyscale .${e}-cover-image {
|
|
1186
|
-
transition: filter ${
|
|
1193
|
+
transition: filter ${ce}ms ${ue};
|
|
1187
1194
|
}
|
|
1188
1195
|
|
|
1189
1196
|
@media (hover: hover) {
|
|
1190
1197
|
.${e}-hover-zoom-in .${e}-cover:hover .${e}-cover-image {
|
|
1191
|
-
|
|
1192
|
-
clip-path: inset(${dr});
|
|
1198
|
+
--${e}-hover-zoom: ${hr};
|
|
1193
1199
|
}
|
|
1194
1200
|
.${e}-hover-scale-down .${e}-cover:hover .${e}-cover-image {
|
|
1195
1201
|
transform: scale(0.9);
|
|
@@ -1541,26 +1547,26 @@ function mr(e) {
|
|
|
1541
1547
|
}
|
|
1542
1548
|
`;
|
|
1543
1549
|
}
|
|
1544
|
-
const
|
|
1545
|
-
const { prefix: m } =
|
|
1546
|
-
M.length !== 0 &&
|
|
1550
|
+
const Lr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode: s, portalId: d }) => {
|
|
1551
|
+
const { prefix: m } = En(), { cover: $, coverFit: A, hover: K = "none" } = e, O = K !== "none" && (!a || s) ? ` ${m}-hover-${K}` : "", P = p(null), [R, F] = wt(!1), M = o ?? [], tt = R && M.length > 0, St = () => {
|
|
1552
|
+
M.length !== 0 && F(!0);
|
|
1547
1553
|
};
|
|
1548
1554
|
return ft(() => {
|
|
1549
|
-
!a || c || s ||
|
|
1555
|
+
!a || c || s || F(!1);
|
|
1550
1556
|
}, [a, c, s]), /* @__PURE__ */ w(yt, { children: [
|
|
1551
|
-
/* @__PURE__ */ w("div", { ref: P, className: `${m}-wrapper${
|
|
1552
|
-
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html:
|
|
1557
|
+
/* @__PURE__ */ w("div", { ref: P, className: `${m}-wrapper${O}`, children: [
|
|
1558
|
+
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html: dr(m) } }),
|
|
1553
1559
|
$ && /* @__PURE__ */ f(
|
|
1554
1560
|
"div",
|
|
1555
1561
|
{
|
|
1556
|
-
className: `${m}-cover ${
|
|
1562
|
+
className: `${m}-cover ${Et(A) ? `${m}-ratio-wrapper-cover` : `${m}-ratio-wrapper-fit`}`,
|
|
1557
1563
|
onClick: () => St(),
|
|
1558
|
-
style: { ...
|
|
1564
|
+
style: { ...Et(A) ? { "--image-aspect-ratio": Ve(A) } : {} },
|
|
1559
1565
|
"aria-label": "Open image gallery",
|
|
1560
1566
|
children: /* @__PURE__ */ f(
|
|
1561
1567
|
"img",
|
|
1562
1568
|
{
|
|
1563
|
-
className: `${m}-cover-image ${
|
|
1569
|
+
className: `${m}-cover-image ${Et(A) ? `${m}-cover-image-cover` : `${m}-cover-image-fit`}`,
|
|
1564
1570
|
src: $,
|
|
1565
1571
|
alt: "cover"
|
|
1566
1572
|
}
|
|
@@ -1570,9 +1576,9 @@ const Tr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode
|
|
|
1570
1576
|
] }),
|
|
1571
1577
|
tt && typeof document < "u" && (() => {
|
|
1572
1578
|
const ht = (d ? document.getElementById(d) : null) ?? document.body;
|
|
1573
|
-
return
|
|
1579
|
+
return kn(
|
|
1574
1580
|
/* @__PURE__ */ f(
|
|
1575
|
-
|
|
1581
|
+
fr,
|
|
1576
1582
|
{
|
|
1577
1583
|
prefix: m,
|
|
1578
1584
|
images: M,
|
|
@@ -1580,7 +1586,7 @@ const Tr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode
|
|
|
1580
1586
|
isEditor: a,
|
|
1581
1587
|
isEditMode: c,
|
|
1582
1588
|
isPreviewMode: s,
|
|
1583
|
-
onClose: () =>
|
|
1589
|
+
onClose: () => F(!1)
|
|
1584
1590
|
}
|
|
1585
1591
|
),
|
|
1586
1592
|
ht
|
|
@@ -1589,12 +1595,12 @@ const Tr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode
|
|
|
1589
1595
|
] });
|
|
1590
1596
|
};
|
|
1591
1597
|
export {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
+
Lr as LightboxStrip,
|
|
1599
|
+
nr as STRIP_TEXT_STYLE_PREFIXES,
|
|
1600
|
+
rr as STRIP_TEXT_STYLE_TAB_LABELS,
|
|
1601
|
+
Sr as createStripTextStylePanelTab,
|
|
1602
|
+
ar as createStripTextStyleTabContentItems,
|
|
1603
|
+
lr as extractTitlesFromLegacyText,
|
|
1598
1604
|
X as getStripTextStyleSettingKey,
|
|
1599
|
-
|
|
1605
|
+
sr as resolveStripItemTitles
|
|
1600
1606
|
};
|