@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,507 @@
|
|
|
1
|
+
import { jsxs as x, jsx as r, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as w } from "react";
|
|
3
|
+
import { s } from "./scalingValue-C9JH5L6O.mjs";
|
|
4
|
+
import { S as Ft } from "./SvgImage-B5mR9y6q.mjs";
|
|
5
|
+
import { j as Z, r as q, D as Q, b as _, a as pt, g as wt, c as F, T as K, d as jt, e as b, f as R, h as At } from "./utils-FxC9rcxw.mjs";
|
|
6
|
+
function Qt({
|
|
7
|
+
prefix: i,
|
|
8
|
+
entry: u,
|
|
9
|
+
settings: B,
|
|
10
|
+
isEditor: a,
|
|
11
|
+
isEditMode: p,
|
|
12
|
+
isPreviewMode: ut,
|
|
13
|
+
onClose: j
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
title1Width: X,
|
|
17
|
+
title2Width: Y,
|
|
18
|
+
title3Width: E,
|
|
19
|
+
title1MarginLeft: L = 0,
|
|
20
|
+
title2MarginLeft: P = 0,
|
|
21
|
+
title3MarginLeft: tt = 0,
|
|
22
|
+
titleRowMarginBottom: C = 0,
|
|
23
|
+
titleHeaderLayout: vt = "desktop",
|
|
24
|
+
contentMarginTop: et = 0,
|
|
25
|
+
iconMarginRight: Tt = 0,
|
|
26
|
+
closeIcon: ot = null,
|
|
27
|
+
closeIconMaxWidth: nt = 0,
|
|
28
|
+
closeIconColor: it = "#000000",
|
|
29
|
+
closeIconHoverColor: lt = "#cccccc"
|
|
30
|
+
} = B, Wt = s(et, a), yt = s(
|
|
31
|
+
Math.max(et, K),
|
|
32
|
+
a
|
|
33
|
+
), rt = s(Tt, a), St = s(C, a), f = vt === "mobile", M = Z("title1", q(B, "title1"), a), N = Z("title2", q(B, "title2"), a), $ = Z("title3", q(B, "title3"), a), m = w(
|
|
34
|
+
() => ({
|
|
35
|
+
title1Width: X ?? Q.title1Width,
|
|
36
|
+
title2Width: Y ?? Q.title2Width,
|
|
37
|
+
title3Width: E ?? Q.title3Width
|
|
38
|
+
}),
|
|
39
|
+
[X, Y, E]
|
|
40
|
+
), W = w(() => ({
|
|
41
|
+
title2MarginLeft: P,
|
|
42
|
+
title3MarginLeft: tt
|
|
43
|
+
}), [P, tt]), c = w(
|
|
44
|
+
() => _(i, u, M, N, $),
|
|
45
|
+
[i, u, M, N, $]
|
|
46
|
+
), O = w(
|
|
47
|
+
() => c.map((t) => m[t.widthKey]),
|
|
48
|
+
[c, m]
|
|
49
|
+
), T = w(
|
|
50
|
+
() => pt(c.length, O),
|
|
51
|
+
[c.length, O]
|
|
52
|
+
), bt = w(
|
|
53
|
+
() => wt(c.length, O),
|
|
54
|
+
[c.length, O]
|
|
55
|
+
), A = w(
|
|
56
|
+
() => c.filter((t) => t.prefix === "title1"),
|
|
57
|
+
[c]
|
|
58
|
+
), y = w(
|
|
59
|
+
() => c.filter((t) => t.prefix === "title2" || t.prefix === "title3"),
|
|
60
|
+
[c]
|
|
61
|
+
), z = w(
|
|
62
|
+
() => F(A, m),
|
|
63
|
+
[A, m]
|
|
64
|
+
), I = w(
|
|
65
|
+
() => F(y, m),
|
|
66
|
+
[y, m]
|
|
67
|
+
), D = !!(u.title1 || u.title2 || u.title3), k = ot !== null;
|
|
68
|
+
if (!(D || k)) return null;
|
|
69
|
+
const at = (L ?? 0) > 0 || p, U = (t, e) => {
|
|
70
|
+
const l = c.findIndex((n) => n.prefix === t.prefix);
|
|
71
|
+
if (!f || e === "single-row")
|
|
72
|
+
return {
|
|
73
|
+
effectiveWidth: bt[l] ?? 0,
|
|
74
|
+
resolvedWidth: T[l] ?? 0,
|
|
75
|
+
maxWidth: b(l, T)
|
|
76
|
+
};
|
|
77
|
+
if (e === "two-row-top") {
|
|
78
|
+
const n = A.findIndex((h) => h.prefix === t.prefix);
|
|
79
|
+
return {
|
|
80
|
+
effectiveWidth: z.effective[n] ?? 0,
|
|
81
|
+
resolvedWidth: z.resolved[n] ?? 0,
|
|
82
|
+
maxWidth: b(n, z.resolved)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const o = y.findIndex((n) => n.prefix === t.prefix);
|
|
86
|
+
return {
|
|
87
|
+
effectiveWidth: I.effective[o] ?? 0,
|
|
88
|
+
resolvedWidth: I.resolved[o] ?? 0,
|
|
89
|
+
maxWidth: b(o, I.resolved)
|
|
90
|
+
};
|
|
91
|
+
}, G = (t, e, l) => {
|
|
92
|
+
if (!f || l === "single-row") {
|
|
93
|
+
const d = t.findIndex((S) => S.prefix === e.prefix), v = t.map((S) => m[S.widthKey]), H = pt(t.length, v);
|
|
94
|
+
return {
|
|
95
|
+
effectiveWidth: wt(t.length, v)[d] ?? 0,
|
|
96
|
+
resolvedWidth: H[d] ?? 0,
|
|
97
|
+
maxWidth: b(d, H)
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (l === "two-row-top") {
|
|
101
|
+
const d = t.filter((S) => S.prefix === "title1"), v = d.findIndex((S) => S.prefix === e.prefix), { resolved: H, effective: xt } = F(d, m);
|
|
102
|
+
return {
|
|
103
|
+
effectiveWidth: xt[v] ?? 0,
|
|
104
|
+
resolvedWidth: H[v] ?? 0,
|
|
105
|
+
maxWidth: b(v, H)
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
const o = t.filter((d) => d.prefix === "title2" || d.prefix === "title3"), n = o.findIndex((d) => d.prefix === e.prefix), { resolved: h, effective: g } = F(o, m);
|
|
109
|
+
return {
|
|
110
|
+
effectiveWidth: g[n] ?? 0,
|
|
111
|
+
resolvedWidth: h[n] ?? 0,
|
|
112
|
+
maxWidth: b(n, h)
|
|
113
|
+
};
|
|
114
|
+
}, Lt = (t) => At(
|
|
115
|
+
c,
|
|
116
|
+
T,
|
|
117
|
+
W,
|
|
118
|
+
t
|
|
119
|
+
) + (f ? 0 : L ?? 0), Mt = () => f ? 0 : L ?? 0, st = (t) => y.slice(0, t).reduce(
|
|
120
|
+
(e, l, o) => e + (l.marginLeftKey ? W[l.marginLeftKey] ?? 0 : 0) + (I.resolved[o] ?? 0),
|
|
121
|
+
0
|
|
122
|
+
), Rt = (t) => {
|
|
123
|
+
const e = y[t];
|
|
124
|
+
return st(t) + (e.marginLeftKey ? W[e.marginLeftKey] ?? 0 : 0) + (I.resolved[t] ?? 0);
|
|
125
|
+
}, V = (t, e, l) => {
|
|
126
|
+
const o = t.marginLeftKey ? W[t.marginLeftKey] ?? 0 : 0, {
|
|
127
|
+
effectiveWidth: n,
|
|
128
|
+
resolvedWidth: h,
|
|
129
|
+
maxWidth: g
|
|
130
|
+
} = l ?? U(t, e), d = Math.max(o, K), v = p && e === "two-row-top";
|
|
131
|
+
return /* @__PURE__ */ x(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: `${i}-title-cell`,
|
|
135
|
+
"data-title": t.prefix,
|
|
136
|
+
style: {
|
|
137
|
+
width: s(n, a),
|
|
138
|
+
...o > 0 ? { marginLeft: s(o, a) } : {}
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ r("p", { className: t.className, style: t.style, children: t.text }),
|
|
142
|
+
v && t.marginLeftKey ? /* @__PURE__ */ r(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
"data-controls": t.marginLeftKey,
|
|
146
|
+
"data-controls-axis": "x",
|
|
147
|
+
"data-controls-min": "0",
|
|
148
|
+
"data-controls-max-fraction": String(h),
|
|
149
|
+
style: {
|
|
150
|
+
position: "absolute",
|
|
151
|
+
top: 0,
|
|
152
|
+
left: s(-o, a),
|
|
153
|
+
width: s(d, a),
|
|
154
|
+
height: "100%",
|
|
155
|
+
pointerEvents: "auto"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
) : null,
|
|
159
|
+
v ? /* @__PURE__ */ r(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
"data-controls": t.widthKey,
|
|
163
|
+
"data-controls-axis": "x",
|
|
164
|
+
"data-controls-max-fraction": String(g),
|
|
165
|
+
"data-controls-variant": "column-width",
|
|
166
|
+
className: `${i}-title-resize-handle`,
|
|
167
|
+
style: {
|
|
168
|
+
position: "absolute",
|
|
169
|
+
top: 0,
|
|
170
|
+
right: s(-R / 2, a),
|
|
171
|
+
width: s(R, a),
|
|
172
|
+
height: "100%",
|
|
173
|
+
pointerEvents: "auto"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
) : null
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
t.className
|
|
180
|
+
);
|
|
181
|
+
}, ct = (t = "two-row") => {
|
|
182
|
+
const e = c.findIndex((n) => n.prefix === "title1"), l = e >= 0 ? T[e] : m.title1Width, o = t === "two-row" && p;
|
|
183
|
+
return /* @__PURE__ */ r(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
...o ? {
|
|
187
|
+
"data-controls": "title1MarginLeft",
|
|
188
|
+
"data-controls-axis": "x",
|
|
189
|
+
"data-controls-min": "0",
|
|
190
|
+
"data-controls-max-fraction": String(l)
|
|
191
|
+
} : {},
|
|
192
|
+
style: {
|
|
193
|
+
width: s(L ?? 0, a),
|
|
194
|
+
flexShrink: 0,
|
|
195
|
+
alignSelf: "stretch",
|
|
196
|
+
...o ? { pointerEvents: "auto" } : {}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}, dt = () => /* @__PURE__ */ r(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
className: `${i}-titles-baseline-strut`,
|
|
204
|
+
style: M,
|
|
205
|
+
"aria-hidden": "true",
|
|
206
|
+
children: " "
|
|
207
|
+
}
|
|
208
|
+
), Nt = (t) => {
|
|
209
|
+
const e = _(i, t, M, N, $);
|
|
210
|
+
return /* @__PURE__ */ r(J, { children: e.map((l) => V(
|
|
211
|
+
l,
|
|
212
|
+
"single-row",
|
|
213
|
+
G(e, l, "single-row")
|
|
214
|
+
)) });
|
|
215
|
+
}, $t = (t) => {
|
|
216
|
+
const e = _(i, t, M, N, $), l = e.find((o) => o.prefix === "title1");
|
|
217
|
+
return l ? V(
|
|
218
|
+
l,
|
|
219
|
+
"two-row-top",
|
|
220
|
+
G(e, l, "two-row-top")
|
|
221
|
+
) : null;
|
|
222
|
+
}, It = (t, e = !1) => {
|
|
223
|
+
const l = _(i, t, M, N, $), o = l.filter((g) => g.prefix === "title2" || g.prefix === "title3"), n = p && e;
|
|
224
|
+
return o.length > 0 || n || (C ?? 0) > 0 ? /* @__PURE__ */ x("div", { className: `${i}-titles-row-bottom-wrap`, children: [
|
|
225
|
+
o.length > 0 ? /* @__PURE__ */ x("div", { className: `${i}-titles-row-bottom`, children: [
|
|
226
|
+
/* @__PURE__ */ r("div", { className: `${i}-titles-stack`, children: o.map((g) => V(
|
|
227
|
+
g,
|
|
228
|
+
"two-row-bottom",
|
|
229
|
+
G(l, g, "two-row-bottom")
|
|
230
|
+
)) }),
|
|
231
|
+
e && p ? /* @__PURE__ */ x(J, { children: [
|
|
232
|
+
Dt(),
|
|
233
|
+
kt()
|
|
234
|
+
] }) : null
|
|
235
|
+
] }) : null,
|
|
236
|
+
(C ?? 0) > 0 || n ? /* @__PURE__ */ r(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
"data-controls": n ? "titleRowMarginBottom" : void 0,
|
|
240
|
+
"data-controls-axis": n ? "y" : void 0,
|
|
241
|
+
"data-controls-reverse": n ? "" : void 0,
|
|
242
|
+
className: n ? `${i}-control` : void 0,
|
|
243
|
+
style: {
|
|
244
|
+
height: St,
|
|
245
|
+
width: "100%",
|
|
246
|
+
flexShrink: 0,
|
|
247
|
+
pointerEvents: n ? "auto" : "none"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
) : null
|
|
251
|
+
] }) : null;
|
|
252
|
+
}, Ht = () => /* @__PURE__ */ x(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
className: `${i}-close-icon`,
|
|
256
|
+
style: {
|
|
257
|
+
width: s(nt ?? 0, a),
|
|
258
|
+
height: s(nt ?? 0, a),
|
|
259
|
+
marginRight: rt,
|
|
260
|
+
"--close-icon-hover-color": lt
|
|
261
|
+
},
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ r(
|
|
264
|
+
"button",
|
|
265
|
+
{
|
|
266
|
+
type: "button",
|
|
267
|
+
className: `${i}-close-icon-inner`,
|
|
268
|
+
onClick: (t) => {
|
|
269
|
+
t.stopPropagation(), j == null || j();
|
|
270
|
+
},
|
|
271
|
+
"aria-label": "Close",
|
|
272
|
+
children: /* @__PURE__ */ r(
|
|
273
|
+
Ft,
|
|
274
|
+
{
|
|
275
|
+
url: ot ?? "",
|
|
276
|
+
fill: it,
|
|
277
|
+
hoverFill: a && !ut ? it : lt,
|
|
278
|
+
className: `${i}-close-icon-img`
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
p && /* @__PURE__ */ r(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
"data-controls": "iconMarginRight",
|
|
287
|
+
"data-controls-axis": "x",
|
|
288
|
+
"data-controls-reverse": "",
|
|
289
|
+
className: `${i}-control`,
|
|
290
|
+
style: {
|
|
291
|
+
position: "absolute",
|
|
292
|
+
top: 0,
|
|
293
|
+
left: "100%",
|
|
294
|
+
width: rt,
|
|
295
|
+
height: "100%",
|
|
296
|
+
pointerEvents: "auto"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
)
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
), ht = () => k ? /* @__PURE__ */ r("div", { className: `${i}-titles-row-header-controls`, children: Ht() }) : null, ft = (t) => /* @__PURE__ */ r("div", { className: `${i}-titles-row-titles`, children: /* @__PURE__ */ r("div", { className: `${i}-titles-stack`, children: t }) }), Kt = (t) => /* @__PURE__ */ x("div", { className: `${i}-titles-row-top`, children: [
|
|
303
|
+
k || D ? dt() : null,
|
|
304
|
+
at ? ct("two-row") : null,
|
|
305
|
+
ft(t),
|
|
306
|
+
ht()
|
|
307
|
+
] }), Bt = (t, e = !1) => /* @__PURE__ */ x(J, { children: [
|
|
308
|
+
Kt($t(t)),
|
|
309
|
+
It(t, e)
|
|
310
|
+
] }), Ct = () => {
|
|
311
|
+
const t = f ? -1 : c.findIndex((o) => o.prefix === "title1"), e = !f && (p || (L ?? 0) > 0) ? (() => {
|
|
312
|
+
const o = L ?? 0, n = t >= 0 ? T[t] : m.title1Width, h = Math.max(o, K);
|
|
313
|
+
return /* @__PURE__ */ r(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
"data-controls": "title1MarginLeft",
|
|
317
|
+
"data-controls-axis": "x",
|
|
318
|
+
"data-controls-min": "0",
|
|
319
|
+
"data-controls-max-fraction": String(n),
|
|
320
|
+
style: {
|
|
321
|
+
position: "absolute",
|
|
322
|
+
top: 0,
|
|
323
|
+
left: 0,
|
|
324
|
+
width: s(h, a),
|
|
325
|
+
height: "100%",
|
|
326
|
+
pointerEvents: "auto"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"title1MarginLeft"
|
|
330
|
+
);
|
|
331
|
+
})() : null, l = c.flatMap((o, n) => {
|
|
332
|
+
if (!o.marginLeftKey) return [];
|
|
333
|
+
const h = W[o.marginLeftKey] ?? 0, g = jt(
|
|
334
|
+
c,
|
|
335
|
+
T,
|
|
336
|
+
W,
|
|
337
|
+
n
|
|
338
|
+
) + Mt(), d = Math.max(h, K);
|
|
339
|
+
return /* @__PURE__ */ r(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
"data-controls": o.marginLeftKey,
|
|
343
|
+
"data-controls-axis": "x",
|
|
344
|
+
"data-controls-min": "0",
|
|
345
|
+
"data-controls-max-fraction": String(T[n]),
|
|
346
|
+
style: {
|
|
347
|
+
position: "absolute",
|
|
348
|
+
top: 0,
|
|
349
|
+
left: s(g, a),
|
|
350
|
+
width: s(d, a),
|
|
351
|
+
height: "100%",
|
|
352
|
+
pointerEvents: "auto"
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
o.marginLeftKey
|
|
356
|
+
);
|
|
357
|
+
});
|
|
358
|
+
return e ? [e, ...l] : l;
|
|
359
|
+
}, Ot = () => c.map((t, e) => {
|
|
360
|
+
const l = b(e, T), n = Lt(e) - R / 2;
|
|
361
|
+
return /* @__PURE__ */ r("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ r(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
"data-controls": t.widthKey,
|
|
365
|
+
"data-controls-axis": "x",
|
|
366
|
+
"data-controls-max-fraction": String(l),
|
|
367
|
+
"data-controls-variant": "column-width",
|
|
368
|
+
className: `${i}-title-resize-handle`,
|
|
369
|
+
style: {
|
|
370
|
+
position: "absolute",
|
|
371
|
+
top: 0,
|
|
372
|
+
left: s(n, a),
|
|
373
|
+
width: s(R, a),
|
|
374
|
+
height: "100%",
|
|
375
|
+
pointerEvents: "auto"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
) }, `${t.widthKey}-junction`);
|
|
379
|
+
}), Dt = () => y.flatMap((t, e) => {
|
|
380
|
+
if (!t.marginLeftKey) return [];
|
|
381
|
+
const l = W[t.marginLeftKey] ?? 0, o = st(e), n = Math.max(l, K), { resolvedWidth: h } = U(t, "two-row-bottom");
|
|
382
|
+
return /* @__PURE__ */ r(
|
|
383
|
+
"div",
|
|
384
|
+
{
|
|
385
|
+
"data-controls": t.marginLeftKey,
|
|
386
|
+
"data-controls-axis": "x",
|
|
387
|
+
"data-controls-min": "0",
|
|
388
|
+
"data-controls-max-fraction": String(h),
|
|
389
|
+
style: {
|
|
390
|
+
position: "absolute",
|
|
391
|
+
top: 0,
|
|
392
|
+
left: s(o, a),
|
|
393
|
+
width: s(n, a),
|
|
394
|
+
height: "100%",
|
|
395
|
+
pointerEvents: "auto"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
t.marginLeftKey
|
|
399
|
+
);
|
|
400
|
+
}), kt = () => y.map((t, e) => {
|
|
401
|
+
const { maxWidth: l } = U(t, "two-row-bottom"), n = Rt(e) - R / 2;
|
|
402
|
+
return /* @__PURE__ */ r("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ r(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
"data-controls": t.widthKey,
|
|
406
|
+
"data-controls-axis": "x",
|
|
407
|
+
"data-controls-max-fraction": String(l),
|
|
408
|
+
"data-controls-variant": "column-width",
|
|
409
|
+
className: `${i}-title-resize-handle`,
|
|
410
|
+
style: {
|
|
411
|
+
position: "absolute",
|
|
412
|
+
top: 0,
|
|
413
|
+
left: s(n, a),
|
|
414
|
+
width: s(R, a),
|
|
415
|
+
height: "100%",
|
|
416
|
+
pointerEvents: "auto"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
) }, `${t.widthKey}-junction`);
|
|
420
|
+
}), mt = () => !p || f ? null : /* @__PURE__ */ x(J, { children: [
|
|
421
|
+
Ct(),
|
|
422
|
+
Ot()
|
|
423
|
+
] }), gt = !!(u.title2 || u.title3 || (C ?? 0) > 0 || p), Jt = () => /* @__PURE__ */ x(
|
|
424
|
+
"div",
|
|
425
|
+
{
|
|
426
|
+
className: `${i}-titles-row ${i}-titles-row-header`,
|
|
427
|
+
style: { width: "100%", position: "relative" },
|
|
428
|
+
children: [
|
|
429
|
+
k || D ? dt() : null,
|
|
430
|
+
at ? ct("single-row") : null,
|
|
431
|
+
D ? ft(Nt(u)) : /* @__PURE__ */ r("div", { className: `${i}-titles-row-titles`, "aria-hidden": "true" }),
|
|
432
|
+
ht(),
|
|
433
|
+
mt()
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
), _t = () => /* @__PURE__ */ x(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
style: {
|
|
440
|
+
position: "relative",
|
|
441
|
+
width: "100%",
|
|
442
|
+
alignSelf: "stretch",
|
|
443
|
+
display: "flex",
|
|
444
|
+
flexDirection: "column",
|
|
445
|
+
minHeight: 0,
|
|
446
|
+
...gt ? { flex: 1, height: "100%" } : {}
|
|
447
|
+
},
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ r(
|
|
450
|
+
"div",
|
|
451
|
+
{
|
|
452
|
+
className: `${i}-titles-row-two-row`,
|
|
453
|
+
style: gt ? void 0 : { flex: "0 0 auto", height: "auto" },
|
|
454
|
+
children: Bt(u, !0)
|
|
455
|
+
}
|
|
456
|
+
),
|
|
457
|
+
mt()
|
|
458
|
+
]
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
return /* @__PURE__ */ x("div", { className: `${i}-lightbox-overlay-content`, children: [
|
|
462
|
+
/* @__PURE__ */ r(
|
|
463
|
+
"div",
|
|
464
|
+
{
|
|
465
|
+
style: {
|
|
466
|
+
position: "relative",
|
|
467
|
+
width: "100%",
|
|
468
|
+
height: Wt,
|
|
469
|
+
flexShrink: 0
|
|
470
|
+
},
|
|
471
|
+
children: p && /* @__PURE__ */ r(
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
"data-controls": "contentMarginTop",
|
|
475
|
+
"data-controls-axis": "y",
|
|
476
|
+
"data-controls-min": "0",
|
|
477
|
+
className: `${i}-control`,
|
|
478
|
+
style: {
|
|
479
|
+
position: "absolute",
|
|
480
|
+
top: 0,
|
|
481
|
+
left: 0,
|
|
482
|
+
width: "100%",
|
|
483
|
+
height: yt,
|
|
484
|
+
pointerEvents: "auto"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
/* @__PURE__ */ r("div", { style: {
|
|
491
|
+
display: "flex",
|
|
492
|
+
flexDirection: "row",
|
|
493
|
+
width: "100%",
|
|
494
|
+
...f ? { flex: 1, minHeight: 0 } : {}
|
|
495
|
+
}, children: /* @__PURE__ */ r("div", { className: `${i}-lightbox-content-area${f ? ` ${i}-lightbox-content-area-stacked` : ""}`, children: /* @__PURE__ */ r(
|
|
496
|
+
"div",
|
|
497
|
+
{
|
|
498
|
+
className: `${i}-text-bar-cell${f ? ` ${i}-text-bar-cell-stacked` : ""}`,
|
|
499
|
+
style: f ? void 0 : { flex: 1, minWidth: 0, width: "100%" },
|
|
500
|
+
children: f ? _t() : Jt()
|
|
501
|
+
}
|
|
502
|
+
) }) })
|
|
503
|
+
] });
|
|
504
|
+
}
|
|
505
|
+
export {
|
|
506
|
+
Qt as H
|
|
507
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-DFlmxAoL.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react/jsx-runtime"),r=require("react"),J="ImageRevealSlider-module__imageRevealSlider___UE5Ob",K="ImageRevealSlider-module__image___Qjt-e",U="ImageRevealSlider-module__link___N-iLG",V="ImageRevealSlider-module__cursor___2U03d",v={imageRevealSlider:J,image:K,link:U,cursor:V};function T(c,l,g){for(const t of g){const a=new Image;a.src=t.assetId;const u=t.width?Number.parseFloat(t.width):a.naturalWidth,o=a.naturalHeight/a.naturalWidth*u,y=u/2,x=o/2;if(c>=t.x-y&&c<=t.x+y&&l>=t.y-x&&l<=t.y+x)return!0}return!1}function W(c){return new Promise(l=>{const g=new Image;g.src=c,g.onload=()=>{l({width:g.naturalWidth,height:g.naturalHeight})}})}async function Z(c,l,g,t){let a,u;if(l==="custom"){a=g;const o=await W(c);u=o.height/o.width*a}else if(l==="random"){a=Math.random()*(t.max-t.min)+t.min;const o=await W(c);u=o.height/o.width*a}else{const o=await W(c);a=o.width,u=o.height}return{width:a,height:u,finalWidth:`${a}px`}}function ee({settings:c,content:l,isEditor:g}){const[t,a]=r.useState(null),[u,o]=r.useState([]),[y,x]=r.useState(0),G=r.useRef(0),[E,Q]=r.useState({x:0,y:0}),[A,p]=r.useState(1),[b,_]=r.useState("none"),j=r.useRef({x:0,y:0}),[S,N]=r.useState(!1),{sizeType:$,imageWidth:z,randomRangeImageWidth:L}=c.imageSize,{revealPosition:C,visible:P}=c.position,{cursorType:H,target:R,defaultCursorScale:O,defaultCursor:X,hoverCursorScale:Y,hoverCursor:B}=c.cursor;r.useEffect(()=>{if(!t)return;const e=(n,h)=>{const i=t.getBoundingClientRect(),w=n-i.left,f=h-i.top;if(Q({x:w,y:f}),H==="system"){_("none"),p(1);return}const m=w,k=f,M=document.elementFromPoint(i.left+m,i.top+k);if(M&&M.closest("a")){_("none"),p(1);return}const F=T(m,k,u)||R==="area"?{img:B??"none",scale:Y}:{img:X??"none",scale:O};_(F.img),p(F.scale)},s=n=>{n.stopPropagation(),j.current={x:n.clientX,y:n.clientY},e(n.clientX,n.clientY)},d=()=>{S&&e(j.current.x,j.current.y)};return t.addEventListener("mousemove",s),window.addEventListener("scroll",d,!0),()=>{t.removeEventListener("mousemove",s),window.removeEventListener("scroll",d,!0)}},[t,S,E,H,R,B,X,Y,O,u]),r.useEffect(()=>{S||(_("none"),p(0))},[S]);const q=async(e,s,d,n={})=>{const{width:h,height:i,finalWidth:w}=await Z(e.image.assetId,$,z,L);let f=0,m=0;C==="same"?(f=s/2,m=d/2):(f=n.x??Math.random()*s,m=n.y??Math.random()*d);const k=Math.min(Math.max(f,h/2),s-h/2),M=Math.min(Math.max(m,i/2),d-i/2);return{id:G.current++,assetId:e.image.assetId,link:e.link,name:e.image.name,x:k,y:M,width:w}};r.useEffect(()=>{if(!t||l.length===0)return;const e=t.getBoundingClientRect(),s=e.width,d=e.height,n=[];(async()=>{const i=l[0],w=await q(i,s,d);n.push(w),o(n),x(1)})()},[$,z,L,C,t]),r.useEffect(()=>{P==="last One"&&o(e=>e.length>0?[e[e.length-1]]:[])},[P]);const D=async e=>{if(!t)return;const s=t.getBoundingClientRect(),d=e.clientX-s.left,n=e.clientY-s.top;if(R==="image"&&!T(d,n,u))return;let h=0,i=0;C==="on Click"?(h=d,i=n):C==="same"?(h=s.width/2,i=s.height/2):(h=Math.random()*s.width,i=Math.random()*s.height);const w=l[y],f=await q(w,s.width,s.height,{x:h,y:i});o(m=>P==="all"?[...m,f]:[f]),x(m=>m>=l.length-1?0:m+1)};return I.jsxs("div",{ref:a,onClick:D,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),className:v.imageRevealSlider,style:{cursor:b==="none"?"default":"none"},children:[u.map(e=>I.jsx("div",{className:v.wrapper,style:{top:`${e.y}px`,left:`${e.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:e.width??"auto",height:"auto",cursor:b==="none"?"default":"none"},children:R==="area"&&e.link?I.jsx("a",{href:e.link,target:"_blank",className:v.link,children:I.jsx("img",{src:e.assetId,alt:e.name,className:v.image},e.id)}):I.jsx("img",{src:e.assetId,alt:e.name,className:v.image},e.id)},e.id)),S&&I.jsx("div",{className:v.cursor,style:{left:`${E.x}px`,top:`${E.y}px`,transform:`translate(-50%, -50%) scale(${A})`,backgroundImage:`url('${b}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}exports.ImageRevealSlider=ee;
|