@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
@@ -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,
@@ -27,7 +27,7 @@ import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
29
  import { getTRBLBreakPoints } from "./helper/theme";
30
- import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
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]);
@@ -158,7 +149,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
158
149
  setValue(draftToSlate({
159
150
  data: content
160
151
  }));
161
- updateTopBanner(content, setTopBanner);
162
152
  if (!isMobile && !ReactEditor.isFocused(editor)) {
163
153
  ReactEditor.focus(editor);
164
154
  }
@@ -308,7 +298,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
308
298
  }) : [];
309
299
  const handleEditorChange = newValue => {
310
300
  if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
311
- updateTopBanner(newValue, setTopBanner);
312
301
  debounced(newValue);
313
302
  if (!isInteracted) {
314
303
  setIsInteracted(true);
@@ -421,7 +410,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
421
410
  editorWrapper?.current?.classList.remove("hideScroll");
422
411
  handleScrollStop();
423
412
  };
424
- const hasTopBanner = () => topBanner;
413
+ const hasTopBanner = () => {
414
+ const tb = editor.children[0];
415
+ return tb?.type === "topbanner" ? tb : null;
416
+ };
425
417
  const renderTopBanner = () => {
426
418
  const tb = hasTopBanner();
427
419
  return tb ? /*#__PURE__*/_jsx(TopBanner, {
@@ -503,12 +495,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
503
495
  ,
504
496
  children: /*#__PURE__*/_jsxs(Slate, {
505
497
  editor: editor,
506
- initialValue: getInitialValue(debouncedValue?.current, readOnly),
498
+ initialValue: debouncedValue?.current,
507
499
  onChange: handleEditorChange,
508
500
  children: [/*#__PURE__*/_jsx(DragAndDrop, {
509
501
  children: /*#__PURE__*/_jsxs(Overlay, {
510
502
  children: [/*#__PURE__*/_jsx(Box, {
511
- 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`,
512
504
  sx: classes.slateWrapper,
513
505
  id: "slate-wrapper-scroll-container",
514
506
  ref: editorWrapper,
@@ -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 {
@@ -351,7 +351,7 @@ blockquote {
351
351
  height: 100%;
352
352
  width: 100%;
353
353
  border: 1px solid #2563EB;
354
- border-radius: 7px;
354
+ border-radius: 12px;
355
355
  }
356
356
 
357
357
  .activeBrush svg {
@@ -383,7 +383,7 @@ blockquote {
383
383
 
384
384
  .dialog-actions-si .MuiButtonBase-root {
385
385
  opacity: 1;
386
- padding: 0px 5px 0px 2px !important
386
+ padding: 6px 5px 0px 3px !important
387
387
  }
388
388
 
389
389
  .signature-tab {
@@ -397,9 +397,9 @@ blockquote {
397
397
  .signature-tab2 {
398
398
  /* display: flex; */
399
399
  align-items: center;
400
- border-width: 1px;
400
+ border-width: 0px, 0px, 0px, 0px;
401
401
  border-style: solid;
402
- border-color: #2563EB66;
402
+ border-color: #2563EB;
403
403
  justify-content: center;
404
404
  flex-direction: column;
405
405
  width: 100%;
@@ -493,9 +493,9 @@ blockquote {
493
493
 
494
494
  .MuiButton-root.primaryBtn.disabled,
495
495
  .MuiButton-root.secondaryBtn.disabled {
496
- background: #eee;
497
- color: #ccc;
498
- border: 1px solid #ccc;
496
+ background: #eee !important;
497
+ color: #ccc !important;
498
+ border: 1px solid #ccc !important;
499
499
  }
500
500
 
501
501
  .MuiButton-root.secondaryBtn {
@@ -623,7 +623,7 @@ blockquote {
623
623
  }
624
624
 
625
625
  .MuiIconButton-root.btnActive {
626
- color: #2563EB !important;
626
+ background-color: #ccc;
627
627
  }
628
628
 
629
629
  .embed .element-toolbar {
@@ -858,7 +858,7 @@ blockquote {
858
858
 
859
859
  .dialogComp .MuiInputBase-input {
860
860
  border-radius: 8px;
861
- /* 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);
862
862
  font-size: 12px;
863
863
  font-weight: 500;
864
864
  }
@@ -1073,10 +1073,6 @@ blockquote {
1073
1073
  font-size: 14px;
1074
1074
  }
1075
1075
 
1076
- .listItemMargin {
1077
- margin: 0px;
1078
- }
1079
-
1080
1076
  .content-editable.empty {
1081
1077
  position: relative;
1082
1078
  }
@@ -1230,57 +1226,15 @@ blockquote {
1230
1226
  position: absolute;
1231
1227
  }
1232
1228
 
1233
- .dividerComponent:hover .divider-settings,
1234
- .dividerComponent:hover .element-selector {
1229
+ .dividerComponent:hover .divider-settings {
1235
1230
  display: block;
1236
- pointer-events: auto;
1237
- }
1238
-
1239
- .hideScroll {
1240
- overflow-anchor: none;
1241
- }
1242
-
1243
- .hideScroll::-webkit-scrollbar-track {
1244
- background: none !important;
1245
- }
1246
-
1247
- .hideScroll::-webkit-scrollbar-thumb {
1248
- background: none !important;
1249
1231
  }
1250
1232
 
1251
- .hideScroll::-webkit-scrollbar-thumb:hover {
1252
- background: none !important;
1253
- }
1254
1233
  @media (max-width: 899px) {
1255
1234
  .MuiPopover-root {
1256
1235
  z-index: 1302 !important;
1257
1236
  }
1258
-
1259
1237
  canvas {
1260
1238
  max-width: 100% !important;
1261
1239
  }
1262
1240
  }
1263
-
1264
- .settingsHeader {
1265
- font-size: 14px !important;
1266
- font-weight: 500 !important;
1267
- }
1268
-
1269
- .custom-scroll::-webkit-scrollbar {
1270
- height: .6rem;
1271
- }
1272
-
1273
- .custom-scroll::-webkit-scrollbar-thumb {
1274
- background: #888;
1275
- border-radius: 5px;
1276
- cursor: pointer;
1277
- }
1278
-
1279
- .custom-scroll::-webkit-scrollbar-track {
1280
- background: #f1f1f1;
1281
- }
1282
-
1283
- .custom-scroll:hover::-webkit-scrollbar-thumb {
1284
- background: #A7AEC1;
1285
- }
1286
-
@@ -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,
@@ -108,15 +108,10 @@ const updateAnchorEl = (setAnchorEl, editor, openAI, selectedElement) => {
108
108
  return;
109
109
  }
110
110
  const selection = window.getSelection();
111
-
112
- // if (
113
- // openAI === "fromToolBar" &&
114
- // selection.anchorOffset !== selection.focusOffset
115
- // ) {
116
- // // to fix some issue in Drag n Drop
117
- // return;
118
- // }
119
-
111
+ if (openAI === "fromToolBar" && selection.anchorOffset !== selection.focusOffset) {
112
+ // to fix some issue in Drag n Drop
113
+ return;
114
+ }
120
115
  if (selection.rangeCount) {
121
116
  let caret;
122
117
  if (getSelectedText(editor)) {
@@ -115,7 +115,7 @@ const Styles = theme => ({
115
115
  overflow: "auto",
116
116
  // width: "240px",
117
117
  minWidth: "200px",
118
- border: `1px solid ${theme?.palette?.editor?.popUpBorderColor}`,
118
+ border: "1px solid #E0E0E0",
119
119
  padding: "6px"
120
120
  },
121
121
  optionWrapper: {
@@ -142,28 +142,16 @@ const Styles = theme => ({
142
142
  gap: "8px"
143
143
  },
144
144
  "&:hover": {
145
- backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`,
146
- "& svg path": {
147
- stroke: `${theme?.palette?.editor?.textColor} !important`
148
- },
149
- "& svg": {
150
- color: `${theme?.palette?.editor?.textColor} !important`
151
- }
152
- },
153
- "& svg path": {
154
- stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
155
- },
156
- "& svg": {
157
- color: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
145
+ background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`
158
146
  },
159
147
  "&.active": {
160
148
  background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`,
161
- color: theme?.palette?.editor?.menuOptionsSelectedTextColor,
149
+ color: "#2563EB",
162
150
  "& svg path": {
163
- stroke: theme?.palette?.editor?.menuOptionsSelectedTextColor
151
+ stroke: "#2563EB"
164
152
  },
165
153
  "& svg": {
166
- color: `${theme?.palette?.editor?.menuOptionsSelectedTextColor} !important`
154
+ color: "#2563EB !important"
167
155
  }
168
156
  }
169
157
  },
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { Node, Transforms } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
- import { Tooltip, IconButton, Box } from "@mui/material";
4
+ import { Tooltip, IconButton } from "@mui/material";
5
5
  import DeleteIcon from "@mui/icons-material/Delete";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -37,7 +37,7 @@ const CarouselItem = props => {
37
37
  className: "element-toolbar hr",
38
38
  style: {
39
39
  top: "0px",
40
- left: "0px"
40
+ right: "28px"
41
41
  },
42
42
  contentEditable: false,
43
43
  children: /*#__PURE__*/_jsx(Tooltip, {
@@ -53,7 +53,7 @@ const CarouselItem = props => {
53
53
  return /*#__PURE__*/_jsx("div", {
54
54
  ...attributes,
55
55
  className: "carousel-item",
56
- children: /*#__PURE__*/_jsxs(Box, {
56
+ children: /*#__PURE__*/_jsxs("div", {
57
57
  className: "carousel-item-inner",
58
58
  style: {
59
59
  minHeight: "50px",
@@ -61,14 +61,6 @@ const CarouselItem = props => {
61
61
  justifyContent: "center",
62
62
  alignItems: "center"
63
63
  },
64
- sx: {
65
- "& .ico-grp-ss": {
66
- position: "absolute",
67
- top: "0px",
68
- right: "0px",
69
- display: "flex"
70
- }
71
- },
72
64
  children: [children, /*#__PURE__*/_jsx(Toolbar, {})]
73
65
  })
74
66
  });
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { Box, IconButton, Popover } from "@mui/material";
3
- import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
3
+ import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
@@ -46,7 +46,7 @@ const SingleColorButton = ({
46
46
  id: `in_${id}`,
47
47
  onClick: handleMore,
48
48
  className: "more-btn-cbs",
49
- children: /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {})
49
+ children: /*#__PURE__*/_jsx(ArrowDropDownIcon, {})
50
50
  }) : null]
51
51
  }, `ci_bs_row_${index}}`);
52
52
  };
@@ -82,7 +82,7 @@ export const AllColors = props => {
82
82
  children: /*#__PURE__*/_jsx(Box, {
83
83
  className: "buttonsWrpr",
84
84
  style: {
85
- padding: "5px"
85
+ padding: "8px"
86
86
  },
87
87
  children: all.map((m, i) => {
88
88
  return /*#__PURE__*/_jsx(SingleColorButton, {
@@ -9,17 +9,13 @@ const ColorPickerStyles = theme => ({
9
9
  width: "24px",
10
10
  height: "24px",
11
11
  marginRight: "8px",
12
- border: "unset"
12
+ border: "1px solid #ccc"
13
13
  }
14
14
  },
15
15
  colorPopper: {
16
16
  marginTop: "20px",
17
- borderRadius: "7px !important",
18
17
  "& .MuiPaper-root": {
19
- backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
20
- border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
21
- borderRadius: "7px !important",
22
- padding: "0px 5px",
18
+ backgroundColor: theme?.palette?.editor?.background,
23
19
  '@media only screen and (max-width: 600px)': {
24
20
  marginTop: "-40px"
25
21
  }
@@ -58,7 +54,7 @@ const ColorPickerStyles = theme => ({
58
54
  width: "24px",
59
55
  height: "24px",
60
56
  margin: "0px 4px",
61
- border: "unset"
57
+ border: "1px solid #ccc"
62
58
  }
63
59
  },
64
60
  colorPickerIcon: {
@@ -1,4 +1,4 @@
1
- export const colors = ["#000000", "#578CFF", "#A58CFF", "#46BBFF", "#FFC93A", "#33B24F", "#F06C83", "#64748B", "#82A9FE", "#C4B3FF", "#71CBFF", "#FFD055", "#61D57A", "#FA91A4", "#A2B0B9", "#A4C1FF", "#D7CBFF", "#9FDCFF", "#FFDC80", "#8AE59E", "#FCB0BE", "#E4ECF3", "#CDDCFF", "#E0D7FF", "#BEE7FF", "#FFE49E", "#B9F6C6", "#FDCAD3", "#FFFFFF", "#489FF8", "#FE7A00", "linear-gradient(327.62deg, #EBB9E0 13.53%, #9CEEE5 86.82%)", "linear-gradient(310.6deg, #7FA4F4 15.53%, #805EF5 83.64%)", "linear-gradient(95.19deg, #A831E7 4.17%, #F05339 88.89%)", "linear-gradient(90deg, #3F2AB7 12.5%, #0DC9B5 100%)", "#0F172A", "#2563EB", "#8360FD", "#19A9FC", "#FDB52A", "#0E8E2A", "#E1425E"
1
+ export const colors = ["#292D32", "#578CFF", "#A58CFF", "#46BBFF", "#FFC93A", "#33B24F", "#F06C83", "#64748B", "#82A9FE", "#C4B3FF", "#71CBFF", "#FFD055", "#61D57A", "#FA91A4", "#A2B0B9", "#A4C1FF", "#D7CBFF", "#9FDCFF", "#FFDC80", "#8AE59E", "#FCB0BE", "#E4ECF3", "#CDDCFF", "#E0D7FF", "#BEE7FF", "#FFE49E", "#B9F6C6", "#FDCAD3", "#FFFFFF", "#489FF8", "#FE7A00", "linear-gradient(327.62deg, #EBB9E0 13.53%, #9CEEE5 86.82%)", "linear-gradient(310.6deg, #7FA4F4 15.53%, #805EF5 83.64%)", "linear-gradient(95.19deg, #A831E7 4.17%, #F05339 88.89%)", "linear-gradient(90deg, #3F2AB7 12.5%, #0DC9B5 100%)", "#0F172A", "#2563EB", "#8360FD", "#19A9FC", "#FDB52A", "#0E8E2A", "#E1425E"
2
2
  // "#E6E6E6",
3
- // "#BEBEBE",
3
+ // "#BEBEBE"
4
4
  ];