@flozy/editor 9.2.0 → 9.2.1

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 (44) hide show
  1. package/dist/Editor/ChatEditor.js +2 -2
  2. package/dist/Editor/CommonEditor.js +11 -41
  3. package/dist/Editor/Editor.css +3 -17
  4. package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -0
  5. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
  8. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
  9. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
  10. package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
  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 +2 -1
  15. package/dist/Editor/Elements/Link/Link.js +43 -70
  16. package/dist/Editor/Elements/SimpleText/index.js +1 -0
  17. package/dist/Editor/Elements/Table/TableCell.js +2 -1
  18. package/dist/Editor/Elements/Variables/Style.js +2 -28
  19. package/dist/Editor/Elements/Variables/VariableButton.js +3 -7
  20. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
  21. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
  22. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +6 -3
  23. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +3 -6
  24. package/dist/Editor/Toolbar/PopupTool/index.js +16 -4
  25. package/dist/Editor/common/DnD/Draggable.js +1 -0
  26. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
  27. package/dist/Editor/common/ImageSelector/UploadStyles.js +10 -9
  28. package/dist/Editor/common/MentionsPopup/Styles.js +3 -3
  29. package/dist/Editor/common/RnD/ElementSettings/styles.js +1 -0
  30. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -15
  31. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  32. package/dist/Editor/common/RnD/VirtualElement/index.js +2 -1
  33. package/dist/Editor/commonStyle.js +4 -59
  34. package/dist/Editor/helper/index.js +14 -10
  35. package/dist/Editor/hooks/useDrag.js +11 -17
  36. package/dist/Editor/hooks/useEditorScroll.js +6 -10
  37. package/dist/Editor/hooks/useMouseMove.js +10 -16
  38. package/dist/Editor/hooks/useTable.js +1 -1
  39. package/dist/Editor/plugins/withHTML.js +3 -2
  40. package/dist/Editor/utils/helper.js +1 -13
  41. package/dist/Editor/utils/link.js +1 -1
  42. package/package.json +3 -6
  43. package/dist/Editor/common/CustomDialog/index.js +0 -90
  44. package/dist/Editor/common/CustomDialog/styles.js +0 -80
@@ -50,7 +50,8 @@ const GridItemToolbar = props => {
50
50
  open: true,
51
51
  placement: "top-end",
52
52
  sx: classes.popTools,
53
- className: "gi-tool-pp hide-popper-on-overlap",
53
+ className: "gi-tool-pp",
54
+ disablePortal: true,
54
55
  contentEditable: false,
55
56
  children: /*#__PURE__*/_jsxs(Box, {
56
57
  className: "ico-grp-ss",
@@ -1,7 +1,7 @@
1
- import React, { useRef, useState } from "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, Popper, Tooltip } from "@mui/material";
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";
@@ -155,7 +155,7 @@ const TableCell = props => {
155
155
  };
156
156
  useEffect(() => {
157
157
  const currentPath = path?.toString();
158
- setTimeout(() => {
158
+ const timeoutId = setTimeout(() => {
159
159
  if (tableResizing === currentPath) {
160
160
  setTableResizing(null);
161
161
 
@@ -171,6 +171,7 @@ const TableCell = props => {
171
171
  if (resizing) {
172
172
  setTableResizing(currentPath);
173
173
  }
174
+ return () => clearTimeout(timeoutId);
174
175
  }, [resizing]);
175
176
  const onMouseEnter = path => {
176
177
  setHoverPath(path);
@@ -1,4 +1,4 @@
1
- const VariableStyles = theme => ({
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: 'unset !important'
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 KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
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(KeyboardArrowDownRoundedIcon, {}),
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
- // "&::-webkit-scrollbar-thumb": {
428
- // background: `none !important`,
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
  },
@@ -33,17 +33,14 @@ const TextFormat = props => {
33
33
  const [anchorEl, setAnchorEl] = useState(null);
34
34
  const [type, setType] = useState(null);
35
35
  const open = Boolean(anchorEl);
36
- const {
37
- element: pageSt
38
- } = getPageSettings(editor) || {};
36
+
37
+ // const { element: pageSt } = getPageSettings(editor) || {};
39
38
  // const pageSettingLine = pageSt?.pageProps?.lineHeight;
40
39
  const {
41
40
  fontFamilies,
42
41
  theme
43
42
  } = useEditorContext();
44
- const {
45
- activeBreakPoint
46
- } = useEditorContext();
43
+ // const { activeBreakPoint } = useEditorContext();
47
44
  // const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
48
45
  const fontWeight = allTools.find(f => f.format === "fontWeight");
49
46
  const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
@@ -14,7 +14,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const PopupTool = props => {
15
15
  const {
16
16
  theme,
17
- setIsTextSelected,
18
17
  customProps,
19
18
  editorWrapper
20
19
  } = props;
@@ -35,6 +34,9 @@ const PopupTool = props => {
35
34
  const [size] = useWindowResize();
36
35
  const updateAnchorEl = isScroll => {
37
36
  try {
37
+ const {
38
+ selection
39
+ } = editor;
38
40
  const isHavingSelection = selection && !Range.isCollapsed(selection);
39
41
  if (isHavingSelection && event === "end") {
40
42
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
@@ -74,29 +76,39 @@ const PopupTool = props => {
74
76
  if (!isCarouselEdit) {
75
77
  setOpen(true);
76
78
  setPopupType("textFormat");
77
- setIsTextSelected(true);
79
+ // setIsTextSelected(true);
78
80
  }
79
81
  } else if (!anchorEl) {
80
82
  setOpen(false);
81
83
  setPopupType("");
82
- setIsTextSelected(false);
84
+ // setIsTextSelected(false);
83
85
  }
84
86
  }, [event, anchorEl]);
85
87
  useEffect(() => {
86
- if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || selectedElement?.enable === 1) {
88
+ console.log("Editor useEffect", selection);
89
+ const {
90
+ path,
91
+ enable
92
+ } = selectedElement || {};
93
+ const isFreeGridElement = path && path.split("|").length > 2;
94
+ const isFreeGridEnabled = enable === 1 && isFreeGridElement;
95
+ if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || isFreeGridEnabled) {
87
96
  setAnchorEl(null);
88
97
  } else {
98
+ console.log("Editor updateAnchorEl", selection);
89
99
  updateAnchorEl();
90
100
  hideSlateSelection(); // removes slate selection background, when there is no selection
91
101
  }
92
102
  }, [selection, event, selectedElement?.enable]);
93
103
  const handleClose = () => {
104
+ console.log("Editor closing");
94
105
  // setAnchorEl(null);
95
106
  setOpen(false);
96
107
  setPopupType("");
97
108
  };
98
109
  return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
99
110
  onClickAway: e => {
111
+ console.log("ClickAwayListener", e.target, document.body, e.target !== document.body);
100
112
  // close the mini toolbar, if user clicks outside the editor (in Flozy app.)
101
113
  if (e.target !== document.body) {
102
114
  // e.target returns body, if the user clicks material ui select popup inside the tool bar, on that time, we don't need to close
@@ -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 => {
@@ -19,7 +19,7 @@ const Upload = props => {
19
19
  xs: 12,
20
20
  sx: {
21
21
  padding: "10px",
22
- height: '100%'
22
+ height: "100%"
23
23
  },
24
24
  className: "ims-right",
25
25
  children: /*#__PURE__*/_jsx(Uploader, {
@@ -5,8 +5,9 @@ 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
- minHeight: '150px',
9
- height: 'inherit'
8
+ height: "100%",
9
+ minHeight: "150px",
10
+ height: "inherit"
10
11
  },
11
12
  uploadField: {
12
13
  width: "100%",
@@ -18,21 +19,21 @@ const UploadStyles = theme => ({
18
19
  backgroundColor: theme?.palette?.editor?.uploadFileInnerBg,
19
20
  borderRadius: "9px",
20
21
  border: "1px dashed #2563EB",
21
- minHeight: '150px'
22
+ minHeight: "150px"
22
23
  },
23
24
  uploadIcon: {
24
25
  display: "grid !important",
25
26
  "& svg": {
26
- display: 'flex',
27
- width: '100%',
27
+ display: "flex",
28
+ width: "100%",
28
29
  "& path": {
29
30
  stroke: "#2563EB"
30
31
  }
31
32
  },
32
- '& span': {
33
- display: 'flex',
34
- width: '100%',
35
- marginTop: '5px'
33
+ "& span": {
34
+ display: "flex",
35
+ width: "100%",
36
+ marginTop: "5px"
36
37
  }
37
38
  }
38
39
  });
@@ -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
  },
@@ -58,6 +58,7 @@ const useElementSettingsStyle = theme => ({
58
58
  maxHeight: "500px",
59
59
  overflowX: "hidden",
60
60
  overflowY: "auto",
61
+ paddingLeft: "4px",
61
62
  background: theme?.palette?.editor?.background,
62
63
  paddingLeft: "4px",
63
64
  "& .MuiTypography-root, .MuiInputBase-root, input": {
@@ -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: isPdf() ? {
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 viewportTheme = extendedTheme(theme);
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
- // const MARGIN_OF = {
7
- // xs: 160,
8
- // lg: 490,
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
@@ -75,12 +75,13 @@ const VirtualElement = props => {
75
75
  const virtualRef = useRef();
76
76
  useEffect(() => {
77
77
  if (virtualRef?.current) {
78
- setTimeout(() => {
78
+ const timeoutId = setTimeout(() => {
79
79
  const allData = calculateProps(path, virtualRef?.current, ROOT_ITEM_CLASS, []);
80
80
  const groupData = groupByPathAndCalculateHeight(allData);
81
81
  // it should trigger by auto alignment or on clicking mobile view change
82
82
  updateAutoProps(editor, allData, "xs", groupData);
83
83
  }, 100);
84
+ return () => clearTimeout(timeoutId);
84
85
  }
85
86
  }, [updated_at, virtualRef?.current]);
86
87
  const calculateProps = (curPath, dom, domClass, allData) => {
@@ -438,71 +438,16 @@ const useCommonStyle = theme => ({
438
438
  width: "100%",
439
439
  "& .react-datepicker__input-container": {
440
440
  "& .MuiInputBase-root": {
441
- backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
441
+ background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
442
442
  "& .MuiInputBase-input": {
443
- backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
444
- color: theme?.palette?.editor?.textColor + " !important"
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 || 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
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: {