@gem-sdk/components 2.0.0-staging.841 → 2.0.0-staging.842
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/image/settings/configs/presets.js +1 -1
- package/dist/cjs/product/components/product-variants/common/base/styles.js +1 -1
- package/dist/cjs/stock-counter/components/StockCounter.liquid.js +29 -27
- package/dist/esm/image/settings/configs/presets.js +1 -1
- package/dist/esm/product/components/product-variants/common/base/styles.js +1 -1
- package/dist/esm/stock-counter/components/StockCounter.liquid.js +43 -41
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<ellipse cx="20.4375" cy="22.9688" rx="2.0625" ry="1.96875" fill="#F9F9F9"/>
|
|
11
11
|
<path d="M17.2887 32.9997L20.5342 29.1816C20.6441 29.052 20.7799 28.9473 20.9327 28.8741C21.0856 28.8009 21.2521 28.761 21.4213 28.7568C21.5905 28.7527 21.7587 28.7845 21.915 28.8501C22.0712 28.9158 22.2118 29.0138 22.3278 29.1378L23.8454 30.758L29.7777 23.6225C29.8938 23.4827 30.0398 23.371 30.2048 23.2958C30.3697 23.2205 30.5495 23.1836 30.7306 23.1878C30.9117 23.192 31.0895 23.2372 31.2509 23.3201C31.4122 23.4029 31.5529 23.5213 31.6625 23.6663L38.7549 33.0467C38.8905 33.2266 38.9735 33.4409 38.9947 33.6656C39.0158 33.8902 38.9741 34.1164 38.8744 34.3186C38.7747 34.5207 38.6209 34.6909 38.4302 34.81C38.2396 34.9291 38.0197 34.9923 37.7952 34.9926L18.2057 35C17.9753 34.9999 17.7497 34.9334 17.5557 34.8085C17.3616 34.6835 17.2072 34.5053 17.1108 34.2948C17.0143 34.0844 16.9798 33.8506 17.0113 33.6211C17.0429 33.3915 17.1391 33.1759 17.2887 32.9997Z" fill="#F9F9F9"/>
|
|
12
12
|
</svg>
|
|
13
|
-
`},components:[{tag:"Image",settings:{imageStyle:"circle"},styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"},wrapperBorder:{borderType:"none",border:"none",width:"1px 1px 1px 1px",position:"all",borderWidth:"1px",color:"#000000",isCustom:!0}},advanced:{"spacing-setting":{desktop:{margin:{bottom:"var(--g-s-l)"}}},editorData:{cssplaceholder:".{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}"}}}],rootOverride:{styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"}},advanced:{"spacing-setting":{desktop:{margin:{bottom:0}}}}}},{id:"image-pre-sales-page",name:{en:"Image"},icon:{desktop:`
|
|
13
|
+
`},components:[{tag:"Image",settings:{imageStyle:"circle"},styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0},tablet:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0},mobile:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"},wrapperBorder:{borderType:"none",border:"none",width:"1px 1px 1px 1px",position:"all",borderWidth:"1px",color:"#000000",isCustom:!0}},advanced:{"spacing-setting":{desktop:{margin:{bottom:"var(--g-s-l)"}}},editorData:{cssplaceholder:".{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}"}}}],rootOverride:{styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"}},advanced:{"spacing-setting":{desktop:{margin:{bottom:0}}}}}},{id:"image-pre-sales-page",name:{en:"Image"},icon:{desktop:`
|
|
14
14
|
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
15
|
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
16
16
|
<circle cx="37" cy="17" r="3" fill="#D6D6D6"/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../../../../helpers.js");const getWrapperStyleActive=e=>{let{preset:t,optionTypography:o,optionTypo:r,typeOfOption:l}=e,a=t?.optionBgColor,p=t?.optionTextColor,i=t?.optionBorder,c=t?.optionHasShadow,d=t?.optionShadow,h=t?.optionRounded,n="color"===l,g="image"===l||"image_shopify"===l,s=core.composeTypographyStyle(r,o),y=e=>core.makeStyle({bg:e&&core.getSingleColorVariable(a?.active),bs:i?.active?.border,bw:i?.active?.width,bc:core.getSingleColorVariable(i?.active?.color)});return helpers.filterTruthyObject({...y(!n),...core.getRadiusStyleActiveState(h),...core.getStyleShadow({value:d?.active,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:c?.active},!0),...s,...!n&&!g&&core.makeStyle({c:core.getSingleColorVariable(p?.active??p?.normal)}),...core.makeStyle({h:t?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:t,optionTransform:o,optionTypography:r,optionTypo:l,typeOfOption:a}=e,p=t?.optionBgColor,i=t?.optionTextColor,c=t?.optionBorder,d=t?.optionHasShadow,h=t?.optionShadow,n=t?.optionRounded,g="color"===a,s="image"===a||"image_shopify"===a,y=core.composeTypographyStyle(l,r),S=["normal","hover"].reduce((e,t)=>({...e,...core.getStyleShadow({value:h?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:d?.[t]})}),{});return helpers.filterTruthyObject({...core.composeRadius(n),...S,...!g&&core.getGlobalColorStateStyle("bg",p),...!g&&core.handleConvertBorderStyle(c),...!g&&core.handleConvertBorderWidth(c),...!g&&core.handleConvertBorderColor(c),...!g&&!s&&core.makeStyle({c:o}),...!g&&!s&&core.getGlobalColorStateStyle("c",i),...y,...core.makeStyle({h:t?.height})})},getWrapperTextStyle=e=>{let{preset:t,typeOfOption:o}=e,r="color"===o,l=()=>{let e="16px",o={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return t?.width?.desktop?.toLowerCase()!=="auto"&&t?.width?.desktop||(o["--pl"]=e,o["--pr"]=e),t?.width?.tablet?.toLowerCase()!=="auto"&&t?.width?.tablet||(o["--pl-tablet"]=e,o["--pr-tablet"]=e),t?.width?.mobile?.toLowerCase()!=="auto"&&t?.width?.mobile||(o["--pl-mobile"]=e,o["--pr-mobile"]=e),(t?.height?.toLowerCase()==="auto"||t?.height)&&(o["--pt"]="8px",o["--pb"]="8px"),o};return helpers.filterTruthyObject({...r?{}:l()})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden","--bs":o?"none":"solid",...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.composeRadius(t),...l()});return a(!!o)},getTextStyle=({optionTypo:e,optionTypography:t})=>{let o=core.composeTypographyStyle(e,t);return delete o["--c"],helpers.filterTruthyObject({...o})};exports.getColorStyle=getColorStyle,exports.getTextStyle=getTextStyle,exports.getWrapperStyleActive=getWrapperStyleActive,exports.getWrapperStyleNormalAndHover=getWrapperStyleNormalAndHover,exports.getWrapperTextStyle=getWrapperTextStyle;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../../../../helpers.js");const getWrapperStyleActive=e=>{let{preset:t,optionTypography:o,optionTypo:r,typeOfOption:l}=e,a=t?.optionBgColor,p=t?.optionTextColor,i=t?.optionBorder,c=t?.optionHasShadow,d=t?.optionShadow,h=t?.optionRounded,n="color"===l,g="image"===l||"image_shopify"===l,s=core.composeTypographyStyle(r,o),y=e=>core.makeStyle({bg:e&&core.getSingleColorVariable(a?.active??a?.normal),bs:i?.active?.border,bw:i?.active?.width,bc:core.getSingleColorVariable(i?.active?.color)});return helpers.filterTruthyObject({...y(!n),...core.getRadiusStyleActiveState(h),...core.getStyleShadow({value:d?.active,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:c?.active},!0),...s,...!n&&!g&&core.makeStyle({c:core.getSingleColorVariable(p?.active??p?.normal)}),...core.makeStyle({h:t?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:t,optionTransform:o,optionTypography:r,optionTypo:l,typeOfOption:a}=e,p=t?.optionBgColor,i=t?.optionTextColor,c=t?.optionBorder,d=t?.optionHasShadow,h=t?.optionShadow,n=t?.optionRounded,g="color"===a,s="image"===a||"image_shopify"===a,y=core.composeTypographyStyle(l,r),S=["normal","hover"].reduce((e,t)=>({...e,...core.getStyleShadow({value:h?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:d?.[t]})}),{});return helpers.filterTruthyObject({...core.composeRadius(n),...S,...!g&&core.getGlobalColorStateStyle("bg",p),...!g&&core.handleConvertBorderStyle(c),...!g&&core.handleConvertBorderWidth(c),...!g&&core.handleConvertBorderColor(c),...!g&&!s&&core.makeStyle({c:o}),...!g&&!s&&core.getGlobalColorStateStyle("c",i),...y,...core.makeStyle({h:t?.height})})},getWrapperTextStyle=e=>{let{preset:t,typeOfOption:o}=e,r="color"===o,l=()=>{let e="16px",o={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return t?.width?.desktop?.toLowerCase()!=="auto"&&t?.width?.desktop||(o["--pl"]=e,o["--pr"]=e),t?.width?.tablet?.toLowerCase()!=="auto"&&t?.width?.tablet||(o["--pl-tablet"]=e,o["--pr-tablet"]=e),t?.width?.mobile?.toLowerCase()!=="auto"&&t?.width?.mobile||(o["--pl-mobile"]=e,o["--pr-mobile"]=e),(t?.height?.toLowerCase()==="auto"||t?.height)&&(o["--pt"]="8px",o["--pb"]="8px"),o};return helpers.filterTruthyObject({...r?{}:l()})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden","--bs":o?"none":"solid",...core.handleConvertBorderWidth(e),...core.handleConvertBorderColor(e),...core.composeRadius(t),...l()});return a(!!o)},getTextStyle=({optionTypo:e,optionTypography:t})=>{let o=core.composeTypographyStyle(e,t);return delete o["--c"],helpers.filterTruthyObject({...o})};exports.getColorStyle=getColorStyle,exports.getTextStyle=getTextStyle,exports.getWrapperStyleActive=getWrapperStyleActive,exports.getWrapperStyleNormalAndHover=getWrapperStyleNormalAndHover,exports.getWrapperTextStyle=getWrapperTextStyle;
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),attrs=require("../common/attrs.js"),system=require("@gem-sdk/system");const StockCounter=({setting:e,styles:s,style:t,advanced:r,builderProps:a,pageContext:l})=>{let{borderRadius:c}=s??{},{showIcon:i,icon:o,oosIcon:
|
|
2
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),attrs=require("../common/attrs.js"),system=require("@gem-sdk/system");const StockCounter=({setting:e,styles:s,style:t,advanced:r,builderProps:a,pageContext:l})=>{let{borderRadius:c}=s??{},{showIcon:i,icon:o,oosIcon:d,layout:n="full",template:p,outOfStockMessage:y,continueSelling:u,unlimitedQuantityMessage:g}=e??{},m=helpers$1.getInlineCss(a?.uid,c),$="progress-bar"!==n,v=helpers.getDynamicSourceLocales({val:p,uid:a?.uid,settingId:"template",pageContext:l,translate:e?.translate,isReplaceInventoryQuantity:!0}),S=helpers.getDynamicSourceLocales({val:y,uid:a?.uid,settingId:"outOfStockMessage",pageContext:l,translate:e?.translate}),f=helpers.getDynamicSourceLocales({val:u,uid:a?.uid,settingId:"continueSelling",pageContext:l,translate:e?.translate}),k=helpers.getDynamicSourceLocales({val:g,uid:a?.uid,settingId:"unlimitedQuantityMessage",pageContext:l,translate:e?.translate}),C=system.createAttr({...attrs.getLiquidTagAttrs(a,e,s)}),I=system.createClass({...core.composeClasses("gp-stock-counter-progress gp-mt-2 data-[visible=true]:gp-block data-[visible=false]:gp-hidden"),...classes.getProgressBarClasses(s)}),h=system.createStyle({...styles.getProgressBarStyles(s,e)}),q=system.createStyle({...styles.getContainerStyles(s)}),L=system.createClass({...classes.getContainerClasses(e)}),b=system.createClass({...classes.getLiquidTagClasses(r)}),A=system.createStyle({...t}),O=system.createStyle({...styles.getWrapperStyles(s)}),_=helpers$1.getLiquidInitData(e,s),D=helpers$1.getLiquidTextContent({templateStringDisplay:v,outOfStockMessageDisplay:S,continueSellingDisplay:f,unlimitedQuantityMessageDisplay:k}),j=system.createClass({...classes.getWrapperIconClasses(e)}),T=system.createClass({...core.composeClasses("gp-stock-counter-icon data-[visible=true]:gp-block data-[visible=false]:gp-hidden"),...classes.getIconClasses()}),x=system.createClass({...classes.getWrapperClasses(e)}),P=t=>system.createStyle({...styles.getIconStyles(s,e,t)}),R=({isOutOfStockIcon:e,isVisible:s})=>system.createAttr({...attrs.getIconAttrs(e,s)}),E=system.createAttr({...attrs.getLiquidProgressBarAttrs()}),V=system.createClass({...classes.getTextClasses(s),...core.composeClasses("gp-stock-counter-mark")}),M=e=>system.createStyle({...styles.getTextStyles(s,e)}),B=system.createAttr({...attrs.getLiquidTextAttrs()}),W=helpers$1.getTextDisplayData({templateStringDisplay:v,outOfStockMessageDisplay:S,continueSellingDisplay:f,unlimitedQuantityMessageDisplay:k},s);return core.template`
|
|
2
|
+
${_}
|
|
3
3
|
<gp-product-stock-counter ${{...C}} class="${b}"
|
|
4
4
|
style="${A}">
|
|
5
|
+
<div class="${x}" style="${O}">
|
|
5
6
|
<style>${m}</style>
|
|
6
7
|
<div
|
|
7
8
|
class="${L}"
|
|
8
9
|
style="${q}"
|
|
9
10
|
>
|
|
10
|
-
<div class="${
|
|
11
|
+
<div class="${j}">
|
|
11
12
|
${core.RenderIf(i,core.template`
|
|
12
13
|
${system.LiquidIf("is_out_of_stock",core.template`<div
|
|
13
|
-
${{...
|
|
14
|
-
class="${
|
|
15
|
-
style="${
|
|
14
|
+
${{...R({isOutOfStockIcon:!0,isVisible:!0})}}
|
|
15
|
+
class="${T}"
|
|
16
|
+
style="${P(!0)}"
|
|
16
17
|
>
|
|
17
|
-
${
|
|
18
|
+
${d}
|
|
18
19
|
</div>
|
|
19
20
|
<div
|
|
20
|
-
${{...
|
|
21
|
+
${{...R({isOutOfStockIcon:!1,isVisible:!1})}}
|
|
21
22
|
data-slot-type="false"
|
|
22
|
-
class="${
|
|
23
|
-
style="${
|
|
23
|
+
class="${T}"
|
|
24
|
+
style="${P(!1)}"
|
|
24
25
|
>
|
|
25
26
|
${o}
|
|
26
27
|
</div>`,core.template` <div
|
|
27
|
-
${{...
|
|
28
|
-
class="${
|
|
29
|
-
style="${
|
|
28
|
+
${{...R({isOutOfStockIcon:!0,isVisible:!1})}}
|
|
29
|
+
class="${T}"
|
|
30
|
+
style="${P(!0)}"
|
|
30
31
|
>
|
|
31
|
-
${
|
|
32
|
+
${d}
|
|
32
33
|
</div>
|
|
33
34
|
<div
|
|
34
|
-
${{...
|
|
35
|
-
class="${
|
|
36
|
-
style="${
|
|
35
|
+
${{...R({isOutOfStockIcon:!1,isVisible:!0})}}
|
|
36
|
+
class="${T}"
|
|
37
|
+
style="${P(!1)}"
|
|
37
38
|
>
|
|
38
39
|
${o}
|
|
39
40
|
</div>`)}
|
|
40
41
|
`)}
|
|
41
|
-
${
|
|
42
|
+
${W}
|
|
42
43
|
${core.RenderIf($,core.template`
|
|
43
44
|
${system.LiquidIf("is_out_of_stock",core.template`<p
|
|
44
|
-
${{...
|
|
45
|
-
class="${
|
|
46
|
-
style="${
|
|
45
|
+
${{...B}}
|
|
46
|
+
class="${V}"
|
|
47
|
+
style="${M(!0)}"
|
|
47
48
|
>
|
|
48
|
-
${
|
|
49
|
+
${D}
|
|
49
50
|
</p>`,core.template`<p
|
|
50
|
-
${{...
|
|
51
|
-
class="${
|
|
52
|
-
style="${
|
|
51
|
+
${{...B}}
|
|
52
|
+
class="${V}"
|
|
53
|
+
style="${M(!1)}"
|
|
53
54
|
>
|
|
54
|
-
${
|
|
55
|
+
${D}
|
|
55
56
|
</p>`)}
|
|
56
57
|
`)}
|
|
57
58
|
|
|
58
59
|
</div>
|
|
59
60
|
|
|
60
61
|
<div
|
|
61
|
-
${{...
|
|
62
|
+
${{...E}}
|
|
62
63
|
style="${h}"
|
|
63
64
|
class="${I}"
|
|
64
65
|
></div>
|
|
65
66
|
</div>
|
|
67
|
+
</div>
|
|
66
68
|
</gp-product-stock-counter>
|
|
67
69
|
${core.RenderIf(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-stock-counter.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-stock-counter.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
68
70
|
`};exports.default=StockCounter;
|
|
@@ -10,7 +10,7 @@ let ImagePreset=[{id:"image",name:{en:"Image"},icon:{desktop:`
|
|
|
10
10
|
<ellipse cx="20.4375" cy="22.9688" rx="2.0625" ry="1.96875" fill="#F9F9F9"/>
|
|
11
11
|
<path d="M17.2887 32.9997L20.5342 29.1816C20.6441 29.052 20.7799 28.9473 20.9327 28.8741C21.0856 28.8009 21.2521 28.761 21.4213 28.7568C21.5905 28.7527 21.7587 28.7845 21.915 28.8501C22.0712 28.9158 22.2118 29.0138 22.3278 29.1378L23.8454 30.758L29.7777 23.6225C29.8938 23.4827 30.0398 23.371 30.2048 23.2958C30.3697 23.2205 30.5495 23.1836 30.7306 23.1878C30.9117 23.192 31.0895 23.2372 31.2509 23.3201C31.4122 23.4029 31.5529 23.5213 31.6625 23.6663L38.7549 33.0467C38.8905 33.2266 38.9735 33.4409 38.9947 33.6656C39.0158 33.8902 38.9741 34.1164 38.8744 34.3186C38.7747 34.5207 38.6209 34.6909 38.4302 34.81C38.2396 34.9291 38.0197 34.9923 37.7952 34.9926L18.2057 35C17.9753 34.9999 17.7497 34.9334 17.5557 34.8085C17.3616 34.6835 17.2072 34.5053 17.1108 34.2948C17.0143 34.0844 16.9798 33.8506 17.0113 33.6211C17.0429 33.3915 17.1391 33.1759 17.2887 32.9997Z" fill="#F9F9F9"/>
|
|
12
12
|
</svg>
|
|
13
|
-
`},components:[{tag:"Image",settings:{imageStyle:"circle"},styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"},wrapperBorder:{borderType:"none",border:"none",width:"1px 1px 1px 1px",position:"all",borderWidth:"1px",color:"#000000",isCustom:!0}},advanced:{"spacing-setting":{desktop:{margin:{bottom:"var(--g-s-l)"}}},editorData:{cssplaceholder:".{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}"}}}],rootOverride:{styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"}},advanced:{"spacing-setting":{desktop:{margin:{bottom:0}}}}}},{id:"image-pre-sales-page",name:{en:"Image"},icon:{desktop:`
|
|
13
|
+
`},components:[{tag:"Image",settings:{imageStyle:"circle"},styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0},tablet:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0},mobile:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"},wrapperBorder:{borderType:"none",border:"none",width:"1px 1px 1px 1px",position:"all",borderWidth:"1px",color:"#000000",isCustom:!0}},advanced:{"spacing-setting":{desktop:{margin:{bottom:"var(--g-s-l)"}}},editorData:{cssplaceholder:".{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}"}}}],rootOverride:{styles:{shape:{desktop:{shape:"square",shapeValue:"1/1",width:"80px",shapeLinked:!0}},borderRadius:{btrr:"999999px",bblr:"999999px",bbrr:"999999px",btlr:"999999px",radiusType:"circle"}},advanced:{"spacing-setting":{desktop:{margin:{bottom:0}}}}}},{id:"image-pre-sales-page",name:{en:"Image"},icon:{desktop:`
|
|
14
14
|
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
15
|
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
16
16
|
<circle cx="37" cy="17" r="3" fill="#D6D6D6"/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as p,getGlobalColorStateStyle as a,handleConvertBorderStyle as i,handleConvertBorderWidth as d,handleConvertBorderColor as n}from"@gem-sdk/core";import{filterTruthyObject as h}from"../../../../../helpers.js";let getWrapperStyleActive=p=>{let{preset:a,optionTypography:i,optionTypo:d,typeOfOption:n}=p,b=a?.optionBgColor,g=a?.optionTextColor,c=a?.optionBorder,s=a?.optionHasShadow,
|
|
1
|
+
import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as p,getGlobalColorStateStyle as a,handleConvertBorderStyle as i,handleConvertBorderWidth as d,handleConvertBorderColor as n}from"@gem-sdk/core";import{filterTruthyObject as h}from"../../../../../helpers.js";let getWrapperStyleActive=p=>{let{preset:a,optionTypography:i,optionTypo:d,typeOfOption:n}=p,b=a?.optionBgColor,g=a?.optionTextColor,c=a?.optionBorder,s=a?.optionHasShadow,m=a?.optionShadow,w=a?.optionRounded,x="color"===n,u="image"===n||"image_shopify"===n,S=e(d,i),v=e=>r({bg:e&&l(b?.active??b?.normal),bs:c?.active?.border,bw:c?.active?.width,bc:l(c?.active?.color)});return h({...v(!x),...t(w),...o({value:m?.active,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:s?.active},!0),...S,...!x&&!u&&r({c:l(g?.active??g?.normal)}),...r({h:a?.height})})},getWrapperStyleNormalAndHover=t=>{let{preset:l,optionTransform:b,optionTypography:g,optionTypo:c,typeOfOption:s}=t,m=l?.optionBgColor,w=l?.optionTextColor,x=l?.optionBorder,u=l?.optionHasShadow,S=l?.optionShadow,v=l?.optionRounded,y="color"===s,C="image"===s||"image_shopify"===s,W=e(c,g),f=["normal","hover"].reduce((e,t)=>({...e,...o({value:S?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:u?.[t]})}),{});return h({...p(v),...f,...!y&&a("bg",m),...!y&&i(x),...!y&&d(x),...!y&&n(x),...!y&&!C&&r({c:b}),...!y&&!C&&a("c",w),...W,...r({h:l?.height})})},getWrapperTextStyle=e=>{let{preset:t,typeOfOption:o}=e,r="color"===o,l=()=>{let e="16px",o={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return t?.width?.desktop?.toLowerCase()!=="auto"&&t?.width?.desktop||(o["--pl"]=e,o["--pr"]=e),t?.width?.tablet?.toLowerCase()!=="auto"&&t?.width?.tablet||(o["--pl-tablet"]=e,o["--pr-tablet"]=e),t?.width?.mobile?.toLowerCase()!=="auto"&&t?.width?.mobile||(o["--pl-mobile"]=e,o["--pr-mobile"]=e),(t?.height?.toLowerCase()==="auto"||t?.height)&&(o["--pt"]="8px",o["--pb"]="8px"),o};return h({...r?{}:l()})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},a=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden","--bs":o?"none":"solid",...d(e),...n(e),...p(t),...l()});return a(!!o)},getTextStyle=({optionTypo:t,optionTypography:o})=>{let r=e(t,o);return delete r["--c"],h({...r})};export{getColorStyle,getTextStyle,getWrapperStyleActive,getWrapperStyleNormalAndHover,getWrapperTextStyle};
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
import{composeClasses as s,template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as
|
|
2
|
-
${
|
|
3
|
-
<gp-product-stock-counter ${{...
|
|
4
|
-
style="${
|
|
5
|
-
<style
|
|
1
|
+
import{composeClasses as s,template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as l}from"@gem-sdk/core";import{getDynamicSourceLocales as o,getSettingPreloadData as a}from"../../helpers.js";import{getInlineCss as r,getLiquidInitData as c,getLiquidTextContent as d,getTextDisplayData as $}from"../common/helpers.js";import{getProgressBarClasses as n,getContainerClasses as p,getLiquidTagClasses as u,getWrapperIconClasses as m,getIconClasses as v,getWrapperClasses as g,getTextClasses as f}from"../common/classes.js";import{getProgressBarStyles as k,getContainerStyles as y,getWrapperStyles as S,getIconStyles as b,getTextStyles as I}from"../common/styles.js";import{getLiquidTagAttrs as O,getLiquidProgressBarAttrs as _,getLiquidTextAttrs as j,getIconAttrs as h}from"../common/attrs.js";import{createAttr as V,createClass as E,createStyle as M,LiquidIf as A}from"@gem-sdk/system";let StockCounter=({setting:C,styles:G,style:Q,advanced:R,builderProps:x,pageContext:N})=>{let{borderRadius:P}=G??{},{showIcon:T,icon:q,oosIcon:w,layout:z="full",template:B,outOfStockMessage:D,continueSelling:F,unlimitedQuantityMessage:H}=C??{},J=r(x?.uid,P),K="progress-bar"!==z,L=o({val:B,uid:x?.uid,settingId:"template",pageContext:N,translate:C?.translate,isReplaceInventoryQuantity:!0}),U=o({val:D,uid:x?.uid,settingId:"outOfStockMessage",pageContext:N,translate:C?.translate}),W=o({val:F,uid:x?.uid,settingId:"continueSelling",pageContext:N,translate:C?.translate}),X=o({val:H,uid:x?.uid,settingId:"unlimitedQuantityMessage",pageContext:N,translate:C?.translate}),Y=V({...O(x,C,G)}),Z=E({...s("gp-stock-counter-progress gp-mt-2 data-[visible=true]:gp-block data-[visible=false]:gp-hidden"),...n(G)}),ss=M({...k(G,C)}),st=M({...y(G)}),se=E({...p(C)}),si=E({...u(R)}),sl=M({...Q}),so=M({...S(G)}),sa=c(C,G),sr=d({templateStringDisplay:L,outOfStockMessageDisplay:U,continueSellingDisplay:W,unlimitedQuantityMessageDisplay:X}),sc=E({...m(C)}),sd=E({...s("gp-stock-counter-icon data-[visible=true]:gp-block data-[visible=false]:gp-hidden"),...v()}),s$=E({...g(C)}),sn=s=>M({...b(G,C,s)}),sp=({isOutOfStockIcon:s,isVisible:t})=>V({...h(s,t)}),su=V({..._()}),sm=E({...f(G),...s("gp-stock-counter-mark")}),sv=s=>M({...I(G,s)}),sg=V({...j()}),sf=$({templateStringDisplay:L,outOfStockMessageDisplay:U,continueSellingDisplay:W,unlimitedQuantityMessageDisplay:X},G);return t`
|
|
2
|
+
${sa}
|
|
3
|
+
<gp-product-stock-counter ${{...Y}} class="${si}"
|
|
4
|
+
style="${sl}">
|
|
5
|
+
<div class="${s$}" style="${so}">
|
|
6
|
+
<style>${J}</style>
|
|
6
7
|
<div
|
|
7
|
-
class="${
|
|
8
|
-
style="${
|
|
8
|
+
class="${se}"
|
|
9
|
+
style="${st}"
|
|
9
10
|
>
|
|
10
|
-
<div class="${
|
|
11
|
-
${e(
|
|
12
|
-
${
|
|
13
|
-
${{...
|
|
14
|
-
class="${
|
|
15
|
-
style="${
|
|
11
|
+
<div class="${sc}">
|
|
12
|
+
${e(T,t`
|
|
13
|
+
${A("is_out_of_stock",t`<div
|
|
14
|
+
${{...sp({isOutOfStockIcon:!0,isVisible:!0})}}
|
|
15
|
+
class="${sd}"
|
|
16
|
+
style="${sn(!0)}"
|
|
16
17
|
>
|
|
17
|
-
${
|
|
18
|
+
${w}
|
|
18
19
|
</div>
|
|
19
20
|
<div
|
|
20
|
-
${{...
|
|
21
|
+
${{...sp({isOutOfStockIcon:!1,isVisible:!1})}}
|
|
21
22
|
data-slot-type="false"
|
|
22
|
-
class="${
|
|
23
|
-
style="${
|
|
23
|
+
class="${sd}"
|
|
24
|
+
style="${sn(!1)}"
|
|
24
25
|
>
|
|
25
|
-
${
|
|
26
|
+
${q}
|
|
26
27
|
</div>`,t` <div
|
|
27
|
-
${{...
|
|
28
|
-
class="${
|
|
29
|
-
style="${
|
|
28
|
+
${{...sp({isOutOfStockIcon:!0,isVisible:!1})}}
|
|
29
|
+
class="${sd}"
|
|
30
|
+
style="${sn(!0)}"
|
|
30
31
|
>
|
|
31
|
-
${
|
|
32
|
+
${w}
|
|
32
33
|
</div>
|
|
33
34
|
<div
|
|
34
|
-
${{...
|
|
35
|
-
class="${
|
|
36
|
-
style="${
|
|
35
|
+
${{...sp({isOutOfStockIcon:!1,isVisible:!0})}}
|
|
36
|
+
class="${sd}"
|
|
37
|
+
style="${sn(!1)}"
|
|
37
38
|
>
|
|
38
|
-
${
|
|
39
|
+
${q}
|
|
39
40
|
</div>`)}
|
|
40
41
|
`)}
|
|
41
|
-
${
|
|
42
|
-
${e(
|
|
43
|
-
${
|
|
44
|
-
${{...
|
|
45
|
-
class="${
|
|
46
|
-
style="${
|
|
42
|
+
${sf}
|
|
43
|
+
${e(K,t`
|
|
44
|
+
${A("is_out_of_stock",t`<p
|
|
45
|
+
${{...sg}}
|
|
46
|
+
class="${sm}"
|
|
47
|
+
style="${sv(!0)}"
|
|
47
48
|
>
|
|
48
|
-
${
|
|
49
|
+
${sr}
|
|
49
50
|
</p>`,t`<p
|
|
50
|
-
${{...
|
|
51
|
-
class="${
|
|
52
|
-
style="${
|
|
51
|
+
${{...sg}}
|
|
52
|
+
class="${sm}"
|
|
53
|
+
style="${sv(!1)}"
|
|
53
54
|
>
|
|
54
|
-
${
|
|
55
|
+
${sr}
|
|
55
56
|
</p>`)}
|
|
56
57
|
`)}
|
|
57
58
|
|
|
58
59
|
</div>
|
|
59
60
|
|
|
60
61
|
<div
|
|
61
|
-
${{...
|
|
62
|
-
style="${
|
|
63
|
-
class="${
|
|
62
|
+
${{...su}}
|
|
63
|
+
style="${ss}"
|
|
64
|
+
class="${Z}"
|
|
64
65
|
></div>
|
|
65
66
|
</div>
|
|
67
|
+
</div>
|
|
66
68
|
</gp-product-stock-counter>
|
|
67
|
-
${e(i,`<script ${a('class="gps-link" delay',"src")}="{{ 'gp-product-stock-counter.js' | asset_url }}" defer="defer"></script>`,`<script ${a('class="gps-link" delay',"src")}="${
|
|
69
|
+
${e(i,`<script ${a('class="gps-link" delay',"src")}="{{ 'gp-product-stock-counter.js' | asset_url }}" defer="defer"></script>`,`<script ${a('class="gps-link" delay',"src")}="${l}/assets-v2/gp-product-stock-counter.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
68
70
|
`};export{StockCounter as default};
|