@flozy/editor 5.7.2 → 5.7.4

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 (43) hide show
  1. package/dist/Editor/CommonEditor.js +12 -7
  2. package/dist/Editor/Editor.css +22 -17
  3. package/dist/Editor/Elements/Button/EditorButton.js +3 -1
  4. package/dist/Editor/Elements/DataView/DataView.js +4 -3
  5. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +5 -1
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +5 -1
  7. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +23 -19
  8. package/dist/Editor/Elements/Form/Form.js +1 -0
  9. package/dist/Editor/Elements/FreeGrid/styles.js +1 -0
  10. package/dist/Editor/Elements/List/CheckList.js +2 -1
  11. package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
  12. package/dist/Editor/Elements/Search/SearchList.js +8 -1
  13. package/dist/Editor/Elements/Signature/SignaturePopup.js +3 -1
  14. package/dist/Editor/Elements/SimpleText/index.js +8 -1
  15. package/dist/Editor/Elements/SimpleText/style.js +5 -1
  16. package/dist/Editor/Elements/Title/title.js +13 -1
  17. package/dist/Editor/Elements/Variables/Style.js +20 -2
  18. package/dist/Editor/Elements/Variables/VariableButton.js +7 -3
  19. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +13 -3
  20. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +5 -0
  21. package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
  22. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
  23. package/dist/Editor/common/FontLoader/FontLoader.js +32 -9
  24. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
  25. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
  26. package/dist/Editor/common/RnD/Utils/gridDropItem.js +1 -0
  27. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  28. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  29. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  30. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
  31. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
  32. package/dist/Editor/common/Uploader.js +8 -0
  33. package/dist/Editor/commonStyle.js +9 -12
  34. package/dist/Editor/helper/index.js +2 -2
  35. package/dist/Editor/helper/theme.js +24 -1
  36. package/dist/Editor/hooks/useMouseMove.js +5 -2
  37. package/dist/Editor/plugins/withLayout.js +1 -1
  38. package/dist/Editor/utils/SlateUtilityFunctions.js +8 -1
  39. package/dist/Editor/utils/button.js +4 -4
  40. package/dist/Editor/utils/draftToSlate.js +3 -2
  41. package/dist/Editor/utils/helper.js +42 -19
  42. package/dist/Editor/utils/pageSettings.js +14 -2
  43. package/package.json +1 -1
@@ -14,6 +14,8 @@ 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";
17
19
  import { jsx as _jsx } from "react/jsx-runtime";
18
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
21
  const allTools = toolbarGroups.flat();
@@ -31,10 +33,18 @@ const TextFormat = props => {
31
33
  const [anchorEl, setAnchorEl] = useState(null);
32
34
  const [type, setType] = useState(null);
33
35
  const open = Boolean(anchorEl);
36
+ const {
37
+ element: pageSt
38
+ } = getPageSettings(editor) || {};
39
+ const pageSettingLine = pageSt?.pageProps?.lineHeight;
34
40
  const {
35
41
  fontFamilies,
36
42
  theme
37
43
  } = useEditorContext();
44
+ const {
45
+ activeBreakPoint
46
+ } = useEditorContext();
47
+ const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
38
48
  const fontWeight = allTools.find(f => f.format === "fontWeight");
39
49
  const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
40
50
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
@@ -51,6 +61,8 @@ const TextFormat = props => {
51
61
  color: "",
52
62
  bgColor: ""
53
63
  };
64
+ let lineSpacingValue = activeMark(editor, 'lineHeight');
65
+ lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
54
66
  const handleColorPicker = type => e => {
55
67
  setType(type);
56
68
  setAnchorEl(e.currentTarget);
@@ -91,6 +103,13 @@ const TextFormat = props => {
91
103
  value
92
104
  });
93
105
  };
106
+ const handleLineSpacing = data => {
107
+ const [[format, value]] = Object.entries(data);
108
+ addMarkData(editor, {
109
+ format,
110
+ value
111
+ });
112
+ };
94
113
  return /*#__PURE__*/_jsxs(Grid, {
95
114
  container: true,
96
115
  sx: classes.textFormatWrapper,
@@ -360,6 +379,32 @@ const TextFormat = props => {
360
379
  xs: 12,
361
380
  sx: classes.dividerGrid,
362
381
  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, {})
363
408
  }), /*#__PURE__*/_jsx(Grid, {
364
409
  item: true,
365
410
  xs: 12,
@@ -1,7 +1,11 @@
1
- import { useEffect } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  import WebFont from "webfontloader";
3
3
  import { useEditorContext } from "../../hooks/useMouseMove";
4
4
  import { defaultFonts, googleFontList, otherFonts } from "./FontList";
5
+ import CircularProgress from '@mui/material/CircularProgress';
6
+ import Box from "@mui/material/Box";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
9
  const FontLoader = props => {
6
10
  const {
7
11
  otherProps,
@@ -10,12 +14,14 @@ const FontLoader = props => {
10
14
  const {
11
15
  setFontFamilies
12
16
  } = useEditorContext();
17
+ const [loading, setLoading] = useState(false);
13
18
  const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
14
19
  let currentIndex = 0;
15
20
  let retryCount = 0;
16
21
  function loadNextBatch() {
17
22
  if (currentIndex >= families?.length) {
18
- // console.log("All fonts have been loaded");
23
+ console.log("All fonts have been loaded");
24
+ setLoading(false);
19
25
  return;
20
26
  }
21
27
  const batch = families?.slice(currentIndex, currentIndex + batchSize);
@@ -27,7 +33,7 @@ const FontLoader = props => {
27
33
  classes: false,
28
34
  timeout: 2000,
29
35
  active: () => {
30
- // console.log(`Fonts loaded successfully: ${batch}`);
36
+ console.log(`Fonts loaded successfully: ${batch}`);
31
37
  currentIndex += batchSize;
32
38
  retryCount = 0; // Reset retry count for the next batch
33
39
  loadNextBatch();
@@ -37,13 +43,13 @@ const FontLoader = props => {
37
43
 
38
44
  if (retryCount < maxRetries) {
39
45
  retryCount++;
40
- // console.log(`Retrying batch (${retryCount}/${maxRetries})...`);
46
+ console.log(`Retrying batch (${retryCount}/${maxRetries})...`);
41
47
  // Retry loading the same batch
42
48
  loadNextBatch();
43
49
  } else {
44
- console.log(
45
- // `Max retries reached for batch: ${batch}. Moving to the next batch.`
46
- );
50
+ // console.log(
51
+ // `Max retries reached for batch: ${batch}. Moving to the next batch.`
52
+ // );
47
53
  currentIndex += batchSize;
48
54
  retryCount = 0; // Reset retry count for the next batch
49
55
  loadNextBatch();
@@ -67,8 +73,9 @@ const FontLoader = props => {
67
73
  });
68
74
  loadFontsInBatches(families);
69
75
  }).catch(err => {
70
- console.log(err);
76
+ // console.log(err);
71
77
  });
78
+ setLoading(true);
72
79
  } else {
73
80
  function correctFontArray(fontString) {
74
81
  let fontsArray = fontString.split(",");
@@ -90,9 +97,25 @@ const FontLoader = props => {
90
97
  families = families?.map(font => font?.replace(/\"/g, ""));
91
98
  families = families?.map(font => font?.replace(", sans-serif", "")); //This is temporary fix for patch
92
99
  families = families.filter(font => googleFontList.includes(font));
100
+ setLoading(true);
93
101
  loadFontsInBatches(families);
94
102
  }
95
103
  }, []);
96
- return null;
104
+ return /*#__PURE__*/_jsx(_Fragment, {
105
+ children: loading ? /*#__PURE__*/_jsx(Box, {
106
+ sx: {
107
+ position: 'absolute',
108
+ top: 0,
109
+ left: 0,
110
+ right: 0,
111
+ bottom: 0,
112
+ zIndex: 99999,
113
+ display: 'flex',
114
+ justifyContent: 'center',
115
+ alignItems: 'center'
116
+ },
117
+ children: /*#__PURE__*/_jsx(CircularProgress, {})
118
+ }) : null
119
+ });
97
120
  };
98
121
  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": {
@@ -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
- console.log(breakpoint);
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, {})
@@ -147,6 +147,7 @@ export function onDropItem(props, parentClass) {
147
147
  newPath = moveTo;
148
148
  const appenBp = breakpoint === "lg" ? "" : `_${breakpoint}`;
149
149
  const cCalx = isContainerElement(editor, moveTo, props, appenBp);
150
+
150
151
  // const posX = parseInt(
151
152
  // cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX
152
153
  // );
@@ -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
  }
@@ -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;
@@ -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",
@@ -49,16 +49,16 @@ const useCommonStyle = theme => ({
49
49
  fontWeight: "500",
50
50
  fontFamily: "Inter, sans-serif"
51
51
  },
52
- "& p": {
53
- marginBottom: "7px",
54
- marginTop: "4px"
55
- },
56
52
  "& .MuiPaper-root": {
57
- border: 'unset !important',
53
+ border: `unset !important`,
58
54
  borderRadius: '0px',
59
55
  height: 'fit-content',
60
56
  padding: '2px'
61
57
  },
58
+ "& p": {
59
+ marginBottom: "7px",
60
+ marginTop: "4px"
61
+ },
62
62
  "& .muiIconsListParent": {
63
63
  "& svg": {
64
64
  color: `${theme?.palette?.editor?.svgTextAlignStrokeColor} !important`
@@ -71,9 +71,6 @@ const useCommonStyle = theme => ({
71
71
  },
72
72
  "&::-webkit-scrollbar-thumb": {
73
73
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
74
- },
75
- "&::-webkit-scrollbar-track": {
76
- visibility: "hidden"
77
74
  }
78
75
  },
79
76
  "& .MuiGrid-root>.MuiGrid-item": {
@@ -470,10 +467,6 @@ const useCommonStyle = theme => ({
470
467
  }
471
468
  }
472
469
  },
473
- pageSettingPopUpRoot: {
474
- padding: "16px 8px 16px 10px!important",
475
- height: "100%"
476
- },
477
470
  buttonMoreOption: {
478
471
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
479
472
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
@@ -486,6 +479,10 @@ const useCommonStyle = theme => ({
486
479
  }
487
480
  }
488
481
  },
482
+ pageSettingPopUpRoot: {
483
+ padding: "16px 8px 16px 10px!important",
484
+ height: "100%"
485
+ },
489
486
  buttonMoreOption2: {
490
487
  background: `${theme?.palette?.editor?.aiInputBackground} !important`,
491
488
  border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
@@ -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
+ };
@@ -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, {
@@ -314,7 +314,8 @@ export const getBlock = props => {
314
314
  borderRadius: `${element?.color ? "0px" : "12px"} 12px 12px ${element?.color ? "0px" : "12px"}`,
315
315
  margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
316
316
  width: element?.bgColor ? "calc(100% - 16px)" : "100%",
317
- borderWidth: element?.color ? "0px 0px 0px 3px" : "0px"
317
+ borderWidth: element?.color ? "0px 0px 0px 3px" : "0px",
318
+ lineHeight: 1.43
318
319
  },
319
320
  children: children
320
321
  });
@@ -374,6 +375,9 @@ export const getBlock = props => {
374
375
  });
375
376
  case "orderedList":
376
377
  return /*#__PURE__*/_jsx("ol", {
378
+ style: {
379
+ lineHeight: 1.43
380
+ },
377
381
  className: "listItemMargin",
378
382
  type: "1",
379
383
  ...attributes,
@@ -381,6 +385,9 @@ export const getBlock = props => {
381
385
  });
382
386
  case "unorderedList":
383
387
  return /*#__PURE__*/_jsx("ul", {
388
+ style: {
389
+ lineHeight: 1.43
390
+ },
384
391
  className: "listItemMargin",
385
392
  ...attributes,
386
393
  children: children
@@ -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
  };
@@ -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
  }]