@gem-sdk/core 1.22.31-new-feature.3 → 1.22.31-new-feature.8
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/ComponentToolbarPreview.js +35 -7
- package/dist/cjs/components/theme-section/CreateThemeSection.js +7 -4
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +7 -1
- package/dist/cjs/contexts/BuilderPreviewContext.js +5 -5
- package/dist/esm/components/ComponentToolbarPreview.js +35 -7
- package/dist/esm/components/theme-section/CreateThemeSection.js +7 -4
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +7 -1
- package/dist/esm/contexts/BuilderPreviewContext.js +5 -5
- package/dist/types/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
16
16
|
const getParents = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getParents);
|
|
17
17
|
const root = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.getItem('ROOT'));
|
|
18
18
|
const isThemeSection = props.isThemeSection;
|
|
19
|
-
const
|
|
19
|
+
const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
|
|
20
20
|
const [activeAddSection, setActiveAddSection] = react.useState(null);
|
|
21
21
|
const [isShowParent, setIsShowParent] = react.useState(false);
|
|
22
22
|
const [isShowParentRevert, setIsShowParentRevert] = react.useState(false);
|
|
@@ -110,7 +110,8 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
110
110
|
const event = new CustomEvent('editor:toolbar:duplicate-component', {
|
|
111
111
|
bubbles: true,
|
|
112
112
|
detail: {
|
|
113
|
-
componentUid: props.uid
|
|
113
|
+
componentUid: props.uid,
|
|
114
|
+
isThemeSection: isThemeSection
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
117
|
window.dispatchEvent(event);
|
|
@@ -142,10 +143,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
142
143
|
};
|
|
143
144
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
144
145
|
children: [
|
|
145
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
146
|
+
!(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
146
147
|
"data-toolbar": true,
|
|
147
148
|
"data-toolbar-section": props.tag == 'Section',
|
|
148
|
-
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection,
|
|
149
|
+
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
149
150
|
children: [
|
|
150
151
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
151
152
|
"data-toolbar-show-parent": true,
|
|
@@ -213,6 +214,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
213
214
|
isShowParent && parents.map((parent, index)=>/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
214
215
|
"data-toolbar-parent": true,
|
|
215
216
|
"data-parent-uid": parent.uid,
|
|
217
|
+
"data-toolbar-theme-section": isThemeSectionEditor,
|
|
216
218
|
style: {
|
|
217
219
|
top: !isShowParentRevert ? `${-24 * (index + 1) + index}px` : `${31 + 24 * index - index}px`
|
|
218
220
|
},
|
|
@@ -300,9 +302,34 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
300
302
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
301
303
|
"data-outline": true,
|
|
302
304
|
"data-outline-section": props.tag == 'Section',
|
|
303
|
-
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection
|
|
305
|
+
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor
|
|
304
306
|
}),
|
|
305
|
-
props.tag
|
|
307
|
+
props.tag === 'Section' && isThemeSection && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
308
|
+
"data-theme-section-status": true,
|
|
309
|
+
children: [
|
|
310
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
311
|
+
"data-theme-section-status-icon": true,
|
|
312
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
313
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
314
|
+
width: "16",
|
|
315
|
+
height: "16",
|
|
316
|
+
viewBox: "0 0 16 16",
|
|
317
|
+
fill: "none",
|
|
318
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
319
|
+
fillRule: "evenodd",
|
|
320
|
+
clipRule: "evenodd",
|
|
321
|
+
d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",
|
|
322
|
+
fill: "#9144DA"
|
|
323
|
+
})
|
|
324
|
+
})
|
|
325
|
+
}),
|
|
326
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
327
|
+
"data-theme-section-status-text": true,
|
|
328
|
+
children: "Need to republish. Go to global edit to publish it"
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
}),
|
|
332
|
+
props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
306
333
|
children: [
|
|
307
334
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
308
335
|
"data-toolbar-add-top": true,
|
|
@@ -338,8 +365,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
338
365
|
})
|
|
339
366
|
]
|
|
340
367
|
}),
|
|
341
|
-
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
368
|
+
!(props.tag == 'Section' && isThemeSection) && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
342
369
|
"data-spacing": true,
|
|
370
|
+
"data-spacing-theme-section": isThemeSectionEditor,
|
|
343
371
|
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
344
372
|
"data-spacing-margin-bottom": true,
|
|
345
373
|
children: [
|
|
@@ -13,6 +13,7 @@ require('../../hooks/useCartUI.js');
|
|
|
13
13
|
require('../../helpers/convert.js');
|
|
14
14
|
|
|
15
15
|
const SHOW_TOOLTIP_TIMEOUT = 600;
|
|
16
|
+
const NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP = 3;
|
|
16
17
|
const LIMIT_PLANS = [
|
|
17
18
|
'trial',
|
|
18
19
|
'trial2022'
|
|
@@ -23,7 +24,7 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
23
24
|
const createThemeSectionCount = ShopContext.useShopStore((s)=>s.createThemeSectionCount);
|
|
24
25
|
const isLimit = LIMIT_PLANS.includes(shopPlan ?? '');
|
|
25
26
|
const isRenderTooltip = react.useMemo(()=>{
|
|
26
|
-
return createThemeSectionCount === undefined || createThemeSectionCount <
|
|
27
|
+
return createThemeSectionCount === undefined || createThemeSectionCount < NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP;
|
|
27
28
|
}, [
|
|
28
29
|
createThemeSectionCount
|
|
29
30
|
]);
|
|
@@ -47,13 +48,13 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
47
48
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
48
49
|
setIsShowTooltip(false);
|
|
49
50
|
};
|
|
50
|
-
const onActions = (e)=>{
|
|
51
|
+
const onActions = (e, options)=>{
|
|
51
52
|
e.preventDefault();
|
|
52
53
|
e.stopPropagation();
|
|
54
|
+
if (options?.disabled) return;
|
|
53
55
|
isLimit ? onUpgrade() : onCreate();
|
|
54
56
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
55
57
|
setIsShowTooltip(false);
|
|
56
|
-
return false;
|
|
57
58
|
};
|
|
58
59
|
const onUpgrade = ()=>{
|
|
59
60
|
const eventUpgrade = new CustomEvent('editor:toolbar:upgrade', {
|
|
@@ -87,7 +88,9 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
87
88
|
"data-toolbar-active-create-theme-section-wrapper": true,
|
|
88
89
|
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
89
90
|
"data-toolbar-active-create-theme-section": true,
|
|
90
|
-
onClick: (e)=>onActions(e
|
|
91
|
+
onClick: (e)=>onActions(e, {
|
|
92
|
+
disabled: isLimit
|
|
93
|
+
}),
|
|
91
94
|
"aria-hidden": "true",
|
|
92
95
|
children: [
|
|
93
96
|
/*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
@@ -7,7 +7,7 @@ var core = require('@gem-sdk/core');
|
|
|
7
7
|
|
|
8
8
|
const TRANSITION_DURATION = 350;
|
|
9
9
|
const defaultStyles = {
|
|
10
|
-
transition: `
|
|
10
|
+
transition: `opacity ${TRANSITION_DURATION}ms ease-out`,
|
|
11
11
|
opacity: 0
|
|
12
12
|
};
|
|
13
13
|
const transitions = {
|
|
@@ -29,6 +29,10 @@ const transitions = {
|
|
|
29
29
|
};
|
|
30
30
|
const ThemeSectionTooltip = ({ isShow, isLimit, isRender, children, onMouseEnter, onMouseLeave, onActions })=>{
|
|
31
31
|
const nodeRef = react.useRef(null);
|
|
32
|
+
const openHelpCenter = ()=>{
|
|
33
|
+
const url = 'index';
|
|
34
|
+
window.open(url, '_blank');
|
|
35
|
+
};
|
|
32
36
|
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
33
37
|
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
34
38
|
className: "theme-section-tooltip-wrapper",
|
|
@@ -79,6 +83,8 @@ const ThemeSectionTooltip = ({ isShow, isLimit, isRender, children, onMouseEnter
|
|
|
79
83
|
children: isLimit ? 'Upgrade to create Theme section' : 'Create theme section'
|
|
80
84
|
}),
|
|
81
85
|
isLimit && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
86
|
+
onClick: openHelpCenter,
|
|
87
|
+
"aria-hidden": true,
|
|
82
88
|
className: "theme-section-tooltip__action-learn-more",
|
|
83
89
|
children: "Learn more about Theme section"
|
|
84
90
|
})
|
|
@@ -28,10 +28,10 @@ const root = {
|
|
|
28
28
|
label: 'Root',
|
|
29
29
|
childrens: []
|
|
30
30
|
};
|
|
31
|
-
const createBuilderPreviewProvider = (args,
|
|
31
|
+
const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.createStore((set, get)=>({
|
|
32
32
|
state: args,
|
|
33
33
|
loaded: false,
|
|
34
|
-
|
|
34
|
+
isThemeSectionEditor: !!isThemeSectionEditor,
|
|
35
35
|
addItem: (args)=>{
|
|
36
36
|
const { position, data } = args;
|
|
37
37
|
const state = get().state;
|
|
@@ -411,13 +411,13 @@ const createBuilderPreviewProvider = (args, isEditThemeSection)=>zustand.createS
|
|
|
411
411
|
return parents;
|
|
412
412
|
}
|
|
413
413
|
}));
|
|
414
|
-
const BuilderPreviewProvider = ({ children, state,
|
|
414
|
+
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
|
|
415
415
|
const Component = lazy ? react.Suspense : react.Fragment;
|
|
416
416
|
const value = react.useMemo(()=>{
|
|
417
|
-
return createBuilderPreviewProvider(state,
|
|
417
|
+
return createBuilderPreviewProvider(state, isThemeSectionEditor);
|
|
418
418
|
}, [
|
|
419
419
|
state,
|
|
420
|
-
|
|
420
|
+
isThemeSectionEditor
|
|
421
421
|
]);
|
|
422
422
|
return /*#__PURE__*/ jsxRuntime.jsx(Component, {
|
|
423
423
|
children: /*#__PURE__*/ jsxRuntime.jsx(BuilderPreviewContext.Provider, {
|
|
@@ -14,7 +14,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
14
14
|
const getParents = useBuilderPreviewStore((s)=>s.getParents);
|
|
15
15
|
const root = useBuilderPreviewStore((s)=>s.getItem('ROOT'));
|
|
16
16
|
const isThemeSection = props.isThemeSection;
|
|
17
|
-
const
|
|
17
|
+
const isThemeSectionEditor = useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
|
|
18
18
|
const [activeAddSection, setActiveAddSection] = useState(null);
|
|
19
19
|
const [isShowParent, setIsShowParent] = useState(false);
|
|
20
20
|
const [isShowParentRevert, setIsShowParentRevert] = useState(false);
|
|
@@ -108,7 +108,8 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
108
108
|
const event = new CustomEvent('editor:toolbar:duplicate-component', {
|
|
109
109
|
bubbles: true,
|
|
110
110
|
detail: {
|
|
111
|
-
componentUid: props.uid
|
|
111
|
+
componentUid: props.uid,
|
|
112
|
+
isThemeSection: isThemeSection
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
window.dispatchEvent(event);
|
|
@@ -140,10 +141,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
140
141
|
};
|
|
141
142
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
142
143
|
children: [
|
|
143
|
-
/*#__PURE__*/ jsxs("div", {
|
|
144
|
+
!(props.tag == 'Section' && isThemeSectionEditor) && /*#__PURE__*/ jsxs("div", {
|
|
144
145
|
"data-toolbar": true,
|
|
145
146
|
"data-toolbar-section": props.tag == 'Section',
|
|
146
|
-
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection,
|
|
147
|
+
"data-toolbar-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor,
|
|
147
148
|
children: [
|
|
148
149
|
/*#__PURE__*/ jsxs("div", {
|
|
149
150
|
"data-toolbar-show-parent": true,
|
|
@@ -211,6 +212,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
211
212
|
isShowParent && parents.map((parent, index)=>/*#__PURE__*/ jsxs("div", {
|
|
212
213
|
"data-toolbar-parent": true,
|
|
213
214
|
"data-parent-uid": parent.uid,
|
|
215
|
+
"data-toolbar-theme-section": isThemeSectionEditor,
|
|
214
216
|
style: {
|
|
215
217
|
top: !isShowParentRevert ? `${-24 * (index + 1) + index}px` : `${31 + 24 * index - index}px`
|
|
216
218
|
},
|
|
@@ -298,9 +300,34 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
298
300
|
/*#__PURE__*/ jsx("div", {
|
|
299
301
|
"data-outline": true,
|
|
300
302
|
"data-outline-section": props.tag == 'Section',
|
|
301
|
-
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection
|
|
303
|
+
"data-outline-theme-section": props.tag == 'Section' && !!isThemeSection || isThemeSectionEditor
|
|
302
304
|
}),
|
|
303
|
-
props.tag
|
|
305
|
+
props.tag === 'Section' && isThemeSection && /*#__PURE__*/ jsxs("div", {
|
|
306
|
+
"data-theme-section-status": true,
|
|
307
|
+
children: [
|
|
308
|
+
/*#__PURE__*/ jsx("div", {
|
|
309
|
+
"data-theme-section-status-icon": true,
|
|
310
|
+
children: /*#__PURE__*/ jsx("svg", {
|
|
311
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
312
|
+
width: "16",
|
|
313
|
+
height: "16",
|
|
314
|
+
viewBox: "0 0 16 16",
|
|
315
|
+
fill: "none",
|
|
316
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
317
|
+
fillRule: "evenodd",
|
|
318
|
+
clipRule: "evenodd",
|
|
319
|
+
d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",
|
|
320
|
+
fill: "#9144DA"
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
}),
|
|
324
|
+
/*#__PURE__*/ jsx("span", {
|
|
325
|
+
"data-theme-section-status-text": true,
|
|
326
|
+
children: "Need to republish. Go to global edit to publish it"
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
}),
|
|
330
|
+
props.tag == 'Section' && !isThemeSectionEditor && /*#__PURE__*/ jsxs(Fragment, {
|
|
304
331
|
children: [
|
|
305
332
|
/*#__PURE__*/ jsx("div", {
|
|
306
333
|
"data-toolbar-add-top": true,
|
|
@@ -336,8 +363,9 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
336
363
|
})
|
|
337
364
|
]
|
|
338
365
|
}),
|
|
339
|
-
/*#__PURE__*/ jsx("div", {
|
|
366
|
+
!(props.tag == 'Section' && isThemeSection) && /*#__PURE__*/ jsx("div", {
|
|
340
367
|
"data-spacing": true,
|
|
368
|
+
"data-spacing-theme-section": isThemeSectionEditor,
|
|
341
369
|
children: /*#__PURE__*/ jsxs("div", {
|
|
342
370
|
"data-spacing-margin-bottom": true,
|
|
343
371
|
children: [
|
|
@@ -11,6 +11,7 @@ import '../../hooks/useCartUI.js';
|
|
|
11
11
|
import '../../helpers/convert.js';
|
|
12
12
|
|
|
13
13
|
const SHOW_TOOLTIP_TIMEOUT = 600;
|
|
14
|
+
const NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP = 3;
|
|
14
15
|
const LIMIT_PLANS = [
|
|
15
16
|
'trial',
|
|
16
17
|
'trial2022'
|
|
@@ -21,7 +22,7 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
21
22
|
const createThemeSectionCount = useShopStore((s)=>s.createThemeSectionCount);
|
|
22
23
|
const isLimit = LIMIT_PLANS.includes(shopPlan ?? '');
|
|
23
24
|
const isRenderTooltip = useMemo(()=>{
|
|
24
|
-
return createThemeSectionCount === undefined || createThemeSectionCount <
|
|
25
|
+
return createThemeSectionCount === undefined || createThemeSectionCount < NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP;
|
|
25
26
|
}, [
|
|
26
27
|
createThemeSectionCount
|
|
27
28
|
]);
|
|
@@ -45,13 +46,13 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
45
46
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
46
47
|
setIsShowTooltip(false);
|
|
47
48
|
};
|
|
48
|
-
const onActions = (e)=>{
|
|
49
|
+
const onActions = (e, options)=>{
|
|
49
50
|
e.preventDefault();
|
|
50
51
|
e.stopPropagation();
|
|
52
|
+
if (options?.disabled) return;
|
|
51
53
|
isLimit ? onUpgrade() : onCreate();
|
|
52
54
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
53
55
|
setIsShowTooltip(false);
|
|
54
|
-
return false;
|
|
55
56
|
};
|
|
56
57
|
const onUpgrade = ()=>{
|
|
57
58
|
const eventUpgrade = new CustomEvent('editor:toolbar:upgrade', {
|
|
@@ -85,7 +86,9 @@ const CreateThemeSection = ({ ...props })=>{
|
|
|
85
86
|
"data-toolbar-active-create-theme-section-wrapper": true,
|
|
86
87
|
children: /*#__PURE__*/ jsxs("div", {
|
|
87
88
|
"data-toolbar-active-create-theme-section": true,
|
|
88
|
-
onClick: (e)=>onActions(e
|
|
89
|
+
onClick: (e)=>onActions(e, {
|
|
90
|
+
disabled: isLimit
|
|
91
|
+
}),
|
|
89
92
|
"aria-hidden": "true",
|
|
90
93
|
children: [
|
|
91
94
|
/*#__PURE__*/ jsxs("svg", {
|
|
@@ -5,7 +5,7 @@ import { cls } from '@gem-sdk/core';
|
|
|
5
5
|
|
|
6
6
|
const TRANSITION_DURATION = 350;
|
|
7
7
|
const defaultStyles = {
|
|
8
|
-
transition: `
|
|
8
|
+
transition: `opacity ${TRANSITION_DURATION}ms ease-out`,
|
|
9
9
|
opacity: 0
|
|
10
10
|
};
|
|
11
11
|
const transitions = {
|
|
@@ -27,6 +27,10 @@ const transitions = {
|
|
|
27
27
|
};
|
|
28
28
|
const ThemeSectionTooltip = ({ isShow, isLimit, isRender, children, onMouseEnter, onMouseLeave, onActions })=>{
|
|
29
29
|
const nodeRef = useRef(null);
|
|
30
|
+
const openHelpCenter = ()=>{
|
|
31
|
+
const url = 'index';
|
|
32
|
+
window.open(url, '_blank');
|
|
33
|
+
};
|
|
30
34
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
31
35
|
children: /*#__PURE__*/ jsxs("div", {
|
|
32
36
|
className: "theme-section-tooltip-wrapper",
|
|
@@ -77,6 +81,8 @@ const ThemeSectionTooltip = ({ isShow, isLimit, isRender, children, onMouseEnter
|
|
|
77
81
|
children: isLimit ? 'Upgrade to create Theme section' : 'Create theme section'
|
|
78
82
|
}),
|
|
79
83
|
isLimit && /*#__PURE__*/ jsx("div", {
|
|
84
|
+
onClick: openHelpCenter,
|
|
85
|
+
"aria-hidden": true,
|
|
80
86
|
className: "theme-section-tooltip__action-learn-more",
|
|
81
87
|
children: "Learn more about Theme section"
|
|
82
88
|
})
|
|
@@ -26,10 +26,10 @@ const root = {
|
|
|
26
26
|
label: 'Root',
|
|
27
27
|
childrens: []
|
|
28
28
|
};
|
|
29
|
-
const createBuilderPreviewProvider = (args,
|
|
29
|
+
const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>createStore((set, get)=>({
|
|
30
30
|
state: args,
|
|
31
31
|
loaded: false,
|
|
32
|
-
|
|
32
|
+
isThemeSectionEditor: !!isThemeSectionEditor,
|
|
33
33
|
addItem: (args)=>{
|
|
34
34
|
const { position, data } = args;
|
|
35
35
|
const state = get().state;
|
|
@@ -409,13 +409,13 @@ const createBuilderPreviewProvider = (args, isEditThemeSection)=>createStore((se
|
|
|
409
409
|
return parents;
|
|
410
410
|
}
|
|
411
411
|
}));
|
|
412
|
-
const BuilderPreviewProvider = ({ children, state,
|
|
412
|
+
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
|
|
413
413
|
const Component = lazy ? Suspense : Fragment;
|
|
414
414
|
const value = useMemo(()=>{
|
|
415
|
-
return createBuilderPreviewProvider(state,
|
|
415
|
+
return createBuilderPreviewProvider(state, isThemeSectionEditor);
|
|
416
416
|
}, [
|
|
417
417
|
state,
|
|
418
|
-
|
|
418
|
+
isThemeSectionEditor
|
|
419
419
|
]);
|
|
420
420
|
return /*#__PURE__*/ jsx(Component, {
|
|
421
421
|
children: /*#__PURE__*/ jsx(BuilderPreviewContext.Provider, {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7309,7 +7309,7 @@ declare const useBuilderStore: <U>(selector: (state: ExtractState<StoreApi<Build
|
|
|
7309
7309
|
type BuilderPreviewContextProps = {
|
|
7310
7310
|
state: BuilderState;
|
|
7311
7311
|
loaded?: boolean;
|
|
7312
|
-
|
|
7312
|
+
isThemeSectionEditor?: boolean;
|
|
7313
7313
|
addItem: (args: {
|
|
7314
7314
|
data: BuilderEntityNested | BuilderEntityNested[];
|
|
7315
7315
|
type?: 'component' | 'section';
|
|
@@ -7336,7 +7336,7 @@ type BuilderPreviewProviderProps = Pick<BuilderPreviewContextProps, 'state'> & {
|
|
|
7336
7336
|
children: React.ReactNode;
|
|
7337
7337
|
lazy?: boolean;
|
|
7338
7338
|
priority?: boolean;
|
|
7339
|
-
|
|
7339
|
+
isThemeSectionEditor?: boolean;
|
|
7340
7340
|
};
|
|
7341
7341
|
declare const BuilderPreviewProvider: React.FC<BuilderPreviewProviderProps>;
|
|
7342
7342
|
declare const useBuilderPreviewStore: <U>(selector: (state: ExtractState<StoreApi<BuilderPreviewContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.22.31-new-feature.
|
|
3
|
+
"version": "1.22.31-new-feature.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gem-sdk/adapter-shopify": "1.22.31-staging.0",
|
|
28
|
-
"@gem-sdk/styles": "1.22.31-new-feature.
|
|
28
|
+
"@gem-sdk/styles": "1.22.31-new-feature.7"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.10",
|