@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
@@ -114,16 +114,56 @@ const YotpoReviewsV3UgcConfig = {
114
114
  appId: 'eb7dfd7d-db44-4334-bc49-c893b51b36cf'
115
115
  }
116
116
  };
117
+ const WhatmoreShoppableVideosreelConfig = {
118
+ WhatmoreShoppableVideosreel: {
119
+ appName: 'whatmore-shoppable-videos',
120
+ appId: '20db8a72-315a-4364-8885-64219ee48303'
121
+ }
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
+ };
117
153
 
154
+ exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
155
+ exports.BoldSubscriptionsConfig = BoldSubscriptionsConfig;
118
156
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
119
157
  exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
120
158
  exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
121
159
  exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
160
+ exports.InstasellShoppableInstagramConfig = InstasellShoppableInstagramConfig;
122
161
  exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
123
162
  exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
124
163
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
125
164
  exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
126
165
  exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
166
+ exports.ProductOptionsCustomizerConfig = ProductOptionsCustomizerConfig;
127
167
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
128
168
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
129
169
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
@@ -131,6 +171,8 @@ exports.SelleasyConfig = SelleasyConfig;
131
171
  exports.ShopifyFormsConfig = ShopifyFormsConfig;
132
172
  exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
133
173
  exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
174
+ exports.SproutPlantTreesGrowSalesConfig = SproutPlantTreesGrowSalesConfig;
134
175
  exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
135
176
  exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
177
+ exports.WhatmoreShoppableVideosreelConfig = WhatmoreShoppableVideosreelConfig;
136
178
  exports.YotpoReviewsV3UgcConfig = YotpoReviewsV3UgcConfig;
@@ -95,6 +95,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
95
95
  selected_product: appSetting?.['productHandle'] || '{{ product }}'
96
96
  };
97
97
  }
98
+ case 'WhatmoreShoppableVideosreel':
99
+ {
100
+ return {
101
+ ...currentSetting,
102
+ ['show-views']: appSetting?.showViews
103
+ };
104
+ }
98
105
  default:
99
106
  return currentSetting;
100
107
  }
@@ -214,7 +221,142 @@ const YotpoReviews = {
214
221
  }
215
222
  }
216
223
  };
224
+ const WhatmoreShoppableVideosreel = {
225
+ WhatmoreShoppableVideosreel: {
226
+ 'app-block': {
227
+ heading: 'Watch and Buy',
228
+ 'template-type': 'template-f',
229
+ 'show-views': 'show',
230
+ 'ui-theme': 'round',
231
+ 'color-primary': '#343434',
232
+ 'color-secondary': '#343434',
233
+ 'title-font': 'poppins_n4',
234
+ 'primary-font': 'poppins_n4',
235
+ 'title-font-size': 40,
236
+ 'title-font-size-portrait': 24,
237
+ 'landscape-padding': 40,
238
+ 'top-bottom-padding': 20,
239
+ 'scroll-video-tile-size': 80,
240
+ 'scroll-video-tile-size-portrait': 80,
241
+ 'min-height': 380
242
+ },
243
+ 'app-block-banner': {
244
+ 'template-type': 'template-banner-a',
245
+ 'ui-theme': 'round',
246
+ 'banner-video-tile-size': 80
247
+ },
248
+ 'app-block-collections': {
249
+ collectionHeading: 'W',
250
+ 'template-type': 'template-collections-b',
251
+ 'ui-theme': 'round',
252
+ 'color-secondary': '#343434',
253
+ 'primary-font': 'poppins_n4',
254
+ 'tile-size': 60,
255
+ 'tile-size-portrait': 60,
256
+ 'min-height': 250
257
+ },
258
+ 'app-block-stories': {
259
+ 'template-type': 'template-stories-a',
260
+ 'ui-theme': 'round',
261
+ 'color-primary': '#343434',
262
+ 'color-secondary': '#343434',
263
+ 'primary-font': 'poppins_n4',
264
+ 'stories-top-bottom-padding': 0,
265
+ 'story-tile-size': 40,
266
+ 'story-tile-size-desktop': 40
267
+ }
268
+ }
269
+ };
270
+ const ProductOptionsCustomizer = {
271
+ ProductOptionsCustomizer: {
272
+ 'product-page-customizer': {
273
+ pc_container_size: 100,
274
+ pc_show_options_total: 'initial',
275
+ pc_customizations_total_text: 'Customizations Total:',
276
+ pc_show_preloader: 'hide',
277
+ pc_preloader_color: '',
278
+ pc_ignore_redirect_command: true,
279
+ pc_basic_label_text_color: '#000000',
280
+ pc_basic_label_font_size: 14,
281
+ pc_basic_label_bolden: 'unset',
282
+ pc_basic_label_space_above: 0,
283
+ pc_basic_option_background_color: '#FFFFFF',
284
+ pc_basic_option_text_color: '#000000',
285
+ pc_basic_option_border_color: '#000000',
286
+ pc_basic_option_border_style: 'solid',
287
+ pc_basic_option_border_width: 1,
288
+ pc_basic_option_curve_the_corners: 'none',
289
+ pc_basic_option_font_size: 14,
290
+ pc_basic_option_bolden: 'none',
291
+ pc_basic_option_width: 100,
292
+ pc_basic_option_space_above: 0,
293
+ pc_basic_option_space_below: 0,
294
+ pc_basic_option_space_inside: 10,
295
+ pc_advanced_custom_css: '',
296
+ pc_advanced_custom_js: '',
297
+ pc_show_image_swatch_preview: false
298
+ }
299
+ }
300
+ };
301
+ const AppointmentBookingCowlendar = {
302
+ AppointmentBookingCowlendar: {
303
+ 'app-section': {
304
+ section_title: 'Services list',
305
+ section_type: 'services-list'
306
+ }
307
+ }
308
+ };
309
+ const SproutPlantTreesGrowSales = {
310
+ SproutPlantTreesGrowSales: {
311
+ badge: null,
312
+ 'impact-banner': null
313
+ }
314
+ };
315
+ const InstasellShoppableInstagram = {
316
+ InstasellShoppableInstagram: {
317
+ 'app-block': {
318
+ heading: 'InstaSell: Instagram Gallery+',
319
+ description: 'Showcase your Instagram Feed on your Shopify Storefront'
320
+ }
321
+ }
322
+ };
323
+ const BoldSubscriptions = {
324
+ BoldSubscriptions: {
325
+ 'bsub-widget-block': {
326
+ default_subscribe: true,
327
+ primary_color: '#3b63ff',
328
+ secondary_color: '#7dba63',
329
+ background_color: '#f8f9f9',
330
+ border_radius: 4,
331
+ header_text: 'Purchase Options',
332
+ one_time_text: 'One-time Purchase',
333
+ recurring_text: 'Subscribe and Save',
334
+ prepaid_recurring_text: 'Prepaid Subscribe and Save',
335
+ discount_summary_text: '(Save {discount})',
336
+ discount_summary_plural_text: '(Save up to {discount})',
337
+ frequency_header: 'Delivery Frequency',
338
+ frequency_text: 'delivery',
339
+ prepaid_checkbox_label_text: 'Prepay for subscription',
340
+ billing_frequency_header: 'Billing Frequency',
341
+ billing_frequency_text: '{count} Orders',
342
+ delivery_frequency_discount_text: '({discount} off)',
343
+ billing_frequency_discount_text: '({discount} off)',
344
+ prepaid_total_text: 'Billed {price} today',
345
+ prepaid_continue_as_prepaid_text: 'Prepaid order will auto-renew after {count} orders',
346
+ prepaid_continue_as_standard_text: 'Becomes a regular subscription after {count} orders',
347
+ convertible_header: 'Converts to',
348
+ eligible_for_subscription_header: 'Eligible for Subscription',
349
+ initial_dynamic_discount_text: 'Save {initial_percent_discount}% ({initial_fixed_discount})',
350
+ subsequent_dynamic_discounts_text: '{subsequent_percent_discount}% ({subsequent_fixed_discount}) after {order_count} order(s)'
351
+ }
352
+ }
353
+ };
217
354
  const composeSettingsByWidgetType = {
355
+ ...InstasellShoppableInstagram,
356
+ ...SproutPlantTreesGrowSales,
357
+ ...AppointmentBookingCowlendar,
358
+ ...ProductOptionsCustomizer,
359
+ ...WhatmoreShoppableVideosreel,
218
360
  ...JunipProductReviewsUgc,
219
361
  ...FlyBundlesUpsellsFbt,
220
362
  ...PreorderNowWodPresale,
@@ -233,7 +375,8 @@ const composeSettingsByWidgetType = {
233
375
  ...LoyaltyRewardsReferrals,
234
376
  ...SubifySubscriptions,
235
377
  ...SelleasyWidget,
236
- ...YotpoReviews
378
+ ...YotpoReviews,
379
+ ...BoldSubscriptions
237
380
  };
238
381
 
239
382
  exports.composeSettingsByWidgetType = composeSettingsByWidgetType;
@@ -21,7 +21,13 @@ const mapShopifyAppMeta = {
21
21
  ...appConfig.FlyBundlesUpsellsFbtConfig,
22
22
  ...appConfig.JunipProductReviewsUgcConfig,
23
23
  ...appConfig.PreorderNowWodPresaleConfig,
24
- ...appConfig.YotpoReviewsV3UgcConfig
24
+ ...appConfig.YotpoReviewsV3UgcConfig,
25
+ ...appConfig.WhatmoreShoppableVideosreelConfig,
26
+ ...appConfig.ProductOptionsCustomizerConfig,
27
+ ...appConfig.AppointmentBookingCowlendarConfig,
28
+ ...appConfig.SproutPlantTreesGrowSalesConfig,
29
+ ...appConfig.InstasellShoppableInstagramConfig,
30
+ ...appConfig.BoldSubscriptionsConfig
25
31
  };
26
32
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
27
33
 
@@ -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}`;
@@ -14,7 +14,8 @@ const useAnimationConfig = (props)=>{
14
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",
@@ -1,6 +1,6 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { useMemo } from 'react';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
2
  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,98 +15,17 @@ import 'dayjs';
15
15
  import { useInteraction } from '../helpers/interaction/index.js';
16
16
  import '../helpers/convert.js';
17
17
 
18
- const InteractionSuffix = ({ tag, uid })=>{
18
+ const InteractionSuffix = ()=>{
19
19
  const { closeSelectOnPage } = useInteraction();
20
- const currentInteraction = usePageStore((s)=>s.interactionData?.item);
20
+ const settingType = usePageStore((s)=>s.interactionData?.settingType);
21
21
  const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
22
- const isCurrentInteractionTarget = useMemo(()=>{
23
- return currentInteraction?.targets?.find((t)=>t.uid === uid && !t.isEntirePage);
24
- }, [
25
- currentInteraction,
26
- uid
27
- ]);
28
- const isCurrentInteractionTrigger = useMemo(()=>{
29
- return currentInteraction?.self?.uid === uid && !currentInteraction?.self?.isEntirePage;
30
- }, [
31
- currentInteraction,
32
- uid
33
- ]);
34
- const isDisplay = useMemo(()=>{
35
- return isCurrentInteractionTarget || isCurrentInteractionTrigger;
36
- }, [
37
- isCurrentInteractionTarget,
38
- isCurrentInteractionTrigger
39
- ]);
40
- const positionOffset = useMemo(()=>{
41
- if (isCurrentInteractionTrigger && isCurrentInteractionTarget) {
42
- return 80;
43
- }
44
- return 40;
45
- }, [
46
- isCurrentInteractionTrigger,
47
- isCurrentInteractionTarget
48
- ]);
49
- if (!isDisplay) {
50
- return /*#__PURE__*/ jsx(Fragment, {});
51
- }
52
- return /*#__PURE__*/ jsxs(Fragment, {
53
- children: [
54
- isSelectOnPage && /*#__PURE__*/ jsx("button", {
55
- 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",
56
- onClick: closeSelectOnPage,
57
- children: "Use element"
58
- }),
59
- /*#__PURE__*/ jsx("div", {
60
- className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
61
- }),
62
- /*#__PURE__*/ jsxs("div", {
63
- className: `gp-hidden gp-absolute interaction-suffix gp-gap-[8px] ${tag == 'Section' ? `gp-left-[-${positionOffset}px]` : `gp-right-[-${positionOffset}px]`}`,
64
- children: [
65
- isCurrentInteractionTrigger && /*#__PURE__*/ jsx("div", {
66
- className: `gp-h-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center `,
67
- children: /*#__PURE__*/ jsx("svg", {
68
- width: "16",
69
- height: "16",
70
- viewBox: "0 0 16 16",
71
- fill: "none",
72
- xmlns: "http://www.w3.org/2000/svg",
73
- children: /*#__PURE__*/ jsx("path", {
74
- fillRule: "evenodd",
75
- clipRule: "evenodd",
76
- d: "M12.9196 5.80449C13.0989 5.80449 13.1876 6.02216 13.0595 6.14749L4.83569 14.1892C4.69517 14.3267 4.46149 14.2002 4.49967 14.0074L5.50422 8.93537C5.53483 8.7808 5.41656 8.6368 5.25898 8.6368H3.08019C2.92551 8.6368 2.82938 8.46874 2.90779 8.33541L6.72099 1.85154C6.75692 1.79045 6.8225 1.75293 6.89338 1.75293H12.5729C12.7386 1.75293 12.8324 1.94273 12.7319 2.07435L10.1891 5.40272C10.0634 5.56724 10.1807 5.80449 10.3877 5.80449H12.9196Z",
77
- fill: "#F9F9F9"
78
- })
79
- })
80
- }),
81
- isCurrentInteractionTarget && /*#__PURE__*/ jsx("div", {
82
- className: `gp-h-8 min-w-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center`,
83
- children: /*#__PURE__*/ jsxs("svg", {
84
- width: "16",
85
- height: "16",
86
- viewBox: "0 0 16 16",
87
- fill: "none",
88
- xmlns: "http://www.w3.org/2000/svg",
89
- children: [
90
- /*#__PURE__*/ jsx("path", {
91
- d: "M8.58987 2.11238C8.62815 2.66333 8.21254 3.141 7.66158 3.17928C6.73192 3.24386 5.84034 3.57396 5.09276 4.13034C4.34519 4.68673 3.77304 5.44602 3.44429 6.31801C3.11554 7.19 3.04401 8.13803 3.23821 9.04947C3.4324 9.96092 3.88415 10.7975 4.53978 11.4597C5.19541 12.122 6.02737 12.5821 6.93682 12.7854C7.84626 12.9888 8.79496 12.9268 9.67021 12.6068C10.5455 12.2869 11.3105 11.7224 11.8743 10.9804C12.4382 10.2385 12.7772 9.35025 12.8512 8.42129C12.895 7.87074 13.3768 7.45996 13.9273 7.50377C14.4779 7.54758 14.8887 8.0294 14.8449 8.57994C14.7406 9.8906 14.2622 11.1438 13.4667 12.1906C12.6711 13.2374 11.5918 14.0338 10.3569 14.4852C9.12204 14.9367 7.78353 15.0241 6.50041 14.7373C5.2173 14.4504 4.0435 13.8012 3.11848 12.8668C2.19345 11.9324 1.55609 10.7522 1.28211 9.46624C1.00813 8.1803 1.10905 6.84274 1.57287 5.61247C2.03669 4.3822 2.84393 3.31093 3.89867 2.52593C4.95342 1.74093 6.21133 1.27521 7.52297 1.18409C8.07393 1.14581 8.5516 1.56142 8.58987 2.11238Z",
92
- fill: "#F9F9F9"
93
- }),
94
- /*#__PURE__*/ jsx("path", {
95
- fillRule: "evenodd",
96
- clipRule: "evenodd",
97
- d: "M11.9757 1.25658C12.184 1.31428 12.3452 1.47958 12.3976 1.68929L12.7872 3.24774L14.3457 3.63736C14.5554 3.68978 14.7207 3.85096 14.7784 4.05928C14.8361 4.2676 14.7773 4.49085 14.6244 4.64371L12.7167 6.55141C12.5677 6.70044 12.3514 6.76035 12.1469 6.70924L10.5688 6.3147L8.42436 8.45912C8.19005 8.69344 7.81015 8.69344 7.57583 8.45912C7.34152 8.22481 7.34152 7.84491 7.57583 7.61059L9.72025 5.46617L9.32572 3.88804C9.2746 3.68357 9.33451 3.46728 9.48354 3.31825L11.3912 1.41054C11.5441 1.25769 11.7674 1.19888 11.9757 1.25658ZM10.8795 5.15545L12.1084 5.46267L13.0266 4.54451L12.1469 4.3246C11.9319 4.27086 11.7641 4.10301 11.7104 3.88804L11.4904 3.0084L10.5723 3.92656L10.8795 5.15545Z",
98
- fill: "#F9F9F9"
99
- }),
100
- /*#__PURE__*/ jsx("path", {
101
- d: "M7.35783 6.45343C7.87208 6.25201 8.12568 5.67185 7.92426 5.15761C7.72284 4.64336 7.14268 4.38976 6.62844 4.59118C6.05705 4.81498 5.55049 5.17772 5.15453 5.64655C4.75858 6.11538 4.4857 6.67552 4.36055 7.27631C4.23539 7.87709 4.26189 8.49961 4.43764 9.08758C4.6134 9.67555 4.93289 10.2105 5.36727 10.6439C5.80165 11.0774 6.33722 11.3958 6.92556 11.5702C7.51391 11.7445 8.13643 11.7695 8.73683 11.6427C9.33723 11.5158 9.89652 11.2413 10.3641 10.8439C10.8318 10.4465 11.1929 9.93885 11.4151 9.36679C11.615 8.85196 11.3597 8.27254 10.8449 8.07262C10.3301 7.87269 9.75066 8.12797 9.55073 8.6428C9.44887 8.9051 9.28329 9.1378 9.06901 9.3199C8.85474 9.50199 8.59851 9.62774 8.32352 9.68582C8.04853 9.7439 7.76341 9.73249 7.49394 9.65262C7.22445 9.57274 6.97907 9.42691 6.78001 9.22825C6.58093 9.0296 6.43446 8.78439 6.35386 8.51478C6.27327 8.24517 6.26112 7.9597 6.31851 7.6842C6.37591 7.4087 6.50102 7.1519 6.68251 6.93702C6.86399 6.72214 7.0961 6.55595 7.35783 6.45343Z",
102
- fill: "#F9F9F9"
103
- })
104
- ]
105
- })
106
- })
107
- ]
108
- })
109
- ]
22
+ return /*#__PURE__*/ jsx(Fragment, {
23
+ children: isSelectOnPage && /*#__PURE__*/ jsx("button", {
24
+ className: "gp-bg-[#F4F4F4] gp-px-2 gp-h-[24px] gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-xs gp-font-medium gp-hidden interaction-use-custom-element ",
25
+ onClick: closeSelectOnPage,
26
+ "data-setup-interaction": true,
27
+ children: settingType === 'TRIGGER' ? 'Set as trigger' : 'Set as target'
28
+ })
110
29
  });
111
30
  };
112
31