@flozy/editor 4.8.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +3 -4
- package/dist/Editor/Editor.css +8 -1
- package/dist/Editor/Elements/AI/AIInput.js +4 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +78 -62
- package/dist/Editor/Elements/AI/Styles.js +1 -0
- package/dist/Editor/Elements/AppHeader/AppHeader.js +12 -5
- package/dist/Editor/Elements/Embed/EmbedPopup.js +7 -1
- package/dist/Editor/Elements/Emoji/EmojiPicker.js +4 -2
- package/dist/Editor/Elements/Form/Form.js +38 -2
- package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
- package/dist/Editor/Elements/Form/FormPopup.js +12 -9
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
- package/dist/Editor/Elements/Grid/GridItem.js +7 -2
- package/dist/Editor/Elements/Link/Link.js +0 -2
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +2 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +0 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +144 -12
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -3
- package/dist/Editor/common/RnD/index.js +2 -6
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +5 -2
- package/dist/Editor/common/StyleBuilder/formStyle.js +206 -119
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +5 -0
- package/dist/Editor/common/StyleBuilder/index.js +123 -10
- package/dist/Editor/plugins/withCustomDeleteBackward.js +13 -0
- package/dist/Editor/utils/Decorators/highlightSelection.js +22 -0
- package/dist/Editor/utils/Decorators/index.js +3 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +9 -0
- package/dist/Editor/utils/font.js +11 -4
- package/dist/Editor/utils/formfield.js +8 -4
- package/dist/Editor/utils/helper.js +2 -2
- package/package.json +1 -1
@@ -1,38 +1,187 @@
|
|
1
|
-
import { fontOptions } from "../../utils/font";
|
1
|
+
import { fontOptions, fontWeightOptions } from "../../utils/font";
|
2
2
|
import Icon from "../Icon";
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
const formStyle = [{
|
5
|
-
tab: "
|
6
|
-
value: "
|
4
|
+
export const formStyle = [{
|
5
|
+
tab: "Form Settings",
|
6
|
+
value: "FormSetting",
|
7
|
+
hasChildrenTabs: true,
|
7
8
|
fields: [{
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
tab: "General",
|
10
|
+
value: "general",
|
11
|
+
fields: [{
|
12
|
+
label: "Form Name",
|
13
|
+
key: "formName",
|
14
|
+
type: "text"
|
15
|
+
}, {
|
16
|
+
label: "Send Form to Email",
|
17
|
+
key: "email",
|
18
|
+
type: "text",
|
19
|
+
placeholder: "Enter Email to send the response..."
|
20
|
+
}, {
|
21
|
+
label: "Save Response",
|
22
|
+
key: "saveResponse",
|
23
|
+
type: "selectBox",
|
24
|
+
placeholder: "Save Response"
|
25
|
+
}]
|
11
26
|
}, {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
27
|
+
tab: "Form Title",
|
28
|
+
value: "formTitle",
|
29
|
+
fields: [{
|
30
|
+
label: "Title",
|
31
|
+
key: "formTitle",
|
32
|
+
type: "text"
|
33
|
+
}, {
|
34
|
+
label: "Font Family",
|
35
|
+
key: "fontFamily",
|
36
|
+
type: "textOptions",
|
37
|
+
hideMetaDataOptions: true,
|
38
|
+
options: fontOptions,
|
39
|
+
webFont: true,
|
40
|
+
width: 7,
|
41
|
+
renderOption: option => {
|
42
|
+
return /*#__PURE__*/_jsx("span", {
|
43
|
+
style: {
|
44
|
+
fontFamily: option.value
|
45
|
+
},
|
46
|
+
children: option.text
|
47
|
+
});
|
48
|
+
}
|
49
|
+
}, {
|
50
|
+
label: "Font Size",
|
51
|
+
key: "textSize",
|
52
|
+
type: "fontSize",
|
53
|
+
width: 5,
|
54
|
+
placeholder: "16px"
|
55
|
+
}, {
|
56
|
+
label: "Text Align",
|
57
|
+
key: "textAlign",
|
58
|
+
type: "textAlign",
|
59
|
+
placeholder: "16px or 1em"
|
60
|
+
}]
|
61
|
+
}, {
|
62
|
+
tab: "Banner Spacing",
|
63
|
+
value: "bannerSpacing",
|
64
|
+
fields: [{
|
65
|
+
label: "Banner Spacing",
|
66
|
+
key: "bannerSpacing",
|
67
|
+
type: "bannerSpacing"
|
68
|
+
}]
|
69
|
+
}, {
|
70
|
+
tab: "Border",
|
71
|
+
value: "border",
|
72
|
+
fields: [{
|
73
|
+
label: "Border Radius",
|
74
|
+
key: "borderRadius",
|
75
|
+
type: "borderRadius"
|
76
|
+
}, {
|
77
|
+
label: "Border Width",
|
78
|
+
key: "borderWidth",
|
79
|
+
type: "text",
|
80
|
+
placeholder: "1px"
|
81
|
+
}, {
|
82
|
+
label: "Border Style",
|
83
|
+
key: "borderStyle",
|
84
|
+
type: "textOptions",
|
85
|
+
hideMetaDataOptions: true,
|
86
|
+
options: [{
|
87
|
+
text: "Solid",
|
88
|
+
value: "solid"
|
89
|
+
}, {
|
90
|
+
text: "Dotted",
|
91
|
+
value: "dotted"
|
92
|
+
}, {
|
93
|
+
text: "Dashed",
|
94
|
+
value: "dashed"
|
95
|
+
}],
|
96
|
+
renderOption: option => {
|
97
|
+
return /*#__PURE__*/_jsx("span", {
|
98
|
+
children: option.text
|
99
|
+
});
|
100
|
+
}
|
101
|
+
}]
|
102
|
+
}, {
|
103
|
+
tab: "Colors",
|
104
|
+
value: "colors",
|
105
|
+
fields: [{
|
106
|
+
label: "Text Color",
|
107
|
+
key: "textColor",
|
108
|
+
type: "color",
|
109
|
+
needPreview: true
|
110
|
+
}, {
|
111
|
+
label: "Background Color",
|
112
|
+
key: "bgColor",
|
113
|
+
type: "color"
|
114
|
+
}, {
|
115
|
+
label: "Border Color",
|
116
|
+
key: "borderColor",
|
117
|
+
type: "color"
|
118
|
+
}]
|
119
|
+
}, {
|
120
|
+
tab: "Position",
|
121
|
+
value: "position",
|
122
|
+
fields: [{
|
123
|
+
label: "Set Postion (Vertical & Horizantal)",
|
124
|
+
key: "alignment",
|
125
|
+
type: "alignment"
|
126
|
+
}]
|
127
|
+
}, {
|
128
|
+
tab: "Background",
|
129
|
+
value: "backgroundImage",
|
130
|
+
fields: [{
|
131
|
+
label: "URL",
|
132
|
+
key: "backgroundImage",
|
133
|
+
type: "text"
|
134
|
+
}, {
|
135
|
+
label: "Background Image",
|
136
|
+
key: "backgroundImage",
|
137
|
+
type: "backgroundImage"
|
138
|
+
}]
|
139
|
+
}, {
|
140
|
+
tab: "Add to Boards",
|
141
|
+
value: "metadatamapping",
|
142
|
+
fields: [{
|
143
|
+
label: "Add response to contacts board",
|
144
|
+
key: "metadatamapping",
|
145
|
+
type: "metadatamapping",
|
146
|
+
compType: "card",
|
147
|
+
content: "By default, form responses are added as separate cards on the default contact board.",
|
148
|
+
value: "mappingToContactBoard",
|
149
|
+
infoIcon: /*#__PURE__*/_jsx(Icon, {
|
150
|
+
icon: "info"
|
151
|
+
})
|
152
|
+
}, {
|
153
|
+
label: "Create a separate board",
|
154
|
+
key: "metadatamapping",
|
155
|
+
type: "metadatamapping",
|
156
|
+
compType: "card",
|
157
|
+
content: "By default, form responses are added as separate cards on a new board (Contact Us).",
|
158
|
+
value: "mappingToSeparateBoard",
|
159
|
+
infoIcon: /*#__PURE__*/_jsx(Icon, {
|
160
|
+
icon: "info"
|
161
|
+
})
|
162
|
+
}]
|
16
163
|
}, {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
164
|
+
tab: "Save As Template",
|
165
|
+
value: "saveAsTemplate",
|
166
|
+
needActions: false,
|
167
|
+
hideOnFGS: true,
|
168
|
+
fields: [{
|
169
|
+
label: "Template Image",
|
170
|
+
key: "saveAsTemplate",
|
171
|
+
type: "saveAsTemplate"
|
172
|
+
}]
|
21
173
|
}]
|
22
174
|
}, {
|
23
|
-
tab: "
|
24
|
-
value: "
|
175
|
+
tab: "Field Settings",
|
176
|
+
value: "FieldSetting",
|
177
|
+
hasChildrenTabs: false,
|
25
178
|
fields: [{
|
26
|
-
label: "Title",
|
27
|
-
key: "formTitle",
|
28
|
-
type: "text"
|
29
|
-
}, {
|
30
179
|
label: "Font Family",
|
31
|
-
key: "
|
180
|
+
key: "fieldFontFamily",
|
32
181
|
type: "textOptions",
|
182
|
+
hideMetaDataOptions: true,
|
33
183
|
options: fontOptions,
|
34
184
|
webFont: true,
|
35
|
-
width: 7,
|
36
185
|
renderOption: option => {
|
37
186
|
return /*#__PURE__*/_jsx("span", {
|
38
187
|
style: {
|
@@ -41,42 +190,52 @@ const formStyle = [{
|
|
41
190
|
children: option.text
|
42
191
|
});
|
43
192
|
}
|
193
|
+
}, {
|
194
|
+
label: "Font Weight",
|
195
|
+
key: "fieldFontWeight",
|
196
|
+
type: "textOptions",
|
197
|
+
width: 5,
|
198
|
+
options: fontWeightOptions,
|
199
|
+
hideMetaDataOptions: true,
|
200
|
+
renderOption: option => {
|
201
|
+
return /*#__PURE__*/_jsx("span", {
|
202
|
+
style: {
|
203
|
+
fontWeight: option.value
|
204
|
+
},
|
205
|
+
children: option.text
|
206
|
+
});
|
207
|
+
}
|
44
208
|
}, {
|
45
209
|
label: "Font Size",
|
46
|
-
key: "
|
210
|
+
key: "fieldTextSize",
|
47
211
|
type: "fontSize",
|
48
212
|
width: 5,
|
49
213
|
placeholder: "16px"
|
50
214
|
}, {
|
51
|
-
label: "Text
|
52
|
-
key: "
|
53
|
-
type: "
|
54
|
-
|
55
|
-
}
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
label: "
|
61
|
-
key: "
|
62
|
-
type: "
|
63
|
-
}]
|
64
|
-
}, {
|
65
|
-
tab: "Border",
|
66
|
-
value: "border",
|
67
|
-
fields: [{
|
68
|
-
label: "Border Radius",
|
69
|
-
key: "borderRadius",
|
70
|
-
type: "borderRadius"
|
215
|
+
label: "Text Color",
|
216
|
+
key: "fieldTextColor",
|
217
|
+
type: "color",
|
218
|
+
needPreview: true
|
219
|
+
}, {
|
220
|
+
label: "Background Color",
|
221
|
+
key: "fieldBgColor",
|
222
|
+
type: "color"
|
223
|
+
}, {
|
224
|
+
label: "Border Color",
|
225
|
+
key: "fieldBorderColor",
|
226
|
+
type: "color"
|
71
227
|
}, {
|
72
228
|
label: "Border Width",
|
73
|
-
key: "
|
229
|
+
key: "fieldBorderWidth",
|
74
230
|
type: "text",
|
231
|
+
width: 5,
|
75
232
|
placeholder: "1px"
|
76
233
|
}, {
|
77
234
|
label: "Border Style",
|
78
|
-
key: "
|
235
|
+
key: "fieldBorderStyle",
|
79
236
|
type: "textOptions",
|
237
|
+
hideMetaDataOptions: true,
|
238
|
+
width: 5,
|
80
239
|
options: [{
|
81
240
|
text: "Solid",
|
82
241
|
value: "solid"
|
@@ -93,76 +252,4 @@ const formStyle = [{
|
|
93
252
|
});
|
94
253
|
}
|
95
254
|
}]
|
96
|
-
}
|
97
|
-
tab: "Colors",
|
98
|
-
value: "colors",
|
99
|
-
fields: [{
|
100
|
-
label: "Text Color",
|
101
|
-
key: "textColor",
|
102
|
-
type: "color",
|
103
|
-
needPreview: true
|
104
|
-
}, {
|
105
|
-
label: "Background Color",
|
106
|
-
key: "bgColor",
|
107
|
-
type: "color"
|
108
|
-
}, {
|
109
|
-
label: "Border Color",
|
110
|
-
key: "borderColor",
|
111
|
-
type: "color"
|
112
|
-
}]
|
113
|
-
}, {
|
114
|
-
tab: "Position",
|
115
|
-
value: "position",
|
116
|
-
fields: [{
|
117
|
-
label: "Set Postion (Vertical & Horizantal)",
|
118
|
-
key: "alignment",
|
119
|
-
type: "alignment"
|
120
|
-
}]
|
121
|
-
}, {
|
122
|
-
tab: "Background",
|
123
|
-
value: "backgroundImage",
|
124
|
-
fields: [{
|
125
|
-
label: "URL",
|
126
|
-
key: "backgroundImage",
|
127
|
-
type: "text"
|
128
|
-
}, {
|
129
|
-
label: "Background Image",
|
130
|
-
key: "backgroundImage",
|
131
|
-
type: "backgroundImage"
|
132
|
-
}]
|
133
|
-
}, {
|
134
|
-
tab: "Add to Boards",
|
135
|
-
value: "metadatamapping",
|
136
|
-
fields: [{
|
137
|
-
label: "Add response to contacts board",
|
138
|
-
key: "metadatamapping",
|
139
|
-
type: "metadatamapping",
|
140
|
-
compType: "card",
|
141
|
-
content: "By default, form responses are added as separate cards on the default contact board.",
|
142
|
-
value: "mappingToContactBoard",
|
143
|
-
infoIcon: /*#__PURE__*/_jsx(Icon, {
|
144
|
-
icon: "info"
|
145
|
-
})
|
146
|
-
}, {
|
147
|
-
label: "Create a separate board",
|
148
|
-
key: "metadatamapping",
|
149
|
-
type: "metadatamapping",
|
150
|
-
compType: "card",
|
151
|
-
content: "By default, form responses are added as separate cards on a new board (Contact Us).",
|
152
|
-
value: "mappingToSeparateBoard",
|
153
|
-
infoIcon: /*#__PURE__*/_jsx(Icon, {
|
154
|
-
icon: "info"
|
155
|
-
})
|
156
|
-
}]
|
157
|
-
}, {
|
158
|
-
tab: "Save As Template",
|
159
|
-
value: "saveAsTemplate",
|
160
|
-
needActions: false,
|
161
|
-
hideOnFGS: true,
|
162
|
-
fields: [{
|
163
|
-
label: "Template Image",
|
164
|
-
key: "saveAsTemplate",
|
165
|
-
type: "saveAsTemplate"
|
166
|
-
}]
|
167
|
-
}];
|
168
|
-
export default formStyle;
|
255
|
+
}];
|
@@ -79,6 +79,11 @@ const gridItemStyle = [{
|
|
79
79
|
label: "Width Size",
|
80
80
|
key: "grid",
|
81
81
|
type: "gridSize"
|
82
|
+
}, {
|
83
|
+
label: "Force Full Width on Mobile",
|
84
|
+
key: "forceFullWidth",
|
85
|
+
type: "selectBox",
|
86
|
+
placeholder: "Force Full Width on Mobile"
|
82
87
|
}, {
|
83
88
|
label: "Height",
|
84
89
|
key: "cellGHeight",
|
@@ -1,12 +1,31 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
|
-
import { DialogTitle, DialogContent, DialogActions, Button, Grid, IconButton, Typography, Drawer, SwipeableDrawer } from "@mui/material";
|
2
|
+
import { DialogTitle, DialogContent, DialogActions, Button, Grid, IconButton, Typography, Drawer, SwipeableDrawer, Accordion, AccordionSummary, AccordionDetails, createTheme } from "@mui/material";
|
3
3
|
import FieldMap from "./fieldTypes";
|
4
4
|
import CloseIcon from "@mui/icons-material/Close";
|
5
5
|
import useCommonStyle from "../../commonStyle";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
|
+
import { ThemeProvider } from "@mui/material/styles";
|
8
|
+
import { ExpandMoreOutlined, Height } from "@mui/icons-material";
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
11
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
12
|
+
const muiTheme = createTheme({
|
13
|
+
components: {
|
14
|
+
MuiAccordion: {
|
15
|
+
styleOverrides: {
|
16
|
+
root: {
|
17
|
+
padding: "0px",
|
18
|
+
"&.Mui-expanded": {
|
19
|
+
margin: "0"
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
defaultProps: {
|
24
|
+
elevation: 0
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
});
|
10
29
|
export const StyleContent = props => {
|
11
30
|
const {
|
12
31
|
value,
|
@@ -73,6 +92,9 @@ const StyleBuilder = props => {
|
|
73
92
|
} = tabVal || {
|
74
93
|
needActions: true
|
75
94
|
};
|
95
|
+
const {
|
96
|
+
hideTools
|
97
|
+
} = customProps || {};
|
76
98
|
useEffect(() => {
|
77
99
|
if (customProps?.onDrawerOpen) {
|
78
100
|
customProps?.onDrawerOpen(true);
|
@@ -140,17 +162,108 @@ const StyleBuilder = props => {
|
|
140
162
|
}), /*#__PURE__*/_jsx(DialogContent, {
|
141
163
|
sx: {
|
142
164
|
maxHeight: isMobile ? `500px` : `${window.innerHeight - 125}px`,
|
143
|
-
padding: "
|
165
|
+
padding: "0px"
|
144
166
|
},
|
145
167
|
children: renderTabs.map((m, i) => {
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
168
|
+
if (m?.hasChildrenTabs) {
|
169
|
+
return /*#__PURE__*/_jsx(ThemeProvider, {
|
170
|
+
theme: muiTheme,
|
171
|
+
children: /*#__PURE__*/_jsxs(Accordion, {
|
172
|
+
defaultExpanded: true,
|
173
|
+
children: [/*#__PURE__*/_jsx(AccordionSummary, {
|
174
|
+
expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
|
175
|
+
sx: {
|
176
|
+
padding: "0px"
|
177
|
+
},
|
178
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
179
|
+
variant: "h3",
|
180
|
+
className: "settingsHeader",
|
181
|
+
color: "primary",
|
182
|
+
style: {
|
183
|
+
fontSize: "14px !important",
|
184
|
+
fontWeight: "400"
|
185
|
+
},
|
186
|
+
children: m?.tab
|
187
|
+
})
|
188
|
+
}), /*#__PURE__*/_jsx(AccordionDetails, {
|
189
|
+
sx: {
|
190
|
+
padding: "5px"
|
191
|
+
},
|
192
|
+
children: m?.fields.filter(f => (hideTools || []).indexOf(f.value) === -1).map((field, index) => {
|
193
|
+
return /*#__PURE__*/_jsx(ThemeProvider, {
|
194
|
+
theme: muiTheme,
|
195
|
+
children: /*#__PURE__*/_jsxs(Accordion, {
|
196
|
+
defaultExpanded: true,
|
197
|
+
children: [/*#__PURE__*/_jsx(AccordionSummary, {
|
198
|
+
expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
|
199
|
+
sx: {
|
200
|
+
padding: "0px"
|
201
|
+
},
|
202
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
203
|
+
variant: "h3",
|
204
|
+
className: "settingsHeader",
|
205
|
+
color: "primary",
|
206
|
+
style: {
|
207
|
+
fontSize: "14px !important",
|
208
|
+
fontWeight: "400"
|
209
|
+
},
|
210
|
+
children: field?.tab
|
211
|
+
})
|
212
|
+
}), /*#__PURE__*/_jsx(AccordionDetails, {
|
213
|
+
sx: {
|
214
|
+
padding: "0px"
|
215
|
+
},
|
216
|
+
children: /*#__PURE__*/_jsx(StyleContent, {
|
217
|
+
renderTabs: [field],
|
218
|
+
value: field.value,
|
219
|
+
element: elementProps,
|
220
|
+
onChange: onElementPropsChange,
|
221
|
+
customProps: customProps,
|
222
|
+
handleClose: handleClose
|
223
|
+
}, `tab_${field.value}_${index}`)
|
224
|
+
})]
|
225
|
+
}, `accordion_${index}`)
|
226
|
+
}, index);
|
227
|
+
})
|
228
|
+
})]
|
229
|
+
}, `accordion_${i}`)
|
230
|
+
}, i);
|
231
|
+
} else {
|
232
|
+
return /*#__PURE__*/_jsx(ThemeProvider, {
|
233
|
+
theme: muiTheme,
|
234
|
+
children: /*#__PURE__*/_jsxs(Accordion, {
|
235
|
+
defaultExpanded: true,
|
236
|
+
children: [/*#__PURE__*/_jsx(AccordionSummary, {
|
237
|
+
expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
|
238
|
+
sx: {
|
239
|
+
padding: "0px"
|
240
|
+
},
|
241
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
242
|
+
variant: "h3",
|
243
|
+
className: "settingsHeader",
|
244
|
+
color: "primary",
|
245
|
+
style: {
|
246
|
+
fontSize: "14px !important",
|
247
|
+
fontWeight: "400"
|
248
|
+
},
|
249
|
+
children: m?.tab
|
250
|
+
})
|
251
|
+
}), /*#__PURE__*/_jsx(AccordionDetails, {
|
252
|
+
sx: {
|
253
|
+
padding: "0px"
|
254
|
+
},
|
255
|
+
children: /*#__PURE__*/_jsx(StyleContent, {
|
256
|
+
renderTabs: renderTabs,
|
257
|
+
value: m.value,
|
258
|
+
element: elementProps,
|
259
|
+
onChange: onElementPropsChange,
|
260
|
+
customProps: customProps,
|
261
|
+
handleClose: handleClose
|
262
|
+
}, `tab_${m.value}_$${i}`)
|
263
|
+
})]
|
264
|
+
}, `accordion_${i}`)
|
265
|
+
}, i);
|
266
|
+
}
|
154
267
|
})
|
155
268
|
}), needActions ? /*#__PURE__*/_jsxs(DialogActions, {
|
156
269
|
sx: {
|
@@ -14,6 +14,19 @@ const withCustomDeleteBackward = editor => {
|
|
14
14
|
selection
|
15
15
|
} = editor;
|
16
16
|
if (selection) {
|
17
|
+
// get the current node
|
18
|
+
const [freeGridItemNode] = Editor.nodes(editor, {
|
19
|
+
match: n => n.type === "freegridItem" // Adjust based on your list item type
|
20
|
+
});
|
21
|
+
|
22
|
+
// if it is freegrid
|
23
|
+
if (freeGridItemNode && freeGridItemNode[0]) {
|
24
|
+
const hasText = Node.string(freeGridItemNode[0]);
|
25
|
+
if (!hasText) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
17
30
|
// Check if current node is a list item and is the last one
|
18
31
|
const [node] = Editor.nodes(editor, {
|
19
32
|
match: n => n.type === "list-item" // Adjust based on your list item type
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Editor, Range, Text } from "slate";
|
2
|
+
const highlightSelection = ([node, path], editor = {}) => {
|
3
|
+
if (Text.isText(node) && editor?.selection) {
|
4
|
+
const intersection = Range.intersection(editor.selection, Editor.range(editor, path));
|
5
|
+
if (!intersection) {
|
6
|
+
return [];
|
7
|
+
}
|
8
|
+
|
9
|
+
// Avoid applying highlight if the range only includes line breaks
|
10
|
+
const rangeText = Editor.string(editor, intersection);
|
11
|
+
if (!rangeText.trim()) {
|
12
|
+
return [];
|
13
|
+
}
|
14
|
+
const range = {
|
15
|
+
highlight: true,
|
16
|
+
...intersection
|
17
|
+
};
|
18
|
+
return [range];
|
19
|
+
}
|
20
|
+
return [];
|
21
|
+
};
|
22
|
+
export default highlightSelection;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import highlightSelection from "./highlightSelection";
|
1
2
|
import link from "./link";
|
2
|
-
const decorators = d => {
|
3
|
-
return [...link(d)];
|
3
|
+
const decorators = (d, editor) => {
|
4
|
+
return [...link(d, editor), ...highlightSelection(d, editor)];
|
4
5
|
};
|
5
6
|
export default decorators;
|
@@ -242,6 +242,15 @@ export const getMarked = (leaf, children, theme) => {
|
|
242
242
|
})
|
243
243
|
});
|
244
244
|
}
|
245
|
+
if (leaf.highlight) {
|
246
|
+
children = /*#__PURE__*/_jsx("span", {
|
247
|
+
style: {
|
248
|
+
background: "#EAEBFE",
|
249
|
+
color: "inherit"
|
250
|
+
},
|
251
|
+
children: children
|
252
|
+
});
|
253
|
+
}
|
245
254
|
if (leaf.decoration === "link") {
|
246
255
|
children = /*#__PURE__*/_jsx("a", {
|
247
256
|
style: {
|
@@ -60,7 +60,14 @@ export const signedTextFonts = Object.keys(fontFamilyMap).slice(-12).map(m => {
|
|
60
60
|
};
|
61
61
|
});
|
62
62
|
export const headingMap = {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
};
|
63
|
+
headingOne: "32px",
|
64
|
+
headingTwo: "24px",
|
65
|
+
headingThree: "19px"
|
66
|
+
};
|
67
|
+
export const fontWeightOptions = [{
|
68
|
+
text: "Bold",
|
69
|
+
value: "500"
|
70
|
+
}, {
|
71
|
+
text: "Bolder",
|
72
|
+
value: "600"
|
73
|
+
}];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Transforms } from "slate";
|
2
|
-
export const formField =
|
2
|
+
export const formField = data => {
|
3
3
|
return {
|
4
4
|
type: "form-field",
|
5
5
|
grid: 6,
|
@@ -12,14 +12,18 @@ export const formField = () => {
|
|
12
12
|
text: ""
|
13
13
|
}],
|
14
14
|
field_type: "text",
|
15
|
-
bgColor: "rgba(255, 255, 255, 1)",
|
16
|
-
borderColor: "#ccc",
|
15
|
+
bgColor: data?.bgColor ? data?.bgColor : "rgba(255, 255, 255, 1)",
|
16
|
+
borderColor: data?.borderColor ? data?.borderColor : "#ccc",
|
17
17
|
bannerSpacing: {
|
18
18
|
left: 16,
|
19
19
|
right: 16,
|
20
20
|
top: 16,
|
21
21
|
bottom: 16
|
22
|
-
}
|
22
|
+
},
|
23
|
+
fontFamily: data?.fontFamily ? data?.fontFamily : "",
|
24
|
+
textSize: data?.textSize ? data?.textSize : "",
|
25
|
+
textColor: data?.textColor ? data?.textColor : "",
|
26
|
+
fontWeight: data?.fontWeight ? data?.fontWeight : "500"
|
23
27
|
};
|
24
28
|
};
|
25
29
|
export const insertGridItem = editor => {
|
@@ -64,7 +64,7 @@ export const getBorderColor = (color, borderWidth = 3) => {
|
|
64
64
|
export const absoluteLink = url => {
|
65
65
|
try {
|
66
66
|
if (url?.indexOf("://") === -1) {
|
67
|
-
return
|
67
|
+
return `/${url}`;
|
68
68
|
}
|
69
69
|
return url;
|
70
70
|
} catch (err) {
|
@@ -496,7 +496,7 @@ export const isFreeGrid = (nodes, types = ["freegrid", "freegridItem", "freegrid
|
|
496
496
|
}
|
497
497
|
return false;
|
498
498
|
} catch (err) {
|
499
|
-
console.log(
|
499
|
+
console.log("isFreeGrid error:", err);
|
500
500
|
return false;
|
501
501
|
}
|
502
502
|
};
|