@gem-sdk/components 8.0.0-staging.9 → 8.0.1

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,14 +1,16 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styles=require("./common/styles.js"),helpers$1=require("./common/helpers.js"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("../../../helpers.js"),getButtonDynamicSourceLocales=require("./helpers/getButtonDynamicSourceLocales.js"),SoldOutButton_liquid=require("./SoldOutButton.liquid.js"),AddToCartButton_liquid=require("./AddToCartButton.liquid.js");const ProductButton=t=>{let{setting:e,builderProps:r,style:s,styles:o,pageContext:a}=t,{wrapStyle:l,restStyle:u}=styles.getSplitStyle(s),{outOfStockButtonLabel:i,unavailableButtonLabel:n,variantSelectionRequiredMessage:c}=getButtonDynamicSourceLocales.getButtonDynamicSourceLocales({setting:e,pageContext:a,builderProps:r}),{urlData:d}=helpers.getInsertLinkData("",e?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:e?.customURL),p=system.createStateOrContext(helpers$1.getGPProductButtonState(o,e)),g=()=>AddToCartButton_liquid.AddToCartButton({...t,style:u}),y=()=>SoldOutButton_liquid.SoldOutButton({...t,style:u,label:i}),S=()=>system.If(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var styles=require("./common/styles.js"),helpers$1=require("./common/helpers.js"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("../../../helpers.js"),getButtonDynamicSourceLocales=require("./helpers/getButtonDynamicSourceLocales.js"),SoldOutButton_liquid=require("./SoldOutButton.liquid.js"),AddToCartButton_liquid=require("./AddToCartButton.liquid.js");const ProductButton=t=>{let{setting:e,builderProps:s,style:r,styles:o,pageContext:a}=t,{wrapStyle:i,restStyle:l}=styles.getSplitStyle(r),{outOfStockButtonLabel:u,unavailableButtonLabel:n,variantSelectionRequiredMessage:c}=getButtonDynamicSourceLocales.getButtonDynamicSourceLocales({setting:e,pageContext:a,builderProps:s}),{urlData:d}=helpers.getInsertLinkData("",e?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:e?.customURL),p=system.createStateOrContext(helpers$1.getGPProductButtonState(o,e)),g=()=>AddToCartButton_liquid.AddToCartButton({...t,style:l}),y=()=>SoldOutButton_liquid.SoldOutButton({...t,style:l,label:u}),m=()=>system.If(core.isLocalEnv,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return core.template`
2
+ ${system.Liquid("{%- assign total_combinations = 1 -%}")}
3
+ ${system.LiquidFor("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
2
4
  {%- liquid
3
5
  assign inventory_quantity = variant.inventory_quantity | default: 0
4
6
  assign is_in_stock = variant.available
5
7
  -%}
6
8
  <gp-product-button
7
- style="${l}"
9
+ style="${i}"
8
10
  gp-data-wrapper="true"
9
11
  gp-href="${d.href}"
10
12
  class="gp-product-button"
11
- gp-label-out-of-stock="${i}"
13
+ gp-label-out-of-stock="${u}"
12
14
  gp-label-unavailable="${n}"
13
15
  gp-data='${JSON.stringify(p).replaceAll("'","&#039;")}'
14
16
  data-variant-selection-required-message="${c}"
@@ -16,5 +18,5 @@
16
18
  ${g()}
17
19
  ${y()}
18
20
  </gp-product-button>
19
- ${S()}
21
+ ${m()}
20
22
  `};exports.default=ProductButton;
@@ -13,7 +13,7 @@
13
13
  {% else %}
14
14
  ${_()}
15
15
  {% endcase %}
16
- `,f=()=>Modal3d_liquid.default({src:system.LiquidIf("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:n}),y=()=>Video_liquid.default({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:n}),h=()=>{let e=system.createStyle({...productFeaturedImage.getVideoHeight(a?.ftLayout),...core.makeStyleResponsive("objf",a?.ftLayout)}),t=system.createStyle({...productFeaturedImage.getVideoHeight(a?.ftLayout)});return HTML5Embed_liquid.default({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:t,style:{width:"100%","max-height":"100%",...e},className:"gp-invisible"})},I=()=>core.template`
16
+ `,f=()=>Modal3d_liquid.default({src:system.LiquidIf("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:n}),y=()=>Video_liquid.default({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:n}),h=()=>{let e=system.createStyle({...productFeaturedImage.getVideoHeight(a?.ftLayout),...core.makeStyleResponsive("objf",a?.ftLayout)}),t=system.createStyle({...productFeaturedImage.getVideoHeight(a?.ftLayout)});return HTML5Embed_liquid.default({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:t,poster:{altText:"{{featureMedia.alt | escape}}"},style:{width:"100%","max-height":"100%",...e},className:"gp-invisible"})},I=()=>core.template`
17
17
  ${q(core.cls("gp-w-full gp-transition-opacity",{"group-hover:gp-opacity-0":"other"==a.hoverEffect},"{{shouldHidden}}"))}
18
18
  ${system.If(a?.hoverEffect!=="none",`<div class="${core.cls("zoom-element !gp-max-w-none",productFeaturedImage.getZoomImageClass())}">
19
19
  ${q("image-zoom",!0)}
@@ -56,19 +56,19 @@
56
56
  ${M()}`)}
57
57
  `,NextImage_liquid.default({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:a?.preload,setting:{layout:a?.ftLayout,aspectRatio:n,qualityType:a?.qualityType,qualityPercent:a?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none",customLazyload:!0,enableLazyLoadImage:i})),L=()=>`
58
58
  ${Carousel_liquid.default({builderProps:{uid:e},rootId:`ft-${e}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:$,rootClass:`${s}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:c,rootStyles:o,styles:u,style:{playSpeed:600},disableMarginAuto:!0,children:w,productBadgeLiquid:t||""})}
59
- `,S=()=>{switch(a?.preDisplay){case"1st-images":return`
59
+ `,x=()=>{switch(a?.preDisplay){case"1st-images":return`
60
60
  {% assign featureMedia = product.media.first %}
61
61
  `;case"1st-3d-mode":return system.LiquidFor("media in product.media",system.LiquidIf("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return system.LiquidFor("media in product.media",system.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
62
62
  {% assign featureMedia = variant.featured_media %}
63
63
  {% unless featureMedia %}
64
64
  {% assign featureMedia = product.featured_media %}
65
65
  {% endunless %}
66
- `}},x=()=>system.Liquid(`
66
+ `}},S=()=>system.Liquid(`
67
67
  {% assign featureMedia = variant.featured_media %}
68
68
  {% unless featureMedia %}
69
69
  {% assign featureMedia = product.featured_media %}
70
70
  {% endunless %}
71
- ${system.LiquidIf("product.media.size > 1",S())}
71
+ ${system.LiquidIf("product.media.size > 1",x())}
72
72
  {% assign largestRatio = 0 %}
73
73
  {% assign height = featureMedia.height | times: 1.0 %}
74
74
  {% assign width = featureMedia.width | times: 1.0 %}
@@ -109,7 +109,7 @@
109
109
  </div>
110
110
  `);return system.Liquid(`
111
111
  {% capture featureImageOnlyOne %}
112
- ${x()}
112
+ ${S()}
113
113
  {% endcapture %}
114
114
  ${system.LiquidIf("product.media.size > 1",`
115
115
  ${system.If(v,L()," ")}
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Text_liquid=require("../../../text/components/Text.liquid.js"),index_liquid=require("./components/variants/index.liquid.js"),Dropdown_liquid=require("./components/dropdown-swatches/Dropdown.liquid.js"),DropdownGroup_liquid=require("./components/dropdown-group/DropdownGroup.liquid.js"),helpers=require("../../../helpers.js"),mappingVariantStyles=require("./utils/mappingVariantStyles.js"),system=require("@gem-sdk/system"),getAttr=require("./common/main/getAttr.js"),styles=require("./common/main/styles.js"),classes=require("./common/main/classes.js"),getData=require("./common/main/getData.js"),classes$1=require("./common/variants/classes.js"),_function=require("../../helpers/function.js"),styles$1=require("./common/variants/styles.js");const DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=e=>{let{builderProps:s,styles:t,setting:i,advanced:a}=e,{align:o,swatchItemWidth:n,dropdownItemWidth:r,swatchSpacing:l,optionTypo:p,marginBottom:d}=t??{},{label:u,optionType:m,showAsSwatches:c,layout:y,hasPreSelected:g}=i??{},$=a?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:v}=s??{},q="groupOption"===m,f=()=>{let e={};return core.DEVICES.forEach(s=>{let t=core.getResponsiveValueByScreen(n,s);e[s]="auto"===t}),e},_=()=>{let e={};return core.DEVICES.forEach(s=>{e[s]=r?.[s]==="fill"}),e},L=core.composeMemo(()=>{let e=mappingVariantStyles.mappingVariantStyles(i?.variantPresets,t);return{...i,variantPresets:e}},[i?.variantPresets,t]),S=e=>{let s={"'":"&apos;",'"':"&quot;"},t=e;for(let i in s)e.indexOf(i)>=0&&(t=t.replaceAll(i,s[i]));return t},I=()=>i?.variantPresets?.map(e=>`${S(e.optionName)}($2)${e.optionType}`).join("($1)"),V=()=>i?.variantPresets?.filter(e=>!!e?.hide)?.map(e=>e.optionName).join(","),h=system.createClass(classes.getVariantOptionGroupClass(o)),j=system.createStyle(styles.getVariantOptionGroupStyle(l,l)),w=getData.getTextVariantTitleData(e,"Liquid"),A=system.createClass(classes$1.getWrapVariantOptionClass(y,o)),b=()=>core.template`
2
- ${system.Liquid(`{%- assign presets = "${I()}" | split: '($1)' -%}`)}
3
- ${system.Liquid(`{% assign hiddenPresetOptions = "${V()}" | split: ',' %}`)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Text_liquid=require("../../../text/components/Text.liquid.js"),index_liquid=require("./components/variants/index.liquid.js"),Dropdown_liquid=require("./components/dropdown-swatches/Dropdown.liquid.js"),DropdownGroup_liquid=require("./components/dropdown-group/DropdownGroup.liquid.js"),helpers=require("../../../helpers.js"),mappingVariantStyles=require("./utils/mappingVariantStyles.js"),system=require("@gem-sdk/system"),getAttr=require("./common/main/getAttr.js"),styles=require("./common/main/styles.js"),classes=require("./common/main/classes.js"),getData=require("./common/main/getData.js"),classes$1=require("./common/variants/classes.js"),_function=require("../../helpers/function.js"),styles$1=require("./common/variants/styles.js");const DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=e=>{let{builderProps:s,styles:t,setting:i,advanced:a}=e,{align:o,swatchItemWidth:n,dropdownItemWidth:r,swatchSpacing:l,optionTypo:p,marginBottom:d}=t??{},{label:u,optionType:m,showAsSwatches:c,layout:y,hasPreSelected:g}=i??{},$=a?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:v}=s??{},q="groupOption"===m,f=()=>{let e={};return core.DEVICES.forEach(s=>{let t=core.getResponsiveValueByScreen(n,s);e[s]="auto"===t}),e},_=()=>{let e={};return core.DEVICES.forEach(s=>{e[s]=r?.[s]==="fill"}),e},L=core.composeMemo(()=>{let e=mappingVariantStyles.mappingVariantStyles(i?.variantPresets,t);return{...i,variantPresets:e}},[i?.variantPresets,t]),S=e=>{let s={"'":"&apos;",'"':"&quot;"},t=e;for(let i in s)e.indexOf(i)>=0&&(t=t.replaceAll(i,s[i]));return t},h=()=>i?.variantPresets?.map(e=>`${S(e.optionName)}($2)${e.optionType}`).join("($1)"),I=()=>i?.variantPresets?.filter(e=>!!e?.hide)?.map(e=>e.optionName).join(","),V=system.createClass(classes.getVariantOptionGroupClass(o)),j=system.createStyle(styles.getVariantOptionGroupStyle(l,l)),w=getData.getTextVariantTitleData(e,"Liquid"),b=system.createClass(classes$1.getWrapVariantOptionClass(y,o)),A=()=>core.template`
2
+ ${system.Liquid(`{%- assign presets = "${h()}" | split: '($1)' -%}`)}
3
+ ${system.Liquid(`{% assign hiddenPresetOptions = "${I()}" | split: ',' %}`)}
4
4
 
5
5
  ${system.Liquid(`{% assign all_option_names = options | map: 'name' %}
6
6
  {% assign filtered_options_string = '' %}
@@ -30,7 +30,7 @@
30
30
  ${system.LiquidFor("option in options",`
31
31
  <div
32
32
  option-name="{{option.name | escape}}"
33
- class="${A} ${system.LiquidIf("hiddenPresetOptions contains option.name","gp-hidden")}"
33
+ class="${b} ${system.LiquidIf("hiddenPresetOptions contains option.name","gp-hidden")}"
34
34
  style="${_function.getStyleOfObject(styles$1.getMarginBottomStyle(d))}${system.Liquid("{% if forloop.last or option.name == last_option_name %}--mb:0;--mb-mobile:0;--mb-tablet:0;{% endif %}")}"
35
35
  >
36
36
  ${system.Liquid("{%- assign showVariantClass = 'variant-display' -%}")}
@@ -42,7 +42,7 @@
42
42
  ${system.If(u,Text_liquid.default(w)," ")}
43
43
  <div
44
44
  variant-option-name="{{option.name | escape}}"
45
- class="${h}"
45
+ class="${V}"
46
46
  style="${_function.getStyleOfObject(j)}"
47
47
  >
48
48
  ${system.Liquid("{%- assign values = option.values -%}")}
@@ -121,6 +121,8 @@
121
121
  ${DropdownGroup_liquid.default(O)}
122
122
  </div>
123
123
  `;system.createStateOrContext({setting:L,styles:JSON.stringify(t),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($)}`,totalVariantCombinations:"{{ total_combinations }}",firstAvailableVariant:"{{ product.selected_or_first_available_variant | json | escape }}"});let E=system.createAttr(getAttr.getAttrs({uid:v,hasPreSelected:g,cssClass:a?.cssClass})),N=system.createStyle(styles.getWrapperStyle(e)),F=system.createClass({"gp-flex gp-flex-col !gp-ml-0":!0}),U=()=>{let e=core.isLocalEnv?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return core.template`
124
+ ${system.Liquid("{%- assign total_combinations = 1 -%}")}
125
+ ${system.LiquidFor("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
124
126
  <gp-product-variants
125
127
  ${E}
126
128
  gp-data='{
@@ -147,7 +149,7 @@
147
149
  class="${F}"
148
150
  style="${N}"
149
151
  >
150
- ${system.If(q,C(),b())}
152
+ ${system.If(q,C(),A())}
151
153
  </div>`)}
152
154
  </gp-product-variants>
153
155
 
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:i,style:r,builderProps:a,rawChildren:o,advanced:s}=e,{isSyncProduct:d}=i??{},{rowSetting:n,rowStyles:c,formatVariantId:l,formatProductId:p,productStatus:u,preSelectedOptionIds:f,productHandle:m,advancedStyle:g}=helpers.getData(e),_=()=>core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:d}=e,{isSyncProduct:s}=r??{},{rowSetting:n,rowStyles:c,formatVariantId:l,formatProductId:p,productStatus:u,preSelectedOptionIds:f,productHandle:g,advancedStyle:m}=helpers.getData(e),_=()=>core.template`
2
2
  {%- liquid
3
3
  if request.page_type == 'product'
4
4
  if '${u}' == '${helpers.STATIC_PRODUCT_STATUS}'
@@ -7,7 +7,7 @@
7
7
  assign product = collections.all.products | sort: 'created_at' | reverse | first
8
8
  endpaginate
9
9
  else
10
- assign product = all_products['${m}']
10
+ assign product = all_products['${g}']
11
11
  assign productId = '${p}' | times: 1
12
12
  if product == empty or product == null
13
13
  paginate collections.all.products by 100000
@@ -26,7 +26,7 @@
26
26
  assign product = collections.all.products | sort: 'created_at'| reverse | first
27
27
  endpaginate
28
28
  else
29
- assign product = all_products['${m}']
29
+ assign product = all_products['${g}']
30
30
  assign productId = '${p}' | times: 1
31
31
  if product == empty or product == null
32
32
  paginate collections.all.products by 100000
@@ -43,7 +43,7 @@
43
43
  `,y=()=>core.template`
44
44
  {%- liquid
45
45
  if request.page_type != 'product'
46
- assign product = all_products['${m}']
46
+ assign product = all_products['${g}']
47
47
  assign productId = '${p}' | times: 1
48
48
  if product == empty or product == null
49
49
  paginate collections.all.products by 100000
@@ -60,8 +60,6 @@
60
60
  {%- assign gpBkProduct = product -%}
61
61
  ${system.If(u==helpers.DYNAMIC_PRODUCT_STATUS,y(),_())}
62
62
  `,$=()=>core.template`
63
- ${system.Liquid("{%- assign total_combinations = 1 -%}")}
64
- ${system.LiquidFor("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
65
63
  {%- assign initVariantId = ${l} -%}
66
64
  {%- assign product_form_id = 'product-form-' | append: "${a?.uid}" -%}
67
65
  ${l?"{%- assign variant = product.variants | where: 'id', initVariantId | first -%}":"{%- assign variant = product.selected_or_first_available_variant -%}"}
@@ -74,14 +72,14 @@
74
72
  {%- endif -%}
75
73
  `,S=()=>core.template`
76
74
  <div class="gp-text-center">${helpers$1.getStaticLocale("Product","product_not_found")}</div>
77
- `,h=()=>core.template`
75
+ `,I=()=>core.template`
78
76
  ${$()}
79
77
  <gp-product
80
78
  data-uid="${a?.uid}"
81
79
  data-id="${a?.uid}"
82
- style="${g}"
83
- class="${s?.cssClass}"
84
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${f}], "isSyncProduct": "${d}", "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
+ style="${m}"
81
+ class="${d?.cssClass}"
82
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${f}], "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 }}" }'
85
83
  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 }}}'
86
84
  >
87
85
  <product-form class="product-form">
@@ -89,13 +87,13 @@
89
87
  <input type="hidden" name="id" value="{{ variant.id }}" />
90
88
  <input type="hidden" name="quantity" value="{{ quantity }}" />
91
89
  <button type="submit" onclick="return false;" style="display:none;"></button>
92
- ${Row_liquid.default({builderProps:{...a,uid:a?.uid,uidInteraction:`${a?.uid}-row`},style:r,styles:c,setting:n,children:t,rawChildren:o})}
90
+ ${Row_liquid.default({builderProps:{...a,uid:a?.uid,uidInteraction:`${a?.uid}-row`},style:i,styles:c,setting:n,children:t,rawChildren:o})}
93
91
  {%- endform -%}
94
92
  </product-form>
95
93
  </gp-product>
96
94
  {%- assign product = gpBkProduct -%}
97
95
  `;return core.template`
98
96
  ${v()}
99
- ${system.LiquidIf("product != empty and product != null",h(),S())}
97
+ ${system.LiquidIf("product != empty and product != null",I(),S())}
100
98
  ${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
101
99
  `};exports.default=Product;
@@ -1,4 +1,4 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var BonLoyaltyRewardsReferrals=require("../../configs/BonLoyaltyRewardsReferrals.js"),uiV1=require("./uiV1.js"),uiV2=require("./uiV2.js"),helpers=require("../../common/helpers.js");const config={tag:BonLoyaltyRewardsReferrals.default.tag,label:BonLoyaltyRewardsReferrals.default.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:BonLoyaltyRewardsReferrals.default.id,name:{en:BonLoyaltyRewardsReferrals.default.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:BonLoyaltyRewardsReferrals.default.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:helpers.get3rdPartyInstallLink({handle:"bon-loyalty-rewards-referrals"}),appName:BonLoyaltyRewardsReferrals.default.label},{id:"openApp",type:"open-link",target:"_blank",linkType:"openApp",href:"https://admin.shopify.com/?redirect=/apps/bon-loyalty",appName:BonLoyaltyRewardsReferrals.default.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:uiV1.default,uiV2:uiV2.default};exports.default=config;
4
+ </div>`},components:[{tag:BonLoyaltyRewardsReferrals.default.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:helpers.get3rdPartyInstallLink({handle:"bon-loyalty-rewards-referrals"}),appName:BonLoyaltyRewardsReferrals.default.label},{id:"openApp",type:"open-link",target:"_blank",linkType:"openApp",href:"https://admin.shopify.com/?redirect=/apps/bon-loyalty",appName:BonLoyaltyRewardsReferrals.default.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:uiV1.default,uiV2:uiV2.default};exports.default=config;
@@ -1,20 +1,22 @@
1
- import{getSplitStyle as t}from"./common/styles.js";import{getGPProductButtonState as r}from"./common/helpers.js";import{template as e,isLocalEnv as s,baseAssetURL as o}from"@gem-sdk/core";import{createStateOrContext as a,If as i}from"@gem-sdk/system";import{getInsertLinkData as l,getSettingPreloadData as p}from"../../../helpers.js";import{getButtonDynamicSourceLocales as n}from"./helpers/getButtonDynamicSourceLocales.js";import{SoldOutButton as u}from"./SoldOutButton.liquid.js";import{AddToCartButton as c}from"./AddToCartButton.liquid.js";let ProductButton=d=>{let{setting:m,builderProps:f,style:g,styles:y,pageContext:$}=d,{wrapStyle:v,restStyle:b}=t(g),{outOfStockButtonLabel:j,unavailableButtonLabel:S,variantSelectionRequiredMessage:k}=n({setting:m,pageContext:$,builderProps:f}),{urlData:_}=l("",m?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:m?.customURL),h=a(r(y,m)),q=()=>c({...d,style:b}),B=()=>u({...d,style:b,label:j}),E=()=>i(s,`<script ${p('class="gps-link" delay',"src")}="{{ 'gp-product-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${p('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return e`
1
+ import{getSplitStyle as t}from"./common/styles.js";import{getGPProductButtonState as o}from"./common/helpers.js";import{template as s,isLocalEnv as e,baseAssetURL as r}from"@gem-sdk/core";import{createStateOrContext as a,Liquid as i,LiquidFor as l,If as n}from"@gem-sdk/system";import{getInsertLinkData as p,getSettingPreloadData as u}from"../../../helpers.js";import{getButtonDynamicSourceLocales as c}from"./helpers/getButtonDynamicSourceLocales.js";import{SoldOutButton as m}from"./SoldOutButton.liquid.js";import{AddToCartButton as d}from"./AddToCartButton.liquid.js";let ProductButton=f=>{let{setting:g,builderProps:$,style:b,styles:v,pageContext:y}=f,{wrapStyle:_,restStyle:j}=t(b),{outOfStockButtonLabel:S,unavailableButtonLabel:h,variantSelectionRequiredMessage:k}=c({setting:g,pageContext:y,builderProps:$}),{urlData:q}=p("",g?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:g?.customURL),B=a(o(v,g)),E=()=>d({...f,style:j}),A=()=>m({...f,style:j,label:S}),w=()=>n(e,`<script ${u('class="gps-link" delay',"src")}="{{ 'gp-product-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${u('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return s`
2
+ ${i("{%- assign total_combinations = 1 -%}")}
3
+ ${l("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
2
4
  {%- liquid
3
5
  assign inventory_quantity = variant.inventory_quantity | default: 0
4
6
  assign is_in_stock = variant.available
5
7
  -%}
6
8
  <gp-product-button
7
- style="${v}"
9
+ style="${_}"
8
10
  gp-data-wrapper="true"
9
- gp-href="${_.href}"
11
+ gp-href="${q.href}"
10
12
  class="gp-product-button"
11
- gp-label-out-of-stock="${j}"
12
- gp-label-unavailable="${S}"
13
- gp-data='${JSON.stringify(h).replaceAll("'","&#039;")}'
13
+ gp-label-out-of-stock="${S}"
14
+ gp-label-unavailable="${h}"
15
+ gp-data='${JSON.stringify(B).replaceAll("'","&#039;")}'
14
16
  data-variant-selection-required-message="${k}"
15
17
  >
16
- ${q()}
17
- ${B()}
18
+ ${E()}
19
+ ${A()}
18
20
  </gp-product-button>
19
- ${E()}
21
+ ${w()}
20
22
  `};export{ProductButton as default};
@@ -1,4 +1,4 @@
1
- import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getVideoHeight as o,getZoomImageClass as u,getZoomLenClass as l}from"../../common/productFeaturedImage.js";import m from"../../../../../video/components/HTML5Embed.liquid.js";import g from"../../../../../image/components/Modal3d.liquid.js";import p from"../../../../../image/components/NextImage.liquid.js";import n from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as c}from"../../../../helpers/function.js";import{getProductImagesStyles as f}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as h}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as y}from"../../composables/getProductImagesAttr.js";import{LiquidIf as M,LiquidFor as b,Liquid as $,If as _,createStyle as v}from"@gem-sdk/system";import w from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import I from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";let FeatureImageWithGallery=({builderPropUID:x,children:q,enableLazyLoadImage:j,...z})=>{let{featuredImageCarouselClasses:S,galleryItemClasses:L,featuredCarouselItemClasses:P}=h({...z,builderProps:{uid:x}}),{featuredImageCarouselStyle:R,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:C,featureImageOnlyOneImageStyle:T,featureImageCarouselItemStyle:N}=f(z),{featuredImageCarouselSettingAttrs:k}=y(z),E=t(z.ftShape),O=()=>`
1
+ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getVideoHeight as o,getZoomImageClass as u,getZoomLenClass as l}from"../../common/productFeaturedImage.js";import m from"../../../../../video/components/HTML5Embed.liquid.js";import p from"../../../../../image/components/Modal3d.liquid.js";import g from"../../../../../image/components/NextImage.liquid.js";import n from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as c}from"../../../../helpers/function.js";import{getProductImagesStyles as f}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as h}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as y}from"../../composables/getProductImagesAttr.js";import{LiquidIf as M,LiquidFor as b,Liquid as $,If as _,createStyle as v}from"@gem-sdk/system";import w from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import I from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";let FeatureImageWithGallery=({builderPropUID:x,children:q,enableLazyLoadImage:j,...z})=>{let{featuredImageCarouselClasses:S,galleryItemClasses:L,featuredCarouselItemClasses:P}=h({...z,builderProps:{uid:x}}),{featuredImageCarouselStyle:R,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:T,featureImageOnlyOneImageStyle:C,featureImageCarouselItemStyle:N}=f(z),{featuredImageCarouselSettingAttrs:k}=y(z),E=t(z.ftShape),O=()=>`
2
2
  {% case featureMedia.media_type %}
3
3
  {% when 'image' %}
4
4
  ${F()}
@@ -13,7 +13,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
13
13
  {% else %}
14
14
  ${G()}
15
15
  {% endcase %}
16
- `,A=()=>g({src:M("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:E}),D=()=>n({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:E}),V=()=>{let a=v({...o(z?.ftLayout),...e("objf",z?.ftLayout)}),i=v({...o(z?.ftLayout)});return m({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:i,style:{width:"100%","max-height":"100%",...a},className:"gp-invisible"})},F=()=>a`
16
+ `,A=()=>p({src:M("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:E}),D=()=>n({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:E}),V=()=>{let a=v({...o(z?.ftLayout),...e("objf",z?.ftLayout)}),i=v({...o(z?.ftLayout)});return m({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:i,poster:{altText:"{{featureMedia.alt | escape}}"},style:{width:"100%","max-height":"100%",...a},className:"gp-invisible"})},F=()=>a`
17
17
  ${H(i("gp-w-full gp-transition-opacity",{"group-hover:gp-opacity-0":"other"==z.hoverEffect},"{{shouldHidden}}"))}
18
18
  ${_(z?.hoverEffect!=="none",`<div class="${i("zoom-element !gp-max-w-none",u())}">
19
19
  ${H("image-zoom",!0)}
@@ -29,8 +29,8 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
29
29
  {% assign otherImage = product.media[other_image_index] %}
30
30
  ${M("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
31
31
  `)}
32
- ${p({srcIsLiquidCode:!0,src:M("src != null",s("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:M("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${s("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e??""}`,enableLazyLoadImage:j})}`,G=()=>a`
33
- ${p({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none",enableLazyLoadImage:j})}`,B=r(z.ftShape),J=a=>`
32
+ ${g({srcIsLiquidCode:!0,src:M("src != null",s("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:M("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${s("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e??""}`,enableLazyLoadImage:j})}`,G=()=>a`
33
+ ${g({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},priority:z?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none",enableLazyLoadImage:j})}`,B=r(z.ftShape),J=a=>`
34
34
  ${$(`{% assign productImageWidth = 0 %}
35
35
  {% case featureMedia.media_type %}
36
36
  {% when 'image' %}
@@ -54,7 +54,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
54
54
  `)}
55
55
  ${b("featureMedia in product.media",`${M("featureMedia.media_type == 'image'",`${b("image in product.images",M("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
56
56
  ${J()}`)}
57
- `,p({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:z?.preload,setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none",customLazyload:!0,enableLazyLoadImage:j})),X=()=>`
57
+ `,g({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:z?.preload,setting:{layout:z?.ftLayout,aspectRatio:E,qualityType:z?.qualityType,qualityPercent:z?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none",customLazyload:!0,enableLazyLoadImage:j})),X=()=>`
58
58
  ${w({builderProps:{uid:x},rootId:`ft-${x}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:Q,rootClass:`${S}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:k,rootStyles:W,styles:R,style:{playSpeed:600},disableMarginAuto:!0,children:U,productBadgeLiquid:q||""})}
59
59
  `,Y=()=>{switch(z?.preDisplay){case"1st-images":return`
60
60
  {% assign featureMedia = product.media.first %}
@@ -88,7 +88,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
88
88
  >
89
89
  <div
90
90
  class="gp-relative"
91
- style="${c(T)}"
91
+ style="${c(C)}"
92
92
  >
93
93
  ${q}
94
94
  <div
@@ -96,7 +96,7 @@ import{makeStyleResponsive as e,template as a,cls as i}from"@gem-sdk/core";impor
96
96
  product-id="{{product.id}}"
97
97
  product-media="{{product.media.size}}"
98
98
  class="${P(Q)}"
99
- style="${c(C)}"
99
+ style="${c(T)}"
100
100
  >
101
101
  <div
102
102
  class="gp-w-full gp-relative ${M("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
@@ -1,4 +1,4 @@
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 d}from"../../../helpers.js";import{mappingVariantStyles as m}from"./utils/mappingVariantStyles.js";import{createClass as c,createStyle as u,createStateOrContext as g,createAttr as $,Liquid as v,LiquidIf as f,If as y,LiquidFor 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 A,getDropdownGroupData as w}from"./common/main/getData.js";import{getWrapVariantOptionClass as b}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=m(E?.variantPresets,x);return{...E,variantPresets:e}},[E?.variantPresets,x]),X=e=>{let t={"'":"&apos;",'"':"&quot;"},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=A(N,"Liquid"),ea=c(b(R,U)),eo=()=>t`
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={"'":"&apos;",'"':"&quot;"},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
2
  ${v(`{%- assign presets = "${Z()}" | split: '($1)' -%}`)}
3
3
  ${v(`{% assign hiddenPresetOptions = "${ee()}" | split: ',' %}`)}
4
4
 
@@ -27,19 +27,19 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
27
27
 
28
28
  ${v("{% assign last_option_name = filtered_options_array | last %}")}
29
29
 
30
- ${_("option in options",`
30
+ ${f("option in options",`
31
31
  <div
32
32
  option-name="{{option.name | escape}}"
33
- class="${ea} ${f("hiddenPresetOptions contains option.name","gp-hidden")}"
33
+ class="${ea} ${y("hiddenPresetOptions contains option.name","gp-hidden")}"
34
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
35
  >
36
36
  ${v("{%- assign showVariantClass = 'variant-display' -%}")}
37
37
  ${v("{%- assign optionName = option.name -%}")}
38
- ${_("preset in presets",`
38
+ ${f("preset in presets",`
39
39
  ${v("{%- assign presetDetail = preset | split: '($2)' -%}")}
40
- ${f("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${v("{%- assign showVariantClass = '' -%}")} ${v("{%- break -%}")}`)}
40
+ ${y("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${v("{%- assign showVariantClass = '' -%}")} ${v("{%- break -%}")}`)}
41
41
  `)}
42
- ${y(G,n(ei)," ")}
42
+ ${_(G,n(ei)," ")}
43
43
  <div
44
44
  variant-option-name="{{option.name | escape}}"
45
45
  class="${et}"
@@ -56,8 +56,8 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
56
56
  {%- assign selectedValue = variant.option3 -%}
57
57
  {%- endif -%}
58
58
  `)}
59
- ${y(!W,v("{%- assign selectedValue = null -%}"),"")}
60
- ${y(L,er(),ep())}
59
+ ${_(!W,v("{%- assign selectedValue = null -%}"),"")}
60
+ ${_(L,er(),ep())}
61
61
  </div>
62
62
  </div>`)}
63
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`
@@ -65,13 +65,13 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
65
65
  ${v("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
66
66
  ${v("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
67
67
 
68
- ${_("swatchesItem in swatchesItems",`
68
+ ${f("swatchesItem in swatchesItems",`
69
69
  ${v('{%- assign colorArraysString = "" -%}')}
70
70
  ${v('{%- assign labelsString = "" -%}')}
71
71
  ${v('{%- assign imageUrlsString = "" -%}')}
72
72
  ${v("{%- assign attrItems = swatchesItem | split: '($3)' -%}")}
73
73
 
74
- ${_("attrItem in attrItems",`${v("{%- assign attrs = attrItem | split: '($2)' -%}")}
74
+ ${f("attrItem in attrItems",`${v("{%- assign attrs = attrItem | split: '($2)' -%}")}
75
75
  ${v("{%- assign optionKey = attrs[0] -%}")}
76
76
  ${v("{%- assign optionValue = attrs[1] -%}")}
77
77
  ${v(`
@@ -82,45 +82,47 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
82
82
  {% endif %}
83
83
  `)}
84
84
 
85
- ${f("optionKey == 'optionValues'",`${v("{%- assign opValueItems = optionValue | split: '($4)' -%}")}
86
- ${_("opValueItem in opValueItems",`${v("{%- assign opValueItemAttrs = opValueItem | split: '($6)' -%}")}
87
- ${_("opValueItemAttr in opValueItemAttrs",`${v("{%- assign attrs = opValueItemAttr | split: '($5)' -%}")}
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
88
  ${v("{%- assign opValueItemKey = attrs[0] -%}")}
89
89
  ${v("{%- assign opValueItemValue = attrs[1] -%}")}
90
90
 
91
- ${f("opValueItemKey == 'label'",`${v("{%- assign labelsString = labelsString | append: opValueItemValue -%}")}${v('{%- assign labelsString = labelsString | append: "($8)" -%}')}`)}
91
+ ${y("opValueItemKey == 'label'",`${v("{%- assign labelsString = labelsString | append: opValueItemValue -%}")}${v('{%- assign labelsString = labelsString | append: "($8)" -%}')}`)}
92
92
 
93
- ${f("opValueItemKey == 'colors'",`${v("{%- assign colorArraysString = colorArraysString | append: opValueItemValue -%}")}${v('{%- assign colorArraysString = colorArraysString | append: "($8)" -%}')}`)}
93
+ ${y("opValueItemKey == 'colors'",`${v("{%- assign colorArraysString = colorArraysString | append: opValueItemValue -%}")}${v('{%- assign colorArraysString = colorArraysString | append: "($8)" -%}')}`)}
94
94
 
95
- ${f("opValueItemKey == 'imageUrl'",`${v("{%- assign imageUrlsString = imageUrlsString | append: opValueItemValue -%}")}${v('{%- assign imageUrlsString = imageUrlsString | append: "($8)" -%}')}`)}`)}`)}`)}
95
+ ${y("opValueItemKey == 'imageUrl'",`${v("{%- assign imageUrlsString = imageUrlsString | append: opValueItemValue -%}")}${v('{%- assign imageUrlsString = imageUrlsString | append: "($8)" -%}')}`)}`)}`)}`)}
96
96
  `)}
97
97
 
98
98
  ${v("{%- assign labels = labelsString | split: '($8)' -%}")}
99
99
  ${v("{%- assign colorStrings = colorArraysString | split: '($8)' -%}")}
100
100
  ${v("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
101
101
 
102
- ${f("optionTitle == option.name",`
102
+ ${y("optionTitle == option.name",`
103
103
  ${v(`{%- assign variantPresetString = "${en}" -%}`)}
104
104
  ${v('{%- assign optionName = option.name | replace: "\'", "&apos;" | replace: \'"\', "&quot;" -%}')}
105
105
  ${v("{%- assign items = variantPresetString | split:'($2)' -%}")}
106
106
  ${v("{%- assign type = 'dropdown' -%}")}
107
- ${_("item in items",`
107
+ ${f("item in items",`
108
108
  ${v("{%- assign itemPreset = item | split:'($1)' -%}")}
109
- ${f("itemPreset[0] == optionName",v("{%- assign type = itemPreset[1] -%}"))}
110
- ${f('itemPreset[0] == "base"',v("{%- assign type = itemPreset[1] -%}"))}
109
+ ${y("itemPreset[0] == optionName",v("{%- assign type = itemPreset[1] -%}"))}
110
+ ${y('itemPreset[0] == "base"',v("{%- assign type = itemPreset[1] -%}"))}
111
111
  `)}
112
112
  ${v("{%- assign optionRendered = true -%}")}
113
- ${_("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
- ${f("type == 'dropdown'",p({...x,...B,swatchAutoWidth:Y(),optionTypo:k}))}
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
115
  `)}
116
116
  `)}
117
117
 
118
- ${f("optionRendered == false",ep())}
119
- `,ep=()=>_("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)),ed=w(N),em=()=>`
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
120
  <div className="${el}">
121
- ${l(ed)}
121
+ ${l(em)}
122
122
  </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 ${d('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return t`
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 -%}")}
124
126
  <gp-product-variants
125
127
  ${ec}
126
128
  gp-data='{
@@ -143,11 +145,11 @@ import{composeMemo as e,template as t,DEVICES as s,getResponsiveValueByScreen as
143
145
  <div class="gp-hidden" style="--hvr-shadow: none; --hvr-shadow-tablet: none; --hvr-shadow-mobile: none"></div>
144
146
  ${v("{%- assign options = product.options_with_values -%}")}
145
147
  ${v("{%- assign variants = product.variants -%}")}
146
- ${f("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
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
147
149
  class="${eg}"
148
150
  style="${eu}"
149
151
  >
150
- ${y(M,em(),eo())}
152
+ ${_(M,ed(),eo())}
151
153
  </div>`)}
152
154
  </gp-product-variants>
153
155
 
@@ -1,14 +1,14 @@
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`
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`
2
2
  {%- liquid
3
3
  if request.page_type == 'product'
4
- if '${P}' == '${f}'
5
- if '${V}' == '${m}'
4
+ if '${q}' == '${l}'
5
+ if '${h}' == '${u}'
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['${w}']
11
- assign productId = '${V}' | times: 1
10
+ assign product = all_products['${P}']
11
+ assign productId = '${h}' | 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 o}from"@gem-s
21
21
  endif
22
22
  endif
23
23
  else
24
- if '${V}' == '${m}'
24
+ if '${h}' == '${u}'
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['${w}']
30
- assign productId = '${V}' | times: 1
29
+ assign product = all_products['${P}']
30
+ assign productId = '${h}' | 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 o}from"@gem-s
40
40
  endif
41
41
  endif
42
42
  -%}
43
- `,A=()=>t`
43
+ `,E=()=>t`
44
44
  {%- liquid
45
45
  if request.page_type != 'product'
46
- assign product = all_products['${w}']
47
- assign productId = '${V}' | times: 1
46
+ assign product = all_products['${P}']
47
+ assign productId = '${h}' | 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,32 +56,30 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as o}from"@gem-s
56
56
  endif
57
57
  endif
58
58
  -%}
59
- `,B=()=>t`
59
+ `,x=()=>t`
60
60
  {%- assign gpBkProduct = product -%}
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 -%}"}
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 -%}"}
69
67
  {%-if productSelectedVariant == empty or productSelectedVariant == null -%}
70
68
  {%- assign productSelectedVariant = product.selected_or_first_available_variant -%}
71
69
  {%- endif -%}
72
70
  {%-if variant == empty or variant == null -%}
73
71
  {%- assign variant = product.selected_or_first_available_variant -%}
74
72
  {%- endif -%}
75
- `,H=()=>t`
76
- <div class="gp-text-center">${p("Product","product_not_found")}</div>
77
- `,O=()=>t`
78
- ${G()}
73
+ `,B=()=>t`
74
+ <div class="gp-text-center">${s("Product","product_not_found")}</div>
75
+ `,G=()=>t`
76
+ ${A()}
79
77
  <gp-product
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 }}" }'
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 }}" }'
85
83
  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 }}}'
86
84
  >
87
85
  <product-form class="product-form">
@@ -89,13 +87,13 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as o}from"@gem-s
89
87
  <input type="hidden" name="id" value="{{ variant.id }}" />
90
88
  <input type="hidden" name="quantity" value="{{ quantity }}" />
91
89
  <button type="submit" onclick="return false;" style="display:none;"></button>
92
- ${r({builderProps:{...$,uid:$?.uid,uidInteraction:`${$?.uid}-row`},style:y,styles:h,setting:j,children:_,rawChildren:b})}
90
+ ${o({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:b,setting:S,children:m,rawChildren:_})}
93
91
  {%- endform -%}
94
92
  </product-form>
95
93
  </gp-product>
96
94
  {%- assign product = gpBkProduct -%}
97
95
  `;return t`
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>`)}
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>`)}
101
99
  `};export{Product as default};
@@ -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"},{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};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "8.0.0-staging.9",
3
+ "version": "8.0.1",
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": "8.0.0-staging.8",
30
- "@gem-sdk/styles": "7.0.1-staging.0",
31
- "@gem-sdk/system": "7.0.1-staging.0",
29
+ "@gem-sdk/core": "8.0.1",
30
+ "@gem-sdk/styles": "7.0.0",
31
+ "@gem-sdk/system": "7.0.0",
32
32
  "@types/react-transition-group": "^4.4.12",
33
33
  "tsup": "^8.5.0",
34
34
  "postcss-import": "^16.1.1",