@gem-sdk/core 1.53.0-dev.18 → 1.53.0-dev.186

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/ComponentToolbarPreview.js +58 -4
  2. package/dist/cjs/components/InteractionSuffix.js +19 -92
  3. package/dist/cjs/components/Render.liquid.js +40 -7
  4. package/dist/cjs/contexts/PageContext.js +19 -4
  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 +15 -1
  9. package/dist/cjs/helpers/interaction/index.js +45 -6
  10. package/dist/cjs/helpers/radius.js +11 -1
  11. package/dist/cjs/helpers/shadow.js +5 -4
  12. package/dist/cjs/helpers/third-party/appConfig.js +49 -0
  13. package/dist/cjs/helpers/third-party/appSetting.js +150 -35
  14. package/dist/cjs/helpers/third-party/constant.js +8 -1
  15. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +8 -1
  16. package/dist/cjs/helpers/typography.js +5 -2
  17. package/dist/cjs/hooks/animation/useAnimationConfig.js +3 -2
  18. package/dist/cjs/hooks/animation/useApplyAnimation.js +5 -5
  19. package/dist/cjs/index.js +5 -1
  20. package/dist/esm/components/ComponentToolbarPreview.js +58 -4
  21. package/dist/esm/components/InteractionSuffix.js +20 -93
  22. package/dist/esm/components/Render.liquid.js +40 -7
  23. package/dist/esm/contexts/PageContext.js +19 -4
  24. package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
  25. package/dist/esm/helpers/animations.js +11 -2
  26. package/dist/esm/helpers/background.js +10 -5
  27. package/dist/esm/helpers/compose-advance-style.js +16 -2
  28. package/dist/esm/helpers/interaction/index.js +45 -6
  29. package/dist/esm/helpers/radius.js +11 -1
  30. package/dist/esm/helpers/shadow.js +5 -4
  31. package/dist/esm/helpers/third-party/appConfig.js +43 -1
  32. package/dist/esm/helpers/third-party/appSetting.js +150 -35
  33. package/dist/esm/helpers/third-party/constant.js +9 -2
  34. package/dist/esm/helpers/third-party/getAppBlockConfig.js +8 -1
  35. package/dist/esm/helpers/typography.js +5 -2
  36. package/dist/esm/hooks/animation/useAnimationConfig.js +3 -2
  37. package/dist/esm/hooks/animation/useApplyAnimation.js +5 -5
  38. package/dist/esm/index.js +3 -1
  39. package/dist/types/index.d.ts +371 -192
  40. package/package.json +3 -3
@@ -72,6 +72,13 @@ const ShopifyForms = {
72
72
  }
73
73
  }
74
74
  };
75
+ const KachingBundles = {
76
+ KachingBundles: {
77
+ 'app-block': {
78
+ product: '{{product}}'
79
+ }
80
+ }
81
+ };
75
82
  const overrideSettings = (tag, currentSetting, appSetting)=>{
76
83
  switch(tag){
77
84
  case 'ShopifyForms':
@@ -93,6 +100,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
93
100
  selected_product: appSetting?.['productHandle'] || '{{ product }}'
94
101
  };
95
102
  }
103
+ case 'WhatmoreShoppableVideosreel':
104
+ {
105
+ return {
106
+ ...currentSetting,
107
+ ['show-views']: appSetting?.showViews
108
+ };
109
+ }
96
110
  default:
97
111
  return currentSetting;
98
112
  }
@@ -215,50 +229,148 @@ const YotpoReviews = {
215
229
  const WhatmoreShoppableVideosreel = {
216
230
  WhatmoreShoppableVideosreel: {
217
231
  'app-block': {
218
- "heading": "Watch and Buy",
219
- "template-type": "template-f",
220
- "show-views": "show",
221
- "ui-theme": "round",
222
- "color-primary": "#343434",
223
- "color-secondary": "#343434",
224
- "title-font": "poppins_n4",
225
- "primary-font": "poppins_n4",
226
- "title-font-size": 40,
227
- "title-font-size-portrait": 24,
228
- "landscape-padding": 40,
229
- "top-bottom-padding": 20,
230
- "scroll-video-tile-size": 80,
231
- "scroll-video-tile-size-portrait": 80,
232
- "min-height": 380
232
+ heading: 'Watch and Buy',
233
+ 'template-type': 'template-f',
234
+ 'show-views': 'show',
235
+ 'ui-theme': 'round',
236
+ 'color-primary': '#343434',
237
+ 'color-secondary': '#343434',
238
+ 'title-font': 'poppins_n4',
239
+ 'primary-font': 'poppins_n4',
240
+ 'title-font-size': 40,
241
+ 'title-font-size-portrait': 24,
242
+ 'landscape-padding': 40,
243
+ 'top-bottom-padding': 20,
244
+ 'scroll-video-tile-size': 80,
245
+ 'scroll-video-tile-size-portrait': 80,
246
+ 'min-height': 380
233
247
  },
234
248
  'app-block-banner': {
235
- "template-type": "template-banner-a",
236
- "ui-theme": "round",
237
- "banner-video-tile-size": 80
249
+ 'template-type': 'template-banner-a',
250
+ 'ui-theme': 'round',
251
+ 'banner-video-tile-size': 80
238
252
  },
239
253
  'app-block-collections': {
240
- "collectionHeading": "W",
241
- "template-type": "template-collections-b",
242
- "ui-theme": "round",
243
- "color-secondary": "#343434",
244
- "primary-font": "poppins_n4",
245
- "tile-size": 60,
246
- "tile-size-portrait": 60,
247
- "min-height": 250
254
+ collectionHeading: 'W',
255
+ 'template-type': 'template-collections-b',
256
+ 'ui-theme': 'round',
257
+ 'color-secondary': '#343434',
258
+ 'primary-font': 'poppins_n4',
259
+ 'tile-size': 60,
260
+ 'tile-size-portrait': 60,
261
+ 'min-height': 250
248
262
  },
249
263
  'app-block-stories': {
250
- "template-type": "template-stories-a",
251
- "ui-theme": "round",
252
- "color-primary": "#343434",
253
- "color-secondary": "#343434",
254
- "primary-font": "poppins_n4",
255
- "stories-top-bottom-padding": 0,
256
- "story-tile-size": 40,
257
- "story-tile-size-desktop": 40
264
+ 'template-type': 'template-stories-a',
265
+ 'ui-theme': 'round',
266
+ 'color-primary': '#343434',
267
+ 'color-secondary': '#343434',
268
+ 'primary-font': 'poppins_n4',
269
+ 'stories-top-bottom-padding': 0,
270
+ 'story-tile-size': 40,
271
+ 'story-tile-size-desktop': 40
272
+ }
273
+ }
274
+ };
275
+ const ProductOptionsCustomizer = {
276
+ ProductOptionsCustomizer: {
277
+ 'product-page-customizer': {
278
+ pc_container_size: 100,
279
+ pc_show_options_total: 'initial',
280
+ pc_customizations_total_text: 'Customizations Total:',
281
+ pc_show_preloader: 'hide',
282
+ pc_preloader_color: '',
283
+ pc_ignore_redirect_command: true,
284
+ pc_basic_label_text_color: '#000000',
285
+ pc_basic_label_font_size: 14,
286
+ pc_basic_label_bolden: 'unset',
287
+ pc_basic_label_space_above: 0,
288
+ pc_basic_option_background_color: '#FFFFFF',
289
+ pc_basic_option_text_color: '#000000',
290
+ pc_basic_option_border_color: '#000000',
291
+ pc_basic_option_border_style: 'solid',
292
+ pc_basic_option_border_width: 1,
293
+ pc_basic_option_curve_the_corners: 'none',
294
+ pc_basic_option_font_size: 14,
295
+ pc_basic_option_bolden: 'none',
296
+ pc_basic_option_width: 100,
297
+ pc_basic_option_space_above: 0,
298
+ pc_basic_option_space_below: 0,
299
+ pc_basic_option_space_inside: 10,
300
+ pc_advanced_custom_css: '',
301
+ pc_advanced_custom_js: '',
302
+ pc_show_image_swatch_preview: false
303
+ }
304
+ }
305
+ };
306
+ const AppointmentBookingCowlendar = {
307
+ AppointmentBookingCowlendar: {
308
+ 'app-section': {
309
+ section_title: 'Services list',
310
+ section_type: 'services-list'
311
+ }
312
+ }
313
+ };
314
+ const SproutPlantTreesGrowSales = {
315
+ SproutPlantTreesGrowSales: {
316
+ badge: null,
317
+ 'impact-banner': null
318
+ }
319
+ };
320
+ const InstasellShoppableInstagram = {
321
+ InstasellShoppableInstagram: {
322
+ 'app-block': {
323
+ heading: 'InstaSell: Instagram Gallery+',
324
+ description: 'Showcase your Instagram Feed on your Shopify Storefront'
325
+ }
326
+ }
327
+ };
328
+ const BoldSubscriptions = {
329
+ BoldSubscriptions: {
330
+ 'bsub-widget-block': {
331
+ default_subscribe: true,
332
+ primary_color: '#3b63ff',
333
+ secondary_color: '#7dba63',
334
+ background_color: '#f8f9f9',
335
+ border_radius: 4,
336
+ header_text: 'Purchase Options',
337
+ one_time_text: 'One-time Purchase',
338
+ recurring_text: 'Subscribe and Save',
339
+ prepaid_recurring_text: 'Prepaid Subscribe and Save',
340
+ discount_summary_text: '(Save {discount})',
341
+ discount_summary_plural_text: '(Save up to {discount})',
342
+ frequency_header: 'Delivery Frequency',
343
+ frequency_text: 'delivery',
344
+ prepaid_checkbox_label_text: 'Prepay for subscription',
345
+ billing_frequency_header: 'Billing Frequency',
346
+ billing_frequency_text: '{count} Orders',
347
+ delivery_frequency_discount_text: '({discount} off)',
348
+ billing_frequency_discount_text: '({discount} off)',
349
+ prepaid_total_text: 'Billed {price} today',
350
+ prepaid_continue_as_prepaid_text: 'Prepaid order will auto-renew after {count} orders',
351
+ prepaid_continue_as_standard_text: 'Becomes a regular subscription after {count} orders',
352
+ convertible_header: 'Converts to',
353
+ eligible_for_subscription_header: 'Eligible for Subscription',
354
+ initial_dynamic_discount_text: 'Save {initial_percent_discount}% ({initial_fixed_discount})',
355
+ subsequent_dynamic_discounts_text: '{subsequent_percent_discount}% ({subsequent_fixed_discount}) after {order_count} order(s)'
258
356
  }
259
357
  }
260
358
  };
359
+ const Growave = {
360
+ Growave: {
361
+ 'block.product.faveButton': {
362
+ option_button_class: ''
363
+ },
364
+ 'block.product.reviewWidget': null,
365
+ 'block.product.reviewAvgProfile': null,
366
+ 'v2.product.reviewsMiniSlider': null
367
+ }
368
+ };
261
369
  const composeSettingsByWidgetType = {
370
+ ...InstasellShoppableInstagram,
371
+ ...SproutPlantTreesGrowSales,
372
+ ...AppointmentBookingCowlendar,
373
+ ...ProductOptionsCustomizer,
262
374
  ...WhatmoreShoppableVideosreel,
263
375
  ...JunipProductReviewsUgc,
264
376
  ...FlyBundlesUpsellsFbt,
@@ -278,7 +390,10 @@ const composeSettingsByWidgetType = {
278
390
  ...LoyaltyRewardsReferrals,
279
391
  ...SubifySubscriptions,
280
392
  ...SelleasyWidget,
281
- ...YotpoReviews
393
+ ...YotpoReviews,
394
+ ...BoldSubscriptions,
395
+ ...Growave,
396
+ ...KachingBundles
282
397
  };
283
398
 
284
399
  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, WhatmoreShoppableVideosreelConfig } 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, GrowaveConfig, KachingBundlesConfig } from './appConfig.js';
2
2
 
3
3
  const mapShopifyAppMeta = {
4
4
  ...RechargeSubscriptionsConfig,
@@ -20,7 +20,14 @@ const mapShopifyAppMeta = {
20
20
  ...JunipProductReviewsUgcConfig,
21
21
  ...PreorderNowWodPresaleConfig,
22
22
  ...YotpoReviewsV3UgcConfig,
23
- ...WhatmoreShoppableVideosreelConfig
23
+ ...WhatmoreShoppableVideosreelConfig,
24
+ ...ProductOptionsCustomizerConfig,
25
+ ...AppointmentBookingCowlendarConfig,
26
+ ...SproutPlantTreesGrowSalesConfig,
27
+ ...InstasellShoppableInstagramConfig,
28
+ ...BoldSubscriptionsConfig,
29
+ ...GrowaveConfig,
30
+ ...KachingBundlesConfig
24
31
  };
25
32
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
26
33
 
@@ -1,10 +1,17 @@
1
1
  import { composeSettingsByWidgetType, overrideSettings } from './appSetting.js';
2
2
  import { getAppBlockType } from './getAppBlockType.js';
3
3
 
4
+ const listAppUpdateNewVersion = [
5
+ 'Growave'
6
+ ];
4
7
  const getAppBlockConfig = (tag, appBlockId, settings)=>{
8
+ let widgetType = settings?.widgetType;
9
+ if (listAppUpdateNewVersion.includes(tag)) {
10
+ widgetType = settings?.widgetTypeV2;
11
+ }
5
12
  const appBlockType = getAppBlockType({
6
13
  tag,
7
- widgetType: settings?.widgetType
14
+ widgetType
8
15
  });
9
16
  const settingByWidget = composeSettingsByWidgetType[tag][settings?.widgetType];
10
17
  const appSettings = overrideSettings(tag, settingByWidget, settings);
@@ -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}`;
@@ -9,10 +9,11 @@ const useAnimationConfig = (props)=>{
9
9
  ]);
10
10
  const getAnimationConfig = useCallback(()=>{
11
11
  const { trigger, triggerConfig } = configByDevices;
12
- const { animation, setting } = triggerConfig[trigger];
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
@@ -21,13 +21,13 @@ const useApplyAnimation = ({ props })=>{
21
21
  setAnimationOnFinish,
22
22
  setToolbarActive
23
23
  });
24
- const generateAnimation = useCallback(({ target, setting, type })=>{
25
- return animation[type](target, setting);
24
+ const generateAnimation = useCallback(({ target, setting, type, reverse })=>{
25
+ return animation[type](target, setting, reverse);
26
26
  }, [
27
27
  animation
28
28
  ]);
29
29
  const initListAnimations = useCallback(()=>{
30
- const { type, setting } = getAnimationConfig();
30
+ const { type, setting, reverse } = getAnimationConfig();
31
31
  if (!type || type === AnimationType.None || !targetObjects.current.length) {
32
32
  cancelAnimation();
33
33
  return;
@@ -35,9 +35,9 @@ const useApplyAnimation = ({ props })=>{
35
35
  const listAnimations = targetObjects.current.map((item)=>generateAnimation({
36
36
  type,
37
37
  setting,
38
- target: item.target
38
+ target: item.target,
39
+ reverse
39
40
  }));
40
- console.log('listAnimations', listAnimations);
41
41
  cancelAnimation();
42
42
  setAnimation(listAnimations);
43
43
  }, [
package/dist/esm/index.js CHANGED
@@ -17,6 +17,7 @@ export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
17
17
  export { ArticleListProvider, useArticleListStore } from './contexts/ArticleListContext.js';
18
18
  export { ArticleProvider, useArticleStore } from './contexts/ArticleContext.js';
19
19
  export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
20
+ export { PublishedShopMetasDocument } from './graphql/queries/published-shop-metas.js';
20
21
  export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
21
22
  export { CollectionDocument } from './graphql/queries/collection.generated.js';
22
23
  export { CollectionsDocument } from './graphql/queries/collections.generated.js';
@@ -63,11 +64,12 @@ export { isDefined } from './helpers/is-defined.js';
63
64
  export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
64
65
  export { makeAspectRatio, makeGlobalSizeHeightResponsive, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveByScreen, makeStyleResponsiveState, makeStyleState, makeWidth, removeNullUndefined } from './helpers/make-style.js';
65
66
  export { convertTextAlignToJustify } from './helpers/align.js';
67
+ export { checkInStock } from './helpers/variant.js';
66
68
  export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption } from './helpers/product.js';
67
69
  export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
68
70
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
69
71
  export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
70
- export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
72
+ export { composeShadowCss, getResponsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
71
73
  export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
72
74
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
73
75
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';