@gem-sdk/core 1.14.0-dev.397 → 1.14.0-dev.400
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/helpers/background.js +1 -1
- package/dist/cjs/helpers/icon-list.js +1 -1
- package/dist/cjs/helpers/size.js +1 -1
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/icon-list.js +1 -1
- package/dist/esm/helpers/size.js +1 -1
- package/dist/types/index.d.ts +11 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var colors=require("./colors.js"),makeStyle=require("./make-style.js");const getStyleBackgroundByDevice=(e,t)=>e?{...getStyleBgColor(e),...getStyleBgImage(e,t),...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e),...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?colors.isColor(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let o={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return makeStyle.makeStyleResponsive("bgi",o)},getBgImageByDevice=(e,t,o)=>{let g=e?.[t]?.image?.backupFileKey,i=o?.liquid&&g&&`{{ "${g}" | asset_url }}`||e?.[t]?.image?.src;if("string"==typeof i)return`url(${i})`},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgp",t)},getBgPositionByDevice=(e,t)=>{let o=e?.[t]?.position;return o&&`${o.x}% ${o.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${colors.getSingleColorVariable(e)} !important;`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},o={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...o.desktop?.wrapper,...o.tablet?.wrapper,...o.mobile?.wrapper},content:{...o.desktop?.content,...o.tablet?.content,...o.mobile?.content}}},makeFixedBgAttachmentByDevice=(e,t)=>{let o=
|
|
1
|
+
"use strict";var constant=require("./constant.js"),colors=require("./colors.js"),makeStyle=require("./make-style.js");const getStyleBackgroundByDevice=(e,t)=>e?{...getStyleBgColor(e),...getStyleBgImage(e,t),...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e),...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?colors.isColor(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let o={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return makeStyle.makeStyleResponsive("bgi",o)},getBgImageByDevice=(e,t,o)=>{let g=e?.[t]?.image?.backupFileKey,i=o?.liquid&&g&&`{{ "${g}" | asset_url }}`||e?.[t]?.image?.src;if("string"==typeof i)return`url(${i})`},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgp",t)},getBgPositionByDevice=(e,t)=>{let o=e?.[t]?.position;return o&&`${o.x}% ${o.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return makeStyle.makeStyleResponsive("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${colors.getSingleColorVariable(e)} !important;`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},o={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...o.desktop?.wrapper,...o.tablet?.wrapper,...o.mobile?.wrapper},content:{...o.desktop?.content,...o.tablet?.content,...o.mobile?.content}}},makeFixedBgAttachmentByDevice=(e,t)=>{let o=constant.devicesMapping[e]??"";return"fixed"===t?{wrapper:{[`--pos${o}`]:"absolute",[`--top${o}`]:"0",[`--left${o}`]:"0",[`--w${o}`]:"100%",[`--h${o}`]:"100%"},content:{[`--pos${o}`]:"fixed",[`--w${o}`]:"100vw",[`--h${o}`]:"100vh",[`--bga${o}`]:"unset"}}:{wrapper:{[`--pos${o}`]:"absolute"},content:{[`--pos${o}`]:"absolute",[`--bga${o}`]:t}}};exports.composeBackgroundCss=composeBackgroundCss,exports.getStyleBackgroundByDevice=getStyleBackgroundByDevice,exports.makeFixedBgAttachment=makeFixedBgAttachment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constant=require("../web-components/src/helpers/styles/constant.js");const TEXT_TOTAL_SPACING=3,composePostionIconList=(e,o
|
|
1
|
+
"use strict";var constant=require("../web-components/src/helpers/styles/constant.js");const TEXT_TOTAL_SPACING=3,composePostionIconList=(e,t,o)=>{let i={};return composePositionLineHeight({compose:i,lineHeight:e,device:"desktop",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"tablet",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"mobile",position:t,iconWidth:o}),i},composePositionLineHeight=({compose:e,lineHeight:t,device:o,position:i,iconWidth:s})=>{let n=i?.[o],c=s?.[o];if(n){let i=constant.devicesMapping[o]??"";if("center"===n)e.wrapper={...e.wrapper,[`--ai${i}`]:"center"},e.content={...e.content,[`--pos${i}`]:"static"};else if(c){let o=parseFloat(t.replaceAll(/[a-zA-Z]/g,""))/2+3-c/2;e.wrapper={...e.wrapper,[`--ai${i}`]:"flex-start"},e.content={...e.content,[`--top${i}`]:`${Math.max(0,Math.ceil(o))}px`,[`--pos${i}`]:"relative"}}}};exports.composePositionLineHeight=composePositionLineHeight,exports.composePostionIconList=composePostionIconList;
|
package/dist/cjs/helpers/size.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";var makeStyle=require("./make-style.js"),constant=require("./constant.js"),getResonsiveValue=require("./get-resonsive-value.js");function getCustomSizeCSSByDevice(e,t){if(!e||!t)return{};let i=constant.devicesMapping[t]??"";return{[`--pl${i}`]:e?.[t]?.horizontal,[`--pr${i}`]:e?.[t]?.horizontal,[`--pt${i}`]:e?.[t]?.vertical,[`--pb${i}`]:e?.[t]?.vertical}}const composeSize=e=>Object.assign({},getCustomSizeCSSByDevice(e,"desktop"),getCustomSizeCSSByDevice(e,"tablet"),getCustomSizeCSSByDevice(e,"mobile"));function genSizeClass(e){return`g-s-${e}`}const composeSizeCss=e=>{if(void 0===e)return"";let t=e?.custom?.desktop?.horizontal,i=e?.custom?.desktop?.vertical;if(e?.custom)return`
|
|
2
2
|
${t?`padding-left: ${t}; padding-right: ${t};`:void 0}
|
|
3
3
|
${i?`padding-top: ${i}; padding-bottom: ${i};`:void 0}
|
|
4
|
-
`},makeGlobalSize=e=>({width:makeStyleWithDefault("w",getWidthHeightGlobalSize("width",e),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),height:makeStyle.makeStyleResponsive("h",getWidthHeightGlobalSize("height",e)),padding:getPaddingGlobalSize(e),gap:getGlobalSizeGap(e)}),getGlobalSizeGap=e=>({"--gg":e?.desktop?.gap,"--gg-tablet":e?.tablet?.gap,"--gg-mobile":e?.mobile?.gap}),makeStyleWithDefault=(e,t,i)=>({[`--${e}`]:t?.desktop==="default"?`var(${i?.desktop})`:t?.desktop,[`--${e}-tablet`]:t?.tablet==="default"?`var(${i?.tablet})`:t?.tablet,[`--${e}-mobile`]:t?.mobile==="default"?`var(${i?.mobile})`:t?.mobile}),getWidthHeightGlobalSize=(e,t)=>{if(!t)return{};let i={},a=["desktop","mobile","tablet"];return a.forEach(a=>{i={...i,[a]:getResonsiveValue.getResponsiveValueByScreen(t,a)?.[e]}}),i},getHeightByShapeGlobalSize=e=>{let t={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,i),o=a?.shapeValue,l=a?.height;t={...t,[i]:o?"auto":l||"auto"}}),t},getWidthByShapeGlobalSize=e=>{let t={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,i),o=a?.width;t={...t,[i]:o
|
|
4
|
+
`},makeGlobalSize=e=>({width:makeStyleWithDefault("w",getWidthHeightGlobalSize("width",e),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),height:makeStyle.makeStyleResponsive("h",getWidthHeightGlobalSize("height",e)),padding:getPaddingGlobalSize(e),gap:getGlobalSizeGap(e)}),getGlobalSizeGap=e=>({"--gg":e?.desktop?.gap,"--gg-tablet":e?.tablet?.gap,"--gg-mobile":e?.mobile?.gap}),makeStyleWithDefault=(e,t,i)=>({[`--${e}`]:t?.desktop==="default"?`var(${i?.desktop})`:t?.desktop,[`--${e}-tablet`]:t?.tablet==="default"?`var(${i?.tablet})`:t?.tablet,[`--${e}-mobile`]:t?.mobile==="default"?`var(${i?.mobile})`:t?.mobile}),getWidthHeightGlobalSize=(e,t)=>{if(!t)return{};let i={},a=["desktop","mobile","tablet"];return a.forEach(a=>{i={...i,[a]:getResonsiveValue.getResponsiveValueByScreen(t,a)?.[e]}}),i},getHeightByShapeGlobalSize=e=>{let t={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,i),o=a?.shapeValue,l=a?.height;t={...t,[i]:o?"auto":l||"auto"}}),t},getWidthByShapeGlobalSize=e=>{let t={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,i),o=a?.width;o&&(t={...t,[i]:o})}),t},getAspectRatioGlobalSize=e=>{let t={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,i)?.shapeValue;if(a)t={...t,[i]:a};else{let a=getResonsiveValue.getResponsiveValueByScreen(e,i)?.shape;switch(a){case"square":t={...t,[i]:"1/1"};break;case"vertical":t={...t,[i]:"3/4"};break;case"horizontal":t={...t,[i]:"4/3"};break;case"original":t={...t,[i]:"auto"}}}}),t};function getCustomPaddingSizeCSSByDevice(e,t){if(!e||!t)return{};let i=constant.devicesMapping[t]??"";return{[`--pl${i}`]:e?.[t]?.padding?.left,[`--pr${i}`]:e?.[t]?.padding?.right,[`--pt${i}`]:e?.[t]?.padding?.top,[`--pb${i}`]:e?.[t]?.padding?.bottom}}const getPaddingGlobalSize=e=>Object.assign({},getCustomPaddingSizeCSSByDevice(e,"desktop"),getCustomPaddingSizeCSSByDevice(e,"tablet"),getCustomPaddingSizeCSSByDevice(e,"mobile"));exports.composeSize=composeSize,exports.composeSizeCss=composeSizeCss,exports.genSizeClass=genSizeClass,exports.getAspectRatioGlobalSize=getAspectRatioGlobalSize,exports.getGlobalSizeGap=getGlobalSizeGap,exports.getHeightByShapeGlobalSize=getHeightByShapeGlobalSize,exports.getPaddingGlobalSize=getPaddingGlobalSize,exports.getWidthByShapeGlobalSize=getWidthByShapeGlobalSize,exports.getWidthHeightGlobalSize=getWidthHeightGlobalSize,exports.makeGlobalSize=makeGlobalSize,exports.makeStyleWithDefault=makeStyleWithDefault;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isColor as
|
|
1
|
+
import{devicesMapping as e}from"./constant.js";import{isColor as t,getSingleColorVariable as o}from"./colors.js";import{makeStyleResponsive as g}from"./make-style.js";let getStyleBackgroundByDevice=(e,t)=>e?{...getStyleBgColor(e),...getStyleBgImage(e,t),...getStyleBgPosition(e),...getStyleBgSize(e),...getStyleBgRepeat(e),...t?.ignoreBgAttachment?{}:getStyleBgAttachment(e)}:{},getStyleBgColor=e=>{let t={desktop:getBgColorByDevice(e,"desktop"),tablet:getBgColorByDevice(e,"tablet"),mobile:getBgColorByDevice(e,"mobile")};return g("bgc",t)},getBgColorByDevice=(e,t)=>getColor(e?.[t]?.color),getColor=e=>e?t(e?.toString())?e:`var(--g-c-${e})`:void 0,getStyleBgImage=(e,t)=>{let o={desktop:getBgImageByDevice(e,"desktop",t),tablet:getBgImageByDevice(e,"tablet",t),mobile:getBgImageByDevice(e,"mobile",t)};return g("bgi",o)},getBgImageByDevice=(e,t,o)=>{let g=e?.[t]?.image?.backupFileKey,i=o?.liquid&&g&&`{{ "${g}" | asset_url }}`||e?.[t]?.image?.src;if("string"==typeof i)return`url(${i})`},getStyleBgPosition=e=>{let t={desktop:getBgPositionByDevice(e,"desktop"),tablet:getBgPositionByDevice(e,"tablet"),mobile:getBgPositionByDevice(e,"mobile")};return g("bgp",t)},getBgPositionByDevice=(e,t)=>{let o=e?.[t]?.position;return o&&`${o.x}% ${o.y}%`},getStyleBgSize=e=>{let t={desktop:getBgSizeByDevice(e,"desktop"),tablet:getBgSizeByDevice(e,"tablet"),mobile:getBgSizeByDevice(e,"mobile")};return g("bgs",t)},getBgSizeByDevice=(e,t)=>e?.[t]?.size,getStyleBgRepeat=e=>{let t={desktop:getBgRepeatByDevice(e,"desktop"),tablet:getBgRepeatByDevice(e,"tablet"),mobile:getBgRepeatByDevice(e,"mobile")};return g("bgr",t)},getBgRepeatByDevice=(e,t)=>e?.[t]?.repeat,getStyleBgAttachment=e=>{let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")};return g("bga",t)},getBgAttachmentByDevice=(e,t)=>e?.[t]?.attachment,composeBackgroundCss=e=>`${e?`background-color: ${o(e)} !important;`:void 0}`,makeFixedBgAttachment=e=>{if(!e)return;e.tablet=e.tablet?e.tablet:e.desktop,e.mobile=e.mobile?e.mobile:e.tablet;let t={desktop:getBgAttachmentByDevice(e,"desktop"),tablet:getBgAttachmentByDevice(e,"tablet"),mobile:getBgAttachmentByDevice(e,"mobile")},o={desktop:{...makeFixedBgAttachmentByDevice("desktop",t.desktop)},tablet:{...makeFixedBgAttachmentByDevice("tablet",t.tablet)},mobile:{...makeFixedBgAttachmentByDevice("mobile",t.mobile)}};return{wrapper:{...o.desktop?.wrapper,...o.tablet?.wrapper,...o.mobile?.wrapper},content:{...o.desktop?.content,...o.tablet?.content,...o.mobile?.content}}},makeFixedBgAttachmentByDevice=(t,o)=>{let g=e[t]??"";return"fixed"===o?{wrapper:{[`--pos${g}`]:"absolute",[`--top${g}`]:"0",[`--left${g}`]:"0",[`--w${g}`]:"100%",[`--h${g}`]:"100%"},content:{[`--pos${g}`]:"fixed",[`--w${g}`]:"100vw",[`--h${g}`]:"100vh",[`--bga${g}`]:"unset"}}:{wrapper:{[`--pos${g}`]:"absolute"},content:{[`--pos${g}`]:"absolute",[`--bga${g}`]:o}}};export{composeBackgroundCss,getStyleBackgroundByDevice,makeFixedBgAttachment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{devicesMapping as e}from"../web-components/src/helpers/styles/constant.js";let TEXT_TOTAL_SPACING=3,composePostionIconList=(e,t,o)=>{let i={};return composePositionLineHeight({compose:i,lineHeight:e,device:"desktop",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"tablet",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"mobile",position:t,iconWidth:o}),i},composePositionLineHeight=({compose:t,lineHeight:o,device:i,position:
|
|
1
|
+
import{devicesMapping as e}from"../web-components/src/helpers/styles/constant.js";let TEXT_TOTAL_SPACING=3,composePostionIconList=(e,t,o)=>{let i={};return composePositionLineHeight({compose:i,lineHeight:e,device:"desktop",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"tablet",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"mobile",position:t,iconWidth:o}),i},composePositionLineHeight=({compose:t,lineHeight:o,device:i,position:s,iconWidth:n})=>{let p=s?.[i],c=n?.[i];if(p){let s=e[i]??"";if("center"===p)t.wrapper={...t.wrapper,[`--ai${s}`]:"center"},t.content={...t.content,[`--pos${s}`]:"static"};else if(c){let e=parseFloat(o.replaceAll(/[a-zA-Z]/g,""))/2+3-c/2;t.wrapper={...t.wrapper,[`--ai${s}`]:"flex-start"},t.content={...t.content,[`--top${s}`]:`${Math.max(0,Math.ceil(e))}px`,[`--pos${s}`]:"relative"}}}};export{composePositionLineHeight,composePostionIconList};
|
package/dist/esm/helpers/size.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{makeStyleResponsive as e}from"./make-style.js";import{devicesMapping as t}from"./constant.js";import{getResponsiveValueByScreen as i}from"./get-resonsive-value.js";function getCustomSizeCSSByDevice(e,i){if(!e||!i)return{};let a=t[i]??"";return{[`--pl${a}`]:e?.[i]?.horizontal,[`--pr${a}`]:e?.[i]?.horizontal,[`--pt${a}`]:e?.[i]?.vertical,[`--pb${a}`]:e?.[i]?.vertical}}let composeSize=e=>Object.assign({},getCustomSizeCSSByDevice(e,"desktop"),getCustomSizeCSSByDevice(e,"tablet"),getCustomSizeCSSByDevice(e,"mobile"));function genSizeClass(e){return`g-s-${e}`}let composeSizeCss=e=>{if(void 0===e)return"";let t=e?.custom?.desktop?.horizontal,i=e?.custom?.desktop?.vertical;if(e?.custom)return`
|
|
2
2
|
${t?`padding-left: ${t}; padding-right: ${t};`:void 0}
|
|
3
3
|
${i?`padding-top: ${i}; padding-bottom: ${i};`:void 0}
|
|
4
|
-
`},makeGlobalSize=t=>({width:makeStyleWithDefault("w",getWidthHeightGlobalSize("width",t),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),height:e("h",getWidthHeightGlobalSize("height",t)),padding:getPaddingGlobalSize(t),gap:getGlobalSizeGap(t)}),getGlobalSizeGap=e=>({"--gg":e?.desktop?.gap,"--gg-tablet":e?.tablet?.gap,"--gg-mobile":e?.mobile?.gap}),makeStyleWithDefault=(e,t,i)=>({[`--${e}`]:t?.desktop==="default"?`var(${i?.desktop})`:t?.desktop,[`--${e}-tablet`]:t?.tablet==="default"?`var(${i?.tablet})`:t?.tablet,[`--${e}-mobile`]:t?.mobile==="default"?`var(${i?.mobile})`:t?.mobile}),getWidthHeightGlobalSize=(e,t)=>{if(!t)return{};let a={},l=["desktop","mobile","tablet"];return l.forEach(l=>{a={...a,[l]:i(t,l)?.[e]}}),a},getHeightByShapeGlobalSize=e=>{let t={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let l=i(e,a),o=l?.shapeValue,g=l?.height;t={...t,[a]:o?"auto":g||"auto"}}),t},getWidthByShapeGlobalSize=e=>{let t={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let l=i(e,a),o=l?.width;t={...t,[a]:o
|
|
4
|
+
`},makeGlobalSize=t=>({width:makeStyleWithDefault("w",getWidthHeightGlobalSize("width",t),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),height:e("h",getWidthHeightGlobalSize("height",t)),padding:getPaddingGlobalSize(t),gap:getGlobalSizeGap(t)}),getGlobalSizeGap=e=>({"--gg":e?.desktop?.gap,"--gg-tablet":e?.tablet?.gap,"--gg-mobile":e?.mobile?.gap}),makeStyleWithDefault=(e,t,i)=>({[`--${e}`]:t?.desktop==="default"?`var(${i?.desktop})`:t?.desktop,[`--${e}-tablet`]:t?.tablet==="default"?`var(${i?.tablet})`:t?.tablet,[`--${e}-mobile`]:t?.mobile==="default"?`var(${i?.mobile})`:t?.mobile}),getWidthHeightGlobalSize=(e,t)=>{if(!t)return{};let a={},l=["desktop","mobile","tablet"];return l.forEach(l=>{a={...a,[l]:i(t,l)?.[e]}}),a},getHeightByShapeGlobalSize=e=>{let t={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let l=i(e,a),o=l?.shapeValue,g=l?.height;t={...t,[a]:o?"auto":g||"auto"}}),t},getWidthByShapeGlobalSize=e=>{let t={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let l=i(e,a),o=l?.width;o&&(t={...t,[a]:o})}),t},getAspectRatioGlobalSize=e=>{let t={},a=["desktop","mobile","tablet"];return a.forEach(a=>{let l=i(e,a)?.shapeValue;if(l)t={...t,[a]:l};else{let l=i(e,a)?.shape;switch(l){case"square":t={...t,[a]:"1/1"};break;case"vertical":t={...t,[a]:"3/4"};break;case"horizontal":t={...t,[a]:"4/3"};break;case"original":t={...t,[a]:"auto"}}}}),t};function getCustomPaddingSizeCSSByDevice(e,i){if(!e||!i)return{};let a=t[i]??"";return{[`--pl${a}`]:e?.[i]?.padding?.left,[`--pr${a}`]:e?.[i]?.padding?.right,[`--pt${a}`]:e?.[i]?.padding?.top,[`--pb${a}`]:e?.[i]?.padding?.bottom}}let getPaddingGlobalSize=e=>Object.assign({},getCustomPaddingSizeCSSByDevice(e,"desktop"),getCustomPaddingSizeCSSByDevice(e,"tablet"),getCustomPaddingSizeCSSByDevice(e,"mobile"));export{composeSize,composeSizeCss,genSizeClass,getAspectRatioGlobalSize,getGlobalSizeGap,getHeightByShapeGlobalSize,getPaddingGlobalSize,getWidthByShapeGlobalSize,getWidthHeightGlobalSize,makeGlobalSize,makeStyleWithDefault};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -960,7 +960,17 @@ type DropdownInput<T> = SharedControlType<T> & {
|
|
|
960
960
|
}[];
|
|
961
961
|
};
|
|
962
962
|
|
|
963
|
-
type
|
|
963
|
+
type Dropdown<T> = SharedControlType<T> & {
|
|
964
|
+
type: 'dropdown';
|
|
965
|
+
inputType?: 'text';
|
|
966
|
+
displayOptions?: {
|
|
967
|
+
label: string;
|
|
968
|
+
value: string;
|
|
969
|
+
icon?: string;
|
|
970
|
+
}[];
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | ProductListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T>;
|
|
964
974
|
type Setting<P extends BaseProps> = {
|
|
965
975
|
id: 'setting';
|
|
966
976
|
note?: string;
|