@cntrl-site/components 1.0.118 → 1.0.120-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.
@@ -0,0 +1,41 @@
1
+ import { Grid } from './Grid';
2
+ import { ComponentSchemaV1 } from '../../types/SchemaV1';
3
+ export declare const CustomGridComponent: {
4
+ element: typeof Grid;
5
+ id: string;
6
+ name: string;
7
+ schema: ComponentSchemaV1;
8
+ category: string;
9
+ layoutMode: "structured";
10
+ preview: {
11
+ type: "image";
12
+ url: string;
13
+ };
14
+ version: number;
15
+ defaultSize: {
16
+ d: {
17
+ width: number;
18
+ height: number;
19
+ };
20
+ };
21
+ assetsPaths: {
22
+ content: {
23
+ path: string;
24
+ placeholderEnabled: boolean;
25
+ }[];
26
+ parameters: {
27
+ path: string;
28
+ }[];
29
+ };
30
+ fontSettingsPaths: {
31
+ content: never[];
32
+ parameters: {
33
+ path: string;
34
+ }[];
35
+ };
36
+ fontRelations: {
37
+ titleFontSettings: string;
38
+ subtitleFontSettings: string;
39
+ lightboxCounterFontSettings: string;
40
+ };
41
+ };
@@ -19,17 +19,40 @@ type GridLayoutConfig = {
19
19
  columnsCount: number;
20
20
  lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
21
21
  };
22
+ type CustomGridBlock = {
23
+ column: number;
24
+ span: number;
25
+ top: number;
26
+ height: number;
27
+ };
28
+ type CustomGridLayout = {
29
+ columnsCount: number;
30
+ columnWidth: number;
31
+ gutterWidth: number;
32
+ maxWidth: number | null;
33
+ verticalGap?: number;
34
+ beat?: number;
35
+ repeatHeight?: number;
36
+ blocks: CustomGridBlock[];
37
+ gridType?: 'masonry' | 'stacked' | 'rows' | 'freeform';
38
+ cellHeight?: 'manual' | 'auto';
39
+ masonry?: 'off' | 'on';
40
+ rows?: number;
41
+ mediaDisplay?: 'fit' | 'cover';
42
+ textGrowth?: 'inside' | 'outside';
43
+ };
22
44
  type GridSettings = {
23
45
  type: 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
24
- gridLayout: GridLayoutConfig;
46
+ gridLayout?: GridLayoutConfig;
47
+ customGrid?: CustomGridLayout;
25
48
  textBoxWidth: number;
26
- verticalGap: number;
27
- entriesCount: number;
49
+ verticalGap?: number;
50
+ entriesCount?: number;
28
51
  lightbox: 'on' | 'off';
29
- imageDisplay: {
52
+ imageDisplay: 'fit' | 'cover' | {
30
53
  display: 'fit' | 'cover';
31
- ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
32
- reversed: boolean;
54
+ ratioValue?: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
55
+ reversed?: boolean;
33
56
  };
34
57
  imageCorners?: number;
35
58
  lightboxImageDisplay?: 'fit' | 'cover' | {
@@ -41,8 +64,9 @@ type GridSettings = {
41
64
  transition: 'fade' | 'slide';
42
65
  showText: 'always' | 'on hover';
43
66
  hover?: 'none' | 'zoom-in' | 'greyscale' | 'scale-down';
44
- alignEntries: 'on' | 'off';
67
+ alignEntries?: 'on' | 'off';
45
68
  align?: 'top' | 'center' | 'bottom';
69
+ textGrowth?: 'inside' | 'outside';
46
70
  titleMarginTop: number;
47
71
  subtitleMarginTop: number;
48
72
  titleColor: string;
@@ -223,6 +223,7 @@ export declare const SimpleButtonComponent: {
223
223
  };
224
224
  display: {
225
225
  type: string;
226
+ gradient: boolean;
226
227
  };
227
228
  };
228
229
  textColor: {
@@ -249,6 +250,7 @@ export declare const SimpleButtonComponent: {
249
250
  };
250
251
  display: {
251
252
  type: string;
253
+ gradient: boolean;
252
254
  };
253
255
  };
254
256
  iconColor: {
@@ -1,7 +1,6 @@
1
1
  import { jsx as t, jsxs as v, Fragment as M } from "react/jsx-runtime";
2
2
  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
- /* empty css */
5
4
  import c from "classnames";
6
5
  import { R as Q } from "./RichTextRenderer-D52Xto59.mjs";
7
6
  import { s } from "./scalingValue-C9JH5L6O.mjs";
@@ -62,7 +61,7 @@ const G = "ControlSlider-module__wrapper___sHEkd", J = "ControlSlider-module__ho
62
61
  "bottom-center": o.bottomCenterAlignment,
63
62
  "bottom-right": o.bottomRightAlignment
64
63
  };
65
- function Go({ settings: g, content: p, styles: z, isEditor: l }) {
64
+ function Zo({ settings: g, content: p, styles: z, isEditor: l }) {
66
65
  const [m, B] = f(null), { widthSettings: A, fontSettings: S, letterSpacing: V, textAlign: W, wordSpacing: F, fontSizeLineHeight: y, textAppearance: I, color: D } = z.imageCaption ?? {}, [_, $] = f(void 0), [C, P] = f(null), [w, U] = f(0), [j, H] = f(0), { direction: n, transition: a, controls: e, pagination: i, imageCaption: h, triggers: u } = g, R = Y(a.type), { x: b, y: L } = g.controls.offset, k = (r) => {
67
66
  m && m.go(r);
68
67
  };
@@ -330,5 +329,5 @@ function T({ color: g, className: p }) {
330
329
  return /* @__PURE__ */ t("svg", { viewBox: "0 0 10 18", className: p, children: /* @__PURE__ */ t("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ t("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: g, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
331
330
  }
332
331
  export {
333
- Go as ControlSlider
332
+ Zo as ControlSlider
334
333
  };
@@ -0,0 +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"),d=require("classnames"),M=require("./RichTextRenderer-DEFXh5o6.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,D]=g.useState(null),[S,$]=g.useState(0),[q,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:D,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=>{$(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))},q),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;