@flozy/editor 5.9.1 → 5.9.3

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 (61) hide show
  1. package/dist/Editor/CommonEditor.js +22 -15
  2. package/dist/Editor/Editor.css +22 -16
  3. package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -12
  4. package/dist/Editor/Elements/Button/EditorButton.js +3 -1
  5. package/dist/Editor/Elements/DataView/DataView.js +4 -3
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +8 -14
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +5 -1
  8. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +5 -1
  9. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +23 -19
  10. package/dist/Editor/Elements/Form/Form.js +1 -0
  11. package/dist/Editor/Elements/FreeGrid/styles.js +1 -0
  12. package/dist/Editor/Elements/Grid/GridItem.js +1 -2
  13. package/dist/Editor/Elements/Link/Link.js +70 -43
  14. package/dist/Editor/Elements/List/CheckList.js +2 -1
  15. package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
  16. package/dist/Editor/Elements/Search/SearchList.js +8 -1
  17. package/dist/Editor/Elements/SimpleText/index.js +13 -11
  18. package/dist/Editor/Elements/SimpleText/style.js +5 -1
  19. package/dist/Editor/Elements/Table/Table.js +3 -3
  20. package/dist/Editor/Elements/Table/TableCell.js +14 -9
  21. package/dist/Editor/Elements/Title/title.js +13 -1
  22. package/dist/Editor/Elements/Variables/Style.js +28 -2
  23. package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
  24. package/dist/Editor/MiniEditor.js +4 -2
  25. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +37 -28
  26. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +3 -1
  27. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
  28. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +3 -1
  29. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
  30. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +9 -3
  31. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
  32. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  33. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
  34. package/dist/Editor/Toolbar/PopupTool/index.js +31 -37
  35. package/dist/Editor/common/FontLoader/FontList.js +3 -11
  36. package/dist/Editor/common/FontLoader/FontLoader.js +75 -43
  37. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
  38. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
  39. package/dist/Editor/common/Section/index.js +78 -97
  40. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  41. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  42. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  43. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
  44. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
  45. package/dist/Editor/common/Uploader.js +8 -0
  46. package/dist/Editor/common/iconslist.js +1 -2
  47. package/dist/Editor/commonStyle.js +58 -57
  48. package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
  49. package/dist/Editor/helper/index.js +2 -2
  50. package/dist/Editor/helper/theme.js +24 -1
  51. package/dist/Editor/hooks/useEditorScroll.js +1 -1
  52. package/dist/Editor/hooks/useMouseMove.js +5 -2
  53. package/dist/Editor/plugins/withLayout.js +1 -1
  54. package/dist/Editor/utils/SlateUtilityFunctions.js +15 -4
  55. package/dist/Editor/utils/button.js +4 -4
  56. package/dist/Editor/utils/customHooks/useTableResize.js +2 -1
  57. package/dist/Editor/utils/draftToSlate.js +3 -2
  58. package/dist/Editor/utils/helper.js +60 -19
  59. package/dist/Editor/utils/pageSettings.js +14 -2
  60. package/dist/Editor/utils/table.js +21 -0
  61. package/package.json +2 -2
@@ -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;
@@ -25,6 +25,10 @@ const pageSettingsStyle = [{
25
25
  label: "Padding",
26
26
  key: "bannerSpacing",
27
27
  type: "bannerSpacing"
28
+ }, {
29
+ label: "Line Spacing",
30
+ key: "lineHeight",
31
+ type: "lineSpacing"
28
32
  }]
29
33
  }, {
30
34
  tab: "Max Width",
@@ -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",
@@ -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
- "& .MuiPaper-root": {
57
- border: 'unset !important',
58
- borderRadius: '0px',
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: 'fit-content'
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: '36px !important'
144
+ height: "36px !important"
144
145
  }
145
146
  },
146
- '& .MuiFormHelperText-root': {
147
- margin: '4px 0px 0px 0px',
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: '500',
404
+ fontWeight: "500",
404
405
  fontFamily: "Inter, sans-serif",
405
- minHeight: '36px',
406
+ minHeight: "36px",
406
407
  "&:hover": {
407
408
  backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
408
409
  }
409
410
  },
410
- '& .Mui-selected': {
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: '8px',
420
- padding: '0px',
420
+ borderRadius: "8px",
421
+ padding: "0px",
421
422
  background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
422
423
  },
423
- '& .MuiButtonBase-root': {
424
- margin: '4px',
425
- borderRadius: '6px'
424
+ "& .MuiButtonBase-root": {
425
+ margin: "4px",
426
+ borderRadius: "6px"
426
427
  },
427
- '& .MuiList-root': {
428
- padding: '0px'
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: '4px !important',
481
- '& svg': {
482
- width: '18px !important',
483
- height: '18px !important',
484
- '& path': {
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
- '& svg': {
493
- '& path': {
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: '5px !important',
502
- '& svg': {
503
- width: '16px !important',
504
- height: '16px !important',
505
- '& path': {
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: '5px !important',
514
- borderRadius: '50% !important',
515
- '& svg': {
516
- width: '18px',
517
- height: '18px',
518
- '& path': {
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
- '&:hover': {
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: 'math-auto !important',
529
- color: '#FFFFFF !important',
530
- padding: '0px 12px !important',
531
- height: '32px',
532
- borderRadius: '8px',
533
- fontWeight: '500',
534
- 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"
535
536
  },
536
537
  emptyThumbBtn: {
537
538
  background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
538
539
  color: `${theme?.palette?.editor?.textColor} !important`,
539
- fontSize: '14px !important',
540
- '& svg': {
541
- width: '20px !important',
542
- height: '20px !important',
543
- '& path': {
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
  }
@@ -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 === 'carousel'
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('carousel_slider_edit');
347
+ const isEdit = carouselDom.classList.contains("carousel_slider_edit");
348
348
  return !isEdit;
349
349
  } catch (err) {
350
350
  console.log(err);
@@ -161,4 +161,27 @@ export const groupByBreakpoint = (styleProps, theme) => {
161
161
  }
162
162
  };
163
163
  };
164
- export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
164
+ export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
165
+ export const getBreakpointLineSpacing = (value, breakpoint) => {
166
+ try {
167
+ const values = getBreakPointsValue(value, breakpoint);
168
+ const cssVal = BREAKPOINTS_DEVICES.reduce((a, b) => {
169
+ if (values[b] || values["lg"]) {
170
+ const value = values[b] || values["lg"];
171
+ return {
172
+ ...a,
173
+ [b]: value
174
+ };
175
+ } else {
176
+ return a;
177
+ }
178
+ }, {});
179
+ if (breakpoint) {
180
+ return value[breakpoint] || value["lg"] || value;
181
+ } else {
182
+ return cssVal["lg"];
183
+ }
184
+ } catch (err) {
185
+ // console.log(err);
186
+ }
187
+ };
@@ -5,7 +5,7 @@ function useEditorScroll(editorWrapper = {
5
5
  useEffect(() => {
6
6
  const handleScroll = () => {
7
7
  if (editorWrapper.current) {
8
- callback();
8
+ callback("scroll");
9
9
  }
10
10
  };
11
11
  const currentEditorWrapper = editorWrapper.current;
@@ -35,6 +35,7 @@ export const EditorProvider = ({
35
35
  path: null
36
36
  });
37
37
  const [fontFamilies, setFontFamilies] = useState({});
38
+ const [activeBreakPoint, setActiveBreakPoint] = useState("");
38
39
  useEffect(() => {
39
40
  window.updateSelectedItem = d => {
40
41
  setSelectedElement(d);
@@ -97,8 +98,10 @@ export const EditorProvider = ({
97
98
  setOpenAI,
98
99
  updateDragging,
99
100
  fontFamilies,
100
- setFontFamilies
101
- }), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop]);
101
+ setFontFamilies,
102
+ activeBreakPoint,
103
+ setActiveBreakPoint
104
+ }), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, activeBreakPoint]);
102
105
  return /*#__PURE__*/_jsx(EditorContext.Provider, {
103
106
  value: otherValues,
104
107
  children: children
@@ -39,7 +39,7 @@ const withLayout = editor => {
39
39
  const title = {
40
40
  type: "title",
41
41
  children: [{
42
- text: "Untitled"
42
+ text: ""
43
43
  }]
44
44
  };
45
45
  Transforms.insertNodes(editor, title, {
@@ -173,10 +173,9 @@ export const getMarked = (leaf, children, theme) => {
173
173
  if (leaf.highlight) {
174
174
  children = /*#__PURE__*/_jsx("span", {
175
175
  style: {
176
- color: "inherit"
176
+ color: "inherit",
177
+ background: "var(--slate-highlight-bg)"
177
178
  },
178
- className: "slate-highlight" // while opening AI, we will use this element to highlight the selection. (PopoverAIInput.js)
179
- ,
180
179
  children: children
181
180
  });
182
181
  }
@@ -338,7 +337,8 @@ export const getBlock = props => {
338
337
  borderRadius: `${element?.color ? "0px" : "12px"} 12px 12px ${element?.color ? "0px" : "12px"}`,
339
338
  margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
340
339
  width: element?.bgColor ? "calc(100% - 16px)" : "100%",
341
- borderWidth: element?.color ? "0px 0px 0px 3px" : "0px"
340
+ borderWidth: element?.color ? "0px 0px 0px 3px" : "0px",
341
+ lineHeight: 1.43
342
342
  },
343
343
  children: children
344
344
  });
@@ -398,6 +398,9 @@ export const getBlock = props => {
398
398
  });
399
399
  case "orderedList":
400
400
  return /*#__PURE__*/_jsx("ol", {
401
+ style: {
402
+ lineHeight: 1.43
403
+ },
401
404
  className: "listItemMargin",
402
405
  type: "1",
403
406
  ...attributes,
@@ -405,6 +408,9 @@ export const getBlock = props => {
405
408
  });
406
409
  case "unorderedList":
407
410
  return /*#__PURE__*/_jsx("ul", {
411
+ style: {
412
+ lineHeight: 1.43
413
+ },
408
414
  className: "listItemMargin",
409
415
  ...attributes,
410
416
  children: children
@@ -614,6 +620,11 @@ export const getBlock = props => {
614
620
  children: children
615
621
  });
616
622
  default:
623
+ // return (
624
+ // <span {...attributes} {...element.attr}>
625
+ // {children}
626
+ // </span>
627
+ // );
617
628
  return /*#__PURE__*/_jsx(SimpleText, {
618
629
  ...props,
619
630
  isEmpty: isEmpty
@@ -20,10 +20,10 @@ export const insertButton = editor => {
20
20
  bottomRight: 30
21
21
  },
22
22
  bannerSpacing: {
23
- left: 16,
24
- top: 8,
25
- right: 16,
26
- bottom: 8
23
+ left: 24,
24
+ top: 10,
25
+ right: 24,
26
+ bottom: 10
27
27
  },
28
28
  ...(windowVar.lastButtonProps || {})
29
29
  };
@@ -43,7 +43,8 @@ const useTableResize = ({
43
43
  minWidth
44
44
  } = minMaxProps || {};
45
45
  setSize(currentSize => {
46
- const calcWidth = currentSize?.width + e.movementX;
46
+ const width = currentSize?.width || parentDOM?.clientWidth;
47
+ const calcWidth = width + e.movementX;
47
48
  return {
48
49
  width: minWidth && calcWidth < minWidth ? minWidth : calcWidth,
49
50
  height: currentSize.height + e.movementY,
@@ -82,7 +82,8 @@ const splitInlineStyleRanges = (text, inlineStyleRanges, data) => {
82
82
  };
83
83
  export const draftToSlate = props => {
84
84
  const {
85
- data
85
+ data,
86
+ needLayout
86
87
  } = props;
87
88
  if (data?.blocks && data?.blocks?.length > 0) {
88
89
  const converted = data?.blocks?.reduce((a, b) => {
@@ -104,7 +105,7 @@ export const draftToSlate = props => {
104
105
  return data;
105
106
  } else {
106
107
  return [{
107
- type: "paragraph",
108
+ type: needLayout ? "title" : "paragraph",
108
109
  children: [{
109
110
  text: ""
110
111
  }]