@flozy/editor 9.1.9 → 9.2.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.
Files changed (32) hide show
  1. package/dist/Editor/ChatEditor.js +2 -2
  2. package/dist/Editor/CommonEditor.js +41 -11
  3. package/dist/Editor/Editor.css +15 -1
  4. package/dist/Editor/Elements/Color Picker/ColorPicker.js +0 -1
  5. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
  8. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
  9. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
  10. package/dist/Editor/Elements/DataView/Layouts/TableView.js +126 -29
  11. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
  12. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  13. package/dist/Editor/Elements/DataView/styles.js +8 -8
  14. package/dist/Editor/Elements/Grid/GridItem.js +1 -2
  15. package/dist/Editor/Elements/Link/Link.js +70 -43
  16. package/dist/Editor/Elements/SimpleText/index.js +0 -1
  17. package/dist/Editor/Elements/Variables/Style.js +28 -2
  18. package/dist/Editor/Elements/Variables/VariableButton.js +7 -3
  19. package/dist/Editor/Toolbar/FormatTools/TextSize.js +0 -2
  20. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
  21. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +3 -6
  22. package/dist/Editor/common/CustomDialog/index.js +90 -0
  23. package/dist/Editor/common/CustomDialog/styles.js +80 -0
  24. package/dist/Editor/common/DnD/Draggable.js +0 -1
  25. package/dist/Editor/common/ImageSelector/UploadStyles.js +0 -1
  26. package/dist/Editor/common/MentionsPopup/Styles.js +3 -3
  27. package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -4
  28. package/dist/Editor/commonStyle.js +59 -4
  29. package/dist/Editor/plugins/withHTML.js +1 -1
  30. package/dist/Editor/utils/helper.js +13 -1
  31. package/dist/Editor/utils/link.js +1 -1
  32. package/package.json +5 -2
@@ -1,7 +1,7 @@
1
- import React, { useState } from "react";
1
+ import React, { useRef, useState } from "react";
2
2
  import { Node, Transforms } from "slate";
3
- import { ReactEditor, useFocused, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Tooltip } from "@mui/material";
3
+ import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
+ import { Box, IconButton, Popper, 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,6 +11,62 @@ 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
+ };
14
70
  const linkStyles = () => ({
15
71
  linkBtn: {
16
72
  border: "none",
@@ -40,7 +96,6 @@ const Link = props => {
40
96
  } = customProps;
41
97
  const editor = useSlateStatic();
42
98
  const selected = useSelected();
43
- const focused = useFocused();
44
99
  const [showInput, setShowInput] = useState(false);
45
100
  const [linkData, setLinkData] = useState({
46
101
  name: "",
@@ -53,6 +108,7 @@ const Link = props => {
53
108
  const showInNewTab = element?.showInNewTab || element?.target;
54
109
  const linkType = element?.linkType;
55
110
  const classes = linkStyles();
111
+ const linkRef = useRef(null);
56
112
  const updateLink = data => {
57
113
  Transforms.setNodes(editor, data, {
58
114
  at: path
@@ -77,54 +133,25 @@ const Link = props => {
77
133
  const handleClose = () => {
78
134
  setShowInput(false);
79
135
  };
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
- };
118
136
  const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
119
137
  return /*#__PURE__*/_jsxs("div", {
120
138
  className: "link",
139
+ ref: linkRef,
121
140
  children: [/*#__PURE__*/_jsx(Box, {
122
141
  ...attributes,
123
142
  ...element.attr,
124
143
  sx: classes.linkBtn,
125
144
  ...buttonProps,
126
145
  children: children
127
- }), /*#__PURE__*/_jsx(Toolbar, {}), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
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, {
128
155
  handleClose: handleClose,
129
156
  onSave: ({
130
157
  linkType,
@@ -5,7 +5,6 @@ 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";
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  import { Fragment as _Fragment } from "react/jsx-runtime";
11
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- const VariableStyles = () => ({
1
+ const VariableStyles = theme => ({
2
2
  variablesItem: {
3
3
  color: "#2563EB",
4
4
  background: "#EEEEEE"
@@ -37,8 +37,34 @@ const VariableStyles = () => ({
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
+ },
40
66
  "& .Mui-selected": {
41
- backgroundColor: "rgba(0, 0, 0, 0.04) !important"
67
+ backgroundColor: 'unset !important'
42
68
  }
43
69
  }
44
70
  });
@@ -3,11 +3,15 @@ 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 KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
6
+ import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
7
+ import { useEditorContext } from "../../hooks/useMouseMove";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const VariableButton = props => {
10
- const classes = VariableStyles();
11
+ const {
12
+ theme
13
+ } = useEditorContext();
14
+ const classes = VariableStyles(theme);
11
15
  const editor = useSlateStatic();
12
16
  const {
13
17
  options
@@ -24,7 +28,7 @@ const VariableButton = props => {
24
28
  value: "",
25
29
  sx: classes.variableBtn,
26
30
  onChange: updateVariable,
27
- IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
31
+ IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {}),
28
32
  MenuProps: {
29
33
  sx: classes.variableMenuItem,
30
34
  PaperProps: {
@@ -2,8 +2,6 @@ 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";
7
5
  import { getBreakPointsValue } from "../../helper/theme.js";
8
6
  import useWindowResize from "../../hooks/useWindowResize.js";
9
7
  import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
@@ -3,17 +3,18 @@ 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
+ // };
6
15
  import { jsx as _jsx } from "react/jsx-runtime";
7
16
  import { Fragment as _Fragment } from "react/jsx-runtime";
8
17
  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
- };
17
18
  const Categories = props => {
18
19
  const {
19
20
  value,
@@ -424,12 +424,9 @@ const usePopupStyle = theme => ({
424
424
  fontFamilyListOptions: {
425
425
  "& .MuiAutocomplete-listbox": {
426
426
  padding: "0px",
427
- "&::-webkit-scrollbar-thumb": {
428
- background: `none !important`
429
- },
430
- "&::-webkit-scrollbar-track": {
431
- visibility: "hidden"
432
- },
427
+ // "&::-webkit-scrollbar-thumb": {
428
+ // background: `none !important`,
429
+ // },
433
430
  "&::-webkit-scrollbar-thumb": {
434
431
  background: `${theme?.palette?.editor?.brainPopupScroll} !important`
435
432
  },
@@ -0,0 +1,90 @@
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 };
@@ -0,0 +1,80 @@
1
+ const CustomDialogStyles = theme => ({
2
+ MuiBackdropRoot: {
3
+ opacity: "1",
4
+ transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"
5
+ },
6
+ CustomDialogu: {
7
+ "& .MuiPaper-root": {
8
+ borderRadius: "12px 12px 0px 0px",
9
+ backgroundColor: `${theme?.palette?.greyshades?.light9} !important`,
10
+ "@media only screen and (min-width: 899px)": {
11
+ maxWidth: "400px",
12
+ border: `1px solid ${theme?.palette?.editor?.customDialogueBorder}`,
13
+ borderRadius: "12px"
14
+ }
15
+ },
16
+ "& .MuiDialogContent-root": {
17
+ padding: "20px 24px 8px 24px",
18
+ "& .MuiTypography-root": {
19
+ textAlign: "center",
20
+ fontFamily: "Inter, sans-serif",
21
+ fontSize: "14px",
22
+ fontWeight: 500,
23
+ color: theme?.palette?.editor?.textColor
24
+ }
25
+ },
26
+ "& .confirmBtn": {
27
+ backgroundColor: "#2563EB",
28
+ padding: "8px 12px",
29
+ color: "#ffffff",
30
+ fontWeight: 600,
31
+ fontSize: "14px",
32
+ opacity: 1,
33
+ borderRadius: "8px",
34
+ textTransform: "math-auto",
35
+ height: "36px",
36
+ padding: "0px 12px",
37
+ minWidth: "90px",
38
+ "&:hover": {
39
+ backgroundColor: "#2563EB"
40
+ },
41
+ "@media only screen and (max-width: 899px)": {
42
+ width: "50%"
43
+ }
44
+ },
45
+ "& .MuiDialogActions-root": {
46
+ justifyContent: "center",
47
+ paddingBottom: "20px"
48
+ },
49
+ "& .closeBtn": {
50
+ padding: "8px 12px",
51
+ color: theme?.palette?.editor?.customDialogueCloseBtnColor,
52
+ fontWeight: 600,
53
+ fontSize: "14px",
54
+ opacity: 1,
55
+ borderRadius: "8px",
56
+ textTransform: "math-auto",
57
+ height: "36px",
58
+ padding: "0px 12px",
59
+ minWidth: "90px",
60
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground,
61
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`,
62
+ "&:hover": {
63
+ backgroundColor: theme?.palette?.editor?.closeButtonBackground
64
+ },
65
+ "@media only screen and (max-width: 899px)": {
66
+ width: "50%"
67
+ }
68
+ },
69
+ "& .pullerRoot": {
70
+ padding: "8px 0"
71
+ },
72
+ "& .pullerGrid": {
73
+ width: "40px",
74
+ height: "5px",
75
+ backgroundColor: "#ccc",
76
+ borderRadius: "10px"
77
+ }
78
+ }
79
+ });
80
+ export default CustomDialogStyles;
@@ -1,7 +1,6 @@
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";
5
4
  import { SectionDragIcon } from "../iconListV2";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  const Draggable = props => {
@@ -5,7 +5,6 @@ const UploadStyles = theme => ({
5
5
  borderRadius: "11px",
6
6
  boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.16)",
7
7
  background: theme?.palette?.editor?.uploadFileBg,
8
- height: '100%',
9
8
  minHeight: '150px',
10
9
  height: 'inherit'
11
10
  },
@@ -53,9 +53,9 @@ const usePopupStyles = theme => ({
53
53
  "& button": {
54
54
  color: theme?.palette?.editor?.textColor
55
55
  },
56
- "@media only screen and (min-width: 899px)": {
57
- maxHeight: "400px"
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,10 +2,11 @@ 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
- const MARGIN_OF = {
6
- xs: 160,
7
- lg: 490
8
- };
5
+
6
+ // const MARGIN_OF = {
7
+ // xs: 160,
8
+ // lg: 490,
9
+ // };
9
10
 
10
11
  /**
11
12
  * This method will update the grid template rows of parent section based on height
@@ -438,16 +438,71 @@ const useCommonStyle = theme => ({
438
438
  width: "100%",
439
439
  "& .react-datepicker__input-container": {
440
440
  "& .MuiInputBase-root": {
441
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
441
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
442
442
  "& .MuiInputBase-input": {
443
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
444
- color: `${theme?.palette?.editor?.textColor} !important`
443
+ backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
444
+ color: theme?.palette?.editor?.textColor + " !important"
445
445
  },
446
446
  "& .MuiOutlinedInput-notchedOutline": {
447
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
447
+ border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder || theme?.palette?.divider} !important`,
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
448
455
  }
449
456
  }
450
457
  }
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"
451
506
  }
452
507
  },
453
508
  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").forEach(list => {
12
+ parsed.querySelectorAll("li > ul, li > ol, li > table").forEach(list => {
13
13
  // Find the parent li
14
14
  const parentLi = list.parentElement;
15
15
 
@@ -764,4 +764,16 @@ export const hideSlateSelection = () => {
764
764
  };
765
765
  export function handleNegativeInteger(val) {
766
766
  return val < 0 ? 0 : val;
767
- }
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
+ };
@@ -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 ? "_blank" : "_self",
6
+ target: showInNewTab === "_blank" ? "_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.1.9",
3
+ "version": "9.2.0",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"
@@ -69,7 +69,10 @@
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"
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"
73
76
  },
74
77
  "eslintConfig": {
75
78
  "extends": [