@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.
- package/dist/Editor/CommonEditor.js +22 -15
- package/dist/Editor/Editor.css +22 -16
- 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/Components/Select.js +8 -14
- 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 +70 -43
- 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 +13 -11
- 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 +31 -37
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +75 -43
- 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 +78 -97
- 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/common/iconslist.js +1 -2
- package/dist/Editor/commonStyle.js +58 -57
- package/dist/Editor/helper/ensureWrappedVariables.js +28 -0
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +24 -1
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +5 -2
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +15 -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 +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;
|
@@ -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 =
|
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
|
-
"&
|
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
|
}
|
@@ -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);
|
@@ -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
|
-
|
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
|
@@ -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
|
@@ -43,7 +43,8 @@ const useTableResize = ({
|
|
43
43
|
minWidth
|
44
44
|
} = minMaxProps || {};
|
45
45
|
setSize(currentSize => {
|
46
|
-
const
|
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
|
}]
|