@gem-sdk/components 2.0.0-staging.951 → 2.0.0-staging.952
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/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/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";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
|
-
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 = {
|