@gem-sdk/core 1.49.0 → 1.50.0-staging.14

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.
@@ -71,16 +71,7 @@ const postPurchaseWrapElements = [
71
71
  'PostPurchaseProductOffer'
72
72
  ];
73
73
  const ableGenerateContentElements = [
74
- 'Section',
75
- 'Row',
76
- 'Text',
77
- 'Heading',
78
- 'Accordion',
79
- 'Product',
80
- 'HeroBanner',
81
- 'IconList',
82
- 'IconListV2',
83
- 'AdvancedList'
74
+ 'Section'
84
75
  ];
85
76
 
86
77
  exports.ableGenerateContentElements = ableGenerateContentElements;
@@ -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),
@@ -69,16 +69,7 @@ const postPurchaseWrapElements = [
69
69
  'PostPurchaseProductOffer'
70
70
  ];
71
71
  const ableGenerateContentElements = [
72
- 'Section',
73
- 'Row',
74
- 'Text',
75
- 'Heading',
76
- 'Accordion',
77
- 'Product',
78
- 'HeroBanner',
79
- 'IconList',
80
- 'IconListV2',
81
- 'AdvancedList'
72
+ 'Section'
82
73
  ];
83
74
 
84
75
  export { ableGenerateContentElements, customRenderChildren, disableWrap, excludeApplyStyle, postPurchaseRequiredElements, postPurchaseWrapElements };
@@ -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>;
@@ -29766,6 +29767,15 @@ declare const filterAttrInStyle: (style?: React.CSSProperties, filterKeys?: stri
29766
29767
  '--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
29767
29768
  '--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
29768
29769
  '--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
29770
+ '--gr'?: csstype.Property.GridRow | undefined;
29771
+ '--hvr-gr'?: csstype.Property.GridRow | undefined;
29772
+ '--focus-gr'?: csstype.Property.GridRow | undefined;
29773
+ '--gr-tablet'?: csstype.Property.GridRow | undefined;
29774
+ '--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
29775
+ '--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
29776
+ '--gr-mobile'?: csstype.Property.GridRow | undefined;
29777
+ '--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
29778
+ '--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
29769
29779
  '--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
29770
29780
  '--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
29771
29781
  '--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
@@ -31261,6 +31271,15 @@ declare const removeAttrInStyle: (style?: React.CSSProperties, filterKeys?: stri
31261
31271
  '--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
31262
31272
  '--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
31263
31273
  '--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
31274
+ '--gr'?: csstype.Property.GridRow | undefined;
31275
+ '--hvr-gr'?: csstype.Property.GridRow | undefined;
31276
+ '--focus-gr'?: csstype.Property.GridRow | undefined;
31277
+ '--gr-tablet'?: csstype.Property.GridRow | undefined;
31278
+ '--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
31279
+ '--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
31280
+ '--gr-mobile'?: csstype.Property.GridRow | undefined;
31281
+ '--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
31282
+ '--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
31264
31283
  '--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
31265
31284
  '--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
31266
31285
  '--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
@@ -32756,6 +32775,15 @@ declare const filterCornerInStyle: (style?: React.CSSProperties) => {
32756
32775
  '--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
32757
32776
  '--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
32758
32777
  '--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
32778
+ '--gr'?: csstype.Property.GridRow | undefined;
32779
+ '--hvr-gr'?: csstype.Property.GridRow | undefined;
32780
+ '--focus-gr'?: csstype.Property.GridRow | undefined;
32781
+ '--gr-tablet'?: csstype.Property.GridRow | undefined;
32782
+ '--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
32783
+ '--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
32784
+ '--gr-mobile'?: csstype.Property.GridRow | undefined;
32785
+ '--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
32786
+ '--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
32759
32787
  '--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
32760
32788
  '--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
32761
32789
  '--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
@@ -34251,6 +34279,15 @@ declare const removePaddingYInStyle: (style?: React.CSSProperties) => {
34251
34279
  '--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
34252
34280
  '--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
34253
34281
  '--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
34282
+ '--gr'?: csstype.Property.GridRow | undefined;
34283
+ '--hvr-gr'?: csstype.Property.GridRow | undefined;
34284
+ '--focus-gr'?: csstype.Property.GridRow | undefined;
34285
+ '--gr-tablet'?: csstype.Property.GridRow | undefined;
34286
+ '--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
34287
+ '--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
34288
+ '--gr-mobile'?: csstype.Property.GridRow | undefined;
34289
+ '--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
34290
+ '--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
34254
34291
  '--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
34255
34292
  '--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
34256
34293
  '--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
@@ -35884,6 +35921,15 @@ declare const composeTypographyStyle: (typo?: TypographySettingV2, typography?:
35884
35921
  '--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
35885
35922
  '--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
35886
35923
  '--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
35924
+ '--gr'?: csstype.Property.GridRow | undefined;
35925
+ '--hvr-gr'?: csstype.Property.GridRow | undefined;
35926
+ '--focus-gr'?: csstype.Property.GridRow | undefined;
35927
+ '--gr-tablet'?: csstype.Property.GridRow | undefined;
35928
+ '--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
35929
+ '--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
35930
+ '--gr-mobile'?: csstype.Property.GridRow | undefined;
35931
+ '--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
35932
+ '--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
35887
35933
  '--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
35888
35934
  '--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
35889
35935
  '--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.49.0",
3
+ "version": "1.50.0-staging.14",
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.49.0",
31
- "@gem-sdk/styles": "1.49.0",
30
+ "@gem-sdk/adapter-shopify": "1.47.0",
31
+ "@gem-sdk/styles": "1.49.0-staging.9",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {