@gem-sdk/core 1.53.0-dev.16 → 1.53.0-dev.160

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 (38) hide show
  1. package/dist/cjs/components/ComponentToolbarPreview.js +58 -3
  2. package/dist/cjs/components/InteractionSuffix.js +10 -91
  3. package/dist/cjs/components/Render.liquid.js +40 -7
  4. package/dist/cjs/contexts/PageContext.js +9 -1
  5. package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
  6. package/dist/cjs/helpers/animations.js +11 -2
  7. package/dist/cjs/helpers/background.js +10 -5
  8. package/dist/cjs/helpers/compose-advance-style.js +6 -1
  9. package/dist/cjs/helpers/interaction/index.js +25 -6
  10. package/dist/cjs/helpers/radius.js +11 -1
  11. package/dist/cjs/helpers/shadow.js +4 -3
  12. package/dist/cjs/helpers/third-party/appConfig.js +42 -0
  13. package/dist/cjs/helpers/third-party/appSetting.js +144 -1
  14. package/dist/cjs/helpers/third-party/constant.js +7 -1
  15. package/dist/cjs/helpers/typography.js +5 -2
  16. package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -1
  17. package/dist/cjs/hooks/animation/useApplyAnimation.js +5 -5
  18. package/dist/cjs/index.js +5 -1
  19. package/dist/esm/components/ComponentToolbarPreview.js +58 -3
  20. package/dist/esm/components/InteractionSuffix.js +11 -92
  21. package/dist/esm/components/Render.liquid.js +40 -7
  22. package/dist/esm/contexts/PageContext.js +9 -1
  23. package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
  24. package/dist/esm/helpers/animations.js +11 -2
  25. package/dist/esm/helpers/background.js +10 -5
  26. package/dist/esm/helpers/compose-advance-style.js +7 -2
  27. package/dist/esm/helpers/interaction/index.js +25 -6
  28. package/dist/esm/helpers/radius.js +11 -1
  29. package/dist/esm/helpers/shadow.js +4 -3
  30. package/dist/esm/helpers/third-party/appConfig.js +37 -1
  31. package/dist/esm/helpers/third-party/appSetting.js +144 -1
  32. package/dist/esm/helpers/third-party/constant.js +8 -2
  33. package/dist/esm/helpers/typography.js +5 -2
  34. package/dist/esm/hooks/animation/useAnimationConfig.js +2 -1
  35. package/dist/esm/hooks/animation/useApplyAnimation.js +5 -5
  36. package/dist/esm/index.js +3 -1
  37. package/dist/types/index.d.ts +350 -187
  38. package/package.json +3 -3
@@ -31,7 +31,7 @@ const componentIconList = [
31
31
  const componentUsingAdvanced = [
32
32
  'IconList'
33
33
  ];
34
- const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
34
+ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, largeComponent = [], sizeLargeComponent = 50, ...passProps })=>{
35
35
  const item = builder[uid];
36
36
  const Component = components[item?.tag];
37
37
  if (!Component) {
@@ -70,6 +70,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
70
70
  advanced: item.advanced,
71
71
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
72
72
  pageContext,
73
+ largeComponent,
74
+ sizeLargeComponent,
73
75
  ...passProps,
74
76
  builderAttrs: {
75
77
  ...passProps.builderAttrs
@@ -81,7 +83,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
81
83
  builder,
82
84
  components,
83
85
  customProps,
84
- pageContext
86
+ pageContext,
87
+ largeComponent,
88
+ sizeLargeComponent
85
89
  };
86
90
  }),
87
91
  children: !customRenderChildren.includes(item.tag) ? WrapRenderChildren({
@@ -93,11 +97,13 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
93
97
  components,
94
98
  customProps,
95
99
  parentTag: item.tag,
96
- pageContext
100
+ pageContext,
101
+ largeComponent,
102
+ sizeLargeComponent
97
103
  }))) : ''
98
104
  });
99
105
  }, ()=>{
100
- return Component({
106
+ const liquid = Component({
101
107
  builderProps: {
102
108
  uid,
103
109
  builderData: item
@@ -109,11 +115,20 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
109
115
  isText: componentTexts.includes(item.tag) ? true : null,
110
116
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
111
117
  pageContext,
118
+ largeComponent,
119
+ sizeLargeComponent,
112
120
  ...passProps,
113
121
  builderAttrs: {
114
122
  ...passProps.builderAttrs
115
123
  }
116
124
  });
125
+ if (isLimitSize(liquid, sizeLargeComponent)) {
126
+ largeComponent.push({
127
+ uid: item.uid,
128
+ tag: item.tag
129
+ });
130
+ }
131
+ return liquid;
117
132
  });
118
133
  } else {
119
134
  liquid = template`<div gp-el-wrapper style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
@@ -130,6 +145,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
130
145
  cssClass: item?.advanced?.cssClass
131
146
  },
132
147
  pageContext,
148
+ largeComponent,
149
+ sizeLargeComponent,
133
150
  ...passProps,
134
151
  builderAttrs: {
135
152
  ...passProps.builderAttrs
@@ -141,7 +158,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
141
158
  builder,
142
159
  components,
143
160
  customProps,
144
- pageContext
161
+ pageContext,
162
+ largeComponent,
163
+ sizeLargeComponent
145
164
  };
146
165
  }),
147
166
  children: !customRenderChildren.includes(item.tag) ? WrapRenderChildren({
@@ -153,11 +172,13 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
153
172
  components,
154
173
  customProps,
155
174
  parentTag: item.tag,
156
- pageContext
175
+ pageContext,
176
+ largeComponent,
177
+ sizeLargeComponent
157
178
  }))) : ''
158
179
  });
159
180
  }, ()=>{
160
- return Component({
181
+ const liquid = Component({
161
182
  builderProps: {
162
183
  uid,
163
184
  builderData: item
@@ -175,6 +196,13 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
175
196
  ...passProps.builderAttrs
176
197
  }
177
198
  });
199
+ if (isLimitSize(liquid, sizeLargeComponent)) {
200
+ largeComponent.push({
201
+ uid: item.uid,
202
+ tag: item.tag
203
+ });
204
+ }
205
+ return liquid;
178
206
  })}
179
207
  </div>`;
180
208
  }
@@ -299,5 +327,10 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
299
327
  }
300
328
  return liquid;
301
329
  };
330
+ const isLimitSize = (liquid, size = 50)=>{
331
+ const textEncoder = new TextEncoder();
332
+ const byteSize = textEncoder.encode(liquid).length;
333
+ return byteSize >= size * 1024;
334
+ };
302
335
 
303
336
  export { RenderChildren, WrapRenderChildren, Render as default };
@@ -54,6 +54,14 @@ const createPageStoreProvider = (data)=>createStore((set)=>({
54
54
  selectType
55
55
  }
56
56
  }));
57
+ },
58
+ setInteractionSettingType: (settingType)=>{
59
+ set((state)=>({
60
+ interactionData: {
61
+ ...state.interactionData,
62
+ settingType
63
+ }
64
+ }));
57
65
  }
58
66
  }));
59
67
  const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
@@ -63,7 +71,7 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
63
71
  productOffers,
64
72
  publicStoreFrontData,
65
73
  interactionData: {
66
- selectType: 'element'
74
+ selectType: 'ELEMENT'
67
75
  }
68
76
  }), [
69
77
  dynamicProduct,
@@ -0,0 +1,13 @@
1
+ const PublishedShopMetasDocument = `
2
+ query PublishedShopMetas($keys: [String!]) {
3
+ publishedShopMetas(keys: $keys) {
4
+ id
5
+ createdAt
6
+ updatedAt
7
+ key
8
+ value
9
+ }
10
+ }
11
+ `;
12
+
13
+ export { PublishedShopMetasDocument };
@@ -51,10 +51,16 @@ const animations = ()=>{
51
51
  'left',
52
52
  'right'
53
53
  ].includes(direction ?? '') ? 'X' : 'Y';
54
- const isNeg = [
54
+ let isNeg = [
55
55
  'left',
56
56
  'down'
57
57
  ].includes(direction ?? '') ? '-' : '';
58
+ if (reverse) {
59
+ isNeg = [
60
+ 'left',
61
+ 'down'
62
+ ].includes(direction ?? '') ? '' : '-';
63
+ }
58
64
  const preset = [
59
65
  {
60
66
  opacity: 0,
@@ -124,7 +130,10 @@ const animations = ()=>{
124
130
  opacity: 1
125
131
  }
126
132
  ];
127
- const zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
133
+ let zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
134
+ if (reverse) {
135
+ zoomPreset = zoomDirection === 'in' ? zoomOutPreset : zoomInPreset;
136
+ }
128
137
  return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
129
138
  ...generateOptions(normalizedOptions, 700)
130
139
  });
@@ -11,7 +11,9 @@ const getStyleBackgroundByDevice = (background, options)=>{
11
11
  ...getStyleBgColor(background)
12
12
  } : {},
13
13
  ...!options?.ignoreBackgroundImage ? {
14
- ...getStyleBgImage(background, options),
14
+ ...getStyleBgImage(background, options)
15
+ } : {},
16
+ ...!options?.ignoreBackgroundImageProperties ? {
15
17
  ...getStyleBgPosition(background),
16
18
  ...getStyleBgSize(background),
17
19
  ...getStyleBgRepeat(background)
@@ -72,6 +74,9 @@ const getBgImageByDevice = (background, device, options)=>{
72
74
  if (typeof imageByDevice === 'string') {
73
75
  return `url(${imageByDevice})`;
74
76
  }
77
+ if (imageByDevice !== undefined) {
78
+ return 'none';
79
+ }
75
80
  };
76
81
  const getStyleBgPosition = (background)=>{
77
82
  const bgPosition = {
@@ -203,7 +208,7 @@ const getGradientBgrStyleForButton = (backgroundStyle)=>{
203
208
  });
204
209
  return bgrStyle;
205
210
  };
206
- const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage = false)=>{
211
+ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage)=>{
207
212
  if (!backgroundStyle) return;
208
213
  const bgrStyle = {};
209
214
  [
@@ -211,10 +216,10 @@ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage = fa
211
216
  'tablet',
212
217
  'mobile'
213
218
  ].forEach((device)=>{
214
- if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY)) {
219
+ if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY) && backgroundStyle[device]?.type !== 'video') {
215
220
  Object.assign(bgrStyle, {
216
- [`--bgc${device !== 'desktop' ? '-' + device : ''}`]: 'transparent',
217
- [`--bgi${device !== 'desktop' ? '-' + device : ''}`]: ignoreBackgroundImage ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
221
+ [`--bgc${device !== 'desktop' ? '-' + device : ''}`]: backgroundStyle[device]?.color,
222
+ [`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
218
223
  });
219
224
  }
220
225
  });
@@ -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 { getResonsiveStyleShadow, getStyleShadowState, getStyleShadow } from './shadow.js';
6
+ import { getResponsiveStyleShadow, getStyleShadowState, getStyleShadow } from './shadow.js';
7
7
 
8
8
  const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
9
9
  const { top, left, bottom, right } = spacing;
@@ -100,7 +100,12 @@ function composeAdvanceStyle(data, tag, pageType) {
100
100
  Object.assign(styles, composeRadius(value));
101
101
  }
102
102
  if (attr === 'boxShadow') {
103
- Object.assign(styles, getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
103
+ const hasBoxShadow = {
104
+ desktop: value.desktop ?? false,
105
+ tablet: value.tablet ?? value.desktop ?? false,
106
+ mobile: value.mobile ?? value.tablet ?? value.desktop ?? false
107
+ };
108
+ Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
104
109
  }
105
110
  if (composeAttr === 'desktop') {
106
111
  switch(attr){
@@ -1,6 +1,6 @@
1
+ import { useRef } from 'react';
1
2
  import 'react/jsx-runtime';
2
3
  import 'zustand';
3
- import 'react';
4
4
  import 'swr';
5
5
  import { usePageStore } from '../../contexts/PageContext.js';
6
6
  import '@gem-sdk/adapter-shopify';
@@ -15,9 +15,17 @@ import 'dayjs';
15
15
  import '../convert.js';
16
16
 
17
17
  const useInteraction = ()=>{
18
+ const ref = useRef();
18
19
  const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
19
- const onListener = ({ event, selector }, callback)=>{
20
- const element = document.querySelector(selector);
20
+ function findElementIncludingSelf(element, selector) {
21
+ if (!(element instanceof Document) && element?.matches(selector)) {
22
+ return element;
23
+ } else {
24
+ return element?.querySelector(selector);
25
+ }
26
+ }
27
+ const onListener = ({ event, selector, elementRef }, callback)=>{
28
+ const element = findElementIncludingSelf(elementRef?.current || ref.current || document, selector);
21
29
  if (!element) return;
22
30
  element.addEventListener(event, (e)=>{
23
31
  const event = e;
@@ -25,8 +33,8 @@ const useInteraction = ()=>{
25
33
  if (callback) callback(params);
26
34
  });
27
35
  };
28
- const trigger = ({ event, data, selector })=>{
29
- const element = document.querySelector(selector);
36
+ const trigger = ({ event, data, selector, element: elementParam })=>{
37
+ const element = elementParam || document.querySelector(selector);
30
38
  if (!element) return;
31
39
  const eventDispatch = new CustomEvent(event, {
32
40
  bubbles: false,
@@ -45,6 +53,14 @@ const useInteraction = ()=>{
45
53
  [key]: value
46
54
  }));
47
55
  };
56
+ const getInteractionPreviousData = (element, key)=>{
57
+ const interactionData = element.getAttribute('gp-data-interaction');
58
+ const interactionDataJson = JSON.parse(interactionData || '{}');
59
+ return {
60
+ previousData: interactionDataJson[key],
61
+ interactionDataJson
62
+ };
63
+ };
48
64
  const closeSelectOnPage = ()=>{
49
65
  setInteractionIsSelectOnPage(false);
50
66
  const event = new CustomEvent('editor:interaction:change-select-on-page', {
@@ -57,7 +73,10 @@ const useInteraction = ()=>{
57
73
  onListener,
58
74
  trigger,
59
75
  saveToElementInteractionData,
60
- closeSelectOnPage
76
+ closeSelectOnPage,
77
+ ref,
78
+ findElementIncludingSelf,
79
+ getInteractionPreviousData
61
80
  };
62
81
  };
63
82
 
@@ -25,7 +25,14 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
25
25
  };
26
26
  };
27
27
  const getCustomRadius = (state, radius, device)=>{
28
- if (!radius || !state || radius?.radiusType !== 'custom') return {};
28
+ const list = [
29
+ 'custom',
30
+ 'pill',
31
+ 'rounded',
32
+ 'single',
33
+ 'none'
34
+ ];
35
+ if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
29
36
  const suffix = device && device !== 'desktop' ? devicesMapping?.[device] : '';
30
37
  const mState = stateMapping?.[state];
31
38
  return {
@@ -60,6 +67,7 @@ const composeRadiusState = (radiusValue, device)=>{
60
67
  case 'circle':
61
68
  case 'none':
62
69
  case 'custom':
70
+ case 'rounded':
63
71
  Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
64
72
  break;
65
73
  }
@@ -72,6 +80,7 @@ const composeRadiusState = (radiusValue, device)=>{
72
80
  case 'circle':
73
81
  case 'none':
74
82
  case 'custom':
83
+ case 'rounded':
75
84
  Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
76
85
  break;
77
86
  }
@@ -84,6 +93,7 @@ const composeRadiusState = (radiusValue, device)=>{
84
93
  case 'circle':
85
94
  case 'none':
86
95
  case 'custom':
96
+ case 'rounded':
87
97
  Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
88
98
  break;
89
99
  }
@@ -24,8 +24,9 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
24
24
  if (!styleAppliedFor || !value) return {};
25
25
  if (typeof value.distance == 'undefined') return {};
26
26
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
27
+ const isNoneValue = value.type === 'none';
27
28
  return {
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
+ [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow && !isNoneValue ? `${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
30
  };
30
31
  };
31
32
  const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
@@ -42,7 +43,7 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
42
43
  }
43
44
  return style;
44
45
  };
45
- const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
46
+ const getResponsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
46
47
  if (!value) return undefined;
47
48
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
48
49
  return {
@@ -60,4 +61,4 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
60
61
  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};`;
61
62
  };
62
63
 
63
- export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit };
64
+ export { composeShadowCss, getResponsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit };
@@ -112,5 +112,41 @@ const YotpoReviewsV3UgcConfig = {
112
112
  appId: 'eb7dfd7d-db44-4334-bc49-c893b51b36cf'
113
113
  }
114
114
  };
115
+ const WhatmoreShoppableVideosreelConfig = {
116
+ WhatmoreShoppableVideosreel: {
117
+ appName: 'whatmore-shoppable-videos',
118
+ appId: '20db8a72-315a-4364-8885-64219ee48303'
119
+ }
120
+ };
121
+ const ProductOptionsCustomizerConfig = {
122
+ ProductOptionsCustomizer: {
123
+ appName: 'product-options-customizer',
124
+ appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
125
+ }
126
+ };
127
+ const AppointmentBookingCowlendarConfig = {
128
+ AppointmentBookingCowlendar: {
129
+ appName: 'cowlendar-booking',
130
+ appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
131
+ }
132
+ };
133
+ const SproutPlantTreesGrowSalesConfig = {
134
+ SproutPlantTreesGrowSales: {
135
+ appName: 'sprout-plant-trees',
136
+ appId: '7db5ee24-2195-4099-b98e-1547c600e4aa'
137
+ }
138
+ };
139
+ const InstasellShoppableInstagramConfig = {
140
+ InstasellShoppableInstagram: {
141
+ appName: 'instasell-instagram-gallery',
142
+ appId: '38d643ac-410a-4b2c-a727-6125ff08e444'
143
+ }
144
+ };
145
+ const BoldSubscriptionsConfig = {
146
+ BoldSubscriptions: {
147
+ appName: 'bold-subscriptions',
148
+ appId: '9ceb49f0-5fe5-4b5e-943d-f8af8985167d'
149
+ }
150
+ };
115
151
 
116
- export { BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, YotpoReviewsV3UgcConfig };
152
+ export { AppointmentBookingCowlendarConfig, BoldSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, InstasellShoppableInstagramConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, ProductOptionsCustomizerConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SproutPlantTreesGrowSalesConfig, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, WhatmoreShoppableVideosreelConfig, YotpoReviewsV3UgcConfig };
@@ -93,6 +93,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
93
93
  selected_product: appSetting?.['productHandle'] || '{{ product }}'
94
94
  };
95
95
  }
96
+ case 'WhatmoreShoppableVideosreel':
97
+ {
98
+ return {
99
+ ...currentSetting,
100
+ ['show-views']: appSetting?.showViews
101
+ };
102
+ }
96
103
  default:
97
104
  return currentSetting;
98
105
  }
@@ -212,7 +219,142 @@ const YotpoReviews = {
212
219
  }
213
220
  }
214
221
  };
222
+ const WhatmoreShoppableVideosreel = {
223
+ WhatmoreShoppableVideosreel: {
224
+ 'app-block': {
225
+ heading: 'Watch and Buy',
226
+ 'template-type': 'template-f',
227
+ 'show-views': 'show',
228
+ 'ui-theme': 'round',
229
+ 'color-primary': '#343434',
230
+ 'color-secondary': '#343434',
231
+ 'title-font': 'poppins_n4',
232
+ 'primary-font': 'poppins_n4',
233
+ 'title-font-size': 40,
234
+ 'title-font-size-portrait': 24,
235
+ 'landscape-padding': 40,
236
+ 'top-bottom-padding': 20,
237
+ 'scroll-video-tile-size': 80,
238
+ 'scroll-video-tile-size-portrait': 80,
239
+ 'min-height': 380
240
+ },
241
+ 'app-block-banner': {
242
+ 'template-type': 'template-banner-a',
243
+ 'ui-theme': 'round',
244
+ 'banner-video-tile-size': 80
245
+ },
246
+ 'app-block-collections': {
247
+ collectionHeading: 'W',
248
+ 'template-type': 'template-collections-b',
249
+ 'ui-theme': 'round',
250
+ 'color-secondary': '#343434',
251
+ 'primary-font': 'poppins_n4',
252
+ 'tile-size': 60,
253
+ 'tile-size-portrait': 60,
254
+ 'min-height': 250
255
+ },
256
+ 'app-block-stories': {
257
+ 'template-type': 'template-stories-a',
258
+ 'ui-theme': 'round',
259
+ 'color-primary': '#343434',
260
+ 'color-secondary': '#343434',
261
+ 'primary-font': 'poppins_n4',
262
+ 'stories-top-bottom-padding': 0,
263
+ 'story-tile-size': 40,
264
+ 'story-tile-size-desktop': 40
265
+ }
266
+ }
267
+ };
268
+ const ProductOptionsCustomizer = {
269
+ ProductOptionsCustomizer: {
270
+ 'product-page-customizer': {
271
+ pc_container_size: 100,
272
+ pc_show_options_total: 'initial',
273
+ pc_customizations_total_text: 'Customizations Total:',
274
+ pc_show_preloader: 'hide',
275
+ pc_preloader_color: '',
276
+ pc_ignore_redirect_command: true,
277
+ pc_basic_label_text_color: '#000000',
278
+ pc_basic_label_font_size: 14,
279
+ pc_basic_label_bolden: 'unset',
280
+ pc_basic_label_space_above: 0,
281
+ pc_basic_option_background_color: '#FFFFFF',
282
+ pc_basic_option_text_color: '#000000',
283
+ pc_basic_option_border_color: '#000000',
284
+ pc_basic_option_border_style: 'solid',
285
+ pc_basic_option_border_width: 1,
286
+ pc_basic_option_curve_the_corners: 'none',
287
+ pc_basic_option_font_size: 14,
288
+ pc_basic_option_bolden: 'none',
289
+ pc_basic_option_width: 100,
290
+ pc_basic_option_space_above: 0,
291
+ pc_basic_option_space_below: 0,
292
+ pc_basic_option_space_inside: 10,
293
+ pc_advanced_custom_css: '',
294
+ pc_advanced_custom_js: '',
295
+ pc_show_image_swatch_preview: false
296
+ }
297
+ }
298
+ };
299
+ const AppointmentBookingCowlendar = {
300
+ AppointmentBookingCowlendar: {
301
+ 'app-section': {
302
+ section_title: 'Services list',
303
+ section_type: 'services-list'
304
+ }
305
+ }
306
+ };
307
+ const SproutPlantTreesGrowSales = {
308
+ SproutPlantTreesGrowSales: {
309
+ badge: null,
310
+ 'impact-banner': null
311
+ }
312
+ };
313
+ const InstasellShoppableInstagram = {
314
+ InstasellShoppableInstagram: {
315
+ 'app-block': {
316
+ heading: 'InstaSell: Instagram Gallery+',
317
+ description: 'Showcase your Instagram Feed on your Shopify Storefront'
318
+ }
319
+ }
320
+ };
321
+ const BoldSubscriptions = {
322
+ BoldSubscriptions: {
323
+ 'bsub-widget-block': {
324
+ default_subscribe: true,
325
+ primary_color: '#3b63ff',
326
+ secondary_color: '#7dba63',
327
+ background_color: '#f8f9f9',
328
+ border_radius: 4,
329
+ header_text: 'Purchase Options',
330
+ one_time_text: 'One-time Purchase',
331
+ recurring_text: 'Subscribe and Save',
332
+ prepaid_recurring_text: 'Prepaid Subscribe and Save',
333
+ discount_summary_text: '(Save {discount})',
334
+ discount_summary_plural_text: '(Save up to {discount})',
335
+ frequency_header: 'Delivery Frequency',
336
+ frequency_text: 'delivery',
337
+ prepaid_checkbox_label_text: 'Prepay for subscription',
338
+ billing_frequency_header: 'Billing Frequency',
339
+ billing_frequency_text: '{count} Orders',
340
+ delivery_frequency_discount_text: '({discount} off)',
341
+ billing_frequency_discount_text: '({discount} off)',
342
+ prepaid_total_text: 'Billed {price} today',
343
+ prepaid_continue_as_prepaid_text: 'Prepaid order will auto-renew after {count} orders',
344
+ prepaid_continue_as_standard_text: 'Becomes a regular subscription after {count} orders',
345
+ convertible_header: 'Converts to',
346
+ eligible_for_subscription_header: 'Eligible for Subscription',
347
+ initial_dynamic_discount_text: 'Save {initial_percent_discount}% ({initial_fixed_discount})',
348
+ subsequent_dynamic_discounts_text: '{subsequent_percent_discount}% ({subsequent_fixed_discount}) after {order_count} order(s)'
349
+ }
350
+ }
351
+ };
215
352
  const composeSettingsByWidgetType = {
353
+ ...InstasellShoppableInstagram,
354
+ ...SproutPlantTreesGrowSales,
355
+ ...AppointmentBookingCowlendar,
356
+ ...ProductOptionsCustomizer,
357
+ ...WhatmoreShoppableVideosreel,
216
358
  ...JunipProductReviewsUgc,
217
359
  ...FlyBundlesUpsellsFbt,
218
360
  ...PreorderNowWodPresale,
@@ -231,7 +373,8 @@ const composeSettingsByWidgetType = {
231
373
  ...LoyaltyRewardsReferrals,
232
374
  ...SubifySubscriptions,
233
375
  ...SelleasyWidget,
234
- ...YotpoReviews
376
+ ...YotpoReviews,
377
+ ...BoldSubscriptions
235
378
  };
236
379
 
237
380
  export { composeSettingsByWidgetType, overrideSettings };
@@ -1,4 +1,4 @@
1
- import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig } from './appConfig.js';
1
+ import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig, WhatmoreShoppableVideosreelConfig, ProductOptionsCustomizerConfig, AppointmentBookingCowlendarConfig, SproutPlantTreesGrowSalesConfig, InstasellShoppableInstagramConfig, BoldSubscriptionsConfig } from './appConfig.js';
2
2
 
3
3
  const mapShopifyAppMeta = {
4
4
  ...RechargeSubscriptionsConfig,
@@ -19,7 +19,13 @@ const mapShopifyAppMeta = {
19
19
  ...FlyBundlesUpsellsFbtConfig,
20
20
  ...JunipProductReviewsUgcConfig,
21
21
  ...PreorderNowWodPresaleConfig,
22
- ...YotpoReviewsV3UgcConfig
22
+ ...YotpoReviewsV3UgcConfig,
23
+ ...WhatmoreShoppableVideosreelConfig,
24
+ ...ProductOptionsCustomizerConfig,
25
+ ...AppointmentBookingCowlendarConfig,
26
+ ...SproutPlantTreesGrowSalesConfig,
27
+ ...InstasellShoppableInstagramConfig,
28
+ ...BoldSubscriptionsConfig
23
29
  };
24
30
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
25
31
 
@@ -82,7 +82,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
82
82
  if (typeof fontFamily === 'string') {
83
83
  return getFontUsedByTypographyV2({
84
84
  fontFamily,
85
- fallbackFontFamily: value?.fallbackFontFamily
85
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
86
86
  });
87
87
  }
88
88
  if (typeof fontFamily === 'object' && typeof fontFamily?.value === 'string') {
@@ -92,12 +92,15 @@ const composeFontFamilyTypographyV2 = (value)=>{
92
92
  default:
93
93
  return getFontUsedByTypographyV2({
94
94
  fontFamily: fontFamily.value,
95
- fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
95
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
96
96
  });
97
97
  }
98
98
  }
99
99
  return;
100
100
  };
101
+ const getFallbackFontFamily = (fallbackFontFamilyDefault, type)=>{
102
+ return fallbackFontFamilyDefault || composeFallbackTypographyStyle(type ?? 'heading');
103
+ };
101
104
  const getFontUsedByTypographyV2 = ({ fontFamily, fallbackFontFamily })=>{
102
105
  if (fontFamily) {
103
106
  return `var(--g-font-${fontFamily?.replace(/ /g, '-')}, '${fontFamily}'), ${fallbackFontFamily}`;
@@ -12,7 +12,8 @@ const useAnimationConfig = (props)=>{
12
12
  const { animation, setting } = triggerConfig[trigger];
13
13
  return {
14
14
  type: animation,
15
- setting: setting[animation]
15
+ setting: setting[animation],
16
+ reverse: trigger === "hidden"
16
17
  };
17
18
  }, [
18
19
  configByDevices