@cntrl-site/components 1.0.43-alpha.1 → 1.0.43-alpha.2

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.
@@ -20,6 +20,7 @@ export declare const SimpleButtonComponent: {
20
20
  version: 1;
21
21
  settings: {
22
22
  sizing: string;
23
+ linkInParamsPanel: true;
23
24
  properties: {
24
25
  type: {
25
26
  type: "string";
package/dist/index.js CHANGED
@@ -16394,6 +16394,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16394
16394
  white-space: pre-wrap;
16395
16395
  overflow-wrap: anywhere;
16396
16396
  word-break: break-word;
16397
+ user-select: none;
16397
16398
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
16398
16399
  box-shadow: ${i};
16399
16400
  }
@@ -16609,7 +16610,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16609
16610
  height: calc(1em * var(--${e}-icon-scale, 1));
16610
16611
  width: calc(1em * var(--${e}-icon-scale, 1));
16611
16612
  }
16612
- `}function Nr(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function Hs(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(cn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const d=y.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function Bf({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i}){const{prefix:o}=y.useScopedStyles(),l=a.useMemo(()=>Of(o),[o]),{type:s="a",label:d="Button",icon:c,alignment:u="center",alignA:m,order:v="text-icon",gap:w=0,iconScale:C=100,iconSize:h=0,dimensions:x=!1,padding:$={top:0,right:0,bottom:0,left:0},cornerRadius:T={top:0,right:0,bottom:0,left:0},boxShadow:I={top:0,left:0,right:0,bottom:0},boxShadowColor:k="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:M="rgba(0, 0, 0, 0)",stroke:B=0,backgroundColor:P="#000000",textColor:b="#ffffff",borderColor:X="#ffffff",iconColor:f="#ffffff",hoverEffect:R="none",fontFamily:A,fontSettings:j,fontSize:q,lineHeight:le,letterSpacing:Y=0,wordSpacing:z=0,textAppearance:H,stateOverrides:L,minWidth:E=0,minHeight:D=0}=e,K=y.buildColorVars(o,{backgroundColor:P,textColor:b,borderColor:X,iconColor:f,boxShadowColor:k,innerBoxShadowColor:M},Ff,_f,L),Q=i&&i!=="default"?`${o}-state-${i}`:"",O=t&&!n?`${o}-editing`:"",he=R!=="none"&&(!t||n||i==="hover")?`${o}-hover-effect-${R}`:"",g=R==="blinds"||R==="reveal"||R==="swipe",me=R==="content-roll",ae=R==="reveal"&&(!t||n),we=x===!0,ne=we?"center":s==="a"?m??u:u,ye=s==="c",U=s!=="b",be={fontSettings:{fontFamily:A,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:q??.01,lineHeight:le,letterSpacing:Y,wordSpacing:z,textAppearance:H,color:b},pe={...U?ln(Kt(be,t)):{},[`--${o}-box-shadow-x`]:y.scalingValue(I.left,t),[`--${o}-box-shadow-y`]:y.scalingValue(I.top,t),[`--${o}-box-shadow-blur`]:y.scalingValue(I.right,t),[`--${o}-box-shadow-spread`]:y.scalingValue(I.bottom,t),[`--${o}-inner-box-shadow-x`]:y.scalingValue(N.left,t),[`--${o}-inner-box-shadow-y`]:y.scalingValue(N.top,t),[`--${o}-inner-box-shadow-blur`]:y.scalingValue(N.right,t),[`--${o}-inner-box-shadow-spread`]:y.scalingValue(N.bottom,t),paddingTop:y.scalingValue($.top,t),paddingRight:y.scalingValue($.right,t),paddingBottom:y.scalingValue($.bottom,t),paddingLeft:y.scalingValue($.left,t),borderTopLeftRadius:y.scalingValue(T.top,t),borderTopRightRadius:y.scalingValue(T.right,t),borderBottomRightRadius:y.scalingValue(T.bottom,t),borderBottomLeftRadius:y.scalingValue(T.left,t),borderWidth:y.scalingValue(B,t),...ye?{}:{justifyContent:_r[ne],textAlign:ne},...ye&&!me?{gap:y.scalingValue(w,t)}:{},...we?{width:"auto",height:"auto"}:{minWidth:y.scalingValue(E,t),minHeight:y.scalingValue(D,t),...ye?{width:"100%"}:{}}};let oe;const Se={display:"inline-flex",alignItems:"center",justifyContent:ye?_r[ne]:_r[s==="a"?ne:"center"],gap:ye?y.scalingValue(w,t):void 0,width:"100%",height:"100%",...s==="a"?{textAlign:ne}:{}};if(s==="b"){const xe=()=>Hs(o,c,h>0?"fixed":"fill",100,h,t);oe=me?Nr(o,xe,`${o}-icon-roll`,void 0,Se):xe()}else if(s==="c"){const xe=()=>{const _=r.jsx("span",{className:`${o}-text`,style:{textAlign:ne},children:d}),ee=Hs(o,c,"inline",C);return v==="icon-text"?r.jsxs(r.Fragment,{children:[ee,_]}):r.jsxs(r.Fragment,{children:[_,ee]})};oe=me?Nr(o,xe,`${o}-icon-text-roll`,void 0,Se):xe()}else oe=me?Nr(o,()=>d,`${o}-label-roll`,void 0,Se):g?r.jsx("span",{className:`${o}-button-inner`,children:d}):d;const Ie=ae?xe=>Nf(xe,o):void 0,fe=ae?xe=>Hf(xe,o):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${o}-wrapper ${Q} ${O}`.trim(),style:K,children:r.jsx("button",{type:"button",className:`${o}-button ${he}`.trim(),style:pe,onMouseEnter:Ie,onMouseLeave:fe,children:oe})})]})}const jf=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16613
+ `}function Nr(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function Hs(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(cn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const d=y.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function Bf({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i}){const{prefix:o}=y.useScopedStyles(),l=a.useMemo(()=>Of(o),[o]),{type:s="a",label:d="Button",icon:c,alignment:u="center",alignA:m,order:v="text-icon",gap:w=0,iconScale:C=100,iconSize:h=0,dimensions:x=!1,padding:$={top:0,right:0,bottom:0,left:0},cornerRadius:T={top:0,right:0,bottom:0,left:0},boxShadow:I={top:0,left:0,right:0,bottom:0},boxShadowColor:k="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:M="rgba(0, 0, 0, 0)",stroke:B=0,backgroundColor:P="#000000",textColor:b="#ffffff",borderColor:X="#ffffff",iconColor:f="#ffffff",hoverEffect:R="none",fontFamily:A,fontSettings:j,fontSize:q,lineHeight:le,letterSpacing:Y=0,wordSpacing:z=0,textAppearance:H,stateOverrides:L,minWidth:E=0,minHeight:D=0}=e,K=y.buildColorVars(o,{backgroundColor:P,textColor:b,borderColor:X,iconColor:f,boxShadowColor:k,innerBoxShadowColor:M},Ff,_f,L),Q=i&&i!=="default"?`${o}-state-${i}`:"",O=t&&!n?`${o}-editing`:"",he=R!=="none"&&(!t||n||i==="hover")?`${o}-hover-effect-${R}`:"",g=R==="blinds"||R==="reveal"||R==="swipe",me=R==="content-roll",ae=R==="reveal"&&(!t||n),we=x===!0,ne=we?"center":s==="a"?m??u:u,ye=s==="c",U=s!=="b",be={fontSettings:{fontFamily:A,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:q??.01,lineHeight:le,letterSpacing:Y,wordSpacing:z,textAppearance:H,color:b},pe={...U?ln(Kt(be,t)):{},[`--${o}-box-shadow-x`]:y.scalingValue(I.left,t),[`--${o}-box-shadow-y`]:y.scalingValue(I.top,t),[`--${o}-box-shadow-blur`]:y.scalingValue(I.right,t),[`--${o}-box-shadow-spread`]:y.scalingValue(I.bottom,t),[`--${o}-inner-box-shadow-x`]:y.scalingValue(N.left,t),[`--${o}-inner-box-shadow-y`]:y.scalingValue(N.top,t),[`--${o}-inner-box-shadow-blur`]:y.scalingValue(N.right,t),[`--${o}-inner-box-shadow-spread`]:y.scalingValue(N.bottom,t),paddingTop:y.scalingValue($.top,t),paddingRight:y.scalingValue($.right,t),paddingBottom:y.scalingValue($.bottom,t),paddingLeft:y.scalingValue($.left,t),borderTopLeftRadius:y.scalingValue(T.top,t),borderTopRightRadius:y.scalingValue(T.right,t),borderBottomRightRadius:y.scalingValue(T.bottom,t),borderBottomLeftRadius:y.scalingValue(T.left,t),borderWidth:y.scalingValue(B,t),...ye?{}:{justifyContent:_r[ne],textAlign:ne},...ye&&!me?{gap:y.scalingValue(w,t)}:{},...we?{width:"auto",height:"auto"}:{minWidth:y.scalingValue(E,t),minHeight:y.scalingValue(D,t),...ye?{width:"100%"}:{}}};let oe;const Se={display:"inline-flex",alignItems:"center",justifyContent:ye?_r[ne]:_r[s==="a"?ne:"center"],gap:ye?y.scalingValue(w,t):void 0,width:"100%",height:"100%",...s==="a"?{textAlign:ne}:{}};if(s==="b"){const xe=()=>Hs(o,c,h>0?"fixed":"fill",100,h,t);oe=me?Nr(o,xe,`${o}-icon-roll`,void 0,Se):xe()}else if(s==="c"){const xe=()=>{const _=r.jsx("span",{className:`${o}-text`,style:{textAlign:ne},children:d}),ee=Hs(o,c,"inline",C);return v==="icon-text"?r.jsxs(r.Fragment,{children:[ee,_]}):r.jsxs(r.Fragment,{children:[_,ee]})};oe=me?Nr(o,xe,`${o}-icon-text-roll`,void 0,Se):xe()}else oe=me?Nr(o,()=>d,`${o}-label-roll`,void 0,Se):g?r.jsx("span",{className:`${o}-button-inner`,children:d}):d;const Ie=ae?xe=>Nf(xe,o):void 0,fe=ae?xe=>Hf(xe,o):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${o}-wrapper ${Q} ${O}`.trim(),style:K,children:r.jsx("div",{className:`${o}-button ${he}`.trim(),style:pe,onMouseEnter:Ie,onMouseLeave:fe,role:"button",children:oe})})]})}const jf=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16613
16614
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16614
16615
  import { CommonComponentProps } from '../props';
16615
16616
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -16753,6 +16754,7 @@ function getCSS(P: string): string {
16753
16754
  white-space: pre-wrap;
16754
16755
  overflow-wrap: anywhere;
16755
16756
  word-break: break-word;
16757
+ user-select: none;
16756
16758
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
16757
16759
  box-shadow: \${boxShadow};
16758
16760
  }
@@ -17201,27 +17203,27 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
17201
17203
  }
17202
17204
 
17203
17205
  const handleRevealMouseEnter = revealHoverActive
17204
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
17206
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
17205
17207
  : undefined;
17206
17208
  const handleRevealMouseLeave = revealHoverActive
17207
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
17209
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
17208
17210
  : undefined;
17209
17211
 
17210
17212
  return (
17211
17213
  <>
17212
17214
  <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
17213
17215
  <div className={\`\${P}-wrapper \${stateClass} \${editingClass}\`.trim()} style={colorVars}>
17214
- <button
17215
- type="button"
17216
+ <div
17216
17217
  className={\`\${P}-button \${hoverEffectClass}\`.trim()}
17217
17218
  style={buttonStyle}
17218
17219
  onMouseEnter={handleRevealMouseEnter}
17219
17220
  onMouseLeave={handleRevealMouseLeave}
17221
+ role="button"
17220
17222
  >
17221
17223
  {buttonContent}
17222
- </button>
17224
+ </div>
17223
17225
  </div>
17224
17226
  </>
17225
17227
  );
17226
17228
  }
17227
- `,zf={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Df=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Vf={type:"object",version:1,settings:{sizing:"auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconScale:{type:"number",scope:"layout",title:"Icon size (%)",display:{type:"percentage-input",visible:!1},min:10,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"object",scope:"layout",title:"Corner radius",display:{type:"padding-controls"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow color",display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner shadow color",display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Border",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Default background",display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Default text",display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border color",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Default icon",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","blinds","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...zf.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999}},defaults:{type:"a",label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",alignment:"center",alignA:"center",order:"text-icon",gap:0,iconScale:100,iconSize:40/1440,dimensions:!1,padding:{top:10/1440,right:10/1440,bottom:10/1440,left:10/1440},cornerRadius:{top:0,right:0,bottom:0,left:0},boxShadow:{top:0,left:0,right:0,bottom:0},boxShadowColor:"#000000",innerBoxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadowColor:"#000000",stroke:0,backgroundColor:"#000000",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",hoverEffect:"none",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},stateOverrides:{hover:{backgroundColor:"#333333"},active:{backgroundColor:"#555555"}},minWidth:100/1440,minHeight:100/1440},layoutDefaults:{m:{dimensions:!1,padding:{top:10/375,right:10/375,bottom:10/375,left:10/375},minWidth:100/375,minHeight:100/375,iconSize:32/375,fontSize:.0426,lineHeight:.0426},t:{dimensions:!1,padding:{top:10/768,right:10/768,bottom:10/768,left:10/768},minWidth:100/768,minHeight:100/768,iconSize:36/768,fontSize:.02083,lineHeight:.02604},d:{dimensions:!1,padding:{top:10/1440,right:10/1440,bottom:10/1440,left:10/1440},minWidth:100/1440,minHeight:100/1440,iconSize:40/1440,fontSize:.01,lineHeight:.01}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconScale","iconSize","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconScale.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.alignment.display.enabled",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.alignA.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconScale"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Df],panelIds:["general","typeStyle"],stateItems:{default:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],hover:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],active:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"]}},states:["default","hover","active"],statesByLayout:{m:["default","active"],t:["default","active"]}},Gf={element:Bf,id:"simple-button",name:"Simple Button",category:"dev",version:1,defaultSize:{d:{width:200,height:100},m:{width:160,height:80}},schema:Vf,sourceCode:jf,assetsPaths:{content:[],parameters:[{path:"settings.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}},qf=[ou,uu,$f,Qu,lp,vp,Fp,Bp,Kp,gm,lg,dh,xh,tf,mf,Wf,Gf];exports.components=qf;exports.isSchemaV1=Xl;
17229
+ `,zf={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Df=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Vf={type:"object",version:1,settings:{sizing:"auto",linkInParamsPanel:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconScale:{type:"number",scope:"layout",title:"Icon size (%)",display:{type:"percentage-input",visible:!1},min:10,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"object",scope:"layout",title:"Corner radius",display:{type:"padding-controls"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow color",display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner shadow color",display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Border",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Default background",display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Default text",display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border color",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Default icon",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","blinds","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...zf.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999}},defaults:{type:"a",label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",alignment:"center",alignA:"center",order:"text-icon",gap:0,iconScale:100,iconSize:40/1440,dimensions:!1,padding:{top:10/1440,right:10/1440,bottom:10/1440,left:10/1440},cornerRadius:{top:0,right:0,bottom:0,left:0},boxShadow:{top:0,left:0,right:0,bottom:0},boxShadowColor:"#000000",innerBoxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadowColor:"#000000",stroke:0,backgroundColor:"#000000",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",hoverEffect:"none",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},stateOverrides:{hover:{backgroundColor:"#333333"},active:{backgroundColor:"#555555"}},minWidth:100/1440,minHeight:100/1440},layoutDefaults:{m:{dimensions:!1,padding:{top:10/375,right:10/375,bottom:10/375,left:10/375},minWidth:100/375,minHeight:100/375,iconSize:32/375,fontSize:.0426,lineHeight:.0426},t:{dimensions:!1,padding:{top:10/768,right:10/768,bottom:10/768,left:10/768},minWidth:100/768,minHeight:100/768,iconSize:36/768,fontSize:.02083,lineHeight:.02604},d:{dimensions:!1,padding:{top:10/1440,right:10/1440,bottom:10/1440,left:10/1440},minWidth:100/1440,minHeight:100/1440,iconSize:40/1440,fontSize:.01,lineHeight:.01}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconScale","iconSize","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconScale.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.alignment.display.enabled",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.alignA.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconScale"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Df],panelIds:["general","typeStyle"],stateItems:{default:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],hover:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],active:["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"]}},states:["default","hover","active"],statesByLayout:{m:["default","active"],t:["default","active"]}},Gf={element:Bf,id:"simple-button",name:"Simple Button",category:"dev",version:1,defaultSize:{d:{width:200,height:100},m:{width:160,height:80}},schema:Vf,sourceCode:jf,assetsPaths:{content:[],parameters:[{path:"settings.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}},qf=[ou,uu,$f,Qu,lp,vp,Fp,Bp,Kp,gm,lg,dh,xh,tf,mf,Wf,Gf];exports.components=qf;exports.isSchemaV1=Xl;
package/dist/index.mjs CHANGED
@@ -37149,6 +37149,7 @@ function Jf(e) {
37149
37149
  white-space: pre-wrap;
37150
37150
  overflow-wrap: anywhere;
37151
37151
  word-break: break-word;
37152
+ user-select: none;
37152
37153
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
37153
37154
  box-shadow: ${i};
37154
37155
  }
@@ -37524,13 +37525,13 @@ function Zf({ settings: e, isEditor: t, isPreviewMode: n, activeEvent: i }) {
37524
37525
  return /* @__PURE__ */ j(Xe, { children: [
37525
37526
  /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: a } }),
37526
37527
  /* @__PURE__ */ l("div", { className: `${o}-wrapper ${Q} ${H}`.trim(), style: K, children: /* @__PURE__ */ l(
37527
- "button",
37528
+ "div",
37528
37529
  {
37529
- type: "button",
37530
37530
  className: `${o}-button ${ye}`.trim(),
37531
37531
  style: ge,
37532
37532
  onMouseEnter: Me,
37533
37533
  onMouseLeave: ve,
37534
+ role: "button",
37534
37535
  children: oe
37535
37536
  }
37536
37537
  ) })
@@ -37680,6 +37681,7 @@ function getCSS(P: string): string {
37680
37681
  white-space: pre-wrap;
37681
37682
  overflow-wrap: anywhere;
37682
37683
  word-break: break-word;
37684
+ user-select: none;
37683
37685
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
37684
37686
  box-shadow: \${boxShadow};
37685
37687
  }
@@ -38128,25 +38130,25 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
38128
38130
  }
38129
38131
 
38130
38132
  const handleRevealMouseEnter = revealHoverActive
38131
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
38133
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
38132
38134
  : undefined;
38133
38135
  const handleRevealMouseLeave = revealHoverActive
38134
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
38136
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
38135
38137
  : undefined;
38136
38138
 
38137
38139
  return (
38138
38140
  <>
38139
38141
  <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
38140
38142
  <div className={\`\${P}-wrapper \${stateClass} \${editingClass}\`.trim()} style={colorVars}>
38141
- <button
38142
- type="button"
38143
+ <div
38143
38144
  className={\`\${P}-button \${hoverEffectClass}\`.trim()}
38144
38145
  style={buttonStyle}
38145
38146
  onMouseEnter={handleRevealMouseEnter}
38146
38147
  onMouseLeave={handleRevealMouseLeave}
38148
+ role="button"
38147
38149
  >
38148
38150
  {buttonContent}
38149
- </button>
38151
+ </div>
38150
38152
  </div>
38151
38153
  </>
38152
38154
  );
@@ -38172,6 +38174,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
38172
38174
  version: 1,
38173
38175
  settings: {
38174
38176
  sizing: "auto",
38177
+ linkInParamsPanel: !0,
38175
38178
  properties: {
38176
38179
  type: {
38177
38180
  type: "string",
@@ -63,6 +63,7 @@ export type SchemaDisplayRule = {
63
63
  };
64
64
  export type SchemaSection = {
65
65
  sizing?: string;
66
+ linkInParamsPanel?: boolean;
66
67
  properties: Record<string, SchemaProperty>;
67
68
  layout?: LayoutItem[];
68
69
  defaults: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.43-alpha.1",
3
+ "version": "1.0.43-alpha.2",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",