@flozy/editor 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +9 -6
- package/dist/Editor/Editor.css +1 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +21 -7
- package/dist/Editor/Elements/Button/EditorButton.js +43 -10
- package/dist/Editor/Elements/ChipText/ChipText.js +7 -2
- package/dist/Editor/Elements/Form/Form.js +2 -2
- package/dist/Editor/Elements/Form/FormElements/FormText.js +9 -7
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +51 -0
- package/dist/Editor/Elements/Form/FormElements/index.js +3 -1
- package/dist/Editor/Elements/Form/FormField.js +2 -3
- package/dist/Editor/Elements/Grid/Grid.js +1 -1
- package/dist/Editor/Elements/Grid/GridItem.js +47 -13
- package/dist/Editor/Elements/Grid/templates/default_grid.js +144 -0
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +5 -1
- package/dist/Editor/Toolbar/FormatTools/Autocomplete.js +33 -0
- package/dist/Editor/Toolbar/FormatTools/Text.js +29 -0
- package/dist/Editor/Toolbar/FormatTools/index.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/index.js +0 -3
- package/dist/Editor/Toolbar/Toolbar.js +16 -9
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +35 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +36 -0
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +11 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +11 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +107 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +10 -3
- package/dist/Editor/common/StyleBuilder/formButtonStyle.js +8 -0
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +62 -4
- package/dist/Editor/common/StyleBuilder/gridStyle.js +33 -5
- package/dist/Editor/common/StyleBuilder/index.js +2 -2
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +2 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +1 -1
- package/dist/Editor/utils/form.js +8 -0
- package/dist/Editor/utils/formfield.js +7 -1
- package/dist/Editor/utils/grid.js +2 -8
- package/package.json +1 -1
@@ -75,13 +75,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
75
75
|
pageProps
|
76
76
|
} = pageSettings || {};
|
77
77
|
const {
|
78
|
-
bannerSpacing
|
78
|
+
bannerSpacing,
|
79
|
+
pageBgImage,
|
80
|
+
pageColor
|
79
81
|
} = pageProps || {
|
80
82
|
bannerSpacing: {
|
81
|
-
left:
|
82
|
-
right:
|
83
|
-
top:
|
84
|
-
bottom:
|
83
|
+
left: 0,
|
84
|
+
right: 0,
|
85
|
+
top: 0,
|
86
|
+
bottom: 0
|
85
87
|
}
|
86
88
|
};
|
87
89
|
useEffect(() => {
|
@@ -257,7 +259,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
257
259
|
className: "editor-wrapper",
|
258
260
|
style: {
|
259
261
|
border: "1px solid #f3f3f3",
|
260
|
-
|
262
|
+
backgroundImage: pageBgImage ? `url(${pageBgImage})` : "none",
|
263
|
+
backgroundColor: pageColor || defaultBG || "#FFF",
|
261
264
|
color: pageProps?.color || "#000",
|
262
265
|
paddingLeft: `${bannerSpacing?.left}px`,
|
263
266
|
paddingRight: `${bannerSpacing?.right}px`,
|
package/dist/Editor/Editor.css
CHANGED
@@ -34,10 +34,15 @@ function AppHeader(props) {
|
|
34
34
|
appLogo,
|
35
35
|
menus,
|
36
36
|
bgColor,
|
37
|
+
bgColorHover,
|
38
|
+
textColor,
|
39
|
+
textColorHover,
|
37
40
|
menuStyle,
|
38
41
|
bannerSpacing,
|
39
42
|
fontSize,
|
40
|
-
fontFamily
|
43
|
+
fontFamily,
|
44
|
+
logoFontSize,
|
45
|
+
titleFontFamily
|
41
46
|
} = element;
|
42
47
|
const {
|
43
48
|
left,
|
@@ -63,7 +68,8 @@ function AppHeader(props) {
|
|
63
68
|
className: "element-toolbar",
|
64
69
|
contentEditable: false,
|
65
70
|
style: {
|
66
|
-
top: "-24px"
|
71
|
+
top: "-24px",
|
72
|
+
right: "50px"
|
67
73
|
},
|
68
74
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
69
75
|
title: "App Header Settings",
|
@@ -110,9 +116,9 @@ function AppHeader(props) {
|
|
110
116
|
children: [/*#__PURE__*/_jsx(Typography, {
|
111
117
|
variant: "h6",
|
112
118
|
sx: {
|
113
|
-
my: 2
|
119
|
+
my: 2,
|
120
|
+
color: textColor
|
114
121
|
},
|
115
|
-
color: "primary",
|
116
122
|
children: appLogo && appLogo !== "none" ? /*#__PURE__*/_jsx("img", {
|
117
123
|
alt: `${appTitle} Logo`,
|
118
124
|
style: {
|
@@ -175,7 +181,10 @@ function AppHeader(props) {
|
|
175
181
|
color: "primary",
|
176
182
|
style: {
|
177
183
|
display: "inline-flex",
|
178
|
-
alignItems: "center"
|
184
|
+
alignItems: "center",
|
185
|
+
color: textColor,
|
186
|
+
fontSize: logoFontSize,
|
187
|
+
fontFamily: titleFontFamily
|
179
188
|
},
|
180
189
|
sx: {
|
181
190
|
flexGrow: 1,
|
@@ -210,10 +219,15 @@ function AppHeader(props) {
|
|
210
219
|
component: "a",
|
211
220
|
href: item.url,
|
212
221
|
sx: {
|
213
|
-
color: "#fff",
|
214
222
|
fontFamily: fontFamily,
|
215
223
|
textTransform: "none",
|
216
|
-
fontSize: fontSize || "16px"
|
224
|
+
fontSize: fontSize || "16px",
|
225
|
+
color: textColor || "#FFF",
|
226
|
+
background: bgColor || "none",
|
227
|
+
"&:hover": {
|
228
|
+
color: textColorHover || textColor || "#FFF",
|
229
|
+
background: bgColorHover || bgColor || "none"
|
230
|
+
}
|
217
231
|
},
|
218
232
|
children: item.text
|
219
233
|
}, item)) : null]
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { Transforms } from "slate";
|
3
3
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
4
|
-
import { IconButton, Menu, MenuItem, Tooltip } from "@mui/material";
|
4
|
+
import { IconButton, Menu, MenuItem, Tooltip, Box } from "@mui/material";
|
5
|
+
import * as fIcons from "@mui/icons-material";
|
5
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
6
7
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
7
8
|
import DeleteIcon from "@mui/icons-material/Delete";
|
@@ -13,7 +14,8 @@ const EditorButton = props => {
|
|
13
14
|
const {
|
14
15
|
attributes,
|
15
16
|
element,
|
16
|
-
customProps
|
17
|
+
customProps,
|
18
|
+
children
|
17
19
|
} = props;
|
18
20
|
const {
|
19
21
|
readOnly,
|
@@ -34,7 +36,11 @@ const EditorButton = props => {
|
|
34
36
|
buttonLink,
|
35
37
|
textSize,
|
36
38
|
textAlign,
|
37
|
-
fontFamily
|
39
|
+
fontFamily,
|
40
|
+
textColorHover,
|
41
|
+
bgColorHover,
|
42
|
+
buttonIcon,
|
43
|
+
iconPosition
|
38
44
|
} = element;
|
39
45
|
const {
|
40
46
|
linkType,
|
@@ -52,6 +58,7 @@ const EditorButton = props => {
|
|
52
58
|
right,
|
53
59
|
bottom
|
54
60
|
} = bannerSpacing || {};
|
61
|
+
const BtnIcon = buttonIcon ? fIcons[buttonIcon] : null;
|
55
62
|
const onClick = async e => {
|
56
63
|
if (readOnly) {
|
57
64
|
if (metadata?.buttonLink?.handler) {
|
@@ -121,15 +128,19 @@ const EditorButton = props => {
|
|
121
128
|
return /*#__PURE__*/_jsxs("div", {
|
122
129
|
className: "editor-btn-wrapper",
|
123
130
|
...attributes,
|
131
|
+
style: {
|
132
|
+
display: "inline"
|
133
|
+
},
|
124
134
|
children: [/*#__PURE__*/_jsx("div", {
|
125
135
|
className: "editor-btn-wrapper-inner",
|
126
136
|
style: {
|
127
|
-
textAlign: textAlign || "left"
|
137
|
+
textAlign: textAlign || "left",
|
138
|
+
display: "inline"
|
128
139
|
},
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
140
|
+
contentEditable: false,
|
141
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
142
|
+
component: "button",
|
143
|
+
sx: {
|
133
144
|
background: bgColor || "rgb(30, 75, 122)",
|
134
145
|
borderWidth: "1px",
|
135
146
|
borderBlockStyle: "solid",
|
@@ -141,11 +152,33 @@ const EditorButton = props => {
|
|
141
152
|
paddingBottom: `${bottom || 8}px`,
|
142
153
|
color: `${textColor || "#FFFFFF"}`,
|
143
154
|
fontSize: textSize || "inherit",
|
144
|
-
fontFamily: fontFamily || "PoppinsRegular"
|
155
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
156
|
+
display: "inline-flex",
|
157
|
+
alignItems: "center",
|
158
|
+
"&:hover": {
|
159
|
+
color: `${textColorHover || textColor || "#FFFFFF"}`,
|
160
|
+
background: bgColorHover || bgColor || "rgb(30, 75, 122)"
|
161
|
+
}
|
145
162
|
},
|
146
163
|
onClick: onClick,
|
147
|
-
children:
|
164
|
+
children: [BtnIcon && iconPosition === "start" && /*#__PURE__*/_jsx(BtnIcon, {
|
165
|
+
style: {
|
166
|
+
paddingLeft: "4px",
|
167
|
+
paddingRight: "4px"
|
168
|
+
}
|
169
|
+
}), label || "My Button", BtnIcon && iconPosition === "end" && /*#__PURE__*/_jsx(BtnIcon, {
|
170
|
+
style: {
|
171
|
+
paddingLeft: "4px",
|
172
|
+
paddingRight: "4px"
|
173
|
+
}
|
174
|
+
})]
|
148
175
|
})
|
176
|
+
}), /*#__PURE__*/_jsx("div", {
|
177
|
+
contentEditable: true,
|
178
|
+
style: {
|
179
|
+
display: "inline"
|
180
|
+
},
|
181
|
+
children: children
|
149
182
|
}), /*#__PURE__*/_jsxs(Menu, {
|
150
183
|
className: "editor-btn-options",
|
151
184
|
open: anchorEl !== null,
|
@@ -25,10 +25,12 @@ const ChipText = props => {
|
|
25
25
|
bottomLeft,
|
26
26
|
bottomRight
|
27
27
|
} = borderRadius || {};
|
28
|
-
return /*#__PURE__*/_jsx("
|
28
|
+
return /*#__PURE__*/_jsx("button", {
|
29
29
|
...attributes,
|
30
30
|
className: "editor-chip-text",
|
31
|
+
contentEditable: false,
|
31
32
|
style: {
|
33
|
+
display: "inline",
|
32
34
|
paddingLeft: `${left}px`,
|
33
35
|
paddingRight: `${right}px`,
|
34
36
|
paddingTop: `${top}px`,
|
@@ -38,7 +40,10 @@ const ChipText = props => {
|
|
38
40
|
background: bgColor || "#CCC",
|
39
41
|
color: textColor
|
40
42
|
},
|
41
|
-
children:
|
43
|
+
children: /*#__PURE__*/_jsx("div", {
|
44
|
+
contentEditable: true,
|
45
|
+
children: children
|
46
|
+
})
|
42
47
|
});
|
43
48
|
};
|
44
49
|
export default ChipText;
|
@@ -195,13 +195,13 @@ const Form = props => {
|
|
195
195
|
spacing: 2,
|
196
196
|
children: [children, /*#__PURE__*/_jsx(Grid, {
|
197
197
|
item: true,
|
198
|
+
xs: buttonProps?.grid || 6,
|
198
199
|
className: "form-btn-wrpr",
|
199
200
|
contentEditable: false,
|
200
201
|
style: {
|
201
202
|
display: "flex",
|
202
203
|
justifyContent: btnAlign?.horizantal || "start",
|
203
|
-
alignItems: btnAlign?.vertical || "start"
|
204
|
-
marginLeft: "0px"
|
204
|
+
alignItems: btnAlign?.vertical || "start"
|
205
205
|
},
|
206
206
|
children: /*#__PURE__*/_jsx("button", {
|
207
207
|
onClick: onSubmitClick,
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { Grid } from "@mui/material";
|
3
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
3
|
const FormText = props => {
|
5
4
|
const {
|
@@ -8,7 +7,8 @@ const FormText = props => {
|
|
8
7
|
const {
|
9
8
|
borderColor,
|
10
9
|
bannerSpacing,
|
11
|
-
borderRadius
|
10
|
+
borderRadius,
|
11
|
+
height
|
12
12
|
} = fieldProps;
|
13
13
|
const {
|
14
14
|
left,
|
@@ -22,13 +22,14 @@ const FormText = props => {
|
|
22
22
|
bottomLeft,
|
23
23
|
bottomRight
|
24
24
|
} = borderRadius || {};
|
25
|
-
console.log(fieldProps);
|
26
25
|
const onChange = e => {
|
27
26
|
e.preventDefault();
|
28
27
|
};
|
29
|
-
return /*#__PURE__*/_jsx(
|
30
|
-
|
31
|
-
|
28
|
+
return /*#__PURE__*/_jsx("div", {
|
29
|
+
style: {
|
30
|
+
width: "100%",
|
31
|
+
display: "flex"
|
32
|
+
},
|
32
33
|
contentEditable: false,
|
33
34
|
children: /*#__PURE__*/_jsx("input", {
|
34
35
|
...fieldProps,
|
@@ -40,7 +41,8 @@ const FormText = props => {
|
|
40
41
|
paddingLeft: `${left || 8}px`,
|
41
42
|
paddingRight: `${right || 8}px`,
|
42
43
|
paddingTop: `${top || 8}px`,
|
43
|
-
paddingBottom: `${bottom || 8}px
|
44
|
+
paddingBottom: `${bottom || 8}px`,
|
45
|
+
height: height || "auto"
|
44
46
|
}
|
45
47
|
})
|
46
48
|
});
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
const FormTextArea = props => {
|
4
|
+
const {
|
5
|
+
fieldProps
|
6
|
+
} = props;
|
7
|
+
const {
|
8
|
+
borderColor,
|
9
|
+
bannerSpacing,
|
10
|
+
borderRadius,
|
11
|
+
height
|
12
|
+
} = fieldProps;
|
13
|
+
const {
|
14
|
+
left,
|
15
|
+
top,
|
16
|
+
right,
|
17
|
+
bottom
|
18
|
+
} = bannerSpacing || {};
|
19
|
+
const {
|
20
|
+
topLeft,
|
21
|
+
topRight,
|
22
|
+
bottomLeft,
|
23
|
+
bottomRight
|
24
|
+
} = borderRadius || {};
|
25
|
+
console.log(fieldProps);
|
26
|
+
const onChange = e => {
|
27
|
+
e.preventDefault();
|
28
|
+
};
|
29
|
+
return /*#__PURE__*/_jsx("div", {
|
30
|
+
style: {
|
31
|
+
width: "100%",
|
32
|
+
display: "flex"
|
33
|
+
},
|
34
|
+
contentEditable: false,
|
35
|
+
children: /*#__PURE__*/_jsx("textarea", {
|
36
|
+
...fieldProps,
|
37
|
+
onChange: onChange,
|
38
|
+
style: {
|
39
|
+
width: "100%",
|
40
|
+
border: `1px solid ${borderColor || "#FFF"}`,
|
41
|
+
borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
|
42
|
+
paddingLeft: `${left || 8}px`,
|
43
|
+
paddingRight: `${right || 8}px`,
|
44
|
+
paddingTop: `${top || 8}px`,
|
45
|
+
paddingBottom: `${bottom || 8}px`,
|
46
|
+
height: height || "150px"
|
47
|
+
}
|
48
|
+
})
|
49
|
+
});
|
50
|
+
};
|
51
|
+
export default FormTextArea;
|
@@ -27,7 +27,6 @@ const FormField = props => {
|
|
27
27
|
const editor = useSlateStatic();
|
28
28
|
const path = ReactEditor.findPath(editor, element);
|
29
29
|
const [openSetttings, setOpenSettings] = useState(false);
|
30
|
-
const itemWidth = (grid || 6) / 12 * 100;
|
31
30
|
const onSettings = () => {
|
32
31
|
setOpenSettings(true);
|
33
32
|
};
|
@@ -83,11 +82,11 @@ const FormField = props => {
|
|
83
82
|
};
|
84
83
|
return /*#__PURE__*/_jsxs(Grid, {
|
85
84
|
item: true,
|
85
|
+
xs: grid,
|
86
86
|
...attributes,
|
87
87
|
className: "form-field",
|
88
88
|
style: {
|
89
|
-
position: "relative"
|
90
|
-
width: `${itemWidth}%`
|
89
|
+
position: "relative"
|
91
90
|
},
|
92
91
|
children: [!readOnly && /*#__PURE__*/_jsx(FieldToolbar, {}), /*#__PURE__*/_jsx(FormElement, {
|
93
92
|
fieldProps: elementProps
|
@@ -2,7 +2,7 @@ import React, { useState } from "react";
|
|
2
2
|
import { Transforms } from "slate";
|
3
3
|
import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
4
4
|
import GridItemPopup from "./GridItemPopup";
|
5
|
-
import { IconButton, Tooltip } from "@mui/material";
|
5
|
+
import { IconButton, Tooltip, Box } from "@mui/material";
|
6
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -21,7 +21,17 @@ const GridItem = props => {
|
|
21
21
|
grid,
|
22
22
|
bannerSpacing,
|
23
23
|
bgColor,
|
24
|
-
alignment
|
24
|
+
alignment,
|
25
|
+
gridHeight,
|
26
|
+
borderRadius,
|
27
|
+
borderStyle,
|
28
|
+
borderWidth,
|
29
|
+
borderColor,
|
30
|
+
margin,
|
31
|
+
textColorHover,
|
32
|
+
bgColorHover,
|
33
|
+
borderColorHover,
|
34
|
+
textColor
|
25
35
|
} = element;
|
26
36
|
const {
|
27
37
|
left,
|
@@ -31,7 +41,8 @@ const GridItem = props => {
|
|
31
41
|
} = bannerSpacing || {};
|
32
42
|
const {
|
33
43
|
vertical,
|
34
|
-
horizantal
|
44
|
+
horizantal,
|
45
|
+
flexDirection
|
35
46
|
} = alignment || {};
|
36
47
|
const editor = useSlateStatic();
|
37
48
|
const selected = useSelected();
|
@@ -62,6 +73,7 @@ const GridItem = props => {
|
|
62
73
|
const updateData = {
|
63
74
|
...data
|
64
75
|
};
|
76
|
+
console.log(updateData);
|
65
77
|
delete updateData.children;
|
66
78
|
Transforms.setNodes(editor, {
|
67
79
|
...updateData
|
@@ -80,31 +92,53 @@ const GridItem = props => {
|
|
80
92
|
});
|
81
93
|
}
|
82
94
|
};
|
83
|
-
return /*#__PURE__*/_jsxs(
|
84
|
-
|
95
|
+
return /*#__PURE__*/_jsxs(Box, {
|
96
|
+
component: "div",
|
97
|
+
className: `grid-item xs-${grid} element-root gi-top-wrpr`,
|
85
98
|
...attributes,
|
86
|
-
|
99
|
+
sx: {
|
87
100
|
display: "flex",
|
88
|
-
flexDirection: "column",
|
89
|
-
backgroundColor: bgColor,
|
101
|
+
flexDirection: flexDirection || "column",
|
102
|
+
backgroundColor: bgColor || "transparent",
|
90
103
|
alignItems: horizantal,
|
91
104
|
justifyContent: vertical,
|
92
105
|
width: `${itemWidth}%`,
|
93
|
-
|
106
|
+
marginLeft: `${margin?.left || 0}px`,
|
107
|
+
marginRight: `${margin?.right || 0}px`,
|
108
|
+
marginTop: `${margin?.top || 0}px`,
|
109
|
+
marginBottom: `${margin?.bottom || 0}px`,
|
110
|
+
"&:hover": {
|
111
|
+
background: `${bgColorHover || bgColor || "transparent"}`,
|
112
|
+
"& *": {
|
113
|
+
color: textColorHover || textColor || "#000"
|
114
|
+
}
|
115
|
+
}
|
94
116
|
},
|
95
117
|
children: [!readOnly && /*#__PURE__*/_jsx("div", {
|
96
118
|
className: `element-selector ${selected ? "selected" : ""}`,
|
97
119
|
contentEditable: false,
|
98
120
|
children: /*#__PURE__*/_jsx(GridItemToolbar, {})
|
99
|
-
}), /*#__PURE__*/_jsx(
|
100
|
-
|
121
|
+
}), /*#__PURE__*/_jsx(Box, {
|
122
|
+
className: "gi-inner-cw",
|
123
|
+
component: "div",
|
124
|
+
sx: {
|
101
125
|
display: "flex",
|
102
|
-
flexDirection: "column",
|
126
|
+
flexDirection: flexDirection || "column",
|
103
127
|
width: "100%",
|
104
128
|
paddingLeft: `${left}px`,
|
105
129
|
paddingRight: `${right}px`,
|
106
130
|
paddingTop: `${top}px`,
|
107
|
-
paddingBottom: `${bottom}px
|
131
|
+
paddingBottom: `${bottom}px`,
|
132
|
+
justifyContent: vertical,
|
133
|
+
height: gridHeight || "auto",
|
134
|
+
borderColor: borderColor || "transparent",
|
135
|
+
borderWidth: borderWidth || "1px",
|
136
|
+
borderRadius: borderRadius || "0px",
|
137
|
+
borderStyle: borderStyle || "solid",
|
138
|
+
color: textColor || "#000",
|
139
|
+
"&:hover": {
|
140
|
+
borderColor: borderColorHover || borderColor || "transparent"
|
141
|
+
}
|
108
142
|
},
|
109
143
|
children: children
|
110
144
|
}), openSetttings ? /*#__PURE__*/_jsx(GridItemPopup, {
|
@@ -0,0 +1,144 @@
|
|
1
|
+
const default_grid = {
|
2
|
+
type: "grid",
|
3
|
+
grid: "container",
|
4
|
+
children: [{
|
5
|
+
type: "grid-item",
|
6
|
+
grid: 12,
|
7
|
+
children: [{
|
8
|
+
type: "alignCenter",
|
9
|
+
children: [{
|
10
|
+
type: "paragraph",
|
11
|
+
children: [{
|
12
|
+
text: "Ship Sites with Style.",
|
13
|
+
fontSize: "huge",
|
14
|
+
fontFamily: "PoppinsBold"
|
15
|
+
}]
|
16
|
+
}]
|
17
|
+
}],
|
18
|
+
bgColor: "rgba(255, 255, 255, 0)",
|
19
|
+
lockSpacing: true,
|
20
|
+
bannerSpacing: {
|
21
|
+
top: "16",
|
22
|
+
left: "16",
|
23
|
+
right: "16",
|
24
|
+
bottom: "16"
|
25
|
+
},
|
26
|
+
alignment: {
|
27
|
+
horizantal: "center"
|
28
|
+
}
|
29
|
+
}, {
|
30
|
+
type: "grid-item",
|
31
|
+
grid: 12,
|
32
|
+
children: [{
|
33
|
+
type: "alignCenter",
|
34
|
+
children: [{
|
35
|
+
type: "paragraph",
|
36
|
+
children: [{
|
37
|
+
text: "Lorem Ipsum je fiktívny text, používaný pri návrhu tlačovín a typografie. Lorem Ipsum je štandardným výplňovým textom už od 16. storočia, keď neznámy tlačiar zobral sadzobnicu plnú tlačových znakov a pomiešal ich, aby tak vytvoril vzorkovú knihu. Prežil nielen päť storočí, ale aj skok do elektronickej sadzby, a pritom zostal v podstate nezmenený. Spopularizovaný bol v 60-tych rokoch 20.storočia, vydaním hárkov Letraset, ktoré obsahovali pasáže Lorem Ipsum, a neskôr aj softvérom ako Aldus PageMaker, ktorý obsahoval verzie Lorem Ipsum."
|
38
|
+
}]
|
39
|
+
}]
|
40
|
+
}],
|
41
|
+
bgColor: "rgba(255, 255, 255, 0)",
|
42
|
+
lockSpacing: true,
|
43
|
+
bannerSpacing: {
|
44
|
+
top: "16",
|
45
|
+
left: "16",
|
46
|
+
right: "16",
|
47
|
+
bottom: "16"
|
48
|
+
}
|
49
|
+
}, {
|
50
|
+
type: "grid-item",
|
51
|
+
grid: 12,
|
52
|
+
children: [{
|
53
|
+
type: "paragraph",
|
54
|
+
children: [{
|
55
|
+
text: ""
|
56
|
+
}]
|
57
|
+
}, {
|
58
|
+
type: "paragraph",
|
59
|
+
children: [{
|
60
|
+
text: ""
|
61
|
+
}]
|
62
|
+
}, {
|
63
|
+
type: "button",
|
64
|
+
children: [{
|
65
|
+
text: " "
|
66
|
+
}],
|
67
|
+
buttonLink: {
|
68
|
+
linkType: "webAddress"
|
69
|
+
},
|
70
|
+
label: "Gettings Started",
|
71
|
+
bgColor: "rgba(192,192,192, 1)",
|
72
|
+
textColor: "rgba(0,0,0,1)",
|
73
|
+
lockSpacing: true,
|
74
|
+
bannerSpacing: {
|
75
|
+
top: "16",
|
76
|
+
left: "16",
|
77
|
+
right: "16",
|
78
|
+
bottom: "16"
|
79
|
+
},
|
80
|
+
lockRadius: true,
|
81
|
+
borderRadius: {
|
82
|
+
topLeft: "12",
|
83
|
+
topRight: "12",
|
84
|
+
bottomLeft: "12",
|
85
|
+
bottomRight: "12"
|
86
|
+
},
|
87
|
+
bgColorHover: "rgba(0, 0, 0, 1)",
|
88
|
+
textColorHover: "rgba(255, 255, 255, 1)",
|
89
|
+
borderColor: "rgba(175, 51, 242, 0)"
|
90
|
+
}, {
|
91
|
+
type: "button",
|
92
|
+
children: [{
|
93
|
+
text: ""
|
94
|
+
}],
|
95
|
+
buttonLink: {
|
96
|
+
linkType: "webAddress"
|
97
|
+
},
|
98
|
+
label: "Learn More",
|
99
|
+
bgColor: "rgba(192,192,192, 1)",
|
100
|
+
textColor: "rgba(0,0,0,1)",
|
101
|
+
lockSpacing: false,
|
102
|
+
bannerSpacing: {
|
103
|
+
top: "16",
|
104
|
+
left: "32",
|
105
|
+
right: "32",
|
106
|
+
bottom: "16"
|
107
|
+
},
|
108
|
+
lockRadius: true,
|
109
|
+
borderRadius: {
|
110
|
+
topLeft: "12",
|
111
|
+
topRight: "12",
|
112
|
+
bottomLeft: "12",
|
113
|
+
bottomRight: "12"
|
114
|
+
},
|
115
|
+
borderColor: "rgba(175, 51, 242, 0)",
|
116
|
+
bgColorHover: "rgba(0,0,0,1)",
|
117
|
+
textColorHover: "rgba(255,255,255, 1)"
|
118
|
+
}],
|
119
|
+
bgColor: "rgba(255, 255, 255, 0)",
|
120
|
+
alignment: {
|
121
|
+
flexDirection: "row",
|
122
|
+
vertical: "center",
|
123
|
+
horizantal: "center"
|
124
|
+
},
|
125
|
+
lockSpacing: true,
|
126
|
+
bannerSpacing: {
|
127
|
+
top: "16",
|
128
|
+
left: "16",
|
129
|
+
right: "16",
|
130
|
+
bottom: "16"
|
131
|
+
}
|
132
|
+
}],
|
133
|
+
alignment: {
|
134
|
+
flexDirection: "column"
|
135
|
+
},
|
136
|
+
lockSpacing: true,
|
137
|
+
bannerSpacing: {
|
138
|
+
top: "16",
|
139
|
+
left: "16",
|
140
|
+
right: "16",
|
141
|
+
bottom: "16"
|
142
|
+
}
|
143
|
+
};
|
144
|
+
export default JSON.stringify(default_grid);
|
@@ -54,6 +54,7 @@ const PageSettingsButton = props => {
|
|
54
54
|
...data
|
55
55
|
};
|
56
56
|
delete updateData.children;
|
57
|
+
console.log(openSetttings);
|
57
58
|
if (openSetttings?.path) {
|
58
59
|
Transforms.setNodes(editor, {
|
59
60
|
pageProps: {
|
@@ -63,6 +64,7 @@ const PageSettingsButton = props => {
|
|
63
64
|
at: openSetttings?.path
|
64
65
|
});
|
65
66
|
} else {
|
67
|
+
console.log(editor.children.length);
|
66
68
|
Transforms.insertNodes(editor, [{
|
67
69
|
type: "page-settings",
|
68
70
|
pageProps: {
|
@@ -71,7 +73,9 @@ const PageSettingsButton = props => {
|
|
71
73
|
children: [{
|
72
74
|
text: ""
|
73
75
|
}]
|
74
|
-
}]
|
76
|
+
}], {
|
77
|
+
at: [editor.children.length]
|
78
|
+
});
|
75
79
|
}
|
76
80
|
onClose();
|
77
81
|
};
|