@cntrl-site/components 1.0.106-alpha.0 → 1.0.107-alpha.0
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/ClickGallerie-CYQMgrIr.js +36 -0
- package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
- package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
- package/dist/Components/Helix/Helix.d.ts +4 -1
- package/dist/Components/Hive/Hive.d.ts +4 -1
- package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
- package/dist/Components/List/List.d.ts +6 -2
- package/dist/Components/Marquee/Marquee.d.ts +6 -2
- package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
- package/dist/Components/Mercury/Mercury.d.ts +4 -1
- package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
- package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
- package/dist/Components/utils/LinkWrapper.d.ts +16 -0
- package/dist/Components/utils/embedMedia.d.ts +40 -0
- package/dist/Components/utils/index.d.ts +6 -0
- package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
- package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
- package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
- package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
- package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
- package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
- package/dist/Grid-CFHTP3mb.js +378 -0
- package/dist/Grid-e-gLfsji.mjs +1590 -0
- package/dist/Helix-BpLo9FD3.js +43 -0
- package/dist/Helix-CidI3ucE.mjs +324 -0
- package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
- package/dist/Hive-D1j6wZpV.js +321 -0
- package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
- package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
- package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
- package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
- package/dist/LinkWrapper-Ca84iPtg.js +1 -0
- package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
- package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
- package/dist/List-DVvpQ24J.js +377 -0
- package/dist/Marquee-DByooiWP.mjs +578 -0
- package/dist/Marquee-DfIP-tIN.js +133 -0
- package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
- package/dist/MarqueeText-DsUiV6Zv.js +132 -0
- package/dist/Mercury-B-s2Kvuq.js +267 -0
- package/dist/Mercury-CCW0Es-s.mjs +1700 -0
- package/dist/PretextComponent-Dnbenstn.js +1 -0
- package/dist/{PretextComponent-j-OsRZTx.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
- package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
- package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
- package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
- package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
- package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
- package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
- package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
- package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
- package/dist/Waterfall-3kKioKh2.mjs +1432 -0
- package/dist/Waterfall-DII4-WV5.js +288 -0
- package/dist/{components-D2LyuDm-.mjs → components-BRmbflgg.mjs} +15 -15
- package/dist/components-nvbH4l0S.js +1 -0
- package/dist/content/postFieldBindings.d.ts +29 -0
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +16 -16
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +52 -15
- package/dist/sources.js +312 -212
- package/dist/sources.mjs +312 -212
- package/dist/types/SchemaV1.d.ts +53 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +30 -20
- package/package.json +1 -1
- package/dist/ClickGallerie-D7g093HX.js +0 -36
- package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
- package/dist/Grid-BBpdl60K.js +0 -374
- package/dist/Grid-DS53S_gA.mjs +0 -1576
- package/dist/Helix-BPn9V1sg.mjs +0 -315
- package/dist/Helix-DcgsCc4D.js +0 -43
- package/dist/Hive-n8Fz-j3o.js +0 -321
- package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
- package/dist/List-C32WImI3.js +0 -377
- package/dist/Marquee-DOIRRCu4.js +0 -133
- package/dist/Marquee-O_PDwlIb.mjs +0 -564
- package/dist/MarqueeText-DkaO2lQ5.js +0 -132
- package/dist/Mercury-C9D10TTT.mjs +0 -1702
- package/dist/Mercury-DynO-NxY.js +0 -267
- package/dist/PretextComponent-BnsS2zJ6.js +0 -1
- package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
- package/dist/Waterfall-DC2WQ3GT.js +0 -287
- package/dist/Waterfall-Yud2VR62.mjs +0 -1404
- package/dist/components-B9Vdjf0w.js +0 -1
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { jsxs as fe, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Z, useMemo as P, useRef as _, useLayoutEffect as X, useEffect as we, useCallback as $e } from "react";
|
|
3
|
+
import re from "classnames";
|
|
4
|
+
import { s as We } from "./scalingValue-C9JH5L6O.mjs";
|
|
5
|
+
import { u as Ie } from "./useScopedStyles-DhBG3557.mjs";
|
|
6
|
+
import { p as Re, r as Ce, a as Me } from "./useLazyVideos-CxXyEjRQ.mjs";
|
|
7
|
+
import { L as Te } from "./LinkWrapper-DZs9hlOn.mjs";
|
|
8
|
+
import { i as ke, g as Ve, E as Oe } from "./EmbedMediaFrame-DwHeOAy5.mjs";
|
|
9
|
+
import { o as Ee, N as Be } from "./observeIntersection-B0f3L2iK.mjs";
|
|
10
|
+
function Le(e, n) {
|
|
11
|
+
const r = n > 0 ? `${n}px` : "0px";
|
|
12
|
+
return `
|
|
13
|
+
.${e}-marquee-wrapper {
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: auto;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes ${e}-marquee-left {
|
|
20
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
21
|
+
to { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes ${e}-marquee-right {
|
|
25
|
+
from { -webkit-transform: translate3d(-${r}, 0, 0); transform: translate3d(-${r}, 0, 0); }
|
|
26
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.${e}-marquee-track {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
width: max-content;
|
|
33
|
+
will-change: transform;
|
|
34
|
+
backface-visibility: hidden;
|
|
35
|
+
-webkit-backface-visibility: hidden;
|
|
36
|
+
flex-wrap: nowrap;
|
|
37
|
+
-webkit-animation-timing-function: linear;
|
|
38
|
+
animation-timing-function: linear;
|
|
39
|
+
-webkit-animation-iteration-count: infinite;
|
|
40
|
+
animation-iteration-count: infinite;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
44
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
45
|
+
animation-name: ${e}-marquee-left;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
49
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
50
|
+
animation-name: ${e}-marquee-right;
|
|
51
|
+
}
|
|
52
|
+
.${e}-marquee-row {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: flex-start;
|
|
56
|
+
}
|
|
57
|
+
.${e}-marquee-set {
|
|
58
|
+
flex: 0 0 auto;
|
|
59
|
+
}
|
|
60
|
+
.${e}-marquee-static {
|
|
61
|
+
justify-content: center;
|
|
62
|
+
overflow-x: auto;
|
|
63
|
+
}
|
|
64
|
+
.${e}-marquee-card {
|
|
65
|
+
position: relative;
|
|
66
|
+
flex: 0 0 auto;
|
|
67
|
+
align-self: flex-start;
|
|
68
|
+
}
|
|
69
|
+
.${e}-wrapper {
|
|
70
|
+
position: relative;
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 100%;
|
|
73
|
+
order: 1;
|
|
74
|
+
}
|
|
75
|
+
.${e}-cover {
|
|
76
|
+
position: absolute;
|
|
77
|
+
width: 100%;
|
|
78
|
+
height: 100%;
|
|
79
|
+
top: 0;
|
|
80
|
+
left: 0;
|
|
81
|
+
}
|
|
82
|
+
.${e}-elements-overlay {
|
|
83
|
+
position: relative;
|
|
84
|
+
inset: 0;
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
.${e}-control {
|
|
90
|
+
position: relative;
|
|
91
|
+
z-index: 2;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.${e}-marquee-link {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
text-decoration: none;
|
|
103
|
+
color: inherit;
|
|
104
|
+
}
|
|
105
|
+
.${e}-marquee-link-contain {
|
|
106
|
+
width: auto;
|
|
107
|
+
height: auto;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.${e}-control::before {
|
|
111
|
+
content: "";
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
left: 0;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
min-height: 20px;
|
|
118
|
+
pointer-events: auto;
|
|
119
|
+
z-index: 10;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.${e}-gap-control {
|
|
123
|
+
position: relative;
|
|
124
|
+
z-index: 2;
|
|
125
|
+
pointer-events: auto;
|
|
126
|
+
height: 100%;
|
|
127
|
+
}
|
|
128
|
+
.${e}-image-hover-brightness img,
|
|
129
|
+
.${e}-image-hover-brightness video {
|
|
130
|
+
transition: filter 0.3s ease;
|
|
131
|
+
}
|
|
132
|
+
.${e}-image-hover-brightness:hover img,
|
|
133
|
+
.${e}-image-hover-brightness:hover video {
|
|
134
|
+
filter: brightness(1.25);
|
|
135
|
+
}
|
|
136
|
+
.${e}-image-hover-grayscale img,
|
|
137
|
+
.${e}-image-hover-grayscale video {
|
|
138
|
+
transition: filter 0.3s ease;
|
|
139
|
+
}
|
|
140
|
+
.${e}-image-hover-grayscale:hover img,
|
|
141
|
+
.${e}-image-hover-grayscale:hover video {
|
|
142
|
+
filter: grayscale(100%);
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
const He = 30, ze = 20, me = 3, je = 12, Ue = 32, Fe = 3, Ge = 250, Xe = 0.5, De = (e) => {
|
|
147
|
+
e.style.setProperty("animation-name", "none"), e.style.setProperty("-webkit-animation-name", "none"), e.offsetHeight, e.style.removeProperty("animation-name"), e.style.removeProperty("-webkit-animation-name");
|
|
148
|
+
}, Ke = (e, n) => Array.from({ length: n }, () => e).flat(), Qe = (e) => typeof e == "string" ? {
|
|
149
|
+
display: e.toLowerCase() === "cover" ? "cover" : "fit",
|
|
150
|
+
ratioValue: "16:9",
|
|
151
|
+
reversed: !1
|
|
152
|
+
} : {
|
|
153
|
+
display: (typeof (e == null ? void 0 : e.display) == "string" ? e.display.toLowerCase() : "") === "cover" ? "cover" : "fit",
|
|
154
|
+
ratioValue: (e == null ? void 0 : e.ratioValue) ?? "16:9",
|
|
155
|
+
reversed: (e == null ? void 0 : e.reversed) ?? !1
|
|
156
|
+
}, xe = (e) => e.reduce(
|
|
157
|
+
(n, r) => n + (r.offsetWidth || r.getBoundingClientRect().width),
|
|
158
|
+
0
|
|
159
|
+
), qe = (e, n) => {
|
|
160
|
+
if (n <= 0 || e.children.length < n) return 0;
|
|
161
|
+
const r = e.children[0], l = e.children[n - 1];
|
|
162
|
+
if (!r || !l) return 0;
|
|
163
|
+
const m = getComputedStyle(e), d = Number.parseFloat(m.columnGap || m.gap || "0") || 0, y = l.getBoundingClientRect().right - r.getBoundingClientRect().left;
|
|
164
|
+
if (y > 0) return y;
|
|
165
|
+
const q = Array.from({ length: n }, ($, W) => e.children[W]), f = xe(q);
|
|
166
|
+
return f <= 0 ? 0 : f + d * Math.max(0, n - 1);
|
|
167
|
+
}, Ye = (e) => {
|
|
168
|
+
const n = e.getBoundingClientRect().width;
|
|
169
|
+
if (n > 0) return n;
|
|
170
|
+
const r = e.offsetWidth;
|
|
171
|
+
if (r > 0) return r;
|
|
172
|
+
const l = xe(Array.from(e.children));
|
|
173
|
+
if (l <= 0) return 0;
|
|
174
|
+
const m = getComputedStyle(e), d = Number.parseFloat(m.columnGap || m.gap || "0") || 0, y = Number.parseFloat(m.paddingRight) || 0;
|
|
175
|
+
return l + d * Math.max(0, e.children.length - 1) + y;
|
|
176
|
+
}, Je = (e, n) => {
|
|
177
|
+
const r = n.getBoundingClientRect(), l = e.getBoundingClientRect();
|
|
178
|
+
return l.right > r.left && l.left < r.right;
|
|
179
|
+
}, Ze = (e, n) => {
|
|
180
|
+
const r = e.querySelectorAll(`[data-marquee-item-index="${n}"]`);
|
|
181
|
+
return Array.from(r).some((l) => Je(l, e));
|
|
182
|
+
}, Pe = (e) => {
|
|
183
|
+
if (ke(e)) return !1;
|
|
184
|
+
if (e.type === "video") return !0;
|
|
185
|
+
if (e.type === "image") return !1;
|
|
186
|
+
const n = e.name ?? "";
|
|
187
|
+
return /\.(mp4|webm|ogg|mov)(\?|$)/i.test(n) ? !0 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId ?? "");
|
|
188
|
+
}, et = (e) => e ? e instanceof HTMLVideoElement ? e.readyState >= 1 : e.complete : !1, tt = ({
|
|
189
|
+
item: e,
|
|
190
|
+
prefix: n,
|
|
191
|
+
imageFit: r,
|
|
192
|
+
imageMaxWidth: l,
|
|
193
|
+
imageMaxHeight: m,
|
|
194
|
+
cornerRadius: d,
|
|
195
|
+
imageHoverClass: y,
|
|
196
|
+
isFirstSet: q,
|
|
197
|
+
scaled: f,
|
|
198
|
+
onFirstSetImageDone: $
|
|
199
|
+
}) => {
|
|
200
|
+
var L, H, Q, z, ne;
|
|
201
|
+
const W = _(null), D = !!((L = e.image) != null && L.assetId && Pe(e.image)), V = !!((H = e.image) != null && H.assetId && ke(e.image));
|
|
202
|
+
X(() => {
|
|
203
|
+
q && (V || et(W.current)) && ($ == null || $());
|
|
204
|
+
}, [q, V, (Q = e.image) == null ? void 0 : Q.assetId, $]);
|
|
205
|
+
const b = r.display === "cover", ee = r.ratioValue ?? "1:1", K = r.reversed ?? !1, [k, te] = ee.split(":").map(Number), S = (K ? te : k) / (K ? k : te), I = l / S, M = I > m ? m : I, ae = I > m ? m * S : l, x = f(ae), he = f(M), g = {
|
|
206
|
+
borderRadius: f(d)
|
|
207
|
+
}, N = b ? {
|
|
208
|
+
pointerEvents: "auto",
|
|
209
|
+
display: "block",
|
|
210
|
+
width: "100%",
|
|
211
|
+
height: "100%",
|
|
212
|
+
objectFit: "cover",
|
|
213
|
+
...g
|
|
214
|
+
} : {
|
|
215
|
+
pointerEvents: "auto",
|
|
216
|
+
display: "block",
|
|
217
|
+
width: "auto",
|
|
218
|
+
height: "auto",
|
|
219
|
+
maxWidth: f(l),
|
|
220
|
+
maxHeight: f(m),
|
|
221
|
+
objectFit: "contain",
|
|
222
|
+
...g
|
|
223
|
+
}, R = V && e.image ? Ve(e.image) : null, T = R === null ? void 0 : b ? N : {
|
|
224
|
+
...N,
|
|
225
|
+
width: f(l / R > m ? m * R : l),
|
|
226
|
+
height: f(l / R > m ? m : l / R)
|
|
227
|
+
}, B = ((z = e.image) == null ? void 0 : z.assetId) && (V ? /* @__PURE__ */ w(
|
|
228
|
+
Oe,
|
|
229
|
+
{
|
|
230
|
+
media: e.image,
|
|
231
|
+
fit: b ? "cover" : "contain",
|
|
232
|
+
style: T
|
|
233
|
+
}
|
|
234
|
+
) : D ? /* @__PURE__ */ w(
|
|
235
|
+
"video",
|
|
236
|
+
{
|
|
237
|
+
ref: (j) => {
|
|
238
|
+
W.current = j;
|
|
239
|
+
},
|
|
240
|
+
src: e.image.assetId,
|
|
241
|
+
style: N,
|
|
242
|
+
muted: !0,
|
|
243
|
+
loop: !0,
|
|
244
|
+
playsInline: !0,
|
|
245
|
+
preload: "none",
|
|
246
|
+
onLoadedMetadata: q ? $ : void 0,
|
|
247
|
+
onError: q ? $ : void 0
|
|
248
|
+
}
|
|
249
|
+
) : /* @__PURE__ */ w(
|
|
250
|
+
"img",
|
|
251
|
+
{
|
|
252
|
+
ref: (j) => {
|
|
253
|
+
W.current = j;
|
|
254
|
+
},
|
|
255
|
+
src: e.image.assetId,
|
|
256
|
+
alt: ((ne = e.image) == null ? void 0 : ne.name) ?? "",
|
|
257
|
+
style: N,
|
|
258
|
+
onLoad: q ? $ : void 0,
|
|
259
|
+
onError: q ? $ : void 0
|
|
260
|
+
}
|
|
261
|
+
));
|
|
262
|
+
return /* @__PURE__ */ w(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
style: {
|
|
266
|
+
display: "flex",
|
|
267
|
+
flexDirection: "column",
|
|
268
|
+
alignItems: "start",
|
|
269
|
+
...b ? { width: x } : { width: "max-content", maxWidth: f(l), minWidth: 0 }
|
|
270
|
+
},
|
|
271
|
+
children: /* @__PURE__ */ w(
|
|
272
|
+
"div",
|
|
273
|
+
{
|
|
274
|
+
className: y,
|
|
275
|
+
style: {
|
|
276
|
+
display: "flex",
|
|
277
|
+
flexDirection: "column",
|
|
278
|
+
justifyContent: "center",
|
|
279
|
+
alignItems: "center",
|
|
280
|
+
flexShrink: 0,
|
|
281
|
+
...b ? {
|
|
282
|
+
width: x,
|
|
283
|
+
height: he,
|
|
284
|
+
overflow: "hidden",
|
|
285
|
+
...g
|
|
286
|
+
} : {
|
|
287
|
+
width: "max-content",
|
|
288
|
+
maxWidth: f(l),
|
|
289
|
+
height: f(m)
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
children: B && /* @__PURE__ */ w(Te, { link: e.link, className: re(`${n}-marquee-link`, !b && `${n}-marquee-link-contain`), children: B })
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}, dt = ({ settings: e, content: n, isEditor: r, isPreviewMode: l, isEditMode: m }) => {
|
|
298
|
+
const { prefix: d } = Ie(), [y, q] = Z(0), f = y > 0 ? Math.round(y) : 0, $ = P(() => Le(d, f), [d, f]), {
|
|
299
|
+
speed: W,
|
|
300
|
+
direction: D,
|
|
301
|
+
pauseOnHover: V,
|
|
302
|
+
gap: b,
|
|
303
|
+
imageMaxWidth: ee,
|
|
304
|
+
imageMaxHeight: K,
|
|
305
|
+
hoverEffect: k,
|
|
306
|
+
cornerRadius: te = 0
|
|
307
|
+
} = e, O = P(() => Qe(e.imageFit), [e.imageFit]), oe = O.display !== "cover", S = (n == null ? void 0 : n.length) ?? 0, I = !!m, M = !r || !!l, ae = M && k !== "off" && k !== "randomize" ? `${d}-image-hover-${k}` : void 0, x = r ? !!l : !0, g = ((n == null ? void 0 : n.length) ?? 0) > 0 && (x || !!r), N = Math.max(0, W) * He, R = (t) => We(t, r ?? !1), T = _(null), B = _(null), L = _(null), [H, Q] = Z(0), z = x && V === "on", [ne, j] = Z(!1), [U, ie] = Z({}), se = _(U);
|
|
308
|
+
se.current = U;
|
|
309
|
+
const ce = _(null), le = _(0), Y = _(null), pe = P(() => (n ?? []).map((t) => {
|
|
310
|
+
var o;
|
|
311
|
+
return ((o = t.image) == null ? void 0 : o.assetId) ?? "";
|
|
312
|
+
}).join("\0"), [n]), [F, ge] = Z(me), ue = P(() => {
|
|
313
|
+
const t = n ?? [];
|
|
314
|
+
return t.length === 0 || !(x || !!r) ? t : Ke(t, F);
|
|
315
|
+
}, [n, x, F, r]), ve = P(
|
|
316
|
+
() => (n ?? []).filter((t) => {
|
|
317
|
+
var o;
|
|
318
|
+
return !!((o = t.image) != null && o.assetId);
|
|
319
|
+
}).length,
|
|
320
|
+
[n]
|
|
321
|
+
), ye = g ? Fe : 1;
|
|
322
|
+
X(() => {
|
|
323
|
+
le.current = 0, ie({}), ce.current = null, ge(me), q(0);
|
|
324
|
+
}, [pe]), we(() => {
|
|
325
|
+
if (!M || k !== "randomize") return;
|
|
326
|
+
const t = T.current;
|
|
327
|
+
if (!t) return;
|
|
328
|
+
const o = (s) => {
|
|
329
|
+
ie((c) => {
|
|
330
|
+
const v = Array.from(s).filter(
|
|
331
|
+
(p) => p in c && !Ze(t, p)
|
|
332
|
+
);
|
|
333
|
+
if (v.length === 0) return c;
|
|
334
|
+
const h = { ...c };
|
|
335
|
+
return v.forEach((p) => {
|
|
336
|
+
delete h[p];
|
|
337
|
+
}), h;
|
|
338
|
+
});
|
|
339
|
+
}, a = new IntersectionObserver((s) => {
|
|
340
|
+
const c = /* @__PURE__ */ new Set();
|
|
341
|
+
for (const v of s) {
|
|
342
|
+
const h = v.target.dataset.marqueeItemIndex, p = h !== void 0 ? Number(h) : NaN;
|
|
343
|
+
Number.isNaN(p) || c.add(p);
|
|
344
|
+
}
|
|
345
|
+
c.size > 0 && o(c);
|
|
346
|
+
}, { root: t, threshold: 0 });
|
|
347
|
+
Object.keys(U).forEach((s) => {
|
|
348
|
+
const c = Number(s);
|
|
349
|
+
t.querySelectorAll(`[data-marquee-item-index="${c}"]`).forEach((v) => a.observe(v));
|
|
350
|
+
});
|
|
351
|
+
const u = { current: 0 }, i = () => {
|
|
352
|
+
const s = Object.keys(se.current);
|
|
353
|
+
s.length !== 0 && (o(s.map(Number)), u.current = requestAnimationFrame(i));
|
|
354
|
+
};
|
|
355
|
+
return Object.keys(se.current).length > 0 && (u.current = requestAnimationFrame(i)), () => {
|
|
356
|
+
cancelAnimationFrame(u.current), a.disconnect();
|
|
357
|
+
};
|
|
358
|
+
}, [k, U, M]), we(() => {
|
|
359
|
+
const t = T.current;
|
|
360
|
+
if (!t || typeof IntersectionObserver > "u") return;
|
|
361
|
+
let o = !1, a = !1, u;
|
|
362
|
+
const i = () => {
|
|
363
|
+
const h = t.querySelectorAll("video");
|
|
364
|
+
if (!o) {
|
|
365
|
+
h.forEach(Re);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const p = t.getBoundingClientRect(), A = p.width * Xe;
|
|
369
|
+
h.forEach((C) => {
|
|
370
|
+
const J = C.getBoundingClientRect(), G = J.right > p.left && J.left < p.right;
|
|
371
|
+
J.right > p.left - A && J.left < p.right + A ? Ce(C, "auto") : oe && Ce(C, "metadata"), a && G ? C.paused && Me(C) : Re(C);
|
|
372
|
+
});
|
|
373
|
+
}, s = () => {
|
|
374
|
+
o && u === void 0 ? u = setInterval(i, Ge) : !o && u !== void 0 && (clearInterval(u), u = void 0), i();
|
|
375
|
+
}, c = Ee(t, Be, (h) => {
|
|
376
|
+
o = h, s();
|
|
377
|
+
}), v = Ee(t, "0px", (h) => {
|
|
378
|
+
a = h, s();
|
|
379
|
+
});
|
|
380
|
+
return () => {
|
|
381
|
+
c(), v(), clearInterval(u);
|
|
382
|
+
};
|
|
383
|
+
}, [g, oe]), X(() => {
|
|
384
|
+
if (!g) return;
|
|
385
|
+
const t = T.current, o = L.current;
|
|
386
|
+
if (!t || !o) return;
|
|
387
|
+
const a = { current: 0 }, u = () => {
|
|
388
|
+
const c = t.getBoundingClientRect().width || t.offsetWidth, v = Ye(o), h = ce.current, p = typeof h == "number" && Math.abs(h - v) <= 0.25;
|
|
389
|
+
ce.current = v;
|
|
390
|
+
let A = F, C = 0;
|
|
391
|
+
if ((x || r) && S > 0 && c > 0) {
|
|
392
|
+
const E = qe(o, S);
|
|
393
|
+
if (E >= Ue) {
|
|
394
|
+
C = E;
|
|
395
|
+
const de = Math.min(
|
|
396
|
+
je,
|
|
397
|
+
Math.max(
|
|
398
|
+
me,
|
|
399
|
+
Math.ceil(c / E) + 1
|
|
400
|
+
)
|
|
401
|
+
);
|
|
402
|
+
A = de, de !== F && ge(de);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
const G = A !== F && C > 0 ? C * A : v > 0 ? v : C > 0 ? C * A : (() => {
|
|
406
|
+
const E = qe(o, S);
|
|
407
|
+
return E > 0 ? E * A : 0;
|
|
408
|
+
})();
|
|
409
|
+
G > 0 ? q((E) => E <= 0 ? G : !p || Math.round(E) === Math.round(G) ? E : G) : !p && y <= 0 && (cancelAnimationFrame(a.current), a.current = requestAnimationFrame(u));
|
|
410
|
+
}, i = () => {
|
|
411
|
+
cancelAnimationFrame(a.current), a.current = requestAnimationFrame(u);
|
|
412
|
+
};
|
|
413
|
+
Y.current = i, i();
|
|
414
|
+
const s = new ResizeObserver(i);
|
|
415
|
+
return s.observe(t), s.observe(o), () => {
|
|
416
|
+
Y.current = null, cancelAnimationFrame(a.current), s.disconnect();
|
|
417
|
+
};
|
|
418
|
+
}, [x, g, y, pe, F, S, r]), X(() => {
|
|
419
|
+
if (!g || f <= 0) return;
|
|
420
|
+
const t = B.current;
|
|
421
|
+
t && De(t);
|
|
422
|
+
}, [g, f, D, N]), X(() => {
|
|
423
|
+
if (!g || y <= 0) {
|
|
424
|
+
Q(0);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
const t = B.current, o = L.current;
|
|
428
|
+
if (!t || !o) return;
|
|
429
|
+
const a = () => {
|
|
430
|
+
const i = t.offsetHeight || t.getBoundingClientRect().height, s = Array.from(o.children).reduce(
|
|
431
|
+
(v, h) => Math.max(v, h.offsetHeight || h.getBoundingClientRect().height),
|
|
432
|
+
0
|
|
433
|
+
), c = i > 0 ? i : s;
|
|
434
|
+
Q(c > 0 ? c : 0);
|
|
435
|
+
};
|
|
436
|
+
a();
|
|
437
|
+
const u = new ResizeObserver(a);
|
|
438
|
+
return u.observe(t), u.observe(o), () => u.disconnect();
|
|
439
|
+
}, [g, ye, ue, r, b, ee, K, y, O, U]), X(() => {
|
|
440
|
+
if (!r || !I || !g || typeof window > "u") return;
|
|
441
|
+
const t = requestAnimationFrame(() => {
|
|
442
|
+
window.dispatchEvent(new Event("scroll"));
|
|
443
|
+
});
|
|
444
|
+
return () => cancelAnimationFrame(t);
|
|
445
|
+
}, [r, I, g, D, y, H, b, ue]);
|
|
446
|
+
const Se = () => {
|
|
447
|
+
z && j(!0);
|
|
448
|
+
}, Ne = () => {
|
|
449
|
+
z && j(!1);
|
|
450
|
+
}, Ae = $e(() => {
|
|
451
|
+
var t;
|
|
452
|
+
le.current = Math.min(
|
|
453
|
+
ve,
|
|
454
|
+
le.current + 1
|
|
455
|
+
), (t = Y.current) == null || t.call(Y);
|
|
456
|
+
}, [ve]), _e = $e((t, o) => {
|
|
457
|
+
ie((a) => {
|
|
458
|
+
const u = a[t] ?? o, i = (n ?? []).filter((c) => c !== u);
|
|
459
|
+
if (i.length === 0) return a;
|
|
460
|
+
const s = i[Math.floor(Math.random() * i.length)];
|
|
461
|
+
return { ...a, [t]: s };
|
|
462
|
+
});
|
|
463
|
+
}, [n]), be = (t, o, a, u) => {
|
|
464
|
+
const i = M && k === "randomize" && O.display === "cover" ? U[a] ?? t : t, s = `max(${R(b)}, ${ze}px)`, c = `calc(-0.5 * (${s} + ${R(b)}))`;
|
|
465
|
+
return /* @__PURE__ */ fe(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
className: `${d}-marquee-card`,
|
|
469
|
+
"data-marquee-item-index": a,
|
|
470
|
+
onMouseEnter: M && k === "randomize" && O.display === "cover" ? () => _e(a, t) : void 0,
|
|
471
|
+
children: [
|
|
472
|
+
/* @__PURE__ */ w(
|
|
473
|
+
tt,
|
|
474
|
+
{
|
|
475
|
+
item: i,
|
|
476
|
+
prefix: d,
|
|
477
|
+
imageFit: O,
|
|
478
|
+
imageMaxWidth: ee,
|
|
479
|
+
imageMaxHeight: K,
|
|
480
|
+
cornerRadius: te,
|
|
481
|
+
imageHoverClass: ae,
|
|
482
|
+
isEditor: r,
|
|
483
|
+
isFirstSet: u,
|
|
484
|
+
scaled: R,
|
|
485
|
+
onFirstSetImageDone: Ae
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
I && /* @__PURE__ */ w(
|
|
489
|
+
"div",
|
|
490
|
+
{
|
|
491
|
+
"data-controls": "gap",
|
|
492
|
+
"data-controls-axis": "x",
|
|
493
|
+
className: `${d}-gap-control`,
|
|
494
|
+
style: {
|
|
495
|
+
position: "absolute",
|
|
496
|
+
top: 0,
|
|
497
|
+
right: c,
|
|
498
|
+
width: s,
|
|
499
|
+
height: "100%"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
`${o}-${a}`
|
|
506
|
+
);
|
|
507
|
+
};
|
|
508
|
+
if (g) {
|
|
509
|
+
const t = x ? z && ne ? "paused" : "running" : "paused", o = f > 0 && N > 0 ? f / N * 1e3 : 0, a = `${Math.max(0, o) / 1e3}s`;
|
|
510
|
+
return /* @__PURE__ */ fe(
|
|
511
|
+
"div",
|
|
512
|
+
{
|
|
513
|
+
ref: T,
|
|
514
|
+
className: re(`${d}-wrapper`, `${d}-marquee-wrapper`),
|
|
515
|
+
"aria-label": "Marquee",
|
|
516
|
+
style: H > 0 ? { height: H } : void 0,
|
|
517
|
+
children: [
|
|
518
|
+
/* @__PURE__ */ w("style", { dangerouslySetInnerHTML: { __html: $ } }),
|
|
519
|
+
/* @__PURE__ */ w(
|
|
520
|
+
"div",
|
|
521
|
+
{
|
|
522
|
+
ref: B,
|
|
523
|
+
className: `${d}-marquee-track`,
|
|
524
|
+
"data-direction": D,
|
|
525
|
+
onMouseEnter: Se,
|
|
526
|
+
onMouseLeave: Ne,
|
|
527
|
+
style: {
|
|
528
|
+
WebkitAnimationDuration: a,
|
|
529
|
+
animationDuration: a,
|
|
530
|
+
WebkitAnimationPlayState: t,
|
|
531
|
+
animationPlayState: t
|
|
532
|
+
},
|
|
533
|
+
children: Array.from({ length: ye }, (u, i) => /* @__PURE__ */ w(
|
|
534
|
+
"div",
|
|
535
|
+
{
|
|
536
|
+
ref: i === 0 ? L : void 0,
|
|
537
|
+
className: re(`${d}-marquee-row`, `${d}-marquee-set`),
|
|
538
|
+
style: {
|
|
539
|
+
gap: R(b),
|
|
540
|
+
paddingRight: R(b)
|
|
541
|
+
},
|
|
542
|
+
"aria-hidden": i > 0,
|
|
543
|
+
children: ue.map(
|
|
544
|
+
(s, c) => be(
|
|
545
|
+
s,
|
|
546
|
+
i,
|
|
547
|
+
c,
|
|
548
|
+
i === 0 && c < S
|
|
549
|
+
)
|
|
550
|
+
)
|
|
551
|
+
},
|
|
552
|
+
`set-${i}`
|
|
553
|
+
))
|
|
554
|
+
}
|
|
555
|
+
)
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
return /* @__PURE__ */ fe("div", { ref: T, className: `${d}-wrapper`, children: [
|
|
561
|
+
/* @__PURE__ */ w("style", { dangerouslySetInnerHTML: { __html: $ } }),
|
|
562
|
+
/* @__PURE__ */ w(
|
|
563
|
+
"div",
|
|
564
|
+
{
|
|
565
|
+
className: re(`${d}-marquee-row`, `${d}-marquee-static`),
|
|
566
|
+
style: { gap: R(b), transform: "none" },
|
|
567
|
+
"aria-label": "Marquee",
|
|
568
|
+
children: n == null ? void 0 : n.map(
|
|
569
|
+
(t, o) => be(t, 0, o)
|
|
570
|
+
)
|
|
571
|
+
},
|
|
572
|
+
"marquee-static"
|
|
573
|
+
)
|
|
574
|
+
] });
|
|
575
|
+
};
|
|
576
|
+
export {
|
|
577
|
+
dt as Marquee
|
|
578
|
+
};
|