@gem-sdk/core 1.14.0-next.84 → 1.14.0-next.91

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.
@@ -2,6 +2,7 @@
2
2
  fragment MediaSelect on Media {
3
3
  id
4
4
  contentType
5
+ previewImage
5
6
  src
6
7
  width
7
8
  height
@@ -1 +1 @@
1
- "use strict";var borders=require("./borders.js"),colors=require("./colors.js"),constant=require("./constant.js"),makeStyle=require("./make-style.js"),radius=require("./radius.js"),shadow=require("./shadow.js");const composeSpacing=({source:e,spacing:o,type:s,suffix:a=""})=>{let{top:r,left:t,bottom:d,right:l}=o;r&&(e[`--${s}t${a}`]=r),t&&(e[`--${s}l${a}`]=t),d&&(e[`--${s}b${a}`]=d),l&&(e[`--${s}r${a}`]=l)},getAttrValue=(e,o,s)=>{if(null!=o)switch(e){case"bgc":case"c":return colors.isColor(o.toString())?o:`var(--g-c-${o})`;case"d":if(!o)return"none";if(o&&s&&constant.layoutComponent.includes(s))return"grid";return"block";default:return o}};function composeAdvanceStyle(e,o){if(!e)return{};let s={},a=["desktop","tablet","mobile"],r=["hover","normal"];return Object.keys(e).forEach(t=>{let d=e[t];if(null==d)return;let l=e.hasBoxShadow?e.hasBoxShadow:{};if("object"==typeof d){if(Array.isArray(d))return;Object.keys(d).forEach(i=>{if(a.includes(i)){let e=d[i];if(void 0!==e){if("border"===t&&Object.assign(s,borders.handleConvertBorderStyle(d),borders.handleConvertBorderWidth(d),borders.handleConvertBorderColor(d)),"rounded"===t&&Object.assign(s,radius.composeRadius(d)),"desktop"===i)switch(t){case"padding":composeSpacing({source:s,spacing:e,type:"p"});break;case"margin":composeSpacing({source:s,spacing:e,type:"m"});break;case"m":case"p":break;default:s[`--${t}`]=getAttrValue(t,e,o)}else switch(t){case"padding":composeSpacing({source:s,spacing:e,type:"p",suffix:`-${i}`});break;case"margin":composeSpacing({source:s,spacing:e,type:"m",suffix:`-${i}`});break;case"m":case"p":break;default:s[`--${t}-${i}`]=getAttrValue(t,e,o)}}}else if(r.includes(i))switch(t){case"hasBoxShadow":break;case"boxShadow":Object.assign(s,shadow.getStyleShadowState(d,"box-shadow",l))}else{if("border"===t){let e=d;"none"===e.border&&(e.border="solid",e.color="#121212",e.isCustom=!0,e.width="0px",e.position="all"),Object.assign(s,borders.getBorderStyle(e))}"rounded"===t&&Object.assign(s,radius.getCornerCSSFromGlobal(d)),"hasBoxShadow"===t&&Object.assign(s,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow})),"boxShadow"===t&&Object.assign(s,shadow.getStyleShadow({value:d,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))}})}else s[`--${t}`]=getAttrValue(t,d,o),"hasBoxShadow"===t&&e.boxShadow&&Object.assign(s,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))}),s}const splitStyle=(e,o={})=>{let s=e.map(e=>makeStyle.makeStyleKey(e)).flat(),a=Object.keys(o).filter(e=>s.includes(e)),r=a.reduce((e,s)=>({...e,[s]:o[s]}),{}),t=Object.keys(o).filter(e=>!a.includes(e)).reduce((e,s)=>({...e,[s]:o[s]}),{});return[r,t]};exports.composeAdvanceStyle=composeAdvanceStyle,exports.splitStyle=splitStyle;
1
+ "use strict";var borders=require("./borders.js"),colors=require("./colors.js"),constant=require("./constant.js"),makeStyle=require("./make-style.js"),radius=require("./radius.js"),shadow=require("./shadow.js");const composeSpacing=({source:e,spacing:o,type:s,suffix:a=""})=>{let{top:r,left:t,bottom:d,right:l}=o;r&&(e[`--${s}t${a}`]=r),t&&(e[`--${s}l${a}`]=t),d&&(e[`--${s}b${a}`]=d),l&&(e[`--${s}r${a}`]=l)},getAttrValue=(e,o,s)=>{if(null!=o)switch(e){case"bgc":case"c":return colors.isColor(o.toString())?o:`var(--g-c-${o})`;case"d":if(!o)return"none";if(o&&s&&constant.layoutComponent.includes(s))return"grid";return"block";default:return o}};function composeAdvanceStyle(e,o){if(!e)return{};let s={},a=["desktop","tablet","mobile"],r=["hover","normal"];return Object.keys(e).forEach(t=>{let d=e[t];if(null==d)return;let l=e.hasBoxShadow?e.hasBoxShadow:{};if("object"==typeof d){if(Array.isArray(d))return;Object.keys(d).forEach(c=>{if(a.includes(c)){let e=d[c];if(void 0!==e){if("border"===t&&Object.assign(s,borders.handleConvertBorderStyle(d),borders.handleConvertBorderWidth(d),borders.handleConvertBorderColor(d)),"rounded"===t&&Object.assign(s,radius.composeRadius(d)),"desktop"===c)switch(t){case"padding":composeSpacing({source:s,spacing:e,type:"p"});break;case"margin":composeSpacing({source:s,spacing:e,type:"m"});break;case"m":case"p":break;default:s[`--${t}`]=getAttrValue(t,e,o)}else switch(t){case"padding":composeSpacing({source:s,spacing:e,type:"p",suffix:`-${c}`});break;case"margin":composeSpacing({source:s,spacing:e,type:"m",suffix:`-${c}`});break;case"m":case"p":break;default:s[`--${t}-${c}`]=getAttrValue(t,e,o)}}}else if(r.includes(c))switch(t){case"hasBoxShadow":break;case"boxShadow":Object.assign(s,shadow.getStyleShadowState(d,"box-shadow",l))}else"border"===t&&("none"===d.border&&(d.border="solid",d.color="#121212",d.isCustom=!0,d.width="0px",d.position="all"),Object.assign(s,borders.getBorderStyle(d))),"rounded"===t&&Object.assign(s,radius.getCornerCSSFromGlobal(d)),"hasBoxShadow"===t&&Object.assign(s,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow})),"boxShadow"===t&&Object.assign(s,shadow.getStyleShadow({value:d,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))})}else s[`--${t}`]=getAttrValue(t,d,o),"hasBoxShadow"===t&&e.boxShadow&&Object.assign(s,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))}),s}const splitStyle=(e,o={})=>{let s=e.map(e=>makeStyle.makeStyleKey(e)).flat(),a=Object.keys(o).filter(e=>s.includes(e)),r=a.reduce((e,s)=>({...e,[s]:o[s]}),{}),t=Object.keys(o).filter(e=>!a.includes(e)).reduce((e,s)=>({...e,[s]:o[s]}),{});return[r,t]};exports.composeAdvanceStyle=composeAdvanceStyle,exports.splitStyle=splitStyle;
@@ -2,6 +2,7 @@ let MediaSelect=`
2
2
  fragment MediaSelect on Media {
3
3
  id
4
4
  contentType
5
+ previewImage
5
6
  src
6
7
  width
7
8
  height
@@ -1 +1 @@
1
- import{handleConvertBorderStyle as e,handleConvertBorderWidth as o,handleConvertBorderColor as s,getBorderStyle as a}from"./borders.js";import{isColor as t}from"./colors.js";import{layoutComponent as r}from"./constant.js";import{makeStyleKey as i}from"./make-style.js";import{composeRadius as c,getCornerCSSFromGlobal as l}from"./radius.js";import{getStyleShadowState as d,getStyleShadow as n}from"./shadow.js";let composeSpacing=({source:e,spacing:o,type:s,suffix:a=""})=>{let{top:t,left:r,bottom:i,right:c}=o;t&&(e[`--${s}t${a}`]=t),r&&(e[`--${s}l${a}`]=r),i&&(e[`--${s}b${a}`]=i),c&&(e[`--${s}r${a}`]=c)},getAttrValue=(e,o,s)=>{if(null!=o)switch(e){case"bgc":case"c":return t(o.toString())?o:`var(--g-c-${o})`;case"d":if(!o)return"none";if(o&&s&&r.includes(s))return"grid";return"block";default:return o}};function composeAdvanceStyle(t,r){if(!t)return{};let i={},p=["desktop","tablet","mobile"],b=["hover","normal"];return Object.keys(t).forEach(u=>{let h=t[u];if(null==h)return;let f=t.hasBoxShadow?t.hasBoxShadow:{};if("object"==typeof h){if(Array.isArray(h))return;Object.keys(h).forEach(m=>{if(p.includes(m)){let a=h[m];if(void 0!==a){if("border"===u&&Object.assign(i,e(h),o(h),s(h)),"rounded"===u&&Object.assign(i,c(h)),"desktop"===m)switch(u){case"padding":composeSpacing({source:i,spacing:a,type:"p"});break;case"margin":composeSpacing({source:i,spacing:a,type:"m"});break;case"m":case"p":break;default:i[`--${u}`]=getAttrValue(u,a,r)}else switch(u){case"padding":composeSpacing({source:i,spacing:a,type:"p",suffix:`-${m}`});break;case"margin":composeSpacing({source:i,spacing:a,type:"m",suffix:`-${m}`});break;case"m":case"p":break;default:i[`--${u}-${m}`]=getAttrValue(u,a,r)}}}else if(b.includes(m))switch(u){case"hasBoxShadow":break;case"boxShadow":Object.assign(i,d(h,"box-shadow",f))}else{if("border"===u){let e=h;"none"===e.border&&(e.border="solid",e.color="#121212",e.isCustom=!0,e.width="0px",e.position="all"),Object.assign(i,a(e))}"rounded"===u&&Object.assign(i,l(h)),"hasBoxShadow"===u&&Object.assign(i,n({value:t.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow})),"boxShadow"===u&&Object.assign(i,n({value:h,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow}))}})}else i[`--${u}`]=getAttrValue(u,h,r),"hasBoxShadow"===u&&t.boxShadow&&Object.assign(i,n({value:t.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow}))}),i}let splitStyle=(e,o={})=>{let s=e.map(e=>i(e)).flat(),a=Object.keys(o).filter(e=>s.includes(e)),t=a.reduce((e,s)=>({...e,[s]:o[s]}),{}),r=Object.keys(o).filter(e=>!a.includes(e)).reduce((e,s)=>({...e,[s]:o[s]}),{});return[t,r]};export{composeAdvanceStyle,splitStyle};
1
+ import{handleConvertBorderStyle as e,handleConvertBorderWidth as o,handleConvertBorderColor as s,getBorderStyle as a}from"./borders.js";import{isColor as t}from"./colors.js";import{layoutComponent as r}from"./constant.js";import{makeStyleKey as i}from"./make-style.js";import{composeRadius as c,getCornerCSSFromGlobal as l}from"./radius.js";import{getStyleShadowState as d,getStyleShadow as n}from"./shadow.js";let composeSpacing=({source:e,spacing:o,type:s,suffix:a=""})=>{let{top:t,left:r,bottom:i,right:c}=o;t&&(e[`--${s}t${a}`]=t),r&&(e[`--${s}l${a}`]=r),i&&(e[`--${s}b${a}`]=i),c&&(e[`--${s}r${a}`]=c)},getAttrValue=(e,o,s)=>{if(null!=o)switch(e){case"bgc":case"c":return t(o.toString())?o:`var(--g-c-${o})`;case"d":if(!o)return"none";if(o&&s&&r.includes(s))return"grid";return"block";default:return o}};function composeAdvanceStyle(t,r){if(!t)return{};let i={},p=["desktop","tablet","mobile"],b=["hover","normal"];return Object.keys(t).forEach(u=>{let h=t[u];if(null==h)return;let f=t.hasBoxShadow?t.hasBoxShadow:{};if("object"==typeof h){if(Array.isArray(h))return;Object.keys(h).forEach(m=>{if(p.includes(m)){let a=h[m];if(void 0!==a){if("border"===u&&Object.assign(i,e(h),o(h),s(h)),"rounded"===u&&Object.assign(i,c(h)),"desktop"===m)switch(u){case"padding":composeSpacing({source:i,spacing:a,type:"p"});break;case"margin":composeSpacing({source:i,spacing:a,type:"m"});break;case"m":case"p":break;default:i[`--${u}`]=getAttrValue(u,a,r)}else switch(u){case"padding":composeSpacing({source:i,spacing:a,type:"p",suffix:`-${m}`});break;case"margin":composeSpacing({source:i,spacing:a,type:"m",suffix:`-${m}`});break;case"m":case"p":break;default:i[`--${u}-${m}`]=getAttrValue(u,a,r)}}}else if(b.includes(m))switch(u){case"hasBoxShadow":break;case"boxShadow":Object.assign(i,d(h,"box-shadow",f))}else"border"===u&&("none"===h.border&&(h.border="solid",h.color="#121212",h.isCustom=!0,h.width="0px",h.position="all"),Object.assign(i,a(h))),"rounded"===u&&Object.assign(i,l(h)),"hasBoxShadow"===u&&Object.assign(i,n({value:t.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow})),"boxShadow"===u&&Object.assign(i,n({value:h,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow}))})}else i[`--${u}`]=getAttrValue(u,h,r),"hasBoxShadow"===u&&t.boxShadow&&Object.assign(i,n({value:t.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:t.hasBoxShadow}))}),i}let splitStyle=(e,o={})=>{let s=e.map(e=>i(e)).flat(),a=Object.keys(o).filter(e=>s.includes(e)),t=a.reduce((e,s)=>({...e,[s]:o[s]}),{}),r=Object.keys(o).filter(e=>!a.includes(e)).reduce((e,s)=>({...e,[s]:o[s]}),{});return[t,r]};export{composeAdvanceStyle,splitStyle};