@gem-sdk/components 3.1.0-staging.1137 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/article/components/ArticleImage.js +1 -1
- package/dist/cjs/article/components/ArticleImage.liquid.js +4 -4
- package/dist/cjs/dialog/common/classes.js +1 -1
- package/dist/cjs/dialog/components/Dialog.js +1 -1
- package/dist/cjs/dialog/components/Dialog.liquid.js +1 -1
- package/dist/cjs/grid/components/row/common/classes.js +1 -1
- package/dist/cjs/hero-banner/common/classes.js +1 -1
- package/dist/cjs/hero-banner/common/helpers.js +1 -1
- package/dist/cjs/hero-banner/common/styles.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +7 -7
- package/dist/cjs/hero-banner/settings/configs/settings.js +1 -1
- package/dist/cjs/icon-list-v2/common/helpers.js +1 -1
- package/dist/cjs/icon-list-v2/components/IconList.js +1 -1
- package/dist/cjs/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/cjs/image/common/attrs.js +1 -1
- package/dist/cjs/product/components/dynamic-checkout/Button.liquid.js +1 -1
- package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.liquid.js +22 -30
- package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-quantity/common/classes.js +1 -1
- package/dist/cjs/product/settings/product-list/configs/settings-v2.js +1 -1
- package/dist/cjs/text/common/styles.js +1 -1
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +6 -6
- package/dist/esm/article/components/ArticleImage.js +1 -1
- package/dist/esm/article/components/ArticleImage.liquid.js +4 -4
- package/dist/esm/dialog/common/classes.js +1 -1
- package/dist/esm/dialog/components/Dialog.js +1 -1
- package/dist/esm/dialog/components/Dialog.liquid.js +1 -1
- package/dist/esm/grid/components/row/common/classes.js +1 -1
- package/dist/esm/hero-banner/common/classes.js +1 -1
- package/dist/esm/hero-banner/common/helpers.js +1 -1
- package/dist/esm/hero-banner/common/styles.js +1 -1
- package/dist/esm/hero-banner/components/HeroBanner.liquid.js +10 -10
- package/dist/esm/hero-banner/settings/configs/settings.js +1 -1
- package/dist/esm/icon-list-v2/common/helpers.js +1 -1
- package/dist/esm/icon-list-v2/components/IconList.js +1 -1
- package/dist/esm/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/esm/image/common/attrs.js +1 -1
- package/dist/esm/product/components/dynamic-checkout/Button.liquid.js +1 -1
- package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.liquid.js +24 -32
- package/dist/esm/product/components/product-list/common/helpers.js +1 -1
- package/dist/esm/product/components/product-quantity/common/classes.js +1 -1
- package/dist/esm/product/settings/product-list/configs/settings-v2.js +1 -1
- package/dist/esm/text/common/styles.js +1 -1
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +5 -5
- package/dist/types/index.d.ts +0 -1
- package/package.json +4 -4
|
@@ -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"),Image=require("../../image/components/Image.js"),React=require("react");const ArticleImage=({className:e,setting:t={},styles:r={},advanced:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Image=require("../../image/components/Image.js"),React=require("react");const ArticleImage=({className:e,setting:t={},styles:r={},advanced:a,builderProps:s})=>{let i=core.useArticleStore(e=>e.article),c=React.useMemo(()=>{let{src:e,alt:t}=i?.media??{};return{src:e,alt:t}},[i]);return jsxRuntime.jsx("div",{className:core.cls("gp-text-center",e),style:{borderRadius:"inherit"},children:jsxRuntime.jsx(Image.default,{builderProps:s,setting:{...t,alt:c.alt,image:c,disableNoDataState:!0},styles:r,advanced:a})})};exports.default=ArticleImage;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Image_liquid=require("../../image/components/Image.liquid.js"),helpers=require("../../helpers.js");const ArticleImage=e=>{let t=e?.setting??{},{
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Image_liquid=require("../../image/components/Image.liquid.js"),helpers=require("../../helpers.js");const ArticleImage=e=>{let t=e?.setting??{},{builderProps:a}=e,i=t?.openNewTab?"_blank":"_self";return core.template`
|
|
3
3
|
<div class="${core.cls("gp-text-center",e?.className)}" style="border-radius: inherit">
|
|
4
4
|
${t?.linkArticle?`
|
|
5
|
-
<a href="${helpers.getLinkArticle(t.linkArticle,t.customURL)}" target="${
|
|
6
|
-
${Image_liquid.default({...e,styles:e.styles,setting:{...e.setting,alt:
|
|
5
|
+
<a href="${helpers.getLinkArticle(t.linkArticle,t.customURL)}" target="${i}" title="{{article.title}}">
|
|
6
|
+
${Image_liquid.default({...e,styles:e.styles,setting:{...e.setting,alt:"{{article.image.alt}}",image:{src:"{{article.image.src | img_url: '1024x1024'}}",alt:"{{article.image.alt}}"},srcSet:{desktop:{src:"{{article.image.src | img_url: '1024x1024'}}"}},disableNoDataState:!0},advanced:e.advanced,builderAttrs:{"data-id":a?.uid}})}
|
|
7
7
|
</a>
|
|
8
8
|
`:`
|
|
9
|
-
${Image_liquid.default({...e,styles:e.styles,setting:{...e.setting,alt:"{{article.image.alt}}",image:{src:"{{article.image.src | img_url: '1024x1024'}}",alt:"{{article.image.alt}}"},srcSet:{desktop:{src:"{{article.image.src | img_url: '1024x1024'}}"}},disableNoDataState:!0},advanced:e.advanced,builderAttrs:{"data-id":
|
|
9
|
+
${Image_liquid.default({...e,styles:e.styles,setting:{...e.setting,alt:"{{article.image.alt}}",image:{src:"{{article.image.src | img_url: '1024x1024'}}",alt:"{{article.image.alt}}"},srcSet:{desktop:{src:"{{article.image.src | img_url: '1024x1024'}}"}},disableNoDataState:!0},advanced:e.advanced,builderAttrs:{"data-id":a?.uid}})}
|
|
10
10
|
`}
|
|
11
11
|
</div>
|
|
12
12
|
`};exports.default=ArticleImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var helpers=require("../../helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getContainClasses=
|
|
1
|
+
"use strict";var helpers=require("../../helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getContainClasses=e=>{let s="gp-dialog gp-bg-transparent gp-z-[999999]";return e&&(s+=` ${e}`),{...composeClasses(s)}},getBackdropClasses=e=>{let s="gp-fixed gp-inset-0 gp-z-50 gp-flex gp-overflow-y-auto gp-overflow-x-hidden gp-shadow-xl";return"center"===e&&(s+=" gp-items-center gp-justify-center"),"top"===e&&(s+=" gp-justify-center gp-items-start"),"top-right"===e&&(s+=" gp-justify-end gp-items-start"),"top-left"===e&&(s+=" gp-justify-start gp-items-start"),"bottom"===e&&(s+=" gp-items-end gp-justify-center"),"left"===e&&(s+=" gp-items-center gp-justify-start"),"right"===e&&(s+=" gp-items-center gp-justify-end"),"bottom-left"===e&&(s+=" gp-items-end gp-justify-start"),"bottom-right"===e&&(s+=" gp-items-end gp-justify-end"),{...composeClasses(s)}},getOverlayClasses=()=>({...composeClasses("gp-fixed gp-inset-0 gp-block gp-transition-all gp-duration-100")}),getDialogContentClasses=({setting:e,enableEffect:s,isILP:t})=>{let{effectType:o,background:n,closeButtonPosition:g}=e??{},a="gp-relative gp-max-h-full gp-max-w-full";return"fade"===o&&s&&(a+=" gp-animate-[fadeIn_0.4s_ease-in]"),"zoom"===o&&s&&(a+=" gp-animate-[zoomIn_0.3s_ease-in]"),"zoom-out"===o&&s&&(a+=" gp-animate-[zoomOut_0.3s_ease-in]"),"horizontal"===o&&s&&(a+=" gp-animate-[slideInLeft_0.3s_ease-in]"),"vertical"===o&&s&&(a+=" gp-animate-[slideInUp_0.3s_ease-in]"),"unfold"===o&&s&&(a+=" gp-animate-[unfold_0.3s_ease-in-out]"),"outside"!==g&&(a+=" gp-overflow-hidden"),helpers.isTransparentColor(n?.desktop?.color)||(a+=" gp-shadow-xl"),!s&&t&&(a+=" gp-animate-[fadeOut_0.2s_ease-out]"),{...composeClasses(a)}},getHeadContentClasses=()=>({...composeClasses("gp-inline-block gp-h-screen gp-align-middle")}),getButtonContentClasses=e=>{let s="gp-absolute gp-top-0 gp-right-0 gp-inline-flex gp-items-center gp-justify-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-overflow-hidden gp-z-1";return"outside"===e&&(s+=" gp-translate-x-1/2 -gp-translate-y-1/2 gp-shadow-md gp-z-[999999]"),{...composeClasses(s)}},getSvgContentClasses=()=>({...composeClasses("[&>svg]:!gp-w-auto [&>svg]:!gp-h-[var(--height-icon)]")}),getBodyContentClasses=()=>({...composeClasses("gp-h-full gp-w-full gp-overflow-y-auto gp-overflow-x-hidden !gp-max-h-screen")});exports.getBackdropClasses=getBackdropClasses,exports.getBodyContentClasses=getBodyContentClasses,exports.getButtonContentClasses=getButtonContentClasses,exports.getContainClasses=getContainClasses,exports.getDialogContentClasses=getDialogContentClasses,exports.getHeadContentClasses=getHeadContentClasses,exports.getOverlayClasses=getOverlayClasses,exports.getSvgContentClasses=getSvgContentClasses;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),ButtonIcon=require("../../button/components/ButtonIcon.js"),useDialog=require("../hooks/useDialog.js");const Dialog=e=>{let{setting:s,children:t,builderProps:l,style:a,advanced:r,builderAttrs:o}=e,n=r?.d,{name:i,fullScreen:c,width:y,height:m,position:d,overlayColor:u,overlayOpacity:g,iconSize:C,closeButtonPosition:j,iconSvg:x}=s??{},p=core.useEditorMode(),{ref:S,overlay:v,handleClickOverlay:b,closeModal:h,open:D,dialogId:f}=useDialog.useDialog(s,l,"edit"===p),B="edit"!==p,R=system.createAttr({...attrs.getAttr({uid:l?.uid||""})}),q=system.createStyle({...styles.getWrapperStyle(n)}),k=system.createClass({...classes.getContainClasses(r?.cssClass
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),ButtonIcon=require("../../button/components/ButtonIcon.js"),useDialog=require("../hooks/useDialog.js");const Dialog=e=>{let{setting:s,children:t,builderProps:l,style:a,advanced:r,builderAttrs:o}=e,n=r?.d,{name:i,fullScreen:c,width:y,height:m,position:d,overlayColor:u,overlayOpacity:g,iconSize:C,closeButtonPosition:j,iconSvg:x}=s??{},p=core.useEditorMode(),{ref:S,overlay:v,handleClickOverlay:b,closeModal:h,open:D,dialogId:f}=useDialog.useDialog(s,l,"edit"===p),B="edit"!==p,R=system.createAttr({...attrs.getAttr({uid:l?.uid||""})}),q=system.createStyle({...styles.getWrapperStyle(n)}),k=system.createClass({...classes.getContainClasses(r?.cssClass)}),A=system.createAttr({...attrs.getAttrContainer({uid:f||""})}),N=system.createStyle({...styles.getContainStyle()}),I=system.createClass({...classes.getBackdropClasses(d)}),L=system.createStyle({...styles.getBackdropStyle(a)}),O=system.createAttr({...attrs.getAttrOverlay()}),w=system.createClass({...classes.getOverlayClasses()}),E=system.createStyle({...styles.getOverlayStyle(g,u,a)}),M=system.createStyle({...styles.getDialogContentStyle({style:a,width:y,height:m,fullScreen:c})}),P=system.createClass({...classes.getDialogContentClasses({setting:s,enableEffect:D,isILP:B})}),T=system.createAttr({...attrs.getAttrClose()}),_=system.createClass({...classes.getHeadContentClasses()}),z=system.createStyle({...styles.getButtonContentStyle(s)}),H=system.createClass({...classes.getButtonContentClasses(j)}),W=system.createStyle({...styles.getSvgContentStyle(C)}),F=system.createClass({...classes.getSvgContentClasses()}),G=system.createStyle({...styles.getBodyContentStyle(s,a)}),J=system.createClass({...classes.getBodyContentClasses()});return jsxRuntime.jsx("div",{...R,style:q,children:(D||"edit"!==p)&&jsxRuntime.jsx("dialog",{ref:S,open:D,"aria-label":i,...A,className:k,style:N,children:jsxRuntime.jsxs("div",{"aria-label":"Backdrop",className:I,style:L,children:[system.If(!!u,jsxRuntime.jsx("div",{ref:v,...O,className:w,style:E,onClick:b,"aria-hidden":!0})),jsxRuntime.jsx("span",{className:_}),jsxRuntime.jsxs("div",{role:"dialog","aria-label":"Dialog content",...o,className:P,style:M,children:[jsxRuntime.jsx("button",{...T,type:"button",tabIndex:-1,className:H,style:z,onClick:h,children:jsxRuntime.jsx(ButtonIcon.default,{iconSvg:x??`<svg viewBox="0 0 12 12" fill="currentColor" style={svgContentStyle}>
|
|
3
3
|
<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>
|
|
4
4
|
</svg>`,styles:W,classes:F})}),jsxRuntime.jsx("div",{"aria-label":"Dialog body",style:G,className:J,children:core.isEmptyChildren(t)?jsxRuntime.jsx(ChildrenDroppable.default,{}):core.filterToolbarPreview(t)}),core.filterToolbarPreview(t,!0)]})]})})})};exports.default=Dialog;
|
|
@@ -1,4 +1,4 @@
|
|
|
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}=e,c=r?.d,{frequency:o=3,triggerPercentage:i=0,trigger:n,triggerTime:g,frequencyMode:d="once",mobileTrigger:m,mobileTriggerTime:C,closeOnClickOutside:p}=s??{},{name:$,fullScreen:S,width:v,height:u,position:f,overlayColor:b,overlayOpacity:A,iconSize:B,closeButtonPosition:L,iconSvg:h}=s??{},j=s?.dialogId??a?.uid,D=system.createStateOrContext({dialogId:j,trigger:n,triggerTime:g,frequency:o,triggerPercentage:i,mobileTrigger:m,mobileTriggerTime:C,closeOnClickOutside:p,frequencyMode:d,display:c}),O=system.createAttr({...attrs.getAttr({uid:a?.uid||""})}),q=system.createStyle({...styles.getWrapperStyle(c)}),E=system.createClass({...classes.getContainClasses(r?.cssClass
|
|
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}=e,c=r?.d,{frequency:o=3,triggerPercentage:i=0,trigger:n,triggerTime:g,frequencyMode:d="once",mobileTrigger:m,mobileTriggerTime:C,closeOnClickOutside:p}=s??{},{name:$,fullScreen:S,width:v,height:u,position:f,overlayColor:b,overlayOpacity:A,iconSize:B,closeButtonPosition:L,iconSvg:h}=s??{},j=s?.dialogId??a?.uid,D=system.createStateOrContext({dialogId:j,trigger:n,triggerTime:g,frequency:o,triggerPercentage:i,mobileTrigger:m,mobileTriggerTime:C,closeOnClickOutside:p,frequencyMode:d,display:c}),O=system.createAttr({...attrs.getAttr({uid:a?.uid||""})}),q=system.createStyle({...styles.getWrapperStyle(c)}),E=system.createClass({...classes.getContainClasses(r?.cssClass)}),k=system.createAttr({...attrs.getAttrContainer({uid:j||""})}),x=system.createStyle({...styles.getContainStyle()}),I=system.createClass({...classes.getBackdropClasses(f)}),P=system.createStyle({...styles.getBackdropStyle(l)}),_=system.createAttr({...attrs.getAttrOverlay()}),M=system.createClass({...classes.getOverlayClasses()}),R=system.createStyle({...styles.getOverlayStyle(A,b,l)}),z=system.createStyle({...styles.getDialogContentStyle({style:l,width:v,height:u,fullScreen:S})}),G=system.createClass({...classes.getDialogContentClasses({setting:s,enableEffect:!0,isILP:!1})}),N=system.createAttr({...attrs.getAttrClose()}),w=system.createClass({...classes.getHeadContentClasses()}),H=system.createStyle({...styles.getButtonContentStyle(s)}),J=system.createClass({...classes.getButtonContentClasses(L)}),T=system.createStyle({...styles.getSvgContentStyle(B)}),U=system.createClass({...classes.getSvgContentClasses()}),V=system.createStyle({...styles.getBodyContentStyle(s,l)}),W=system.createClass({...classes.getBodyContentClasses()}),F=()=>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")}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var system=require("@gem-sdk/system");const getClass=s=>{let{builderProps:e,advanced:l,className:g}=s,a=system.createClass({"gp-background-video gp-absolute gp-overflow-hidden gp-w-full gp-h-full left-0 top-0
|
|
1
|
+
"use strict";var system=require("@gem-sdk/system");const getClass=s=>{let{builderProps:e,advanced:l,className:g}=s,a=system.createClass({"gp-background-video gp-absolute gp-overflow-hidden gp-w-full gp-h-full left-0 top-0":!0}),t=system.createClass({"gp-bg-video gp-relative gp-h-full":!0}),p=system.createClass({...g&&{[g]:!0},...e?.uid&&{[e.uid]:!0},"gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full gp-grid-rows-[1fr]":!0,...l?.cssClass&&{[l?.cssClass]:!0}}),r=system.createClass({"gp-mx-auto gp-max-w-full [&_*]:gp-max-w-full":!0}),u=system.createClass({"gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-background-article":!0}),o=system.createClass({"!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]":!0});return{rowClass:p,backgroundBoxClass:a,backgroundBoxInnerClass:t,sectionClass:r,wrapperYoutubeClasses:u,iframeYoutubeClasses:o}};exports.getClass=getClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},t=s?.hover||s?.normal;return t&&"transparent"!==t&&"0%"!=helpers.getOpacityHover(e)},getOverlayClasses=e=>{let{overlayColor:s,hoverEffect:t}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(e)&&(a+=" gp-transition-all gp-duration-300"),t&&(a+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,o,!t)&&(a+=` ${core.getGlobalColorStateClass("bg",s,o,!t)}`),composeClasses(a)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:a}=s??{},l=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(a),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${l} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),a=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.enableTransitionHover=enableTransitionHover,exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},t=s?.hover||s?.normal;return t&&"transparent"!==t&&"0%"!=helpers.getOpacityHover(e)},getOverlayClasses=e=>{let{overlayColor:s,hoverEffect:t}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(e)&&(a+=" gp-transition-all gp-duration-300"),t&&(a+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,o,!t)&&(a+=` ${core.getGlobalColorStateClass("bg",s,o,!t)}`),composeClasses(a)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:a}=s??{},l=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(a),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${l} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),a=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.enableTransitionHover=enableTransitionHover,exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let i={};return core.DEVICES.map(l=>{let n=core.getResponsiveValueByScreen(e,l),a=core.getResponsiveValueByScreen(t,l),r=core.getResponsiveValueByScreen(o,l);i={...i,[l]:1>=(n?.cols?.length||1)?a:r}}),i},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},i={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},l={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(i,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(i,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(i,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return l},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,i)=>{if(!e)return"";let l=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(l,t),t,i)})`,r=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${r}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let i={};return core.DEVICES.forEach(l=>{i={...i,[l]:getBgImageByScreen(e,l,t,o)}}),core.makeStyleResponsive("bgi",i)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e?.[o]?.attachment;t={...t,[o]:"fixed"===i?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let i=core.getAspectRatioGlobalSize(t),l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(t,l),a=!!getDataVideoHeroBannerResponsive(l,e),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s,p=g&&a;p&&(i={...i,[l]:"16/9"}),o&&o[l]&&getDataVideoHeroBannerResponsive(l,e)?.data?.videoType==="html5"&&(i={...i,[l]:o[l]})}),core.makeStyleResponsive("aspect",i)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=core.getResponsiveValueByScreen(e,i),n=!!getDataVideoHeroBannerResponsive(i,t),a=l?.shape,r=l?.height,s="original"===a&&"fit-content"!==r&&!n;o={...o,[i]:s?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e?.[o];i&&(t={...t,[o]:"default"===i?"var(--g-ct-w, 1200px)":i})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:i}=e,l=-i;if(o<l)return 0;if(o>t)return 100;let n=(o-l)/(t-l)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=isScaleImage({enableParallax:t,attachment:e[i]?.attachment});o={...o,[i]:t?"150%":l?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=isScaleImage({enableParallax:t,attachment:e[i]?.attachment});o={...o,[i]:l?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),i=getWidthHeroBanner(e,t),l=getTopHeroBanner(e);return{...o,...i,...l}},calcRounderClipPath=(e,t=0,o=0)=>{let i=t,l=t;if(t>o?i=o:l=o,e>=999){let t=e-i;return t>0?t:0}let n=e-l;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,i,l,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(r??"0"),o,i),b=calcRounderClipPath(parseInt(s??"0"),i,l),d=calcRounderClipPath(parseInt(g??"0"),l,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),get1ColLayout=({device:e,settingLayoutRes:t,contentPosition1ColRes:o})=>{let i=t[e]?.cols??[],l=i.length<=1,n=o[e];if(!l||!n)return;let a=["space-between","top","center","bottom"];return a.includes(n)?n:void 0},getClassSpaceBetween=(e,t)=>{let o=getResponsiveSetting(e),i=getResponsiveSetting(t),l={desktop:get1ColLayout({device:"desktop",settingLayoutRes:o,contentPosition1ColRes:i}),tablet:get1ColLayout({device:"tablet",settingLayoutRes:o,contentPosition1ColRes:i}),mobile:get1ColLayout({device:"mobile",settingLayoutRes:o,contentPosition1ColRes:i})},n={"space-between":{desktop:"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden",tablet:"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute tablet:[&>*:nth-child(2)]:gp-hidden",mobile:"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute mobile:[&>*:nth-child(2)]:gp-hidden"},top:{desktop:"!gp-content-stretch [&>*]:!gp-justify-start",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start"},center:{desktop:"!gp-content-stretch [&>*]:!gp-justify-center",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center"},bottom:{desktop:"!gp-content-stretch [&>*]:!gp-justify-end",tablet:"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end",mobile:"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end"}},a={};return core.DEVICES.forEach(e=>{let t=l[e],o=n?.[t]?.[e];a[o]=!0}),a},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",i=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",l=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":i,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":l,"mobile:!gp-h-auto":!l}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=core.getResponsiveValueByScreen(e,o);t={...t,[o]:i}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let l=core.getResponsiveValueByScreen(e,i),n=!!getDataVideoHeroBannerResponsive(i,t),a=l?.shape,r=l?.height,s="original"===a&&"fit-content"!==r;o={...o,[i]:s&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",i=e.tablet||o,l=e.mobile||i;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[i||"center"]}`]:!!i,[`mobile:gp-justify-${t[l||"center"]}`]:!!l}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,i=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:i}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...i){clearTimeout(o),o=setTimeout(()=>e.apply(this,i),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:i}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,i="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||i};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getOpacityHover=getOpacityHover,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(n=>{let i=core.getResponsiveValueByScreen(e,n),a=core.getResponsiveValueByScreen(t,n),r=core.getResponsiveValueByScreen(o,n);l={...l,[n]:1>=(i?.cols?.length||1)?a:r}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},n={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return n},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let n=getBgImage(e),i=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(n,t),t,l)})`,r=i?.color?`, ${i.color}`:"";return i?.color?.includes(core.GRADIENT_BGR_KEY)&&i?.type==="image"?`${a}${r}`:i?.color?.includes(core.GRADIENT_BGR_KEY)&&i?.type!=="image"?`${i.color}`:i?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(n=>{l={...l,[n]:getBgImageByScreen(e,n,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),n=["desktop","mobile","tablet"];return n.forEach(n=>{let i=core.getResponsiveValueByScreen(t,n),a=!!getDataVideoHeroBannerResponsive(n,e),r=i?.shape,s=i?.height,g="original"===r&&"fit-content"!==s,p=g&&a;p&&(l={...l,[n]:"16/9"}),o&&o[n]&&getDataVideoHeroBannerResponsive(n,e)?.data?.videoType==="html5"&&(l={...l,[n]:o[n]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(e,l),i=!!getDataVideoHeroBannerResponsive(l,t),a=n?.shape,r=n?.height,s="original"===a&&"fit-content"!==r&&!i;o={...o,[l]:s?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,n=-l;if(o<n)return 0;if(o>t)return 100;let i=(o-n)/(t-n)*100;return Math.min(Math.max(i,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":n?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:n?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),n=getTopHeroBanner(e);return{...o,...l,...n}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,n=t;if(t>o?l=o:n=o,e>=999){let t=e-l;return t>0?t:0}let i=e-n;return i>0?i:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,n,i]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,i),c=calcRounderClipPath(parseInt(r??"0"),o,l),b=calcRounderClipPath(parseInt(s??"0"),l,n),d=calcRounderClipPath(parseInt(g??"0"),n,i);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),n=getResponsiveSetting(t),i=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?n.desktop:i.desktop,r=1>=(l?.tablet?.cols?.length||1)?n.tablet:i.tablet,s=1>=(l?.mobile?.cols?.length||1)?n.mobile:i.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",n=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":n,"mobile:!gp-h-auto":!n}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(e,l),i=!!getDataVideoHeroBannerResponsive(l,t),a=n?.shape,r=n?.height,s="original"===a&&"fit-content"!==r;o={...o,[l]:s&&!i}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,n=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[n||"center"]}`]:!!n}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getOpacityHover=getOpacityHover,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:a,aspectRatio:i}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(a,i)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:a,shadowBg:i,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},n={...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(r)),...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...a,active:{...a||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(n)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:l}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,i=core.makeStyleState("op",{normal:a,hover:helpers.getOpacityHover(e)}),s=core.getGlobalColorStateStyle("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete s?.["--bgc"],delete i?.["--op"]),l||(delete s?.["--hvr-bgc"],delete i?.["--hvr-op"]);let y={...s,...i,"--top":"0","--left":"0"};return filterTruthyStyles(y)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:a}=e??{},i
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:a,aspectRatio:i}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(a,i)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:a,shadowBg:i,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},n={...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(r)),...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...a,active:{...a||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(n)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:l}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,i=core.makeStyleState("op",{normal:a,hover:helpers.getOpacityHover(e)}),s=core.getGlobalColorStateStyle("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete s?.["--bgc"],delete i?.["--op"]),l||(delete s?.["--hvr-bgc"],delete i?.["--hvr-op"]);let y={...s,...i,"--top":"0","--left":"0"};return filterTruthyStyles(y)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:a}=e??{},i={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${a}`)??0}s`,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(i)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":helpers.getClipPath(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...core.makeStyleResponsive("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...core.makeStyleResponsive("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};exports.getAdaptiveStyle=getAdaptiveStyle,exports.getBackgroundStyle=getBackgroundStyle,exports.getContainBackgroundStyle=getContainBackgroundStyle,exports.getContainerStyle=getContainerStyle,exports.getHtml5VideoStyle=getHtml5VideoStyle,exports.getOverlayStyle=getOverlayStyle,exports.getRowStyle=getRowStyle,exports.getStyle=getStyle,exports.getYoutubeIframeStyle=getYoutubeIframeStyle;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var HeroBannerItem_liquid=require("./HeroBannerItem.liquid.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),system=require("@gem-sdk/system"),core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js");const HeroBanner=e=>{let{builderAttrs:s,builderProps:t,setting:r,styles:a,style:l,children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var HeroBannerItem_liquid=require("./HeroBannerItem.liquid.js"),attrs=require("../common/attrs.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),system=require("@gem-sdk/system"),core=require("@gem-sdk/core"),helpers=require("../../helpers.js"),helpers$1=require("../common/helpers.js");const HeroBanner=e=>{let{builderAttrs:s,builderProps:t,setting:r,styles:a,style:l,children:n,advanced:o,pageContext:i}=e,{enableLazyLoadImage:c}=i??{},{enableLink:d}=r??{},p=helpers$1.getBannerLink(r),{cssClass:u}=o??{},{urlData:m}=helpers.getInsertLinkData("",p),g=system.createStateOrContext({background:helpers$1.getResponsiveSetting(a?.background||{}),uid:t?.uid,enableParallax:Number(r?.speedParallax||0)>0,speedParallax:Number(r?.speedParallax)||0,hoverEffect:a?.hoverEffect,hoverEffectScale:a?.hoverEffectScale,layout:r?.layout,contentPosition1Col:a?.contentPosition1Col,contentPosition2Col:a?.contentPosition2Col,aspectRatio:r?.aspectRatio,target:p?.target??"_self",href:m?.href??"",linkType:p?.type??""}),y=!!p?.link&&d,f=system.createAttr({...attrs.getAttr({uid:t?.uid||""})}),h=system.createAttr(attrs.getAttrLink()),$=system.createStyle({...styles.getStyle(a,r,l)}),v=system.createClass({...classes.getClasses({setting:r,builderProps:t,advancedCssClass:u})}),S=system.createClass({...classes.getLinkClasses()}),C=()=>HeroBannerItem_liquid.default({setting:r,styles:a,children:n,enableLazyLoadImage:c,rawChildren:e.rawChildren,builderProps:t});return core.template`
|
|
2
2
|
<gp-hero-banner
|
|
3
3
|
${{...s}}
|
|
4
|
-
${{...
|
|
5
|
-
class="${
|
|
6
|
-
style="${
|
|
7
|
-
gp-data='${core.dataStringify(
|
|
4
|
+
${{...f}}
|
|
5
|
+
class="${v}"
|
|
6
|
+
style="${$}"
|
|
7
|
+
gp-data='${core.dataStringify(g)}'
|
|
8
8
|
>
|
|
9
|
-
${system.If(!
|
|
10
|
-
${system.If(
|
|
9
|
+
${system.If(!y,C())}
|
|
10
|
+
${system.If(y,core.template`
|
|
11
11
|
<div
|
|
12
12
|
${{...h}}
|
|
13
13
|
aria-hidden="true"
|
|
@@ -143,4 +143,4 @@
|
|
|
143
143
|
d="M4.39584 15.625C3.36031 15.625 2.52084 14.7855 2.52084 13.75V12.5C2.52084 11.4645 3.36031 10.625 4.39584 10.625H14.3958C15.4314 10.625 16.2708 11.4645 16.2708 12.5V13.75C16.2708 14.7855 15.4314 15.625 14.3958 15.625H4.39584ZM3.77084 13.75C3.77084 14.0952 4.05066 14.375 4.39584 14.375H14.3958C14.741 14.375 15.0208 14.0952 15.0208 13.75V12.5C15.0208 12.1548 14.741 11.875 14.3958 11.875H4.39584C4.05066 11.875 3.77084 12.1548 3.77084 12.5V13.75Z"
|
|
144
144
|
fill="currentColor"
|
|
145
145
|
/>
|
|
146
|
-
</svg> `,tooltip:"Align right"}],devices:{desktop:{default:"center"}}},{id:"seo",type:"group",label:"SEO",controls:[{id:"alt",label:"Alt Text",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: Classic white crewneck t-shirt with minimalist design",default:void 0},{id:"title",label:"Image title",info:"Show title when hover to image",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: White t-shirt",default:void 0}]},{id:"ratioOptions",type:"ratio",min:1,useUnit:!1,useLink:!1,devices:{desktop:{default:{width:"16",height:"9"}}}},{id:"aspectRatio",type:"select",label:"Ratio",options:[{label:"Original",value:"auto"},{label:"Square",value:"1/1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Cover",value:"cover"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"16/9"},mobile:{default:"auto"}}},{id:"contentBanner",type:"banner",message:"The background image should be taller than the Hero Banner",closable:!0}]},{id:"style",controls:[{id:"sizeSetting",type:"size-setting",label:"",devices:{desktop:{default:{shape:"original",widthHeightLinked:!1,width:"100%"}},mobile:{default:{shape:"custom",width:"100%"}}},settingConfig:{width:{displayOptions:["full","default"],name:"Width"},height:{displayOptions:["fit-content","fit-screen"],name:"Height"},shape:{displayOptions:["original","custom"],name:"Frame",shapeTitleConfig:{original:"As banner source"}}},hiddenSettings:["padding","gap"]},{id:"background",type:"background-media",ignoreReRender:!0,showVideo:!0,showDeviceControl:!0,devices:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"",videoHtml5:"",videoType:"youtube",loop:!0,lazyLoad:!1}}},compoDefaultValue:{desktop:{default:{type:"image",color:"bg-2",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"https://youtu.be/KOxfzBp72uk",videoHtml5:"https://cdn.shopify.com/videos/c/o/v/92a407d4e0c94a288eb54cac18c387dc.mp4",videoType:"youtube",loop:!0,lazyLoad:!1}}}},{id:"hoverEffect",type:"toggle",default:!1},{id:"hoverEffectScale",type:"input:slider",label:"Zoom Value",units:["%"],min:100,max:200,step:5,default:"120%"},{id:"hoverEffectDuration",label:"Zoom Time",type:"input:unit",units:["s"],min:0,default:.5,
|
|
146
|
+
</svg> `,tooltip:"Align right"}],devices:{desktop:{default:"center"}}},{id:"seo",type:"group",label:"SEO",controls:[{id:"alt",label:"Alt Text",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: Classic white crewneck t-shirt with minimalist design",default:void 0},{id:"title",label:"Image title",info:"Show title when hover to image",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: White t-shirt",default:void 0}]},{id:"ratioOptions",type:"ratio",min:1,useUnit:!1,useLink:!1,devices:{desktop:{default:{width:"16",height:"9"}}}},{id:"aspectRatio",type:"select",label:"Ratio",options:[{label:"Original",value:"auto"},{label:"Square",value:"1/1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Cover",value:"cover"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"16/9"},mobile:{default:"auto"}}},{id:"contentBanner",type:"banner",message:"The background image should be taller than the Hero Banner",closable:!0}]},{id:"style",controls:[{id:"sizeSetting",type:"size-setting",label:"",devices:{desktop:{default:{shape:"original",widthHeightLinked:!1,width:"100%"}},mobile:{default:{shape:"custom",width:"100%"}}},settingConfig:{width:{displayOptions:["full","default"],name:"Width"},height:{displayOptions:["fit-content","fit-screen"],name:"Height"},shape:{displayOptions:["original","custom"],name:"Frame",shapeTitleConfig:{original:"As banner source"}}},hiddenSettings:["padding","gap"]},{id:"background",type:"background-media",ignoreReRender:!0,showVideo:!0,showDeviceControl:!0,devices:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"",videoHtml5:"",videoType:"youtube",loop:!0,lazyLoad:!1}}},compoDefaultValue:{desktop:{default:{type:"image",color:"bg-2",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"https://youtu.be/KOxfzBp72uk",videoHtml5:"https://cdn.shopify.com/videos/c/o/v/92a407d4e0c94a288eb54cac18c387dc.mp4",videoType:"youtube",loop:!0,lazyLoad:!1}}}},{id:"hoverEffect",type:"toggle",default:!1},{id:"hoverEffectScale",type:"input:slider",label:"Zoom Value",units:["%"],min:100,max:200,step:5,default:"120%"},{id:"hoverEffectDuration",label:"Zoom Time",type:"input:unit",units:["s"],min:0,default:.5,useOnlyUnitInit:!0},{id:"height",label:"Height",type:"input:unit",units:["px"],placeholder:"Auto",devices:{desktop:{default:void 0}},info:"Full Width: To set Hero Banner full width, first you drag & drop a Section element from left sidebar, then make it full-width, after that you put your Hero Banner inside Section you have created."},{id:"contentPosition1Col",label:"Content Position",type:"option:value",options:[{label:"Top",value:"top",iconName:"gp-align-top"},{label:"Center",value:"center",iconName:"gp-align-center-vertical"},{label:"Bottom",value:"bottom",iconName:"gp-align-bottom"},{label:"Space between",value:"space-between",iconName:"gp-justify-content-space-between"}],devices:{desktop:{default:"center"}}},{id:"contentPosition2Col",label:"Content Position",type:"option:value",options:[{label:"Top",value:"top",iconName:"gp-align-top"},{label:"Center",value:"center",iconName:"gp-align-center-vertical"},{label:"Bottom",value:"bottom",iconName:"gp-align-bottom"},{label:"Space between",value:"space-between",iconName:"gp-justify-content-space-between"}],devices:{desktop:{default:"center"}}},{id:"wrapperWidth",type:"input:unit-width",label:"Width",placeholder:"Auto",min:0,units:["px","%"],devices:{desktop:{default:void 0},tablet:{default:void 0},mobile:{default:void 0}}},{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"default"},tablet:{default:"default"},mobile:{default:"default"}},displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0}]},{id:"verticalGutter",type:"input:unit",units:["px"],min:0,label:"Spacing",devices:{desktop:{default:"32px"}}},{id:"overlayEnable",type:"toggle",default:!1},{id:"overlayOpacity",label:"Opacity",type:"input:slider",min:0,max:100,units:["%"],step:1,default:{normal:"20%"},state:{normal:!0,hover:!0},compoDefaultValue:{normal:"20%",hover:"20%"}},{id:"overlayColor",label:"Color",type:"color-picker-v2",state:{normal:!0,hover:!0}},{id:"borderBg",type:"border-v2",label:"Border",compoDefaultValue:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},{id:"cornerBg",type:"corner-v2",label:"Corner",default:{radiusType:"none"}},{id:"hasActiveShadow",type:"toggle",label:"Enable Button Shadow",default:!1},{id:"shadowBg",type:"shadow-v2",label:"Button Shadow",compoDefaultValue:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.2)",angle:45,enable:!0}},{id:"contentPadding",type:"padding-v2",devices:{desktop:{default:{top:"4px",left:"16px",bottom:"4px",right:"16px",linked:!1}},mobile:{default:{top:"16px",left:"16px",bottom:"16px",right:"16px",linked:!1}}},compoDefaultValue:{desktop:{default:{top:"4px",left:"16px",bottom:"4px",right:"16px",linked:!1}},mobile:{default:{top:"16px",left:"16px",bottom:"16px",right:"16px",linked:!1}}}}]}];exports.SettingsV2=SettingsV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../helpers.js");const
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("../../helpers.js");const getTextIconNotFound=e=>"react"===e?"Icons not found":helpers.getStaticLocale("IconList","icons_not_found"),getTextIconTranslations=({setting:e,builderProps:t,pageContext:o,key:n,type:s})=>{let{childItem:i,translate:c}=e??{};return"react"===s?i?.[n]:helpers.getDynamicSourceLocales({val:i?.[n],uid:t?.uid,settingId:`childItem_${n}`,pageContext:o,translate:c,isReplaceLocationOrigin:!0})},getvalueMap=({setting:e})=>{let{childConfig:t,iconType:o,iconSvg:n}=e??{};return o&&"matching"!==o?"different"===o?t:void 0:Array(t?.length).fill(n)},composePostionIconList=(e,t,o)=>{let n={...o,desktop:o?.desktop??0,tablet:o?.tablet??o?.desktop??0,mobile:o?.mobile??o?.tablet??o?.desktop??0},s={};return core.DEVICES.forEach(o=>{core.composePositionLineHeight({compose:s,lineHeight:e,device:o,position:t,iconWidth:n})}),s};exports.composePostionIconList=composePostionIconList,exports.getTextIconNotFound=getTextIconNotFound,exports.getTextIconTranslations=getTextIconTranslations,exports.getvalueMap=getvalueMap;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),useGetProductId=require("../../hooks/useGetProductId.js"),Text=require("../../text/components/Text.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js"),useIconLineHeight=require("../hooks/useIconLineHeight.js");const IconListV2=e=>{let{builderProps:s,builderAttrs:t,style:l,setting:a,styles:r,pageContext:c,advanced:n}=e,i=system.createClass({[s?.uid??""]:!0}),o=system.createClass(classes.getClassWraplistIcon()),y=system.createClass(classes.getClassColListIcon()),m=system.createClass(classes.getClassWrapItemIcon({builderProps:s})),u=system.createClass(classes.getClassWrapIcon()),d=system.createClass(classes.getClassIcon()),p=system.createClass(classes.getClassTextItem({setting:a})),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),useGetProductId=require("../../hooks/useGetProductId.js"),Text=require("../../text/components/Text.js"),system=require("@gem-sdk/system"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),helpers=require("../common/helpers.js"),useIconLineHeight=require("../hooks/useIconLineHeight.js");const IconListV2=e=>{let{builderProps:s,builderAttrs:t,style:l,setting:a,styles:r,pageContext:c,advanced:n}=e,i=system.createClass({[s?.uid??""]:!0}),o=system.createClass(classes.getClassWraplistIcon()),y=system.createClass(classes.getClassColListIcon()),m=system.createClass(classes.getClassWrapItemIcon({builderProps:s})),u=system.createClass(classes.getClassWrapIcon()),d=system.createClass(classes.getClassIcon()),p=system.createClass(classes.getClassTextItem({setting:a})),x=system.createStyle(styles.getStyleContainerIconlistMain({styles:r,style:l,type:"react",advanced:n})),I=system.createStyle(styles.getStyleWraplistIcon({styles:r})),g=system.createStyle(styles.getStyleColListIcon({styles:r})),j=system.createStyle(styles.getStyleIcon({styles:r,setting:a})),h=styles.getStyleTypoText({setting:a}),C=system.createAttr({...t}),S=helpers.getTextIconNotFound("react"),T=helpers.getvalueMap({setting:a}),{ref:v,lineHeight:L}=useIconLineHeight.useIconLineHeight({iconWidth:a?.iconWidth}),q=helpers.composePostionIconList(L,r?.position,a?.iconWidth),{refContainer:R,productID:W}=useGetProductId.useGetProductId(),N=system.createStyle({...styles.getStyleWrapIcon({styles:r,setting:a}),...q.content}),f=system.createStyle({...styles.getStyleWrapItemIcon({styles:r}),...q.wrapper});return jsxRuntime.jsx("div",{...C,...s,"data-id":s?.uid,style:x,className:i,ref:R,children:system.If(!T||!T.length,jsxRuntime.jsx("div",{children:S}),jsxRuntime.jsx("div",{className:o,style:I,children:jsxRuntime.jsx("div",{className:y,style:g,children:T?.map((e,t)=>{let l=helpers.getTextIconTranslations({setting:a,builderProps:s,pageContext:c,key:t,type:"react"});return jsxRuntime.jsxs("div",{"data-index":t,className:m,style:f,children:[jsxRuntime.jsx("div",{className:u,style:N,children:jsxRuntime.jsx("span",{style:j,className:d,dangerouslySetInnerHTML:{__html:e}})}),jsxRuntime.jsx(Text.default,{setting:{text:l?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${s?.uid}-${t}-${W}`,productID:W,customClass:{wrapper:"gp-w-full"}}},styles:h,className:p,ref:v})]},t)})})}))})};exports.default=IconListV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var React=require("react");const useIconLineHeight=({iconWidth:e})=>{let t=React.useRef(null),[r,u]=React.useState("");return React.useEffect(()=>{if(t?.current){let e=window.getComputedStyle(t?.current).getPropertyValue("line-height");u(e)}},[e?.desktop]),{ref:t,lineHeight:r}};exports.useIconLineHeight=useIconLineHeight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constant=require("../../constant.js"),helpers=require("./helpers.js"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),constants=require("../constants.js");const getContainerAttrs=(e,t)=>({...e,...t&&{"data-id":t}}),getLinkWrapperAttrs=({urlData:e,imageLink:t,title:r,isLiquid:s=!1})=>{let a=s?{...e,...t?.noFollow&&{rel:"nofollow"},title:r}:{setting:e,title:r};return t?.type!=="go-to-sales-page"?t?.link?a:{}:s?{href:constant.HREF_TO_SALES_PAGE,target:"_self"}:{setting:{href:constant.HREF_TO_SALES_PAGE,target:"_self"}}},getImageLiquidAttrs=({pageContext:e,enableLazyLoadImage:t=!1})=>({...e&&{pageContext:e},...t&&{enableLazyLoadImage:t}}),getAdaptiveImageAttrs=({styles:e,setting:t,mode:r,isLiquid:s})=>{let{alt:a,srcSet:i,priority:l,qualityPercent:g,qualityType:p}=t??{},n=helpers.getAspectRatio({styles:e,setting:t}),o=()=>{helpers$1.handleClickLink(t?.imageLink,r)},c=i?.desktop?.backupFileKey?helpers.getNewBackupFileKey(i?.desktop?.backupFileKey??"",i?.desktop?.src??""):"",A=s?helpers.getImageSrc({src:i?.desktop?.src,backupFileKey:c,backupFilePath:i?.desktop?.backupFilePath,storage:i?.desktop?.storage}):i?.desktop?.src??"",u=l?{}:{"base-src":A??"","quality-type":helpers.safeStringify(p),"quality-percent":helpers.safeStringify(g)};return{pictureClass:"gp-contents",...a&&{alt:a},...i&&{srcSet:i},...l&&constants.PRIORITY_LOAD_ATTRS,...u,...e?.objectFit&&{layout:e.objectFit},onClick:o,aspectRatio:n}},getNextImageAttrs=({styles:e,setting:t})=>{let{objectFit:r}=e??{},{vw:s,alt:a,title:i,quality:l,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:o}=t??{},c=helpers.getAspectRatio({styles:e,setting:t});return{...t?.image,...s&&{vw:s},...a&&{alt:a},...i&&{title:i},...l&&{quality:l},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:c,layout:r,qualityType:n,qualityPercent:o}}},getNextImageLiquidAttrs=e=>{let{srcset:t,setting:r,storage:s,baseSrc:a,priority:i,customAttrs:l,width:g=2237,height:p=1678,isNotLazyload:n,backupFileKey:o,backupFilePath:c,srcIsLiquidCode:A,enableLazyLoadImage:u,alt:h,title:I,src:y=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC,sizes:E=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SIZES}=e,_=!n&&u&&!i,d=()=>{let e=o?helpers.getNewBackupFileKey(o??"",y):"",r=A?a:helpers.getImageSrc({src:y,backupFileKey:e,backupFilePath:c,storage:s}),l=A?y:helpers.getSrcSet(e??"",s??"THEME",y),n={sizes:"100vw",src:helpers.createBlurDataURL(g,p),...r&&!i?{"base-src":r}:{},...r?{"data-src":r}:{},...l?{"data-srcset":l}:{}},u={sizes:E,src:r??"",isNotLazyload:"true",srcset:t??"",...r&&!i?{"base-src":r}:{},...i?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",..._?n:u}},L=()=>{let{qualityPercent:e,qualityType:t}=r??{},s=!i&&t&&e?{"quality-type":helpers.safeStringify(t),"quality-percent":helpers.safeStringify(e)}:{"quality-type":"","quality-percent":""};return{...h&&{alt:h},...I&&{title:I},width:g,height:p,draggable:"false",...s}};return system.createAttr({...l,...L(),...d()})},getNextImageReactAttrs=e=>{let{width:t=helpers.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS,height:r=helpers.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS,quality:s,priority:a,isNotLazyload:i,enableLazyLoadImage:l,base64:g=helpers.IMAGE_PLACEHOLDER,alt:p=helpers.NEXT_IMAGE_CONFIG.DEFAULT_ALT,
|
|
1
|
+
"use strict";var constant=require("../../constant.js"),helpers=require("./helpers.js"),system=require("@gem-sdk/system"),helpers$1=require("../../helpers.js"),constants=require("../constants.js");const getContainerAttrs=(e,t)=>({...e,...t&&{"data-id":t}}),getLinkWrapperAttrs=({urlData:e,imageLink:t,title:r,isLiquid:s=!1})=>{let a=s?{...e,...t?.noFollow&&{rel:"nofollow"},title:r}:{setting:e,title:r};return t?.type!=="go-to-sales-page"?t?.link?a:{}:s?{href:constant.HREF_TO_SALES_PAGE,target:"_self"}:{setting:{href:constant.HREF_TO_SALES_PAGE,target:"_self"}}},getImageLiquidAttrs=({pageContext:e,enableLazyLoadImage:t=!1})=>({...e&&{pageContext:e},...t&&{enableLazyLoadImage:t}}),getAdaptiveImageAttrs=({styles:e,setting:t,mode:r,isLiquid:s})=>{let{alt:a,srcSet:i,priority:l,qualityPercent:g,qualityType:p}=t??{},n=helpers.getAspectRatio({styles:e,setting:t}),o=()=>{helpers$1.handleClickLink(t?.imageLink,r)},c=i?.desktop?.backupFileKey?helpers.getNewBackupFileKey(i?.desktop?.backupFileKey??"",i?.desktop?.src??""):"",A=s?helpers.getImageSrc({src:i?.desktop?.src,backupFileKey:c,backupFilePath:i?.desktop?.backupFilePath,storage:i?.desktop?.storage}):i?.desktop?.src??"",u=l?{}:{"base-src":A??"","quality-type":helpers.safeStringify(p),"quality-percent":helpers.safeStringify(g)};return{pictureClass:"gp-contents",...a&&{alt:a},...i&&{srcSet:i},...l&&constants.PRIORITY_LOAD_ATTRS,...u,...e?.objectFit&&{layout:e.objectFit},onClick:o,aspectRatio:n}},getNextImageAttrs=({styles:e,setting:t})=>{let{objectFit:r}=e??{},{vw:s,alt:a,title:i,quality:l,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:o}=t??{},c=helpers.getAspectRatio({styles:e,setting:t});return{...t?.image,...s&&{vw:s},...a&&{alt:a},...i&&{title:i},...l&&{quality:l},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:c,layout:r,qualityType:n,qualityPercent:o}}},getNextImageLiquidAttrs=e=>{let{srcset:t,setting:r,storage:s,baseSrc:a,priority:i,customAttrs:l,width:g=2237,height:p=1678,isNotLazyload:n,backupFileKey:o,backupFilePath:c,srcIsLiquidCode:A,enableLazyLoadImage:u,alt:h,title:I,src:y=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC,sizes:E=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SIZES}=e,_=!n&&u&&!i,d=()=>{let e=o?helpers.getNewBackupFileKey(o??"",y):"",r=A?a:helpers.getImageSrc({src:y,backupFileKey:e,backupFilePath:c,storage:s}),l=A?y:helpers.getSrcSet(e??"",s??"THEME",y),n={sizes:"100vw",src:helpers.createBlurDataURL(g,p),...r&&!i?{"base-src":r}:{},...r?{"data-src":r}:{},...l?{"data-srcset":l}:{}},u={sizes:E,src:r??"",isNotLazyload:"true",srcset:t??"",...r&&!i?{"base-src":r}:{},...i?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",..._?n:u}},L=()=>{let{qualityPercent:e,qualityType:t}=r??{},s=!i&&t&&e?{"quality-type":helpers.safeStringify(t),"quality-percent":helpers.safeStringify(e)}:{"quality-type":"","quality-percent":""};return{...h&&{alt:h},...I&&{title:I},width:g,height:p,draggable:"false",...s}};return system.createAttr({...l,...L(),...d()})},getNextImageReactAttrs=e=>{let{width:t=helpers.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS,height:r=helpers.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS,quality:s,priority:a,isNotLazyload:i,enableLazyLoadImage:l,base64:g=helpers.IMAGE_PLACEHOLDER,alt:p=helpers.NEXT_IMAGE_CONFIG.DEFAULT_ALT,src:n=helpers.NEXT_IMAGE_CONFIG.DEFAULT_SRC}=e,o=!i&&l&&!a,c=()=>{let e={loading:"lazy",placeholder:"blur",...g&&{blurDataURL:g}},t={loading:"eager",fetchpriority:"high"};return{...o?e:t}},A=()=>({src:n,alt:p,width:t,height:r,quality:s}),u=A(),h=system.createAttr(c());return{...u,...h}};exports.getAdaptiveImageAttrs=getAdaptiveImageAttrs,exports.getContainerAttrs=getContainerAttrs,exports.getImageLiquidAttrs=getImageLiquidAttrs,exports.getLinkWrapperAttrs=getLinkWrapperAttrs,exports.getNextImageAttrs=getNextImageAttrs,exports.getNextImageLiquidAttrs=getNextImageLiquidAttrs,exports.getNextImageReactAttrs=getNextImageReactAttrs;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
assign supported_payment_methods = shop.enabled_payment_types
|
|
8
8
|
-%}
|
|
9
9
|
`)}
|
|
10
|
-
<gp-product-dynamic data-id="${i?.uid}" data-translate-label=
|
|
10
|
+
<gp-product-dynamic data-id="${i?.uid}" data-translate-label="${r}" class="${s?.cssClass}" gp-data='${JSON.stringify(d).replaceAll("'","'")}
|
|
11
11
|
'>
|
|
12
12
|
<div class="${o}">
|
|
13
13
|
{{ form | payment_button }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),helpers=require("../common/helpers.js"),core=require("@gem-sdk/core");const useGpDescription=e=>{let t=React.useRef(null),[r,c]=React.useState(!1),[
|
|
1
|
+
"use strict";var React=require("react"),helpers=require("../common/helpers.js"),core=require("@gem-sdk/core");const useGpDescription=e=>{let t=React.useRef(null),[r,c]=React.useState(!1),[s,u]=React.useState(!1),i=core.useProduct(),o=core.useCurrentDevice(),l=core.getResponsiveValueByScreen(e?.hasLineClamp,o),n=core.getResponsiveValueByScreen(e?.lineClamp,o),{redirectProductShopifyLink:a}=core.useProductShopifyEditLink(),p=core.useEditorMode(),h=React.useCallback(()=>{if(!t.current)return helpers.DESCRIPTION_LINE_HEIGHT_DEFAULT;let e=window.getComputedStyle(t.current).getPropertyValue("line-height");return Math.ceil(parseFloat(e))},[]),m=React.useCallback(e=>l&&n&&e?`${n*e}px`:"auto",[l,n]),d=()=>{if(!t.current)return;let e=h();r?t.current.style.maxHeight=m(e):t.current.style.maxHeight="none",c(e=>!e)};return React.useEffect(()=>{let e=h();m(e)},[e?.typo?.custom,m,h]),React.useEffect(()=>{let e=t.current;if(c(!1),!e)return;let r=l&&i?.descriptionHtml;r?setTimeout(()=>{let t=e?.scrollHeight??0,r=e?.clientHeight??0,c=h(),s=Math.round((t??0)/c);e.style.maxHeight=m(c);let i=n&&n<s||r<t;n&&i?u(()=>!0):u(()=>!1)},100):e.style.maxHeight="none"},[l,n,i?.description,i?.descriptionHtml,h,m,c,u]),{ref:t,open:r,isShowViewMore:s,handleToggleShowMore:d,mode:p,redirectProductShopifyLink:a}};exports.useGpDescription=useGpDescription;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),ProductListCarouselLayout_liquid=require("./ProductListCarouselLayout.liquid.js"),ProductListGridLayout_liquid=require("./ProductListGridLayout.liquid.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js");const ProductList=e=>{let{setting:s,styles:t,pageContext:i}=e,r=i?.pageType==="GP_FUNNEL_PAGE";if(r)return"";let{hasRelatedExclude:d,relatedExcludeTrim:a,collectionID:o,isLatestProducts:c,isGrid:l,numberOfProducts:n,productListId:u,productListHandles:g,sortedBy:p,isReverse:f,productSrc:m,productNumber:P,isSorted:$,relatedTag:h
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),ProductListCarouselLayout_liquid=require("./ProductListCarouselLayout.liquid.js"),ProductListGridLayout_liquid=require("./ProductListGridLayout.liquid.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js");const ProductList=e=>{let{setting:s,styles:t,pageContext:i}=e,r=i?.pageType==="GP_FUNNEL_PAGE";if(r)return"";let{hasRelatedExclude:d,relatedExcludeTrim:a,collectionID:o,isLatestProducts:c,isGrid:l,numberOfProducts:n,productListId:u,productListHandles:g,sortedBy:p,isReverse:f,productSrc:m,productNumber:P,isSorted:$,relatedTag:h}=helpers.getDataLiquid(e),y=()=>core.template`
|
|
2
2
|
${core.RenderIf("RelatedProduct"===m,`
|
|
3
3
|
assign relatedTag = '${h}'
|
|
4
4
|
assign assignProduct = product
|
|
@@ -95,24 +95,7 @@
|
|
|
95
95
|
assign products = products
|
|
96
96
|
endpaginate
|
|
97
97
|
`)}
|
|
98
|
-
`,
|
|
99
|
-
assign target_collection = collections['${y}']
|
|
100
|
-
if target_collection == empty
|
|
101
|
-
for collection in collections
|
|
102
|
-
if collection.id == ${o}
|
|
103
|
-
assign target_collection = collection
|
|
104
|
-
break
|
|
105
|
-
endif
|
|
106
|
-
endfor
|
|
107
|
-
endif
|
|
108
|
-
`:`
|
|
109
|
-
for collection in collections
|
|
110
|
-
if collection.id == ${o}
|
|
111
|
-
assign target_collection = collection
|
|
112
|
-
break
|
|
113
|
-
endif
|
|
114
|
-
endfor
|
|
115
|
-
`;return core.template`
|
|
98
|
+
`,_=()=>core.template`
|
|
116
99
|
{%- liquid
|
|
117
100
|
assign productHandles = '${g.toString()}'| split: ','
|
|
118
101
|
assign products = null
|
|
@@ -120,14 +103,18 @@
|
|
|
120
103
|
assign productSrc = '${m}'
|
|
121
104
|
assign c = 0
|
|
122
105
|
assign limit = ${P??4}
|
|
123
|
-
|
|
124
106
|
if request.page_type == 'collection' or preview_page_type == 'collection'
|
|
125
107
|
assign target_collection = collection
|
|
126
108
|
if target_collection == empty or target_collection == null
|
|
127
109
|
if '${o.toLowerCase()}' == 'latest'
|
|
128
110
|
assign target_collection = collections | sort: 'updated_at' ${f?"| reverse":""} | first
|
|
129
111
|
else
|
|
130
|
-
|
|
112
|
+
for collection in collections
|
|
113
|
+
if collection.id == ${o}
|
|
114
|
+
assign target_collection = collection
|
|
115
|
+
break
|
|
116
|
+
endif
|
|
117
|
+
endfor
|
|
131
118
|
endif
|
|
132
119
|
endif
|
|
133
120
|
paginate target_collection.products by ${n||4}
|
|
@@ -135,7 +122,7 @@
|
|
|
135
122
|
endpaginate
|
|
136
123
|
else
|
|
137
124
|
if productSrc == 'RelatedProduct'
|
|
138
|
-
${
|
|
125
|
+
${y()}
|
|
139
126
|
elsif productSrc == 'PickProduct'
|
|
140
127
|
unless ${c}
|
|
141
128
|
assign products = null | sort
|
|
@@ -155,7 +142,12 @@
|
|
|
155
142
|
if '${o.toLowerCase()}' == 'latest'
|
|
156
143
|
assign target_collection = collections | sort: 'updated_at' ${f?"| reverse":""} | first
|
|
157
144
|
else
|
|
158
|
-
|
|
145
|
+
for collection in collections
|
|
146
|
+
if collection.id == ${o}
|
|
147
|
+
assign target_collection = collection
|
|
148
|
+
break
|
|
149
|
+
endif
|
|
150
|
+
endfor
|
|
159
151
|
endif
|
|
160
152
|
paginate target_collection.products by ${n||4}
|
|
161
153
|
assign products = target_collection.products ${$?p:""} ${f?"| reverse":""}
|
|
@@ -163,7 +155,7 @@
|
|
|
163
155
|
endif
|
|
164
156
|
endif
|
|
165
157
|
-%}
|
|
166
|
-
|
|
158
|
+
`,{productListWrapStyle:L,productListContentStyle:v,productListWrapAlignStyle:E}=styles.getStyle(e),{productListWrapClass:S}=classes.getClass(e),k=()=>core.template`
|
|
167
159
|
{%- if products == null -%}
|
|
168
160
|
{%- if count == 0 and ${u.length} == 0 -%}
|
|
169
161
|
{% if '${m}' == 'RelatedProduct' -%}
|
|
@@ -186,17 +178,17 @@
|
|
|
186
178
|
|
|
187
179
|
${core.RenderIf(!!t?.preloadBgImage,`${core.RenderIf(!!t?.backgroundImage?.desktop?.image?.src,`<link rel="preload" href="${t?.backgroundImage?.desktop?.image?.src}" as="image" />`)}${core.RenderIf(!!t?.backgroundImage?.tablet?.image?.src,`<link rel="preload" href="${t?.backgroundImage?.tablet?.image?.src}" as="image" />`)}${core.RenderIf(!!t?.backgroundImage?.mobile?.image?.src,`<link rel="preload" href="${t?.backgroundImage?.mobile?.image?.src}" as="image" />`)}`)}
|
|
188
180
|
<div
|
|
189
|
-
class="${
|
|
190
|
-
style="${
|
|
181
|
+
class="${S}"
|
|
182
|
+
style="${L}"
|
|
191
183
|
>
|
|
192
|
-
<div class='gp-flex gp-w-full' style="${
|
|
184
|
+
<div class='gp-flex gp-w-full' style="${E}">
|
|
193
185
|
<div
|
|
194
|
-
style="${
|
|
186
|
+
style="${v}"
|
|
195
187
|
>
|
|
196
188
|
{%- assign gpBkProduct = product -%}
|
|
197
189
|
{%- assign gpBkProducts = products -%}
|
|
198
|
-
${
|
|
199
|
-
${
|
|
190
|
+
${_()}
|
|
191
|
+
${k()}
|
|
200
192
|
{%- assign product = gpBkProduct -%}
|
|
201
193
|
{%- assign products = gpBkProducts -%}
|
|
202
194
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var product=require("../../../helpers/product.js"),productFeaturedImage=require("../../product-images/common/productFeaturedImage.js"),helpers=require("../../../../carousel/components/dot/common/helpers.js");const getData=e=>{let{setting:t,styles:o}=e,r=t?.productSetting??{},d="RelatedProduct"===r.productSrc,c=helpers.getUpdatedDotStyle(t?.dot,t?.dotStyle),l={dotSize:{desktop:12},dotGapToCarousel:{desktop:16},arrowIconSize:{desktop:24},showWhenHover:!1,rtl:!1,...t};delete l.childItem;let
|
|
1
|
+
"use strict";var product=require("../../../helpers/product.js"),productFeaturedImage=require("../../product-images/common/productFeaturedImage.js"),helpers=require("../../../../carousel/components/dot/common/helpers.js");const getData=e=>{let{setting:t,styles:o}=e,r=t?.productSetting??{},d="RelatedProduct"===r.productSrc,c=helpers.getUpdatedDotStyle(t?.dot,t?.dotStyle),l={dotSize:{desktop:12},dotGapToCarousel:{desktop:16},arrowIconSize:{desktop:24},showWhenHover:!1,rtl:!1,...t};delete l.childItem;let u={...o,sizeSetting:{...product.getSizeSetting({adaptiveHeight:o?.adaptiveHeight,height:o?.height,fullWidth:{desktop:!0}})},spacing:o?.spacing};return delete u.backgroundColor,delete u.backgroundImage,{isRelatedProduct:d,productSetting:r,dotStyle:c,carouselConfigSetting:l,carouselConfigStyle:u}},getDataLiquid=e=>{let{setting:t,styles:o}=e,r=t?.productSetting,d=r?.relatedTag,c=r?.hasRelatedExclude,l=(d&&"collection"===d[0]?r?.relatedCollectionExclude:r?.relatedTagsExclude)??"",u=l?.split(",").map(e=>e.trim()).toString(),a=r?.productSrc??"Collection",i=r?.collectionId?.replace(PREFIX_COLLECTION_ID,"")??"latest",p=r?.productSrc==="PickProduct"&&r?.productIds?.length===0,s=o?.layout==="grid",n=productFeaturedImage.convertUnitToNumber(t?.numberOfProducts,4),g="PickProduct"===a&&r?.productIds?.length?r?.productIds.map(e=>e.replace(PREFIX_PRODUCT_ID,"")):[],I="PickProduct"===a&&r?.productHandles?.length?r?.productHandles:[],P=t?.orderBy&&t?.orderBy!=="none",h=(r?.productSrc==="Collection"||r?.productSrc==="DynamicCollection")&&P?t?.orderBy?.split("_"):"none",D=P&&h?.[0]==="TITLE"?"| sort: 'title'":"| sort: 'updated_at'",C=h?.[h.length-1]==="DESC",m=()=>"PickProduct"===a?p?4:r?.numOfSelectedProducts??4:n;return{hasRelatedExclude:c,relatedExcludeTrim:u,collectionID:i,isLatestProducts:p,isGrid:s,numberOfProducts:n,productListId:g,productListHandles:I,sortedBy:D,isReverse:C,productSrc:a,productSetting:r,isSorted:P,relatedTag:d,productNumber:m()}},PREFIX_COLLECTION_ID="gid://shopify/Collection/",PREFIX_PRODUCT_ID="gid://shopify/Product/";exports.PREFIX_COLLECTION_ID=PREFIX_COLLECTION_ID,exports.PREFIX_PRODUCT_ID=PREFIX_PRODUCT_ID,exports.getData=getData,exports.getDataLiquid=getDataLiquid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getInputClasses=({styles:e,borderBtn:s,inputBackgroundColor:t,textColor:o,isDisabled:l})=>{let p="gp-flex gp-w-full gp-px-1 gp-min-w-[45px] gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",r=core.composeTypographyClassName(e?.typo,e?.typography),a=core.handleConvertClassColor(s),g=core.getGlobalColorStateClass("bg",t),n=core.getGlobalColorStateClass("text",o);return a&&(p+=` ${a} `),r&&(p+=` ${r} `),g&&(p+=` ${g} `),n&&(p+=` ${n} `),l&&(p+="gp-cursor-not-allowed"),{...core.composeClasses(p)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:t,buttonSide:o,isDisabled:l})=>{let p=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${l?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===o?"gp-minus":"gp-plus"} `,r=core.handleConvertClassColor(e),a=core.getGlobalColorStateClass("bg",s),g=core.getGlobalColorStateClass("text",t);return r&&(p+=` ${r} `),a&&(p+=` ${a} `),g&&(p+=` ${g} `),{...core.composeClasses(p)}},getContainerClasses=e=>({...core.composeClasses(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...core.composeClasses("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});exports.getButtonClass=getButtonClass,exports.getContainerClasses=getContainerClasses,exports.getIconWrapperClasses=getIconWrapperClasses,exports.getInputClasses=getInputClasses,exports.getWrapperClasses=getWrapperClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var settingsV2=require("../../../../carousel/settings/configs/settings-v2.js");const ProductListSettingsV2=[{id:"setting",controls:[{id:"productSetting",type:"product-list",label:"Select product list",default:{productSrc:"PickProduct",productIds:[],collectionId:"Latest",
|
|
1
|
+
"use strict";var settingsV2=require("../../../../carousel/settings/configs/settings-v2.js");const ProductListSettingsV2=[{id:"setting",controls:[{id:"productSetting",type:"product-list",label:"Select product list",default:{productSrc:"PickProduct",productIds:[],collectionId:"Latest",relatedType:"related-product",relatedTag:["collection"],hasRelatedExclude:!1}},{id:"slidesToShow",type:"input:slider",min:1,max:6,isNumber:!0,label:"Products per rows ",devices:{desktop:{default:4},tablet:{default:3},mobile:{default:2}}},{id:"numberOfProducts",type:"input:slider",min:1,max:50,label:"Number of products",isNumber:!0,default:10,ignoreMax:!0},{id:"sameHeight",label:"Enable same height",type:"select",options:[{label:"Same height",value:!0},{label:"Fit content height",value:!1}],default:!0},...settingsV2.CarouselSettingsV2Setting]},{id:"style",controls:[{id:"layout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 78 52",itemPerRow:2,itemSpacing:"large",default:"grid",options:[{label:"Grid",value:"grid",iconName:"gp-grid-layout"},{label:"Slider",value:"slider",iconName:"gp-slider-layout"}]},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,isRowWith:!0,devices:{desktop:{default:"default"}},displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0}]},{id:"height",label:"Height",type:"dropdown:input",inputType:"number",units:["px"],displayOptions:[{label:"Fit content",value:"Auto"}],devices:{}},{id:"horizontalGutter",label:"Row gap",type:"input:unit",fallbackValue:!0,min:0,units:["px","%"],devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"verticalGutter",label:"Column gap",type:"input:unit",units:["px","%"],fallbackValue:!0,min:0,devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"backgroundColor",type:"color-picker-v2",devices:{desktop:{default:"transparent"}},compoDefaultValue:{desktop:{default:"#DDDDDD"}},enableGradient:!0},{id:"backgroundImage",type:"background-image",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:480,hiddenSEO:!0},repeat:"no-repeat",size:"cover",position:{x:50,y:50},attachment:"scroll",preload:!1}}}},{id:"preloadBgImage",type:"toggle",label:"Preload",default:!1},{id:"align",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left"},{label:"Center",value:"center",type:"align",tooltip:"Align center"},{label:"Right",value:"right",type:"align",tooltip:"Align right"}],devices:{desktop:{default:"center"}}},...settingsV2.CarouselSettingsV2Style]}];exports.ProductListSettingsV2=ProductListSettingsV2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t)=>{let o={...core.makeStyle({mr:e?.spacing,mb:e?.spacing}),...core.makeStyleResponsive("ta",e?.align),...t,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(o)},getContainerStyle=(e,t)=>{let{tagWidth:o}=t??{},r={...core.makeStyleResponsive("jc",e?.align),...o};return filterTruthyStyles(r)},getTextStyle=(e,t)=>{let o=core.makeGlobalSize(t?.globalSize),r=[e?.lineThrough&&"line-through",e?.typo?.attrs?.underline&&"underline"].filter(Boolean),l={...o?.width?.["--w"]?o.width:{"--w":"100%"},...core.makeStyle({tdc:core.getSingleColorVariable(e?.lineColor?.normal),tdt:helpers.formatThickness(e?.thickness)}),...core.composeBorderResponsive(e?.shapeBorder),...core.composeRadiusResponsive(e?.shapeRounded),...core.getResponsiveStyleShadowWithoutState(e?.shapeBoxShadow,"box-shadow",e?.shapeBoxShadow),...core.getStyleShadow({value:e?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:e?.typo?.custom?.hasShadowText}),...core.makeStyleResponsive("ta",e?.textAlign),...core.makeStyleResponsive("line-clamp",core.makeLineClamp(e?.lineClamp,e?.hasLineClamp)),...e?.textColor?core.getGlobalColorStyle(e.textColor):core.getGlobalColorStateStyle("c",e?.color),...core.composeTypographyStyle(e?.typo),"word-break":"break-word",...core.getStyleBackgroundByDevice(t?.background),...o.padding,...core.getGradientBgrStyleByDevice(t?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...e?.opacityPrice&&{opacity:`${e?.opacityPrice}%`},...core.makeStyle({tdl:r.join(" ")})};return e?.enableHoverEffect?filterTruthyStyles(l):core.filterHoverVariables(l)},getTextStyleInline=e=>{let t={...core.composeTypographyStyle(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};exports.getContainerStyle=getContainerStyle,exports.getStyle=getStyle,exports.getTextStyle=getTextStyle,exports.getTextStyleInline=getTextStyleInline;
|
|
@@ -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"),NextImage_liquid=require("../../image/components/NextImage.liquid.js");const LiteVimeoEmbed=e=>{let{title:s,id:t,lazy:l,aspectRatio:a,autoplay:r,muted:i,thumbnailLink:m,poster:c}=e,{iframeSrc:o}=helpers$1.getVimeoParams(e),p=!l,d=e.thumbnail,
|
|
2
|
-
<gp-lite-vimeo-embed gp-data='${JSON.stringify(
|
|
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"),NextImage_liquid=require("../../image/components/NextImage.liquid.js");const LiteVimeoEmbed=e=>{let{title:s,id:t,lazy:l,aspectRatio:a,autoplay:r,muted:i,thumbnailLink:m,poster:c}=e,{iframeSrc:o}=helpers$1.getVimeoParams(e),p=!l,d=e.thumbnail,y=system.createStateOrContext({id:t,thumbnail:m,lazy:l,iframeSrc:o,title:s,autoplay:r,muted:i,style:e?.vimeoStyleIframe||""}),g=system.createStyle({...styles.getIframeVimeoStyle(a)}),n=system.createStyle({...styles.getArticleVimeoStyle(a,"")}),u=system.createClass({...classes.getArticleVimeoClasses(d,a)}),f=system.createClass({...classes.getImageVimeoClasses(p)}),$=system.createClass({...classes.getButtonVimeoClasses(p)}),b=system.createClass({...classes.getIframeVimeoClasses()});return core.template`
|
|
2
|
+
<gp-lite-vimeo-embed gp-data='${JSON.stringify(y)}'>
|
|
3
3
|
<article
|
|
4
4
|
aria-hidden
|
|
5
5
|
class="${u}"
|
|
6
6
|
data-title="${s}"
|
|
7
7
|
style="${n}"
|
|
8
8
|
>
|
|
9
|
-
${NextImage_liquid.default({src:d,alt:c?.altText,title:c?.imageTitle,className:f,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:c?.preload
|
|
9
|
+
${NextImage_liquid.default({src:d,alt:c?.altText,title:c?.imageTitle,className:f,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:c?.preload})}
|
|
10
10
|
${system.If(!p,core.template`
|
|
11
|
-
<button type="button" class="${
|
|
11
|
+
<button type="button" class="${$}" aria-label="Play">
|
|
12
12
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
13
13
|
<path
|
|
14
14
|
fill="currentColor"
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
</button>`)}
|
|
19
19
|
${system.If(p,core.template`
|
|
20
20
|
<iframe
|
|
21
|
-
style="${
|
|
21
|
+
style="${g}"
|
|
22
22
|
title="${s}"
|
|
23
23
|
frameborder="0"
|
|
24
24
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
25
25
|
allowfullscreen
|
|
26
26
|
src="${o}"
|
|
27
|
-
class="${
|
|
27
|
+
class="${b}"
|
|
28
28
|
></iframe>`)}
|
|
29
29
|
</article>
|
|
30
30
|
</gp-lite-vimeo-embed>
|