@flozy/editor 4.8.0 → 4.8.1
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 +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
|
@@ -314,7 +314,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
314
314
|
site_id: site_id,
|
|
315
315
|
page_title: page_title,
|
|
316
316
|
isIframe: isIframe,
|
|
317
|
-
onDrawerOpen: onDrawerOpen
|
|
317
|
+
onDrawerOpen: onDrawerOpen,
|
|
318
|
+
ICON_API: "https://assets.agenciflow.com"
|
|
318
319
|
};
|
|
319
320
|
const renderElement = useCallback(props => {
|
|
320
321
|
return /*#__PURE__*/_jsx(Element, {
|
|
@@ -534,7 +535,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
534
535
|
readOnly: isReadOnly,
|
|
535
536
|
renderElement: renderElement,
|
|
536
537
|
renderLeaf: renderLeaf,
|
|
537
|
-
decorate: decorators,
|
|
538
|
+
decorate: d => decorators(d, editor),
|
|
538
539
|
onKeyDown: onKeyDown,
|
|
539
540
|
onSelect: () => handleCursorScroll(editorWrapper.current)
|
|
540
541
|
}), !readOnly ? /*#__PURE__*/_jsx(MentionsPopup, {
|
|
@@ -584,8 +585,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
584
585
|
}), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
|
|
585
586
|
...htmlAction,
|
|
586
587
|
handleCodeToText: handleCodeToText
|
|
587
|
-
}), /*#__PURE__*/_jsx(FontLoader, {
|
|
588
|
-
...props
|
|
589
588
|
})]
|
|
590
589
|
}, id)
|
|
591
590
|
})
|
package/dist/Editor/Editor.css
CHANGED
|
@@ -1225,5 +1225,12 @@ blockquote {
|
|
|
1225
1225
|
@media (max-width: 899px) {
|
|
1226
1226
|
.MuiPopover-root {
|
|
1227
1227
|
z-index: 1302 !important;
|
|
1228
|
-
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
.settingsHeader {
|
|
1232
|
+
font-size: 14px !important;
|
|
1233
|
+
font-weight: 600 !important;
|
|
1234
|
+
font-family: Inter, sans-serif;
|
|
1235
|
+
text-transform: uppercase;
|
|
1229
1236
|
}
|
|
@@ -90,6 +90,7 @@ function AIInput({
|
|
|
90
90
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
91
91
|
component: "div",
|
|
92
92
|
sx: classes.aiContainer,
|
|
93
|
+
ref: refs[0],
|
|
93
94
|
children: [generatedText ? /*#__PURE__*/_jsx(Typography, {
|
|
94
95
|
sx: classes.generatedText,
|
|
95
96
|
style: {
|
|
@@ -104,7 +105,6 @@ function AIInput({
|
|
|
104
105
|
onSubmit: e => {
|
|
105
106
|
e.preventDefault();
|
|
106
107
|
},
|
|
107
|
-
ref: refs[0],
|
|
108
108
|
children: [/*#__PURE__*/_jsx("div", {
|
|
109
109
|
className: "icon-container icons-elements",
|
|
110
110
|
ref: inputWrapperRef,
|
|
@@ -116,22 +116,21 @@ function AIInput({
|
|
|
116
116
|
children: /*#__PURE__*/_jsx(WaveLoading, {})
|
|
117
117
|
}) : /*#__PURE__*/_jsx(TextareaAutosize, {
|
|
118
118
|
className: "ai-input",
|
|
119
|
-
placeholder:
|
|
119
|
+
placeholder: "Ask AI to write anything...",
|
|
120
120
|
ref: inputRef,
|
|
121
121
|
value: inputValue,
|
|
122
122
|
onChange: onInputChange,
|
|
123
|
-
disabled: fromToolBar,
|
|
124
123
|
onKeyDown: event => {
|
|
125
124
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
126
125
|
event.preventDefault();
|
|
127
126
|
handleSendBtnClick();
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
|
-
}),
|
|
129
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
131
130
|
component: "div",
|
|
132
131
|
style: classes.sendIconContainer,
|
|
133
132
|
className: "icons-elements",
|
|
134
|
-
children: [
|
|
133
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
135
134
|
disabled: loading,
|
|
136
135
|
onClick: () => startRecording(),
|
|
137
136
|
children: /*#__PURE__*/_jsx(ChatMicIcon, {})
|
|
@@ -40,9 +40,11 @@ const scrollToAIInput = editor => {
|
|
|
40
40
|
}, 200);
|
|
41
41
|
};
|
|
42
42
|
const insertText = (editor, text, options) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
if (text?.length) {
|
|
44
|
+
const parsed = new DOMParser().parseFromString(text, "text/html");
|
|
45
|
+
const fragment = deserialize(parsed.body);
|
|
46
|
+
Transforms.insertFragment(editor, fragment, options);
|
|
47
|
+
}
|
|
46
48
|
};
|
|
47
49
|
const insertAtNextLine = (editor, text) => {
|
|
48
50
|
const nextLine = getNextLine(editor);
|
|
@@ -199,81 +201,95 @@ function PopoverAIInput({
|
|
|
199
201
|
useEffect(() => {
|
|
200
202
|
selectedEleRef.current = selectedElement;
|
|
201
203
|
}, [selectedElement]);
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
onClickOutside();
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
if (type === "done") {
|
|
208
|
-
// Get the current selection point
|
|
209
|
-
const {
|
|
210
|
-
anchor
|
|
211
|
-
} = editor.selection;
|
|
212
|
-
const {
|
|
213
|
-
path
|
|
214
|
-
} = anchor;
|
|
215
|
-
const {
|
|
216
|
-
text: selectText
|
|
217
|
-
} = Node.get(editor, path);
|
|
218
|
-
if (selectText?.length) {
|
|
219
|
-
insertAtNextLine(editor, generatedText);
|
|
220
|
-
} else {
|
|
221
|
-
insertText(editor, generatedText);
|
|
222
|
-
}
|
|
223
|
-
onClickOutside();
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (type === "replace_selection") {
|
|
227
|
-
// replace generated text
|
|
228
|
-
insertText(editor, generatedText);
|
|
229
|
-
onClickOutside();
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
if (type === "speech_to_text") {
|
|
233
|
-
setGeneratedText(option.text);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if (type === "try_again") {
|
|
237
|
-
// resetting the previous option and try again
|
|
238
|
-
option = selectedOption;
|
|
239
|
-
type = selectedOption.value;
|
|
240
|
-
} else {
|
|
241
|
-
setSelectedOption(option);
|
|
242
|
-
}
|
|
243
|
-
setLoading(true);
|
|
244
|
-
const payload = {
|
|
204
|
+
const framePayload = (type, option) => {
|
|
205
|
+
let payload = {
|
|
245
206
|
mode: option.mode || 0,
|
|
246
207
|
query: option?.inputValue || inputValue
|
|
247
208
|
};
|
|
248
209
|
if (option.mode === MODES.translate || option.mode === MODES.rephraseTone) {
|
|
249
210
|
payload.textOptionInput = type;
|
|
250
211
|
}
|
|
212
|
+
const selectedText = getSelectedText(editor);
|
|
213
|
+
const textData = generatedText || selectedText;
|
|
251
214
|
if (option.mode) {
|
|
252
|
-
payload.textData =
|
|
215
|
+
payload.textData = textData;
|
|
216
|
+
} else if (selectedText && Number(payload.mode) === 0) {
|
|
217
|
+
payload.query = `${selectedText} \n ${payload.query}`;
|
|
253
218
|
}
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
} = result || {};
|
|
260
|
-
if (!text) {
|
|
261
|
-
onClickOutside();
|
|
262
|
-
return;
|
|
219
|
+
const tryAgain = type === "try_again";
|
|
220
|
+
if (tryAgain) {
|
|
221
|
+
// resetting previous payload
|
|
222
|
+
const prevPayload = selectedOption?.payload || {};
|
|
223
|
+
payload = prevPayload;
|
|
263
224
|
}
|
|
264
|
-
|
|
225
|
+
return payload;
|
|
226
|
+
};
|
|
227
|
+
const onSend = async (type, option) => {
|
|
228
|
+
try {
|
|
229
|
+
if (type === "close") {
|
|
230
|
+
onClickOutside();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (type === "done") {
|
|
234
|
+
// Get the current selection point
|
|
235
|
+
const {
|
|
236
|
+
anchor
|
|
237
|
+
} = editor.selection;
|
|
238
|
+
const {
|
|
239
|
+
path
|
|
240
|
+
} = anchor;
|
|
241
|
+
const {
|
|
242
|
+
text: selectText
|
|
243
|
+
} = Node.get(editor, path);
|
|
244
|
+
if (selectText?.length) {
|
|
245
|
+
insertAtNextLine(editor, generatedText);
|
|
246
|
+
} else {
|
|
247
|
+
insertText(editor, generatedText);
|
|
248
|
+
}
|
|
249
|
+
onClickOutside();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (type === "replace_selection") {
|
|
253
|
+
// replace generated text
|
|
254
|
+
insertText(editor, generatedText);
|
|
255
|
+
onClickOutside();
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
setLoading(true);
|
|
259
|
+
const payload = framePayload(type, option);
|
|
260
|
+
setSelectedOption({
|
|
261
|
+
...option,
|
|
262
|
+
payload
|
|
263
|
+
});
|
|
264
|
+
const result = await services("infinityAI", payload);
|
|
265
|
+
setLoading(false);
|
|
266
|
+
setInputValue("");
|
|
267
|
+
let {
|
|
268
|
+
data: text
|
|
269
|
+
} = result || {};
|
|
270
|
+
if (!text) {
|
|
271
|
+
onClickOutside();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// if (!option.replace) {
|
|
265
276
|
if (type === "continue_writing") {
|
|
266
277
|
setGeneratedText(generatedText + text);
|
|
267
278
|
} else {
|
|
268
279
|
setGeneratedText(text);
|
|
269
280
|
}
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
insertText(editor, text);
|
|
273
281
|
|
|
274
|
-
|
|
275
|
-
|
|
282
|
+
// return;
|
|
283
|
+
// }
|
|
276
284
|
|
|
285
|
+
// ** we are not using this insertText right now, AI returned response will not insert into the editor immediately, so option.replace will be false always
|
|
286
|
+
// insertText(editor, text);
|
|
287
|
+
|
|
288
|
+
// scrollToAIInput();
|
|
289
|
+
} catch (err) {
|
|
290
|
+
console.error("Error on sending/inserting text", err);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
277
293
|
const onInputChange = e => {
|
|
278
294
|
setInputValue(e.target.value);
|
|
279
295
|
};
|
|
@@ -129,7 +129,6 @@ function AppHeader(props) {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
const drawer = /*#__PURE__*/_jsxs(Box, {
|
|
132
|
-
onClick: handleDrawerToggle,
|
|
133
132
|
sx: {
|
|
134
133
|
textAlign: "center"
|
|
135
134
|
},
|
|
@@ -139,6 +138,7 @@ function AppHeader(props) {
|
|
|
139
138
|
my: 2,
|
|
140
139
|
color: textColor
|
|
141
140
|
},
|
|
141
|
+
onClick: closeDrawer,
|
|
142
142
|
children: appLogo && appLogo !== "none" ? /*#__PURE__*/_jsx("img", {
|
|
143
143
|
alt: `${appTitle} Logo`,
|
|
144
144
|
style: {
|
|
@@ -150,16 +150,20 @@ function AppHeader(props) {
|
|
|
150
150
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(List, {
|
|
151
151
|
children: menus.map((item, i) => {
|
|
152
152
|
const buttonProps = handleLinkType(item.url, item.linkType, true, item.target === "_blank");
|
|
153
|
+
const onButtonClick = e => {
|
|
154
|
+
closeDrawer();
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
buttonProps?.onClick(e);
|
|
157
|
+
}, 200);
|
|
158
|
+
};
|
|
153
159
|
const onTouchEnd = e => {
|
|
154
160
|
if (buttonProps?.onTouchEnd) {
|
|
155
|
-
|
|
156
|
-
closeDrawer();
|
|
161
|
+
onButtonClick(e);
|
|
157
162
|
}
|
|
158
163
|
};
|
|
159
164
|
const onClick = e => {
|
|
160
165
|
if (buttonProps?.onClick) {
|
|
161
|
-
|
|
162
|
-
closeDrawer();
|
|
166
|
+
onButtonClick(e);
|
|
163
167
|
}
|
|
164
168
|
};
|
|
165
169
|
const props = {
|
|
@@ -171,6 +175,9 @@ function AppHeader(props) {
|
|
|
171
175
|
disablePadding: true,
|
|
172
176
|
children: /*#__PURE__*/_jsx(ListItemButton, {
|
|
173
177
|
...props,
|
|
178
|
+
component: "button",
|
|
179
|
+
href: "" // to avoid <a> tag
|
|
180
|
+
,
|
|
174
181
|
sx: {
|
|
175
182
|
textAlign: "center"
|
|
176
183
|
},
|
|
@@ -12,13 +12,19 @@ const EmbedPopup = props => {
|
|
|
12
12
|
format,
|
|
13
13
|
onDelete
|
|
14
14
|
} = props;
|
|
15
|
+
const videoStyles = embedVideoStyle?.filter(f => {
|
|
16
|
+
if (f?.value === "AspectRatio" && format !== "video") {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
});
|
|
15
21
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
|
16
22
|
title: format === "image" ? "Image" : format === "video" ? "video" : format === "calendly" ? "calendly" : "Embed",
|
|
17
23
|
type: format === "image" ? "embedImageStyle" : "embedVideoStyle",
|
|
18
24
|
element: element,
|
|
19
25
|
onSave: onSave,
|
|
20
26
|
onClose: onClose,
|
|
21
|
-
renderTabs: format === "image" ? embedImageStyle :
|
|
27
|
+
renderTabs: format === "image" ? embedImageStyle : videoStyles,
|
|
22
28
|
customProps: customProps,
|
|
23
29
|
onDelete: onDelete
|
|
24
30
|
});
|
|
@@ -6,14 +6,16 @@ const EmojiPicker = props => {
|
|
|
6
6
|
const {
|
|
7
7
|
onEmojiSelect,
|
|
8
8
|
onClose,
|
|
9
|
-
theme = 'light'
|
|
9
|
+
theme = 'light',
|
|
10
|
+
...rest
|
|
10
11
|
} = props;
|
|
11
12
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
12
13
|
children: /*#__PURE__*/_jsx(Picker, {
|
|
13
14
|
data: data,
|
|
14
15
|
onEmojiSelect: onEmojiSelect,
|
|
15
16
|
onClickOutside: onClose,
|
|
16
|
-
theme: theme
|
|
17
|
+
theme: theme,
|
|
18
|
+
...rest
|
|
17
19
|
})
|
|
18
20
|
});
|
|
19
21
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
2
|
import { Transforms } from "slate";
|
|
3
|
+
import { Node } from "slate";
|
|
3
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
|
4
5
|
import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography, useTheme } from "@mui/material";
|
|
5
6
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
@@ -48,7 +49,15 @@ const Form = props => {
|
|
|
48
49
|
textSize,
|
|
49
50
|
fontFamily,
|
|
50
51
|
textAlign,
|
|
51
|
-
alignment
|
|
52
|
+
alignment,
|
|
53
|
+
fieldFontFamily,
|
|
54
|
+
fieldFontWeight,
|
|
55
|
+
fieldTextSize,
|
|
56
|
+
fieldTextColor,
|
|
57
|
+
fieldBgColor,
|
|
58
|
+
fieldBorderColor,
|
|
59
|
+
fieldBorderWidth,
|
|
60
|
+
fieldBorderStyle
|
|
52
61
|
} = element;
|
|
53
62
|
const btnR = buttonProps?.borderRadius || {};
|
|
54
63
|
const btnSpacing = buttonProps?.bannerSpacing || {};
|
|
@@ -190,6 +199,24 @@ const Form = props => {
|
|
|
190
199
|
}, {
|
|
191
200
|
at: path
|
|
192
201
|
});
|
|
202
|
+
// adding form field style to the current form node
|
|
203
|
+
const currentNode = Node.get(editor, path);
|
|
204
|
+
if (currentNode) {
|
|
205
|
+
currentNode.children.forEach((item, index) => {
|
|
206
|
+
Transforms.setNodes(editor, {
|
|
207
|
+
bgColor: data?.fieldBgColor ? data?.fieldBgColor : "rgba(255, 255, 255, 1)",
|
|
208
|
+
borderColor: data?.fieldBorderColor ? data?.fieldBorderColor : "#ccc",
|
|
209
|
+
borderStyle: data?.fieldBorderStyle ? data?.fieldBorderStyle : "",
|
|
210
|
+
borderWidth: data?.fieldBorderWidth ? data?.fieldBorderWidth : "",
|
|
211
|
+
textColor: data?.fieldTextColor ? data?.fieldTextColor : "",
|
|
212
|
+
fontFamily: data?.fieldFontFamily ? data?.fieldFontFamily : "",
|
|
213
|
+
textSize: data?.fieldTextSize ? data?.fieldTextSize : "",
|
|
214
|
+
fontWeight: data?.fieldFontWeight ? data?.fieldFontWeight : ""
|
|
215
|
+
}, {
|
|
216
|
+
at: [...path, index]
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
}
|
|
193
220
|
onClose();
|
|
194
221
|
};
|
|
195
222
|
const onClose = () => {
|
|
@@ -198,7 +225,16 @@ const Form = props => {
|
|
|
198
225
|
const onAddFormField = () => {
|
|
199
226
|
try {
|
|
200
227
|
Transforms.insertNodes(editor, {
|
|
201
|
-
...formField(
|
|
228
|
+
...formField({
|
|
229
|
+
fontFamily: fieldFontFamily,
|
|
230
|
+
fontWeight: fieldFontWeight,
|
|
231
|
+
textSize: fieldTextSize,
|
|
232
|
+
textColor: fieldTextColor,
|
|
233
|
+
bgColor: fieldBgColor,
|
|
234
|
+
borderColor: fieldBorderColor,
|
|
235
|
+
borderWidth: fieldBorderWidth,
|
|
236
|
+
borderStyle: fieldBorderStyle
|
|
237
|
+
})
|
|
202
238
|
}, {
|
|
203
239
|
at: [...path, children.length]
|
|
204
240
|
});
|
|
@@ -16,6 +16,9 @@ const FormCheckbox = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -46,7 +49,10 @@ const FormCheckbox = props => {
|
|
|
46
49
|
},
|
|
47
50
|
borderStyle: borderStyle || "solid",
|
|
48
51
|
color: textColor || "#000",
|
|
49
|
-
background: bgColor || "transparent"
|
|
52
|
+
background: bgColor || "transparent",
|
|
53
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
54
|
+
fontSize: textSize || "inherit",
|
|
55
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
50
56
|
}
|
|
51
57
|
})
|
|
52
58
|
});
|
|
@@ -16,6 +16,9 @@ const FormDate = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -47,7 +50,10 @@ const FormDate = props => {
|
|
|
47
50
|
borderStyle: borderStyle || "solid",
|
|
48
51
|
color: textColor || "#000",
|
|
49
52
|
background: bgColor || "transparent",
|
|
50
|
-
paddingRight: '85px !important'
|
|
53
|
+
paddingRight: '85px !important',
|
|
54
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
55
|
+
fontSize: textSize || "inherit",
|
|
56
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
51
57
|
}
|
|
52
58
|
})
|
|
53
59
|
});
|
|
@@ -16,6 +16,9 @@ const FormEmail = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -47,7 +50,10 @@ const FormEmail = props => {
|
|
|
47
50
|
},
|
|
48
51
|
borderStyle: borderStyle || "solid",
|
|
49
52
|
color: textColor || "#000",
|
|
50
|
-
background: bgColor || "transparent"
|
|
53
|
+
background: bgColor || "transparent",
|
|
54
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
55
|
+
fontSize: textSize || "inherit",
|
|
56
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
51
57
|
}
|
|
52
58
|
})
|
|
53
59
|
});
|
|
@@ -16,6 +16,9 @@ const FormNumbers = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -63,7 +66,10 @@ const FormNumbers = props => {
|
|
|
63
66
|
},
|
|
64
67
|
borderStyle: borderStyle || "solid",
|
|
65
68
|
color: textColor || "#000",
|
|
66
|
-
background: bgColor || "transparent"
|
|
69
|
+
background: bgColor || "transparent",
|
|
70
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
71
|
+
fontSize: textSize || "inherit",
|
|
72
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
67
73
|
}
|
|
68
74
|
})
|
|
69
75
|
});
|
|
@@ -16,6 +16,9 @@ const FormRadioButton = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -46,7 +49,10 @@ const FormRadioButton = props => {
|
|
|
46
49
|
},
|
|
47
50
|
borderStyle: borderStyle || "solid",
|
|
48
51
|
color: textColor || "#000",
|
|
49
|
-
background: bgColor || "transparent"
|
|
52
|
+
background: bgColor || "transparent",
|
|
53
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
54
|
+
fontSize: textSize || "inherit",
|
|
55
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
50
56
|
}
|
|
51
57
|
})
|
|
52
58
|
});
|
|
@@ -16,6 +16,9 @@ const FormText = props => {
|
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
18
|
lockSpacing,
|
|
19
|
+
textSize,
|
|
20
|
+
fontFamily,
|
|
21
|
+
fontWeight,
|
|
19
22
|
...rest
|
|
20
23
|
} = fieldProps;
|
|
21
24
|
const onChange = e => {
|
|
@@ -45,7 +48,10 @@ const FormText = props => {
|
|
|
45
48
|
},
|
|
46
49
|
borderStyle: borderStyle || "solid",
|
|
47
50
|
color: textColor || "#000",
|
|
48
|
-
background: bgColor || "transparent"
|
|
51
|
+
background: bgColor || "transparent",
|
|
52
|
+
fontSize: textSize || "inherit",
|
|
53
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
54
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
49
55
|
}
|
|
50
56
|
})
|
|
51
57
|
});
|
|
@@ -15,6 +15,9 @@ const FormTextArea = props => {
|
|
|
15
15
|
borderColor,
|
|
16
16
|
textColor,
|
|
17
17
|
bgColor,
|
|
18
|
+
textSize,
|
|
19
|
+
fontFamily,
|
|
20
|
+
fontWeight,
|
|
18
21
|
...rest
|
|
19
22
|
} = fieldProps;
|
|
20
23
|
const onChange = e => {
|
|
@@ -45,7 +48,9 @@ const FormTextArea = props => {
|
|
|
45
48
|
borderStyle: borderStyle || "solid",
|
|
46
49
|
color: `${textColor || "#000"} !important`,
|
|
47
50
|
background: `${bgColor || "transparent"} !important`,
|
|
48
|
-
fontSize:
|
|
51
|
+
fontSize: textSize || "14px",
|
|
52
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
|
53
|
+
fontWeight: `${fontWeight} !important` || "400 !important"
|
|
49
54
|
}
|
|
50
55
|
})
|
|
51
56
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import StyleBuilder from "../../common/StyleBuilder";
|
|
3
|
-
import formStyle from "../../common/StyleBuilder/formStyle";
|
|
3
|
+
import { formStyle } from "../../common/StyleBuilder/formStyle";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
6
|
const FormPopup = props => {
|
|
6
7
|
const {
|
|
7
8
|
element,
|
|
@@ -9,14 +10,16 @@ const FormPopup = props => {
|
|
|
9
10
|
onClose,
|
|
10
11
|
customProps
|
|
11
12
|
} = props;
|
|
12
|
-
return /*#__PURE__*/_jsx(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
14
|
+
children: /*#__PURE__*/_jsx(StyleBuilder, {
|
|
15
|
+
title: "Form",
|
|
16
|
+
type: "formStyle",
|
|
17
|
+
element: element,
|
|
18
|
+
onSave: onSave,
|
|
19
|
+
onClose: onClose,
|
|
20
|
+
renderTabs: formStyle,
|
|
21
|
+
customProps: customProps
|
|
22
|
+
})
|
|
20
23
|
});
|
|
21
24
|
};
|
|
22
25
|
export default FormPopup;
|
|
@@ -144,8 +144,27 @@ const FreeGridItem = props => {
|
|
|
144
144
|
};
|
|
145
145
|
const onAddFormField = () => {
|
|
146
146
|
try {
|
|
147
|
+
const {
|
|
148
|
+
fieldFontFamily,
|
|
149
|
+
fieldFontWeight,
|
|
150
|
+
fieldTextSize,
|
|
151
|
+
fieldTextColor,
|
|
152
|
+
fieldBgColor,
|
|
153
|
+
fieldBorderColor,
|
|
154
|
+
fieldBorderWidth,
|
|
155
|
+
fieldBorderStyle
|
|
156
|
+
} = element?.children[0];
|
|
147
157
|
Transforms.insertNodes(editor, {
|
|
148
|
-
...formField(
|
|
158
|
+
...formField({
|
|
159
|
+
fontFamily: fieldFontFamily ? fieldFontFamily : "",
|
|
160
|
+
fontWeight: fieldFontWeight ? fieldFontWeight : "",
|
|
161
|
+
textSize: fieldTextSize ? fieldTextSize : "",
|
|
162
|
+
textColor: fieldTextColor ? fieldTextColor : "",
|
|
163
|
+
bgColor: fieldBgColor ? fieldBgColor : "",
|
|
164
|
+
borderColor: fieldBorderColor ? fieldBorderColor : "",
|
|
165
|
+
borderWidth: fieldBorderWidth ? fieldBorderWidth : "",
|
|
166
|
+
borderStyle: fieldBorderStyle ? fieldBorderStyle : ""
|
|
167
|
+
})
|
|
149
168
|
}, {
|
|
150
169
|
at: [...path, 0, 0]
|
|
151
170
|
});
|
|
@@ -62,7 +62,8 @@ const GridItem = props => {
|
|
|
62
62
|
textColor,
|
|
63
63
|
animation,
|
|
64
64
|
cellGHeight,
|
|
65
|
-
xsHidden
|
|
65
|
+
xsHidden,
|
|
66
|
+
forceFullWidth
|
|
66
67
|
} = element;
|
|
67
68
|
const {
|
|
68
69
|
vertical,
|
|
@@ -105,13 +106,17 @@ const GridItem = props => {
|
|
|
105
106
|
const getBorderColor = () => {
|
|
106
107
|
return borderColor || "transparent";
|
|
107
108
|
};
|
|
109
|
+
|
|
110
|
+
// getting Grid Item Width value
|
|
111
|
+
const gridWidthBreakPointsValue = getBreakPointsValue(grid, null, "overrideGridSize", true);
|
|
108
112
|
const getBRProps = groupByBreakpoint({
|
|
109
113
|
display: {
|
|
110
114
|
xs: xsHidden ? "none" : "inline-block",
|
|
111
115
|
lg: "inline-block"
|
|
112
116
|
},
|
|
113
117
|
width: {
|
|
114
|
-
...getBreakPointsValue(grid, null, "overrideGridSize", true)
|
|
118
|
+
...getBreakPointsValue(grid, null, "overrideGridSize", true),
|
|
119
|
+
xs: forceFullWidth ? "100%" : gridWidthBreakPointsValue?.xs
|
|
115
120
|
},
|
|
116
121
|
height: {
|
|
117
122
|
...getBreakPointsValue(cellGHeight || "auto")
|