@flozy/editor 5.4.0 → 5.4.1

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 (192) hide show
  1. package/dist/Editor/ChatEditor.js +34 -25
  2. package/dist/Editor/CommonEditor.js +15 -29
  3. package/dist/Editor/Editor.css +18 -100
  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 +52 -58
  7. package/dist/Editor/Elements/AI/Styles.js +6 -24
  8. package/dist/Editor/Elements/Accordion/Accordion.js +1 -8
  9. package/dist/Editor/Elements/AppHeader/AppHeader.js +6 -6
  10. package/dist/Editor/Elements/Button/EditorButton.js +2 -9
  11. package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -11
  12. package/dist/Editor/Elements/Color Picker/ColorButtons.js +5 -7
  13. package/dist/Editor/Elements/Color Picker/Styles.js +3 -7
  14. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  15. package/dist/Editor/Elements/Divider/Divider.js +20 -36
  16. package/dist/Editor/Elements/Embed/Image.js +16 -51
  17. package/dist/Editor/Elements/Embed/Video.js +3 -26
  18. package/dist/Editor/Elements/Form/Form.js +2 -39
  19. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +1 -7
  20. package/dist/Editor/Elements/Form/FormElements/FormDate.js +1 -7
  21. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +1 -7
  22. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +1 -7
  23. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +1 -7
  24. package/dist/Editor/Elements/Form/FormElements/FormText.js +1 -7
  25. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +1 -6
  26. package/dist/Editor/Elements/Form/FormPopup.js +9 -12
  27. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  28. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -20
  29. package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +4 -4
  30. package/dist/Editor/Elements/FreeGrid/styles.js +1 -2
  31. package/dist/Editor/Elements/Grid/GridButton.js +2 -2
  32. package/dist/Editor/Elements/Grid/GridItem.js +36 -47
  33. package/dist/Editor/Elements/Grid/Styles.js +0 -50
  34. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  35. package/dist/Editor/Elements/List/CheckList.js +1 -2
  36. package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
  37. package/dist/Editor/Elements/Search/SearchButton.js +0 -1
  38. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  39. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  40. package/dist/Editor/Elements/Signature/SignaturePopup.js +52 -17
  41. package/dist/Editor/Elements/SimpleText/index.js +1 -8
  42. package/dist/Editor/Elements/SimpleText/style.js +1 -20
  43. package/dist/Editor/Elements/Table/Styles.js +79 -82
  44. package/dist/Editor/Elements/Table/Table.js +140 -258
  45. package/dist/Editor/Elements/Table/TableCell.js +111 -365
  46. package/dist/Editor/Elements/Table/TablePopup.js +3 -9
  47. package/dist/Editor/Elements/Table/TableRow.js +2 -10
  48. package/dist/Editor/Elements/TopBanner/TopBanner.js +1 -2
  49. package/dist/Editor/MiniEditor.js +1 -15
  50. package/dist/Editor/Styles/EditorStyles.js +4 -13
  51. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +0 -10
  52. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +12 -7
  53. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -26
  54. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +0 -3
  55. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -5
  56. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +6 -3
  57. package/dist/Editor/Toolbar/Mini/Styles.js +1 -4
  58. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/InfinityAITool.js +3 -7
  59. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -6
  60. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +15 -19
  61. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +57 -555
  62. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +16 -73
  63. package/dist/Editor/Toolbar/PopupTool/index.js +5 -3
  64. package/dist/Editor/Toolbar/Toolbar.js +0 -6
  65. package/dist/Editor/Toolbar/toolbarGroups.js +0 -4
  66. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  67. package/dist/Editor/assets/svg/SettingsIcon.js +4 -4
  68. package/dist/Editor/common/ColorPickerButton.js +45 -85
  69. package/dist/Editor/common/DnD/Draggable.js +1 -2
  70. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  71. package/dist/Editor/common/Icon.js +20 -23
  72. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -2
  73. package/dist/Editor/common/ImageSelector/Styles.js +6 -47
  74. package/dist/Editor/common/ImageSelector/UploadStyles.js +6 -18
  75. package/dist/Editor/common/LinkSettings/NavComponents.js +1 -2
  76. package/dist/Editor/common/LinkSettings/index.js +1 -2
  77. package/dist/Editor/common/MentionsPopup/Styles.js +8 -143
  78. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +12 -108
  80. package/dist/Editor/common/RnD/GuideLines/styles.js +3 -3
  81. package/dist/Editor/common/RnD/ShadowElement.js +1 -1
  82. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
  83. package/dist/Editor/common/RnD/Utils/gridDropItem.js +6 -9
  84. package/dist/Editor/common/RnD/VirtualElement/index.js +1 -5
  85. package/dist/Editor/common/RnD/index.js +2 -3
  86. package/dist/Editor/common/Section/index.js +3 -3
  87. package/dist/Editor/common/Section/styles.js +1 -5
  88. package/dist/Editor/common/Shorthands/elements.js +1 -13
  89. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -2
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -9
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -35
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +2 -15
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +1 -2
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +1 -1
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +0 -2
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +11 -11
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +6 -22
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -21
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -20
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +2 -12
  103. package/dist/Editor/common/StyleBuilder/formStyle.js +149 -268
  104. package/dist/Editor/common/StyleBuilder/index.js +20 -101
  105. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
  106. package/dist/Editor/common/StyleBuilder/tableStyle.js +25 -69
  107. package/dist/Editor/common/SwipeableDrawer/style.js +4 -15
  108. package/dist/Editor/common/ToolbarIcon.js +1 -1
  109. package/dist/Editor/common/Uploader.js +36 -46
  110. package/dist/Editor/common/iconListV2.js +60 -616
  111. package/dist/Editor/common/iconslist.js +17 -23
  112. package/dist/Editor/commonStyle.js +11 -417
  113. package/dist/Editor/helper/deserialize/index.js +1 -4
  114. package/dist/Editor/helper/index.js +4 -17
  115. package/dist/Editor/helper/theme.js +1 -24
  116. package/dist/Editor/hooks/useMouseMove.js +2 -5
  117. package/dist/Editor/plugins/withCustomDeleteBackward.js +4 -36
  118. package/dist/Editor/plugins/withEmbeds.js +26 -30
  119. package/dist/Editor/plugins/withHTML.js +10 -61
  120. package/dist/Editor/plugins/withLayout.js +0 -1
  121. package/dist/Editor/utils/SlateUtilityFunctions.js +12 -39
  122. package/dist/Editor/utils/brains.js +1 -1
  123. package/dist/Editor/utils/button.js +4 -4
  124. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +1 -26
  125. package/dist/Editor/utils/customHooks/useResize.js +4 -7
  126. package/dist/Editor/utils/customHooks/useTableResize.js +2 -6
  127. package/dist/Editor/utils/embed.js +1 -2
  128. package/dist/Editor/utils/events.js +1 -0
  129. package/dist/Editor/utils/font.js +4 -11
  130. package/dist/Editor/utils/formfield.js +4 -8
  131. package/dist/Editor/utils/helper.js +2 -103
  132. package/dist/Editor/utils/insertNewLine.js +1 -19
  133. package/dist/Editor/utils/pageSettings.js +2 -14
  134. package/dist/Editor/utils/serializeToText.js +0 -2
  135. package/dist/Editor/utils/table.js +24 -228
  136. package/package.json +2 -2
  137. package/dist/Editor/Elements/DataView/DataView.js +0 -124
  138. package/dist/Editor/Elements/DataView/DataViewButton.js +0 -23
  139. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +0 -67
  140. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +0 -33
  141. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +0 -162
  142. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +0 -40
  143. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +0 -67
  144. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +0 -35
  145. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +0 -39
  146. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +0 -30
  147. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +0 -30
  148. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +0 -35
  149. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +0 -36
  150. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +0 -17
  151. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +0 -29
  152. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +0 -38
  153. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +0 -74
  154. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +0 -64
  155. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +0 -106
  156. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +0 -174
  157. package/dist/Editor/Elements/DataView/Layouts/Formula.js +0 -29
  158. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +0 -113
  159. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +0 -37
  160. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +0 -111
  161. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +0 -60
  162. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +0 -36
  163. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +0 -101
  164. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +0 -160
  165. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +0 -190
  166. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +0 -42
  167. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +0 -30
  168. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -110
  169. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +0 -179
  170. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +0 -112
  171. package/dist/Editor/Elements/DataView/Layouts/TableView.js +0 -227
  172. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +0 -80
  173. package/dist/Editor/Elements/DataView/Layouts/colStyles.js +0 -10
  174. package/dist/Editor/Elements/DataView/Layouts/index.js +0 -25
  175. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +0 -281
  176. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +0 -15
  177. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +0 -74
  178. package/dist/Editor/Elements/DataView/styles.js +0 -154
  179. package/dist/Editor/Elements/Table/AddRowCol.js +0 -77
  180. package/dist/Editor/Elements/Table/DragButton.js +0 -142
  181. package/dist/Editor/Elements/Table/DragStyles.js +0 -70
  182. package/dist/Editor/Elements/Table/Draggable.js +0 -25
  183. package/dist/Editor/Elements/Table/Droppable.js +0 -53
  184. package/dist/Editor/Elements/Table/TableTool.js +0 -101
  185. package/dist/Editor/Elements/Table/tableHelper.js +0 -71
  186. package/dist/Editor/assets/svg/TableIcons.js +0 -220
  187. package/dist/Editor/common/Select/index.js +0 -20
  188. package/dist/Editor/common/Select/styles.js +0 -17
  189. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
  190. package/dist/Editor/helper/enforceDateFormat.js +0 -41
  191. package/dist/Editor/hooks/useTable.js +0 -210
  192. package/dist/Editor/utils/dataView.js +0 -43
@@ -1,8 +1,9 @@
1
1
  import React, { useCallback, useMemo, useRef, useState, useEffect, useImperativeHandle, forwardRef } from "react";
2
2
  import { Editable, Slate, ReactEditor } from 'slate-react';
3
3
  import { createEditor, Transforms, Editor } from 'slate';
4
+ import { useDebounce } from "use-debounce";
4
5
  import withCommon from "./hooks/withCommon";
5
- import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
6
+ import { getBlock, getMarked } from "./utils/chatEditor/SlateUtilityFunctions";
6
7
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
7
8
  import { commands, mentionsEvent } from "./utils/events";
8
9
  import { insertEmoji } from "./utils/emoji";
@@ -14,7 +15,6 @@ import Shorthands from "./common/Shorthands";
14
15
  import usePopupStyle from "./Toolbar/PopupTool/PopupToolStyle";
15
16
  import { EditorProvider } from "./hooks/useMouseMove";
16
17
  import decorators from "./utils/Decorators";
17
- import { useDebouncedCallback } from "use-debounce";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
@@ -42,18 +42,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
42
42
  });
43
43
  const [isInteracted, setIsInteracted] = useState(false);
44
44
  const [value, setValue] = useState(convertedContent);
45
- const debouncedValue = useRef(value);
46
- const debounced = useDebouncedCallback(
47
- // function
48
- value => {
49
- const {
50
- value: strVal,
51
- ...restVal
52
- } = getOnSaveData(value);
53
- onSave(strVal, restVal);
54
- },
55
- // delay in ms
56
- 500);
45
+ const [loadedValue] = useState(value);
46
+ const [deboundedValue] = useDebounce(value, 500);
57
47
  const editor = useMemo(() => {
58
48
  return withCommon(createEditor(), {
59
49
  needLayout,
@@ -73,7 +63,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
73
63
  const {
74
64
  value: strVal,
75
65
  ...restVal
76
- } = getOnSaveData(debouncedValue?.current);
66
+ } = getOnSaveData(value);
77
67
  onsubmit(false, {
78
68
  strVal,
79
69
  restVal
@@ -109,8 +99,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
109
99
  const newValue = draftToSlate({
110
100
  data: content
111
101
  });
112
- debounced(newValue);
113
-
102
+ setValue(newValue);
114
103
  // setTimeout(() => {
115
104
  if (editor.children.length === 0) {
116
105
  Transforms.insertNodes(editor, newValue);
@@ -123,14 +112,27 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
123
112
  }
124
113
  }
125
114
  }));
115
+
116
+ // useEffect(() => {
117
+ // setIsExternalUpdate(true);
118
+ // setValue(draftToSlate({ data: content }));
119
+ // }, [content]);
120
+
121
+ useEffect(() => {
122
+ if (JSON.stringify(loadedValue) !== JSON.stringify(deboundedValue) && isInteracted && onSave) {
123
+ const {
124
+ value: strVal,
125
+ ...restVal
126
+ } = getOnSaveData(deboundedValue);
127
+ onSave(strVal, restVal);
128
+ }
129
+ }, [deboundedValue]);
126
130
  const getOnSaveData = val => {
127
131
  const text = serializeToText(val);
128
- const mentions = serializeMentions(val);
129
132
  const title = val?.find(f => f.type === "title");
130
133
  return {
131
134
  value: JSON.stringify(val),
132
135
  text: text,
133
- mentions: mentions,
134
136
  title: serializeToText(title?.children) || "Untitled"
135
137
  };
136
138
  };
@@ -178,8 +180,15 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
178
180
  });
179
181
  };
180
182
  const handleEditorChange = newValue => {
181
- debounced(newValue);
182
- debouncedValue.current = newValue;
183
+ const value_txt = serializeToText(value);
184
+ if (!value_txt) {
185
+ const {
186
+ value: strVal,
187
+ ...restVal
188
+ } = getOnSaveData(newValue);
189
+ onSave(strVal, restVal);
190
+ }
191
+ setValue(newValue);
183
192
  if (!isInteracted) {
184
193
  setIsInteracted(true);
185
194
  }
@@ -219,7 +228,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
219
228
  editor
220
229
  });
221
230
  } else if (event.key === "Enter" && !isMobile) {
222
- const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
231
+ const isEmpty = value.length === 1 && value[0].type === 'paragraph' && value[0].children.length === 1 && value[0].children[0].text === '';
223
232
  if (isEmpty) {
224
233
  event.preventDefault();
225
234
  return;
@@ -228,7 +237,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
228
237
  const {
229
238
  value: strVal,
230
239
  ...restVal
231
- } = getOnSaveData(debouncedValue?.current);
240
+ } = getOnSaveData(value);
232
241
  onsubmit(false, {
233
242
  strVal,
234
243
  restVal
@@ -242,7 +251,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
242
251
  const {
243
252
  value: strVal,
244
253
  ...restVal
245
- } = getOnSaveData(debouncedValue?.current);
254
+ } = getOnSaveData(value);
246
255
  onBlur({
247
256
  strVal,
248
257
  restVal
@@ -263,7 +272,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
263
272
  editor: editor,
264
273
  children: /*#__PURE__*/_jsxs(Slate, {
265
274
  editor: editor,
266
- initialValue: debouncedValue?.current,
275
+ initialValue: value,
267
276
  onChange: handleEditorChange,
268
277
  children: [toolBar && /*#__PURE__*/_jsx(MiniTextFormat, {
269
278
  classes: classes,
@@ -26,8 +26,8 @@ import editorStyles from "./Styles/EditorStyles";
26
26
  import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
- import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
30
- import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
29
+ import { getTRBLBreakPoints } from "./helper/theme";
30
+ import { handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
32
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
33
33
  import RnDCopy from "./common/RnD/RnDCopy";
@@ -72,12 +72,6 @@ const Leaf = ({
72
72
  children: children
73
73
  });
74
74
  };
75
- const updateTopBanner = (content = [], setTopBanner) => {
76
- setTopBanner(() => {
77
- const firstNode = content ? content[0] : {};
78
- return firstNode?.type === "topbanner" ? firstNode : null;
79
- });
80
- };
81
75
  const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
82
76
  const {
83
77
  id,
@@ -109,7 +103,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
109
103
  });
110
104
  const [isTextSelected, setIsTextSelected] = useState(false);
111
105
  const [breakpoint, setBreakpoint] = useState("");
112
- const [topBanner, setTopBanner] = useState();
113
106
  const debouncedValue = useRef(value);
114
107
  const [size] = useWindowResize();
115
108
  const {
@@ -124,9 +117,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
124
117
  } = otherProps || {};
125
118
  const editor = useMemo(() => {
126
119
  if (collaborativeEditor) return collaborativeEditor;
127
- const editor = createEditor();
128
- editor.needLayout = needLayout;
129
- return withCommon(editor, {
120
+ return withCommon(createEditor(), {
130
121
  needLayout
131
122
  });
132
123
  }, [collaborativeEditor]);
@@ -139,8 +130,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
139
130
  pageColor,
140
131
  color: pageTextColor,
141
132
  pageWidth,
142
- maxWidth: pageMaxWidth,
143
- lineHeight
133
+ maxWidth: pageMaxWidth
144
134
  } = pageSt?.pageProps || {
145
135
  bannerSpacing: {
146
136
  left: 0,
@@ -159,7 +149,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
159
149
  setValue(draftToSlate({
160
150
  data: content
161
151
  }));
162
- updateTopBanner(content, setTopBanner);
163
152
  if (!isMobile && !ReactEditor.isFocused(editor)) {
164
153
  ReactEditor.focus(editor);
165
154
  }
@@ -308,13 +297,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
308
297
  hideTools: updatedHideTools || []
309
298
  }) : [];
310
299
  const handleEditorChange = newValue => {
311
- if (!readOnly) {
312
- if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
313
- updateTopBanner(newValue, setTopBanner);
314
- debounced(newValue);
315
- if (!isInteracted) {
316
- setIsInteracted(true);
317
- }
300
+ if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
301
+ debounced(newValue);
302
+ if (!isInteracted) {
303
+ setIsInteracted(true);
318
304
  }
319
305
  }
320
306
  };
@@ -333,7 +319,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
333
319
  onDrawerOpen: onDrawerOpen,
334
320
  ICON_API: "https://assets.agenciflow.com"
335
321
  };
336
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
337
322
  const renderElement = useCallback(props => {
338
323
  return /*#__PURE__*/_jsx(Element, {
339
324
  ...props,
@@ -425,7 +410,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
425
410
  editorWrapper?.current?.classList.remove("hideScroll");
426
411
  handleScrollStop();
427
412
  };
428
- const hasTopBanner = () => topBanner;
413
+ const hasTopBanner = () => {
414
+ const tb = editor.children[0];
415
+ return tb?.type === "topbanner" ? tb : null;
416
+ };
429
417
  const renderTopBanner = () => {
430
418
  const tb = hasTopBanner();
431
419
  return tb ? /*#__PURE__*/_jsx(TopBanner, {
@@ -507,12 +495,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
507
495
  ,
508
496
  children: /*#__PURE__*/_jsxs(Slate, {
509
497
  editor: editor,
510
- initialValue: getInitialValue(debouncedValue?.current, readOnly),
498
+ initialValue: debouncedValue?.current,
511
499
  onChange: handleEditorChange,
512
500
  children: [/*#__PURE__*/_jsx(DragAndDrop, {
513
501
  children: /*#__PURE__*/_jsxs(Overlay, {
514
502
  children: [/*#__PURE__*/_jsx(Box, {
515
- className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth ${readOnly ? "readOnlyContainer" : ""}`,
503
+ className: `pc-${editorClass || ""} ${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""} scrollable-content scrollSmooth`,
516
504
  sx: classes.slateWrapper,
517
505
  id: "slate-wrapper-scroll-container",
518
506
  ref: editorWrapper,
@@ -536,7 +524,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
536
524
  padding: {
537
525
  ...getTRBLBreakPoints(bannerSpacing)
538
526
  },
539
- lineHeight: lineH,
540
527
  width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
541
528
  height: viewport.h ? `${viewport.h}px` : `100%`,
542
529
  alignSelf: "center",
@@ -594,9 +581,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
594
581
  setIsTextSelected: setIsTextSelected,
595
582
  customProps: customProps,
596
583
  editorWrapper: editorWrapper
597
- }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
584
+ }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
598
585
  breakpoint: breakpoint,
599
- show: showViewport,
600
586
  onChange: b => onSwitchBreakpoint(b)
601
587
  }) : null]
602
588
  })
@@ -31,7 +31,7 @@ blockquote {
31
31
  border-left: 3px solid transparent;
32
32
  margin-left: 0;
33
33
  margin-right: 0;
34
- /* padding-left: 10px; */
34
+ padding-left: 10px;
35
35
  margin: 0px;
36
36
  }
37
37
 
@@ -42,7 +42,7 @@ blockquote {
42
42
  }
43
43
 
44
44
  .editor-wrapper table {
45
- border-collapse: collapse;
45
+ border-collapse: separate;
46
46
  }
47
47
 
48
48
  .editor-wrapper .editor-wrapperbutton {
@@ -149,7 +149,7 @@ blockquote {
149
149
  .grid-item-toolbar button,
150
150
  .element-toolbar button,
151
151
  .element-toolbar a {
152
- border-radius: 50%;
152
+ border-radius: 10px;
153
153
  border: 1px solid rgba(37, 99, 235, 0.32);
154
154
  background: #fff;
155
155
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.16);
@@ -225,13 +225,9 @@ blockquote {
225
225
  background-color: #0052cc;
226
226
  padding: 8px 12px;
227
227
  color: #ffffff;
228
- font-weight: 600;
229
- font-size: 14px;
228
+ font-weight: bold;
230
229
  opacity: 1;
231
230
  border-radius: 32px;
232
- text-transform: math-auto;
233
- height: 36px;
234
- padding: 0px 12px;
235
231
  }
236
232
 
237
233
  .signature-btn-container button:hover {
@@ -355,17 +351,13 @@ blockquote {
355
351
  height: 100%;
356
352
  width: 100%;
357
353
  border: 1px solid #2563EB;
358
- border-radius: 7px;
354
+ border-radius: 12px;
359
355
  }
360
356
 
361
357
  .activeBrush svg {
362
358
  stroke: #2563eb;
363
359
  }
364
360
 
365
- .brushIcon:hover {
366
- background: unset;
367
- }
368
-
369
361
  .react-datepicker__input-container {
370
362
  display: flex !important;
371
363
  align-items: center;
@@ -391,7 +383,7 @@ blockquote {
391
383
 
392
384
  .dialog-actions-si .MuiButtonBase-root {
393
385
  opacity: 1;
394
- padding: 0px 5px 0px 2px !important
386
+ padding: 6px 5px 0px 3px !important
395
387
  }
396
388
 
397
389
  .signature-tab {
@@ -405,9 +397,9 @@ blockquote {
405
397
  .signature-tab2 {
406
398
  /* display: flex; */
407
399
  align-items: center;
408
- border-width: 1px;
400
+ border-width: 0px, 0px, 0px, 0px;
409
401
  border-style: solid;
410
- border-color: #2563EB66;
402
+ border-color: #2563EB;
411
403
  justify-content: center;
412
404
  flex-direction: column;
413
405
  width: 100%;
@@ -499,19 +491,11 @@ blockquote {
499
491
  text-transform: none;
500
492
  }
501
493
 
502
- .MuiButton-root.primaryBtn:disabled {
494
+ .MuiButton-root.primaryBtn.disabled,
495
+ .MuiButton-root.secondaryBtn.disabled {
503
496
  background: #eee !important;
504
- box-shadow: none !important;
505
497
  color: #ccc !important;
506
498
  border: 1px solid #ccc !important;
507
- cursor: not-allowed;
508
- }
509
-
510
- .MuiButton-root.primaryBtn.disabled,
511
- .MuiButton-root.secondaryBtn.disabled {
512
- background: #eee;
513
- color: #ccc;
514
- border: 1px solid #ccc;
515
499
  }
516
500
 
517
501
  .MuiButton-root.secondaryBtn {
@@ -532,7 +516,7 @@ blockquote {
532
516
  }
533
517
 
534
518
  .deleteBtn {
535
- background: #d32f2f ;
519
+ background: #ffffff;
536
520
  border: 1px solid #d32f2f !important;
537
521
  box-shadow: 0px 8px 24px rgba(30, 64, 175, 0.08);
538
522
  border-radius: 8px !important;
@@ -542,7 +526,6 @@ blockquote {
542
526
  margin-right: 15px !important;
543
527
  color: #d32f2f;
544
528
  width: auto !important;
545
- text-transform: capitalize !important;
546
529
  }
547
530
 
548
531
  @media (max-width: 480px) {
@@ -640,7 +623,7 @@ blockquote {
640
623
  }
641
624
 
642
625
  .MuiIconButton-root.btnActive {
643
- color: #2563EB !important;
626
+ background-color: #ccc;
644
627
  }
645
628
 
646
629
  .embed .element-toolbar {
@@ -680,8 +663,7 @@ blockquote {
680
663
  }
681
664
 
682
665
  .resize-br.img-resizer {
683
- bottom: 10px;
684
- right: 5px;
666
+ bottom: 8px;
685
667
  }
686
668
 
687
669
  .visible-on-hover {
@@ -876,7 +858,7 @@ blockquote {
876
858
 
877
859
  .dialogComp .MuiInputBase-input {
878
860
  border-radius: 8px;
879
- /* box-shadow: 0px 4px 18px 0px rgba(0, 0, 0, 0.05); */
861
+ box-shadow: 0px 4px 18px 0px rgba(0, 0, 0, 0.05);
880
862
  font-size: 12px;
881
863
  font-weight: 500;
882
864
  }
@@ -1041,11 +1023,11 @@ blockquote {
1041
1023
  width: 200px;
1042
1024
  cursor: pointer;
1043
1025
  color: #464646;
1044
- /* background-color: #fff; */
1026
+ background-color: #fff;
1045
1027
  padding: 4px 6px;
1046
1028
  border-radius: 12px;
1047
1029
  span {
1048
- text-transform: math-auto;
1030
+ text-transform: capitalize;
1049
1031
  }
1050
1032
  @media only screen and (max-width: 599px) {
1051
1033
  background-color: unset;
@@ -1067,7 +1049,7 @@ blockquote {
1067
1049
  }
1068
1050
 
1069
1051
  .textFontArrows .MuiIconButton-root {
1070
- padding: 0px;
1052
+ padding: 2px;
1071
1053
  }
1072
1054
 
1073
1055
  .tools-drawer .MuiTypography-root {
@@ -1091,10 +1073,6 @@ blockquote {
1091
1073
  font-size: 14px;
1092
1074
  }
1093
1075
 
1094
- .listItemMargin {
1095
- margin: 0px;
1096
- }
1097
-
1098
1076
  .content-editable.empty {
1099
1077
  position: relative;
1100
1078
  }
@@ -1248,10 +1226,8 @@ blockquote {
1248
1226
  position: absolute;
1249
1227
  }
1250
1228
 
1251
- .dividerComponent:hover .divider-settings,
1252
- .dividerComponent:hover .element-selector {
1229
+ .dividerComponent:hover .divider-settings {
1253
1230
  display: block;
1254
- pointer-events: auto;
1255
1231
  }
1256
1232
 
1257
1233
  @media (max-width: 899px) {
@@ -1262,61 +1238,3 @@ blockquote {
1262
1238
  max-width: 100% !important;
1263
1239
  }
1264
1240
  }
1265
-
1266
- .settingsHeader {
1267
- font-size: 14px !important;
1268
- font-weight: 500 !important;
1269
- }
1270
- .hideScroll {
1271
- overflow-anchor: none;
1272
- }
1273
-
1274
- .hideScroll::-webkit-scrollbar-track {
1275
- background: none !important;
1276
- }
1277
-
1278
- .hideScroll::-webkit-scrollbar-thumb {
1279
- background: none !important;
1280
- }
1281
-
1282
- .hideScroll::-webkit-scrollbar-thumb:hover {
1283
- background: none !important;
1284
- }
1285
-
1286
- .custom-scroll::-webkit-scrollbar {
1287
- height: .6rem;
1288
- }
1289
-
1290
- .custom-scroll::-webkit-scrollbar-thumb {
1291
- background: #888;
1292
- border-radius: 5px;
1293
- cursor: pointer;
1294
- }
1295
-
1296
- .custom-scroll::-webkit-scrollbar-track {
1297
- background: #f1f1f1;
1298
- }
1299
-
1300
- .custom-scroll:hover::-webkit-scrollbar-thumb {
1301
- background: #A7AEC1;
1302
- }
1303
-
1304
- ::selection {
1305
- color: inherit;
1306
- background: rgba(35, 131, 226, 0.35) !important;
1307
- }
1308
-
1309
- ::-moz-selection {
1310
- background: rgba(35, 131, 226, 0.35) !important;
1311
- color: inherit;
1312
- }
1313
-
1314
- ::-webkit-selection {
1315
- background: rgba(35, 131, 226, 0.35) !important;
1316
- color: inherit;
1317
- }
1318
-
1319
- .gradientFillBtn {
1320
- background: linear-gradient(112.61deg, #2C63ED 19.3%, #8360FD 88.14%) !important;
1321
- text-transform: math-auto !important;
1322
- }
@@ -71,6 +71,7 @@ function AIInput({
71
71
  }, [openAI]);
72
72
  const isSendBtnDisabled = !inputValue || loading;
73
73
  const props = getProps(openAI, generatedText) || {};
74
+ const fromToolBar = openAI === "fromToolBar";
74
75
  const handleSendBtnClick = () => {
75
76
  if (isSendBtnDisabled) {
76
77
  return;
@@ -8,15 +8,12 @@ function CustomSelect({
8
8
  classes,
9
9
  options,
10
10
  onSend,
11
- show,
12
- btnProps = {}
11
+ show
13
12
  }) {
14
- const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
15
13
  if (show) {
16
14
  return /*#__PURE__*/_jsx(Box, {
17
15
  component: "div",
18
- sx: !isMobile && classes.customSelectContainer,
19
- className: "customSelectContainer",
16
+ sx: classes.customSelectContainer,
20
17
  children: options?.map((groupOption, index) => {
21
18
  const {
22
19
  options,
@@ -31,8 +28,7 @@ function CustomSelect({
31
28
  return /*#__PURE__*/_jsx(DisplayOption, {
32
29
  option: option,
33
30
  classes: classes,
34
- onSend: onSend,
35
- btnProps: btnProps
31
+ onSend: onSend
36
32
  }, i);
37
33
  })]
38
34
  }, index);
@@ -46,18 +42,15 @@ export default CustomSelect;
46
42
  function DisplayOption({
47
43
  option,
48
44
  classes,
49
- onSend,
50
- btnProps = {}
45
+ onSend
51
46
  }) {
52
47
  const {
53
- Icon,
54
- Component
48
+ Icon
55
49
  } = option;
56
50
  const [open, setOpen] = useState(false);
57
51
  const optionRef = useRef();
58
- const showChild = option.options?.length || Component;
59
52
  const openOptions = e => {
60
- if (showChild && !open) {
53
+ if (option.options?.length && !open) {
61
54
  setOpen(e.currentTarget);
62
55
  return;
63
56
  }
@@ -73,7 +66,7 @@ function DisplayOption({
73
66
  e.stopPropagation();
74
67
 
75
68
  // is having child options
76
- if (showChild) {
69
+ if (option.options?.length) {
77
70
  openOptions(e);
78
71
  return;
79
72
  }
@@ -82,19 +75,18 @@ function DisplayOption({
82
75
  },
83
76
  id: "infinity-select-popover",
84
77
  className: open ? "active" : "",
85
- ...btnProps,
86
78
  children: [/*#__PURE__*/_jsxs("div", {
87
79
  className: "option-label",
88
80
  id: "infinity-select-popover",
89
81
  children: [Icon && /*#__PURE__*/_jsx(Icon, {}), option.label]
90
- }), showChild ? /*#__PURE__*/_jsx(IconButton, {
82
+ }), option.options?.length && /*#__PURE__*/_jsx(IconButton, {
91
83
  children: /*#__PURE__*/_jsx(FaChevronRight, {
92
84
  color: "#94A3B8",
93
85
  size: 12
94
86
  })
95
- }) : null]
87
+ })]
96
88
  }), /*#__PURE__*/_jsx(Popper, {
97
- open: open && showChild,
89
+ open: open && option.options,
98
90
  anchorEl: open,
99
91
  sx: {
100
92
  zIndex: 9001,
@@ -104,7 +96,7 @@ function DisplayOption({
104
96
  setOpen(null);
105
97
  },
106
98
  placement: "right-start",
107
- children: Component ? /*#__PURE__*/_jsx(Component, {}) : /*#__PURE__*/_jsx(Box, {
99
+ children: /*#__PURE__*/_jsx(Box, {
108
100
  children: /*#__PURE__*/_jsx(CustomSelect, {
109
101
  options: option.options,
110
102
  onSend: onSend,