@gem-sdk/components 4.0.12 → 4.0.13
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/grid/components/row/Row.js +1 -1
- package/dist/cjs/grid/hooks/useRowSetting.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.js +1 -1
- package/dist/esm/grid/components/row/Row.js +1 -1
- package/dist/esm/grid/hooks/useRowSetting.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.js +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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,bgVideo:m,isRowEmpty:n,rowClassEditorOnly:u,isRenderPlaceholderViewBox:d,isPostPurchase:c,ref:p,postPurchaseVerticalAlign:j}=useRowSetting.useRowSettings(e),{rowStyle:x,backgroundBoxStyle:y,embedVideoStyle:h,sectionStyle:R}=styles.getRowStyle(e,c),{rowAttr:g}=attrs.getAttr(e),{rowClass:b,backgroundBoxClass:v,backgroundBoxInnerClass:f,sectionClass:C,wrapperYoutubeClasses:k,iframeYoutubeClasses:q}=classes.getClass(e),E=system.createClass({[b]:!0,[u]:!0}),w=React.useMemo(()=>{if(!helpers.checkHasBackgroundVideo(o))return;if(m?.videoType==="html5"&&!m.videoHtml5||m?.videoType==="youtube"&&!m.video)return null;if(m?.videoType==="html5"&&m.videoHtml5)return jsxRuntime.jsx(HTML5Embed.default,{muted:!0,loop:m.loop,controls:!1,autoplay:!0,src:m.videoHtml5,title:"Video",className:"gp-relative",style:h});let e=m?.video??"",s=helpers$1.getYoutubeVideoId(e);if(!helpers$1.youtubeVideoRegex.test(e)||!s)return;let t=`&loop=${m?.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:h,wrapperClass:k,iframeClass:q})},[o,m,h,q,k]),H=React.Children.map(r,e=>!!core.isEmptyChildren(e)),T=jsxRuntime.jsxs("div",{ref:p,...a,...g,style:x(c),className:E,children:[!!w&&jsxRuntime.jsx("div",{className:v,style:y,children:jsxRuntime.jsx("div",{className:f,children:w})}),d?jsxRuntime.jsx(jsxRuntime.Fragment,{}):n?jsxRuntime.jsx(ChildrenDroppable.default,{}):React.Children.map(r,s=>React.isValidElement(s)?React.createElement(s.type,{hiddenEmptyCol:e.hiddenEmptyCol&&!core.isEmptyChildren(s)&&!H,...s.props,key:s.key,order:t?.order,layout:t?.layout,justifyContent:c?j():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:C,style:R,children:T}):T]})};exports.default=Row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useInView=require("../../common/hooks/useInView.js");const useRowSettings=e=>{let{setting:t,styles:
|
|
1
|
+
"use strict";var React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),useInView=require("../../common/hooks/useInView.js");const useRowSettings=e=>{let{setting:t,styles:r,children:i,maxWidthWithEmptyChildren:s,builderAttrs:n}=e,{isSection:o,lazy:u,layout:c,blockAlignment:l}=t??{},{background:a}=r??{},d=core.useCurrentDevice(),g=core.useEditorMode(),m=core.usePageType(),h=core.getBgVideoByDevice(a,d),R=React.useRef(null),y=React.useMemo(()=>core.isEmptyChildren(i),[i]),w=e=>{R.current&&(clearTimeout(R.current),R.current=null);let t=e?.getBoundingClientRect().height;e.style.height=`${t||500}px`,e.style.overflow="hidden"},p=e=>{R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{e.style.height="",e.style.overflow="",R.current=null},1500)},[f,v]=useInView.useInView({initialInView:!u,triggerOnce:!0,skip:!o,onChange:(e,t)=>{t&&t instanceof HTMLElement&&"edit"===g&&(e?p(t):w(t))}}),C=React.useMemo(()=>!v&&"edit"==g&&"POST_PURCHASE"!==m,[v,g,m]),P=React.useMemo(()=>"edit"!==g&&u&&!v,[v,u,g]),S=()=>{let e=s&&y&&"edit"===g;if(!e)return{};let t=core.getResponsiveValue(c,"display"),r=t[d];return{width:"fit"===r?"fit-content":"400px"}},T=system.createClass({...S,"gp-content-visibility-hidden":P}),V=()=>({desktop:l,tablet:l,mobile:l});return{ref:f,isRowEmpty:y,bgVideo:h,rowClassEditorOnly:T,isRenderPlaceholderViewBox:C,builderAttrs:n,children:i,isPostPurchase:"POST_PURCHASE"===m,postPurchaseVerticalAlign:V}};exports.useRowSettings=useRowSettings;
|
package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),ProductGalleryGrid=require("../child/ProductGalleryGrid.js");const GalleryGrid=e=>{let{setting:r,styles:t,gallery:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),ProductGalleryGrid=require("../child/ProductGalleryGrid.js");const GalleryGrid=e=>{let{setting:r,styles:t,gallery:l,builderProps:i,noDataChildren:d,onHandleClickImage:u,children:n}=e,o={...r,...t};return(console.log("setting",r),l?.[0]?.id==="noImageError")?jsxRuntime.jsx(jsxRuntime.Fragment,{children:d}):jsxRuntime.jsx(ProductGalleryGrid.default,{productImages:l,enableHoverAction:!0,...o,builderPropUID:i?.uid,onHandleClick:(e,r)=>u(e||"",r),children:n})};exports.default=GalleryGrid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{useMemo as t,Children as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{useMemo as t,Children as m,isValidElement as l,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 u}from"./common/attrs.js";import{getClass as h}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:E}=b??{},{builderAttrs:H,bgVideo:x,isRowEmpty:R,rowClassEditorOnly:L,isRenderPlaceholderViewBox:$,isPostPurchase:z,ref:A,postPurchaseVerticalAlign:B}=y(k),{rowStyle:D,backgroundBoxStyle:I,embedVideoStyle:M,sectionStyle:S}=v(k,z),{rowAttr:V}=u(k),{rowClass:Y,backgroundBoxClass:q,backgroundBoxInnerClass:F,sectionClass:G,wrapperYoutubeClasses:J,iframeYoutubeClasses:K}=h(k),O=f({[Y]:!0,[L]:!0}),P=t(()=>{if(!g(E))return;if(x?.videoType==="html5"&&!x.videoHtml5||x?.videoType==="youtube"&&!x.video)return null;if(x?.videoType==="html5"&&x.videoHtml5)return e(p,{muted:!0,loop:x.loop,controls:!1,autoplay:!0,src:x.videoHtml5,title:"Video",className:"gp-relative",style:M});let o=x?.video??"",r=d(o);if(!n.test(o)||!r)return;let t=`&loop=${x?.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:M,wrapperClass:J,iframeClass:K})},[E,x,M,K,J]),Q=m.map(w,e=>!!j(e)),U=o("div",{ref:A,...H,...V,style:D(z),className:O,children:[!!P&&e("div",{className:q,style:I,children:e("div",{className:F,children:P})}),$?e(r,{}):R?e(a,{}):m.map(w,e=>l(e)?i(e.type,{hiddenEmptyCol:k.hiddenEmptyCol&&!j(e)&&!Q,...e.props,key:e.key,order:C?.order,layout:C?.layout,justifyContent:z?B():C?.verticalAlign}):null)]});return o(r,{children:[!!b?.preloadBgImage&&o(s,{children:[!!E?.desktop?.image?.src&&e("link",{rel:"preload",href:E.desktop.image.src,as:"image"}),!!E?.tablet?.image?.src&&e("link",{rel:"preload",href:E.tablet.image.src,as:"image"}),!!E?.mobile?.image?.src&&e("link",{rel:"preload",href:E.mobile.image.src,as:"image"})]}),N?e(T,{className:G,style:S,children:U}):U]})};export{Row as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useRef as e,useMemo as t}from"react";import{useCurrentDevice as i,useEditorMode as r,usePageType as n,getBgVideoByDevice as o,isEmptyChildren as l,getResponsiveValue as s}from"@gem-sdk/core";import{createClass as u}from"@gem-sdk/system";import{useInView as c}from"../../common/hooks/useInView.js";let useRowSettings=m=>{let{setting:d,styles:g,children:h,maxWidthWithEmptyChildren:p,builderAttrs:f}=m,{isSection:a,lazy:w,layout:y,blockAlignment:P}=d??{},{background:S}=g??{},T=i(),k=r(),R=n(),C=o(S,T),b=e(null),v=t(()=>l(h),[h]),x=e=>{b.current&&(clearTimeout(b.current),b.current=null);let t=e?.getBoundingClientRect().height;e.style.height=`${t||500}px`,e.style.overflow="hidden"},E=e=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{e.style.height="",e.style.overflow="",b.current=null},1500)},[H,O]=c({initialInView:!w,triggerOnce:!0,skip:!a,onChange:(e,t)=>{t&&t instanceof HTMLElement&&"edit"===k&&(e?E(t):x(t))}}),A=t(()=>!O&&"edit"==k&&"POST_PURCHASE"!==R,[O,k,R]),I=t(()=>"edit"!==k&&w&&!O,[O,w,k]),U=()=>{let e=p&&v&&"edit"===k;if(!e)return{};let t=s(y,"display"),i=t[T];return{width:"fit"===i?"fit-content":"400px"}},V=u({...U,"gp-content-visibility-hidden":I}),_=()=>({desktop:P,tablet:P,mobile:P});return{ref:H,isRowEmpty:v,bgVideo:C,rowClassEditorOnly:V,isRenderPlaceholderViewBox:A,builderAttrs:f,children:h,isPostPurchase:"POST_PURCHASE"===R,postPurchaseVerticalAlign:_}};export{useRowSettings};
|
package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as r,Fragment as e}from"react/jsx-runtime";import l from"../child/ProductGalleryGrid.js";let GalleryGrid=
|
|
2
|
+
import{jsx as r,Fragment as e}from"react/jsx-runtime";import l from"../child/ProductGalleryGrid.js";let GalleryGrid=o=>{let{setting:i,styles:t,gallery:d,builderProps:n,noDataChildren:a,onHandleClickImage:c,children:m}=o,u={...i,...t};return(console.log("setting",i),d?.[0]?.id==="noImageError")?r(e,{children:a}):r(l,{productImages:d,enableHoverAction:!0,...u,builderPropUID:n?.uid,onHandleClick:(r,e)=>c(r||"",e),children:m})};export{GalleryGrid as default};
|