@gem-sdk/components 17.0.0-dev.83 → 17.0.0-dev.84
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 e=require("react/jsx-runtime"),r=require("react"),s=require("next/head"),t=require("../ChildrenDroppable.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),s=require("next/head"),t=require("../ChildrenDroppable.js"),l=require("../../../video/components/HTML5Embed.js"),i=require("../../../video/common/helpers.js"),o=require("../../../video/components/LiteYouTubeEmbed.js"),a=require("@gem-sdk/system"),d=require("../../hooks/useRowSetting.js"),m=require("./common/attrs.js"),n=require("./common/classes.js"),u=require("./common/styles.js"),c=require("./common/helpers.js"),p=require("@gem-sdk/core"),y=require("../section/lazyload/LazySectionWrapper.js");exports.default=j=>{let{styles:h,setting:g,children:v}=j,{isSection:x,as:f="div"}=g??{},{background:q}=h??{},{builderAttrs:k,bgVideo:b,isRowEmpty:C,rowClassEditorOnly:E,isRenderPlaceholderViewBox:w,isPostPurchase:N,ref:H,postPurchaseVerticalAlign:R}=d.useRowSettings(j),{rowStyle:T,backgroundBoxStyle:V,embedVideoStyle:P,sectionStyle:S}=u.getRowStyle({rowProps:j,isPostPurchase:N,type:"React"}),{rowAttr:z}=m.getAttr(j),{rowClass:L,backgroundBoxClass:M,backgroundBoxInnerClass:A,sectionClass:B,wrapperYoutubeClasses:F,iframeYoutubeClasses:I}=n.getClass(j),Y=a.createClass({[L]:!0,[E]:!0}),$=r.useMemo(()=>{if(!c.checkHasBackgroundVideo(q))return;if(b?.videoType==="html5"&&!b.videoHtml5||b?.videoType==="youtube"&&!b.video)return null;if(b?.videoType==="html5"&&b.videoHtml5)return e.jsx(l.default,{muted:!0,loop:b.loop,controls:!1,autoplay:!0,src:b.videoHtml5,title:"Video",className:"gp-relative",style:P});let r=b?.video??"",s=i.getYoutubeVideoId(r);if(!i.youtubeVideoRegex.test(r)||!s)return;let t=`&loop=${b?.loop?1:0}&playlist=${s}&showinfo=0&rel=0&fs=0&enablejsapi=1`;return e.jsx(o.default,{id:s,autoplay:!0,title:"",controls:!1,params:t,adNetwork:!1,noCookie:!0,muted:!0,lazy:!1,style:P,wrapperClass:F,iframeClass:I})},[q,b,P,I,F]),_=r.Children.map(v,e=>!!p.isEmptyChildren(e)),D=e.jsxs("div",{ref:H,...k,...z,style:T(N),className:Y,children:[!!$&&e.jsx("div",{className:M,style:V,children:e.jsx("div",{className:A,children:$})}),w?e.jsx(e.Fragment,{}):C?e.jsx(t.default,{}):r.Children.map(v,e=>r.isValidElement(e)?r.createElement(e.type,{hiddenEmptyCol:j.hiddenEmptyCol&&!p.isEmptyChildren(e)&&!_,...e.props,key:e.key,order:g?.order,layout:g?.layout,justifyContent:N?R():g?.verticalAlign}):null)]});return e.jsxs(e.Fragment,{children:[!!h?.preloadBgImage&&e.jsxs(s,{children:[!!q?.desktop?.image?.src&&e.jsx("link",{rel:"preload",href:q.desktop.image.src,as:"image"}),!!q?.tablet?.image?.src&&e.jsx("link",{rel:"preload",href:q.tablet.image.src,as:"image"}),!!q?.mobile?.image?.src&&e.jsx("link",{rel:"preload",href:q.mobile.image.src,as:"image"})]}),x?e.jsx(y.default,{children:e.jsx(f,{className:B,style:S,children:D})}):D]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("@gem-sdk/core"),i=require("./lazyInteractionTrigger.js"),n=require("./lazySectionCoordinator.js");const s=({children:t,isFirst:s})=>{let[u,a]=r.useState(()=>s||i.isInteracted()),c=r.useRef(null);return(r.useEffect(()=>{s&&requestAnimationFrame(()=>{n.startCascade(c.current?.clientHeight??0)})},[s]),r.useEffect(()=>{u&&!s&&requestAnimationFrame(()=>{n.notifySectionRendered(c.current?.clientHeight??0)})},[u,s]),r.useEffect(()=>{if(u||s)return;let e=n.enqueueSection(()=>a(!0)),r=i.subscribeInteraction(()=>a(!0));return()=>{e(),r()}},[u,s]),u)?r.isValidElement(t)?r.cloneElement(t,{ref:c}):e.jsx(e.Fragment,{children:t}):e.jsx("div",{"data-lazyload-section":!0})};exports.default=({children:r})=>{let i=t.useEditorMode(),n=t.useLazyPriority();return"edit"===i||null===n?e.jsx(e.Fragment,{children:r}):e.jsx(s,{isFirst:n,children:r})};
|
|
@@ -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 i,createElement as l}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";import k from"../section/lazyload/LazySectionWrapper.js";let b=b=>{let{styles:C,setting:w,children:N}=b,{isSection:T,as:E="div"}=w??{},{background:H}=C??{},{builderAttrs:x,bgVideo:z,isRowEmpty:L,rowClassEditorOnly:P,isRenderPlaceholderViewBox:R,isPostPurchase:S,ref:$,postPurchaseVerticalAlign:A}=y(b),{rowStyle:B,backgroundBoxStyle:D,embedVideoStyle:I,sectionStyle:M}=v({rowProps:b,isPostPurchase:S,type:"React"}),{rowAttr:V}=u(b),{rowClass:W,backgroundBoxClass:Y,backgroundBoxInnerClass:q,sectionClass:F,wrapperYoutubeClasses:G,iframeYoutubeClasses:J}=h(b),K=f({[W]:!0,[P]:!0}),O=t(()=>{if(!g(H))return;if(z?.videoType==="html5"&&!z.videoHtml5||z?.videoType==="youtube"&&!z.video)return null;if(z?.videoType==="html5"&&z.videoHtml5)return e(p,{muted:!0,loop:z.loop,controls:!1,autoplay:!0,src:z.videoHtml5,title:"Video",className:"gp-relative",style:I});let o=z?.video??"",r=d(o);if(!n.test(o)||!r)return;let t=`&loop=${z?.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:I,wrapperClass:G,iframeClass:J})},[H,z,I,J,G]),Q=m.map(N,e=>!!j(e)),U=o("div",{ref:$,...x,...V,style:B(S),className:K,children:[!!O&&e("div",{className:Y,style:D,children:e("div",{className:q,children:O})}),R?e(r,{}):L?e(a,{}):m.map(N,e=>i(e)?l(e.type,{hiddenEmptyCol:b.hiddenEmptyCol&&!j(e)&&!Q,...e.props,key:e.key,order:w?.order,layout:w?.layout,justifyContent:S?A():w?.verticalAlign}):null)]});return o(r,{children:[!!C?.preloadBgImage&&o(s,{children:[!!H?.desktop?.image?.src&&e("link",{rel:"preload",href:H.desktop.image.src,as:"image"}),!!H?.tablet?.image?.src&&e("link",{rel:"preload",href:H.tablet.image.src,as:"image"}),!!H?.mobile?.image?.src&&e("link",{rel:"preload",href:H.mobile.image.src,as:"image"})]}),T?e(k,{children:e(E,{className:F,style:M,children:U})}):U]})};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useState as t,useRef as
|
|
1
|
+
import{jsx as r,Fragment as e}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as n,isValidElement as o,cloneElement as a}from"react";import{useEditorMode as l,useLazyPriority as m}from"@gem-sdk/core";import{isInteracted as c,subscribeInteraction as u}from"./lazyInteractionTrigger.js";import{startCascade as d,notifySectionRendered as s,enqueueSection as f}from"./lazySectionCoordinator.js";let p=({children:t})=>{let i=l(),n=m();return"edit"===i||null===n?r(e,{children:t}):r(g,{isFirst:n,children:t})},g=({children:l,isFirst:m})=>{let[p,g]=t(()=>m||c()),h=i(null);return(n(()=>{m&&requestAnimationFrame(()=>{d(h.current?.clientHeight??0)})},[m]),n(()=>{p&&!m&&requestAnimationFrame(()=>{s(h.current?.clientHeight??0)})},[p,m]),n(()=>{if(p||m)return;let r=f(()=>g(!0)),e=u(()=>g(!0));return()=>{r(),e()}},[p,m]),p)?o(l)?a(l,{ref:h}):r(e,{children:l}):r("div",{"data-lazyload-section":!0})};export{p as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "17.0.0-dev.
|
|
3
|
+
"version": "17.0.0-dev.84",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "17.0.0-dev.
|
|
30
|
-
"@gem-sdk/styles": "17.0.0-dev.
|
|
31
|
-
"@gem-sdk/system": "17.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "17.0.0-dev.84",
|
|
30
|
+
"@gem-sdk/styles": "17.0.0-dev.84",
|
|
31
|
+
"@gem-sdk/system": "17.0.0-dev.84",
|
|
32
32
|
"@types/react-transition-group": "^4.4.12",
|
|
33
33
|
"postcss-import": "16.1.1",
|
|
34
34
|
"@thedutchcoder/postcss-rem-to-px": "0.0.2",
|