@gem-sdk/pages 2.0.0-dev.409 → 2.0.0-dev.453
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.
|
@@ -37,6 +37,7 @@ const defaultPadding = {
|
|
|
37
37
|
mobile: 'var(--g-ct-p)'
|
|
38
38
|
};
|
|
39
39
|
const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
40
|
+
const { t } = core.useI18nStore();
|
|
40
41
|
const layoutSetting = core.useShopStore((s)=>s.layoutSettings);
|
|
41
42
|
const totalSection = core.useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
|
|
42
43
|
const editingPageType = core.useShopStore((s)=>s.pageType);
|
|
@@ -82,11 +83,11 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
82
83
|
children: [
|
|
83
84
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
84
85
|
className: "gp-absolute gp-top-[-12px] gp-bg-white gp-px-[8px] gp-text-[14px] gp-font-normal gp-text-[#9E9E9E]",
|
|
85
|
-
children:
|
|
86
|
+
children: t('Add section')
|
|
86
87
|
}),
|
|
87
88
|
ACTIONS_DATA.map((action)=>{
|
|
88
89
|
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
89
|
-
className: `gp-relative gp-mx-1 gp-h-[60px] gp-
|
|
90
|
+
className: `gp-relative gp-mx-1 gp-min-h-[60px] gp-border-box w375:gp-w-auto w576:gp-w-auto gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 gp-flex gp-p-2`,
|
|
90
91
|
id: action.id,
|
|
91
92
|
onClick: ()=>handleAddSectionAction(action.eventID),
|
|
92
93
|
"aria-hidden": true,
|
|
@@ -94,7 +95,7 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
94
95
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
95
96
|
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",
|
|
96
97
|
children: [
|
|
97
|
-
action.title,
|
|
98
|
+
t(action.title),
|
|
98
99
|
action.hasAILogo && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
|
|
99
100
|
width: "43",
|
|
100
101
|
height: "20",
|
|
@@ -137,7 +138,7 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
137
138
|
className: "gp-flex gp-items-center",
|
|
138
139
|
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
139
140
|
className: "gp-mr-[3px] gp-text-center gp-text-[12px] gp-font-normal gp-text-[#676767]",
|
|
140
|
-
children: action.content
|
|
141
|
+
children: t(action.content)
|
|
141
142
|
})
|
|
142
143
|
})
|
|
143
144
|
]
|
|
@@ -18,6 +18,7 @@ var Body = require('../components/builder/Body.js');
|
|
|
18
18
|
|
|
19
19
|
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
|
|
20
20
|
const [loadSuccess, setLoadSuccess] = react.useState(false);
|
|
21
|
+
const { t } = core.useI18n();
|
|
21
22
|
const isDisableHeaderFooter = ()=>{
|
|
22
23
|
return isThemeSectionEditor;
|
|
23
24
|
};
|
|
@@ -65,47 +66,50 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
65
66
|
components: components,
|
|
66
67
|
children: /*#__PURE__*/ jsxRuntime.jsx(core.SectionProvider, {
|
|
67
68
|
data: sectionData,
|
|
68
|
-
children: /*#__PURE__*/ jsxRuntime.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
69
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(core.I18nProvider, {
|
|
70
|
+
t: t,
|
|
71
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(core.BuilderPreviewProvider, {
|
|
72
|
+
pageName: pageName,
|
|
73
|
+
state: initState,
|
|
74
|
+
isThemeSectionEditor: isThemeSectionEditor,
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ jsxRuntime.jsx(Toolbox.default, {}),
|
|
77
|
+
!hiddenToolbar && /*#__PURE__*/ jsxRuntime.jsx(Toolbar.default, {}),
|
|
78
|
+
/*#__PURE__*/ jsxRuntime.jsx(PopupManager.default, {}),
|
|
79
|
+
loadSuccess && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
80
|
+
className: "builder gp-z-1 gp-relative",
|
|
81
|
+
children: [
|
|
82
|
+
!hiddenToolbar && (isDisableHeaderFooter() ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
83
|
+
className: "gp-h-[40px] gp-bg-[#ffffff] gp-border-b-[1px] gp-border-[#eeeeee]",
|
|
84
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(SwitchView.default, {})
|
|
85
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(Header.default, {
|
|
86
|
+
pageType: pageType,
|
|
87
|
+
isOriginTemplate: isOriginTemplate,
|
|
88
|
+
openPageSetting: openPageSetting
|
|
89
|
+
})),
|
|
90
|
+
/*#__PURE__*/ jsxRuntime.jsx(Body.default, {
|
|
91
|
+
pageType: pageType,
|
|
92
|
+
isThemeSectionEditor: isThemeSectionEditor
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ jsxRuntime.jsx(ImageToLayout.default, {
|
|
95
|
+
editorImageToLayout: editorImageToLayout || false
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsxRuntime.jsx(AddSectionImageToLayout.default, {
|
|
98
|
+
editorImageToLayout: editorImageToLayout || false
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
101
|
+
id: "visual-content"
|
|
102
|
+
}),
|
|
103
|
+
!isDisableHeaderFooter() && !hiddenToolbar && /*#__PURE__*/ jsxRuntime.jsx(Footer.default, {
|
|
104
|
+
pageType: pageType,
|
|
105
|
+
isOriginTemplate: isOriginTemplate,
|
|
106
|
+
openPageSetting: openPageSetting
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}, "preview")
|
|
112
|
+
})
|
|
109
113
|
})
|
|
110
114
|
})
|
|
111
115
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { useShopStore, useBuilderPreviewStore, makeStyleResponsive } from '@gem-sdk/core';
|
|
4
|
+
import { useI18nStore, useShopStore, useBuilderPreviewStore, makeStyleResponsive } from '@gem-sdk/core';
|
|
5
5
|
|
|
6
6
|
const BASE_DATA = [
|
|
7
7
|
{
|
|
@@ -33,6 +33,7 @@ const defaultPadding = {
|
|
|
33
33
|
mobile: 'var(--g-ct-p)'
|
|
34
34
|
};
|
|
35
35
|
const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
36
|
+
const { t } = useI18nStore();
|
|
36
37
|
const layoutSetting = useShopStore((s)=>s.layoutSettings);
|
|
37
38
|
const totalSection = useBuilderPreviewStore((state)=>state.state.ROOT.childrens?.length);
|
|
38
39
|
const editingPageType = useShopStore((s)=>s.pageType);
|
|
@@ -78,11 +79,11 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
78
79
|
children: [
|
|
79
80
|
/*#__PURE__*/ jsx("span", {
|
|
80
81
|
className: "gp-absolute gp-top-[-12px] gp-bg-white gp-px-[8px] gp-text-[14px] gp-font-normal gp-text-[#9E9E9E]",
|
|
81
|
-
children:
|
|
82
|
+
children: t('Add section')
|
|
82
83
|
}),
|
|
83
84
|
ACTIONS_DATA.map((action)=>{
|
|
84
85
|
return /*#__PURE__*/ jsxs("div", {
|
|
85
|
-
className: `gp-relative gp-mx-1 gp-h-[60px] gp-
|
|
86
|
+
className: `gp-relative gp-mx-1 gp-min-h-[60px] gp-border-box w375:gp-w-auto w576:gp-w-auto gp-cursor-pointer gp-flex-col gp-items-center gp-justify-center gp-rounded-[3px] gp-bg-[#F4F4F4] hover:gp-bg-black/10 gp-flex gp-p-2`,
|
|
86
87
|
id: action.id,
|
|
87
88
|
onClick: ()=>handleAddSectionAction(action.eventID),
|
|
88
89
|
"aria-hidden": true,
|
|
@@ -90,7 +91,7 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
90
91
|
/*#__PURE__*/ jsxs("div", {
|
|
91
92
|
className: "gp-mb-[4px] gp-flex gp-gap-2 gp-text-[14px] gp-font-medium gp-text-[#212121]",
|
|
92
93
|
children: [
|
|
93
|
-
action.title,
|
|
94
|
+
t(action.title),
|
|
94
95
|
action.hasAILogo && /*#__PURE__*/ jsxs("svg", {
|
|
95
96
|
width: "43",
|
|
96
97
|
height: "20",
|
|
@@ -133,7 +134,7 @@ const AddSectionImageToLayout = ({ editorImageToLayout })=>{
|
|
|
133
134
|
className: "gp-flex gp-items-center",
|
|
134
135
|
children: /*#__PURE__*/ jsx("span", {
|
|
135
136
|
className: "gp-mr-[3px] gp-text-center gp-text-[12px] gp-font-normal gp-text-[#676767]",
|
|
136
|
-
children: action.content
|
|
137
|
+
children: t(action.content)
|
|
137
138
|
})
|
|
138
139
|
})
|
|
139
140
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { PageProvider, BuilderComponentProvider, SectionProvider, BuilderPreviewProvider } from '@gem-sdk/core';
|
|
3
|
+
import { useI18n, PageProvider, BuilderComponentProvider, SectionProvider, I18nProvider, BuilderPreviewProvider } from '@gem-sdk/core';
|
|
4
4
|
import { NextSeo } from 'next-seo';
|
|
5
5
|
import Head from 'next/head';
|
|
6
6
|
import { useState, useMemo, useEffect } from 'react';
|
|
@@ -16,6 +16,7 @@ import Body from '../components/builder/Body.js';
|
|
|
16
16
|
|
|
17
17
|
const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, pageType, editorImageToLayout, isThemeSectionEditor, hiddenToolbar, pageName, isOriginTemplate })=>{
|
|
18
18
|
const [loadSuccess, setLoadSuccess] = useState(false);
|
|
19
|
+
const { t } = useI18n();
|
|
19
20
|
const isDisableHeaderFooter = ()=>{
|
|
20
21
|
return isThemeSectionEditor;
|
|
21
22
|
};
|
|
@@ -63,47 +64,50 @@ const BuilderPage = ({ components, seo, themeStyle, fontStyle, sectionData, page
|
|
|
63
64
|
components: components,
|
|
64
65
|
children: /*#__PURE__*/ jsx(SectionProvider, {
|
|
65
66
|
data: sectionData,
|
|
66
|
-
children: /*#__PURE__*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
67
|
+
children: /*#__PURE__*/ jsx(I18nProvider, {
|
|
68
|
+
t: t,
|
|
69
|
+
children: /*#__PURE__*/ jsxs(BuilderPreviewProvider, {
|
|
70
|
+
pageName: pageName,
|
|
71
|
+
state: initState,
|
|
72
|
+
isThemeSectionEditor: isThemeSectionEditor,
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ jsx(Toolbox, {}),
|
|
75
|
+
!hiddenToolbar && /*#__PURE__*/ jsx(Toolbar, {}),
|
|
76
|
+
/*#__PURE__*/ jsx(PopupManager, {}),
|
|
77
|
+
loadSuccess && /*#__PURE__*/ jsxs("div", {
|
|
78
|
+
className: "builder gp-z-1 gp-relative",
|
|
79
|
+
children: [
|
|
80
|
+
!hiddenToolbar && (isDisableHeaderFooter() ? /*#__PURE__*/ jsx("div", {
|
|
81
|
+
className: "gp-h-[40px] gp-bg-[#ffffff] gp-border-b-[1px] gp-border-[#eeeeee]",
|
|
82
|
+
children: /*#__PURE__*/ jsx(Devices, {})
|
|
83
|
+
}) : /*#__PURE__*/ jsx(Header, {
|
|
84
|
+
pageType: pageType,
|
|
85
|
+
isOriginTemplate: isOriginTemplate,
|
|
86
|
+
openPageSetting: openPageSetting
|
|
87
|
+
})),
|
|
88
|
+
/*#__PURE__*/ jsx(Body, {
|
|
89
|
+
pageType: pageType,
|
|
90
|
+
isThemeSectionEditor: isThemeSectionEditor
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ jsx(ImageToLayout, {
|
|
93
|
+
editorImageToLayout: editorImageToLayout || false
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ jsx(AddSectionImageToLayout, {
|
|
96
|
+
editorImageToLayout: editorImageToLayout || false
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ jsx("div", {
|
|
99
|
+
id: "visual-content"
|
|
100
|
+
}),
|
|
101
|
+
!isDisableHeaderFooter() && !hiddenToolbar && /*#__PURE__*/ jsx(Footer, {
|
|
102
|
+
pageType: pageType,
|
|
103
|
+
isOriginTemplate: isOriginTemplate,
|
|
104
|
+
openPageSetting: openPageSetting
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
}, "preview")
|
|
110
|
+
})
|
|
107
111
|
})
|
|
108
112
|
})
|
|
109
113
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.453",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "14.2.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "2.0.0-dev.453",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "2.0.0-dev.348",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "2.0.0-dev.348",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.348"
|