@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,125 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),j=require("classnames"),o=require("react"),E=require("./RichTextRenderer-CIy6yI8U.js"),u=require("./scalingValue-CSHYgTZl.js"),X=require("./SvgImage-DFlmxAoL.js"),ue=require("./useScopedStyles-Bf6yohVQ.js"),de=require("./readTestimonialTextMeasure-CEPaB4Sy.js"),G=require("./textStylesToCss-CNN3zZTV.js");function he(e){return`
|
|
2
|
+
.${e}-container {
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow-x: clip;
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.${e}-wrapper {
|
|
12
|
+
position: relative;
|
|
13
|
+
width: 100%;
|
|
14
|
+
order: 1;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
inset: 0;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
height: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${e}-fade-stack {
|
|
24
|
+
position: relative;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${e}-fade-item-prev {
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.${e}-fade-item-current {
|
|
36
|
+
position: relative;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@keyframes ${e}-testimonial-fade-in {
|
|
41
|
+
from { opacity: 0; }
|
|
42
|
+
to { opacity: 1; }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes ${e}-testimonial-fade-out {
|
|
46
|
+
from { opacity: 1; }
|
|
47
|
+
to { opacity: 0; }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.${e}-fade-in {
|
|
51
|
+
animation: ${e}-testimonial-fade-in 300ms ease-in forwards;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.${e}-fade-out {
|
|
55
|
+
animation: ${e}-testimonial-fade-out 300ms ease-in forwards;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.${e}-controls {
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset: 0;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
display: flex;
|
|
63
|
+
width: 100%;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.${e}-arrow {
|
|
69
|
+
pointer-events: auto;
|
|
70
|
+
position: relative;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
border: none;
|
|
75
|
+
background-color: transparent;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
padding: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.${e}-next-arrow {
|
|
81
|
+
left: unset;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.${e}-arrow-inner {
|
|
85
|
+
all: unset;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
pointer-events: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.${e}-arrow-img {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 50%;
|
|
95
|
+
left: 50%;
|
|
96
|
+
transform: translate(-50%, -50%);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.${e}-mirror {
|
|
100
|
+
transform: translate(-50%, -50%) scaleX(-1) !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.${e}-control {
|
|
104
|
+
position: relative;
|
|
105
|
+
z-index: 2;
|
|
106
|
+
pointer-events: auto;
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.${e}-control::before {
|
|
111
|
+
content: "";
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
left: 0;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
pointer-events: auto;
|
|
118
|
+
z-index: 10;
|
|
119
|
+
}
|
|
120
|
+
.${e}-icon {
|
|
121
|
+
pointer-events: auto;
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
`}const xe=3e3,me=({settings:e,content:A,isEditor:c,isPreviewMode:J,isEditMode:K})=>{const{prefix:r}=ue.useScopedStyles(),l=A||[],{speed:M,align:w,width:P,imageMarginTop:Q,textMarginTop:U,captionMarginTop:Y,imageWidth:Z,imageHeight:ee,controlsWidth:y,controlsColor:F,controlsHoverColor:g}=e,R=M>0&&(!c||!!J),[te,$]=o.useState(0),[V,b]=o.useState(null),[H,C]=o.useState(!1),h=o.useRef(null),S=o.useMemo(()=>{switch(w){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[w]),q=o.useMemo(()=>{switch(w){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[w]);o.useEffect(()=>{$(0),b(null),C(!1)},[l.length]);const z=l[te],L=V===null?null:l[V],D=t=>{var i,m,v,d,p;return{fontSettings:{fontFamily:(e==null?void 0:e[`${t}FontFamily`])??"Arial",fontWeight:((i=e==null?void 0:e[`${t}FontSettings`])==null?void 0:i.fontWeight)??400,fontStyle:((m=e==null?void 0:e[`${t}FontSettings`])==null?void 0:m.fontStyle)??"normal"},textAppearance:{textTransform:((v=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:v.textTransform)??"none",textDecoration:((d=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:d.textDecoration)??"none",fontVariant:((p=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:p.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${t}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${t}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${t}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${t}WordSpacing`])??0,color:(e==null?void 0:e[`${t}Color`])??"#000000"}},ne=D("text"),ae=D("caption"),T=l.length>1&&l.some(t=>{var a,i;return(((a=t.text)==null?void 0:a.length)??0)>0||(((i=t.caption)==null?void 0:i.length)??0)>0}),O=o.useRef(null),[re,oe]=o.useState(0),[ie,le]=o.useState(0),f=e.controls??{mode:"Off",icon:null},s=l.length>1,x=o.useCallback((t,a)=>!s||a===t?t:(h.current&&window.clearTimeout(h.current),b(t),C(!0),h.current=window.setTimeout(()=>{b(null),C(!1),h.current=null},300),a),[s]),ce=o.useCallback(()=>{s&&$(t=>x(t,(t-1+l.length)%l.length))},[s,x,l.length]),se=o.useCallback(()=>{s&&$(t=>x(t,(t+1)%l.length))},[s,x,l.length]);o.useEffect(()=>{if(!R||!s)return;const t=Math.max(300,xe/M),a=window.setInterval(()=>{$(i=>x(i,(i+1)%l.length))},t);return()=>{window.clearInterval(a)}},[R,s,x,l.length,M]),o.useEffect(()=>()=>{h.current&&window.clearTimeout(h.current)},[]);const N=(t,a)=>{var p,_,B,k;const i=a==null?void 0:a.textMinHeightPx,m=a==null?void 0:a.captionMinHeightPx,v=a==null?void 0:a.dataMeasureAttrs,d=K&&!(a!=null&&a.dataMeasureAttrs)&&!(a!=null&&a.hideControls);return n.jsxs(n.Fragment,{children:[t.text&&n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[n.jsx("div",{"data-controls":d?"textMarginTop":void 0,className:d?`${r}-control`:void 0,style:{height:u.scalingValue(U??0,c??!1)}}),n.jsx("div",{...v&&{"data-testimonial-measure":"text"},style:{...G.textStylesToCss(ne,c),...i&&i>0?{minHeight:i}:{},textAlign:q,pointerEvents:"auto"},children:n.jsx(E.RichTextRenderer,{content:t.text})})]}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[n.jsx("div",{"data-controls":d?"imageMarginTop":void 0,className:d?`${r}-control`:void 0,style:{height:u.scalingValue(Q??0,c??!1)}}),n.jsx("div",{style:{width:u.scalingValue(Z??0,c??!1),height:u.scalingValue(ee??0,c??!1)},children:((p=t.image)==null?void 0:p.assetId)&&n.jsx("img",{src:(_=t.image)==null?void 0:_.assetId,alt:((B=t.image)==null?void 0:B.name)??"",className:`${r}-icon`,style:{objectFit:((k=t.image)==null?void 0:k.objectFit)||"contain"}})})]}),t.caption&&n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[n.jsx("div",{"data-controls":d?"captionMarginTop":void 0,className:d?`${r}-control`:void 0,style:{height:u.scalingValue(Y??0,c??!1)}}),n.jsx("div",{...v?{"data-testimonial-measure":"caption"}:{},style:{...G.textStylesToCss(ae,c),...m&&m>0?{minHeight:m}:{},textAlign:q,pointerEvents:"auto"},children:n.jsx(E.RichTextRenderer,{content:t.caption})})]})]})},I=o.useCallback(t=>{oe(t.maxTextPx),le(t.maxCaptionPx)},[]);if(o.useLayoutEffect(()=>{if(!T){I({maxTextPx:0,maxCaptionPx:0});return}const t=O.current;if(!t)return;const a=()=>{de.readTestimonialTextMeasure(t,I)};a();const i=new ResizeObserver(a);return i.observe(t),()=>{i.disconnect()}},[T,I,A]),!z)return n.jsx(n.Fragment,{});const W=T?{textMinHeightPx:re,captionMinHeightPx:ie}:void 0;return n.jsx(n.Fragment,{children:n.jsxs("div",{className:`${r}-container`,children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:he(r)}}),n.jsxs("div",{className:`${r}-wrapper`,style:{width:u.scalingValue(P??0,c??!1),alignItems:S},children:[T&&n.jsx("div",{ref:O,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((t,a)=>n.jsx("div",{style:{width:"100%"},children:N(t,{dataMeasureAttrs:!0})},a))}),n.jsxs("div",{className:`${r}-fade-stack`,children:[L&&H&&n.jsx("div",{className:j(`${r}-fade-item-prev`,`${r}-fade-out`),children:N(L,{...W,hideControls:!0})}),n.jsx("div",{className:j(`${r}-fade-item-current`,H?`${r}-fade-in`:void 0),children:N(z,W)})]})]}),f.mode==="On"&&n.jsxs("div",{className:`${r}-controls`,children:[n.jsx("div",{className:`${r}-arrow`,style:{width:u.scalingValue(y??.02,c??!1),height:u.scalingValue(y??.02,c??!1),"--arrow-hover-color":g},children:n.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!s,"aria-label":"Previous testimonial",children:f.icon&&n.jsx(X.SvgImage,{url:f.icon,fill:F,hoverFill:g,className:j(`${r}-arrow-img`,`${r}-mirror`)})})}),n.jsx("div",{className:j(`${r}-arrow`,`${r}-next-arrow`),style:{width:u.scalingValue(y??.02,c??!1),height:u.scalingValue(y??.02,c??!1),"--arrow-hover-color":g},children:n.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:se,disabled:!s,"aria-label":"Next testimonial",children:f.icon&&n.jsx(X.SvgImage,{url:f.icon,fill:F,hoverFill:g,className:`${r}-arrow-img`})})})]})]})})};exports.TestimonialSingle=me;
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { jsx as o, Fragment as z, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import b from "classnames";
|
|
3
|
+
import { useState as w, useRef as U, useMemo as Y, useEffect as R, useCallback as N, useLayoutEffect as pe } from "react";
|
|
4
|
+
import { R as Z } from "./RichTextRenderer-B6WtTYlR.mjs";
|
|
5
|
+
import { s } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
|
+
import { S as E } from "./SvgImage-B5mR9y6q.mjs";
|
|
7
|
+
import { u as ve } from "./useScopedStyles-DhBG3557.mjs";
|
|
8
|
+
import { r as we } from "./readTestimonialTextMeasure-BIXpGFEt.mjs";
|
|
9
|
+
import { t as P } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
|
+
function $e(e) {
|
|
11
|
+
return `
|
|
12
|
+
.${e}-container {
|
|
13
|
+
position: relative;
|
|
14
|
+
overflow-x: clip;
|
|
15
|
+
display: flex;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.${e}-wrapper {
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
order: 1;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
inset: 0;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.${e}-fade-stack {
|
|
34
|
+
position: relative;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.${e}-fade-item-prev {
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: 0;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.${e}-fade-item-current {
|
|
46
|
+
position: relative;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes ${e}-testimonial-fade-in {
|
|
51
|
+
from { opacity: 0; }
|
|
52
|
+
to { opacity: 1; }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes ${e}-testimonial-fade-out {
|
|
56
|
+
from { opacity: 1; }
|
|
57
|
+
to { opacity: 0; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.${e}-fade-in {
|
|
61
|
+
animation: ${e}-testimonial-fade-in 300ms ease-in forwards;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.${e}-fade-out {
|
|
65
|
+
animation: ${e}-testimonial-fade-out 300ms ease-in forwards;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.${e}-controls {
|
|
69
|
+
position: absolute;
|
|
70
|
+
inset: 0;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
display: flex;
|
|
73
|
+
width: 100%;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.${e}-arrow {
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
position: relative;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
border: none;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
padding: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.${e}-next-arrow {
|
|
91
|
+
left: unset;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.${e}-arrow-inner {
|
|
95
|
+
all: unset;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
width: 100%;
|
|
98
|
+
height: 100%;
|
|
99
|
+
pointer-events: auto;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.${e}-arrow-img {
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: 50%;
|
|
105
|
+
left: 50%;
|
|
106
|
+
transform: translate(-50%, -50%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.${e}-mirror {
|
|
110
|
+
transform: translate(-50%, -50%) scaleX(-1) !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.${e}-control {
|
|
114
|
+
position: relative;
|
|
115
|
+
z-index: 2;
|
|
116
|
+
pointer-events: auto;
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.${e}-control::before {
|
|
121
|
+
content: "";
|
|
122
|
+
position: absolute;
|
|
123
|
+
top: 0;
|
|
124
|
+
left: 0;
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
pointer-events: auto;
|
|
128
|
+
z-index: 10;
|
|
129
|
+
}
|
|
130
|
+
.${e}-icon {
|
|
131
|
+
pointer-events: auto;
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 100%;
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
const ye = 3e3, Fe = ({ settings: e, content: L, isEditor: l, isPreviewMode: k, isEditMode: ee }) => {
|
|
138
|
+
const { prefix: a } = ve(), i = L || [], { speed: A, align: $, width: te, imageMarginTop: ne, textMarginTop: oe, captionMarginTop: ae, imageWidth: re, imageHeight: ie, controlsWidth: y, controlsColor: j, controlsHoverColor: g } = e, D = A > 0 && (!l || !!k), [le, M] = w(0), [W, C] = w(null), [_, I] = w(!1), h = U(null), T = Y(() => {
|
|
139
|
+
switch ($) {
|
|
140
|
+
case "center":
|
|
141
|
+
return "center";
|
|
142
|
+
case "end":
|
|
143
|
+
return "flex-end";
|
|
144
|
+
case "start":
|
|
145
|
+
default:
|
|
146
|
+
return "flex-start";
|
|
147
|
+
}
|
|
148
|
+
}, [$]), O = Y(() => {
|
|
149
|
+
switch ($) {
|
|
150
|
+
case "center":
|
|
151
|
+
return "center";
|
|
152
|
+
case "end":
|
|
153
|
+
return "right";
|
|
154
|
+
case "start":
|
|
155
|
+
default:
|
|
156
|
+
return "left";
|
|
157
|
+
}
|
|
158
|
+
}, [$]);
|
|
159
|
+
R(() => {
|
|
160
|
+
M(0), C(null), I(!1);
|
|
161
|
+
}, [i.length]);
|
|
162
|
+
const V = i[le], B = W === null ? null : i[W], X = (t) => {
|
|
163
|
+
var r, f, p, d, v;
|
|
164
|
+
return {
|
|
165
|
+
fontSettings: {
|
|
166
|
+
fontFamily: (e == null ? void 0 : e[`${t}FontFamily`]) ?? "Arial",
|
|
167
|
+
fontWeight: ((r = e == null ? void 0 : e[`${t}FontSettings`]) == null ? void 0 : r.fontWeight) ?? 400,
|
|
168
|
+
fontStyle: ((f = e == null ? void 0 : e[`${t}FontSettings`]) == null ? void 0 : f.fontStyle) ?? "normal"
|
|
169
|
+
},
|
|
170
|
+
textAppearance: {
|
|
171
|
+
textTransform: ((p = e == null ? void 0 : e[`${t}TextAppearance`]) == null ? void 0 : p.textTransform) ?? "none",
|
|
172
|
+
textDecoration: ((d = e == null ? void 0 : e[`${t}TextAppearance`]) == null ? void 0 : d.textDecoration) ?? "none",
|
|
173
|
+
fontVariant: ((v = e == null ? void 0 : e[`${t}TextAppearance`]) == null ? void 0 : v.fontVariant) ?? "normal"
|
|
174
|
+
},
|
|
175
|
+
fontSize: (e == null ? void 0 : e[`${t}FontSize`]) ?? 0.01,
|
|
176
|
+
lineHeight: (e == null ? void 0 : e[`${t}LineHeight`]) ?? 0.01,
|
|
177
|
+
letterSpacing: (e == null ? void 0 : e[`${t}LetterSpacing`]) ?? 0,
|
|
178
|
+
wordSpacing: (e == null ? void 0 : e[`${t}WordSpacing`]) ?? 0,
|
|
179
|
+
color: (e == null ? void 0 : e[`${t}Color`]) ?? "#000000"
|
|
180
|
+
};
|
|
181
|
+
}, ce = X("text"), se = X("caption"), S = i.length > 1 && i.some((t) => {
|
|
182
|
+
var n, r;
|
|
183
|
+
return (((n = t.text) == null ? void 0 : n.length) ?? 0) > 0 || (((r = t.caption) == null ? void 0 : r.length) ?? 0) > 0;
|
|
184
|
+
}), q = U(null), [de, me] = w(0), [he, ue] = w(0), x = e.controls ?? { mode: "Off", icon: null }, c = i.length > 1, u = N((t, n) => !c || n === t ? t : (h.current && window.clearTimeout(h.current), C(t), I(!0), h.current = window.setTimeout(() => {
|
|
185
|
+
C(null), I(!1), h.current = null;
|
|
186
|
+
}, 300), n), [c]), fe = N(() => {
|
|
187
|
+
c && M((t) => u(t, (t - 1 + i.length) % i.length));
|
|
188
|
+
}, [c, u, i.length]), xe = N(() => {
|
|
189
|
+
c && M((t) => u(t, (t + 1) % i.length));
|
|
190
|
+
}, [c, u, i.length]);
|
|
191
|
+
R(() => {
|
|
192
|
+
if (!D || !c) return;
|
|
193
|
+
const t = Math.max(300, ye / A), n = window.setInterval(() => {
|
|
194
|
+
M((r) => u(r, (r + 1) % i.length));
|
|
195
|
+
}, t);
|
|
196
|
+
return () => {
|
|
197
|
+
window.clearInterval(n);
|
|
198
|
+
};
|
|
199
|
+
}, [D, c, u, i.length, A]), R(() => () => {
|
|
200
|
+
h.current && window.clearTimeout(h.current);
|
|
201
|
+
}, []);
|
|
202
|
+
const F = (t, n) => {
|
|
203
|
+
var v, J, K, Q;
|
|
204
|
+
const r = n == null ? void 0 : n.textMinHeightPx, f = n == null ? void 0 : n.captionMinHeightPx, p = n == null ? void 0 : n.dataMeasureAttrs, d = ee && !(n != null && n.dataMeasureAttrs) && !(n != null && n.hideControls);
|
|
205
|
+
return /* @__PURE__ */ m(z, { children: [
|
|
206
|
+
t.text && /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", alignItems: T, width: "100%" }, children: [
|
|
207
|
+
/* @__PURE__ */ o(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
"data-controls": d ? "textMarginTop" : void 0,
|
|
211
|
+
className: d ? `${a}-control` : void 0,
|
|
212
|
+
style: { height: s(oe ?? 0, l ?? !1) }
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ o(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
...p && { "data-testimonial-measure": "text" },
|
|
219
|
+
style: {
|
|
220
|
+
...P(ce, l),
|
|
221
|
+
...r && r > 0 ? { minHeight: r } : {},
|
|
222
|
+
textAlign: O,
|
|
223
|
+
pointerEvents: "auto"
|
|
224
|
+
},
|
|
225
|
+
children: /* @__PURE__ */ o(Z, { content: t.text })
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", alignItems: T, width: "100%" }, children: [
|
|
230
|
+
/* @__PURE__ */ o(
|
|
231
|
+
"div",
|
|
232
|
+
{
|
|
233
|
+
"data-controls": d ? "imageMarginTop" : void 0,
|
|
234
|
+
className: d ? `${a}-control` : void 0,
|
|
235
|
+
style: { height: s(ne ?? 0, l ?? !1) }
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ o("div", { style: { width: s(re ?? 0, l ?? !1), height: s(ie ?? 0, l ?? !1) }, children: ((v = t.image) == null ? void 0 : v.assetId) && /* @__PURE__ */ o(
|
|
239
|
+
"img",
|
|
240
|
+
{
|
|
241
|
+
src: (J = t.image) == null ? void 0 : J.assetId,
|
|
242
|
+
alt: ((K = t.image) == null ? void 0 : K.name) ?? "",
|
|
243
|
+
className: `${a}-icon`,
|
|
244
|
+
style: { objectFit: ((Q = t.image) == null ? void 0 : Q.objectFit) || "contain" }
|
|
245
|
+
}
|
|
246
|
+
) })
|
|
247
|
+
] }),
|
|
248
|
+
t.caption && /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", alignItems: T, width: "100%" }, children: [
|
|
249
|
+
/* @__PURE__ */ o(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
"data-controls": d ? "captionMarginTop" : void 0,
|
|
253
|
+
className: d ? `${a}-control` : void 0,
|
|
254
|
+
style: { height: s(ae ?? 0, l ?? !1) }
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ o(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
...p ? { "data-testimonial-measure": "caption" } : {},
|
|
261
|
+
style: {
|
|
262
|
+
...P(se, l),
|
|
263
|
+
...f && f > 0 ? { minHeight: f } : {},
|
|
264
|
+
textAlign: O,
|
|
265
|
+
pointerEvents: "auto"
|
|
266
|
+
},
|
|
267
|
+
children: /* @__PURE__ */ o(Z, { content: t.caption })
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
] })
|
|
271
|
+
] });
|
|
272
|
+
}, H = N((t) => {
|
|
273
|
+
me(t.maxTextPx), ue(t.maxCaptionPx);
|
|
274
|
+
}, []);
|
|
275
|
+
if (pe(() => {
|
|
276
|
+
if (!S) {
|
|
277
|
+
H({ maxTextPx: 0, maxCaptionPx: 0 });
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const t = q.current;
|
|
281
|
+
if (!t) return;
|
|
282
|
+
const n = () => {
|
|
283
|
+
we(t, H);
|
|
284
|
+
};
|
|
285
|
+
n();
|
|
286
|
+
const r = new ResizeObserver(n);
|
|
287
|
+
return r.observe(t), () => {
|
|
288
|
+
r.disconnect();
|
|
289
|
+
};
|
|
290
|
+
}, [S, H, L]), !V) return /* @__PURE__ */ o(z, {});
|
|
291
|
+
const G = S ? { textMinHeightPx: de, captionMinHeightPx: he } : void 0;
|
|
292
|
+
return /* @__PURE__ */ o(z, { children: /* @__PURE__ */ m("div", { className: `${a}-container`, children: [
|
|
293
|
+
/* @__PURE__ */ o("style", { dangerouslySetInnerHTML: { __html: $e(a) } }),
|
|
294
|
+
/* @__PURE__ */ m(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
className: `${a}-wrapper`,
|
|
298
|
+
style: { width: s(te ?? 0, l ?? !1), alignItems: T },
|
|
299
|
+
children: [
|
|
300
|
+
S && /* @__PURE__ */ o(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
ref: q,
|
|
304
|
+
"aria-hidden": !0,
|
|
305
|
+
style: {
|
|
306
|
+
position: "absolute",
|
|
307
|
+
left: 0,
|
|
308
|
+
top: 0,
|
|
309
|
+
width: "100%",
|
|
310
|
+
height: "100%",
|
|
311
|
+
visibility: "hidden",
|
|
312
|
+
pointerEvents: "none",
|
|
313
|
+
zIndex: -1
|
|
314
|
+
},
|
|
315
|
+
children: i.map((t, n) => /* @__PURE__ */ o("div", { style: { width: "100%" }, children: F(t, { dataMeasureAttrs: !0 }) }, n))
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
/* @__PURE__ */ m("div", { className: `${a}-fade-stack`, children: [
|
|
319
|
+
B && _ && /* @__PURE__ */ o("div", { className: b(`${a}-fade-item-prev`, `${a}-fade-out`), children: F(B, { ...G, hideControls: !0 }) }),
|
|
320
|
+
/* @__PURE__ */ o("div", { className: b(`${a}-fade-item-current`, _ ? `${a}-fade-in` : void 0), children: F(V, G) })
|
|
321
|
+
] })
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
x.mode === "On" && /* @__PURE__ */ m("div", { className: `${a}-controls`, children: [
|
|
326
|
+
/* @__PURE__ */ o(
|
|
327
|
+
"div",
|
|
328
|
+
{
|
|
329
|
+
className: `${a}-arrow`,
|
|
330
|
+
style: {
|
|
331
|
+
width: s(y ?? 0.02, l ?? !1),
|
|
332
|
+
height: s(y ?? 0.02, l ?? !1),
|
|
333
|
+
"--arrow-hover-color": g
|
|
334
|
+
},
|
|
335
|
+
children: /* @__PURE__ */ o(
|
|
336
|
+
"button",
|
|
337
|
+
{
|
|
338
|
+
type: "button",
|
|
339
|
+
className: `${a}-arrow-inner`,
|
|
340
|
+
onClick: fe,
|
|
341
|
+
disabled: !c,
|
|
342
|
+
"aria-label": "Previous testimonial",
|
|
343
|
+
children: x.icon && /* @__PURE__ */ o(
|
|
344
|
+
E,
|
|
345
|
+
{
|
|
346
|
+
url: x.icon,
|
|
347
|
+
fill: j,
|
|
348
|
+
hoverFill: g,
|
|
349
|
+
className: b(`${a}-arrow-img`, `${a}-mirror`)
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
)
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ o(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
className: b(`${a}-arrow`, `${a}-next-arrow`),
|
|
360
|
+
style: {
|
|
361
|
+
width: s(y ?? 0.02, l ?? !1),
|
|
362
|
+
height: s(y ?? 0.02, l ?? !1),
|
|
363
|
+
"--arrow-hover-color": g
|
|
364
|
+
},
|
|
365
|
+
children: /* @__PURE__ */ o(
|
|
366
|
+
"button",
|
|
367
|
+
{
|
|
368
|
+
type: "button",
|
|
369
|
+
className: `${a}-arrow-inner`,
|
|
370
|
+
onClick: xe,
|
|
371
|
+
disabled: !c,
|
|
372
|
+
"aria-label": "Next testimonial",
|
|
373
|
+
children: x.icon && /* @__PURE__ */ o(
|
|
374
|
+
E,
|
|
375
|
+
{
|
|
376
|
+
url: x.icon,
|
|
377
|
+
fill: j,
|
|
378
|
+
hoverFill: g,
|
|
379
|
+
className: `${a}-arrow-img`
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] })
|
|
387
|
+
] }) });
|
|
388
|
+
};
|
|
389
|
+
export {
|
|
390
|
+
Fe as TestimonialSingle
|
|
391
|
+
};
|