@gem-sdk/components 2.0.0-staging.951 → 2.0.0-staging.953
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/product/settings/product-title/configs/settings.js +1 -1
- package/dist/cjs/product/settings/product-title/configs/ui-v2.js +1 -1
- package/dist/cjs/product/settings/product-vendor/configs/settings.js +1 -1
- package/dist/cjs/product/settings/product-vendor/configs/ui-v2.js +1 -1
- package/dist/cjs/text/common/classes.js +1 -1
- package/dist/cjs/text/common/styles.js +1 -1
- package/dist/esm/product/settings/product-title/configs/settings.js +1 -1
- package/dist/esm/product/settings/product-title/configs/ui-v2.js +1 -1
- package/dist/esm/product/settings/product-vendor/configs/settings.js +1 -1
- package/dist/esm/product/settings/product-vendor/configs/ui-v2.js +1 -1
- package/dist/esm/text/common/classes.js +1 -1
- package/dist/esm/text/common/styles.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const ProductTitleSettings=[{id:"setting",controls:[{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h2"},{id:"linkProduct",label:"Link To Product",type:"toggle",default:!1,info:"Ability to click on product title to goto product detail page."}]},{id:"style",controls:[{id:"typo",type:"typography-v2",default:{type:"heading-2",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"gp-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"gp-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"gp-text-align-right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify",iconName:"gp-text-align-justify"}],devices:{desktop:{default:"left"}}},{id:"hasLineClamp",type:"toggle",label:"Has Line Clamp",devices:{desktop:{default:!1}}},{id:"lineClamp",type:"input:stepper",min:1,label:"Line Clamp",disableDecimal:!0,devices:{desktop:{default:2}},hide:!0},{id:"color",type:"color-picker-v2",default:{normal:"text-1"},state:{normal:!0,hover:!0},compoDefaultValue:{hover:"highlight"}},{id:"hasTextShadow",type:"toggle",label:"Enable Text Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"textShadow",type:"textShadow",label:"Text Shadow",hideOnState:{normal:!0,hover:!0},default:{normal:{type:"shadow-1"}},state:{normal:!0,hover:!0}}]}];exports.ProductTitleSettings=ProductTitleSettings;
|
|
1
|
+
"use strict";const ProductTitleSettings=[{id:"setting",controls:[{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h2"},{id:"linkProduct",label:"Link To Product",type:"toggle",default:!1,info:"Ability to click on product title to goto product detail page."}]},{id:"style",controls:[{id:"typo",type:"typography-v2",default:{type:"heading-2",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"gp-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"gp-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"gp-text-align-right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify",iconName:"gp-text-align-justify"}],devices:{desktop:{default:"left"}}},{id:"hasLineClamp",type:"toggle",label:"Has Line Clamp",devices:{desktop:{default:!1}}},{id:"lineClamp",type:"input:stepper",min:1,label:"Line Clamp",disableDecimal:!0,devices:{desktop:{default:2}},hide:!0},{id:"enableHoverEffect",type:"toggle",label:"Enable Hover Effect",default:!0},{id:"color",type:"color-picker-v2",default:{normal:"text-1"},state:{normal:!0,hover:!0},compoDefaultValue:{hover:"highlight"}},{id:"hasTextShadow",type:"toggle",label:"Enable Text Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"textShadow",type:"textShadow",label:"Text Shadow",hideOnState:{normal:!0,hover:!0},default:{normal:{type:"shadow-1"}},state:{normal:!0,hover:!0}}]}];exports.ProductTitleSettings=ProductTitleSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{label:{en:"Text style"},controls:[{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Hover
|
|
1
|
+
"use strict";const SettingUIV2=[{label:{en:"Text style"},controls:[{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",setting:{id:"enableHoverEffect"},label:{en:"Hover"},iconName:"polaris-check-hover",fixedValue:"Styled",popoverLabel:{en:"Color"},state:"hover",controls:[{label:{en:"Text color"},setting:{id:"color",state:"hover"}}]}]},{label:{en:"Display option"},controls:[{label:{en:"Max line"},setting:{id:"hasLineClamp"}},{label:{en:"Number of lines"},setting:{id:"lineClamp"},conditionDisplay:"hasLineClamp == true"}]},{controls:[{label:{en:"Product link"},setting:{id:"linkProduct"},options:{labelVariant:"primary",toggleStyle:"switch"}}]},{label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}];exports.SettingUIV2=SettingUIV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const ProductVendorSettings=[{id:"setting",controls:[{id:"label",label:"Custom label",type:"textarea",placeholder:"E.g: Brand"},{id:"url",label:"Open collection URL",type:"toggle",default:!1},{id:"openIn",type:"option:value",options:[{label:"Yes",value:"new-tab"},{label:"No",value:"current"}],default:"current"},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],default:"h2"}]},{id:"style",controls:[{id:"color",label:"Text Color",type:"color-picker-v2",default:{normal:"text-2"},compoDefaultValue:{normal:"highlight"},state:{normal:!0,hover:!0}},{id:"underlineLink",type:"toggle",label:"Underline link",default:{hover:!0,normal:!1},state:{hover:!0,normal:!1}},{id:"typo",type:"typography-v2",default:{type:"paragraph-1",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{},compoDefaultValue:{custom:{textShadow:{angle:145,distance:"2px",blur:"20px",color:"rgba(18, 18, 18, 0.2)",type:"custom",enable:!0}}}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}];exports.ProductVendorSettings=ProductVendorSettings;
|
|
1
|
+
"use strict";const ProductVendorSettings=[{id:"setting",controls:[{id:"label",label:"Custom label",type:"textarea",placeholder:"E.g: Brand"},{id:"url",label:"Open collection URL",type:"toggle",default:!1},{id:"openIn",type:"option:value",options:[{label:"Yes",value:"new-tab"},{label:"No",value:"current"}],default:"current"},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],default:"h2"}]},{id:"style",controls:[{id:"enableHoverEffect",type:"toggle",label:"Enable Hover Effect",default:!0},{id:"color",label:"Text Color",type:"color-picker-v2",default:{normal:"text-2"},compoDefaultValue:{normal:"highlight"},state:{normal:!0,hover:!0}},{id:"underlineLink",type:"toggle",label:"Underline link",default:{hover:!0,normal:!1},state:{hover:!0,normal:!1}},{id:"typo",type:"typography-v2",default:{type:"paragraph-1",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{},compoDefaultValue:{custom:{textShadow:{angle:145,distance:"2px",blur:"20px",color:"rgba(18, 18, 18, 0.2)",type:"custom",enable:!0}}}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}];exports.ProductVendorSettings=ProductVendorSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{label:{en:"Text style"},controls:[{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"label",compoDefaultValue:"Vendor: ",popoverLabel:{en:"Vendor label"},controls:[{label:{en:"Prefix"},setting:{id:"label"},options:{labelAlign:"top"}}]},{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Hover
|
|
1
|
+
"use strict";const SettingUIV2=[{label:{en:"Text style"},controls:[{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"label",compoDefaultValue:"Vendor: ",popoverLabel:{en:"Vendor label"},controls:[{label:{en:"Prefix"},setting:{id:"label"},options:{labelAlign:"top"}}]},{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",setting:{id:"enableHoverEffect"},fixedValue:"Styled",popoverLabel:{en:"Hover"},state:"hover",controls:[{label:{en:"Text color"},setting:{id:"color",state:"hover"}},{label:{en:"Underline"},setting:{id:"underlineLink",state:"hover"}}]}]},{controls:[{label:{en:"Collection link"},setting:{id:"url"},options:{labelVariant:"primary",toggleStyle:"switch"},help:{content:"Click to open a collection page with<br> all products from the same vendor."}},{label:{en:"Open new tab"},setting:{id:"openIn"},conditionDisplay:"url == true"}]},{label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}];exports.SettingUIV2=SettingUIV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getClasses=({setting:e,advanced:
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getClasses=({setting:e,advanced:t,builderProps:s})=>({...s?.uid&&{[s.uid]:!0},...e?.options?.customClass?.wrapper&&{[e.options.customClass.wrapper]:!0},...t?.cssClass&&{[t.cssClass]:!0}}),getContainerClasses=({setting:e})=>{let{excludeFlex:t}=e??{},s="";return t||(s+=" gp-flex"),composeClasses(s)},getTextClasses=({styles:e,setting:t,className:s,mode:o,disableEdit:r})=>{let{text:l,options:a}=t??{},p="";if(l||r||(p+="gp-relative empty:gp-pl-[2px] after:gp-content-['Your_custom_text_goes_here'] after:gp-absolute after:gp-select-none after:gp-top-0 after:gp-left-[2px] after:gp-w-full after:gp-truncate after:gp-text-black after:gp-opacity-20 "),e?.enableHoverEffect&&e?.underlineLink){let{underlineLink:t}=e,s=t.hover?"hover:gp-underline":"hover:!gp-no-underline",o=t.normal?"gp-underline":"";p+=` ${s} ${o}`.trim()}"edit"===o?(p+=" gp-text gp-cursor-pointer !gp-cursor-default",r||(p+=" gp-p-[2px]"),a?.useState&&(p+=" child-item-text gp-border gp-border-transparent hover:!gp-border-[#3C67FF]")):(p+=" gp-text-instant",a?.disablePointerEvent&&(p+=" gp-pointer-events-none"));let n=p.trim().split(" ").reduce((e,t)=>(e[t]=!0,e),{});return{...s&&{[s]:!0},...globalTypoClasses(e),...n}};function composeClasses(e){return e.split(" ").reduce((e,t)=>(e[t]=!0,e),{})}const globalTypoClasses=e=>{let t=core.composeTypographyClassName(e?.typo);return{...t&&{[t]:!0},...e?.textColor&&{[core.getGlobalColorClass("text",e?.textColor)]:!0},...!e?.textColor&&{[core.getGlobalColorStateClass("text",e?.color)]:!0}}};exports.composeClasses=composeClasses,exports.getClasses=getClasses,exports.getContainerClasses=getContainerClasses,exports.getTextClasses=getTextClasses,exports.globalTypoClasses=globalTypoClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:r.join(" ")})};return filterTruthyStyles(l)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:r.join(" ")})};return e?.enableHoverEffect?filterTruthyStyles(l):Object.fromEntries(Object.entries(l).filter(([e])=>!e.startsWith("--hvr")))},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let ProductTitleSettings=[{id:"setting",controls:[{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h2"},{id:"linkProduct",label:"Link To Product",type:"toggle",default:!1,info:"Ability to click on product title to goto product detail page."}]},{id:"style",controls:[{id:"typo",type:"typography-v2",default:{type:"heading-2",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"gp-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"gp-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"gp-text-align-right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify",iconName:"gp-text-align-justify"}],devices:{desktop:{default:"left"}}},{id:"hasLineClamp",type:"toggle",label:"Has Line Clamp",devices:{desktop:{default:!1}}},{id:"lineClamp",type:"input:stepper",min:1,label:"Line Clamp",disableDecimal:!0,devices:{desktop:{default:2}},hide:!0},{id:"color",type:"color-picker-v2",default:{normal:"text-1"},state:{normal:!0,hover:!0},compoDefaultValue:{hover:"highlight"}},{id:"hasTextShadow",type:"toggle",label:"Enable Text Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"textShadow",type:"textShadow",label:"Text Shadow",hideOnState:{normal:!0,hover:!0},default:{normal:{type:"shadow-1"}},state:{normal:!0,hover:!0}}]}];export{ProductTitleSettings};
|
|
1
|
+
let ProductTitleSettings=[{id:"setting",controls:[{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"div",label:"Div"}],default:"h2"},{id:"linkProduct",label:"Link To Product",type:"toggle",default:!1,info:"Ability to click on product title to goto product detail page."}]},{id:"style",controls:[{id:"typo",type:"typography-v2",default:{type:"heading-2",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"gp-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"gp-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"gp-text-align-right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify",iconName:"gp-text-align-justify"}],devices:{desktop:{default:"left"}}},{id:"hasLineClamp",type:"toggle",label:"Has Line Clamp",devices:{desktop:{default:!1}}},{id:"lineClamp",type:"input:stepper",min:1,label:"Line Clamp",disableDecimal:!0,devices:{desktop:{default:2}},hide:!0},{id:"enableHoverEffect",type:"toggle",label:"Enable Hover Effect",default:!0},{id:"color",type:"color-picker-v2",default:{normal:"text-1"},state:{normal:!0,hover:!0},compoDefaultValue:{hover:"highlight"}},{id:"hasTextShadow",type:"toggle",label:"Enable Text Shadow",default:{normal:!1,hover:!1},state:{normal:!0,hover:!0}},{id:"textShadow",type:"textShadow",label:"Text Shadow",hideOnState:{normal:!0,hover:!0},default:{normal:{type:"shadow-1"}},state:{normal:!0,hover:!0}}]}];export{ProductTitleSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:{en:"Text style"},controls:[{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Hover
|
|
1
|
+
let SettingUIV2=[{label:{en:"Text style"},controls:[{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{type:"combo",setting:{id:"enableHoverEffect"},label:{en:"Hover"},iconName:"polaris-check-hover",fixedValue:"Styled",popoverLabel:{en:"Color"},state:"hover",controls:[{label:{en:"Text color"},setting:{id:"color",state:"hover"}}]}]},{label:{en:"Display option"},controls:[{label:{en:"Max line"},setting:{id:"hasLineClamp"}},{label:{en:"Number of lines"},setting:{id:"lineClamp"},conditionDisplay:"hasLineClamp == true"}]},{controls:[{label:{en:"Product link"},setting:{id:"linkProduct"},options:{labelVariant:"primary",toggleStyle:"switch"}}]},{label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}];export{SettingUIV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let ProductVendorSettings=[{id:"setting",controls:[{id:"label",label:"Custom label",type:"textarea",placeholder:"E.g: Brand"},{id:"url",label:"Open collection URL",type:"toggle",default:!1},{id:"openIn",type:"option:value",options:[{label:"Yes",value:"new-tab"},{label:"No",value:"current"}],default:"current"},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],default:"h2"}]},{id:"style",controls:[{id:"color",label:"Text Color",type:"color-picker-v2",default:{normal:"text-2"},compoDefaultValue:{normal:"highlight"},state:{normal:!0,hover:!0}},{id:"underlineLink",type:"toggle",label:"Underline link",default:{hover:!0,normal:!1},state:{hover:!0,normal:!1}},{id:"typo",type:"typography-v2",default:{type:"paragraph-1",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{},compoDefaultValue:{custom:{textShadow:{angle:145,distance:"2px",blur:"20px",color:"rgba(18, 18, 18, 0.2)",type:"custom",enable:!0}}}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}];export{ProductVendorSettings};
|
|
1
|
+
let ProductVendorSettings=[{id:"setting",controls:[{id:"label",label:"Custom label",type:"textarea",placeholder:"E.g: Brand"},{id:"url",label:"Open collection URL",type:"toggle",default:!1},{id:"openIn",type:"option:value",options:[{label:"Yes",value:"new-tab"},{label:"No",value:"current"}],default:"current"},{id:"htmlTag",label:"HTML Tag",type:"select",options:[{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],default:"h2"}]},{id:"style",controls:[{id:"enableHoverEffect",type:"toggle",label:"Enable Hover Effect",default:!0},{id:"color",label:"Text Color",type:"color-picker-v2",default:{normal:"text-2"},compoDefaultValue:{normal:"highlight"},state:{normal:!0,hover:!0}},{id:"underlineLink",type:"toggle",label:"Underline link",default:{hover:!0,normal:!1},state:{hover:!0,normal:!1}},{id:"typo",type:"typography-v2",default:{type:"paragraph-1",attrs:{transform:"none"}},ignoreReRender:!0,hiddenSetting:{},compoDefaultValue:{custom:{textShadow:{angle:145,distance:"2px",blur:"20px",color:"rgba(18, 18, 18, 0.2)",type:"custom",enable:!0}}}},{id:"textAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left"},{label:"Center",value:"center",type:"text",tooltip:"Align center"},{label:"Right",value:"right",type:"text",tooltip:"Align right"},{label:"Justify",value:"justify",type:"text",tooltip:"Align justify"}],devices:{desktop:{default:"left"}}}]}];export{ProductVendorSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:{en:"Text style"},controls:[{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"label",compoDefaultValue:"Vendor: ",popoverLabel:{en:"Vendor label"},controls:[{label:{en:"Prefix"},setting:{id:"label"},options:{labelAlign:"top"}}]},{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Hover
|
|
1
|
+
let SettingUIV2=[{label:{en:"Text style"},controls:[{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"label",compoDefaultValue:"Vendor: ",popoverLabel:{en:"Vendor label"},controls:[{label:{en:"Prefix"},setting:{id:"label"},options:{labelAlign:"top"}}]},{type:"control",setting:{id:"typo"},layout:"vertical",options:{updateFields:[{field:"attrs.color",settingId:"color",state:"normal"},{field:"attrs.textAlign",settingId:"textAlign"}]},controlChangeTrigger:{settings:[{action:{controlId:"textAlign",valueFromField:"attrs.textAlign",groupType:"style",controlType:"style"}},{action:{controlId:"color",valueFromField:"attrs.color",groupType:"style",controlType:"style",removeDevice:!0,state:"normal"}}],options:{noRecordHistory:!0}}}]},{label:{en:"Effect"},controls:[{label:{en:"Hover"},iconName:"polaris-check-hover",type:"combo",setting:{id:"enableHoverEffect"},fixedValue:"Styled",popoverLabel:{en:"Hover"},state:"hover",controls:[{label:{en:"Text color"},setting:{id:"color",state:"hover"}},{label:{en:"Underline"},setting:{id:"underlineLink",state:"hover"}}]}]},{controls:[{label:{en:"Collection link"},setting:{id:"url"},options:{labelVariant:"primary",toggleStyle:"switch"},help:{content:"Click to open a collection page with<br> all products from the same vendor."}},{label:{en:"Open new tab"},setting:{id:"openIn"},conditionDisplay:"url == true"}]},{label:{en:"SEO"},controls:[{type:"control",label:{en:"HTML tag"},setting:{id:"htmlTag"}}]}];export{SettingUIV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeTypographyClassName as e,getGlobalColorClass as t,getGlobalColorStateClass as s}from"@gem-sdk/core";let getClasses=({setting:e,advanced:t,builderProps:s})=>({...s?.uid&&{[s.uid]:!0},...e?.options?.customClass?.wrapper&&{[e.options.customClass.wrapper]:!0},...t?.cssClass&&{[t.cssClass]:!0}}),getContainerClasses=({setting:e})=>{let{excludeFlex:t}=e??{},s="";return t||(s+=" gp-flex"),composeClasses(s)},getTextClasses=({styles:e,setting:t,className:s,mode:r,disableEdit:o})=>{let{text:l,options:p}=t??{},
|
|
1
|
+
import{composeTypographyClassName as e,getGlobalColorClass as t,getGlobalColorStateClass as s}from"@gem-sdk/core";let getClasses=({setting:e,advanced:t,builderProps:s})=>({...s?.uid&&{[s.uid]:!0},...e?.options?.customClass?.wrapper&&{[e.options.customClass.wrapper]:!0},...t?.cssClass&&{[t.cssClass]:!0}}),getContainerClasses=({setting:e})=>{let{excludeFlex:t}=e??{},s="";return t||(s+=" gp-flex"),composeClasses(s)},getTextClasses=({styles:e,setting:t,className:s,mode:r,disableEdit:o})=>{let{text:l,options:p}=t??{},a="";if(l||o||(a+="gp-relative empty:gp-pl-[2px] after:gp-content-['Your_custom_text_goes_here'] after:gp-absolute after:gp-select-none after:gp-top-0 after:gp-left-[2px] after:gp-w-full after:gp-truncate after:gp-text-black after:gp-opacity-20 "),e?.enableHoverEffect&&e?.underlineLink){let{underlineLink:t}=e,s=t.hover?"hover:gp-underline":"hover:!gp-no-underline",r=t.normal?"gp-underline":"";a+=` ${s} ${r}`.trim()}"edit"===r?(a+=" gp-text gp-cursor-pointer !gp-cursor-default",o||(a+=" gp-p-[2px]"),p?.useState&&(a+=" child-item-text gp-border gp-border-transparent hover:!gp-border-[#3C67FF]")):(a+=" gp-text-instant",p?.disablePointerEvent&&(a+=" gp-pointer-events-none"));let n=a.trim().split(" ").reduce((e,t)=>(e[t]=!0,e),{});return{...s&&{[s]:!0},...globalTypoClasses(e),...n}};function composeClasses(e){return e.split(" ").reduce((e,t)=>(e[t]=!0,e),{})}let globalTypoClasses=r=>{let o=e(r?.typo);return{...o&&{[o]:!0},...r?.textColor&&{[t("text",r?.textColor)]:!0},...!r?.textColor&&{[s("text",r?.color)]:!0}}};export{composeClasses,getClasses,getContainerClasses,getTextClasses,globalTypoClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as
|
|
1
|
+
import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as s,getGlobalColorStateStyle as h,composeTypographyStyle as y,getStyleBackgroundByDevice as c,getGradientBgrStyleByDevice as p}from"@gem-sdk/core";import{formatThickness as u}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(g,S)=>{let f=r(S?.globalSize),w=[g?.lineThrough&&"line-through",g?.typo?.attrs?.underline&&"underline"].filter(Boolean),m={...f?.width?.["--w"]?f.width:{"--w":"100%"},...e({tdc:o(g?.lineColor?.normal),tdt:u(g?.thickness)}),...l(g?.shapeBorder),...i(g?.shapeRounded),...n(g?.shapeBoxShadow,"box-shadow",g?.shapeBoxShadow),...a({value:g?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:g?.typo?.custom?.hasShadowText}),...t("ta",g?.textAlign),...t("line-clamp",d(g?.lineClamp,g?.hasLineClamp)),...g?.textColor?s(g.textColor):h("c",g?.color),...y(g?.typo),"word-break":"break-word",...c(S?.background),...f.padding,...p(S?.background),overflow:"hidden",...g?.opacityPrice&&{opacity:`${g?.opacityPrice}%`},...e({tdl:w.join(" ")})};return g?.enableHoverEffect?filterTruthyStyles(m):Object.fromEntries(Object.entries(m).filter(([e])=>!e.startsWith("--hvr")))},getTextStyleInline=e=>{let t={...y(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ type TextStyleProps = {
|
|
|
115
115
|
isForceValue?: boolean;
|
|
116
116
|
lineThrough?: boolean;
|
|
117
117
|
opacityPrice?: number;
|
|
118
|
+
enableHoverEffect?: boolean;
|
|
118
119
|
};
|
|
119
120
|
type HTMLTag = 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'small' | 'mark' | 'kbd' | 'i';
|
|
120
121
|
type TextSettingProps = {
|