@flozy/editor 5.9.3 → 5.9.5
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 +14 -16
- package/dist/Editor/Editor.css +16 -22
- package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
- package/dist/Editor/Elements/Button/EditorButton.js +1 -3
- package/dist/Editor/Elements/DataView/DataView.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +14 -8
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
- package/dist/Editor/Elements/Form/Form.js +0 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Link/Link.js +43 -70
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
- package/dist/Editor/Elements/Search/SearchList.js +1 -8
- package/dist/Editor/Elements/SimpleText/index.js +1 -8
- package/dist/Editor/Elements/SimpleText/style.js +1 -5
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +9 -14
- package/dist/Editor/Elements/Title/title.js +1 -13
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
- package/dist/Editor/MiniEditor.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +28 -37
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -9
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +0 -5
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
- package/dist/Editor/Toolbar/PopupTool/index.js +0 -2
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -6
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/common/iconslist.js +2 -1
- package/dist/Editor/commonStyle.js +57 -58
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +1 -24
- package/dist/Editor/hooks/useMouseMove.js +2 -5
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +4 -10
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/helper.js +19 -60
- package/dist/Editor/utils/pageSettings.js +2 -14
- package/dist/Editor/utils/table.js +0 -21
- package/package.json +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
- package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
@@ -3,35 +3,24 @@ 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";
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
8
|
const SwitchViewport = props => {
|
10
9
|
const {
|
11
10
|
breakpoint,
|
12
|
-
onChange
|
13
|
-
show
|
11
|
+
onChange
|
14
12
|
} = props;
|
15
13
|
const classes = useSwitchViewport();
|
16
|
-
const {
|
17
|
-
setSelectedElement,
|
18
|
-
setActiveBreakPoint
|
19
|
-
} = useEditorContext();
|
20
14
|
useEffect(() => {
|
21
|
-
|
22
|
-
setSelectedElement({});
|
15
|
+
console.log(breakpoint);
|
23
16
|
}, [breakpoint]);
|
24
17
|
return /*#__PURE__*/_jsxs(Box, {
|
25
18
|
sx: classes.root,
|
26
|
-
style: {
|
27
|
-
display: show ? "block" : "none"
|
28
|
-
},
|
29
19
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
30
20
|
title: "Desktop View",
|
31
21
|
children: /*#__PURE__*/_jsx(IconButton, {
|
32
22
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
33
23
|
onClick: () => {
|
34
|
-
setActiveBreakPoint("");
|
35
24
|
onChange("");
|
36
25
|
},
|
37
26
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
@@ -41,7 +30,6 @@ const SwitchViewport = props => {
|
|
41
30
|
children: /*#__PURE__*/_jsx(IconButton, {
|
42
31
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
43
32
|
onClick: () => {
|
44
|
-
setActiveBreakPoint("xs");
|
45
33
|
onChange("xs");
|
46
34
|
},
|
47
35
|
children: /*#__PURE__*/_jsx(PhoneIphoneIcon, {})
|
@@ -73,11 +73,6 @@ 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
|
-
},
|
81
76
|
children: /*#__PURE__*/_jsxs(Button, {
|
82
77
|
component: "label",
|
83
78
|
variant: "text",
|
@@ -1,7 +1,6 @@
|
|
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";
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -16,10 +15,7 @@ const RenderCard = ({
|
|
16
15
|
return /*#__PURE__*/_jsx(Card, {
|
17
16
|
sx: {
|
18
17
|
position: 'relative',
|
19
|
-
padding: "10px"
|
20
|
-
'& .MuiCheckbox-root svg': {
|
21
|
-
fill: 'unset !important'
|
22
|
-
}
|
18
|
+
padding: "10px"
|
23
19
|
},
|
24
20
|
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
25
21
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
@@ -85,9 +81,6 @@ const CardsMapping = props => {
|
|
85
81
|
selectedCard,
|
86
82
|
infoIcon
|
87
83
|
} = data;
|
88
|
-
const {
|
89
|
-
theme
|
90
|
-
} = useEditorContext();
|
91
84
|
const activeCard = value === selectedCard;
|
92
85
|
const handleChange = e => {
|
93
86
|
if (selectedCard === data?.value) {
|
@@ -106,8 +99,7 @@ const CardsMapping = props => {
|
|
106
99
|
sx: {
|
107
100
|
marginBottom: "12px",
|
108
101
|
"& .MuiPaper-root": {
|
109
|
-
|
110
|
-
border: activeCard ? "1px solid #2563EB" : `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
102
|
+
border: activeCard ? "1px solid #2563EB" : "1px solid #C8D8FA",
|
111
103
|
borderRadius: "8px",
|
112
104
|
boxShadow: activeCard ? "0px 4px 16px 0px #2563EB40" : "unset"
|
113
105
|
}
|
@@ -18,7 +18,6 @@ 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";
|
22
21
|
const FieldMap = {
|
23
22
|
text: Text,
|
24
23
|
bannerSpacing: BannerSpacing,
|
@@ -39,7 +38,6 @@ const FieldMap = {
|
|
39
38
|
fontSize: FontSize,
|
40
39
|
selectSwitch: SelectSwitch,
|
41
40
|
card: CardsMapping,
|
42
|
-
metadatamapping: MetaDataMapping
|
43
|
-
lineSpacing: LineSpacing
|
41
|
+
metadatamapping: MetaDataMapping
|
44
42
|
};
|
45
43
|
export default FieldMap;
|
@@ -4,7 +4,6 @@ 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";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -19,9 +18,6 @@ const Uploader = props => {
|
|
19
18
|
const [base64, setBase64] = useState(value?.url);
|
20
19
|
const [fileName, setFileName] = useState("");
|
21
20
|
const [uploading, setUploading] = useState(false);
|
22
|
-
const {
|
23
|
-
theme
|
24
|
-
} = useEditorContext();
|
25
21
|
const handleChange = async e => {
|
26
22
|
const uFile = e.target.files[0];
|
27
23
|
const strImage = await convertBase64(uFile);
|
@@ -103,10 +99,6 @@ const Uploader = props => {
|
|
103
99
|
className: "uploadImageSection",
|
104
100
|
children: base64 ? renderThumb() : /*#__PURE__*/_jsx(Grid, {
|
105
101
|
className: "uploadImageText",
|
106
|
-
sx: {
|
107
|
-
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
108
|
-
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
109
|
-
},
|
110
102
|
children: /*#__PURE__*/_jsxs(Button, {
|
111
103
|
component: "label",
|
112
104
|
variant: "text",
|
@@ -1654,12 +1654,13 @@ export const CsvIcon = () => /*#__PURE__*/_jsxs("svg", {
|
|
1654
1654
|
fill: "white"
|
1655
1655
|
})]
|
1656
1656
|
});
|
1657
|
-
export const CloseIcon =
|
1657
|
+
export const CloseIcon = props => /*#__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 || {}),
|
1663
1664
|
children: [/*#__PURE__*/_jsx("path", {
|
1664
1665
|
d: "M14.1245 5.875L5.87493 14.1246",
|
1665
1666
|
stroke: "#64748B",
|
@@ -49,19 +49,15 @@ 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
|
-
},
|
58
52
|
"& p": {
|
59
53
|
marginBottom: "7px",
|
60
54
|
marginTop: "4px"
|
61
55
|
},
|
62
|
-
"&
|
63
|
-
|
64
|
-
|
56
|
+
"& .MuiPaper-root": {
|
57
|
+
border: 'unset !important',
|
58
|
+
borderRadius: '0px',
|
59
|
+
height: 'fit-content',
|
60
|
+
padding: '2px'
|
65
61
|
},
|
66
62
|
"& .muiIconsListParent": {
|
67
63
|
"& svg": {
|
@@ -75,12 +71,15 @@ const useCommonStyle = theme => ({
|
|
75
71
|
},
|
76
72
|
"&::-webkit-scrollbar-thumb": {
|
77
73
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
74
|
+
},
|
75
|
+
"&::-webkit-scrollbar-track": {
|
76
|
+
visibility: "hidden"
|
78
77
|
}
|
79
78
|
},
|
80
79
|
"& .MuiGrid-root>.MuiGrid-item": {
|
81
80
|
paddingRight: "0px !important",
|
82
81
|
fontFamily: "Inter, sans-serif",
|
83
|
-
height:
|
82
|
+
height: 'fit-content'
|
84
83
|
},
|
85
84
|
"& .MuiInputBase-root": {
|
86
85
|
borderRadius: "10px",
|
@@ -141,11 +140,11 @@ const useCommonStyle = theme => ({
|
|
141
140
|
borderRadius: "10px",
|
142
141
|
width: "46px !important",
|
143
142
|
marginLeft: "10px",
|
144
|
-
height:
|
143
|
+
height: '36px !important'
|
145
144
|
}
|
146
145
|
},
|
147
|
-
|
148
|
-
margin:
|
146
|
+
'& .MuiFormHelperText-root': {
|
147
|
+
margin: '4px 0px 0px 0px',
|
149
148
|
color: theme?.palette?.editor?.closeButtonSvgStroke,
|
150
149
|
fontFamily: "Inter, sans-serif"
|
151
150
|
}
|
@@ -401,14 +400,14 @@ const useCommonStyle = theme => ({
|
|
401
400
|
padding: "8px 12px",
|
402
401
|
fontSize: "12px",
|
403
402
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
404
|
-
fontWeight:
|
403
|
+
fontWeight: '500',
|
405
404
|
fontFamily: "Inter, sans-serif",
|
406
|
-
minHeight:
|
405
|
+
minHeight: '36px',
|
407
406
|
"&:hover": {
|
408
407
|
backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground
|
409
408
|
}
|
410
409
|
},
|
411
|
-
|
410
|
+
'& .Mui-selected': {
|
412
411
|
background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
413
412
|
},
|
414
413
|
"& .MuiListSubheader-root": {
|
@@ -417,16 +416,16 @@ const useCommonStyle = theme => ({
|
|
417
416
|
fontSize: "12px"
|
418
417
|
},
|
419
418
|
"& .MuiPaper-root": {
|
420
|
-
borderRadius:
|
421
|
-
padding:
|
419
|
+
borderRadius: '8px',
|
420
|
+
padding: '0px',
|
422
421
|
background: `${theme?.palette?.editor?.textWeightPopUpBackground} !important`
|
423
422
|
},
|
424
|
-
|
425
|
-
margin:
|
426
|
-
borderRadius:
|
423
|
+
'& .MuiButtonBase-root': {
|
424
|
+
margin: '4px',
|
425
|
+
borderRadius: '6px'
|
427
426
|
},
|
428
|
-
|
429
|
-
padding:
|
427
|
+
'& .MuiList-root': {
|
428
|
+
padding: '0px'
|
430
429
|
}
|
431
430
|
},
|
432
431
|
datePicker: {
|
@@ -471,27 +470,27 @@ const useCommonStyle = theme => ({
|
|
471
470
|
}
|
472
471
|
}
|
473
472
|
},
|
473
|
+
pageSettingPopUpRoot: {
|
474
|
+
padding: "16px 8px 16px 10px!important",
|
475
|
+
height: "100%"
|
476
|
+
},
|
474
477
|
buttonMoreOption: {
|
475
478
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
476
479
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
477
|
-
padding:
|
478
|
-
|
479
|
-
width:
|
480
|
-
height:
|
481
|
-
|
480
|
+
padding: '4px !important',
|
481
|
+
'& svg': {
|
482
|
+
width: '18px !important',
|
483
|
+
height: '18px !important',
|
484
|
+
'& path': {
|
482
485
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
483
486
|
}
|
484
487
|
}
|
485
488
|
},
|
486
|
-
pageSettingPopUpRoot: {
|
487
|
-
padding: "16px 8px 16px 10px!important",
|
488
|
-
height: "100%"
|
489
|
-
},
|
490
489
|
buttonMoreOption2: {
|
491
490
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
492
491
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
493
|
-
|
494
|
-
|
492
|
+
'& svg': {
|
493
|
+
'& path': {
|
495
494
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
496
495
|
}
|
497
496
|
}
|
@@ -499,11 +498,11 @@ const useCommonStyle = theme => ({
|
|
499
498
|
buttonMoreOption3: {
|
500
499
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
501
500
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
502
|
-
padding:
|
503
|
-
|
504
|
-
width:
|
505
|
-
height:
|
506
|
-
|
501
|
+
padding: '5px !important',
|
502
|
+
'& svg': {
|
503
|
+
width: '16px !important',
|
504
|
+
height: '16px !important',
|
505
|
+
'& path': {
|
507
506
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
508
507
|
}
|
509
508
|
}
|
@@ -511,37 +510,37 @@ const useCommonStyle = theme => ({
|
|
511
510
|
resizeButton: {
|
512
511
|
background: theme?.palette?.editor?.aiInputBackground,
|
513
512
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1}`,
|
514
|
-
padding:
|
515
|
-
borderRadius:
|
516
|
-
|
517
|
-
width:
|
518
|
-
height:
|
519
|
-
|
513
|
+
padding: '5px !important',
|
514
|
+
borderRadius: '50% !important',
|
515
|
+
'& svg': {
|
516
|
+
width: '18px',
|
517
|
+
height: '18px',
|
518
|
+
'& path': {
|
520
519
|
fill: `${theme?.palette?.editor?.closeButtonSvgStroke}`
|
521
520
|
}
|
522
521
|
},
|
523
|
-
|
522
|
+
'&:hover': {
|
524
523
|
background: theme?.palette?.editor?.aiInputBackground
|
525
524
|
}
|
526
525
|
},
|
527
526
|
gradientFillBtn: {
|
528
527
|
background: `linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important`,
|
529
|
-
textTransform:
|
530
|
-
color:
|
531
|
-
padding:
|
532
|
-
height:
|
533
|
-
borderRadius:
|
534
|
-
fontWeight:
|
535
|
-
fontSize:
|
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'
|
536
535
|
},
|
537
536
|
emptyThumbBtn: {
|
538
537
|
background: `${theme?.palette?.editor?.sectionSettingIconHover} !important`,
|
539
538
|
color: `${theme?.palette?.editor?.textColor} !important`,
|
540
|
-
fontSize:
|
541
|
-
|
542
|
-
width:
|
543
|
-
height:
|
544
|
-
|
539
|
+
fontSize: '14px !important',
|
540
|
+
'& svg': {
|
541
|
+
width: '20px !important',
|
542
|
+
height: '20px !important',
|
543
|
+
'& path': {
|
545
544
|
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
546
545
|
}
|
547
546
|
}
|
@@ -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,27 +161,4 @@ export const groupByBreakpoint = (styleProps, theme) => {
|
|
161
161
|
}
|
162
162
|
};
|
163
163
|
};
|
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
|
-
};
|
164
|
+
export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
|
@@ -35,7 +35,6 @@ export const EditorProvider = ({
|
|
35
35
|
path: null
|
36
36
|
});
|
37
37
|
const [fontFamilies, setFontFamilies] = useState({});
|
38
|
-
const [activeBreakPoint, setActiveBreakPoint] = useState("");
|
39
38
|
useEffect(() => {
|
40
39
|
window.updateSelectedItem = d => {
|
41
40
|
setSelectedElement(d);
|
@@ -98,10 +97,8 @@ export const EditorProvider = ({
|
|
98
97
|
setOpenAI,
|
99
98
|
updateDragging,
|
100
99
|
fontFamilies,
|
101
|
-
setFontFamilies
|
102
|
-
|
103
|
-
setActiveBreakPoint
|
104
|
-
}), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, activeBreakPoint]);
|
100
|
+
setFontFamilies
|
101
|
+
}), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop]);
|
105
102
|
return /*#__PURE__*/_jsx(EditorContext.Provider, {
|
106
103
|
value: otherValues,
|
107
104
|
children: children
|
@@ -173,9 +173,10 @@ export const getMarked = (leaf, children, theme) => {
|
|
173
173
|
if (leaf.highlight) {
|
174
174
|
children = /*#__PURE__*/_jsx("span", {
|
175
175
|
style: {
|
176
|
-
color: "inherit"
|
177
|
-
background: "var(--slate-highlight-bg)"
|
176
|
+
color: "inherit"
|
178
177
|
},
|
178
|
+
className: "slate-highlight" // while opening AI, we will use this element to highlight the selection. (PopoverAIInput.js)
|
179
|
+
,
|
179
180
|
children: children
|
180
181
|
});
|
181
182
|
}
|
@@ -337,8 +338,7 @@ export const getBlock = props => {
|
|
337
338
|
borderRadius: `${element?.color ? "0px" : "12px"} 12px 12px ${element?.color ? "0px" : "12px"}`,
|
338
339
|
margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
|
339
340
|
width: element?.bgColor ? "calc(100% - 16px)" : "100%",
|
340
|
-
borderWidth: element?.color ? "0px 0px 0px 3px" : "0px"
|
341
|
-
lineHeight: 1.43
|
341
|
+
borderWidth: element?.color ? "0px 0px 0px 3px" : "0px"
|
342
342
|
},
|
343
343
|
children: children
|
344
344
|
});
|
@@ -398,9 +398,6 @@ export const getBlock = props => {
|
|
398
398
|
});
|
399
399
|
case "orderedList":
|
400
400
|
return /*#__PURE__*/_jsx("ol", {
|
401
|
-
style: {
|
402
|
-
lineHeight: 1.43
|
403
|
-
},
|
404
401
|
className: "listItemMargin",
|
405
402
|
type: "1",
|
406
403
|
...attributes,
|
@@ -408,9 +405,6 @@ export const getBlock = props => {
|
|
408
405
|
});
|
409
406
|
case "unorderedList":
|
410
407
|
return /*#__PURE__*/_jsx("ul", {
|
411
|
-
style: {
|
412
|
-
lineHeight: 1.43
|
413
|
-
},
|
414
408
|
className: "listItemMargin",
|
415
409
|
...attributes,
|
416
410
|
children: children
|
@@ -43,8 +43,7 @@ const useTableResize = ({
|
|
43
43
|
minWidth
|
44
44
|
} = minMaxProps || {};
|
45
45
|
setSize(currentSize => {
|
46
|
-
const
|
47
|
-
const calcWidth = width + e.movementX;
|
46
|
+
const calcWidth = currentSize?.width + e.movementX;
|
48
47
|
return {
|
49
48
|
width: minWidth && calcWidth < minWidth ? minWidth : calcWidth,
|
50
49
|
height: currentSize.height + e.movementY,
|
@@ -82,8 +82,7 @@ const splitInlineStyleRanges = (text, inlineStyleRanges, data) => {
|
|
82
82
|
};
|
83
83
|
export const draftToSlate = props => {
|
84
84
|
const {
|
85
|
-
data
|
86
|
-
needLayout
|
85
|
+
data
|
87
86
|
} = props;
|
88
87
|
if (data?.blocks && data?.blocks?.length > 0) {
|
89
88
|
const converted = data?.blocks?.reduce((a, b) => {
|
@@ -105,7 +104,7 @@ export const draftToSlate = props => {
|
|
105
104
|
return data;
|
106
105
|
} else {
|
107
106
|
return [{
|
108
|
-
type:
|
107
|
+
type: "paragraph",
|
109
108
|
children: [{
|
110
109
|
text: ""
|
111
110
|
}]
|