@flozy/editor 9.1.1 → 9.1.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.
Files changed (127) hide show
  1. package/dist/Editor/ChatEditor.js +2 -3
  2. package/dist/Editor/CommonEditor.js +37 -104
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +3 -21
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  6. package/dist/Editor/Elements/Button/EditorButton.js +9 -25
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
  8. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  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 +1 -4
  12. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
  15. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
  16. package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
  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 +14 -0
  22. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +1 -2
  23. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -2
  24. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  25. package/dist/Editor/Elements/Grid/GridItem.js +3 -2
  26. package/dist/Editor/Elements/Link/Link.js +43 -70
  27. package/dist/Editor/Elements/SimpleText/index.js +1 -0
  28. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  29. package/dist/Editor/Elements/Table/Table.js +4 -5
  30. package/dist/Editor/Elements/Table/TableCell.js +3 -4
  31. package/dist/Editor/Elements/Title/title.js +31 -13
  32. package/dist/Editor/Elements/Variables/Style.js +2 -28
  33. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  34. package/dist/Editor/Styles/EditorStyles.js +5 -5
  35. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  36. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  37. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  38. package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
  39. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +0 -1
  40. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +85 -210
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
  44. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
  45. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +7 -54
  46. package/dist/Editor/Toolbar/PopupTool/index.js +10 -5
  47. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  48. package/dist/Editor/common/ColorPickerButton.js +9 -35
  49. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  50. package/dist/Editor/common/DnD/Draggable.js +1 -0
  51. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  52. package/dist/Editor/common/Icon.js +0 -28
  53. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
  54. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  55. package/dist/Editor/common/ImageSelector/UploadStyles.js +10 -9
  56. package/dist/Editor/common/MentionsPopup/Styles.js +12 -6
  57. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  66. package/dist/Editor/common/RnD/ElementSettings/styles.js +1 -0
  67. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -8
  68. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  69. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  70. package/dist/Editor/common/RnD/Utils/index.js +0 -45
  71. package/dist/Editor/common/RnD/index.js +3 -23
  72. package/dist/Editor/common/Shorthands/elements.js +0 -54
  73. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  81. package/dist/Editor/common/Uploader.js +0 -8
  82. package/dist/Editor/commonStyle.js +69 -114
  83. package/dist/Editor/helper/index.js +2 -2
  84. package/dist/Editor/helper/theme.js +2 -200
  85. package/dist/Editor/hooks/useDrag.js +11 -17
  86. package/dist/Editor/hooks/useEditorScroll.js +1 -0
  87. package/dist/Editor/hooks/useMouseMove.js +3 -9
  88. package/dist/Editor/plugins/withEmbeds.js +1 -1
  89. package/dist/Editor/plugins/withHTML.js +14 -19
  90. package/dist/Editor/plugins/withLayout.js +1 -1
  91. package/dist/Editor/plugins/withTable.js +1 -1
  92. package/dist/Editor/theme/ThemeList.js +173 -50
  93. package/dist/Editor/utils/SlateUtilityFunctions.js +37 -150
  94. package/dist/Editor/utils/button.js +14 -0
  95. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -23
  96. package/dist/Editor/utils/draftToSlate.js +2 -3
  97. package/dist/Editor/utils/font.js +37 -40
  98. package/dist/Editor/utils/helper.js +27 -59
  99. package/dist/Editor/utils/link.js +1 -1
  100. package/package.json +3 -6
  101. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  102. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  103. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  104. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  105. package/dist/Editor/common/CustomDialog/index.js +0 -90
  106. package/dist/Editor/common/CustomDialog/styles.js +0 -80
  107. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  108. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  109. package/dist/Editor/common/CustomSelect.js +0 -33
  110. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  111. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  112. package/dist/Editor/theme/index.js +0 -144
  113. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  114. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  115. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  116. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  117. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  118. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  119. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  120. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  121. package/dist/Editor/themeSettings/icons.js +0 -60
  122. package/dist/Editor/themeSettings/index.js +0 -320
  123. package/dist/Editor/themeSettings/style.js +0 -152
  124. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  125. package/dist/Editor/themeSettingsAI/index.js +0 -356
  126. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  127. package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -1,15 +1,11 @@
1
1
  import React, { useState } from "react";
2
- import { Box, IconButton, Popover, Typography, useTheme } from "@mui/material";
2
+ import { Box, IconButton, Popover } from "@mui/material";
3
3
  import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
7
- import { useSlateStatic } from "slate-react";
8
- import { Transforms } from "slate";
9
- import { useEditorContext } from "../../hooks/useMouseMove";
10
7
  import { jsx as _jsx } from "react/jsx-runtime";
11
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
- import { Fragment as _Fragment } from "react/jsx-runtime";
13
9
  let c = [];
14
10
  const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((a, b, i) => {
15
11
  if (i % 7 === 0) {
@@ -114,18 +110,12 @@ const ColorButtons = props => {
114
110
  openColorTool,
115
111
  onClose,
116
112
  onColorPickerClick,
117
- disableEditTheme,
118
113
  defaultColors = []
119
114
  } = props;
120
115
  const [row1, ...restRows] = ColorChunks([]);
121
116
  const [anchorEl, setAnchorEl] = useState(null);
122
117
  const open = Boolean(anchorEl);
123
118
  const firstRow = defaultColors?.length ? defaultColors : row1;
124
- const theme = useTheme();
125
- const editor = useSlateStatic();
126
- const {
127
- setOpenTheme
128
- } = useEditorContext();
129
119
  const handleMore = e => {
130
120
  setAnchorEl(e.currentTarget);
131
121
  };
@@ -138,7 +128,6 @@ const ColorButtons = props => {
138
128
  const handleSelect = color => () => {
139
129
  onSelect(color);
140
130
  };
141
- const colorVars = theme?.vars?.colors || {};
142
131
  return /*#__PURE__*/_jsxs(Box, {
143
132
  component: "span",
144
133
  sx: classes.colorButtons,
@@ -155,7 +144,7 @@ const ColorButtons = props => {
155
144
  activeColor: activeColor
156
145
  }, `si_btn_row1_${m}_${i}`);
157
146
  })
158
- }), /*#__PURE__*/_jsx(Popover, {
147
+ }), /*#__PURE__*/_jsxs(Popover, {
159
148
  open: open || openColorTool,
160
149
  anchorEl: anchorEl || openColorTool,
161
150
  onClose: handleClose,
@@ -169,39 +158,9 @@ const ColorButtons = props => {
169
158
  },
170
159
  sx: classes.colorPopper,
171
160
  className: "colorPopper",
172
- children: /*#__PURE__*/_jsxs(Box, {
161
+ children: [/*#__PURE__*/_jsx(Box, {
173
162
  sx: classes.colorButtonsInner,
174
- children: [Object.values(colorVars)?.length ? /*#__PURE__*/_jsxs(_Fragment, {
175
- children: [/*#__PURE__*/_jsxs(Box, {
176
- component: "div",
177
- className: "singleColorTitleWrapper",
178
- children: [/*#__PURE__*/_jsx(Typography, {
179
- variant: "subtitle2",
180
- children: "Theme colours"
181
- }), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
182
- className: "editBtn",
183
- onClick: () => {
184
- Transforms.deselect(editor, {
185
- at: editor.selection
186
- });
187
- setOpenTheme("editThemeColor");
188
- },
189
- children: "Edit"
190
- })]
191
- }), /*#__PURE__*/_jsx(SingleColorButton, {
192
- crs: Object.values(colorVars),
193
- handleSelect: handleSelect,
194
- classes: classes,
195
- activeColor: activeColor
196
- })]
197
- }) : null, /*#__PURE__*/_jsx(Box, {
198
- component: "div",
199
- className: "singleColorTitleWrapper",
200
- children: /*#__PURE__*/_jsx(Typography, {
201
- variant: "subtitle2",
202
- children: "Custom colour"
203
- })
204
- }), restRows.map((m, i) => {
163
+ children: restRows.map((m, i) => {
205
164
  return /*#__PURE__*/_jsx(SingleColorButton, {
206
165
  id: `p2_${id}`,
207
166
  crs: m,
@@ -210,18 +169,14 @@ const ColorButtons = props => {
210
169
  classes: classes,
211
170
  activeColor: activeColor
212
171
  }, `si_btn_${m}_${i}`);
213
- }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
214
- onClick: onColorPickerClick,
215
- style: {
216
- alignSelf: "start",
217
- margin: "6px"
218
- },
219
- children: /*#__PURE__*/_jsx("img", {
220
- src: ColorPicker,
221
- alt: "color wheel"
222
- })
223
- }) : null]
224
- })
172
+ })
173
+ }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
174
+ onClick: onColorPickerClick,
175
+ children: /*#__PURE__*/_jsx("img", {
176
+ src: ColorPicker,
177
+ alt: "color wheel"
178
+ })
179
+ }) : null]
225
180
  })]
226
181
  });
227
182
  };
@@ -60,28 +60,4 @@
60
60
  padding: 0 15px !important;
61
61
  width: 60px !important;
62
62
  flex-shrink: 0;
63
- }
64
-
65
-
66
- .singleColorTitleWrapper {
67
- display: flex;
68
- justify-content: space-between;
69
- align-items: center;
70
- padding: 10px;
71
- width: 100%;
72
- border-bottom: 1px solid #DCE4EC;
73
- }
74
-
75
- .singleColorTitleWrapper .MuiTypography-root {
76
- font-weight: 600;
77
- }
78
-
79
- .singleColorTitleWrapper .editBtn {
80
- text-transform: none;
81
- color: #2563EB;
82
- text-decoration: underline;
83
- padding: 0px;
84
- min-width: unset;
85
- cursor: pointer;
86
- font-size: 14px;
87
- }
63
+ }
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { ReactEditor } from "slate-react";
3
- // import ColorPickerTool from "react-gcolor-picker";
3
+ import { Transforms } from "slate";
4
+ import ColorPickerTool from "react-gcolor-picker";
4
5
  import { IconButton, Tooltip, Box, Popover } from "@mui/material";
5
6
  import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
6
7
  import ColorButtons from "./ColorButtons";
@@ -8,7 +9,6 @@ import ColorPickerStyles from "./Styles";
8
9
  import colorWheel from "./colorWheel.png";
9
10
  import "./ColorPicker.css";
10
11
  import { useEditorContext } from "../../hooks/useMouseMove";
11
- import CustomColorPicker from "../../common/CustomColorPicker";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -97,10 +97,10 @@ const ColorPicker = props => {
97
97
  horizontal: "top"
98
98
  },
99
99
  sx: classes.colorPickerPopup,
100
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
100
+ children: /*#__PURE__*/_jsx(ColorPickerTool, {
101
101
  gradient: true,
102
- onChange: handleFormSubmit,
103
- color: activeColor
102
+ value: activeColor,
103
+ onChange: handleFormSubmit
104
104
  })
105
105
  })]
106
106
  });
@@ -21,7 +21,7 @@ const ColorPickerStyles = theme => ({
21
21
  border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
22
22
  borderRadius: "7px !important",
23
23
  padding: "0px 5px",
24
- "@media only screen and (max-width: 600px)": {
24
+ '@media only screen and (max-width: 600px)': {
25
25
  marginTop: "-40px"
26
26
  }
27
27
  }
@@ -16,10 +16,7 @@ const ColumnView = props => {
16
16
  selected,
17
17
  readOnly
18
18
  } = props;
19
- const {
20
- type
21
- } = property;
22
- const DataType = DataTypes[type] || DataTypes["text"];
19
+ const DataType = DataTypes[property?.type] || DataTypes["text"];
23
20
  const anchorRef = useRef(null);
24
21
  const [anchorEl, setAnchorEl] = useState(null);
25
22
  const [popperRefresh, setPopperRefresh] = useState(new Date().getTime());
@@ -153,9 +153,11 @@ export default function Select(props) {
153
153
  ...optionProps,
154
154
  children: /*#__PURE__*/_jsx(Chip, {
155
155
  label: option.label || option.value || "",
156
- classes: classes.chipText,
157
156
  sx: {
158
- background: option.color || appTheme?.palette?.editor?.tv_border1
157
+ background: option.color || appTheme?.palette?.editor?.tv_border1,
158
+ "& .MuiChip-label": {
159
+ paddingLeft: "12px !important"
160
+ }
159
161
  },
160
162
  avatar: /*#__PURE__*/_jsx(AvatarIcon, {
161
163
  option: option,
@@ -170,7 +172,6 @@ export default function Select(props) {
170
172
  fullWidth: true,
171
173
  renderInput: params => {
172
174
  return /*#__PURE__*/_jsx(TextField, {
173
- fullWidth: true,
174
175
  size: "small",
175
176
  ...params,
176
177
  placeholder: placeholder
@@ -3,7 +3,7 @@ const useCompStyles = (theme, appTheme) => ({
3
3
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
4
4
  background: appTheme?.palette?.editor?.tv_pop_bg,
5
5
  color: appTheme?.palette?.editor?.tv_text,
6
- fontSize: "14px",
6
+ fontSize: '14px',
7
7
  borderRadius: "8px",
8
8
  [theme?.breakpoints?.between("xs", "md")]: {},
9
9
  "& ul": {
@@ -63,11 +63,6 @@ const useCompStyles = (theme, appTheme) => ({
63
63
  }
64
64
  }
65
65
  }
66
- },
67
- chipText: {
68
- "& .MuiChip-label": {
69
- paddingLeft: "12px !important"
70
- }
71
66
  }
72
67
  });
73
68
  export default useCompStyles;
@@ -1,9 +1,6 @@
1
1
  import React from "react";
2
2
  import DatePicker from "react-datepicker";
3
- import { Grid } from "@mui/material";
4
3
  import { useDataView } from "../../Providers/DataViewProvider";
5
- import useCommonStyle from "../../../../commonStyle";
6
- import { useEditorContext } from "../../../../hooks/useMouseMove";
7
4
  import { jsx as _jsx } from "react/jsx-runtime";
8
5
  function isValidDate(dateString) {
9
6
  const date = new Date(dateString);
@@ -19,27 +16,20 @@ const DateType = props => {
19
16
  const {
20
17
  onChange
21
18
  } = useDataView();
22
- const {
23
- theme
24
- } = useEditorContext();
25
- const classes = useCommonStyle(theme);
26
19
  const handleChange = date => {
27
20
  onChange(rowIndex, {
28
21
  [property]: date
29
22
  });
30
23
  };
31
- return /*#__PURE__*/_jsx(Grid, {
32
- sx: classes.datePicker,
33
- children: /*#__PURE__*/_jsx(DatePicker, {
34
- disabled: readOnly,
35
- selected: isValidDate(value) ? new Date(value) : "",
36
- onChange: handleChange,
37
- onKeyDown: e => {
38
- e.preventDefault();
39
- console.log(e?.target.value);
40
- },
41
- placeholderText: "MM/DD/YYYY"
42
- })
24
+ return /*#__PURE__*/_jsx(DatePicker, {
25
+ disabled: readOnly,
26
+ selected: isValidDate(value) ? new Date(value) : "",
27
+ onChange: handleChange,
28
+ onKeyDown: e => {
29
+ e.preventDefault();
30
+ console.log(e?.target.value);
31
+ },
32
+ placeholderText: "MM/DD/YYYY"
43
33
  });
44
34
  };
45
35
  export default DateType;
@@ -10,16 +10,12 @@ const useTableStyles = (theme, appTheme) => ({
10
10
  borderSpacing: 0,
11
11
  borderRadius: "7px 7px 0px 0px",
12
12
  overflow: "hidden",
13
- width: "auto !important",
14
- minWidth: "100%",
15
13
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
16
- tableLayout: "fixed",
17
14
  "& thead": {
18
15
  background: appTheme?.palette?.editor?.tv_header,
19
16
  height: "40px"
20
17
  },
21
18
  "& th": {
22
- position: "relative",
23
19
  "& svg": {
24
20
  "& .fillStroke": {
25
21
  stroke: appTheme?.palette?.editor?.tv_stroke
@@ -31,8 +27,6 @@ const useTableStyles = (theme, appTheme) => ({
31
27
  },
32
28
  "& td": {
33
29
  height: "40px",
34
- maxWidth: "0px !important",
35
- minWidth: "0px !important",
36
30
  "& input": {
37
31
  color: appTheme?.palette?.editor?.tv_text_primary,
38
32
  background: "transparent",
@@ -45,11 +39,6 @@ const useTableStyles = (theme, appTheme) => ({
45
39
  "& th, tr, td": {
46
40
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
47
41
  },
48
- "& th, & td": {
49
- overflowX: "clip",
50
- textOverflow: "ellipsis",
51
- whiteSpace: "nowrap"
52
- },
53
42
  "& .tv-act-btn": {
54
43
  color: appTheme?.palette?.editor?.tv_text,
55
44
  textTransform: "none",
@@ -96,18 +85,13 @@ const useTableStyles = (theme, appTheme) => ({
96
85
  paddingTop: "3px",
97
86
  paddingBottom: "3px",
98
87
  paddingLeft: "3px",
99
- // maxWidth: "250px",
88
+ maxWidth: "250px",
100
89
  overflow: "hidden",
101
90
  position: "relative",
102
91
  "& .tv-ms-tag-wrpr": {
103
92
  display: "flex",
104
93
  flexWrap: "nowrap",
105
- overflow: "auto",
106
- minWidth: "58px",
107
- "& .MuiChip-deleteIcon": {
108
- minWidth: "22px",
109
- minHeight: "22px"
110
- }
94
+ overflow: "auto"
111
95
  },
112
96
  "&.Mui-disabled": {
113
97
  "& input": {
@@ -145,20 +129,6 @@ const useTableStyles = (theme, appTheme) => ({
145
129
  opacity: 1
146
130
  }
147
131
  }
148
- },
149
- cellResizer: {
150
- position: "absolute",
151
- cursor: "col-resize",
152
- right: "0px",
153
- top: 0,
154
- width: "3px",
155
- borderRadius: "0px",
156
- zIndex: 1,
157
- background: "transparent",
158
- height: "100%",
159
- "&:hover, &.active": {
160
- background: "#2563EB"
161
- }
162
132
  }
163
133
  });
164
134
  export default useTableStyles;
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Box, Button, useTheme } from "@mui/material";
3
3
  import { useDataView } from "../Providers/DataViewProvider";
4
4
  import PropertySettings from "./Options";
@@ -7,127 +7,37 @@ import useTableStyles from "./TableStyles";
7
7
  import { GridSettingsIcon, GridAddSectionIcon } from "../../../common/iconslist";
8
8
  import { useEditorContext } from "../../../hooks/useMouseMove";
9
9
  import Icon from "../../../common/Icon";
10
- import useTableResize from "../../../utils/customHooks/useTableResize";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
13
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- const Resizer = ({
15
- classes,
16
- onMouseDown,
17
- height,
18
- resizing
19
- }) => {
20
- return /*#__PURE__*/_jsx(_Fragment, {
21
- children: /*#__PURE__*/_jsx(Box, {
22
- component: "div",
23
- className: `cell-resizer ${resizing ? "active" : ""}`,
24
- contentEditable: false,
25
- onPointerDown: onMouseDown,
26
- sx: classes.cellResizer,
27
- style: {
28
- height: `${height}px`
29
- }
30
- })
31
- });
32
- };
33
13
  const SortIcon = props => {
34
14
  const {
35
15
  sortBy
36
16
  } = props;
37
17
  return sortBy ? sortBy === "asc" ? /*#__PURE__*/_jsx(Box, {
38
18
  sx: {
39
- "& svg": {
40
- "& path": {
19
+ '& svg': {
20
+ '& path': {
41
21
  stroke: "rgba(37, 99, 235, 1) !important"
42
22
  }
43
23
  }
44
24
  },
45
25
  children: /*#__PURE__*/_jsx(Icon, {
46
- icon: "chervUp"
26
+ icon: 'chervUp'
47
27
  })
48
28
  }) : /*#__PURE__*/_jsx(Box, {
49
29
  sx: {
50
- "& svg": {
51
- "& path": {
30
+ '& svg': {
31
+ '& path': {
52
32
  stroke: "rgba(37, 99, 235, 1) !important"
53
33
  }
54
34
  }
55
35
  },
56
36
  children: /*#__PURE__*/_jsx(Icon, {
57
- icon: "chervDown"
37
+ icon: 'chervDown'
58
38
  })
59
39
  }) : null;
60
40
  };
61
- const THead = props => {
62
- const thRef = useRef(null);
63
- const [headerTextWidth, setHeaderTextWidth] = useState(200);
64
- const {
65
- iconType,
66
- isSort,
67
- classes,
68
- onEditProperty,
69
- m,
70
- tableRef,
71
- handleResize
72
- } = props;
73
- // do not remove extra coma it will lead to swap of variable
74
- const [size, onMouseDown, resizing,, isDone] = useTableResize({
75
- parentDOM: thRef?.current,
76
- size: m?.size,
77
- minMaxProps: {
78
- minWidth: 30
79
- }
80
- });
81
- const finalWidth = size?.width < headerTextWidth ? headerTextWidth : size?.width || 200;
82
- useEffect(() => {
83
- if (thRef?.current) {
84
- const tw = (thRef?.current?.querySelectorAll(".dht-text")[0]?.getBoundingClientRect()?.width || 0) + 16 + 30;
85
- setHeaderTextWidth(tw);
86
- }
87
- }, [thRef?.current, m?.label]);
88
- useEffect(() => {
89
- if (isDone) {
90
- handleResize({
91
- ...m,
92
- size: size
93
- });
94
- }
95
- }, [isDone]);
96
- return /*#__PURE__*/_jsxs("th", {
97
- style: {
98
- minWidth: finalWidth,
99
- maxWidth: finalWidth,
100
- width: finalWidth
101
- },
102
- ref: thRef,
103
- children: [/*#__PURE__*/_jsx(Box, {
104
- sx: {
105
- maxWidth: "100%",
106
- overflow: "hidden"
107
- },
108
- children: /*#__PURE__*/_jsx(Button, {
109
- className: "tv-act-btn la",
110
- startIcon: /*#__PURE__*/_jsx(Icon, {
111
- icon: iconType
112
- }),
113
- endIcon: /*#__PURE__*/_jsx(SortIcon, {
114
- sortBy: isSort
115
- }),
116
- fullWidth: true,
117
- onClick: onEditProperty(m),
118
- children: /*#__PURE__*/_jsx("span", {
119
- className: "dht-text",
120
- children: m.label
121
- })
122
- })
123
- }), /*#__PURE__*/_jsx(Resizer, {
124
- classes: classes,
125
- onMouseDown: onMouseDown,
126
- height: tableRef?.current?.getBoundingClientRect()?.height,
127
- resizing: resizing
128
- })]
129
- });
130
- };
131
41
  const TableView = props => {
132
42
  const {
133
43
  theme: appTheme
@@ -138,7 +48,6 @@ const TableView = props => {
138
48
  } = props;
139
49
  const theme = useTheme();
140
50
  const classes = useTableStyles(theme, appTheme);
141
- const tableRef = useRef(null);
142
51
  const {
143
52
  properties,
144
53
  onAddProperty,
@@ -255,9 +164,6 @@ const TableView = props => {
255
164
  setMode({});
256
165
  setAnchorEl(null);
257
166
  };
258
- const handleResize = data => {
259
- onUpdateProperty(data);
260
- };
261
167
  return /*#__PURE__*/_jsxs(_Fragment, {
262
168
  children: [/*#__PURE__*/_jsx(Box, {
263
169
  component: "div",
@@ -267,7 +173,6 @@ const TableView = props => {
267
173
  children: /*#__PURE__*/_jsxs(Box, {
268
174
  component: "table",
269
175
  sx: classes.table,
270
- ref: tableRef,
271
176
  children: [/*#__PURE__*/_jsx("thead", {
272
177
  children: /*#__PURE__*/_jsxs("tr", {
273
178
  children: [shownProperties?.map((m, i) => {
@@ -275,23 +180,26 @@ const TableView = props => {
275
180
  Icon: iconType
276
181
  } = PROPERTY_TYPES?.find(f => f.type === m.type) || {};
277
182
  const isSort = sortBy?.key === m.key ? sortBy?.operator : null;
278
- return /*#__PURE__*/_jsx(THead, {
279
- iconType: iconType,
280
- isSort: isSort,
281
- onEditProperty: onEditProperty,
282
- m: m,
283
- classes: classes,
284
- tableRef: tableRef,
285
- handleResize: handleResize
183
+ return /*#__PURE__*/_jsx("th", {
184
+ style: {
185
+ minWidth: "200px"
186
+ },
187
+ children: /*#__PURE__*/_jsx(Button, {
188
+ className: "tv-act-btn la",
189
+ startIcon: /*#__PURE__*/_jsx(Icon, {
190
+ icon: iconType
191
+ }),
192
+ endIcon: /*#__PURE__*/_jsx(SortIcon, {
193
+ sortBy: isSort
194
+ }),
195
+ fullWidth: true,
196
+ onClick: onEditProperty(m),
197
+ children: m.label
198
+ })
286
199
  }, i);
287
200
  }), !readOnly ? /*#__PURE__*/_jsxs(_Fragment, {
288
201
  children: [/*#__PURE__*/_jsx("th", {
289
202
  className: "tv-act-btn ico",
290
- style: {
291
- maxWidth: "80px",
292
- minWidth: "80px",
293
- width: "auto"
294
- },
295
203
  children: /*#__PURE__*/_jsx(Button, {
296
204
  onClick: onAddClick,
297
205
  fullWidth: true,
@@ -299,11 +207,6 @@ const TableView = props => {
299
207
  })
300
208
  }), /*#__PURE__*/_jsx("th", {
301
209
  className: "tv-act-btn ico",
302
- style: {
303
- maxWidth: "80px",
304
- minWidth: "80px",
305
- width: "auto"
306
- },
307
210
  children: /*#__PURE__*/_jsx(Button, {
308
211
  onClick: onSettings,
309
212
  fullWidth: true,
@@ -323,18 +226,18 @@ const TableView = props => {
323
226
  textTransform: "none",
324
227
  justifyContent: "start",
325
228
  color: appTheme?.palette?.editor?.activeColor,
326
- "& svg": {
327
- width: "18px",
328
- height: "18px",
229
+ '& svg': {
230
+ width: '18px',
231
+ height: '18px',
329
232
  strokeWidth: 1.2,
330
- "& path": {
233
+ '& path': {
331
234
  stroke: appTheme?.palette?.editor?.activeColor
332
235
  }
333
236
  },
334
- fontFamily: "inter"
237
+ fontFamily: 'inter'
335
238
  },
336
239
  startIcon: /*#__PURE__*/_jsx(Icon, {
337
- icon: "addRounded"
240
+ icon: 'addRounded'
338
241
  }),
339
242
  children: "Add new row"
340
243
  }) : null, open && !readOnly ? /*#__PURE__*/_jsx(PropertySettings, {
@@ -58,17 +58,17 @@ const ViewData = props => {
58
58
  }
59
59
  },
60
60
  children: [rows?.map((row, i) => {
61
- return /*#__PURE__*/_jsxs(Box, {
61
+ return /*#__PURE__*/_jsx(Box, {
62
62
  component: "tr",
63
63
  className: "tv-act-row",
64
- children: [/*#__PURE__*/_jsx(RenderRow, {
64
+ children: /*#__PURE__*/_jsx(RenderRow, {
65
65
  rowIndex: row?.id,
66
66
  row: row,
67
67
  properties: properties,
68
68
  onSelect: onSelect,
69
69
  selected: selectedRows?.includes(row?.id),
70
70
  readOnly: readOnly
71
- }), /*#__PURE__*/_jsx("td", {}), /*#__PURE__*/_jsx("td", {})]
71
+ })
72
72
  }, i);
73
73
  }), /*#__PURE__*/_jsx("tr", {
74
74
  style: {
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, useContext, useEffect, useState } from "react";
2
- import { Transforms, Node } from "slate";
2
+ import { Editor, Transforms, Node } from "slate";
3
3
  import { PROPERTY_DEFAULTS } from "../Layouts/Options/Constants";
4
4
  import multiSortRows from "../Utils/multiSortRows";
5
5
  import globalSearch from "../Utils/globalSearch";