@gem-sdk/core 1.50.0-staging.18 → 1.50.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.
|
@@ -118,7 +118,7 @@ const composeTypographyAttr = (attrs)=>{
|
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
120
|
const composeTypographyClassName = (typo, typography)=>{
|
|
121
|
-
return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
121
|
+
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
122
122
|
};
|
|
123
123
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
124
124
|
if (tag.toLocaleLowerCase().includes('heading')) {
|
|
@@ -132,7 +132,7 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
132
132
|
const customTypo = {
|
|
133
133
|
...typo.custom,
|
|
134
134
|
fallbackFontFamily: fallbackFontFamily,
|
|
135
|
-
isCustom:
|
|
135
|
+
isCustom: isCustomTypo(typo.custom)
|
|
136
136
|
};
|
|
137
137
|
return {
|
|
138
138
|
...composeTypographyV2(customTypo, typo.attrs),
|
|
@@ -143,6 +143,9 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
143
143
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
|
+
const isCustomTypo = (customTypo)=>{
|
|
147
|
+
return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
|
|
148
|
+
};
|
|
146
149
|
|
|
147
150
|
exports.composeFallbackTypographyStyle = composeFallbackTypographyStyle;
|
|
148
151
|
exports.composeFontFamilyTypographyV2 = composeFontFamilyTypographyV2;
|
|
@@ -116,7 +116,7 @@ const composeTypographyAttr = (attrs)=>{
|
|
|
116
116
|
});
|
|
117
117
|
};
|
|
118
118
|
const composeTypographyClassName = (typo, typography)=>{
|
|
119
|
-
return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
119
|
+
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
120
120
|
};
|
|
121
121
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
122
122
|
if (tag.toLocaleLowerCase().includes('heading')) {
|
|
@@ -130,7 +130,7 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
130
130
|
const customTypo = {
|
|
131
131
|
...typo.custom,
|
|
132
132
|
fallbackFontFamily: fallbackFontFamily,
|
|
133
|
-
isCustom:
|
|
133
|
+
isCustom: isCustomTypo(typo.custom)
|
|
134
134
|
};
|
|
135
135
|
return {
|
|
136
136
|
...composeTypographyV2(customTypo, typo.attrs),
|
|
@@ -141,5 +141,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
141
141
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
|
+
const isCustomTypo = (customTypo)=>{
|
|
145
|
+
return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
|
|
146
|
+
};
|
|
144
147
|
|
|
145
148
|
export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
|