@flozy/editor 9.0.7 → 9.1.0
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/ChatEditor.js +2 -2
- package/dist/Editor/CommonEditor.js +11 -41
- package/dist/Editor/Editor.css +1 -15
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -0
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Link/Link.js +43 -70
- package/dist/Editor/Elements/SimpleText/index.js +1 -0
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +3 -7
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +6 -3
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +14 -38
- package/dist/Editor/common/DnD/Draggable.js +1 -0
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -0
- package/dist/Editor/common/LinkSettings/index.js +2 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +3 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
- package/dist/Editor/commonStyle.js +4 -59
- package/dist/Editor/plugins/withHTML.js +1 -1
- package/dist/Editor/utils/helper.js +1 -13
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +2 -5
- package/dist/Editor/common/CustomDialog/index.js +0 -90
- package/dist/Editor/common/CustomDialog/styles.js +0 -80
@@ -1,7 +1,7 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import { Node, Transforms } from "slate";
|
3
|
-
import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
|
4
|
-
import { Box, IconButton,
|
3
|
+
import { ReactEditor, useFocused, useSelected, useSlateStatic } from "slate-react";
|
4
|
+
import { Box, IconButton, Tooltip } from "@mui/material";
|
5
5
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
6
6
|
import EditIcon from "@mui/icons-material/Edit";
|
7
7
|
import LinkOffIcon from "@mui/icons-material/LinkOff";
|
@@ -11,62 +11,6 @@ import { getLinkType, handleLinkType } from "../../utils/helper";
|
|
11
11
|
import LinkSettings from "../../common/LinkSettings";
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
-
const Toolbar = props => {
|
15
|
-
const {
|
16
|
-
urlPath,
|
17
|
-
linkType,
|
18
|
-
showInNewTab,
|
19
|
-
selected,
|
20
|
-
linkRef,
|
21
|
-
onEditLink,
|
22
|
-
editor
|
23
|
-
} = props;
|
24
|
-
const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
|
25
|
-
const navType = getLinkType(linkType, urlPath);
|
26
|
-
const hideOpenLink = navType === "page" || !navType;
|
27
|
-
return selected ? /*#__PURE__*/_jsx(Popper, {
|
28
|
-
anchorEl: linkRef?.current,
|
29
|
-
open: true,
|
30
|
-
placement: "top-start",
|
31
|
-
className: "hide-popper-on-overlap",
|
32
|
-
contentEditable: false,
|
33
|
-
style: {
|
34
|
-
zIndex: 1000
|
35
|
-
},
|
36
|
-
children: /*#__PURE__*/_jsxs(Box, {
|
37
|
-
className: "element-toolbar hr",
|
38
|
-
style: {
|
39
|
-
width: "150px",
|
40
|
-
display: "flex",
|
41
|
-
position: "unset"
|
42
|
-
},
|
43
|
-
component: "div",
|
44
|
-
children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
|
45
|
-
title: "Open",
|
46
|
-
children: /*#__PURE__*/_jsx(Box, {
|
47
|
-
sx: {
|
48
|
-
display: "inline-flex",
|
49
|
-
color: "rgba(0, 0, 0, 0.54)"
|
50
|
-
},
|
51
|
-
...btnProps,
|
52
|
-
children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
|
53
|
-
})
|
54
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
55
|
-
title: "Edit",
|
56
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
57
|
-
onClick: onEditLink,
|
58
|
-
children: /*#__PURE__*/_jsx(EditIcon, {})
|
59
|
-
})
|
60
|
-
}), /*#__PURE__*/_jsx(Tooltip, {
|
61
|
-
title: "Remove",
|
62
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
63
|
-
onClick: () => removeLink(editor),
|
64
|
-
children: /*#__PURE__*/_jsx(LinkOffIcon, {})
|
65
|
-
})
|
66
|
-
})]
|
67
|
-
})
|
68
|
-
}) : null;
|
69
|
-
};
|
70
14
|
const linkStyles = () => ({
|
71
15
|
linkBtn: {
|
72
16
|
border: "none",
|
@@ -96,6 +40,7 @@ const Link = props => {
|
|
96
40
|
} = customProps;
|
97
41
|
const editor = useSlateStatic();
|
98
42
|
const selected = useSelected();
|
43
|
+
const focused = useFocused();
|
99
44
|
const [showInput, setShowInput] = useState(false);
|
100
45
|
const [linkData, setLinkData] = useState({
|
101
46
|
name: "",
|
@@ -108,7 +53,6 @@ const Link = props => {
|
|
108
53
|
const showInNewTab = element?.showInNewTab || element?.target;
|
109
54
|
const linkType = element?.linkType;
|
110
55
|
const classes = linkStyles();
|
111
|
-
const linkRef = useRef(null);
|
112
56
|
const updateLink = data => {
|
113
57
|
Transforms.setNodes(editor, data, {
|
114
58
|
at: path
|
@@ -133,25 +77,54 @@ const Link = props => {
|
|
133
77
|
const handleClose = () => {
|
134
78
|
setShowInput(false);
|
135
79
|
};
|
80
|
+
const Toolbar = () => {
|
81
|
+
const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
|
82
|
+
const navType = getLinkType(linkType, urlPath);
|
83
|
+
const hideOpenLink = navType === "page" || !navType;
|
84
|
+
return selected && focused ? /*#__PURE__*/_jsxs("div", {
|
85
|
+
className: "element-toolbar hr",
|
86
|
+
contentEditable: false,
|
87
|
+
style: {
|
88
|
+
width: "150px",
|
89
|
+
top: "100%",
|
90
|
+
left: "0px",
|
91
|
+
display: "flex"
|
92
|
+
},
|
93
|
+
children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
|
94
|
+
title: "Open",
|
95
|
+
children: /*#__PURE__*/_jsx(Box, {
|
96
|
+
sx: {
|
97
|
+
display: "inline-flex",
|
98
|
+
color: "rgba(0, 0, 0, 0.54)"
|
99
|
+
},
|
100
|
+
...btnProps,
|
101
|
+
children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
|
102
|
+
})
|
103
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
104
|
+
title: "Edit",
|
105
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
106
|
+
onClick: onEditLink,
|
107
|
+
children: /*#__PURE__*/_jsx(EditIcon, {})
|
108
|
+
})
|
109
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
110
|
+
title: "Remove",
|
111
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
112
|
+
onClick: () => removeLink(editor),
|
113
|
+
children: /*#__PURE__*/_jsx(LinkOffIcon, {})
|
114
|
+
})
|
115
|
+
})]
|
116
|
+
}) : null;
|
117
|
+
};
|
136
118
|
const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
|
137
119
|
return /*#__PURE__*/_jsxs("div", {
|
138
120
|
className: "link",
|
139
|
-
ref: linkRef,
|
140
121
|
children: [/*#__PURE__*/_jsx(Box, {
|
141
122
|
...attributes,
|
142
123
|
...element.attr,
|
143
124
|
sx: classes.linkBtn,
|
144
125
|
...buttonProps,
|
145
126
|
children: children
|
146
|
-
}), /*#__PURE__*/_jsx(Toolbar, {
|
147
|
-
urlPath: urlPath,
|
148
|
-
linkType: linkType,
|
149
|
-
showInNewTab: showInNewTab,
|
150
|
-
selected: selected,
|
151
|
-
linkRef: linkRef,
|
152
|
-
onEditLink: onEditLink,
|
153
|
-
editor: editor
|
154
|
-
}), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
|
127
|
+
}), /*#__PURE__*/_jsx(Toolbar, {}), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
|
155
128
|
handleClose: handleClose,
|
156
129
|
onSave: ({
|
157
130
|
linkType,
|
@@ -5,6 +5,7 @@ import { Box } from "@mui/material";
|
|
5
5
|
import { isTextSelected } from "../../utils/helper";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
8
|
+
import { getBreakpointLineSpacing } from "../../helper/theme";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
10
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const VariableStyles =
|
1
|
+
const VariableStyles = () => ({
|
2
2
|
variablesItem: {
|
3
3
|
color: "#2563EB",
|
4
4
|
background: "#EEEEEE"
|
@@ -37,34 +37,8 @@ const VariableStyles = theme => ({
|
|
37
37
|
"& .MuiMenuItem-root": {
|
38
38
|
color: "#64748B"
|
39
39
|
},
|
40
|
-
"& .MuiPaper-root": {
|
41
|
-
borderRadius: '8px',
|
42
|
-
backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
|
43
|
-
marginTop: '5px',
|
44
|
-
"@media only screen and (max-width: 599px)": {
|
45
|
-
padding: '10px 0px'
|
46
|
-
}
|
47
|
-
},
|
48
|
-
"& .MuiList-root": {
|
49
|
-
padding: '0px'
|
50
|
-
},
|
51
|
-
"& .MuiButtonBase-root": {
|
52
|
-
margin: '6px',
|
53
|
-
borderRadius: '8px',
|
54
|
-
padding: '6px 14px',
|
55
|
-
fontSize: '14px',
|
56
|
-
fontWeight: '400',
|
57
|
-
color: theme?.palette?.editor?.deletePopUpButtonTextColor,
|
58
|
-
"&:hover": {
|
59
|
-
background: `${theme?.palette?.editor?.menuOptionHoverBackground} !important`
|
60
|
-
},
|
61
|
-
"@media only screen and (max-width: 599px)": {
|
62
|
-
minHeight: '30px',
|
63
|
-
margin: '0px 6px'
|
64
|
-
}
|
65
|
-
},
|
66
40
|
"& .Mui-selected": {
|
67
|
-
backgroundColor:
|
41
|
+
backgroundColor: "rgba(0, 0, 0, 0.04) !important"
|
68
42
|
}
|
69
43
|
}
|
70
44
|
});
|
@@ -3,15 +3,11 @@ import { useSlateStatic } from "slate-react";
|
|
3
3
|
import { MenuItem, Select } from "@mui/material";
|
4
4
|
import { insertVariables } from "../../utils/variables";
|
5
5
|
import VariableStyles from "./Style";
|
6
|
-
import
|
7
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
6
|
+
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
9
|
const VariableButton = props => {
|
11
|
-
const
|
12
|
-
theme
|
13
|
-
} = useEditorContext();
|
14
|
-
const classes = VariableStyles(theme);
|
10
|
+
const classes = VariableStyles();
|
15
11
|
const editor = useSlateStatic();
|
16
12
|
const {
|
17
13
|
options
|
@@ -28,7 +24,7 @@ const VariableButton = props => {
|
|
28
24
|
value: "",
|
29
25
|
sx: classes.variableBtn,
|
30
26
|
onChange: updateVariable,
|
31
|
-
IconComponent: () => /*#__PURE__*/_jsx(
|
27
|
+
IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
|
32
28
|
MenuProps: {
|
33
29
|
sx: classes.variableMenuItem,
|
34
30
|
PaperProps: {
|
@@ -2,6 +2,8 @@ import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
import { TextField, IconButton } from "@mui/material";
|
3
3
|
import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
|
4
4
|
import { headingMap, sizeMap } from "../../utils/font.js";
|
5
|
+
import ExpandLessRoundedIcon from "@mui/icons-material/ExpandLessRounded";
|
6
|
+
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
|
5
7
|
import { getBreakPointsValue } from "../../helper/theme.js";
|
6
8
|
import useWindowResize from "../../hooks/useWindowResize.js";
|
7
9
|
import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
|
@@ -3,18 +3,17 @@ import { Grid, Tabs, Tab, CircularProgress } from "@mui/material";
|
|
3
3
|
import TemplateCard from "./TemplateCard";
|
4
4
|
import FullViewCard from "./FullViewCard";
|
5
5
|
import ButtonTemplateCard from "./ButtonTemplatesCard";
|
6
|
-
|
7
|
-
// const CATEGORIES_SORT_INDEX = {
|
8
|
-
// Brief: 1,
|
9
|
-
// Buttons: 2,
|
10
|
-
// Banners: 3,
|
11
|
-
// Tables: 4,
|
12
|
-
// Contract: 5,
|
13
|
-
// Proposal: 6,
|
14
|
-
// };
|
15
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
7
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
17
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
+
const CATEGORIES_SORT_INDEX = {
|
10
|
+
Brief: 1,
|
11
|
+
Buttons: 2,
|
12
|
+
Banners: 3,
|
13
|
+
Tables: 4,
|
14
|
+
Contract: 5,
|
15
|
+
Proposal: 6
|
16
|
+
};
|
18
17
|
const Categories = props => {
|
19
18
|
const {
|
20
19
|
value,
|
@@ -424,9 +424,12 @@ const usePopupStyle = theme => ({
|
|
424
424
|
fontFamilyListOptions: {
|
425
425
|
"& .MuiAutocomplete-listbox": {
|
426
426
|
padding: "0px",
|
427
|
-
|
428
|
-
|
429
|
-
|
427
|
+
"&::-webkit-scrollbar-thumb": {
|
428
|
+
background: `none !important`
|
429
|
+
},
|
430
|
+
"&::-webkit-scrollbar-track": {
|
431
|
+
visibility: "hidden"
|
432
|
+
},
|
430
433
|
"&::-webkit-scrollbar-thumb": {
|
431
434
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
432
435
|
},
|
@@ -14,7 +14,7 @@ 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";
|
17
|
+
// import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
18
|
import { getPageSettings } from "../../utils/pageSettings";
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
20
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -36,7 +36,7 @@ const TextFormat = props => {
|
|
36
36
|
const {
|
37
37
|
element: pageSt
|
38
38
|
} = getPageSettings(editor) || {};
|
39
|
-
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
39
|
+
// const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
40
40
|
const {
|
41
41
|
fontFamilies,
|
42
42
|
theme
|
@@ -44,7 +44,7 @@ const TextFormat = props => {
|
|
44
44
|
const {
|
45
45
|
activeBreakPoint
|
46
46
|
} = useEditorContext();
|
47
|
-
const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
47
|
+
// const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
48
48
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
49
49
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
50
50
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
@@ -61,8 +61,12 @@ const TextFormat = props => {
|
|
61
61
|
color: "",
|
62
62
|
bgColor: ""
|
63
63
|
};
|
64
|
-
|
65
|
-
|
64
|
+
|
65
|
+
// let lineSpacingValue = activeMark(editor, "lineHeight");
|
66
|
+
// lineSpacingValue =
|
67
|
+
// lineSpacingValue?.[breakpoint] !== undefined
|
68
|
+
// ? lineSpacingValue
|
69
|
+
// : pageSettingLine;
|
66
70
|
const handleColorPicker = type => e => {
|
67
71
|
setType(type);
|
68
72
|
setAnchorEl(e.currentTarget);
|
@@ -103,13 +107,11 @@ const TextFormat = props => {
|
|
103
107
|
value
|
104
108
|
});
|
105
109
|
};
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
});
|
112
|
-
};
|
110
|
+
|
111
|
+
// const handleLineSpacing = (data) => {
|
112
|
+
// const [[format, value]] = Object.entries(data);
|
113
|
+
// addMarkData(editor, { format, value });
|
114
|
+
// };
|
113
115
|
return /*#__PURE__*/_jsxs(Grid, {
|
114
116
|
container: true,
|
115
117
|
sx: classes.textFormatWrapper,
|
@@ -379,32 +381,6 @@ const TextFormat = props => {
|
|
379
381
|
xs: 12,
|
380
382
|
sx: classes.dividerGrid,
|
381
383
|
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, {})
|
408
384
|
}), /*#__PURE__*/_jsx(Grid, {
|
409
385
|
item: true,
|
410
386
|
xs: 12,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useEffect } from "react";
|
2
2
|
import { useDraggable } from "@dnd-kit/core";
|
3
3
|
import { Box } from "@mui/material";
|
4
|
+
import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
|
4
5
|
import { SectionDragIcon } from "../iconListV2";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
7
|
const Draggable = props => {
|
@@ -171,7 +171,8 @@ export default function LinkSettings(props) {
|
|
171
171
|
value: navValue,
|
172
172
|
openInNewTab: openInNewTab,
|
173
173
|
onNewTabChange: () => setOpenInNewTab(prev => !prev),
|
174
|
-
services: customProps.services
|
174
|
+
services: customProps.services,
|
175
|
+
classes: classes
|
175
176
|
})
|
176
177
|
})]
|
177
178
|
})
|
@@ -53,9 +53,9 @@ const usePopupStyles = theme => ({
|
|
53
53
|
"& button": {
|
54
54
|
color: theme?.palette?.editor?.textColor
|
55
55
|
},
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
"@media only screen and (min-width: 899px)": {
|
57
|
+
maxHeight: "400px"
|
58
|
+
},
|
59
59
|
"& .orderedListIcon, .bulletedListTextIcon, .checkedListTextIcon, .accordianIconSvgTextFormat": {
|
60
60
|
width: "20px !important"
|
61
61
|
},
|
@@ -2,11 +2,10 @@ import { Transforms, Node, Path } from "slate";
|
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { handleNegativeInteger } from "../../../utils/helper";
|
4
4
|
export const ROW_HEIGHT = 50;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
// };
|
5
|
+
const MARGIN_OF = {
|
6
|
+
xs: 160,
|
7
|
+
lg: 490
|
8
|
+
};
|
10
9
|
|
11
10
|
/**
|
12
11
|
* This method will update the grid template rows of parent section based on height
|
@@ -25,11 +25,13 @@ const pageSettingsStyle = [{
|
|
25
25
|
label: "Padding",
|
26
26
|
key: "bannerSpacing",
|
27
27
|
type: "bannerSpacing"
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
}
|
29
|
+
// {
|
30
|
+
// label: "Line Spacing",
|
31
|
+
// key: "lineHeight",
|
32
|
+
// type: "lineSpacing",
|
33
|
+
// },
|
34
|
+
]
|
33
35
|
}, {
|
34
36
|
tab: "Max Width",
|
35
37
|
value: "maxWidth",
|
@@ -438,71 +438,16 @@ const useCommonStyle = theme => ({
|
|
438
438
|
width: "100%",
|
439
439
|
"& .react-datepicker__input-container": {
|
440
440
|
"& .MuiInputBase-root": {
|
441
|
-
|
441
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
442
442
|
"& .MuiInputBase-input": {
|
443
|
-
|
444
|
-
color: theme?.palette?.editor?.textColor
|
443
|
+
background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
|
444
|
+
color: `${theme?.palette?.editor?.textColor} !important`
|
445
445
|
},
|
446
446
|
"& .MuiOutlinedInput-notchedOutline": {
|
447
|
-
border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder
|
448
|
-
borderRadius: "10px"
|
449
|
-
},
|
450
|
-
"&:hover .MuiOutlinedInput-notchedOutline": {
|
451
|
-
borderColor: theme?.palette?.primary?.main
|
452
|
-
},
|
453
|
-
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
454
|
-
borderColor: theme?.palette?.primary?.dark
|
447
|
+
border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
|
455
448
|
}
|
456
449
|
}
|
457
450
|
}
|
458
|
-
},
|
459
|
-
"& .react-datepicker": {
|
460
|
-
backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
|
461
|
-
// borderRadius: "10px",
|
462
|
-
border: `1px solid ${theme?.palette?.divider || "#ccc"}`,
|
463
|
-
boxShadow: "2px 4px 8px rgba(0, 0, 0, 0.4)",
|
464
|
-
color: theme?.palette?.editor?.textColor + " !important"
|
465
|
-
},
|
466
|
-
"& .react-datepicker__header": {
|
467
|
-
backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
|
468
|
-
borderBottom: `1px solid ${theme?.palette?.divider || "#ddd"}`,
|
469
|
-
color: theme?.palette?.editor?.textColor + " !important"
|
470
|
-
},
|
471
|
-
"& .react-datepicker__day": {
|
472
|
-
color: theme?.palette?.editor?.textColor,
|
473
|
-
"&:hover": {
|
474
|
-
backgroundColor: theme?.palette?.editor?.menuOptionHoverBackground,
|
475
|
-
color: theme?.palette?.editor?.textColor || "#fff"
|
476
|
-
}
|
477
|
-
},
|
478
|
-
"& .react-datepicker__current-month": {
|
479
|
-
color: theme?.palette?.editor?.textColor
|
480
|
-
},
|
481
|
-
"& .react-datepicker__day-name": {
|
482
|
-
color: theme?.palette?.editor?.textColor
|
483
|
-
},
|
484
|
-
"& .react-datepicker__day--selected": {
|
485
|
-
background: theme?.palette?.editor?.activeColor,
|
486
|
-
color: "#fff",
|
487
|
-
"&:hover": {
|
488
|
-
background: theme?.palette?.editor?.activeColor,
|
489
|
-
color: "#fff"
|
490
|
-
}
|
491
|
-
},
|
492
|
-
"& .react-datepicker__day--keyboard-selected": {
|
493
|
-
backgroundColor: "#bad9f1",
|
494
|
-
color: "#000",
|
495
|
-
"&:hover": {
|
496
|
-
backgroundColor: "#bad9f1",
|
497
|
-
color: "#000"
|
498
|
-
}
|
499
|
-
},
|
500
|
-
"& .react-datepicker__day--today": {
|
501
|
-
fontWeight: "bold",
|
502
|
-
borderBottom: `2px solid ${theme?.palette?.editor?.activeColor}`
|
503
|
-
},
|
504
|
-
"& .react-datepicker__triangle": {
|
505
|
-
display: "none"
|
506
451
|
}
|
507
452
|
},
|
508
453
|
signaturePopUpNameField: {
|
@@ -9,7 +9,7 @@ const parseCopiedHTML = html => {
|
|
9
9
|
const parsed = new DOMParser().parseFromString(html, "text/html");
|
10
10
|
|
11
11
|
// if ol, ul are inside li, remove and push ol,ul after that li to maintain format between our slate list and external source list's json
|
12
|
-
parsed.querySelectorAll("li > ul, li > ol
|
12
|
+
parsed.querySelectorAll("li > ul, li > ol").forEach(list => {
|
13
13
|
// Find the parent li
|
14
14
|
const parentLi = list.parentElement;
|
15
15
|
|
@@ -756,16 +756,4 @@ export const hideSlateSelection = () => {
|
|
756
756
|
};
|
757
757
|
export function handleNegativeInteger(val) {
|
758
758
|
return val < 0 ? 0 : val;
|
759
|
-
}
|
760
|
-
export const isEverythingSelected = editor => {
|
761
|
-
const {
|
762
|
-
selection
|
763
|
-
} = editor;
|
764
|
-
if (selection && Range.isExpanded(selection)) {
|
765
|
-
if (Range.includes(selection, Editor.start(editor, [])) && Range.includes(selection, Editor.end(editor, []))) {
|
766
|
-
return true;
|
767
|
-
} else {
|
768
|
-
return false;
|
769
|
-
}
|
770
|
-
}
|
771
|
-
};
|
759
|
+
}
|
@@ -3,7 +3,7 @@ import { isBlockActive } from "./SlateUtilityFunctions";
|
|
3
3
|
export const createLinkNode = (href, showInNewTab, text, linkType) => ({
|
4
4
|
type: "link",
|
5
5
|
href,
|
6
|
-
target: showInNewTab
|
6
|
+
target: showInNewTab ? "_blank" : "_self",
|
7
7
|
linkType,
|
8
8
|
children: [{
|
9
9
|
text
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flozy/editor",
|
3
|
-
"version": "9.0
|
3
|
+
"version": "9.1.0",
|
4
4
|
"description": "An Editor for flozy app brain",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -69,10 +69,7 @@
|
|
69
69
|
"storybook": "storybook dev -p 6006",
|
70
70
|
"build-storybook": "NODE_OPTIONS='--max_old_space_size=4096' storybook build",
|
71
71
|
"publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",
|
72
|
-
"publish:local": "rm -rf /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist --copy-files"
|
73
|
-
"publish:flozy": "./publish-flozy.sh",
|
74
|
-
"publish:flozy2": "./publish-flozy2.sh",
|
75
|
-
"publish:permission": "chmod +x publish-flozy.sh && chmod +x publish-flozy2.sh"
|
72
|
+
"publish:local": "rm -rf /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agmac03/flozy/client/node_modules/@flozy/editor/dist --copy-files"
|
76
73
|
},
|
77
74
|
"eslintConfig": {
|
78
75
|
"extends": [
|