@gem-sdk/components 23.0.0-staging.19 → 23.0.0-staging.20

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";var e=require("@gem-sdk/core"),t=require("./helpers.js");function o(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}const l=t=>Object.fromEntries(Object.entries(e.getWidthByShapeGlobalSize(t,!0)).map(([e,t])=>[e,"auto"===t?"100%":t])),r=t=>{if(t)return{desktop:e.getValueByDevice(t,"desktop"),tablet:e.getValueByDevice(t,"tablet"),mobile:e.getValueByDevice(t,"mobile")}},a=t=>{if(!t)return;let o={};return e.DEVICES.forEach(l=>{let r=e.getResponsiveValueByScreen(t,l),a=r?.videoAlign;o[l]=a||"top"}),Object.keys(o).length>0?o:void 0};exports.getAdaptiveStyle=r=>{let{sizeSetting:a,background:i}=r??{},n={...t.getDisplayStyleByFitContent(a,i),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(a)),...e.makeStyleWithDefault("w",l(a),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"})};return o(n)},exports.getBackgroundStyle=(l,r,a)=>{let{hoverEffectScale:i,background:n,hoverEffectDuration:s}=l??{},g=`${parseFloat(`${s}`)??.5}s`,p={...t.getStyleHeroBannerBg(t.getResponsiveSetting(n||{}),r),...e.getStyleBackgroundByDevice(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":g,"--scale":t.formatHoverScale(i),...e.makeStyleResponsive("pos",t.getAttachmentDevice(n)),transform:a,transition:`transform ${g} cubic-bezier(0,0,0,1)`};return o(p)},exports.getContainBackgroundStyle=e=>{let{borderBg:l,cornerBg:r}=e??{},a={"clip-path":t.getClipPath(l?.width,r)};return o(a)},exports.getContainerStyle=l=>{let{sizeSetting:r,background:a,borderBg:i,cornerBg:n,shadowBg:s,hasActiveShadow:g}=l??{},p={...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(r)),...t.getStyleAspectRatioHeroBannerCustom(a,r),...e.makeStyle({bs:i?.border??i?.border,bw:i?.width??i?.width,bc:e.getSingleColorVariable(i?.color)}),...e.getRadiusStyleActiveState({...n,active:{...n||{},radiusType:"custom"}}),...a?{...e.getStyleBgColor(a)}:{},...e.getStyleShadow({value:s,styleAppliedFor:"box-shadow",isEnableShadow:g})};return o(p)},exports.getHtml5VideoStyle=(t,l,i)=>{let n=r(l),s=a(i),g={...e.makeStyleResponsive("aspect",t),...n?e.makeStyleResponsive("objf",n):{},...s?e.makeStyleResponsive("objp",s):{}};return o(g)},exports.getOverlayStyle=l=>{let{overlayColor:r,overlayOpacity:a,hoverEffect:i}=l??{},{disableOpacity:n}=t.opacityEnabledData(l),s="number"!=typeof a?.normal||isNaN(a?.normal)?"string"==typeof a?.normal?`${parseInt(a?.normal)}%`:"0%":`${a?.normal}%`,g=e.makeStyleState("op",{normal:s,hover:t.getOpacityHover(l)}),p=e.getGlobalColorStateStyle("bgc",{...r,hover:r?.hover||r?.normal});n&&(delete p?.["--bgc"],delete g?.["--op"]),i||(delete p?.["--hvr-bgc"],delete g?.["--hvr-op"]);let y={...p,...g,"--top":"0","--left":"0"};return o(y)},exports.getRowStyle=t=>{let{contentPadding:l}=t??{},r={...e.getResponsiveStylePadding(l)};return o(r)},exports.getStyle=(l,r,a)=>{let{sizeSetting:i}=l??{},n={...a,...t.getVisibilityStyle(a),...e.makeStyleWithDefault("w",e.getWidthByShapeGlobalSize(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(i))};return o(n)},exports.getYoutubeIframeStyle=(t,l)=>{let a=r(l),i={...e.makeStyleResponsive("aspect",t),...a?e.makeStyleResponsive("objf",a):{},"pointer-events":"none"};return o(i)};
1
+ "use strict";var e=require("@gem-sdk/core"),t=require("./helpers.js");function l(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}const o=({background:t,device:l})=>{let o=Number(e.getResponsiveValueByScreen(t,l)?.image?.width);return o>0?`${o}px`:void 0},r=({sizeSetting:t,background:l})=>{let r=e.getWidthByShapeGlobalSize(t,!0);return Object.fromEntries(e.DEVICES.flatMap(e=>{let t=r[e];return void 0===t?[]:"auto"!==t?[[e,t]]:[[e,o({background:l,device:e})??"100%"]]}))},a=t=>{if(t)return{desktop:e.getValueByDevice(t,"desktop"),tablet:e.getValueByDevice(t,"tablet"),mobile:e.getValueByDevice(t,"mobile")}},i=t=>{if(!t)return;let l={};return e.DEVICES.forEach(o=>{let r=e.getResponsiveValueByScreen(t,o),a=r?.videoAlign;l[o]=a||"top"}),Object.keys(l).length>0?l:void 0};exports.getAdaptiveStyle=o=>{let{sizeSetting:a,background:i}=o??{},n={...t.getDisplayStyleByFitContent(a,i),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(a)),...e.makeStyleWithDefault("w",r({sizeSetting:a,background:i}),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"})};return l(n)},exports.getBackgroundStyle=(o,r,a)=>{let{hoverEffectScale:i,background:n,hoverEffectDuration:s}=o??{},g=`${parseFloat(`${s}`)??.5}s`,p={...t.getStyleHeroBannerBg(t.getResponsiveSetting(n||{}),r),...e.getStyleBackgroundByDevice(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":g,"--scale":t.formatHoverScale(i),...e.makeStyleResponsive("pos",t.getAttachmentDevice(n)),transform:a,transition:`transform ${g} cubic-bezier(0,0,0,1)`};return l(p)},exports.getContainBackgroundStyle=e=>{let{borderBg:o,cornerBg:r}=e??{},a={"clip-path":t.getClipPath(o?.width,r)};return l(a)},exports.getContainerStyle=o=>{let{sizeSetting:r,background:a,borderBg:i,cornerBg:n,shadowBg:s,hasActiveShadow:g}=o??{},p={...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(r)),...t.getStyleAspectRatioHeroBannerCustom(a,r),...e.makeStyle({bs:i?.border??i?.border,bw:i?.width??i?.width,bc:e.getSingleColorVariable(i?.color)}),...e.getRadiusStyleActiveState({...n,active:{...n||{},radiusType:"custom"}}),...a?{...e.getStyleBgColor(a)}:{},...e.getStyleShadow({value:s,styleAppliedFor:"box-shadow",isEnableShadow:g})};return l(p)},exports.getHtml5VideoStyle=(t,o,r)=>{let n=a(o),s=i(r),g={...e.makeStyleResponsive("aspect",t),...n?e.makeStyleResponsive("objf",n):{},...s?e.makeStyleResponsive("objp",s):{}};return l(g)},exports.getOverlayStyle=o=>{let{overlayColor:r,overlayOpacity:a,hoverEffect:i}=o??{},{disableOpacity:n}=t.opacityEnabledData(o),s="number"!=typeof a?.normal||isNaN(a?.normal)?"string"==typeof a?.normal?`${parseInt(a?.normal)}%`:"0%":`${a?.normal}%`,g=e.makeStyleState("op",{normal:s,hover:t.getOpacityHover(o)}),p=e.getGlobalColorStateStyle("bgc",{...r,hover:r?.hover||r?.normal});n&&(delete p?.["--bgc"],delete g?.["--op"]),i||(delete p?.["--hvr-bgc"],delete g?.["--hvr-op"]);let y={...p,...g,"--top":"0","--left":"0"};return l(y)},exports.getRowStyle=t=>{let{contentPadding:o}=t??{},r={...e.getResponsiveStylePadding(o)};return l(r)},exports.getStyle=(o,r,a)=>{let{sizeSetting:i}=o??{},n={...a,...t.getVisibilityStyle(a),...e.makeStyleWithDefault("w",e.getWidthByShapeGlobalSize(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...e.makeStyleResponsive("h",e.getHeightByShapeGlobalSize(i))};return l(n)},exports.getYoutubeIframeStyle=(t,o)=>{let r=a(o),i={...e.makeStyleResponsive("aspect",t),...r?e.makeStyleResponsive("objf",r):{},"pointer-events":"none"};return l(i)};
@@ -1 +1 @@
1
- import{makeStyleResponsive as e,getHeightByShapeGlobalSize as t,makeStyleWithDefault as r,getWidthByShapeGlobalSize as o,getStyleShadow as l,getStyleBgColor as n,getRadiusStyleActiveState as a,makeStyle as i,getSingleColorVariable as c,makeStyleState as b,getGlobalColorStateStyle as s,getResponsiveStylePadding as g,getStyleBackgroundByDevice as p,getValueByDevice as d,DEVICES as m,getResponsiveValueByScreen as u}from"@gem-sdk/core";import{getVisibilityStyle as h,getStyleAspectRatioHeroBannerCustom as f,getOpacityHover as w,getDisplayStyleByFitContent as y,getAttachmentDevice as v,formatHoverScale as S,getStyleHeroBannerBg as j,getClipPath as k,opacityEnabledData as O,getResponsiveSetting as $}from"./helpers.js";function A(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}let B=(l,n,a)=>{let{sizeSetting:i}=l??{},c={...a,...h(a),...r("w",o(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...e("h",t(i))};return A(c)},E=r=>{let{sizeSetting:o,background:b,borderBg:s,cornerBg:g,shadowBg:p,hasActiveShadow:d}=r??{},m={...e("h",t(o)),...f(b,o),...i({bs:s?.border??s?.border,bw:s?.width??s?.width,bc:c(s?.color)}),...a({...g,active:{...g||{},radiusType:"custom"}}),...b?{...n(b)}:{},...l({value:p,styleAppliedFor:"box-shadow",isEnableShadow:d})};return A(m)},I=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:o}=e??{},{disableOpacity:l}=O(e),n="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,a=b("op",{normal:n,hover:w(e)}),i=s("bgc",{...t,hover:t?.hover||t?.normal});l&&(delete i?.["--bgc"],delete a?.["--op"]),o||(delete i?.["--hvr-bgc"],delete a?.["--hvr-op"]);let c={...i,...a,"--top":"0","--left":"0"};return A(c)},x=e=>{let{contentPadding:t}=e??{},r={...g(t)};return A(r)},C=e=>Object.fromEntries(Object.entries(o(e,!0)).map(([e,t])=>[e,"auto"===t?"100%":t])),F=o=>{let{sizeSetting:l,background:n}=o??{},a={...y(l,n),...e("h",t(l)),...r("w",C(l),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"})};return A(a)},N=(t,r,o)=>{let{hoverEffectScale:l,background:n,hoverEffectDuration:a}=t??{},i=`${parseFloat(`${a}`)??.5}s`,c={...j($(n||{}),r),...p(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":i,"--scale":S(l),...e("pos",v(n)),transform:o,transition:`transform ${i} cubic-bezier(0,0,0,1)`};return A(c)},z=e=>{let{borderBg:t,cornerBg:r}=e??{},o={"clip-path":k(t?.width,r)};return A(o)},H=e=>{if(e)return{desktop:d(e,"desktop"),tablet:d(e,"tablet"),mobile:d(e,"mobile")}},R=e=>{if(!e)return;let t={};return m.forEach(r=>{let o=u(e,r),l=o?.videoAlign;t[r]=l||"top"}),Object.keys(t).length>0?t:void 0},T=(t,r,o)=>{let l=H(r),n=R(o),a={...e("aspect",t),...l?e("objf",l):{},...n?e("objp",n):{}};return A(a)},V=(t,r)=>{let o=H(r),l={...e("aspect",t),...o?e("objf",o):{},"pointer-events":"none"};return A(l)};export{F as getAdaptiveStyle,N as getBackgroundStyle,z as getContainBackgroundStyle,E as getContainerStyle,T as getHtml5VideoStyle,I as getOverlayStyle,x as getRowStyle,B as getStyle,V as getYoutubeIframeStyle};
1
+ import{makeStyleResponsive as e,getHeightByShapeGlobalSize as t,makeStyleWithDefault as r,getWidthByShapeGlobalSize as o,getStyleShadow as l,getStyleBgColor as n,getRadiusStyleActiveState as a,makeStyle as i,getSingleColorVariable as b,makeStyleState as c,getGlobalColorStateStyle as d,getResponsiveStylePadding as g,getStyleBackgroundByDevice as p,DEVICES as u,getValueByDevice as s,getResponsiveValueByScreen as m}from"@gem-sdk/core";import{getVisibilityStyle as h,getStyleAspectRatioHeroBannerCustom as f,getOpacityHover as w,getDisplayStyleByFitContent as v,getAttachmentDevice as y,formatHoverScale as S,getStyleHeroBannerBg as k,getClipPath as j,opacityEnabledData as $,getResponsiveSetting as O}from"./helpers.js";function A(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}let B=(l,n,a)=>{let{sizeSetting:i}=l??{},b={...a,...h(a),...r("w",o(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...e("h",t(i))};return A(b)},E=r=>{let{sizeSetting:o,background:c,borderBg:d,cornerBg:g,shadowBg:p,hasActiveShadow:u}=r??{},s={...e("h",t(o)),...f(c,o),...i({bs:d?.border??d?.border,bw:d?.width??d?.width,bc:b(d?.color)}),...a({...g,active:{...g||{},radiusType:"custom"}}),...c?{...n(c)}:{},...l({value:p,styleAppliedFor:"box-shadow",isEnableShadow:u})};return A(s)},x=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:o}=e??{},{disableOpacity:l}=$(e),n="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,a=c("op",{normal:n,hover:w(e)}),i=d("bgc",{...t,hover:t?.hover||t?.normal});l&&(delete i?.["--bgc"],delete a?.["--op"]),o||(delete i?.["--hvr-bgc"],delete a?.["--hvr-op"]);let b={...i,...a,"--top":"0","--left":"0"};return A(b)},I=e=>{let{contentPadding:t}=e??{},r={...g(t)};return A(r)},N=({background:e,device:t})=>{let r=Number(m(e,t)?.image?.width);return r>0?`${r}px`:void 0},C=({sizeSetting:e,background:t})=>{let r=o(e,!0);return Object.fromEntries(u.flatMap(e=>{let o=r[e];return void 0===o?[]:"auto"!==o?[[e,o]]:[[e,N({background:t,device:e})??"100%"]]}))},F=o=>{let{sizeSetting:l,background:n}=o??{},a={...v(l,n),...e("h",t(l)),...r("w",C({sizeSetting:l,background:n}),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"})};return A(a)},z=(t,r,o)=>{let{hoverEffectScale:l,background:n,hoverEffectDuration:a}=t??{},i=`${parseFloat(`${a}`)??.5}s`,b={...k(O(n||{}),r),...p(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":i,"--scale":S(l),...e("pos",y(n)),transform:o,transition:`transform ${i} cubic-bezier(0,0,0,1)`};return A(b)},H=e=>{let{borderBg:t,cornerBg:r}=e??{},o={"clip-path":j(t?.width,r)};return A(o)},M=e=>{if(e)return{desktop:s(e,"desktop"),tablet:s(e,"tablet"),mobile:s(e,"mobile")}},R=e=>{if(!e)return;let t={};return u.forEach(r=>{let o=m(e,r),l=o?.videoAlign;t[r]=l||"top"}),Object.keys(t).length>0?t:void 0},T=(t,r,o)=>{let l=M(r),n=R(o),a={...e("aspect",t),...l?e("objf",l):{},...n?e("objp",n):{}};return A(a)},V=(t,r)=>{let o=M(r),l={...e("aspect",t),...o?e("objf",o):{},"pointer-events":"none"};return A(l)};export{F as getAdaptiveStyle,z as getBackgroundStyle,H as getContainBackgroundStyle,E as getContainerStyle,T as getHtml5VideoStyle,x as getOverlayStyle,I as getRowStyle,B as getStyle,V as getYoutubeIframeStyle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "23.0.0-staging.19",
3
+ "version": "23.0.0-staging.20",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",