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

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
@@ -16380,6 +16380,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16380
16380
  height: 100%;
16381
16381
  align-items: center;
16382
16382
  justify-content: center;
16383
+ pointer-events: none;
16383
16384
  }
16384
16385
  .${e}-button {
16385
16386
  display: inline-flex;
@@ -16394,6 +16395,8 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16394
16395
  white-space: pre-wrap;
16395
16396
  overflow-wrap: anywhere;
16396
16397
  word-break: break-word;
16398
+ user-select: none;
16399
+ pointer-events: auto;
16397
16400
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
16398
16401
  box-shadow: ${i};
16399
16402
  }
@@ -16609,7 +16612,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
16609
16612
  height: calc(1em * var(--${e}-icon-scale, 1));
16610
16613
  width: calc(1em * var(--${e}-icon-scale, 1));
16611
16614
  }
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';
16615
+ `}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
16616
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16614
16617
  import { CommonComponentProps } from '../props';
16615
16618
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -16739,6 +16742,7 @@ function getCSS(P: string): string {
16739
16742
  height: 100%;
16740
16743
  align-items: center;
16741
16744
  justify-content: center;
16745
+ pointer-events: none;
16742
16746
  }
16743
16747
  .\${P}-button {
16744
16748
  display: inline-flex;
@@ -16753,6 +16757,8 @@ function getCSS(P: string): string {
16753
16757
  white-space: pre-wrap;
16754
16758
  overflow-wrap: anywhere;
16755
16759
  word-break: break-word;
16760
+ user-select: none;
16761
+ pointer-events: auto;
16756
16762
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
16757
16763
  box-shadow: \${boxShadow};
16758
16764
  }
@@ -17201,27 +17207,27 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
17201
17207
  }
17202
17208
 
17203
17209
  const handleRevealMouseEnter = revealHoverActive
17204
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
17210
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
17205
17211
  : undefined;
17206
17212
  const handleRevealMouseLeave = revealHoverActive
17207
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
17213
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
17208
17214
  : undefined;
17209
17215
 
17210
17216
  return (
17211
17217
  <>
17212
17218
  <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
17213
17219
  <div className={\`\${P}-wrapper \${stateClass} \${editingClass}\`.trim()} style={colorVars}>
17214
- <button
17215
- type="button"
17220
+ <div
17216
17221
  className={\`\${P}-button \${hoverEffectClass}\`.trim()}
17217
17222
  style={buttonStyle}
17218
17223
  onMouseEnter={handleRevealMouseEnter}
17219
17224
  onMouseLeave={handleRevealMouseLeave}
17225
+ role="button"
17220
17226
  >
17221
17227
  {buttonContent}
17222
- </button>
17228
+ </div>
17223
17229
  </div>
17224
17230
  </>
17225
17231
  );
17226
17232
  }
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;
17233
+ `,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
@@ -37135,6 +37135,7 @@ function Jf(e) {
37135
37135
  height: 100%;
37136
37136
  align-items: center;
37137
37137
  justify-content: center;
37138
+ pointer-events: none;
37138
37139
  }
37139
37140
  .${e}-button {
37140
37141
  display: inline-flex;
@@ -37149,6 +37150,8 @@ function Jf(e) {
37149
37150
  white-space: pre-wrap;
37150
37151
  overflow-wrap: anywhere;
37151
37152
  word-break: break-word;
37153
+ user-select: none;
37154
+ pointer-events: auto;
37152
37155
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
37153
37156
  box-shadow: ${i};
37154
37157
  }
@@ -37524,13 +37527,13 @@ function Zf({ settings: e, isEditor: t, isPreviewMode: n, activeEvent: i }) {
37524
37527
  return /* @__PURE__ */ j(Xe, { children: [
37525
37528
  /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: a } }),
37526
37529
  /* @__PURE__ */ l("div", { className: `${o}-wrapper ${Q} ${H}`.trim(), style: K, children: /* @__PURE__ */ l(
37527
- "button",
37530
+ "div",
37528
37531
  {
37529
- type: "button",
37530
37532
  className: `${o}-button ${ye}`.trim(),
37531
37533
  style: ge,
37532
37534
  onMouseEnter: Me,
37533
37535
  onMouseLeave: ve,
37536
+ role: "button",
37534
37537
  children: oe
37535
37538
  }
37536
37539
  ) })
@@ -37666,6 +37669,7 @@ function getCSS(P: string): string {
37666
37669
  height: 100%;
37667
37670
  align-items: center;
37668
37671
  justify-content: center;
37672
+ pointer-events: none;
37669
37673
  }
37670
37674
  .\${P}-button {
37671
37675
  display: inline-flex;
@@ -37680,6 +37684,8 @@ function getCSS(P: string): string {
37680
37684
  white-space: pre-wrap;
37681
37685
  overflow-wrap: anywhere;
37682
37686
  word-break: break-word;
37687
+ user-select: none;
37688
+ pointer-events: auto;
37683
37689
  transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms, box-shadow 250ms;
37684
37690
  box-shadow: \${boxShadow};
37685
37691
  }
@@ -38128,25 +38134,25 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
38128
38134
  }
38129
38135
 
38130
38136
  const handleRevealMouseEnter = revealHoverActive
38131
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
38137
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealOpenDirectionFromMouseEnter(event, P)
38132
38138
  : undefined;
38133
38139
  const handleRevealMouseLeave = revealHoverActive
38134
- ? (event: MouseEvent<HTMLButtonElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
38140
+ ? (event: MouseEvent<HTMLDivElement>) => setRevealCloseDirectionFromMouseLeave(event, P)
38135
38141
  : undefined;
38136
38142
 
38137
38143
  return (
38138
38144
  <>
38139
38145
  <style dangerouslySetInnerHTML={{ __html: scopedCss }} />
38140
38146
  <div className={\`\${P}-wrapper \${stateClass} \${editingClass}\`.trim()} style={colorVars}>
38141
- <button
38142
- type="button"
38147
+ <div
38143
38148
  className={\`\${P}-button \${hoverEffectClass}\`.trim()}
38144
38149
  style={buttonStyle}
38145
38150
  onMouseEnter={handleRevealMouseEnter}
38146
38151
  onMouseLeave={handleRevealMouseLeave}
38152
+ role="button"
38147
38153
  >
38148
38154
  {buttonContent}
38149
- </button>
38155
+ </div>
38150
38156
  </div>
38151
38157
  </>
38152
38158
  );
@@ -38172,6 +38178,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent }:
38172
38178
  version: 1,
38173
38179
  settings: {
38174
38180
  sizing: "auto",
38181
+ linkInParamsPanel: !0,
38175
38182
  properties: {
38176
38183
  type: {
38177
38184
  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.3",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",