@flozy/editor 9.1.2 → 9.1.3

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 (128) hide show
  1. package/dist/Editor/ChatEditor.js +19 -2
  2. package/dist/Editor/CommonEditor.js +104 -37
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +21 -3
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  6. package/dist/Editor/Elements/Button/EditorButton.js +25 -9
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +57 -12
  8. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.js +5 -5
  10. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  11. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
  12. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
  15. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
  16. package/dist/Editor/Elements/DataView/Layouts/TableView.js +126 -29
  17. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
  18. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  19. package/dist/Editor/Elements/DataView/styles.js +8 -8
  20. package/dist/Editor/Elements/Embed/Image.js +2 -2
  21. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
  22. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -1
  23. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +2 -1
  24. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  25. package/dist/Editor/Elements/Grid/GridItem.js +2 -3
  26. package/dist/Editor/Elements/Link/Link.js +70 -43
  27. package/dist/Editor/Elements/SimpleText/index.js +0 -1
  28. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  29. package/dist/Editor/Elements/Table/Table.js +43 -27
  30. package/dist/Editor/Elements/Table/TableCell.js +4 -3
  31. package/dist/Editor/Elements/Title/title.js +13 -31
  32. package/dist/Editor/Elements/Variables/Style.js +28 -2
  33. package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
  34. package/dist/Editor/Styles/EditorStyles.js +5 -5
  35. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  36. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  37. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  38. package/dist/Editor/Toolbar/FormatTools/TextSize.js +7 -15
  39. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -0
  40. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +210 -85
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  44. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
  45. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +54 -7
  46. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
  47. package/dist/Editor/Toolbar/PopupTool/index.js +5 -10
  48. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  49. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  50. package/dist/Editor/common/ColorPickerButton.js +35 -9
  51. package/dist/Editor/common/CustomColorPicker/index.js +106 -0
  52. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  53. package/dist/Editor/common/CustomDialog/index.js +90 -0
  54. package/dist/Editor/common/CustomDialog/styles.js +80 -0
  55. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  56. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  57. package/dist/Editor/common/CustomSelect.js +33 -0
  58. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  59. package/dist/Editor/common/DnD/Draggable.js +0 -1
  60. package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
  61. package/dist/Editor/common/Icon.js +28 -0
  62. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
  63. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  64. package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -10
  65. package/dist/Editor/common/MentionsPopup/Styles.js +6 -12
  66. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  68. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  69. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  70. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  71. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  72. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  73. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  74. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  75. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
  76. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
  77. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  78. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  79. package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -4
  80. package/dist/Editor/common/RnD/Utils/index.js +45 -0
  81. package/dist/Editor/common/RnD/index.js +23 -3
  82. package/dist/Editor/common/Shorthands/elements.js +54 -0
  83. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  84. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  85. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  86. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  87. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  88. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +35 -11
  89. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  91. package/dist/Editor/common/Uploader.js +8 -0
  92. package/dist/Editor/commonStyle.js +114 -69
  93. package/dist/Editor/helper/index.js +2 -2
  94. package/dist/Editor/helper/theme.js +200 -2
  95. package/dist/Editor/hooks/useDrag.js +17 -11
  96. package/dist/Editor/hooks/useEditorScroll.js +0 -1
  97. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  98. package/dist/Editor/hooks/useMouseMove.js +9 -3
  99. package/dist/Editor/plugins/withEmbeds.js +1 -1
  100. package/dist/Editor/plugins/withHTML.js +19 -14
  101. package/dist/Editor/plugins/withLayout.js +1 -1
  102. package/dist/Editor/plugins/withTable.js +1 -1
  103. package/dist/Editor/theme/ThemeList.js +50 -173
  104. package/dist/Editor/theme/index.js +144 -0
  105. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  106. package/dist/Editor/themeSettings/buttons/index.js +283 -0
  107. package/dist/Editor/themeSettings/buttons/style.js +21 -0
  108. package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
  109. package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
  110. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  111. package/dist/Editor/themeSettings/fonts/index.js +220 -0
  112. package/dist/Editor/themeSettings/fonts/style.js +44 -0
  113. package/dist/Editor/themeSettings/icons.js +60 -0
  114. package/dist/Editor/themeSettings/index.js +320 -0
  115. package/dist/Editor/themeSettings/style.js +152 -0
  116. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  117. package/dist/Editor/themeSettingsAI/index.js +356 -0
  118. package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
  119. package/dist/Editor/themeSettingsAI/style.js +250 -0
  120. package/dist/Editor/utils/SlateUtilityFunctions.js +150 -37
  121. package/dist/Editor/utils/button.js +0 -14
  122. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
  123. package/dist/Editor/utils/draftToSlate.js +3 -2
  124. package/dist/Editor/utils/font.js +40 -37
  125. package/dist/Editor/utils/helper.js +59 -27
  126. package/dist/Editor/utils/link.js +1 -1
  127. package/dist/Editor/utils/table.js +8 -0
  128. package/package.json +6 -3
@@ -11,7 +11,7 @@ const useDataViewStyles = (theme, appTheme) => ({
11
11
  },
12
12
  "& table th": {
13
13
  cursor: "pointer",
14
- width: "200px"
14
+ minWidth: "200px"
15
15
  },
16
16
  "& table, th, td": {
17
17
  border: "1px solid black",
@@ -48,7 +48,7 @@ const useDataViewStyles = (theme, appTheme) => ({
48
48
  "& .tv-ck-box": {
49
49
  "& svg": {
50
50
  color: appTheme?.palette?.editor?.tv_border,
51
- '& rect': {
51
+ "& rect": {
52
52
  fill: appTheme?.palette?.editor?.tv_chk_box_fill,
53
53
  stroke: appTheme?.palette?.editor?.tv_chk_box_stroke
54
54
  }
@@ -56,9 +56,9 @@ const useDataViewStyles = (theme, appTheme) => ({
56
56
  "&.Mui-checked": {
57
57
  "& svg": {
58
58
  color: "rgba(37, 99, 235, 1)",
59
- '& rect': {
59
+ "& rect": {
60
60
  fill: appTheme?.palette?.editor?.activeColor,
61
- stroke: 'none'
61
+ stroke: "none"
62
62
  }
63
63
  }
64
64
  }
@@ -94,7 +94,7 @@ const useDataViewStyles = (theme, appTheme) => ({
94
94
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
95
95
  boxShadow: "0px 4px 18px 0px #0000000D",
96
96
  borderRadius: "8px",
97
- minWidth: '148px'
97
+ minWidth: "148px"
98
98
  },
99
99
  "& input": {
100
100
  paddingBottom: "0px",
@@ -140,12 +140,12 @@ const useDataViewStyles = (theme, appTheme) => ({
140
140
  width: "150px",
141
141
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
142
142
  borderRadius: "8px",
143
- fontFamily: 'Inter !important',
143
+ fontFamily: "Inter !important",
144
144
  background: appTheme?.palette?.editor?.tv_pop_bg,
145
145
  color: appTheme?.palette?.editor?.tv_text_primary,
146
146
  "& .MuiButtonBase-root": {
147
147
  fontSize: "14px",
148
- padding: '6px 8px',
148
+ padding: "6px 8px",
149
149
  "& svg": {
150
150
  width: "16px",
151
151
  height: "16px",
@@ -157,7 +157,7 @@ const useDataViewStyles = (theme, appTheme) => ({
157
157
  color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
158
158
  "& svg": {
159
159
  color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
160
- '& path': {
160
+ "& path": {
161
161
  stroke: `${appTheme?.palette?.editor?.tv_hover_text} !important`
162
162
  }
163
163
  }
@@ -5,7 +5,7 @@ import AspectRatioIcon from "@mui/icons-material/AspectRatio";
5
5
  import useResize from "../../utils/customHooks/useResize";
6
6
  import EmbedPopup from "./EmbedPopup";
7
7
  import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
8
- import { GridSettingsIcon, LinkIcon } from "../../common/iconslist";
8
+ import { LinkIcon } from "../../common/iconslist";
9
9
  import { useEditorContext } from "../../hooks/useMouseMove";
10
10
  import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
11
11
  import Icon from "../../common/Icon";
@@ -32,7 +32,7 @@ const ToolBar = ({
32
32
  top: "-4px",
33
33
  left: topM ? "35px" : "0px",
34
34
  margin: "0px",
35
- gap: '3px'
35
+ gap: "3px"
36
36
  },
37
37
  children: [/*#__PURE__*/_jsx(Tooltip, {
38
38
  title: "Image Settings",
@@ -180,20 +180,6 @@ const FreeGrid = props => {
180
180
  linkType: "webAddress"
181
181
  },
182
182
  iconPosition: "start",
183
- bgColor: "#2563EB",
184
- textColor: "#FFF",
185
- borderRadius: {
186
- topLeft: 30,
187
- topRight: 30,
188
- bottomLeft: 30,
189
- bottomRight: 30
190
- },
191
- bannerSpacing: {
192
- left: 12,
193
- top: 12,
194
- right: 12,
195
- bottom: 12
196
- },
197
183
  textAlign: "center",
198
184
  label: "Get Started"
199
185
  }],
@@ -59,7 +59,8 @@ const FreeGridBox = props => {
59
59
  delete updateData.children;
60
60
  updateData = formatBreakpointValues(element.type, breakpoint, updateData);
61
61
  Transforms.setNodes(editor, {
62
- ...updateData
62
+ ...updateData,
63
+ [`${breakpoint}_updatedOn`]: new Date().getTime()
63
64
  }, {
64
65
  at: path
65
66
  });
@@ -59,7 +59,8 @@ const FreeGridItem = props => {
59
59
  delete updateData.children;
60
60
  updateData = formatBreakpointValues(element.type, breakpoint, updateData);
61
61
  Transforms.setNodes(editor, {
62
- ...updateData
62
+ ...updateData,
63
+ [`${breakpoint}_updatedOn`]: new Date().getTime()
63
64
  }, {
64
65
  at: path
65
66
  });
@@ -338,6 +338,9 @@ const useFreeGridStyles = ({
338
338
  fontSize: "14px",
339
339
  borderRadius: "7px"
340
340
  }
341
+ },
342
+ "& .remove-resize-styles": {
343
+ transform: "none !important"
341
344
  }
342
345
  }
343
346
  },
@@ -50,8 +50,7 @@ const GridItemToolbar = props => {
50
50
  open: true,
51
51
  placement: "top-end",
52
52
  sx: classes.popTools,
53
- className: "gi-tool-pp",
54
- disablePortal: true,
53
+ className: "gi-tool-pp hide-popper-on-overlap",
55
54
  contentEditable: false,
56
55
  children: /*#__PURE__*/_jsxs(Box, {
57
56
  className: "ico-grp-ss",
@@ -288,7 +287,7 @@ const GridItem = props => {
288
287
  ...getBRProps,
289
288
  display: "flex",
290
289
  flexDirection: flexDirection || "column",
291
- background: bgColor || "transparent",
290
+ background: bgColor,
292
291
  borderColor: getBorderColor(),
293
292
  borderWidth: borderWidth || "1px",
294
293
  borderStyle: borderStyle || "solid",
@@ -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";
@@ -35,8 +35,8 @@ const SimpleTextStyle = ({
35
35
  height: "24px",
36
36
  overflow: "hidden",
37
37
  fontSize: "14px",
38
- display: 'inline-flex',
39
- alignItems: 'center',
38
+ display: "inline-flex",
39
+ alignItems: "center",
40
40
  "& .bg-pad-sl": {
41
41
  padding: "2px 4px 2px 4px",
42
42
  background: "transparent",
@@ -12,9 +12,11 @@ import useTable, { TableProvider, getDefaultTableSelection } from "../../hooks/u
12
12
  import AddRowCol from "./AddRowCol";
13
13
  import TableTool from "./TableTool";
14
14
  import { MoreIcon, SettingsIcon } from "../../assets/svg/TableIcons";
15
+ import { DeleteIcon } from "../../assets/svg/AIIcons";
15
16
  import { getSelectedCls } from "../../utils/helper";
16
17
  import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { Fragment as _Fragment } from "react/jsx-runtime";
18
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
21
  const hideRowDragBtns = (hide, dragRowBtnCls) => {
20
22
  const rowDragBtns = document.querySelectorAll(`.${dragRowBtnCls}`);
@@ -30,14 +32,16 @@ const ToolTableComponent = props => {
30
32
  const {
31
33
  updateTableSelection
32
34
  } = useTable();
33
- return /*#__PURE__*/_jsx(TableTool, {
34
- theme: editorTheme,
35
- handleToolAction: (type, option) => {
36
- handleAction(type, option);
37
- if (type === "duplicate") {
38
- updateTableSelection(getDefaultTableSelection());
35
+ return /*#__PURE__*/_jsx("div", {
36
+ children: /*#__PURE__*/_jsx(TableTool, {
37
+ theme: editorTheme,
38
+ handleToolAction: (type, option) => {
39
+ handleAction(type, option);
40
+ if (type === "duplicate") {
41
+ updateTableSelection(getDefaultTableSelection());
42
+ }
39
43
  }
40
- }
44
+ })
41
45
  });
42
46
  };
43
47
  const MoreTableSettings = props => {
@@ -89,34 +93,44 @@ const ToolBar = props => {
89
93
  handleExpand,
90
94
  handleAction,
91
95
  exandTools,
92
- openSetttings
96
+ openSetttings,
97
+ hideTools
93
98
  } = props;
94
99
  const {
95
100
  getSelectedCells
96
101
  } = useTable();
97
102
  const viewTool = selected && !showTool && getSelectedCells()?.length <= 1;
98
- return viewTool ? /*#__PURE__*/_jsxs(Box, {
103
+ return viewTool ? /*#__PURE__*/_jsx(Box, {
99
104
  component: "div",
100
105
  contentEditable: false,
101
106
  className: `tableToolBar ${exandTools ? "active" : ""}`,
102
107
  sx: classes.tableToolBar,
103
- children: [/*#__PURE__*/_jsx(Tooltip, {
104
- title: "Settings",
105
- arrow: true,
106
- onClick: () => handleAction("settings"),
107
- children: /*#__PURE__*/_jsx(IconButton, {
108
- className: getSelectedCls("toolbtn toggle", openSetttings),
109
- children: /*#__PURE__*/_jsx(SettingsIcon, {})
110
- })
111
- }), /*#__PURE__*/_jsx(Tooltip, {
112
- title: "Show Tools",
108
+ children: !hideTools.includes("settings") ? /*#__PURE__*/_jsxs(_Fragment, {
109
+ children: [/*#__PURE__*/_jsx(Tooltip, {
110
+ title: "Settings",
111
+ arrow: true,
112
+ onClick: () => handleAction("settings"),
113
+ children: /*#__PURE__*/_jsx(IconButton, {
114
+ className: getSelectedCls("toolbtn toggle", openSetttings),
115
+ children: /*#__PURE__*/_jsx(SettingsIcon, {})
116
+ })
117
+ }), /*#__PURE__*/_jsx(Tooltip, {
118
+ title: "Show Tools",
119
+ arrow: true,
120
+ onClick: handleExpand,
121
+ children: /*#__PURE__*/_jsx(IconButton, {
122
+ className: getSelectedCls("toolbtn toggle", exandTools),
123
+ children: /*#__PURE__*/_jsx(MoreIcon, {})
124
+ })
125
+ })]
126
+ }) : /*#__PURE__*/_jsx(Tooltip, {
127
+ title: "Delete",
113
128
  arrow: true,
114
- onClick: handleExpand,
129
+ onClick: () => handleAction("delete"),
115
130
  children: /*#__PURE__*/_jsx(IconButton, {
116
- className: getSelectedCls("toolbtn toggle", exandTools),
117
- children: /*#__PURE__*/_jsx(MoreIcon, {})
131
+ children: /*#__PURE__*/_jsx(DeleteIcon, {})
118
132
  })
119
- })]
133
+ })
120
134
  }) : null;
121
135
  };
122
136
  const Table = props => {
@@ -133,7 +147,8 @@ const Table = props => {
133
147
  const classes = TableStyles(editorTheme);
134
148
  const {
135
149
  readOnly,
136
- isMobile
150
+ isMobile,
151
+ hideTools = []
137
152
  } = customProps;
138
153
  const [openSetttings, setOpenSettings] = useState(false);
139
154
  const [exandTools, setExpandTools] = useState(null);
@@ -304,12 +319,12 @@ const Table = props => {
304
319
  ...attributes,
305
320
  children: children
306
321
  })
307
- }), /*#__PURE__*/_jsx(AddRowCol, {
322
+ }), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
308
323
  ...commonAddBtnProps,
309
324
  addType: "col",
310
325
  onAdd: addCol
311
326
  })]
312
- }), /*#__PURE__*/_jsx(AddRowCol, {
327
+ }), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
313
328
  ...commonAddBtnProps,
314
329
  addType: "row",
315
330
  onAdd: addRow
@@ -320,7 +335,8 @@ const Table = props => {
320
335
  handleExpand: handleExpand,
321
336
  handleAction: handleAction,
322
337
  exandTools: exandTools,
323
- openSetttings: openSetttings
338
+ openSetttings: openSetttings,
339
+ hideTools: hideTools
324
340
  }), /*#__PURE__*/_jsx(MoreTableSettings, {
325
341
  exandTools: exandTools,
326
342
  handleAction: handleAction,
@@ -48,7 +48,8 @@ const TableCell = props => {
48
48
  customProps
49
49
  } = props;
50
50
  const {
51
- readOnly
51
+ readOnly,
52
+ hideTools = []
52
53
  } = customProps;
53
54
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
54
55
  const {
@@ -106,8 +107,8 @@ const TableCell = props => {
106
107
  const isFirstRow = row === 0;
107
108
  const isFirstColumn = column === 0;
108
109
  const [hoverRow, hoverCol] = hoverPath ? hoverPath.slice(-2) : [];
109
- const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly;
110
- const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly;
110
+ const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly && !hideTools.includes("drag");
111
+ const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly && !hideTools.includes("drag");
111
112
  const [parentProps] = tableNode || [{}];
112
113
  const [rowProps] = rowNode || [{}];
113
114
  const tableDOM = table.getDOMNode(path, true);
@@ -1,18 +1,24 @@
1
- import React, { useEffect, useState } from "react";
2
- import { Editor } from "slate";
3
- import { useSlate } from "slate-react";
4
- import { getNodeText } from "../../utils/helper";
1
+ import React from "react";
2
+ import { Text } from "slate";
5
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
+ const isEmptyTextNode = node => {
5
+ if (Text.isText(node)) {
6
+ return !node.text.trim();
7
+ }
8
+ return false;
9
+ };
6
10
  const Title = props => {
7
11
  const {
12
+ element,
8
13
  attributes,
9
14
  children,
10
- element,
11
15
  customProps
12
16
  } = props;
13
- useDetectExitFromTitle(element, customProps?.getTitleSaveData);
17
+ const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
14
18
  return /*#__PURE__*/_jsx("div", {
15
19
  ...attributes,
20
+ placeholder: "Title",
21
+ className: `content-editable ${isEmpty}`,
16
22
  style: {
17
23
  fontWeight: "bold",
18
24
  fontSize: "20px"
@@ -20,28 +26,4 @@ const Title = props => {
20
26
  children: children
21
27
  });
22
28
  };
23
- export default Title;
24
- const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
25
- const editor = useSlate();
26
- const [wasInsideTitle, setWasInsideTitle] = useState(false);
27
- useEffect(() => {
28
- if (!editor.selection) return;
29
-
30
- // Get the current node where the cursor is
31
- const [nodeEntry] = Editor.nodes(editor, {
32
- at: editor.selection,
33
- match: n => n.type === "title"
34
- });
35
- if (nodeEntry) {
36
- setWasInsideTitle(true); // User was inside the title
37
- } else if (wasInsideTitle) {
38
- // User exited the title node
39
- const text = getNodeText(titleNode) || "";
40
- if (text?.trim() && text !== "Untitled" && onSaveTitle) {
41
- onSaveTitle(text);
42
- }
43
- setWasInsideTitle(false);
44
- }
45
- }, [editor.selection]);
46
- return null;
47
- };
29
+ export default Title;
@@ -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,13 +28,14 @@ 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: {
31
35
  style: {
32
36
  maxHeight: 300,
33
- overflowY: "auto"
37
+ overflowY: "auto",
38
+ transformOrigin: 'top left'
34
39
  },
35
40
  sx: {
36
41
  "&::-webkit-scrollbar-track": {
@@ -40,6 +45,14 @@ const VariableButton = props => {
40
45
  borderRadius: "16px"
41
46
  }
42
47
  }
48
+ },
49
+ anchorOrigin: {
50
+ vertical: 'bottom',
51
+ horizontal: 'right'
52
+ },
53
+ transformOrigin: {
54
+ vertical: 'top',
55
+ horizontal: 'right'
43
56
  }
44
57
  },
45
58
  children: [/*#__PURE__*/_jsx(MenuItem, {
@@ -133,7 +133,7 @@ const editorStyles = ({
133
133
  },
134
134
  "& .accordion-summary-collapse-btn": {
135
135
  padding: "4px",
136
- width: '5px'
136
+ width: "5px"
137
137
  },
138
138
  "& .workflow-icon-btn": {
139
139
  pointerEvents: "none",
@@ -242,7 +242,7 @@ const editorStyles = ({
242
242
  }
243
243
  },
244
244
  "& .section-tw": {
245
- background: 'transparent !important',
245
+ background: "transparent !important",
246
246
  "& button": {
247
247
  padding: "2px",
248
248
  borderRadius: "0px",
@@ -291,8 +291,8 @@ const editorStyles = ({
291
291
  }
292
292
  },
293
293
  "& ::selection": {
294
- background: 'rgba(35, 131, 226, 0.35)!important',
295
- color: 'inherit'
294
+ background: "rgba(35, 131, 226, 0.35)!important",
295
+ color: "inherit"
296
296
  },
297
297
  "&.readOnlyContainer": {
298
298
  "& .max-content": {
@@ -302,7 +302,7 @@ const editorStyles = ({
302
302
  },
303
303
  fullScreenWrapper: {
304
304
  "& .editor-wrapper": {
305
- paddingTop: '20px'
305
+ paddingTop: "20px"
306
306
  },
307
307
  "& .MuiDialog-paper, & .MuiPopover-paper": {
308
308
  background: `${theme?.palette?.editor?.background} !important`