@flozy/editor 9.2.0 → 9.2.2
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/common/DnD/Draggable.js +1 -0
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -0
- package/dist/Editor/common/MentionsPopup/Styles.js +3 -3
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -15
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -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
|
},
|
@@ -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 => {
|
@@ -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
|
},
|
@@ -1,19 +1,9 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { useTheme, ThemeProvider, createTheme } from "@mui/material";
|
2
|
+
import { useTheme, ThemeProvider, createTheme, useMediaQuery } from "@mui/material";
|
3
3
|
import { isStimulator, STIMULATOR_MOCK } from "../../../hooks/useBreakpoints";
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
const isPdf = () => {
|
6
|
-
try {
|
7
|
-
const hash = window.location.hash;
|
8
|
-
const queryString = hash.split("?")[1]; // Get part after "?"
|
9
|
-
const params = new URLSearchParams(queryString);
|
10
|
-
return params.get("isPdf");
|
11
|
-
} catch (err) {
|
12
|
-
console.log(err);
|
13
|
-
}
|
14
|
-
};
|
15
4
|
|
16
5
|
// Custom breakpoints functions
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
17
7
|
const customUp = (key, breakpoints) => {
|
18
8
|
const MOCK_BREAKPOINT = isStimulator();
|
19
9
|
if (key === "xs") {
|
@@ -59,9 +49,9 @@ const getBreakPoints = prevTheme => {
|
|
59
49
|
};
|
60
50
|
|
61
51
|
// Extend the existing theme with custom breakpoint functions
|
62
|
-
const extendedTheme = prevTheme => createTheme({
|
52
|
+
const extendedTheme = (prevTheme, isPrintMode) => createTheme({
|
63
53
|
...prevTheme,
|
64
|
-
breakpoints:
|
54
|
+
breakpoints: isPrintMode ? {
|
65
55
|
values: {
|
66
56
|
...prevTheme.breakpoints.values,
|
67
57
|
md: 400 // To resolve, while taking pdf on A4 size, it is getting mobile view because of breakpoint
|
@@ -72,7 +62,8 @@ const ViewportStimulator = ({
|
|
72
62
|
children
|
73
63
|
}) => {
|
74
64
|
const theme = useTheme();
|
75
|
-
const
|
65
|
+
const isPrintMode = useMediaQuery("print");
|
66
|
+
const viewportTheme = extendedTheme(theme, isPrintMode);
|
76
67
|
return /*#__PURE__*/_jsx(ThemeProvider, {
|
77
68
|
theme: viewportTheme,
|
78
69
|
children: children
|
@@ -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
|
@@ -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
|
|
@@ -764,16 +764,4 @@ export const hideSlateSelection = () => {
|
|
764
764
|
};
|
765
765
|
export function handleNegativeInteger(val) {
|
766
766
|
return val < 0 ? 0 : val;
|
767
|
-
}
|
768
|
-
export const isEverythingSelected = editor => {
|
769
|
-
const {
|
770
|
-
selection
|
771
|
-
} = editor;
|
772
|
-
if (selection && Range.isExpanded(selection)) {
|
773
|
-
if (Range.includes(selection, Editor.start(editor, [])) && Range.includes(selection, Editor.end(editor, []))) {
|
774
|
-
return true;
|
775
|
-
} else {
|
776
|
-
return false;
|
777
|
-
}
|
778
|
-
}
|
779
|
-
};
|
767
|
+
}
|
@@ -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.2.
|
3
|
+
"version": "9.2.2",
|
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": [
|
@@ -1,90 +0,0 @@
|
|
1
|
-
import { Button, Dialog, DialogActions, DialogContent, Grid, SwipeableDrawer, Typography, useMediaQuery } from "@mui/material";
|
2
|
-
import PropTypes from "prop-types";
|
3
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
-
import CustomDialogStyles from "./styles";
|
5
|
-
import { forwardRef, useImperativeHandle, useState } from "react";
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
|
-
const CustomDialog = (props, ref) => {
|
10
|
-
const {
|
11
|
-
content,
|
12
|
-
confirmText,
|
13
|
-
cancelText,
|
14
|
-
onConfirm
|
15
|
-
} = props;
|
16
|
-
const [open, setOpen] = useState(false);
|
17
|
-
const isMobile = useMediaQuery("(max-width:899px)");
|
18
|
-
const {
|
19
|
-
theme
|
20
|
-
} = useEditorContext();
|
21
|
-
const classes = CustomDialogStyles(theme);
|
22
|
-
useImperativeHandle(ref, () => ({
|
23
|
-
handleOpen: () => setOpen(true),
|
24
|
-
handleClose: () => setOpen(false)
|
25
|
-
}));
|
26
|
-
const DialogueContent = () => /*#__PURE__*/_jsxs(_Fragment, {
|
27
|
-
children: [/*#__PURE__*/_jsx(DialogContent, {
|
28
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
29
|
-
children: content
|
30
|
-
})
|
31
|
-
}), /*#__PURE__*/_jsxs(DialogActions, {
|
32
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
33
|
-
className: "closeBtn",
|
34
|
-
onClick: () => setOpen(false),
|
35
|
-
children: cancelText
|
36
|
-
}), /*#__PURE__*/_jsx(Button, {
|
37
|
-
className: "confirmBtn",
|
38
|
-
onClick: () => {
|
39
|
-
onConfirm();
|
40
|
-
setOpen(false);
|
41
|
-
},
|
42
|
-
children: confirmText
|
43
|
-
})]
|
44
|
-
})]
|
45
|
-
});
|
46
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
47
|
-
children: !isMobile ? /*#__PURE__*/_jsx(Dialog, {
|
48
|
-
className: `${classes.MuiBackdropRoot}`,
|
49
|
-
open: open,
|
50
|
-
onClose: () => setOpen(false),
|
51
|
-
fullWidth: true,
|
52
|
-
maxWidth: "sm",
|
53
|
-
sx: classes.CustomDialogu,
|
54
|
-
children: /*#__PURE__*/_jsx(DialogueContent, {})
|
55
|
-
}) : /*#__PURE__*/_jsxs(SwipeableDrawer, {
|
56
|
-
open: open,
|
57
|
-
anchor: "bottom",
|
58
|
-
onClose: () => setOpen(false),
|
59
|
-
style: {
|
60
|
-
zIndex: "1300"
|
61
|
-
},
|
62
|
-
sx: classes.CustomDialogu,
|
63
|
-
disableBackdropTransition: true,
|
64
|
-
disableSwipeToOpen: true,
|
65
|
-
children: [/*#__PURE__*/_jsx(Grid, {
|
66
|
-
container: true,
|
67
|
-
justifyContent: "center",
|
68
|
-
className: "pullerRoot",
|
69
|
-
children: /*#__PURE__*/_jsx(Grid, {
|
70
|
-
item: true,
|
71
|
-
className: "pullerGrid"
|
72
|
-
})
|
73
|
-
}), /*#__PURE__*/_jsx(DialogueContent, {})]
|
74
|
-
})
|
75
|
-
});
|
76
|
-
};
|
77
|
-
const CustomDialogComponent = /*#__PURE__*/forwardRef(CustomDialog);
|
78
|
-
CustomDialogComponent.defaultProps = {
|
79
|
-
content: "Are you sure you want to proceed?",
|
80
|
-
confirmText: "Confirm",
|
81
|
-
cancelText: "Cancel",
|
82
|
-
onConfirm: () => console.warn("onConfirm not provided")
|
83
|
-
};
|
84
|
-
CustomDialogComponent.propTypes = {
|
85
|
-
content: PropTypes.string,
|
86
|
-
confirmText: PropTypes.string,
|
87
|
-
cancelText: PropTypes.string,
|
88
|
-
onConfirm: PropTypes.func
|
89
|
-
};
|
90
|
-
export { CustomDialogComponent };
|