@gem-sdk/components 3.1.0 → 3.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},r=["desktop","mobile","tablet"];return r.forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",i=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==i||"0px"!==l},getAspectRatio=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e,o)?.shapeValue;if(r)t={...t,[o]:r};else{let r=core.getResponsiveValueByScreen(e,o)?.shape;switch(r){case"square":t={...t,[o]:"1/1"};break;case"vertical":t={...t,[o]:"3/4"};break;case"horizontal":t={...t,[o]:"4/3"};break;case"original":t={...t,[o]:""}}}}),core.makeAspectRatio(t)},getStyleGridLayout=e=>{let t={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!e.isHiddenGalleryImages){let o=!1;core.DEVICES.forEach(r=>{let i=core.getResponsiveValueByScreen(e.position,r),l=core.getResponsiveValueByScreen(e.ratioLayout,r),n=core.getResponsiveValueByScreen(e.ratioLayoutRight,r),a="desktop"===r?"--gtc":`--gtc-${r}`,s="desktop"===r?"--gtr":`--gtr-${r}`,c="left"===i?l:n,d=["left","right"].includes(i||"");d&&c?(o=!0,Object.assign(t={...t,[a]:`minmax(0, ${c[0]}fr) minmax(0, ${c[1]}fr)`},{[s]:"fit-content(0)"})):o&&Object.assign(t,{[s]:"unset"})})}return t},getStyleGridOrderForFeature=e=>{let t={"--o":"0","--o-tablet":"0","--o-mobile":"0"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e.position,o),i="desktop"===o?"--o":`--o-${o}`;t={...t,[i]:"left"===r?"1":"0"}}),t},getStyleGridOrderForGallery=e=>{let t={"--o":"1","--o-tablet":"1","--o-mobile":"1"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e.position,o),i="desktop"===o?"--o":`--o-${o}`;t={...t,[i]:"left"===r?"0":"1"}}),t},getSrcImage=e=>`{{${e} |
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},r=["desktop","mobile","tablet"];return r.forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",i=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==i||"0px"!==l},getAspectRatio=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e,o)?.shapeValue;if(r)t={...t,[o]:r};else{let r=core.getResponsiveValueByScreen(e,o)?.shape;switch(r){case"square":t={...t,[o]:"1/1"};break;case"vertical":t={...t,[o]:"3/4"};break;case"horizontal":t={...t,[o]:"4/3"};break;case"original":t={...t,[o]:""}}}}),core.makeAspectRatio(t)},getStyleGridLayout=e=>{let t={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!e.isHiddenGalleryImages){let o=!1;core.DEVICES.forEach(r=>{let i=core.getResponsiveValueByScreen(e.position,r),l=core.getResponsiveValueByScreen(e.ratioLayout,r),n=core.getResponsiveValueByScreen(e.ratioLayoutRight,r),a="desktop"===r?"--gtc":`--gtc-${r}`,s="desktop"===r?"--gtr":`--gtr-${r}`,c="left"===i?l:n,d=["left","right"].includes(i||"");d&&c?(o=!0,Object.assign(t={...t,[a]:`minmax(0, ${c[0]}fr) minmax(0, ${c[1]}fr)`},{[s]:"fit-content(0)"})):o&&Object.assign(t,{[s]:"unset"})})}return t},getStyleGridOrderForFeature=e=>{let t={"--o":"0","--o-tablet":"0","--o-mobile":"0"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e.position,o),i="desktop"===o?"--o":`--o-${o}`;t={...t,[i]:"left"===r?"1":"0"}}),t},getStyleGridOrderForGallery=e=>{let t={"--o":"1","--o-tablet":"1","--o-mobile":"1"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e.position,o),i="desktop"===o?"--o":`--o-${o}`;t={...t,[i]:"left"===r?"0":"1"}}),t},getSrcImage=e=>`{{${e} | image_url: width: 480}}, {{${e} | image_url: width: 768}}, {{${e} | image_url: width: 1024}}, {{${e} | image_url: width: 1440}}`,convertSpacingForIndisdeLayout=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},getStyleInsideLayout=(e,t,o)=>{let r=["desktop","mobile","tablet"],i={},l={},n={},a={},s={},c={};return r.forEach(r=>{let d=core.getResponsiveValueByScreen(e,r),g=core.getResponsiveValueByScreen(t,r)?.width,u=core.getResponsiveValueByScreen(o,r);if(i={...i,[r]:["inside-bottom","inside-left","inside-right"].includes(d)?"absolute":"static"},["inside-bottom"].includes(d)){let e=convertSpacingForIndisdeLayout(u);g=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(d)&&(g="100%"),n={...n,[r]:"inside-bottom"===d?`${u}`:"auto"},a={...a,[r]:["inside-left","inside-right"].includes(d)?`${u}`:"auto"},c={...c,[r]:["inside-bottom","inside-left"].includes(d)?`${u}`:"auto"},s={...s,[r]:"inside-right"===d?`${u}`:"auto"},l={...l,[r]:g}}),{...core.makeStyleResponsive("pos",i),...core.makeStyleResponsive("w",core.removeNullUndefined(l)),...core.makeStyleResponsive("bottom",core.removeNullUndefined(n)),...core.makeStyleResponsive("top",core.removeNullUndefined(a)),...core.makeStyleResponsive("left",core.removeNullUndefined(c)),...core.makeStyleResponsive("right",core.removeNullUndefined(s))}},getConditionRenderGalleryImages=(e,t)=>{let o=["desktop","mobile","tablet"],r=!0,i=!1;return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o),n=core.getResponsiveValueByScreen(t,o);l&&"only-feature"!==l&&(r=!1),(["two-col","one-col"].includes(l)||"images"===n)&&(i=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:i}},setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}}),getValueFromValueContainUnit=e=>{let t=e.match(/\d+/g);return t?t[0]:e},getPaddingBottomByShapeSetting=e=>{let t=getAspectRatio(e),o={desktop:"auto",mobile:"auto",tablet:"auto"},r=["desktop","mobile","tablet"];return r.forEach(r=>{let i=core.getResponsiveValueByScreen(e,r),l=i?.height,n=i?.width||"",a=getValueFromValueContainUnit(l||""),s=n.toString().match(/px/g)?getValueFromValueContainUnit(n):n;if(l&&n&&!isNaN(Number(a))&&!isNaN(Number(s))){o={...o,[r]:`${Number(a)/Number(s)*100}%`};return}if(l&&!isNaN(Number(a))){o={...o,[r]:l};return}let c=t?.[r]!=="auto"&&t?.[r]?t?.[r]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";o={...o,[r]:`calc((${c})*100%)`}}),o};exports.checkAddOverFlowClass=checkAddOverFlowClass,exports.convertSpacing=convertSpacing,exports.convertSpacingForIndisdeLayout=convertSpacingForIndisdeLayout,exports.convertUnitToNumber=convertUnitToNumber,exports.getAspectRatio=getAspectRatio,exports.getConditionRenderGalleryImages=getConditionRenderGalleryImages,exports.getDisplayStyle=getDisplayStyle,exports.getPaddingBottomByShapeSetting=getPaddingBottomByShapeSetting,exports.getSrcImage=getSrcImage,exports.getStyleGridLayout=getStyleGridLayout,exports.getStyleGridOrderForFeature=getStyleGridOrderForFeature,exports.getStyleGridOrderForGallery=getStyleGridOrderForGallery,exports.getStyleInsideLayout=getStyleInsideLayout,exports.getTypeWidthDevice=getTypeWidthDevice,exports.setDefaultWhenUndefineSetting=setDefaultWhenUndefineSetting;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];exports.TabsSettings=TabsSettings;
|
|
1
|
+
"use strict";const TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{angle:135,blur:"2px",distance:"2px",type:"custom",color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];exports.TabsSettings=TabsSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getResponsiveValueByScreen as e,makeAspectRatio as t,makeStyleResponsive as o,removeNullUndefined as i,DEVICES as r}from"@gem-sdk/core";let getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,i=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:i}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{o={...o,[`--d${"desktop"===i?"":`-${i}`}`]:`${e(i)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",i=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==i||"0px"!==r||"0px"!==l},getAspectRatio=o=>{let i={},r=["desktop","mobile","tablet"];return r.forEach(t=>{let r=e(o,t)?.shapeValue;if(r)i={...i,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":i={...i,[t]:"1/1"};break;case"vertical":i={...i,[t]:"3/4"};break;case"horizontal":i={...i,[t]:"4/3"};break;case"original":i={...i,[t]:""}}}}),t(i)},getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let i=!1;r.forEach(r=>{let l=e(t.position,r),a=e(t.ratioLayout,r),n=e(t.ratioLayoutRight,r),s="desktop"===r?"--gtc":`--gtc-${r}`,d="desktop"===r?"--gtr":`--gtr-${r}`,u="left"===l?a:n,c=["left","right"].includes(l||"");c&&u?(i=!0,Object.assign(o={...o,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):i&&Object.assign(o,{[d]:"unset"})})}return o},getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"1":"0"}}),o},getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"0":"1"}}),o},getSrcImage=e=>`{{${e} |
|
|
1
|
+
import{getResponsiveValueByScreen as e,makeAspectRatio as t,makeStyleResponsive as o,removeNullUndefined as i,DEVICES as r}from"@gem-sdk/core";let getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,i=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:i}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{o={...o,[`--d${"desktop"===i?"":`-${i}`}`]:`${e(i)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",i=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==i||"0px"!==r||"0px"!==l},getAspectRatio=o=>{let i={},r=["desktop","mobile","tablet"];return r.forEach(t=>{let r=e(o,t)?.shapeValue;if(r)i={...i,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":i={...i,[t]:"1/1"};break;case"vertical":i={...i,[t]:"3/4"};break;case"horizontal":i={...i,[t]:"4/3"};break;case"original":i={...i,[t]:""}}}}),t(i)},getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let i=!1;r.forEach(r=>{let l=e(t.position,r),a=e(t.ratioLayout,r),n=e(t.ratioLayoutRight,r),s="desktop"===r?"--gtc":`--gtc-${r}`,d="desktop"===r?"--gtr":`--gtr-${r}`,u="left"===l?a:n,c=["left","right"].includes(l||"");c&&u?(i=!0,Object.assign(o={...o,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):i&&Object.assign(o,{[d]:"unset"})})}return o},getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"1":"0"}}),o},getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"0":"1"}}),o},getSrcImage=e=>`{{${e} | image_url: width: 480}}, {{${e} | image_url: width: 768}}, {{${e} | image_url: width: 1024}}, {{${e} | image_url: width: 1440}}`,convertSpacingForIndisdeLayout=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},getStyleInsideLayout=(t,r,l)=>{let a=["desktop","mobile","tablet"],n={},s={},d={},u={},c={},g={};return a.forEach(o=>{let i=e(t,o),a=e(r,o)?.width,m=e(l,o);if(n={...n,[o]:["inside-bottom","inside-left","inside-right"].includes(i)?"absolute":"static"},["inside-bottom"].includes(i)){let e=convertSpacingForIndisdeLayout(m);a=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(i)&&(a="100%"),d={...d,[o]:"inside-bottom"===i?`${m}`:"auto"},u={...u,[o]:["inside-left","inside-right"].includes(i)?`${m}`:"auto"},g={...g,[o]:["inside-bottom","inside-left"].includes(i)?`${m}`:"auto"},c={...c,[o]:"inside-right"===i?`${m}`:"auto"},s={...s,[o]:a}}),{...o("pos",n),...o("w",i(s)),...o("bottom",i(d)),...o("top",i(u)),...o("left",i(g)),...o("right",i(c))}},getConditionRenderGalleryImages=(t,o)=>{let i=["desktop","mobile","tablet"],r=!0,l=!1;return i.forEach(i=>{let a=e(t,i),n=e(o,i);a&&"only-feature"!==a&&(r=!1),(["two-col","one-col"].includes(a)||"images"===n)&&(l=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:l}},setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}}),getValueFromValueContainUnit=e=>{let t=e.match(/\d+/g);return t?t[0]:e},getPaddingBottomByShapeSetting=t=>{let o=getAspectRatio(t),i={desktop:"auto",mobile:"auto",tablet:"auto"},r=["desktop","mobile","tablet"];return r.forEach(r=>{let l=e(t,r),a=l?.height,n=l?.width||"",s=getValueFromValueContainUnit(a||""),d=n.toString().match(/px/g)?getValueFromValueContainUnit(n):n;if(a&&n&&!isNaN(Number(s))&&!isNaN(Number(d))){i={...i,[r]:`${Number(s)/Number(d)*100}%`};return}if(a&&!isNaN(Number(s))){i={...i,[r]:a};return}let u=o?.[r]!=="auto"&&o?.[r]?o?.[r]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";i={...i,[r]:`calc((${u})*100%)`}}),i};export{checkAddOverFlowClass,convertSpacing,convertSpacingForIndisdeLayout,convertUnitToNumber,getAspectRatio,getConditionRenderGalleryImages,getDisplayStyle,getPaddingBottomByShapeSetting,getSrcImage,getStyleGridLayout,getStyleGridOrderForFeature,getStyleGridOrderForGallery,getStyleInsideLayout,getTypeWidthDevice,setDefaultWhenUndefineSetting};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];export{TabsSettings};
|
|
1
|
+
let TabsSettings=[{id:"setting",controls:[{id:"childItem",label:"Tabs Item",type:"child-item",default:["Tab 1","Tab 2","Tab 3"]},{id:"activeKey",type:"select-custom-options",label:"Order",controlOption:"childItem",default:0},{id:"translate",type:"input",default:"childItem"},{id:"position",type:"layout-selector",label:"Layout",iconViewBox:"0 0 74 48",enableItemBackground:!0,itemPerRow:2,options:[{value:"top",label:"Top",iconName:"gp-tab-top"},{value:"left",label:"Left",iconName:"gp-tab-left"},{value:"right",label:"Right",iconName:"gp-tab-bottom"}],devices:{desktop:{default:"top"}}},{id:"group-header",label:"Tabs Header",type:"group",controls:[{id:"labelTypoV2",type:"typography-v2",default:{type:"paragraph-1",attrs:{color:"text-1"}},compoDefaultValue:{custom:{textShadow:{angle:135,blur:"2px",distance:"2px",type:"custom",color:"rgba(18, 18, 18, 0.5)"}}},ignoreReRender:!0},{id:"panelFullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"panelWidth",label:"Width",type:"dropdown:input",units:["px","%"],displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}],devices:{desktop:{default:"Auto"}}},{id:"panelAlign",type:"option:value",label:"Alignment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"left"}}},{id:"panelAlignVertical",type:"option:value",label:"Alignment",options:[{label:"Top",value:"start",type:"align",tooltip:"Align Top",iconName:"gp-align-top"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Bottom",value:"end",type:"align",tooltip:"Align Bottom",iconName:"gp-align-bottom"}],devices:{desktop:{default:"start"}}},{id:"labelWidth",label:"Width",type:"input:unit",units:["px","%"],devices:{desktop:{default:"auto"}}},{id:"padding",type:"padding-v2",devices:{desktop:{}}},{id:"labelAlign",type:"option:value",label:"Text alignment",options:[{label:"Left",value:"left",type:"text"},{label:"Center",value:"center",type:"text"},{label:"Right",value:"right",type:"text"}],devices:{desktop:{default:"left"}}}]},{id:"enableHoverEffect",label:"",type:"toggle",default:!1},{id:"enableActiveEffect",label:"",type:"toggle",default:!0},{id:"behavior-state-group",type:"behavior-state",controls:[{id:"labelBgColor",label:"Background Color",type:"color-picker-v2",default:{active:"bg-1"},compoDefaultValue:{normal:"bg-2",hover:"bg-2",active:"bg-1"}},{id:"labelColor",label:"Text Color",type:"color-picker-v2",default:{normal:"text-1"},compoDefaultValue:{normal:"text-1"}},{id:"borderTab",type:"border",label:"Border",default:{active:{border:"solid",width:"0px 0px 1px 0px",borderWidth:"1px",color:"line-3",position:"bottom",isCustom:!0}}}]},{id:"containWidth",type:"input:unit",placeholder:"Auto",units:["px","%"],devices:{desktop:{default:"100%"}}},{id:"background",type:"background-media",ignoreReRender:!0,devices:{desktop:{default:{type:"color",color:"transparent",image:{src:"",width:0,height:0},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}},compoDefaultValue:{desktop:{default:{type:"color",color:"#DDDDDD",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:1200},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll"}}}},{id:"align",label:"Align",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],devices:{desktop:{default:"center"}}}]}];export{TabsSettings};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "3.1.
|
|
28
|
+
"@gem-sdk/core": "3.1.2",
|
|
29
29
|
"@gem-sdk/styles": "3.1.0",
|
|
30
30
|
"@gem-sdk/system": "3.1.0",
|
|
31
31
|
"tsup": "^8.5.0",
|