@flozy/editor 5.3.6 → 5.3.8

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 (102) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +8 -16
  3. package/dist/Editor/Editor.css +11 -57
  4. package/dist/Editor/Elements/AI/AIInput.js +1 -0
  5. package/dist/Editor/Elements/AI/CustomSelect.js +11 -19
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -9
  7. package/dist/Editor/Elements/AI/Styles.js +5 -17
  8. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -11
  9. package/dist/Editor/Elements/Color Picker/ColorButtons.js +3 -3
  10. package/dist/Editor/Elements/Color Picker/Styles.js +3 -7
  11. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  12. package/dist/Editor/Elements/Divider/Divider.js +15 -16
  13. package/dist/Editor/Elements/Embed/Image.js +7 -23
  14. package/dist/Editor/Elements/Embed/Video.js +1 -13
  15. package/dist/Editor/Elements/Form/Form.js +2 -38
  16. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  17. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  18. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  19. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  20. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  21. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  22. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  23. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  24. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  25. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  26. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  27. package/dist/Editor/Elements/Grid/GridItem.js +36 -45
  28. package/dist/Editor/Elements/Grid/Styles.js +0 -6
  29. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  30. package/dist/Editor/Elements/Search/SearchButton.js +0 -1
  31. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  32. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  33. package/dist/Editor/Elements/Signature/SignaturePopup.js +48 -13
  34. package/dist/Editor/Elements/SimpleText/style.js +0 -10
  35. package/dist/Editor/Elements/Table/Styles.js +79 -82
  36. package/dist/Editor/Elements/Table/Table.js +140 -260
  37. package/dist/Editor/Elements/Table/TableCell.js +103 -362
  38. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  39. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  40. package/dist/Editor/Styles/EditorStyles.js +1 -8
  41. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  42. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
  43. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -10
  44. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  45. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
  46. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +6 -3
  47. package/dist/Editor/Toolbar/Mini/Styles.js +1 -4
  48. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
  49. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
  50. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +49 -409
  51. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +8 -17
  52. package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
  53. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  54. package/dist/Editor/common/ColorPickerButton.js +44 -82
  55. package/dist/Editor/common/Icon.js +20 -17
  56. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  57. package/dist/Editor/common/LinkSettings/index.js +1 -2
  58. package/dist/Editor/common/MentionsPopup/Styles.js +8 -156
  59. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -107
  61. package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
  62. package/dist/Editor/common/RnD/index.js +1 -1
  63. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +4 -8
  64. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +7 -7
  65. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -5
  66. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  67. package/dist/Editor/common/StyleBuilder/index.js +11 -84
  68. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  69. package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
  70. package/dist/Editor/common/iconListV2.js +40 -378
  71. package/dist/Editor/common/iconslist.js +14 -17
  72. package/dist/Editor/commonStyle.js +10 -130
  73. package/dist/Editor/helper/deserialize/index.js +20 -27
  74. package/dist/Editor/helper/index.js +1 -1
  75. package/dist/Editor/plugins/withCustomDeleteBackward.js +2 -3
  76. package/dist/Editor/plugins/withHTML.js +10 -61
  77. package/dist/Editor/plugins/withLayout.js +0 -1
  78. package/dist/Editor/utils/SlateUtilityFunctions.js +0 -2
  79. package/dist/Editor/utils/brains.js +1 -1
  80. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
  81. package/dist/Editor/utils/customHooks/useResize.js +4 -7
  82. package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
  83. package/dist/Editor/utils/embed.js +1 -2
  84. package/dist/Editor/utils/events.js +1 -0
  85. package/dist/Editor/utils/font.js +4 -11
  86. package/dist/Editor/utils/formfield.js +4 -8
  87. package/dist/Editor/utils/helper.js +2 -55
  88. package/dist/Editor/utils/insertNewLine.js +1 -19
  89. package/dist/Editor/utils/serializeToText.js +0 -2
  90. package/dist/Editor/utils/table.js +24 -228
  91. package/package.json +1 -1
  92. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  93. package/dist/Editor/Elements/Table/DragButton.js +0 -142
  94. package/dist/Editor/Elements/Table/DragStyles.js +0 -70
  95. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  96. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  97. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  98. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  99. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  100. package/dist/Editor/common/Select/index.js +0 -20
  101. package/dist/Editor/common/Select/styles.js +0 -17
  102. package/dist/Editor/hooks/useTable.js +0 -207
@@ -138,8 +138,8 @@ export const StrikethroughIcon = props => /*#__PURE__*/_jsx("svg", {
138
138
  children: /*#__PURE__*/_jsx("path", {
139
139
  className: "strokeFillPath",
140
140
  d: "M2.7607 11.125C2.7607 13.0718 4.33885 14.65 6.28568 14.65H8.21432C10.1611 14.65 11.7393 13.0718 11.7393 11.125V10.6429C11.7393 9.78254 11.4309 8.99403 10.9189 8.38214H13.5179C13.867 8.38214 14.15 8.0991 14.15 7.75C14.15 7.4009 13.867 7.11786 13.5179 7.11786H8.21597H8.21435H6.28579C5.03727 7.11786 4.02509 6.10568 4.02509 4.85714V4.375C4.02509 3.12647 5.03727 2.11429 6.28579 2.11429H8.21435C9.46288 2.11429 10.4751 3.12647 10.4751 4.375V4.84874C10.4751 5.19784 10.7581 5.48088 11.1072 5.48088C11.4563 5.48088 11.7393 5.19784 11.7393 4.84874V4.375C11.7393 2.42817 10.1612 0.85 8.21435 0.85H6.28579C4.33897 0.85 2.76081 2.42817 2.76081 4.375V4.85714C2.76081 5.71746 3.06916 6.50597 3.58108 7.11786H0.982141C0.633044 7.11786 0.35 7.4009 0.35 7.75C0.35 8.0991 0.633044 8.38214 0.982141 8.38214H8.21424L8.21556 8.38214C8.21559 8.38214 8.21562 8.38214 8.21564 8.38214C9.46353 8.38289 10.4749 9.39474 10.4749 10.6429V11.125C10.4749 12.3735 9.46276 13.3857 8.21424 13.3857H6.28568C5.03715 13.3857 4.02498 12.3735 4.02498 11.125V10.6429C4.02498 10.2938 3.74193 10.0107 3.39284 10.0107C3.04374 10.0107 2.7607 10.2938 2.7607 10.6429V11.125Z",
141
- fill: "currentColor",
142
- stroke: "currentColor",
141
+ fill: "#64748B",
142
+ stroke: "#64748B",
143
143
  strokeWidth: "0.3"
144
144
  })
145
145
  });
@@ -864,19 +864,19 @@ export const TextLeftAlign = props => /*#__PURE__*/_jsxs("svg", {
864
864
  children: [/*#__PURE__*/_jsx("path", {
865
865
  className: "fillPath",
866
866
  d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
867
- fill: "#64748B"
867
+ fill: "#292D32"
868
868
  }), /*#__PURE__*/_jsx("path", {
869
869
  className: "fillPath",
870
870
  d: "M12.47 11.0557H3C2.59 11.0557 2.25 10.7157 2.25 10.3057C2.25 9.89566 2.59 9.55566 3 9.55566H12.47C12.88 9.55566 13.22 9.89566 13.22 10.3057C13.22 10.7157 12.89 11.0557 12.47 11.0557Z",
871
- fill: "#64748B"
871
+ fill: "#292D32"
872
872
  }), /*#__PURE__*/_jsx("path", {
873
873
  className: "fillPath",
874
874
  d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
875
- fill: "#64748B"
875
+ fill: "#292D32"
876
876
  }), /*#__PURE__*/_jsx("path", {
877
877
  className: "fillPath",
878
878
  d: "M12.47 21.0557H3C2.59 21.0557 2.25 20.7157 2.25 20.3057C2.25 19.8957 2.59 19.5557 3 19.5557H12.47C12.88 19.5557 13.22 19.8957 13.22 20.3057C13.22 20.7157 12.89 21.0557 12.47 21.0557Z",
879
- fill: "#64748B"
879
+ fill: "#292D32"
880
880
  })]
881
881
  });
882
882
  export const TextCenterAlign = props => /*#__PURE__*/_jsxs("svg", {
@@ -888,19 +888,19 @@ export const TextCenterAlign = props => /*#__PURE__*/_jsxs("svg", {
888
888
  children: [/*#__PURE__*/_jsx("path", {
889
889
  className: "fillPath",
890
890
  d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
891
- fill: "#64748B"
891
+ fill: "#292D32"
892
892
  }), /*#__PURE__*/_jsx("path", {
893
893
  className: "fillPath",
894
894
  d: "M16.7417 11.0557H7.26172C6.85172 11.0557 6.51172 10.7157 6.51172 10.3057C6.51172 9.89566 6.85172 9.55566 7.26172 9.55566H16.7317C17.1417 9.55566 17.4817 9.89566 17.4817 10.3057C17.4817 10.7157 17.1517 11.0557 16.7417 11.0557Z",
895
- fill: "#64748B"
895
+ fill: "#292D32"
896
896
  }), /*#__PURE__*/_jsx("path", {
897
897
  className: "fillPath",
898
898
  d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
899
- fill: "#64748B"
899
+ fill: "#292D32"
900
900
  }), /*#__PURE__*/_jsx("path", {
901
901
  className: "fillPath",
902
902
  d: "M16.7417 21.0557H7.26172C6.85172 21.0557 6.51172 20.7157 6.51172 20.3057C6.51172 19.8957 6.85172 19.5557 7.26172 19.5557H16.7317C17.1417 19.5557 17.4817 19.8957 17.4817 20.3057C17.4817 20.7157 17.1517 21.0557 16.7417 21.0557Z",
903
- fill: "#64748B"
903
+ fill: "#292D32"
904
904
  })]
905
905
  });
906
906
  export const TextRightAlign = props => /*#__PURE__*/_jsxs("svg", {
@@ -912,19 +912,19 @@ export const TextRightAlign = props => /*#__PURE__*/_jsxs("svg", {
912
912
  children: [/*#__PURE__*/_jsx("path", {
913
913
  className: "fillPath",
914
914
  d: "M21 6.05566H3C2.59 6.05566 2.25 5.71566 2.25 5.30566C2.25 4.89566 2.59 4.55566 3 4.55566H21C21.41 4.55566 21.75 4.89566 21.75 5.30566C21.75 5.71566 21.41 6.05566 21 6.05566Z",
915
- fill: "#64748B"
915
+ fill: "#292D32"
916
916
  }), /*#__PURE__*/_jsx("path", {
917
917
  className: "fillPath",
918
918
  d: "M21.0013 11.0557H11.5312C11.1213 11.0557 10.7812 10.7157 10.7812 10.3057C10.7812 9.89566 11.1213 9.55566 11.5312 9.55566H21.0013C21.4113 9.55566 21.7513 9.89566 21.7513 10.3057C21.7513 10.7157 21.4113 11.0557 21.0013 11.0557Z",
919
- fill: "#64748B"
919
+ fill: "#292D32"
920
920
  }), /*#__PURE__*/_jsx("path", {
921
921
  className: "fillPath",
922
922
  d: "M21 16.0557H3C2.59 16.0557 2.25 15.7157 2.25 15.3057C2.25 14.8957 2.59 14.5557 3 14.5557H21C21.41 14.5557 21.75 14.8957 21.75 15.3057C21.75 15.7157 21.41 16.0557 21 16.0557Z",
923
- fill: "#64748B"
923
+ fill: "#292D32"
924
924
  }), /*#__PURE__*/_jsx("path", {
925
925
  className: "fillPath",
926
926
  d: "M21.0013 21.0557H11.5312C11.1213 21.0557 10.7812 20.7157 10.7812 20.3057C10.7812 19.8957 11.1213 19.5557 11.5312 19.5557H21.0013C21.4113 19.5557 21.7513 19.8957 21.7513 20.3057C21.7513 20.7157 21.4113 21.0557 21.0013 21.0557Z",
927
- fill: "#64748B"
927
+ fill: "#292D32"
928
928
  })]
929
929
  });
930
930
  export const JustifyStartIcon = props => /*#__PURE__*/_jsxs("svg", {
@@ -933,9 +933,6 @@ export const JustifyStartIcon = props => /*#__PURE__*/_jsxs("svg", {
933
933
  height: "25",
934
934
  viewBox: "0 0 24 25",
935
935
  fill: "none",
936
- style: {
937
- color: "red"
938
- },
939
936
  children: [/*#__PURE__*/_jsx("path", {
940
937
  d: "M5.10156 20.0557H16.9016C18.4016 20.0557 19.0016 19.4157 19.0016 17.8257V16.7857C19.0016 15.1957 18.4016 14.5557 16.9016 14.5557H5.10156",
941
938
  stroke: "#64748B",
@@ -17,31 +17,19 @@ const useCommonStyle = theme => ({
17
17
  },
18
18
  "& .close-popupbtn": {
19
19
  color: theme?.palette?.editor?.textColor
20
- },
21
- "& .MuiSvgIcon-root": {
22
- color: theme?.palette?.editor?.textColor
23
20
  }
24
21
  },
25
22
  sapcingInput: {
26
23
  backgroundColor: theme?.palette?.editor?.background,
27
24
  color: theme?.palette?.editor?.textColor
28
25
  },
29
- customPaddingInput: {
30
- background: theme?.palette?.editor?.inputFieldBgColor,
31
- border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
32
- color: theme?.palette?.editor?.textColor,
33
- borderRadius: '6px'
34
- },
35
26
  colorPickerPopup: {
36
27
  "& .MuiPaper-root": {
37
28
  overflow: "auto",
38
29
  backgroundColor: theme?.palette?.editor?.background
39
30
  },
40
31
  "& .popup_tabs": {
41
- backgroundColor: theme?.palette?.editor?.background,
42
- "@media only screen and (max-width: 899px)": {
43
- width: '100% !important'
44
- }
32
+ backgroundColor: theme?.palette?.editor?.background
45
33
  },
46
34
  "& .popup_tabs-header": {
47
35
  backgroundColor: theme?.palette?.editor?.background,
@@ -80,9 +68,9 @@ const useCommonStyle = theme => ({
80
68
  },
81
69
  signaturePopup: {
82
70
  "& .MuiPaper-root": {
83
- backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
71
+ backgroundColor: theme?.palette?.editor?.background,
84
72
  "& .signature-canvas": {
85
- backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`
73
+ backgroundColor: "#FFF"
86
74
  },
87
75
  "& label": {
88
76
  color: theme?.palette?.editor?.textColor
@@ -109,97 +97,26 @@ const useCommonStyle = theme => ({
109
97
  borderColor: theme?.palette?.editor?.textColor
110
98
  },
111
99
  "& .upload-wrapper-ui": {
112
- backgroundColor: theme?.palette?.type === "dark" ? "#2563EB0F" : "#F8F9FF",
100
+ backgroundColor: theme?.palette?.type === "dark" ? "transparent" : "#F8F9FF",
113
101
  "& .MuiTypography-root": {
114
102
  color: theme?.palette?.editor?.textColor
115
103
  }
116
104
  },
117
- "& .typesignature-input-wrapper": {
118
- "& .MuiInputBase-root": {
119
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
120
- borderRadius: "7px !important",
121
- paddingRight: "6px !important"
122
- },
123
- "& .MuiInputBase-input": {
124
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`
125
- },
126
- "& .MuiOutlinedInput-notchedOutline": {
127
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder}`
128
- },
129
- "& .Mui-focused": {
130
- "& .MuiOutlinedInput-notchedOutline": {
131
- border: `1px solid #2563EB !important`
132
- }
133
- },
134
- "& button": {
135
- background: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
136
- color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
137
- }
138
- },
139
105
  "& .typesignature-fontfamily": {
140
106
  "& button": {
141
- color: theme?.palette?.editor?.textColor,
142
- background: `${theme?.palette?.editor?.signatureFontBtnBg} !important`,
143
- border: `1px solid ${theme?.palette?.editor?.sectionSettingIconHover} !important`,
144
- "& p": {
145
- fontSize: "13px !important"
146
- }
147
- },
148
- "& .active ": {
149
- border: `1px solid #2563EB !important`
107
+ color: theme?.palette?.editor?.textColor
150
108
  }
151
109
  },
152
110
  "& .MuiTab-root": {
153
- color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`,
154
- backgroundColor: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
155
- opacity: "unset",
156
- fontSize: "12px !important",
157
- fontWeight: "500 !important",
158
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonBorder} !important`
159
- },
160
- "& .Mui-selected": {
161
- background: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBg} !important`,
162
- color: `${theme?.palette?.editor?.textColor} !important`,
163
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpTabButtonSelectedBorder} !important`,
164
- "& .MuiGrid-root": {
165
- "& svg": {
166
- "& path": {
167
- fill: `${theme?.palette?.editor?.signaturePopUpTabButtonSelectedSvg} !important`
168
- }
169
- }
170
- }
111
+ color: theme?.palette?.editor?.textColor,
112
+ backgroundColor: theme?.palette?.editor?.background
171
113
  },
172
114
  "& .close-popupbtn": {
173
- color: theme?.palette?.editor?.closeButtonSvgStroke,
174
- background: `${theme?.palette?.editor?.closeButtonBgColor} !important`
115
+ color: theme?.palette?.editor?.textColor
175
116
  },
176
117
  "& .deleteBtn": {
177
- background: "transparent",
178
- margin: '0px !important'
179
- },
180
- "& .MuiGrid-container": {
181
- "& .workFlowButton": {
182
- background: `${theme?.palette?.editor?.workFlowButtonBackground} !important`,
183
- textTransform: "unset !important",
184
- color: `${theme?.palette?.editor?.textColor} !important`,
185
- fontSize: "14px !important",
186
- fontWeight: "500 !important",
187
- borderRadius: "25px",
188
- padding: "5px 15px"
189
- }
190
- },
191
- "& .MuiDialogActions-root": {
192
- "& .deleteButtonSignature": {
193
- background: `${theme?.palette?.editor?.closeButtonBackground} !important`,
194
- color: `${theme?.palette?.editor?.deletePopUpButtonTextColor} !important`,
195
- border: `1px solid ${theme?.palette?.editor?.closeButtonBorder} !important`
196
- }
118
+ background: "transparent"
197
119
  }
198
- },
199
- "& .disabledSaveBtn": {
200
- background: "#2563EB33 !important",
201
- color: theme?.palette?.type === "dark" && "#FFFFFF33 !important",
202
- border: "1px solid #2563EB33 !important"
203
120
  }
204
121
  },
205
122
  popupTitle2: {
@@ -213,44 +130,7 @@ const useCommonStyle = theme => ({
213
130
  },
214
131
  datePicker: {
215
132
  "& .react-datepicker-wrapper": {
216
- width: "100%",
217
- "& .react-datepicker__input-container": {
218
- "& .MuiInputBase-root": {
219
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
220
- "& .MuiInputBase-input": {
221
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
222
- color: `${theme?.palette?.editor?.textColor} !important`
223
- },
224
- "& .MuiOutlinedInput-notchedOutline": {
225
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`
226
- }
227
- }
228
- }
229
- }
230
- },
231
- signaturePopUpNameField: {
232
- background: "transparent !important",
233
- "& .MuiInputBase-root": {
234
- borderRadius: "10px !important",
235
- background: "transparent !important",
236
- "& .MuiOutlinedInput-input": {
237
- background: `${theme?.palette?.editor?.inputFieldBgColor} !important`,
238
- borderRadius: "10px !important",
239
- border: `1px solid ${theme?.palette?.editor?.signaturePopUpInputFieldBorder} !important`,
240
- fontSize: "14px !important",
241
- fontWeight: "500 !important"
242
- },
243
- "& .MuiOutlinedInput-notchedOutline": {
244
- border: `1px solid transparent !important`
245
- }
246
- },
247
- "& .Mui-focused": {
248
- "& .MuiOutlinedInput-input": {
249
- border: `1px solid #2563EB !important`
250
- },
251
- "& .MuiOutlinedInput-notchedOutline": {
252
- border: `1px solid transparent !important`
253
- }
133
+ width: "100%"
254
134
  }
255
135
  }
256
136
  });
@@ -14,12 +14,16 @@ const handleTableCell = (el, children) => {
14
14
  });
15
15
  return {
16
16
  type: "table-cell",
17
- overwriteChild: wrapChild,
18
- size: {
19
- width: 120
20
- }
17
+ overwriteChild: wrapChild
21
18
  };
22
19
  };
20
+ const paragraphType = el => {
21
+ const firstChild = el?.childNodes?.[0];
22
+ const isFirstChildText = firstChild?.nodeType === 3 || TEXT_TAGS[firstChild?.nodeName];
23
+ return isFirstChildText ? {
24
+ type: "paragraph"
25
+ } : {};
26
+ };
23
27
  const ELEMENT_TAGS = {
24
28
  A: el => ({
25
29
  type: "link",
@@ -59,24 +63,14 @@ const ELEMENT_TAGS = {
59
63
  OL: () => ({
60
64
  type: "orderedList"
61
65
  }),
62
- P: () => ({
63
- type: "paragraph"
64
- }),
65
- DIV: () => ({
66
- type: "paragraph"
67
- }),
66
+ P: paragraphType,
67
+ DIV: paragraphType,
68
68
  PRE: () => ({
69
69
  type: "code"
70
70
  }),
71
- META: () => ({
72
- type: "paragraph"
73
- }),
74
- STYLE: () => ({
75
- type: "paragraph"
76
- }),
77
- "GOOGLE-SHEETS-HTML-ORIGIN": () => ({
78
- type: "paragraph"
79
- }),
71
+ META: paragraphType,
72
+ STYLE: paragraphType,
73
+ "GOOGLE-SHEETS-HTML-ORIGIN": paragraphType,
80
74
  TABLE: (el, children = []) => {
81
75
  try {
82
76
  const bodyChild = children || [];
@@ -98,12 +92,8 @@ const ELEMENT_TAGS = {
98
92
  type: "table-row"
99
93
  }),
100
94
  TD: handleTableCell,
101
- COLGROUP: () => ({
102
- type: "paragraph"
103
- }),
104
- COL: () => ({
105
- type: "paragraph"
106
- })
95
+ COLGROUP: paragraphType,
96
+ COL: paragraphType
107
97
  };
108
98
 
109
99
  // COMPAT: `B` is omitted here because Google Docs uses `<b>` in weird ways.
@@ -133,7 +123,8 @@ const TEXT_TAGS = {
133
123
  const deserialize = el => {
134
124
  if (el.nodeType === 3) {
135
125
  const match = /\r|\n/.exec(el.textContent);
136
- return match ? null : el.textContent;
126
+ const text = el.textContent.replace(/\r|\n/g, "").trim();
127
+ return match && !text ? null : el.textContent;
137
128
  } else if (el.nodeType !== 1) {
138
129
  return null;
139
130
  } else if (el.nodeName === "BR") {
@@ -160,7 +151,9 @@ const deserialize = el => {
160
151
  overwriteChild,
161
152
  ...attrs
162
153
  } = ELEMENT_TAGS[nodeName](el, children);
163
- return jsx("element", attrs, overwriteChild || children);
154
+ if (attrs?.type) {
155
+ return jsx("element", attrs, overwriteChild || children);
156
+ }
164
157
  }
165
158
  if (TEXT_TAGS[nodeName]) {
166
159
  const attrs = TEXT_TAGS[nodeName](el);
@@ -352,7 +352,7 @@ export const clearBrainText = editor => {
352
352
  } = editor;
353
353
  if (selection) {
354
354
  const [currentNode, currentPath] = Editor.node(editor, selection);
355
- const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
355
+ const cleanedText = Node.string(currentNode).replace(/\/b(?:rain|rai|ra|r)?/g, "").trim();
356
356
  Transforms.insertText(editor, cleanedText, {
357
357
  at: currentPath
358
358
  });
@@ -1,6 +1,5 @@
1
1
  import { Editor, Node, Path, Point, Transforms } from "slate";
2
2
  import { getNextNode } from "../utils/helper";
3
- const BACKWARD_BLOCKS = ["list-item", "signature"];
4
3
  const isNodeTextEmpty = node => {
5
4
  const nodeText = Node.string(node);
6
5
  return nodeText.trim() === "";
@@ -30,9 +29,9 @@ const withCustomDeleteBackward = editor => {
30
29
  }
31
30
  }
32
31
 
33
- // Check if current node is a list item and is the last one, signature node
32
+ // Check if current node is a list item and is the last one
34
33
  const [node] = Editor.nodes(editor, {
35
- match: n => BACKWARD_BLOCKS.includes(n.type) // Adjust based on your list item type
34
+ match: n => n.type === "list-item" // Adjust based on your list item type
36
35
  });
37
36
 
38
37
  if (node) {
@@ -2,8 +2,6 @@ import { Transforms, Editor, Element, Node, Path } from "slate";
2
2
  import deserialize from "../helper/deserialize";
3
3
  import { decodeAndParseBase64 } from "../utils/helper";
4
4
  const avoidDefaultInsert = ["table", "grid"];
5
- const NON_TEXT_TAGS = ["ol", "ul", "img", "table", "video", "a", "button", "GOOGLE-SHEETS-HTML-ORIGIN"];
6
- const ALLOWED_TEXT_NODES = ["paragraph", "title", "headingOne", "headingTwo", "headingThree"];
7
5
  const loopChildren = (children = [], defaultInsert) => {
8
6
  if (!children?.length) {
9
7
  return defaultInsert;
@@ -63,23 +61,12 @@ const insertAtNextNode = (editor, formattedFragment) => {
63
61
  console.log(err);
64
62
  }
65
63
  };
66
-
67
- // const handleInsert = (editor, defaultInsert, fragment = []) => {
68
- // if (
69
- // getCurrentElementText(editor) &&
70
- // fragment.some((f) => f.type === "table")
71
- // ) {
72
- // insertAtNextNode(editor, fragment);
73
- // } else {
74
- // defaultInsert();
75
- // }
76
- // };
77
-
78
- const getTableCellChild = (fragment = []) => {
79
- const table = fragment.find(node => node.type === "table");
80
- const row = table?.children?.find(node => node.type === "table-row");
81
- const cell = row?.children?.find(node => node.type === "table-cell");
82
- return cell?.children || [];
64
+ const handleInsert = (editor, defaultInsert, fragment = []) => {
65
+ if (getCurrentElementText(editor) && fragment.some(f => f.type === "table")) {
66
+ insertAtNextNode(editor, fragment);
67
+ } else {
68
+ defaultInsert();
69
+ }
83
70
  };
84
71
  const formatFragment = {
85
72
  "list-item": fragment => {
@@ -128,21 +115,8 @@ const withHtml = editor => {
128
115
  const html = data?.getData("text/html");
129
116
  const currentEl = getCurrentElement(editor);
130
117
  const eltype = currentEl?.type;
131
- const firstNode = editor?.children?.[0];
132
- const titlePath = firstNode?.type === "topbanner" ? 1 : 0;
133
- const isTitlePath = editor.needLayout && editor?.selection?.anchor?.path[0] === titlePath;
134
118
  if (slateHTML && !formatFragment[eltype]) {
135
- const [tableCellNode] = Editor.nodes(editor, {
136
- match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "table-cell"
137
- });
138
119
  const decoded = decodeAndParseBase64(slateHTML);
139
- if (tableCellNode) {
140
- const tableCellChild = getTableCellChild(decoded);
141
- if (tableCellChild?.length) {
142
- Transforms.insertFragment(editor, tableCellChild);
143
- return;
144
- }
145
- }
146
120
  const tableNode = getFocusedNode(editor, "table");
147
121
  const onlyTextNode = getFocusedNode(editor, "freegrid");
148
122
 
@@ -180,38 +154,22 @@ const withHtml = editor => {
180
154
  Transforms.insertText(editor, text);
181
155
  }
182
156
  } else {
183
- const isTextNode = ALLOWED_TEXT_NODES.includes(decoded?.[0]?.type);
184
- if (isTitlePath && !isTextNode) {
185
- insertAtNextNode(editor, decoded);
186
- return;
187
- }
188
- const currentText = getCurrentElementText(editor);
189
- if (currentText && !isTextNode) {
190
- insertAtNextNode(editor, decoded);
191
- return;
192
- }
193
- insertData(data);
157
+ handleInsert(editor, () => insertData(data), decoded);
194
158
  }
195
159
  } else if (html) {
196
160
  const parsed = new DOMParser().parseFromString(html, "text/html");
197
- const rootElement = parsed.body || parsed.documentElement;
198
- const isNonText = rootElement ? rootElement?.querySelector(NON_TEXT_TAGS.toString()) : false;
199
161
  const isGoogleSheet = parsed.body.querySelector("google-sheets-html-origin");
200
162
  if (isGoogleSheet) {
201
163
  if (editor.isChatEditor) {
202
164
  return;
203
165
  }
204
- const table = rootElement.querySelector("table");
166
+ const table = parsed.body.querySelector("table");
205
167
  const colGrp = table.querySelector("colgroup");
206
168
  if (colGrp) {
207
169
  colGrp.remove();
208
170
  }
209
171
  const fragment = deserialize(table);
210
- if (isTitlePath) {
211
- insertAtNextNode(editor, [fragment]);
212
- } else {
213
- Transforms.insertFragment(editor, [fragment]);
214
- }
172
+ Transforms.insertFragment(editor, [fragment]);
215
173
  return;
216
174
  }
217
175
  const fragment = deserialize(parsed.body);
@@ -225,16 +183,7 @@ const withHtml = editor => {
225
183
  if (editor.isChatEditor && is_img_table) {
226
184
  return;
227
185
  }
228
- if (isTitlePath && isNonText) {
229
- insertAtNextNode(editor, formattedFragment);
230
- return;
231
- }
232
- const currentText = getCurrentElementText(editor);
233
- if (currentText && isNonText) {
234
- insertAtNextNode(editor, formattedFragment);
235
- return;
236
- }
237
- Transforms.insertFragment(editor, formattedFragment);
186
+ handleInsert(editor, () => Transforms.insertFragment(editor, formattedFragment), formattedFragment);
238
187
  return;
239
188
  } else {
240
189
  insertData(data);
@@ -58,7 +58,6 @@ const withLayout = editor => {
58
58
  Transforms.insertNodes(editor, paragraph, {
59
59
  at: path.concat(1)
60
60
  });
61
- return;
62
61
  }
63
62
  ORDERS_LAYOUT.forEach((enforce, index) => {
64
63
  if (index < editor.children.length) {
@@ -369,14 +369,12 @@ export const getBlock = props => {
369
369
  });
370
370
  case "orderedList":
371
371
  return /*#__PURE__*/_jsx("ol", {
372
- className: "listItemMargin",
373
372
  type: "1",
374
373
  ...attributes,
375
374
  children: children
376
375
  });
377
376
  case "unorderedList":
378
377
  return /*#__PURE__*/_jsx("ul", {
379
- className: "listItemMargin",
380
378
  ...attributes,
381
379
  children: children
382
380
  });
@@ -18,7 +18,7 @@ export const insertBrain = (editor, data, position) => {
18
18
  };
19
19
  const [currentNode, currentPath] = Editor.node(editor, selection);
20
20
  console.log('W1', Node.string(currentNode));
21
- const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
21
+ const cleanedText = Node.string(currentNode).replace(/\/b(?:rain|rai|ra|r)?/g, "").trim();
22
22
  if (cleanedText) {
23
23
  Transforms.delete(editor, {
24
24
  at: Editor.range(editor, currentPath)
@@ -3,7 +3,6 @@ import { Box } from "@mui/material";
3
3
  import { fontFamilyMap, sizeMap } from "../font";
4
4
  import Mentions from "../../Elements/Mentions/Mentions";
5
5
  import CheckList from "../../Elements/List/CheckList";
6
- import SimpleText from "../../Elements/SimpleText";
7
6
  import { isEmptyTextNode } from "../../helper";
8
7
  import { getBreakPointsValue } from "../../helper/theme";
9
8
  import insertNewLine from "../insertNewLine";
@@ -16,20 +15,6 @@ const LIST_FORMAT_TYPE = {
16
15
  unorderedList: "list-item"
17
16
  };
18
17
  const NEWLINESAFTER = ["headingOne", "headingTwo", "headingThree"];
19
- export const serializeMentions = node => {
20
- try {
21
- if (node?.type === 'mention') {
22
- return [node.character];
23
- }
24
- let children = Array.isArray(node) ? node : node?.children;
25
- children = children && Array.isArray(children) ? children : [];
26
- let mentions = children.map(child => serializeMentions(child)).flat();
27
- return mentions.filter(Boolean);
28
- } catch (err) {
29
- console.log(err);
30
- return [];
31
- }
32
- };
33
18
  export const toggleBlock = (editor, format, selection = true, attr = {}) => {
34
19
  const isActive = isBlockActive(editor, format);
35
20
  const isList = list_types.includes(format);
@@ -260,13 +245,6 @@ export const getBlock = props => {
260
245
  ,
261
246
  children: children
262
247
  });
263
- case "title":
264
- return /*#__PURE__*/_jsx("h3", {
265
- ...attributes,
266
- ...element.attr,
267
- className: `content-editable ${isEmpty ? "empty" : ""}`,
268
- children: children
269
- });
270
248
  case "headingThree":
271
249
  return /*#__PURE__*/_jsx("h3", {
272
250
  ...attributes,
@@ -364,9 +342,6 @@ export const getBlock = props => {
364
342
  ...props
365
343
  });
366
344
  default:
367
- return /*#__PURE__*/_jsx(SimpleText, {
368
- ...props,
369
- isEmpty: isEmpty
370
- });
345
+ return null;
371
346
  }
372
347
  };
@@ -4,10 +4,7 @@ const useResize = ({
4
4
  parentDOM,
5
5
  size: allSize,
6
6
  isGrid,
7
- onChange,
8
- MH,
9
- MW,
10
- MP
7
+ onChange
11
8
  }) => {
12
9
  const device = getDevice(window.innerWidth);
13
10
  const defaultSize = getBreakPointsValue(allSize);
@@ -55,9 +52,9 @@ const useResize = ({
55
52
  const cWP = calcWidth / width * 100;
56
53
  const calcHeight = (parseInt(currentSize.height) || height) + e.movementY;
57
54
  const calc = {
58
- width: Math.max(calcWidth, MW || 140),
59
- height: Math.max(calcHeight, MH || 50),
60
- widthInPercent: cWP > 100 ? 100 : Math.max(cWP, MP || 15)
55
+ width: Math.max(calcWidth, 140),
56
+ height: Math.max(calcHeight, 50),
57
+ widthInPercent: cWP > 100 ? 100 : Math.max(cWP, 15)
61
58
  };
62
59
  latest = calc;
63
60
  return calc;
@@ -2,8 +2,7 @@ import { useState } from "react";
2
2
  const useTableResize = ({
3
3
  parentDOM,
4
4
  size: defaultSize,
5
- onDone,
6
- minMaxProps = {}
5
+ onDone
7
6
  }) => {
8
7
  const {
9
8
  width
@@ -39,13 +38,10 @@ const useTableResize = ({
39
38
  setIsDone(1);
40
39
  };
41
40
  const onMouseMove = e => {
42
- const {
43
- minWidth
44
- } = minMaxProps || {};
45
41
  setSize(currentSize => {
46
42
  const calcWidth = currentSize?.width + e.movementX;
47
43
  return {
48
- width: minWidth && calcWidth < minWidth ? minWidth : calcWidth,
44
+ width: calcWidth,
49
45
  height: currentSize.height + e.movementY,
50
46
  widthInPercent: calcWidth / width * 100
51
47
  };