@gem-sdk/core 1.53.0-dev.14 → 1.53.0-dev.145

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/ComponentWrapper.js +1 -1
  3. package/dist/cjs/components/InteractionSuffix.js +10 -91
  4. package/dist/cjs/components/Render.liquid.js +34 -7
  5. package/dist/cjs/contexts/PageContext.js +9 -1
  6. package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
  7. package/dist/cjs/helpers/animations.js +11 -2
  8. package/dist/cjs/helpers/background.js +6 -1
  9. package/dist/cjs/helpers/convert.js +1 -1
  10. package/dist/cjs/helpers/interaction/index.js +24 -5
  11. package/dist/cjs/helpers/radius.js +11 -1
  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 +4 -0
  19. package/dist/esm/components/ComponentToolbarPreview.js +58 -3
  20. package/dist/esm/components/ComponentWrapper.js +1 -1
  21. package/dist/esm/components/InteractionSuffix.js +11 -92
  22. package/dist/esm/components/Render.liquid.js +34 -7
  23. package/dist/esm/contexts/PageContext.js +9 -1
  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 +6 -1
  27. package/dist/esm/helpers/convert.js +1 -1
  28. package/dist/esm/helpers/interaction/index.js +24 -5
  29. package/dist/esm/helpers/radius.js +11 -1
  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 +2 -0
  37. package/dist/types/index.d.ts +179 -22
  38. package/package.json +3 -3
@@ -60,7 +60,31 @@ const ComponentToolbarPreview = (props)=>{
60
60
  editingPageType
61
61
  ]);
62
62
  const isSelectOnPage = react.useMemo(()=>interactionData?.isSelectOnPage, [
63
- interactionData
63
+ interactionData?.isSelectOnPage
64
+ ]);
65
+ const settingType = react.useMemo(()=>interactionData?.settingType, [
66
+ interactionData?.settingType
67
+ ]);
68
+ const isShowIconInteractionTarget = react.useMemo(()=>{
69
+ return interactionData?.item?.targets?.find((t)=>t.uid === props.uid && t?.type !== 'PAGE') && settingType === 'TARGET';
70
+ }, [
71
+ interactionData?.item?.targets,
72
+ props.uid,
73
+ settingType
74
+ ]);
75
+ const isShowIconInteractionTrigger = react.useMemo(()=>{
76
+ return interactionData?.item?.self?.uid === props.uid && interactionData?.item?.self.type !== 'PAGE' && settingType === 'TRIGGER';
77
+ }, [
78
+ interactionData?.item?.self?.type,
79
+ interactionData?.item?.self?.uid,
80
+ props.uid,
81
+ settingType
82
+ ]);
83
+ const isDisplayIconDrag = react.useMemo(()=>{
84
+ return !isShowIconInteractionTarget && !isShowIconInteractionTrigger;
85
+ }, [
86
+ isShowIconInteractionTarget,
87
+ isShowIconInteractionTrigger
64
88
  ]);
65
89
  const { checkDisableDelete, getTooltipText, checkDisableDuplicate } = useToolbarPostPurchase.usePostPurchase(props.uid, props.tag || '');
66
90
  const editProductElementList = [
@@ -338,7 +362,6 @@ const ComponentToolbarPreview = (props)=>{
338
362
  if (isShopifySection || isThemeSection && !isThemeSectionEditor) return false;
339
363
  return constant.ableGenerateContentElements.includes(tag);
340
364
  };
341
- // if (!isActive) return null;
342
365
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
343
366
  children: [
344
367
  !(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -353,7 +376,39 @@ const ComponentToolbarPreview = (props)=>{
353
376
  onClick: (e)=>onShowParent(e),
354
377
  "aria-hidden": "true",
355
378
  children: [
356
- /*#__PURE__*/ jsxRuntime.jsx("div", {
379
+ isShowIconInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
380
+ className: "gp-hidden gp-w-[12px] interaction-use-custom-element",
381
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
382
+ width: "12",
383
+ height: "13",
384
+ viewBox: "0 0 12 13",
385
+ fill: "none",
386
+ xmlns: "http://www.w3.org/2000/svg",
387
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
388
+ "fill-rule": "evenodd",
389
+ "clip-rule": "evenodd",
390
+ 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",
391
+ fill: "#F9F9F9"
392
+ })
393
+ })
394
+ }),
395
+ isShowIconInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
396
+ className: "gp-hidden gp-w-[14px] interaction-use-custom-element",
397
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
398
+ width: "16",
399
+ height: "16",
400
+ viewBox: "0 0 16 16",
401
+ fill: "none",
402
+ xmlns: "http://www.w3.org/2000/svg",
403
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
404
+ "fill-rule": "evenodd",
405
+ "clip-rule": "evenodd",
406
+ 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",
407
+ fill: "#F9F9F9"
408
+ })
409
+ })
410
+ }),
411
+ isDisplayIconDrag && /*#__PURE__*/ jsxRuntime.jsx("div", {
357
412
  "data-toolbar-icon-drag": true,
358
413
  children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
359
414
  width: "16",
@@ -14,7 +14,7 @@ const ComponentWrapper = ({ children, pageType, ...props })=>{
14
14
  const advanced = props.advanced;
15
15
  const interactionAttributes = ()=>{
16
16
  let result = {};
17
- if (props.advanced?.displayInitInteraction === false) {
17
+ if (props.advanced?.displayInitInteraction !== undefined) {
18
18
  result = {
19
19
  'display-init': props.advanced?.displayInitInteraction === false ? 'hide' : 'show',
20
20
  'gp-interaction-wrapper': ''
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var react = require('react');
5
4
  require('zustand');
5
+ require('react');
6
6
  require('swr');
7
7
  var PageContext = require('../contexts/PageContext.js');
8
8
  require('@gem-sdk/adapter-shopify');
@@ -17,98 +17,17 @@ require('dayjs');
17
17
  var index = require('../helpers/interaction/index.js');
18
18
  require('../helpers/convert.js');
19
19
 
20
- const InteractionSuffix = ({ tag, uid })=>{
20
+ const InteractionSuffix = ()=>{
21
21
  const { closeSelectOnPage } = index.useInteraction();
22
- const currentInteraction = PageContext.usePageStore((s)=>s.interactionData?.item);
22
+ const settingType = PageContext.usePageStore((s)=>s.interactionData?.settingType);
23
23
  const isSelectOnPage = PageContext.usePageStore((s)=>s.interactionData?.isSelectOnPage);
24
- const isCurrentInteractionTarget = react.useMemo(()=>{
25
- return currentInteraction?.targets?.find((t)=>t.uid === uid && !t.isEntirePage);
26
- }, [
27
- currentInteraction,
28
- uid
29
- ]);
30
- const isCurrentInteractionTrigger = react.useMemo(()=>{
31
- return currentInteraction?.self?.uid === uid && !currentInteraction?.self?.isEntirePage;
32
- }, [
33
- currentInteraction,
34
- uid
35
- ]);
36
- const isDisplay = react.useMemo(()=>{
37
- return isCurrentInteractionTarget || isCurrentInteractionTrigger;
38
- }, [
39
- isCurrentInteractionTarget,
40
- isCurrentInteractionTrigger
41
- ]);
42
- const positionOffset = react.useMemo(()=>{
43
- if (isCurrentInteractionTrigger && isCurrentInteractionTarget) {
44
- return 80;
45
- }
46
- return 40;
47
- }, [
48
- isCurrentInteractionTrigger,
49
- isCurrentInteractionTarget
50
- ]);
51
- if (!isDisplay) {
52
- return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
53
- }
54
- return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
55
- children: [
56
- isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx("button", {
57
- 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",
58
- onClick: closeSelectOnPage,
59
- children: "Use element"
60
- }),
61
- /*#__PURE__*/ jsxRuntime.jsx("div", {
62
- className: "hidden gp-left-[-40px] gp-left-[-80px] gp-right-[-40px] gp-right-[-80px]"
63
- }),
64
- /*#__PURE__*/ jsxRuntime.jsxs("div", {
65
- className: `gp-hidden gp-absolute interaction-suffix gp-gap-[8px] ${tag == 'Section' ? `gp-left-[-${positionOffset}px]` : `gp-right-[-${positionOffset}px]`}`,
66
- children: [
67
- isCurrentInteractionTrigger && /*#__PURE__*/ jsxRuntime.jsx("div", {
68
- className: `gp-h-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center `,
69
- children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
70
- width: "16",
71
- height: "16",
72
- viewBox: "0 0 16 16",
73
- fill: "none",
74
- xmlns: "http://www.w3.org/2000/svg",
75
- children: /*#__PURE__*/ jsxRuntime.jsx("path", {
76
- fillRule: "evenodd",
77
- clipRule: "evenodd",
78
- 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",
79
- fill: "#F9F9F9"
80
- })
81
- })
82
- }),
83
- isCurrentInteractionTarget && /*#__PURE__*/ jsxRuntime.jsx("div", {
84
- className: `gp-h-8 min-w-8 gp-rounded-[8px] gp-w-8 gp-bg-[#212121] gp-flex gp-justify-center gp-items-center`,
85
- children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
86
- width: "16",
87
- height: "16",
88
- viewBox: "0 0 16 16",
89
- fill: "none",
90
- xmlns: "http://www.w3.org/2000/svg",
91
- children: [
92
- /*#__PURE__*/ jsxRuntime.jsx("path", {
93
- 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",
94
- fill: "#F9F9F9"
95
- }),
96
- /*#__PURE__*/ jsxRuntime.jsx("path", {
97
- fillRule: "evenodd",
98
- clipRule: "evenodd",
99
- 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",
100
- fill: "#F9F9F9"
101
- }),
102
- /*#__PURE__*/ jsxRuntime.jsx("path", {
103
- 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",
104
- fill: "#F9F9F9"
105
- })
106
- ]
107
- })
108
- })
109
- ]
110
- })
111
- ]
24
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
25
+ children: isSelectOnPage && /*#__PURE__*/ jsxRuntime.jsx("button", {
26
+ className: "gp-bg-[#F4F4F4] gp-px-2 gp-py-0.5 gp-rounded-lg gp-text-[#212121] gp-text-xs gp-font-medium gp-hidden interaction-use-custom-element ",
27
+ onClick: closeSelectOnPage,
28
+ "data-setup-interaction": true,
29
+ children: settingType === 'TRIGGER' ? 'Set as trigger' : 'Set as target'
30
+ })
112
31
  });
113
32
  };
114
33
 
@@ -35,7 +35,7 @@ const componentIconList = [
35
35
  const componentUsingAdvanced = [
36
36
  'IconList'
37
37
  ];
38
- const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
38
+ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, largeComponent = [], sizeLargeComponent = 50, ...passProps })=>{
39
39
  const item = builder[uid];
40
40
  const Component = components[item?.tag];
41
41
  if (!Component) {
@@ -74,6 +74,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
74
74
  advanced: item.advanced,
75
75
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
76
76
  pageContext,
77
+ largeComponent,
78
+ sizeLargeComponent,
77
79
  ...passProps,
78
80
  builderAttrs: {
79
81
  ...passProps.builderAttrs
@@ -85,7 +87,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
85
87
  builder,
86
88
  components,
87
89
  customProps,
88
- pageContext
90
+ pageContext,
91
+ largeComponent,
92
+ sizeLargeComponent
89
93
  };
90
94
  }),
91
95
  children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
@@ -97,11 +101,13 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
97
101
  components,
98
102
  customProps,
99
103
  parentTag: item.tag,
100
- pageContext
104
+ pageContext,
105
+ largeComponent,
106
+ sizeLargeComponent
101
107
  }))) : ''
102
108
  });
103
109
  }, ()=>{
104
- return Component({
110
+ const liquid = Component({
105
111
  builderProps: {
106
112
  uid,
107
113
  builderData: item
@@ -113,11 +119,17 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
113
119
  isText: componentTexts.includes(item.tag) ? true : null,
114
120
  parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
115
121
  pageContext,
122
+ largeComponent,
123
+ sizeLargeComponent,
116
124
  ...passProps,
117
125
  builderAttrs: {
118
126
  ...passProps.builderAttrs
119
127
  }
120
128
  });
129
+ if (isLimitSize(liquid, sizeLargeComponent)) {
130
+ largeComponent.push(item.uid);
131
+ }
132
+ return liquid;
121
133
  });
122
134
  } else {
123
135
  liquid = render.template`<div gp-el-wrapper style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
@@ -134,6 +146,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
134
146
  cssClass: item?.advanced?.cssClass
135
147
  },
136
148
  pageContext,
149
+ largeComponent,
150
+ sizeLargeComponent,
137
151
  ...passProps,
138
152
  builderAttrs: {
139
153
  ...passProps.builderAttrs
@@ -145,7 +159,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
145
159
  builder,
146
160
  components,
147
161
  customProps,
148
- pageContext
162
+ pageContext,
163
+ largeComponent,
164
+ sizeLargeComponent
149
165
  };
150
166
  }),
151
167
  children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
@@ -157,11 +173,13 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
157
173
  components,
158
174
  customProps,
159
175
  parentTag: item.tag,
160
- pageContext
176
+ pageContext,
177
+ largeComponent,
178
+ sizeLargeComponent
161
179
  }))) : ''
162
180
  });
163
181
  }, ()=>{
164
- return Component({
182
+ const liquid = Component({
165
183
  builderProps: {
166
184
  uid,
167
185
  builderData: item
@@ -179,6 +197,10 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
179
197
  ...passProps.builderAttrs
180
198
  }
181
199
  });
200
+ if (isLimitSize(liquid, sizeLargeComponent)) {
201
+ largeComponent.push(item.uid);
202
+ }
203
+ return liquid;
182
204
  })}
183
205
  </div>`;
184
206
  }
@@ -303,6 +325,11 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
303
325
  }
304
326
  return liquid;
305
327
  };
328
+ const isLimitSize = (liquid, size = 50)=>{
329
+ const textEncoder = new TextEncoder();
330
+ const byteSize = textEncoder.encode(liquid).length;
331
+ return byteSize >= size * 1024;
332
+ };
306
333
 
307
334
  exports.RenderChildren = RenderChildren;
308
335
  exports.WrapRenderChildren = WrapRenderChildren;
@@ -56,6 +56,14 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
56
56
  selectType
57
57
  }
58
58
  }));
59
+ },
60
+ setInteractionSettingType: (settingType)=>{
61
+ set((state)=>({
62
+ interactionData: {
63
+ ...state.interactionData,
64
+ settingType
65
+ }
66
+ }));
59
67
  }
60
68
  }));
61
69
  const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
@@ -65,7 +73,7 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
65
73
  productOffers,
66
74
  publicStoreFrontData,
67
75
  interactionData: {
68
- selectType: 'element'
76
+ selectType: 'ELEMENT'
69
77
  }
70
78
  }), [
71
79
  dynamicProduct,
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const PublishedShopMetasDocument = `
4
+ query PublishedShopMetas($keys: [String!]) {
5
+ publishedShopMetas(keys: $keys) {
6
+ id
7
+ createdAt
8
+ updatedAt
9
+ key
10
+ value
11
+ }
12
+ }
13
+ `;
14
+
15
+ exports.PublishedShopMetasDocument = PublishedShopMetasDocument;
@@ -53,10 +53,16 @@ const animations = ()=>{
53
53
  'left',
54
54
  'right'
55
55
  ].includes(direction ?? '') ? 'X' : 'Y';
56
- const isNeg = [
56
+ let isNeg = [
57
57
  'left',
58
58
  'down'
59
59
  ].includes(direction ?? '') ? '-' : '';
60
+ if (reverse) {
61
+ isNeg = [
62
+ 'left',
63
+ 'down'
64
+ ].includes(direction ?? '') ? '' : '-';
65
+ }
60
66
  const preset = [
61
67
  {
62
68
  opacity: 0,
@@ -126,7 +132,10 @@ const animations = ()=>{
126
132
  opacity: 1
127
133
  }
128
134
  ];
129
- const zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
135
+ let zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
136
+ if (reverse) {
137
+ zoomPreset = zoomDirection === 'in' ? zoomOutPreset : zoomInPreset;
138
+ }
130
139
  return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
131
140
  ...generateOptions(normalizedOptions, 700)
132
141
  });
@@ -13,7 +13,9 @@ const getStyleBackgroundByDevice = (background, options)=>{
13
13
  ...getStyleBgColor(background)
14
14
  } : {},
15
15
  ...!options?.ignoreBackgroundImage ? {
16
- ...getStyleBgImage(background, options),
16
+ ...getStyleBgImage(background, options)
17
+ } : {},
18
+ ...!options?.ignoreBackgroundImageProperties ? {
17
19
  ...getStyleBgPosition(background),
18
20
  ...getStyleBgSize(background),
19
21
  ...getStyleBgRepeat(background)
@@ -74,6 +76,9 @@ const getBgImageByDevice = (background, device, options)=>{
74
76
  if (typeof imageByDevice === 'string') {
75
77
  return `url(${imageByDevice})`;
76
78
  }
79
+ if (imageByDevice !== undefined) {
80
+ return 'none';
81
+ }
77
82
  };
78
83
  const getStyleBgPosition = (background)=>{
79
84
  const bgPosition = {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const isLocalEnv = true;
3
+ const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
4
4
  const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
5
5
 
6
6
  exports.baseAssetURL = baseAssetURL;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var react = require('react');
3
4
  require('react/jsx-runtime');
4
5
  require('zustand');
5
- require('react');
6
6
  require('swr');
7
7
  var PageContext = require('../../contexts/PageContext.js');
8
8
  require('@gem-sdk/adapter-shopify');
@@ -17,9 +17,17 @@ require('dayjs');
17
17
  require('../convert.js');
18
18
 
19
19
  const useInteraction = ()=>{
20
+ const ref = react.useRef(null);
20
21
  const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
22
+ function findElementIncludingSelf(element, selector) {
23
+ if (!(element instanceof Document) && element?.matches(selector)) {
24
+ return element;
25
+ } else {
26
+ return element?.querySelector(selector);
27
+ }
28
+ }
21
29
  const onListener = ({ event, selector }, callback)=>{
22
- const element = document.querySelector(selector);
30
+ const element = findElementIncludingSelf(ref.current || document, selector);
23
31
  if (!element) return;
24
32
  element.addEventListener(event, (e)=>{
25
33
  const event = e;
@@ -27,8 +35,8 @@ const useInteraction = ()=>{
27
35
  if (callback) callback(params);
28
36
  });
29
37
  };
30
- const trigger = ({ event, data, selector })=>{
31
- const element = document.querySelector(selector);
38
+ const trigger = ({ event, data, selector, element: elementParam })=>{
39
+ const element = elementParam || document.querySelector(selector);
32
40
  if (!element) return;
33
41
  const eventDispatch = new CustomEvent(event, {
34
42
  bubbles: false,
@@ -47,6 +55,14 @@ const useInteraction = ()=>{
47
55
  [key]: value
48
56
  }));
49
57
  };
58
+ const getInteractionPreviousData = (element, key)=>{
59
+ const interactionData = element.getAttribute('gp-data-interaction');
60
+ const interactionDataJson = JSON.parse(interactionData || '{}');
61
+ return {
62
+ previousData: interactionDataJson[key],
63
+ interactionDataJson
64
+ };
65
+ };
50
66
  const closeSelectOnPage = ()=>{
51
67
  setInteractionIsSelectOnPage(false);
52
68
  const event = new CustomEvent('editor:interaction:change-select-on-page', {
@@ -59,7 +75,10 @@ const useInteraction = ()=>{
59
75
  onListener,
60
76
  trigger,
61
77
  saveToElementInteractionData,
62
- closeSelectOnPage
78
+ closeSelectOnPage,
79
+ ref,
80
+ findElementIncludingSelf,
81
+ getInteractionPreviousData
63
82
  };
64
83
  };
65
84
 
@@ -27,7 +27,14 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
27
27
  };
28
28
  };
29
29
  const getCustomRadius = (state, radius, device)=>{
30
- if (!radius || !state || radius?.radiusType !== 'custom') return {};
30
+ const list = [
31
+ 'custom',
32
+ 'pill',
33
+ 'rounded',
34
+ 'single',
35
+ 'none'
36
+ ];
37
+ if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
31
38
  const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
32
39
  const mState = constant.stateMapping?.[state];
33
40
  return {
@@ -62,6 +69,7 @@ const composeRadiusState = (radiusValue, device)=>{
62
69
  case 'circle':
63
70
  case 'none':
64
71
  case 'custom':
72
+ case 'rounded':
65
73
  Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
66
74
  break;
67
75
  }
@@ -74,6 +82,7 @@ const composeRadiusState = (radiusValue, device)=>{
74
82
  case 'circle':
75
83
  case 'none':
76
84
  case 'custom':
85
+ case 'rounded':
77
86
  Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
78
87
  break;
79
88
  }
@@ -86,6 +95,7 @@ const composeRadiusState = (radiusValue, device)=>{
86
95
  case 'circle':
87
96
  case 'none':
88
97
  case 'custom':
98
+ case 'rounded':
89
99
  Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
90
100
  break;
91
101
  }
@@ -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;