@cntrl-site/components 1.0.60-alpha.3 → 1.0.60-alpha.4
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.
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CommonComponentProps } from '
|
|
2
|
-
type
|
|
1
|
+
import { CommonComponentProps } from '../props';
|
|
2
|
+
type HelixMedia = {
|
|
3
3
|
url?: string;
|
|
4
4
|
name?: string;
|
|
5
5
|
type?: 'image' | 'video';
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
8
|
-
image?:
|
|
7
|
+
export type HelixContentItem = {
|
|
8
|
+
image?: HelixMedia;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type HelixSettings = {
|
|
11
11
|
width?: number;
|
|
12
12
|
/** @deprecated use `width` */
|
|
13
13
|
spread?: number;
|
|
@@ -30,12 +30,12 @@ export type SpiralListSettings = {
|
|
|
30
30
|
reversed?: boolean;
|
|
31
31
|
} | string;
|
|
32
32
|
};
|
|
33
|
-
type
|
|
34
|
-
settings?:
|
|
35
|
-
content?:
|
|
33
|
+
type HelixProps = {
|
|
34
|
+
settings?: HelixSettings;
|
|
35
|
+
content?: HelixContentItem[];
|
|
36
36
|
isEditor?: boolean;
|
|
37
37
|
isPreviewMode?: boolean;
|
|
38
38
|
isEditMode?: boolean;
|
|
39
39
|
} & CommonComponentProps;
|
|
40
|
-
export declare function
|
|
40
|
+
export declare function Helix({ settings, content, isEditor, isPreviewMode, }: HelixProps): import("react/jsx-runtime").JSX.Element;
|
|
41
41
|
export {};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentSchemaV1 } from '
|
|
3
|
-
export declare const
|
|
4
|
-
element: typeof
|
|
1
|
+
import { Helix } from './Helix';
|
|
2
|
+
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
+
export declare const HelixComponent: {
|
|
4
|
+
element: typeof Helix;
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
category: string;
|
|
8
8
|
layoutMode: "structured";
|
|
9
|
+
preview: {
|
|
10
|
+
type: "image";
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
9
13
|
version: number;
|
|
10
14
|
defaultSize: {
|
|
11
15
|
d: {
|
package/dist/index.js
CHANGED
|
@@ -21860,13 +21860,13 @@ export function Mercury({
|
|
|
21860
21860
|
object-position: center;
|
|
21861
21861
|
}
|
|
21862
21862
|
${t}
|
|
21863
|
-
`}function ko(e){return Number(e.toFixed(4))}function Pl(e,t,n,i){let s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?(s>0&&s<1&&(s=Math.round(s*Ia)),Math.min(i,Math.max(n,Math.round(s)))):t}function pa(e,t,n=0,i=9999){let s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?(s>i/Ia&&(s/=Ia),Math.min(i,Math.max(n,s))):t}function cb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function db(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function ub(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function Xc(e,t){return(1-e)/(1-e*Math.cos(t))}function pb(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*Xc(e,i)))}return t||1}function mb(e,t){return e?1:1+Kc*(.35+t)}function gb(e,t,n,i){const o=t*mb(n,i);return Math.max(0,(e-o)/2)}function Yc(e,t,n){const i=Xc(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Zc(e,t,n){return e/2+t*n}function hb(e,t,n){return e(t-n/2)}function fb(e,t){return e*t}function Jc(e){return Math.round(e*1e3)}function Qc(e,t,n){const i=Math.cos(e),o=Math.cos(sb*Math.PI/2);if(i>=o)return n;const s=(i+1)/(o+1);return ko(t+(n-t)*s)}function ed(e){return Qc(e,ib,ob)}function yb(e){return Qc(e,rb,ab)}function td(e,t){if(!t)return"none";const n=yb(e);return n<=0?"none":`blur(${n}px)`}function vb(e,t,n,i,o,s,l,d){const{offset:c,scale:u}=Yc(i,o,s*Math.PI*2),p=s*Math.PI*2,y=Zc(t,n,c),v=ko(u),L=`calc(${e(y)} - var(--
|
|
21863
|
+
`}function ko(e){return Number(e.toFixed(4))}function Pl(e,t,n,i){let s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?(s>0&&s<1&&(s=Math.round(s*Ia)),Math.min(i,Math.max(n,Math.round(s)))):t}function pa(e,t,n=0,i=9999){let s=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(s)?(s>i/Ia&&(s/=Ia),Math.min(i,Math.max(n,s))):t}function cb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function db(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function ub(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function Xc(e,t){return(1-e)/(1-e*Math.cos(t))}function pb(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*Xc(e,i)))}return t||1}function mb(e,t){return e?1:1+Kc*(.35+t)}function gb(e,t,n,i){const o=t*mb(n,i);return Math.max(0,(e-o)/2)}function Yc(e,t,n){const i=Xc(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function Zc(e,t,n){return e/2+t*n}function hb(e,t,n){return e(t-n/2)}function fb(e,t){return e*t}function Jc(e){return Math.round(e*1e3)}function Qc(e,t,n){const i=Math.cos(e),o=Math.cos(sb*Math.PI/2);if(i>=o)return n;const s=(i+1)/(o+1);return ko(t+(n-t)*s)}function ed(e){return Qc(e,ib,ob)}function yb(e){return Qc(e,rb,ab)}function td(e,t){if(!t)return"none";const n=yb(e);return n<=0?"none":`blur(${n}px)`}function vb(e,t,n,i,o,s,l,d){const{offset:c,scale:u}=Yc(i,o,s*Math.PI*2),p=s*Math.PI*2,y=Zc(t,n,c),v=ko(u),L=`calc(${e(y)} - var(--helix-base-w) * ${v} / 2)`,h=`calc(var(--helix-base-w) * ${v})`,g=l?`height: calc(var(--helix-base-h) * ${v});`:"";return`left: ${L}; width: ${h}; ${g} z-index: ${Jc(u)}; transform: translateY(-50%); opacity: ${ed(p)}; filter: ${td(p,d)};`}function bb(e,t,n,i,o,s,l,d){const c=[];for(let u=0;u<=El;u+=1){const p=u/El;c.push(` ${ko(p*100)}% { ${vb(t,n,i,o,s,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
21864
21864
|
${c.join(`
|
|
21865
21865
|
`)}
|
|
21866
|
-
}`}function nd(e,t){return(e%t+t)%t}function xb(e,t){return ls(e,t)/t}function ls(e,t){return nd(e,t)}function wb(e,t){return Math.floor(e/t)}function Sb(e,t,n,i){return wb(e,t)*n+ls(e,t)*i}function $b(e,t,n){const i=n==="left"?1-e:e;return`${ko(-i*t)}s`}function kl(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function id(e){const t=e%1;return t<0?t+1:t}function Cb(e,t,n){const i=t/qc,o=n==="left"?-e*i:e*i;return id(o)}function Tb({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=S.useScopedStyles(),s=a.useRef(null),l=pa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),X0),d=pa(e==null?void 0:e.imageWidth,Y0),c=pa(e==null?void 0:e.turnHeight,Z0),u=Pl(e==null?void 0:e.itemsPerTurn,J0,3,40),p=Pl(e==null?void 0:e.turns,Q0,1,30),y=Math.min(nb,Math.max(0,eb)),v=Math.min(1,Math.max(0,tb)),L=Math.max(0,(e==null?void 0:e.speed)??qc),h=(e==null?void 0:e.direction)==="left"?"left":"right",g=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",f=(e==null?void 0:e.cornerRadius)??0,M=(e==null?void 0:e.blur)!=="off",R=a.useMemo(()=>cb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),C=R.display==="cover",U=te=>S.scalingValue(te,n??!1),A=a.useMemo(()=>pb(y),[y]),B=a.useMemo(()=>gb(l,d,C,v),[l,d,C,v]),k=a.useMemo(()=>lb(o,bb(o,U,l,B,y,A,C,M)),[o,l,B,y,A,C,M,n]),T=a.useMemo(()=>(t??[]).filter(te=>{var P;return!!((P=te.image)!=null&&P.url)}),[t]),z=c/u,b=d*db(R),W=Math.min(q0,p*u),I=K0*u,J=W+I*2,X=Math.max(0,p-1)*c+(u-1)*z,G=L>0,V=g==="scroll"&&G,oe=g==="autoplay"&&G&&(n?!!i:!0),[$,E]=a.useState(0);a.useEffect(()=>{if(!V)return;const te=s.current;if(!te)return;const P=()=>{const x=te.getBoundingClientRect(),ne=window.innerHeight||document.documentElement.clientHeight,Y=ne+x.height;Y<=0||E(Math.min(1,Math.max(0,(ne-x.top)/Y)))};P(),window.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P);const ae=new ResizeObserver(P);return ae.observe(te),()=>{window.removeEventListener("scroll",P),window.removeEventListener("resize",P),ae.disconnect()}},[V]);const N=V?Cb($,L,h):0,ee=G&&g==="autoplay"?360/(L*U0):0;return T.length===0?r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),r.jsx("div",{className:`${o}-wrapper`,style:{width:U(l),marginInline:"auto"}})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),r.jsx("div",{ref:s,className:`${o}-wrapper`,style:{width:U(l),height:U(X),marginInline:"auto"},children:Array.from({length:J},(te,P)=>{const ae=P-I,ne=T[nd(ae,T.length)].image,Y=ls(ae,u),fe=xb(ae,u),Re=V?id(fe+N):fe,de=Sb(ae,u,c,z),le=v===0?0:(kl(Y+7.3)-.5)*v*z,q=C?1:1+(kl(Y+3.1)-.5)*2*Kc*(.35+v),Q=Re*Math.PI*2,{offset:pe,scale:ke}=Yc(y,A,Q),$e=d*q,Ee=fb($e,ke),ue=Zc(l,B,pe),he={"--
|
|
21867
|
-
import { CommonComponentProps } from '
|
|
21868
|
-
import { scalingValue } from '
|
|
21869
|
-
import { useScopedStyles } from '
|
|
21866
|
+
}`}function nd(e,t){return(e%t+t)%t}function xb(e,t){return ls(e,t)/t}function ls(e,t){return nd(e,t)}function wb(e,t){return Math.floor(e/t)}function Sb(e,t,n,i){return wb(e,t)*n+ls(e,t)*i}function $b(e,t,n){const i=n==="left"?1-e:e;return`${ko(-i*t)}s`}function kl(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function id(e){const t=e%1;return t<0?t+1:t}function Cb(e,t,n){const i=t/qc,o=n==="left"?-e*i:e*i;return id(o)}function Tb({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=S.useScopedStyles(),s=a.useRef(null),l=pa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),X0),d=pa(e==null?void 0:e.imageWidth,Y0),c=pa(e==null?void 0:e.turnHeight,Z0),u=Pl(e==null?void 0:e.itemsPerTurn,J0,3,40),p=Pl(e==null?void 0:e.turns,Q0,1,30),y=Math.min(nb,Math.max(0,eb)),v=Math.min(1,Math.max(0,tb)),L=Math.max(0,(e==null?void 0:e.speed)??qc),h=(e==null?void 0:e.direction)==="left"?"left":"right",g=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",f=(e==null?void 0:e.cornerRadius)??0,M=(e==null?void 0:e.blur)!=="off",R=a.useMemo(()=>cb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),C=R.display==="cover",U=te=>S.scalingValue(te,n??!1),A=a.useMemo(()=>pb(y),[y]),B=a.useMemo(()=>gb(l,d,C,v),[l,d,C,v]),k=a.useMemo(()=>lb(o,bb(o,U,l,B,y,A,C,M)),[o,l,B,y,A,C,M,n]),T=a.useMemo(()=>(t??[]).filter(te=>{var P;return!!((P=te.image)!=null&&P.url)}),[t]),z=c/u,b=d*db(R),W=Math.min(q0,p*u),I=K0*u,J=W+I*2,X=Math.max(0,p-1)*c+(u-1)*z,G=L>0,V=g==="scroll"&&G,oe=g==="autoplay"&&G&&(n?!!i:!0),[$,E]=a.useState(0);a.useEffect(()=>{if(!V)return;const te=s.current;if(!te)return;const P=()=>{const x=te.getBoundingClientRect(),ne=window.innerHeight||document.documentElement.clientHeight,Y=ne+x.height;Y<=0||E(Math.min(1,Math.max(0,(ne-x.top)/Y)))};P(),window.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P);const ae=new ResizeObserver(P);return ae.observe(te),()=>{window.removeEventListener("scroll",P),window.removeEventListener("resize",P),ae.disconnect()}},[V]);const N=V?Cb($,L,h):0,ee=G&&g==="autoplay"?360/(L*U0):0;return T.length===0?r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),r.jsx("div",{className:`${o}-wrapper`,style:{width:U(l),marginInline:"auto"}})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),r.jsx("div",{ref:s,className:`${o}-wrapper`,style:{width:U(l),height:U(X),marginInline:"auto"},children:Array.from({length:J},(te,P)=>{const ae=P-I,ne=T[nd(ae,T.length)].image,Y=ls(ae,u),fe=xb(ae,u),Re=V?id(fe+N):fe,de=Sb(ae,u,c,z),le=v===0?0:(kl(Y+7.3)-.5)*v*z,q=C?1:1+(kl(Y+3.1)-.5)*2*Kc*(.35+v),Q=Re*Math.PI*2,{offset:pe,scale:ke}=Yc(y,A,Q),$e=d*q,Ee=fb($e,ke),ue=Zc(l,B,pe),he={"--helix-base-w":U($e),...C?{"--helix-base-h":U(b)}:{}},xe={top:U(de+le),transform:"translateY(-50%)",...he,...oe?{animationDuration:`${ko(ee)}s`,animationDelay:$b(fe,ee,h),animationDirection:h==="left"?"reverse":"normal"}:{left:hb(U,ue,Ee),width:U(Ee),...C?{height:U(b*ke)}:{},zIndex:Jc(ke),opacity:ed(Q),filter:td(Q,M)}},D=f>0?{borderRadius:U(f)}:{},re=C?{...D,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:D,ge=ub(ne)?r.jsx("video",{className:`${o}-media`,style:re,src:ne.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:`${o}-media`,style:re,src:ne.url,alt:ne.name??"",loading:"lazy",decoding:"async"});return r.jsx("div",{className:oe?`${o}-item`:`${o}-item ${o}-item-static`,style:xe,children:C?r.jsx("div",{className:`${o}-cover`,style:D,children:ge}):ge},`${p}-${u}-${ae}`)})})]})}const Lb=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
21867
|
+
import { CommonComponentProps } from '../props';
|
|
21868
|
+
import { scalingValue } from '../utils/scalingValue';
|
|
21869
|
+
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
21870
21870
|
|
|
21871
21871
|
const ORBIT_STEPS = 48;
|
|
21872
21872
|
const DEG_PER_SEC_PER_SPEED_UNIT = 10;
|
|
@@ -21938,17 +21938,17 @@ function getCSS(P: string, keyframes: string): string {
|
|
|
21938
21938
|
\`;
|
|
21939
21939
|
}
|
|
21940
21940
|
|
|
21941
|
-
type
|
|
21941
|
+
type HelixMedia = {
|
|
21942
21942
|
url?: string;
|
|
21943
21943
|
name?: string;
|
|
21944
21944
|
type?: 'image' | 'video';
|
|
21945
21945
|
};
|
|
21946
21946
|
|
|
21947
|
-
export type
|
|
21948
|
-
image?:
|
|
21947
|
+
export type HelixContentItem = {
|
|
21948
|
+
image?: HelixMedia;
|
|
21949
21949
|
};
|
|
21950
21950
|
|
|
21951
|
-
export type
|
|
21951
|
+
export type HelixSettings = {
|
|
21952
21952
|
width?: number;
|
|
21953
21953
|
/** @deprecated use \`width\` */
|
|
21954
21954
|
spread?: number;
|
|
@@ -21972,9 +21972,9 @@ export type SpiralListSettings = {
|
|
|
21972
21972
|
} | string;
|
|
21973
21973
|
};
|
|
21974
21974
|
|
|
21975
|
-
type
|
|
21976
|
-
settings?:
|
|
21977
|
-
content?:
|
|
21975
|
+
type HelixProps = {
|
|
21976
|
+
settings?: HelixSettings;
|
|
21977
|
+
content?: HelixContentItem[];
|
|
21978
21978
|
isEditor?: boolean;
|
|
21979
21979
|
isPreviewMode?: boolean;
|
|
21980
21980
|
isEditMode?: boolean;
|
|
@@ -22022,7 +22022,7 @@ function resolveLayoutMetric(
|
|
|
22022
22022
|
return Math.min(max, Math.max(min, resolved));
|
|
22023
22023
|
}
|
|
22024
22024
|
|
|
22025
|
-
function normalizeImageDisplay(raw:
|
|
22025
|
+
function normalizeImageDisplay(raw: HelixSettings['imageDisplay']): ImageDisplay {
|
|
22026
22026
|
if (typeof raw === 'string') {
|
|
22027
22027
|
return {
|
|
22028
22028
|
display: raw.toLowerCase() === 'cover' ? 'cover' : 'fit',
|
|
@@ -22045,7 +22045,7 @@ function getAspectHeightFactor(imageDisplay: ImageDisplay): number {
|
|
|
22045
22045
|
return effectiveHeight / effectiveWidth;
|
|
22046
22046
|
}
|
|
22047
22047
|
|
|
22048
|
-
function isVideoMedia(media:
|
|
22048
|
+
function isVideoMedia(media: HelixMedia): boolean {
|
|
22049
22049
|
if (media.type === 'video') return true;
|
|
22050
22050
|
if (media.type === 'image') return false;
|
|
22051
22051
|
return /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.name ?? '') || /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.url ?? '');
|
|
@@ -22146,9 +22146,9 @@ function getOrbitKeyframeStyles(
|
|
|
22146
22146
|
const angle = progress * Math.PI * 2;
|
|
22147
22147
|
const centerX = getOrbitCenterX(width, orbitRadius, offset);
|
|
22148
22148
|
const layoutWidthFactor = round(scale);
|
|
22149
|
-
const left = \`calc(\${scaled(centerX)} - var(--
|
|
22150
|
-
const widthStyle = \`calc(var(--
|
|
22151
|
-
const heightStyle = isCover ? \`height: calc(var(--
|
|
22149
|
+
const left = \`calc(\${scaled(centerX)} - var(--helix-base-w) * \${layoutWidthFactor} / 2)\`;
|
|
22150
|
+
const widthStyle = \`calc(var(--helix-base-w) * \${layoutWidthFactor})\`;
|
|
22151
|
+
const heightStyle = isCover ? \`height: calc(var(--helix-base-h) * \${layoutWidthFactor});\` : '';
|
|
22152
22152
|
return \`left: \${left}; width: \${widthStyle}; \${heightStyle} z-index: \${getOrbitZIndex(scale)}; transform: translateY(-50%); opacity: \${getOrbitOpacity(angle)}; filter: \${getOrbitFilter(angle, blurEnabled)};\`;
|
|
22153
22153
|
}
|
|
22154
22154
|
|
|
@@ -22213,12 +22213,12 @@ function getScrollOrbitProgress(scrollProgress: number, speed: number, direction
|
|
|
22213
22213
|
return normalizePhase(signedProgress);
|
|
22214
22214
|
}
|
|
22215
22215
|
|
|
22216
|
-
export function
|
|
22216
|
+
export function Helix({
|
|
22217
22217
|
settings,
|
|
22218
22218
|
content,
|
|
22219
22219
|
isEditor,
|
|
22220
22220
|
isPreviewMode,
|
|
22221
|
-
}:
|
|
22221
|
+
}: HelixProps) {
|
|
22222
22222
|
const { prefix: P } = useScopedStyles();
|
|
22223
22223
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
22224
22224
|
|
|
@@ -22261,8 +22261,8 @@ export function SpiralList({
|
|
|
22261
22261
|
const visibleItems = Math.min(MAX_TOTAL_ITEMS, turns * itemsPerTurn);
|
|
22262
22262
|
const overflowItems = OVERFLOW_TURNS * itemsPerTurn;
|
|
22263
22263
|
const totalItems = visibleItems + overflowItems * 2;
|
|
22264
|
-
const
|
|
22265
|
-
const wrapperHeight =
|
|
22264
|
+
const helixSpan = Math.max(0, turns - 1) * turnHeight + (itemsPerTurn - 1) * verticalStep;
|
|
22265
|
+
const wrapperHeight = helixSpan;
|
|
22266
22266
|
|
|
22267
22267
|
const motionEnabled = speed > 0;
|
|
22268
22268
|
const useScrollMotion = playback === 'scroll' && motionEnabled;
|
|
@@ -22321,7 +22321,7 @@ export function SpiralList({
|
|
|
22321
22321
|
{Array.from({ length: totalItems }, (_, index) => {
|
|
22322
22322
|
const logicalIndex = index - overflowItems;
|
|
22323
22323
|
const item = mediaItems[mod(logicalIndex, mediaItems.length)];
|
|
22324
|
-
const media = item.image as
|
|
22324
|
+
const media = item.image as HelixMedia;
|
|
22325
22325
|
const slotIndex = getOrbitSlotIndex(logicalIndex, itemsPerTurn);
|
|
22326
22326
|
const phase = getOrbitPhase(logicalIndex, itemsPerTurn);
|
|
22327
22327
|
const orbitPhase = useScrollMotion ? normalizePhase(phase + scrollOrbitProgress) : phase;
|
|
@@ -22336,8 +22336,8 @@ export function SpiralList({
|
|
|
22336
22336
|
const layoutWidth = getOrbitLayoutWidth(itemWidth, scale);
|
|
22337
22337
|
const centerX = getOrbitCenterX(width, orbitRadius, offset);
|
|
22338
22338
|
const orbitCssVars = {
|
|
22339
|
-
'--
|
|
22340
|
-
...(isCover ? { '--
|
|
22339
|
+
'--helix-base-w': scaled(itemWidth),
|
|
22340
|
+
...(isCover ? { '--helix-base-h': scaled(imageHeight) } : {}),
|
|
22341
22341
|
} as CSSProperties;
|
|
22342
22342
|
|
|
22343
22343
|
const itemStyle: CSSProperties = {
|
|
@@ -22412,4 +22412,4 @@ export function SpiralList({
|
|
|
22412
22412
|
</>
|
|
22413
22413
|
);
|
|
22414
22414
|
}
|
|
22415
|
-
`,Rb=["https://cdn.cntrl.site/component-assets/
|
|
22415
|
+
`,Rb=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Ib={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Rb.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Mb={element:Tb,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:Ib,sourceCode:Lb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Eb=[hp,Sp,By,gm,$m,Am,Jm,rg,pg,Ng,Eh,kf,jf,$y,Fy,tv,Zv,pv,g0,G0,Mb];exports.components=Eb;exports.isSchemaV1=ad;
|