@gem-sdk/core 1.50.0 → 1.51.0-dev.64

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 (58) hide show
  1. package/dist/cjs/components/ComponentToolbarPreview.js +115 -104
  2. package/dist/cjs/components/ComponentWrapperPreview.js +16 -2
  3. package/dist/cjs/components/InteractionSuffix.js +115 -0
  4. package/dist/cjs/components/Render.liquid.js +21 -7
  5. package/dist/cjs/components/RenderPreview.js +1 -0
  6. package/dist/cjs/components/constant.js +2 -1
  7. package/dist/cjs/contexts/PageContext.js +29 -1
  8. package/dist/cjs/contexts/SectionContext.js +0 -1
  9. package/dist/cjs/graphql/fragments/product-little.generated.js +1 -0
  10. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +8 -0
  11. package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +17 -0
  12. package/dist/cjs/helpers/align.js +19 -0
  13. package/dist/cjs/helpers/animations.js +6 -6
  14. package/dist/cjs/helpers/background.js +1 -1
  15. package/dist/cjs/helpers/colors.js +1 -1
  16. package/dist/cjs/helpers/interaction/index.js +66 -0
  17. package/dist/cjs/helpers/render.js +2 -0
  18. package/dist/cjs/helpers/shadow.js +1 -1
  19. package/dist/cjs/helpers/third-party/appConfig.js +28 -0
  20. package/dist/cjs/helpers/third-party/appSetting.js +66 -0
  21. package/dist/cjs/helpers/third-party/constant.js +5 -1
  22. package/dist/cjs/helpers/typography.js +9 -5
  23. package/dist/cjs/hooks/animation/useApplyAnimation.js +2 -0
  24. package/dist/cjs/hooks/useFormatMoney.js +61 -60
  25. package/dist/cjs/hooks/useInteraction.js +19 -0
  26. package/dist/cjs/index.js +16 -0
  27. package/dist/cjs/types/animations.js +2 -0
  28. package/dist/cjs/types/custom.js +51 -0
  29. package/dist/esm/components/ComponentToolbarPreview.js +115 -104
  30. package/dist/esm/components/ComponentWrapperPreview.js +16 -2
  31. package/dist/esm/components/InteractionSuffix.js +113 -0
  32. package/dist/esm/components/Render.liquid.js +21 -7
  33. package/dist/esm/components/RenderPreview.js +1 -0
  34. package/dist/esm/components/constant.js +2 -1
  35. package/dist/esm/contexts/PageContext.js +29 -1
  36. package/dist/esm/contexts/SectionContext.js +0 -1
  37. package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
  38. package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
  39. package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +15 -0
  40. package/dist/esm/helpers/align.js +17 -0
  41. package/dist/esm/helpers/animations.js +6 -6
  42. package/dist/esm/helpers/background.js +1 -1
  43. package/dist/esm/helpers/colors.js +1 -1
  44. package/dist/esm/helpers/interaction/index.js +64 -0
  45. package/dist/esm/helpers/render.js +2 -0
  46. package/dist/esm/helpers/shadow.js +1 -1
  47. package/dist/esm/helpers/third-party/appConfig.js +25 -1
  48. package/dist/esm/helpers/third-party/appSetting.js +66 -0
  49. package/dist/esm/helpers/third-party/constant.js +6 -2
  50. package/dist/esm/helpers/typography.js +9 -5
  51. package/dist/esm/hooks/animation/useApplyAnimation.js +2 -0
  52. package/dist/esm/hooks/useFormatMoney.js +61 -61
  53. package/dist/esm/hooks/useInteraction.js +17 -0
  54. package/dist/esm/index.js +5 -1
  55. package/dist/esm/types/animations.js +2 -0
  56. package/dist/esm/types/custom.js +51 -0
  57. package/dist/types/index.d.ts +3408 -747
  58. package/package.json +3 -3
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ exports.InteractionTargetEvent = void 0;
4
+ (function(InteractionTargetEvent) {
5
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-background-color'] = 0] = 'gp:change-background-color';
6
+ InteractionTargetEvent[InteractionTargetEvent['gp:run-animation'] = 1] = 'gp:run-animation';
7
+ InteractionTargetEvent[InteractionTargetEvent['gp:toggle-element-visibility'] = 2] = 'gp:toggle-element-visibility';
8
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-text'] = 3] = 'gp:change-text';
9
+ InteractionTargetEvent[InteractionTargetEvent['gp:scroll-to'] = 4] = 'gp:scroll-to';
10
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-text-style'] = 5] = 'gp:change-text-style';
11
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-content'] = 6] = 'gp:change-content';
12
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-button-style'] = 7] = 'gp:change-button-style';
13
+ InteractionTargetEvent[InteractionTargetEvent['gp:copy-text'] = 8] = 'gp:copy-text';
14
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-image'] = 9] = 'gp:change-image';
15
+ InteractionTargetEvent[InteractionTargetEvent['gp:toggle-video-play'] = 10] = 'gp:toggle-video-play';
16
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-slider-ratio'] = 11] = 'gp:change-slider-ratio';
17
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-icon-style'] = 12] = 'gp:change-icon-style';
18
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-expanded-item'] = 13] = 'gp:change-expanded-item';
19
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-active-item'] = 14] = 'gp:change-active-item';
20
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-slide'] = 15] = 'gp:change-slide';
21
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-image-step'] = 16] = 'gp:change-image-step';
22
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-text-value'] = 17] = 'gp:change-text-value';
23
+ InteractionTargetEvent[InteractionTargetEvent['gp:toggle-popup-open'] = 18] = 'gp:toggle-popup-open';
24
+ InteractionTargetEvent[InteractionTargetEvent['gp:show-or-hide'] = 19] = 'gp:show-or-hide';
25
+ InteractionTargetEvent[InteractionTargetEvent['gp:change-banner'] = 20] = 'gp:change-banner';
26
+ })(exports.InteractionTargetEvent || (exports.InteractionTargetEvent = {}));
27
+ exports.InteractionTriggerEvent = void 0;
28
+ (function(InteractionTriggerEvent) {
29
+ InteractionTriggerEvent[InteractionTriggerEvent['click'] = 0] = 'click';
30
+ InteractionTriggerEvent[InteractionTriggerEvent["active"] = 1] = "active";
31
+ InteractionTriggerEvent[InteractionTriggerEvent['mouseover'] = 2] = 'mouseover';
32
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:appear'] = 3] = 'gp:appear';
33
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:item-selected'] = 4] = 'gp:item-selected';
34
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:item-unselected'] = 5] = 'gp:item-unselected';
35
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:item-hovered'] = 6] = 'gp:item-hovered';
36
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:item-click'] = 7] = 'gp:item-click';
37
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:after-submit'] = 8] = 'gp:after-submit';
38
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:quantity-change'] = 9] = 'gp:quantity-change';
39
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:after-checked-value'] = 10] = 'gp:after-checked-value';
40
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:after-add-to-cart'] = 11] = 'gp:after-add-to-cart';
41
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:popup-open'] = 12] = 'gp:popup-open';
42
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:popup-close'] = 13] = 'gp:popup-close';
43
+ InteractionTriggerEvent[InteractionTriggerEvent['scroll-up'] = 14] = 'scroll-up';
44
+ InteractionTriggerEvent[InteractionTriggerEvent['scroll-down'] = 15] = 'scroll-down';
45
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:price-change'] = 16] = 'gp:price-change';
46
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:rollback-price-change'] = 17] = 'gp:rollback-price-change';
47
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:compare-price-change'] = 18] = 'gp:compare-price-change';
48
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:rollback:compare-price-change'] = 19] = 'gp:rollback:compare-price-change';
49
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:stock-change'] = 20] = 'gp:stock-change';
50
+ InteractionTriggerEvent[InteractionTriggerEvent['gp:rollback:stock-change'] = 21] = 'gp:rollback:stock-change';
51
+ })(exports.InteractionTriggerEvent || (exports.InteractionTriggerEvent = {}));
@@ -3,6 +3,7 @@ import { memo, useState, useMemo, useCallback, useEffect } from 'react';
3
3
  import 'zustand';
4
4
  import { useBuilderPreviewStore } from '../contexts/BuilderPreviewContext.js';
5
5
  import { useShopStore } from '../contexts/ShopContext.js';
6
+ import { usePageStore } from '../contexts/PageContext.js';
6
7
  import '@gem-sdk/adapter-shopify';
7
8
  import 'swr';
8
9
  import 'swr/mutation';
@@ -17,6 +18,7 @@ import { usePostPurchase } from '../hooks/useToolbarPostPurchase.js';
17
18
  import { ableGenerateContentElements } from './constant.js';
18
19
  import { AIContentGenerator } from './ai-generator/AIContentGenerator.js';
19
20
  import { AIGenContentLoading } from './ai-generator/AIGenContentLoading.js';
21
+ import { InteractionSuffix } from './InteractionSuffix.js';
20
22
  import '../helpers/convert.js';
21
23
 
22
24
  const SECTION_LIMIT = 25;
@@ -33,6 +35,7 @@ const ComponentToolbarPreview = (props)=>{
33
35
  const isShopifySection = props.isShopifySection;
34
36
  const storefrontUrl = useShopStore((s)=>s.storefrontUrl);
35
37
  const editingPageType = useShopStore((s)=>s.pageType);
38
+ const interactionData = usePageStore((s)=>s.interactionData);
36
39
  const getParents = useBuilderPreviewStore((s)=>s.getParents);
37
40
  const root = useBuilderPreviewStore((s)=>s.getItem('ROOT'));
38
41
  const isThemeSectionEditor = useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
@@ -52,6 +55,9 @@ const ComponentToolbarPreview = (props)=>{
52
55
  const isSaleFunnelPage = useMemo(()=>editingPageType === 'POST_PURCHASE', [
53
56
  editingPageType
54
57
  ]);
58
+ const isSelectOnPage = useMemo(()=>interactionData?.isSelectOnPage, [
59
+ interactionData
60
+ ]);
55
61
  const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = usePostPurchase(props.uid, props.tag || '');
56
62
  const editProductElementList = [
57
63
  'Product Title',
@@ -68,10 +74,6 @@ const ComponentToolbarPreview = (props)=>{
68
74
  'Article Excerpt',
69
75
  'Article Tags'
70
76
  ];
71
- const editAbleElementList = [
72
- ...editProductElementList,
73
- ...editArticleElementList
74
- ];
75
77
  const isOverToolbarPosition = (el, parent)=>{
76
78
  const parentLength = parents.length;
77
79
  const rect = el.getBoundingClientRect();
@@ -444,6 +446,7 @@ const ComponentToolbarPreview = (props)=>{
444
446
  }
445
447
  return /*#__PURE__*/ jsxs("div", {
446
448
  "data-toolbar-parent": true,
449
+ "data-component-tag": parent.tag,
447
450
  "data-parent-uid": parent.uid,
448
451
  "data-toolbar-theme-section": isThemeSectionEditor,
449
452
  "data-toolbar-parent-revert": isShowParentRevert,
@@ -494,109 +497,117 @@ const ComponentToolbarPreview = (props)=>{
494
497
  ]
495
498
  }, parent.uid);
496
499
  }),
497
- props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
498
- ...props
499
- }),
500
- isEnableAIContent() && /*#__PURE__*/ jsx(AIContentGenerator, {
501
- ...props
502
- }),
503
- props.tag == 'Sticky' && /*#__PURE__*/ jsx("div", {
504
- "data-toolbar-zoom-out": true,
505
- onClick: (e)=>onZoomOut(e),
506
- "aria-hidden": "true",
507
- children: /*#__PURE__*/ jsx("svg", {
508
- width: "16",
509
- height: "16",
510
- viewBox: "0 0 16 16",
511
- fill: "none",
512
- xmlns: "http://www.w3.org/2000/svg",
513
- children: /*#__PURE__*/ jsx("path", {
514
- fillRule: "evenodd",
515
- clipRule: "evenodd",
516
- d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
517
- fill: "currentColor"
518
- })
519
- })
520
- }),
521
- editAbleElementList.includes(toolbarName() ?? '') && /*#__PURE__*/ jsx(Tooltip, {
522
- "data-toolbar-title": true,
523
- enable: true,
524
- "data-toolbar-disable": false,
525
- text: "Edit content in Shopify",
526
- position: "top",
527
- onClick: goToShopifyEditLink,
528
- "aria-hidden": "true",
529
- children: /*#__PURE__*/ jsxs("svg", {
530
- width: "16",
531
- height: "16",
532
- viewBox: "0 0 16 16",
533
- fill: "none",
534
- xmlns: "http://www.w3.org/2000/svg",
535
- children: [
536
- /*#__PURE__*/ jsx("path", {
537
- fillRule: "evenodd",
538
- clipRule: "evenodd",
539
- d: "M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",
540
- fill: "currentColor"
541
- }),
542
- /*#__PURE__*/ jsx("path", {
543
- d: "M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",
544
- fill: "currentColor"
545
- }),
546
- /*#__PURE__*/ jsx("path", {
547
- d: "M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",
548
- fill: "currentColor"
549
- }),
550
- /*#__PURE__*/ jsx("path", {
551
- d: "M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",
552
- fill: "currentColor"
500
+ !isSelectOnPage && /*#__PURE__*/ jsxs(Fragment, {
501
+ children: [
502
+ props.tag === 'Section' && !props.isThemeSection && isEnableCreateThemeSection() && !props.isShopifySection && getIndexSection() < SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
503
+ ...props
504
+ }),
505
+ isEnableAIContent() && /*#__PURE__*/ jsx(AIContentGenerator, {
506
+ ...props
507
+ }),
508
+ props.tag == 'Sticky' && /*#__PURE__*/ jsx("div", {
509
+ "data-toolbar-zoom-out": true,
510
+ onClick: (e)=>onZoomOut(e),
511
+ "aria-hidden": "true",
512
+ children: /*#__PURE__*/ jsx("svg", {
513
+ width: "16",
514
+ height: "16",
515
+ viewBox: "0 0 16 16",
516
+ fill: "none",
517
+ xmlns: "http://www.w3.org/2000/svg",
518
+ children: /*#__PURE__*/ jsx("path", {
519
+ fillRule: "evenodd",
520
+ clipRule: "evenodd",
521
+ d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
522
+ fill: "currentColor"
523
+ })
524
+ })
525
+ }),
526
+ editProductElementList.includes(toolbarName() ?? '') && /*#__PURE__*/ jsx(Tooltip, {
527
+ "data-toolbar-title": true,
528
+ enable: true,
529
+ "data-toolbar-disable": false,
530
+ text: "Edit content in Shopify",
531
+ position: "top",
532
+ onClick: goToShopifyEditLink,
533
+ "aria-hidden": "true",
534
+ children: /*#__PURE__*/ jsxs("svg", {
535
+ width: "16",
536
+ height: "16",
537
+ viewBox: "0 0 16 16",
538
+ fill: "none",
539
+ xmlns: "http://www.w3.org/2000/svg",
540
+ children: [
541
+ /*#__PURE__*/ jsx("path", {
542
+ fillRule: "evenodd",
543
+ clipRule: "evenodd",
544
+ d: "M8.61129 2.47348C8.61129 2.47348 8.47099 2.51557 8.23248 2.59274C8.19039 2.46647 8.13427 2.30512 8.05009 2.15079C7.78352 1.6387 7.39068 1.37212 6.91366 1.36511C6.87858 1.36511 6.85052 1.36511 6.81545 1.37212C6.80843 1.36511 6.80142 1.35634 6.7944 1.34757C6.78739 1.3388 6.78037 1.33003 6.77336 1.32302C6.56992 1.09854 6.30335 0.993314 5.98768 1.00033C5.37737 1.02137 4.76706 1.46332 4.269 2.249C3.91825 2.80319 3.65869 3.49767 3.58153 4.03082C3.38823 4.09074 3.21092 4.14586 3.05516 4.19429C2.64595 4.32151 2.3851 4.40261 2.37494 4.40261C2.01718 4.51485 2.01016 4.52888 1.96106 4.85859C1.92598 5.11113 1 12.2945 1 12.2945L7.14764 13.3583C7.18955 13.118 7.30454 12.8953 7.47848 12.7214L8.70249 11.4974V2.45945C8.66741 2.45945 8.63234 2.46647 8.61129 2.47348ZM6.82948 3.02767L6.62554 3.09101C6.27515 3.19989 5.90094 3.31617 5.5317 3.42752C5.65797 2.94349 5.89648 2.46647 6.19111 2.15079C6.30335 2.03154 6.45067 1.90527 6.63306 1.8281C6.80142 2.18587 6.83649 2.68393 6.82948 3.02767ZM5.99469 1.4072C6.13499 1.4072 6.26126 1.43526 6.36649 1.50541C6.19813 1.58959 6.0438 1.71586 5.88947 1.87721C5.50364 2.29109 5.202 2.94349 5.08274 3.56783C4.74459 3.66991 4.41804 3.77199 4.10838 3.8688L4.01646 3.89753C4.22691 2.90841 5.05468 1.43526 5.99469 1.4072ZM4.80214 7.0122C4.81874 7.26957 5.09737 7.44833 5.43473 7.66478C5.95252 7.99699 6.60867 8.41798 6.66813 9.3482C6.7453 10.5548 6.02977 11.3826 4.99154 11.4457C3.7569 11.5229 3.06943 10.7933 3.06943 10.7933L3.32899 9.67791C3.32899 9.67791 4.01646 10.197 4.56363 10.1619C4.92139 10.1409 5.04767 9.84627 5.04065 9.64283C5.01607 9.26796 4.73308 9.06671 4.41569 8.84101C4.00848 8.55142 3.54465 8.22157 3.49735 7.4331C3.42018 6.24756 4.19885 5.05501 5.91051 4.94277C6.57694 4.90068 6.91366 5.06904 6.91366 5.06904L6.52082 6.53518C6.52082 6.53518 6.08589 6.33876 5.56678 6.36682C4.80915 6.41592 4.79512 6.89294 4.80214 7.0122ZM7.23635 2.9014C7.22934 2.59274 7.19426 2.15781 7.04695 1.78601C7.50994 1.87721 7.74143 2.39632 7.83964 2.71199C7.70008 2.75665 7.54275 2.80575 7.37118 2.8593L7.23635 2.9014Z",
545
+ fill: "currentColor"
546
+ }),
547
+ /*#__PURE__*/ jsx("path", {
548
+ d: "M10.7719 3.44156C10.7757 3.47543 11.1733 6.16931 11.541 8.65883L8.95503 11.2448V2.57871C9.16548 2.78214 9.71265 3.31528 9.71265 3.31528C9.71265 3.31528 10.6106 3.32931 10.6597 3.33633C10.7088 3.34334 10.7649 3.37842 10.7719 3.44156Z",
549
+ fill: "currentColor"
550
+ }),
551
+ /*#__PURE__*/ jsx("path", {
552
+ d: "M14.8056 8.644L14.0424 7.88088C13.7832 7.62163 13.3629 7.62163 13.1036 7.88088L12.1519 8.83258L13.8539 10.5345L14.8056 9.58282C15.0648 9.32357 15.0648 8.90325 14.8056 8.644Z",
553
+ fill: "currentColor"
554
+ }),
555
+ /*#__PURE__*/ jsx("path", {
556
+ d: "M7.85018 13.0942L11.6419 9.30246L13.3438 11.0044L9.55212 14.7961C9.43782 14.9104 9.28573 14.9791 9.1244 14.9892L7.93427 15.0641C7.73484 15.0767 7.56961 14.9114 7.58216 14.712L7.65706 13.5219C7.66721 13.3606 7.73588 13.2085 7.85018 13.0942Z",
557
+ fill: "currentColor"
558
+ })
559
+ ]
560
+ })
561
+ }),
562
+ /*#__PURE__*/ jsx(Tooltip, {
563
+ enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
564
+ text: "Page has reached Shopify’s 25 section-limit",
565
+ position: "bottom",
566
+ "data-toolbar-duplicate": true,
567
+ "data-toolbar-disable": props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isDisableDuplicate,
568
+ onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
569
+ "aria-hidden": "true",
570
+ className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
571
+ children: /*#__PURE__*/ jsx("svg", {
572
+ width: "16",
573
+ height: "16",
574
+ viewBox: "0 0 16 16",
575
+ fill: "none",
576
+ children: /*#__PURE__*/ jsx("path", {
577
+ fillRule: "evenodd",
578
+ clipRule: "evenodd",
579
+ d: "M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",
580
+ fill: "currentColor"
581
+ })
582
+ })
583
+ }),
584
+ /*#__PURE__*/ jsx(Tooltip, {
585
+ "data-toolbar-delete": true,
586
+ onClick: (e)=>isDisableDelete ? null : onDelete(e),
587
+ enable: isDisableDelete,
588
+ "data-toolbar-disable": isDisableDelete,
589
+ width: tooltipText.width,
590
+ text: tooltipText.text,
591
+ position: deleteTooltipPosition,
592
+ "aria-hidden": "true",
593
+ children: /*#__PURE__*/ jsx("svg", {
594
+ width: "16",
595
+ height: "16",
596
+ viewBox: "0 0 16 16",
597
+ fill: "none",
598
+ children: /*#__PURE__*/ jsx("path", {
599
+ fillRule: "evenodd",
600
+ clipRule: "evenodd",
601
+ d: "M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",
602
+ fill: "currentColor"
603
+ })
553
604
  })
554
- ]
555
- })
556
- }),
557
- /*#__PURE__*/ jsx(Tooltip, {
558
- enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
559
- text: "Page has reached Shopify’s 25 section-limit",
560
- position: "bottom",
561
- "data-toolbar-duplicate": true,
562
- "data-toolbar-disable": props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT || isDisableDuplicate,
563
- onClick: isDisableDuplicate ? undefined : (e)=>onDuplicate(e),
564
- "aria-hidden": "true",
565
- className: isDisableDuplicate ? '!gp-cursor-not-allowed' : '',
566
- children: /*#__PURE__*/ jsx("svg", {
567
- width: "16",
568
- height: "16",
569
- viewBox: "0 0 16 16",
570
- fill: "none",
571
- children: /*#__PURE__*/ jsx("path", {
572
- fillRule: "evenodd",
573
- clipRule: "evenodd",
574
- d: "M6.08423 1.21289C5.53194 1.21289 5.08423 1.66061 5.08423 2.21289V3.78711H4.26172C3.43329 3.78711 2.76172 4.45868 2.76172 5.28711V13.2871C2.76172 14.1155 3.43329 14.7871 4.26172 14.7871H10.2617C11.0901 14.7871 11.7617 14.1155 11.7617 13.2871V12.4629H13.0842C13.6365 12.4629 14.0842 12.0152 14.0842 11.4629V2.21289C14.0842 1.66061 13.6365 1.21289 13.0842 1.21289H6.08423ZM10.7617 12.4629H6.08423C5.53194 12.4629 5.08423 12.0152 5.08423 11.4629V4.78711H4.26172C3.98558 4.78711 3.76172 5.01097 3.76172 5.28711V13.2871C3.76172 13.5633 3.98558 13.7871 4.26172 13.7871H10.2617C10.5379 13.7871 10.7617 13.5633 10.7617 13.2871V12.4629Z",
575
- fill: "currentColor"
576
605
  })
577
- })
606
+ ]
578
607
  }),
579
- /*#__PURE__*/ jsx(Tooltip, {
580
- "data-toolbar-delete": true,
581
- onClick: (e)=>isDisableDelete ? null : onDelete(e),
582
- enable: isDisableDelete,
583
- "data-toolbar-disable": isDisableDelete,
584
- width: tooltipText.width,
585
- text: tooltipText.text,
586
- position: deleteTooltipPosition,
587
- "aria-hidden": "true",
588
- children: /*#__PURE__*/ jsx("svg", {
589
- width: "16",
590
- height: "16",
591
- viewBox: "0 0 16 16",
592
- fill: "none",
593
- children: /*#__PURE__*/ jsx("path", {
594
- fillRule: "evenodd",
595
- clipRule: "evenodd",
596
- d: "M11 2.88965V2.38965C11 1.56122 10.3284 0.889648 9.5 0.889648H6.5C5.67157 0.889648 5 1.56122 5 2.38965V2.88965H2C1.72386 2.88965 1.5 3.11351 1.5 3.38965C1.5 3.66579 1.72386 3.88965 2 3.88965H3.21997V13.1099C3.21997 14.2144 4.1154 15.1099 5.21997 15.1099H11.22C12.3245 15.1099 13.22 14.2144 13.22 13.1099V3.88965H14C14.2761 3.88965 14.5 3.66579 14.5 3.38965C14.5 3.11351 14.2761 2.88965 14 2.88965H11ZM6 2.88965H10V2.38965C10 2.11351 9.77614 1.88965 9.5 1.88965H6.5C6.22386 1.88965 6 2.11351 6 2.38965V2.88965ZM6.24976 6.13965C6.66397 6.13965 6.99976 6.47543 6.99976 6.88965V11.3896C6.99976 11.8039 6.66397 12.1396 6.24976 12.1396C5.83554 12.1396 5.49976 11.8039 5.49976 11.3896V6.88965C5.49976 6.47543 5.83554 6.13965 6.24976 6.13965ZM10.4998 6.88965C10.4998 6.47543 10.164 6.13965 9.74976 6.13965C9.33554 6.13965 8.99976 6.47543 8.99976 6.88965V11.3896C8.99976 11.8039 9.33554 12.1396 9.74976 12.1396C10.164 12.1396 10.4998 11.8039 10.4998 11.3896V6.88965Z",
597
- fill: "currentColor"
598
- })
599
- })
608
+ /*#__PURE__*/ jsx(InteractionSuffix, {
609
+ tag: props.tag,
610
+ uid: props.uid
600
611
  })
601
612
  ]
602
613
  }, props.uid),
@@ -1,6 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { memo, useEffect, isValidElement } from 'react';
3
3
  import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
4
+ import { useInteraction } from '../hooks/useInteraction.js';
4
5
  import { disableWrap, excludeApplyStyle } from './constant.js';
5
6
  import RenderCustomCode from './RenderCustomCode.js';
6
7
  import ComponentToolbarPreview from './ComponentToolbarPreview.js';
@@ -28,6 +29,19 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
28
29
  }, [
29
30
  props.uid
30
31
  ]);
32
+ const currentProps = props;
33
+ const { getAnimationByUid } = useInteraction();
34
+ const animationByInteraction = getAnimationByUid(props.uid);
35
+ if (animationByInteraction) {
36
+ currentProps.advanced = {
37
+ ...currentProps.advanced,
38
+ animation: {
39
+ desktop: animationByInteraction,
40
+ tablet: animationByInteraction,
41
+ mobile: animationByInteraction
42
+ }
43
+ };
44
+ }
31
45
  const pageType = usePageType();
32
46
  if (props.type === 'section') {
33
47
  return null;
@@ -132,7 +146,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
132
146
  return /*#__PURE__*/ jsxs(Fragment, {
133
147
  children: [
134
148
  /*#__PURE__*/ jsx(ComponentAnimation, {
135
- ...props
149
+ ...currentProps
136
150
  }),
137
151
  /*#__PURE__*/ jsx(RenderCustomCode, {
138
152
  uid: props.uid,
@@ -161,7 +175,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
161
175
  return /*#__PURE__*/ jsxs(Fragment, {
162
176
  children: [
163
177
  /*#__PURE__*/ jsx(ComponentAnimation, {
164
- ...props
178
+ ...currentProps
165
179
  }),
166
180
  /*#__PURE__*/ jsx(RenderCustomCode, {
167
181
  uid: props.uid,
@@ -0,0 +1,113 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import 'zustand';
4
+ import 'swr';
5
+ import { usePageStore } from '../contexts/PageContext.js';
6
+ import '@gem-sdk/adapter-shopify';
7
+ import 'swr/mutation';
8
+ import 'swr/infinite';
9
+ import 'vanilla-lazyload';
10
+ import '../hooks/useCartUI.js';
11
+ import 'react-transition-group';
12
+ import '@gem-sdk/core';
13
+ import 'classnames';
14
+ import 'dayjs';
15
+ import { useInteraction } from '../helpers/interaction/index.js';
16
+ import '../helpers/convert.js';
17
+
18
+ const InteractionSuffix = ({ tag, uid })=>{
19
+ const { closeSelectOnPage } = useInteraction();
20
+ const currentInteraction = usePageStore((s)=>s.interactionData?.item);
21
+ const isSelectOnPage = usePageStore((s)=>s.interactionData?.isSelectOnPage);
22
+ const isCurrentInteractionTarget = useMemo(()=>{
23
+ return currentInteraction?.targets?.find((t)=>t.uid === uid);
24
+ }, [
25
+ currentInteraction,
26
+ uid
27
+ ]);
28
+ const isCurrentInteractionTrigger = useMemo(()=>{
29
+ return currentInteraction?.self?.uid === uid;
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
+ ]
110
+ });
111
+ };
112
+
113
+ export { InteractionSuffix };
@@ -35,7 +35,6 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
35
35
  const item = builder[uid];
36
36
  const Component = components[item?.tag];
37
37
  if (!Component) {
38
- console.log('Miss component: ', item);
39
38
  return {
40
39
  liquid: '',
41
40
  extraFiles
@@ -72,6 +71,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
72
71
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
73
72
  pageContext,
74
73
  ...passProps,
74
+ builderAttrs: {
75
+ ...passProps.builderAttrs
76
+ },
75
77
  rawChildren: item.childrens.map((id)=>{
76
78
  return {
77
79
  ...builder[id],
@@ -107,11 +109,14 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
107
109
  isText: componentTexts.includes(item.tag) ? true : null,
108
110
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
109
111
  pageContext,
110
- ...passProps
112
+ ...passProps,
113
+ builderAttrs: {
114
+ ...passProps.builderAttrs
115
+ }
111
116
  });
112
117
  });
113
118
  } else {
114
- liquid = template`<div style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
119
+ liquid = template`<div gp-el-wrapper style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
115
120
  ${RenderIf(item?.childrens?.length, ()=>{
116
121
  return Component({
117
122
  builderProps: {
@@ -126,6 +131,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
126
131
  },
127
132
  pageContext,
128
133
  ...passProps,
134
+ builderAttrs: {
135
+ ...passProps.builderAttrs
136
+ },
129
137
  rawChildren: item.childrens.map((id)=>{
130
138
  return {
131
139
  ...builder[id],
@@ -162,7 +170,10 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
162
170
  pageContext,
163
171
  isText: componentTexts.includes(item.tag) ? true : null,
164
172
  style: componentIconList.includes(item.tag) ? style : null,
165
- ...passProps
173
+ ...passProps,
174
+ builderAttrs: {
175
+ ...passProps.builderAttrs
176
+ }
166
177
  });
167
178
  })}
168
179
  </div>`;
@@ -200,7 +211,7 @@ const RenderCustomCode = (item)=>{
200
211
  };
201
212
  const appendAnimation = (props, liquid)=>{
202
213
  const { advanced, tag } = props;
203
- const { animation, op: opacity } = advanced ?? {};
214
+ const { animation, op: opacity, hasAnimationInteraction, displayInitInteraction = true } = advanced ?? {};
204
215
  const getAnimationType = (settings, type)=>{
205
216
  return settings?.triggerConfig?.[type]?.animation ?? 'none';
206
217
  };
@@ -214,7 +225,8 @@ const appendAnimation = (props, liquid)=>{
214
225
  const hoverDesktop = getAnimationType(getSettingsByDevice('desktop'), 'hover');
215
226
  const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
216
227
  const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
217
- const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
228
+ const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none' || !!hasAnimationInteraction;
229
+ const enableAnimationWhenInit = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
218
230
  if (!enableAnimation) return liquid;
219
231
  const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
220
232
  'shake',
@@ -227,10 +239,12 @@ const appendAnimation = (props, liquid)=>{
227
239
  };
228
240
  return template`
229
241
  <gp-animation
242
+ display-init="${!displayInitInteraction ? 'hide' : 'show'}"
230
243
  gp-data='${JSON.stringify({
231
244
  config: animation,
232
245
  tag,
233
- opacity
246
+ opacity,
247
+ notEnableAnimationWhenInit: !enableAnimationWhenInit
234
248
  })}'
235
249
  style="${{
236
250
  display: 'contents'
@@ -41,6 +41,7 @@ const RenderPreview = ({ uid, ...passProps })=>{
41
41
  setting: item.settings,
42
42
  ...passProps,
43
43
  children: item.childrens.map((id)=>/*#__PURE__*/ jsx(RenderPreviewMemo, {
44
+ "bundle-item": passProps?.['bundle-item'],
44
45
  uid: id
45
46
  }, id))
46
47
  }) : /*#__PURE__*/ jsx(Component, {
@@ -49,7 +49,8 @@ const customRenderChildren = [
49
49
  ];
50
50
  const excludeApplyStyle = [
51
51
  'IconListV2',
52
- 'IconList'
52
+ 'IconList',
53
+ 'ProductBadge'
53
54
  ];
54
55
  const postPurchaseRequiredElements = [
55
56
  'PostPurchaseProductOffer',