@gem-sdk/core 1.48.0-dev.8 → 1.48.0-dev.83

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.
Files changed (36) hide show
  1. package/dist/cjs/components/InteractionSuffix.js +1 -1
  2. package/dist/cjs/components/Render.liquid.js +10 -4
  3. package/dist/cjs/graphql/fragments/product-little.generated.js +1 -0
  4. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +8 -0
  5. package/dist/cjs/helpers/animations.js +6 -6
  6. package/dist/cjs/helpers/background.js +1 -1
  7. package/dist/cjs/helpers/compose-advance-style.js +6 -3
  8. package/dist/cjs/helpers/interaction/index.js +40 -0
  9. package/dist/cjs/helpers/queries/get-product.js +1 -1
  10. package/dist/cjs/helpers/render.js +2 -0
  11. package/dist/cjs/helpers/shadow.js +15 -3
  12. package/dist/cjs/helpers/third-party/appConfig.js +56 -0
  13. package/dist/cjs/helpers/third-party/appSetting.js +93 -0
  14. package/dist/cjs/helpers/third-party/constant.js +9 -1
  15. package/dist/cjs/helpers/typography.js +16 -13
  16. package/dist/cjs/index.js +4 -0
  17. package/dist/cjs/types/animations.js +2 -0
  18. package/dist/esm/components/InteractionSuffix.js +2 -2
  19. package/dist/esm/components/Render.liquid.js +10 -4
  20. package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
  21. package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
  22. package/dist/esm/helpers/animations.js +6 -6
  23. package/dist/esm/helpers/background.js +1 -1
  24. package/dist/esm/helpers/compose-advance-style.js +7 -4
  25. package/dist/esm/helpers/interaction/index.js +38 -0
  26. package/dist/esm/helpers/queries/get-product.js +1 -1
  27. package/dist/esm/helpers/render.js +2 -0
  28. package/dist/esm/helpers/shadow.js +15 -4
  29. package/dist/esm/helpers/third-party/appConfig.js +49 -1
  30. package/dist/esm/helpers/third-party/appSetting.js +93 -0
  31. package/dist/esm/helpers/third-party/constant.js +10 -2
  32. package/dist/esm/helpers/typography.js +16 -14
  33. package/dist/esm/index.js +3 -2
  34. package/dist/esm/types/animations.js +2 -0
  35. package/dist/types/index.d.ts +1974 -193
  36. package/package.json +3 -3
@@ -26,6 +26,10 @@
26
26
  themePageCustomFonts {
27
27
  ...CustomFontSelect
28
28
  }
29
+ interaction {
30
+ id
31
+ value
32
+ }
29
33
  }
30
34
  `;
31
35
  const PreviewThemePageSelect = `
@@ -53,6 +57,10 @@ const PreviewThemePageSelect = `
53
57
  themePageCustomCode {
54
58
  ...CustomCodeSelect
55
59
  }
60
+ interaction {
61
+ id
62
+ value
63
+ }
56
64
  }
57
65
  `;
58
66
 
@@ -44,7 +44,7 @@ const animations = ()=>{
44
44
  });
45
45
  return cloneOptions;
46
46
  };
47
- const slide = (target, options)=>{
47
+ const slide = (target, options, reverse)=>{
48
48
  const normalizedOptions = normalizeOptions(options);
49
49
  const { direction, distance } = normalizedOptions;
50
50
  const coordinate = [
@@ -65,11 +65,11 @@ const animations = ()=>{
65
65
  transform: `translate${coordinate}(0)`
66
66
  }
67
67
  ];
68
- return generateAnimationInstance(target, preset, {
68
+ return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
69
69
  ...generateOptions(normalizedOptions, 500)
70
70
  });
71
71
  };
72
- const fade = (target, options)=>{
72
+ const fade = (target, options, reverse)=>{
73
73
  const normalizedOptions = normalizeOptions(options);
74
74
  const preset = [
75
75
  {
@@ -79,7 +79,7 @@ const animations = ()=>{
79
79
  opacity: 1
80
80
  }
81
81
  ];
82
- return generateAnimationInstance(target, preset, {
82
+ return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
83
83
  ...generateOptions(normalizedOptions, 500)
84
84
  });
85
85
  };
@@ -99,7 +99,7 @@ const animations = ()=>{
99
99
  easing: EASING[easing ?? 'linear']
100
100
  };
101
101
  };
102
- const zoom = (target, options)=>{
102
+ const zoom = (target, options, reverse)=>{
103
103
  const normalizedOptions = normalizeOptions(options);
104
104
  const { scale, zoomDirection, isFade } = normalizedOptions;
105
105
  const [i1, i2] = scale.in;
@@ -125,7 +125,7 @@ const animations = ()=>{
125
125
  }
126
126
  ];
127
127
  const zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
128
- return generateAnimationInstance(target, zoomPreset, {
128
+ return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
129
129
  ...generateOptions(normalizedOptions, 700)
130
130
  });
131
131
  };
@@ -119,7 +119,7 @@ const getBgAttachmentByDevice = (background, device)=>{
119
119
  return background?.[device]?.attachment;
120
120
  };
121
121
  const composeBackgroundCss = (backgroundColor)=>{
122
- return `${backgroundColor ? `background-color: ${getSingleColorVariable(backgroundColor)} !important;` : undefined}`;
122
+ return `${backgroundColor ? `background-color: ${getSingleColorVariable(backgroundColor)};` : undefined}`;
123
123
  };
124
124
  const makeFixedBgAttachment = (background)=>{
125
125
  if (!background) return;
@@ -3,7 +3,7 @@ import { isColor } from './colors.js';
3
3
  import { layoutComponent } from './constant.js';
4
4
  import { makeStyleKey } from './make-style.js';
5
5
  import { composeRadius, getCornerCSSFromGlobal } from './radius.js';
6
- import { getStyleShadowState, getStyleShadow } from './shadow.js';
6
+ import { getResonsiveStyleShadow, getStyleShadowState, getStyleShadow } from './shadow.js';
7
7
 
8
8
  const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
9
9
  const { top, left, bottom, right } = spacing;
@@ -99,6 +99,9 @@ function composeAdvanceStyle(data, tag, pageType) {
99
99
  if (attr === 'rounded') {
100
100
  Object.assign(styles, composeRadius(value));
101
101
  }
102
+ if (attr === 'boxShadow') {
103
+ Object.assign(styles, getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
104
+ }
102
105
  if (composeAttr === 'desktop') {
103
106
  switch(attr){
104
107
  case 'padding':
@@ -213,20 +216,20 @@ function composeAdvanceStyle(data, tag, pageType) {
213
216
  }));
214
217
  }
215
218
  }
216
- if (attr === 'blockPadding' && pageType === "POST_PURCHASE") {
219
+ if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
217
220
  const valueMapped = postPurchasePaddingMapping[value];
218
221
  styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
219
222
  styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
220
223
  styles[`--mb`] = '0px';
221
224
  styles[`--mt`] = '0px';
222
225
  }
223
- if (attr === 'inlinePadding' && pageType === "POST_PURCHASE") {
226
+ if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
224
227
  const valueMapped = postPurchasePaddingMapping[value];
225
228
  styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
226
229
  styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
227
230
  }
228
231
  });
229
- const advancedPostPurchaseStyles = pageType === "POST_PURCHASE" ? composeAdvanceStyleForPostPurchase(data, tag) : {};
232
+ const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
230
233
  return {
231
234
  ...styles,
232
235
  ...advancedPostPurchaseStyles
@@ -0,0 +1,38 @@
1
+ const useInteraction = ()=>{
2
+ const onListener = ({ event, selector }, callback)=>{
3
+ const element = document.querySelector(selector);
4
+ if (!element) return;
5
+ element.addEventListener(event, (e)=>{
6
+ const event = e;
7
+ const params = event.detail;
8
+ if (callback) callback(params);
9
+ });
10
+ };
11
+ const trigger = ({ event, data, selector })=>{
12
+ const element = document.querySelector(selector);
13
+ if (!element) return;
14
+ const eventDispatch = new CustomEvent(event, {
15
+ bubbles: false,
16
+ cancelable: true,
17
+ detail: {
18
+ data
19
+ }
20
+ });
21
+ element.dispatchEvent(eventDispatch);
22
+ };
23
+ const saveToElementInteractionData = (element, key, value)=>{
24
+ const interactionData = element.getAttribute('gp-data-interaction');
25
+ const interactionDataJson = JSON.parse(interactionData || '{}');
26
+ element.setAttribute('gp-data-interaction', JSON.stringify({
27
+ ...interactionDataJson,
28
+ [key]: value
29
+ }));
30
+ };
31
+ return {
32
+ onListener,
33
+ trigger,
34
+ saveToElementInteractionData
35
+ };
36
+ };
37
+
38
+ export { useInteraction };
@@ -34,7 +34,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
34
34
  };
35
35
  };
36
36
  const orderBy = {
37
- field: 'CREATED_AT',
37
+ field: 'PLATFORM_CREATED_AT',
38
38
  direction: 'DESC'
39
39
  };
40
40
  const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
@@ -56,6 +56,8 @@ const template = (strings, ...keys)=>{
56
56
  }
57
57
  }
58
58
  });
59
+ str = str.replaceAll(`style=""`, '');
60
+ str = str.replaceAll(`class=""`, '');
59
61
  return str;
60
62
  };
61
63
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -25,10 +25,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
25
25
  if (typeof value.distance == 'undefined') return {};
26
26
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
27
27
  return {
28
- [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${getSingleColorVariable(value?.color)}` : 'none'
28
+ [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${getSingleColorVariable(value?.color)}` : 'none'
29
29
  };
30
30
  };
31
- const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
31
+ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
32
32
  if (!shadow || !styleAppliedFor) return {};
33
33
  const style = {};
34
34
  for (const [key, value] of Object.entries(shadow)){
@@ -36,11 +36,22 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
36
36
  value: value,
37
37
  state: key,
38
38
  styleAppliedFor,
39
- isEnableShadow: isEnableShadow?.[key]
39
+ isEnableShadow: isEnableShadow?.[key],
40
+ screen: screen ?? ''
40
41
  }));
41
42
  }
42
43
  return style;
43
44
  };
45
+ const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
46
+ if (!value) return undefined;
47
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
48
+ return {
49
+ ...getStyleShadowState(value.desktop, styleAppliedFor, isEnableShadow.desktop),
50
+ ...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.tablet, styleAppliedFor, isEnableShadow.tablet ?? isEnableShadow.desktop, 'tablet') : undefined,
51
+ ...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.mobile, styleAppliedFor, isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop, 'mobile') : undefined
52
+ };
53
+ }
54
+ };
44
55
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
45
56
  if (!hasBoxShadow) return undefined;
46
57
  if (!boxShadowValue) return undefined;
@@ -49,4 +60,4 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
49
60
  return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)}${sub};`;
50
61
  };
51
62
 
52
- export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit };
63
+ export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit };
@@ -70,5 +70,53 @@ const FastBundleBundlesDiscountsConfig = {
70
70
  appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
71
71
  }
72
72
  };
73
+ const SimpleBundlesKitsConfig = {
74
+ SimpleBundlesKits: {
75
+ appName: 'simple-bundles-kits',
76
+ appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
77
+ }
78
+ };
79
+ const EasyBundleBuilderSkailamaConfig = {
80
+ EasyBundleBuilderSkailama: {
81
+ appName: 'easy-bundles',
82
+ appId: '05b1325c-6303-4da5-8e2f-b13ab2a50e1a'
83
+ }
84
+ };
85
+ const AssortionUpsellBundlesConfig = {
86
+ AssortionUpsellBundles: {
87
+ appName: 'assortion',
88
+ appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
89
+ }
90
+ };
91
+ const PreorderNowPreOrderPqConfig = {
92
+ PreorderNowPreOrderPq: {
93
+ appName: 'preorder-now-pre-order-pq',
94
+ appId: '551fab2c-3af6-4a8f-ba21-736a71cb4540'
95
+ }
96
+ };
97
+ const KPreorderNowPartialPaymentConfig = {
98
+ KPreorderNowPartialPayment: {
99
+ appName: 'k-preorder-now-partial-payment',
100
+ appId: '65705a60-a3b0-43ae-9dc8-15db78d76b3b'
101
+ }
102
+ };
103
+ const FlyBundlesUpsellsFbtConfig = {
104
+ FlyBundlesUpsellsFbt: {
105
+ appName: 'fly-bundles-upsell',
106
+ appId: '26807bdc-c2ed-4a25-afb2-06e6b1ebf843'
107
+ }
108
+ };
109
+ const PreorderNowWodPresaleConfig = {
110
+ PreorderNowWodPresale: {
111
+ appName: 'preorder-now-wod-presale',
112
+ appId: 'fdf17d17-ef12-4a7b-8383-20cc1fc2a4b6'
113
+ }
114
+ };
115
+ const JunipProductReviewsUgcConfig = {
116
+ JunipProductReviewsUgc: {
117
+ appName: 'junip-product-reviews-ugc',
118
+ appId: 'dc14f5a8-ed15-41b1-ad08-cfba23f9789b'
119
+ }
120
+ };
73
121
 
74
- export { BonLoyaltyRewardsReferralsConfig, FastBundleBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
122
+ export { AssortionUpsellBundlesConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, KPreorderNowPartialPaymentConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
@@ -79,6 +79,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
79
79
  ...currentSetting,
80
80
  form_id: appSetting['formId']
81
81
  };
82
+ case 'FlyBundlesUpsellsFbt':
83
+ {
84
+ return {
85
+ ...currentSetting,
86
+ bundle_id: appSetting?.['customBundleId']
87
+ };
88
+ }
82
89
  default:
83
90
  return currentSetting;
84
91
  }
@@ -122,10 +129,96 @@ const FastBundleBundlesDiscounts = {
122
129
  volume_position: null
123
130
  }
124
131
  };
132
+ const SimpleBundlesKits = {
133
+ SimpleBundlesKits: {
134
+ 'infinite-options-selector': null
135
+ }
136
+ };
137
+ const EasyBundleBuilderSkailama = {
138
+ EasyBundleBuilderSkailama: {
139
+ 'app-block-bundlePage': null
140
+ }
141
+ };
142
+ const AssortionUpsellBundles = {
143
+ AssortionUpsellBundles: {
144
+ volume: null,
145
+ bundle: null,
146
+ addon: null
147
+ }
148
+ };
149
+ const PreorderNowPreOrderPq = {
150
+ PreorderNowPreOrderPq: {
151
+ 'app-block-notifyapp-block-notify': null,
152
+ 'app-block-partial': null,
153
+ 'app-block-timer': null,
154
+ 'app-block': null
155
+ }
156
+ };
157
+ const KPreorderNowPartialPayment = {
158
+ KPreorderNowPartialPayment: {
159
+ 'kaktus-bundle': null
160
+ }
161
+ };
162
+ const FlyBundlesUpsellsFbt = {
163
+ FlyBundlesUpsellsFbt: {
164
+ 'app-block-volume': null,
165
+ 'app-block-upsell-block': null,
166
+ 'app-block-fbt': null,
167
+ 'app-block-custom': {
168
+ bundle_id: ''
169
+ }
170
+ }
171
+ };
172
+ const PreorderNowWodPresale = {
173
+ PreorderNowWodPresale: {
174
+ 'app-block': null,
175
+ 'popups-block': null
176
+ }
177
+ };
178
+ const JunipProductReviewsUgc = {
179
+ JunipProductReviewsUgc: {
180
+ 'junip-review-carousel': {
181
+ reviewsType: 'product_reviews',
182
+ showSummary: true,
183
+ title: 'Reviews',
184
+ paddingTop: 48,
185
+ paddingBottom: 48,
186
+ containerClass: ''
187
+ },
188
+ 'junip-ugc-gallery': {
189
+ layout: 'scroll',
190
+ title: '',
191
+ paddingTop: 48,
192
+ paddingBottom: 48,
193
+ containerClass: ''
194
+ },
195
+ 'junip-product-review': {
196
+ product: '{{product}}'
197
+ },
198
+ 'junip-product-summary': {
199
+ product: '{{product}}'
200
+ },
201
+ 'junip-reviews': {
202
+ layout: 'list',
203
+ reviewsType: 'all',
204
+ showSummary: true,
205
+ reviewsCount: 10,
206
+ containerClass: ''
207
+ }
208
+ }
209
+ };
125
210
  const composeSettingsByWidgetType = {
211
+ ...JunipProductReviewsUgc,
212
+ ...FlyBundlesUpsellsFbt,
213
+ ...PreorderNowWodPresale,
214
+ ...KPreorderNowPartialPayment,
215
+ ...PreorderNowPreOrderPq,
216
+ ...AssortionUpsellBundles,
217
+ ...EasyBundleBuilderSkailama,
126
218
  ...FastBundleBundlesDiscounts,
127
219
  ...KiteFreeGiftDiscount,
128
220
  ...UnlimitedBundlesDiscounts,
221
+ ...SimpleBundlesKits,
129
222
  ...PumperBundlesVolumeDiscount,
130
223
  ...ReviewxpoProductReviewsApp,
131
224
  ...ShopifyForms,
@@ -1,4 +1,4 @@
1
- import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig } from './appConfig.js';
1
+ import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, AssortionUpsellBundlesConfig, PreorderNowPreOrderPqConfig, KPreorderNowPartialPaymentConfig, FlyBundlesUpsellsFbtConfig, PreorderNowWodPresaleConfig, JunipProductReviewsUgcConfig } from './appConfig.js';
2
2
 
3
3
  const mapShopifyAppMeta = {
4
4
  ...RechargeSubscriptionsConfig,
@@ -12,7 +12,15 @@ const mapShopifyAppMeta = {
12
12
  ...PumperBundlesVolumeDiscountConfig,
13
13
  ...UnlimitedBundlesDiscountsConfig,
14
14
  ...KiteFreeGiftDiscountConfig,
15
- ...FastBundleBundlesDiscountsConfig
15
+ ...FastBundleBundlesDiscountsConfig,
16
+ ...SimpleBundlesKitsConfig,
17
+ ...EasyBundleBuilderSkailamaConfig,
18
+ ...AssortionUpsellBundlesConfig,
19
+ ...PreorderNowPreOrderPqConfig,
20
+ ...KPreorderNowPartialPaymentConfig,
21
+ ...FlyBundlesUpsellsFbtConfig,
22
+ ...PreorderNowWodPresaleConfig,
23
+ ...JunipProductReviewsUgcConfig
16
24
  };
17
25
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
18
26
 
@@ -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,
@@ -114,18 +116,10 @@ const composeTypographyAttr = (attrs)=>{
114
116
  });
115
117
  };
116
118
  const composeTypographyClassName = (typo, typography)=>{
117
- 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);
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,5 +141,12 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
146
141
  ...!typography?.type ? composeTypography(typography?.custom) : {}
147
142
  };
148
143
  };
144
+ const isCustomTypo = (customTypo)=>{
145
+ return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
146
+ };
147
+ const getSeoTagFromTypo = (typo)=>{
148
+ if (!typo?.attrs?.seoTagValue) return 'div';
149
+ return typo?.attrs?.seoTagValue;
150
+ };
149
151
 
150
- export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
152
+ export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass, getSeoTagFromTypo };
package/dist/esm/index.js CHANGED
@@ -66,9 +66,9 @@ 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
- export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
71
+ export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass, getSeoTagFromTypo } from './helpers/typography.js';
72
72
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
73
73
  export { useCartData } from './hooks/cart/use-cart-data.js';
74
74
  export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
@@ -111,3 +111,4 @@ export { fetchMedias, fetchVariants, getProduct } from './helpers/queries/get-pr
111
111
  export { getProductBySlug } from './helpers/queries/get-product-by-slug.js';
112
112
  export { getAppBlocks } from './helpers/third-party/getAppBlocks.js';
113
113
  export { addAppBlockId } from './helpers/third-party/addAppBlockId.js';
114
+ export { useInteraction } from './helpers/interaction/index.js';
@@ -30,6 +30,8 @@ var AnimationTriggerType;
30
30
  (function(AnimationTriggerType) {
31
31
  AnimationTriggerType["Appear"] = 'appear';
32
32
  AnimationTriggerType["Hover"] = 'hover';
33
+ AnimationTriggerType["Hidden"] = 'hidden';
34
+ AnimationTriggerType["AppearByTrigger"] = 'appearByTrigger';
33
35
  })(AnimationTriggerType || (AnimationTriggerType = {}));
34
36
  var AnimationZoomDirectionType;
35
37
  (function(AnimationZoomDirectionType) {