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

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 +13 -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 +14 -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 +361 -189
  40. package/package.json +3 -3
@@ -24,10 +24,11 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
24
24
  let { state } = shadowStyle || {};
25
25
  if (!state) state = 'normal';
26
26
  if (!styleAppliedFor || !value) return {};
27
- if (typeof value.distance == 'undefined') return {};
27
+ const isNoneValue = value.type === 'none';
28
+ if (typeof value.distance == 'undefined' && !isNoneValue) return {};
28
29
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
29
30
  return {
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
+ [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.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 + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
31
32
  };
32
33
  };
33
34
  const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
@@ -44,7 +45,7 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
44
45
  }
45
46
  return style;
46
47
  };
47
- const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
48
+ const getResponsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
48
49
  if (!value) return undefined;
49
50
  if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
50
51
  return {
@@ -63,7 +64,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
63
64
  };
64
65
 
65
66
  exports.composeShadowCss = composeShadowCss;
66
- exports.getResonsiveStyleShadow = getResonsiveStyleShadow;
67
+ exports.getResponsiveStyleShadow = getResponsiveStyleShadow;
67
68
  exports.getStyleShadow = getStyleShadow;
68
69
  exports.getStyleShadowState = getStyleShadowState;
69
70
  exports.parseValueWithUnit = parseValueWithUnit;
@@ -120,16 +120,64 @@ const WhatmoreShoppableVideosreelConfig = {
120
120
  appId: '20db8a72-315a-4364-8885-64219ee48303'
121
121
  }
122
122
  };
123
+ const ProductOptionsCustomizerConfig = {
124
+ ProductOptionsCustomizer: {
125
+ appName: 'product-options-customizer',
126
+ appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
127
+ }
128
+ };
129
+ const AppointmentBookingCowlendarConfig = {
130
+ AppointmentBookingCowlendar: {
131
+ appName: 'cowlendar-booking',
132
+ appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
133
+ }
134
+ };
135
+ const SproutPlantTreesGrowSalesConfig = {
136
+ SproutPlantTreesGrowSales: {
137
+ appName: 'sprout-plant-trees',
138
+ appId: '7db5ee24-2195-4099-b98e-1547c600e4aa'
139
+ }
140
+ };
141
+ const InstasellShoppableInstagramConfig = {
142
+ InstasellShoppableInstagram: {
143
+ appName: 'instasell-instagram-gallery',
144
+ appId: '38d643ac-410a-4b2c-a727-6125ff08e444'
145
+ }
146
+ };
147
+ const BoldSubscriptionsConfig = {
148
+ BoldSubscriptions: {
149
+ appName: 'bold-subscriptions',
150
+ appId: '9ceb49f0-5fe5-4b5e-943d-f8af8985167d'
151
+ }
152
+ };
153
+ const GrowaveConfig = {
154
+ Growave: {
155
+ appName: 'growave-loyalty-wishlist',
156
+ appId: 'b3d2efbe-110a-4e27-84a8-1f2ed63996a4'
157
+ }
158
+ };
159
+ const KachingBundlesConfig = {
160
+ KachingBundles: {
161
+ appName: 'kaching-bundles',
162
+ appId: '6c637362-a106-4a32-94ac-94dcfd68cdb8'
163
+ }
164
+ };
123
165
 
166
+ exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
167
+ exports.BoldSubscriptionsConfig = BoldSubscriptionsConfig;
124
168
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
125
169
  exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
126
170
  exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
127
171
  exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
172
+ exports.GrowaveConfig = GrowaveConfig;
173
+ exports.InstasellShoppableInstagramConfig = InstasellShoppableInstagramConfig;
128
174
  exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
175
+ exports.KachingBundlesConfig = KachingBundlesConfig;
129
176
  exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
130
177
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
131
178
  exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
132
179
  exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
180
+ exports.ProductOptionsCustomizerConfig = ProductOptionsCustomizerConfig;
133
181
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
134
182
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
135
183
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
@@ -137,6 +185,7 @@ exports.SelleasyConfig = SelleasyConfig;
137
185
  exports.ShopifyFormsConfig = ShopifyFormsConfig;
138
186
  exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
139
187
  exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
188
+ exports.SproutPlantTreesGrowSalesConfig = SproutPlantTreesGrowSalesConfig;
140
189
  exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
141
190
  exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
142
191
  exports.WhatmoreShoppableVideosreelConfig = WhatmoreShoppableVideosreelConfig;
@@ -74,6 +74,13 @@ const ShopifyForms = {
74
74
  }
75
75
  }
76
76
  };
77
+ const KachingBundles = {
78
+ KachingBundles: {
79
+ 'app-block': {
80
+ product: '{{product}}'
81
+ }
82
+ }
83
+ };
77
84
  const overrideSettings = (tag, currentSetting, appSetting)=>{
78
85
  switch(tag){
79
86
  case 'ShopifyForms':
@@ -95,6 +102,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
95
102
  selected_product: appSetting?.['productHandle'] || '{{ product }}'
96
103
  };
97
104
  }
105
+ case 'WhatmoreShoppableVideosreel':
106
+ {
107
+ return {
108
+ ...currentSetting,
109
+ ['show-views']: appSetting?.showViews
110
+ };
111
+ }
98
112
  default:
99
113
  return currentSetting;
100
114
  }
@@ -217,50 +231,148 @@ const YotpoReviews = {
217
231
  const WhatmoreShoppableVideosreel = {
218
232
  WhatmoreShoppableVideosreel: {
219
233
  'app-block': {
220
- "heading": "Watch and Buy",
221
- "template-type": "template-f",
222
- "show-views": "show",
223
- "ui-theme": "round",
224
- "color-primary": "#343434",
225
- "color-secondary": "#343434",
226
- "title-font": "poppins_n4",
227
- "primary-font": "poppins_n4",
228
- "title-font-size": 40,
229
- "title-font-size-portrait": 24,
230
- "landscape-padding": 40,
231
- "top-bottom-padding": 20,
232
- "scroll-video-tile-size": 80,
233
- "scroll-video-tile-size-portrait": 80,
234
- "min-height": 380
234
+ heading: 'Watch and Buy',
235
+ 'template-type': 'template-f',
236
+ 'show-views': 'show',
237
+ 'ui-theme': 'round',
238
+ 'color-primary': '#343434',
239
+ 'color-secondary': '#343434',
240
+ 'title-font': 'poppins_n4',
241
+ 'primary-font': 'poppins_n4',
242
+ 'title-font-size': 40,
243
+ 'title-font-size-portrait': 24,
244
+ 'landscape-padding': 40,
245
+ 'top-bottom-padding': 20,
246
+ 'scroll-video-tile-size': 80,
247
+ 'scroll-video-tile-size-portrait': 80,
248
+ 'min-height': 380
235
249
  },
236
250
  'app-block-banner': {
237
- "template-type": "template-banner-a",
238
- "ui-theme": "round",
239
- "banner-video-tile-size": 80
251
+ 'template-type': 'template-banner-a',
252
+ 'ui-theme': 'round',
253
+ 'banner-video-tile-size': 80
240
254
  },
241
255
  'app-block-collections': {
242
- "collectionHeading": "W",
243
- "template-type": "template-collections-b",
244
- "ui-theme": "round",
245
- "color-secondary": "#343434",
246
- "primary-font": "poppins_n4",
247
- "tile-size": 60,
248
- "tile-size-portrait": 60,
249
- "min-height": 250
256
+ collectionHeading: 'W',
257
+ 'template-type': 'template-collections-b',
258
+ 'ui-theme': 'round',
259
+ 'color-secondary': '#343434',
260
+ 'primary-font': 'poppins_n4',
261
+ 'tile-size': 60,
262
+ 'tile-size-portrait': 60,
263
+ 'min-height': 250
250
264
  },
251
265
  'app-block-stories': {
252
- "template-type": "template-stories-a",
253
- "ui-theme": "round",
254
- "color-primary": "#343434",
255
- "color-secondary": "#343434",
256
- "primary-font": "poppins_n4",
257
- "stories-top-bottom-padding": 0,
258
- "story-tile-size": 40,
259
- "story-tile-size-desktop": 40
266
+ 'template-type': 'template-stories-a',
267
+ 'ui-theme': 'round',
268
+ 'color-primary': '#343434',
269
+ 'color-secondary': '#343434',
270
+ 'primary-font': 'poppins_n4',
271
+ 'stories-top-bottom-padding': 0,
272
+ 'story-tile-size': 40,
273
+ 'story-tile-size-desktop': 40
274
+ }
275
+ }
276
+ };
277
+ const ProductOptionsCustomizer = {
278
+ ProductOptionsCustomizer: {
279
+ 'product-page-customizer': {
280
+ pc_container_size: 100,
281
+ pc_show_options_total: 'initial',
282
+ pc_customizations_total_text: 'Customizations Total:',
283
+ pc_show_preloader: 'hide',
284
+ pc_preloader_color: '',
285
+ pc_ignore_redirect_command: true,
286
+ pc_basic_label_text_color: '#000000',
287
+ pc_basic_label_font_size: 14,
288
+ pc_basic_label_bolden: 'unset',
289
+ pc_basic_label_space_above: 0,
290
+ pc_basic_option_background_color: '#FFFFFF',
291
+ pc_basic_option_text_color: '#000000',
292
+ pc_basic_option_border_color: '#000000',
293
+ pc_basic_option_border_style: 'solid',
294
+ pc_basic_option_border_width: 1,
295
+ pc_basic_option_curve_the_corners: 'none',
296
+ pc_basic_option_font_size: 14,
297
+ pc_basic_option_bolden: 'none',
298
+ pc_basic_option_width: 100,
299
+ pc_basic_option_space_above: 0,
300
+ pc_basic_option_space_below: 0,
301
+ pc_basic_option_space_inside: 10,
302
+ pc_advanced_custom_css: '',
303
+ pc_advanced_custom_js: '',
304
+ pc_show_image_swatch_preview: false
305
+ }
306
+ }
307
+ };
308
+ const AppointmentBookingCowlendar = {
309
+ AppointmentBookingCowlendar: {
310
+ 'app-section': {
311
+ section_title: 'Services list',
312
+ section_type: 'services-list'
313
+ }
314
+ }
315
+ };
316
+ const SproutPlantTreesGrowSales = {
317
+ SproutPlantTreesGrowSales: {
318
+ badge: null,
319
+ 'impact-banner': null
320
+ }
321
+ };
322
+ const InstasellShoppableInstagram = {
323
+ InstasellShoppableInstagram: {
324
+ 'app-block': {
325
+ heading: 'InstaSell: Instagram Gallery+',
326
+ description: 'Showcase your Instagram Feed on your Shopify Storefront'
327
+ }
328
+ }
329
+ };
330
+ const BoldSubscriptions = {
331
+ BoldSubscriptions: {
332
+ 'bsub-widget-block': {
333
+ default_subscribe: true,
334
+ primary_color: '#3b63ff',
335
+ secondary_color: '#7dba63',
336
+ background_color: '#f8f9f9',
337
+ border_radius: 4,
338
+ header_text: 'Purchase Options',
339
+ one_time_text: 'One-time Purchase',
340
+ recurring_text: 'Subscribe and Save',
341
+ prepaid_recurring_text: 'Prepaid Subscribe and Save',
342
+ discount_summary_text: '(Save {discount})',
343
+ discount_summary_plural_text: '(Save up to {discount})',
344
+ frequency_header: 'Delivery Frequency',
345
+ frequency_text: 'delivery',
346
+ prepaid_checkbox_label_text: 'Prepay for subscription',
347
+ billing_frequency_header: 'Billing Frequency',
348
+ billing_frequency_text: '{count} Orders',
349
+ delivery_frequency_discount_text: '({discount} off)',
350
+ billing_frequency_discount_text: '({discount} off)',
351
+ prepaid_total_text: 'Billed {price} today',
352
+ prepaid_continue_as_prepaid_text: 'Prepaid order will auto-renew after {count} orders',
353
+ prepaid_continue_as_standard_text: 'Becomes a regular subscription after {count} orders',
354
+ convertible_header: 'Converts to',
355
+ eligible_for_subscription_header: 'Eligible for Subscription',
356
+ initial_dynamic_discount_text: 'Save {initial_percent_discount}% ({initial_fixed_discount})',
357
+ subsequent_dynamic_discounts_text: '{subsequent_percent_discount}% ({subsequent_fixed_discount}) after {order_count} order(s)'
260
358
  }
261
359
  }
262
360
  };
361
+ const Growave = {
362
+ Growave: {
363
+ 'block.product.faveButton': {
364
+ option_button_class: ''
365
+ },
366
+ 'block.product.reviewWidget': null,
367
+ 'block.product.reviewAvgProfile': null,
368
+ 'v2.product.reviewsMiniSlider': null
369
+ }
370
+ };
263
371
  const composeSettingsByWidgetType = {
372
+ ...InstasellShoppableInstagram,
373
+ ...SproutPlantTreesGrowSales,
374
+ ...AppointmentBookingCowlendar,
375
+ ...ProductOptionsCustomizer,
264
376
  ...WhatmoreShoppableVideosreel,
265
377
  ...JunipProductReviewsUgc,
266
378
  ...FlyBundlesUpsellsFbt,
@@ -280,7 +392,10 @@ const composeSettingsByWidgetType = {
280
392
  ...LoyaltyRewardsReferrals,
281
393
  ...SubifySubscriptions,
282
394
  ...SelleasyWidget,
283
- ...YotpoReviews
395
+ ...YotpoReviews,
396
+ ...BoldSubscriptions,
397
+ ...Growave,
398
+ ...KachingBundles
284
399
  };
285
400
 
286
401
  exports.composeSettingsByWidgetType = composeSettingsByWidgetType;
@@ -22,7 +22,14 @@ const mapShopifyAppMeta = {
22
22
  ...appConfig.JunipProductReviewsUgcConfig,
23
23
  ...appConfig.PreorderNowWodPresaleConfig,
24
24
  ...appConfig.YotpoReviewsV3UgcConfig,
25
- ...appConfig.WhatmoreShoppableVideosreelConfig
25
+ ...appConfig.WhatmoreShoppableVideosreelConfig,
26
+ ...appConfig.ProductOptionsCustomizerConfig,
27
+ ...appConfig.AppointmentBookingCowlendarConfig,
28
+ ...appConfig.SproutPlantTreesGrowSalesConfig,
29
+ ...appConfig.InstasellShoppableInstagramConfig,
30
+ ...appConfig.BoldSubscriptionsConfig,
31
+ ...appConfig.GrowaveConfig,
32
+ ...appConfig.KachingBundlesConfig
26
33
  };
27
34
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
28
35
 
@@ -3,10 +3,17 @@
3
3
  var appSetting = require('./appSetting.js');
4
4
  var getAppBlockType = require('./getAppBlockType.js');
5
5
 
6
+ const listAppUpdateNewVersion = [
7
+ 'Growave'
8
+ ];
6
9
  const getAppBlockConfig = (tag, appBlockId, settings)=>{
10
+ let widgetType = settings?.widgetType;
11
+ if (listAppUpdateNewVersion.includes(tag)) {
12
+ widgetType = settings?.widgetTypeV2;
13
+ }
7
14
  const appBlockType = getAppBlockType.getAppBlockType({
8
15
  tag,
9
- widgetType: settings?.widgetType
16
+ widgetType
10
17
  });
11
18
  const settingByWidget = appSetting.composeSettingsByWidgetType[tag][settings?.widgetType];
12
19
  const appSettings = appSetting.overrideSettings(tag, settingByWidget, settings);
@@ -84,7 +84,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
84
84
  if (typeof fontFamily === 'string') {
85
85
  return getFontUsedByTypographyV2({
86
86
  fontFamily,
87
- fallbackFontFamily: value?.fallbackFontFamily
87
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
88
88
  });
89
89
  }
90
90
  if (typeof fontFamily === 'object' && typeof fontFamily?.value === 'string') {
@@ -94,12 +94,15 @@ const composeFontFamilyTypographyV2 = (value)=>{
94
94
  default:
95
95
  return getFontUsedByTypographyV2({
96
96
  fontFamily: fontFamily.value,
97
- fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
97
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
98
98
  });
99
99
  }
100
100
  }
101
101
  return;
102
102
  };
103
+ const getFallbackFontFamily = (fallbackFontFamilyDefault, type)=>{
104
+ return fallbackFontFamilyDefault || composeFallbackTypographyStyle(type ?? 'heading');
105
+ };
103
106
  const getFontUsedByTypographyV2 = ({ fontFamily, fallbackFontFamily })=>{
104
107
  if (fontFamily) {
105
108
  return `var(--g-font-${fontFamily?.replace(/ /g, '-')}, '${fontFamily}'), ${fallbackFontFamily}`;
@@ -11,10 +11,11 @@ const useAnimationConfig = (props)=>{
11
11
  ]);
12
12
  const getAnimationConfig = react.useCallback(()=>{
13
13
  const { trigger, triggerConfig } = configByDevices;
14
- const { animation, setting } = triggerConfig[trigger];
14
+ const { animation, setting } = triggerConfig?.[trigger] ?? {};
15
15
  return {
16
16
  type: animation,
17
- setting: setting[animation]
17
+ setting: setting?.[animation],
18
+ reverse: trigger === "hidden"
18
19
  };
19
20
  }, [
20
21
  configByDevices
@@ -25,13 +25,13 @@ const useApplyAnimation = ({ props })=>{
25
25
  setAnimationOnFinish,
26
26
  setToolbarActive
27
27
  });
28
- const generateAnimation = react.useCallback(({ target, setting, type })=>{
29
- return animation[type](target, setting);
28
+ const generateAnimation = react.useCallback(({ target, setting, type, reverse })=>{
29
+ return animation[type](target, setting, reverse);
30
30
  }, [
31
31
  animation
32
32
  ]);
33
33
  const initListAnimations = react.useCallback(()=>{
34
- const { type, setting } = getAnimationConfig();
34
+ const { type, setting, reverse } = getAnimationConfig();
35
35
  if (!type || type === animations.AnimationType.None || !targetObjects.current.length) {
36
36
  cancelAnimation();
37
37
  return;
@@ -39,9 +39,9 @@ const useApplyAnimation = ({ props })=>{
39
39
  const listAnimations = targetObjects.current.map((item)=>generateAnimation({
40
40
  type,
41
41
  setting,
42
- target: item.target
42
+ target: item.target,
43
+ reverse
43
44
  }));
44
- console.log('listAnimations', listAnimations);
45
45
  cancelAnimation();
46
46
  setAnimation(listAnimations);
47
47
  }, [
package/dist/cjs/index.js CHANGED
@@ -19,6 +19,7 @@ var ModalContext = require('./contexts/ModalContext.js');
19
19
  var ArticleListContext = require('./contexts/ArticleListContext.js');
20
20
  var ArticleContext = require('./contexts/ArticleContext.js');
21
21
  var pageViewUp_generated = require('./graphql/mutations/page-view-up.generated.js');
22
+ var publishedShopMetas = require('./graphql/queries/published-shop-metas.js');
22
23
  var collectionDetailFilter_generated = require('./graphql/queries/collection-detail-filter.generated.js');
23
24
  var collection_generated = require('./graphql/queries/collection.generated.js');
24
25
  var collections_generated = require('./graphql/queries/collections.generated.js');
@@ -62,6 +63,7 @@ var isDefined = require('./helpers/is-defined.js');
62
63
  var layout = require('./helpers/layout.js');
63
64
  var makeStyle = require('./helpers/make-style.js');
64
65
  var align = require('./helpers/align.js');
66
+ var variant = require('./helpers/variant.js');
65
67
  var product = require('./helpers/product.js');
66
68
  var query = require('./helpers/query.js');
67
69
  var radius = require('./helpers/radius.js');
@@ -150,6 +152,7 @@ exports.useArticleListStore = ArticleListContext.useArticleListStore;
150
152
  exports.ArticleProvider = ArticleContext.ArticleProvider;
151
153
  exports.useArticleStore = ArticleContext.useArticleStore;
152
154
  exports.PageViewUpDocument = pageViewUp_generated.PageViewUpDocument;
155
+ exports.PublishedShopMetasDocument = publishedShopMetas.PublishedShopMetasDocument;
153
156
  exports.CollectionDetailFilterDocument = collectionDetailFilter_generated.CollectionDetailFilterDocument;
154
157
  exports.CollectionDocument = collection_generated.CollectionDocument;
155
158
  exports.CollectionsDocument = collections_generated.CollectionsDocument;
@@ -249,6 +252,7 @@ exports.makeStyleState = makeStyle.makeStyleState;
249
252
  exports.makeWidth = makeStyle.makeWidth;
250
253
  exports.removeNullUndefined = makeStyle.removeNullUndefined;
251
254
  exports.convertTextAlignToJustify = align.convertTextAlignToJustify;
255
+ exports.checkInStock = variant.checkInStock;
252
256
  exports.checkAvailableVariantInStock = product.checkAvailableVariantInStock;
253
257
  exports.getSelectedVariant = product.getSelectedVariant;
254
258
  exports.parseSelectedOption = product.parseSelectedOption;
@@ -270,7 +274,7 @@ exports.removeUndefinedValuesFromObject = render.removeUndefinedValuesFromObject
270
274
  exports.styles = render.styles;
271
275
  exports.template = render.template;
272
276
  exports.composeShadowCss = shadow.composeShadowCss;
273
- exports.getResonsiveStyleShadow = shadow.getResonsiveStyleShadow;
277
+ exports.getResponsiveStyleShadow = shadow.getResponsiveStyleShadow;
274
278
  exports.getStyleShadow = shadow.getStyleShadow;
275
279
  exports.getStyleShadowState = shadow.getStyleShadowState;
276
280
  exports.parseValueWithUnit = shadow.parseValueWithUnit;
@@ -56,7 +56,31 @@ const ComponentToolbarPreview = (props)=>{
56
56
  editingPageType
57
57
  ]);
58
58
  const isSelectOnPage = useMemo(()=>interactionData?.isSelectOnPage, [
59
- interactionData
59
+ interactionData?.isSelectOnPage
60
+ ]);
61
+ const settingType = useMemo(()=>interactionData?.settingType, [
62
+ interactionData?.settingType
63
+ ]);
64
+ const isShowIconInteractionTarget = useMemo(()=>{
65
+ return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
66
+ }, [
67
+ interactionData?.item?.targets,
68
+ props.uid,
69
+ settingType
70
+ ]);
71
+ const isShowIconInteractionTrigger = useMemo(()=>{
72
+ return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
73
+ }, [
74
+ interactionData?.item?.self?.type,
75
+ interactionData?.item?.self?.uid,
76
+ props.uid,
77
+ settingType
78
+ ]);
79
+ const isDisplayIconDrag = useMemo(()=>{
80
+ return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
81
+ }, [
82
+ isShowIconInteractionTarget,
83
+ isShowIconInteractionTrigger
60
84
  ]);
61
85
  const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = usePostPurchase(props.uid, props.tag || '');
62
86
  const editProductElementList = [
@@ -334,7 +358,6 @@ const ComponentToolbarPreview = (props)=>{
334
358
  if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
335
359
  return ableGenerateContentElements.includes(tag);
336
360
  };
337
- // if (!isActive) return null;
338
361
  return /*#__PURE__*/ jsxs(Fragment, {
339
362
  children: [
340
363
  !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxs("div", {
@@ -349,7 +372,39 @@ const ComponentToolbarPreview = (props)=>{
349
372
  onClick: (e)=>onShowParent(e),
350
373
  "aria-hidden": "true",
351
374
  children: [
352
- /*#__PURE__*/ jsx("div", {
375
+ isShowIconInteractionTrigger && /*#__PURE__*/ jsx("div", {
376
+ className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
377
+ children: /*#__PURE__*/ jsx("svg", {
378
+ width: "12",
379
+ height: "13",
380
+ viewBox: "0 0 12 13",
381
+ fill: "none",
382
+ xmlns: "http://www.w3.org/2000/svg",
383
+ children: /*#__PURE__*/ jsx("path", {
384
+ "fill-rule": "evenodd",
385
+ "clip-rule": "evenodd",
386
+ d: "M4.36799 0.430523C4.51596 0.205675 4.76709 0.0703125 5.03626 0.0703125H9.88576C10.2042 0.0703125 10.395 0.424378 10.2198 0.69034L8.36968 3.4992C8.28209 3.63218 8.37747 3.80922 8.53671 3.80922H10.749C11.1111 3.80922 11.2869 4.25204 11.0233 4.50036L3.03971 12.0217C2.7572 12.2878 2.29932 12.0361 2.37262 11.655L3.27994 6.93698C3.30366 6.81364 3.20915 6.69921 3.08354 6.69921H0.984651C0.66625 6.69921 0.475479 6.34529 0.650515 6.07932L4.36799 0.430523Z",
387
+ fill: "#F9F9F9"
388
+ })
389
+ })
390
+ }),
391
+ isShowIconInteractionTarget && /*#__PURE__*/ jsx("div", {
392
+ className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
393
+ children: /*#__PURE__*/ jsx("svg", {
394
+ width: "16",
395
+ height: "16",
396
+ viewBox: "0 0 16 16",
397
+ fill: "none",
398
+ xmlns: "http://www.w3.org/2000/svg",
399
+ children: /*#__PURE__*/ jsx("path", {
400
+ "fill-rule": "evenodd",
401
+ "clip-rule": "evenodd",
402
+ d: "M7.32785 3.66159C7.87459 3.58351 8.25451 3.077 8.17643 2.53026C8.09836 1.98353 7.59184 1.6036 7.0451 1.68168C3.92866 2.12673 1.5332 4.80488 1.5332 8.04424C1.5332 11.594 4.41085 14.4716 7.9606 14.4716C11.1706 14.4716 13.8294 12.1194 14.3105 9.04446C14.3959 8.49881 14.0227 7.98727 13.4771 7.9019C12.9314 7.81654 12.4199 8.18967 12.3345 8.73531C12.0034 10.852 10.1702 12.4716 7.9606 12.4716C5.51541 12.4716 3.5332 10.4894 3.5332 8.04424C3.5332 5.81431 5.18273 3.96793 7.32785 3.66159ZM10.3432 1.97548C10.6232 1.69551 11.102 1.83654 11.1855 2.22355L11.6106 4.19339C11.6313 4.28936 11.7063 4.36432 11.8023 4.38503L13.7721 4.81013C14.1591 4.89365 14.3001 5.37247 14.0202 5.65243L12.3432 7.32945C12.1244 7.54819 11.8168 7.65338 11.5099 7.61436L10.1528 7.44178C9.84592 7.40276 9.53827 7.50795 9.31953 7.72669L8.66719 8.37903C8.35477 8.69145 7.86633 8.70954 7.57623 8.41943C7.28613 8.12933 7.30421 7.64089 7.61663 7.32847L8.26898 6.67613C8.48771 6.45739 8.5929 6.14974 8.55388 5.84287L8.38131 4.48575C8.34228 4.17888 8.44748 3.87123 8.66621 3.6525L10.3432 1.97548ZM8.19853 5.1916C8.35319 5.72179 8.04877 6.27697 7.51858 6.43163C6.83078 6.63226 6.32988 7.2683 6.32988 8.01873C6.32988 8.9316 7.06991 9.67164 7.98279 9.67164C8.73014 9.67164 9.36406 9.17486 9.56743 8.49131C9.72492 7.96195 10.2817 7.6605 10.8111 7.81799C11.3404 7.97548 11.6419 8.53227 11.4844 9.06163C11.0356 10.57 9.63916 11.6716 7.98279 11.6716C5.96535 11.6716 4.32988 10.0362 4.32988 8.01873C4.32988 6.35558 5.44054 4.95445 6.95851 4.51165C7.4887 4.35699 8.04387 4.66141 8.19853 5.1916Z",
403
+ fill: "#F9F9F9"
404
+ })
405
+ })
406
+ }),
407
+ isDisplayIconDrag && /*#__PURE__*/ jsx("div", {
353
408
  "data-toolbar-icon-drag": true,
354
409
  children: /*#__PURE__*/ jsxs("svg", {
355
410
  width: "16",
@@ -606,7 +661,6 @@ const ComponentToolbarPreview = (props)=>{
606
661
  ]
607
662
  }),
608
663
  /*#__PURE__*/ jsx(InteractionSuffix, {
609
- tag: props.tag,
610
664
  uid: props.uid
611
665
  })
612
666
  ]