@flozy/editor 5.8.8 → 5.8.9

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.
Files changed (34) hide show
  1. package/dist/Editor/CommonEditor.js +17 -13
  2. package/dist/Editor/Editor.css +29 -14
  3. package/dist/Editor/Elements/Button/EditorButton.js +2 -1
  4. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +8 -12
  5. package/dist/Editor/Elements/Grid/GridItem.js +1 -2
  6. package/dist/Editor/Elements/Link/Link.js +42 -31
  7. package/dist/Editor/Elements/SimpleText/index.js +7 -12
  8. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  9. package/dist/Editor/Elements/Title/title.js +13 -1
  10. package/dist/Editor/Elements/Variables/Style.js +28 -2
  11. package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
  12. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
  13. package/dist/Editor/Toolbar/PopupTool/index.js +28 -31
  14. package/dist/Editor/common/FontLoader/FontList.js +3 -11
  15. package/dist/Editor/common/FontLoader/FontLoader.js +24 -7
  16. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
  17. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
  18. package/dist/Editor/common/Section/index.js +60 -89
  19. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  20. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  21. package/dist/Editor/common/Uploader.js +8 -0
  22. package/dist/Editor/common/iconslist.js +1 -2
  23. package/dist/Editor/commonStyle.js +55 -59
  24. package/dist/Editor/helper/deserialize/index.js +18 -5
  25. package/dist/Editor/helper/index.js +2 -2
  26. package/dist/Editor/helper/markdown.js +45 -0
  27. package/dist/Editor/hooks/useEditorScroll.js +1 -1
  28. package/dist/Editor/plugins/withHTML.js +8 -1
  29. package/dist/Editor/plugins/withLayout.js +1 -1
  30. package/dist/Editor/utils/SlateUtilityFunctions.js +36 -0
  31. package/dist/Editor/utils/button.js +4 -4
  32. package/dist/Editor/utils/draftToSlate.js +3 -2
  33. package/dist/Editor/utils/helper.js +20 -20
  34. package/package.json +3 -2
@@ -1,7 +1,9 @@
1
- import { useEffect } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  import WebFont from "webfontloader";
3
+ import { Backdrop, CircularProgress } from "@mui/material";
3
4
  import { useEditorContext } from "../../hooks/useMouseMove";
4
- import { defaultFonts, googleFontList, otherFonts } from "./FontList";
5
+ import { googleFontList } from "./FontList";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
5
7
  const FontLoader = props => {
6
8
  const {
7
9
  otherProps,
@@ -10,14 +12,20 @@ const FontLoader = props => {
10
12
  const {
11
13
  setFontFamilies
12
14
  } = useEditorContext();
15
+ const [loader, setLoader] = useState(true);
13
16
  const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
14
17
  let currentIndex = 0;
15
18
  let retryCount = 0;
19
+ let hideLoaderOn = 30;
16
20
  function loadNextBatch() {
17
21
  if (currentIndex >= families?.length) {
18
22
  // console.log("All fonts have been loaded");
23
+ setLoader(false);
19
24
  return;
20
25
  }
26
+ if (currentIndex >= hideLoaderOn) {
27
+ setLoader(false);
28
+ }
21
29
  const batch = families?.slice(currentIndex, currentIndex + batchSize);
22
30
  const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
23
31
  WebFont.load({
@@ -54,21 +62,21 @@ const FontLoader = props => {
54
62
  loadNextBatch();
55
63
  };
56
64
  useEffect(() => {
57
- let families = [...otherFonts, ...defaultFonts];
65
+ let families = [...googleFontList];
58
66
  if (!readOnly) {
59
67
  otherProps?.services("listGoogleFont", []).then(data => {
60
- families = [...families, ...(data?.data || [])];
61
- const filteredfamilies = families?.filter(font => !font?.includes("Material"));
68
+ families = [...(data?.data || [])];
62
69
  setFontFamilies({
63
70
  id: 1,
64
71
  format: "fontFamily",
65
72
  type: "fontfamilydropdown",
66
- options: filteredfamilies || []
73
+ options: families || []
67
74
  });
68
75
  loadFontsInBatches(families);
69
76
  }).catch(err => {
70
77
  // console.log(err);
71
78
  });
79
+ // setLoading(true);
72
80
  } else {
73
81
  function correctFontArray(fontString) {
74
82
  let fontsArray = fontString.split(",");
@@ -93,6 +101,15 @@ const FontLoader = props => {
93
101
  loadFontsInBatches(families);
94
102
  }
95
103
  }, []);
96
- return null;
104
+ return /*#__PURE__*/_jsx(Backdrop, {
105
+ open: loader,
106
+ sx: {
107
+ color: "#fff",
108
+ zIndex: theme => theme.zIndex.drawer + 1 // Ensure it's above other UI elements
109
+ },
110
+ children: /*#__PURE__*/_jsx(CircularProgress, {
111
+ color: "inherit"
112
+ })
113
+ });
97
114
  };
98
115
  export default FontLoader;
@@ -62,6 +62,7 @@ const FormSettings = props => {
62
62
  MuiAccordion: {
63
63
  styleOverrides: {
64
64
  root: {
65
+ background: theme?.palette?.editor?.miniToolBarBackground,
65
66
  "& .MuiAccordionSummary-root": {
66
67
  flexDirection: "row-reverse",
67
68
  "& .MuiSvgIcon-root": {
@@ -9,17 +9,23 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  const SwitchViewport = props => {
10
10
  const {
11
11
  breakpoint,
12
- onChange
12
+ onChange,
13
+ show
13
14
  } = props;
14
15
  const classes = useSwitchViewport();
15
16
  const {
17
+ setSelectedElement,
16
18
  setActiveBreakPoint
17
19
  } = useEditorContext();
18
20
  useEffect(() => {
19
- console.log(breakpoint);
21
+ // to reset selection on viewport changes - FS-6589
22
+ setSelectedElement({});
20
23
  }, [breakpoint]);
21
24
  return /*#__PURE__*/_jsxs(Box, {
22
25
  sx: classes.root,
26
+ style: {
27
+ display: show ? "block" : "none"
28
+ },
23
29
  children: [/*#__PURE__*/_jsx(Tooltip, {
24
30
  title: "Desktop View",
25
31
  children: /*#__PURE__*/_jsx(IconButton, {
@@ -2,36 +2,34 @@ import React, { useRef, useState } from "react";
2
2
  import { useTheme } from "@mui/material";
3
3
  import { Transforms } from "slate";
4
4
  import { ReactEditor, useSlateStatic } from "slate-react";
5
- import { Box, IconButton, Popper, Tooltip } from "@mui/material";
5
+ import { Box, IconButton, Tooltip } from "@mui/material";
6
6
  import SectionPopup from "../../Elements/Grid/SectionPopup";
7
7
  import { getBreakPointsValue, getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
8
- import DragHandle from "../DnD/DragHandleButton";
9
- import { useEditorSelection } from "../../hooks/useMouseMove";
8
+ // import DragHandle from "../DnD/DragHandleButton";
9
+ // import { useEditorSelection } from "../../hooks/useMouseMove";
10
10
  import SectionStyle from "./styles";
11
11
  import useWindowResize from "../../hooks/useWindowResize";
12
12
  import { SectionSettingIcon } from "../iconListV2";
13
+
14
+ // const list_types = ["orderedList", "unorderedList"];
13
15
  import { jsx as _jsx } from "react/jsx-runtime";
14
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
- import { Fragment as _Fragment } from "react/jsx-runtime";
16
17
  const Toolbar = ({
17
- fromPopper,
18
18
  readOnly,
19
19
  showTool,
20
- onSettings
20
+ onSettings,
21
+ isSectionFullWidth
21
22
  }) => {
22
23
  return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
23
24
  component: "div",
24
25
  className: `element-toolbar no-border-button hr section-tw sectionIcon`,
25
26
  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"
27
+ sx: {
28
+ left: isSectionFullWidth ? "0px" : "-28px",
29
+ top: isSectionFullWidth ? "-28px" : "1px",
30
+ "&:hover": {
31
+ backgroundColor: "rgba(0,0,0,0.5)"
32
+ }
35
33
  },
36
34
  children: /*#__PURE__*/_jsx(Tooltip, {
37
35
  title: "Section Settings",
@@ -42,7 +40,6 @@ const Toolbar = ({
42
40
  })
43
41
  }) : null;
44
42
  };
45
- const list_types = ["orderedList", "unorderedList"];
46
43
  const Section = props => {
47
44
  const themeReact = useTheme();
48
45
  const theme = props?.theme;
@@ -56,7 +53,8 @@ const Section = props => {
56
53
  readOnly
57
54
  } = customProps;
58
55
  const editor = useSlateStatic();
59
- const [showTool] = useEditorSelection(editor);
56
+ // const [isHovering, setIsHovering] = useState(false);
57
+ const [size] = useWindowResize();
60
58
  const [openSetttings, setOpenSettings] = useState(false);
61
59
  const {
62
60
  sectionBgColor,
@@ -73,41 +71,11 @@ const Section = props => {
73
71
  } = sectionAlignment || {};
74
72
  const path = ReactEditor.findPath(editor, element);
75
73
  const anchorEl = useRef(null);
76
- const popperEl = useRef(null);
77
- const [size] = useWindowResize();
74
+ // const popperEl = useRef(null);
75
+ // const [showTool] = useEditorSelection(editor);
78
76
  const isSectionFullWidth = sectionGridSize && sectionGridSize[size?.device] >= 12;
79
- const [isHovering, setIsHovering] = useState(false);
80
- const onMouseEnter = () => {
81
- setIsHovering(true);
82
- };
83
- const onMouseLeave = () => {
84
- setIsHovering(false);
85
- };
86
- const onSettings = () => {
87
- setOpenSettings(true);
88
- };
89
- const onSave = data => {
90
- const updateData = {
91
- ...data
92
- };
93
- delete updateData.children;
94
- Transforms.setNodes(editor, {
95
- ...updateData
96
- }, {
97
- at: path
98
- });
99
- onClose();
100
- };
101
- const onClose = () => {
102
- setOpenSettings(false);
103
- };
104
- const onDelete = () => {
105
- Transforms.removeNodes(editor, {
106
- at: path
107
- });
108
- };
109
- const isFreeGrid = element?.children?.find(f => f.type === "freegrid");
110
- const needHover = element?.children?.find(f => f.type === "grid" && !list_types.includes(element.type)) ? "" : "";
77
+ const isFreeGrid = element?.children[0]?.type === "freegrid";
78
+ const needHover = false;
111
79
  let tempProps = {};
112
80
  if (element?.type === "temp") {
113
81
  tempProps = {
@@ -131,6 +99,38 @@ const Section = props => {
131
99
  ...getBreakPointsValue(sectionGridSize || 8, null, "overrideGridSize", true)
132
100
  }
133
101
  }, themeReact);
102
+
103
+ // const onMouseEnter = () => {
104
+ // setIsHovering(true);
105
+ // };
106
+
107
+ // const onMouseLeave = () => {
108
+ // setIsHovering(false);
109
+ // };
110
+
111
+ const onSettings = () => {
112
+ setOpenSettings(true);
113
+ };
114
+ const onSave = data => {
115
+ const updateData = {
116
+ ...data
117
+ };
118
+ delete updateData.children;
119
+ Transforms.setNodes(editor, {
120
+ ...updateData
121
+ }, {
122
+ at: path
123
+ });
124
+ onClose();
125
+ };
126
+ const onClose = () => {
127
+ setOpenSettings(false);
128
+ };
129
+ const onDelete = () => {
130
+ Transforms.removeNodes(editor, {
131
+ at: path
132
+ });
133
+ };
134
134
  return path.length === 1 && !isFreeGrid ? /*#__PURE__*/_jsxs(Box, {
135
135
  component: "div",
136
136
  className: `ed-section-wrapper ${readOnly ? "" : "hselect"} ${needHover} is-${element?.type}`,
@@ -145,9 +145,10 @@ const Section = props => {
145
145
  flexDirection: flexDirection || "column",
146
146
  alignItems: horizantal,
147
147
  justifyContent: vertical
148
- },
149
- onMouseEnter: onMouseEnter,
150
- onMouseLeave: onMouseLeave,
148
+ }
149
+ // onMouseEnter={onMouseEnter}
150
+ // onMouseLeave={onMouseLeave}
151
+ ,
151
152
  children: [/*#__PURE__*/_jsxs(Box, {
152
153
  className: "ed-section-inner",
153
154
  sx: {
@@ -155,41 +156,11 @@ const Section = props => {
155
156
  ...edInnerSp
156
157
  },
157
158
  ref: anchorEl,
158
- children: [isHovering && isSectionFullWidth ? /*#__PURE__*/_jsx(Popper, {
159
- open: isHovering && isSectionFullWidth,
160
- anchorEl: anchorEl?.current,
161
- placement: "top-start",
162
- sx: {
163
- zIndex: 9999
164
- },
165
- disablePortal: true,
166
- ref: popperEl,
167
- className: "sectionPopper",
168
- children: /*#__PURE__*/_jsxs(Box, {
169
- sx: {
170
- bgcolor: "background.paper",
171
- height: "30px",
172
- position: "relative",
173
- background: theme?.palette?.type === "dark" ? theme?.palette?.editor?.miniToolBarBackground : "#F6F6F6"
174
- },
175
- children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
176
- ...props,
177
- fromPopper: true
178
- }) : null, /*#__PURE__*/_jsx(Toolbar, {
179
- fromPopper: true,
180
- readOnly: readOnly,
181
- showTool: showTool,
182
- onSettings: onSettings
183
- })]
184
- })
185
- }) : /*#__PURE__*/_jsxs(_Fragment, {
186
- children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
187
- ...props
188
- }) : null, /*#__PURE__*/_jsx(Toolbar, {
189
- readOnly: readOnly,
190
- showTool: showTool,
191
- onSettings: onSettings
192
- })]
159
+ children: [/*#__PURE__*/_jsx(Toolbar, {
160
+ isSectionFullWidth: isSectionFullWidth,
161
+ readOnly: readOnly,
162
+ showTool: false,
163
+ onSettings: onSettings
193
164
  }), children]
194
165
  }), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
195
166
  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
- border: activeCard ? "1px solid #2563EB" : "1px solid #C8D8FA",
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
  }
@@ -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",
@@ -1654,13 +1654,12 @@ export const CsvIcon = () => /*#__PURE__*/_jsxs("svg", {
1654
1654
  fill: "white"
1655
1655
  })]
1656
1656
  });
1657
- export const CloseIcon = props => /*#__PURE__*/_jsxs("svg", {
1657
+ export const CloseIcon = () => /*#__PURE__*/_jsxs("svg", {
1658
1658
  width: "20",
1659
1659
  height: "20",
1660
1660
  viewBox: "0 0 20 20",
1661
1661
  fill: "none",
1662
1662
  xmlns: "http://www.w3.org/2000/svg",
1663
- ...(props || {}),
1664
1663
  children: [/*#__PURE__*/_jsx("path", {
1665
1664
  d: "M14.1245 5.875L5.87493 14.1246",
1666
1665
  stroke: "#64748B",
@@ -51,18 +51,17 @@ const useCommonStyle = theme => ({
51
51
  },
52
52
  "& .MuiPaper-root": {
53
53
  border: `unset !important`,
54
- borderRadius: '0px',
55
- height: 'fit-content'
54
+ borderRadius: "0px",
55
+ height: "fit-content",
56
+ padding: "2px"
56
57
  },
57
58
  "& p": {
58
59
  marginBottom: "7px",
59
60
  marginTop: "4px"
60
61
  },
61
- "& .MuiPaper-root": {
62
- border: 'unset !important',
63
- borderRadius: '0px',
64
- height: 'fit-content',
65
- padding: '2px'
62
+ "& p": {
63
+ marginBottom: "7px",
64
+ marginTop: "4px"
66
65
  },
67
66
  "& .muiIconsListParent": {
68
67
  "& svg": {
@@ -76,15 +75,12 @@ const useCommonStyle = theme => ({
76
75
  },
77
76
  "&::-webkit-scrollbar-thumb": {
78
77
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
79
- },
80
- "&::-webkit-scrollbar-track": {
81
- visibility: "hidden"
82
78
  }
83
79
  },
84
80
  "& .MuiGrid-root>.MuiGrid-item": {
85
81
  paddingRight: "0px !important",
86
82
  fontFamily: "Inter, sans-serif",
87
- height: 'fit-content'
83
+ height: "fit-content"
88
84
  },
89
85
  "& .MuiInputBase-root": {
90
86
  borderRadius: "10px",
@@ -145,11 +141,11 @@ const useCommonStyle = theme => ({
145
141
  borderRadius: "10px",
146
142
  width: "46px !important",
147
143
  marginLeft: "10px",
148
- height: '36px !important'
144
+ height: "36px !important"
149
145
  }
150
146
  },
151
- '& .MuiFormHelperText-root': {
152
- margin: '4px 0px 0px 0px',
147
+ "& .MuiFormHelperText-root": {
148
+ margin: "4px 0px 0px 0px",
153
149
  color: theme?.palette?.editor?.closeButtonSvgStroke,
154
150
  fontFamily: "Inter, sans-serif"
155
151
  }
@@ -405,14 +401,14 @@ const useCommonStyle = theme => ({
405
401
  padding: "8px 12px",
406
402
  fontSize: "12px",
407
403
  color: theme?.palette?.editor?.menuOptionTextColor,
408
- fontWeight: '500',
404
+ fontWeight: "500",
409
405
  fontFamily: "Inter, sans-serif",
410
- minHeight: '36px',
406
+ minHeight: "36px",
411
407
  "&:hover": {
412
408
  backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
413
409
  }
414
410
  },
415
- '& .Mui-selected': {
411
+ "& .Mui-selected": {
416
412
  background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
417
413
  },
418
414
  "& .MuiListSubheader-root": {
@@ -421,16 +417,16 @@ const useCommonStyle = theme => ({
421
417
  fontSize: "12px"
422
418
  },
423
419
  "& .MuiPaper-root": {
424
- borderRadius: '8px',
425
- padding: '0px',
420
+ borderRadius: "8px",
421
+ padding: "0px",
426
422
  background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
427
423
  },
428
- '& .MuiButtonBase-root': {
429
- margin: '4px',
430
- borderRadius: '6px'
424
+ "& .MuiButtonBase-root": {
425
+ margin: "4px",
426
+ borderRadius: "6px"
431
427
  },
432
- '& .MuiList-root': {
433
- padding: '0px'
428
+ "& .MuiList-root": {
429
+ padding: "0px"
434
430
  }
435
431
  },
436
432
  datePicker: {
@@ -475,27 +471,27 @@ const useCommonStyle = theme => ({
475
471
  }
476
472
  }
477
473
  },
478
- pageSettingPopUpRoot: {
479
- padding: "16px 8px 16px 10px!important",
480
- height: "100%"
481
- },
482
474
  buttonMoreOption: {
483
475
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
484
476
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
485
- padding: '4px !important',
486
- '& svg': {
487
- width: '18px !important',
488
- height: '18px !important',
489
- '& path': {
477
+ padding: "4px !important",
478
+ "& svg": {
479
+ width: "18px !important",
480
+ height: "18px !important",
481
+ "& path": {
490
482
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
491
483
  }
492
484
  }
493
485
  },
486
+ pageSettingPopUpRoot: {
487
+ padding: "16px 8px 16px 10px!important",
488
+ height: "100%"
489
+ },
494
490
  buttonMoreOption2: {
495
491
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
496
492
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
497
- '& svg': {
498
- '& path': {
493
+ "& svg": {
494
+ "& path": {
499
495
  fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
500
496
  }
501
497
  }
@@ -503,11 +499,11 @@ const useCommonStyle = theme => ({
503
499
  buttonMoreOption3: {
504
500
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
505
501
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
506
- padding: '5px !important',
507
- '& svg': {
508
- width: '16px !important',
509
- height: '16px !important',
510
- '& path': {
502
+ padding: "5px !important",
503
+ "& svg": {
504
+ width: "16px !important",
505
+ height: "16px !important",
506
+ "& path": {
511
507
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
512
508
  }
513
509
  }
@@ -515,37 +511,37 @@ const useCommonStyle = theme => ({
515
511
  resizeButton: {
516
512
  background: theme?.palette?.editor?.aiInputBackground,
517
513
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
518
- padding: '5px !important',
519
- borderRadius: '50% !important',
520
- '& svg': {
521
- width: '18px',
522
- height: '18px',
523
- '& path': {
514
+ padding: "5px !important",
515
+ borderRadius: "50% !important",
516
+ "& svg": {
517
+ width: "18px",
518
+ height: "18px",
519
+ "& path": {
524
520
  fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
525
521
  }
526
522
  },
527
- '&:hover': {
523
+ "&:hover": {
528
524
  background: theme?.palette?.editor?.aiInputBackground
529
525
  }
530
526
  },
531
527
  gradientFillBtn: {
532
528
  background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
533
- textTransform: 'math-auto !important',
534
- color: '#FFFFFF !important',
535
- padding: '0px 12px !important',
536
- height: '32px',
537
- borderRadius: '8px',
538
- fontWeight: '500',
539
- fontSize: '14px'
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"
540
536
  },
541
537
  emptyThumbBtn: {
542
538
  background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
543
539
  color: `${theme?.palette?.editor?.textColor} !important`,
544
- fontSize: '14px !important',
545
- '& svg': {
546
- width: '20px !important',
547
- height: '20px !important',
548
- '& path': {
540
+ fontSize: "14px !important",
541
+ "& svg": {
542
+ width: "20px !important",
543
+ height: "20px !important",
544
+ "& path": {
549
545
  stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
550
546
  }
551
547
  }
@@ -90,9 +90,18 @@ const ELEMENT_TAGS = {
90
90
  type: "image",
91
91
  url: el.getAttribute("src")
92
92
  }),
93
- LI: () => ({
94
- type: "list-item"
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.