@gem-sdk/pages 1.41.0-dev.21 → 1.41.0-staging.13
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.
- package/dist/cjs/components/Footer.js +8 -11
- package/dist/cjs/components/Header.js +69 -70
- package/dist/cjs/components/builder/Toolbar.js +31 -35
- package/dist/cjs/components/image-to-layout/AddSectionImageToLayout.js +27 -16
- package/dist/cjs/pages/builder.js +3 -5
- package/dist/esm/components/Footer.js +8 -11
- package/dist/esm/components/Header.js +70 -71
- package/dist/esm/components/builder/Toolbar.js +31 -35
- package/dist/esm/components/image-to-layout/AddSectionImageToLayout.js +27 -16
- package/dist/esm/pages/builder.js +3 -5
- package/dist/types/index.d.ts +0 -1
- package/package.json +2 -2
|
@@ -11,15 +11,12 @@ const defaultMargin = {
|
|
|
11
11
|
tablet: '40px',
|
|
12
12
|
mobile: '40px'
|
|
13
13
|
};
|
|
14
|
-
const FOOTER_ON_COLOR = '#D6D6D6';
|
|
15
14
|
const FOOTER_OFF_COLOR = '#F4F4F4';
|
|
16
15
|
const Footer = (props)=>{
|
|
17
|
-
const { pageType
|
|
16
|
+
const { pageType } = props;
|
|
18
17
|
const urlParams = new URLSearchParams(window.location.search);
|
|
19
18
|
const shopName = urlParams.get('storefrontHandle');
|
|
20
19
|
const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
|
|
21
|
-
const activeFooter = layoutSetting?.showFooter || isOriginTemplate;
|
|
22
|
-
const footerColor = activeFooter ? FOOTER_ON_COLOR : FOOTER_OFF_COLOR;
|
|
23
20
|
const [shouldFixed, setShouldFixed] = react.useState(false);
|
|
24
21
|
react.useEffect(()=>{
|
|
25
22
|
const $iframe = parent.document.querySelector('.iframe');
|
|
@@ -81,19 +78,19 @@ const Footer = (props)=>{
|
|
|
81
78
|
children: [
|
|
82
79
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
83
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",
|
|
84
|
-
fill:
|
|
81
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
85
82
|
}),
|
|
86
83
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
87
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",
|
|
88
|
-
fill:
|
|
85
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
89
86
|
}),
|
|
90
87
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
91
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",
|
|
92
|
-
fill:
|
|
89
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
93
90
|
})
|
|
94
91
|
]
|
|
95
92
|
}),
|
|
96
|
-
|
|
93
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
97
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",
|
|
98
95
|
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
99
96
|
className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
|
|
@@ -129,15 +126,15 @@ const Footer = (props)=>{
|
|
|
129
126
|
children: [
|
|
130
127
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
131
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",
|
|
132
|
-
fill:
|
|
129
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
133
130
|
}),
|
|
134
131
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
135
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",
|
|
136
|
-
fill:
|
|
133
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
137
134
|
}),
|
|
138
135
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
139
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",
|
|
140
|
-
fill:
|
|
137
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
141
138
|
})
|
|
142
139
|
]
|
|
143
140
|
})
|
|
@@ -10,7 +10,6 @@ const defaultMargin = {
|
|
|
10
10
|
tablet: '40px',
|
|
11
11
|
mobile: '40px'
|
|
12
12
|
};
|
|
13
|
-
const HEADER_ON_COLOR = '#D6D6D6';
|
|
14
13
|
const HEADER_OFF_COLOR = '#F4F4F4';
|
|
15
14
|
const sizeCheck = {
|
|
16
15
|
desktop: '24px',
|
|
@@ -18,10 +17,8 @@ const sizeCheck = {
|
|
|
18
17
|
mobile: '36px'
|
|
19
18
|
};
|
|
20
19
|
const Header = (props)=>{
|
|
21
|
-
const { pageType
|
|
20
|
+
const { pageType } = props;
|
|
22
21
|
const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
|
|
23
|
-
const activeHeader = layoutSetting?.showHeader || isOriginTemplate;
|
|
24
|
-
const headerColor = activeHeader ? HEADER_ON_COLOR : HEADER_OFF_COLOR;
|
|
25
22
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
26
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'),
|
|
27
24
|
children: pageType === 'POST_PURCHASE' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -91,80 +88,82 @@ const Header = (props)=>{
|
|
|
91
88
|
})
|
|
92
89
|
]
|
|
93
90
|
})
|
|
94
|
-
}) : /*#__PURE__*/ jsxRuntime.
|
|
91
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
95
92
|
className: "gp-flex gp-h-[40px] gp-flex-1 gp-items-center gp-justify-between",
|
|
96
93
|
style: {
|
|
97
94
|
maxWidth: `var(--g-ct-w)`,
|
|
98
95
|
...core.makeStyleResponsive('ml', defaultMargin),
|
|
99
96
|
...core.makeStyleResponsive('mr', defaultMargin)
|
|
100
97
|
},
|
|
101
|
-
children:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
+
})
|
|
143
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
|
+
]
|
|
144
164
|
})
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
width: "192",
|
|
148
|
-
height: "8",
|
|
149
|
-
viewBox: "0 0 192 8",
|
|
150
|
-
fill: "none",
|
|
151
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
152
|
-
children: [
|
|
153
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
154
|
-
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",
|
|
155
|
-
fill: headerColor
|
|
156
|
-
}),
|
|
157
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
158
|
-
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",
|
|
159
|
-
fill: headerColor
|
|
160
|
-
}),
|
|
161
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
162
|
-
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",
|
|
163
|
-
fill: headerColor
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
})
|
|
167
|
-
]
|
|
165
|
+
]
|
|
166
|
+
})
|
|
168
167
|
})
|
|
169
168
|
});
|
|
170
169
|
};
|
|
@@ -85,7 +85,7 @@ const Toolbar = ()=>{
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
const setHoverComponent = react.useCallback(({ $component, componentUid, focus,
|
|
88
|
+
const setHoverComponent = react.useCallback(({ $component, componentUid, focus, isThemeSection, isParent })=>{
|
|
89
89
|
if (!$component && !componentUid) return;
|
|
90
90
|
if (!$component) {
|
|
91
91
|
const $c = document.querySelector(`[data-uid="${componentUid}"]`);
|
|
@@ -102,7 +102,7 @@ const Toolbar = ()=>{
|
|
|
102
102
|
const $btnAddTop = getChildrenByAttrSelector($component, 'data-toolbar-add-top');
|
|
103
103
|
const $btnAddBottom = getChildrenByAttrSelector($component, 'data-toolbar-add-bottom');
|
|
104
104
|
const $themeSectionStatus = getChildrenByAttrSelector($component, 'data-theme-section-status');
|
|
105
|
-
if (
|
|
105
|
+
if (isThemeSection && $themeSectionStatus) {
|
|
106
106
|
$themeSectionStatus.setAttribute('data-theme-section-status-active', 'true');
|
|
107
107
|
}
|
|
108
108
|
if ($toolbar) {
|
|
@@ -124,7 +124,7 @@ const Toolbar = ()=>{
|
|
|
124
124
|
if (isParent) {
|
|
125
125
|
$outline.setAttribute('data-outline-parent-hover', 'true');
|
|
126
126
|
}
|
|
127
|
-
if (
|
|
127
|
+
if (isThemeSection) {
|
|
128
128
|
$outline.setAttribute('data-outline-overlay-theme-section', 'true');
|
|
129
129
|
}
|
|
130
130
|
if (focus) {
|
|
@@ -379,25 +379,25 @@ const Toolbar = ()=>{
|
|
|
379
379
|
countShowOnboarding,
|
|
380
380
|
onCloseOnboarding
|
|
381
381
|
]);
|
|
382
|
-
const
|
|
383
|
-
if (marqueeKey) {
|
|
384
|
-
return `[marquee-item-key="${marqueeKey}"] [data-uid="${componentUid}"]`;
|
|
385
|
-
}
|
|
386
|
-
return `${productId ? `[data-product-id="${productId}"][data-uid="${componentUid}"], [data-product-id="${productId}"] [data-uid="${componentUid}"]` : `[data-uid="${componentUid}"]`}`;
|
|
387
|
-
};
|
|
388
|
-
const setActiveComponent = react.useCallback(async ({ componentUid, productId, timeAwait = 600, forceReActive, marqueeKey })=>{
|
|
382
|
+
const setActiveComponent = react.useCallback(async ({ componentUid, productId, timeAwait = 500, forceReActive })=>{
|
|
389
383
|
if (!componentUid) return;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
384
|
+
let $component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"][data-uid="${componentUid}"], [data-product-id="${productId}"] [data-uid="${componentUid}"]` : `[data-uid="${componentUid}"]`}`, timeAwait);
|
|
385
|
+
// check element fetch data: product, product list
|
|
386
|
+
if (!$component) {
|
|
387
|
+
const isLoading = document.querySelector(`.gp-loading-placeholder`);
|
|
388
|
+
if (!isLoading) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (isLoading) {
|
|
392
|
+
// await element onload
|
|
393
|
+
$component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 15000);
|
|
394
|
+
}
|
|
400
395
|
}
|
|
396
|
+
if (!$component) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (!forceReActive && componentUid == currentComponentActive.current?.componentUid && productId == currentComponentActive.current?.productId) return;
|
|
400
|
+
if (componentUid !== currentComponentActive.current?.componentUid || productId !== currentComponentActive.current?.productId || forceReActive) removeActiveComponent();
|
|
401
401
|
const $toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
|
|
402
402
|
const $outline = getChildrenByAttrSelector($component, 'data-outline');
|
|
403
403
|
const $btnAddTop = getChildrenByAttrSelector($component, 'data-toolbar-add-top');
|
|
@@ -405,8 +405,7 @@ const Toolbar = ()=>{
|
|
|
405
405
|
if ($toolbar) {
|
|
406
406
|
currentComponentActive.current = {
|
|
407
407
|
componentUid,
|
|
408
|
-
productId
|
|
409
|
-
marqueeKey
|
|
408
|
+
productId
|
|
410
409
|
};
|
|
411
410
|
$toolbar.removeAttribute('style');
|
|
412
411
|
$toolbar.setAttribute('data-toolbar-active', 'true');
|
|
@@ -425,9 +424,8 @@ const Toolbar = ()=>{
|
|
|
425
424
|
if ($btnAddBottom) {
|
|
426
425
|
$btnAddBottom.setAttribute('data-toolbar-add-active', 'true');
|
|
427
426
|
}
|
|
428
|
-
const isChildOfMarquee = !!$component.closest('[data-component-tag="Marquee"]');
|
|
429
427
|
// Active same element in product list
|
|
430
|
-
if (productId
|
|
428
|
+
if (productId) {
|
|
431
429
|
const $relatedElements = document.querySelectorAll(`[data-uid="${componentUid}"]`);
|
|
432
430
|
if ($relatedElements?.length) {
|
|
433
431
|
$relatedElements.forEach(($relatedElement)=>{
|
|
@@ -482,7 +480,6 @@ const Toolbar = ()=>{
|
|
|
482
480
|
const componentUid = currentComponentActive.current?.componentUid;
|
|
483
481
|
const productId = currentComponentActive.current?.productId;
|
|
484
482
|
const $component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 500);
|
|
485
|
-
console.log(' $component', $component);
|
|
486
483
|
if ($component) {
|
|
487
484
|
const $toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
|
|
488
485
|
const $outline = getChildrenByAttrSelector($component, 'data-outline');
|
|
@@ -635,23 +632,23 @@ const Toolbar = ()=>{
|
|
|
635
632
|
}
|
|
636
633
|
}
|
|
637
634
|
}
|
|
638
|
-
const $
|
|
639
|
-
if ($
|
|
635
|
+
const $themeSection = $target.closest('[data-theme-section]');
|
|
636
|
+
if ($themeSection) {
|
|
640
637
|
setHoverComponent({
|
|
641
|
-
$component: $
|
|
638
|
+
$component: $themeSection,
|
|
642
639
|
focus: true,
|
|
643
|
-
|
|
640
|
+
isThemeSection: true
|
|
644
641
|
});
|
|
645
642
|
} else {
|
|
646
643
|
return;
|
|
647
644
|
}
|
|
648
645
|
}
|
|
649
|
-
const $
|
|
650
|
-
if ($
|
|
646
|
+
const $themeSection = $target.closest('[data-theme-section]');
|
|
647
|
+
if ($themeSection) {
|
|
651
648
|
setHoverComponent({
|
|
652
|
-
$component: $
|
|
649
|
+
$component: $themeSection,
|
|
653
650
|
focus: true,
|
|
654
|
-
|
|
651
|
+
isThemeSection: true
|
|
655
652
|
});
|
|
656
653
|
} else {
|
|
657
654
|
setHoverComponent({
|
|
@@ -678,8 +675,7 @@ const Toolbar = ()=>{
|
|
|
678
675
|
if (detail?.componentUid) {
|
|
679
676
|
setActiveComponent({
|
|
680
677
|
componentUid: detail.componentUid,
|
|
681
|
-
productId: detail.productId
|
|
682
|
-
marqueeKey: detail.marqueeKey
|
|
678
|
+
productId: detail.productId
|
|
683
679
|
});
|
|
684
680
|
} else {
|
|
685
681
|
removeActiveComponent();
|
|
@@ -14,14 +14,22 @@ const BASE_DATA = [
|
|
|
14
14
|
id: 'gps-add-section-bottom-from-library'
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
title: '
|
|
18
|
-
content: '
|
|
19
|
-
hasAILogo:
|
|
17
|
+
title: 'Insert URL',
|
|
18
|
+
content: 'to generate layout',
|
|
19
|
+
hasAILogo: false,
|
|
20
20
|
id: 'gps-add-section-bottom-from-url'
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
title: '
|
|
24
|
-
content: '
|
|
23
|
+
title: 'Upload image',
|
|
24
|
+
content: 'to generate layout',
|
|
25
|
+
hasAILogo: false,
|
|
26
|
+
id: 'gps-add-section-bottom-from-image'
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
const POST_PURCHASE_PAGE_DATA = [
|
|
30
|
+
{
|
|
31
|
+
title: 'Blank section',
|
|
32
|
+
content: 'to start from scratch',
|
|
25
33
|
hasAILogo: false,
|
|
26
34
|
id: 'gps-add-section-blank'
|
|
27
35
|
}
|
|
@@ -45,7 +53,10 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
45
53
|
'gps-add-section-bottom-from-image',
|
|
46
54
|
'gps-add-section-bottom-from-library'
|
|
47
55
|
];
|
|
48
|
-
ACTIONS_DATA =
|
|
56
|
+
ACTIONS_DATA = [
|
|
57
|
+
...POST_PURCHASE_PAGE_DATA,
|
|
58
|
+
...BASE_DATA
|
|
59
|
+
].filter((item)=>!dataIdNotPostPurchase.includes(item.id));
|
|
49
60
|
}
|
|
50
61
|
react.useEffect(()=>{
|
|
51
62
|
if (!isInput || totalSection === 0) {
|
|
@@ -89,35 +100,35 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
89
100
|
}),
|
|
90
101
|
ACTIONS_DATA.map((action)=>{
|
|
91
102
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
92
|
-
className: `gp-relative gp-mx-1 gp-h-[60px]
|
|
103
|
+
className: `gp-relative gp-mx-1 gp-h-[60px] gp-w-[172px] gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 ${isInput ? 'gp-hidden' : 'gp-flex'}`,
|
|
93
104
|
id: action.id,
|
|
94
105
|
"aria-hidden": true,
|
|
95
106
|
children: [
|
|
96
107
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
97
|
-
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]
|
|
108
|
+
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",
|
|
98
109
|
children: [
|
|
99
110
|
action.title,
|
|
100
111
|
action.hasAILogo && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
101
|
-
width: "
|
|
112
|
+
width: "35",
|
|
102
113
|
height: "20",
|
|
103
|
-
viewBox: "0 0
|
|
114
|
+
viewBox: "0 0 35 20",
|
|
104
115
|
fill: "none",
|
|
105
116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
106
117
|
children: [
|
|
107
118
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
108
|
-
d: "M0
|
|
119
|
+
d: "M0 3C0 1.34315 1.34315 0 3 0H32C33.6569 0 35 1.34315 35 3V17C35 18.6569 33.6569 20 32 20H3C1.34315 20 0 18.6569 0 17V3Z",
|
|
109
120
|
fill: "#EBDDF8"
|
|
110
121
|
}),
|
|
111
122
|
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
112
|
-
d: "
|
|
113
|
-
fill: "url(#
|
|
123
|
+
d: "M4.95881 14V5.27273H8.15483C8.77415 5.27273 9.28693 5.375 9.69318 5.57955C10.0994 5.78125 10.4034 6.0554 10.6051 6.40199C10.8068 6.74574 10.9077 7.13352 10.9077 7.56534C10.9077 7.92898 10.8409 8.2358 10.7074 8.4858C10.5739 8.73295 10.3949 8.93182 10.1705 9.08239C9.94886 9.23011 9.70455 9.33807 9.4375 9.40625V9.49148C9.72727 9.50568 10.0099 9.59943 10.2855 9.77273C10.5639 9.94318 10.794 10.1861 10.9759 10.5014C11.1577 10.8168 11.2486 11.2003 11.2486 11.652C11.2486 12.098 11.1435 12.4986 10.9332 12.8537C10.7259 13.206 10.4048 13.4858 9.97017 13.6932C9.53551 13.8977 8.98011 14 8.30398 14H4.95881ZM6.27557 12.8707H8.17614C8.80682 12.8707 9.25852 12.7486 9.53125 12.5043C9.80398 12.2599 9.94034 11.9545 9.94034 11.5881C9.94034 11.3125 9.87074 11.0597 9.73153 10.8295C9.59233 10.5994 9.39347 10.4162 9.13494 10.2798C8.87926 10.1435 8.57528 10.0753 8.22301 10.0753H6.27557V12.8707ZM6.27557 9.0483H8.03977C8.33523 9.0483 8.60085 8.99148 8.83665 8.87784C9.07528 8.7642 9.2642 8.60511 9.40341 8.40057C9.54545 8.19318 9.61648 7.94886 9.61648 7.66761C9.61648 7.30682 9.49006 7.00426 9.23722 6.75994C8.98438 6.51562 8.59659 6.39347 8.07386 6.39347H6.27557V9.0483ZM15.5291 14.1321C14.8842 14.1321 14.3288 13.9943 13.8629 13.7188C13.3999 13.4403 13.0419 13.0497 12.7891 12.5469C12.5391 12.0412 12.4141 11.4489 12.4141 10.7699C12.4141 10.0994 12.5391 9.50852 12.7891 8.99716C13.0419 8.4858 13.3942 8.08665 13.8459 7.79972C14.3004 7.51278 14.8317 7.36932 15.4396 7.36932C15.8089 7.36932 16.1669 7.4304 16.5135 7.55256C16.8601 7.67472 17.1712 7.86648 17.4467 8.12784C17.7223 8.3892 17.9396 8.72869 18.0987 9.14631C18.2578 9.56108 18.3374 10.0653 18.3374 10.6591V11.1108H13.1342V10.1562H17.0888C17.0888 9.82102 17.0206 9.52415 16.8842 9.26562C16.7479 9.00426 16.5561 8.7983 16.3089 8.64773C16.0646 8.49716 15.7777 8.42188 15.4482 8.42188C15.0902 8.42188 14.7777 8.50994 14.5107 8.68608C14.2464 8.85937 14.0419 9.08665 13.897 9.3679C13.755 9.64631 13.6839 9.94886 13.6839 10.2756V11.0213C13.6839 11.4588 13.7607 11.831 13.9141 12.1378C14.0703 12.4446 14.2876 12.679 14.5661 12.8409C14.8445 13 15.1697 13.0795 15.5419 13.0795C15.7834 13.0795 16.0036 13.0455 16.2024 12.9773C16.4013 12.9062 16.5732 12.8011 16.718 12.6619C16.8629 12.5227 16.9737 12.3509 17.0504 12.1463L18.2564 12.3636C18.1598 12.7187 17.9865 13.0298 17.7365 13.2969C17.4893 13.5611 17.1783 13.767 16.8033 13.9148C16.4311 14.0597 16.0064 14.1321 15.5291 14.1321ZM22.8065 7.45455V8.47727H19.2312V7.45455H22.8065ZM20.19 5.88636H21.4641V12.0781C21.4641 12.3253 21.5011 12.5114 21.5749 12.6364C21.6488 12.7585 21.744 12.8423 21.8604 12.8878C21.9798 12.9304 22.109 12.9517 22.2482 12.9517C22.3505 12.9517 22.44 12.9446 22.5167 12.9304C22.5934 12.9162 22.6531 12.9048 22.6957 12.8963L22.9258 13.9489C22.8519 13.9773 22.7468 14.0057 22.6104 14.0341C22.4741 14.0653 22.3036 14.0824 22.0991 14.0852C21.7638 14.0909 21.4513 14.0312 21.1616 13.9062C20.8718 13.7812 20.6374 13.5881 20.4585 13.3267C20.2795 13.0653 20.19 12.7372 20.19 12.3423V5.88636ZM26.1207 14.1449C25.706 14.1449 25.331 14.0682 24.9957 13.9148C24.6605 13.7585 24.3949 13.5327 24.1989 13.2372C24.0057 12.9418 23.9091 12.5795 23.9091 12.1506C23.9091 11.7812 23.9801 11.4773 24.1222 11.2386C24.2642 11 24.456 10.8111 24.6974 10.6719C24.9389 10.5327 25.2088 10.4276 25.5071 10.3565C25.8054 10.2855 26.1094 10.2315 26.419 10.1946C26.8111 10.1491 27.1293 10.1122 27.3736 10.0838C27.6179 10.0526 27.7955 10.0028 27.9062 9.93466C28.017 9.86648 28.0724 9.75568 28.0724 9.60227V9.57244C28.0724 9.20028 27.9673 8.91193 27.7571 8.70739C27.5497 8.50284 27.2401 8.40057 26.8281 8.40057C26.3991 8.40057 26.0611 8.49574 25.8139 8.68608C25.5696 8.87358 25.4006 9.08239 25.3068 9.3125L24.1094 9.03977C24.2514 8.64205 24.4588 8.32102 24.7315 8.0767C25.0071 7.82955 25.3239 7.65057 25.6818 7.53977C26.0398 7.42614 26.4162 7.36932 26.8111 7.36932C27.0724 7.36932 27.3494 7.40057 27.642 7.46307C27.9375 7.52273 28.2131 7.63352 28.4688 7.79545C28.7273 7.95739 28.9389 8.18892 29.1037 8.49006C29.2685 8.78835 29.3509 9.17614 29.3509 9.65341V14H28.1065V13.1051H28.0554C27.973 13.2699 27.8494 13.4318 27.6847 13.5909C27.5199 13.75 27.3082 13.8821 27.0497 13.9872C26.7912 14.0923 26.4815 14.1449 26.1207 14.1449ZM26.3977 13.1222C26.75 13.1222 27.0511 13.0526 27.3011 12.9134C27.554 12.7741 27.7457 12.5923 27.8764 12.3679C28.0099 12.1406 28.0767 11.8977 28.0767 11.6392V10.7955C28.0313 10.8409 27.9432 10.8835 27.8125 10.9233C27.6847 10.9602 27.5384 10.9929 27.3736 11.0213C27.2088 11.0469 27.0483 11.071 26.892 11.0938C26.7358 11.1136 26.6051 11.1307 26.5 11.1449C26.2528 11.1761 26.027 11.2287 25.8224 11.3026C25.6207 11.3764 25.4588 11.483 25.3366 11.6222C25.2173 11.7585 25.1577 11.9403 25.1577 12.1676C25.1577 12.483 25.2741 12.7216 25.5071 12.8835C25.7401 13.0426 26.0369 13.1222 26.3977 13.1222Z",
|
|
124
|
+
fill: "url(#paint0_linear_5214_50736)"
|
|
114
125
|
}),
|
|
115
126
|
/*#__PURE__*/ jsxRuntime.jsx("defs", {
|
|
116
127
|
children: /*#__PURE__*/ jsxRuntime.jsxs("linearGradient", {
|
|
117
|
-
id: "
|
|
118
|
-
x1: "
|
|
128
|
+
id: "paint0_linear_5214_50736",
|
|
129
|
+
x1: "31",
|
|
119
130
|
y1: "15.2703",
|
|
120
|
-
x2: "
|
|
131
|
+
x2: "3.99944",
|
|
121
132
|
y2: "15.2287",
|
|
122
133
|
gradientUnits: "userSpaceOnUse",
|
|
123
134
|
children: [
|
|
@@ -14,7 +14,7 @@ var ImageToLayout = require('../components/image-to-layout/ImageToLayout.js');
|
|
|
14
14
|
var AddSectionImageToLayout = require('../components/image-to-layout/AddSectionImageToLayout.js');
|
|
15
15
|
var Toolbar = require('../components/builder/Toolbar.js');
|
|
16
16
|
|
|
17
|
-
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar
|
|
17
|
+
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar })=>{
|
|
18
18
|
const [loadSuccess, setLoadSuccess] = react.useState(false);
|
|
19
19
|
const isDisableHeaderFooter = ()=>{
|
|
20
20
|
return isThemeSectionEditor;
|
|
@@ -71,8 +71,7 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
71
71
|
!hiddenToolbar && (isDisableHeaderFooter() ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
72
72
|
className: "h-[40px] bg-[#f4f4f4]"
|
|
73
73
|
}) : /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
|
|
74
|
-
pageType: pageType
|
|
75
|
-
isOriginTemplate: isOriginTemplate
|
|
74
|
+
pageType: pageType
|
|
76
75
|
})),
|
|
77
76
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
78
77
|
id: "storefront",
|
|
@@ -95,8 +94,7 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
95
94
|
id: "visual-content"
|
|
96
95
|
}),
|
|
97
96
|
!isDisableHeaderFooter() && !hiddenToolbar && /*#__PURE__*/ jsxRuntime.jsx(Footer.default, {
|
|
98
|
-
pageType: pageType
|
|
99
|
-
isOriginTemplate: isOriginTemplate
|
|
97
|
+
pageType: pageType
|
|
100
98
|
})
|
|
101
99
|
]
|
|
102
100
|
})
|
|
@@ -7,15 +7,12 @@ const defaultMargin = {
|
|
|
7
7
|
tablet: '40px',
|
|
8
8
|
mobile: '40px'
|
|
9
9
|
};
|
|
10
|
-
const FOOTER_ON_COLOR = '#D6D6D6';
|
|
11
10
|
const FOOTER_OFF_COLOR = '#F4F4F4';
|
|
12
11
|
const Footer = (props)=>{
|
|
13
|
-
const { pageType
|
|
12
|
+
const { pageType } = props;
|
|
14
13
|
const urlParams = new URLSearchParams(window.location.search);
|
|
15
14
|
const shopName = urlParams.get('storefrontHandle');
|
|
16
15
|
const layoutSetting = useShopStore((s)=>s.layoutSettings);
|
|
17
|
-
const activeFooter = layoutSetting?.showFooter || isOriginTemplate;
|
|
18
|
-
const footerColor = activeFooter ? FOOTER_ON_COLOR : FOOTER_OFF_COLOR;
|
|
19
16
|
const [shouldFixed, setShouldFixed] = useState(false);
|
|
20
17
|
useEffect(()=>{
|
|
21
18
|
const $iframe = parent.document.querySelector('.iframe');
|
|
@@ -77,19 +74,19 @@ const Footer = (props)=>{
|
|
|
77
74
|
children: [
|
|
78
75
|
/*#__PURE__*/ jsx("path", {
|
|
79
76
|
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",
|
|
80
|
-
fill:
|
|
77
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
81
78
|
}),
|
|
82
79
|
/*#__PURE__*/ jsx("path", {
|
|
83
80
|
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",
|
|
84
|
-
fill:
|
|
81
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
85
82
|
}),
|
|
86
83
|
/*#__PURE__*/ jsx("path", {
|
|
87
84
|
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",
|
|
88
|
-
fill:
|
|
85
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
89
86
|
})
|
|
90
87
|
]
|
|
91
88
|
}),
|
|
92
|
-
|
|
89
|
+
/*#__PURE__*/ jsx("div", {
|
|
93
90
|
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",
|
|
94
91
|
children: /*#__PURE__*/ jsx("div", {
|
|
95
92
|
className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
|
|
@@ -125,15 +122,15 @@ const Footer = (props)=>{
|
|
|
125
122
|
children: [
|
|
126
123
|
/*#__PURE__*/ jsx("path", {
|
|
127
124
|
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",
|
|
128
|
-
fill:
|
|
125
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
129
126
|
}),
|
|
130
127
|
/*#__PURE__*/ jsx("path", {
|
|
131
128
|
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",
|
|
132
|
-
fill:
|
|
129
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
133
130
|
}),
|
|
134
131
|
/*#__PURE__*/ jsx("path", {
|
|
135
132
|
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",
|
|
136
|
-
fill:
|
|
133
|
+
fill: layoutSetting?.showFooter ? '#D6D6D6' : FOOTER_OFF_COLOR
|
|
137
134
|
})
|
|
138
135
|
]
|
|
139
136
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useShopStore, cls, makeStyleResponsive } from '@gem-sdk/core';
|
|
3
3
|
|
|
4
4
|
const defaultMargin = {
|
|
@@ -6,7 +6,6 @@ const defaultMargin = {
|
|
|
6
6
|
tablet: '40px',
|
|
7
7
|
mobile: '40px'
|
|
8
8
|
};
|
|
9
|
-
const HEADER_ON_COLOR = '#D6D6D6';
|
|
10
9
|
const HEADER_OFF_COLOR = '#F4F4F4';
|
|
11
10
|
const sizeCheck = {
|
|
12
11
|
desktop: '24px',
|
|
@@ -14,10 +13,8 @@ const sizeCheck = {
|
|
|
14
13
|
mobile: '36px'
|
|
15
14
|
};
|
|
16
15
|
const Header = (props)=>{
|
|
17
|
-
const { pageType
|
|
16
|
+
const { pageType } = props;
|
|
18
17
|
const layoutSetting = useShopStore((s)=>s.layoutSettings);
|
|
19
|
-
const activeHeader = layoutSetting?.showHeader || isOriginTemplate;
|
|
20
|
-
const headerColor = activeHeader ? HEADER_ON_COLOR : HEADER_OFF_COLOR;
|
|
21
18
|
return /*#__PURE__*/ jsx("div", {
|
|
22
19
|
className: 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'),
|
|
23
20
|
children: pageType === 'POST_PURCHASE' ? /*#__PURE__*/ jsx("div", {
|
|
@@ -87,80 +84,82 @@ const Header = (props)=>{
|
|
|
87
84
|
})
|
|
88
85
|
]
|
|
89
86
|
})
|
|
90
|
-
}) : /*#__PURE__*/
|
|
87
|
+
}) : /*#__PURE__*/ jsx("div", {
|
|
91
88
|
className: "gp-flex gp-h-[40px] gp-flex-1 gp-items-center gp-justify-between",
|
|
92
89
|
style: {
|
|
93
90
|
maxWidth: `var(--g-ct-w)`,
|
|
94
91
|
...makeStyleResponsive('ml', defaultMargin),
|
|
95
92
|
...makeStyleResponsive('mr', defaultMargin)
|
|
96
93
|
},
|
|
97
|
-
children:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
94
|
+
children: /*#__PURE__*/ jsxs(Fragment, {
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ jsxs("svg", {
|
|
97
|
+
width: "84",
|
|
98
|
+
height: "8",
|
|
99
|
+
viewBox: "0 0 84 8",
|
|
100
|
+
fill: "none",
|
|
101
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsx("path", {
|
|
104
|
+
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",
|
|
105
|
+
fill: layoutSetting?.showHeader ? '#9E9E9E' : HEADER_OFF_COLOR
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ jsx("path", {
|
|
108
|
+
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",
|
|
109
|
+
fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ jsx("div", {
|
|
114
|
+
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",
|
|
115
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
116
|
+
className: "gp-flex gp-h-[24px] gp-w-[24px] gp-items-center gp-justify-center",
|
|
117
|
+
children: /*#__PURE__*/ jsxs("svg", {
|
|
118
|
+
width: "14",
|
|
119
|
+
height: "14",
|
|
120
|
+
viewBox: "0 0 14 14",
|
|
121
|
+
fill: "none",
|
|
122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
+
children: [
|
|
124
|
+
/*#__PURE__*/ jsx("path", {
|
|
125
|
+
fillRule: "evenodd",
|
|
126
|
+
clipRule: "evenodd",
|
|
127
|
+
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",
|
|
128
|
+
fill: "#212121"
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ jsx("path", {
|
|
131
|
+
fillRule: "evenodd",
|
|
132
|
+
clipRule: "evenodd",
|
|
133
|
+
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",
|
|
134
|
+
fill: "#212121"
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
})
|
|
139
138
|
})
|
|
139
|
+
}),
|
|
140
|
+
/*#__PURE__*/ jsxs("svg", {
|
|
141
|
+
width: "192",
|
|
142
|
+
height: "8",
|
|
143
|
+
viewBox: "0 0 192 8",
|
|
144
|
+
fill: "none",
|
|
145
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
146
|
+
children: [
|
|
147
|
+
/*#__PURE__*/ jsx("path", {
|
|
148
|
+
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",
|
|
149
|
+
fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
|
|
150
|
+
}),
|
|
151
|
+
/*#__PURE__*/ jsx("path", {
|
|
152
|
+
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",
|
|
153
|
+
fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ jsx("path", {
|
|
156
|
+
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",
|
|
157
|
+
fill: layoutSetting?.showHeader ? '#D6D6D6' : HEADER_OFF_COLOR
|
|
158
|
+
})
|
|
159
|
+
]
|
|
140
160
|
})
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
width: "192",
|
|
144
|
-
height: "8",
|
|
145
|
-
viewBox: "0 0 192 8",
|
|
146
|
-
fill: "none",
|
|
147
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
148
|
-
children: [
|
|
149
|
-
/*#__PURE__*/ jsx("path", {
|
|
150
|
-
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",
|
|
151
|
-
fill: headerColor
|
|
152
|
-
}),
|
|
153
|
-
/*#__PURE__*/ jsx("path", {
|
|
154
|
-
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",
|
|
155
|
-
fill: headerColor
|
|
156
|
-
}),
|
|
157
|
-
/*#__PURE__*/ jsx("path", {
|
|
158
|
-
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",
|
|
159
|
-
fill: headerColor
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
})
|
|
163
|
-
]
|
|
161
|
+
]
|
|
162
|
+
})
|
|
164
163
|
})
|
|
165
164
|
});
|
|
166
165
|
};
|
|
@@ -81,7 +81,7 @@ const Toolbar = ()=>{
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
const setHoverComponent = useCallback(({ $component, componentUid, focus,
|
|
84
|
+
const setHoverComponent = useCallback(({ $component, componentUid, focus, isThemeSection, isParent })=>{
|
|
85
85
|
if (!$component && !componentUid) return;
|
|
86
86
|
if (!$component) {
|
|
87
87
|
const $c = document.querySelector(`[data-uid="${componentUid}"]`);
|
|
@@ -98,7 +98,7 @@ const Toolbar = ()=>{
|
|
|
98
98
|
const $btnAddTop = getChildrenByAttrSelector($component, 'data-toolbar-add-top');
|
|
99
99
|
const $btnAddBottom = getChildrenByAttrSelector($component, 'data-toolbar-add-bottom');
|
|
100
100
|
const $themeSectionStatus = getChildrenByAttrSelector($component, 'data-theme-section-status');
|
|
101
|
-
if (
|
|
101
|
+
if (isThemeSection && $themeSectionStatus) {
|
|
102
102
|
$themeSectionStatus.setAttribute('data-theme-section-status-active', 'true');
|
|
103
103
|
}
|
|
104
104
|
if ($toolbar) {
|
|
@@ -120,7 +120,7 @@ const Toolbar = ()=>{
|
|
|
120
120
|
if (isParent) {
|
|
121
121
|
$outline.setAttribute('data-outline-parent-hover', 'true');
|
|
122
122
|
}
|
|
123
|
-
if (
|
|
123
|
+
if (isThemeSection) {
|
|
124
124
|
$outline.setAttribute('data-outline-overlay-theme-section', 'true');
|
|
125
125
|
}
|
|
126
126
|
if (focus) {
|
|
@@ -375,25 +375,25 @@ const Toolbar = ()=>{
|
|
|
375
375
|
countShowOnboarding,
|
|
376
376
|
onCloseOnboarding
|
|
377
377
|
]);
|
|
378
|
-
const
|
|
379
|
-
if (marqueeKey) {
|
|
380
|
-
return `[marquee-item-key="${marqueeKey}"] [data-uid="${componentUid}"]`;
|
|
381
|
-
}
|
|
382
|
-
return `${productId ? `[data-product-id="${productId}"][data-uid="${componentUid}"], [data-product-id="${productId}"] [data-uid="${componentUid}"]` : `[data-uid="${componentUid}"]`}`;
|
|
383
|
-
};
|
|
384
|
-
const setActiveComponent = useCallback(async ({ componentUid, productId, timeAwait = 600, forceReActive, marqueeKey })=>{
|
|
378
|
+
const setActiveComponent = useCallback(async ({ componentUid, productId, timeAwait = 500, forceReActive })=>{
|
|
385
379
|
if (!componentUid) return;
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
380
|
+
let $component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"][data-uid="${componentUid}"], [data-product-id="${productId}"] [data-uid="${componentUid}"]` : `[data-uid="${componentUid}"]`}`, timeAwait);
|
|
381
|
+
// check element fetch data: product, product list
|
|
382
|
+
if (!$component) {
|
|
383
|
+
const isLoading = document.querySelector(`.gp-loading-placeholder`);
|
|
384
|
+
if (!isLoading) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (isLoading) {
|
|
388
|
+
// await element onload
|
|
389
|
+
$component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 15000);
|
|
390
|
+
}
|
|
396
391
|
}
|
|
392
|
+
if (!$component) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (!forceReActive && componentUid == currentComponentActive.current?.componentUid && productId == currentComponentActive.current?.productId) return;
|
|
396
|
+
if (componentUid !== currentComponentActive.current?.componentUid || productId !== currentComponentActive.current?.productId || forceReActive) removeActiveComponent();
|
|
397
397
|
const $toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
|
|
398
398
|
const $outline = getChildrenByAttrSelector($component, 'data-outline');
|
|
399
399
|
const $btnAddTop = getChildrenByAttrSelector($component, 'data-toolbar-add-top');
|
|
@@ -401,8 +401,7 @@ const Toolbar = ()=>{
|
|
|
401
401
|
if ($toolbar) {
|
|
402
402
|
currentComponentActive.current = {
|
|
403
403
|
componentUid,
|
|
404
|
-
productId
|
|
405
|
-
marqueeKey
|
|
404
|
+
productId
|
|
406
405
|
};
|
|
407
406
|
$toolbar.removeAttribute('style');
|
|
408
407
|
$toolbar.setAttribute('data-toolbar-active', 'true');
|
|
@@ -421,9 +420,8 @@ const Toolbar = ()=>{
|
|
|
421
420
|
if ($btnAddBottom) {
|
|
422
421
|
$btnAddBottom.setAttribute('data-toolbar-add-active', 'true');
|
|
423
422
|
}
|
|
424
|
-
const isChildOfMarquee = !!$component.closest('[data-component-tag="Marquee"]');
|
|
425
423
|
// Active same element in product list
|
|
426
|
-
if (productId
|
|
424
|
+
if (productId) {
|
|
427
425
|
const $relatedElements = document.querySelectorAll(`[data-uid="${componentUid}"]`);
|
|
428
426
|
if ($relatedElements?.length) {
|
|
429
427
|
$relatedElements.forEach(($relatedElement)=>{
|
|
@@ -478,7 +476,6 @@ const Toolbar = ()=>{
|
|
|
478
476
|
const componentUid = currentComponentActive.current?.componentUid;
|
|
479
477
|
const productId = currentComponentActive.current?.productId;
|
|
480
478
|
const $component = await waitForElementToExist(`${productId ? `[data-product-id="${productId}"] ` : ''}[data-uid="${componentUid}"]`, 500);
|
|
481
|
-
console.log(' $component', $component);
|
|
482
479
|
if ($component) {
|
|
483
480
|
const $toolbar = getChildrenByAttrSelector($component, 'data-toolbar');
|
|
484
481
|
const $outline = getChildrenByAttrSelector($component, 'data-outline');
|
|
@@ -631,23 +628,23 @@ const Toolbar = ()=>{
|
|
|
631
628
|
}
|
|
632
629
|
}
|
|
633
630
|
}
|
|
634
|
-
const $
|
|
635
|
-
if ($
|
|
631
|
+
const $themeSection = $target.closest('[data-theme-section]');
|
|
632
|
+
if ($themeSection) {
|
|
636
633
|
setHoverComponent({
|
|
637
|
-
$component: $
|
|
634
|
+
$component: $themeSection,
|
|
638
635
|
focus: true,
|
|
639
|
-
|
|
636
|
+
isThemeSection: true
|
|
640
637
|
});
|
|
641
638
|
} else {
|
|
642
639
|
return;
|
|
643
640
|
}
|
|
644
641
|
}
|
|
645
|
-
const $
|
|
646
|
-
if ($
|
|
642
|
+
const $themeSection = $target.closest('[data-theme-section]');
|
|
643
|
+
if ($themeSection) {
|
|
647
644
|
setHoverComponent({
|
|
648
|
-
$component: $
|
|
645
|
+
$component: $themeSection,
|
|
649
646
|
focus: true,
|
|
650
|
-
|
|
647
|
+
isThemeSection: true
|
|
651
648
|
});
|
|
652
649
|
} else {
|
|
653
650
|
setHoverComponent({
|
|
@@ -674,8 +671,7 @@ const Toolbar = ()=>{
|
|
|
674
671
|
if (detail?.componentUid) {
|
|
675
672
|
setActiveComponent({
|
|
676
673
|
componentUid: detail.componentUid,
|
|
677
|
-
productId: detail.productId
|
|
678
|
-
marqueeKey: detail.marqueeKey
|
|
674
|
+
productId: detail.productId
|
|
679
675
|
});
|
|
680
676
|
} else {
|
|
681
677
|
removeActiveComponent();
|
|
@@ -10,14 +10,22 @@ const BASE_DATA = [
|
|
|
10
10
|
id: 'gps-add-section-bottom-from-library'
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
title: '
|
|
14
|
-
content: '
|
|
15
|
-
hasAILogo:
|
|
13
|
+
title: 'Insert URL',
|
|
14
|
+
content: 'to generate layout',
|
|
15
|
+
hasAILogo: false,
|
|
16
16
|
id: 'gps-add-section-bottom-from-url'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
title: '
|
|
20
|
-
content: '
|
|
19
|
+
title: 'Upload image',
|
|
20
|
+
content: 'to generate layout',
|
|
21
|
+
hasAILogo: false,
|
|
22
|
+
id: 'gps-add-section-bottom-from-image'
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
const POST_PURCHASE_PAGE_DATA = [
|
|
26
|
+
{
|
|
27
|
+
title: 'Blank section',
|
|
28
|
+
content: 'to start from scratch',
|
|
21
29
|
hasAILogo: false,
|
|
22
30
|
id: 'gps-add-section-blank'
|
|
23
31
|
}
|
|
@@ -41,7 +49,10 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
41
49
|
'gps-add-section-bottom-from-image',
|
|
42
50
|
'gps-add-section-bottom-from-library'
|
|
43
51
|
];
|
|
44
|
-
ACTIONS_DATA =
|
|
52
|
+
ACTIONS_DATA = [
|
|
53
|
+
...POST_PURCHASE_PAGE_DATA,
|
|
54
|
+
...BASE_DATA
|
|
55
|
+
].filter((item)=>!dataIdNotPostPurchase.includes(item.id));
|
|
45
56
|
}
|
|
46
57
|
useEffect(()=>{
|
|
47
58
|
if (!isInput || totalSection === 0) {
|
|
@@ -85,35 +96,35 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
85
96
|
}),
|
|
86
97
|
ACTIONS_DATA.map((action)=>{
|
|
87
98
|
return /*#__PURE__*/ jsxs("div", {
|
|
88
|
-
className: `gp-relative gp-mx-1 gp-h-[60px]
|
|
99
|
+
className: `gp-relative gp-mx-1 gp-h-[60px] gp-w-[172px] gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 ${isInput ? 'gp-hidden' : 'gp-flex'}`,
|
|
89
100
|
id: action.id,
|
|
90
101
|
"aria-hidden": true,
|
|
91
102
|
children: [
|
|
92
103
|
/*#__PURE__*/ jsxs("div", {
|
|
93
|
-
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]
|
|
104
|
+
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",
|
|
94
105
|
children: [
|
|
95
106
|
action.title,
|
|
96
107
|
action.hasAILogo && /*#__PURE__*/ jsxs("svg", {
|
|
97
|
-
width: "
|
|
108
|
+
width: "35",
|
|
98
109
|
height: "20",
|
|
99
|
-
viewBox: "0 0
|
|
110
|
+
viewBox: "0 0 35 20",
|
|
100
111
|
fill: "none",
|
|
101
112
|
xmlns: "http://www.w3.org/2000/svg",
|
|
102
113
|
children: [
|
|
103
114
|
/*#__PURE__*/ jsx("path", {
|
|
104
|
-
d: "M0
|
|
115
|
+
d: "M0 3C0 1.34315 1.34315 0 3 0H32C33.6569 0 35 1.34315 35 3V17C35 18.6569 33.6569 20 32 20H3C1.34315 20 0 18.6569 0 17V3Z",
|
|
105
116
|
fill: "#EBDDF8"
|
|
106
117
|
}),
|
|
107
118
|
/*#__PURE__*/ jsx("path", {
|
|
108
|
-
d: "
|
|
109
|
-
fill: "url(#
|
|
119
|
+
d: "M4.95881 14V5.27273H8.15483C8.77415 5.27273 9.28693 5.375 9.69318 5.57955C10.0994 5.78125 10.4034 6.0554 10.6051 6.40199C10.8068 6.74574 10.9077 7.13352 10.9077 7.56534C10.9077 7.92898 10.8409 8.2358 10.7074 8.4858C10.5739 8.73295 10.3949 8.93182 10.1705 9.08239C9.94886 9.23011 9.70455 9.33807 9.4375 9.40625V9.49148C9.72727 9.50568 10.0099 9.59943 10.2855 9.77273C10.5639 9.94318 10.794 10.1861 10.9759 10.5014C11.1577 10.8168 11.2486 11.2003 11.2486 11.652C11.2486 12.098 11.1435 12.4986 10.9332 12.8537C10.7259 13.206 10.4048 13.4858 9.97017 13.6932C9.53551 13.8977 8.98011 14 8.30398 14H4.95881ZM6.27557 12.8707H8.17614C8.80682 12.8707 9.25852 12.7486 9.53125 12.5043C9.80398 12.2599 9.94034 11.9545 9.94034 11.5881C9.94034 11.3125 9.87074 11.0597 9.73153 10.8295C9.59233 10.5994 9.39347 10.4162 9.13494 10.2798C8.87926 10.1435 8.57528 10.0753 8.22301 10.0753H6.27557V12.8707ZM6.27557 9.0483H8.03977C8.33523 9.0483 8.60085 8.99148 8.83665 8.87784C9.07528 8.7642 9.2642 8.60511 9.40341 8.40057C9.54545 8.19318 9.61648 7.94886 9.61648 7.66761C9.61648 7.30682 9.49006 7.00426 9.23722 6.75994C8.98438 6.51562 8.59659 6.39347 8.07386 6.39347H6.27557V9.0483ZM15.5291 14.1321C14.8842 14.1321 14.3288 13.9943 13.8629 13.7188C13.3999 13.4403 13.0419 13.0497 12.7891 12.5469C12.5391 12.0412 12.4141 11.4489 12.4141 10.7699C12.4141 10.0994 12.5391 9.50852 12.7891 8.99716C13.0419 8.4858 13.3942 8.08665 13.8459 7.79972C14.3004 7.51278 14.8317 7.36932 15.4396 7.36932C15.8089 7.36932 16.1669 7.4304 16.5135 7.55256C16.8601 7.67472 17.1712 7.86648 17.4467 8.12784C17.7223 8.3892 17.9396 8.72869 18.0987 9.14631C18.2578 9.56108 18.3374 10.0653 18.3374 10.6591V11.1108H13.1342V10.1562H17.0888C17.0888 9.82102 17.0206 9.52415 16.8842 9.26562C16.7479 9.00426 16.5561 8.7983 16.3089 8.64773C16.0646 8.49716 15.7777 8.42188 15.4482 8.42188C15.0902 8.42188 14.7777 8.50994 14.5107 8.68608C14.2464 8.85937 14.0419 9.08665 13.897 9.3679C13.755 9.64631 13.6839 9.94886 13.6839 10.2756V11.0213C13.6839 11.4588 13.7607 11.831 13.9141 12.1378C14.0703 12.4446 14.2876 12.679 14.5661 12.8409C14.8445 13 15.1697 13.0795 15.5419 13.0795C15.7834 13.0795 16.0036 13.0455 16.2024 12.9773C16.4013 12.9062 16.5732 12.8011 16.718 12.6619C16.8629 12.5227 16.9737 12.3509 17.0504 12.1463L18.2564 12.3636C18.1598 12.7187 17.9865 13.0298 17.7365 13.2969C17.4893 13.5611 17.1783 13.767 16.8033 13.9148C16.4311 14.0597 16.0064 14.1321 15.5291 14.1321ZM22.8065 7.45455V8.47727H19.2312V7.45455H22.8065ZM20.19 5.88636H21.4641V12.0781C21.4641 12.3253 21.5011 12.5114 21.5749 12.6364C21.6488 12.7585 21.744 12.8423 21.8604 12.8878C21.9798 12.9304 22.109 12.9517 22.2482 12.9517C22.3505 12.9517 22.44 12.9446 22.5167 12.9304C22.5934 12.9162 22.6531 12.9048 22.6957 12.8963L22.9258 13.9489C22.8519 13.9773 22.7468 14.0057 22.6104 14.0341C22.4741 14.0653 22.3036 14.0824 22.0991 14.0852C21.7638 14.0909 21.4513 14.0312 21.1616 13.9062C20.8718 13.7812 20.6374 13.5881 20.4585 13.3267C20.2795 13.0653 20.19 12.7372 20.19 12.3423V5.88636ZM26.1207 14.1449C25.706 14.1449 25.331 14.0682 24.9957 13.9148C24.6605 13.7585 24.3949 13.5327 24.1989 13.2372C24.0057 12.9418 23.9091 12.5795 23.9091 12.1506C23.9091 11.7812 23.9801 11.4773 24.1222 11.2386C24.2642 11 24.456 10.8111 24.6974 10.6719C24.9389 10.5327 25.2088 10.4276 25.5071 10.3565C25.8054 10.2855 26.1094 10.2315 26.419 10.1946C26.8111 10.1491 27.1293 10.1122 27.3736 10.0838C27.6179 10.0526 27.7955 10.0028 27.9062 9.93466C28.017 9.86648 28.0724 9.75568 28.0724 9.60227V9.57244C28.0724 9.20028 27.9673 8.91193 27.7571 8.70739C27.5497 8.50284 27.2401 8.40057 26.8281 8.40057C26.3991 8.40057 26.0611 8.49574 25.8139 8.68608C25.5696 8.87358 25.4006 9.08239 25.3068 9.3125L24.1094 9.03977C24.2514 8.64205 24.4588 8.32102 24.7315 8.0767C25.0071 7.82955 25.3239 7.65057 25.6818 7.53977C26.0398 7.42614 26.4162 7.36932 26.8111 7.36932C27.0724 7.36932 27.3494 7.40057 27.642 7.46307C27.9375 7.52273 28.2131 7.63352 28.4688 7.79545C28.7273 7.95739 28.9389 8.18892 29.1037 8.49006C29.2685 8.78835 29.3509 9.17614 29.3509 9.65341V14H28.1065V13.1051H28.0554C27.973 13.2699 27.8494 13.4318 27.6847 13.5909C27.5199 13.75 27.3082 13.8821 27.0497 13.9872C26.7912 14.0923 26.4815 14.1449 26.1207 14.1449ZM26.3977 13.1222C26.75 13.1222 27.0511 13.0526 27.3011 12.9134C27.554 12.7741 27.7457 12.5923 27.8764 12.3679C28.0099 12.1406 28.0767 11.8977 28.0767 11.6392V10.7955C28.0313 10.8409 27.9432 10.8835 27.8125 10.9233C27.6847 10.9602 27.5384 10.9929 27.3736 11.0213C27.2088 11.0469 27.0483 11.071 26.892 11.0938C26.7358 11.1136 26.6051 11.1307 26.5 11.1449C26.2528 11.1761 26.027 11.2287 25.8224 11.3026C25.6207 11.3764 25.4588 11.483 25.3366 11.6222C25.2173 11.7585 25.1577 11.9403 25.1577 12.1676C25.1577 12.483 25.2741 12.7216 25.5071 12.8835C25.7401 13.0426 26.0369 13.1222 26.3977 13.1222Z",
|
|
120
|
+
fill: "url(#paint0_linear_5214_50736)"
|
|
110
121
|
}),
|
|
111
122
|
/*#__PURE__*/ jsx("defs", {
|
|
112
123
|
children: /*#__PURE__*/ jsxs("linearGradient", {
|
|
113
|
-
id: "
|
|
114
|
-
x1: "
|
|
124
|
+
id: "paint0_linear_5214_50736",
|
|
125
|
+
x1: "31",
|
|
115
126
|
y1: "15.2703",
|
|
116
|
-
x2: "
|
|
127
|
+
x2: "3.99944",
|
|
117
128
|
y2: "15.2287",
|
|
118
129
|
gradientUnits: "userSpaceOnUse",
|
|
119
130
|
children: [
|
|
@@ -12,7 +12,7 @@ import ImageToLayout from '../components/image-to-layout/ImageToLayout.js';
|
|
|
12
12
|
import AddSectionImageToLayout from '../components/image-to-layout/AddSectionImageToLayout.js';
|
|
13
13
|
import Toolbar from '../components/builder/Toolbar.js';
|
|
14
14
|
|
|
15
|
-
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar
|
|
15
|
+
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar })=>{
|
|
16
16
|
const [loadSuccess, setLoadSuccess] = useState(false);
|
|
17
17
|
const isDisableHeaderFooter = ()=>{
|
|
18
18
|
return isThemeSectionEditor;
|
|
@@ -69,8 +69,7 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
69
69
|
!hiddenToolbar && (isDisableHeaderFooter() ? /*#__PURE__*/ jsx("div", {
|
|
70
70
|
className: "h-[40px] bg-[#f4f4f4]"
|
|
71
71
|
}) : /*#__PURE__*/ jsx(Header, {
|
|
72
|
-
pageType: pageType
|
|
73
|
-
isOriginTemplate: isOriginTemplate
|
|
72
|
+
pageType: pageType
|
|
74
73
|
})),
|
|
75
74
|
/*#__PURE__*/ jsx("div", {
|
|
76
75
|
id: "storefront",
|
|
@@ -93,8 +92,7 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
93
92
|
id: "visual-content"
|
|
94
93
|
}),
|
|
95
94
|
!isDisableHeaderFooter() && !hiddenToolbar && /*#__PURE__*/ jsx(Footer, {
|
|
96
|
-
pageType: pageType
|
|
97
|
-
isOriginTemplate: isOriginTemplate
|
|
95
|
+
pageType: pageType
|
|
98
96
|
})
|
|
99
97
|
]
|
|
100
98
|
})
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "1.41.0-
|
|
3
|
+
"version": "1.41.0-staging.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "latest"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "1.41.0-
|
|
29
|
+
"@gem-sdk/core": "1.41.0-staging.13",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "1.41.0-staging.13",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "1.41.0-staging.13",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "1.41.0-staging.13"
|