@flozy/editor 8.0.5 → 8.0.7

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 (130) hide show
  1. package/dist/Editor/ChatEditor.js +1 -2
  2. package/dist/Editor/CommonEditor.js +33 -112
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +16 -32
  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 +4 -4
  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 -28
  16. package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -122
  17. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  18. package/dist/Editor/Elements/DataView/styles.js +8 -8
  19. package/dist/Editor/Elements/Embed/Image.js +2 -2
  20. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -0
  21. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +1 -2
  22. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -2
  23. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  24. package/dist/Editor/Elements/Grid/GridItem.js +3 -2
  25. package/dist/Editor/Elements/Link/Link.js +43 -70
  26. package/dist/Editor/Elements/SimpleText/index.js +12 -7
  27. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  28. package/dist/Editor/Elements/Table/Table.js +16 -17
  29. package/dist/Editor/Elements/Table/TableCell.js +3 -4
  30. package/dist/Editor/Elements/Title/title.js +1 -13
  31. package/dist/Editor/Elements/Variables/Style.js +2 -28
  32. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  33. package/dist/Editor/Styles/EditorStyles.js +291 -287
  34. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  35. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  36. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  37. package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
  38. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +0 -1
  39. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
  40. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +85 -210
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
  43. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
  44. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +9 -56
  45. package/dist/Editor/Toolbar/PopupTool/index.js +56 -34
  46. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  47. package/dist/Editor/common/ColorPickerButton.js +9 -35
  48. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  49. package/dist/Editor/common/DnD/Draggable.js +1 -0
  50. package/dist/Editor/common/FontLoader/FontList.js +11 -3
  51. package/dist/Editor/common/FontLoader/FontLoader.js +42 -74
  52. package/dist/Editor/common/Icon.js +0 -28
  53. package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -2
  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/LinkSettings/NavComponents.js +5 -0
  57. package/dist/Editor/common/LinkSettings/index.js +5 -0
  58. package/dist/Editor/common/MentionsPopup/Styles.js +12 -6
  59. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  66. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  68. package/dist/Editor/common/RnD/ElementSettings/styles.js +2 -0
  69. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -8
  70. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  71. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  72. package/dist/Editor/common/RnD/Utils/index.js +0 -45
  73. package/dist/Editor/common/RnD/index.js +3 -23
  74. package/dist/Editor/common/Section/index.js +89 -60
  75. package/dist/Editor/common/Shorthands/elements.js +0 -54
  76. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  81. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
  82. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  83. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  84. package/dist/Editor/common/Uploader.js +0 -8
  85. package/dist/Editor/commonStyle.js +69 -114
  86. package/dist/Editor/helper/deserialize/index.js +1 -1
  87. package/dist/Editor/helper/index.js +2 -2
  88. package/dist/Editor/helper/theme.js +2 -200
  89. package/dist/Editor/hooks/useDrag.js +11 -17
  90. package/dist/Editor/hooks/useEditorScroll.js +2 -1
  91. package/dist/Editor/hooks/useMouseMove.js +3 -9
  92. package/dist/Editor/plugins/withEmbeds.js +1 -1
  93. package/dist/Editor/plugins/withHTML.js +21 -20
  94. package/dist/Editor/plugins/withLayout.js +1 -1
  95. package/dist/Editor/plugins/withTable.js +1 -1
  96. package/dist/Editor/theme/ThemeList.js +173 -50
  97. package/dist/Editor/utils/SlateUtilityFunctions.js +49 -157
  98. package/dist/Editor/utils/button.js +14 -0
  99. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -23
  100. package/dist/Editor/utils/draftToSlate.js +2 -3
  101. package/dist/Editor/utils/font.js +37 -40
  102. package/dist/Editor/utils/helper.js +19 -59
  103. package/dist/Editor/utils/link.js +1 -1
  104. package/package.json +3 -6
  105. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  106. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  107. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  108. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  109. package/dist/Editor/common/CustomDialog/index.js +0 -90
  110. package/dist/Editor/common/CustomDialog/style.js +0 -67
  111. package/dist/Editor/common/CustomDialog/styles.js +0 -80
  112. package/dist/Editor/common/CustomSelect.js +0 -33
  113. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  114. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  115. package/dist/Editor/theme/index.js +0 -144
  116. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  117. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  118. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  119. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  120. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  121. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  122. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  123. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  124. package/dist/Editor/themeSettings/icons.js +0 -60
  125. package/dist/Editor/themeSettings/index.js +0 -320
  126. package/dist/Editor/themeSettings/style.js +0 -152
  127. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  128. package/dist/Editor/themeSettingsAI/index.js +0 -356
  129. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  130. 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
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";
@@ -95,10 +95,10 @@ const ColorPicker = props => {
95
95
  horizontal: "top"
96
96
  },
97
97
  sx: classes.colorPickerPopup,
98
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
98
+ children: /*#__PURE__*/_jsx(ColorPickerTool, {
99
99
  gradient: true,
100
- onChange: handleFormSubmit,
101
- color: activeColor
100
+ value: activeColor,
101
+ onChange: handleFormSubmit
102
102
  })
103
103
  })]
104
104
  });
@@ -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;
@@ -11,13 +11,11 @@ const useTableStyles = (theme, appTheme) => ({
11
11
  borderRadius: "7px 7px 0px 0px",
12
12
  overflow: "hidden",
13
13
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
14
- tableLayout: "fixed",
15
14
  "& thead": {
16
15
  background: appTheme?.palette?.editor?.tv_header,
17
16
  height: "40px"
18
17
  },
19
18
  "& th": {
20
- position: "relative",
21
19
  "& svg": {
22
20
  "& .fillStroke": {
23
21
  stroke: appTheme?.palette?.editor?.tv_stroke
@@ -41,11 +39,6 @@ const useTableStyles = (theme, appTheme) => ({
41
39
  "& th, tr, td": {
42
40
  border: `1px solid ${appTheme?.palette?.editor?.tv_border}`
43
41
  },
44
- "& th, & td": {
45
- overflowX: "clip",
46
- textOverflow: "ellipsis",
47
- whiteSpace: "nowrap"
48
- },
49
42
  "& .tv-act-btn": {
50
43
  color: appTheme?.palette?.editor?.tv_text,
51
44
  textTransform: "none",
@@ -92,18 +85,13 @@ const useTableStyles = (theme, appTheme) => ({
92
85
  paddingTop: "3px",
93
86
  paddingBottom: "3px",
94
87
  paddingLeft: "3px",
95
- // maxWidth: "250px",
88
+ maxWidth: "250px",
96
89
  overflow: "hidden",
97
90
  position: "relative",
98
91
  "& .tv-ms-tag-wrpr": {
99
92
  display: "flex",
100
93
  flexWrap: "nowrap",
101
- overflow: "auto",
102
- minWidth: "58px",
103
- "& .MuiChip-deleteIcon": {
104
- minWidth: "22px",
105
- minHeight: "22px"
106
- }
94
+ overflow: "auto"
107
95
  },
108
96
  "&.Mui-disabled": {
109
97
  "& input": {
@@ -141,20 +129,6 @@ const useTableStyles = (theme, appTheme) => ({
141
129
  opacity: 1
142
130
  }
143
131
  }
144
- },
145
- cellResizer: {
146
- position: "absolute",
147
- cursor: "col-resize",
148
- right: "0px",
149
- top: 0,
150
- width: "3px",
151
- borderRadius: "0px",
152
- zIndex: 1,
153
- background: "transparent",
154
- height: "100%",
155
- "&:hover, &.active": {
156
- background: "#2563EB"
157
- }
158
132
  }
159
133
  });
160
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,21 +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
- widht: "autp"
292
- },
293
203
  children: /*#__PURE__*/_jsx(Button, {
294
204
  onClick: onAddClick,
295
205
  fullWidth: true,
@@ -297,9 +207,6 @@ const TableView = props => {
297
207
  })
298
208
  }), /*#__PURE__*/_jsx("th", {
299
209
  className: "tv-act-btn ico",
300
- style: {
301
- widht: "autp"
302
- },
303
210
  children: /*#__PURE__*/_jsx(Button, {
304
211
  onClick: onSettings,
305
212
  fullWidth: true,
@@ -319,18 +226,18 @@ const TableView = props => {
319
226
  textTransform: "none",
320
227
  justifyContent: "start",
321
228
  color: appTheme?.palette?.editor?.activeColor,
322
- "& svg": {
323
- width: "18px",
324
- height: "18px",
229
+ '& svg': {
230
+ width: '18px',
231
+ height: '18px',
325
232
  strokeWidth: 1.2,
326
- "& path": {
233
+ '& path': {
327
234
  stroke: appTheme?.palette?.editor?.activeColor
328
235
  }
329
236
  },
330
- fontFamily: "inter"
237
+ fontFamily: 'inter'
331
238
  },
332
239
  startIcon: /*#__PURE__*/_jsx(Icon, {
333
- icon: "addRounded"
240
+ icon: 'addRounded'
334
241
  }),
335
242
  children: "Add new row"
336
243
  }) : null, open && !readOnly ? /*#__PURE__*/_jsx(PropertySettings, {
@@ -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";
@@ -11,7 +11,7 @@ const useDataViewStyles = (theme, appTheme) => ({
11
11
  },
12
12
  "& table th": {
13
13
  cursor: "pointer",
14
- minWidth: "200px"
14
+ width: "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
  }