@gem-sdk/components 12.0.0-dev.51 → 12.0.0-dev.53
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/dialog/components/Dialog.liquid.js +3 -3
- package/dist/cjs/post-purchase/product/components/product-image/index.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/helpers/findMatchedGroup.js +1 -1
- package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
- package/dist/cjs/product/components/ProductImages.js +1 -1
- package/dist/cjs/product/components/product-description/ProductDescription.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v2/ProductImageV2.js +2 -2
- package/dist/cjs/product/components/product-images-v3/ProductImageV3.js +2 -2
- package/dist/cjs/product/components/product-list/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/esm/dialog/components/Dialog.liquid.js +7 -7
- package/dist/esm/post-purchase/product/components/product-image/index.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/helpers/findMatchedGroup.js +1 -1
- package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
- package/dist/esm/product/components/ProductImages.js +1 -1
- package/dist/esm/product/components/product-description/ProductDescription.liquid.js +6 -6
- package/dist/esm/product/components/product-images-v2/ProductImageV2.js +2 -2
- package/dist/esm/product/components/product-images-v3/ProductImageV3.js +2 -2
- package/dist/esm/product/components/product-list/ProductList.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers=require("../../helpers.js");const Dialog=e=>{let{setting:s,children:t,builderProps:a,style:l,advanced:r,builderAttrs:y,pageContext:c}=e,o=r?.d,{frequency:i=3,triggerPercentage:n=0,trigger:g,triggerTime:d,frequencyMode:m="once",mobileTrigger:C,mobileTriggerTime:p,closeOnClickOutside:$}=s??{},{name:S,fullScreen:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers=require("../../helpers.js");const Dialog=e=>{let{setting:s,children:t,builderProps:a,style:l,advanced:r,builderAttrs:y,pageContext:c}=e,o=r?.d,{frequency:i=3,triggerPercentage:n=0,trigger:g,triggerTime:d,frequencyMode:m="once",mobileTrigger:C,mobileTriggerTime:p,closeOnClickOutside:$}=s??{},{name:S,fullScreen:u,width:v,height:f,position:b,overlayColor:A,overlayOpacity:L,iconSize:B,closeButtonPosition:h,iconSvg:j}=s??{},q=s?.dialogId??a?.uid,D=system.createStateOrContext({dialogId:q,trigger:g,triggerTime:d,frequency:i,triggerPercentage:n,mobileTrigger:C,mobileTriggerTime:p,closeOnClickOutside:$,frequencyMode:m,display:o}),O=system.createAttr({...attrs.getAttr({uid:a?.uid||""})}),x=system.createStyle({...styles.getWrapperStyle(o)}),E=system.createClass({...classes.getContainClasses(r?.cssClass,L,A)}),k=system.createAttr({...attrs.getAttrContainer({uid:q||""})}),I=system.createStyle({...styles.getContainStyle()}),P=system.createClass({...classes.getBackdropClasses(b)}),_=system.createStyle({...styles.getBackdropStyle(l)}),M=system.createAttr({...attrs.getAttrOverlay()}),R=system.createClass({...classes.getOverlayClasses()}),z=system.createStyle({...styles.getOverlayStyle(L,A,l)}),G=system.createStyle({...styles.getDialogContentStyle({style:l,width:v,height:f,fullScreen:u})}),N=system.createClass({...classes.getDialogContentClasses({setting:s,enableEffect:!0,isILP:!1})}),w=system.createAttr({...attrs.getAttrClose()}),H=system.createClass({...classes.getHeadContentClasses()}),J=system.createStyle({...styles.getButtonContentStyle(s)}),T=system.createClass({...classes.getButtonContentClasses(h)}),U=system.createStyle({...styles.getSvgContentStyle(B)}),V=system.createClass({...classes.getSvgContentClasses()}),W=system.createStyle({...styles.getBodyContentStyle({setting:s,style:l,uid:a?.uid,pageContext:c,type:"Liquid"})}),F=system.createClass({...classes.getBodyContentClasses()}),K=()=>core.RenderIf(core.isLocalEnv,'<script src="{{ \'gp-dialog-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${core.baseAssetURL}/assets-v2/gp-dialog-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return core.template`
|
|
2
2
|
<gp-dialog
|
|
3
|
-
${{...
|
|
3
|
+
${{...O}}
|
|
4
4
|
class="${helpers.getSettingPreloadData("gps-lazy")}"
|
|
5
5
|
style="${x}"
|
|
6
|
-
data-gp-setting='${JSON.stringify(
|
|
6
|
+
data-gp-setting='${JSON.stringify(D)}'>
|
|
7
7
|
<dialog
|
|
8
8
|
aria-label="${S}"
|
|
9
9
|
${{...k}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),FeatureImageWithGalleryImage=require("./layouts/FeatureImageWithGalleryImage.js"),FeatureImage=require("./FeatureImage.js"),OnlyGalleryImage=require("./layouts/OnlyGalleryImage.js"),system=require("@gem-sdk/system"),classes=require("../../common/classes.js");const PostPurchaseProductImages=e=>{let{setting:s,styles:t,builderProps:r,builderAttrs:a,style:l,children:u}=e,i={...s,...t},{layoutType:m="bottom-center"}=i,c=core.useProduct(),g=e=>e?.medias?.edges.filter(e=>!["VIDEO","EXTERNAL_VIDEO","MODEL_3D"].includes(e.node?.contentType||"")).map(e=>e?.node),n=e=>!!e&&["EXTERNAL_VIDEO","MODEL_3D","VIDEO"].includes(e),o=React.useMemo(()=>{let e=g(c)?.map(e=>(e&&(e.src=n(e.contentType)?e?.previewImage:e.src),e));return e?.length?e:[{id:c?.featuredImage?.id||"noImageError",src:c?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:c?.featuredImage?.width||480,height:c?.featuredImage?.height||480}]},[c]),d=()=>["bottom-center","left","right"].includes(m)?jsxRuntime.jsx(FeatureImageWithGalleryImage.default,{gallery:o,builderProps:r,setting:s,styles:t}):["one-col","two-col"].includes(m)?jsxRuntime.jsx(OnlyGalleryImage.default,{gallery:o,builderProps:r,setting:s,styles:t}):jsxRuntime.jsx(FeatureImage.default,{gallery:o,styles:t,setting:s}),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),FeatureImageWithGalleryImage=require("./layouts/FeatureImageWithGalleryImage.js"),FeatureImage=require("./FeatureImage.js"),OnlyGalleryImage=require("./layouts/OnlyGalleryImage.js"),system=require("@gem-sdk/system"),classes=require("../../common/classes.js");const PostPurchaseProductImages=e=>{let{setting:s,styles:t,builderProps:r,builderAttrs:a,style:l,children:u}=e,i={...s,...t},{layoutType:m="bottom-center"}=i,c=core.useProduct(),g=e=>e?.medias?.edges.filter(e=>!["VIDEO","EXTERNAL_VIDEO","MODEL_3D"].includes(e.node?.contentType||"")).map(e=>e?.node),n=e=>!!e&&["EXTERNAL_VIDEO","MODEL_3D","VIDEO"].includes(e),o=React.useMemo(()=>{let e=g(c)?.map(e=>(e&&(e.src=n(e.contentType)?e?.previewImage:e.src),e));return e?.length?e:[{id:c?.featuredImage?.id||"noImageError",baseID:c?.featuredImage?.baseID||"noImageError",src:c?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:c?.featuredImage?.width||480,height:c?.featuredImage?.height||480}]},[c]),d=()=>["bottom-center","left","right"].includes(m)?jsxRuntime.jsx(FeatureImageWithGalleryImage.default,{gallery:o,builderProps:r,setting:s,styles:t}):["one-col","two-col"].includes(m)?jsxRuntime.jsx(OnlyGalleryImage.default,{gallery:o,builderProps:r,setting:s,styles:t}):jsxRuntime.jsx(FeatureImage.default,{gallery:o,styles:t,setting:s}),I=system.createClass(classes.getProductImageClass({align:i?.align})),y=system.createStyle({...l});return jsxRuntime.jsxs("div",{...a,className:I,style:y,children:[jsxRuntime.jsx("div",{className:I,children:d()}),u]})};exports.default=PostPurchaseProductImages;
|
package/dist/cjs/post-purchase/product/components/product-subscription/helpers/findMatchedGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var calculateBestSellingPlan=require("./calculateBestSellingPlan.js"),core=require("@gem-sdk/core");const findMatchedGroup=e=>{let{sellingPlanGroups:
|
|
1
|
+
"use strict";var calculateBestSellingPlan=require("./calculateBestSellingPlan.js"),core=require("@gem-sdk/core");const getAllValidPlans=e=>{let r=[];for(let l of e)if(l?.sellingPlans){let e=l.sellingPlans.filter(e=>null!=e);r.push(...e)}return r},getVariantPrice=e=>{if(!e)return 0;let r="number"==typeof e.price?String(e.price):e.price??void 0;return core.convertDecimalToNumber(r)??0},findGroupByPlanId=(e,r)=>e.find(e=>e?.sellingPlans?.some(e=>e?.baseID===r||e?.id===r)),findGroupByBestPlan=(e,r)=>{let l=getAllValidPlans(e);if(0===l.length)return;let n=calculateBestSellingPlan.findBestPlanFromList({plans:l,variantPrice:r});if(n)return findGroupByPlanId(e,n.baseID||n.id||"")},findMatchedGroup=e=>{let{sellingPlanGroups:r,extractedSettings:l,currentVariant:n}=e;if(l.group){if("__unknown__"===l.sourceApp){let e=r.find(e=>e?.id===l.group);if(e)return e}else if(l.sourceApp){let e=r.find(e=>e?.appID===l.sourceApp&&e?.id===l.group);if(e)return e}}if(l.defaultOptions){let e=findGroupByPlanId(r,l.defaultOptions);if(e)return e}if(l.sourceApp){let e=r.find(e=>e?.appID===l.sourceApp);if(e)return e}let i=getVariantPrice(n);if(i>0){let e=findGroupByBestPlan(r,i);if(e)return e}return r[0]};exports.findMatchedGroup=findMatchedGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const productOfferPlaceholder={id:"",title:"Dynamic product",description:"This is a dynamic product. The actual product will appear here based on your setup",descriptionHtml:'<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',createdAt:"2024-07-01T04:19:51.286753Z",handle:"dynamic-product",averageRating:0,isStorefront:!0,isSample:!1,baseID:"",sku:"",options:[{id:"1",name:"Variant",optionType:"",values:[{id:"1",label:"Variant option",isDefault:!0,baseID:""}]}],vendor:"",featuredImage:{id:"542178560626918105",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""},collections:{edges:[{node:{id:"502321959132988135",title:"Home page"}},{node:{id:"539286505089204764",title:"b"}},{node:{id:"539286505089401372",title:"e"}}]},tags:[],medias:{edges:[{cursor:"gqFpzweGNIc/AALZoXYB",node:{id:"542178560626918105",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""}}],pageInfo:{endCursor:"gqFpzweGNIc/AALZoXYB",hasNextPage:!0}},variants:{edges:[{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}},{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}}],pageInfo:{hasNextPage:!1,endCursor:"gaFpzwc5ZqRtDAMI"}}};exports.productOfferPlaceholder=productOfferPlaceholder;
|
|
1
|
+
"use strict";const productOfferPlaceholder={id:"",title:"Dynamic product",description:"This is a dynamic product. The actual product will appear here based on your setup",descriptionHtml:'<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',createdAt:"2024-07-01T04:19:51.286753Z",handle:"dynamic-product",averageRating:0,isStorefront:!0,isSample:!1,baseID:"",sku:"",options:[{id:"1",name:"Variant",optionType:"",values:[{id:"1",label:"Variant option",isDefault:!0,baseID:""}]}],vendor:"",featuredImage:{id:"542178560626918105",baseID:"",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""},collections:{edges:[{node:{id:"502321959132988135",title:"Home page"}},{node:{id:"539286505089204764",title:"b"}},{node:{id:"539286505089401372",title:"e"}}]},tags:[],medias:{edges:[{cursor:"gqFpzweGNIc/AALZoXYB",node:{id:"542178560626918105",baseID:"",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""}}],pageInfo:{endCursor:"gqFpzweGNIc/AALZoXYB",hasNextPage:!0}},variants:{edges:[{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}},{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}}],pageInfo:{hasNextPage:!1,endCursor:"gaFpzwc5ZqRtDAMI"}}};exports.productOfferPlaceholder=productOfferPlaceholder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"
|
|
1
|
+
"use strict";const SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleOneTimeDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleOneTimeAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'rtl' && sellingTitleOneTimeAlign === 'left'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]},{action:{controlId:"sellingTitleOneTimeAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'ltr' && sellingTitleOneTimeAlign === 'right'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"Direction",setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"Align",conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=SettingUIV2;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),ProductFeaturedImage=require("./product-images/ProductFeaturedImage.js"),productImage=require("../helpers/product-image.js"),helpers=require("./product-images/common/helpers.js"),ProductGalleryCarousel=require("./product-images/ProductGalleryCarousel.js"),ProductGalleryGrid=require("./product-images/ProductGalleryGrid.js"),ProductImagesLightBox=require("./product-images/ProductImagesLightBox.js"),productGallery=require("./product-images/common/productGallery.js");const DEVICES=["mobile","tablet","desktop"],getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),ProductImages=e=>{let{setting:t,styles:r,builderProps:i,builderAttrs:o,style:s,children:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),ProductFeaturedImage=require("./product-images/ProductFeaturedImage.js"),productImage=require("../helpers/product-image.js"),helpers=require("./product-images/common/helpers.js"),ProductGalleryCarousel=require("./product-images/ProductGalleryCarousel.js"),ProductGalleryGrid=require("./product-images/ProductGalleryGrid.js"),ProductImagesLightBox=require("./product-images/ProductImagesLightBox.js"),productGallery=require("./product-images/common/productGallery.js");const DEVICES=["mobile","tablet","desktop"],getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),ProductImages=e=>{let{setting:t,styles:r,builderProps:i,builderAttrs:o,style:s,children:a}=e,l={...e.styles,...e.setting},u={...e.styles,...e.setting},c=core.useProduct(),g=core.useCurrentDevice(),n=core.useCurrentVariant(),d=core.useProductStore(e=>e.setProductFeaturedImage),[p,m]=React.useState(!1),[f,h]=React.useState(100),y=React.useRef(null),b=core.getResponsiveValueByScreen(t?.galleryVisible,g),I=core.getResponsiveValueByScreen(t?.featureImageVisible,g),R=React.useMemo(()=>core.getResponsiveValueByScreen(r?.position,g),[g,r?.position]),j=React.useMemo(()=>productGallery.getStyleWidthForGallery({galleryVisible:t?.galleryVisible,featureImageVisible:t?.featureImageVisible,position:r?.position,width:r?.width,widthHorizontalLayout:r?.widthHorizontalLayout}),[r?.position,r?.width,r?.widthHorizontalLayout,t?.galleryVisible,t?.featureImageVisible]),x=React.useMemo(()=>{let e=getProductGallery(c);return e?.length?e:[{id:c?.featuredImage?.id??"noImageError",baseID:c?.featuredImage?.baseID??"noImageError",src:c?.featuredImage?.src??"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:c?.featuredImage?.width??480,height:c?.featuredImage?.height??480}]},[c]),V=React.useMemo(()=>helpers.getStyleAlignment(r?.align,r?.position),[r?.position,r?.align]),P=React.useMemo(()=>x.reduce((e,t,r)=>t?{...e,[t.id]:r}:e,{}),[x]),v=React.useMemo(()=>productGallery.getStyleGallerySpacing(r?.position,r?.gallerySpacing),[r?.position,r?.gallerySpacing]),S=React.useMemo(()=>helpers.checkAddOverFlowClass(s),[s]),G=React.useMemo(()=>{let e={};return DEVICES.forEach(i=>{let o=helpers.convertUnitToNumber(r?.height?.[i],0),s=core.getResponsiveValueByScreen(t?.galleryVisible,i),a=core.getResponsiveValueByScreen(t?.featureImageVisible,i),l=core.getResponsiveValueByScreen(r?.position,i),u=("left"===l||"right"===l)&&s&&a;e=o?"number"==typeof r?.height?.[i]?{...e,[i]:r?.height?.[i]+"px"}:r?.height?.[i]?.includes("%")?{...e,[i]:helpers.convertUnitToNumber(r?.height?.[i],f)*f/100+"px"}:{...e,[i]:r?.height?.[i]}:{...e,[i]:u?f+"px":"auto"}}),e},[f,r?.height,r?.position,t?.featureImageVisible,t?.galleryVisible]),w=React.useCallback(()=>core.makeStyleResponsive("h",core.makeHeight(G)),[G]);React.useEffect(()=>{if(n){let e=P[n?.mediaId]??0,t=x[e]??c?.featuredImage;t&&d(t)}},[n,P,x,c?.featuredImage,d]),React.useEffect(()=>{let e=null;return y?.current&&(e=new ResizeObserver(()=>{h(y?.current?.offsetHeight??0)})).observe(y.current,{}),()=>{e?.disconnect()}},[t?.featureImageVisible,g]),React.useEffect(()=>{t?.featureImageVisible&&setTimeout(()=>{h(y?.current?.offsetHeight??0)},100)},[t?.featureImageVisible,g]);let k=e=>{if(!e)return;let t=P[e];if(void 0!==t){let e=x[t];e&&d(e)}},B=e=>{let r=t?.clickEffect=="popup"||core.getResponsiveValueByScreen(t?.largeViewInPopup,g);r&&m(!0),k(e)},C=e=>{let r=core.getResponsiveValueByScreen(t?.largeViewInPopup,g);r&&B(e),k(e)};return jsxRuntime.jsxs("div",{...o,className:core.cls(i?.uid,{"gp-overflow-hidden":S}),style:{...s},children:[jsxRuntime.jsxs("div",{className:core.cls("gp-flex gp-w-full",{...productImage.getFlexDirection(e)}),style:{...V},children:[I&&jsxRuntime.jsx(ProductFeaturedImage.default,{imgRef:y,productImages:x,...l,onOpenLightBox:()=>m(!0)}),b&&x.length>1&&jsxRuntime.jsx("div",{className:core.cls("gp-product-images-gallery gp-inline-flex gp-h-fit gp-max-w-full",{"gp-justify-start":r?.position?.desktop=="bottom-left","tablet:gp-justify-start":r?.position?.tablet=="bottom-left","mobile:gp-justify-start":r?.position?.mobile=="bottom-left","gp-justify-center":r?.position?.desktop=="bottom-center","tablet:gp-justify-center":r?.position?.tablet=="bottom-center","mobile:gp-justify-center":r?.position?.mobile=="bottom-center","gp-mx-auto":"bottom-center"==R}),style:{...core.makeStyle({fs:"1.23"}),...j,...v,...w()},children:"slider"===helpers.getTypeWidthDevice(t?.type)[g]||"left"===R||"right"===R?jsxRuntime.jsx(ProductGalleryCarousel.default,{productImages:x,...u,builderPropUID:i?.uid,onHandleClick:e=>C(e||"")}):jsxRuntime.jsx(ProductGalleryGrid.default,{productImages:x,...u,builderPropUID:i?.uid,onHandleClick:e=>C(e||"")})})]}),(t?.clickEffect=="popup"||core.getResponsiveValueByScreen(t?.largeViewInPopup,g))&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:x,builderPropUID:i?.uid,open:p,onHandleClose:()=>m(!1),imageRatio:r?.ftAspectRatio}),a]})};exports.default=ProductImages;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers$1=require("./common/helpers.js"),translate=require("../../settings/product-description/configs/translate.js");const ProductDescription=e=>{let{setting:s,advanced:t,builderProps:r,pageContext:a}=e,{htmlTag:i,viewMoreText:l,viewLessText:c}=s??{},o="html"===i?"div":"p",p=system.createClass({"gp-product-description":!0,[t?.cssClass]:!0}),n=system.createClass(classes.getClasses({setting:s,isLiquid:!0})),d=system.createClass(classes.getButtonClasses({setting:s})),m=system.createClass({"gp-show-more-text":!0}),u=system.createClass({"gp-show-more-icon gp-ml-1":!0}),y=system.createStyle({...styles.getTextStyle({setting:s,renderMaxHeight:!0}),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(s?.lineClamp,s?.hasLineClamp))}),g=system.createClass(classes.getClassPreBuilt()),$=system.createStyle(styles.getButtonStyle({setting:s})),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers=require("../../../helpers.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers$1=require("./common/helpers.js"),translate=require("../../settings/product-description/configs/translate.js");const ProductDescription=e=>{let{setting:s,advanced:t,builderProps:r,pageContext:a}=e,{htmlTag:i,viewMoreText:l,viewLessText:c}=s??{},o="html"===i?"div":"p",p=system.createClass({"gp-product-description":!0,[t?.cssClass]:!0}),n=system.createClass(classes.getClasses({setting:s,isLiquid:!0})),d=system.createClass(classes.getButtonClasses({setting:s})),m=system.createClass({"gp-show-more-text":!0}),u=system.createClass({"gp-show-more-icon gp-ml-1":!0}),y=system.createStyle({...styles.getTextStyle({setting:s,renderMaxHeight:!0}),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(s?.lineClamp,s?.hasLineClamp))}),g=system.createClass(classes.getClassPreBuilt()),$=system.createStyle(styles.getButtonStyle({setting:s})),S=system.createAttr({"data-id":`${r?.uid}`}),C=system.createAttr({"data-gp-text":""}),{textDescriptionCss:v,gpDescriptionCss:h}=styles.getStaticCss(),L="product.description == blank",x=()=>{let e=core.isLocalEnv?"{{ 'gp-product-description-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-description-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`},q=helpers.getDynamicSourceLocales({val:l,uid:r?.uid,settingId:helpers.createSettingId({id:translate.ProductDescription?.viewMoreText?.id}),pageContext:a}),I=helpers.getDynamicSourceLocales({val:c,uid:r?.uid,settingId:helpers.createSettingId({id:translate.ProductDescription?.viewLessText?.id}),pageContext:a}),f=system.createStateOrContext({setting:{lineClamp:s?.lineClamp,hasLineClamp:s?.hasLineClamp,viewMoreText:q,viewLessText:I,enableViewMoreIcon:s?.enableViewMoreIcon},textStyle:y});return system.LiquidIf(L,"",system.Liquid(core.template`
|
|
2
2
|
<gp-product-description
|
|
3
|
-
${
|
|
3
|
+
${S}
|
|
4
4
|
class="${p}"
|
|
5
5
|
data-view-more-text="${q}"
|
|
6
6
|
data-view-less-text="${I}"
|
|
7
7
|
>
|
|
8
|
-
<script gp-data type="application/json">${core.dataStringify(
|
|
9
|
-
<style>${
|
|
8
|
+
<script gp-data type="application/json">${core.dataStringify(f).replaceAll("'","'")}</script>
|
|
9
|
+
<style>${v}${h}</style>
|
|
10
10
|
<div class="${g}" ></div>
|
|
11
|
-
${system.LiquidUnless("product","<p>Product not found</p>",core.template`<${o} ${
|
|
11
|
+
${system.LiquidUnless("product","<p>Product not found</p>",core.template`<${o} ${C} class="${n}" style="${y}">
|
|
12
12
|
{{product.description}}
|
|
13
13
|
</${o}>
|
|
14
14
|
${system.LiquidUnless(L,core.template`<button type="button" class="${d}" style="${$}">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:o,builderProps:l,builderAttrs:r,style:C,children:s}=t,d=core.useProduct(),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:o,builderProps:l,builderAttrs:r,style:C,children:s}=t,d=core.useProduct(),n=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),[p,f]=React.useState(!1),h=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,y=e=>e?.featuredImage,I=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,D=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),M=React.useMemo(()=>{if(D){let e;switch(i?.preDisplay){case"1st-images":e=y(d);break;case"1st-3d-mode":e=I(d);break;case"1st-video":e=h(d);break;case"1st-available-variant":e=c?.media}return g(e),e}},[D,i?.preDisplay,g,d,c?.media]),b=React.useMemo(()=>{let e=getProductGallery(d);return e?.length?e:[{id:d?.featuredImage?.id||"noImageError",baseID:d?.featuredImage?.baseID||"noImageError",src:d?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:d?.featuredImage?.width||480,height:d?.featuredImage?.height||480}]},[d]),x=React.useMemo(()=>b.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[b]),R=React.useMemo(()=>core.getResponsiveValueByScreen(o?.position,n),[n,o?.position]),E=(e,t)=>{v(e),t&&j()},j=()=>{f(!0)},v=e=>{if(!e)return;let t=x[e];if(void 0!==t){let e=b[t];e&&g(e)}};React.useEffect(()=>{if(c&&!D){let e=x[c?.mediaId];if(void 0!==e){let t=b[e]??d?.featuredImage;t&&g(t)}}},[c,x,b,d?.featuredImage,g,D]);let P=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,n)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,n);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,n,m]),L=()=>b.length>0?React.Children.map(core.filterToolbarPreview(s),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:o?.ftShape,imageAlign:o?.align,imageLayout:o?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,V=`
|
|
3
3
|
<svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
|
|
5
5
|
<path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
<path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
|
|
24
24
|
<path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:V}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...r,className:k,style:C,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...o},uid:l?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(
|
|
26
|
+
`,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:V}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...r,className:k,style:C,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...o},uid:l?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(R)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,gallery:b,priorityFeatureImage:M,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),"only-feature"===R&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:b,...t,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),["one-col","two-col"].includes(R)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:b,...t,onHandleClickImage:(e,t)=>E(e||"",t),noDataChildren:Z,children:L()}),P&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:b,builderPropUID:l?.uid,open:p,onHandleClose:()=>f(!1),imageRatio:common.getAspectRatio(o?.ftShape)}),core.filterToolbarPreview(s,!0)]})};exports.default=ProductImagesV2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:l,builderProps:r,builderAttrs:o,style:s,children:C}=t,n=core.useProduct(),d=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),common=require("./common/common.js"),core=require("@gem-sdk/core"),React=require("react"),FeatureImageWithGallery=require("./components/feature-gallery/FeatureImageWithGallery.js"),OnlyFeatureImage=require("./components/feature-only/OnlyFeatureImage.js"),ProductImagesLightBox=require("./components/lightbox/ProductImagesLightBox.js"),NoDataState=require("../../../common/components/NoDataState.js"),getProductImagesClassName=require("./composables/getProductImagesClassName.js"),getBorderActiveCss=require("./common/getBorderActiveCss.js"),GalleryGrid=require("./components/gallery-grid/GalleryGrid.js");const getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=e=>{let t=React.useMemo(()=>common.setDefaultWhenUndefineSetting(e),[e]),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),{setting:i,styles:l,builderProps:r,builderAttrs:o,style:s,children:C}=t,n=core.useProduct(),d=core.useCurrentDevice(),c=core.useCurrentVariant(),{isChangeSelectedOption:u}=core.useSelectedOption(),m=core.useEditorMode(),g=core.useProductStore(e=>e.setProductFeaturedImage),[p,f]=React.useState(!1),h=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,y=e=>e?.featuredImage,I=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,M=React.useMemo(()=>i?.typeDisplay==="all-images"&&!u,[u,i?.typeDisplay]),D=React.useMemo(()=>{if(M){let e;switch(i?.preDisplay){case"1st-images":e=y(n);break;case"1st-3d-mode":e=I(n);break;case"1st-video":e=h(n);break;case"1st-available-variant":e=c?.media}return g(e),e}},[M,i?.preDisplay,g,n,c?.media]),b=React.useMemo(()=>i?.filterByVariant==="selected_variant",[i?.filterByVariant]),R=React.useMemo(()=>{let e=getProductGallery(n);if(!e?.length)return[{id:n?.featuredImage?.id||"noImageError",baseID:n?.featuredImage?.baseID||"noImageError",src:n?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:n?.featuredImage?.width||480,height:n?.featuredImage?.height||480}];if(!b||!c?.selectedOptions?.length)return e;let t=c.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),l=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),l=i(a),r="all-variants"===t,o=t===l||t.includes(l);return r||o});return l?.length>0?l:e},[c?.selectedOptions,b,n]),x=React.useMemo(()=>R.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[R]),E=React.useMemo(()=>core.getResponsiveValueByScreen(l?.position,d),[d,l?.position]),v=(e,t)=>{V(e),t&&j()},j=()=>{f(!0)},V=e=>{if(!e)return;let t=x[e];if(void 0!==t){let e=R[t];e&&g(e)}};React.useEffect(()=>{if(c&&!M){let e=x[c?.mediaId];if(void 0!==e){let t=R[e]??n?.featuredImage;t&&g(t)}}},[c,x,R,n?.featuredImage,g,M]);let L=React.useMemo(()=>{let e="popup"===core.getResponsiveValueByScreen(i?.ftClickOpenLightBox,d)||core.getResponsiveValueByScreen(i?.clickOpenLightBox,d);return e||"edit"!==m||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[i?.ftClickOpenLightBox,i?.clickOpenLightBox,d,m]),P=()=>R.length>0?React.Children.map(core.filterToolbarPreview(C),e=>React.isValidElement(e)?jsxRuntime.jsx(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:i?.ftNavigationPosition,imageData:{imageShape:l?.ftShape,imageAlign:l?.align,imageLayout:l?.position},dotData:{dotSize:i?.ftDotSize,dotGapToCarousel:i?.ftDotGapToCarousel,dotStyle:i?.ftDotStyle}}):null):null,w=`
|
|
3
3
|
<svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
|
|
5
5
|
<path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
<path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
|
|
24
24
|
<path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:w}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...o,className:k,style:s,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...l},uid:r?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(
|
|
26
|
+
`,Z=jsxRuntime.jsx(NoDataState.default,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:a},{text:"sync data",callback:"syncProduct"}],additionalMedia:w}),{wrapperClasses:k}=getProductImagesClassName.getProductImagesClassName(e);return jsxRuntime.jsxs("div",{...o,className:k,style:s,children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:getBorderActiveCss.getBorderActiveCss({settings:{...i,...l},uid:r?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(E)&&jsxRuntime.jsx(FeatureImageWithGallery.default,{...t,isFilterByVariantEnabled:b,gallery:R,priorityFeatureImage:D,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),"only-feature"===E&&jsxRuntime.jsx(OnlyFeatureImage.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,isFilterByVariantEnabled:b,children:P()}),["one-col","two-col"].includes(E)&&jsxRuntime.jsx(GalleryGrid.default,{gallery:R,...t,onHandleClickImage:(e,t)=>v(e||"",t),noDataChildren:Z,children:P()}),L&&jsxRuntime.jsx(ProductImagesLightBox.default,{productImages:R,builderPropUID:r?.uid,open:p,onHandleClose:()=>f(!1),imageRatio:common.getAspectRatio(l?.ftShape)}),core.filterToolbarPreview(C,!0)]})};exports.default=ProductImagesV3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),dynamic=require("next/dynamic"),Loading=require("../../../common/components/Loading.js"),React=require("react"),core=require("@gem-sdk/core"),SalePageProductListWarning=require("../SalePageProductListWarning.js"),Head=require("next/head"),ProductListGridLayout=require("./ProductListGridLayout.js"),ProductListCarouselLayout=require("./ProductListCarouselLayout.js"),styles=require("./common/styles.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),helpers$1=require("../../../dialog/common/helpers.js");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:Loading.default}),ProductList=e=>{let{children:t,styles:r,builderProps:o,setting:s,builderAttrs:a}=e,{isRelatedProduct:d,productSetting:i}=helpers.getData(e),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),dynamic=require("next/dynamic"),Loading=require("../../../common/components/Loading.js"),React=require("react"),core=require("@gem-sdk/core"),SalePageProductListWarning=require("../SalePageProductListWarning.js"),Head=require("next/head"),ProductListGridLayout=require("./ProductListGridLayout.js"),ProductListCarouselLayout=require("./ProductListCarouselLayout.js"),styles=require("./common/styles.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),helpers$1=require("../../../dialog/common/helpers.js");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:Loading.default}),ProductList=e=>{let{children:t,styles:r,builderProps:o,setting:s,builderAttrs:a}=e,{isRelatedProduct:d,productSetting:i}=helpers.getData(e),c=i.relatedTag&&i.relatedTag[0],{isEditMode:l,isPreviewSharePageMode:u}=core.useRenderMode(),n=core.useCurrentDevice(),g=core.usePageType(),m=core.usePageStore(e=>e.dynamicProduct),h=core.usePageStore(e=>e.dynamicCollection),[P,f]=React.useState(1),[j,p]=React.useState(!0),[x,y]=React.useState(),[R,v]=React.useState(!1),b="GP_FUNNEL_PAGE"===g,T="GP_COLLECTION"==g;T&&(i.productSrc="DynamicCollection",i.collectionId=h?.collectionId??"latest");let I=i?.productSrc??"Collection",S=m?.productId&&m?.productId!==i.relatedProductId?m?.productId:i.relatedProductId,k=core.useFetchHandle(),L=core.usePageStore(e=>e.publicStoreFrontData),C=React.useMemo(()=>core.hasPublicStoreFrontData(L)?core.createStoreFrontFetcher(L):k,[L]),{data:O}=core.useProductQuery(d&&S?S:void 0,{revalidateOnMount:l||u},C),w=i.relatedTag&&"tags"===i.relatedTag[0]&&(!O?.tags||O?.tags.length===0),E=i.relatedTag&&"collection"===i.relatedTag[0]&&(!O?.collections?.edges||O?.collections.edges.length===0),N=i.relatedTag&&"vendor"===i.relatedTag[0]&&!O?.vendor,q=w||E||N,M=core.useProductsQueryAll(x,{revalidateOnMount:l||u},C),W=l||u,F=core.useProductsQuery("PickProduct"===I?i?.productIds:void 0,{revalidateOnMount:W},{defaultSelectedProductCount:i?.numOfSelectedProducts}),G=React.useMemo(()=>({id:i?.collectionId??"latest",numberOfProducts:s?.numberOfProducts??4,orderBy:s?.orderBy}),[i?.collectionId,Number(s?.numberOfProducts),s?.orderBy]),Q=core.useCollectionQuery("PickProduct"!==I?G:void 0,{revalidateOnMount:W});React.useEffect(()=>{if(d&&O&&i.relatedTag&&"recommended-product"!==i.relatedType){let e;switch(v(!1),i.hasRelatedExclude&&(e=i?.relatedExclude&&i.relatedExclude.split(",").map(e=>e.trim())),i.relatedTag[0]){case"vendor":y({first:s?.numberOfProducts,where:{vendor:i.relatedTag&&"vendor"===i.relatedTag[0]?O?.vendor:"",idNEQ:O.id}});break;case"collection":{let t;let r=O?.collections?.edges.map(e=>e.node?.id);if(!r||r?.length===0){v(!0);break}y(t=e&&e.length>0?{first:s?.numberOfProducts,where:{idNEQ:O.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r},{titleNotIn:e}]}]}}:{first:s?.numberOfProducts,where:{idNEQ:O.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r}]}]}});break}case"tags":{let t;if(!O.tags||0===O.tags.length){v(!0);break}y(t=e&&e.length>0?{first:s?.numberOfProducts,where:{idNEQ:O.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:O.tags},{nameNotIn:e}]}]}}:{first:s?.numberOfProducts,where:{idNEQ:O.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:O.tags}]}]}})}}}},[O,i.relatedType,i.relatedTag,s?.numberOfProducts,i.relatedExclude,i.hasRelatedExclude,d]);let B="PickProduct"===I?F.isValidating:Q.isValidating,D="PickProduct"===I?F.isLoading:Q.isLoading,A="PickProduct"===I?F.error:Q.error,H=Q.data?.collections?.edges?.[0]?.node,$="PickProduct"===I?core.flattenConnection(F.data?.products):core.flattenConnection(H?.products),_=M?.data?.products?core.flattenConnection(M?.data?.products):void 0,z=d&&_?_:"PickProduct"===I&&i?.productIds?.length?i?.productIds?.map(e=>$?.find(t=>t?.baseID===e)).filter(Boolean)??$:"PickProduct"!==I?$:$.filter((e,t)=>t<(i?.numOfSelectedProducts??4)),V=React.useMemo(()=>R&&d&&l||!z.length&&!D&&j&&l,[j,D,R,d,l,z.length]),U=React.useMemo(()=>!z||R&&d,[R,d,z]),J=React.useMemo(()=>{if(!s?.sameHeight)return[];let e=0,t=Math.ceil((z?.length??0)/+(s?.slidesToShow?.[n]??1));return Array.from(Array(z?.length??0)).map((o,a)=>(a>=+(s?.slidesToShow?.[n]??1)*(e+1)&&++e,{gridRow:`${1+P*e}/${P+1+P*e}`,marginBottom:e+1<t?helpers$1.getPropertyByDevice(r?.horizontalGutter,n):void 0}))},[s?.sameHeight,s?.slidesToShow,P,z?.length,n,r?.horizontalGutter]),K=React.useMemo(()=>B||D||A||!z||R&&d,[A,D,R,d,B,z]);React.useEffect(()=>{K||setTimeout(()=>{let{builderData:e}=o??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&f(r.childElementCount||1)},l?0:500)},[o,K,l]);let X=React.useMemo(()=>({collection:H,products:z,settings:{loop:s?.loop??{desktop:!1},scrollMode:s?.scrollMode??{desktop:"snap"},slidesToShow:s?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:r?.layout,dot:s?.dot,dotStyle:s?.dotStyle,arrow:s?.arrow,controlOverContent:s?.controlOverContent},styles:{horizontalGutter:r?.horizontalGutter,verticalGutter:r?.verticalGutter,fullWidth:r?.fullWidth,spacing:r?.spacing,width:r?.width,height:r?.height}}),[H,z,s,r]);if(o?.isPreview&&b)return jsxRuntime.jsx(jsxRuntime.Fragment,{});if(V)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(j,jsxRuntime.jsx(ProductNotFound,{builderAttrs:a,collectionHandle:H?.handle,productSrc:I,onClose:()=>p(!1),children:t,relatedTagString:c,assignProductNoTags:q,noAssignedProduct:!S}))});let{productListWrapStyle:Y,productListContentStyle:Z,productListWrapAlignStyle:ee}=styles.getStyle(e),{productListWrapClass:et}=classes.getClass(e),er=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(r?.layout==="grid",jsxRuntime.jsx(ProductListGridLayout.default,{...e,productSortedById:z,generateGridRowArray:J}),jsxRuntime.jsx(ProductListCarouselLayout.default,{...e,productSortedById:z}))});return jsxRuntime.jsxs("div",{...a,className:et,style:Y,children:[!!r?.preloadBgImage&&jsxRuntime.jsxs(Head,{children:[!!r.backgroundImage?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage.desktop.image.src,as:"image"}),!!r.backgroundImage?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage?.tablet?.image?.src,as:"image"}),!!r.backgroundImage?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage?.mobile?.image?.src,as:"image"})]}),B||D?jsxRuntime.jsx(Loading.default,{}):A?jsxRuntime.jsxs("div",{children:["Error: ",A?.message]}):U?jsxRuntime.jsx("div",{children:"Products not found"}):jsxRuntime.jsx(core.ProductListProvider,{...X,children:jsxRuntime.jsx("div",{className:"gp-flex gp-w-full",style:ee,children:jsxRuntime.jsxs("div",{style:Z,children:[b&&jsxRuntime.jsx(SalePageProductListWarning.default,{}),er()]})})}),core.filterToolbarPreview(t,!0)]})};exports.default=ProductList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),dynamic=require("next/dynamic"),Loading=require("../../../common/components/Loading.js"),React=require("react"),core=require("@gem-sdk/core"),SalePageProductListWarning=require("../SalePageProductListWarning.js"),Head=require("next/head"),ProductListGridLayout=require("./ProductListGridLayout.js"),ProductListCarouselLayout=require("./ProductListCarouselLayout.js"),styles=require("./common/styles.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),helpers$1=require("../../../dialog/common/helpers.js");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:Loading.default}),ProductList=e=>{let{children:t,styles:r,builderProps:o,setting:s,builderAttrs:a}=e,{isRelatedProduct:d,productSetting:i}=helpers.getData(e),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),dynamic=require("next/dynamic"),Loading=require("../../../common/components/Loading.js"),React=require("react"),core=require("@gem-sdk/core"),SalePageProductListWarning=require("../SalePageProductListWarning.js"),Head=require("next/head"),ProductListGridLayout=require("./ProductListGridLayout.js"),ProductListCarouselLayout=require("./ProductListCarouselLayout.js"),styles=require("./common/styles.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),helpers$1=require("../../../dialog/common/helpers.js");const ProductNotFound=dynamic(()=>Promise.resolve().then(function(){return require("../ProductNotFound.js")}),{loading:Loading.default}),ProductList=e=>{let{children:t,styles:r,builderProps:o,setting:s,builderAttrs:a}=e,{isRelatedProduct:d,productSetting:i}=helpers.getData(e),c=i.relatedTag&&i.relatedTag[0],{isEditMode:l,isPreviewSharePageMode:u}=core.useRenderMode(),n=core.useCurrentDevice(),g=core.usePageType(),m=core.usePageStore(e=>e.dynamicProduct),h=core.usePageStore(e=>e.dynamicCollection),[P,f]=React.useState(1),[p,j]=React.useState(!0),[x,y]=React.useState(),[R,b]=React.useState(!1),v="GP_FUNNEL_PAGE"===g,S="GP_COLLECTION"==g;S&&(i.productSrc="DynamicCollection",i.collectionId=h?.collectionId??"latest");let I=i?.productSrc??"Collection",T=m?.productId&&m?.productId!==i.relatedProductId?m?.productId:i.relatedProductId,k=core.useFetchHandle(),L=core.usePageStore(e=>e.publicStoreFrontData),C=React.useMemo(()=>core.hasPublicStoreFrontData(L)?core.createStoreFrontFetcher(L):k,[L]),{data:O}=core.useProductQuery(d&&T?T:void 0,{revalidateOnMount:l||u},C),w=i.relatedTag&&"tags"===i.relatedTag[0]&&(!O?.tags||O?.tags.length===0),E=i.relatedTag&&"collection"===i.relatedTag[0]&&(!O?.collections?.edges||O?.collections.edges.length===0),M=i.relatedTag&&"vendor"===i.relatedTag[0]&&!O?.vendor,N=w||E||M,q=core.useProductsQueryAll(x,{revalidateOnMount:l||u},C),W=l||u,F=core.useProductsQuery("PickProduct"===I?i?.productIds:void 0,{revalidateOnMount:W},{defaultSelectedProductCount:i?.numOfSelectedProducts}),G=React.useMemo(()=>({id:i?.collectionId??"latest",numberOfProducts:s?.numberOfProducts??4,orderBy:s?.orderBy}),[i?.collectionId,Number(s?.numberOfProducts),s?.orderBy]),Q=core.useCollectionQuery("PickProduct"!==I?G:void 0,{revalidateOnMount:W});React.useEffect(()=>{if(d&&O&&i.relatedTag&&"recommended-product"!==i.relatedType){let e;switch(b(!1),i.hasRelatedExclude&&(e=i?.relatedExclude&&i.relatedExclude.split(",").map(e=>e.trim())),i.relatedTag[0]){case"vendor":y({first:s?.numberOfProducts,where:{vendor:i.relatedTag&&"vendor"===i.relatedTag[0]?O?.vendor:"",idNEQ:O.id}});break;case"collection":{let t;let r=O?.collections?.edges.map(e=>e.node?.id);if(!r||r?.length===0){b(!0);break}y(t=e&&e.length>0?{first:s?.numberOfProducts,where:{idNEQ:O.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r},{titleNotIn:e}]}]}}:{first:s?.numberOfProducts,where:{idNEQ:O.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r}]}]}});break}case"tags":{let t;if(!O.tags||0===O.tags.length){b(!0);break}y(t=e&&e.length>0?{first:s?.numberOfProducts,where:{idNEQ:O.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:O.tags},{nameNotIn:e}]}]}}:{first:s?.numberOfProducts,where:{idNEQ:O.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:O.tags}]}]}})}}}},[O,i.relatedType,i.relatedTag,s?.numberOfProducts,i.relatedExclude,i.hasRelatedExclude,d]);let A="PickProduct"===I?F.isValidating:Q.isValidating,B="PickProduct"===I?F.isLoading:Q.isLoading,D="PickProduct"===I?F.error:Q.error,H=Q.data?.collections?.edges?.[0]?.node,$="PickProduct"===I?core.flattenConnection(F.data?.products):core.flattenConnection(H?.products),_=core.usePageStore(e=>e.assignedProductIds),z=core.usePageStore(e=>e.isApplyAllProducts),V=React.useMemo(()=>(_??[]).length>0&&!z||z,[_,z]),U=q?.data?.products&&V?core.flattenConnection(q?.data?.products):[],J=d?U:"PickProduct"===I&&i?.productIds?.length?i?.productIds?.map(e=>$?.find(t=>t?.baseID===e)).filter(Boolean)??$:"PickProduct"!==I?$:$.filter((e,t)=>t<(i?.numOfSelectedProducts??4)),K=React.useMemo(()=>R&&d&&l||!J.length&&!B&&p&&l,[p,B,R,d,l,J.length]),X=React.useMemo(()=>!J||R&&d,[R,d,J]),Y=React.useMemo(()=>{if(!s?.sameHeight)return[];let e=0,t=Math.ceil((J?.length??0)/+(s?.slidesToShow?.[n]??1));return Array.from(Array(J?.length??0)).map((o,a)=>(a>=+(s?.slidesToShow?.[n]??1)*(e+1)&&++e,{gridRow:`${1+P*e}/${P+1+P*e}`,marginBottom:e+1<t?helpers$1.getPropertyByDevice(r?.horizontalGutter,n):void 0}))},[s?.sameHeight,s?.slidesToShow,P,J?.length,n,r?.horizontalGutter]),Z=React.useMemo(()=>A||B||D||!J||R&&d,[D,B,R,d,A,J]),ee=O?.collections?.edges.map(e=>e.node?.id)??[];React.useEffect(()=>{Z||setTimeout(()=>{let{builderData:e}=o??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&f(r.childElementCount||1)},l?0:500)},[o,Z,l,ee]);let et=React.useMemo(()=>({collection:H,products:J,settings:{loop:s?.loop??{desktop:!1},scrollMode:s?.scrollMode??{desktop:"snap"},slidesToShow:s?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:r?.layout,dot:s?.dot,dotStyle:s?.dotStyle,arrow:s?.arrow,controlOverContent:s?.controlOverContent},styles:{horizontalGutter:r?.horizontalGutter,verticalGutter:r?.verticalGutter,fullWidth:r?.fullWidth,spacing:r?.spacing,width:r?.width,height:r?.height}}),[H,J,s,r]);if(o?.isPreview&&v)return jsxRuntime.jsx(jsxRuntime.Fragment,{});if(K)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(p,jsxRuntime.jsx(ProductNotFound,{builderAttrs:a,collectionHandle:H?.handle,productSrc:I,onClose:()=>j(!1),children:t,relatedTagString:c,assignProductNoTags:N,noAssignedProduct:!T}))});let{productListWrapStyle:er,productListContentStyle:eo,productListWrapAlignStyle:es}=styles.getStyle(e),{productListWrapClass:ea}=classes.getClass(e),ed=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:system.If(r?.layout==="grid",jsxRuntime.jsx(ProductListGridLayout.default,{...e,productSortedById:J,generateGridRowArray:Y}),jsxRuntime.jsx(ProductListCarouselLayout.default,{...e,productSortedById:J}))});return jsxRuntime.jsxs("div",{...a,className:ea,style:er,children:[!!r?.preloadBgImage&&jsxRuntime.jsxs(Head,{children:[!!r.backgroundImage?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage.desktop.image.src,as:"image"}),!!r.backgroundImage?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage?.tablet?.image?.src,as:"image"}),!!r.backgroundImage?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:r.backgroundImage?.mobile?.image?.src,as:"image"})]}),A||B?jsxRuntime.jsx(Loading.default,{}):D?jsxRuntime.jsxs("div",{children:["Error: ",D?.message]}):X?jsxRuntime.jsx("div",{children:"Products not found"}):jsxRuntime.jsx(core.ProductListProvider,{...et,children:jsxRuntime.jsx("div",{className:"gp-flex gp-w-full",style:es,children:jsxRuntime.jsxs("div",{style:eo,children:[v&&jsxRuntime.jsx(SalePageProductListWarning.default,{}),ed()]})})}),core.filterToolbarPreview(t,!0)]})};exports.default=ProductList;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{template as s,RenderIf as l,isLocalEnv as a,baseAssetURL as e}from"@gem-sdk/core";import{createStateOrContext as t,createAttr as i,createStyle as o,createClass as d,If as r}from"@gem-sdk/system";import{getAttr as
|
|
1
|
+
import{template as s,RenderIf as l,isLocalEnv as a,baseAssetURL as e}from"@gem-sdk/core";import{createStateOrContext as t,createAttr as i,createStyle as o,createClass as d,If as r}from"@gem-sdk/system";import{getAttr as p,getAttrContainer as $,getAttrOverlay as c,getAttrClose as g}from"../common/attrs.js";import{getWrapperStyle as n,getContainStyle as m,getBackdropStyle as v,getOverlayStyle as y,getDialogContentStyle as f,getButtonContentStyle as u,getSvgContentStyle as b,getBodyContentStyle as L}from"../common/styles.js";import{getContainClasses as S,getBackdropClasses as j,getOverlayClasses as h,getDialogContentClasses as E,getHeadContentClasses as x,getButtonContentClasses as C,getSvgContentClasses as D,getBodyContentClasses as k}from"../common/classes.js";import{getSettingPreloadData as I}from"../../helpers.js";let Dialog=z=>{let{setting:A,children:B,builderProps:G,style:M,advanced:N,builderAttrs:O,pageContext:P}=z,_=N?.d,{frequency:q=3,triggerPercentage:w=0,trigger:J,triggerTime:R,frequencyMode:T="once",mobileTrigger:V,mobileTriggerTime:F,closeOnClickOutside:H}=A??{},{name:K,fullScreen:Q,width:U,height:W,position:X,overlayColor:Y,overlayOpacity:Z,iconSize:ss,closeButtonPosition:sl,iconSvg:sa}=A??{},se=A?.dialogId??G?.uid,st=t({dialogId:se,trigger:J,triggerTime:R,frequency:q,triggerPercentage:w,mobileTrigger:V,mobileTriggerTime:F,closeOnClickOutside:H,frequencyMode:T,display:_}),si=i({...p({uid:G?.uid||""})}),so=o({...n(_)}),sd=d({...S(N?.cssClass,Z,Y)}),sr=i({...$({uid:se||""})}),sp=o({...m()}),s$=d({...j(X)}),sc=o({...v(M)}),sg=i({...c()}),sn=d({...h()}),sm=o({...y(Z,Y,M)}),sv=o({...f({style:M,width:U,height:W,fullScreen:Q})}),sy=d({...E({setting:A,enableEffect:!0,isILP:!1})}),sf=i({...g()}),su=d({...x()}),sb=o({...u(A)}),sL=d({...C(sl)}),sS=o({...b(ss)}),sj=d({...D()}),sh=o({...L({setting:A,style:M,uid:G?.uid,pageContext:P,type:"Liquid"})}),sE=d({...k()}),sx=()=>l(a,'<script src="{{ \'gp-dialog-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${e}/assets-v2/gp-dialog-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);return s`
|
|
2
2
|
<gp-dialog
|
|
3
3
|
${{...si}}
|
|
4
4
|
class="${I("gps-lazy")}"
|
|
@@ -8,9 +8,9 @@ import{template as s,RenderIf as l,isLocalEnv as a,baseAssetURL as e}from"@gem-s
|
|
|
8
8
|
aria-label="${K}"
|
|
9
9
|
${{...sr}}
|
|
10
10
|
class="${sd}"
|
|
11
|
-
style="${
|
|
11
|
+
style="${sp}"
|
|
12
12
|
>
|
|
13
|
-
<div aria-label="Backdrop" class="${
|
|
13
|
+
<div aria-label="Backdrop" class="${s$}" style="${sc}">
|
|
14
14
|
${r(!!Y,s`
|
|
15
15
|
<div
|
|
16
16
|
${{...sg}}
|
|
@@ -24,17 +24,17 @@ import{template as s,RenderIf as l,isLocalEnv as a,baseAssetURL as e}from"@gem-s
|
|
|
24
24
|
role="dialog"
|
|
25
25
|
aria-label="Dialog content"
|
|
26
26
|
${{...O}}
|
|
27
|
-
class="${
|
|
27
|
+
class="${sy}"
|
|
28
28
|
style="${sv}"
|
|
29
29
|
>
|
|
30
30
|
<button
|
|
31
|
-
${{...
|
|
31
|
+
${{...sf}}
|
|
32
32
|
type="button"
|
|
33
33
|
tabindex="-1"
|
|
34
|
-
class="${
|
|
34
|
+
class="${sL}"
|
|
35
35
|
style="${sb}"
|
|
36
36
|
>
|
|
37
|
-
<span style="${
|
|
37
|
+
<span style="${sS}" class="${sj}">
|
|
38
38
|
${sa??`<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
39
39
|
<path d="M7.1,6l4.5,4.5l-1.1,1.1L6,7.1l-4.5,4.5l-1.1-1.1L4.9,6L0.5,1.5l1.1-1.1L6,4.9l4.5-4.5l1.1,1.1L7.1,6z"></path>
|
|
40
40
|
</svg>`}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{useProduct as s}from"@gem-sdk/core";import a from"./layouts/FeatureImageWithGalleryImage.js";import o from"./FeatureImage.js";import m from"./layouts/OnlyGalleryImage.js";import{createClass as l,createStyle as i}from"@gem-sdk/system";import{getProductImageClass as c}from"../../common/classes.js";let PostPurchaseProductImages=g=>{let{setting:n,styles:d,builderProps:f,builderAttrs:u,style:
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{useProduct as s}from"@gem-sdk/core";import a from"./layouts/FeatureImageWithGalleryImage.js";import o from"./FeatureImage.js";import m from"./layouts/OnlyGalleryImage.js";import{createClass as l,createStyle as i}from"@gem-sdk/system";import{getProductImageClass as c}from"../../common/classes.js";let PostPurchaseProductImages=g=>{let{setting:n,styles:d,builderProps:f,builderAttrs:u,style:I,children:p}=g,y={...n,...d},{layoutType:b="bottom-center"}=y,h=s(),E=e=>e?.medias?.edges.filter(e=>!["VIDEO","EXTERNAL_VIDEO","MODEL_3D"].includes(e.node?.contentType||"")).map(e=>e?.node),D=e=>!!e&&["EXTERNAL_VIDEO","MODEL_3D","VIDEO"].includes(e),P=r(()=>{let e=E(h)?.map(e=>(e&&(e.src=D(e.contentType)?e?.previewImage:e.src),e));return e?.length?e:[{id:h?.featuredImage?.id||"noImageError",baseID:h?.featuredImage?.baseID||"noImageError",src:h?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:h?.featuredImage?.width||480,height:h?.featuredImage?.height||480}]},[h]),O=()=>["bottom-center","left","right"].includes(b)?t(a,{gallery:P,builderProps:f,setting:n,styles:d}):["one-col","two-col"].includes(b)?t(m,{gallery:P,builderProps:f,setting:n,styles:d}):t(o,{gallery:P,styles:d,setting:n}),j=l(c({align:y?.align})),_=i({...I});return e("div",{...u,className:j,style:_,children:[t("div",{className:j,children:O()}),p]})};export{PostPurchaseProductImages as default};
|
package/dist/esm/post-purchase/product/components/product-subscription/helpers/findMatchedGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findBestPlanFromList as e}from"./calculateBestSellingPlan.js";import{convertDecimalToNumber as
|
|
1
|
+
import{findBestPlanFromList as e}from"./calculateBestSellingPlan.js";import{convertDecimalToNumber as r}from"@gem-sdk/core";let getAllValidPlans=e=>{let r=[];for(let i of e)if(i?.sellingPlans){let e=i.sellingPlans.filter(e=>null!=e);r.push(...e)}return r},getVariantPrice=e=>{if(!e)return 0;let i="number"==typeof e.price?String(e.price):e.price??void 0;return r(i)??0},findGroupByPlanId=(e,r)=>e.find(e=>e?.sellingPlans?.some(e=>e?.baseID===r||e?.id===r)),findGroupByBestPlan=(r,i)=>{let l=getAllValidPlans(r);if(0===l.length)return;let n=e({plans:l,variantPrice:i});if(n)return findGroupByPlanId(r,n.baseID||n.id||"")},findMatchedGroup=e=>{let{sellingPlanGroups:r,extractedSettings:i,currentVariant:l}=e;if(i.group){if("__unknown__"===i.sourceApp){let e=r.find(e=>e?.id===i.group);if(e)return e}else if(i.sourceApp){let e=r.find(e=>e?.appID===i.sourceApp&&e?.id===i.group);if(e)return e}}if(i.defaultOptions){let e=findGroupByPlanId(r,i.defaultOptions);if(e)return e}if(i.sourceApp){let e=r.find(e=>e?.appID===i.sourceApp);if(e)return e}let n=getVariantPrice(l);if(n>0){let e=findGroupByBestPlan(r,n);if(e)return e}return r[0]};export{findMatchedGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let productOfferPlaceholder={id:"",title:"Dynamic product",description:"This is a dynamic product. The actual product will appear here based on your setup",descriptionHtml:'<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',createdAt:"2024-07-01T04:19:51.286753Z",handle:"dynamic-product",averageRating:0,isStorefront:!0,isSample:!1,baseID:"",sku:"",options:[{id:"1",name:"Variant",optionType:"",values:[{id:"1",label:"Variant option",isDefault:!0,baseID:""}]}],vendor:"",featuredImage:{id:"542178560626918105",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""},collections:{edges:[{node:{id:"502321959132988135",title:"Home page"}},{node:{id:"539286505089204764",title:"b"}},{node:{id:"539286505089401372",title:"e"}}]},tags:[],medias:{edges:[{cursor:"gqFpzweGNIc/AALZoXYB",node:{id:"542178560626918105",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""}}],pageInfo:{endCursor:"gqFpzweGNIc/AALZoXYB",hasNextPage:!0}},variants:{edges:[{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}},{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}}],pageInfo:{hasNextPage:!1,endCursor:"gaFpzwc5ZqRtDAMI"}}};export{productOfferPlaceholder};
|
|
1
|
+
let productOfferPlaceholder={id:"",title:"Dynamic product",description:"This is a dynamic product. The actual product will appear here based on your setup",descriptionHtml:'<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',createdAt:"2024-07-01T04:19:51.286753Z",handle:"dynamic-product",averageRating:0,isStorefront:!0,isSample:!1,baseID:"",sku:"",options:[{id:"1",name:"Variant",optionType:"",values:[{id:"1",label:"Variant option",isDefault:!0,baseID:""}]}],vendor:"",featuredImage:{id:"542178560626918105",baseID:"",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""},collections:{edges:[{node:{id:"502321959132988135",title:"Home page"}},{node:{id:"539286505089204764",title:"b"}},{node:{id:"539286505089401372",title:"e"}}]},tags:[],medias:{edges:[{cursor:"gqFpzweGNIc/AALZoXYB",node:{id:"542178560626918105",baseID:"",contentType:"IMAGE",previewImage:"",src:"https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png",width:449,height:449,alt:""}}],pageInfo:{endCursor:"gqFpzweGNIc/AALZoXYB",hasNextPage:!0}},variants:{edges:[{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}},{cursor:"gqFpzwc5ZqRtDAMIoXYC",node:{id:"520560088328176392",title:"Default Title",barcode:"",baseID:"gid://shopify/ProductVariant/49298248925463",costPrice:"88",height:0,inventoryPolicy:"DENY",inventoryQuantity:211,inventoryStatus:"",isDigital:!0,length:0,lowInventoryAmount:0,manageInventory:!1,mediaId:"0",platform:"SHOPIFY",price:"88",salePrice:"88",sku:"",soldIndividually:!1,weight:0,width:0,selectedOptions:[],media:void 0}}],pageInfo:{hasNextPage:!1,endCursor:"gaFpzwc5ZqRtDAMI"}}};export{productOfferPlaceholder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"
|
|
1
|
+
let SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"Direction",setting:{id:"sellingTitleOneTimeDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleOneTimeAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'rtl' && sellingTitleOneTimeAlign === 'left'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]},{action:{controlId:"sellingTitleOneTimeAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'ltr' && sellingTitleOneTimeAlign === 'right'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"Direction",setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"Align",conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useProduct as i,useCurrentDevice as o,useCurrentVariant as r,useProductStore as l,getResponsiveValueByScreen as a,makeStyleResponsive as s,makeHeight as g,cls as p,makeStyle as m}from"@gem-sdk/core";import{useState as u,useRef as d,useMemo as n,useCallback as c,useEffect as f}from"react";import b from"./product-images/ProductFeaturedImage.js";import{getFlexDirection as h}from"../helpers/product-image.js";import{getStyleAlignment as I,checkAddOverFlowClass as y,convertUnitToNumber as V,getTypeWidthDevice as w}from"./product-images/common/helpers.js";import P from"./product-images/ProductGalleryCarousel.js";import j from"./product-images/ProductGalleryGrid.js";import x from"./product-images/ProductImagesLightBox.js";import{getStyleWidthForGallery as
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useProduct as i,useCurrentDevice as o,useCurrentVariant as r,useProductStore as l,getResponsiveValueByScreen as a,makeStyleResponsive as s,makeHeight as g,cls as p,makeStyle as m}from"@gem-sdk/core";import{useState as u,useRef as d,useMemo as n,useCallback as c,useEffect as f}from"react";import b from"./product-images/ProductFeaturedImage.js";import{getFlexDirection as h}from"../helpers/product-image.js";import{getStyleAlignment as I,checkAddOverFlowClass as y,convertUnitToNumber as V,getTypeWidthDevice as w}from"./product-images/common/helpers.js";import P from"./product-images/ProductGalleryCarousel.js";import j from"./product-images/ProductGalleryGrid.js";import x from"./product-images/ProductImagesLightBox.js";import{getStyleWidthForGallery as E,getStyleGallerySpacing as k}from"./product-images/common/productGallery.js";let DEVICES=["mobile","tablet","desktop"],getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),ProductImages=H=>{let{setting:v,styles:D,builderProps:C,builderAttrs:G,style:L,children:z}=H,R={...H.styles,...H.setting},S={...H.styles,...H.setting},N=i(),U=o(),B=r(),F=l(e=>e.setProductFeaturedImage),[O,A]=u(!1),[T,_]=u(100),q=d(null),J=a(v?.galleryVisible,U),K=a(v?.featureImageVisible,U),M=n(()=>a(D?.position,U),[U,D?.position]),Q=n(()=>E({galleryVisible:v?.galleryVisible,featureImageVisible:v?.featureImageVisible,position:D?.position,width:D?.width,widthHorizontalLayout:D?.widthHorizontalLayout}),[D?.position,D?.width,D?.widthHorizontalLayout,v?.galleryVisible,v?.featureImageVisible]),W=n(()=>{let e=getProductGallery(N);return e?.length?e:[{id:N?.featuredImage?.id??"noImageError",baseID:N?.featuredImage?.baseID??"noImageError",src:N?.featuredImage?.src??"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:N?.featuredImage?.width??480,height:N?.featuredImage?.height??480}]},[N]),X=n(()=>I(D?.align,D?.position),[D?.position,D?.align]),Y=n(()=>W.reduce((e,t,i)=>t?{...e,[t.id]:i}:e,{}),[W]),Z=n(()=>k(D?.position,D?.gallerySpacing),[D?.position,D?.gallerySpacing]),$=n(()=>y(L),[L]),ee=n(()=>{let e={};return DEVICES.forEach(t=>{let i=V(D?.height?.[t],0),o=a(v?.galleryVisible,t),r=a(v?.featureImageVisible,t),l=a(D?.position,t),s=("left"===l||"right"===l)&&o&&r;e=i?"number"==typeof D?.height?.[t]?{...e,[t]:D?.height?.[t]+"px"}:D?.height?.[t]?.includes("%")?{...e,[t]:V(D?.height?.[t],T)*T/100+"px"}:{...e,[t]:D?.height?.[t]}:{...e,[t]:s?T+"px":"auto"}}),e},[T,D?.height,D?.position,v?.featureImageVisible,v?.galleryVisible]),et=c(()=>s("h",g(ee)),[ee]);f(()=>{if(B){let e=Y[B?.mediaId]??0,t=W[e]??N?.featuredImage;t&&F(t)}},[B,Y,W,N?.featuredImage,F]),f(()=>{let e=null;return q?.current&&(e=new ResizeObserver(()=>{_(q?.current?.offsetHeight??0)})).observe(q.current,{}),()=>{e?.disconnect()}},[v?.featureImageVisible,U]),f(()=>{v?.featureImageVisible&&setTimeout(()=>{_(q?.current?.offsetHeight??0)},100)},[v?.featureImageVisible,U]);let ei=e=>{if(!e)return;let t=Y[e];if(void 0!==t){let e=W[t];e&&F(e)}},eo=e=>{let t=v?.clickEffect=="popup"||a(v?.largeViewInPopup,U);t&&A(!0),ei(e)},er=e=>{let t=a(v?.largeViewInPopup,U);t&&eo(e),ei(e)};return e("div",{...G,className:p(C?.uid,{"gp-overflow-hidden":$}),style:{...L},children:[e("div",{className:p("gp-flex gp-w-full",{...h(H)}),style:{...X},children:[K&&t(b,{imgRef:q,productImages:W,...R,onOpenLightBox:()=>A(!0)}),J&&W.length>1&&t("div",{className:p("gp-product-images-gallery gp-inline-flex gp-h-fit gp-max-w-full",{"gp-justify-start":D?.position?.desktop=="bottom-left","tablet:gp-justify-start":D?.position?.tablet=="bottom-left","mobile:gp-justify-start":D?.position?.mobile=="bottom-left","gp-justify-center":D?.position?.desktop=="bottom-center","tablet:gp-justify-center":D?.position?.tablet=="bottom-center","mobile:gp-justify-center":D?.position?.mobile=="bottom-center","gp-mx-auto":"bottom-center"==M}),style:{...m({fs:"1.23"}),...Q,...Z,...et()},children:"slider"===w(v?.type)[U]||"left"===M||"right"===M?t(P,{productImages:W,...S,builderPropUID:C?.uid,onHandleClick:e=>er(e||"")}):t(j,{productImages:W,...S,builderPropUID:C?.uid,onHandleClick:e=>er(e||"")})})]}),(v?.clickEffect=="popup"||a(v?.largeViewInPopup,U))&&t(x,{productImages:W,builderPropUID:C?.uid,open:O,onHandleClose:()=>A(!1),imageRatio:D?.ftAspectRatio}),z]})};export{ProductImages as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{makeStyleResponsive as e,makeLineClamp as t,template as s,dataStringify as i,isLocalEnv as o,baseAssetURL as r}from"@gem-sdk/core";import{getDynamicSourceLocales as p,createSettingId as a,getSettingPreloadData as n}from"../../../helpers.js";import{createClass as d,createStyle as c,createAttr as l,createStateOrContext as m,LiquidIf as u,Liquid as $,LiquidUnless as g,If as v}from"@gem-sdk/system";import{getClasses as f,getButtonClasses as w,getClassPreBuilt as
|
|
1
|
+
import{makeStyleResponsive as e,makeLineClamp as t,template as s,dataStringify as i,isLocalEnv as o,baseAssetURL as r}from"@gem-sdk/core";import{getDynamicSourceLocales as p,createSettingId as a,getSettingPreloadData as n}from"../../../helpers.js";import{createClass as d,createStyle as c,createAttr as l,createStateOrContext as m,LiquidIf as u,Liquid as $,LiquidUnless as g,If as v}from"@gem-sdk/system";import{getClasses as f,getButtonClasses as w,getClassPreBuilt as h}from"./common/classes.js";import{getTextStyle as x,getButtonStyle as y,getStaticCss as j}from"./common/styles.js";import{ICON_SVG as b}from"./common/helpers.js";import{ProductDescription as C}from"../../settings/product-description/configs/translate.js";let ProductDescription=M=>{let{setting:S,advanced:I,builderProps:L,pageContext:P}=M,{htmlTag:T,viewMoreText:k,viewLessText:E}=S??{},V="html"===T?"div":"p",A=d({"gp-product-description":!0,[I?.cssClass]:!0}),D=d(f({setting:S,isLiquid:!0})),G=d(w({setting:S})),_=d({"gp-show-more-text":!0}),q=d({"gp-show-more-icon gp-ml-1":!0}),H=c({...x({setting:S,renderMaxHeight:!0}),...e("line-clamp",t(S?.lineClamp,S?.hasLineClamp))}),N=d(h()),O=c(y({setting:S})),R=l({"data-id":`${L?.uid}`}),z=l({"data-gp-text":""}),{textDescriptionCss:B,gpDescriptionCss:F}=j(),J="product.description == blank",K=()=>{let e=o?"{{ 'gp-product-description-v7-5.js' | asset_url }}":`${r}/assets-v2/gp-product-description-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${n('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`},Q=p({val:k,uid:L?.uid,settingId:a({id:C?.viewMoreText?.id}),pageContext:P}),U=p({val:E,uid:L?.uid,settingId:a({id:C?.viewLessText?.id}),pageContext:P}),W=m({setting:{lineClamp:S?.lineClamp,hasLineClamp:S?.hasLineClamp,viewMoreText:Q,viewLessText:U,enableViewMoreIcon:S?.enableViewMoreIcon},textStyle:H});return u(J,"",$(s`
|
|
2
2
|
<gp-product-description
|
|
3
3
|
${R}
|
|
4
4
|
class="${A}"
|
|
5
|
-
data-view-more-text="${
|
|
6
|
-
data-view-less-text="${
|
|
5
|
+
data-view-more-text="${Q}"
|
|
6
|
+
data-view-less-text="${U}"
|
|
7
7
|
>
|
|
8
|
-
<script gp-data type="application/json">${i(
|
|
8
|
+
<script gp-data type="application/json">${i(W).replaceAll("'","'")}</script>
|
|
9
9
|
<style>${B}${F}</style>
|
|
10
10
|
<div class="${N}" ></div>
|
|
11
11
|
${g("product","<p>Product not found</p>",s`<${V} ${z} class="${D}" style="${H}">
|
|
@@ -13,9 +13,9 @@ import{makeStyleResponsive as e,makeLineClamp as t,template as s,dataStringify a
|
|
|
13
13
|
</${V}>
|
|
14
14
|
${g(J,s`<button type="button" class="${G}" style="${O}">
|
|
15
15
|
<span class="${_}">
|
|
16
|
-
${v(!1,
|
|
16
|
+
${v(!1,U?.toString(),Q?.toString())}
|
|
17
17
|
</span>
|
|
18
|
-
${v(
|
|
18
|
+
${v(S?.enableViewMoreIcon,s`<span class="${q}">${b}</span>`," ")}
|
|
19
19
|
</button>`)}`)}
|
|
20
20
|
</gp-product-description>
|
|
21
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as C,useProduct as o,useCurrentDevice as l,useCurrentVariant as
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as C,useProduct as o,useCurrentDevice as l,useCurrentVariant as r,useSelectedOption as d,useEditorMode as n,useProductStore as s,getResponsiveValueByScreen as p,filterToolbarPreview as m}from"@gem-sdk/core";import{useMemo as c,useState as g,useEffect as f,Children as h,isValidElement as u}from"react";import y from"./components/feature-gallery/FeatureImageWithGallery.js";import I from"./components/feature-only/OnlyFeatureImage.js";import D from"./components/lightbox/ProductImagesLightBox.js";import b from"../../../common/components/NoDataState.js";import{getProductImagesClassName as M}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as E}from"./common/getBorderActiveCss.js";import Z from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV2=k=>{let w=c(()=>a(k),[k]),{redirectProductShopifyLink:L}=C(),{setting:A,styles:V,builderProps:v,builderAttrs:x,style:H,children:P}=w,G=o(),O=l(),T=r(),{isChangeSelectedOption:_}=d(),S=n(),j=s(e=>e.setProductFeaturedImage),[F,B]=g(!1),R=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,N=e=>e?.featuredImage,U=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,Y=c(()=>A?.typeDisplay==="all-images"&&!_,[_,A?.typeDisplay]),z=c(()=>{if(Y){let e;switch(A?.preDisplay){case"1st-images":e=N(G);break;case"1st-3d-mode":e=U(G);break;case"1st-video":e=R(G);break;case"1st-available-variant":e=T?.media}return j(e),e}},[Y,A?.preDisplay,j,G,T?.media]),J=c(()=>{let e=getProductGallery(G);return e?.length?e:[{id:G?.featuredImage?.id||"noImageError",baseID:G?.featuredImage?.baseID||"noImageError",src:G?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:G?.featuredImage?.width||480,height:G?.featuredImage?.height||480}]},[G]),W=c(()=>J.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[J]),X=c(()=>p(V?.position,O),[O,V?.position]),q=(e,t)=>{Q(e),t&&K()},K=()=>{B(!0)},Q=e=>{if(!e)return;let t=W[e];if(void 0!==t){let e=J[t];e&&j(e)}};f(()=>{if(T&&!Y){let e=W[T?.mediaId];if(void 0!==e){let t=J[e]??G?.featuredImage;t&&j(t)}}},[T,W,J,G?.featuredImage,j,Y]);let $=c(()=>{let e="popup"===p(A?.ftClickOpenLightBox,O)||p(A?.clickOpenLightBox,O);return e||"edit"!==S||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[A?.ftClickOpenLightBox,A?.clickOpenLightBox,O,S]),ee=()=>J.length>0?h.map(m(P),e=>u(e)?t(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:A?.ftNavigationPosition,imageData:{imageShape:V?.ftShape,imageAlign:V?.align,imageLayout:V?.position},dotData:{dotSize:A?.ftDotSize,dotGapToCarousel:A?.ftDotGapToCarousel,dotStyle:A?.ftDotStyle}}):null):null,et=`
|
|
3
3
|
<svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
|
|
5
5
|
<path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
|
|
@@ -23,4 +23,4 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineS
|
|
|
23
23
|
<path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
|
|
24
24
|
<path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`,ea=t(b,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:L},{text:"sync data",callback:"syncProduct"}],additionalMedia:et}),{wrapperClasses:ei}=M(k);return e("div",{...x,className:ei,style:H,children:[t("style",{dangerouslySetInnerHTML:{__html:E({settings:{...A,...V},uid:v?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(X)&&t(y,{...w,gallery:J,priorityFeatureImage:z,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),"only-feature"===X&&t(
|
|
26
|
+
`,ea=t(b,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:L},{text:"sync data",callback:"syncProduct"}],additionalMedia:et}),{wrapperClasses:ei}=M(k);return e("div",{...x,className:ei,style:H,children:[t("style",{dangerouslySetInnerHTML:{__html:E({settings:{...A,...V},uid:v?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(X)&&t(y,{...w,gallery:J,priorityFeatureImage:z,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),"only-feature"===X&&t(I,{gallery:J,...w,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),["one-col","two-col"].includes(X)&&t(Z,{gallery:J,...w,onHandleClickImage:(e,t)=>q(e||"",t),noDataChildren:ea,children:ee()}),$&&t(D,{productImages:J,builderPropUID:v?.uid,open:F,onHandleClose:()=>B(!1),imageRatio:i(V?.ftShape)}),m(P,!0)]})};export{ProductImagesV2 as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as l,useProduct as C,useCurrentDevice as o,useCurrentVariant as r,useSelectedOption as n,useEditorMode as d,useProductStore as s,getResponsiveValueByScreen as p,filterToolbarPreview as c}from"@gem-sdk/core";import{useMemo as m,useState as f,useEffect as g,Children as h,isValidElement as u}from"react";import y from"./components/feature-gallery/FeatureImageWithGallery.js";import
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineSetting as a,getAspectRatio as i}from"./common/common.js";import{useProductShopifyEditLink as l,useProduct as C,useCurrentDevice as o,useCurrentVariant as r,useSelectedOption as n,useEditorMode as d,useProductStore as s,getResponsiveValueByScreen as p,filterToolbarPreview as c}from"@gem-sdk/core";import{useMemo as m,useState as f,useEffect as g,Children as h,isValidElement as u}from"react";import y from"./components/feature-gallery/FeatureImageWithGallery.js";import I from"./components/feature-only/OnlyFeatureImage.js";import D from"./components/lightbox/ProductImagesLightBox.js";import b from"../../../common/components/NoDataState.js";import{getProductImagesClassName as M}from"./composables/getProductImagesClassName.js";import{getBorderActiveCss as E}from"./common/getBorderActiveCss.js";import Z from"./components/gallery-grid/GalleryGrid.js";let getProductGallery=e=>e?.medias?.edges.map(e=>e?.node),LAYOUT_FEATURE_IMAGE_GALLERY=["bottom-left","bottom-center","left","right","inside-left","inside-right","inside-bottom"],ProductImagesV3=w=>{let L=m(()=>a(w),[w]),{redirectProductShopifyLink:V}=l(),{setting:k,styles:v,builderProps:A,builderAttrs:O,style:_,children:x}=L,B=C(),H=o(),P=r(),{isChangeSelectedOption:F}=n(),G=d(),T=s(e=>e.setProductFeaturedImage),[j,S]=f(!1),R=e=>e?.medias?.edges.find(e=>["VIDEO","EXTERNAL_VIDEO"].includes(e?.node?.contentType??""))?.node,N=e=>e?.featuredImage,U=e=>e?.medias?.edges.find(e=>e?.node?.contentType==="MODEL_3D")?.node,Y=m(()=>k?.typeDisplay==="all-images"&&!F,[F,k?.typeDisplay]),z=m(()=>{if(Y){let e;switch(k?.preDisplay){case"1st-images":e=N(B);break;case"1st-3d-mode":e=U(B);break;case"1st-video":e=R(B);break;case"1st-available-variant":e=P?.media}return T(e),e}},[Y,k?.preDisplay,T,B,P?.media]),J=m(()=>k?.filterByVariant==="selected_variant",[k?.filterByVariant]),W=m(()=>{let e=getProductGallery(B);if(!e?.length)return[{id:B?.featuredImage?.id||"noImageError",baseID:B?.featuredImage?.baseID||"noImageError",src:B?.featuredImage?.src||"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",width:B?.featuredImage?.width||480,height:B?.featuredImage?.height||480}];if(!J||!P?.selectedOptions?.length)return e;let t=P.selectedOptions.map(e=>e.value).filter(Boolean).map(e=>e?.trim().toLowerCase()),a=t.join("-"),i=e=>e.toLowerCase().trim().replace(/[\s_]+/g,"-").replace(/[^a-z\d-]/g,"").replace(/-+/g,"-"),l=e?.filter(e=>{if(!e?.alt)return!1;let t=i(e.alt),l=i(a),C="all-variants"===t,o=t===l||t.includes(l);return C||o});return l?.length>0?l:e},[P?.selectedOptions,J,B]),X=m(()=>W.reduce((e,t,a)=>t?{...e,[t.id]:a}:e,{}),[W]),q=m(()=>p(v?.position,H),[H,v?.position]),K=(e,t)=>{$(e),t&&Q()},Q=()=>{S(!0)},$=e=>{if(!e)return;let t=X[e];if(void 0!==t){let e=W[t];e&&T(e)}};g(()=>{if(P&&!Y){let e=X[P?.mediaId];if(void 0!==e){let t=W[e]??B?.featuredImage;t&&T(t)}}},[P,X,W,B?.featuredImage,T,Y]);let ee=m(()=>{let e="popup"===p(k?.ftClickOpenLightBox,H)||p(k?.clickOpenLightBox,H);return e||"edit"!==G||window?.parent?.postMessage?.(JSON.stringify({type:"active-modal",value:open}),"*"),e},[k?.ftClickOpenLightBox,k?.clickOpenLightBox,H,G]),et=()=>W.length>0?h.map(c(x),e=>u(e)?t(e.type,{...e.props,isInsideProductImage:!0,navigationPosition:k?.ftNavigationPosition,imageData:{imageShape:v?.ftShape,imageAlign:v?.align,imageLayout:v?.position},dotData:{dotSize:k?.ftDotSize,dotGapToCarousel:k?.ftDotGapToCarousel,dotStyle:k?.ftDotStyle}}):null):null,ea=`
|
|
3
3
|
<svg viewBox="0 0 452 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
4
|
<path d="M0 7.99999C0 3.58171 3.58172 0 8 0H444C448.418 0 452 3.58172 452 8V392C452 396.418 448.418 400 444 400H8C3.58173 400 0 396.418 0 392V7.99999Z" fill="#F9F9F9"/>
|
|
5
5
|
<path d="M208.148 348.801C239.683 348.75 265.245 347.272 265.242 345.499C265.239 343.726 239.673 342.33 208.138 342.381C176.603 342.432 151.041 343.91 151.044 345.683C151.047 347.456 176.614 348.851 208.148 348.801Z" fill="#E6E6E6"/>
|
|
@@ -23,4 +23,4 @@ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{setDefaultWhenUndefineS
|
|
|
23
23
|
<path opacity="0.2" d="M293.196 231.862C306.954 231.862 318.106 217.921 318.106 200.724C318.106 183.527 306.954 169.586 293.196 169.586C279.439 169.586 268.286 183.527 268.286 200.724C268.286 217.921 279.439 231.862 293.196 231.862Z" fill="white"/>
|
|
24
24
|
<path opacity="0.2" d="M293.196 247.637C313.923 247.637 330.726 226.634 330.726 200.725C330.726 174.816 313.923 153.812 293.196 153.812C272.469 153.812 255.666 174.816 255.666 200.725C255.666 226.634 272.469 247.637 293.196 247.637Z" fill="white"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`,ei=t(
|
|
26
|
+
`,ei=t(b,{elementType:"secondary",description:"Catch your customer's attention with attracted media.",descriptionActions:[{text:"Add image",callback:V},{text:"sync data",callback:"syncProduct"}],additionalMedia:ea}),{wrapperClasses:el}=M(w);return e("div",{...O,className:el,style:_,children:[t("style",{dangerouslySetInnerHTML:{__html:E({settings:{...k,...v},uid:A?.uid,type:"React"})}}),LAYOUT_FEATURE_IMAGE_GALLERY.includes(q)&&t(y,{...L,isFilterByVariantEnabled:J,gallery:W,priorityFeatureImage:z,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,children:et()}),"only-feature"===q&&t(I,{gallery:W,...L,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,isFilterByVariantEnabled:J,children:et()}),["one-col","two-col"].includes(q)&&t(Z,{gallery:W,...L,onHandleClickImage:(e,t)=>K(e||"",t),noDataChildren:ei,children:et()}),ee&&t(D,{productImages:W,builderPropUID:A?.uid,open:j,onHandleClose:()=>S(!1),imageRatio:i(v?.ftShape)}),c(x,!0)]})};export{ProductImagesV3 as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as l,useMemo as a,useEffect as i}from"react";import{useRenderMode as c,useCurrentDevice as s,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as f,useProductsQuery as P,useCollectionQuery as b,flattenConnection as k,ProductListProvider as T,filterToolbarPreview as I}from"@gem-sdk/core";import v from"../SalePageProductListWarning.js";import y from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as N}from"./common/styles.js";import{If as S}from"@gem-sdk/system";import{getClass as C}from"./common/classes.js";import{getData as E}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let ProductNotFound=o(()=>import("../ProductNotFound.js"),{loading:d}),ProductList=o=>{let{children:W,styles:j,builderProps:x,setting:G,builderAttrs:M}=o,{isRelatedProduct:B,productSetting:A}=E(o),F=A.relatedTag&&A.relatedTag[0],{isEditMode:Q,isPreviewSharePageMode:z}=c(),D=s(),H=n(),R=u(e=>e.dynamicProduct),$=u(e=>e.dynamicCollection),[_,V]=l(1),[q,U]=l(!0),[J,K]=l(),[X,Y]=l(!1),Z="GP_FUNNEL_PAGE"===H,ee="GP_COLLECTION"==H;ee&&(A.productSrc="DynamicCollection",A.collectionId=$?.collectionId??"latest");let et=A?.productSrc??"Collection",er=R?.productId&&R?.productId!==A.relatedProductId?R?.productId:A.relatedProductId,eo=m(),ed=u(e=>e.publicStoreFrontData),el=a(()=>g(ed)?h(ed):eo,[ed]),{data:ea}=p(B&&er?er:void 0,{revalidateOnMount:Q||z},el),ei=A.relatedTag&&"tags"===A.relatedTag[0]&&(!ea?.tags||ea?.tags.length===0),ec=A.relatedTag&&"collection"===A.relatedTag[0]&&(!ea?.collections?.edges||ea?.collections.edges.length===0),es=A.relatedTag&&"vendor"===A.relatedTag[0]&&!ea?.vendor,en=ei||ec||es,eu=f(J,{revalidateOnMount:Q||z},el),em=Q||z,eg=P("PickProduct"===et?A?.productIds:void 0,{revalidateOnMount:em},{defaultSelectedProductCount:A?.numOfSelectedProducts}),eh=a(()=>({id:A?.collectionId??"latest",numberOfProducts:G?.numberOfProducts??4,orderBy:G?.orderBy}),[A?.collectionId,Number(G?.numberOfProducts),G?.orderBy]),ep=b("PickProduct"!==et?eh:void 0,{revalidateOnMount:em});i(()=>{if(B&&ea&&A.relatedTag&&"recommended-product"!==A.relatedType){let e;switch(Y(!1),A.hasRelatedExclude&&(e=A?.relatedExclude&&A.relatedExclude.split(",").map(e=>e.trim())),A.relatedTag[0]){case"vendor":K({first:G?.numberOfProducts,where:{vendor:A.relatedTag&&"vendor"===A.relatedTag[0]?ea?.vendor:"",idNEQ:ea.id}});break;case"collection":{let t;let r=ea?.collections?.edges.map(e=>e.node?.id);if(!r||r?.length===0){Y(!0);break}K(t=e&&e.length>0?{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r},{titleNotIn:e}]}]}}:{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:r}]}]}});break}case"tags":{let t;if(!ea.tags||0===ea.tags.length){Y(!0);break}K(t=e&&e.length>0?{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags},{nameNotIn:e}]}]}}:{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags}]}]}})}}}},[ea,A.relatedType,A.relatedTag,G?.numberOfProducts,A.relatedExclude,A.hasRelatedExclude,B]);let ef="PickProduct"===et?eg.isValidating:ep.isValidating,eP="PickProduct"===et?eg.isLoading:ep.isLoading,eb="PickProduct"===et?eg.error:ep.error,ek=ep.data?.collections?.edges?.[0]?.node,eT="PickProduct"===et?k(eg.data?.products):k(ek?.products),eI=eu?.data?.products?k(eu?.data?.products):void 0,ev=B&&eI?eI:"PickProduct"===et&&A?.productIds?.length?A?.productIds?.map(e=>eT?.find(t=>t?.baseID===e)).filter(Boolean)??eT:"PickProduct"!==et?eT:eT.filter((e,t)=>t<(A?.numOfSelectedProducts??4)),ey=a(()=>X&&B&&Q||!ev.length&&!eP&&q&&Q,[q,eP,X,B,Q,ev.length]),eO=a(()=>!ev||X&&B,[X,B,ev]),ew=a(()=>{if(!G?.sameHeight)return[];let e=0,t=Math.ceil((ev?.length??0)/+(G?.slidesToShow?.[D]??1));return Array.from(Array(ev?.length??0)).map((r,o)=>(o>=+(G?.slidesToShow?.[D]??1)*(e+1)&&++e,{gridRow:`${1+_*e}/${_+1+_*e}`,marginBottom:e+1<t?L(j?.horizontalGutter,D):void 0}))},[G?.sameHeight,G?.slidesToShow,_,ev?.length,D,j?.horizontalGutter]),eN=a(()=>ef||eP||eb||!ev||X&&B,[eb,eP,X,B,ef,ev]);i(()=>{eN||setTimeout(()=>{let{builderData:e}=x??{},t=e?.childrens?.[0];if(!t)return;let r=document.querySelector(`[data-id=${t}] div`);r&&V(r.childElementCount||1)},Q?0:500)},[x,eN,Q]);let eS=a(()=>({collection:ek,products:ev,settings:{loop:G?.loop??{desktop:!1},scrollMode:G?.scrollMode??{desktop:"snap"},slidesToShow:G?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:j?.layout,dot:G?.dot,dotStyle:G?.dotStyle,arrow:G?.arrow,controlOverContent:G?.controlOverContent},styles:{horizontalGutter:j?.horizontalGutter,verticalGutter:j?.verticalGutter,fullWidth:j?.fullWidth,spacing:j?.spacing,width:j?.width,height:j?.height}}),[ek,ev,G,j]);if(x?.isPreview&&Z)return e(t,{});if(ey)return e(t,{children:S(q,e(ProductNotFound,{builderAttrs:M,collectionHandle:ek?.handle,productSrc:et,onClose:()=>U(!1),children:W,relatedTagString:F,assignProductNoTags:en,noAssignedProduct:!er}))});let{productListWrapStyle:eC,productListContentStyle:eE,productListWrapAlignStyle:eL}=N(o),{productListWrapClass:eW}=C(o),ej=()=>e(t,{children:S(j?.layout==="grid",e(O,{...o,productSortedById:ev,generateGridRowArray:ew}),e(w,{...o,productSortedById:ev}))});return r("div",{...M,className:eW,style:eC,children:[!!j?.preloadBgImage&&r(y,{children:[!!j.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage.desktop.image.src,as:"image"}),!!j.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage?.tablet?.image?.src,as:"image"}),!!j.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage?.mobile?.image?.src,as:"image"})]}),ef||eP?e(d,{}):eb?r("div",{children:["Error: ",eb?.message]}):eO?e("div",{children:"Products not found"}):e(T,{...eS,children:e("div",{className:"gp-flex gp-w-full",style:eL,children:r("div",{style:eE,children:[Z&&e(v,{}),ej()]})})}),I(W,!0)]})};export{ProductList as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import r from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as l,useMemo as
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import r from"next/dynamic";import d from"../../../common/components/Loading.js";import{useState as l,useMemo as a,useEffect as i}from"react";import{useRenderMode as c,useCurrentDevice as s,usePageType as n,usePageStore as u,useFetchHandle as m,hasPublicStoreFrontData as g,createStoreFrontFetcher as h,useProductQuery as p,useProductsQueryAll as P,useProductsQuery as f,useCollectionQuery as b,flattenConnection as k,ProductListProvider as I,filterToolbarPreview as T}from"@gem-sdk/core";import y from"../SalePageProductListWarning.js";import v from"next/head";import O from"./ProductListGridLayout.js";import w from"./ProductListCarouselLayout.js";import{getStyle as N}from"./common/styles.js";import{If as S}from"@gem-sdk/system";import{getClass as C}from"./common/classes.js";import{getData as E}from"./common/helpers.js";import{getPropertyByDevice as L}from"../../../dialog/common/helpers.js";let ProductNotFound=r(()=>import("../ProductNotFound.js"),{loading:d}),ProductList=r=>{let{children:W,styles:j,builderProps:x,setting:G,builderAttrs:A}=r,{isRelatedProduct:M,productSetting:B}=E(r),F=B.relatedTag&&B.relatedTag[0],{isEditMode:Q,isPreviewSharePageMode:z}=c(),D=s(),H=n(),R=u(e=>e.dynamicProduct),$=u(e=>e.dynamicCollection),[_,V]=l(1),[q,U]=l(!0),[J,K]=l(),[X,Y]=l(!1),Z="GP_FUNNEL_PAGE"===H,ee="GP_COLLECTION"==H;ee&&(B.productSrc="DynamicCollection",B.collectionId=$?.collectionId??"latest");let et=B?.productSrc??"Collection",eo=R?.productId&&R?.productId!==B.relatedProductId?R?.productId:B.relatedProductId,er=m(),ed=u(e=>e.publicStoreFrontData),el=a(()=>g(ed)?h(ed):er,[ed]),{data:ea}=p(M&&eo?eo:void 0,{revalidateOnMount:Q||z},el),ei=B.relatedTag&&"tags"===B.relatedTag[0]&&(!ea?.tags||ea?.tags.length===0),ec=B.relatedTag&&"collection"===B.relatedTag[0]&&(!ea?.collections?.edges||ea?.collections.edges.length===0),es=B.relatedTag&&"vendor"===B.relatedTag[0]&&!ea?.vendor,en=ei||ec||es,eu=P(J,{revalidateOnMount:Q||z},el),em=Q||z,eg=f("PickProduct"===et?B?.productIds:void 0,{revalidateOnMount:em},{defaultSelectedProductCount:B?.numOfSelectedProducts}),eh=a(()=>({id:B?.collectionId??"latest",numberOfProducts:G?.numberOfProducts??4,orderBy:G?.orderBy}),[B?.collectionId,Number(G?.numberOfProducts),G?.orderBy]),ep=b("PickProduct"!==et?eh:void 0,{revalidateOnMount:em});i(()=>{if(M&&ea&&B.relatedTag&&"recommended-product"!==B.relatedType){let e;switch(Y(!1),B.hasRelatedExclude&&(e=B?.relatedExclude&&B.relatedExclude.split(",").map(e=>e.trim())),B.relatedTag[0]){case"vendor":K({first:G?.numberOfProducts,where:{vendor:B.relatedTag&&"vendor"===B.relatedTag[0]?ea?.vendor:"",idNEQ:ea.id}});break;case"collection":{let t;let o=ea?.collections?.edges.map(e=>e.node?.id);if(!o||o?.length===0){Y(!0);break}K(t=e&&e.length>0?{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:o},{titleNotIn:e}]}]}}:{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasCollectionProductsWith:[{hasCollectionWith:[{idIn:o}]}]}});break}case"tags":{let t;if(!ea.tags||0===ea.tags.length){Y(!0);break}K(t=e&&e.length>0?{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags},{nameNotIn:e}]}]}}:{first:G?.numberOfProducts,where:{idNEQ:ea.id,hasProductTagsWith:[{hasTagsWith:[{nameIn:ea.tags}]}]}})}}}},[ea,B.relatedType,B.relatedTag,G?.numberOfProducts,B.relatedExclude,B.hasRelatedExclude,M]);let eP="PickProduct"===et?eg.isValidating:ep.isValidating,ef="PickProduct"===et?eg.isLoading:ep.isLoading,eb="PickProduct"===et?eg.error:ep.error,ek=ep.data?.collections?.edges?.[0]?.node,eI="PickProduct"===et?k(eg.data?.products):k(ek?.products),eT=u(e=>e.assignedProductIds),ey=u(e=>e.isApplyAllProducts),ev=a(()=>(eT??[]).length>0&&!ey||ey,[eT,ey]),eO=eu?.data?.products&&ev?k(eu?.data?.products):[],ew=M?eO:"PickProduct"===et&&B?.productIds?.length?B?.productIds?.map(e=>eI?.find(t=>t?.baseID===e)).filter(Boolean)??eI:"PickProduct"!==et?eI:eI.filter((e,t)=>t<(B?.numOfSelectedProducts??4)),eN=a(()=>X&&M&&Q||!ew.length&&!ef&&q&&Q,[q,ef,X,M,Q,ew.length]),eS=a(()=>!ew||X&&M,[X,M,ew]),eC=a(()=>{if(!G?.sameHeight)return[];let e=0,t=Math.ceil((ew?.length??0)/+(G?.slidesToShow?.[D]??1));return Array.from(Array(ew?.length??0)).map((o,r)=>(r>=+(G?.slidesToShow?.[D]??1)*(e+1)&&++e,{gridRow:`${1+_*e}/${_+1+_*e}`,marginBottom:e+1<t?L(j?.horizontalGutter,D):void 0}))},[G?.sameHeight,G?.slidesToShow,_,ew?.length,D,j?.horizontalGutter]),eE=a(()=>eP||ef||eb||!ew||X&&M,[eb,ef,X,M,eP,ew]),eL=ea?.collections?.edges.map(e=>e.node?.id)??[];i(()=>{eE||setTimeout(()=>{let{builderData:e}=x??{},t=e?.childrens?.[0];if(!t)return;let o=document.querySelector(`[data-id=${t}] div`);o&&V(o.childElementCount||1)},Q?0:500)},[x,eE,Q,eL]);let eW=a(()=>({collection:ek,products:ew,settings:{loop:G?.loop??{desktop:!1},scrollMode:G?.scrollMode??{desktop:"snap"},slidesToShow:G?.slidesToShow??{desktop:4,tablet:3,mobile:1},layout:j?.layout,dot:G?.dot,dotStyle:G?.dotStyle,arrow:G?.arrow,controlOverContent:G?.controlOverContent},styles:{horizontalGutter:j?.horizontalGutter,verticalGutter:j?.verticalGutter,fullWidth:j?.fullWidth,spacing:j?.spacing,width:j?.width,height:j?.height}}),[ek,ew,G,j]);if(x?.isPreview&&Z)return e(t,{});if(eN)return e(t,{children:S(q,e(ProductNotFound,{builderAttrs:A,collectionHandle:ek?.handle,productSrc:et,onClose:()=>U(!1),children:W,relatedTagString:F,assignProductNoTags:en,noAssignedProduct:!eo}))});let{productListWrapStyle:ej,productListContentStyle:ex,productListWrapAlignStyle:eG}=N(r),{productListWrapClass:eA}=C(r),eM=()=>e(t,{children:S(j?.layout==="grid",e(O,{...r,productSortedById:ew,generateGridRowArray:eC}),e(w,{...r,productSortedById:ew}))});return o("div",{...A,className:eA,style:ej,children:[!!j?.preloadBgImage&&o(v,{children:[!!j.backgroundImage?.desktop?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage.desktop.image.src,as:"image"}),!!j.backgroundImage?.tablet?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage?.tablet?.image?.src,as:"image"}),!!j.backgroundImage?.mobile?.image?.src&&e("link",{rel:"preload",href:j.backgroundImage?.mobile?.image?.src,as:"image"})]}),eP||ef?e(d,{}):eb?o("div",{children:["Error: ",eb?.message]}):eS?e("div",{children:"Products not found"}):e(I,{...eW,children:e("div",{className:"gp-flex gp-w-full",style:eG,children:o("div",{style:ex,children:[Z&&e(y,{}),eM()]})})}),T(W,!0)]})};export{ProductList as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "12.0.0-dev.
|
|
3
|
+
"version": "12.0.0-dev.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"i18n:generate-keys-usage": "node ./scripts/en-keys-usage.js"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "12.0.0-dev.
|
|
31
|
-
"@gem-sdk/styles": "12.0.0-dev.
|
|
32
|
-
"@gem-sdk/system": "12.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "12.0.0-dev.53",
|
|
31
|
+
"@gem-sdk/styles": "12.0.0-dev.53",
|
|
32
|
+
"@gem-sdk/system": "12.0.0-dev.53",
|
|
33
33
|
"@types/react-transition-group": "^4.4.12",
|
|
34
34
|
"tsup": "8.5.1",
|
|
35
35
|
"postcss-import": "16.1.1",
|