@flozy/editor 5.8.9 → 5.9.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 +15 -22
- package/dist/Editor/Editor.css +16 -22
- package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
- package/dist/Editor/Elements/Button/EditorButton.js +1 -3
- package/dist/Editor/Elements/DataView/DataView.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +14 -8
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
- package/dist/Editor/Elements/Form/Form.js +0 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Link/Link.js +31 -42
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
- package/dist/Editor/Elements/Search/SearchList.js +1 -8
- package/dist/Editor/Elements/SimpleText/index.js +11 -13
- package/dist/Editor/Elements/SimpleText/style.js +1 -5
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +9 -14
- package/dist/Editor/Elements/Title/title.js +1 -13
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
- package/dist/Editor/MiniEditor.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +28 -37
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -9
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +0 -5
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
- package/dist/Editor/Toolbar/PopupTool/index.js +31 -30
- package/dist/Editor/common/FontLoader/FontList.js +11 -3
- package/dist/Editor/common/FontLoader/FontLoader.js +11 -28
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
- package/dist/Editor/common/Section/index.js +97 -78
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/common/iconslist.js +2 -1
- package/dist/Editor/commonStyle.js +57 -58
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +1 -24
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +2 -5
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +4 -15
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/helper.js +19 -60
- package/dist/Editor/utils/pageSettings.js +2 -14
- package/dist/Editor/utils/table.js +0 -21
- package/package.json +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
- package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
@@ -1,17 +1,17 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { useSlateStatic, useSelected, ReactEditor } from "slate-react";
|
3
3
|
import { Box } from "@mui/material";
|
4
|
-
|
4
|
+
import { getPageSettings } from "../../utils/pageSettings";
|
5
5
|
import { isTextSelected } from "../../utils/helper";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
8
|
-
import { getBreakpointLineSpacing } from "../../helper/theme";
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
10
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
11
|
import { createElement as _createElement } from "react";
|
13
12
|
const SimpleText = props => {
|
14
13
|
const {
|
14
|
+
theme,
|
15
15
|
openAI
|
16
16
|
} = useEditorContext() || {};
|
17
17
|
const editor = useSlateStatic();
|
@@ -27,16 +27,14 @@ const SimpleText = props => {
|
|
27
27
|
readOnly,
|
28
28
|
editorPlaceholder
|
29
29
|
} = customProps;
|
30
|
-
// const { element: pageSt } = getPageSettings(editor) || {};
|
31
|
-
// const { pageColor } = pageSt?.pageProps || {};
|
32
30
|
const {
|
33
|
-
|
34
|
-
} =
|
35
|
-
const
|
36
|
-
|
31
|
+
element: pageSt
|
32
|
+
} = getPageSettings(editor) || {};
|
33
|
+
const {
|
34
|
+
pageColor
|
35
|
+
} = pageSt?.pageProps || {};
|
37
36
|
const classes = SimpleTextStyle({
|
38
|
-
pageColor: "#FFFFFF"
|
39
|
-
lineHeight: lineH
|
37
|
+
pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF"
|
40
38
|
});
|
41
39
|
const selected = useSelected();
|
42
40
|
const path = ReactEditor.findPath(editor, element);
|
@@ -54,14 +52,14 @@ const SimpleText = props => {
|
|
54
52
|
contentEditable: false,
|
55
53
|
className: "placeholder-simple-text",
|
56
54
|
children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
|
57
|
-
children: ["Type
|
55
|
+
children: ["Type ", /*#__PURE__*/_jsx("span", {
|
58
56
|
style: {
|
59
|
-
backgroundColor:
|
57
|
+
backgroundColor: '#F2F6FA',
|
60
58
|
padding: "0px 2px",
|
61
59
|
borderRadius: "2px"
|
62
60
|
},
|
63
61
|
children: "/"
|
64
|
-
}), "
|
62
|
+
}), " to browse elements"]
|
65
63
|
}) : "" : ""
|
66
64
|
}));
|
67
65
|
};
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import { invertColor } from "../../helper";
|
2
2
|
const SimpleTextStyle = ({
|
3
|
-
pageColor
|
4
|
-
lineHeight
|
3
|
+
pageColor
|
5
4
|
}) => ({
|
6
5
|
root: {
|
7
6
|
position: "relative",
|
8
7
|
padding: "0px",
|
9
|
-
lineHeight: lineHeight,
|
10
8
|
"&.dataView": {
|
11
9
|
"& .placeholder-simple-text": {
|
12
10
|
opacity: 0
|
@@ -35,8 +33,6 @@ const SimpleTextStyle = ({
|
|
35
33
|
height: "24px",
|
36
34
|
overflow: "hidden",
|
37
35
|
fontSize: "14px",
|
38
|
-
display: "inline-flex",
|
39
|
-
alignItems: "center",
|
40
36
|
"& .bg-pad-sl": {
|
41
37
|
padding: "2px 4px 2px 4px",
|
42
38
|
background: "transparent",
|
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Editor, Transforms } from "slate";
|
3
3
|
import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
|
4
4
|
import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme, Popper, ClickAwayListener } from "@mui/material";
|
5
|
-
import { TableUtil
|
5
|
+
import { TableUtil } from "../../utils/table";
|
6
6
|
import TablePopup from "./TablePopup";
|
7
7
|
import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
|
8
8
|
import TableStyles from "./Styles";
|
@@ -206,7 +206,7 @@ const Table = props => {
|
|
206
206
|
}
|
207
207
|
}, theme);
|
208
208
|
const addRow = () => {
|
209
|
-
const lastRow =
|
209
|
+
const lastRow = element?.rows - 1;
|
210
210
|
const firstCol = 0;
|
211
211
|
const lastRowPath = [...path, lastRow, firstCol];
|
212
212
|
const position = Editor.start(editor, lastRowPath);
|
@@ -221,7 +221,7 @@ const Table = props => {
|
|
221
221
|
Transforms.deselect(editor);
|
222
222
|
};
|
223
223
|
const addCol = () => {
|
224
|
-
const lastCol =
|
224
|
+
const lastCol = element?.columns - 1;
|
225
225
|
const firstRow = 0;
|
226
226
|
const lastColumnPath = [...path, firstRow, lastCol];
|
227
227
|
const position = Editor.start(editor, lastColumnPath);
|
@@ -50,7 +50,6 @@ const TableCell = props => {
|
|
50
50
|
const {
|
51
51
|
readOnly
|
52
52
|
} = customProps;
|
53
|
-
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
54
53
|
const {
|
55
54
|
bgColor,
|
56
55
|
borderColor,
|
@@ -248,24 +247,20 @@ const TableCell = props => {
|
|
248
247
|
isDragging: false
|
249
248
|
});
|
250
249
|
};
|
251
|
-
const eventProps = isMobile ? {
|
252
|
-
// mobile events for selection
|
253
|
-
onTouchStart: onMouseDownInCell,
|
254
|
-
onTouchMove: handleTouchMove,
|
255
|
-
onTouchEnd: handleTouchEnd
|
256
|
-
} : {
|
257
|
-
onMouseEnter: () => onMouseEnter(path),
|
258
|
-
onMouseLeave,
|
259
|
-
onMouseDown: onMouseDownInCell,
|
260
|
-
onMouseUp,
|
261
|
-
onClick
|
262
|
-
};
|
263
250
|
const tbProps = tableResizing || resizing || over || readOnly ? {
|
264
251
|
...commonTdProps,
|
265
252
|
contentEditable: false
|
266
253
|
} : {
|
267
254
|
...commonTdProps,
|
268
|
-
|
255
|
+
onMouseEnter: () => onMouseEnter(path),
|
256
|
+
onMouseLeave,
|
257
|
+
onMouseDown: onMouseDownInCell,
|
258
|
+
onMouseUp,
|
259
|
+
onClick,
|
260
|
+
// mobile events for selection
|
261
|
+
onTouchStart: onMouseDownInCell,
|
262
|
+
onTouchMove: handleTouchMove,
|
263
|
+
onTouchEnd: handleTouchEnd
|
269
264
|
};
|
270
265
|
const dndProps = {
|
271
266
|
id: cellId,
|
@@ -1,24 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { Text } from "slate";
|
3
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
const isEmptyTextNode = node => {
|
5
|
-
if (Text.isText(node)) {
|
6
|
-
return !node.text.trim();
|
7
|
-
}
|
8
|
-
return false;
|
9
|
-
};
|
10
3
|
const Title = props => {
|
11
4
|
const {
|
12
|
-
element,
|
13
5
|
attributes,
|
14
|
-
children
|
15
|
-
customProps
|
6
|
+
children
|
16
7
|
} = props;
|
17
|
-
const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
|
18
8
|
return /*#__PURE__*/_jsx("div", {
|
19
9
|
...attributes,
|
20
|
-
placeholder: "Title",
|
21
|
-
className: `content-editable ${isEmpty}`,
|
22
10
|
style: {
|
23
11
|
fontWeight: "bold",
|
24
12
|
fontSize: "20px"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const VariableStyles =
|
1
|
+
const VariableStyles = () => ({
|
2
2
|
variablesItem: {
|
3
3
|
color: "#2563EB",
|
4
4
|
background: "#EEEEEE"
|
@@ -37,34 +37,8 @@ const VariableStyles = theme => ({
|
|
37
37
|
"& .MuiMenuItem-root": {
|
38
38
|
color: "#64748B"
|
39
39
|
},
|
40
|
-
"& .MuiPaper-root": {
|
41
|
-
borderRadius: '8px',
|
42
|
-
backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
|
43
|
-
marginTop: '5px',
|
44
|
-
"@media only screen and (max-width: 599px)": {
|
45
|
-
padding: '10px 0px'
|
46
|
-
}
|
47
|
-
},
|
48
|
-
"& .MuiList-root": {
|
49
|
-
padding: '0px'
|
50
|
-
},
|
51
|
-
"& .MuiButtonBase-root": {
|
52
|
-
margin: '6px',
|
53
|
-
borderRadius: '8px',
|
54
|
-
padding: '6px 14px',
|
55
|
-
fontSize: '14px',
|
56
|
-
fontWeight: '400',
|
57
|
-
color: theme?.palette?.editor?.deletePopUpButtonTextColor,
|
58
|
-
"&:hover": {
|
59
|
-
background: `${theme?.palette?.editor?.menuOptionHoverBackground} !important`
|
60
|
-
},
|
61
|
-
"@media only screen and (max-width: 599px)": {
|
62
|
-
minHeight: '30px',
|
63
|
-
margin: '0px 6px'
|
64
|
-
}
|
65
|
-
},
|
66
40
|
"& .Mui-selected": {
|
67
|
-
backgroundColor:
|
41
|
+
backgroundColor: "rgba(0, 0, 0, 0.04) !important"
|
68
42
|
}
|
69
43
|
}
|
70
44
|
});
|
@@ -3,15 +3,11 @@ import { useSlateStatic } from "slate-react";
|
|
3
3
|
import { MenuItem, Select } from "@mui/material";
|
4
4
|
import { insertVariables } from "../../utils/variables";
|
5
5
|
import VariableStyles from "./Style";
|
6
|
-
import
|
7
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
6
|
+
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
9
|
const VariableButton = props => {
|
11
|
-
const
|
12
|
-
theme
|
13
|
-
} = useEditorContext();
|
14
|
-
const classes = VariableStyles(theme);
|
10
|
+
const classes = VariableStyles();
|
15
11
|
const editor = useSlateStatic();
|
16
12
|
const {
|
17
13
|
options
|
@@ -28,14 +24,13 @@ const VariableButton = props => {
|
|
28
24
|
value: "",
|
29
25
|
sx: classes.variableBtn,
|
30
26
|
onChange: updateVariable,
|
31
|
-
IconComponent: () => /*#__PURE__*/_jsx(
|
27
|
+
IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
|
32
28
|
MenuProps: {
|
33
29
|
sx: classes.variableMenuItem,
|
34
30
|
PaperProps: {
|
35
31
|
style: {
|
36
32
|
maxHeight: 300,
|
37
|
-
overflowY: "auto"
|
38
|
-
transformOrigin: 'top left'
|
33
|
+
overflowY: "auto"
|
39
34
|
},
|
40
35
|
sx: {
|
41
36
|
"&::-webkit-scrollbar-track": {
|
@@ -45,14 +40,6 @@ const VariableButton = props => {
|
|
45
40
|
borderRadius: "16px"
|
46
41
|
}
|
47
42
|
}
|
48
|
-
},
|
49
|
-
anchorOrigin: {
|
50
|
-
vertical: 'bottom',
|
51
|
-
horizontal: 'right'
|
52
|
-
},
|
53
|
-
transformOrigin: {
|
54
|
-
vertical: 'top',
|
55
|
-
horizontal: 'right'
|
56
43
|
}
|
57
44
|
},
|
58
45
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
@@ -11,7 +11,6 @@ import withCommon from "./hooks/withCommon";
|
|
11
11
|
import { serializeToText } from "./utils/serializeToText";
|
12
12
|
import "./Editor.css";
|
13
13
|
import { EditorProvider } from "./hooks/useMouseMove";
|
14
|
-
import { ensureWrappedVariables } from "./helper/ensureWrappedVariables";
|
15
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
16
|
const MiniEditor = props => {
|
@@ -37,8 +36,7 @@ const MiniEditor = props => {
|
|
37
36
|
needLayout: false
|
38
37
|
}));
|
39
38
|
const [isInteracted, setIsInteracted] = useState(false);
|
40
|
-
const
|
41
|
-
const [value, setValue] = useState(ensureWrappedVariables(updatedContent));
|
39
|
+
const [value, setValue] = useState(content);
|
42
40
|
const [deboundedValue] = useDebounce(value, 500);
|
43
41
|
const isReadOnly = readOnly === "readonly";
|
44
42
|
const customProps = {
|
@@ -151,7 +149,7 @@ const MiniEditor = props => {
|
|
151
149
|
theme: theme,
|
152
150
|
children: /*#__PURE__*/_jsxs(Slate, {
|
153
151
|
editor: editor,
|
154
|
-
initialValue:
|
152
|
+
initialValue: content,
|
155
153
|
onChange: onChange,
|
156
154
|
children: [/*#__PURE__*/_jsx(BasicToolbar, {
|
157
155
|
...props,
|
@@ -4,7 +4,6 @@ import TemplateCard from "./TemplateCard";
|
|
4
4
|
import FullViewCard from "./FullViewCard";
|
5
5
|
import ButtonTemplateCard from "./ButtonTemplatesCard";
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
8
|
const CATEGORIES_SORT_INDEX = {
|
10
9
|
Brief: 1,
|
@@ -47,7 +46,7 @@ const ProgressBar = ({
|
|
47
46
|
alignItems: "center",
|
48
47
|
margin: 0,
|
49
48
|
padding: 0,
|
50
|
-
height: "
|
49
|
+
height: "50px",
|
51
50
|
overflow: "hidden"
|
52
51
|
},
|
53
52
|
children: /*#__PURE__*/_jsx(CircularProgress, {})
|
@@ -70,49 +69,41 @@ const AddTemplates = props => {
|
|
70
69
|
const [categories, setCategories] = useState([]);
|
71
70
|
const [category, setCategory] = useState("");
|
72
71
|
const [templates, setTemplates] = useState([]);
|
72
|
+
const [filteredTemplates, setFilteredTemplates] = useState([]);
|
73
73
|
useEffect(() => {
|
74
|
-
|
74
|
+
getTemplatesList();
|
75
75
|
}, []);
|
76
|
-
const
|
77
|
-
|
78
|
-
const categoryDB = await services("listCategory");
|
79
|
-
if (categoryDB?.data?.Template?.length > 0) {
|
80
|
-
setCategories(categoryDB.data.Template);
|
81
|
-
setCategory(categoryDB.data.Template[0]);
|
82
|
-
getTemplatesList(categoryDB.data.Template[0]);
|
83
|
-
}
|
84
|
-
setLoading(false);
|
76
|
+
const sortCategory = (a, b) => {
|
77
|
+
return (CATEGORIES_SORT_INDEX[a] || Infinity) - (CATEGORIES_SORT_INDEX[b] || Infinity);
|
85
78
|
};
|
86
|
-
const getTemplatesList = async
|
79
|
+
const getTemplatesList = async () => {
|
87
80
|
setLoading(true);
|
88
|
-
const result = await services("listTemplates", {
|
89
|
-
|
90
|
-
|
91
|
-
|
81
|
+
const result = await services("listTemplates", {});
|
82
|
+
const tempList = result?.data?.filter(f => f.type === "Template");
|
83
|
+
const lic = tempList?.reduce((a, b) => {
|
84
|
+
if (a.indexOf(b.category) < 0) {
|
85
|
+
a.push(b.category);
|
86
|
+
}
|
87
|
+
return a;
|
88
|
+
}, []).sort(sortCategory);
|
89
|
+
const ft = tempList?.filter(f => f.category === lic[0]);
|
90
|
+
setTemplates(tempList);
|
91
|
+
setCategories(lic);
|
92
|
+
setCategory(lic[0]);
|
93
|
+
setFilteredTemplates(ft);
|
92
94
|
setLoading(false);
|
93
95
|
};
|
94
96
|
const handleChange = (event, newValue) => {
|
95
|
-
setTemplates([]);
|
96
97
|
onSearch("");
|
97
98
|
setCategory(newValue);
|
98
|
-
|
99
|
+
setFilteredTemplates(templates.filter(f => f.category === newValue));
|
99
100
|
};
|
100
|
-
const onSelectTemplate = card =>
|
101
|
+
const onSelectTemplate = card => () => {
|
101
102
|
try {
|
102
|
-
|
103
|
-
data
|
104
|
-
} = await services("templateContent", {
|
105
|
-
id: card?.id
|
106
|
-
});
|
107
|
-
const content = data?.content;
|
108
|
-
if (content) {
|
109
|
-
editor.insertNode(JSON.parse(content));
|
110
|
-
} else {
|
111
|
-
console.log("No data found");
|
112
|
-
}
|
103
|
+
editor.insertNode(JSON.parse(card.content));
|
113
104
|
onClose();
|
114
105
|
} catch (err) {
|
115
|
-
console.log(
|
106
|
+
console.log(err);
|
116
107
|
}
|
117
108
|
};
|
118
109
|
const filterByTitle = f => {
|
@@ -182,16 +173,16 @@ const AddTemplates = props => {
|
|
182
173
|
data: categories,
|
183
174
|
handleChange: handleChange
|
184
175
|
})
|
185
|
-
}), /*#__PURE__*/
|
176
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
186
177
|
container: true,
|
187
178
|
spacing: 0,
|
188
179
|
className: `${fullScreen ? "fullscreen" : ""}`,
|
189
180
|
sx: classes.templateCardsWrpr,
|
190
|
-
children:
|
181
|
+
children: [/*#__PURE__*/_jsx(ProgressBar, {
|
191
182
|
loading: loading
|
192
|
-
})
|
193
|
-
|
194
|
-
})
|
183
|
+
}), filteredTemplates.filter(filterByTitle).map(m => {
|
184
|
+
return renderTemplate(m);
|
185
|
+
})]
|
195
186
|
})]
|
196
187
|
});
|
197
188
|
};
|
@@ -51,8 +51,7 @@ const alignmentOptions = [{
|
|
51
51
|
}];
|
52
52
|
function SelectAlignment({
|
53
53
|
editor,
|
54
|
-
classes
|
55
|
-
closeMainPopup
|
54
|
+
classes
|
56
55
|
}) {
|
57
56
|
const selected = useMemo(() => {
|
58
57
|
return alignmentOptions.find(t => isBlockActive(editor, t.value));
|
@@ -60,7 +59,6 @@ function SelectAlignment({
|
|
60
59
|
const onChange = (format, option) => {
|
61
60
|
if (option.type === "block") {
|
62
61
|
toggleBlock(editor, format);
|
63
|
-
closeMainPopup();
|
64
62
|
}
|
65
63
|
};
|
66
64
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
@@ -68,8 +68,7 @@ const listOptions = [{
|
|
68
68
|
}];
|
69
69
|
function SelectList({
|
70
70
|
editor,
|
71
|
-
classes
|
72
|
-
closeMainPopup
|
71
|
+
classes
|
73
72
|
}) {
|
74
73
|
const selectedList = useMemo(() => {
|
75
74
|
return listOptions.find(t => isBlockActive(editor, t.value));
|
@@ -80,7 +79,6 @@ function SelectList({
|
|
80
79
|
} else if (option.type === "accordion") {
|
81
80
|
insertAccordion(editor);
|
82
81
|
}
|
83
|
-
closeMainPopup();
|
84
82
|
};
|
85
83
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
86
84
|
options: listOptions,
|
@@ -125,6 +125,7 @@ function SelectTypography({
|
|
125
125
|
...upData
|
126
126
|
}
|
127
127
|
});
|
128
|
+
closeMainPopup();
|
128
129
|
};
|
129
130
|
const selectedBlock = useMemo(() => {
|
130
131
|
return typographyOptions.find(t => {
|
@@ -166,7 +167,6 @@ function SelectTypography({
|
|
166
167
|
const [sizeInNumber] = size.split("px");
|
167
168
|
updateMarkData(Number(sizeInNumber));
|
168
169
|
}
|
169
|
-
closeMainPopup();
|
170
170
|
};
|
171
171
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
172
172
|
options: typographyOptions,
|
@@ -14,7 +14,6 @@ import MiniColorPicker from "./MiniColorPicker";
|
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
15
15
|
import SelectFontSize from "./SelectFontSize";
|
16
16
|
import InfinityAITool from "./InfinityAITool";
|
17
|
-
import { viewSlateSelection } from "../../../utils/helper";
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
19
|
const DEFAULT_COLOR = {
|
@@ -61,15 +60,13 @@ const MiniTextFormat = props => {
|
|
61
60
|
className: "verticalLine"
|
62
61
|
}), /*#__PURE__*/_jsx(SelectList, {
|
63
62
|
classes: classes,
|
64
|
-
editor: editor
|
65
|
-
closeMainPopup: closeMainPopup
|
63
|
+
editor: editor
|
66
64
|
}), /*#__PURE__*/_jsx("div", {
|
67
65
|
className: "verticalLine mr-1"
|
68
66
|
}), /*#__PURE__*/_jsx(SelectAlignment, {
|
69
67
|
fontAlign: fontAlign,
|
70
68
|
classes: classes,
|
71
|
-
editor: editor
|
72
|
-
closeMainPopup: closeMainPopup
|
69
|
+
editor: editor
|
73
70
|
}), /*#__PURE__*/_jsx("div", {
|
74
71
|
className: "verticalLine mr-1"
|
75
72
|
}), /*#__PURE__*/_jsx(SelectFontSize, {
|
@@ -101,10 +98,7 @@ const MiniTextFormat = props => {
|
|
101
98
|
editor: editor,
|
102
99
|
customProps: customProps
|
103
100
|
}, link.id), /*#__PURE__*/_jsx(IconButton, {
|
104
|
-
onClick: e =>
|
105
|
-
viewSlateSelection();
|
106
|
-
setAnchorEl(document.getElementById("mini-text-editor-wrapper"));
|
107
|
-
},
|
101
|
+
onClick: e => setAnchorEl(document.getElementById("mini-text-editor-wrapper")),
|
108
102
|
className: `textSettingsIcon ${open ? "btnActive" : ""}`,
|
109
103
|
children: /*#__PURE__*/_jsx(TextToolIcon, {})
|
110
104
|
}), /*#__PURE__*/_jsx(Popper, {
|
@@ -416,11 +416,6 @@ const usePopupStyle = theme => ({
|
|
416
416
|
"& .MuiOutlinedInput-notchedOutline": {
|
417
417
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
|
418
418
|
},
|
419
|
-
'& .MuiInputBase-root': {
|
420
|
-
'& input': {
|
421
|
-
border: "none !important"
|
422
|
-
}
|
423
|
-
},
|
424
419
|
"& svg": {
|
425
420
|
width: "20px",
|
426
421
|
height: "24px"
|
@@ -47,7 +47,7 @@ const TemplateCard = props => {
|
|
47
47
|
}), /*#__PURE__*/_jsx(CardMedia, {
|
48
48
|
className: `template-card-media ${fullScreen ? "fullscreen" : ""}`,
|
49
49
|
component: "div",
|
50
|
-
image: m?.
|
50
|
+
image: m?.thumbnail,
|
51
51
|
alt: m?.title,
|
52
52
|
sx: classes.templateCardMedia
|
53
53
|
}), /*#__PURE__*/_jsx(PreviewAndSelect, {
|
@@ -14,8 +14,6 @@ import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
|
|
14
14
|
import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
|
15
15
|
import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
|
16
16
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
17
|
-
import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
|
-
import { getPageSettings } from "../../utils/pageSettings";
|
19
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
20
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
21
19
|
const allTools = toolbarGroups.flat();
|
@@ -33,18 +31,10 @@ const TextFormat = props => {
|
|
33
31
|
const [anchorEl, setAnchorEl] = useState(null);
|
34
32
|
const [type, setType] = useState(null);
|
35
33
|
const open = Boolean(anchorEl);
|
36
|
-
const {
|
37
|
-
element: pageSt
|
38
|
-
} = getPageSettings(editor) || {};
|
39
|
-
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
40
34
|
const {
|
41
35
|
fontFamilies,
|
42
36
|
theme
|
43
37
|
} = useEditorContext();
|
44
|
-
const {
|
45
|
-
activeBreakPoint
|
46
|
-
} = useEditorContext();
|
47
|
-
const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
48
38
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
49
39
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
50
40
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
@@ -61,8 +51,6 @@ const TextFormat = props => {
|
|
61
51
|
color: "",
|
62
52
|
bgColor: ""
|
63
53
|
};
|
64
|
-
let lineSpacingValue = activeMark(editor, 'lineHeight');
|
65
|
-
lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
|
66
54
|
const handleColorPicker = type => e => {
|
67
55
|
setType(type);
|
68
56
|
setAnchorEl(e.currentTarget);
|
@@ -103,13 +91,6 @@ const TextFormat = props => {
|
|
103
91
|
value
|
104
92
|
});
|
105
93
|
};
|
106
|
-
const handleLineSpacing = data => {
|
107
|
-
const [[format, value]] = Object.entries(data);
|
108
|
-
addMarkData(editor, {
|
109
|
-
format,
|
110
|
-
value
|
111
|
-
});
|
112
|
-
};
|
113
94
|
return /*#__PURE__*/_jsxs(Grid, {
|
114
95
|
container: true,
|
115
96
|
sx: classes.textFormatWrapper,
|
@@ -379,32 +360,6 @@ const TextFormat = props => {
|
|
379
360
|
xs: 12,
|
380
361
|
sx: classes.dividerGrid,
|
381
362
|
children: /*#__PURE__*/_jsx(Divider, {})
|
382
|
-
}), /*#__PURE__*/_jsxs(Grid, {
|
383
|
-
item: true,
|
384
|
-
xs: 12,
|
385
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
386
|
-
variant: "body1",
|
387
|
-
color: "primary",
|
388
|
-
sx: classes.typoLabel,
|
389
|
-
children: "Line Spacing"
|
390
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
391
|
-
item: true,
|
392
|
-
xs: 12,
|
393
|
-
className: "typo-icons",
|
394
|
-
sx: classes.evenSpace,
|
395
|
-
children: /*#__PURE__*/_jsx(LineSpacing, {
|
396
|
-
value: lineSpacingValue,
|
397
|
-
onChange: handleLineSpacing,
|
398
|
-
data: {
|
399
|
-
key: 'lineHeight'
|
400
|
-
}
|
401
|
-
})
|
402
|
-
})]
|
403
|
-
}), /*#__PURE__*/_jsx(Grid, {
|
404
|
-
item: true,
|
405
|
-
xs: 12,
|
406
|
-
sx: classes.dividerGrid,
|
407
|
-
children: /*#__PURE__*/_jsx(Divider, {})
|
408
363
|
}), /*#__PURE__*/_jsx(Grid, {
|
409
364
|
item: true,
|
410
365
|
xs: 12,
|