@cntrl-site/components 1.0.100 → 1.0.102
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 +25 -1
- package/dist/Burger-C6jI6C1c.js +661 -0
- package/dist/Burger-EMSn7TPB.mjs +1807 -0
- package/dist/ClickGallerie-D_O1XhAO.mjs +270 -0
- package/dist/ClickGallerie-M9xdGR1G.js +36 -0
- package/dist/Components/Burger/BurgerComponent.d.ts +0 -1
- package/dist/Components/ClickGallerie/ClickGallerieComponent.d.ts +0 -1
- package/dist/Components/FAQ/FAQComponent.d.ts +0 -1
- package/dist/Components/Form/FormComponent.d.ts +0 -1
- package/dist/Components/Grid/GridComponent.d.ts +0 -1
- package/dist/Components/Helix/HelixComponent.d.ts +0 -1
- package/dist/Components/Hive/HiveComponent.d.ts +0 -1
- package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +0 -1
- package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +0 -1
- package/dist/Components/List/ListComponent.d.ts +0 -1
- package/dist/Components/Marquee/MarqueeComponent.d.ts +0 -1
- package/dist/Components/MarqueeText/MarqueeTextComponent.d.ts +0 -1
- package/dist/Components/Mercury/MercuryComponent.d.ts +0 -1
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +0 -1
- package/dist/Components/Pretext/PretextComponent.d.ts +0 -1
- package/dist/Components/Scale/ScaleComponent.d.ts +0 -1
- package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +0 -1
- package/dist/Components/Slider20/Slider20Component.d.ts +0 -1
- package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +0 -1
- package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +0 -1
- package/dist/Components/Waterfall/WaterfallComponent.d.ts +0 -1
- package/dist/ControlSlider-SiOt22l_.js +1 -0
- package/dist/ControlSlider-pZv7H6BU.mjs +334 -0
- package/dist/FAQ-C7823fyi.js +166 -0
- package/dist/FAQ-CZ39u4m8.mjs +588 -0
- package/dist/Form-BX5_41nb.mjs +472 -0
- package/dist/Form-Dn-6A1He.js +153 -0
- package/dist/Grid-CemGhf3F.js +374 -0
- package/dist/Grid-cfQsXW3b.mjs +1553 -0
- package/dist/Helix-2Vr-9WBa.js +43 -0
- package/dist/Helix-BmkAKT1G.mjs +315 -0
- package/dist/Hive-BC6zQBsv.js +321 -0
- package/dist/Hive-BGMWinrW.mjs +1425 -0
- package/dist/HiveLightboxTitles-DhEeFKWs.mjs +507 -0
- package/dist/HiveLightboxTitles-DlyptAaK.js +1 -0
- package/dist/ImageRevealSlider-BBWtFjUF.js +1 -0
- package/dist/ImageRevealSlider-BdFGyVEP.mjs +184 -0
- package/dist/Lightbox-CIss_nOG.js +1 -0
- package/dist/Lightbox-eP9qAZzL.mjs +665 -0
- package/dist/LightboxJournal-D59ex6wH.mjs +1613 -0
- package/dist/LightboxJournal-DAEZOPDi.js +523 -0
- package/dist/LightboxStrip-BDjI1jyH.js +386 -0
- package/dist/LightboxStrip-YspzBP8N.mjs +1574 -0
- package/dist/List-C32WImI3.js +377 -0
- package/dist/List-DW7fyJbf.mjs +1891 -0
- package/dist/Marquee-BYClHHws.mjs +551 -0
- package/dist/Marquee-vmHaTGIP.js +133 -0
- package/dist/MarqueeText-4Rip_sQX.mjs +515 -0
- package/dist/MarqueeText-E6OubMOG.js +132 -0
- package/dist/Mercury-BwF_XW2w.js +267 -0
- package/dist/Mercury-DuKJQ1Zo.mjs +1701 -0
- package/dist/OnelinerForm-BEu7_sho.mjs +434 -0
- package/dist/OnelinerForm-C2Y_XMCY.js +194 -0
- package/dist/Pretext-10CcyP1E.mjs +2762 -0
- package/dist/Pretext-DvQ3xsni.js +231 -0
- package/dist/PretextComponent-C3YFICy8.js +1 -0
- package/dist/PretextComponent-Ct0newmn.mjs +11624 -0
- package/dist/RichTextRenderer-B6WtTYlR.mjs +32 -0
- package/dist/RichTextRenderer-CIy6yI8U.js +1 -0
- package/dist/Scale-976sjO8e.js +111 -0
- package/dist/Scale-rLNT4KAk.mjs +345 -0
- package/dist/SimpleButton-C-o2W9bS.mjs +451 -0
- package/dist/SimpleButton-nGEcO2gB.js +243 -0
- package/dist/Slider20-C9o2REDl.js +272 -0
- package/dist/Slider20-Dm8BeCli.mjs +851 -0
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/TestimonialGrid-CPu4qQ6B.mjs +492 -0
- package/dist/TestimonialGrid-D4ieiz9e.js +90 -0
- package/dist/TestimonialSingle-CVu15ZtV.js +125 -0
- package/dist/TestimonialSingle-DLdnAVF7.mjs +391 -0
- package/dist/Waterfall-A0FjM2my.mjs +1400 -0
- package/dist/Waterfall-DnPDHbCL.js +287 -0
- package/dist/buildColorVars-CE2D5cQV.js +1 -0
- package/dist/buildColorVars-CLyWQm5K.mjs +21 -0
- package/dist/components-OE3ac1dr.js +1 -0
- package/dist/components-w-jHX-2U.mjs +2053 -0
- package/dist/components.css +1 -1
- package/dist/elements.d.ts +7 -0
- package/dist/elements.js +1 -0
- package/dist/elements.mjs +63 -0
- package/dist/elements.node.d.ts +6 -0
- package/dist/elements.node.js +1 -0
- package/dist/elements.node.mjs +21 -0
- package/dist/forking.d.ts +1 -0
- package/dist/formFieldValidation-DZl2KVaF.js +1 -0
- package/dist/formFieldValidation-DvihFrq5.mjs +21 -0
- package/dist/getColorAlpha-BVBY0N5x.mjs +39 -0
- package/dist/getColorAlpha-CoSseoCn.js +1 -0
- package/dist/getImageRect-BQhQXvT8.js +1 -0
- package/dist/getImageRect-CBMhFNHM.mjs +109 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -28866
- package/dist/index.mjs +16 -62477
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/panelAvailability-D179wwJx.mjs +27 -0
- package/dist/panelAvailability-DnOe0rQ4.js +1 -0
- package/dist/react-splide.esm-CabaEmHi.js +6 -0
- package/dist/react-splide.esm-DQqds4PL.mjs +1750 -0
- package/dist/readTestimonialTextMeasure-BIXpGFEt.mjs +13 -0
- package/dist/readTestimonialTextMeasure-CEPaB4Sy.js +1 -0
- package/dist/scalingValue-C9JH5L6O.mjs +6 -0
- package/dist/scalingValue-CSHYgTZl.js +1 -0
- package/dist/sources.d.ts +1 -0
- package/dist/sources.js +23753 -0
- package/dist/sources.mjs +23779 -0
- package/dist/textStylesToCss-05Mn6I_2.mjs +32 -0
- package/dist/textStylesToCss-CNN3zZTV.js +1 -0
- package/dist/types/Component.d.ts +0 -1
- package/dist/useLightboxScrollLock-Hf16Eq4g.js +1 -0
- package/dist/useLightboxScrollLock-VQ07s7EJ.mjs +18 -0
- package/dist/useLightboxSwipeDismiss-Br9uE5G0.js +1 -0
- package/dist/useLightboxSwipeDismiss-SGv6Ra33.mjs +95 -0
- package/dist/useScopedStyles-Bf6yohVQ.js +1 -0
- package/dist/useScopedStyles-DhBG3557.mjs +11 -0
- package/dist/utils-033j3qNL.js +1 -0
- package/dist/utils-FxC9rcxw.mjs +247 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +17 -11
- package/package.json +31 -2
- package/dist/index-2JTNRDR1.js +0 -1
- package/dist/index-DA8t6EZ4.mjs +0 -255
- package/dist/panelAvailability-CgSic84c.mjs +0 -126
- package/dist/panelAvailability-D8c7cdbu.js +0 -1
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { jsx as x, jsxs as Ce, Fragment as Ct } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, useMemo as le, useRef as T, useLayoutEffect as W } from "react";
|
|
3
|
+
import Mt from "classnames";
|
|
4
|
+
import { s as kt } from "./scalingValue-C9JH5L6O.mjs";
|
|
5
|
+
import { u as Et } from "./useScopedStyles-DhBG3557.mjs";
|
|
6
|
+
import { t as Rt } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
7
|
+
function qt(e, r, o) {
|
|
8
|
+
const a = r > 0 ? `${r}px` : "0px", i = o ? `
|
|
9
|
+
.${e}-item-image-wrap {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 0 0 auto;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
.${e}-glyph {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
}
|
|
17
|
+
.${e}-glyph-inner {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
transform-origin: 50% 50%;
|
|
20
|
+
backface-visibility: hidden;
|
|
21
|
+
-webkit-backface-visibility: hidden;
|
|
22
|
+
}
|
|
23
|
+
.${e}-item-image {
|
|
24
|
+
transform-origin: 50% 50%;
|
|
25
|
+
backface-visibility: hidden;
|
|
26
|
+
-webkit-backface-visibility: hidden;
|
|
27
|
+
}
|
|
28
|
+
` : "";
|
|
29
|
+
return `
|
|
30
|
+
.${e}-wrapper {
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: auto;
|
|
34
|
+
}
|
|
35
|
+
.${e}-marquee-wrapper {
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
overflow-x: clip;
|
|
39
|
+
overflow-y: visible;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: auto;
|
|
42
|
+
}
|
|
43
|
+
.${e}-curve-bg {
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: 0;
|
|
46
|
+
top: 0;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
z-index: 0;
|
|
52
|
+
}
|
|
53
|
+
.${e}-ribbon {
|
|
54
|
+
position: absolute;
|
|
55
|
+
left: 0;
|
|
56
|
+
top: 50%;
|
|
57
|
+
width: 100%;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
z-index: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ${e}-marquee-left {
|
|
64
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
65
|
+
to { -webkit-transform: translate3d(-${a}, 0, 0); transform: translate3d(-${a}, 0, 0); }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes ${e}-marquee-right {
|
|
69
|
+
from { -webkit-transform: translate3d(-${a}, 0, 0); transform: translate3d(-${a}, 0, 0); }
|
|
70
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.${e}-marquee-track {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
width: max-content;
|
|
77
|
+
backface-visibility: hidden;
|
|
78
|
+
-webkit-backface-visibility: hidden;
|
|
79
|
+
flex-wrap: nowrap;
|
|
80
|
+
-webkit-animation-timing-function: linear;
|
|
81
|
+
animation-timing-function: linear;
|
|
82
|
+
-webkit-animation-iteration-count: infinite;
|
|
83
|
+
animation-iteration-count: infinite;
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
}
|
|
87
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
88
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
89
|
+
animation-name: ${e}-marquee-left;
|
|
90
|
+
}
|
|
91
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
92
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
93
|
+
animation-name: ${e}-marquee-right;
|
|
94
|
+
}
|
|
95
|
+
.${e}-marquee-set {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: row;
|
|
98
|
+
align-items: center;
|
|
99
|
+
flex: 0 0 auto;
|
|
100
|
+
position: relative;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
}
|
|
103
|
+
.${e}-marquee-static {
|
|
104
|
+
justify-content: center;
|
|
105
|
+
overflow-x: auto;
|
|
106
|
+
}
|
|
107
|
+
.${e}-item {
|
|
108
|
+
position: relative;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: row;
|
|
111
|
+
align-items: center;
|
|
112
|
+
flex: 0 0 auto;
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
}
|
|
115
|
+
.${e}-item-link {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
align-items: center;
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
color: inherit;
|
|
121
|
+
}
|
|
122
|
+
.${e}-item-image {
|
|
123
|
+
display: block;
|
|
124
|
+
width: auto;
|
|
125
|
+
flex: 0 0 auto;
|
|
126
|
+
object-fit: contain;
|
|
127
|
+
}
|
|
128
|
+
.${e}-text {
|
|
129
|
+
display: inline-block;
|
|
130
|
+
}
|
|
131
|
+
${i}
|
|
132
|
+
.${e}-cap-ref {
|
|
133
|
+
position: absolute;
|
|
134
|
+
visibility: hidden;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
left: -9999px;
|
|
138
|
+
top: 0;
|
|
139
|
+
}
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
const Ft = 30, Se = 3, Lt = 12, Tt = 96, Ke = 3, ue = 0.72, _t = 100, Wt = 10, Nt = (e) => e / _t, Bt = (e) => Math.max(0, e) / Wt, Ht = (e) => {
|
|
143
|
+
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");
|
|
144
|
+
}, zt = (e, r) => Array.from({ length: r * e.length }, (o, a) => e[a % e.length]), X = { ctx: void 0 }, Pt = () => X.ctx !== void 0 ? X.ctx : typeof document > "u" ? (X.ctx = null, X.ctx) : (X.ctx = document.createElement("canvas").getContext("2d"), X.ctx), Dt = (e, r, o, a) => {
|
|
145
|
+
e.style.transform = `translate3d(${r}px, ${o}px, 0) rotate(${a}deg)`;
|
|
146
|
+
}, Qe = (e) => {
|
|
147
|
+
e.style.transform = "";
|
|
148
|
+
}, Ot = (e) => {
|
|
149
|
+
if (!e || e === "none") return 0;
|
|
150
|
+
try {
|
|
151
|
+
return new DOMMatrixReadOnly(e).m41;
|
|
152
|
+
} catch {
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
}, It = (e, r) => {
|
|
156
|
+
const o = (a, i) => {
|
|
157
|
+
if (!a || a === r) return i;
|
|
158
|
+
const d = i + a.offsetLeft, c = a.offsetParent;
|
|
159
|
+
return !c || c === a ? d : o(c, d);
|
|
160
|
+
};
|
|
161
|
+
return o(e, e.offsetWidth / 2);
|
|
162
|
+
}, Ge = 96, Je = (e, r, o) => {
|
|
163
|
+
if (r <= 0 || Math.abs(e) <= 0 || o < 2) return null;
|
|
164
|
+
const a = 2 * Math.PI / r, i = new Float64Array(o + 1), d = new Float64Array(o + 1), c = e * r, l = (u) => Math.sqrt(1 + (c * Math.cos(r * u)) ** 2), b = a / o;
|
|
165
|
+
return Array.from({ length: o }, (u, k) => {
|
|
166
|
+
const v = k * b, C = v + b;
|
|
167
|
+
i[k + 1] = C, d[k + 1] = d[k] + (l(v) + l(C)) * 0.5 * b;
|
|
168
|
+
}), { wavelength: a, periodArc: d[o], x: i, s: d };
|
|
169
|
+
}, Ut = (e, r) => {
|
|
170
|
+
const o = Je(e, r, Ge);
|
|
171
|
+
return !o || o.wavelength <= 0 ? 1 : o.periodArc / o.wavelength;
|
|
172
|
+
}, Xt = (e, r) => {
|
|
173
|
+
if (e.periodArc <= 0) return r;
|
|
174
|
+
const o = r < 0 ? -1 : 1, a = Math.abs(r), i = Math.floor(a / e.periodArc), d = a - i * e.periodArc, { s: c, x: l } = e, b = (E, w) => {
|
|
175
|
+
if (w - E <= 1) return [E, w];
|
|
176
|
+
const R = E + w >> 1;
|
|
177
|
+
return c[R] <= d ? b(R, w) : b(E, R);
|
|
178
|
+
}, [u, k] = b(0, c.length - 1), v = c[k] - c[u], C = v > 0 ? (d - c[u]) / v : 0;
|
|
179
|
+
return o * (i * e.wavelength + l[u] + (l[k] - l[u]) * C);
|
|
180
|
+
}, Vt = (e, r, o, a, i = 0) => {
|
|
181
|
+
const d = Math.max(0, o), c = e > 0 ? 2 * Math.PI * d / e : 0, l = (w) => a + r * Math.sin(c * w), b = (w) => r * c * Math.cos(c * w), u = -i, v = e + i - u, C = Math.max(4, Math.ceil(d * 4 * (v / Math.max(e, 1)))), E = Array.from({ length: C }, (w, R) => {
|
|
182
|
+
const N = u + R / C * v, q = u + (R + 1) / C * v, H = q - N, J = l(N), V = l(q), Z = N + H / 3, ee = J + b(N) * H / 3, de = q - H / 3, te = V - b(q) * H / 3;
|
|
183
|
+
return `C${Z.toFixed(2)} ${ee.toFixed(2)} ${de.toFixed(2)} ${te.toFixed(2)} ${q.toFixed(2)} ${V.toFixed(2)}`;
|
|
184
|
+
});
|
|
185
|
+
return [`M${u.toFixed(2)} ${l(u).toFixed(2)}`, ...E].join(" ");
|
|
186
|
+
}, jt = ({ item: e, prefix: r, textCss: o, capHeightPx: a, opticalOffsetY: i, imageGapPx: d, isCurve: c }) => {
|
|
187
|
+
var E;
|
|
188
|
+
const l = i !== 0 ? { ...o, transform: `translateY(${i}px)` } : o, b = a > 0 ? { height: `${a}px` } : { fontSize: o.fontSize, height: `${ue}em` }, u = ((E = e.image) == null ? void 0 : E.assetId) && /* @__PURE__ */ x(
|
|
189
|
+
"img",
|
|
190
|
+
{
|
|
191
|
+
src: e.image.assetId,
|
|
192
|
+
alt: e.image.name ?? "",
|
|
193
|
+
className: `${r}-item-image`,
|
|
194
|
+
style: b
|
|
195
|
+
}
|
|
196
|
+
), k = u && (c ? /* @__PURE__ */ x("span", { className: `${r}-item-image-wrap`, "data-marquee-wave-node": !0, children: u }) : u), v = c ? /* @__PURE__ */ x("span", { className: `${r}-text`, style: l, children: Array.from(e.text).map((w, R) => /* @__PURE__ */ x("span", { className: `${r}-glyph`, "data-marquee-wave-node": !0, children: /* @__PURE__ */ x("span", { className: `${r}-glyph-inner`, children: w === " " ? " " : w }) }, R)) }) : /* @__PURE__ */ x("span", { className: `${r}-text`, style: l, children: e.text }), C = /* @__PURE__ */ Ce(Ct, { children: [
|
|
197
|
+
k,
|
|
198
|
+
v
|
|
199
|
+
] });
|
|
200
|
+
return /* @__PURE__ */ x("div", { className: `${r}-item`, "data-marquee-text-item": !0, style: { gap: d }, children: e.link ? /* @__PURE__ */ x("a", { href: e.link, className: `${r}-item-link`, style: { gap: d }, children: C }) : C });
|
|
201
|
+
}, en = ({ settings: e, content: r, isEditor: o, isPreviewMode: a }) => {
|
|
202
|
+
const { prefix: i } = Et(), [d, c] = B(0), l = d > 0 ? Math.round(d) : 0, {
|
|
203
|
+
speed: b,
|
|
204
|
+
direction: u,
|
|
205
|
+
pauseOnHover: k,
|
|
206
|
+
gap: v,
|
|
207
|
+
layoutType: C,
|
|
208
|
+
curveAmplitude: E,
|
|
209
|
+
curveFrequency: w,
|
|
210
|
+
textFontFamily: R,
|
|
211
|
+
textFontSettings: N,
|
|
212
|
+
textFontSize: q,
|
|
213
|
+
textLetterSpacing: H,
|
|
214
|
+
textWordSpacing: J,
|
|
215
|
+
textTextAppearance: V,
|
|
216
|
+
textColor: Z,
|
|
217
|
+
backgroundColor: ee,
|
|
218
|
+
ribbonWidth: de
|
|
219
|
+
} = e, te = de ?? q, y = C === "curve", O = Nt(E), j = Bt(w), Ze = le(() => qt(i, l, y), [i, l, y]), z = le(() => Rt({
|
|
220
|
+
fontSettings: {
|
|
221
|
+
fontFamily: R,
|
|
222
|
+
fontWeight: N.fontWeight,
|
|
223
|
+
fontStyle: N.fontStyle
|
|
224
|
+
},
|
|
225
|
+
letterSpacing: H,
|
|
226
|
+
wordSpacing: J,
|
|
227
|
+
fontSize: q,
|
|
228
|
+
lineHeight: q,
|
|
229
|
+
textAppearance: V,
|
|
230
|
+
color: Z
|
|
231
|
+
}, o), [R, N, H, J, q, V, Z, o]), ne = (n) => kt(n, o ?? !1), P = ((r == null ? void 0 : r.length) ?? 0) > 0, Y = o ? !!a : !0, D = P && (Y || !!o), re = Math.max(0, b) * Ft, me = Y && k === "on", [et, Me] = B(!1), fe = Y ? me && et ? "paused" : "running" : "paused", he = fe === "running" && re > 0 && l > 0, tt = l > 0 && re > 0 ? l / re * 1e3 : 0, oe = T(null), pe = T(null), ge = T(null), ie = T(null), ke = T(null), Ee = T(null), Re = T(he), K = T(null), Q = T(null), xe = T(O), ve = T(j);
|
|
232
|
+
Re.current = he, xe.current = O, ve.current = j;
|
|
233
|
+
const [I, qe] = B(0), [nt, Fe] = B(0), [Le, Te] = B(0), [G, _e] = B(0), [We, rt] = B(0), ae = le(
|
|
234
|
+
() => (r ?? []).map((n) => {
|
|
235
|
+
var t;
|
|
236
|
+
return `${n.text}\0${((t = n.image) == null ? void 0 : t.assetId) ?? ""}\0${n.link ?? ""}`;
|
|
237
|
+
}).join("\0"),
|
|
238
|
+
[r]
|
|
239
|
+
), [U, Ne] = B(Se), ot = le(() => {
|
|
240
|
+
const n = r ?? [];
|
|
241
|
+
return n.length === 0 || !(Y || o) ? n : zt(n, U);
|
|
242
|
+
}, [r, Y, U, o]), it = D ? Ke : 1;
|
|
243
|
+
W(() => {
|
|
244
|
+
Ne(Se), c(0);
|
|
245
|
+
}, [ae]), W(() => {
|
|
246
|
+
var h;
|
|
247
|
+
const n = Ee.current;
|
|
248
|
+
if (!n) return;
|
|
249
|
+
const t = () => {
|
|
250
|
+
const p = getComputedStyle(n), m = parseFloat(p.fontSize) || 0;
|
|
251
|
+
if (m <= 0) return;
|
|
252
|
+
const f = Pt();
|
|
253
|
+
if (!f) {
|
|
254
|
+
qe(m * ue), Fe(0);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
f.font = `${p.fontStyle} ${p.fontWeight} ${m}px ${p.fontFamily}`;
|
|
258
|
+
const g = f.measureText("H"), F = g.actualBoundingBoxAscent > 0 ? g.actualBoundingBoxAscent : m * ue, A = Math.max(0, g.actualBoundingBoxDescent || 0), S = g.fontBoundingBoxAscent || 0, _ = g.fontBoundingBoxDescent || 0;
|
|
259
|
+
qe((L) => Math.abs(L - F) > 0.5 ? F : L);
|
|
260
|
+
const M = S > 0 || _ > 0 ? (_ - A - (S - F)) / 2 : 0;
|
|
261
|
+
Fe((L) => Math.abs(L - M) > 0.25 ? M : L);
|
|
262
|
+
};
|
|
263
|
+
t();
|
|
264
|
+
const s = typeof document < "u" ? document.fonts : void 0;
|
|
265
|
+
(h = s == null ? void 0 : s.ready) == null || h.then(t).catch(() => {
|
|
266
|
+
});
|
|
267
|
+
const $ = new ResizeObserver(t);
|
|
268
|
+
return $.observe(n), () => $.disconnect();
|
|
269
|
+
}, [z.fontFamily, z.fontWeight, z.fontStyle, z.fontSize, z.lineHeight]), W(() => {
|
|
270
|
+
if (!D) return;
|
|
271
|
+
const n = oe.current, t = ie.current;
|
|
272
|
+
if (!n || !t) return;
|
|
273
|
+
const s = { id: 0 }, $ = () => {
|
|
274
|
+
const f = n.offsetWidth || n.getBoundingClientRect().width, g = t.offsetWidth || t.getBoundingClientRect().width;
|
|
275
|
+
if (P && f > 0 && g > 0) {
|
|
276
|
+
const F = g / U;
|
|
277
|
+
if (F > 0) {
|
|
278
|
+
let A = f, S = Lt;
|
|
279
|
+
if (y) {
|
|
280
|
+
const M = f * xe.current, L = ve.current, se = L > 0 ? 2 * Math.PI * L / f : 0, $e = Ut(M, se);
|
|
281
|
+
A = Math.max(f, $e * f / (Ke - 1)), S = Tt;
|
|
282
|
+
}
|
|
283
|
+
const _ = Math.min(
|
|
284
|
+
S,
|
|
285
|
+
Math.max(Se, Math.ceil(A / F) + 1)
|
|
286
|
+
);
|
|
287
|
+
if (_ !== U) {
|
|
288
|
+
Ne(_);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
g > 0 && c(g);
|
|
294
|
+
}, h = () => {
|
|
295
|
+
cancelAnimationFrame(s.id), s.id = requestAnimationFrame($);
|
|
296
|
+
};
|
|
297
|
+
h();
|
|
298
|
+
const p = new ResizeObserver(h);
|
|
299
|
+
p.observe(n), p.observe(t);
|
|
300
|
+
const m = () => {
|
|
301
|
+
document.hidden || h();
|
|
302
|
+
};
|
|
303
|
+
return document.addEventListener("visibilitychange", m), window.addEventListener("pageshow", m), window.addEventListener("focus", m), () => {
|
|
304
|
+
cancelAnimationFrame(s.id), p.disconnect(), document.removeEventListener("visibilitychange", m), window.removeEventListener("pageshow", m), window.removeEventListener("focus", m);
|
|
305
|
+
};
|
|
306
|
+
}, [D, ae, U, P, I, y, O, j]), W(() => {
|
|
307
|
+
const n = ke.current;
|
|
308
|
+
if (!n) return;
|
|
309
|
+
const t = { id: 0 }, s = () => {
|
|
310
|
+
const h = n.offsetHeight;
|
|
311
|
+
h > 0 && rt((p) => Math.abs(p - h) > 0.5 ? h : p);
|
|
312
|
+
};
|
|
313
|
+
t.id = requestAnimationFrame(s);
|
|
314
|
+
const $ = new ResizeObserver(() => {
|
|
315
|
+
cancelAnimationFrame(t.id), t.id = requestAnimationFrame(s);
|
|
316
|
+
});
|
|
317
|
+
return $.observe(n), () => {
|
|
318
|
+
cancelAnimationFrame(t.id), $.disconnect();
|
|
319
|
+
};
|
|
320
|
+
}, [te, o]), W(() => {
|
|
321
|
+
if (!y) {
|
|
322
|
+
Te(0), _e(0);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const n = oe.current, t = ie.current;
|
|
326
|
+
if (!n || !t) return;
|
|
327
|
+
const s = { id: 0 }, $ = () => {
|
|
328
|
+
const p = n.offsetWidth, m = t.offsetHeight;
|
|
329
|
+
p > 0 && _e((f) => Math.abs(f - p) > 0.5 ? p : f), m > 0 && Te((f) => Math.abs(f - m) > 0.5 ? m : f);
|
|
330
|
+
};
|
|
331
|
+
s.id = requestAnimationFrame($);
|
|
332
|
+
const h = new ResizeObserver(() => {
|
|
333
|
+
cancelAnimationFrame(s.id), s.id = requestAnimationFrame($);
|
|
334
|
+
});
|
|
335
|
+
return h.observe(n), h.observe(t), () => {
|
|
336
|
+
cancelAnimationFrame(s.id), h.disconnect();
|
|
337
|
+
};
|
|
338
|
+
}, [y, ae, I, q, D]), W(() => {
|
|
339
|
+
if (!D || l <= 0) return;
|
|
340
|
+
const n = ge.current;
|
|
341
|
+
n && Ht(n);
|
|
342
|
+
}, [D, l, u, re]), W(() => {
|
|
343
|
+
if (!y || !P) return;
|
|
344
|
+
const n = oe.current;
|
|
345
|
+
if (!n) return;
|
|
346
|
+
const t = {
|
|
347
|
+
raf: 0,
|
|
348
|
+
cancelled: !1,
|
|
349
|
+
lut: null,
|
|
350
|
+
lutKey: "",
|
|
351
|
+
itemsCache: [],
|
|
352
|
+
cacheDirty: !0
|
|
353
|
+
}, s = () => {
|
|
354
|
+
for (const F of t.itemsCache)
|
|
355
|
+
for (const A of F.glyphs) Qe(A.inner);
|
|
356
|
+
}, $ = () => {
|
|
357
|
+
const F = pe.current ?? n;
|
|
358
|
+
t.itemsCache = Array.from(
|
|
359
|
+
n.querySelectorAll("[data-marquee-text-item]"),
|
|
360
|
+
(A) => {
|
|
361
|
+
const S = [];
|
|
362
|
+
return A.querySelectorAll("[data-marquee-wave-node]").forEach((_) => {
|
|
363
|
+
const M = _.firstElementChild;
|
|
364
|
+
M && S.push({
|
|
365
|
+
inner: M,
|
|
366
|
+
layoutLocalX: It(_, F)
|
|
367
|
+
});
|
|
368
|
+
}), { item: A, glyphs: S };
|
|
369
|
+
}
|
|
370
|
+
), t.cacheDirty = !1;
|
|
371
|
+
}, h = () => {
|
|
372
|
+
t.cacheDirty && $();
|
|
373
|
+
const A = (pe.current ?? n).offsetWidth || 1, S = A * xe.current, _ = ve.current, M = 2 * Math.PI * _ / A, L = `${A}|${S}|${M}`;
|
|
374
|
+
if (L !== t.lutKey && (t.lutKey = L, t.lut = Je(S, M, Ge)), Math.abs(S) <= 0 || M <= 0) {
|
|
375
|
+
s();
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const se = ge.current, $e = se ? Ot(getComputedStyle(se).transform) : 0, Ue = n.getBoundingClientRect(), vt = Ue.left, yt = Ue.right, bt = t.lut && t.lut.wavelength > 0 ? Math.max(0, (t.lut.periodArc / t.lut.wavelength - 1) * A) : 0;
|
|
379
|
+
for (const { item: wt, glyphs: Xe } of t.itemsCache) {
|
|
380
|
+
const Ve = wt.getBoundingClientRect();
|
|
381
|
+
if (Ve.right < vt || Ve.left > yt + bt) {
|
|
382
|
+
for (const ce of Xe) Qe(ce.inner);
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
for (const ce of Xe) {
|
|
386
|
+
const Ae = ce.layoutLocalX + $e, je = t.lut ? Xt(t.lut, Ae) : Ae, Ye = M * je, $t = S * Math.sin(Ye), At = S * M * Math.cos(Ye), St = Math.atan(At) * (180 / Math.PI);
|
|
387
|
+
Dt(ce.inner, je - Ae, $t, St);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, p = () => {
|
|
391
|
+
t.cancelled || (t.raf = 0, h(), Re.current && !document.hidden && (t.raf = requestAnimationFrame(p)));
|
|
392
|
+
}, m = () => {
|
|
393
|
+
t.cancelled || t.raf || (t.raf = requestAnimationFrame(p));
|
|
394
|
+
}, f = () => {
|
|
395
|
+
t.cacheDirty = !0, h(), m();
|
|
396
|
+
};
|
|
397
|
+
K.current = m, Q.current = f, h(), m();
|
|
398
|
+
const g = () => {
|
|
399
|
+
if (document.hidden) {
|
|
400
|
+
cancelAnimationFrame(t.raf), t.raf = 0;
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
cancelAnimationFrame(t.raf), t.raf = 0, f();
|
|
404
|
+
};
|
|
405
|
+
return document.addEventListener("visibilitychange", g), window.addEventListener("pageshow", g), window.addEventListener("focus", g), () => {
|
|
406
|
+
t.cancelled = !0, K.current = null, Q.current = null, cancelAnimationFrame(t.raf), document.removeEventListener("visibilitychange", g), window.removeEventListener("pageshow", g), window.removeEventListener("focus", g), s();
|
|
407
|
+
};
|
|
408
|
+
}, [y, P]), W(() => {
|
|
409
|
+
var n;
|
|
410
|
+
!y || !P || (n = Q.current) == null || n.call(Q);
|
|
411
|
+
}, [y, P, d, ae, U, I, O, j, G]), W(() => {
|
|
412
|
+
var n;
|
|
413
|
+
(n = K.current) == null || n.call(K);
|
|
414
|
+
}, [he, u]);
|
|
415
|
+
const at = (n) => {
|
|
416
|
+
me && n.pointerType === "mouse" && Me(!0);
|
|
417
|
+
}, st = () => {
|
|
418
|
+
me && Me(!1);
|
|
419
|
+
}, Be = y ? Math.abs(O) * 100 : 0, ye = ne(te), ct = {
|
|
420
|
+
minHeight: ye,
|
|
421
|
+
...y ? { paddingTop: `${Be}%`, paddingBottom: `${Be}%` } : {}
|
|
422
|
+
}, lt = {
|
|
423
|
+
height: ye,
|
|
424
|
+
...y ? { visibility: "hidden" } : { backgroundColor: ee }
|
|
425
|
+
}, He = {
|
|
426
|
+
gap: ne(v),
|
|
427
|
+
minHeight: ye
|
|
428
|
+
}, ze = G * O, Pe = Math.abs(ze), be = We > 0 ? We : Le, we = Math.max(Le, be), ut = Pe + we / 2, dt = Math.max(be, 1), De = y && G > 0 && we > 0 ? Vt(
|
|
429
|
+
G,
|
|
430
|
+
ze,
|
|
431
|
+
j,
|
|
432
|
+
ut,
|
|
433
|
+
dt
|
|
434
|
+
) : "", mt = Pe * 2 + we, ft = De ? /* @__PURE__ */ x(
|
|
435
|
+
"svg",
|
|
436
|
+
{
|
|
437
|
+
className: `${i}-curve-bg`,
|
|
438
|
+
viewBox: `0 0 ${G} ${mt}`,
|
|
439
|
+
preserveAspectRatio: "none",
|
|
440
|
+
"aria-hidden": !0,
|
|
441
|
+
children: /* @__PURE__ */ x(
|
|
442
|
+
"path",
|
|
443
|
+
{
|
|
444
|
+
d: De,
|
|
445
|
+
fill: "none",
|
|
446
|
+
stroke: ee,
|
|
447
|
+
strokeWidth: be,
|
|
448
|
+
strokeLinecap: "butt",
|
|
449
|
+
strokeLinejoin: "round"
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
) : null, ht = /* @__PURE__ */ x("div", { ref: ke, className: `${i}-ribbon`, style: lt, "aria-hidden": !0 }), pt = {
|
|
454
|
+
...z,
|
|
455
|
+
lineHeight: I > 0 ? `${I}px` : `${ue}em`
|
|
456
|
+
}, Oe = (n, t, s) => /* @__PURE__ */ x(
|
|
457
|
+
jt,
|
|
458
|
+
{
|
|
459
|
+
item: n,
|
|
460
|
+
prefix: i,
|
|
461
|
+
textCss: pt,
|
|
462
|
+
capHeightPx: I,
|
|
463
|
+
opticalOffsetY: nt,
|
|
464
|
+
imageGapPx: ne(v),
|
|
465
|
+
isCurve: y
|
|
466
|
+
},
|
|
467
|
+
`${t}-${s}`
|
|
468
|
+
), gt = /* @__PURE__ */ x("span", { ref: Ee, "aria-hidden": !0, className: `${i}-cap-ref`, style: z, children: "H" }), Ie = `${Math.max(0, tt) / 1e3}s`, xt = D ? /* @__PURE__ */ x(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
ref: ge,
|
|
472
|
+
className: `${i}-marquee-track`,
|
|
473
|
+
"data-direction": u,
|
|
474
|
+
onPointerEnter: at,
|
|
475
|
+
onPointerLeave: st,
|
|
476
|
+
style: {
|
|
477
|
+
WebkitAnimationDuration: Ie,
|
|
478
|
+
animationDuration: Ie,
|
|
479
|
+
WebkitAnimationPlayState: fe,
|
|
480
|
+
animationPlayState: fe
|
|
481
|
+
},
|
|
482
|
+
children: Array.from({ length: it }, (n, t) => /* @__PURE__ */ x(
|
|
483
|
+
"div",
|
|
484
|
+
{
|
|
485
|
+
ref: t === 0 ? ie : void 0,
|
|
486
|
+
className: `${i}-marquee-set`,
|
|
487
|
+
style: { ...He, paddingRight: ne(v) },
|
|
488
|
+
"aria-hidden": t > 0,
|
|
489
|
+
children: ot.map((s, $) => Oe(s, t, $))
|
|
490
|
+
},
|
|
491
|
+
`set-${t}`
|
|
492
|
+
))
|
|
493
|
+
}
|
|
494
|
+
) : /* @__PURE__ */ x(
|
|
495
|
+
"div",
|
|
496
|
+
{
|
|
497
|
+
ref: ie,
|
|
498
|
+
className: Mt(`${i}-marquee-set`, `${i}-marquee-static`),
|
|
499
|
+
style: He,
|
|
500
|
+
children: r == null ? void 0 : r.map((n, t) => Oe(n, 0, t))
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
return /* @__PURE__ */ Ce("div", { ref: oe, className: `${i}-wrapper`, "aria-label": "Marquee text", children: [
|
|
504
|
+
/* @__PURE__ */ x("style", { dangerouslySetInnerHTML: { __html: Ze } }),
|
|
505
|
+
gt,
|
|
506
|
+
/* @__PURE__ */ Ce("div", { ref: pe, className: `${i}-marquee-wrapper`, style: ct, children: [
|
|
507
|
+
ht,
|
|
508
|
+
ft,
|
|
509
|
+
xt
|
|
510
|
+
] })
|
|
511
|
+
] });
|
|
512
|
+
};
|
|
513
|
+
export {
|
|
514
|
+
en as MarqueeText
|
|
515
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),a=require("react"),wt=require("classnames"),$t=require("./scalingValue-CSHYgTZl.js"),St=require("./useScopedStyles-Bf6yohVQ.js"),At=require("./textStylesToCss-CNN3zZTV.js");function Et(e,r,o){const s=r>0?`${r}px`:"0px",i=o?`
|
|
2
|
+
.${e}-item-image-wrap {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex: 0 0 auto;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
.${e}-glyph {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
.${e}-glyph-inner {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
transform-origin: 50% 50%;
|
|
13
|
+
backface-visibility: hidden;
|
|
14
|
+
-webkit-backface-visibility: hidden;
|
|
15
|
+
}
|
|
16
|
+
.${e}-item-image {
|
|
17
|
+
transform-origin: 50% 50%;
|
|
18
|
+
backface-visibility: hidden;
|
|
19
|
+
-webkit-backface-visibility: hidden;
|
|
20
|
+
}
|
|
21
|
+
`:"";return`
|
|
22
|
+
.${e}-wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: auto;
|
|
26
|
+
}
|
|
27
|
+
.${e}-marquee-wrapper {
|
|
28
|
+
position: relative;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
overflow-x: clip;
|
|
31
|
+
overflow-y: visible;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: auto;
|
|
34
|
+
}
|
|
35
|
+
.${e}-curve-bg {
|
|
36
|
+
position: absolute;
|
|
37
|
+
left: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
overflow: visible;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 0;
|
|
44
|
+
}
|
|
45
|
+
.${e}-ribbon {
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 50%;
|
|
49
|
+
width: 100%;
|
|
50
|
+
transform: translateY(-50%);
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes ${e}-marquee-left {
|
|
56
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
57
|
+
to { -webkit-transform: translate3d(-${s}, 0, 0); transform: translate3d(-${s}, 0, 0); }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes ${e}-marquee-right {
|
|
61
|
+
from { -webkit-transform: translate3d(-${s}, 0, 0); transform: translate3d(-${s}, 0, 0); }
|
|
62
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.${e}-marquee-track {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: row;
|
|
68
|
+
width: max-content;
|
|
69
|
+
backface-visibility: hidden;
|
|
70
|
+
-webkit-backface-visibility: hidden;
|
|
71
|
+
flex-wrap: nowrap;
|
|
72
|
+
-webkit-animation-timing-function: linear;
|
|
73
|
+
animation-timing-function: linear;
|
|
74
|
+
-webkit-animation-iteration-count: infinite;
|
|
75
|
+
animation-iteration-count: infinite;
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
}
|
|
79
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
80
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
81
|
+
animation-name: ${e}-marquee-left;
|
|
82
|
+
}
|
|
83
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
84
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
85
|
+
animation-name: ${e}-marquee-right;
|
|
86
|
+
}
|
|
87
|
+
.${e}-marquee-set {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: row;
|
|
90
|
+
align-items: center;
|
|
91
|
+
flex: 0 0 auto;
|
|
92
|
+
position: relative;
|
|
93
|
+
z-index: 1;
|
|
94
|
+
}
|
|
95
|
+
.${e}-marquee-static {
|
|
96
|
+
justify-content: center;
|
|
97
|
+
overflow-x: auto;
|
|
98
|
+
}
|
|
99
|
+
.${e}-item {
|
|
100
|
+
position: relative;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
align-items: center;
|
|
104
|
+
flex: 0 0 auto;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
.${e}-item-link {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
color: inherit;
|
|
113
|
+
}
|
|
114
|
+
.${e}-item-image {
|
|
115
|
+
display: block;
|
|
116
|
+
width: auto;
|
|
117
|
+
flex: 0 0 auto;
|
|
118
|
+
object-fit: contain;
|
|
119
|
+
}
|
|
120
|
+
.${e}-text {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
}
|
|
123
|
+
${i}
|
|
124
|
+
.${e}-cap-ref {
|
|
125
|
+
position: absolute;
|
|
126
|
+
visibility: hidden;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
left: -9999px;
|
|
130
|
+
top: 0;
|
|
131
|
+
}
|
|
132
|
+
`}const Mt=30,we=3,Ct=12,Rt=96,Ue=3,se=.72,kt=100,qt=10,Lt=e=>e/kt,Ft=e=>Math.max(0,e)/qt,Tt=e=>{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")},_t=(e,r)=>Array.from({length:r*e.length},(o,s)=>e[s%e.length]),D={ctx:void 0},Wt=()=>D.ctx!==void 0?D.ctx:typeof document>"u"?(D.ctx=null,D.ctx):(D.ctx=document.createElement("canvas").getContext("2d"),D.ctx),Nt=(e,r,o,s)=>{e.style.transform=`translate3d(${r}px, ${o}px, 0) rotate(${s}deg)`},Xe=e=>{e.style.transform=""},jt=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Bt=(e,r)=>{const o=(s,i)=>{if(!s||s===r)return i;const m=i+s.offsetLeft,u=s.offsetParent;return!u||u===s?m:o(u,m)};return o(e,e.offsetWidth/2)},Ve=96,Ye=(e,r,o)=>{if(r<=0||Math.abs(e)<=0||o<2)return null;const s=2*Math.PI/r,i=new Float64Array(o+1),m=new Float64Array(o+1),u=e*r,l=d=>Math.sqrt(1+(u*Math.cos(r*d))**2),w=s/o;return Array.from({length:o},(d,R)=>{const v=R*w,M=v+w;i[R+1]=M,m[R+1]=m[R]+(l(v)+l(M))*.5*w}),{wavelength:s,periodArc:m[o],x:i,s:m}},Ht=(e,r)=>{const o=Ye(e,r,Ve);return!o||o.wavelength<=0?1:o.periodArc/o.wavelength},Pt=(e,r)=>{if(e.periodArc<=0)return r;const o=r<0?-1:1,s=Math.abs(r),i=Math.floor(s/e.periodArc),m=s-i*e.periodArc,{s:u,x:l}=e,w=(k,$)=>{if($-k<=1)return[k,$];const q=k+$>>1;return u[q]<=m?w(q,$):w(k,q)},[d,R]=w(0,u.length-1),v=u[R]-u[d],M=v>0?(m-u[d])/v:0;return o*(i*e.wavelength+l[d]+(l[R]-l[d])*M)},zt=(e,r,o,s,i=0)=>{const m=Math.max(0,o),u=e>0?2*Math.PI*m/e:0,l=$=>s+r*Math.sin(u*$),w=$=>r*u*Math.cos(u*$),d=-i,v=e+i-d,M=Math.max(4,Math.ceil(m*4*(v/Math.max(e,1)))),k=Array.from({length:M},($,q)=>{const W=d+q/M*v,L=d+(q+1)/M*v,N=L-W,Q=l(W),I=l(L),G=W+N/3,J=Q+w(W)*N/3,ce=L-N/3,Z=I-w(L)*N/3;return`C${G.toFixed(2)} ${J.toFixed(2)} ${ce.toFixed(2)} ${Z.toFixed(2)} ${L.toFixed(2)} ${I.toFixed(2)}`});return[`M${d.toFixed(2)} ${l(d).toFixed(2)}`,...k].join(" ")},Ot=({item:e,prefix:r,textCss:o,capHeightPx:s,opticalOffsetY:i,imageGapPx:m,isCurve:u})=>{var k;const l=i!==0?{...o,transform:`translateY(${i}px)`}:o,w=s>0?{height:`${s}px`}:{fontSize:o.fontSize,height:`${se}em`},d=((k=e.image)==null?void 0:k.assetId)&&f.jsx("img",{src:e.image.assetId,alt:e.image.name??"",className:`${r}-item-image`,style:w}),R=d&&(u?f.jsx("span",{className:`${r}-item-image-wrap`,"data-marquee-wave-node":!0,children:d}):d),v=u?f.jsx("span",{className:`${r}-text`,style:l,children:Array.from(e.text).map(($,q)=>f.jsx("span",{className:`${r}-glyph`,"data-marquee-wave-node":!0,children:f.jsx("span",{className:`${r}-glyph-inner`,children:$===" "?" ":$})},q))}):f.jsx("span",{className:`${r}-text`,style:l,children:e.text}),M=f.jsxs(f.Fragment,{children:[R,v]});return f.jsx("div",{className:`${r}-item`,"data-marquee-text-item":!0,style:{gap:m},children:e.link?f.jsx("a",{href:e.link,className:`${r}-item-link`,style:{gap:m},children:M}):M})},Dt=({settings:e,content:r,isEditor:o,isPreviewMode:s})=>{const{prefix:i}=St.useScopedStyles(),[m,u]=a.useState(0),l=m>0?Math.round(m):0,{speed:w,direction:d,pauseOnHover:R,gap:v,layoutType:M,curveAmplitude:k,curveFrequency:$,textFontFamily:q,textFontSettings:W,textFontSize:L,textLetterSpacing:N,textWordSpacing:Q,textTextAppearance:I,textColor:G,backgroundColor:J,ribbonWidth:ce}=e,Z=ce??L,b=M==="curve",P=Lt(k),U=Ft($),Ke=a.useMemo(()=>Et(i,l,b),[i,l,b]),j=a.useMemo(()=>At.textStylesToCss({fontSettings:{fontFamily:q,fontWeight:W.fontWeight,fontStyle:W.fontStyle},letterSpacing:N,wordSpacing:Q,fontSize:L,lineHeight:L,textAppearance:I,color:G},o),[q,W,N,Q,L,I,G,o]),ee=n=>$t.scalingValue(n,o??!1),B=((r==null?void 0:r.length)??0)>0,X=o?!!s:!0,H=B&&(X||!!o),te=Math.max(0,w)*Mt,ue=X&&R==="on",[Qe,$e]=a.useState(!1),le=X?ue&&Qe?"paused":"running":"paused",de=le==="running"&&te>0&&l>0,Ge=l>0&&te>0?l/te*1e3:0,ne=a.useRef(null),fe=a.useRef(null),me=a.useRef(null),re=a.useRef(null),Se=a.useRef(null),Ae=a.useRef(null),Ee=a.useRef(de),V=a.useRef(null),Y=a.useRef(null),he=a.useRef(P),pe=a.useRef(U);Ee.current=de,he.current=P,pe.current=U;const[z,Me]=a.useState(0),[Je,Ce]=a.useState(0),[Re,ke]=a.useState(0),[K,qe]=a.useState(0),[Le,Ze]=a.useState(0),oe=a.useMemo(()=>(r??[]).map(n=>{var t;return`${n.text}\0${((t=n.image)==null?void 0:t.assetId)??""}\0${n.link??""}`}).join("\0"),[r]),[O,Fe]=a.useState(we),et=a.useMemo(()=>{const n=r??[];return n.length===0||!(X||o)?n:_t(n,O)},[r,X,O,o]),tt=H?Ue:1;a.useLayoutEffect(()=>{Fe(we),u(0)},[oe]),a.useLayoutEffect(()=>{var g;const n=Ae.current;if(!n)return;const t=()=>{const x=getComputedStyle(n),h=parseFloat(x.fontSize)||0;if(h<=0)return;const p=Wt();if(!p){Me(h*se),Ce(0);return}p.font=`${x.fontStyle} ${x.fontWeight} ${h}px ${x.fontFamily}`;const y=p.measureText("H"),F=y.actualBoundingBoxAscent>0?y.actualBoundingBoxAscent:h*se,A=Math.max(0,y.actualBoundingBoxDescent||0),E=y.fontBoundingBoxAscent||0,_=y.fontBoundingBoxDescent||0;Me(T=>Math.abs(T-F)>.5?F:T);const C=E>0||_>0?(_-A-(E-F))/2:0;Ce(T=>Math.abs(T-C)>.25?C:T)};t();const c=typeof document<"u"?document.fonts:void 0;(g=c==null?void 0:c.ready)==null||g.then(t).catch(()=>{});const S=new ResizeObserver(t);return S.observe(n),()=>S.disconnect()},[j.fontFamily,j.fontWeight,j.fontStyle,j.fontSize,j.lineHeight]),a.useLayoutEffect(()=>{if(!H)return;const n=ne.current,t=re.current;if(!n||!t)return;const c={id:0},S=()=>{const p=n.offsetWidth||n.getBoundingClientRect().width,y=t.offsetWidth||t.getBoundingClientRect().width;if(B&&p>0&&y>0){const F=y/O;if(F>0){let A=p,E=Ct;if(b){const C=p*he.current,T=pe.current,ae=T>0?2*Math.PI*T/p:0,ve=Ht(C,ae);A=Math.max(p,ve*p/(Ue-1)),E=Rt}const _=Math.min(E,Math.max(we,Math.ceil(A/F)+1));if(_!==O){Fe(_);return}}}y>0&&u(y)},g=()=>{cancelAnimationFrame(c.id),c.id=requestAnimationFrame(S)};g();const x=new ResizeObserver(g);x.observe(n),x.observe(t);const h=()=>{document.hidden||g()};return document.addEventListener("visibilitychange",h),window.addEventListener("pageshow",h),window.addEventListener("focus",h),()=>{cancelAnimationFrame(c.id),x.disconnect(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pageshow",h),window.removeEventListener("focus",h)}},[H,oe,O,B,z,b,P,U]),a.useLayoutEffect(()=>{const n=Se.current;if(!n)return;const t={id:0},c=()=>{const g=n.offsetHeight;g>0&&Ze(x=>Math.abs(x-g)>.5?g:x)};t.id=requestAnimationFrame(c);const S=new ResizeObserver(()=>{cancelAnimationFrame(t.id),t.id=requestAnimationFrame(c)});return S.observe(n),()=>{cancelAnimationFrame(t.id),S.disconnect()}},[Z,o]),a.useLayoutEffect(()=>{if(!b){ke(0),qe(0);return}const n=ne.current,t=re.current;if(!n||!t)return;const c={id:0},S=()=>{const x=n.offsetWidth,h=t.offsetHeight;x>0&&qe(p=>Math.abs(p-x)>.5?x:p),h>0&&ke(p=>Math.abs(p-h)>.5?h:p)};c.id=requestAnimationFrame(S);const g=new ResizeObserver(()=>{cancelAnimationFrame(c.id),c.id=requestAnimationFrame(S)});return g.observe(n),g.observe(t),()=>{cancelAnimationFrame(c.id),g.disconnect()}},[b,oe,z,L,H]),a.useLayoutEffect(()=>{if(!H||l<=0)return;const n=me.current;n&&Tt(n)},[H,l,d,te]),a.useLayoutEffect(()=>{if(!b||!B)return;const n=ne.current;if(!n)return;const t={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},c=()=>{for(const F of t.itemsCache)for(const A of F.glyphs)Xe(A.inner)},S=()=>{const F=fe.current??n;t.itemsCache=Array.from(n.querySelectorAll("[data-marquee-text-item]"),A=>{const E=[];return A.querySelectorAll("[data-marquee-wave-node]").forEach(_=>{const C=_.firstElementChild;C&&E.push({inner:C,layoutLocalX:Bt(_,F)})}),{item:A,glyphs:E}}),t.cacheDirty=!1},g=()=>{t.cacheDirty&&S();const A=(fe.current??n).offsetWidth||1,E=A*he.current,_=pe.current,C=2*Math.PI*_/A,T=`${A}|${E}|${C}`;if(T!==t.lutKey&&(t.lutKey=T,t.lut=Ye(E,C,Ve)),Math.abs(E)<=0||C<=0){c();return}const ae=me.current,ve=ae?jt(getComputedStyle(ae).transform):0,Pe=n.getBoundingClientRect(),ht=Pe.left,pt=Pe.right,gt=t.lut&&t.lut.wavelength>0?Math.max(0,(t.lut.periodArc/t.lut.wavelength-1)*A):0;for(const{item:xt,glyphs:ze}of t.itemsCache){const Oe=xt.getBoundingClientRect();if(Oe.right<ht||Oe.left>pt+gt){for(const ie of ze)Xe(ie.inner);continue}for(const ie of ze){const be=ie.layoutLocalX+ve,De=t.lut?Pt(t.lut,be):be,Ie=C*De,yt=E*Math.sin(Ie),vt=E*C*Math.cos(Ie),bt=Math.atan(vt)*(180/Math.PI);Nt(ie.inner,De-be,yt,bt)}}},x=()=>{t.cancelled||(t.raf=0,g(),Ee.current&&!document.hidden&&(t.raf=requestAnimationFrame(x)))},h=()=>{t.cancelled||t.raf||(t.raf=requestAnimationFrame(x))},p=()=>{t.cacheDirty=!0,g(),h()};V.current=h,Y.current=p,g(),h();const y=()=>{if(document.hidden){cancelAnimationFrame(t.raf),t.raf=0;return}cancelAnimationFrame(t.raf),t.raf=0,p()};return document.addEventListener("visibilitychange",y),window.addEventListener("pageshow",y),window.addEventListener("focus",y),()=>{t.cancelled=!0,V.current=null,Y.current=null,cancelAnimationFrame(t.raf),document.removeEventListener("visibilitychange",y),window.removeEventListener("pageshow",y),window.removeEventListener("focus",y),c()}},[b,B]),a.useLayoutEffect(()=>{var n;!b||!B||(n=Y.current)==null||n.call(Y)},[b,B,m,oe,O,z,P,U,K]),a.useLayoutEffect(()=>{var n;(n=V.current)==null||n.call(V)},[de,d]);const nt=n=>{ue&&n.pointerType==="mouse"&&$e(!0)},rt=()=>{ue&&$e(!1)},Te=b?Math.abs(P)*100:0,ge=ee(Z),ot={minHeight:ge,...b?{paddingTop:`${Te}%`,paddingBottom:`${Te}%`}:{}},at={height:ge,...b?{visibility:"hidden"}:{backgroundColor:J}},_e={gap:ee(v),minHeight:ge},We=K*P,Ne=Math.abs(We),xe=Le>0?Le:Re,ye=Math.max(Re,xe),it=Ne+ye/2,st=Math.max(xe,1),je=b&&K>0&&ye>0?zt(K,We,U,it,st):"",ct=Ne*2+ye,ut=je?f.jsx("svg",{className:`${i}-curve-bg`,viewBox:`0 0 ${K} ${ct}`,preserveAspectRatio:"none","aria-hidden":!0,children:f.jsx("path",{d:je,fill:"none",stroke:J,strokeWidth:xe,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,lt=f.jsx("div",{ref:Se,className:`${i}-ribbon`,style:at,"aria-hidden":!0}),dt={...j,lineHeight:z>0?`${z}px`:`${se}em`},Be=(n,t,c)=>f.jsx(Ot,{item:n,prefix:i,textCss:dt,capHeightPx:z,opticalOffsetY:Je,imageGapPx:ee(v),isCurve:b},`${t}-${c}`),ft=f.jsx("span",{ref:Ae,"aria-hidden":!0,className:`${i}-cap-ref`,style:j,children:"H"}),He=`${Math.max(0,Ge)/1e3}s`,mt=H?f.jsx("div",{ref:me,className:`${i}-marquee-track`,"data-direction":d,onPointerEnter:nt,onPointerLeave:rt,style:{WebkitAnimationDuration:He,animationDuration:He,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:tt},(n,t)=>f.jsx("div",{ref:t===0?re:void 0,className:`${i}-marquee-set`,style:{..._e,paddingRight:ee(v)},"aria-hidden":t>0,children:et.map((c,S)=>Be(c,t,S))},`set-${t}`))}):f.jsx("div",{ref:re,className:wt(`${i}-marquee-set`,`${i}-marquee-static`),style:_e,children:r==null?void 0:r.map((n,t)=>Be(n,0,t))});return f.jsxs("div",{ref:ne,className:`${i}-wrapper`,"aria-label":"Marquee text",children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:Ke}}),ft,f.jsxs("div",{ref:fe,className:`${i}-marquee-wrapper`,style:ot,children:[lt,ut,mt]})]})};exports.MarqueeText=Dt;
|