@gem-sdk/pages 1.39.15 → 1.40.0

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 (30) hide show
  1. package/dist/cjs/components/Footer.js +101 -79
  2. package/dist/cjs/components/FooterForPostPurchase.js +34 -0
  3. package/dist/cjs/components/Header.js +142 -67
  4. package/dist/cjs/components/builder/Toolbar.js +31 -24
  5. package/dist/cjs/components/builder/Toolbox.js +23 -1
  6. package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +22 -1
  7. package/dist/cjs/index.js +5 -0
  8. package/dist/cjs/libs/api/get-post-purchase-props-preview.js +166 -0
  9. package/dist/cjs/libs/fetcher.js +33 -0
  10. package/dist/cjs/libs/helpers/get-fallback.js +2 -3
  11. package/dist/cjs/libs/helpers/normalize.js +7 -1
  12. package/dist/cjs/libs/hooks/usePagePreview.js +92 -0
  13. package/dist/cjs/pages/builder.js +12 -5
  14. package/dist/cjs/pages/static-v2.js +27 -13
  15. package/dist/esm/components/Footer.js +102 -80
  16. package/dist/esm/components/FooterForPostPurchase.js +30 -0
  17. package/dist/esm/components/Header.js +143 -68
  18. package/dist/esm/components/builder/Toolbar.js +31 -24
  19. package/dist/esm/components/builder/Toolbox.js +23 -1
  20. package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +22 -1
  21. package/dist/esm/index.js +3 -1
  22. package/dist/esm/libs/api/get-post-purchase-props-preview.js +161 -0
  23. package/dist/esm/libs/fetcher.js +33 -1
  24. package/dist/esm/libs/helpers/get-fallback.js +2 -3
  25. package/dist/esm/libs/helpers/normalize.js +7 -2
  26. package/dist/esm/libs/hooks/usePagePreview.js +90 -0
  27. package/dist/esm/pages/builder.js +12 -5
  28. package/dist/esm/pages/static-v2.js +27 -13
  29. package/dist/types/index.d.ts +30 -6
  30. package/package.json +7 -6
@@ -12,7 +12,10 @@ const defaultMargin = {
12
12
  mobile: '40px'
13
13
  };
14
14
  const FOOTER_OFF_COLOR = '#F4F4F4';
15
- const Footer = ()=>{
15
+ const Footer = (props)=>{
16
+ const { pageType } = props;
17
+ const urlParams = new URLSearchParams(window.location.search);
18
+ const shopName = urlParams.get('storefrontHandle');
16
19
  const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
17
20
  const [shouldFixed, setShouldFixed] = react.useState(false);
18
21
  react.useEffect(()=>{
@@ -36,88 +39,107 @@ const Footer = ()=>{
36
39
  }, [
37
40
  layoutSetting
38
41
  ]);
39
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
40
- className: core.cls('gp-footer-container gp-border-1 gp-group gp-flex gp-h-[48px] gp-justify-center gp-border-y gp-border-[#EEEEEE] gp-bg-white gp-font-sans', {
41
- 'gp-fixed gp-bottom-0 gp-w-full': shouldFixed
42
- }),
43
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
44
- className: "gp-flex gp-h-[40px] gp-flex-1 gp-items-center gp-justify-between",
45
- style: {
46
- maxWidth: `var(--g-ct-w)`,
47
- ...core.makeStyleResponsive('ml', defaultMargin),
48
- ...core.makeStyleResponsive('mr', defaultMargin)
49
- },
50
- children: [
51
- /*#__PURE__*/ jsxRuntime.jsxs("svg", {
52
- width: "192",
53
- height: "8",
54
- viewBox: "0 0 192 8",
55
- fill: "none",
56
- xmlns: "http://www.w3.org/2000/svg",
42
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
43
+ children: pageType === 'POST_PURCHASE' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
44
+ className: core.cls('gp-footer-container gp-border-1 gp-group gp-flex gp-justify-center gp-border-y gp-border-[#EEEEEE] gp-bg-white gp-font-sans'),
45
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
46
+ className: "gp-flex gp-flex-1 gp-items-center gp-justify-between gp-py-6",
47
+ style: {
48
+ maxWidth: `var(--g-ct-w, 1200px)`,
49
+ ...core.makeStyleResponsive('ml', defaultMargin),
50
+ ...core.makeStyleResponsive('mr', defaultMargin)
51
+ },
52
+ children: /*#__PURE__*/ jsxRuntime.jsxs("p", {
53
+ className: "gp-text-lg",
57
54
  children: [
58
- /*#__PURE__*/ jsxRuntime.jsx("path", {
59
- d: "M0 4C0 1.79086 1.79086 0 4 0H52C54.2091 0 56 1.79086 56 4C56 6.20914 54.2091 8 52 8H4C1.79086 8 0 6.20914 0 4Z",
60
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
61
- }),
62
- /*#__PURE__*/ jsxRuntime.jsx("path", {
63
- d: "M68 4C68 1.79086 69.7909 0 72 0H120C122.209 0 124 1.79086 124 4C124 6.20914 122.209 8 120 8H72C69.7909 8 68 6.20914 68 4Z",
64
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
65
- }),
66
- /*#__PURE__*/ jsxRuntime.jsx("path", {
67
- d: "M136 4C136 1.79086 137.791 0 140 0H188C190.209 0 192 1.79086 192 4C192 6.20914 190.209 8 188 8H140C137.791 8 136 6.20914 136 4Z",
68
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
69
- })
55
+ "All rights reserved ",
56
+ shopName
70
57
  ]
71
- }),
72
- /*#__PURE__*/ jsxRuntime.jsx("div", {
73
- className: "gp-footer gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-w-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#0000001a] group-hover:gp-visible",
74
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
75
- className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
76
- children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
77
- width: "14",
78
- height: "14",
79
- viewBox: "0 0 14 14",
80
- fill: "none",
81
- xmlns: "http://www.w3.org/2000/svg",
82
- children: [
83
- /*#__PURE__*/ jsxRuntime.jsx("path", {
84
- fillRule: "evenodd",
85
- clipRule: "evenodd",
86
- d: "M6.99985 4.08501C5.38983 4.08501 4.08465 5.39019 4.08465 7.00021C4.08465 8.61023 5.38983 9.9154 6.99985 9.9154C8.60987 9.9154 9.91504 8.61023 9.91504 7.00021C9.91504 5.39019 8.60987 4.08501 6.99985 4.08501ZM5.08465 7.00021C5.08465 5.94247 5.94211 5.08501 6.99985 5.08501C8.05758 5.08501 8.91504 5.94247 8.91504 7.00021C8.91504 8.05794 8.05758 8.9154 6.99985 8.9154C5.94211 8.9154 5.08465 8.05794 5.08465 7.00021Z",
87
- fill: "#212121"
88
- }),
89
- /*#__PURE__*/ jsxRuntime.jsx("path", {
90
- fillRule: "evenodd",
91
- clipRule: "evenodd",
92
- d: "M5.52351 0.00390625C5.28138 0.00390625 5.07405 0.177388 5.03135 0.415715L4.7415 2.03321C4.40346 2.18248 4.08346 2.36419 3.78558 2.57432L2.18557 2.00147C1.95684 1.91958 1.70235 2.01395 1.58232 2.22517L0.122204 4.79451C0.00217064 5.00572 0.0513362 5.27266 0.238747 5.42725L1.50086 6.46836C1.48358 6.64355 1.47474 6.82106 1.47474 7.00047C1.47474 7.17981 1.48357 7.35726 1.50084 7.53238L0.238747 8.57347C0.0513362 8.72806 0.00217064 8.995 0.122203 9.20622L1.58232 11.7756C1.70235 11.9868 1.95684 12.0811 2.18557 11.9993L3.78537 11.4265C4.08332 11.6367 4.40341 11.8185 4.74155 11.9678L5.03135 13.585C5.07405 13.8233 5.28138 13.9968 5.52351 13.9968H8.47647C8.7186 13.9968 8.92593 13.8233 8.96863 13.585L9.25846 11.9676C9.5965 11.8183 9.91649 11.6365 10.2144 11.4264L11.8144 11.9993C12.0431 12.0811 12.2976 11.9868 12.4177 11.7756L13.8778 9.20622C13.9978 8.995 13.9486 8.72806 13.7612 8.57347L12.4988 7.5321C12.516 7.35706 12.5249 7.17971 12.5249 7.00047C12.5249 6.82116 12.516 6.64375 12.4988 6.46864L13.7612 5.42725C13.9486 5.27266 13.9978 5.00572 13.8778 4.79451L12.4177 2.22517C12.2976 2.01395 12.0431 1.91958 11.8144 2.00147L10.2141 2.57441C9.91636 2.36433 9.59645 2.18264 9.25851 2.0334L8.96863 0.415715C8.92593 0.177389 8.7186 0.00390625 8.47647 0.00390625H5.52351ZM5.67747 2.47943L5.94187 1.00391H8.0581L8.32253 2.47958C8.35348 2.6523 8.47271 2.79616 8.63668 2.85863C9.06768 3.02283 9.46674 3.25007 9.82215 3.5288C9.95734 3.63483 10.1375 3.66402 10.2993 3.6061L11.7559 3.08459L12.8007 4.92323L11.6503 5.8722C11.5145 5.98427 11.4476 6.15956 11.4743 6.33366C11.5076 6.55089 11.5249 6.77354 11.5249 7.00047C11.5249 7.22735 11.5076 7.44993 11.4743 7.66711C11.4476 7.8412 11.5145 8.01648 11.6504 8.12855L12.8007 9.07749L11.7559 10.9161L10.2994 10.3947C10.1377 10.3368 9.95752 10.366 9.82233 10.472C9.46686 10.7508 9.06773 10.9781 8.63664 11.1423C8.47267 11.2048 8.35344 11.3487 8.32249 11.5214L8.0581 12.9968H5.94187L5.67752 11.5215C5.64656 11.3488 5.52732 11.2049 5.36333 11.1425C4.93215 10.9782 4.53292 10.7509 4.17738 10.4721C4.04219 10.3661 3.86203 10.3369 3.70027 10.3948L2.24412 10.9161L1.19924 9.07749L2.34929 8.12883C2.48516 8.01675 2.55204 7.84146 2.52535 7.66736C2.49205 7.4501 2.47474 7.22743 2.47474 7.00047C2.47474 6.77345 2.49206 6.55072 2.52538 6.33341C2.55207 6.15931 2.48519 5.984 2.34932 5.87192L1.19924 4.92323L2.24412 3.08459L3.70047 3.60601C3.86221 3.66392 4.04236 3.63474 4.17755 3.52872C4.53304 3.24994 4.93219 3.02269 5.36329 2.85849C5.52728 2.79603 5.64652 2.65216 5.67747 2.47943Z",
93
- fill: "#212121"
94
- })
95
- ]
58
+ })
59
+ })
60
+ }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
61
+ className: core.cls('gp-footer-container gp-border-1 gp-group gp-flex gp-justify-center gp-border-y gp-border-[#EEEEEE] gp-bg-white gp-font-sans', {
62
+ 'gp-fixed gp-bottom-0 gp-w-full': shouldFixed
63
+ }),
64
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
65
+ className: "gp-flex gp-h-[40px] gp-flex-1 gp-items-center gp-justify-between",
66
+ style: {
67
+ maxWidth: `var(--g-ct-w)`,
68
+ ...core.makeStyleResponsive('ml', defaultMargin),
69
+ ...core.makeStyleResponsive('mr', defaultMargin)
70
+ },
71
+ children: [
72
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
73
+ width: "192",
74
+ height: "8",
75
+ viewBox: "0 0 192 8",
76
+ fill: "none",
77
+ xmlns: "http://www.w3.org/2000/svg",
78
+ children: [
79
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
80
+ d: "M0 4C0 1.79086 1.79086 0 4 0H52C54.2091 0 56 1.79086 56 4C56 6.20914 54.2091 8 52 8H4C1.79086 8 0 6.20914 0 4Z",
81
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
82
+ }),
83
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
84
+ d: "M68 4C68 1.79086 69.7909 0 72 0H120C122.209 0 124 1.79086 124 4C124 6.20914 122.209 8 120 8H72C69.7909 8 68 6.20914 68 4Z",
85
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
86
+ }),
87
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
88
+ d: "M136 4C136 1.79086 137.791 0 140 0H188C190.209 0 192 1.79086 192 4C192 6.20914 190.209 8 188 8H140C137.791 8 136 6.20914 136 4Z",
89
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
90
+ })
91
+ ]
92
+ }),
93
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
94
+ className: "gp-footer gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-w-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#0000001a] group-hover:gp-visible",
95
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
96
+ className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
97
+ children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
98
+ width: "14",
99
+ height: "14",
100
+ viewBox: "0 0 14 14",
101
+ fill: "none",
102
+ xmlns: "http://www.w3.org/2000/svg",
103
+ children: [
104
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
105
+ fillRule: "evenodd",
106
+ clipRule: "evenodd",
107
+ d: "M6.99985 4.08501C5.38983 4.08501 4.08465 5.39019 4.08465 7.00021C4.08465 8.61023 5.38983 9.9154 6.99985 9.9154C8.60987 9.9154 9.91504 8.61023 9.91504 7.00021C9.91504 5.39019 8.60987 4.08501 6.99985 4.08501ZM5.08465 7.00021C5.08465 5.94247 5.94211 5.08501 6.99985 5.08501C8.05758 5.08501 8.91504 5.94247 8.91504 7.00021C8.91504 8.05794 8.05758 8.9154 6.99985 8.9154C5.94211 8.9154 5.08465 8.05794 5.08465 7.00021Z",
108
+ fill: "#212121"
109
+ }),
110
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
111
+ fillRule: "evenodd",
112
+ clipRule: "evenodd",
113
+ d: "M5.52351 0.00390625C5.28138 0.00390625 5.07405 0.177388 5.03135 0.415715L4.7415 2.03321C4.40346 2.18248 4.08346 2.36419 3.78558 2.57432L2.18557 2.00147C1.95684 1.91958 1.70235 2.01395 1.58232 2.22517L0.122204 4.79451C0.00217064 5.00572 0.0513362 5.27266 0.238747 5.42725L1.50086 6.46836C1.48358 6.64355 1.47474 6.82106 1.47474 7.00047C1.47474 7.17981 1.48357 7.35726 1.50084 7.53238L0.238747 8.57347C0.0513362 8.72806 0.00217064 8.995 0.122203 9.20622L1.58232 11.7756C1.70235 11.9868 1.95684 12.0811 2.18557 11.9993L3.78537 11.4265C4.08332 11.6367 4.40341 11.8185 4.74155 11.9678L5.03135 13.585C5.07405 13.8233 5.28138 13.9968 5.52351 13.9968H8.47647C8.7186 13.9968 8.92593 13.8233 8.96863 13.585L9.25846 11.9676C9.5965 11.8183 9.91649 11.6365 10.2144 11.4264L11.8144 11.9993C12.0431 12.0811 12.2976 11.9868 12.4177 11.7756L13.8778 9.20622C13.9978 8.995 13.9486 8.72806 13.7612 8.57347L12.4988 7.5321C12.516 7.35706 12.5249 7.17971 12.5249 7.00047C12.5249 6.82116 12.516 6.64375 12.4988 6.46864L13.7612 5.42725C13.9486 5.27266 13.9978 5.00572 13.8778 4.79451L12.4177 2.22517C12.2976 2.01395 12.0431 1.91958 11.8144 2.00147L10.2141 2.57441C9.91636 2.36433 9.59645 2.18264 9.25851 2.0334L8.96863 0.415715C8.92593 0.177389 8.7186 0.00390625 8.47647 0.00390625H5.52351ZM5.67747 2.47943L5.94187 1.00391H8.0581L8.32253 2.47958C8.35348 2.6523 8.47271 2.79616 8.63668 2.85863C9.06768 3.02283 9.46674 3.25007 9.82215 3.5288C9.95734 3.63483 10.1375 3.66402 10.2993 3.6061L11.7559 3.08459L12.8007 4.92323L11.6503 5.8722C11.5145 5.98427 11.4476 6.15956 11.4743 6.33366C11.5076 6.55089 11.5249 6.77354 11.5249 7.00047C11.5249 7.22735 11.5076 7.44993 11.4743 7.66711C11.4476 7.8412 11.5145 8.01648 11.6504 8.12855L12.8007 9.07749L11.7559 10.9161L10.2994 10.3947C10.1377 10.3368 9.95752 10.366 9.82233 10.472C9.46686 10.7508 9.06773 10.9781 8.63664 11.1423C8.47267 11.2048 8.35344 11.3487 8.32249 11.5214L8.0581 12.9968H5.94187L5.67752 11.5215C5.64656 11.3488 5.52732 11.2049 5.36333 11.1425C4.93215 10.9782 4.53292 10.7509 4.17738 10.4721C4.04219 10.3661 3.86203 10.3369 3.70027 10.3948L2.24412 10.9161L1.19924 9.07749L2.34929 8.12883C2.48516 8.01675 2.55204 7.84146 2.52535 7.66736C2.49205 7.4501 2.47474 7.22743 2.47474 7.00047C2.47474 6.77345 2.49206 6.55072 2.52538 6.33341C2.55207 6.15931 2.48519 5.984 2.34932 5.87192L1.19924 4.92323L2.24412 3.08459L3.70047 3.60601C3.86221 3.66392 4.04236 3.63474 4.17755 3.52872C4.53304 3.24994 4.93219 3.02269 5.36329 2.85849C5.52728 2.79603 5.64652 2.65216 5.67747 2.47943Z",
114
+ fill: "#212121"
115
+ })
116
+ ]
117
+ })
96
118
  })
119
+ }),
120
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
121
+ width: "82",
122
+ height: "8",
123
+ viewBox: "0 0 82 8",
124
+ fill: "none",
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ children: [
127
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
128
+ d: "M0 4C0 1.79086 1.79086 0 4 0H18C20.2091 0 22 1.79086 22 4C22 6.20914 20.2091 8 18 8H4C1.79086 8 0 6.20914 0 4Z",
129
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
130
+ }),
131
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
132
+ d: "M30 4C30 1.79086 31.7909 0 34 0H48C50.2091 0 52 1.79086 52 4C52 6.20914 50.2091 8 48 8H34C31.7909 8 30 6.20914 30 4Z",
133
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
134
+ }),
135
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
136
+ d: "M60 4C60 1.79086 61.7909 0 64 0H78C80.2091 0 82 1.79086 82 4C82 6.20914 80.2091 8 78 8H64C61.7909 8 60 6.20914 60 4Z",
137
+ fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
138
+ })
139
+ ]
97
140
  })
98
- }),
99
- /*#__PURE__*/ jsxRuntime.jsxs("svg", {
100
- width: "82",
101
- height: "8",
102
- viewBox: "0 0 82 8",
103
- fill: "none",
104
- xmlns: "http://www.w3.org/2000/svg",
105
- children: [
106
- /*#__PURE__*/ jsxRuntime.jsx("path", {
107
- d: "M0 4C0 1.79086 1.79086 0 4 0H18C20.2091 0 22 1.79086 22 4C22 6.20914 20.2091 8 18 8H4C1.79086 8 0 6.20914 0 4Z",
108
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
109
- }),
110
- /*#__PURE__*/ jsxRuntime.jsx("path", {
111
- d: "M30 4C30 1.79086 31.7909 0 34 0H48C50.2091 0 52 1.79086 52 4C52 6.20914 50.2091 8 48 8H34C31.7909 8 30 6.20914 30 4Z",
112
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
113
- }),
114
- /*#__PURE__*/ jsxRuntime.jsx("path", {
115
- d: "M60 4C60 1.79086 61.7909 0 64 0H78C80.2091 0 82 1.79086 82 4C82 6.20914 80.2091 8 78 8H64C61.7909 8 60 6.20914 60 4Z",
116
- fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
117
- })
118
- ]
119
- })
120
- ]
141
+ ]
142
+ })
121
143
  })
122
144
  });
123
145
  };
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var core = require('@gem-sdk/core');
7
+
8
+ const defaultMargin = {
9
+ desktop: '40px',
10
+ tablet: '40px',
11
+ mobile: '40px'
12
+ };
13
+ const FooterForPostPurchase = (props)=>{
14
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
15
+ className: core.cls('gp-footer-container gp-border-1 gp-group gp-flex gp-justify-center gp-border-y gp-border-[#EEEEEE] gp-bg-white gp-font-sans'),
16
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
17
+ className: "gp-flex gp-flex-1 gp-items-center gp-justify-between gp-py-6",
18
+ style: {
19
+ maxWidth: `var(--g-ct-w, 1200px)`,
20
+ ...core.makeStyleResponsive('ml', defaultMargin),
21
+ ...core.makeStyleResponsive('mr', defaultMargin)
22
+ },
23
+ children: /*#__PURE__*/ jsxRuntime.jsxs("p", {
24
+ className: "gp-text-lg",
25
+ children: [
26
+ "All rights reserved ",
27
+ props.shopName
28
+ ]
29
+ })
30
+ })
31
+ });
32
+ };
33
+
34
+ exports.default = FooterForPostPurchase;
@@ -11,84 +11,159 @@ const defaultMargin = {
11
11
  mobile: '40px'
12
12
  };
13
13
  const HEADER_OFF_COLOR = '#F4F4F4';
14
- const Header = ()=>{
14
+ const sizeCheck = {
15
+ desktop: '24px',
16
+ tablet: '36px',
17
+ mobile: '36px'
18
+ };
19
+ const Header = (props)=>{
20
+ const { pageType } = props;
15
21
  const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
16
22
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
17
23
  className: core.cls('gp-header-container gp-border-1 gp-group gp-relative gp-flex gp-justify-center gp-border-b gp-border-[#EEEEEE] gp-font-sans'),
18
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
24
+ children: pageType === 'POST_PURCHASE' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
25
+ className: "gp-flex gp-flex-1 gp-items-center gp-justify-between",
26
+ style: {
27
+ maxWidth: `var(--g-ct-w, 1200px)`,
28
+ ...core.makeStyleResponsive('ml', defaultMargin),
29
+ ...core.makeStyleResponsive('mr', defaultMargin)
30
+ },
31
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
32
+ className: "tablet:gp-items-center gp-flex gp-py-3",
33
+ children: [
34
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
35
+ style: {
36
+ ...core.makeStyleResponsive('w', sizeCheck),
37
+ ...core.makeStyleResponsive('h', sizeCheck)
38
+ },
39
+ viewBox: "0 0 24 24",
40
+ fill: "none",
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ children: [
43
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
44
+ d: "M15.7244 10.6242C15.9587 10.3899 15.9587 10.01 15.7244 9.77571C15.49 9.5414 15.1101 9.5414 14.8758 9.77571L11.1001 13.5514L9.42436 11.8757C9.19005 11.6414 8.81015 11.6414 8.57583 11.8757C8.34152 12.11 8.34152 12.4899 8.57583 12.7242L10.6758 14.8242C10.9101 15.0586 11.29 15.0586 11.5244 14.8242L15.7244 10.6242Z",
45
+ fill: "#197BBD"
46
+ }),
47
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
48
+ fillRule: "evenodd",
49
+ clipRule: "evenodd",
50
+ d: "M20.4001 12C20.4001 16.6392 16.6393 20.4 12.0001 20.4C7.36091 20.4 3.6001 16.6392 3.6001 12C3.6001 7.36078 7.36091 3.59998 12.0001 3.59998C16.6393 3.59998 20.4001 7.36078 20.4001 12ZM19.2001 12C19.2001 15.9764 15.9765 19.2 12.0001 19.2C8.02365 19.2 4.8001 15.9764 4.8001 12C4.8001 8.02352 8.02365 4.79998 12.0001 4.79998C15.9765 4.79998 19.2001 8.02352 19.2001 12Z",
51
+ fill: "#197BBD"
52
+ })
53
+ ]
54
+ }),
55
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
56
+ className: "gp-ml-4",
57
+ children: [
58
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
59
+ className: "gp-text-sm",
60
+ children: "Order #1001"
61
+ }),
62
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
63
+ children: "You’ve paid for your order."
64
+ }),
65
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
66
+ className: "gp-mt-1 gp-flex gp-items-center gp-text-[#197BBD]",
67
+ children: [
68
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
69
+ className: "gp-text-sm",
70
+ children: "View order confirmation"
71
+ }),
72
+ /*#__PURE__*/ jsxRuntime.jsx("svg", {
73
+ width: "12",
74
+ height: "13",
75
+ viewBox: "0 0 12 13",
76
+ fill: "none",
77
+ xmlns: "http://www.w3.org/2000/svg",
78
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
79
+ fillRule: "evenodd",
80
+ clipRule: "evenodd",
81
+ d: "M4.6318 9.21817C4.45607 9.04244 4.45607 8.75751 4.6318 8.58178L6.7136 6.49998L4.6318 4.41817C4.45607 4.24244 4.45607 3.95751 4.6318 3.78178C4.80754 3.60604 5.09246 3.60604 5.2682 3.78178L7.6682 6.18178C7.84393 6.35751 7.84393 6.64244 7.6682 6.81817L5.2682 9.21817C5.09246 9.39391 4.80754 9.39391 4.6318 9.21817Z",
82
+ fill: "#197BBD"
83
+ })
84
+ })
85
+ ]
86
+ })
87
+ ]
88
+ })
89
+ ]
90
+ })
91
+ }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
19
92
  className: "gp-flex gp-h-[40px] gp-flex-1 gp-items-center gp-justify-between",
20
93
  style: {
21
94
  maxWidth: `var(--g-ct-w)`,
22
95
  ...core.makeStyleResponsive('ml', defaultMargin),
23
96
  ...core.makeStyleResponsive('mr', defaultMargin)
24
97
  },
25
- children: [
26
- /*#__PURE__*/ jsxRuntime.jsxs("svg", {
27
- width: "84",
28
- height: "8",
29
- viewBox: "0 0 84 8",
30
- fill: "none",
31
- xmlns: "http://www.w3.org/2000/svg",
32
- children: [
33
- /*#__PURE__*/ jsxRuntime.jsx("path", {
34
- d: "M0 4C0 1.79086 1.79086 0 4 0H18C20.2091 0 22 1.79086 22 4C22 6.20914 20.2091 8 18 8H4C1.79086 8 0 6.20914 0 4Z",
35
- fill: layoutSetting?.showHeader ? '#9E9E9E' : HEADER_OFF_COLOR
36
- }),
37
- /*#__PURE__*/ jsxRuntime.jsx("path", {
38
- d: "M28 4C28 1.79086 29.7909 0 32 0H80C82.2091 0 84 1.79086 84 4C84 6.20914 82.2091 8 80 8H32C29.7909 8 28 6.20914 28 4Z",
39
- fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
40
- })
41
- ]
42
- }),
43
- /*#__PURE__*/ jsxRuntime.jsx("div", {
44
- className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-w-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#0000001a] group-hover:gp-visible",
45
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
46
- className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
47
- children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
48
- width: "14",
49
- height: "14",
50
- viewBox: "0 0 14 14",
51
- fill: "none",
52
- xmlns: "http://www.w3.org/2000/svg",
53
- children: [
54
- /*#__PURE__*/ jsxRuntime.jsx("path", {
55
- fillRule: "evenodd",
56
- clipRule: "evenodd",
57
- d: "M6.99985 4.08501C5.38983 4.08501 4.08465 5.39019 4.08465 7.00021C4.08465 8.61023 5.38983 9.9154 6.99985 9.9154C8.60987 9.9154 9.91504 8.61023 9.91504 7.00021C9.91504 5.39019 8.60987 4.08501 6.99985 4.08501ZM5.08465 7.00021C5.08465 5.94247 5.94211 5.08501 6.99985 5.08501C8.05758 5.08501 8.91504 5.94247 8.91504 7.00021C8.91504 8.05794 8.05758 8.9154 6.99985 8.9154C5.94211 8.9154 5.08465 8.05794 5.08465 7.00021Z",
58
- fill: "#212121"
59
- }),
60
- /*#__PURE__*/ jsxRuntime.jsx("path", {
61
- fillRule: "evenodd",
62
- clipRule: "evenodd",
63
- d: "M5.52351 0.00390625C5.28138 0.00390625 5.07405 0.177388 5.03135 0.415715L4.7415 2.03321C4.40346 2.18248 4.08346 2.36419 3.78558 2.57432L2.18557 2.00147C1.95684 1.91958 1.70235 2.01395 1.58232 2.22517L0.122204 4.79451C0.00217064 5.00572 0.0513362 5.27266 0.238747 5.42725L1.50086 6.46836C1.48358 6.64355 1.47474 6.82106 1.47474 7.00047C1.47474 7.17981 1.48357 7.35726 1.50084 7.53238L0.238747 8.57347C0.0513362 8.72806 0.00217064 8.995 0.122203 9.20622L1.58232 11.7756C1.70235 11.9868 1.95684 12.0811 2.18557 11.9993L3.78537 11.4265C4.08332 11.6367 4.40341 11.8185 4.74155 11.9678L5.03135 13.585C5.07405 13.8233 5.28138 13.9968 5.52351 13.9968H8.47647C8.7186 13.9968 8.92593 13.8233 8.96863 13.585L9.25846 11.9676C9.5965 11.8183 9.91649 11.6365 10.2144 11.4264L11.8144 11.9993C12.0431 12.0811 12.2976 11.9868 12.4177 11.7756L13.8778 9.20622C13.9978 8.995 13.9486 8.72806 13.7612 8.57347L12.4988 7.5321C12.516 7.35706 12.5249 7.17971 12.5249 7.00047C12.5249 6.82116 12.516 6.64375 12.4988 6.46864L13.7612 5.42725C13.9486 5.27266 13.9978 5.00572 13.8778 4.79451L12.4177 2.22517C12.2976 2.01395 12.0431 1.91958 11.8144 2.00147L10.2141 2.57441C9.91636 2.36433 9.59645 2.18264 9.25851 2.0334L8.96863 0.415715C8.92593 0.177389 8.7186 0.00390625 8.47647 0.00390625H5.52351ZM5.67747 2.47943L5.94187 1.00391H8.0581L8.32253 2.47958C8.35348 2.6523 8.47271 2.79616 8.63668 2.85863C9.06768 3.02283 9.46674 3.25007 9.82215 3.5288C9.95734 3.63483 10.1375 3.66402 10.2993 3.6061L11.7559 3.08459L12.8007 4.92323L11.6503 5.8722C11.5145 5.98427 11.4476 6.15956 11.4743 6.33366C11.5076 6.55089 11.5249 6.77354 11.5249 7.00047C11.5249 7.22735 11.5076 7.44993 11.4743 7.66711C11.4476 7.8412 11.5145 8.01648 11.6504 8.12855L12.8007 9.07749L11.7559 10.9161L10.2994 10.3947C10.1377 10.3368 9.95752 10.366 9.82233 10.472C9.46686 10.7508 9.06773 10.9781 8.63664 11.1423C8.47267 11.2048 8.35344 11.3487 8.32249 11.5214L8.0581 12.9968H5.94187L5.67752 11.5215C5.64656 11.3488 5.52732 11.2049 5.36333 11.1425C4.93215 10.9782 4.53292 10.7509 4.17738 10.4721C4.04219 10.3661 3.86203 10.3369 3.70027 10.3948L2.24412 10.9161L1.19924 9.07749L2.34929 8.12883C2.48516 8.01675 2.55204 7.84146 2.52535 7.66736C2.49205 7.4501 2.47474 7.22743 2.47474 7.00047C2.47474 6.77345 2.49206 6.55072 2.52538 6.33341C2.55207 6.15931 2.48519 5.984 2.34932 5.87192L1.19924 4.92323L2.24412 3.08459L3.70047 3.60601C3.86221 3.66392 4.04236 3.63474 4.17755 3.52872C4.53304 3.24994 4.93219 3.02269 5.36329 2.85849C5.52728 2.79603 5.64652 2.65216 5.67747 2.47943Z",
64
- fill: "#212121"
65
- })
66
- ]
98
+ children: /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
99
+ children: [
100
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
101
+ width: "84",
102
+ height: "8",
103
+ viewBox: "0 0 84 8",
104
+ fill: "none",
105
+ xmlns: "http://www.w3.org/2000/svg",
106
+ children: [
107
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
108
+ d: "M0 4C0 1.79086 1.79086 0 4 0H18C20.2091 0 22 1.79086 22 4C22 6.20914 20.2091 8 18 8H4C1.79086 8 0 6.20914 0 4Z",
109
+ fill: layoutSetting?.showHeader ? '#9E9E9E' : HEADER_OFF_COLOR
110
+ }),
111
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
112
+ d: "M28 4C28 1.79086 29.7909 0 32 0H80C82.2091 0 84 1.79086 84 4C84 6.20914 82.2091 8 80 8H32C29.7909 8 28 6.20914 28 4Z",
113
+ fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
114
+ })
115
+ ]
116
+ }),
117
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
118
+ className: "gp-header gp-invisible gp-absolute gp-left-[8px] gp-flex gp-h-[24px] gp-w-[24px] gp-cursor-pointer gp-items-center gp-justify-center gp-rounded gp-bg-[#EEEEEE] gp-p-[4px] hover:gp-bg-[#0000001a] group-hover:gp-visible",
119
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
120
+ className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
121
+ children: /*#__PURE__*/ jsxRuntime.jsxs("svg", {
122
+ width: "14",
123
+ height: "14",
124
+ viewBox: "0 0 14 14",
125
+ fill: "none",
126
+ xmlns: "http://www.w3.org/2000/svg",
127
+ children: [
128
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
129
+ fillRule: "evenodd",
130
+ clipRule: "evenodd",
131
+ d: "M6.99985 4.08501C5.38983 4.08501 4.08465 5.39019 4.08465 7.00021C4.08465 8.61023 5.38983 9.9154 6.99985 9.9154C8.60987 9.9154 9.91504 8.61023 9.91504 7.00021C9.91504 5.39019 8.60987 4.08501 6.99985 4.08501ZM5.08465 7.00021C5.08465 5.94247 5.94211 5.08501 6.99985 5.08501C8.05758 5.08501 8.91504 5.94247 8.91504 7.00021C8.91504 8.05794 8.05758 8.9154 6.99985 8.9154C5.94211 8.9154 5.08465 8.05794 5.08465 7.00021Z",
132
+ fill: "#212121"
133
+ }),
134
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
135
+ fillRule: "evenodd",
136
+ clipRule: "evenodd",
137
+ d: "M5.52351 0.00390625C5.28138 0.00390625 5.07405 0.177388 5.03135 0.415715L4.7415 2.03321C4.40346 2.18248 4.08346 2.36419 3.78558 2.57432L2.18557 2.00147C1.95684 1.91958 1.70235 2.01395 1.58232 2.22517L0.122204 4.79451C0.00217064 5.00572 0.0513362 5.27266 0.238747 5.42725L1.50086 6.46836C1.48358 6.64355 1.47474 6.82106 1.47474 7.00047C1.47474 7.17981 1.48357 7.35726 1.50084 7.53238L0.238747 8.57347C0.0513362 8.72806 0.00217064 8.995 0.122203 9.20622L1.58232 11.7756C1.70235 11.9868 1.95684 12.0811 2.18557 11.9993L3.78537 11.4265C4.08332 11.6367 4.40341 11.8185 4.74155 11.9678L5.03135 13.585C5.07405 13.8233 5.28138 13.9968 5.52351 13.9968H8.47647C8.7186 13.9968 8.92593 13.8233 8.96863 13.585L9.25846 11.9676C9.5965 11.8183 9.91649 11.6365 10.2144 11.4264L11.8144 11.9993C12.0431 12.0811 12.2976 11.9868 12.4177 11.7756L13.8778 9.20622C13.9978 8.995 13.9486 8.72806 13.7612 8.57347L12.4988 7.5321C12.516 7.35706 12.5249 7.17971 12.5249 7.00047C12.5249 6.82116 12.516 6.64375 12.4988 6.46864L13.7612 5.42725C13.9486 5.27266 13.9978 5.00572 13.8778 4.79451L12.4177 2.22517C12.2976 2.01395 12.0431 1.91958 11.8144 2.00147L10.2141 2.57441C9.91636 2.36433 9.59645 2.18264 9.25851 2.0334L8.96863 0.415715C8.92593 0.177389 8.7186 0.00390625 8.47647 0.00390625H5.52351ZM5.67747 2.47943L5.94187 1.00391H8.0581L8.32253 2.47958C8.35348 2.6523 8.47271 2.79616 8.63668 2.85863C9.06768 3.02283 9.46674 3.25007 9.82215 3.5288C9.95734 3.63483 10.1375 3.66402 10.2993 3.6061L11.7559 3.08459L12.8007 4.92323L11.6503 5.8722C11.5145 5.98427 11.4476 6.15956 11.4743 6.33366C11.5076 6.55089 11.5249 6.77354 11.5249 7.00047C11.5249 7.22735 11.5076 7.44993 11.4743 7.66711C11.4476 7.8412 11.5145 8.01648 11.6504 8.12855L12.8007 9.07749L11.7559 10.9161L10.2994 10.3947C10.1377 10.3368 9.95752 10.366 9.82233 10.472C9.46686 10.7508 9.06773 10.9781 8.63664 11.1423C8.47267 11.2048 8.35344 11.3487 8.32249 11.5214L8.0581 12.9968H5.94187L5.67752 11.5215C5.64656 11.3488 5.52732 11.2049 5.36333 11.1425C4.93215 10.9782 4.53292 10.7509 4.17738 10.4721C4.04219 10.3661 3.86203 10.3369 3.70027 10.3948L2.24412 10.9161L1.19924 9.07749L2.34929 8.12883C2.48516 8.01675 2.55204 7.84146 2.52535 7.66736C2.49205 7.4501 2.47474 7.22743 2.47474 7.00047C2.47474 6.77345 2.49206 6.55072 2.52538 6.33341C2.55207 6.15931 2.48519 5.984 2.34932 5.87192L1.19924 4.92323L2.24412 3.08459L3.70047 3.60601C3.86221 3.66392 4.04236 3.63474 4.17755 3.52872C4.53304 3.24994 4.93219 3.02269 5.36329 2.85849C5.52728 2.79603 5.64652 2.65216 5.67747 2.47943Z",
138
+ fill: "#212121"
139
+ })
140
+ ]
141
+ })
67
142
  })
143
+ }),
144
+ /*#__PURE__*/ jsxRuntime.jsxs("svg", {
145
+ width: "192",
146
+ height: "8",
147
+ viewBox: "0 0 192 8",
148
+ fill: "none",
149
+ xmlns: "http://www.w3.org/2000/svg",
150
+ children: [
151
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
152
+ d: "M0 4C0 1.79086 1.79086 0 4 0H52C54.2091 0 56 1.79086 56 4C56 6.20914 54.2091 8 52 8H4C1.79086 8 0 6.20914 0 4Z",
153
+ fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
154
+ }),
155
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
156
+ d: "M68 4C68 1.79086 69.7909 0 72 0H120C122.209 0 124 1.79086 124 4C124 6.20914 122.209 8 120 8H72C69.7909 8 68 6.20914 68 4Z",
157
+ fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
158
+ }),
159
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
160
+ d: "M136 4C136 1.79086 137.791 0 140 0H188C190.209 0 192 1.79086 192 4C192 6.20914 190.209 8 188 8H140C137.791 8 136 6.20914 136 4Z",
161
+ fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
162
+ })
163
+ ]
68
164
  })
69
- }),
70
- /*#__PURE__*/ jsxRuntime.jsxs("svg", {
71
- width: "192",
72
- height: "8",
73
- viewBox: "0 0 192 8",
74
- fill: "none",
75
- xmlns: "http://www.w3.org/2000/svg",
76
- children: [
77
- /*#__PURE__*/ jsxRuntime.jsx("path", {
78
- d: "M0 4C0 1.79086 1.79086 0 4 0H52C54.2091 0 56 1.79086 56 4C56 6.20914 54.2091 8 52 8H4C1.79086 8 0 6.20914 0 4Z",
79
- fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
80
- }),
81
- /*#__PURE__*/ jsxRuntime.jsx("path", {
82
- d: "M68 4C68 1.79086 69.7909 0 72 0H120C122.209 0 124 1.79086 124 4C124 6.20914 122.209 8 120 8H72C69.7909 8 68 6.20914 68 4Z",
83
- fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
84
- }),
85
- /*#__PURE__*/ jsxRuntime.jsx("path", {
86
- d: "M136 4C136 1.79086 137.791 0 140 0H188C190.209 0 192 1.79086 192 4C192 6.20914 190.209 8 188 8H140C137.791 8 136 6.20914 136 4Z",
87
- fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
88
- })
89
- ]
90
- })
91
- ]
165
+ ]
166
+ })
92
167
  })
93
168
  });
94
169
  };
@@ -16,6 +16,27 @@ const isSticky = (el)=>{
16
16
  const tag = el.getAttribute('data-component-tag');
17
17
  return tag === 'Sticky';
18
18
  };
19
+ const isOverToolbarPosition = (el, parent1)=>{
20
+ const rect = el.getBoundingClientRect();
21
+ const rectP = parent1.getBoundingClientRect();
22
+ // 32px = toolbar active height
23
+ return rect.top - rectP.top < TOOLBAR_ACTIVE_HEIGHT + 1;
24
+ };
25
+ const findOverflowParent = (element, initEl)=>{
26
+ const thisEl = element;
27
+ const origEl = initEl || thisEl;
28
+ if (!thisEl) return;
29
+ if (isSection(thisEl)) return;
30
+ if (notVisible(thisEl) && isOverToolbarPosition(initEl, thisEl)) return thisEl;
31
+ if (thisEl.parentElement) {
32
+ return findOverflowParent(thisEl.parentElement, origEl);
33
+ } else {
34
+ return;
35
+ }
36
+ };
37
+ const COMPONENTS_TAG_NOT_LOAD_IMAGES = [
38
+ 'PostPurchaseProductImages'
39
+ ];
19
40
  const Toolbar = ()=>{
20
41
  const currentComponentActive = react.useRef(null);
21
42
  const isDragging = react.useRef(false);
@@ -274,13 +295,17 @@ const Toolbar = ()=>{
274
295
  };
275
296
  window.removeEventListener('editor:component:render', onComponentReRender);
276
297
  window.addEventListener('editor:component:render', onComponentReRender);
277
- const $images = $el.querySelectorAll('img');
278
- if ($images?.length) {
279
- $images.forEach(($img)=>{
280
- $img.addEventListener('load', ()=>{
281
- callback();
298
+ const componentTag = $el.getAttribute('data-component-tag');
299
+ // hotfix cho sale funnel release, nhưng cần tìm solution cho phần này
300
+ if (componentTag && !COMPONENTS_TAG_NOT_LOAD_IMAGES.includes(componentTag)) {
301
+ const $images = $el.querySelectorAll('img');
302
+ if ($images?.length) {
303
+ $images.forEach(($img)=>{
304
+ $img.addEventListener('load', ()=>{
305
+ callback();
306
+ });
282
307
  });
283
- });
308
+ }
284
309
  }
285
310
  stopWatchReRenderComponent.current = ()=>{
286
311
  window.removeEventListener('editor:component:render', onComponentReRender);
@@ -860,24 +885,6 @@ const isSection = (el)=>{
860
885
  const tag = el.getAttribute('data-component-tag');
861
886
  return tag === 'Section';
862
887
  };
863
- const isOverToolbarPosition = (el, parent1)=>{
864
- const rect = el.getBoundingClientRect();
865
- const rectP = parent1.getBoundingClientRect();
866
- // 32px = toolbar active height
867
- return rect.top - rectP.top < TOOLBAR_ACTIVE_HEIGHT + 1;
868
- };
869
- const findOverflowParent = (element, initEl)=>{
870
- const thisEl = element;
871
- const origEl = initEl || thisEl;
872
- if (!thisEl) return;
873
- if (isSection(thisEl)) return;
874
- if (notVisible(thisEl) && isOverToolbarPosition(initEl, thisEl)) return thisEl;
875
- if (thisEl.parentElement) {
876
- return findOverflowParent(thisEl.parentElement, origEl);
877
- } else {
878
- return;
879
- }
880
- };
881
888
  var Toolbar$1 = /*#__PURE__*/ react.memo(Toolbar);
882
889
 
883
890
  exports.default = Toolbar$1;
@@ -17,6 +17,8 @@ const Toolbox = ()=>{
17
17
  const provider = core.useShopStore((s)=>s.provider);
18
18
  const changeStorefrontInfo = core.useShopStore((s)=>s.changeStorefrontInfo);
19
19
  const setDynamicProduct = core.usePageStore((s)=>s.setDynamicProduct);
20
+ const setPostPurchaseProductOffers = core.usePageStore((s)=>s.setPostPurchaseProductOffers);
21
+ const setSalePageProductId = core.usePageStore((s)=>s.setSalePageProductId);
20
22
  const setDynamicCollection = core.usePageStore((s)=>s.setDynamicCollection);
21
23
  const initState = core.useBuilderPreviewStore((s)=>s.initState);
22
24
  const state = core.useBuilderPreviewStore((s)=>s.state);
@@ -313,6 +315,20 @@ const Toolbox = ()=>{
313
315
  }, [
314
316
  updateItemAttribute
315
317
  ]);
318
+ const onUpdateProductOffers = react.useCallback((e)=>{
319
+ const productOffers = e.detail;
320
+ if (!productOffers?.length) return;
321
+ setPostPurchaseProductOffers(productOffers);
322
+ }, [
323
+ setPostPurchaseProductOffers
324
+ ]);
325
+ const onUpdateSalePageProductId = react.useCallback((e)=>{
326
+ const id = e.detail;
327
+ if (!id) return;
328
+ setSalePageProductId(id);
329
+ }, [
330
+ setSalePageProductId
331
+ ]);
316
332
  react.useEffect(()=>{
317
333
  if (fonts) {
318
334
  setFontsToHead('google-font-element', fonts);
@@ -338,6 +354,8 @@ const Toolbox = ()=>{
338
354
  window.addEventListener('set-dynamic-collection', onUpdateDynamicCollection);
339
355
  window.addEventListener('update-item-name', onUpdateItemName);
340
356
  window.addEventListener('update-item-attribute', onUpdateItemAttribute);
357
+ window.addEventListener('set-product-offer', onUpdateProductOffers);
358
+ window.addEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
341
359
  return ()=>{
342
360
  window.removeEventListener('update-shop-info', onChangeShopInfo);
343
361
  window.removeEventListener('revalidate-query', onRevalidateQuery);
@@ -355,6 +373,8 @@ const Toolbox = ()=>{
355
373
  window.removeEventListener('set-dynamic-collection', onUpdateDynamicCollection);
356
374
  window.removeEventListener('update-item-name', onUpdateItemName);
357
375
  window.removeEventListener('update-item-attribute', onUpdateItemAttribute);
376
+ window.removeEventListener('set-product-offer', onUpdateProductOffers);
377
+ window.removeEventListener('update-sale-page-product-id', onUpdateSalePageProductId);
358
378
  };
359
379
  }, [
360
380
  onAddEntity,
@@ -373,7 +393,9 @@ const Toolbox = ()=>{
373
393
  onUpdateDynamicProduct,
374
394
  onUpdateDynamicCollection,
375
395
  onUpdateItemName,
376
- onUpdateItemAttribute
396
+ onUpdateItemAttribute,
397
+ onUpdateProductOffers,
398
+ onUpdateSalePageProductId
377
399
  ]);
378
400
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
379
401
  className: "toolbox"