@gem-sdk/components 2.0.0-staging.1037 → 2.0.0-staging.1038
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),Head=require("next/head"),ChildrenDroppable=require("../ChildrenDroppable.js"),HTML5Embed=require("../../../video/components/HTML5Embed.js"),helpers$1=require("../../../video/common/helpers.js"),LiteYouTubeEmbed=require("../../../video/components/LiteYouTubeEmbed.js"),system=require("@gem-sdk/system"),useRowSetting=require("../../hooks/useRowSetting.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js"),core=require("@gem-sdk/core");const Row=e=>{let{styles:s,setting:t,children:r}=e,{isSection:i,as:l="div"}=t??{},{background:o}=s??{},{builderAttrs:a,cacheHeightOutViewport:m,bgVideo:n,isRowEmpty:u,rowClassEditorOnly:d,isRenderPlaceholderViewBox:c,isPostPurchase:p,ref:j,postPurchaseVerticalAlign:x}=useRowSetting.useRowSettings(e),{rowStyle:h,backgroundBoxStyle:y,embedVideoStyle:R,sectionStyle:g}=styles.getRowStyle(e),{rowAttr:b}=attrs.getAttr(e),{rowClass:v,backgroundBoxClass:f,backgroundBoxInnerClass:C,sectionClass:k,wrapperYoutubeClasses:q,iframeYoutubeClasses:E}=classes.getClass(e),w=system.createClass({[v]:!0,[d]:!0}),H=React.useMemo(()=>{if(!helpers.checkHasBackgroundVideo(o))return;if(n?.videoType==="html5"&&!n.videoHtml5||n?.videoType==="youtube"&&!n.video)return null;if(n?.videoType==="html5"&&n.videoHtml5)return jsxRuntime.jsx(HTML5Embed.default,{muted:!0,loop:n.loop,controls:!1,autoplay:!0,src:n.videoHtml5,title:"Video",className:"gp-relative",style:R});let e=n?.video??"",s=helpers$1.getYoutubeVideoId(e);if(!helpers$1.youtubeVideoRegex.test(e)||!s)return;let t=`&loop=${n?.loop?1:0}&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return jsxRuntime.jsx(LiteYouTubeEmbed.default,{id:s,autoplay:!0,title:"",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:!1,style:R,wrapperClass:q,iframeClass:E})},[o,n,R,E,q]),T=React.Children.map(r,e=>!!core.isEmptyChildren(e)),L=jsxRuntime.jsxs("div",{ref:j,...a,...b,style:h(p),className:w,children:[!!H&&jsxRuntime.jsx("div",{className:f,style:y,children:jsxRuntime.jsx("div",{className:C,children:H})}),c?jsxRuntime.jsx("div",{style:{height:`${m}px`}}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:u?jsxRuntime.jsx(ChildrenDroppable.default,{}):React.Children.map(r,s=>React.isValidElement(s)?React.createElement(s.type,{hiddenEmptyCol:e.hiddenEmptyCol&&!core.isEmptyChildren(s)&&!T,...s.props,key:s.key,order:t?.order,layout:t?.layout,justifyContent:p?x():t?.verticalAlign}):null)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!!s?.preloadBgImage&&jsxRuntime.jsxs(Head,{children:[!!o?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.desktop.image.src,as:"image"}),!!o?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.tablet.image.src,as:"image"}),!!o?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.mobile.image.src,as:"image"})]}),i?jsxRuntime.jsx(l,{className:k,style:g,children:L}):L]})};exports.default=Row;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),Head=require("next/head"),ChildrenDroppable=require("../ChildrenDroppable.js"),HTML5Embed=require("../../../video/components/HTML5Embed.js"),helpers$1=require("../../../video/common/helpers.js"),LiteYouTubeEmbed=require("../../../video/components/LiteYouTubeEmbed.js"),system=require("@gem-sdk/system"),useRowSetting=require("../../hooks/useRowSetting.js"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js"),core=require("@gem-sdk/core");const Row=e=>{let{styles:s,setting:t,children:r}=e,{isSection:i,as:l="div"}=t??{},{background:o}=s??{},{builderAttrs:a,cacheHeightOutViewport:m,bgVideo:n,isRowEmpty:u,rowClassEditorOnly:d,isRenderPlaceholderViewBox:c,isPostPurchase:p,ref:j,postPurchaseVerticalAlign:x}=useRowSetting.useRowSettings(e),{rowStyle:h,backgroundBoxStyle:y,embedVideoStyle:R,sectionStyle:g}=styles.getRowStyle(e,p),{rowAttr:b}=attrs.getAttr(e),{rowClass:v,backgroundBoxClass:f,backgroundBoxInnerClass:C,sectionClass:k,wrapperYoutubeClasses:q,iframeYoutubeClasses:E}=classes.getClass(e),w=system.createClass({[v]:!0,[d]:!0}),H=React.useMemo(()=>{if(!helpers.checkHasBackgroundVideo(o))return;if(n?.videoType==="html5"&&!n.videoHtml5||n?.videoType==="youtube"&&!n.video)return null;if(n?.videoType==="html5"&&n.videoHtml5)return jsxRuntime.jsx(HTML5Embed.default,{muted:!0,loop:n.loop,controls:!1,autoplay:!0,src:n.videoHtml5,title:"Video",className:"gp-relative",style:R});let e=n?.video??"",s=helpers$1.getYoutubeVideoId(e);if(!helpers$1.youtubeVideoRegex.test(e)||!s)return;let t=`&loop=${n?.loop?1:0}&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return jsxRuntime.jsx(LiteYouTubeEmbed.default,{id:s,autoplay:!0,title:"",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:!1,style:R,wrapperClass:q,iframeClass:E})},[o,n,R,E,q]),T=React.Children.map(r,e=>!!core.isEmptyChildren(e)),L=jsxRuntime.jsxs("div",{ref:j,...a,...b,style:h(p),className:w,children:[!!H&&jsxRuntime.jsx("div",{className:f,style:y,children:jsxRuntime.jsx("div",{className:C,children:H})}),c?jsxRuntime.jsx("div",{style:{height:`${m}px`}}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:u?jsxRuntime.jsx(ChildrenDroppable.default,{}):React.Children.map(r,s=>React.isValidElement(s)?React.createElement(s.type,{hiddenEmptyCol:e.hiddenEmptyCol&&!core.isEmptyChildren(s)&&!T,...s.props,key:s.key,order:t?.order,layout:t?.layout,justifyContent:p?x():t?.verticalAlign}):null)})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!!s?.preloadBgImage&&jsxRuntime.jsxs(Head,{children:[!!o?.desktop?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.desktop.image.src,as:"image"}),!!o?.tablet?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.tablet.image.src,as:"image"}),!!o?.mobile?.image?.src&&jsxRuntime.jsx("link",{rel:"preload",href:o.mobile.image.src,as:"image"})]}),i?jsxRuntime.jsx(l,{className:k,style:g,children:L}):L]})};exports.default=Row;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("./helpers.js"),helper=require("../../../../post-purchase/common/helper.js");const getRowStyle=e=>{let{children:
|
|
2
|
+
"use strict";var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("./helpers.js"),helper=require("../../../../post-purchase/common/helper.js");const getRowStyle=(e,t)=>{let{children:r,setting:o,builderProps:s,styles:l,style:i,advanced:p,isNotFullWidth:a,parentStyle:c}=e,{isSection:n,layout:d,horizontalAlign:m,responsive:y,inlineAlignment:b}=o??{},{width:u,columnGap:g,rowGap:k,fullWidth:S,background:v,verticalGutter:h,verticalGutterMobile:R,enablePagePadding:f,height:x}=l??{},w=helpers.getInnerRadiusExcludeBorder(p?.border,p?.rounded),B=(e,t)=>{let r=e?.normal,o=t?.normal;if(!r||!o||o?.borderType=="none"||"square"===r.radiusType||"none"===r.radiusType)return!1;for(let e in r)if(Object.hasOwn(r,e)&&"0px"!==r[e])return!0;return!1},D=core.makeStyleResponsive("of",{desktop:B(w.desktop,core.getValueByDevice(p?.border,"desktop"))?"hidden":void 0,tablet:B(w.tablet,core.getValueByDevice(p?.border,"tablet"))?"hidden":void 0,mobile:B(w.mobile,core.getValueByDevice(p?.border,"mobile"))?"hidden":void 0}),j=s?.builderData?.childrens?.length,q={...core.makeStyleResponsive("aspect",{desktop:"16/9"})},V=core.isEmptyChildren(r)||!j,O={desktop:u?.desktop==="default"?"1200px":u?.desktop,tablet:u?.tablet==="default"?"1200px":u?.tablet,mobile:u?.mobile==="default"?"1200px":u?.mobile},T=helpers.createStyleObject(t?O:u,S),[C,E]=core.splitStyle(["pos","top","left","bottom","right","z"],i),G=()=>({...n?E:i,...core.makeStyleResponsive("cg",h),...core.makeStyleResponsive("rg",R),...d?core.composeGridLayout(d):core.makeStyleResponsive("gtc",y),...core.makeStyleResponsive("w",T.content),...core.makeStyleResponsive("h",x),...n?{}:D}),L=()=>({"--mb":"0px","--mt":"0px",...core.makeStyleResponsive("cg",g),...core.makeStyle({pc:b,rg:k?helper.postPurchaseViewSpacing[k]:"0px"})}),z=e=>({...core.getStyleBackgroundByDevice(v,e),...core.getGradientBgrStyleByDevice(v,{desktop:!0,tablet:!0,mobile:!0}),...core.makeStyleResponsive("pc",m)}),H=()=>{let e=a&&!V;return e?{marginLeft:"0px",marginRight:"0px"}:{}},I=()=>({...core.composeRadius(w)}),P=(e=!1)=>system.createStyle({...G(),...z(),...H(),...e?L():{},...o?.sameHeightSubgridContainer&&c}),Y=system.createStyle({...I()}),A=system.createStyle({...q,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),F=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},J={desktop:F(f?.desktop),tablet:F(f?.tablet),mobile:F(f?.mobile)},K=system.createStyle({...C,...core.makeStyleResponsive("w",T.wrapper),...core.makeStyleResponsive("pl",J),...core.makeStyleResponsive("pr",J)});return{embedVideoStyle:A,backgroundBoxStyle:Y,rowStyle:P,sectionStyle:K}};exports.getRowStyle=getRowStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{useMemo as t,Children as l,isValidElement as m,createElement as i}from"react";import s from"next/head";import a from"../ChildrenDroppable.js";import p from"../../../video/components/HTML5Embed.js";import{getYoutubeVideoId as d,youtubeVideoRegex as n}from"../../../video/common/helpers.js";import c from"../../../video/components/LiteYouTubeEmbed.js";import{createClass as f}from"@gem-sdk/system";import{useRowSettings as y}from"../../hooks/useRowSetting.js";import{getAttr as h}from"./common/attrs.js";import{getClass as u}from"./common/classes.js";import{getRowStyle as v}from"./common/styles.js";import{checkHasBackgroundVideo as g}from"./common/helpers.js";import{isEmptyChildren as j}from"@gem-sdk/core";let Row=k=>{let{styles:b,setting:C,children:w}=k,{isSection:N,as:T="div"}=C??{},{background:x}=b??{},{builderAttrs:E,cacheHeightOutViewport:H,bgVideo:R,isRowEmpty:$,rowClassEditorOnly:L,isRenderPlaceholderViewBox:z,isPostPurchase:A,ref:B,postPurchaseVerticalAlign:D}=y(k),{rowStyle:I,backgroundBoxStyle:M,embedVideoStyle:S,sectionStyle:V}=v(k),{rowAttr:Y}=h(k),{rowClass:q,backgroundBoxClass:F,backgroundBoxInnerClass:G,sectionClass:J,wrapperYoutubeClasses:K,iframeYoutubeClasses:O}=u(k),P=f({[q]:!0,[L]:!0}),Q=t(()=>{if(!g(x))return;if(R?.videoType==="html5"&&!R.videoHtml5||R?.videoType==="youtube"&&!R.video)return null;if(R?.videoType==="html5"&&R.videoHtml5)return e(p,{muted:!0,loop:R.loop,controls:!1,autoplay:!0,src:R.videoHtml5,title:"Video",className:"gp-relative",style:S});let o=R?.video??"",r=d(o);if(!n.test(o)||!r)return;let t=`&loop=${R?.loop?1:0}&playlist=${r}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return e(c,{id:r,autoplay:!0,title:"",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:!1,style:S,wrapperClass:K,iframeClass:O})},[x,R,S,O,K]),U=l.map(w,e=>!!j(e)),W=o("div",{ref:B,...E,...Y,style:I(A),className:P,children:[!!Q&&e("div",{className:F,style:M,children:e("div",{className:G,children:Q})}),z?e("div",{style:{height:`${H}px`}}):e(r,{children:$?e(a,{}):l.map(w,e=>m(e)?i(e.type,{hiddenEmptyCol:k.hiddenEmptyCol&&!j(e)&&!U,...e.props,key:e.key,order:C?.order,layout:C?.layout,justifyContent:A?D():C?.verticalAlign}):null)})]});return o(r,{children:[!!b?.preloadBgImage&&o(s,{children:[!!x?.desktop?.image?.src&&e("link",{rel:"preload",href:x.desktop.image.src,as:"image"}),!!x?.tablet?.image?.src&&e("link",{rel:"preload",href:x.tablet.image.src,as:"image"}),!!x?.mobile?.image?.src&&e("link",{rel:"preload",href:x.mobile.image.src,as:"image"})]}),N?e(T,{className:J,style:V,children:W}):W]})};export{Row as default};
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{useMemo as t,Children as l,isValidElement as m,createElement as i}from"react";import s from"next/head";import a from"../ChildrenDroppable.js";import p from"../../../video/components/HTML5Embed.js";import{getYoutubeVideoId as d,youtubeVideoRegex as n}from"../../../video/common/helpers.js";import c from"../../../video/components/LiteYouTubeEmbed.js";import{createClass as f}from"@gem-sdk/system";import{useRowSettings as y}from"../../hooks/useRowSetting.js";import{getAttr as h}from"./common/attrs.js";import{getClass as u}from"./common/classes.js";import{getRowStyle as v}from"./common/styles.js";import{checkHasBackgroundVideo as g}from"./common/helpers.js";import{isEmptyChildren as j}from"@gem-sdk/core";let Row=k=>{let{styles:b,setting:C,children:w}=k,{isSection:N,as:T="div"}=C??{},{background:x}=b??{},{builderAttrs:E,cacheHeightOutViewport:H,bgVideo:R,isRowEmpty:$,rowClassEditorOnly:L,isRenderPlaceholderViewBox:z,isPostPurchase:A,ref:B,postPurchaseVerticalAlign:D}=y(k),{rowStyle:I,backgroundBoxStyle:M,embedVideoStyle:S,sectionStyle:V}=v(k,A),{rowAttr:Y}=h(k),{rowClass:q,backgroundBoxClass:F,backgroundBoxInnerClass:G,sectionClass:J,wrapperYoutubeClasses:K,iframeYoutubeClasses:O}=u(k),P=f({[q]:!0,[L]:!0}),Q=t(()=>{if(!g(x))return;if(R?.videoType==="html5"&&!R.videoHtml5||R?.videoType==="youtube"&&!R.video)return null;if(R?.videoType==="html5"&&R.videoHtml5)return e(p,{muted:!0,loop:R.loop,controls:!1,autoplay:!0,src:R.videoHtml5,title:"Video",className:"gp-relative",style:S});let o=R?.video??"",r=d(o);if(!n.test(o)||!r)return;let t=`&loop=${R?.loop?1:0}&playlist=${r}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return e(c,{id:r,autoplay:!0,title:"",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:!1,style:S,wrapperClass:K,iframeClass:O})},[x,R,S,O,K]),U=l.map(w,e=>!!j(e)),W=o("div",{ref:B,...E,...Y,style:I(A),className:P,children:[!!Q&&e("div",{className:F,style:M,children:e("div",{className:G,children:Q})}),z?e("div",{style:{height:`${H}px`}}):e(r,{children:$?e(a,{}):l.map(w,e=>m(e)?i(e.type,{hiddenEmptyCol:k.hiddenEmptyCol&&!j(e)&&!U,...e.props,key:e.key,order:C?.order,layout:C?.layout,justifyContent:A?D():C?.verticalAlign}):null)})]});return o(r,{children:[!!b?.preloadBgImage&&o(s,{children:[!!x?.desktop?.image?.src&&e("link",{rel:"preload",href:x.desktop.image.src,as:"image"}),!!x?.tablet?.image?.src&&e("link",{rel:"preload",href:x.tablet.image.src,as:"image"}),!!x?.mobile?.image?.src&&e("link",{rel:"preload",href:x.mobile.image.src,as:"image"})]}),N?e(T,{className:J,style:V,children:W}):W]})};export{Row as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{makeStyleResponsive as e,getValueByDevice as t,isEmptyChildren as
|
|
2
|
+
import{makeStyleResponsive as e,getValueByDevice as t,isEmptyChildren as o,splitStyle as r,composeRadius as p,composeGridLayout as i,makeStyle as l,getStyleBackgroundByDevice as d,getGradientBgrStyleByDevice as n}from"@gem-sdk/core";import{createStyle as a}from"@gem-sdk/system";import{getInnerRadiusExcludeBorder as m,createStyleObject as s}from"./helpers.js";import{postPurchaseViewSpacing as b}from"../../../../post-purchase/common/helper.js";let getRowStyle=(g,f)=>{let{children:u,setting:c,builderProps:h,styles:k,style:x,advanced:v,isNotFullWidth:w,parentStyle:y}=g,{isSection:j,layout:R,horizontalAlign:S,responsive:T,inlineAlignment:O}=c??{},{width:q,columnGap:z,rowGap:C,fullWidth:D,background:H,verticalGutter:L,verticalGutterMobile:Y,enablePagePadding:A,height:B}=k??{},E=m(v?.border,v?.rounded),F=(e,t)=>{let o=e?.normal,r=t?.normal;if(!o||!r||r?.borderType=="none"||"square"===o.radiusType||"none"===o.radiusType)return!1;for(let e in o)if(Object.hasOwn(o,e)&&"0px"!==o[e])return!0;return!1},G=e("of",{desktop:F(E.desktop,t(v?.border,"desktop"))?"hidden":void 0,tablet:F(E.tablet,t(v?.border,"tablet"))?"hidden":void 0,mobile:F(E.mobile,t(v?.border,"mobile"))?"hidden":void 0}),I=h?.builderData?.childrens?.length,J={...e("aspect",{desktop:"16/9"})},K=o(u)||!I,M={desktop:q?.desktop==="default"?"1200px":q?.desktop,tablet:q?.tablet==="default"?"1200px":q?.tablet,mobile:q?.mobile==="default"?"1200px":q?.mobile},N=s(f?M:q,D),[P,Q]=r(["pos","top","left","bottom","right","z"],x),U=()=>({...j?Q:x,...e("cg",L),...e("rg",Y),...R?i(R):e("gtc",T),...e("w",N.content),...e("h",B),...j?{}:G}),V=()=>({"--mb":"0px","--mt":"0px",...e("cg",z),...l({pc:O,rg:C?b[C]:"0px"})}),W=t=>({...d(H,t),...n(H,{desktop:!0,tablet:!0,mobile:!0}),...e("pc",S)}),X=()=>{let e=w&&!K;return e?{marginLeft:"0px",marginRight:"0px"}:{}},Z=()=>({...p(E)}),$=(e=!1)=>a({...U(),...W(),...X(),...e?V():{},...c?.sameHeightSubgridContainer&&y}),_=a({...Z()}),ee=a({...J,"pointer-events":"none",transform:"translateY(-50%)",height:"100%","object-fit":"cover",top:"50%"}),et=e=>{if(void 0!==e)return e?"var(--g-ct-p, 15px)":"none"},eo={desktop:et(A?.desktop),tablet:et(A?.tablet),mobile:et(A?.mobile)},er=a({...P,...e("w",N.wrapper),...e("pl",eo),...e("pr",eo)});return{embedVideoStyle:ee,backgroundBoxStyle:_,rowStyle:$,sectionStyle:er}};export{getRowStyle};
|