@gem-sdk/core 1.48.0-dev.9 → 1.48.0-dev.91

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 (40) hide show
  1. package/dist/cjs/components/InteractionSuffix.js +9 -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/colors.js +2 -2
  8. package/dist/cjs/helpers/compose-advance-style.js +6 -3
  9. package/dist/cjs/helpers/interaction/index.js +66 -0
  10. package/dist/cjs/helpers/queries/get-product.js +1 -1
  11. package/dist/cjs/helpers/render.js +2 -0
  12. package/dist/cjs/helpers/shadow.js +15 -3
  13. package/dist/cjs/helpers/third-party/appConfig.js +49 -0
  14. package/dist/cjs/helpers/third-party/appSetting.js +87 -0
  15. package/dist/cjs/helpers/third-party/constant.js +8 -1
  16. package/dist/cjs/helpers/typography.js +19 -15
  17. package/dist/cjs/index.js +4 -0
  18. package/dist/cjs/types/animations.js +2 -0
  19. package/dist/cjs/types/custom.js +1 -0
  20. package/dist/esm/components/InteractionSuffix.js +10 -2
  21. package/dist/esm/components/Render.liquid.js +10 -4
  22. package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
  23. package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
  24. package/dist/esm/helpers/animations.js +6 -6
  25. package/dist/esm/helpers/background.js +1 -1
  26. package/dist/esm/helpers/colors.js +2 -2
  27. package/dist/esm/helpers/compose-advance-style.js +7 -4
  28. package/dist/esm/helpers/interaction/index.js +64 -0
  29. package/dist/esm/helpers/queries/get-product.js +1 -1
  30. package/dist/esm/helpers/render.js +2 -0
  31. package/dist/esm/helpers/shadow.js +15 -4
  32. package/dist/esm/helpers/third-party/appConfig.js +43 -1
  33. package/dist/esm/helpers/third-party/appSetting.js +87 -0
  34. package/dist/esm/helpers/third-party/constant.js +9 -2
  35. package/dist/esm/helpers/typography.js +19 -16
  36. package/dist/esm/index.js +3 -2
  37. package/dist/esm/types/animations.js +2 -0
  38. package/dist/esm/types/custom.js +1 -0
  39. package/dist/types/index.d.ts +1981 -196
  40. package/package.json +3 -3
@@ -14,10 +14,13 @@ require('react-transition-group');
14
14
  require('@gem-sdk/core');
15
15
  require('classnames');
16
16
  require('dayjs');
17
+ var index = require('../helpers/interaction/index.js');
17
18
  require('../helpers/convert.js');
18
19
 
19
20
  const InteractionSuffix = ({ tag, uid })=>{
21
+ const { closeSelectOnPage } = index.useInteraction();
20
22
  const currentInteraction = PageContext.usePageStore((s)=>s.interactionData?.item);
23
+ const isSelectOnPage = PageContext.usePageStore((s)=>s.interactionData?.isSelectOnPage);
21
24
  const isCurrentInteractionTarget = react.useMemo(()=>{
22
25
  return currentInteraction?.targets?.find((t)=>t.uid === uid);
23
26
  }, [
@@ -46,10 +49,15 @@ const InteractionSuffix = ({ tag, uid })=>{
46
49
  isCurrentInteractionTarget
47
50
  ]);
48
51
  if (!isDisplay) {
49
- return undefined;
52
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
50
53
  }
51
54
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
52
55
  children: [
56
+ isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx("button", {
57
+ className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-sm gp-font-medium gp-hidden interaction-use-element-btn",
58
+ onClick: closeSelectOnPage,
59
+ children: "Use element"
60
+ }),
53
61
  /*#__PURE__*/ jsxRuntime.jsx("div", {
54
62
  className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
55
63
  }),
@@ -59,7 +59,11 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
59
59
  const customProps = {
60
60
  extraFiles: {}
61
61
  };
62
- const style = composeAdvanceStyle.composeAdvanceStyle(item.advanced, item.tag);
62
+ const d = item.advanced?.displayInitInteraction ?? item.advanced?.d;
63
+ const style = composeAdvanceStyle.composeAdvanceStyle({
64
+ ...item.advanced,
65
+ d
66
+ }, item.tag);
63
67
  let liquid = '';
64
68
  if (constant.disableWrap.includes(item.tag)) {
65
69
  liquid = render.RenderIf(item?.childrens?.length, ()=>{
@@ -219,7 +223,7 @@ const RenderCustomCode = (item)=>{
219
223
  };
220
224
  const appendAnimation = (props, liquid)=>{
221
225
  const { advanced, tag } = props;
222
- const { animation, op: opacity } = advanced ?? {};
226
+ const { animation, op: opacity, hasAnimationInteraction } = advanced ?? {};
223
227
  const getAnimationType = (settings, type)=>{
224
228
  return settings?.triggerConfig?.[type]?.animation ?? 'none';
225
229
  };
@@ -233,7 +237,9 @@ const appendAnimation = (props, liquid)=>{
233
237
  const hoverDesktop = getAnimationType(getSettingsByDevice('desktop'), 'hover');
234
238
  const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
235
239
  const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
236
- const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
240
+ const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none' || !!hasAnimationInteraction;
241
+ const enableAnimationWhenInit = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
242
+ if (!enableAnimation) return liquid;
237
243
  const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
238
244
  'shake',
239
245
  'none'
@@ -249,7 +255,7 @@ const appendAnimation = (props, liquid)=>{
249
255
  config: animation,
250
256
  tag,
251
257
  opacity,
252
- isEnableInit: enableAnimation
258
+ notEnableAnimationWhenInit: !enableAnimationWhenInit
253
259
  })}'
254
260
  style="${{
255
261
  display: 'contents'
@@ -6,6 +6,7 @@
6
6
  title
7
7
  description
8
8
  descriptionHtml
9
+ createdAt
9
10
  handle
10
11
  averageRating
11
12
  isStorefront
@@ -28,6 +28,10 @@
28
28
  themePageCustomFonts {
29
29
  ...CustomFontSelect
30
30
  }
31
+ interaction {
32
+ id
33
+ value
34
+ }
31
35
  }
32
36
  `;
33
37
  const PreviewThemePageSelect = `
@@ -55,6 +59,10 @@ const PreviewThemePageSelect = `
55
59
  themePageCustomCode {
56
60
  ...CustomCodeSelect
57
61
  }
62
+ interaction {
63
+ id
64
+ value
65
+ }
58
66
  }
59
67
  `;
60
68
 
@@ -46,7 +46,7 @@ const animations = ()=>{
46
46
  });
47
47
  return cloneOptions;
48
48
  };
49
- const slide = (target, options)=>{
49
+ const slide = (target, options, reverse)=>{
50
50
  const normalizedOptions = normalizeOptions(options);
51
51
  const { direction, distance } = normalizedOptions;
52
52
  const coordinate = [
@@ -67,11 +67,11 @@ const animations = ()=>{
67
67
  transform: `translate${coordinate}(0)`
68
68
  }
69
69
  ];
70
- return generateAnimationInstance(target, preset, {
70
+ return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
71
71
  ...generateOptions(normalizedOptions, 500)
72
72
  });
73
73
  };
74
- const fade = (target, options)=>{
74
+ const fade = (target, options, reverse)=>{
75
75
  const normalizedOptions = normalizeOptions(options);
76
76
  const preset = [
77
77
  {
@@ -81,7 +81,7 @@ const animations = ()=>{
81
81
  opacity: 1
82
82
  }
83
83
  ];
84
- return generateAnimationInstance(target, preset, {
84
+ return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
85
85
  ...generateOptions(normalizedOptions, 500)
86
86
  });
87
87
  };
@@ -101,7 +101,7 @@ const animations = ()=>{
101
101
  easing: EASING[easing ?? 'linear']
102
102
  };
103
103
  };
104
- const zoom = (target, options)=>{
104
+ const zoom = (target, options, reverse)=>{
105
105
  const normalizedOptions = normalizeOptions(options);
106
106
  const { scale, zoomDirection, isFade } = normalizedOptions;
107
107
  const [i1, i2] = scale.in;
@@ -127,7 +127,7 @@ const animations = ()=>{
127
127
  }
128
128
  ];
129
129
  const zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
130
- return generateAnimationInstance(target, zoomPreset, {
130
+ return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
131
131
  ...generateOptions(normalizedOptions, 700)
132
132
  });
133
133
  };
@@ -121,7 +121,7 @@ const getBgAttachmentByDevice = (background, device)=>{
121
121
  return background?.[device]?.attachment;
122
122
  };
123
123
  const composeBackgroundCss = (backgroundColor)=>{
124
- return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)} !important;` : undefined}`;
124
+ return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)};` : undefined}`;
125
125
  };
126
126
  const makeFixedBgAttachment = (background)=>{
127
127
  if (!background) return;
@@ -114,9 +114,9 @@ const getGlobalColorResponsiveStyle = (type, data)=>{
114
114
  }
115
115
  }));
116
116
  };
117
- const getGlobalColorStateStyle = (type, data)=>{
117
+ const getGlobalColorStateStyle = (type, data, states)=>{
118
118
  if (!data) return {};
119
- return Object.fromEntries(Object.entries(data).map(([state, value])=>{
119
+ return Object.fromEntries(Object.entries(data).filter(([state])=>states?.length ? states?.includes(state) : true).map(([state, value])=>{
120
120
  if (state === 'active') return [];
121
121
  return [
122
122
  `-${constant.stateMapping?.[state] || ''}-${type}`,
@@ -101,6 +101,9 @@ function composeAdvanceStyle(data, tag, pageType) {
101
101
  if (attr === 'rounded') {
102
102
  Object.assign(styles, radius.composeRadius(value));
103
103
  }
104
+ if (attr === 'boxShadow') {
105
+ Object.assign(styles, shadow.getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
106
+ }
104
107
  if (composeAttr === 'desktop') {
105
108
  switch(attr){
106
109
  case 'padding':
@@ -215,20 +218,20 @@ function composeAdvanceStyle(data, tag, pageType) {
215
218
  }));
216
219
  }
217
220
  }
218
- if (attr === 'blockPadding' && pageType === "POST_PURCHASE") {
221
+ if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
219
222
  const valueMapped = postPurchasePaddingMapping[value];
220
223
  styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
221
224
  styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
222
225
  styles[`--mb`] = '0px';
223
226
  styles[`--mt`] = '0px';
224
227
  }
225
- if (attr === 'inlinePadding' && pageType === "POST_PURCHASE") {
228
+ if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
226
229
  const valueMapped = postPurchasePaddingMapping[value];
227
230
  styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
228
231
  styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
229
232
  }
230
233
  });
231
- const advancedPostPurchaseStyles = pageType === "POST_PURCHASE" ? composeAdvanceStyleForPostPurchase(data, tag) : {};
234
+ const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
232
235
  return {
233
236
  ...styles,
234
237
  ...advancedPostPurchaseStyles
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ require('react/jsx-runtime');
4
+ require('zustand');
5
+ require('react');
6
+ require('swr');
7
+ var PageContext = require('../../contexts/PageContext.js');
8
+ require('@gem-sdk/adapter-shopify');
9
+ require('swr/mutation');
10
+ require('swr/infinite');
11
+ require('vanilla-lazyload');
12
+ require('../../hooks/useCartUI.js');
13
+ require('react-transition-group');
14
+ require('@gem-sdk/core');
15
+ require('classnames');
16
+ require('dayjs');
17
+ require('../convert.js');
18
+
19
+ const useInteraction = ()=>{
20
+ const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
21
+ const onListener = ({ event, selector }, callback)=>{
22
+ const element = document.querySelector(selector);
23
+ if (!element) return;
24
+ element.addEventListener(event, (e)=>{
25
+ const event = e;
26
+ const params = event.detail;
27
+ if (callback) callback(params);
28
+ });
29
+ };
30
+ const trigger = ({ event, data, selector })=>{
31
+ const element = document.querySelector(selector);
32
+ if (!element) return;
33
+ const eventDispatch = new CustomEvent(event, {
34
+ bubbles: false,
35
+ cancelable: true,
36
+ detail: {
37
+ data
38
+ }
39
+ });
40
+ element.dispatchEvent(eventDispatch);
41
+ };
42
+ const saveToElementInteractionData = (element, key, value)=>{
43
+ const interactionData = element.getAttribute('gp-data-interaction');
44
+ const interactionDataJson = JSON.parse(interactionData || '{}');
45
+ element.setAttribute('gp-data-interaction', JSON.stringify({
46
+ ...interactionDataJson,
47
+ [key]: value
48
+ }));
49
+ };
50
+ const closeSelectOnPage = ()=>{
51
+ setInteractionIsSelectOnPage(false);
52
+ const event = new CustomEvent('editor:interaction:change-select-on-page', {
53
+ bubbles: true,
54
+ detail: false
55
+ });
56
+ window.dispatchEvent(event);
57
+ };
58
+ return {
59
+ onListener,
60
+ trigger,
61
+ saveToElementInteractionData,
62
+ closeSelectOnPage
63
+ };
64
+ };
65
+
66
+ exports.useInteraction = useInteraction;
@@ -36,7 +36,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
36
36
  };
37
37
  };
38
38
  const orderBy = {
39
- field: 'CREATED_AT',
39
+ field: 'PLATFORM_CREATED_AT',
40
40
  direction: 'DESC'
41
41
  };
42
42
  const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
@@ -58,6 +58,8 @@ const template = (strings, ...keys)=>{
58
58
  }
59
59
  }
60
60
  });
61
+ str = str.replaceAll(`style=""`, '');
62
+ str = str.replaceAll(`class=""`, '');
61
63
  return str;
62
64
  };
63
65
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -27,10 +27,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
27
27
  if (typeof value.distance == 'undefined') return {};
28
28
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
29
29
  return {
30
- [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.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 + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
30
+ [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.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 + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
31
31
  };
32
32
  };
33
- const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
33
+ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
34
34
  if (!shadow || !styleAppliedFor) return {};
35
35
  const style = {};
36
36
  for (const [key, value] of Object.entries(shadow)){
@@ -38,11 +38,22 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
38
38
  value: value,
39
39
  state: key,
40
40
  styleAppliedFor,
41
- isEnableShadow: isEnableShadow?.[key]
41
+ isEnableShadow: isEnableShadow?.[key],
42
+ screen: screen ?? ''
42
43
  }));
43
44
  }
44
45
  return style;
45
46
  };
47
+ const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
48
+ if (!value) return undefined;
49
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
50
+ return {
51
+ ...getStyleShadowState(value.desktop, styleAppliedFor, isEnableShadow.desktop),
52
+ ...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.tablet, styleAppliedFor, isEnableShadow.tablet ?? isEnableShadow.desktop, 'tablet') : undefined,
53
+ ...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.mobile, styleAppliedFor, isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop, 'mobile') : undefined
54
+ };
55
+ }
56
+ };
46
57
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
47
58
  if (!hasBoxShadow) return undefined;
48
59
  if (!boxShadowValue) return undefined;
@@ -52,6 +63,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
52
63
  };
53
64
 
54
65
  exports.composeShadowCss = composeShadowCss;
66
+ exports.getResonsiveStyleShadow = getResonsiveStyleShadow;
55
67
  exports.getStyleShadow = getStyleShadow;
56
68
  exports.getStyleShadowState = getStyleShadowState;
57
69
  exports.parseValueWithUnit = parseValueWithUnit;
@@ -78,11 +78,60 @@ const SimpleBundlesKitsConfig = {
78
78
  appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
79
79
  }
80
80
  };
81
+ const EasyBundleBuilderSkailamaConfig = {
82
+ EasyBundleBuilderSkailama: {
83
+ appName: 'easy-bundles',
84
+ appId: '05b1325c-6303-4da5-8e2f-b13ab2a50e1a'
85
+ }
86
+ };
87
+ const AssortionUpsellBundlesConfig = {
88
+ AssortionUpsellBundles: {
89
+ appName: 'assortion',
90
+ appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
91
+ }
92
+ };
93
+ const PreorderNowPreOrderPqConfig = {
94
+ PreorderNowPreOrderPq: {
95
+ appName: 'preorder-now-pre-order-pq',
96
+ appId: '551fab2c-3af6-4a8f-ba21-736a71cb4540'
97
+ }
98
+ };
99
+ const KPreorderNowPartialPaymentConfig = {
100
+ KPreorderNowPartialPayment: {
101
+ appName: 'k-preorder-now-partial-payment',
102
+ appId: '65705a60-a3b0-43ae-9dc8-15db78d76b3b'
103
+ }
104
+ };
105
+ const FlyBundlesUpsellsFbtConfig = {
106
+ FlyBundlesUpsellsFbt: {
107
+ appName: 'fly-bundles-upsell',
108
+ appId: '26807bdc-c2ed-4a25-afb2-06e6b1ebf843'
109
+ }
110
+ };
111
+ const PreorderNowWodPresaleConfig = {
112
+ PreorderNowWodPresale: {
113
+ appName: 'preorder-now-wod-presale',
114
+ appId: 'fdf17d17-ef12-4a7b-8383-20cc1fc2a4b6'
115
+ }
116
+ };
117
+ const JunipProductReviewsUgcConfig = {
118
+ JunipProductReviewsUgc: {
119
+ appName: 'junip-product-reviews-ugc',
120
+ appId: 'dc14f5a8-ed15-41b1-ad08-cfba23f9789b'
121
+ }
122
+ };
81
123
 
124
+ exports.AssortionUpsellBundlesConfig = AssortionUpsellBundlesConfig;
82
125
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
126
+ exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
83
127
  exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
128
+ exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
129
+ exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
130
+ exports.KPreorderNowPartialPaymentConfig = KPreorderNowPartialPaymentConfig;
84
131
  exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
85
132
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
133
+ exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
134
+ exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
86
135
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
87
136
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
88
137
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
@@ -81,6 +81,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
81
81
  ...currentSetting,
82
82
  form_id: appSetting['formId']
83
83
  };
84
+ case 'FlyBundlesUpsellsFbt':
85
+ {
86
+ return {
87
+ ...currentSetting,
88
+ bundle_id: appSetting?.['customBundleId']
89
+ };
90
+ }
84
91
  default:
85
92
  return currentSetting;
86
93
  }
@@ -129,7 +136,87 @@ const SimpleBundlesKits = {
129
136
  'infinite-options-selector': null
130
137
  }
131
138
  };
139
+ const EasyBundleBuilderSkailama = {
140
+ EasyBundleBuilderSkailama: {
141
+ 'app-block-bundlePage': null
142
+ }
143
+ };
144
+ const AssortionUpsellBundles = {
145
+ AssortionUpsellBundles: {
146
+ volume: null,
147
+ bundle: null,
148
+ addon: null
149
+ }
150
+ };
151
+ const PreorderNowPreOrderPq = {
152
+ PreorderNowPreOrderPq: {
153
+ 'app-block-notifyapp-block-notify': null,
154
+ 'app-block-partial': null,
155
+ 'app-block-timer': null,
156
+ 'app-block': null
157
+ }
158
+ };
159
+ const KPreorderNowPartialPayment = {
160
+ KPreorderNowPartialPayment: {
161
+ 'kaktus-bundle': null
162
+ }
163
+ };
164
+ const FlyBundlesUpsellsFbt = {
165
+ FlyBundlesUpsellsFbt: {
166
+ 'app-block-volume': null,
167
+ 'app-block-upsell-block': null,
168
+ 'app-block-fbt': null,
169
+ 'app-block-custom': {
170
+ bundle_id: ''
171
+ }
172
+ }
173
+ };
174
+ const PreorderNowWodPresale = {
175
+ PreorderNowWodPresale: {
176
+ 'app-block': null,
177
+ 'popups-block': null
178
+ }
179
+ };
180
+ const JunipProductReviewsUgc = {
181
+ JunipProductReviewsUgc: {
182
+ 'junip-review-carousel': {
183
+ reviewsType: 'product_reviews',
184
+ showSummary: true,
185
+ title: 'Reviews',
186
+ paddingTop: 48,
187
+ paddingBottom: 48,
188
+ containerClass: ''
189
+ },
190
+ 'junip-ugc-gallery': {
191
+ layout: 'scroll',
192
+ title: '',
193
+ paddingTop: 48,
194
+ paddingBottom: 48,
195
+ containerClass: ''
196
+ },
197
+ 'junip-product-review': {
198
+ product: '{{product}}'
199
+ },
200
+ 'junip-product-summary': {
201
+ product: '{{product}}'
202
+ },
203
+ 'junip-reviews': {
204
+ layout: 'list',
205
+ reviewsType: 'all',
206
+ showSummary: true,
207
+ reviewsCount: 10,
208
+ containerClass: ''
209
+ }
210
+ }
211
+ };
132
212
  const composeSettingsByWidgetType = {
213
+ ...JunipProductReviewsUgc,
214
+ ...FlyBundlesUpsellsFbt,
215
+ ...PreorderNowWodPresale,
216
+ ...KPreorderNowPartialPayment,
217
+ ...PreorderNowPreOrderPq,
218
+ ...AssortionUpsellBundles,
219
+ ...EasyBundleBuilderSkailama,
133
220
  ...FastBundleBundlesDiscounts,
134
221
  ...KiteFreeGiftDiscount,
135
222
  ...UnlimitedBundlesDiscounts,
@@ -15,7 +15,14 @@ const mapShopifyAppMeta = {
15
15
  ...appConfig.UnlimitedBundlesDiscountsConfig,
16
16
  ...appConfig.KiteFreeGiftDiscountConfig,
17
17
  ...appConfig.FastBundleBundlesDiscountsConfig,
18
- ...appConfig.SimpleBundlesKitsConfig
18
+ ...appConfig.SimpleBundlesKitsConfig,
19
+ ...appConfig.EasyBundleBuilderSkailamaConfig,
20
+ ...appConfig.AssortionUpsellBundlesConfig,
21
+ ...appConfig.PreorderNowPreOrderPqConfig,
22
+ ...appConfig.KPreorderNowPartialPaymentConfig,
23
+ ...appConfig.FlyBundlesUpsellsFbtConfig,
24
+ ...appConfig.PreorderNowWodPresaleConfig,
25
+ ...appConfig.JunipProductReviewsUgcConfig
19
26
  };
20
27
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
21
28
 
@@ -28,7 +28,8 @@ const composeTypographyV2Css = (typography, isImportant)=>{
28
28
  const composeImportant = isImportant ? '!important' : '';
29
29
  return `
30
30
  ${fontFamily ? `font-family: ${composeFontFamilyTypographyV2({
31
- fontFamily
31
+ fontFamily,
32
+ type: typography?.type
32
33
  })} ${composeImportant}` : ''};
33
34
  ${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant}` : ''};
34
35
  ${bold ? `font-weight: bold ${composeImportant}` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant}` : ''};
@@ -76,8 +77,10 @@ const composeTypographyV2 = (value, attrs)=>{
76
77
  });
77
78
  };
78
79
  const composeFontFamilyTypographyV2 = (value)=>{
79
- const fontFamily = value?.fontFamily;
80
- if (!fontFamily) return;
80
+ const { fontFamily, isCustom, fallbackFontFamily, type } = value || {};
81
+ if (!fontFamily) {
82
+ return isCustom ? fallbackFontFamily : undefined;
83
+ }
81
84
  if (typeof fontFamily === 'string') {
82
85
  return getFontUsedByTypographyV2({
83
86
  fontFamily,
@@ -91,7 +94,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
91
94
  default:
92
95
  return getFontUsedByTypographyV2({
93
96
  fontFamily: fontFamily.value,
94
- fallbackFontFamily: value?.fallbackFontFamily
97
+ fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
95
98
  });
96
99
  }
97
100
  }
@@ -116,18 +119,10 @@ const composeTypographyAttr = (attrs)=>{
116
119
  });
117
120
  };
118
121
  const composeTypographyClassName = (typo, typography)=>{
119
- return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
122
+ return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
120
123
  };
121
124
  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)) {
125
+ if (tag.toLocaleLowerCase().includes('heading')) {
131
126
  return 'var(--g-font-heading, heading)';
132
127
  }
133
128
  return 'var(--g-font-body, body)';
@@ -137,7 +132,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
137
132
  const fallbackFontFamily = composeFallbackTypographyStyle(typo.type ?? 'heading');
138
133
  const customTypo = {
139
134
  ...typo.custom,
140
- fallbackFontFamily: fallbackFontFamily
135
+ fallbackFontFamily: fallbackFontFamily,
136
+ isCustom: isCustomTypo(typo.custom)
141
137
  };
142
138
  return {
143
139
  ...composeTypographyV2(customTypo, typo.attrs),
@@ -148,6 +144,13 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
148
144
  ...!typography?.type ? composeTypography(typography?.custom) : {}
149
145
  };
150
146
  };
147
+ const isCustomTypo = (customTypo)=>{
148
+ return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
149
+ };
150
+ const getSeoTagFromTypo = (typo)=>{
151
+ if (!typo?.attrs?.seoTagValue) return 'div';
152
+ return typo?.attrs?.seoTagValue;
153
+ };
151
154
 
152
155
  exports.composeFallbackTypographyStyle = composeFallbackTypographyStyle;
153
156
  exports.composeFontFamilyTypographyV2 = composeFontFamilyTypographyV2;
@@ -159,3 +162,4 @@ exports.composeTypographyStyle = composeTypographyStyle;
159
162
  exports.composeTypographyV2 = composeTypographyV2;
160
163
  exports.composeTypographyV2Css = composeTypographyV2Css;
161
164
  exports.genTypoClass = genTypoClass;
165
+ exports.getSeoTagFromTypo = getSeoTagFromTypo;
package/dist/cjs/index.js CHANGED
@@ -108,6 +108,7 @@ var getProduct = require('./helpers/queries/get-product.js');
108
108
  var getProductBySlug = require('./helpers/queries/get-product-by-slug.js');
109
109
  var getAppBlocks = require('./helpers/third-party/getAppBlocks.js');
110
110
  var addAppBlockId = require('./helpers/third-party/addAppBlockId.js');
111
+ var index = require('./helpers/interaction/index.js');
111
112
 
112
113
 
113
114
 
@@ -267,6 +268,7 @@ exports.removeUndefinedValuesFromObject = render.removeUndefinedValuesFromObject
267
268
  exports.styles = render.styles;
268
269
  exports.template = render.template;
269
270
  exports.composeShadowCss = shadow.composeShadowCss;
271
+ exports.getResonsiveStyleShadow = shadow.getResonsiveStyleShadow;
270
272
  exports.getStyleShadow = shadow.getStyleShadow;
271
273
  exports.getStyleShadowState = shadow.getStyleShadowState;
272
274
  exports.parseValueWithUnit = shadow.parseValueWithUnit;
@@ -293,6 +295,7 @@ exports.composeTypographyStyle = typography.composeTypographyStyle;
293
295
  exports.composeTypographyV2 = typography.composeTypographyV2;
294
296
  exports.composeTypographyV2Css = typography.composeTypographyV2Css;
295
297
  exports.genTypoClass = typography.genTypoClass;
298
+ exports.getSeoTagFromTypo = typography.getSeoTagFromTypo;
296
299
  exports.useAddToCart = useAddToCart.useAddToCart;
297
300
  exports.useCartData = useCartData.useCartData;
298
301
  exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
@@ -403,3 +406,4 @@ exports.getProduct = getProduct.getProduct;
403
406
  exports.getProductBySlug = getProductBySlug.getProductBySlug;
404
407
  exports.getAppBlocks = getAppBlocks.getAppBlocks;
405
408
  exports.addAppBlockId = addAppBlockId.addAppBlockId;
409
+ exports.useInteraction = index.useInteraction;
@@ -32,6 +32,8 @@ exports.AnimationTriggerType = void 0;
32
32
  (function(AnimationTriggerType) {
33
33
  AnimationTriggerType["Appear"] = 'appear';
34
34
  AnimationTriggerType["Hover"] = 'hover';
35
+ AnimationTriggerType["Hidden"] = 'hidden';
36
+ AnimationTriggerType["AppearByTrigger"] = 'appearByTrigger';
35
37
  })(exports.AnimationTriggerType || (exports.AnimationTriggerType = {}));
36
38
  exports.AnimationZoomDirectionType = void 0;
37
39
  (function(AnimationZoomDirectionType) {
@@ -22,6 +22,7 @@ exports.InteractionTargetEvent = void 0;
22
22
  InteractionTargetEvent[InteractionTargetEvent['gp:change-text-value'] = 17] = 'gp:change-text-value';
23
23
  InteractionTargetEvent[InteractionTargetEvent['gp:toggle-popup-open'] = 18] = 'gp:toggle-popup-open';
24
24
  InteractionTargetEvent[InteractionTargetEvent['gp:show-or-hide'] = 19] = 'gp:show-or-hide';
25
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-banner'] = 20] = 'gp:change-banner';
25
26
  })(exports.InteractionTargetEvent || (exports.InteractionTargetEvent = {}));
26
27
  exports.InteractionTriggerEvent = void 0;
27
28
  (function(InteractionTriggerEvent) {