@gem-sdk/core 1.49.1-staging.12 → 1.50.0

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.
@@ -76,8 +76,10 @@ const composeTypographyV2 = (value, attrs)=>{
76
76
  });
77
77
  };
78
78
  const composeFontFamilyTypographyV2 = (value)=>{
79
- const fontFamily = value?.fontFamily;
80
- if (!fontFamily) return;
79
+ const { fontFamily, isCustom, fallbackFontFamily } = value || {};
80
+ if (!fontFamily) {
81
+ return isCustom ? fallbackFontFamily : undefined;
82
+ }
81
83
  if (typeof fontFamily === 'string') {
82
84
  return getFontUsedByTypographyV2({
83
85
  fontFamily,
@@ -119,15 +121,7 @@ const composeTypographyClassName = (typo, typography)=>{
119
121
  return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
120
122
  };
121
123
  const composeFallbackTypographyStyle = (tag)=>{
122
- if ([
123
- 'heading',
124
- 'heading-1',
125
- 'heading-2',
126
- 'heading-3',
127
- 'heading-4',
128
- 'heading-5',
129
- 'heading-6'
130
- ].includes(tag)) {
124
+ if (tag.toLocaleLowerCase().includes('heading')) {
131
125
  return 'var(--g-font-heading, heading)';
132
126
  }
133
127
  return 'var(--g-font-body, body)';
@@ -137,7 +131,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
137
131
  const fallbackFontFamily = composeFallbackTypographyStyle(typo.type ?? 'heading');
138
132
  const customTypo = {
139
133
  ...typo.custom,
140
- fallbackFontFamily: fallbackFontFamily
134
+ fallbackFontFamily: fallbackFontFamily,
135
+ isCustom: !!typo.custom
141
136
  };
142
137
  return {
143
138
  ...composeTypographyV2(customTypo, typo.attrs),
@@ -74,8 +74,10 @@ const composeTypographyV2 = (value, attrs)=>{
74
74
  });
75
75
  };
76
76
  const composeFontFamilyTypographyV2 = (value)=>{
77
- const fontFamily = value?.fontFamily;
78
- if (!fontFamily) return;
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 && !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: !!typo.custom
139
134
  };
140
135
  return {
141
136
  ...composeTypographyV2(customTypo, typo.attrs),
@@ -6908,7 +6908,7 @@ type StampedWidgetType = 'main-widget' | 'carousel' | 'full-page' | 'visual-gall
6908
6908
  type LaiProductReviewsWidgetType = 'reviews_widget' | 'star_ratings' | 'homepage_reviews' | 'happy_customer_reviews' | 'star_ratings_in_list' | 'advanced_widget';
6909
6909
  type LaiProductReviewsAdvancedWidgetType = 'cardCarousel' | 'testimonialCarousel' | 'mediaGallery' | 'cardGrid';
6910
6910
  type YotpoReviewsWidgetType = 'reviews' | 'badge' | 'reviewHighlights';
6911
- type BogosWidgetType = 'icon' | 'thumnail' | 'slider' | 'message';
6911
+ type BogosWidgetType = 'icon' | 'thumnail' | 'slider' | 'message' | 'classic-bundle' | 'quantity-break';
6912
6912
 
6913
6913
  type ResponsiveConfig<T> = {
6914
6914
  desktop: {
@@ -28304,6 +28304,7 @@ type TypographyProps = {
28304
28304
  fallbackFontFamily?: string;
28305
28305
  textShadow?: ShadowProps;
28306
28306
  hasShadowText?: boolean;
28307
+ isCustom?: boolean;
28307
28308
  };
28308
28309
  type TypographyV2Props = Omit<TypographyProps, 'fontSize' | 'lineHeight'> & {
28309
28310
  fontSize?: ObjectDevices<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.49.1-staging.12",
3
+ "version": "1.50.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -27,8 +27,8 @@
27
27
  "type-check": "yarn tsc --noEmit"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/adapter-shopify": "1.47.0",
31
- "@gem-sdk/styles": "1.49.0-staging.9",
30
+ "@gem-sdk/adapter-shopify": "1.50.0",
31
+ "@gem-sdk/styles": "1.50.0",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {