@gem-sdk/components 3.1.0-staging.1140 → 3.1.0-staging.1141
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 core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==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=`${parseFloat(`${a}`)??.5}s`,s={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":i,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:`transform ${i} cubic-bezier(0,0,0,1)`};return filterTruthyStyles(s)},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 +1 @@
|
|
|
1
|
-
import{makeStyleWithDefault as e,getWidthByShapeGlobalSize as t,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as n,getRadiusStyleActiveState as i,getStyleBgColor as y,getStyleShadow as a,makeStyleState as g,getGlobalColorStateStyle as u,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as d,getAspectRatioSettings as h,getOpacityHover as p,getDisplayStyleByFitContent as m,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as w,getClipPath as v,opacityEnabledData as T,getResponsiveSetting as k}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])
|
|
1
|
+
import{makeStyleWithDefault as e,getWidthByShapeGlobalSize as t,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as n,getRadiusStyleActiveState as i,getStyleBgColor as y,getStyleShadow as a,makeStyleState as g,getGlobalColorStateStyle as u,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as d,getAspectRatioSettings as h,getOpacityHover as p,getDisplayStyleByFitContent as m,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as w,getClipPath as v,opacityEnabledData as T,getResponsiveSetting as k}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>void 0!==e||""===e))}let getStyle=(o,n,i)=>{let{sizeSetting:y,background:a}=o??{},{ratioOptions:g,aspectRatio:u}=n??{},s={...i,...S(i),...e("w",t(y,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...d(a,y,h(g,u)),...r("h",l(y))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:g,background:u,borderBg:s,cornerBg:c,shadowBg:S,hasActiveShadow:p}=e??{},{ratioOptions:m,aspectRatio:b}=t??{},f={...r("h",l(g)),...d(u,g,h(m,b)),...o({bs:s?.border??s?.border,bw:s?.width??s?.width,bc:n(s?.color)}),...i({...c,active:{...c||{},radiusType:"custom"}}),...u?{...y(u)}:{},...a({value:S,styleAppliedFor:"box-shadow",isEnableShadow:p})};return filterTruthyStyles(f)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:l}=e??{},{disableOpacity:o}=T(e),n="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,i=g("op",{normal:n,hover:p(e)}),y=u("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete y?.["--bgc"],delete i?.["--op"]),l||(delete y?.["--hvr-bgc"],delete i?.["--hvr-op"]);let a={...y,...i,"--top":"0","--left":"0"};return filterTruthyStyles(a)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...s(t)};return filterTruthyStyles(r)},getAdaptiveStyle=o=>{let{sizeSetting:n,background:i}=o??{},y={...m(n,i),...r("h",l(n)),...e("w",t(n,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(y)},getBackgroundStyle=(e,t,l)=>{let{hoverEffectScale:o,background:n,hoverEffectDuration:i}=e??{},y=`${parseFloat(`${i}`)??.5}s`,a={...b(k(n||{}),t),...c(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":y,"--scale":f(o),...r("pos",w(n)),transform:l,transition:`transform ${y} cubic-bezier(0,0,0,1)`};return filterTruthyStyles(a)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":v(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...r("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...r("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};export{getAdaptiveStyle,getBackgroundStyle,getContainBackgroundStyle,getContainerStyle,getHtml5VideoStyle,getOverlayStyle,getRowStyle,getStyle,getYoutubeIframeStyle};
|