@flozy/editor 3.3.4 → 3.3.6
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 +13 -2
- package/dist/Editor/Elements/AI/Styles.js +4 -3
- package/dist/Editor/Elements/Form/Form.js +14 -8
- package/dist/Editor/Elements/Variables/Style.js +14 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -1
- package/dist/Editor/Styles/EditorStyles.js +4 -0
- package/dist/Editor/common/MentionsPopup/ElementsListCard.js +2 -1
- package/dist/Editor/common/Shorthands/elements.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +6 -2
- package/package.json +1 -1
|
@@ -69,6 +69,8 @@ const Leaf = ({
|
|
|
69
69
|
const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
70
70
|
const {
|
|
71
71
|
id,
|
|
72
|
+
site_id,
|
|
73
|
+
page_title,
|
|
72
74
|
content,
|
|
73
75
|
onSave,
|
|
74
76
|
editor: collaborativeEditor,
|
|
@@ -96,6 +98,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
96
98
|
});
|
|
97
99
|
const [isScrolling, setIsScrolling] = useState(false);
|
|
98
100
|
const [isTextSelected, setIsTextSelected] = useState(false);
|
|
101
|
+
const [openInfiniti, setOpenInfiniti] = useState(false);
|
|
99
102
|
const [size] = useWindowResize();
|
|
100
103
|
const {
|
|
101
104
|
needDotsBG,
|
|
@@ -275,6 +278,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
275
278
|
...(otherProps || {}),
|
|
276
279
|
readOnly: isReadOnly,
|
|
277
280
|
page_id: id,
|
|
281
|
+
site_id: site_id,
|
|
282
|
+
page_title: page_title,
|
|
278
283
|
onDrawerOpen: onDrawerOpen
|
|
279
284
|
};
|
|
280
285
|
const renderElement = useCallback(props => {
|
|
@@ -381,6 +386,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
381
386
|
return /*#__PURE__*/_jsx(EditorProvider, {
|
|
382
387
|
theme: theme,
|
|
383
388
|
editor: editor,
|
|
389
|
+
setOpenInfiniti: setOpenInfiniti,
|
|
384
390
|
children: /*#__PURE__*/_jsx(DialogWrapper, {
|
|
385
391
|
classes: classes,
|
|
386
392
|
...props,
|
|
@@ -402,13 +408,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
402
408
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
403
409
|
className: `${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} ${isScrolling ? "" : "hideScroll"} scrollable-content scrollSmooth`,
|
|
404
410
|
sx: classes.slateWrapper,
|
|
405
|
-
id: "slate-wrapper-scroll-container"
|
|
406
|
-
style
|
|
411
|
+
id: "slate-wrapper-scroll-container"
|
|
412
|
+
// style={editorWrapperStyle}
|
|
413
|
+
,
|
|
407
414
|
ref: editorWrapper,
|
|
408
415
|
onClick: e => {
|
|
409
416
|
handleInsertLastElement(e, editor);
|
|
410
417
|
},
|
|
411
418
|
onScroll: handleScroll,
|
|
419
|
+
style: {
|
|
420
|
+
...editorWrapperStyle,
|
|
421
|
+
overflowY: openInfiniti ? "hidden" : "auto"
|
|
422
|
+
},
|
|
412
423
|
children: /*#__PURE__*/_jsxs(Box, {
|
|
413
424
|
component: "div",
|
|
414
425
|
className: "max-content",
|
|
@@ -11,7 +11,7 @@ const Styles = theme => ({
|
|
|
11
11
|
padding: "0px 12px",
|
|
12
12
|
minHeight: "36px",
|
|
13
13
|
position: "relative",
|
|
14
|
-
background:
|
|
14
|
+
background: "#FCFAFF",
|
|
15
15
|
borderRadius: "7px",
|
|
16
16
|
"& .icon-container": {
|
|
17
17
|
display: "flex",
|
|
@@ -82,8 +82,9 @@ const Styles = theme => ({
|
|
|
82
82
|
},
|
|
83
83
|
generatedText: {
|
|
84
84
|
margin: "8px",
|
|
85
|
-
maxHeight: "
|
|
86
|
-
overflow: "auto"
|
|
85
|
+
maxHeight: "100px",
|
|
86
|
+
overflow: "auto",
|
|
87
|
+
fontSize: "inherit"
|
|
87
88
|
},
|
|
88
89
|
customSelectWrapper: {
|
|
89
90
|
width: "fit-content",
|
|
@@ -26,6 +26,7 @@ const Form = props => {
|
|
|
26
26
|
readOnly,
|
|
27
27
|
site_id,
|
|
28
28
|
page_id,
|
|
29
|
+
page_title,
|
|
29
30
|
onFormSubmit
|
|
30
31
|
} = customProps;
|
|
31
32
|
const {
|
|
@@ -80,7 +81,7 @@ const Form = props => {
|
|
|
80
81
|
if ((readOnly || test) && formEle && formEle?.current) {
|
|
81
82
|
const formData = new FormData(formEle?.current);
|
|
82
83
|
setLoading(true);
|
|
83
|
-
|
|
84
|
+
const response = [];
|
|
84
85
|
let user_email = "";
|
|
85
86
|
let meta_data = [];
|
|
86
87
|
const validations = [];
|
|
@@ -123,18 +124,23 @@ const Form = props => {
|
|
|
123
124
|
rules: rule?.length > 0 && rule
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
|
-
response = {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
};
|
|
127
|
+
// response = {
|
|
128
|
+
// ...response,
|
|
129
|
+
// [pair[0]]: pair[1],
|
|
130
|
+
// };
|
|
131
|
+
const placeholder = fieldData?.name === pair[0] ? fieldData?.placeholder : "";
|
|
132
|
+
response?.push({
|
|
133
|
+
[pair[0]]: pair[1],
|
|
134
|
+
placeholder: placeholder,
|
|
135
|
+
from_name: formName,
|
|
136
|
+
page_title: page_title
|
|
137
|
+
});
|
|
130
138
|
}
|
|
131
139
|
let params = {
|
|
132
140
|
page_id: page_id,
|
|
133
141
|
site_id: site_id,
|
|
134
142
|
form_id: `${formName}`,
|
|
135
|
-
response:
|
|
136
|
-
...response
|
|
137
|
-
},
|
|
143
|
+
response: response,
|
|
138
144
|
form_data: {
|
|
139
145
|
user_email: user_email,
|
|
140
146
|
email: element?.email,
|
|
@@ -17,11 +17,11 @@ const VariableStyles = () => ({
|
|
|
17
17
|
textTransform: "none",
|
|
18
18
|
border: "1px solid #D8DDE1",
|
|
19
19
|
height: "36px",
|
|
20
|
-
paddingLeft:
|
|
21
|
-
paddingRight:
|
|
20
|
+
paddingLeft: "8px",
|
|
21
|
+
paddingRight: "18px",
|
|
22
22
|
"& svg": {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
23
|
+
width: "20px",
|
|
24
|
+
height: "20px",
|
|
25
25
|
"& path": {
|
|
26
26
|
stroke: "#64748B"
|
|
27
27
|
}
|
|
@@ -29,8 +29,16 @@ const VariableStyles = () => ({
|
|
|
29
29
|
"&:hover": {
|
|
30
30
|
border: "1px solid #64748B"
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
paddingRight:
|
|
32
|
+
"& .MuiSelect-select.MuiInputBase-input.MuiOutlinedInput-input": {
|
|
33
|
+
paddingRight: "5px"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
variableMenuItem: {
|
|
37
|
+
"& .MuiMenuItem-root": {
|
|
38
|
+
color: "#64748B"
|
|
39
|
+
},
|
|
40
|
+
"& .Mui-selected": {
|
|
41
|
+
backgroundColor: "rgba(0, 0, 0, 0.04) !important"
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
});
|
|
@@ -21,10 +21,13 @@ const VariableButton = props => {
|
|
|
21
21
|
labelId: "variable-selection",
|
|
22
22
|
id: "variable-selection-mini",
|
|
23
23
|
displayEmpty: true,
|
|
24
|
-
value:
|
|
24
|
+
value: "",
|
|
25
25
|
sx: classes.variableBtn,
|
|
26
26
|
onChange: updateVariable,
|
|
27
27
|
IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
|
|
28
|
+
MenuProps: {
|
|
29
|
+
sx: classes.variableMenuItem
|
|
30
|
+
},
|
|
28
31
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
29
32
|
value: "",
|
|
30
33
|
children: "Variables"
|
|
@@ -19,7 +19,8 @@ export const useEditorSelection = editor => {
|
|
|
19
19
|
export const EditorProvider = ({
|
|
20
20
|
editor,
|
|
21
21
|
theme,
|
|
22
|
-
children
|
|
22
|
+
children,
|
|
23
|
+
setOpenInfiniti
|
|
23
24
|
}) => {
|
|
24
25
|
const [event] = useMouseMove();
|
|
25
26
|
const [previous, setPrevious] = useState("");
|
|
@@ -54,7 +55,10 @@ export const EditorProvider = ({
|
|
|
54
55
|
popupType,
|
|
55
56
|
setPopupType,
|
|
56
57
|
openAI,
|
|
57
|
-
setOpenAI
|
|
58
|
+
setOpenAI: value => {
|
|
59
|
+
setOpenAI(value);
|
|
60
|
+
setOpenInfiniti(!!value);
|
|
61
|
+
}
|
|
58
62
|
},
|
|
59
63
|
children: children
|
|
60
64
|
});
|