@gem-sdk/components 19.0.0-dev.21 → 19.0.0-dev.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/post-purchase/product/components/ProductTitle.js +1 -1
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +14 -16
- package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
- package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/dist/esm/post-purchase/product/components/ProductTitle.js +1 -1
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +26 -28
- package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
- package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("../../text/components/Text.js");exports.default=({setting:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("../../text/components/Text.js");const s=e=>e?`<p>${e}</p>`:e;exports.default=({setting:i,builderProps:d,styles:u})=>{let o=t.useProduct(),c=o?.baseID?.replace("gid://shopify/Product/","");return e.jsx("div",{id:`shopify-text-element-${d?.uid}`,"data-product-id":c,children:e.jsx(r.default,{styles:u,setting:{...i,text:s(o?.title)}})})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/common.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("./common/common.js"),r=require("./components/feature-gallery/FeatureImageWithGallery.liquid.js"),i=require("./components/gallery-carousel/GalleryCarousel.liquid.js"),s=require("./components/gallery-grid/GalleryGrid.liquid.js"),a=require("../../../helpers.js"),o=require("./common/productGallery.js"),l=require("./composables/getProductImagesClassName.js"),d=require("./composables/getProductImagesStyles.js"),u=require("@gem-sdk/system"),p=require("./common/getBorderActiveCss.js"),n=require("../../helpers/function.js");exports.default=c=>{let g=t.setDefaultWhenUndefineSetting(c),{setting:m,styles:f,builderProps:y,style:$}=g,{rawChildren:S,pageContext:I}=c,{enableLazyLoadImage:h}=I??{},q={...m,...f},v=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(y?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(a.filterPageContext(I))},
|
|
@@ -9,35 +9,33 @@
|
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,j=u.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:C,isRenderGalleryGrid:F}=t.getConditionRenderGalleryImages(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`};return e.template`
|
|
17
|
-
${u.If(m?.borderActive?.border!=="none",u.LiquidIf("product.media.size > 1",`<style>${p.getBorderActiveCss({settings:v,uid:y?.uid,type:"Liquid"})}</style>`),"")}
|
|
12
|
+
`,j=u.createAttr({"section-id":"{{section.id}}","data-id":`${y?.uid}`}),{isOnlyFeatureAllDevices:C,isRenderGalleryGrid:F}=t.getConditionRenderGalleryImages(q?.position,m?.type),L=F?{}:u.createAttr({"data-only-image":u.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:P,productImagesGalleryClasses:O}=l.getProductImagesClassName(c),D=u.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),b=u.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:G,wrapContainerStyleOnlyOneImage:z,galleryImageStyle:A}=d.getProductImagesStyles(q),N=o.getShapeByLayout({shape:q.shape,shapeForBottom:q.shapeForBottom,shapeFor1Col:q.shapeFor1Col,shapeFor2Col:q.shapeFor2Col,shapeForFtOnly:q.shapeForFtOnly,shapeForInsideBottom:q.shapeForInsideBottom??o.sizeSettingDefaultForNewLayout,shapeForInside:q.shapeForInside??o.sizeSettingDefaultForNewLayout},q.position),_=t.getStyleInsideLayout(q.position,N,q?.spacing),B=()=>e.template`
|
|
13
|
+
${e.WrapRenderChildren({uid:y?.uid||"",customProps:S?.[0].customProps},S?.map(t=>{if(t)return e.template`${e.RenderChildren({...t,isInsideProductImage:!0,imageData:{imageShape:f?.ftShape,imageAlign:f?.align,imageLayout:f?.position},dotData:{dotSize:m?.ftDotSize,dotGapToCarousel:m?.ftDotGapToCarousel,dotStyle:m?.ftDotStyle}})}`}))}
|
|
14
|
+
`;return e.template`
|
|
15
|
+
${u.If(m?.borderActive?.border!=="none",u.LiquidIf("product.media.size > 1",`<style>${p.getBorderActiveCss({settings:q,uid:y?.uid,type:"Liquid"})}</style>`),"")}
|
|
18
16
|
${u.Liquid(`
|
|
19
17
|
{% assign featured_image = product.featured_image %}
|
|
20
18
|
${u.LiquidIf("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
21
19
|
`)}
|
|
22
20
|
<gp-product-images-v3
|
|
23
|
-
gp-data='${
|
|
21
|
+
gp-data='${v}'
|
|
24
22
|
${{...j}}
|
|
25
23
|
style="${{...$}}"
|
|
26
24
|
class="${P}"
|
|
27
25
|
>
|
|
28
26
|
<div
|
|
29
|
-
class="${u.LiquidIf("product.media.size > 1",`${
|
|
30
|
-
style="${u.LiquidIf("product.media.size > 1",
|
|
27
|
+
class="${u.LiquidIf("product.media.size > 1",`${D}`,`${b}`)}"
|
|
28
|
+
style="${u.LiquidIf("product.media.size > 1",n.getStyleOfObject(G),n.getStyleOfObject(z))}"
|
|
31
29
|
>
|
|
32
|
-
${
|
|
30
|
+
${r.default({builderPropUID:`gp-carousel-${y?.uid}`,...q,children:B(),enableLazyLoadImage:h})}
|
|
33
31
|
${u.If(!C,e.template`
|
|
34
32
|
<div
|
|
35
|
-
class="${
|
|
36
|
-
style="${
|
|
37
|
-
${{...
|
|
33
|
+
class="${O}"
|
|
34
|
+
style="${n.getStyleOfObject(A)}"
|
|
35
|
+
${{...L}}
|
|
38
36
|
>
|
|
39
|
-
${u.LiquidIf("product.media.size > 1",
|
|
40
|
-
${u.If(F,s.default({builderPropUID:y?.uid,wrapperStyle:{..._},children:B(
|
|
37
|
+
${u.LiquidIf("product.media.size > 1",i.default({builderPropUID:`gp-gallery-${y?.uid}`,...q,enableLazyLoadImage:h}))}
|
|
38
|
+
${u.If(F,s.default({builderPropUID:y?.uid,wrapperStyle:{..._},children:B(),...q,enableLazyLoadImage:h}))}
|
|
41
39
|
</div>
|
|
42
40
|
`)}
|
|
43
41
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@gem-sdk/core");const t=
|
|
1
|
+
"use strict";var e=require("@gem-sdk/core");const t=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},o=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r)?.shapeValue;if(l)o={...o,[r]:l};else{let l=e.getResponsiveValueByScreen(t,r)?.shape;switch(l){case"square":o={...o,[r]:"1/1"};break;case"vertical":o={...o,[r]:"3/4"};break;case"horizontal":o={...o,[r]:"4/3"};break;case"original":o={...o,[r]:""}}}}),e.makeAspectRatio(o)},r=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},l=e=>{let t=e.match(/\d+/g);return t?t[0]:e};exports.checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",l=e?.["--btlr"]||"0px",i=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==l||"0px"!==i},exports.convertSpacing=e=>{if(!e)return{desktop:5};let o=t(e.desktop,5),r=t(e.tablet,o),l=t(e.mobile,r);return{desktop:o,tablet:r,mobile:l}},exports.convertSpacingForIndisdeLayout=r,exports.convertUnitToNumber=t,exports.getAspectRatio=o,exports.getConditionRenderGalleryImages=(t,o)=>{let r=!0,l=!1;return["desktop","mobile","tablet"].forEach(i=>{let s=e.getResponsiveValueByScreen(t,i),n=e.getResponsiveValueByScreen(o,i);s&&"only-feature"!==s&&(r=!1),(["two-col","one-col"].includes(s)||"images"===n)&&(l=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:l}},exports.getDisplayStyle=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},exports.getGalleryCarouselRenderByLayout=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t,r);o={...o,[r]:"only-feature"!==l}}),o},exports.getPaddingBottomByShapeSetting=t=>{let r=o(t),i={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(o=>{let s=e.getResponsiveValueByScreen(t,o),n=s?.height,a=s?.width||"",p=l(n||""),u=a.toString().match(/px/g)?l(a):a;if(n&&a&&!isNaN(Number(p))&&!isNaN(Number(u))){i={...i,[o]:`${Number(p)/Number(u)*100}%`};return}if(n&&!isNaN(Number(p))){i={...i,[o]:n};return}let d=r?.[o]!=="auto"&&r?.[o]?r?.[o]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";i={...i,[o]:`calc((${d})*100%)`}}),i},exports.getSrcImage=e=>`{{${e} | image_url: width: 480}} 480w, {{${e} | image_url: width: 768}} 768w, {{${e} | image_url: width: 1024}} 1024w, {{${e} | image_url: width: 1440}} 1440w`,exports.getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let r=!1;e.DEVICES.forEach(l=>{let i=e.getResponsiveValueByScreen(t.position,l),s=e.getResponsiveValueByScreen(t.ratioLayout,l),n=e.getResponsiveValueByScreen(t.ratioLayoutRight,l),a="desktop"===l?"--gtc":`--gtc-${l}`,p="desktop"===l?"--gtr":`--gtr-${l}`,u="left"===i?s:n,d=["left","right"].includes(i||"");d&&u?(r=!0,Object.assign(o={...o,[a]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[p]:"fit-content(0)"})):r&&Object.assign(o,{[p]:"unset"})})}return o},exports.getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t.position,r),i="desktop"===r?"--o":`--o-${r}`;o={...o,[i]:"left"===l?"1":"0"}}),o},exports.getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(r=>{let l=e.getResponsiveValueByScreen(t.position,r),i="desktop"===r?"--o":`--o-${r}`;o={...o,[i]:"left"===l?"0":"1"}}),o},exports.getStyleInsideLayout=(t,o,l)=>{let i={},s={},n={},a={},p={},u={};return["desktop","mobile","tablet"].forEach(d=>{let c=e.getResponsiveValueByScreen(t,d),m=e.getResponsiveValueByScreen(o,d)?.width,g=e.getResponsiveValueByScreen(l,d);if(i={...i,[d]:["inside-bottom","inside-left","inside-right"].includes(c)?"absolute":"static"},["inside-bottom"].includes(c)){let e=r(g);m=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(c)&&(m="100%"),n={...n,[d]:"inside-bottom"===c?`${g}`:"auto"},a={...a,[d]:["inside-left","inside-right"].includes(c)?`${g}`:"auto"},u={...u,[d]:["inside-bottom","inside-left"].includes(c)?`${g}`:"auto"},p={...p,[d]:"inside-right"===c?`${g}`:"auto"},s={...s,[d]:m}}),{...e.makeStyleResponsive("pos",i),...e.makeStyleResponsive("w",e.removeNullUndefined(s)),...e.makeStyleResponsive("bottom",e.removeNullUndefined(n)),...e.makeStyleResponsive("top",e.removeNullUndefined(a)),...e.makeStyleResponsive("left",e.removeNullUndefined(u)),...e.makeStyleResponsive("right",e.removeNullUndefined(p))}},exports.getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},exports.setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}});
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
${i.Liquid("{%- assign optionRendered = false -%}")}
|
|
3
3
|
${i.Liquid("{%- assign swatches = shop.metafields.GEMPAGES.swatchesJSONFormat.value -%}")}
|
|
4
4
|
|
|
5
|
+
${i.Liquid(`{%- assign variantPresetString = "${r}" -%}
|
|
6
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
7
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
8
|
+
{%- assign type = 'dropdown' -%}
|
|
9
|
+
{% for item in items %}
|
|
10
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
11
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
12
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% endfor %}`)}
|
|
14
|
+
|
|
5
15
|
${i.Liquid(`{% for swatch in swatches %}
|
|
6
16
|
{%- assign optionTitle = swatch.optionTitle -%}
|
|
7
17
|
{%- assign optionType = swatch.optionType -%}
|
|
@@ -21,21 +31,10 @@
|
|
|
21
31
|
{%- assign imageUrls = imageUrlsString | split: '${s.OPTION_VALUES_DELIMITER}' | slice: 0, imageUrlsString.size -%}
|
|
22
32
|
|
|
23
33
|
{% if optionTitle == option.name %}
|
|
24
|
-
{%- assign variantPresetString = "${r}" -%}
|
|
25
|
-
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
26
|
-
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
27
|
-
{%- assign type = 'dropdown' -%}
|
|
28
|
-
|
|
29
|
-
{% for item in items %}
|
|
30
|
-
{%- assign itemPreset = item | split: '($1)' -%}
|
|
31
|
-
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
32
|
-
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
33
|
-
{% endfor %}
|
|
34
34
|
{%- assign optionRendered = true -%}
|
|
35
|
-
|
|
36
35
|
${t({showDropdown:!0})}
|
|
37
36
|
{% endif %}
|
|
38
37
|
{% endfor %}`)}
|
|
39
38
|
|
|
40
|
-
${i.LiquidIf("optionRendered == false",t({showDropdown:!
|
|
39
|
+
${i.LiquidIf("optionRendered == false",t({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
41
40
|
`};
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
${i.Liquid("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
|
|
4
4
|
${i.Liquid("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
|
|
5
5
|
|
|
6
|
+
${i.Liquid(`{%- assign variantPresetString = "${a}" -%}
|
|
7
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
8
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
9
|
+
{%- assign type = 'dropdown' -%}
|
|
10
|
+
{% for item in items %}
|
|
11
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
12
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
14
|
+
{% endfor %}`)}
|
|
15
|
+
|
|
6
16
|
${i.LiquidFor("swatchesItem in swatchesItems",`
|
|
7
17
|
${i.Liquid('{%- assign colorArraysString = "" -%}')}
|
|
8
18
|
${i.Liquid('{%- assign labelsString = "" -%}')}
|
|
@@ -48,19 +58,10 @@
|
|
|
48
58
|
${i.Liquid("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
|
|
49
59
|
|
|
50
60
|
${i.LiquidIf("optionTitle == option.name",`
|
|
51
|
-
${i.Liquid(`{%- assign variantPresetString = "${a}" -%}`)}
|
|
52
|
-
${i.Liquid('{%- assign optionName = option.name | replace: "\'", "'" | replace: \'"\', """ -%}')}
|
|
53
|
-
${i.Liquid("{%- assign items = variantPresetString | split:'($2)' -%}")}
|
|
54
|
-
${i.Liquid("{%- assign type = 'dropdown' -%}")}
|
|
55
|
-
${i.LiquidFor("item in items",`
|
|
56
|
-
${i.Liquid("{%- assign itemPreset = item | split:'($1)' -%}")}
|
|
57
|
-
${i.LiquidIf("itemPreset[0] == optionName",i.Liquid("{%- assign type = itemPreset[1] -%}"))}
|
|
58
|
-
${i.LiquidIf('itemPreset[0] == "base"',i.Liquid("{%- assign type = itemPreset[1] -%}"))}
|
|
59
|
-
`)}
|
|
60
61
|
${i.Liquid("{%- assign optionRendered = true -%}")}
|
|
61
62
|
${t({showDropdown:!0})}
|
|
62
63
|
`)}
|
|
63
64
|
`)}
|
|
64
65
|
|
|
65
|
-
${i.LiquidIf("optionRendered == false",t({showDropdown:!
|
|
66
|
+
${i.LiquidIf("optionRendered == false",t({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
66
67
|
`};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{useProduct as e}from"@gem-sdk/core";import r from"../../text/components/Text.js";let o=({setting:
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{useProduct as e}from"@gem-sdk/core";import r from"../../text/components/Text.js";let o=t=>t?`<p>${t}</p>`:t,i=({setting:i,builderProps:s,styles:d})=>{let p=e(),m=p?.baseID?.replace("gid://shopify/Product/","");return t("div",{id:`shopify-text-element-${s?.uid}`,"data-product-id":m,children:t(r,{styles:d,setting:{...i,text:o(p?.title)}})})};export{i as default};
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as
|
|
1
|
+
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as s,RenderChildren as t}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{filterPageContext as c,getSettingPreloadData as u}from"../../../helpers.js";import{getShapeByLayout as n,sizeSettingDefaultForNewLayout as g}from"./common/productGallery.js";import{getProductImagesClassName as f}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as $}from"./composables/getProductImagesStyles.js";import{createAttr as y,LiquidIf as h,createClass as v,If as S,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as F}from"./common/getBorderActiveCss.js";import{getStyleOfObject as I}from"../../helpers/function.js";let C=C=>{let P=p(C),{setting:G,styles:D,builderProps:b,style:z}=P,{rawChildren:O,pageContext:_}=C,{enableLazyLoadImage:N}=_??{},A={...G,...D},B=`
|
|
2
2
|
{
|
|
3
|
-
"id":${JSON.stringify(
|
|
4
|
-
"pageContext": ${JSON.stringify(
|
|
5
|
-
"setting":${JSON.stringify(
|
|
6
|
-
"styles":${JSON.stringify(
|
|
3
|
+
"id":${JSON.stringify(b?.uid)},
|
|
4
|
+
"pageContext": ${JSON.stringify(c(_))},
|
|
5
|
+
"setting":${JSON.stringify(G)},
|
|
6
|
+
"styles":${JSON.stringify(D)},
|
|
7
7
|
"productUrl":{{product.url | json | escape}},
|
|
8
8
|
"product":{{product | json | escape}},
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
${j(D?.borderActive?.border!=="none",v("product.media.size > 1",`<style>${I({settings:B,uid:z?.uid,type:"Liquid"})}</style>`),"")}
|
|
18
|
-
${F(`
|
|
12
|
+
`,U=y({"section-id":"{{section.id}}","data-id":`${b?.uid}`}),{isOnlyFeatureAllDevices:k,isRenderGalleryGrid:q}=i(A?.position,G?.type),E=q?{}:y({"data-only-image":h("product.media.size > 1","false","true")}),{wrapperClasses:J,productImagesGalleryClasses:w}=f(C),T=v({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),x=v({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:L,wrapContainerStyleOnlyOneImage:M,galleryImageStyle:R}=$(A),V=n({shape:A.shape,shapeForBottom:A.shapeForBottom,shapeFor1Col:A.shapeFor1Col,shapeFor2Col:A.shapeFor2Col,shapeForFtOnly:A.shapeForFtOnly,shapeForInsideBottom:A.shapeForInsideBottom??g,shapeForInside:A.shapeForInside??g},A.position),W=a(A.position,V,A?.spacing),H=()=>r`
|
|
13
|
+
${s({uid:b?.uid||"",customProps:O?.[0].customProps},O?.map(e=>{if(e)return r`${t({...e,isInsideProductImage:!0,imageData:{imageShape:D?.ftShape,imageAlign:D?.align,imageLayout:D?.position},dotData:{dotSize:G?.ftDotSize,dotGapToCarousel:G?.ftDotGapToCarousel,dotStyle:G?.ftDotStyle}})}`}))}
|
|
14
|
+
`;return r`
|
|
15
|
+
${S(G?.borderActive?.border!=="none",h("product.media.size > 1",`<style>${F({settings:A,uid:b?.uid,type:"Liquid"})}</style>`),"")}
|
|
16
|
+
${j(`
|
|
19
17
|
{% assign featured_image = product.featured_image %}
|
|
20
|
-
${
|
|
18
|
+
${h("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
21
19
|
`)}
|
|
22
20
|
<gp-product-images-v3
|
|
23
|
-
gp-data='${
|
|
24
|
-
${{...
|
|
25
|
-
style="${{...
|
|
26
|
-
class="${
|
|
21
|
+
gp-data='${B}'
|
|
22
|
+
${{...U}}
|
|
23
|
+
style="${{...z}}"
|
|
24
|
+
class="${J}"
|
|
27
25
|
>
|
|
28
26
|
<div
|
|
29
|
-
class="${
|
|
30
|
-
style="${
|
|
27
|
+
class="${h("product.media.size > 1",`${T}`,`${x}`)}"
|
|
28
|
+
style="${h("product.media.size > 1",I(L),I(M))}"
|
|
31
29
|
>
|
|
32
|
-
${
|
|
33
|
-
${
|
|
30
|
+
${l({builderPropUID:`gp-carousel-${b?.uid}`,...A,children:H(),enableLazyLoadImage:N})}
|
|
31
|
+
${S(!k,r`
|
|
34
32
|
<div
|
|
35
|
-
class="${
|
|
36
|
-
style="${
|
|
37
|
-
${{...
|
|
33
|
+
class="${w}"
|
|
34
|
+
style="${I(R)}"
|
|
35
|
+
${{...E}}
|
|
38
36
|
>
|
|
39
|
-
${
|
|
40
|
-
${
|
|
37
|
+
${h("product.media.size > 1",d({builderPropUID:`gp-gallery-${b?.uid}`,...A,enableLazyLoadImage:N}))}
|
|
38
|
+
${S(q,m({builderPropUID:b?.uid,wrapperStyle:{...W},children:H(),...A,enableLazyLoadImage:N}))}
|
|
41
39
|
</div>
|
|
42
40
|
`)}
|
|
43
41
|
</div>
|
|
44
42
|
</gp-product-images-v3>
|
|
45
|
-
${
|
|
46
|
-
`};export{
|
|
43
|
+
${S(e,`<script ${u('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${u('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
44
|
+
`};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as
|
|
1
|
+
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as o,makeStyleResponsive as r,removeNullUndefined as i}from"@gem-sdk/core";let l=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,r=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:r}},a=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},n=e=>{if(!e)return{desktop:5};let t=a(e.desktop,5),o=a(e.tablet,t),r=a(e.mobile,o);return{desktop:t,tablet:o,mobile:r}},s=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{o={...o,[`--d${"desktop"===r?"":`-${r}`}`]:`${e(r)?"none":t}`}}),o},d=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",r=e?.["--bbrr"]||"0px",i=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==r||"0px"!==i||"0px"!==l},u=o=>{let r={};return["desktop","mobile","tablet"].forEach(t=>{let i=e(o,t)?.shapeValue;if(i)r={...r,[t]:i};else{let i=e(o,t)?.shape;switch(i){case"square":r={...r,[t]:"1/1"};break;case"vertical":r={...r,[t]:"3/4"};break;case"horizontal":r={...r,[t]:"4/3"};break;case"original":r={...r,[t]:""}}}}),t(r)},b=t=>{let r={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let i=!1;o.forEach(o=>{let l=e(t.position,o),a=e(t.ratioLayout,o),n=e(t.ratioLayoutRight,o),s="desktop"===o?"--gtc":`--gtc-${o}`,d="desktop"===o?"--gtr":`--gtr-${o}`,u="left"===l?a:n,b=["left","right"].includes(l||"");b&&u?(i=!0,Object.assign(r={...r,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):i&&Object.assign(r,{[d]:"unset"})})}return r},c=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(r=>{let i=e(t.position,r),l="desktop"===r?"--o":`--o-${r}`;o={...o,[l]:"left"===i?"1":"0"}}),o},m=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(r=>{let i=e(t.position,r),l="desktop"===r?"--o":`--o-${r}`;o={...o,[l]:"left"===i?"0":"1"}}),o},p=e=>`{{${e} | image_url: width: 480}} 480w, {{${e} | image_url: width: 768}} 768w, {{${e} | image_url: width: 1024}} 1024w, {{${e} | image_url: width: 1440}} 1440w`,g=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},f=(t,o,l)=>{let a={},n={},s={},d={},u={},b={};return["desktop","mobile","tablet"].forEach(r=>{let i=e(t,r),c=e(o,r)?.width,m=e(l,r);if(a={...a,[r]:["inside-bottom","inside-left","inside-right"].includes(i)?"absolute":"static"},["inside-bottom"].includes(i)){let e=g(m);c=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(i)&&(c="100%"),s={...s,[r]:"inside-bottom"===i?`${m}`:"auto"},d={...d,[r]:["inside-left","inside-right"].includes(i)?`${m}`:"auto"},b={...b,[r]:["inside-bottom","inside-left"].includes(i)?`${m}`:"auto"},u={...u,[r]:"inside-right"===i?`${m}`:"auto"},n={...n,[r]:c}}),{...r("pos",a),...r("w",i(n)),...r("bottom",i(s)),...r("top",i(d)),...r("left",i(b)),...r("right",i(u))}},h=(t,o)=>{let r=!0,i=!1;return["desktop","mobile","tablet"].forEach(l=>{let a=e(t,l),n=e(o,l);a&&"only-feature"!==a&&(r=!1),(["two-col","one-col"].includes(a)||"images"===n)&&(i=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:i}},k=e=>({...e,setting:{...e.setting}}),y=e=>{let t=e.match(/\d+/g);return t?t[0]:e},$=t=>{let o=u(t),r={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(i=>{let l=e(t,i),a=l?.height,n=l?.width||"",s=y(a||""),d=n.toString().match(/px/g)?y(n):n;if(a&&n&&!isNaN(Number(s))&&!isNaN(Number(d))){r={...r,[i]:`${Number(s)/Number(d)*100}%`};return}if(a&&!isNaN(Number(s))){r={...r,[i]:a};return}let u=o?.[i]!=="auto"&&o?.[i]?o?.[i]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";r={...r,[i]:`calc((${u})*100%)`}}),r},x=t=>{let o={};return["desktop","mobile","tablet"].forEach(r=>{let i=e(t,r);o={...o,[r]:"only-feature"!==i}}),o};export{d as checkAddOverFlowClass,n as convertSpacing,g as convertSpacingForIndisdeLayout,a as convertUnitToNumber,u as getAspectRatio,h as getConditionRenderGalleryImages,s as getDisplayStyle,x as getGalleryCarouselRenderByLayout,$ as getPaddingBottomByShapeSetting,p as getSrcImage,b as getStyleGridLayout,c as getStyleGridOrderForFeature,m as getStyleGridOrderForGallery,f as getStyleInsideLayout,l as getTypeWidthDevice,k as setDefaultWhenUndefineSetting};
|
|
@@ -2,6 +2,16 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
|
|
|
2
2
|
${s("{%- assign optionRendered = false -%}")}
|
|
3
3
|
${s("{%- assign swatches = shop.metafields.GEMPAGES.swatchesJSONFormat.value -%}")}
|
|
4
4
|
|
|
5
|
+
${s(`{%- assign variantPresetString = "${r}" -%}
|
|
6
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
7
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
8
|
+
{%- assign type = 'dropdown' -%}
|
|
9
|
+
{% for item in items %}
|
|
10
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
11
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
12
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% endfor %}`)}
|
|
14
|
+
|
|
5
15
|
${s(`{% for swatch in swatches %}
|
|
6
16
|
{%- assign optionTitle = swatch.optionTitle -%}
|
|
7
17
|
{%- assign optionType = swatch.optionType -%}
|
|
@@ -21,21 +31,10 @@ import{template as e}from"@gem-sdk/core";import{Liquid as s,LiquidIf as i}from"@
|
|
|
21
31
|
{%- assign imageUrls = imageUrlsString | split: '${n}' | slice: 0, imageUrlsString.size -%}
|
|
22
32
|
|
|
23
33
|
{% if optionTitle == option.name %}
|
|
24
|
-
{%- assign variantPresetString = "${r}" -%}
|
|
25
|
-
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
26
|
-
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
27
|
-
{%- assign type = 'dropdown' -%}
|
|
28
|
-
|
|
29
|
-
{% for item in items %}
|
|
30
|
-
{%- assign itemPreset = item | split: '($1)' -%}
|
|
31
|
-
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
32
|
-
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
33
|
-
{% endfor %}
|
|
34
34
|
{%- assign optionRendered = true -%}
|
|
35
|
-
|
|
36
35
|
${o({showDropdown:!0})}
|
|
37
36
|
{% endif %}
|
|
38
37
|
{% endfor %}`)}
|
|
39
38
|
|
|
40
|
-
${i("optionRendered == false",o({showDropdown:!
|
|
39
|
+
${i("optionRendered == false",o({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
41
40
|
`};export{t as renderOptionValuesNewFormatSwatches};
|
|
@@ -3,6 +3,16 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
|
|
|
3
3
|
${e("{%- assign swatches = shop.metafields.GEMPAGES.swatches -%}")}
|
|
4
4
|
${e("{%- assign swatchesItems = swatches | split: '($1)' -%}")}
|
|
5
5
|
|
|
6
|
+
${e(`{%- assign variantPresetString = "${o}" -%}
|
|
7
|
+
{%- assign optionName = option.name | replace: "'", "'" | replace: '"', """ -%}
|
|
8
|
+
{%- assign items = variantPresetString | split: '($2)' -%}
|
|
9
|
+
{%- assign type = 'dropdown' -%}
|
|
10
|
+
{% for item in items %}
|
|
11
|
+
{%- assign itemPreset = item | split: '($1)' -%}
|
|
12
|
+
{% if itemPreset[0] == optionName %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
13
|
+
{% if itemPreset[0] == 'base' %}{%- assign type = itemPreset[1] -%}{% endif %}
|
|
14
|
+
{% endfor %}`)}
|
|
15
|
+
|
|
6
16
|
${s("swatchesItem in swatchesItems",`
|
|
7
17
|
${e('{%- assign colorArraysString = "" -%}')}
|
|
8
18
|
${e('{%- assign labelsString = "" -%}')}
|
|
@@ -48,19 +58,10 @@ import{Liquid as e,LiquidFor as s,LiquidIf as t}from"@gem-sdk/system";import{tem
|
|
|
48
58
|
${e("{%- assign imageUrls = imageUrlsString | split: '($8)' -%}")}
|
|
49
59
|
|
|
50
60
|
${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
61
|
${e("{%- assign optionRendered = true -%}")}
|
|
61
62
|
${n({showDropdown:!0})}
|
|
62
63
|
`)}
|
|
63
64
|
`)}
|
|
64
65
|
|
|
65
|
-
${t("optionRendered == false",n({showDropdown:!
|
|
66
|
+
${t("optionRendered == false",n({showDropdown:!0,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
66
67
|
`};export{a as renderOptionValuesOld};
|