@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.
Files changed (88) hide show
  1. package/dist/ClickGallerie-CYQMgrIr.js +36 -0
  2. package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
  3. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
  4. package/dist/Components/Helix/Helix.d.ts +4 -1
  5. package/dist/Components/Hive/Hive.d.ts +4 -1
  6. package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
  7. package/dist/Components/List/List.d.ts +6 -2
  8. package/dist/Components/Marquee/Marquee.d.ts +6 -2
  9. package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
  10. package/dist/Components/Mercury/Mercury.d.ts +4 -1
  11. package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
  12. package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
  13. package/dist/Components/utils/LinkWrapper.d.ts +16 -0
  14. package/dist/Components/utils/embedMedia.d.ts +40 -0
  15. package/dist/Components/utils/index.d.ts +6 -0
  16. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  17. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  18. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  19. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  20. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  21. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  22. package/dist/Grid-CFHTP3mb.js +378 -0
  23. package/dist/Grid-e-gLfsji.mjs +1590 -0
  24. package/dist/Helix-BpLo9FD3.js +43 -0
  25. package/dist/Helix-CidI3ucE.mjs +324 -0
  26. package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
  27. package/dist/Hive-D1j6wZpV.js +321 -0
  28. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  29. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  30. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  31. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  32. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  33. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  34. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  35. package/dist/List-DVvpQ24J.js +377 -0
  36. package/dist/Marquee-DByooiWP.mjs +578 -0
  37. package/dist/Marquee-DfIP-tIN.js +133 -0
  38. package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
  39. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  40. package/dist/Mercury-B-s2Kvuq.js +267 -0
  41. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  42. package/dist/PretextComponent-Dnbenstn.js +1 -0
  43. package/dist/{PretextComponent-j-OsRZTx.mjs → PretextComponent-OygSO3fr.mjs} +312 -269
  44. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  45. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  46. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  47. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  48. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  49. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  50. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  51. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  52. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  53. package/dist/Waterfall-DII4-WV5.js +288 -0
  54. package/dist/{components-D2LyuDm-.mjs → components-BRmbflgg.mjs} +15 -15
  55. package/dist/components-nvbH4l0S.js +1 -0
  56. package/dist/content/postFieldBindings.d.ts +29 -0
  57. package/dist/elements.js +1 -1
  58. package/dist/elements.mjs +16 -16
  59. package/dist/elements.node.js +1 -1
  60. package/dist/elements.node.mjs +1 -1
  61. package/dist/index.d.ts +3 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +52 -15
  64. package/dist/sources.js +312 -212
  65. package/dist/sources.mjs +312 -212
  66. package/dist/types/SchemaV1.d.ts +53 -1
  67. package/dist/utils.js +1 -1
  68. package/dist/utils.mjs +30 -20
  69. package/package.json +1 -1
  70. package/dist/ClickGallerie-D7g093HX.js +0 -36
  71. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  72. package/dist/Grid-BBpdl60K.js +0 -374
  73. package/dist/Grid-DS53S_gA.mjs +0 -1576
  74. package/dist/Helix-BPn9V1sg.mjs +0 -315
  75. package/dist/Helix-DcgsCc4D.js +0 -43
  76. package/dist/Hive-n8Fz-j3o.js +0 -321
  77. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  78. package/dist/List-C32WImI3.js +0 -377
  79. package/dist/Marquee-DOIRRCu4.js +0 -133
  80. package/dist/Marquee-O_PDwlIb.mjs +0 -564
  81. package/dist/MarqueeText-DkaO2lQ5.js +0 -132
  82. package/dist/Mercury-C9D10TTT.mjs +0 -1702
  83. package/dist/Mercury-DynO-NxY.js +0 -267
  84. package/dist/PretextComponent-BnsS2zJ6.js +0 -1
  85. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  86. package/dist/Waterfall-DC2WQ3GT.js +0 -287
  87. package/dist/Waterfall-Yud2VR62.mjs +0 -1404
  88. package/dist/components-B9Vdjf0w.js +0 -1
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),u=require("react"),te=require("./useScopedStyles-Bf6yohVQ.js"),ne=require("./LinkWrapper-Ca84iPtg.js"),se={sizeType:"custom",value:700,min:400,max:700};function z(r,i){return{widthPx:r,heightPx:r*i}}function F(r,i,a,o,t,h){return{x:Math.min(Math.max(r,t/2),a-t/2),y:Math.min(Math.max(i,h/2),o-h/2)}}function A(r,i,a,o){const{heightPx:t}=z(a,o);return F(r/2,i/2,r,i,a,t)}function Z(r,i,a){for(const o of a){const{heightPx:t}=z(o.widthPx,o.aspectRatio),h=o.widthPx/2,f=t/2;if(r>=o.x-h&&r<=o.x+h&&i>=o.y-f&&i<=o.y+f)return!0}return!1}function re(r,i,a,o,t,h,f,p){if(t==="system")return"none";const P=o.getBoundingClientRect(),R=document.elementFromPoint(P.left+r,P.top+i);return R&&R.closest("a")?"none":Z(r,i,a)||h==="area"?f??"none":p??"none"}function H(r,i,a){var p;const{sizeType:o,value:t,min:h,max:f}=i;return o==="custom"?t:o==="as is"?((p=a.get(r))==null?void 0:p.naturalWidth)??t:Math.round(Math.random()*(f-h)+h)}function oe(r){return`
2
+ .${r}-root {
3
+ position: absolute;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ overflow: hidden;
9
+ }
10
+ .${r}-wrapper {
11
+ position: absolute;
12
+ transform: translate(-50%, -50%);
13
+ height: auto;
14
+ }
15
+ .${r}-image {
16
+ display: block;
17
+ width: 100%;
18
+ height: auto;
19
+ object-fit: cover;
20
+ position: relative;
21
+ user-select: none;
22
+ pointer-events: none;
23
+ }
24
+ .${r}-link {
25
+ width: 100%;
26
+ display: block;
27
+ }
28
+ .${r}-cursor {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ pointer-events: none;
33
+ width: 32px;
34
+ height: 32px;
35
+ }
36
+ `}function ie(r){return new Promise(i=>{const a=new Image;a.onload=()=>{i({aspectRatio:a.naturalHeight/a.naturalWidth,naturalWidth:a.naturalWidth})},a.onerror=()=>{i({aspectRatio:1,naturalWidth:700})},a.src=r})}async function ae(r){const i=[...new Set(r.filter(Boolean))],a=await Promise.all(i.map(async o=>[o,await ie(o)]));return new Map(a)}function ce({settings:r,content:i=[],isEditor:a}){const{prefix:o}=te.useScopedStyles(),[t,h]=u.useState(null),[f,p]=u.useState([]),[P,R]=u.useState(0),J=u.useRef(0),[X,K]=u.useState({x:0,y:0}),[Y,_]=u.useState("none"),M=u.useRef({x:0,y:0}),[w,G]=u.useState(!1),[W,N]=u.useState(!1),S=u.useRef(new Map),{imageSize:k=se,cursor:T="system",target:$="area",origin:Q,position:V,visible:q="all",defaultCursor:b=null,hoverCursor:L=null}=r,I=Q??V??"random",x=i.filter(e=>{var n;return!!((n=e==null?void 0:e.image)!=null&&n.assetId)}),D=u.useMemo(()=>oe(o),[o]),v=u.useCallback((e,n,s=f)=>{if(!t)return;const d=t.getBoundingClientRect(),c=e-d.left,l=n-d.top;K({x:c,y:l}),_(re(c,l,s,t,T,$,L,b))},[t,f,T,$,L,b]);u.useEffect(()=>{const e=[...x.map(s=>s.image.assetId),b,L].filter(s=>!!s);if(e.length===0){S.current=new Map,N(!0);return}let n=!1;return N(!1),ae(e).then(s=>{n||(S.current=s,N(!0))}),()=>{n=!0}},[i,b,L]),u.useEffect(()=>{if(!t)return;const e=s=>{s.stopPropagation(),M.current={x:s.clientX,y:s.clientY},v(s.clientX,s.clientY)},n=()=>{w&&v(M.current.x,M.current.y)};return t.addEventListener("mousemove",e),window.addEventListener("scroll",n,!0),()=>{t.removeEventListener("mousemove",e),window.removeEventListener("scroll",n,!0)}},[t,w,v]),u.useEffect(()=>{!t||!w||v(M.current.x,M.current.y)},[f,t,w,v]),u.useEffect(()=>{w||_("none")},[w]);const U=(e,n,s,d={})=>{var C,B;if(!((C=e==null?void 0:e.image)!=null&&C.assetId))return null;const c=((B=S.current.get(e.image.assetId))==null?void 0:B.aspectRatio)??1,l=H(e.image.assetId,k,S.current),{heightPx:E}=z(l,c);let m=0,g=0;return I==="same"?{x:m,y:g}=A(n,s,l,c):(m=d.x??Math.random()*n,g=d.y??Math.random()*s,{x:m,y:g}=F(m,g,n,s,l,E)),{id:J.current++,assetId:e.image.assetId,link:e.link,name:e.image.name,x:m,y:g,xRatio:m/n,yRatio:g/s,aspectRatio:c,widthPx:l}},j=()=>{if(!t)return;const e=t.getBoundingClientRect(),n=e.width,s=e.height;n===0||s===0||p(d=>d.length===0?d:d.map(c=>{const l=k.sizeType==="random"?c.widthPx:H(c.assetId,k,S.current),{heightPx:E}=z(l,c.aspectRatio);if(I==="same"){const{x:C,y:B}=A(n,s,l,c.aspectRatio);return{...c,x:C,y:B,widthPx:l}}const{x:m,y:g}=F(c.xRatio*n,c.yRatio*s,n,s,l,E);return{...c,x:m,y:g,widthPx:l}}))};u.useEffect(()=>{if(!t||x.length===0||!W)return;const e=t.getBoundingClientRect(),n=e.width,s=e.height,d=U(x[0],n,s);d&&(p([d]),R(x.length>1?1:0))},[k,I,t,i,W]),u.useEffect(()=>{if(!t)return;j();const e=new ResizeObserver(j);return e.observe(t),window.addEventListener("resize",j),()=>{e.disconnect(),window.removeEventListener("resize",j)}},[t,I,k,f.length]),u.useEffect(()=>{q==="last One"&&p(e=>e.length>0?[e[e.length-1]]:[])},[q]);const ee=e=>{if(!t||x.length===0||!W)return;const n=t.getBoundingClientRect(),s=e.clientX-n.left,d=e.clientY-n.top;if($==="image"&&!Z(s,d,f))return;let c=0,l=0;I==="on Click"?(c=s,l=d):I==="same"?(c=n.width/2,l=n.height/2):(c=Math.random()*n.width,l=Math.random()*n.height);const E=x[P%x.length],m=U(E,n.width,n.height,{x:c,y:l});if(!m)return;const g=q==="all"?[...f,m]:[m];p(g),R(C=>(C+1)%x.length),v(e.clientX,e.clientY,g)},O=T==="custom"&&Y!=="none";return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:D}}),y.jsxs("div",{ref:h,onClick:ee,onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),className:`${o}-root`,style:{cursor:O?"none":"default"},children:[f.map(e=>y.jsx("div",{className:`${o}-wrapper`,style:{top:`${e.y}px`,left:`${e.x}px`,width:`${e.widthPx}px`,cursor:O?"none":"default"},children:y.jsx(ne.LinkWrapper,{link:$==="area"?e.link:void 0,className:`${o}-link`,children:y.jsx("img",{src:e.assetId,alt:e.name,className:`${o}-image`})})},e.id)),w&&O&&y.jsx("div",{className:`${o}-cursor`,style:{left:`${X.x}px`,top:`${X.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${Y}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}exports.ClickGallerie=ce;
@@ -0,0 +1,272 @@
1
+ import { jsxs as Z, Fragment as oe, jsx as b } from "react/jsx-runtime";
2
+ import { useState as y, useRef as _, useMemo as se, useCallback as ie, useEffect as w } from "react";
3
+ import { u as ae } from "./useScopedStyles-DhBG3557.mjs";
4
+ import { L as ce } from "./LinkWrapper-DZs9hlOn.mjs";
5
+ const le = {
6
+ sizeType: "custom",
7
+ value: 700,
8
+ min: 400,
9
+ max: 700
10
+ };
11
+ function W(o, i) {
12
+ return {
13
+ widthPx: o,
14
+ heightPx: o * i
15
+ };
16
+ }
17
+ function j(o, i, a, s, t, m) {
18
+ return {
19
+ x: Math.min(Math.max(o, t / 2), a - t / 2),
20
+ y: Math.min(Math.max(i, m / 2), s - m / 2)
21
+ };
22
+ }
23
+ function J(o, i, a, s) {
24
+ const { heightPx: t } = W(a, s);
25
+ return j(
26
+ o / 2,
27
+ i / 2,
28
+ o,
29
+ i,
30
+ a,
31
+ t
32
+ );
33
+ }
34
+ function Q(o, i, a) {
35
+ for (const s of a) {
36
+ const { heightPx: t } = W(s.widthPx, s.aspectRatio), m = s.widthPx / 2, d = t / 2;
37
+ if (o >= s.x - m && o <= s.x + m && i >= s.y - d && i <= s.y + d)
38
+ return !0;
39
+ }
40
+ return !1;
41
+ }
42
+ function ue(o, i, a, s, t, m, d, g) {
43
+ if (t === "system")
44
+ return "none";
45
+ const S = s.getBoundingClientRect(), M = document.elementFromPoint(S.left + o, S.top + i);
46
+ return M && M.closest("a") ? "none" : Q(o, i, a) || m === "area" ? d ?? "none" : g ?? "none";
47
+ }
48
+ function K(o, i, a) {
49
+ var g;
50
+ const { sizeType: s, value: t, min: m, max: d } = i;
51
+ return s === "custom" ? t : s === "as is" ? ((g = a.get(o)) == null ? void 0 : g.naturalWidth) ?? t : Math.round(Math.random() * (d - m) + m);
52
+ }
53
+ function de(o) {
54
+ return `
55
+ .${o}-root {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 100%;
60
+ height: 100%;
61
+ overflow: hidden;
62
+ }
63
+ .${o}-wrapper {
64
+ position: absolute;
65
+ transform: translate(-50%, -50%);
66
+ height: auto;
67
+ }
68
+ .${o}-image {
69
+ display: block;
70
+ width: 100%;
71
+ height: auto;
72
+ object-fit: cover;
73
+ position: relative;
74
+ user-select: none;
75
+ pointer-events: none;
76
+ }
77
+ .${o}-link {
78
+ width: 100%;
79
+ display: block;
80
+ }
81
+ .${o}-cursor {
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ pointer-events: none;
86
+ width: 32px;
87
+ height: 32px;
88
+ }
89
+ `;
90
+ }
91
+ function me(o) {
92
+ return new Promise((i) => {
93
+ const a = new Image();
94
+ a.onload = () => {
95
+ i({
96
+ aspectRatio: a.naturalHeight / a.naturalWidth,
97
+ naturalWidth: a.naturalWidth
98
+ });
99
+ }, a.onerror = () => {
100
+ i({ aspectRatio: 1, naturalWidth: 700 });
101
+ }, a.src = o;
102
+ });
103
+ }
104
+ async function fe(o) {
105
+ const i = [...new Set(o.filter(Boolean))], a = await Promise.all(
106
+ i.map(async (s) => [s, await me(s)])
107
+ );
108
+ return new Map(a);
109
+ }
110
+ function ye({ settings: o, content: i = [], isEditor: a }) {
111
+ const { prefix: s } = ae(), [t, m] = y(null), [d, g] = y([]), [S, M] = y(0), V = _(0), [U, D] = y({ x: 0, y: 0 }), [A, G] = y("none"), R = _({ x: 0, y: 0 }), [x, q] = y(!1), [T, F] = y(!1), k = _(/* @__PURE__ */ new Map()), {
112
+ imageSize: P = le,
113
+ cursor: O = "system",
114
+ target: E = "area",
115
+ origin: ee,
116
+ position: te,
117
+ visible: X = "all",
118
+ defaultCursor: L = null,
119
+ hoverCursor: B = null
120
+ } = o, I = ee ?? te ?? "random", p = i.filter(
121
+ (e) => {
122
+ var n;
123
+ return !!((n = e == null ? void 0 : e.image) != null && n.assetId);
124
+ }
125
+ ), ne = se(() => de(s), [s]), v = ie((e, n, r = d) => {
126
+ if (!t) return;
127
+ const u = t.getBoundingClientRect(), c = e - u.left, l = n - u.top;
128
+ D({ x: c, y: l }), G(
129
+ ue(c, l, r, t, O, E, B, L)
130
+ );
131
+ }, [t, d, O, E, B, L]);
132
+ w(() => {
133
+ const e = [
134
+ ...p.map((r) => r.image.assetId),
135
+ L,
136
+ B
137
+ ].filter((r) => !!r);
138
+ if (e.length === 0) {
139
+ k.current = /* @__PURE__ */ new Map(), F(!0);
140
+ return;
141
+ }
142
+ let n = !1;
143
+ return F(!1), fe(e).then((r) => {
144
+ n || (k.current = r, F(!0));
145
+ }), () => {
146
+ n = !0;
147
+ };
148
+ }, [i, L, B]), w(() => {
149
+ if (!t) return;
150
+ const e = (r) => {
151
+ r.stopPropagation(), R.current = { x: r.clientX, y: r.clientY }, v(r.clientX, r.clientY);
152
+ }, n = () => {
153
+ x && v(R.current.x, R.current.y);
154
+ };
155
+ return t.addEventListener("mousemove", e), window.addEventListener("scroll", n, !0), () => {
156
+ t.removeEventListener("mousemove", e), window.removeEventListener("scroll", n, !0);
157
+ };
158
+ }, [t, x, v]), w(() => {
159
+ !t || !x || v(R.current.x, R.current.y);
160
+ }, [d, t, x, v]), w(() => {
161
+ x || G("none");
162
+ }, [x]);
163
+ const H = (e, n, r, u = {}) => {
164
+ var C, N;
165
+ if (!((C = e == null ? void 0 : e.image) != null && C.assetId)) return null;
166
+ const c = ((N = k.current.get(e.image.assetId)) == null ? void 0 : N.aspectRatio) ?? 1, l = K(e.image.assetId, P, k.current), { heightPx: $ } = W(l, c);
167
+ let f = 0, h = 0;
168
+ return I === "same" ? { x: f, y: h } = J(n, r, l, c) : (f = u.x ?? Math.random() * n, h = u.y ?? Math.random() * r, { x: f, y: h } = j(f, h, n, r, l, $)), {
169
+ id: V.current++,
170
+ assetId: e.image.assetId,
171
+ link: e.link,
172
+ name: e.image.name,
173
+ x: f,
174
+ y: h,
175
+ xRatio: f / n,
176
+ yRatio: h / r,
177
+ aspectRatio: c,
178
+ widthPx: l
179
+ };
180
+ }, z = () => {
181
+ if (!t) return;
182
+ const e = t.getBoundingClientRect(), n = e.width, r = e.height;
183
+ n === 0 || r === 0 || g((u) => u.length === 0 ? u : u.map((c) => {
184
+ const l = P.sizeType === "random" ? c.widthPx : K(c.assetId, P, k.current), { heightPx: $ } = W(l, c.aspectRatio);
185
+ if (I === "same") {
186
+ const { x: C, y: N } = J(n, r, l, c.aspectRatio);
187
+ return { ...c, x: C, y: N, widthPx: l };
188
+ }
189
+ const { x: f, y: h } = j(
190
+ c.xRatio * n,
191
+ c.yRatio * r,
192
+ n,
193
+ r,
194
+ l,
195
+ $
196
+ );
197
+ return { ...c, x: f, y: h, widthPx: l };
198
+ }));
199
+ };
200
+ w(() => {
201
+ if (!t || p.length === 0 || !T) return;
202
+ const e = t.getBoundingClientRect(), n = e.width, r = e.height, u = H(p[0], n, r);
203
+ u && (g([u]), M(p.length > 1 ? 1 : 0));
204
+ }, [P, I, t, i, T]), w(() => {
205
+ if (!t) return;
206
+ z();
207
+ const e = new ResizeObserver(z);
208
+ return e.observe(t), window.addEventListener("resize", z), () => {
209
+ e.disconnect(), window.removeEventListener("resize", z);
210
+ };
211
+ }, [t, I, P, d.length]), w(() => {
212
+ X === "last One" && g((e) => e.length > 0 ? [e[e.length - 1]] : []);
213
+ }, [X]);
214
+ const re = (e) => {
215
+ if (!t || p.length === 0 || !T) return;
216
+ const n = t.getBoundingClientRect(), r = e.clientX - n.left, u = e.clientY - n.top;
217
+ if (E === "image" && !Q(r, u, d)) return;
218
+ let c = 0, l = 0;
219
+ I === "on Click" ? (c = r, l = u) : I === "same" ? (c = n.width / 2, l = n.height / 2) : (c = Math.random() * n.width, l = Math.random() * n.height);
220
+ const $ = p[S % p.length], f = H($, n.width, n.height, { x: c, y: l });
221
+ if (!f) return;
222
+ const h = X === "all" ? [...d, f] : [f];
223
+ g(h), M((C) => (C + 1) % p.length), v(e.clientX, e.clientY, h);
224
+ }, Y = O === "custom" && A !== "none";
225
+ return /* @__PURE__ */ Z(oe, { children: [
226
+ /* @__PURE__ */ b("style", { dangerouslySetInnerHTML: { __html: ne } }),
227
+ /* @__PURE__ */ Z(
228
+ "div",
229
+ {
230
+ ref: m,
231
+ onClick: re,
232
+ onMouseEnter: () => q(!0),
233
+ onMouseLeave: () => q(!1),
234
+ className: `${s}-root`,
235
+ style: { cursor: Y ? "none" : "default" },
236
+ children: [
237
+ d.map((e) => /* @__PURE__ */ b(
238
+ "div",
239
+ {
240
+ className: `${s}-wrapper`,
241
+ style: {
242
+ top: `${e.y}px`,
243
+ left: `${e.x}px`,
244
+ width: `${e.widthPx}px`,
245
+ cursor: Y ? "none" : "default"
246
+ },
247
+ children: /* @__PURE__ */ b(ce, { link: E === "area" ? e.link : void 0, className: `${s}-link`, children: /* @__PURE__ */ b("img", { src: e.assetId, alt: e.name, className: `${s}-image` }) })
248
+ },
249
+ e.id
250
+ )),
251
+ x && Y && /* @__PURE__ */ b(
252
+ "div",
253
+ {
254
+ className: `${s}-cursor`,
255
+ style: {
256
+ left: `${U.x}px`,
257
+ top: `${U.y}px`,
258
+ transform: "translate(-50%, -50%)",
259
+ backgroundImage: `url('${A}')`,
260
+ backgroundSize: "cover",
261
+ backgroundPosition: "center"
262
+ }
263
+ }
264
+ )
265
+ ]
266
+ }
267
+ )
268
+ ] });
269
+ }
270
+ export {
271
+ ye as ClickGallerie
272
+ };
@@ -1,10 +1,11 @@
1
1
  import { CommonComponentProps } from '../props';
2
+ import { ContentLink } from '../utils/index';
2
3
  type ClickGallerieItem = {
3
4
  image: {
4
5
  assetId: string;
5
6
  name: string;
6
7
  };
7
- link: string;
8
+ link?: ContentLink;
8
9
  };
9
10
  type ImageSizeSettings = {
10
11
  sizeType: 'custom' | 'as is' | 'random';
@@ -2,7 +2,10 @@ import { CommonComponentProps } from '../props';
2
2
  type HelixMedia = {
3
3
  assetId?: string;
4
4
  name?: string;
5
- type?: 'image' | 'video';
5
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
6
+ thumbnail?: string;
7
+ width?: number;
8
+ height?: number;
6
9
  };
7
10
  export type HelixContentItem = {
8
11
  image?: HelixMedia;
@@ -21,7 +21,10 @@ type HiveMedia = {
21
21
  assetId: string;
22
22
  name?: string;
23
23
  objectFit?: 'cover' | 'contain';
24
- type?: 'image' | 'video';
24
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
25
+ thumbnail?: string;
26
+ width?: number;
27
+ height?: number;
25
28
  };
26
29
  type HiveMediaPair = {
27
30
  media: HiveMedia[];
@@ -1,3 +1,4 @@
1
+ import { ContentLink } from '../utils/index';
1
2
  interface ImageRevealSliderProps {
2
3
  settings: ImageRevealSliderSettings;
3
4
  content: ImageRevealSliderItem[];
@@ -34,7 +35,7 @@ type ImageRevealSliderItem = {
34
35
  assetId: string;
35
36
  name: string;
36
37
  };
37
- link: string;
38
+ link?: ContentLink;
38
39
  };
39
40
  export declare function ImageRevealSlider({ settings, content, isEditor }: ImageRevealSliderProps): import("react/jsx-runtime").JSX.Element;
40
41
  export {};
@@ -1,4 +1,5 @@
1
1
  import { CommonComponentProps } from '../props';
2
+ import { ContentLink } from '../utils/index';
2
3
  import { TextStyles } from '../utils/textStylesToCss';
3
4
  import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
4
5
  type ListFontSettings = {
@@ -120,7 +121,10 @@ type ListMedia = {
120
121
  objectFit?: 'cover' | 'contain';
121
122
  assetId: string;
122
123
  name: string;
123
- type?: 'image' | 'video';
124
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
125
+ thumbnail?: string;
126
+ width?: number;
127
+ height?: number;
124
128
  };
125
129
  type ListContentItem = {
126
130
  AColumn?: string;
@@ -129,7 +133,7 @@ type ListContentItem = {
129
133
  DColumnWidth?: string;
130
134
  EColumnWidth?: string;
131
135
  image?: ListMedia;
132
- link?: string;
136
+ link?: ContentLink;
133
137
  };
134
138
  type ListProps = {
135
139
  layoutId?: string;
@@ -1,12 +1,16 @@
1
1
  import { CommonComponentProps } from '../props';
2
+ import { ContentLink } from '../utils/index';
2
3
  export declare const Marquee: ({ settings, content, isEditor, isPreviewMode, isEditMode }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;
3
4
  export type MarqueeItem = {
4
5
  image?: {
5
6
  assetId?: string;
6
7
  name?: string;
7
- type?: 'image' | 'video';
8
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
9
+ thumbnail?: string;
10
+ width?: number;
11
+ height?: number;
8
12
  };
9
- link?: string;
13
+ link?: ContentLink;
10
14
  };
11
15
  export type MarqueeSettings = {
12
16
  speed: number;
@@ -1,4 +1,5 @@
1
1
  import { CommonComponentProps } from '../props';
2
+ import { ContentLink } from '../utils/index';
2
3
  export declare const MarqueeText: ({ settings, content, isEditor, isPreviewMode }: MarqueeTextProps) => import("react/jsx-runtime").JSX.Element;
3
4
  export type MarqueeTextItem = {
4
5
  text: string;
@@ -6,7 +7,7 @@ export type MarqueeTextItem = {
6
7
  assetId?: string;
7
8
  name?: string;
8
9
  };
9
- link?: string;
10
+ link?: ContentLink;
10
11
  };
11
12
  export type MarqueeTextSettings = {
12
13
  speed: number;
@@ -3,8 +3,11 @@ import { TextStyles } from '../utils/textStylesToCss';
3
3
  type MercuryMedia = {
4
4
  assetId: string;
5
5
  name?: string;
6
- type?: 'image' | 'video';
6
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
7
7
  objectFit?: 'cover' | 'contain';
8
+ thumbnail?: string;
9
+ width?: number;
10
+ height?: number;
8
11
  };
9
12
  type MercuryMediaPair = {
10
13
  media: MercuryMedia[];
@@ -3,7 +3,10 @@ export type WaterfallMedia = {
3
3
  assetId: string;
4
4
  name?: string;
5
5
  objectFit?: 'cover' | 'contain';
6
- type?: 'image' | 'video';
6
+ type?: 'image' | 'video' | 'vimeo' | 'youtube';
7
+ thumbnail?: string;
8
+ width?: number;
9
+ height?: number;
7
10
  };
8
11
  export type WaterfallLightboxContentItem = {
9
12
  title?: string;
@@ -0,0 +1,27 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+ import { EmbedMediaLike } from './embedMedia';
3
+ export interface EmbedMediaFrameProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
+ media: EmbedMediaLike;
5
+ /** How the video fills the box, the way an image's object-fit would. */
6
+ fit: 'cover' | 'contain';
7
+ /** Framed only while near the viewport, so a track of copies holds one player per visible card. */
8
+ lazy?: boolean;
9
+ /**
10
+ * Played at once whatever starts it elsewhere: opening a lightbox, or pointing at what a preview shows for,
11
+ * is already the gesture, and the click is left to the box around it.
12
+ */
13
+ startsAtOnce?: boolean;
14
+ /**
15
+ * Played as a silent loop whatever the media says, the click left to the box: a cell that opens a lightbox
16
+ * shows the video there as it was set to play.
17
+ */
18
+ silentLoop?: boolean;
19
+ }
20
+ /**
21
+ * A Vimeo or YouTube video in the room of an image or a video: a box the caller sizes and places,
22
+ * showing the stored thumbnail until the player is framed over it, and playing as the media says.
23
+ * A video that waits for a hover or a click is framed only then, and paused and played again after.
24
+ * Its controls, or a click that plays it, take the click, which then opens nothing around it; any
25
+ * other video is clicked like a picture. A box with no height of its own takes the video's aspect.
26
+ */
27
+ export declare const EmbedMediaFrame: FC<EmbedMediaFrameProps>;
@@ -0,0 +1,16 @@
1
+ import { CSSProperties, FC, ReactNode } from 'react';
2
+ interface Props {
3
+ /**
4
+ * A content link or a rich text link node: both keep the url in `value` and `blank` or `self`
5
+ * in `target` (`_blank` is taken too).
6
+ */
7
+ link?: {
8
+ value: string;
9
+ target?: string;
10
+ };
11
+ className?: string;
12
+ style?: CSSProperties;
13
+ children?: ReactNode;
14
+ }
15
+ export declare const LinkWrapper: FC<Props>;
16
+ export {};
@@ -0,0 +1,40 @@
1
+ export type EmbedProvider = 'vimeo' | 'youtube';
2
+ export type EmbedPlayMode = 'auto' | 'on-hover' | 'on-click';
3
+ /**
4
+ * What a media value holds of a Vimeo or YouTube video: its player url, the picture and size the player has
5
+ * none of, and how it plays, as the editor's embed form set it.
6
+ */
7
+ export type EmbedMediaLike = {
8
+ assetId?: string;
9
+ type?: string;
10
+ name?: string;
11
+ thumbnail?: string;
12
+ width?: number;
13
+ height?: number;
14
+ play?: EmbedPlayMode;
15
+ controls?: boolean;
16
+ loop?: boolean;
17
+ muted?: boolean;
18
+ };
19
+ export type EmbedPlayback = {
20
+ play: EmbedPlayMode;
21
+ controls: boolean;
22
+ loop: boolean;
23
+ muted: boolean;
24
+ };
25
+ /** The provider whose player a media is framed from, none for a file or a value that only claims to be one. */
26
+ export declare function getEmbedProvider(media: EmbedMediaLike | null | undefined): EmbedProvider | null;
27
+ export declare function isEmbedMedia(media: EmbedMediaLike | null | undefined): boolean;
28
+ /** Width over height of the video, 16:9 when the media does not say. */
29
+ export declare function getEmbedAspect(media: EmbedMediaLike): number;
30
+ /**
31
+ * How the video plays: a media that does not say plays as an uploaded video does, on its own, muted and
32
+ * looping, with no controls. Only a click lets sound play, and YouTube's player, with no loop or sound to
33
+ * set, loops and is muted until clicked.
34
+ */
35
+ export declare function getEmbedPlayback(media: EmbedMediaLike): EmbedPlayback;
36
+ /** The player url set to play at once the way the media says; a player waiting for a hover or a click is framed only then. */
37
+ export declare function getEmbedPlayerSrc(media: EmbedMediaLike): string;
38
+ export type EmbedCommand = 'listen' | 'play' | 'pause';
39
+ /** Plays or pauses a framed player through the messages its provider's player listens to. */
40
+ export declare function postEmbedCommand(iframe: HTMLIFrameElement, provider: EmbedProvider, command: EmbedCommand): void;
@@ -10,3 +10,9 @@ export type { CommonComponentProps } from '../props';
10
10
  export { readTestimonialTextMeasure } from './readTestimonialTextMeasure';
11
11
  export { getAvailableStatePanels, getUnavailableStates, isPanelAvailable, } from './panelAvailability';
12
12
  export type { PanelAvailabilityContext } from './panelAvailability';
13
+ export { LinkWrapper } from './LinkWrapper';
14
+ export type { ContentLink } from '../../types/SchemaV1';
15
+ export { getEmbedAspect, getEmbedPlayback, getEmbedPlayerSrc, getEmbedProvider, isEmbedMedia, postEmbedCommand } from './embedMedia';
16
+ export type { EmbedCommand, EmbedMediaLike, EmbedPlayback, EmbedPlayMode, EmbedProvider } from './embedMedia';
17
+ export { EmbedMediaFrame } from './EmbedMediaFrame';
18
+ export type { EmbedMediaFrameProps } from './EmbedMediaFrame';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-CIy6yI8U.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-DFlmxAoL.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-K90Dd7pt.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-DFlmxAoL.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
@@ -3,7 +3,7 @@ import { useState as f, useRef as Y, useEffect as O } from "react";
3
3
  import { S as q, a as K } from "./react-splide.esm-DQqds4PL.mjs";
4
4
  /* empty css */
5
5
  import c from "classnames";
6
- import { R as Q } from "./RichTextRenderer-B6WtTYlR.mjs";
6
+ import { R as Q } from "./RichTextRenderer-BptwNpbJ.mjs";
7
7
  import { s } from "./scalingValue-C9JH5L6O.mjs";
8
8
  import { S as N } from "./SvgImage-B5mR9y6q.mjs";
9
9
  import { n as Z } from "./textStylesToCss-05Mn6I_2.mjs";
@@ -0,0 +1 @@
1
+ "use strict";const L=require("react/jsx-runtime"),i=require("react"),K={vimeo:/^player\.vimeo\.com$/i,youtube:/^(?:www\.)?youtube(?:-nocookie)?\.com$/i};function h(e){if(!(e!=null&&e.assetId)||e.type!=="vimeo"&&e.type!=="youtube")return null;try{const t=new URL(e.assetId);return!K[e.type].test(t.hostname)||e.type==="youtube"&&!t.pathname.startsWith("/embed/")?null:e.type}catch{return null}}function M(e){return h(e)!==null}function T(e){const{width:t,height:s}=e;return t&&s&&t>0&&s>0?t/s:16/9}function N(e){const t=e.play??"auto",s=e.controls??!1,r=t==="on-click";return h(e)==="youtube"?{play:t,controls:s,loop:!0,muted:!r}:{play:t,controls:s,loop:e.loop??!0,muted:!r||(e.muted??!0)}}function V(e){const t=h(e);if(!t||!e.assetId)return e.assetId??"";const{play:s,controls:r,loop:l,muted:a}=N(e),c=new URL(e.assetId),n=c.searchParams,u=E=>E?"1":"0";return t==="vimeo"?(s==="auto"&&!r&&l&&a&&n.set("background","1"),n.set("autoplay","1"),n.set("muted",u(a)),n.set("loop",u(l)),n.set("controls",u(r)),n.set("title","0"),n.set("byline","0"),n.set("portrait","0"),n.set("autopause","0")):(n.set("autoplay","1"),n.set("mute",u(a)),n.set("loop","1"),n.set("playlist",c.pathname.slice(7)),n.set("controls",u(r)),n.set("disablekb",u(!r)),n.set("enablejsapi","1"),n.set("iv_load_policy","3"),n.set("playsinline","1"),n.set("rel","0"),n.set("modestbranding","1")),c.toString()}function Q(e,t){return e==="vimeo"?t==="listen"?null:{method:t}:t==="listen"?{event:"listening",id:1,channel:"widget"}:{event:"command",func:t==="play"?"playVideo":"pauseVideo",args:[]}}function D(e,t,s){const r=Q(t,s),l=e.contentWindow;if(!(!r||!l))try{l.postMessage(JSON.stringify(r),new URL(e.src).origin)}catch{}}const X={play:"auto",controls:!1,loop:!0,muted:!0};function Z(e,t,s){const r=e.width/e.height,l=s==="cover"?t<=r:t>=r,a=l?e.width:e.height*t,c=l?e.width/t:e.height;return{width:a,height:c,left:(e.width-a)/2,top:(e.height-c)/2}}const ee=({media:e,fit:t,lazy:s=!0,startsAtOnce:r=!1,silentLoop:l=!1,style:a,onClick:c,onMouseEnter:n,onMouseLeave:u,...E})=>{const R=i.useRef(null),S=i.useRef(null),[b,H]=i.useState(null),[P,_]=i.useState(!s),[x,I]=i.useState(!1),g=i.useRef(!1),k=i.useRef(!1),d=l?{...e,...X}:e,A=T(d),B=h(d),y=N(d),m=r?"auto":y.play,C=!r&&(y.controls||y.play==="on-click");i.useEffect(()=>{const o=R.current;if(!o||typeof ResizeObserver>"u")return;const p=()=>{const{width:$,height:q}=o.getBoundingClientRect();H(v=>v&&v.width===$&&v.height===q?v:{width:$,height:q})};p();const w=new ResizeObserver(p);return w.observe(o),()=>w.disconnect()},[]),i.useEffect(()=>{const o=R.current;if(!s||!o||typeof IntersectionObserver>"u"){_(!0);return}const p=new IntersectionObserver(([w])=>_(w.isIntersecting),{rootMargin:"200px"});return p.observe(o),()=>p.disconnect()},[s]),i.useEffect(()=>{P||(I(!1),g.current=!1)},[P]);const f=b&&b.width>0&&b.height>0?Z(b,A,t):null,O=P&&f!==null&&(m==="auto"||x);i.useEffect(()=>{O||(k.current=!1)},[O]);const j=o=>{S.current&&B&&D(S.current,B,o)},U=()=>{g.current=!0,x?j("play"):I(!0)},W=()=>{g.current=!1,k.current?j("pause"):I(!1)},J=o=>{if(!C){c==null||c(o);return}o.preventDefault(),o.stopPropagation(),m==="on-click"&&(g.current?W():U())},{width:F,...Y}=a??{},z={position:"relative",overflow:"hidden",aspectRatio:`${A}`,width:F===void 0||F==="auto"?"100%":F,...Y,...C&&{cursor:"pointer"}},G={position:"absolute",inset:0,width:"100%",height:"100%",objectFit:t,pointerEvents:"none"};return L.jsxs("div",{ref:R,"data-embed-frame":"",style:z,...E,onClick:J,onMouseEnter:o=>{n==null||n(o),m==="on-hover"&&U()},onMouseLeave:o=>{u==null||u(o),m==="on-hover"&&W()},children:[d.thumbnail&&L.jsx("img",{src:d.thumbnail,alt:d.name??"",draggable:!1,style:G}),O&&f&&L.jsx("iframe",{ref:S,src:V(d),title:d.name||"Embedded video",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,style:{position:"absolute",left:f.left,top:f.top,width:f.width,height:f.height,border:0,pointerEvents:y.controls?"auto":"none"},onLoad:()=>{k.current=!0,j("listen")}})]})};exports.EmbedMediaFrame=ee;exports.getEmbedAspect=T;exports.getEmbedPlayback=N;exports.getEmbedPlayerSrc=V;exports.getEmbedProvider=h;exports.isEmbedMedia=M;exports.postEmbedCommand=D;