@flozy/editor 1.3.7 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/CommonEditor.js +2 -1
- package/dist/Editor/Editor.css +28 -16
- package/dist/Editor/Elements/AppHeader/AppHeader.js +40 -13
- package/dist/Editor/Elements/Button/ButtonPopup.js +5 -3
- package/dist/Editor/Elements/Button/EditorButton.js +29 -6
- package/dist/Editor/Elements/Embed/Image.js +5 -21
- package/dist/Editor/Elements/Embed/Video.js +2 -2
- package/dist/Editor/Elements/Form/Form.js +38 -17
- package/dist/Editor/Elements/Grid/Grid.js +6 -8
- package/dist/Editor/Elements/Grid/GridItem.js +6 -13
- package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -2
- package/dist/Editor/Elements/Grid/GridPopup.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/index.js +3 -0
- package/dist/Editor/assets/fonts/poppins/OFL.txt +93 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Black.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-BlackItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-BoldItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-ExtraBold.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-ExtraLight.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Italic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Light.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-LightItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-MediumItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-Thin.ttf +0 -0
- package/dist/Editor/assets/fonts/poppins/Poppins-ThinItalic.ttf +0 -0
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +26 -5
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +16 -1
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +12 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +15 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +6 -8
- package/dist/Editor/common/StyleBuilder/formButtonStyle.js +93 -0
- package/dist/Editor/common/StyleBuilder/gridStyle.js +9 -0
- package/dist/Editor/font.css +9 -0
- package/dist/Editor/service/formSubmit.js +2 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +1 -1
- package/dist/Editor/utils/customHooks/useFormat.js +11 -4
- package/dist/Editor/utils/font.js +3 -1
- package/package.json +1 -1
|
@@ -12,10 +12,11 @@ import { RemoteCursorOverlay } from "./RemoteCursorOverlay/Overlay";
|
|
|
12
12
|
import { mentionsEvent, commands } from "./utils/events";
|
|
13
13
|
import withCommon from "./hooks/withCommon";
|
|
14
14
|
import DialogWrapper from "./DialogWrapper";
|
|
15
|
-
import "./Editor.css";
|
|
16
15
|
import { serialize } from "./utils/serializer";
|
|
17
16
|
import { getThumbnailImage } from "./helper";
|
|
18
17
|
import PopupTool from "./Toolbar/PopupTool";
|
|
18
|
+
import "./font.css";
|
|
19
|
+
import "./Editor.css";
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
22
|
const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar"];
|
package/dist/Editor/Editor.css
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
.editor-t-wrapper {
|
|
2
|
+
font-family: "PoppinsRegular", "Helvetica", "Arial", sans-serif;
|
|
3
|
+
}
|
|
4
|
+
.editor-t-wrapper strong,
|
|
5
|
+
.editor-t-wrapper strong * {
|
|
6
|
+
font-family: "PoppinsBold", "Helvetica", "Arial", sans-serif;
|
|
7
|
+
}
|
|
3
8
|
.ml-1 {
|
|
4
9
|
margin-left: 10px;
|
|
5
10
|
}
|
|
@@ -33,8 +38,9 @@ blockquote {
|
|
|
33
38
|
.editor-wrapper .btnActive {
|
|
34
39
|
opacity: 1;
|
|
35
40
|
}
|
|
41
|
+
|
|
36
42
|
.editor-wrapper {
|
|
37
|
-
|
|
43
|
+
|
|
38
44
|
background: #ffffff;
|
|
39
45
|
min-height: 400px;
|
|
40
46
|
height: fit-content;
|
|
@@ -102,11 +108,11 @@ blockquote {
|
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
.grid-container-toolbar {
|
|
105
|
-
right: -
|
|
111
|
+
right: -32px;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
.grid-item-toolbar {
|
|
109
|
-
left: -
|
|
115
|
+
left: -32px;
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
.element-toolbar {
|
|
@@ -119,16 +125,22 @@ blockquote {
|
|
|
119
125
|
.grid-container-toolbar button,
|
|
120
126
|
.grid-item-toolbar button,
|
|
121
127
|
.element-toolbar button {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/* margin-left: 8px; */
|
|
126
|
-
background-color: rgb(255 255 255);
|
|
127
|
-
color: #64748b;
|
|
128
|
+
background-color: #2684ff;
|
|
129
|
+
color: #FFFFFF;
|
|
130
|
+
border: 1px solid transparent;
|
|
128
131
|
font-size: 12px;
|
|
129
|
-
border-radius:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
border-radius: 0px;
|
|
133
|
+
margin-bottom: 0px;
|
|
134
|
+
width: 24px;
|
|
135
|
+
height: 24px;
|
|
136
|
+
padding: 12px;
|
|
137
|
+
}
|
|
138
|
+
.grid-container-toolbar button:hover,
|
|
139
|
+
.grid-item-toolbar button:hover,
|
|
140
|
+
.element-toolbar button:hover {
|
|
141
|
+
background-color: #FFFFFF;
|
|
142
|
+
color: #2684ff;
|
|
143
|
+
border: 1px solid #2684ff;
|
|
132
144
|
}
|
|
133
145
|
|
|
134
146
|
.grid-item {
|
|
@@ -481,7 +493,7 @@ blockquote {
|
|
|
481
493
|
left: 0;
|
|
482
494
|
right: 0;
|
|
483
495
|
bottom: 0;
|
|
484
|
-
top:
|
|
496
|
+
top: 0;
|
|
485
497
|
width: fit-content;
|
|
486
498
|
height: fit-content;
|
|
487
499
|
margin: auto;
|
|
@@ -521,7 +533,7 @@ blockquote {
|
|
|
521
533
|
}
|
|
522
534
|
|
|
523
535
|
.element-toolbar button {
|
|
524
|
-
margin-right:
|
|
536
|
+
margin-right: 0px;
|
|
525
537
|
}
|
|
526
538
|
|
|
527
539
|
.empty-carousel-wrapper .element-selector {
|
|
@@ -18,6 +18,7 @@ import Button from "@mui/material/Button";
|
|
|
18
18
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
19
19
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
20
20
|
import AppHeaderPopup from "./AppHeaderPopup";
|
|
21
|
+
import { Tooltip } from "@mui/material";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
24
|
const drawerWidth = 240;
|
|
@@ -33,8 +34,17 @@ function AppHeader(props) {
|
|
|
33
34
|
appLogo,
|
|
34
35
|
menus,
|
|
35
36
|
bgColor,
|
|
36
|
-
menuStyle
|
|
37
|
+
menuStyle,
|
|
38
|
+
bannerSpacing,
|
|
39
|
+
fontSize,
|
|
40
|
+
fontFamily
|
|
37
41
|
} = element;
|
|
42
|
+
const {
|
|
43
|
+
left,
|
|
44
|
+
top,
|
|
45
|
+
right,
|
|
46
|
+
bottom
|
|
47
|
+
} = bannerSpacing || {};
|
|
38
48
|
const {
|
|
39
49
|
window
|
|
40
50
|
} = props;
|
|
@@ -53,16 +63,24 @@ function AppHeader(props) {
|
|
|
53
63
|
className: "element-toolbar",
|
|
54
64
|
contentEditable: false,
|
|
55
65
|
style: {
|
|
56
|
-
top: "-
|
|
66
|
+
top: "-24px"
|
|
57
67
|
},
|
|
58
|
-
children: [/*#__PURE__*/_jsx(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
children: /*#__PURE__*/_jsx(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
69
|
+
title: "App Header Settings",
|
|
70
|
+
arrow: true,
|
|
71
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
72
|
+
size: "small",
|
|
73
|
+
onClick: onSettings,
|
|
74
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
75
|
+
})
|
|
76
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
77
|
+
title: "Delete App Header",
|
|
78
|
+
arrow: true,
|
|
79
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
80
|
+
size: "small",
|
|
81
|
+
onClick: onDelete,
|
|
82
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
83
|
+
})
|
|
66
84
|
})]
|
|
67
85
|
}) : null;
|
|
68
86
|
};
|
|
@@ -107,6 +125,8 @@ function AppHeader(props) {
|
|
|
107
125
|
children: menus.map(item => /*#__PURE__*/_jsx(ListItem, {
|
|
108
126
|
disablePadding: true,
|
|
109
127
|
children: /*#__PURE__*/_jsx(ListItemButton, {
|
|
128
|
+
component: "a",
|
|
129
|
+
href: item.url,
|
|
110
130
|
sx: {
|
|
111
131
|
textAlign: "center"
|
|
112
132
|
},
|
|
@@ -130,7 +150,11 @@ function AppHeader(props) {
|
|
|
130
150
|
style: {
|
|
131
151
|
position: "relative",
|
|
132
152
|
background: bgColor,
|
|
133
|
-
boxShadow: "none"
|
|
153
|
+
boxShadow: "none",
|
|
154
|
+
paddingLeft: `${left}px`,
|
|
155
|
+
paddingRight: `${right}px`,
|
|
156
|
+
paddingTop: `${top}px`,
|
|
157
|
+
paddingBottom: `${bottom}px`
|
|
134
158
|
},
|
|
135
159
|
children: /*#__PURE__*/_jsxs(Toolbar, {
|
|
136
160
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
@@ -184,9 +208,12 @@ function AppHeader(props) {
|
|
|
184
208
|
children: /*#__PURE__*/_jsx(MenuIcon, {})
|
|
185
209
|
}) : null, !isDrawer ? menus.map(item => /*#__PURE__*/_jsx(Button, {
|
|
186
210
|
component: "a",
|
|
187
|
-
href: item.
|
|
211
|
+
href: item.url,
|
|
188
212
|
sx: {
|
|
189
|
-
color: "#fff"
|
|
213
|
+
color: "#fff",
|
|
214
|
+
fontFamily: fontFamily,
|
|
215
|
+
textTransform: "none",
|
|
216
|
+
fontSize: fontSize || "16px"
|
|
190
217
|
},
|
|
191
218
|
children: item.text
|
|
192
219
|
}, item)) : null]
|
|
@@ -7,15 +7,17 @@ const ButtonPopup = props => {
|
|
|
7
7
|
element,
|
|
8
8
|
onSave,
|
|
9
9
|
customProps,
|
|
10
|
-
onClose
|
|
10
|
+
onClose,
|
|
11
|
+
style,
|
|
12
|
+
styleName
|
|
11
13
|
} = props;
|
|
12
14
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
|
13
15
|
title: "Button",
|
|
14
|
-
type: "buttonStyle",
|
|
16
|
+
type: styleName ? "" : "buttonStyle",
|
|
15
17
|
element: element,
|
|
16
18
|
onSave: onSave,
|
|
17
19
|
onClose: onClose,
|
|
18
|
-
renderTabs: buttonStyle,
|
|
20
|
+
renderTabs: style ? style : buttonStyle,
|
|
19
21
|
customProps: customProps
|
|
20
22
|
});
|
|
21
23
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Transforms } from "slate";
|
|
3
3
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
|
4
|
-
import { Menu, MenuItem } from "@mui/material";
|
|
4
|
+
import { IconButton, Menu, MenuItem, Tooltip } from "@mui/material";
|
|
5
|
+
import SettingsIcon from "@mui/icons-material/Settings";
|
|
6
|
+
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
|
7
|
+
import DeleteIcon from "@mui/icons-material/Delete";
|
|
5
8
|
import ButtonPopup from "./ButtonPopup";
|
|
6
9
|
import { actionButtonRedirect } from "../../service/actionTrigger";
|
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -30,7 +33,8 @@ const EditorButton = props => {
|
|
|
30
33
|
borderColor,
|
|
31
34
|
buttonLink,
|
|
32
35
|
textSize,
|
|
33
|
-
textAlign
|
|
36
|
+
textAlign,
|
|
37
|
+
fontFamily
|
|
34
38
|
} = element;
|
|
35
39
|
const {
|
|
36
40
|
linkType,
|
|
@@ -136,7 +140,8 @@ const EditorButton = props => {
|
|
|
136
140
|
paddingTop: `${top || 8}px`,
|
|
137
141
|
paddingBottom: `${bottom || 8}px`,
|
|
138
142
|
color: `${textColor || "#FFFFFF"}`,
|
|
139
|
-
fontSize: textSize || "inherit"
|
|
143
|
+
fontSize: textSize || "inherit",
|
|
144
|
+
fontFamily: fontFamily || "PoppinsRegular"
|
|
140
145
|
},
|
|
141
146
|
onClick: onClick,
|
|
142
147
|
children: label || "My Button"
|
|
@@ -148,13 +153,31 @@ const EditorButton = props => {
|
|
|
148
153
|
onClose: handleClose,
|
|
149
154
|
children: [!readOnly && /*#__PURE__*/_jsx(MenuItem, {
|
|
150
155
|
onClick: onMenuClick("edit"),
|
|
151
|
-
children:
|
|
156
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
157
|
+
title: "Settings",
|
|
158
|
+
arrow: true,
|
|
159
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
160
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
161
|
+
})
|
|
162
|
+
})
|
|
152
163
|
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
164
|
+
title: "Open Link",
|
|
165
|
+
arrow: true,
|
|
153
166
|
onClick: onMenuClick("open"),
|
|
154
|
-
children:
|
|
167
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
168
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
169
|
+
children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
|
|
170
|
+
})
|
|
171
|
+
})
|
|
155
172
|
}), !readOnly && /*#__PURE__*/_jsx(MenuItem, {
|
|
173
|
+
title: "Delete",
|
|
174
|
+
arrow: true,
|
|
156
175
|
onClick: onMenuClick("delete"),
|
|
157
|
-
children:
|
|
176
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
177
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
178
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
179
|
+
})
|
|
180
|
+
})
|
|
158
181
|
})]
|
|
159
182
|
}), edit && /*#__PURE__*/_jsx(ButtonPopup, {
|
|
160
183
|
element: element,
|
|
@@ -6,9 +6,7 @@ import useResize from "../../utils/customHooks/useResize";
|
|
|
6
6
|
import { insertImageText } from "../../utils/imageText";
|
|
7
7
|
import EmbedPopup from "./EmbedPopup";
|
|
8
8
|
import { IconButton, Tooltip } from "@mui/material";
|
|
9
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
10
9
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
11
|
-
import AddIcon from "@mui/icons-material/Add";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
12
|
const Image = ({
|
|
@@ -112,31 +110,17 @@ const Image = ({
|
|
|
112
110
|
insertImageText(editor, [...path, 1]);
|
|
113
111
|
};
|
|
114
112
|
const ToolBar = () => {
|
|
115
|
-
return selected ? /*#__PURE__*/
|
|
113
|
+
return selected ? /*#__PURE__*/_jsx("div", {
|
|
116
114
|
className: "element-toolbar",
|
|
117
115
|
contentEditable: false,
|
|
118
|
-
children:
|
|
119
|
-
title: "
|
|
120
|
-
arrow: true,
|
|
121
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
122
|
-
onClick: onAddText,
|
|
123
|
-
children: /*#__PURE__*/_jsx(AddIcon, {})
|
|
124
|
-
})
|
|
125
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
126
|
-
title: "Settings",
|
|
116
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
117
|
+
title: "Image Settings",
|
|
127
118
|
arrow: true,
|
|
128
119
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
129
120
|
onClick: onSettings,
|
|
130
121
|
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
131
122
|
})
|
|
132
|
-
})
|
|
133
|
-
title: "Delete",
|
|
134
|
-
arrow: true,
|
|
135
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
136
|
-
onClick: onDelete,
|
|
137
|
-
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
138
|
-
})
|
|
139
|
-
})]
|
|
123
|
+
})
|
|
140
124
|
}) : null;
|
|
141
125
|
};
|
|
142
126
|
const totalMinus = (parseInt(left) || 0) + (parseInt(right) || 0);
|
|
@@ -177,7 +161,7 @@ const Image = ({
|
|
|
177
161
|
alt: alt,
|
|
178
162
|
src: url,
|
|
179
163
|
onClick: handleImageClick
|
|
180
|
-
}), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
|
164
|
+
}), selected && !readOnly && size.width > 300 && size.height > 300 && /*#__PURE__*/_jsx(IconButton, {
|
|
181
165
|
onPointerDown: onMouseDown,
|
|
182
166
|
style: {
|
|
183
167
|
opacity: 1,
|
|
@@ -54,14 +54,14 @@ const Video = ({
|
|
|
54
54
|
className: "element-toolbar visible-on-hover",
|
|
55
55
|
contentEditable: false,
|
|
56
56
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
57
|
-
title: "Settings",
|
|
57
|
+
title: "Video Settings",
|
|
58
58
|
arrow: true,
|
|
59
59
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
60
60
|
onClick: onSettings,
|
|
61
61
|
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
62
62
|
})
|
|
63
63
|
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
64
|
-
title: "Delete",
|
|
64
|
+
title: "Delete Video",
|
|
65
65
|
arrow: true,
|
|
66
66
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
67
67
|
onClick: onDelete,
|
|
@@ -5,10 +5,12 @@ import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress } from "@mu
|
|
|
5
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
6
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
7
7
|
import AddIcon from "@mui/icons-material/Add";
|
|
8
|
+
import BackupIcon from "@mui/icons-material/Backup";
|
|
8
9
|
import FormPopup from "./FormPopup";
|
|
9
10
|
import ButtonPopup from "../Button/ButtonPopup";
|
|
10
11
|
import { formField } from "../../utils/formfield";
|
|
11
12
|
import { formSubmit } from "../../service/formSubmit";
|
|
13
|
+
import formButtonStyle from "../../common/StyleBuilder/formButtonStyle";
|
|
12
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
16
|
const Form = props => {
|
|
@@ -51,17 +53,23 @@ const Form = props => {
|
|
|
51
53
|
if ((readOnly || test) && formEle && formEle?.current) {
|
|
52
54
|
const formData = new FormData(formEle?.current);
|
|
53
55
|
setLoading(true);
|
|
54
|
-
let
|
|
55
|
-
page_id: page_id
|
|
56
|
-
};
|
|
56
|
+
let response = {};
|
|
57
57
|
for (let pair of formData.entries()) {
|
|
58
|
-
|
|
59
|
-
...
|
|
58
|
+
response = {
|
|
59
|
+
...response,
|
|
60
60
|
[pair[0]]: pair[1]
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
let params = {
|
|
64
|
+
page_id: page_id,
|
|
65
|
+
form_id: `${formName}`,
|
|
66
|
+
response,
|
|
67
|
+
form_data: {
|
|
68
|
+
email: element?.email,
|
|
69
|
+
save_response: element?.saveResponse
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
await formSubmit(params, customProps);
|
|
65
73
|
setLoading(false);
|
|
66
74
|
}
|
|
67
75
|
};
|
|
@@ -168,7 +176,6 @@ const Form = props => {
|
|
|
168
176
|
})]
|
|
169
177
|
});
|
|
170
178
|
};
|
|
171
|
-
console.log(element);
|
|
172
179
|
return /*#__PURE__*/_jsxs("div", {
|
|
173
180
|
...attributes,
|
|
174
181
|
className: "form-wrapper element-root",
|
|
@@ -177,7 +184,7 @@ const Form = props => {
|
|
|
177
184
|
padding: "10px"
|
|
178
185
|
},
|
|
179
186
|
children: [!readOnly && /*#__PURE__*/_jsx(FormToolbar, {}), /*#__PURE__*/_jsxs("form", {
|
|
180
|
-
id:
|
|
187
|
+
id: `${formName}`,
|
|
181
188
|
onSubmit: handleSubmit,
|
|
182
189
|
style: {
|
|
183
190
|
color: textColor || "#FFF"
|
|
@@ -192,7 +199,6 @@ const Form = props => {
|
|
|
192
199
|
contentEditable: false,
|
|
193
200
|
style: {
|
|
194
201
|
display: "flex",
|
|
195
|
-
flex: 1,
|
|
196
202
|
justifyContent: btnAlign?.horizantal || "start",
|
|
197
203
|
alignItems: btnAlign?.vertical || "start",
|
|
198
204
|
marginLeft: "0px"
|
|
@@ -216,7 +222,8 @@ const Form = props => {
|
|
|
216
222
|
marginBottom: `${btnM?.bottom || 0}px`,
|
|
217
223
|
color: `${buttonProps?.textColor || "#FFFFFF"}`,
|
|
218
224
|
fontSize: buttonProps?.textSize || "inherit",
|
|
219
|
-
height: "fit-content"
|
|
225
|
+
height: "fit-content",
|
|
226
|
+
fontFamily: buttonProps?.fontFamily || "PoppinsRegular"
|
|
220
227
|
},
|
|
221
228
|
children: buttonProps?.label || "Submit"
|
|
222
229
|
})
|
|
@@ -245,23 +252,37 @@ const Form = props => {
|
|
|
245
252
|
element: element,
|
|
246
253
|
onSave: onSave,
|
|
247
254
|
onClose: onClose
|
|
248
|
-
}) : null, /*#__PURE__*/_jsxs(Menu, {
|
|
255
|
+
}) : null, !readOnly ? /*#__PURE__*/_jsxs(Menu, {
|
|
249
256
|
className: "editor-btn-options",
|
|
250
257
|
open: anchorEl !== null,
|
|
251
258
|
anchorEl: anchorEl,
|
|
252
259
|
onClose: handleClose,
|
|
253
|
-
children: [
|
|
260
|
+
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
254
261
|
onClick: onMenuClick("edit"),
|
|
255
|
-
children:
|
|
262
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
263
|
+
title: "Button Settings",
|
|
264
|
+
arrow: true,
|
|
265
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
266
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
267
|
+
})
|
|
268
|
+
})
|
|
256
269
|
}), /*#__PURE__*/_jsx(MenuItem, {
|
|
257
270
|
onClick: onMenuClick("test"),
|
|
258
|
-
children:
|
|
271
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
272
|
+
title: "Test Submit",
|
|
273
|
+
arrow: true,
|
|
274
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
275
|
+
children: /*#__PURE__*/_jsx(BackupIcon, {})
|
|
276
|
+
})
|
|
277
|
+
})
|
|
259
278
|
})]
|
|
260
|
-
}), editButton && /*#__PURE__*/_jsx(ButtonPopup, {
|
|
279
|
+
}) : null, editButton && /*#__PURE__*/_jsx(ButtonPopup, {
|
|
261
280
|
element: buttonProps || {},
|
|
262
281
|
onSave: onSaveButtonSettings,
|
|
263
282
|
onClose: onCloseButtonSettings,
|
|
264
|
-
customProps: customProps
|
|
283
|
+
customProps: customProps,
|
|
284
|
+
style: formButtonStyle,
|
|
285
|
+
styleName: "formButtonStyle"
|
|
265
286
|
})]
|
|
266
287
|
});
|
|
267
288
|
};
|
|
@@ -4,7 +4,6 @@ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
|
|
4
4
|
import { gridItem } from "../../utils/gridItem";
|
|
5
5
|
import GridPopup from "./GridPopup";
|
|
6
6
|
import { IconButton, Tooltip } from "@mui/material";
|
|
7
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
8
7
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
9
8
|
import AddIcon from "@mui/icons-material/Add";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,6 +20,7 @@ const Grid = props => {
|
|
|
21
20
|
} = customProps;
|
|
22
21
|
const [openSetttings, setOpenSettings] = useState(false);
|
|
23
22
|
const {
|
|
23
|
+
id,
|
|
24
24
|
grid,
|
|
25
25
|
bannerSpacing,
|
|
26
26
|
bgColor,
|
|
@@ -109,19 +109,16 @@ const Grid = props => {
|
|
|
109
109
|
onClick: onAddGridItem,
|
|
110
110
|
children: /*#__PURE__*/_jsx(AddIcon, {})
|
|
111
111
|
})
|
|
112
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
113
|
-
title: "Delete Grid",
|
|
114
|
-
arrow: true,
|
|
115
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
116
|
-
onClick: onDelete,
|
|
117
|
-
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
118
|
-
})
|
|
119
112
|
})]
|
|
120
113
|
}) : null;
|
|
121
114
|
};
|
|
115
|
+
const sectionId = id ? {
|
|
116
|
+
id
|
|
117
|
+
} : {};
|
|
122
118
|
return /*#__PURE__*/_jsxs("div", {
|
|
123
119
|
className: `grid-container ${grid} element-root`,
|
|
124
120
|
...attributes,
|
|
121
|
+
...sectionId,
|
|
125
122
|
style: {
|
|
126
123
|
background: bgColor,
|
|
127
124
|
alignContent: vertical,
|
|
@@ -136,6 +133,7 @@ const Grid = props => {
|
|
|
136
133
|
element: element,
|
|
137
134
|
onSave: onSave,
|
|
138
135
|
onClose: onClose,
|
|
136
|
+
onDelete: onDelete,
|
|
139
137
|
customProps: customProps
|
|
140
138
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
141
139
|
style: {
|
|
@@ -3,7 +3,6 @@ import { Transforms } from "slate";
|
|
|
3
3
|
import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
|
4
4
|
import GridItemPopup from "./GridItemPopup";
|
|
5
5
|
import { IconButton, Tooltip } from "@mui/material";
|
|
6
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
7
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -39,28 +38,21 @@ const GridItem = props => {
|
|
|
39
38
|
const itemWidth = (grid || 6) / 12 * 100;
|
|
40
39
|
const path = ReactEditor.findPath(editor, element);
|
|
41
40
|
const GridItemToolbar = () => {
|
|
42
|
-
return selected ? /*#__PURE__*/
|
|
41
|
+
return selected ? /*#__PURE__*/_jsx("div", {
|
|
43
42
|
contentEditable: false,
|
|
44
43
|
className: "grid-item-toolbar",
|
|
45
44
|
style: {
|
|
46
45
|
top: "0px"
|
|
47
46
|
},
|
|
48
|
-
children:
|
|
49
|
-
title: "Grid Settings",
|
|
47
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
48
|
+
title: "Grid Item Settings",
|
|
50
49
|
arrow: true,
|
|
51
50
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
52
51
|
size: "small",
|
|
53
52
|
onClick: onSettings,
|
|
54
53
|
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
55
54
|
})
|
|
56
|
-
})
|
|
57
|
-
title: "Delete Grid",
|
|
58
|
-
arrow: true,
|
|
59
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
60
|
-
onClick: onDelete,
|
|
61
|
-
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
62
|
-
})
|
|
63
|
-
})]
|
|
55
|
+
})
|
|
64
56
|
}) : null;
|
|
65
57
|
};
|
|
66
58
|
const onSettings = () => {
|
|
@@ -118,7 +110,8 @@ const GridItem = props => {
|
|
|
118
110
|
}), openSetttings ? /*#__PURE__*/_jsx(GridItemPopup, {
|
|
119
111
|
element: element,
|
|
120
112
|
onSave: onSave,
|
|
121
|
-
onClose: onClose
|
|
113
|
+
onClose: onClose,
|
|
114
|
+
onDelete: onDelete
|
|
122
115
|
}) : null]
|
|
123
116
|
});
|
|
124
117
|
};
|
|
@@ -6,7 +6,8 @@ const GridItemPopup = props => {
|
|
|
6
6
|
const {
|
|
7
7
|
element,
|
|
8
8
|
onSave,
|
|
9
|
-
onClose
|
|
9
|
+
onClose,
|
|
10
|
+
onDelete
|
|
10
11
|
} = props;
|
|
11
12
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
|
12
13
|
title: "Grid Item",
|
|
@@ -14,7 +15,8 @@ const GridItemPopup = props => {
|
|
|
14
15
|
element: element,
|
|
15
16
|
onSave: onSave,
|
|
16
17
|
onClose: onClose,
|
|
17
|
-
renderTabs: gridItemStyle
|
|
18
|
+
renderTabs: gridItemStyle,
|
|
19
|
+
onDelete: onDelete
|
|
18
20
|
});
|
|
19
21
|
};
|
|
20
22
|
export default GridItemPopup;
|
|
@@ -7,6 +7,7 @@ const GridPopup = props => {
|
|
|
7
7
|
element,
|
|
8
8
|
onSave,
|
|
9
9
|
onClose,
|
|
10
|
+
onDelete,
|
|
10
11
|
customProps
|
|
11
12
|
} = props;
|
|
12
13
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
|
@@ -16,7 +17,8 @@ const GridPopup = props => {
|
|
|
16
17
|
onSave: onSave,
|
|
17
18
|
onClose: onClose,
|
|
18
19
|
renderTabs: gridStyle,
|
|
19
|
-
customProps: customProps
|
|
20
|
+
customProps: customProps,
|
|
21
|
+
onDelete: onDelete
|
|
20
22
|
});
|
|
21
23
|
};
|
|
22
24
|
export default GridPopup;
|
|
@@ -5,6 +5,7 @@ import { Editor, Range } from "slate";
|
|
|
5
5
|
import { useSlate, useFocused } from "slate-react";
|
|
6
6
|
import TextFormat from "./TextFormat";
|
|
7
7
|
import usePopupStyle from "./PopupToolStyle";
|
|
8
|
+
import useFormat from "../../utils/customHooks/useFormat";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const PopupTool = () => {
|
|
@@ -17,7 +18,9 @@ const PopupTool = () => {
|
|
|
17
18
|
} = editor;
|
|
18
19
|
const open = Boolean(anchorEl);
|
|
19
20
|
const id = open ? "popup-edit-tool" : "";
|
|
21
|
+
console.log(useFormat(editor, null));
|
|
20
22
|
useEffect(() => {
|
|
23
|
+
console.log(selection, inFocus);
|
|
21
24
|
if (!selection || !inFocus || Range.isCollapsed(selection) || Editor.string(editor, selection) === "") {
|
|
22
25
|
setAnchorEl(null);
|
|
23
26
|
} else {
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { fontOptions } from "../../utils/font";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
3
|
const appHeaderStyle = [{
|
|
2
4
|
tab: "Logo",
|
|
3
5
|
value: "appLogo",
|
|
4
6
|
fields: [{
|
|
7
|
+
label: "App Title",
|
|
8
|
+
key: "appTitle",
|
|
9
|
+
type: "text",
|
|
10
|
+
placeholder: "Leave Empty, If only Logo"
|
|
11
|
+
}, {
|
|
5
12
|
label: "App Logo URL",
|
|
6
13
|
key: "appLogo",
|
|
7
14
|
type: "text"
|
|
@@ -11,12 +18,26 @@ const appHeaderStyle = [{
|
|
|
11
18
|
type: "backgroundImage"
|
|
12
19
|
}]
|
|
13
20
|
}, {
|
|
14
|
-
tab: "
|
|
15
|
-
value: "
|
|
21
|
+
tab: "General",
|
|
22
|
+
value: "general",
|
|
16
23
|
fields: [{
|
|
17
|
-
label: "
|
|
18
|
-
key: "
|
|
19
|
-
type: "text"
|
|
24
|
+
label: "Menu Font Size",
|
|
25
|
+
key: "fontSize",
|
|
26
|
+
type: "text",
|
|
27
|
+
placeholder: "16px"
|
|
28
|
+
}, {
|
|
29
|
+
label: "Menu Font Family",
|
|
30
|
+
key: "fontFamily",
|
|
31
|
+
type: "textOptions",
|
|
32
|
+
options: fontOptions,
|
|
33
|
+
renderOption: option => {
|
|
34
|
+
return /*#__PURE__*/_jsx("span", {
|
|
35
|
+
style: {
|
|
36
|
+
fontFamily: option.value
|
|
37
|
+
},
|
|
38
|
+
children: option.text
|
|
39
|
+
});
|
|
40
|
+
}
|
|
20
41
|
}]
|
|
21
42
|
}, {
|
|
22
43
|
tab: "Menus",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fontOptions } from "../../utils/font";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
3
|
const buttonStyle = [{
|
|
2
4
|
tab: "General",
|
|
3
5
|
value: "size",
|
|
@@ -6,10 +8,23 @@ const buttonStyle = [{
|
|
|
6
8
|
key: "label",
|
|
7
9
|
type: "text"
|
|
8
10
|
}, {
|
|
9
|
-
label: "
|
|
11
|
+
label: "Font Size",
|
|
10
12
|
key: "textSize",
|
|
11
13
|
type: "text",
|
|
12
14
|
placeholder: "16px or 1em"
|
|
15
|
+
}, {
|
|
16
|
+
label: "Font Family",
|
|
17
|
+
key: "fontFamily",
|
|
18
|
+
type: "textOptions",
|
|
19
|
+
options: fontOptions,
|
|
20
|
+
renderOption: option => {
|
|
21
|
+
return /*#__PURE__*/_jsx("span", {
|
|
22
|
+
style: {
|
|
23
|
+
fontFamily: option.value
|
|
24
|
+
},
|
|
25
|
+
children: option.text
|
|
26
|
+
});
|
|
27
|
+
}
|
|
13
28
|
}, {
|
|
14
29
|
label: "Text Align",
|
|
15
30
|
key: "textAlign",
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
const embedImageStyle = [{
|
|
2
|
+
tab: "URL",
|
|
3
|
+
value: "url",
|
|
4
|
+
fields: [{
|
|
5
|
+
label: "URL",
|
|
6
|
+
key: "url",
|
|
7
|
+
type: "text"
|
|
8
|
+
}, {
|
|
9
|
+
label: "File",
|
|
10
|
+
key: "url",
|
|
11
|
+
type: "backgroundImage"
|
|
12
|
+
}]
|
|
13
|
+
}, {
|
|
2
14
|
tab: "Banner Spacing",
|
|
3
15
|
value: "bannerSpacing",
|
|
4
16
|
fields: [{
|
|
@@ -39,18 +51,6 @@ const embedImageStyle = [{
|
|
|
39
51
|
key: "borderColor",
|
|
40
52
|
type: "color"
|
|
41
53
|
}]
|
|
42
|
-
}, {
|
|
43
|
-
tab: "URL",
|
|
44
|
-
value: "url",
|
|
45
|
-
fields: [{
|
|
46
|
-
label: "URL",
|
|
47
|
-
key: "url",
|
|
48
|
-
type: "text"
|
|
49
|
-
}, {
|
|
50
|
-
label: "File",
|
|
51
|
-
key: "url",
|
|
52
|
-
type: "backgroundImage"
|
|
53
|
-
}]
|
|
54
54
|
}, {
|
|
55
55
|
tab: "Size",
|
|
56
56
|
value: "elementSize",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Button, Grid, Radio, RadioGroup, TextField, FormControl, FormLabel, FormControlLabel, Typography } from "@mui/material";
|
|
2
|
+
import { Button, Grid, Radio, RadioGroup, TextField, FormControl, FormLabel, FormControlLabel, Typography, Tooltip, IconButton } from "@mui/material";
|
|
3
|
+
import DeleteIcon from "@mui/icons-material/Delete";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
const MenusArray = props => {
|
|
@@ -60,7 +61,7 @@ const MenusArray = props => {
|
|
|
60
61
|
variant: "body1",
|
|
61
62
|
color: "textSecondary",
|
|
62
63
|
sx: {
|
|
63
|
-
fontSize:
|
|
64
|
+
fontSize: "14px"
|
|
64
65
|
},
|
|
65
66
|
children: "Menu Variant"
|
|
66
67
|
})
|
|
@@ -88,15 +89,18 @@ const MenusArray = props => {
|
|
|
88
89
|
return /*#__PURE__*/_jsxs(Grid, {
|
|
89
90
|
item: true,
|
|
90
91
|
xs: 12,
|
|
92
|
+
style: {
|
|
93
|
+
display: "flex",
|
|
94
|
+
alignItems: "center"
|
|
95
|
+
},
|
|
91
96
|
children: [/*#__PURE__*/_jsx(TextField, {
|
|
92
97
|
name: "text",
|
|
93
98
|
type: "text",
|
|
94
99
|
value: m.text,
|
|
95
100
|
onChange: handleChange(i),
|
|
96
101
|
size: "small",
|
|
97
|
-
fullWidth: true,
|
|
98
102
|
sx: {
|
|
99
|
-
mb:
|
|
103
|
+
mb: 0
|
|
100
104
|
}
|
|
101
105
|
}), /*#__PURE__*/_jsx(TextField, {
|
|
102
106
|
name: "url",
|
|
@@ -105,11 +109,13 @@ const MenusArray = props => {
|
|
|
105
109
|
onChange: handleChange(i),
|
|
106
110
|
size: "small",
|
|
107
111
|
fullWidth: true
|
|
108
|
-
}), /*#__PURE__*/_jsx(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
113
|
+
title: "Delete Menu",
|
|
114
|
+
arrow: true,
|
|
115
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
116
|
+
onClick: onDelete(i),
|
|
117
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
|
118
|
+
})
|
|
113
119
|
})]
|
|
114
120
|
}, `add-m-${i}`);
|
|
115
121
|
}), /*#__PURE__*/_jsx(Grid, {
|
|
@@ -3,17 +3,15 @@ import { Grid, MenuItem, Select } from "@mui/material";
|
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
const TextOptions = props => {
|
|
5
5
|
const {
|
|
6
|
+
value,
|
|
6
7
|
data,
|
|
7
|
-
onChange
|
|
8
|
-
elementProps
|
|
8
|
+
onChange
|
|
9
9
|
} = props;
|
|
10
10
|
const {
|
|
11
11
|
key,
|
|
12
|
-
options
|
|
12
|
+
options,
|
|
13
|
+
renderOption
|
|
13
14
|
} = data;
|
|
14
|
-
const {
|
|
15
|
-
element: elementType
|
|
16
|
-
} = elementProps;
|
|
17
15
|
const handleChange = e => {
|
|
18
16
|
onChange({
|
|
19
17
|
[key]: e.target.value
|
|
@@ -29,14 +27,14 @@ const TextOptions = props => {
|
|
|
29
27
|
},
|
|
30
28
|
children: /*#__PURE__*/_jsx(Select, {
|
|
31
29
|
onChange: handleChange,
|
|
32
|
-
value:
|
|
30
|
+
value: value || options[0]?.value,
|
|
33
31
|
placeholder: data?.label,
|
|
34
32
|
fullWidth: true,
|
|
35
33
|
size: "small",
|
|
36
34
|
children: options.map(m => {
|
|
37
35
|
return /*#__PURE__*/_jsx(MenuItem, {
|
|
38
36
|
value: m.value,
|
|
39
|
-
children: m.label
|
|
37
|
+
children: renderOption ? renderOption(m) : m.label || m.text
|
|
40
38
|
}, `${key}_${m.value}`);
|
|
41
39
|
})
|
|
42
40
|
})
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { fontOptions } from "../../utils/font";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
const formButtonStyle = [{
|
|
4
|
+
tab: "General",
|
|
5
|
+
value: "size",
|
|
6
|
+
fields: [{
|
|
7
|
+
label: "Button Text",
|
|
8
|
+
key: "label",
|
|
9
|
+
type: "text"
|
|
10
|
+
}, {
|
|
11
|
+
label: "Font Size",
|
|
12
|
+
key: "textSize",
|
|
13
|
+
type: "text",
|
|
14
|
+
placeholder: "16px or 1em"
|
|
15
|
+
}, {
|
|
16
|
+
label: "Font Family",
|
|
17
|
+
key: "fontFamily",
|
|
18
|
+
type: "textOptions",
|
|
19
|
+
options: fontOptions,
|
|
20
|
+
renderOption: option => {
|
|
21
|
+
return /*#__PURE__*/_jsx("span", {
|
|
22
|
+
style: {
|
|
23
|
+
fontFamily: option.value
|
|
24
|
+
},
|
|
25
|
+
children: option.text
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
label: "Text Align",
|
|
30
|
+
key: "textAlign",
|
|
31
|
+
type: "textAlign",
|
|
32
|
+
placeholder: "16px or 1em"
|
|
33
|
+
}]
|
|
34
|
+
}, {
|
|
35
|
+
tab: "Position",
|
|
36
|
+
value: "position",
|
|
37
|
+
fields: [{
|
|
38
|
+
label: "Set Postion (Vertical & Horizantal)",
|
|
39
|
+
key: "alignment",
|
|
40
|
+
type: "alignment"
|
|
41
|
+
}]
|
|
42
|
+
}, {
|
|
43
|
+
tab: "Margin Spacing",
|
|
44
|
+
value: "marginSpacing",
|
|
45
|
+
fields: [{
|
|
46
|
+
label: "Margin Spacing",
|
|
47
|
+
key: "marginSpacing",
|
|
48
|
+
type: "bannerSpacing"
|
|
49
|
+
}]
|
|
50
|
+
}, {
|
|
51
|
+
tab: "Banner Spacing",
|
|
52
|
+
value: "bannerSpacing",
|
|
53
|
+
fields: [{
|
|
54
|
+
label: "Banner Spacing",
|
|
55
|
+
key: "bannerSpacing",
|
|
56
|
+
type: "bannerSpacing"
|
|
57
|
+
}]
|
|
58
|
+
}, {
|
|
59
|
+
tab: "Border Radius",
|
|
60
|
+
value: "borderRadius",
|
|
61
|
+
fields: [{
|
|
62
|
+
label: "Border Radius",
|
|
63
|
+
key: "borderRadius",
|
|
64
|
+
type: "borderRadius"
|
|
65
|
+
}]
|
|
66
|
+
}, {
|
|
67
|
+
tab: "Colors",
|
|
68
|
+
value: "colors",
|
|
69
|
+
fields: [{
|
|
70
|
+
label: "Text",
|
|
71
|
+
key: "textColor",
|
|
72
|
+
type: "color",
|
|
73
|
+
needPreview: true
|
|
74
|
+
}, {
|
|
75
|
+
label: "Background",
|
|
76
|
+
key: "bgColor",
|
|
77
|
+
type: "color"
|
|
78
|
+
}, {
|
|
79
|
+
label: "Border",
|
|
80
|
+
key: "borderColor",
|
|
81
|
+
type: "color"
|
|
82
|
+
}]
|
|
83
|
+
}, {
|
|
84
|
+
tab: "Save As Template",
|
|
85
|
+
value: "saveAsTemplate",
|
|
86
|
+
needActions: false,
|
|
87
|
+
fields: [{
|
|
88
|
+
label: "Template Image",
|
|
89
|
+
key: "saveAsTemplate",
|
|
90
|
+
type: "saveAsTemplate"
|
|
91
|
+
}]
|
|
92
|
+
}];
|
|
93
|
+
export default formButtonStyle;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
const gridStyle = [{
|
|
2
|
+
tab: "General",
|
|
3
|
+
value: "general",
|
|
4
|
+
fields: [{
|
|
5
|
+
label: "Section ID",
|
|
6
|
+
key: "id",
|
|
7
|
+
type: "text",
|
|
8
|
+
placeholder: "Id should be unique for the page..."
|
|
9
|
+
}]
|
|
10
|
+
}, {
|
|
2
11
|
tab: "Banner Spacing",
|
|
3
12
|
value: "bannerSpacing",
|
|
4
13
|
fields: [{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const formSubmit = async formData => {
|
|
1
|
+
export const formSubmit = async (formData, props) => {
|
|
2
2
|
try {
|
|
3
|
-
const response = await fetch(
|
|
3
|
+
const response = await fetch(`${props.PAGES_API_HOST}/form/submit`, {
|
|
4
4
|
method: "POST",
|
|
5
5
|
headers: {
|
|
6
6
|
"Content-Type": "application/json"
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { useEffect, useState } from
|
|
2
|
-
import { Editor, Element } from
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { Editor, Element } from "slate";
|
|
3
3
|
|
|
4
4
|
// This hook returns if the node in the current selection matches the format passed to it.
|
|
5
5
|
const useFormat = (editor, format) => {
|
|
6
6
|
const [isFormat, setIsFormat] = useState(false);
|
|
7
|
+
const matchFormat = n => {
|
|
8
|
+
if (format) {
|
|
9
|
+
return n.type === format;
|
|
10
|
+
} else {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
useEffect(() => {
|
|
8
15
|
if (editor.selection) {
|
|
9
16
|
// It matches at the editor.selection location by default, so if null handle it seperately.
|
|
10
17
|
const [node] = Editor.nodes(editor, {
|
|
11
|
-
match: n => !Editor.isEditor(n) && Element.isElement(n) && n
|
|
18
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && matchFormat(n)
|
|
12
19
|
});
|
|
13
|
-
setIsFormat(!!node);
|
|
20
|
+
setIsFormat(format ? !!node : node);
|
|
14
21
|
} else {
|
|
15
22
|
setIsFormat(false);
|
|
16
23
|
}
|
|
@@ -5,6 +5,8 @@ export const sizeMap = {
|
|
|
5
5
|
huge: "40px"
|
|
6
6
|
};
|
|
7
7
|
export const fontFamilyMap = {
|
|
8
|
+
PoppinsRegular: "PoppinsRegular",
|
|
9
|
+
PoppinsBold: "PoppinsBold",
|
|
8
10
|
sans: "Helvetica,Arial, sans serif",
|
|
9
11
|
serif: "Georgia, Times New Roaman,serif",
|
|
10
12
|
monospace: "Monaco, Courier New,monospace",
|
|
@@ -29,7 +31,7 @@ export const fontFamilyMap = {
|
|
|
29
31
|
pinyon: "'Pinyon Script', cursive",
|
|
30
32
|
muellerhoff: "'Herr Von Muellerhoff', cursive",
|
|
31
33
|
dawning: "'Dawning of a New Day', cursive",
|
|
32
|
-
//New Font Added for Type Signature
|
|
34
|
+
// New Font Added for Type Signature
|
|
33
35
|
comingsoon: "'Coming Soon', cursive",
|
|
34
36
|
dancingScript: "'Dancing Script', cursive",
|
|
35
37
|
engagement: "'Engagement', cursive",
|