@gem-sdk/core 1.48.0-dev.6 → 1.48.0-dev.60
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/components/InteractionSuffix.js +1 -1
- package/dist/cjs/components/Render.liquid.js +2 -2
- package/dist/cjs/graphql/fragments/product-little.generated.js +1 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/cjs/helpers/background.js +1 -1
- package/dist/cjs/helpers/compose-advance-style.js +6 -3
- package/dist/cjs/helpers/shadow.js +15 -3
- package/dist/cjs/helpers/third-party/appConfig.js +35 -0
- package/dist/cjs/helpers/third-party/appSetting.js +47 -0
- package/dist/cjs/helpers/third-party/constant.js +6 -1
- package/dist/cjs/helpers/typography.js +9 -14
- package/dist/cjs/index.js +1 -0
- package/dist/esm/components/InteractionSuffix.js +2 -2
- package/dist/esm/components/Render.liquid.js +2 -2
- package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/compose-advance-style.js +7 -4
- package/dist/esm/helpers/shadow.js +15 -4
- package/dist/esm/helpers/third-party/appConfig.js +31 -1
- package/dist/esm/helpers/third-party/appSetting.js +47 -0
- package/dist/esm/helpers/third-party/constant.js +7 -2
- package/dist/esm/helpers/typography.js +9 -14
- package/dist/esm/index.js +1 -1
- package/dist/types/index.d.ts +1752 -7
- package/package.json +2 -2
|
@@ -74,8 +74,10 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
const composeFontFamilyTypographyV2 = (value)=>{
|
|
77
|
-
const fontFamily = value
|
|
78
|
-
if (!fontFamily)
|
|
77
|
+
const { fontFamily, isCustom, fallbackFontFamily } = value || {};
|
|
78
|
+
if (!fontFamily) {
|
|
79
|
+
return isCustom ? fallbackFontFamily : undefined;
|
|
80
|
+
}
|
|
79
81
|
if (typeof fontFamily === 'string') {
|
|
80
82
|
return getFontUsedByTypographyV2({
|
|
81
83
|
fontFamily,
|
|
@@ -117,15 +119,7 @@ const composeTypographyClassName = (typo, typography)=>{
|
|
|
117
119
|
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
118
120
|
};
|
|
119
121
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
120
|
-
if (
|
|
121
|
-
'heading',
|
|
122
|
-
'heading-1',
|
|
123
|
-
'heading-2',
|
|
124
|
-
'heading-3',
|
|
125
|
-
'heading-4',
|
|
126
|
-
'heading-5',
|
|
127
|
-
'heading-6'
|
|
128
|
-
].includes(tag)) {
|
|
122
|
+
if (tag.toLocaleLowerCase().includes('heading')) {
|
|
129
123
|
return 'var(--g-font-heading, heading)';
|
|
130
124
|
}
|
|
131
125
|
return 'var(--g-font-body, body)';
|
|
@@ -135,7 +129,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
135
129
|
const fallbackFontFamily = composeFallbackTypographyStyle(typo.type ?? 'heading');
|
|
136
130
|
const customTypo = {
|
|
137
131
|
...typo.custom,
|
|
138
|
-
fallbackFontFamily: fallbackFontFamily
|
|
132
|
+
fallbackFontFamily: fallbackFontFamily,
|
|
133
|
+
isCustom: isCustomTypo(typo.custom)
|
|
139
134
|
};
|
|
140
135
|
return {
|
|
141
136
|
...composeTypographyV2(customTypo, typo.attrs),
|
|
@@ -146,8 +141,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
146
141
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
147
142
|
};
|
|
148
143
|
};
|
|
149
|
-
const isCustomTypo = (
|
|
150
|
-
return
|
|
144
|
+
const isCustomTypo = (customTypo)=>{
|
|
145
|
+
return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
|
|
151
146
|
};
|
|
152
147
|
|
|
153
148
|
export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
|
package/dist/esm/index.js
CHANGED
|
@@ -66,7 +66,7 @@ export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption }
|
|
|
66
66
|
export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
|
|
67
67
|
export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
|
|
68
68
|
export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
|
|
69
|
-
export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
|
|
69
|
+
export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
|
|
70
70
|
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
|
|
71
71
|
export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
|
|
72
72
|
export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
|