@gem-sdk/components 7.0.2 → 8.0.0-dev.19

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.
Files changed (51) hide show
  1. package/dist/cjs/carousel-v3/components/swiper/Swiper.js +1 -1
  2. package/dist/cjs/countdown-timer/common/helpers.js +1 -1
  3. package/dist/cjs/countdown-timer/hooks/useTimeLeft.js +1 -1
  4. package/dist/cjs/post-purchase/product/components/ProductPrice.js +1 -1
  5. package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +1 -1
  6. package/dist/cjs/post-purchase/product/hooks/useGetMoneyLines.js +1 -1
  7. package/dist/cjs/product/components/product-badge/ProductBadge.liquid.js +10 -10
  8. package/dist/cjs/product/components/product-badge/common/styles.js +1 -1
  9. package/dist/cjs/product/components/product-badge/utils/common.js +1 -1
  10. package/dist/cjs/product/components/product-badge/utils/renderBadgeLiquid.js +3 -4
  11. package/dist/cjs/product/components/product-button/hooks/useAddToCart.js +1 -1
  12. package/dist/cjs/product/components/product-discount-tag/hooks/useGpDiscountTag.js +1 -1
  13. package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
  14. package/dist/cjs/product/components/product-price/hooks/useGpPrice.js +1 -1
  15. package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +41 -0
  16. package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +66 -0
  17. package/dist/cjs/product/components/product-variants/ProductVariants.liquid.js +25 -79
  18. package/dist/cjs/product/components/product-variants/common/base/styles.js +1 -1
  19. package/dist/cjs/product/components/product-variants/common/const.js +1 -0
  20. package/dist/cjs/product/components/product-variants/components/color/color.liquid.js +3 -3
  21. package/dist/cjs/product/components/product-view-more/ProductViewMore.liquid.js +1 -1
  22. package/dist/cjs/product/components/product-view-more/common/helpers.js +1 -1
  23. package/dist/cjs/product/components/product-wrap/Product.liquid.js +12 -10
  24. package/dist/cjs/product/helpers/product-bundle.js +1 -1
  25. package/dist/cjs/third-party/settings/BonLoyaltyRewardsReferrals/index.js +1 -1
  26. package/dist/esm/carousel-v3/components/swiper/Swiper.js +1 -1
  27. package/dist/esm/countdown-timer/common/helpers.js +1 -1
  28. package/dist/esm/countdown-timer/hooks/useTimeLeft.js +1 -1
  29. package/dist/esm/post-purchase/product/components/ProductPrice.js +1 -1
  30. package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +1 -1
  31. package/dist/esm/post-purchase/product/hooks/useGetMoneyLines.js +1 -1
  32. package/dist/esm/product/components/product-badge/ProductBadge.liquid.js +21 -21
  33. package/dist/esm/product/components/product-badge/common/styles.js +1 -1
  34. package/dist/esm/product/components/product-badge/utils/common.js +1 -1
  35. package/dist/esm/product/components/product-badge/utils/renderBadgeLiquid.js +3 -4
  36. package/dist/esm/product/components/product-button/hooks/useAddToCart.js +1 -1
  37. package/dist/esm/product/components/product-discount-tag/hooks/useGpDiscountTag.js +1 -1
  38. package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
  39. package/dist/esm/product/components/product-price/hooks/useGpPrice.js +1 -1
  40. package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +41 -0
  41. package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +66 -0
  42. package/dist/esm/product/components/product-variants/ProductVariants.liquid.js +40 -94
  43. package/dist/esm/product/components/product-variants/common/base/styles.js +1 -1
  44. package/dist/esm/product/components/product-variants/common/const.js +1 -0
  45. package/dist/esm/product/components/product-variants/components/color/color.liquid.js +3 -3
  46. package/dist/esm/product/components/product-view-more/ProductViewMore.liquid.js +1 -1
  47. package/dist/esm/product/components/product-view-more/common/helpers.js +1 -1
  48. package/dist/esm/product/components/product-wrap/Product.liquid.js +33 -31
  49. package/dist/esm/product/helpers/product-bundle.js +1 -1
  50. package/dist/esm/third-party/settings/BonLoyaltyRewardsReferrals/index.js +1 -1
  51. package/package.json +4 -4
@@ -0,0 +1,66 @@
1
+ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{template as i}from"@gem-sdk/core";let renderOptionValuesOld=a=>{let{renderVariantItem:n,variantPresetsLiquid:o}=a;return i`
2
+ ${e("{%- assign optionRendered = false -%}")}
3
+ ${e("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
4
+ ${e("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
5
+
6
+ ${s("swatchesItem in swatchesItems",`
7
+ ${e('{%- assign colorArraysString = "" -%}')}
8
+ ${e('{%- assign labelsString = "" -%}')}
9
+ ${e('{%- assign imageUrlsString = "" -%}')}
10
+ ${e("{%- assign attrItems = swatchesItem | split: '($3)' -%}")}
11
+
12
+ ${s("attrItem in attrItems",`
13
+ ${e("{%- assign attrs = attrItem | split: '($2)' -%}")}
14
+ ${e("{%- assign optionKey = attrs[0] -%}")}
15
+ ${e("{%- assign optionValue = attrs[1] -%}")}
16
+ ${e(`
17
+ {% if optionKey == 'optionTitle' %}
18
+ {% assign optionTitle = optionValue %}
19
+ {% elsif optionKey == 'optionType' %}
20
+ {% assign optionType = optionValue %}
21
+ {% endif %}
22
+ `)}
23
+
24
+ ${t('optionKey == "optionValues"',`
25
+ ${e("{%- assign opValueItems = optionValue | split: '($4)' -%}")}
26
+ ${s("opValueItem in opValueItems",`
27
+ ${e("{%- assign opValueItemAttrs = opValueItem | split: '($6)' -%}")}
28
+ ${s("opValueItemAttr in opValueItemAttrs",`
29
+ ${e("{%- assign attrs = opValueItemAttr | split: '($5)' -%}")}
30
+ ${e("{%- assign opValueItemKey = attrs[0] -%}")}
31
+ ${e("{%- assign opValueItemValue = attrs[1] -%}")}
32
+
33
+ ${t('opValueItemKey == "label"',`${e("{%- assign labelsString = labelsString | append: opValueItemValue -%}")}
34
+ ${e('{%- assign labelsString = labelsString | append: "($8)" -%}')}`)}
35
+
36
+ ${t('opValueItemKey == "colors"',`${e("{%- assign colorArraysString = colorArraysString | append: opValueItemValue -%}")}
37
+ ${e('{%- assign colorArraysString = colorArraysString | append: "($8)" -%}')}`)}
38
+
39
+ ${t('opValueItemKey == "imageUrl"',`${e("{%- assign imageUrlsString = imageUrlsString | append: opValueItemValue -%}")}
40
+ ${e('{%- assign imageUrlsString = imageUrlsString | append: "($8)" -%}')}`)}
41
+ `)}
42
+ `)}
43
+ `)}
44
+ `)}
45
+
46
+ ${e("{%- assign labels = labelsString | split: '($8)' -%}")}
47
+ ${e("{%- assign colorStrings = colorArraysString | split: '($8)' -%}")}
48
+ ${e("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
49
+
50
+ ${t("optionTitle == option.name",`
51
+ ${e(`{%- assign variantPresetString = "${o}" -%}`)}
52
+ ${e('{%- assign optionName = option.name | replace: "\'", "'" | replace: \'"\', """ -%}')}
53
+ ${e("{%- assign items = variantPresetString | split:'($2)' -%}")}
54
+ ${e("{%- assign type = 'dropdown' -%}")}
55
+ ${s("item in items",`
56
+ ${e("{%- assign itemPreset = item | split:'($1)' -%}")}
57
+ ${t("itemPreset[0] == optionName",e("{%- assign type = itemPreset[1] -%}"))}
58
+ ${t('itemPreset[0] == "base"',e("{%- assign type = itemPreset[1] -%}"))}
59
+ `)}
60
+ ${e("{%- assign optionRendered = true -%}")}
61
+ ${n({showDropdown:!0})}
62
+ `)}
63
+ `)}
64
+
65
+ ${t("optionRendered == false",n({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
66
+ `};export{renderOptionValuesOld};
@@ -1,8 +1,10 @@
1
- import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as i,isLocalEnv as a,baseAssetURL as o}from"@gem-sdk/core";import n from"../../../text/components/Text.liquid.js";import r from"./components/variants/index.liquid.js";import p from"./components/dropdown-swatches/Dropdown.liquid.js";import l from"./components/dropdown-group/DropdownGroup.liquid.js";import{getSettingPreloadData as m}from"../../../helpers.js";import{mappingVariantStyles as d}from"./utils/mappingVariantStyles.js";import{createClass as c,createStyle as u,createStateOrContext as g,createAttr as $,Liquid as v,LiquidFor as f,LiquidIf as y,If as _}from"@gem-sdk/system";import{getAttrs as h}from"./common/main/getAttr.js";import{getVariantOptionGroupStyle as S,getWrapperStyle as V}from"./common/main/styles.js";import{getVariantOptionGroupClass as j,getWrapDropdownClass as I}from"./common/main/classes.js";import{getTextVariantTitleData as b,getDropdownGroupData as w}from"./common/main/getData.js";import{getWrapVariantOptionClass as A}from"./common/variants/classes.js";import{getStyleOfObject as P}from"../../helpers/function.js";import{getMarginBottomStyle as T}from"./common/variants/styles.js";let DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=N=>{let{builderProps:D,styles:x,setting:E,advanced:O}=N,{align:U,swatchItemWidth:C,dropdownItemWidth:K,swatchSpacing:q,optionTypo:k,marginBottom:F}=x??{},{label:G,optionType:J,showAsSwatches:L,layout:R,hasPreSelected:W}=E??{},z=O?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:H}=D??{},M="groupOption"===J,Q=()=>{let e={};return s.forEach(t=>{let s=i(C,t);e[t]="auto"===s}),e},Y=()=>{let e={};return s.forEach(t=>{e[t]=K?.[t]==="fill"}),e},B=e(()=>{let e=d(E?.variantPresets,x);return{...E,variantPresets:e}},[E?.variantPresets,x]),X=e=>{let t={"'":"'",'"':"""},s=e;for(let i in t)e.indexOf(i)>=0&&(s=s.replaceAll(i,t[i]));return s},Z=()=>E?.variantPresets?.map(e=>`${X(e.optionName)}($2)${e.optionType}`).join("($1)"),ee=()=>E?.variantPresets?.filter(e=>!!e?.hide)?.map(e=>e.optionName).join(","),et=c(j(U)),es=u(S(q,q)),ei=b(N,"Liquid"),ea=c(A(R,U)),eo=()=>t`
2
- ${v(`{%- assign presets = "${Z()}" | split: '($1)' -%}`)}
3
- ${v(`{% assign hiddenPresetOptions = "${ee()}" | split: ',' %}`)}
1
+ import{template as e,isLocalEnv as t,baseAssetURL as s,DEVICES as i,getResponsiveValueByScreen as o}from"@gem-sdk/core";import a from"../../../text/components/Text.liquid.js";import n from"./components/variants/index.liquid.js";import r from"./components/dropdown-swatches/Dropdown.liquid.js";import p from"./components/dropdown-group/DropdownGroup.liquid.js";import{getSettingPreloadData as l}from"../../../helpers.js";import{mappingVariantStyles as d}from"./utils/mappingVariantStyles.js";import{createClass as m,createStyle as c,createAttr as u,Liquid as f,LiquidIf as v,If as $,LiquidFor as _}from"@gem-sdk/system";import{getAttrs as g}from"./common/main/getAttr.js";import{getVariantOptionGroupStyle as h,getWrapperStyle as y}from"./common/main/styles.js";import{getVariantOptionGroupClass as j,getWrapDropdownClass as w}from"./common/main/classes.js";import{getTextVariantTitleData as S,getDropdownGroupData as A}from"./common/main/getData.js";import{getWrapVariantOptionClass as P}from"./common/variants/classes.js";import{getStyleOfObject as D}from"../../helpers/function.js";import{getMarginBottomStyle as V}from"./common/variants/styles.js";import{renderOptionValuesNewFormatSwatches as b}from"./OptionVariantsNewFormat.liquid.js";import{renderOptionValuesOld as E}from"./OptionVariantsOldFormat.liquid.js";let DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=N=>{let{builderProps:T,styles:O,setting:x,advanced:q}=N,{align:G,swatchItemWidth:C,dropdownItemWidth:F,swatchSpacing:I,optionTypo:k,marginBottom:L}=O??{},{label:J,optionType:z,showAsSwatches:M,layout:U,hasPreSelected:W}=x??{},R=q?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:Y}=T??{},H="groupOption"===z,K=()=>{let e={};return i.forEach(t=>{let s=o(C,t);e[t]="auto"===s}),e},Q=()=>{let e={};return i.forEach(t=>{e[t]=F?.[t]==="fill"}),e},B=x?.variantPresets?d(x?.variantPresets,O):[],X=B?.map(e=>({...e,presets:{[e.optionType]:e.presets[e.optionType]}})),Z={...x,variantPresetsOptionType:X},ee=e=>{let t={"'":"'",'"':"""},s=e;for(let i in t)e.indexOf(i)>=0&&(s=s.replaceAll(i,t[i]));return s},et=()=>x?.variantPresets?.map(e=>`${ee(e.optionName)}($2)${e.optionType}`).join("($1)"),es=()=>x?.variantPresets?.filter(e=>!!e?.hide)?.map(e=>e.optionName).join(","),ei=({showDropdown:t,isRenderDefault:s,typeOfOption:i})=>e`
2
+ ${_("value in values",n({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:M,uid:Y,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",typeOfOption:i,activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...O,...Z,swatchAutoWidth:K(),optionTypo:k,isRenderDefault:s}))}
3
+ ${v(t?'type == "dropdown"':"false",r({...O,...Z,swatchAutoWidth:Q(),optionTypo:k}))}`,eo=x?.variantPresets?.map(e=>({name:ee(e.optionName),type:e.optionType})).map(e=>`${e.name}($1)${e.type}`).join("($2)").toString(),ea={renderVariantItem:ei,variantPresetsLiquid:eo??""},en=m(j(G)),er=c(h(I,I)),ep=S(N,"Liquid"),el=m(P(U,G)),ed=()=>e`
4
+ ${f(`{%- assign presets = "${et()}" | split: '($1)' -%}`)}
5
+ ${f(`{% assign hiddenPresetOptions = "${es()}" | split: ',' %}`)}
4
6
 
5
- ${v(`{% assign all_option_names = options | map: 'name' %}
7
+ ${f(`{% assign all_option_names = options | map: 'name' %}
6
8
  {% assign filtered_options_string = '' %}
7
9
  {% assign delimiter = '||' %}
8
10
 
@@ -25,29 +27,29 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
25
27
 
26
28
  {% assign filtered_options_array = filtered_options_string | split: delimiter %}`)}
27
29
 
28
- ${v("{% assign last_option_name = filtered_options_array | last %}")}
30
+ ${f("{% assign last_option_name = filtered_options_array | last %}")}
29
31
 
30
- ${f("option in options",`
32
+ ${_("option in options",`
31
33
  <div
32
34
  option-name="{{option.name | escape}}"
33
- class="${ea} ${y("hiddenPresetOptions contains option.name","gp-hidden")}"
34
- style="${P(T(F))}${v("{% if forloop.last or option.name == last_option_name %}--mb:0;--mb-mobile:0;--mb-tablet:0;{% endif %}")}"
35
+ class="${el} ${v("hiddenPresetOptions contains option.name","gp-hidden")}"
36
+ style="${D(V(L))}${f("{% if forloop.last or option.name == last_option_name %}--mb:0;--mb-mobile:0;--mb-tablet:0;{% endif %}")}"
35
37
  >
36
- ${v("{%- assign showVariantClass = 'variant-display' -%}")}
37
- ${v("{%- assign optionName = option.name -%}")}
38
- ${f("preset in presets",`
39
- ${v("{%- assign presetDetail = preset | split: '($2)' -%}")}
40
- ${y("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${v("{%- assign showVariantClass = '' -%}")} ${v("{%- break -%}")}`)}
38
+ ${f("{%- assign showVariantClass = 'variant-display' -%}")}
39
+ ${f("{%- assign optionName = option.name -%}")}
40
+ ${_("preset in presets",`
41
+ ${f("{%- assign presetDetail = preset | split: '($2)' -%}")}
42
+ ${v("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${f("{%- assign showVariantClass = '' -%}")} ${f("{%- break -%}")}`)}
41
43
  `)}
42
- ${_(G,n(ei)," ")}
44
+ ${$(J,a(ep)," ")}
43
45
  <div
44
46
  variant-option-name="{{option.name | escape}}"
45
- class="${et}"
46
- style="${P(es)}"
47
+ class="${en}"
48
+ style="${D(er)}"
47
49
  >
48
- ${v("{%- assign values = option.values -%}")}
49
- ${v("{%- assign rootForloop = forloop.index0 -%}")}
50
- ${v(`
50
+ ${f("{%- assign values = option.values -%}")}
51
+ ${f("{%- assign rootForloop = forloop.index0 -%}")}
52
+ ${f(`
51
53
  {%- if option.position == 1 -%}
52
54
  {%- assign selectedValue = variant.option1 -%}
53
55
  {%- elsif option.position == 2 -%}
@@ -56,78 +58,22 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
56
58
  {%- assign selectedValue = variant.option3 -%}
57
59
  {%- endif -%}
58
60
  `)}
59
- ${_(!W,v("{%- assign selectedValue = null -%}"),"")}
60
- ${_(L,er(),ep())}
61
+ ${$(!W,f("{%- assign selectedValue = null -%}"),"")}
62
+ ${$(M,em(),ei({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
61
63
  </div>
62
64
  </div>`)}
63
- `,en=E?.variantPresets?.map(e=>({name:X(e.optionName),type:e.optionType})).map(e=>`${e.name}($1)${e.type}`).join("($2)").toString(),er=()=>t`
64
- ${v("{%- assign optionRendered = false -%}")}
65
- ${v("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
66
- ${v("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
67
-
68
- ${f("swatchesItem in swatchesItems",`
69
- ${v('{%- assign colorArraysString = "" -%}')}
70
- ${v('{%- assign labelsString = "" -%}')}
71
- ${v('{%- assign imageUrlsString = "" -%}')}
72
- ${v("{%- assign attrItems = swatchesItem | split: '($3)' -%}")}
73
-
74
- ${f("attrItem in attrItems",`${v("{%- assign attrs = attrItem | split: '($2)' -%}")}
75
- ${v("{%- assign optionKey = attrs[0] -%}")}
76
- ${v("{%- assign optionValue = attrs[1] -%}")}
77
- ${v(`
78
- {% if optionKey == 'optionTitle' %}
79
- {% assign optionTitle = optionValue %}
80
- {% elsif optionKey == 'optionType' %}
81
- {% assign optionType = optionValue %}
82
- {% endif %}
83
- `)}
84
-
85
- ${y("optionKey == 'optionValues'",`${v("{%- assign opValueItems = optionValue | split: '($4)' -%}")}
86
- ${f("opValueItem in opValueItems",`${v("{%- assign opValueItemAttrs = opValueItem | split: '($6)' -%}")}
87
- ${f("opValueItemAttr in opValueItemAttrs",`${v("{%- assign attrs = opValueItemAttr | split: '($5)' -%}")}
88
- ${v("{%- assign opValueItemKey = attrs[0] -%}")}
89
- ${v("{%- assign opValueItemValue = attrs[1] -%}")}
90
-
91
- ${y("opValueItemKey == 'label'",`${v("{%- assign labelsString = labelsString | append: opValueItemValue -%}")}${v('{%- assign labelsString = labelsString | append: "($8)" -%}')}`)}
92
-
93
- ${y("opValueItemKey == 'colors'",`${v("{%- assign colorArraysString = colorArraysString | append: opValueItemValue -%}")}${v('{%- assign colorArraysString = colorArraysString | append: "($8)" -%}')}`)}
94
-
95
- ${y("opValueItemKey == 'imageUrl'",`${v("{%- assign imageUrlsString = imageUrlsString | append: opValueItemValue -%}")}${v('{%- assign imageUrlsString = imageUrlsString | append: "($8)" -%}')}`)}`)}`)}`)}
96
- `)}
97
-
98
- ${v("{%- assign labels = labelsString | split: '($8)' -%}")}
99
- ${v("{%- assign colorStrings = colorArraysString | split: '($8)' -%}")}
100
- ${v("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
101
-
102
- ${y("optionTitle == option.name",`
103
- ${v(`{%- assign variantPresetString = "${en}" -%}`)}
104
- ${v('{%- assign optionName = option.name | replace: "\'", "&apos;" | replace: \'"\', "&quot;" -%}')}
105
- ${v("{%- assign items = variantPresetString | split:'($2)' -%}")}
106
- ${v("{%- assign type = 'dropdown' -%}")}
107
- ${f("item in items",`
108
- ${v("{%- assign itemPreset = item | split:'($1)' -%}")}
109
- ${y("itemPreset[0] == optionName",v("{%- assign type = itemPreset[1] -%}"))}
110
- ${y('itemPreset[0] == "base"',v("{%- assign type = itemPreset[1] -%}"))}
111
- `)}
112
- ${v("{%- assign optionRendered = true -%}")}
113
- ${f("value in values",r({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:L,uid:H,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",optionType:"optionType",activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...x,...B,swatchAutoWidth:Q(),optionTypo:k}))}
114
- ${y("type == 'dropdown'",p({...x,...B,swatchAutoWidth:Y(),optionTypo:k}))}
115
- `)}
116
- `)}
117
-
118
- ${y("optionRendered == false",ep())}
119
- `,ep=()=>f("value in values",r({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:L,uid:H,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",typeOfOption:"optionType",activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...x,...B,swatchAutoWidth:Q(),optionTypo:k,isRenderDefault:!0})),el=c(I(U)),em=w(N),ed=()=>`
120
- <div className="${el}">
121
- ${l(em)}
65
+ `,em=()=>e`
66
+ ${v("shop.metafields.GEMPAGES.swatches and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",b(ea),E(ea))}
67
+ `,ec=m(w(G)),eu=A(N),ef=()=>`
68
+ <div className="${ec}">
69
+ ${p(eu)}
122
70
  </div>
123
- `;g({setting:B,styles:JSON.stringify(x),variants:"{{ product.variants | json | escape }}",optionsWithValues:"{{ product.options_with_values | json | escape }}",variantSelected:"{{ variant | json | escape }}",variantInventoryQuantity:"{{ product.variants | map: 'inventory_quantity' | json | escape }}",variantInventoryPolicy:"{{ product.variants | map: 'inventory_policy' | json | escape }}",moneyFormat:"{{ shop.money_format | json | escape }}",productId:"{{ product.id | json | escape }}",productUrl:"{{ product.url | json | escape }}",productHandle:"{{ product.handle | json | escape }}",displayState:`${JSON.stringify(z)}`,totalVariantCombinations:"{{ total_combinations }}",firstAvailableVariant:"{{ product.selected_or_first_available_variant | json | escape }}"});let ec=$(h({uid:H,hasPreSelected:W,cssClass:O?.cssClass})),eu=u(V(N)),eg=c({"gp-flex gp-flex-col !gp-ml-0":!0}),e$=()=>{let e=a?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${o}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${m('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return t`
124
- ${v("{%- assign total_combinations = 1 -%}")}
125
- ${f("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
71
+ `,ev=u(g({uid:Y,hasPreSelected:W,cssClass:q?.cssClass})),e$=c(y(N)),e_=m({"gp-flex gp-flex-col !gp-ml-0":!0}),eg=()=>{let e=t?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${s}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${l('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return e`
126
72
  <gp-product-variants
127
- ${ec}
73
+ ${ev}
128
74
  gp-data='{
129
- "setting":${JSON.stringify(B)?.replaceAll("'","&#039;")},
130
- "styles":${JSON.stringify(x)},
75
+ "setting":${JSON.stringify(Z)?.replaceAll("'","&#039;")},
76
+ "styles":${JSON.stringify(O)},
131
77
  "variants":{{product.variants | json | escape}},
132
78
  "optionsWithValues": {{product.options_with_values | json | escape}},
133
79
  "variantSelected": {{ variant | json | escape }},
@@ -137,21 +83,21 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
137
83
  "productId": {{product.id | json | escape}},
138
84
  "productUrl": {{product.url | json | escape}},
139
85
  "productHandle": {{product.handle | json | escape}},
140
- "displayState": ${JSON.stringify(z)},
86
+ "displayState": ${JSON.stringify(R)},
141
87
  "totalVariantCombinations": {{total_combinations}},
142
88
  "firstAvailableVariant": {{product.selected_or_first_available_variant | json | escape}}
143
89
  }
144
90
  '>
145
91
  <div class="gp-hidden" style="--hvr-shadow: none; --hvr-shadow-tablet: none; --hvr-shadow-mobile: none"></div>
146
- ${v("{%- assign options = product.options_with_values -%}")}
147
- ${v("{%- assign variants = product.variants -%}")}
148
- ${y("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",t`<div
149
- class="${eg}"
150
- style="${eu}"
92
+ ${f("{%- assign options = product.options_with_values -%}")}
93
+ ${f("{%- assign variants = product.variants -%}")}
94
+ ${v("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",e`<div
95
+ class="${e_}"
96
+ style="${e$}"
151
97
  >
152
- ${_(M,ed(),eo())}
98
+ ${$(H,ef(),ed())}
153
99
  </div>`)}
154
100
  </gp-product-variants>
155
101
 
156
- ${e$()}
102
+ ${eg()}
157
103
  `};export{ProductVariants as default};
@@ -1 +1 @@
1
- import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as i,getGlobalColorStateStyle as p,handleConvertBorderStyle as a,handleConvertBorderWidth as n,handleConvertBorderColor as d,makeStyleResponsive as h}from"@gem-sdk/core";import{filterTruthyObject as c}from"../../../../../helpers.js";let getColorStyleWidth=e=>{let t=e?.height||"32px",o=e?.width||{desktop:t},r=Object.fromEntries(Object.entries(o).map(([e,o])=>{let r=o&&"undefined"!==o&&"auto"!==o?o:t;return[e,r]}));return h("minw",r)},getWrapperStyleActive=i=>{let{preset:p,optionTypography:a,optionTypo:n,typeOfOption:d}=i,h=p?.optionBgColor,g=p?.optionTextColor,s=p?.optionBorder,b=p?.optionHasShadow,m=p?.optionShadow,u=p?.optionRounded,w="color"===d,x="image"===d||"image_shopify"===d,y=e(n,a),S=e=>{let t=h?.active??h?.normal,o=s?.active??s?.normal;return r({bg:e&&l(t),bs:o?.border,bw:o?.width,bc:l(o?.color)})},v=m?.active??m?.normal,C=b?.active??b?.normal,f=g?.active??g?.normal;return c({...S(!w),...t(u),...o({value:v,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:C},!0),...y,...!w&&!x&&r({c:l(f)}),...w&&getColorStyleWidth(p),...r({h:p?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:t,optionTransform:l,optionTypography:h,optionTypo:g,typeOfOption:s}=e,b=t?.optionBgColor,m=t?.optionTextColor,u=t?.optionBorder,w=t?.optionHasShadow,x=t?.optionShadow,y=t?.optionRounded,S="color"===s,v="image"===s||"image_shopify"===s,C=["normal","hover"].reduce((e,t)=>({...e,...o({value:x?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:w?.[t]})}),{});return c({...i(y),...C,...!S&&p("bg",b),...!S&&a(u),...!S&&n(u),...!S&&d(u),...!S&&!v&&r({c:l}),...!S&&!v&&p("c",m),...typoStyleNotIn(g,h,["--c"]),...S&&getColorStyleWidth(t),...r({h:t?.height})})};function typoStyleNotIn(t,o,r){let l=e(t,o);return r&&0!==r.length?Object.fromEntries(Object.entries(l).filter(([e])=>!r.includes(e))):l}let getWrapperTextStyle=e=>{let{preset:o,typeOfOption:r,checked:l}=e,p=o?.optionBorder,h=o?.optionRounded,g="color"===r,s=()=>{let e="16px",t={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return o?.width?.desktop?.toLowerCase()!=="auto"&&o?.width?.desktop||(t["--pl"]=e,t["--pr"]=e),o?.width?.tablet?.toLowerCase()!=="auto"&&o?.width?.tablet||(t["--pl-tablet"]=e,t["--pr-tablet"]=e),o?.width?.mobile?.toLowerCase()!=="auto"&&o?.width?.mobile||(t["--pl-mobile"]=e,t["--pr-mobile"]=e),(o?.height?.toLowerCase()==="auto"||o?.height)&&(t["--pt"]="8px",t["--pb"]="8px"),t},b={...h,active:{...h?.active||{},radiusType:"custom"}},m=l?t(b):i(h),u=!l&&g?{...a(p),...n(p),...d(p)}:{};return c({...!g&&s(),...g&&m,...u})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},p=t=>t?{"--bs":"none"}:a(e),h=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden",...p(o),...n(e),...d(e),...i(t),...l()});return h(!!o)},getTextStyle=({optionTypo:t,optionTypography:o})=>{let r=e(t,o);return delete r["--c"],c({...r})};export{getColorStyle,getTextStyle,getWrapperStyleActive,getWrapperStyleNormalAndHover,getWrapperTextStyle};
1
+ import{composeTypographyStyle as e,getRadiusStyleActiveState as t,getStyleShadow as o,makeStyle as r,getSingleColorVariable as l,composeRadius as i,getGlobalColorStateStyle as p,handleConvertBorderStyle as a,handleConvertBorderWidth as n,handleConvertBorderColor as d,makeStyleResponsive as h}from"@gem-sdk/core";import{filterTruthyObject as c}from"../../../../../helpers.js";let getColorStyleWidth=e=>{let t=e?.height||"32px",o=e?.width||{desktop:t},r=Object.fromEntries(Object.entries(o).map(([e,o])=>{let r=o&&"undefined"!==o&&"auto"!==o?o:t;return[e,r]}));return h("minw",r)},getWrapperStyleActive=i=>{let{preset:p,optionTypography:a,optionTypo:n,typeOfOption:d}=i,h=p?.optionBgColor,s=p?.optionTextColor,g=p?.optionBorder,b=p?.optionHasShadow,m=p?.optionShadow,u=p?.optionRounded,w="color"===d,x="image"===d||"image_shopify"===d,y=e(n,a),S=e=>{let t=h?.active??h?.normal,o=g?.active??g?.normal;return r({bg:e&&l(t),bs:o?.border,bw:o?.width,bc:l(o?.color)})},v=m?.active??m?.normal,C=b?.active??b?.normal,f=s?.active??s?.normal;return c({...S(!w),...t(u),...o({value:v,state:"active",styleAppliedFor:"box-shadow",isEnableShadow:C},!0),...y,...!w&&!x&&r({c:l(f)}),...w&&getColorStyleWidth(p),...r({h:p?.height})})},getWrapperStyleNormalAndHover=e=>{let{preset:t,optionTransform:l,optionTypography:h,optionTypo:s,typeOfOption:g}=e,b=t?.optionBgColor,m=t?.optionTextColor,u=t?.optionBorder,w=t?.optionHasShadow,x=t?.optionShadow,y=t?.optionRounded,S="color"===g,v="image"===g||"image_shopify"===g,C=["normal","hover"].reduce((e,t)=>({...e,...o({value:x?.[t],state:t,styleAppliedFor:"box-shadow",isEnableShadow:w?.[t]})}),{});return c({...i(y),...C,...!S&&p("bg",b),...!S&&a(u),...!S&&n(u),...!S&&d(u),...!S&&!v&&r({c:l}),...!S&&!v&&p("c",m),...typoStyleNotIn(s,h,["--c"]),...S&&getColorStyleWidth(t),...r({h:t?.height})})};function typoStyleNotIn(t,o,r){let l=e(t,o);return r&&0!==r.length?Object.fromEntries(Object.entries(l).filter(([e])=>!r.includes(e))):l}let getWrapperTextStyle=e=>{let{preset:o,typeOfOption:r,checked:l}=e,p=o?.optionBorder,h=o?.optionRounded,s="color"===r,g=()=>{let e="16px",t={"--pl":"0px","--pr":"0px","--pl-tablet":"0px","--pr-tablet":"0px","--pl-mobile":"0px","--pr-mobile":"0px","--pt":"0px","--pb":"0px"};return o?.width?.desktop?.toLowerCase()!=="auto"&&o?.width?.desktop||(t["--pl"]=e,t["--pr"]=e),o?.width?.tablet?.toLowerCase()!=="auto"&&o?.width?.tablet||(t["--pl-tablet"]=e,t["--pr-tablet"]=e),o?.width?.mobile?.toLowerCase()!=="auto"&&o?.width?.mobile||(t["--pl-mobile"]=e,t["--pr-mobile"]=e),(o?.height?.toLowerCase()==="auto"||o?.height)&&(t["--pt"]="8px",t["--pb"]="8px"),t},b={...h,active:{...h?.active||{},radiusType:"custom"}},m=l?t(b):i(h),u=!l&&s?{...a(p),...n(p),...d(p)}:{};return c({...!s&&g(),...s&&m,...u})},getColorStyle=({optionBorder:e,optionRounded:t,isActive:o,color:r})=>{let l=()=>r?r?.startsWith("linear-gradient")?{backgroundImage:r}:{backgroundColor:r}:{},p=t=>t?{"--bs":"none"}:a(e),h=o=>({"--d":"flex","--jc":"center"," --ai":"center","--w":"100%","--h":"100%","--of":"hidden","--hvr-c":"unset",...p(o),...n(e),...d(e),...i(t),...l()});return h(!!o)},getTextStyle=({optionTypo:t,optionTypography:o})=>{let r=e(t,o);return delete r["--c"],c({...r})};export{getColorStyle,getTextStyle,getWrapperStyleActive,getWrapperStyleNormalAndHover,getWrapperTextStyle};
@@ -0,0 +1 @@
1
+ let OPTION_VALUES_DELIMITER="|||";export{OPTION_VALUES_DELIMITER};
@@ -1,4 +1,4 @@
1
- import{template as o}from"@gem-sdk/core";import l from"../base/base.liquid.js";import{optionRoundedColorDefault as r}from"../../utils/mappingVariantStyles.js";let ColorVariant=({isVariantOutStock:i,swatchValue:s,...n})=>o`
1
+ import{template as o}from"@gem-sdk/core";import r from"../base/base.liquid.js";import{optionRoundedColorDefault as l}from"../../utils/mappingVariantStyles.js";import{OPTION_VALUES_DELIMITER as i}from"../../common/const.js";let ColorVariant=({isVariantOutStock:s,swatchValue:n,...t})=>o`
2
2
  {% assign colorsString = null %}
3
3
  {% assign colors = null %}
4
4
  {% for label in labels %}
@@ -7,7 +7,7 @@ import{template as o}from"@gem-sdk/core";import l from"../base/base.liquid.js";i
7
7
  {% endif %}
8
8
  {% endfor %}
9
9
  {% if colorsString != null %}
10
- {% assign colors = colorsString | split: '($7)' %}
10
+ {% assign colors = colorsString | split: '${i}' %}
11
11
  {% endif %}
12
- ${l({...n,typeOfOption:"color",optionRounded:r})}
12
+ ${r({...t,typeOfOption:"color",optionRounded:l})}
13
13
  `;export{ColorVariant as default};
@@ -1,6 +1,6 @@
1
1
  import{If as e}from"@gem-sdk/system";import{getButtonStyle as r}from"./common/styles.js";import{getSettingPreloadData as s}from"../../../helpers.js";import o from"../../../button/components/Button.liquid.js";import{template as t,isLocalEnv as m,baseAssetURL as p}from"@gem-sdk/core";import{getButtonSettings as i,getButtonLiquidSettings as d}from"./common/helpers.js";let ProductViewMore=({style:c,styles:l,setting:a,advanced:u,builderProps:f,builderAttrs:n,pageContext:v})=>t`
2
2
  <gp-product-view-more>
3
- ${o({styles:l,advanced:u,builderProps:f,builderAttrs:n,setting:{...i(a),...d(a)},style:{...r(c,l)},pageContext:v,className:"btn-view-more"})}
3
+ ${o({styles:l,advanced:u,builderProps:f,builderAttrs:n,setting:{...i(a),...d(a,v)},style:{...r(c,l)},pageContext:v,className:"btn-view-more"})}
4
4
  ${e(m,`<script ${s('class="gps-link" delay',"src")}="{{ 'gp-product-view-more-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${s('class="gps-link" delay',"src")}="${p}/assets-v2/gp-product-view-more-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
5
5
  </gp-product-view-more>
6
6
  `;export{ProductViewMore as default};
@@ -1 +1 @@
1
- let getButtonSettings=t=>{let{label:e,iconSvg:n,iconAlign:i,iconVisible:u,shouldClearSpace:g,enableHoverEffect:l}=t??{};return{label:e,iconSvg:n,iconAlign:i,iconVisible:u,shouldClearSpace:g,htmlType:"submit",enableHoverEffect:l}},getButtonLiquidSettings=t=>{let{translate:e,redirectNewTab:n}=t??{};return{translate:e,btnLink:{link:"{{ product.url }}",target:n?"_blank":"_self"},enableBtnLink:!0}};export{getButtonLiquidSettings,getButtonSettings};
1
+ let getButtonSettings=t=>{let{label:e,iconSvg:n,iconAlign:l,iconVisible:i,shouldClearSpace:u,enableHoverEffect:o}=t??{};return{label:e,iconSvg:n,iconAlign:l,iconVisible:i,shouldClearSpace:u,htmlType:"submit",enableHoverEffect:o}},getButtonLiquidSettings=(t,e)=>{let{translate:n,redirectNewTab:l}=t??{},i=e?.hasCollectionHandle?"{% if collection %}{{ collection.url }}{{ product.url }}{% else %}{{ product.url }}{% endif %}":"{{ product.url }}";return{translate:n,btnLink:{link:i,target:l?"_blank":"_self"},enableBtnLink:!0}};export{getButtonLiquidSettings,getButtonSettings};
@@ -1,14 +1,14 @@
1
- import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import o from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as a,If as d}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as p,STATIC_PRODUCT_STATUS as l,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let Product=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:I}=g??{},{rowSetting:S,rowStyles:b,formatVariantId:j,formatProductId:h,productStatus:q,preSelectedOptionIds:V,productHandle:P,advancedStyle:k}=c(f),w=()=>t`
1
+ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as o}from"@gem-sdk/core";import r from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as a,If as n,Liquid as d,LiquidFor as s}from"@gem-sdk/system";import{getSettingPreloadData as c,getStaticLocale as p}from"../../../helpers.js";import{getData as l,DYNAMIC_PRODUCT_STATUS as u,STATIC_PRODUCT_STATUS as f,PRODUCT_ID_LATEST as m}from"./common/helpers.js";let Product=g=>{let{children:_,setting:v,style:y,builderProps:$,rawChildren:b,advanced:I}=g,{isSyncProduct:S}=v??{},{rowSetting:j,rowStyles:h,formatVariantId:q,formatProductId:V,productStatus:P,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=l(g),x=()=>t`
2
2
  {%- liquid
3
3
  if request.page_type == 'product'
4
- if '${q}' == '${l}'
5
- if '${h}' == '${u}'
4
+ if '${P}' == '${f}'
5
+ if '${V}' == '${m}'
6
6
  paginate collections.all.products by 100000
7
7
  assign product = collections.all.products | sort: 'created_at' | reverse | first
8
8
  endpaginate
9
9
  else
10
- assign product = all_products['${P}']
11
- assign productId = '${h}' | times: 1
10
+ assign product = all_products['${w}']
11
+ assign productId = '${V}' | times: 1
12
12
  if product == empty or product == null
13
13
  paginate collections.all.products by 100000
14
14
  for item in collections.all.products
@@ -21,13 +21,13 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
21
21
  endif
22
22
  endif
23
23
  else
24
- if '${h}' == '${u}'
24
+ if '${V}' == '${m}'
25
25
  paginate collections.all.products by 100000
26
26
  assign product = collections.all.products | sort: 'created_at'| reverse | first
27
27
  endpaginate
28
28
  else
29
- assign product = all_products['${P}']
30
- assign productId = '${h}' | times: 1
29
+ assign product = all_products['${w}']
30
+ assign productId = '${V}' | times: 1
31
31
  if product == empty or product == null
32
32
  paginate collections.all.products by 100000
33
33
  for item in collections.all.products
@@ -40,11 +40,11 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
40
40
  endif
41
41
  endif
42
42
  -%}
43
- `,E=()=>t`
43
+ `,A=()=>t`
44
44
  {%- liquid
45
45
  if request.page_type != 'product'
46
- assign product = all_products['${P}']
47
- assign productId = '${h}' | times: 1
46
+ assign product = all_products['${w}']
47
+ assign productId = '${V}' | times: 1
48
48
  if product == empty or product == null
49
49
  paginate collections.all.products by 100000
50
50
  for item in collections.all.products
@@ -56,30 +56,32 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
56
56
  endif
57
57
  endif
58
58
  -%}
59
- `,x=()=>t`
59
+ `,B=()=>t`
60
60
  {%- assign gpBkProduct = product -%}
61
- ${d(q==p,E(),w())}
62
- `,A=()=>t`
63
- {%- assign initVariantId = ${j} -%}
64
- {%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
65
- ${j?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
66
- ${j?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
61
+ ${n(P==u,A(),x())}
62
+ `,G=()=>t`
63
+ ${d("{%- assign total_combinations = 1 -%}")}
64
+ ${s("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
65
+ {%- assign initVariantId = ${q} -%}
66
+ {%- assign product_form_id = 'product-form-' | append: "${$?.uid}" -%}
67
+ ${q?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
68
+ ${q?"{%- assign productSelectedVariant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign productSelectedVariant = product.selected_or_first_available_variant -%}"}
67
69
  {%-if productSelectedVariant == empty or productSelectedVariant == null -%}
68
70
  {%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
69
71
  {%- endif -%}
70
72
  {%-if variant == empty or variant == null -%}
71
73
  {%- assign variant = product.selected_or_first_available_variant -%}
72
74
  {%- endif -%}
73
- `,B=()=>t`
74
- <div class="gp-text-center">${s("Product","product_not_found")}</div>
75
- `,G=()=>t`
76
- ${A()}
75
+ `,H=()=>t`
76
+ <div class="gp-text-center">${p("Product","product_not_found")}</div>
77
+ `,O=()=>t`
78
+ ${G()}
77
79
  <gp-product
78
- data-uid="${v?.uid}"
79
- data-id="${v?.uid}"
80
- style="${k}"
81
- class="${$?.cssClass}"
82
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${V}], "isSyncProduct": "${I}", "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
80
+ data-uid="${$?.uid}"
81
+ data-id="${$?.uid}"
82
+ style="${E}"
83
+ class="${I?.cssClass}"
84
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
83
85
  gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}'
84
86
  >
85
87
  <product-form class="product-form">
@@ -87,13 +89,13 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
87
89
  <input type="hidden" name="id" value="{{ variant.id }}" />
88
90
  <input type="hidden" name="quantity" value="{{ quantity }}" />
89
91
  <button type="submit" onclick="return false;" style="display:none;"></button>
90
- ${o({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:b,setting:S,children:m,rawChildren:_})}
92
+ ${r({builderProps:{...$,uid:$?.uid,uidInteraction:`${$?.uid}-row`},style:y,styles:h,setting:j,children:_,rawChildren:b})}
91
93
  {%- endform -%}
92
94
  </product-form>
93
95
  </gp-product>
94
96
  {%- assign product = gpBkProduct -%}
95
97
  `;return t`
96
- ${x()}
97
- ${a("product != empty and product != null",G(),B())}
98
- ${e(i,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
98
+ ${B()}
99
+ ${a("product != empty and product != null",O(),H())}
100
+ ${e(i,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
99
101
  `};export{Product as default};
@@ -1 +1 @@
1
- import{formatMoney as t}from"@gem-sdk/core";import{DiscountType as e}from"../components/constants/product-bundle.js";let noDiscount=e=>({discountPercentAmount:0,discountAmount:t("0",e)}),applyBundleDiscountAmount=n=>{let{currentVariant:o,bundleItem:u,options:c}=n;if(!c?.useProductCompareAtPrice&&u?.discountType===e.NoDiscount||!u||!o?.price)return noDiscount(c?.moneyFormat||"${{amount}}");let r=Number(o?.price),i=Number(o?.salePrice)||r,a=Number(u?.quantity),m=calculateBundleFixedDiscount(r,u),s=discountPercentAmount(m,a*r),d=r*a-m,l=i*a;return i<=r&&m<=0?noDiscount(c?.moneyFormat||"${{amount}}"):{discountPercentAmount:c?.useProductCompareAtPrice?calculateDiffPercentPrice(d,l):s,discountAmount:c?.useProductCompareAtPrice?calculateDiffFixedPrice(d,l,c?.moneyFormat):t(m.toString(),c?.moneyFormat)}},calculateDiffPercentPrice=(t,e)=>{let n=(e-t)/e*100;return Math.round(n)},calculateDiffFixedPrice=(e,n,o)=>t((n-e).toString(),o),calculateBundleFixedDiscount=(t,n)=>{let o=parseInt(n?.discountValue);return n?.discountType===e.Percentage?t*n.quantity*o/100:n?.discountType===e.FixedAmount?o:0},discountPercentAmount=(t,e)=>Math.round(t/e*100);export{applyBundleDiscountAmount};
1
+ import{convertDecimalToNumber as t,formatMoney as e}from"@gem-sdk/core";import{DiscountType as n}from"../components/constants/product-bundle.js";let noDiscount=t=>({discountPercentAmount:0,discountAmount:e("0",t)}),applyBundleDiscountAmount=o=>{let{currentVariant:u,bundleItem:c,options:r}=o;if(!r?.useProductCompareAtPrice&&c?.discountType===n.NoDiscount||!c||!u?.price)return noDiscount(r?.moneyFormat||"${{amount}}");let i=t(u?.price)??0,a=t(u?.salePrice)??i,m=Number(c?.quantity),s=calculateBundleFixedDiscount(i,c),d=discountPercentAmount(s,m*i),l=i*m-s,p=a*m;return a<=i&&s<=0?noDiscount(r?.moneyFormat||"${{amount}}"):{discountPercentAmount:r?.useProductCompareAtPrice?calculateDiffPercentPrice(l,p):d,discountAmount:r?.useProductCompareAtPrice?calculateDiffFixedPrice(l,p,r?.moneyFormat):e(s.toString(),r?.moneyFormat)}},calculateDiffPercentPrice=(t,e)=>{let n=(e-t)/e*100;return Math.round(n)},calculateDiffFixedPrice=(t,n,o)=>e((n-t).toString(),o),calculateBundleFixedDiscount=(t,e)=>{let o=parseInt(e?.discountValue);return e?.discountType===n.Percentage?t*e.quantity*o/100:e?.discountType===n.FixedAmount?o:0},discountPercentAmount=(t,e)=>Math.round(t/e*100);export{applyBundleDiscountAmount};
@@ -1,4 +1,4 @@
1
1
  import e from"../../configs/BonLoyaltyRewardsReferrals.js";import l from"./uiV1.js";import a from"./uiV2.js";import{get3rdPartyInstallLink as t}from"../../common/helpers.js";let config={tag:e.tag,label:e.label,icon:'<img class="gp-w-[24px] gp-border gp-border-[#494949] gp-rounded-[3px]" src="https://cdn.shopify.com/app-store/listing_images/f367f56199c88dba9296f532dfc5b383/icon/CLS4vPSugoUDEAE=.jpeg?width=22&height=22">',editorConfigs:{component:{isThirdParty:!0}},presets:[{id:e.id,name:{en:e.label},hideTextContent:!0,icon:{desktop:`<div class="w-full flex flex-col items-center">
2
2
  <img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/f367f56199c88dba9296f532dfc5b383/icon/CLS4vPSugoUDEAE=.jpeg?width=22&height=22">
3
3
  <span class="preset-item-title">BON: Loyalty Rewards Referrals</span>
4
- </div>`},components:[{tag:e.tag}]}],settings:[{id:"setting",controls:[{id:"appBlockId",type:"input",default:""},{id:"widgetType",label:"Choose widget",type:"select",options:[{label:"Loyalty Page Block",value:"loyalty-page-block"},{label:"Loyalty Page Earning Block",value:"loyalty-page-earning-block"},{label:"Loyalty Page Header Block",value:"loyalty-page-header-block"},{label:"Loyalty Page Profile Block",value:"loyalty-page-profile-block"},{label:"Loyalty Page Redeem Block",value:"loyalty-page-redeem-block"},{label:"Loyalty Page Referral Block",value:"loyalty-page-referral-block"},{label:"Loyalty Page Tier Block",value:"loyalty-page-tier-block"},{label:"Product Point Review",value:"product-point-preview"},{label:"Point On Product Page",value:"product-point-preview"}],default:"loyalty-page-block"},{id:"install",type:"open-link",target:"_blank",linkType:"install",href:t({handle:"bon-loyalty-rewards-referrals"}),appName:e.label},{id:"openApp",type:"open-link",target:"_blank",linkType:"openApp",href:"https://admin.shopify.com/?redirect=/apps/bon-loyalty",appName:e.label},{id:"align",label:"Alignment",type:"segment",options:[{label:"Left",value:"left",type:"align"},{label:"Center",value:"center",type:"align"},{label:"Right",value:"right",type:"align"}],devices:{desktop:{default:"left"}}}]}],ui:l,uiV2:a};export{config as default};
4
+ </div>`},components:[{tag:e.tag}]}],settings:[{id:"setting",controls:[{id:"appBlockId",type:"input",default:""},{id:"widgetType",label:"Choose widget",type:"select",options:[{label:"Loyalty Page Block",value:"loyalty-page-block"},{label:"Loyalty Page Earning Block",value:"loyalty-page-earning-block"},{label:"Loyalty Page Header Block",value:"loyalty-page-header-block"},{label:"Loyalty Page Profile Block",value:"loyalty-page-profile-block"},{label:"Loyalty Page Redeem Block",value:"loyalty-page-redeem-block"},{label:"Loyalty Page Referral Block",value:"loyalty-page-referral-block"},{label:"Loyalty Page Tier Block",value:"loyalty-page-tier-block"},{label:"Product Point Review",value:"product-point-preview"},{label:"Point On Product Page",value:"product-point-preview"},{label:"Ways to redeem points",value:"bloy-loyalty-ways-redeem"}],default:"loyalty-page-block"},{id:"install",type:"open-link",target:"_blank",linkType:"install",href:t({handle:"bon-loyalty-rewards-referrals"}),appName:e.label},{id:"openApp",type:"open-link",target:"_blank",linkType:"openApp",href:"https://admin.shopify.com/?redirect=/apps/bon-loyalty",appName:e.label},{id:"align",label:"Alignment",type:"segment",options:[{label:"Left",value:"left",type:"align"},{label:"Center",value:"center",type:"align"},{label:"Right",value:"right",type:"align"}],devices:{desktop:{default:"left"}}}]}],ui:l,uiV2:a};export{config as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "7.0.2",
3
+ "version": "8.0.0-dev.19",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,9 +26,9 @@
26
26
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "7.0.0",
30
- "@gem-sdk/styles": "7.0.0",
31
- "@gem-sdk/system": "7.0.0",
29
+ "@gem-sdk/core": "8.0.0-dev.19",
30
+ "@gem-sdk/styles": "7.0.1-dev.6",
31
+ "@gem-sdk/system": "7.0.1-dev.6",
32
32
  "@types/react-transition-group": "^4.4.12",
33
33
  "tsup": "^8.5.0",
34
34
  "postcss-import": "^16.1.1",