@flozy/editor 5.3.0 → 5.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/dist/Editor/ChatEditor.js +25 -34
  2. package/dist/Editor/CommonEditor.js +20 -12
  3. package/dist/Editor/Editor.css +28 -15
  4. package/dist/Editor/Elements/AI/AIInput.js +0 -3
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  6. package/dist/Editor/Elements/Button/EditorButton.js +8 -2
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +4 -2
  8. package/dist/Editor/Elements/DataView/DataView.js +124 -0
  9. package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
  10. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +67 -0
  11. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +33 -0
  12. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +162 -0
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +40 -0
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +67 -0
  15. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +35 -0
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +39 -0
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
  21. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
  22. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +29 -0
  23. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
  24. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +74 -0
  25. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +64 -0
  26. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +106 -0
  27. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +174 -0
  28. package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
  29. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
  30. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +37 -0
  31. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +111 -0
  32. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +60 -0
  33. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +36 -0
  34. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
  35. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +160 -0
  36. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +190 -0
  37. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +42 -0
  38. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +30 -0
  39. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
  40. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +179 -0
  41. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +112 -0
  42. package/dist/Editor/Elements/DataView/Layouts/TableView.js +227 -0
  43. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +80 -0
  44. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +10 -0
  45. package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
  46. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +281 -0
  47. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
  48. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +74 -0
  49. package/dist/Editor/Elements/DataView/styles.js +154 -0
  50. package/dist/Editor/Elements/Form/Form.js +1 -0
  51. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  52. package/dist/Editor/Elements/FreeGrid/styles.js +2 -1
  53. package/dist/Editor/Elements/List/CheckList.js +2 -1
  54. package/dist/Editor/Elements/Search/SearchAttachment.js +1 -0
  55. package/dist/Editor/Elements/SimpleText/index.js +8 -1
  56. package/dist/Editor/Elements/SimpleText/style.js +10 -1
  57. package/dist/Editor/Elements/Table/Table.js +1 -1
  58. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -1
  59. package/dist/Editor/Styles/EditorStyles.js +7 -2
  60. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +10 -0
  61. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +45 -0
  62. package/dist/Editor/Toolbar/Toolbar.js +6 -0
  63. package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
  64. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  65. package/dist/Editor/common/Icon.js +6 -0
  66. package/dist/Editor/common/MentionsPopup/Styles.js +2 -5
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +1 -0
  68. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  69. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  70. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
  71. package/dist/Editor/common/RnD/Utils/gridDropItem.js +9 -6
  72. package/dist/Editor/common/RnD/index.js +3 -2
  73. package/dist/Editor/common/Shorthands/elements.js +13 -1
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
  78. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
  79. package/dist/Editor/common/Uploader.js +8 -0
  80. package/dist/Editor/common/iconListV2.js +53 -53
  81. package/dist/Editor/common/iconslist.js +6 -3
  82. package/dist/Editor/commonStyle.js +9 -0
  83. package/dist/Editor/helper/enforceDateFormat.js +41 -0
  84. package/dist/Editor/helper/index.js +16 -3
  85. package/dist/Editor/helper/theme.js +24 -1
  86. package/dist/Editor/hooks/useMouseMove.js +5 -2
  87. package/dist/Editor/plugins/withEmbeds.js +30 -26
  88. package/dist/Editor/plugins/withHTML.js +47 -12
  89. package/dist/Editor/plugins/withLayout.js +42 -0
  90. package/dist/Editor/utils/SlateUtilityFunctions.js +27 -4
  91. package/dist/Editor/utils/button.js +4 -4
  92. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +26 -1
  93. package/dist/Editor/utils/dataView.js +43 -0
  94. package/dist/Editor/utils/events.js +0 -1
  95. package/dist/Editor/utils/helper.js +51 -1
  96. package/dist/Editor/utils/pageSettings.js +14 -2
  97. package/dist/Editor/utils/serializeToText.js +2 -0
  98. package/package.json +1 -1
@@ -0,0 +1,281 @@
1
+ import React, { createContext, useContext, useEffect, useState } from "react";
2
+ import { Editor, Transforms, Node } from "slate";
3
+ import { PROPERTY_DEFAULTS } from "../Layouts/Options/Constants";
4
+ import multiSortRows from "../Utils/multiSortRows";
5
+ import globalSearch from "../Utils/globalSearch";
6
+
7
+ // Data View context
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ const DataViewContext = /*#__PURE__*/createContext();
10
+ export const useDataView = () => useContext(DataViewContext);
11
+ const DEFAULT_PROPERTIES = [{
12
+ key: "column1",
13
+ label: "Name",
14
+ dataType: "text"
15
+ }, {
16
+ key: "column2",
17
+ label: "Status",
18
+ dataType: "select",
19
+ options: ["Active", "Inactive"]
20
+ }, {
21
+ key: "column3",
22
+ label: "Agree?",
23
+ dataType: "checkbox"
24
+ }];
25
+
26
+ // Combined provider
27
+ export const DataViewProvider = ({
28
+ children,
29
+ ...props
30
+ }) => {
31
+ const {
32
+ data: initialData,
33
+ path,
34
+ editor,
35
+ users: peoples
36
+ } = props;
37
+ const dataViewNode = Node.get(editor, path);
38
+ const [layouts, setLayouts] = useState(initialData?.layouts || []);
39
+ const [seletectedLayout, setSelectedLayout] = useState({
40
+ ...(layouts[0] || {})
41
+ });
42
+ const [layoutType, setLayoutType] = useState(seletectedLayout?.type || "table");
43
+ const [properties, setProperties] = useState(initialData?.properties || [...DEFAULT_PROPERTIES]);
44
+ const [sort, setSort] = useState(seletectedLayout?.sort || []);
45
+ const [filter, setFilter] = useState(seletectedLayout?.filter || []);
46
+ const [rows, setRows] = useState(initialData?.rows || []);
47
+ const [selectedRows, setSelectedRows] = useState([]);
48
+ const [search, setSearch] = useState("");
49
+ const users = peoples?.map(m => {
50
+ return {
51
+ value: m?.name
52
+ };
53
+ });
54
+
55
+ // for undo and redo
56
+ // minimal added for perforamnce issue avoid
57
+ useEffect(() => {
58
+ setRows(dataViewNode?.rows);
59
+ }, [dataViewNode?.rows?.length]);
60
+ useEffect(() => {
61
+ setProperties(dataViewNode?.properties);
62
+ }, [dataViewNode?.properties?.length]);
63
+
64
+ // re-order when sort val changes
65
+ useEffect(() => {
66
+ if ((sort?.length > 0 || search) && rows?.length > 0) {
67
+ const reOrderRows = sort?.length > 0 ? multiSortRows(initialData?.rows, sort, properties) : [...initialData?.rows];
68
+ setRows(globalSearch(reOrderRows, search));
69
+ } else {
70
+ // reset to default order
71
+ setRows(globalSearch(initialData?.rows || [], search));
72
+ }
73
+ }, [sort, search]);
74
+ const onAddProperty = (data, overrides = {}) => {
75
+ try {
76
+ const {
77
+ type
78
+ } = data;
79
+ const key = `col_${new Date().getTime()}`;
80
+ const newProperty = {
81
+ ...(PROPERTY_DEFAULTS[type] || {}),
82
+ ...overrides,
83
+ key: key,
84
+ type
85
+ };
86
+ const updatedProperties = [...properties, {
87
+ ...newProperty
88
+ }];
89
+ Transforms.setNodes(editor, {
90
+ properties: [...updatedProperties]
91
+ }, {
92
+ at: path
93
+ });
94
+ setProperties([...updatedProperties]);
95
+ return newProperty;
96
+ } catch (err) {
97
+ console.log(err);
98
+ }
99
+ };
100
+ const onUpdateProperty = (data, isDelete = false) => {
101
+ try {
102
+ const {
103
+ key
104
+ } = data;
105
+ let up = {
106
+ ...data
107
+ };
108
+ const updatedProperties = properties?.map(m => {
109
+ if (m.key === key) {
110
+ up = {
111
+ ...m,
112
+ ...data
113
+ };
114
+ return up;
115
+ }
116
+ return m;
117
+ });
118
+ if (isDelete) {
119
+ const deleteIndex = updatedProperties.findIndex(f => f.key === key);
120
+ updatedProperties.splice(deleteIndex, 1);
121
+ }
122
+ Transforms.setNodes(editor, {
123
+ properties: [...updatedProperties]
124
+ }, {
125
+ at: path
126
+ });
127
+ setProperties([...updatedProperties]);
128
+ return up;
129
+ } catch (err) {
130
+ console.log(err);
131
+ }
132
+ };
133
+ const onChange = (rowIndex, rowData) => {
134
+ try {
135
+ const updatedRows = rows?.map(m => {
136
+ if (m?.id === rowIndex) {
137
+ m = {
138
+ ...m,
139
+ ...rowData
140
+ };
141
+ }
142
+ return m;
143
+ });
144
+ Transforms.setNodes(editor, {
145
+ rows: [...updatedRows]
146
+ }, {
147
+ at: path
148
+ });
149
+ setRows(updatedRows);
150
+ } catch (err) {
151
+ console.log(err);
152
+ }
153
+ };
154
+ const onAddRow = () => {
155
+ try {
156
+ const newRow = properties?.reduce((a, b) => {
157
+ a[b.key] = "";
158
+ return a;
159
+ }, {
160
+ id: `row_${new Date().getTime()}`
161
+ });
162
+ const updatedRows = [...rows, newRow];
163
+ Transforms.setNodes(editor, {
164
+ rows: [...updatedRows]
165
+ }, {
166
+ at: path
167
+ });
168
+ setRows(updatedRows);
169
+ } catch (err) {
170
+ console.log(err);
171
+ }
172
+ };
173
+ const formatSort = (sorts = [], sortData, isDelete = false) => {
174
+ let upSort = [];
175
+ const isUpdate = sorts?.find(f => f.key === sortData?.key);
176
+ if (isUpdate) {
177
+ // update if any
178
+ upSort = sorts?.map(m => {
179
+ if (m.key === sortData.key) {
180
+ // if update col
181
+ if (sortData["newKey"]) {
182
+ sortData["key"] = sortData["newKey"];
183
+ delete sortData["newKey"];
184
+ }
185
+ return {
186
+ ...sortData
187
+ };
188
+ }
189
+ return m;
190
+ });
191
+ } else {
192
+ upSort = [...sorts, {
193
+ ...sortData
194
+ }];
195
+ }
196
+
197
+ // if no sort
198
+ if (sorts?.length === 0 && !isDelete) {
199
+ upSort = [{
200
+ ...sortData
201
+ }];
202
+ }
203
+
204
+ // if delete
205
+ if (isDelete) {
206
+ const deleteIndex = upSort.findIndex(f => f.key === sortData.key);
207
+ upSort.splice(deleteIndex, 1);
208
+ }
209
+ return upSort;
210
+ };
211
+ const onUpdateSort = (sortData = {}, isDelete = false, deleteAll = false) => {
212
+ try {
213
+ let upSort = {};
214
+ const updatedLayouts = layouts?.map((m, i) => {
215
+ if (seletectedLayout?.key === m.key) {
216
+ upSort = !deleteAll ? formatSort(m?.sort || [], sortData, isDelete) : [];
217
+ return {
218
+ ...m,
219
+ sort: [...upSort]
220
+ };
221
+ }
222
+ return m;
223
+ });
224
+ Transforms.setNodes(editor, {
225
+ layouts: [...updatedLayouts]
226
+ }, {
227
+ at: path
228
+ });
229
+ setLayouts(updatedLayouts);
230
+ setSort(upSort);
231
+ } catch (err) {
232
+ console.log(err);
233
+ }
234
+ };
235
+ const onDeleteRows = () => {
236
+ try {
237
+ const updatedRows = [...rows].filter(f => selectedRows.includes(f.id) === false);
238
+ Transforms.setNodes(editor, {
239
+ rows: [...updatedRows]
240
+ }, {
241
+ at: path
242
+ });
243
+ setRows(updatedRows);
244
+ setSelectedRows([]);
245
+ } catch (err) {
246
+ console.log(err);
247
+ }
248
+ };
249
+ const onSearch = e => {
250
+ setSearch(e?.target?.value);
251
+ };
252
+ const value = {
253
+ layoutType,
254
+ setLayoutType,
255
+ properties,
256
+ setProperties,
257
+ rows,
258
+ setRows,
259
+ onAddProperty,
260
+ layouts,
261
+ setLayouts,
262
+ onUpdateProperty,
263
+ onChange,
264
+ onAddRow,
265
+ users: users,
266
+ onUpdateSort,
267
+ sort,
268
+ filter,
269
+ setSelectedLayout,
270
+ setFilter,
271
+ selectedRows,
272
+ setSelectedRows,
273
+ onDeleteRows,
274
+ search,
275
+ onSearch
276
+ };
277
+ return /*#__PURE__*/_jsx(DataViewContext.Provider, {
278
+ value: value,
279
+ children: children
280
+ });
281
+ };
@@ -0,0 +1,15 @@
1
+ const globalSearch = (array, searchTerm) => {
2
+ if (!searchTerm) {
3
+ return array;
4
+ }
5
+ const lowerCaseSearchTerm = searchTerm.toLowerCase();
6
+ return array.filter(item => Object.values(item).some(value => {
7
+ if (typeof value === "string" && value) {
8
+ return value?.toLowerCase().includes(lowerCaseSearchTerm);
9
+ } else if (Array.isArray(value)) {
10
+ return value?.map(m => m?.value).some(d => d.toLowerCase().includes(lowerCaseSearchTerm));
11
+ }
12
+ return false;
13
+ }));
14
+ };
15
+ export default globalSearch;
@@ -0,0 +1,74 @@
1
+ function sortByDate(a, b) {
2
+ const dateA = new Date(a);
3
+ const dateB = new Date(b);
4
+
5
+ // Check if both dates are valid
6
+ const isValidA = !isNaN(dateA.getTime());
7
+ const isValidB = !isNaN(dateB.getTime());
8
+ if (isValidA && isValidB) {
9
+ // Compare valid dates
10
+ return dateA - dateB;
11
+ } else if (isValidA) {
12
+ // Invalid date in `b` pushes `a` before `b`
13
+ return -1;
14
+ } else if (isValidB) {
15
+ // Invalid date in `a` pushes `b` before `a`
16
+ return 1;
17
+ } else {
18
+ // Both are invalid, maintain their relative order
19
+ return 0;
20
+ }
21
+ }
22
+
23
+ /**
24
+ * Multi-sort rows based on multiple criteria.
25
+ * @param {Array} rows - Array of row objects.
26
+ * @param {Array} criteria - Array of sort criteria [{key, sortBy}].
27
+ * @param {Object} columnConfig - Column configurations with data types.
28
+ */
29
+ const multiSortRows = (rows, criteria, columnConfig) => {
30
+ return rows.slice().sort((a, b) => {
31
+ for (let {
32
+ key,
33
+ operator
34
+ } of criteria) {
35
+ const column = columnConfig.find(col => col.key === key);
36
+ if (!column) continue;
37
+ const dataType = column.type;
38
+ const valueA = a[key];
39
+ const valueB = b[key];
40
+ let comparison = 0;
41
+ switch (dataType) {
42
+ case "text":
43
+ comparison = valueA.localeCompare(valueB, undefined, {
44
+ sensitivity: "base"
45
+ });
46
+ break;
47
+ case "number":
48
+ comparison = parseInt(valueA || 0) - parseInt(valueB || 0);
49
+ break;
50
+ case "select":
51
+ case "multi-select":
52
+ if (Array.isArray(valueA) && Array.isArray(valueB)) {
53
+ comparison = Array.isArray(valueA) ? valueA?.map(m => m?.value).join(", ").localeCompare(valueB?.map(m => m?.value).join(", "), undefined, {
54
+ sensitivity: "base"
55
+ }) : 0;
56
+ }
57
+ break;
58
+ case "date":
59
+ comparison = sortByDate(valueA, valueB);
60
+ break;
61
+ case "check":
62
+ return valueA && operator === "desc" ? 1 : -1;
63
+ default:
64
+ break;
65
+ }
66
+ if (comparison !== 0) {
67
+ return operator === "asc" ? comparison : -comparison;
68
+ }
69
+ }
70
+ return 0; // Rows are equal based on all criteria
71
+ });
72
+ };
73
+
74
+ export default multiSortRows;
@@ -0,0 +1,154 @@
1
+ const useDataViewStyles = (theme, appTheme) => ({
2
+ root: {
3
+ width: "100%",
4
+ overflowX: "auto",
5
+ marginTop: "8px",
6
+ "& table": {
7
+ width: "100%",
8
+ "& th.fe-tv-ap-ico": {
9
+ width: "50px"
10
+ }
11
+ },
12
+ "& table th": {
13
+ cursor: "pointer",
14
+ width: "200px"
15
+ },
16
+ "& table, th, td": {
17
+ border: "1px solid black",
18
+ borderCollapse: "collapse"
19
+ },
20
+ "& .react-datepicker-wrapper": {
21
+ width: "100%",
22
+ "& input": {
23
+ padding: "6px 12px"
24
+ }
25
+ },
26
+ "& .MuiInputBase-root": {
27
+ "& fieldset": {
28
+ border: "none"
29
+ }
30
+ },
31
+ // filter view
32
+ "& .fe-tv-fv": {
33
+ marginBottom: "8px",
34
+ "& .mr": {
35
+ marginRight: "4px"
36
+ },
37
+ [theme?.breakpoints?.between("xs", "md")]: {
38
+ display: "flex",
39
+ flexDirection: "column"
40
+ }
41
+ },
42
+ "& .tv-act-row": {
43
+ "& .tv-tr-pop": {
44
+ opacity: 0,
45
+ "&.active": {
46
+ opacity: 1
47
+ },
48
+ "& .tv-ck-box": {
49
+ "& svg": {
50
+ color: appTheme?.palette?.editor?.tv_border
51
+ },
52
+ "&.Mui-checked": {
53
+ "& svg": {
54
+ color: "rgba(37, 99, 235, 1)"
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "&:hover": {
60
+ "& .tv-tr-pop": {
61
+ opacity: 1
62
+ }
63
+ }
64
+ }
65
+ },
66
+ filterView: {
67
+ display: "flex",
68
+ justifyContent: "space-between",
69
+ alignItems: "center",
70
+ "& .MuiButtonBase-root": {
71
+ padding: "6px",
72
+ marginLeft: "4px",
73
+ width: "29px",
74
+ height: "29px",
75
+ "&.active": {
76
+ color: "rgba(37, 99, 235, 1)"
77
+ }
78
+ },
79
+ "& .tv-sb": {
80
+ display: "flex",
81
+ border: "1px solid transparent",
82
+ width: "24px",
83
+ transition: "width 1s",
84
+ "&.open": {
85
+ width: "fit-content",
86
+ border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
87
+ boxShadow: "0px 4px 18px 0px #0000000D",
88
+ borderRadius: "8px"
89
+ },
90
+ "& input": {
91
+ paddingBottom: "0px",
92
+ fontSize: "14px"
93
+ }
94
+ },
95
+ "& .tv-title-wrpr, .tv-fi-wrpr": {
96
+ display: "flex",
97
+ "& button": {
98
+ color: appTheme?.palette?.editor?.tv_text
99
+ },
100
+ "& input": {
101
+ color: appTheme?.palette?.editor?.tv_text
102
+ }
103
+ },
104
+ "& .tv-title-wrpr": {
105
+ width: "80%",
106
+ marginRight: "8px",
107
+ "& .MuiInputBase-root": {
108
+ width: "100%"
109
+ },
110
+ "& .MuiInputBase-input": {
111
+ paddingBottom: "0px",
112
+ fontWeight: "bold",
113
+ fontSize: "16px"
114
+ },
115
+ [theme?.breakpoints?.between("xs", "md")]: {
116
+ width: "100%",
117
+ marginRight: "0px"
118
+ }
119
+ },
120
+ "& .tv-fi-wrpr": {
121
+ [theme?.breakpoints?.between("xs", "md")]: {
122
+ width: "100%",
123
+ justifyContent: "end"
124
+ }
125
+ }
126
+ },
127
+ basicMenu: {
128
+ "& .MuiPaper-root": {
129
+ padding: "0px 6px",
130
+ width: "150px",
131
+ border: `1px solid ${appTheme?.palette?.editor?.tv_border}`,
132
+ borderRadius: "8px",
133
+ background: appTheme?.palette?.editor?.tv_pop_bg,
134
+ color: appTheme?.palette?.editor?.tv_text_primary,
135
+ "& .MuiButtonBase-root": {
136
+ fontSize: "14px",
137
+ "& svg": {
138
+ width: "16px",
139
+ height: "16px",
140
+ color: `${appTheme?.palette?.editor?.tv_text}`
141
+ },
142
+ "&:hover": {
143
+ background: appTheme?.palette?.editor?.tv_hover_bg,
144
+ borderRadius: "8px",
145
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`,
146
+ "& svg": {
147
+ color: `${appTheme?.palette?.editor?.tv_hover_text} !important`
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+ });
154
+ export default useDataViewStyles;
@@ -402,6 +402,7 @@ const Form = props => {
402
402
  borderStyle: borderStyle || "solid",
403
403
  background: bgColor || "transparent",
404
404
  position: "relative",
405
+ lineHeight: 1.43,
405
406
  ...formSX
406
407
  },
407
408
  ref: formEle,
@@ -47,22 +47,22 @@ export function wrapThemeBreakpoints(sxProp, prop, theme) {
47
47
  const formatedSxProp = Object.keys(sxProp).reduce((a, b) => {
48
48
  switch (b) {
49
49
  case "md":
50
- a[theme.breakpoints.up("lg")] = {
50
+ a[theme?.breakpoints?.up("lg")] = {
51
51
  [prop]: sxProp["md"] || sxProp["lg"]
52
52
  };
53
53
  break;
54
54
  case "sm":
55
- a[theme.breakpoints.up("lg")] = {
55
+ a[theme?.breakpoints?.up("lg")] = {
56
56
  [prop]: sxProp["sm"] || sxProp["lg"]
57
57
  };
58
58
  break;
59
59
  case "xs":
60
- a[theme.breakpoints.between("xs", "md")] = {
60
+ a[theme?.breakpoints?.between("xs", "md")] = {
61
61
  [prop]: sxProp["xs"] || sxProp["lg"]
62
62
  };
63
63
  break;
64
64
  default:
65
- a[theme.breakpoints.up("lg")] = {
65
+ a[theme?.breakpoints?.up("lg")] = {
66
66
  [prop]: sxProp["lg"]
67
67
  };
68
68
  }
@@ -171,6 +171,7 @@ const useFreeGridStyles = ({
171
171
  height: "100%",
172
172
  "& .signature-container": {
173
173
  height: "100%",
174
+ LineHeight: 1.43,
174
175
  "& .signature-btn-container": {
175
176
  height: "100%",
176
177
  display: "flex",
@@ -318,7 +319,7 @@ const useFreeGridStyles = ({
318
319
  "& .element-toolbar": {
319
320
  display: "none"
320
321
  },
321
- [theme.breakpoints.between("xs", "md")]: {
322
+ [theme?.breakpoints?.between("xs", "md")]: {
322
323
  marginLeft: `calc((100% - 320px) * 0.5)`
323
324
  }
324
325
  },
@@ -39,7 +39,8 @@ const CheckList = ({
39
39
  display: "flex",
40
40
  justifyContent: "center",
41
41
  alignItems: "center",
42
- ...(style || {})
42
+ ...(style || {}),
43
+ lineHeight: 1.43
43
44
  },
44
45
  children: [/*#__PURE__*/_jsxs("div", {
45
46
  contentEditable: false,
@@ -49,6 +49,7 @@ const SearchAttachment = props => {
49
49
  background: theme?.palette?.containers?.slashBrainCardBg,
50
50
  cursor: 'pointer',
51
51
  margin: '4px 0px',
52
+ lineHeight: 1.43,
52
53
  "&.MuiPaper-root.MuiPaper-rounded": {
53
54
  borderRadius: "7px !important",
54
55
  paddingTop: '0px !important'
@@ -5,6 +5,7 @@ import { getPageSettings } from "../../utils/pageSettings";
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";
@@ -32,8 +33,14 @@ const SimpleText = props => {
32
33
  const {
33
34
  pageColor
34
35
  } = pageSt?.pageProps || {};
36
+ const {
37
+ activeBreakPoint
38
+ } = useEditorContext();
39
+ const lineHeight = element?.children[0]?.lineHeight;
40
+ const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
35
41
  const classes = SimpleTextStyle({
36
- pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF"
42
+ pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF",
43
+ lineHeight: lineH
37
44
  });
38
45
  const selected = useSelected();
39
46
  const path = ReactEditor.findPath(editor, element);
@@ -1,10 +1,17 @@
1
1
  import { invertColor } from "../../helper";
2
2
  const SimpleTextStyle = ({
3
- pageColor
3
+ pageColor,
4
+ lineHeight
4
5
  }) => ({
5
6
  root: {
6
7
  position: "relative",
7
8
  padding: "0px",
9
+ lineHeight: lineHeight,
10
+ "&.dataView": {
11
+ "& .placeholder-simple-text": {
12
+ opacity: 0
13
+ }
14
+ },
8
15
  "&.signature": {
9
16
  "& .placeholder-simple-text": {
10
17
  opacity: 0
@@ -28,6 +35,8 @@ const SimpleTextStyle = ({
28
35
  height: "24px",
29
36
  overflow: "hidden",
30
37
  fontSize: "14px",
38
+ display: "inline-flex",
39
+ alignItems: "center",
31
40
  "& .bg-pad-sl": {
32
41
  padding: "2px 4px 2px 4px",
33
42
  background: "transparent",
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { Editor, Transforms } from "slate";
3
3
  import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme, Popper, Fade, ClickAwayListener } from "@mui/material";
4
+ import { Box, IconButton, Tooltip, Table as TableComp, TableBody, useTheme, Popper, ClickAwayListener } from "@mui/material";
5
5
  import { TableUtil } from "../../utils/table";
6
6
  import TablePopup from "./TablePopup";
7
7
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
@@ -77,6 +77,7 @@ const TopBanner = props => {
77
77
  theme
78
78
  } = useEditorContext();
79
79
  const classes = TopBannerStyles(theme);
80
+ const renderHeaderAboveBanner = customProps?.metadata?.renderHeader ? customProps.metadata.renderHeader() : null;
80
81
  return /*#__PURE__*/_jsxs(Box, {
81
82
  component: "div",
82
83
  ...attributes,
@@ -87,7 +88,7 @@ const TopBanner = props => {
87
88
  },
88
89
  contentEditable: false,
89
90
  sx: classes.root,
90
- children: [/*#__PURE__*/_jsx("img", {
91
+ children: [renderHeaderAboveBanner, /*#__PURE__*/_jsx("img", {
91
92
  src: url,
92
93
  alt: "Top Banner",
93
94
  className: "top-banner-wrpr-ele",
@@ -286,8 +286,13 @@ const editorStyles = ({
286
286
  }
287
287
  },
288
288
  "& ::selection": {
289
- color: "inherit",
290
- background: "#EAEBFE"
289
+ background: 'rgba(35, 131, 226, 0.35)!important',
290
+ color: 'inherit'
291
+ },
292
+ "&.readOnlyContainer": {
293
+ "& .max-content": {
294
+ paddingBottom: "0px !important"
295
+ }
291
296
  }
292
297
  },
293
298
  fullScreenWrapper: {