@flozy/editor 5.8.5 → 5.8.7
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 +11 -6
- package/dist/Editor/Editor.css +30 -15
- package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -12
- package/dist/Editor/Elements/Button/EditorButton.js +3 -1
- package/dist/Editor/Elements/DataView/DataView.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +23 -19
- package/dist/Editor/Elements/Form/Form.js +1 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -0
- package/dist/Editor/Elements/Grid/GridItem.js +1 -2
- package/dist/Editor/Elements/Link/Link.js +42 -31
- package/dist/Editor/Elements/List/CheckList.js +2 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
- package/dist/Editor/Elements/Search/SearchList.js +8 -1
- package/dist/Editor/Elements/SimpleText/index.js +8 -1
- package/dist/Editor/Elements/SimpleText/style.js +5 -1
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +14 -9
- package/dist/Editor/Elements/Title/title.js +13 -1
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/MiniEditor.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +37 -28
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +9 -3
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +2 -0
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +37 -11
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
- package/dist/Editor/common/Section/index.js +39 -29
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/commonStyle.js +58 -57
- package/dist/Editor/helper/deserialize/index.js +18 -5
- package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/markdown.js +45 -0
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/plugins/withHTML.js +8 -1
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +41 -4
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/helper.js +60 -19
- package/dist/Editor/utils/pageSettings.js +14 -2
- package/dist/Editor/utils/table.js +21 -0
- package/package.json +3 -2
@@ -3,24 +3,35 @@ import PersonalVideoIcon from "@mui/icons-material/PersonalVideo";
|
|
3
3
|
import PhoneIphoneIcon from "@mui/icons-material/PhoneIphone";
|
4
4
|
import useSwitchViewport from "./styles";
|
5
5
|
import { useEffect } from "react";
|
6
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
9
|
const SwitchViewport = props => {
|
9
10
|
const {
|
10
11
|
breakpoint,
|
11
|
-
onChange
|
12
|
+
onChange,
|
13
|
+
show
|
12
14
|
} = props;
|
13
15
|
const classes = useSwitchViewport();
|
16
|
+
const {
|
17
|
+
setSelectedElement,
|
18
|
+
setActiveBreakPoint
|
19
|
+
} = useEditorContext();
|
14
20
|
useEffect(() => {
|
15
|
-
|
21
|
+
// to reset selection on viewport changes - FS-6589
|
22
|
+
setSelectedElement({});
|
16
23
|
}, [breakpoint]);
|
17
24
|
return /*#__PURE__*/_jsxs(Box, {
|
18
25
|
sx: classes.root,
|
26
|
+
style: {
|
27
|
+
display: show ? "block" : "none"
|
28
|
+
},
|
19
29
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
20
30
|
title: "Desktop View",
|
21
31
|
children: /*#__PURE__*/_jsx(IconButton, {
|
22
32
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
23
33
|
onClick: () => {
|
34
|
+
setActiveBreakPoint("");
|
24
35
|
onChange("");
|
25
36
|
},
|
26
37
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
@@ -30,6 +41,7 @@ const SwitchViewport = props => {
|
|
30
41
|
children: /*#__PURE__*/_jsx(IconButton, {
|
31
42
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
32
43
|
onClick: () => {
|
44
|
+
setActiveBreakPoint("xs");
|
33
45
|
onChange("xs");
|
34
46
|
},
|
35
47
|
children: /*#__PURE__*/_jsx(PhoneIphoneIcon, {})
|
@@ -13,6 +13,35 @@ import { SectionSettingIcon } from "../iconListV2";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
+
const Toolbar = ({
|
17
|
+
fromPopper,
|
18
|
+
readOnly,
|
19
|
+
showTool,
|
20
|
+
onSettings
|
21
|
+
}) => {
|
22
|
+
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
23
|
+
component: "div",
|
24
|
+
className: `element-toolbar no-border-button hr section-tw sectionIcon`,
|
25
|
+
contentEditable: false,
|
26
|
+
style: fromPopper ? {
|
27
|
+
position: "unset",
|
28
|
+
marginLeft: "28px",
|
29
|
+
paddingTop: "4px",
|
30
|
+
marginRight: "10px",
|
31
|
+
height: "100%"
|
32
|
+
} : {
|
33
|
+
left: "-28px",
|
34
|
+
top: "1px"
|
35
|
+
},
|
36
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
37
|
+
title: "Section Settings",
|
38
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
39
|
+
onClick: onSettings,
|
40
|
+
children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
|
41
|
+
})
|
42
|
+
})
|
43
|
+
}) : null;
|
44
|
+
};
|
16
45
|
const list_types = ["orderedList", "unorderedList"];
|
17
46
|
const Section = props => {
|
18
47
|
const themeReact = useTheme();
|
@@ -57,32 +86,6 @@ const Section = props => {
|
|
57
86
|
const onSettings = () => {
|
58
87
|
setOpenSettings(true);
|
59
88
|
};
|
60
|
-
const Toolbar = ({
|
61
|
-
fromPopper
|
62
|
-
}) => {
|
63
|
-
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
64
|
-
component: "div",
|
65
|
-
className: `element-toolbar no-border-button hr section-tw sectionIcon`,
|
66
|
-
contentEditable: false,
|
67
|
-
style: fromPopper ? {
|
68
|
-
position: "unset",
|
69
|
-
marginLeft: "28px",
|
70
|
-
paddingTop: "4px",
|
71
|
-
marginRight: "10px",
|
72
|
-
height: "100%"
|
73
|
-
} : {
|
74
|
-
left: "-28px",
|
75
|
-
top: "1px"
|
76
|
-
},
|
77
|
-
children: /*#__PURE__*/_jsx(Tooltip, {
|
78
|
-
title: "Section Settings",
|
79
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
80
|
-
onClick: onSettings,
|
81
|
-
children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
|
82
|
-
})
|
83
|
-
})
|
84
|
-
}) : null;
|
85
|
-
};
|
86
89
|
const onSave = data => {
|
87
90
|
const updateData = {
|
88
91
|
...data
|
@@ -167,19 +170,26 @@ const Section = props => {
|
|
167
170
|
bgcolor: "background.paper",
|
168
171
|
height: "30px",
|
169
172
|
position: "relative",
|
170
|
-
background: theme?.palette?.type ===
|
173
|
+
background: theme?.palette?.type === "dark" ? theme?.palette?.editor?.miniToolBarBackground : "#F6F6F6"
|
171
174
|
},
|
172
175
|
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
173
176
|
...props,
|
174
177
|
fromPopper: true
|
175
178
|
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
176
|
-
fromPopper: true
|
179
|
+
fromPopper: true,
|
180
|
+
readOnly: readOnly,
|
181
|
+
showTool: showTool,
|
182
|
+
onSettings: onSettings
|
177
183
|
})]
|
178
184
|
})
|
179
185
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
180
186
|
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
181
187
|
...props
|
182
|
-
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
188
|
+
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
189
|
+
readOnly: readOnly,
|
190
|
+
showTool: showTool,
|
191
|
+
onSettings: onSettings
|
192
|
+
})]
|
183
193
|
}), children]
|
184
194
|
}), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
|
185
195
|
element: {
|
@@ -73,6 +73,11 @@ const BackgroundImage = props => {
|
|
73
73
|
children: "REMOVE"
|
74
74
|
}) : /*#__PURE__*/_jsx(Grid, {
|
75
75
|
className: "uploadImageText",
|
76
|
+
sx: {
|
77
|
+
padding: 0,
|
78
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
79
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
80
|
+
},
|
76
81
|
children: /*#__PURE__*/_jsxs(Button, {
|
77
82
|
component: "label",
|
78
83
|
variant: "text",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Box, Card, Checkbox, FormControlLabel, Grid, Tooltip, Typography } from "@mui/material";
|
2
2
|
import React from "react";
|
3
3
|
import Icon from "../../Icon";
|
4
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
6
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -15,7 +16,10 @@ const RenderCard = ({
|
|
15
16
|
return /*#__PURE__*/_jsx(Card, {
|
16
17
|
sx: {
|
17
18
|
position: 'relative',
|
18
|
-
padding: "10px"
|
19
|
+
padding: "10px",
|
20
|
+
'& .MuiCheckbox-root svg': {
|
21
|
+
fill: 'unset !important'
|
22
|
+
}
|
19
23
|
},
|
20
24
|
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
21
25
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
@@ -81,6 +85,9 @@ const CardsMapping = props => {
|
|
81
85
|
selectedCard,
|
82
86
|
infoIcon
|
83
87
|
} = data;
|
88
|
+
const {
|
89
|
+
theme
|
90
|
+
} = useEditorContext();
|
84
91
|
const activeCard = value === selectedCard;
|
85
92
|
const handleChange = e => {
|
86
93
|
if (selectedCard === data?.value) {
|
@@ -99,7 +106,8 @@ const CardsMapping = props => {
|
|
99
106
|
sx: {
|
100
107
|
marginBottom: "12px",
|
101
108
|
"& .MuiPaper-root": {
|
102
|
-
|
109
|
+
background: theme?.palette?.editor?.miniToolBarBackground,
|
110
|
+
border: activeCard ? "1px solid #2563EB" : `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
103
111
|
borderRadius: "8px",
|
104
112
|
boxShadow: activeCard ? "0px 4px 16px 0px #2563EB40" : "unset"
|
105
113
|
}
|
@@ -18,6 +18,7 @@ import FontSize from "./fontSize";
|
|
18
18
|
import SelectSwitch from "./selectSwitch";
|
19
19
|
import CardsMapping from "./card";
|
20
20
|
import MetaDataMapping from "./metaDataMapping";
|
21
|
+
import LineSpacing from "./lineSpacing";
|
21
22
|
const FieldMap = {
|
22
23
|
text: Text,
|
23
24
|
bannerSpacing: BannerSpacing,
|
@@ -38,6 +39,7 @@ const FieldMap = {
|
|
38
39
|
fontSize: FontSize,
|
39
40
|
selectSwitch: SelectSwitch,
|
40
41
|
card: CardsMapping,
|
41
|
-
metadatamapping: MetaDataMapping
|
42
|
+
metadatamapping: MetaDataMapping,
|
43
|
+
lineSpacing: LineSpacing
|
42
44
|
};
|
43
45
|
export default FieldMap;
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Grid, Slider, Typography, Box } from "@mui/material";
|
3
|
+
import { getBreakPointsValue } from "../../../helper/theme";
|
4
|
+
import useWindowResize from "../../../hooks/useWindowResize";
|
5
|
+
import { useEditorContext } from "../../../hooks/useMouseMove";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
const LineSpacing = props => {
|
9
|
+
const {
|
10
|
+
value: val,
|
11
|
+
data,
|
12
|
+
onChange
|
13
|
+
} = props;
|
14
|
+
const {
|
15
|
+
theme
|
16
|
+
} = useEditorContext();
|
17
|
+
const {
|
18
|
+
key
|
19
|
+
} = data;
|
20
|
+
const [size] = useWindowResize();
|
21
|
+
const pro_value = getBreakPointsValue(val, size?.device);
|
22
|
+
const [value, setValue] = useState(pro_value);
|
23
|
+
let breakpointValue = getBreakPointsValue(val, null);
|
24
|
+
breakpointValue = typeof breakpointValue['lg'] === 'object' ? breakpointValue['lg'] : breakpointValue;
|
25
|
+
useState(() => {
|
26
|
+
setValue(pro_value);
|
27
|
+
}, [pro_value]);
|
28
|
+
const handleChange = e => {
|
29
|
+
onChange({
|
30
|
+
[key]: {
|
31
|
+
...breakpointValue,
|
32
|
+
[size?.device]: e.target.value
|
33
|
+
}
|
34
|
+
});
|
35
|
+
};
|
36
|
+
return /*#__PURE__*/_jsxs(Grid, {
|
37
|
+
item: true,
|
38
|
+
xs: 12,
|
39
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
40
|
+
variant: "body1",
|
41
|
+
color: "primary",
|
42
|
+
style: {
|
43
|
+
fontSize: "14px",
|
44
|
+
fontWeight: 500
|
45
|
+
},
|
46
|
+
children: data?.label
|
47
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
48
|
+
container: true,
|
49
|
+
wrap: "nowrap",
|
50
|
+
className: "sld-wrpr",
|
51
|
+
children: [/*#__PURE__*/_jsx(Slider, {
|
52
|
+
className: "spacingSlider",
|
53
|
+
defaultValue: value || 1.43,
|
54
|
+
"aria-label": "Default",
|
55
|
+
valueLabelDisplay: "auto",
|
56
|
+
min: 0.5,
|
57
|
+
max: 3.0,
|
58
|
+
step: 0.1,
|
59
|
+
name: "lineHeight",
|
60
|
+
onChange: handleChange
|
61
|
+
}), /*#__PURE__*/_jsx(Box, {
|
62
|
+
component: "input",
|
63
|
+
sx: {
|
64
|
+
background: theme?.palette?.editor?.background,
|
65
|
+
color: theme?.palette?.editor?.textColor
|
66
|
+
},
|
67
|
+
name: "lineHeight",
|
68
|
+
value: pro_value,
|
69
|
+
className: "sliderInput",
|
70
|
+
onChange: handleChange,
|
71
|
+
type: "number",
|
72
|
+
placeholder: "0",
|
73
|
+
disabled: true,
|
74
|
+
defaultValue: pro_value || 1.43
|
75
|
+
})]
|
76
|
+
})]
|
77
|
+
});
|
78
|
+
};
|
79
|
+
export default LineSpacing;
|
@@ -4,6 +4,7 @@ import { convertBase64 } from "../utils/helper";
|
|
4
4
|
import { uploadFile } from "../service/fileupload";
|
5
5
|
import Icon from "./Icon";
|
6
6
|
import UploadStyles from "../common/ImageSelector/UploadStyles";
|
7
|
+
import { useEditorContext } from "../hooks/useMouseMove";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -18,6 +19,9 @@ const Uploader = props => {
|
|
18
19
|
const [base64, setBase64] = useState(value?.url);
|
19
20
|
const [fileName, setFileName] = useState("");
|
20
21
|
const [uploading, setUploading] = useState(false);
|
22
|
+
const {
|
23
|
+
theme
|
24
|
+
} = useEditorContext();
|
21
25
|
const handleChange = async e => {
|
22
26
|
const uFile = e.target.files[0];
|
23
27
|
const strImage = await convertBase64(uFile);
|
@@ -99,6 +103,10 @@ const Uploader = props => {
|
|
99
103
|
className: "uploadImageSection",
|
100
104
|
children: base64 ? renderThumb() : /*#__PURE__*/_jsx(Grid, {
|
101
105
|
className: "uploadImageText",
|
106
|
+
sx: {
|
107
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
108
|
+
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
109
|
+
},
|
102
110
|
children: /*#__PURE__*/_jsxs(Button, {
|
103
111
|
component: "label",
|
104
112
|
variant: "text",
|
@@ -49,15 +49,19 @@ const useCommonStyle = theme => ({
|
|
49
49
|
fontWeight: "500",
|
50
50
|
fontFamily: "Inter, sans-serif"
|
51
51
|
},
|
52
|
+
"& .MuiPaper-root": {
|
53
|
+
border: `unset !important`,
|
54
|
+
borderRadius: "0px",
|
55
|
+
height: "fit-content",
|
56
|
+
padding: "2px"
|
57
|
+
},
|
52
58
|
"& p": {
|
53
59
|
marginBottom: "7px",
|
54
60
|
marginTop: "4px"
|
55
61
|
},
|
56
|
-
"&
|
57
|
-
|
58
|
-
|
59
|
-
height: 'fit-content',
|
60
|
-
padding: '2px'
|
62
|
+
"& p": {
|
63
|
+
marginBottom: "7px",
|
64
|
+
marginTop: "4px"
|
61
65
|
},
|
62
66
|
"& .muiIconsListParent": {
|
63
67
|
"& svg": {
|
@@ -71,15 +75,12 @@ const useCommonStyle = theme => ({
|
|
71
75
|
},
|
72
76
|
"&::-webkit-scrollbar-thumb": {
|
73
77
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
74
|
-
},
|
75
|
-
"&::-webkit-scrollbar-track": {
|
76
|
-
visibility: "hidden"
|
77
78
|
}
|
78
79
|
},
|
79
80
|
"& .MuiGrid-root>.MuiGrid-item": {
|
80
81
|
paddingRight: "0px !important",
|
81
82
|
fontFamily: "Inter, sans-serif",
|
82
|
-
height:
|
83
|
+
height: "fit-content"
|
83
84
|
},
|
84
85
|
"& .MuiInputBase-root": {
|
85
86
|
borderRadius: "10px",
|
@@ -140,11 +141,11 @@ const useCommonStyle = theme => ({
|
|
140
141
|
borderRadius: "10px",
|
141
142
|
width: "46px !important",
|
142
143
|
marginLeft: "10px",
|
143
|
-
height:
|
144
|
+
height: "36px !important"
|
144
145
|
}
|
145
146
|
},
|
146
|
-
|
147
|
-
margin:
|
147
|
+
"& .MuiFormHelperText-root": {
|
148
|
+
margin: "4px 0px 0px 0px",
|
148
149
|
color: theme?.palette?.editor?.closeButtonSvgStroke,
|
149
150
|
fontFamily: "Inter, sans-serif"
|
150
151
|
}
|
@@ -400,14 +401,14 @@ const useCommonStyle = theme => ({
|
|
400
401
|
padding: "8px 12px",
|
401
402
|
fontSize: "12px",
|
402
403
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
403
|
-
fontWeight:
|
404
|
+
fontWeight: "500",
|
404
405
|
fontFamily: "Inter, sans-serif",
|
405
|
-
minHeight:
|
406
|
+
minHeight: "36px",
|
406
407
|
"&:hover": {
|
407
408
|
backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
|
408
409
|
}
|
409
410
|
},
|
410
|
-
|
411
|
+
"& .Mui-selected": {
|
411
412
|
background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
412
413
|
},
|
413
414
|
"& .MuiListSubheader-root": {
|
@@ -416,16 +417,16 @@ const useCommonStyle = theme => ({
|
|
416
417
|
fontSize: "12px"
|
417
418
|
},
|
418
419
|
"& .MuiPaper-root": {
|
419
|
-
borderRadius:
|
420
|
-
padding:
|
420
|
+
borderRadius: "8px",
|
421
|
+
padding: "0px",
|
421
422
|
background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
|
422
423
|
},
|
423
|
-
|
424
|
-
margin:
|
425
|
-
borderRadius:
|
424
|
+
"& .MuiButtonBase-root": {
|
425
|
+
margin: "4px",
|
426
|
+
borderRadius: "6px"
|
426
427
|
},
|
427
|
-
|
428
|
-
padding:
|
428
|
+
"& .MuiList-root": {
|
429
|
+
padding: "0px"
|
429
430
|
}
|
430
431
|
},
|
431
432
|
datePicker: {
|
@@ -470,27 +471,27 @@ const useCommonStyle = theme => ({
|
|
470
471
|
}
|
471
472
|
}
|
472
473
|
},
|
473
|
-
pageSettingPopUpRoot: {
|
474
|
-
padding: "16px 8px 16px 10px!important",
|
475
|
-
height: "100%"
|
476
|
-
},
|
477
474
|
buttonMoreOption: {
|
478
475
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
479
476
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
480
|
-
padding:
|
481
|
-
|
482
|
-
width:
|
483
|
-
height:
|
484
|
-
|
477
|
+
padding: "4px !important",
|
478
|
+
"& svg": {
|
479
|
+
width: "18px !important",
|
480
|
+
height: "18px !important",
|
481
|
+
"& path": {
|
485
482
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
486
483
|
}
|
487
484
|
}
|
488
485
|
},
|
486
|
+
pageSettingPopUpRoot: {
|
487
|
+
padding: "16px 8px 16px 10px!important",
|
488
|
+
height: "100%"
|
489
|
+
},
|
489
490
|
buttonMoreOption2: {
|
490
491
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
491
492
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
492
|
-
|
493
|
-
|
493
|
+
"& svg": {
|
494
|
+
"& path": {
|
494
495
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
495
496
|
}
|
496
497
|
}
|
@@ -498,11 +499,11 @@ const useCommonStyle = theme => ({
|
|
498
499
|
buttonMoreOption3: {
|
499
500
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
500
501
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
501
|
-
padding:
|
502
|
-
|
503
|
-
width:
|
504
|
-
height:
|
505
|
-
|
502
|
+
padding: "5px !important",
|
503
|
+
"& svg": {
|
504
|
+
width: "16px !important",
|
505
|
+
height: "16px !important",
|
506
|
+
"& path": {
|
506
507
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
507
508
|
}
|
508
509
|
}
|
@@ -510,37 +511,37 @@ const useCommonStyle = theme => ({
|
|
510
511
|
resizeButton: {
|
511
512
|
background: theme?.palette?.editor?.aiInputBackground,
|
512
513
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
|
513
|
-
padding:
|
514
|
-
borderRadius:
|
515
|
-
|
516
|
-
width:
|
517
|
-
height:
|
518
|
-
|
514
|
+
padding: "5px !important",
|
515
|
+
borderRadius: "50% !important",
|
516
|
+
"& svg": {
|
517
|
+
width: "18px",
|
518
|
+
height: "18px",
|
519
|
+
"& path": {
|
519
520
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
|
520
521
|
}
|
521
522
|
},
|
522
|
-
|
523
|
+
"&:hover": {
|
523
524
|
background: theme?.palette?.editor?.aiInputBackground
|
524
525
|
}
|
525
526
|
},
|
526
527
|
gradientFillBtn: {
|
527
528
|
background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
|
528
|
-
textTransform:
|
529
|
-
color:
|
530
|
-
padding:
|
531
|
-
height:
|
532
|
-
borderRadius:
|
533
|
-
fontWeight:
|
534
|
-
fontSize:
|
529
|
+
textTransform: "math-auto !important",
|
530
|
+
color: "#FFFFFF !important",
|
531
|
+
padding: "0px 12px !important",
|
532
|
+
height: "32px",
|
533
|
+
borderRadius: "8px",
|
534
|
+
fontWeight: "500",
|
535
|
+
fontSize: "14px"
|
535
536
|
},
|
536
537
|
emptyThumbBtn: {
|
537
538
|
background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
|
538
539
|
color: `${theme?.palette?.editor?.textColor} !important`,
|
539
|
-
fontSize:
|
540
|
-
|
541
|
-
width:
|
542
|
-
height:
|
543
|
-
|
540
|
+
fontSize: "14px !important",
|
541
|
+
"& svg": {
|
542
|
+
width: "20px !important",
|
543
|
+
height: "20px !important",
|
544
|
+
"& path": {
|
544
545
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
545
546
|
}
|
546
547
|
}
|
@@ -90,9 +90,18 @@ const ELEMENT_TAGS = {
|
|
90
90
|
type: "image",
|
91
91
|
url: el.getAttribute("src")
|
92
92
|
}),
|
93
|
-
LI:
|
94
|
-
|
95
|
-
|
93
|
+
LI: el => {
|
94
|
+
const checkListItem = el.querySelector(".check-list-item");
|
95
|
+
if (checkListItem) {
|
96
|
+
return {
|
97
|
+
type: "check-list-item",
|
98
|
+
checked: checkListItem?.dataset?.checked === "true"
|
99
|
+
};
|
100
|
+
}
|
101
|
+
return {
|
102
|
+
type: "list-item"
|
103
|
+
};
|
104
|
+
},
|
96
105
|
UL: () => ({
|
97
106
|
type: "unorderedList"
|
98
107
|
}),
|
@@ -109,7 +118,7 @@ const ELEMENT_TAGS = {
|
|
109
118
|
"GOOGLE-SHEETS-HTML-ORIGIN": paragraphType,
|
110
119
|
TABLE: (el, children = []) => {
|
111
120
|
try {
|
112
|
-
const bodyChild = children || [];
|
121
|
+
const bodyChild = (children || [])?.filter(f => f !== null);
|
113
122
|
const firstRowChildren = bodyChild[0]?.children || [];
|
114
123
|
return {
|
115
124
|
type: "table",
|
@@ -129,7 +138,11 @@ const ELEMENT_TAGS = {
|
|
129
138
|
}),
|
130
139
|
TD: handleTableCell,
|
131
140
|
COLGROUP: paragraphType,
|
132
|
-
COL: paragraphType
|
141
|
+
COL: paragraphType,
|
142
|
+
HR: () => ({
|
143
|
+
type: "divider",
|
144
|
+
borderColor: "#CCC"
|
145
|
+
})
|
133
146
|
};
|
134
147
|
|
135
148
|
// COMPAT: `B` is omitted here because Google Docs uses `<b>` in weird ways.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export const ensureWrappedVariables = content => {
|
2
|
+
return content.map(node => {
|
3
|
+
if (node.children) {
|
4
|
+
return {
|
5
|
+
...node,
|
6
|
+
children: node.children.reduce((result, child, index, arr) => {
|
7
|
+
if (child.type === "variables") {
|
8
|
+
if (index === 0 || !arr[index - 1].text || arr[index - 1].text.trim() === "") {
|
9
|
+
result.push({
|
10
|
+
text: ""
|
11
|
+
});
|
12
|
+
}
|
13
|
+
result.push(child);
|
14
|
+
if (index === arr.length - 1 || !arr[index + 1]?.text || arr[index + 1]?.text.trim() === "") {
|
15
|
+
result.push({
|
16
|
+
text: ""
|
17
|
+
});
|
18
|
+
}
|
19
|
+
} else {
|
20
|
+
result.push(child);
|
21
|
+
}
|
22
|
+
return result;
|
23
|
+
}, [])
|
24
|
+
};
|
25
|
+
}
|
26
|
+
return node;
|
27
|
+
});
|
28
|
+
};
|
@@ -337,14 +337,14 @@ export const isCarouselSelected = editor => {
|
|
337
337
|
return false;
|
338
338
|
}
|
339
339
|
const [nodeEntry] = Editor.nodes(editor, {
|
340
|
-
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type ===
|
340
|
+
match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "carousel"
|
341
341
|
});
|
342
342
|
if (!nodeEntry) {
|
343
343
|
return false;
|
344
344
|
}
|
345
345
|
const [node] = nodeEntry;
|
346
346
|
const carouselDom = ReactEditor.toDOMNode(editor, node);
|
347
|
-
const isEdit = carouselDom.classList.contains(
|
347
|
+
const isEdit = carouselDom.classList.contains("carousel_slider_edit");
|
348
348
|
return !isEdit;
|
349
349
|
} catch (err) {
|
350
350
|
console.log(err);
|