@flozy/editor 5.1.4 → 5.1.6

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 (151) hide show
  1. package/dist/Editor/ChatEditor.js +25 -34
  2. package/dist/Editor/CommonEditor.js +15 -9
  3. package/dist/Editor/Editor.css +56 -12
  4. package/dist/Editor/Elements/AI/AIInput.js +0 -1
  5. package/dist/Editor/Elements/AI/CustomSelect.js +17 -10
  6. package/dist/Editor/Elements/AI/Styles.js +7 -1
  7. package/dist/Editor/Elements/Button/EditorButton.js +1 -1
  8. package/dist/Editor/Elements/Carousel/CarouselItem.js +1 -1
  9. package/dist/Editor/Elements/Color Picker/ColorButtons.js +7 -5
  10. package/dist/Editor/Elements/Color Picker/Styles.js +7 -3
  11. package/dist/Editor/Elements/Color Picker/defaultColors.js +2 -2
  12. package/dist/Editor/Elements/DataView/DataView.js +101 -0
  13. package/dist/Editor/Elements/DataView/DataViewButton.js +23 -0
  14. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +59 -0
  15. package/dist/Editor/Elements/DataView/Layouts/DataTypes/CheckType.js +30 -0
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +140 -0
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SimpleSelect.js +40 -0
  18. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +59 -0
  19. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +26 -0
  20. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +38 -0
  21. package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +30 -0
  22. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +30 -0
  23. package/dist/Editor/Elements/DataView/Layouts/DataTypes/SelectType.js +35 -0
  24. package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +36 -0
  25. package/dist/Editor/Elements/DataView/Layouts/DataTypes/index.js +17 -0
  26. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseField.js +29 -0
  27. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +38 -0
  28. package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +74 -0
  29. package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +64 -0
  30. package/dist/Editor/Elements/DataView/Layouts/FilterSort/styles.js +106 -0
  31. package/dist/Editor/Elements/DataView/Layouts/FilterView.js +174 -0
  32. package/dist/Editor/Elements/DataView/Layouts/Formula.js +29 -0
  33. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +113 -0
  34. package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +37 -0
  35. package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +111 -0
  36. package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +62 -0
  37. package/dist/Editor/Elements/DataView/Layouts/Options/ColumnsList.js +36 -0
  38. package/dist/Editor/Elements/DataView/Layouts/Options/Constants.js +101 -0
  39. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +160 -0
  40. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +190 -0
  41. package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +42 -0
  42. package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +30 -0
  43. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +110 -0
  44. package/dist/Editor/Elements/DataView/Layouts/Options/styles.js +179 -0
  45. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +100 -0
  46. package/dist/Editor/Elements/DataView/Layouts/TableView.js +227 -0
  47. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +70 -0
  48. package/dist/Editor/Elements/DataView/Layouts/index.js +25 -0
  49. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +288 -0
  50. package/dist/Editor/Elements/DataView/Utils/globalSearch.js +15 -0
  51. package/dist/Editor/Elements/DataView/Utils/multiSortRows.js +72 -0
  52. package/dist/Editor/Elements/DataView/styles.js +143 -0
  53. package/dist/Editor/Elements/Divider/Divider.js +15 -14
  54. package/dist/Editor/Elements/Form/Form.js +38 -2
  55. package/dist/Editor/Elements/Form/FormElements/FormCheckbox.js +7 -1
  56. package/dist/Editor/Elements/Form/FormElements/FormDate.js +7 -1
  57. package/dist/Editor/Elements/Form/FormElements/FormEmail.js +7 -1
  58. package/dist/Editor/Elements/Form/FormElements/FormNumbers.js +7 -1
  59. package/dist/Editor/Elements/Form/FormElements/FormRadioButton.js +7 -1
  60. package/dist/Editor/Elements/Form/FormElements/FormText.js +7 -1
  61. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +6 -1
  62. package/dist/Editor/Elements/Form/FormPopup.js +12 -9
  63. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +1 -1
  64. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +20 -1
  65. package/dist/Editor/Elements/Grid/GridButton.js +2 -1
  66. package/dist/Editor/Elements/Grid/GridItem.js +12 -0
  67. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  68. package/dist/Editor/Elements/Signature/Signature.css +1 -1
  69. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -2
  70. package/dist/Editor/Elements/Signature/SignaturePopup.js +13 -48
  71. package/dist/Editor/Elements/SimpleText/index.js +8 -1
  72. package/dist/Editor/Elements/SimpleText/style.js +8 -1
  73. package/dist/Editor/Elements/Table/AddRowCol.js +77 -0
  74. package/dist/Editor/Elements/Table/DragButton.js +141 -0
  75. package/dist/Editor/Elements/Table/DragStyles.js +70 -0
  76. package/dist/Editor/Elements/Table/Draggable.js +25 -0
  77. package/dist/Editor/Elements/Table/Droppable.js +53 -0
  78. package/dist/Editor/Elements/Table/Styles.js +25 -43
  79. package/dist/Editor/Elements/Table/Table.js +205 -138
  80. package/dist/Editor/Elements/Table/TableCell.js +355 -102
  81. package/dist/Editor/Elements/Table/TablePopup.js +9 -3
  82. package/dist/Editor/Elements/Table/TableRow.js +10 -2
  83. package/dist/Editor/Elements/Table/TableTool.js +101 -0
  84. package/dist/Editor/Elements/Table/tableHelper.js +71 -0
  85. package/dist/Editor/Styles/EditorStyles.js +3 -1
  86. package/dist/Editor/Toolbar/FormatTools/BlockButton.js +10 -0
  87. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +7 -11
  88. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +10 -4
  89. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +3 -0
  90. package/dist/Editor/Toolbar/FormatTools/TextSize.js +0 -2
  91. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -6
  92. package/dist/Editor/Toolbar/Mini/Styles.js +4 -1
  93. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -3
  94. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +16 -11
  95. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +416 -49
  96. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +62 -8
  97. package/dist/Editor/Toolbar/PopupTool/index.js +5 -6
  98. package/dist/Editor/Toolbar/Toolbar.js +6 -0
  99. package/dist/Editor/Toolbar/toolbarGroups.js +4 -0
  100. package/dist/Editor/assets/svg/BrainIcon.js +2 -2
  101. package/dist/Editor/assets/svg/TableIcons.js +220 -0
  102. package/dist/Editor/common/ColorPickerButton.js +3 -2
  103. package/dist/Editor/common/FontLoader/FontLoader.js +4 -4
  104. package/dist/Editor/common/Icon.js +24 -23
  105. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -1
  106. package/dist/Editor/common/LinkSettings/index.js +2 -1
  107. package/dist/Editor/common/MentionsPopup/Styles.js +151 -3
  108. package/dist/Editor/common/MentionsPopup/index.js +1 -1
  109. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +108 -12
  110. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +14 -2
  111. package/dist/Editor/common/Select/index.js +20 -0
  112. package/dist/Editor/common/Select/styles.js +17 -0
  113. package/dist/Editor/common/Shorthands/elements.js +13 -1
  114. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  115. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +8 -4
  116. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  117. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
  118. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +79 -0
  119. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +7 -7
  120. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +5 -2
  121. package/dist/Editor/common/StyleBuilder/formStyle.js +268 -149
  122. package/dist/Editor/common/StyleBuilder/index.js +84 -11
  123. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +4 -0
  124. package/dist/Editor/common/StyleBuilder/tableStyle.js +69 -25
  125. package/dist/Editor/common/SwipeableDrawer/style.js +15 -4
  126. package/dist/Editor/common/Uploader.js +8 -0
  127. package/dist/Editor/common/iconListV2.js +378 -40
  128. package/dist/Editor/common/iconslist.js +23 -17
  129. package/dist/Editor/commonStyle.js +126 -9
  130. package/dist/Editor/helper/deserialize/index.js +4 -1
  131. package/dist/Editor/helper/index.js +2 -2
  132. package/dist/Editor/helper/theme.js +24 -1
  133. package/dist/Editor/hooks/useMouseMove.js +5 -2
  134. package/dist/Editor/hooks/useTable.js +195 -0
  135. package/dist/Editor/plugins/withCustomDeleteBackward.js +3 -2
  136. package/dist/Editor/plugins/withHTML.js +17 -1
  137. package/dist/Editor/plugins/withLayout.js +48 -1
  138. package/dist/Editor/utils/SlateUtilityFunctions.js +18 -0
  139. package/dist/Editor/utils/button.js +4 -4
  140. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +21 -0
  141. package/dist/Editor/utils/dataView.js +43 -0
  142. package/dist/Editor/utils/embed.js +2 -1
  143. package/dist/Editor/utils/events.js +0 -1
  144. package/dist/Editor/utils/font.js +11 -4
  145. package/dist/Editor/utils/formfield.js +8 -4
  146. package/dist/Editor/utils/helper.js +67 -2
  147. package/dist/Editor/utils/insertNewLine.js +19 -1
  148. package/dist/Editor/utils/pageSettings.js +14 -2
  149. package/dist/Editor/utils/serializeToText.js +2 -0
  150. package/dist/Editor/utils/table.js +228 -24
  151. package/package.json +1 -1
@@ -1,9 +1,8 @@
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";
5
4
  import withCommon from "./hooks/withCommon";
6
- import { getBlock, getMarked } from "./utils/chatEditor/SlateUtilityFunctions";
5
+ import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
7
6
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
8
7
  import { commands, mentionsEvent } from "./utils/events";
9
8
  import { insertEmoji } from "./utils/emoji";
@@ -15,6 +14,7 @@ import Shorthands from "./common/Shorthands";
15
14
  import usePopupStyle from "./Toolbar/PopupTool/PopupToolStyle";
16
15
  import { EditorProvider } from "./hooks/useMouseMove";
17
16
  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,8 +42,18 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
42
42
  });
43
43
  const [isInteracted, setIsInteracted] = useState(false);
44
44
  const [value, setValue] = useState(convertedContent);
45
- const [loadedValue] = useState(value);
46
- const [deboundedValue] = useDebounce(value, 500);
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);
47
57
  const editor = useMemo(() => {
48
58
  return withCommon(createEditor(), {
49
59
  needLayout,
@@ -63,7 +73,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
63
73
  const {
64
74
  value: strVal,
65
75
  ...restVal
66
- } = getOnSaveData(value);
76
+ } = getOnSaveData(debouncedValue?.current);
67
77
  onsubmit(false, {
68
78
  strVal,
69
79
  restVal
@@ -99,7 +109,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
99
109
  const newValue = draftToSlate({
100
110
  data: content
101
111
  });
102
- setValue(newValue);
112
+ debounced(newValue);
113
+
103
114
  // setTimeout(() => {
104
115
  if (editor.children.length === 0) {
105
116
  Transforms.insertNodes(editor, newValue);
@@ -112,27 +123,14 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
112
123
  }
113
124
  }
114
125
  }));
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]);
130
126
  const getOnSaveData = val => {
131
127
  const text = serializeToText(val);
128
+ const mentions = serializeMentions(val);
132
129
  const title = val?.find(f => f.type === "title");
133
130
  return {
134
131
  value: JSON.stringify(val),
135
132
  text: text,
133
+ mentions: mentions,
136
134
  title: serializeToText(title?.children) || "Untitled"
137
135
  };
138
136
  };
@@ -180,15 +178,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
180
178
  });
181
179
  };
182
180
  const handleEditorChange = 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);
181
+ debounced(newValue);
182
+ debouncedValue.current = newValue;
192
183
  if (!isInteracted) {
193
184
  setIsInteracted(true);
194
185
  }
@@ -228,7 +219,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
228
219
  editor
229
220
  });
230
221
  } else if (event.key === "Enter" && !isMobile) {
231
- const isEmpty = value.length === 1 && value[0].type === 'paragraph' && value[0].children.length === 1 && value[0].children[0].text === '';
222
+ const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
232
223
  if (isEmpty) {
233
224
  event.preventDefault();
234
225
  return;
@@ -237,7 +228,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
237
228
  const {
238
229
  value: strVal,
239
230
  ...restVal
240
- } = getOnSaveData(value);
231
+ } = getOnSaveData(debouncedValue?.current);
241
232
  onsubmit(false, {
242
233
  strVal,
243
234
  restVal
@@ -251,7 +242,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
251
242
  const {
252
243
  value: strVal,
253
244
  ...restVal
254
- } = getOnSaveData(value);
245
+ } = getOnSaveData(debouncedValue?.current);
255
246
  onBlur({
256
247
  strVal,
257
248
  restVal
@@ -272,7 +263,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
272
263
  editor: editor,
273
264
  children: /*#__PURE__*/_jsxs(Slate, {
274
265
  editor: editor,
275
- initialValue: value,
266
+ initialValue: debouncedValue?.current,
276
267
  onChange: handleEditorChange,
277
268
  children: [toolBar && /*#__PURE__*/_jsx(MiniTextFormat, {
278
269
  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 { getTRBLBreakPoints } from "./helper/theme";
30
- import { handleInsertLastElement, isFreeGrid, isFreeGridFragment, isPageSettings, outsideEditorClickLabel } from "./utils/helper";
29
+ import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
30
+ import { getInitialValue, 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";
@@ -130,7 +130,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
130
130
  pageColor,
131
131
  color: pageTextColor,
132
132
  pageWidth,
133
- maxWidth: pageMaxWidth
133
+ maxWidth: pageMaxWidth,
134
+ lineHeight
134
135
  } = pageSt?.pageProps || {
135
136
  bannerSpacing: {
136
137
  left: 0,
@@ -297,10 +298,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
297
298
  hideTools: updatedHideTools || []
298
299
  }) : [];
299
300
  const handleEditorChange = newValue => {
300
- if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
301
- debounced(newValue);
302
- if (!isInteracted) {
303
- setIsInteracted(true);
301
+ if (!readOnly) {
302
+ if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
303
+ debounced(newValue);
304
+ if (!isInteracted) {
305
+ setIsInteracted(true);
306
+ }
304
307
  }
305
308
  }
306
309
  };
@@ -319,6 +322,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
319
322
  onDrawerOpen: onDrawerOpen,
320
323
  ICON_API: "https://assets.agenciflow.com"
321
324
  };
325
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
322
326
  const renderElement = useCallback(props => {
323
327
  return /*#__PURE__*/_jsx(Element, {
324
328
  ...props,
@@ -495,7 +499,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
495
499
  ,
496
500
  children: /*#__PURE__*/_jsxs(Slate, {
497
501
  editor: editor,
498
- initialValue: debouncedValue?.current,
502
+ initialValue: getInitialValue(debouncedValue?.current, readOnly),
499
503
  onChange: handleEditorChange,
500
504
  children: [/*#__PURE__*/_jsx(DragAndDrop, {
501
505
  children: /*#__PURE__*/_jsxs(Overlay, {
@@ -524,6 +528,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
524
528
  padding: {
525
529
  ...getTRBLBreakPoints(bannerSpacing)
526
530
  },
531
+ lineHeight: lineH,
527
532
  width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
528
533
  height: viewport.h ? `${viewport.h}px` : `100%`,
529
534
  alignSelf: "center",
@@ -581,8 +586,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
581
586
  setIsTextSelected: setIsTextSelected,
582
587
  customProps: customProps,
583
588
  editorWrapper: editorWrapper
584
- }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
589
+ }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
585
590
  breakpoint: breakpoint,
591
+ show: showViewport,
586
592
  onChange: b => onSwitchBreakpoint(b)
587
593
  }) : null]
588
594
  })
@@ -42,7 +42,7 @@ blockquote {
42
42
  }
43
43
 
44
44
  .editor-wrapper table {
45
- border-collapse: separate;
45
+ border-collapse: collapse;
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: 10px;
152
+ border-radius: 50%;
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);
@@ -351,7 +351,7 @@ blockquote {
351
351
  height: 100%;
352
352
  width: 100%;
353
353
  border: 1px solid #2563EB;
354
- border-radius: 12px;
354
+ border-radius: 7px;
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: 6px 5px 0px 3px !important
386
+ padding: 0px 5px 0px 2px !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: 0px, 0px, 0px, 0px;
400
+ border-width: 1px;
401
401
  border-style: solid;
402
- border-color: #2563EB;
402
+ border-color: #2563EB66;
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 !important;
497
- color: #ccc !important;
498
- border: 1px solid #ccc !important;
496
+ background: #eee;
497
+ color: #ccc;
498
+ border: 1px solid #ccc;
499
499
  }
500
500
 
501
501
  .MuiButton-root.secondaryBtn {
@@ -623,7 +623,7 @@ blockquote {
623
623
  }
624
624
 
625
625
  .MuiIconButton-root.btnActive {
626
- background-color: #ccc;
626
+ color: #2563EB !important;
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,6 +1073,10 @@ blockquote {
1073
1073
  font-size: 14px;
1074
1074
  }
1075
1075
 
1076
+ .listItemMargin {
1077
+ margin: 0px;
1078
+ }
1079
+
1076
1080
  .content-editable.empty {
1077
1081
  position: relative;
1078
1082
  }
@@ -1226,8 +1230,10 @@ blockquote {
1226
1230
  position: absolute;
1227
1231
  }
1228
1232
 
1229
- .dividerComponent:hover .divider-settings {
1233
+ .dividerComponent:hover .divider-settings,
1234
+ .dividerComponent:hover .element-selector {
1230
1235
  display: block;
1236
+ pointer-events: auto;
1231
1237
  }
1232
1238
 
1233
1239
  @media (max-width: 899px) {
@@ -1238,3 +1244,41 @@ blockquote {
1238
1244
  max-width: 100% !important;
1239
1245
  }
1240
1246
  }
1247
+
1248
+ .settingsHeader {
1249
+ font-size: 14px !important;
1250
+ font-weight: 500 !important;
1251
+ }
1252
+ .hideScroll {
1253
+ overflow-anchor: none;
1254
+ }
1255
+
1256
+ .hideScroll::-webkit-scrollbar-track {
1257
+ background: none !important;
1258
+ }
1259
+
1260
+ .hideScroll::-webkit-scrollbar-thumb {
1261
+ background: none !important;
1262
+ }
1263
+
1264
+ .hideScroll::-webkit-scrollbar-thumb:hover {
1265
+ background: none !important;
1266
+ }
1267
+
1268
+ .custom-scroll::-webkit-scrollbar {
1269
+ height: .6rem;
1270
+ }
1271
+
1272
+ .custom-scroll::-webkit-scrollbar-thumb {
1273
+ background: #888;
1274
+ border-radius: 5px;
1275
+ cursor: pointer;
1276
+ }
1277
+
1278
+ .custom-scroll::-webkit-scrollbar-track {
1279
+ background: #f1f1f1;
1280
+ }
1281
+
1282
+ .custom-scroll:hover::-webkit-scrollbar-thumb {
1283
+ background: #A7AEC1;
1284
+ }
@@ -71,7 +71,6 @@ function AIInput({
71
71
  }, [openAI]);
72
72
  const isSendBtnDisabled = !inputValue || loading;
73
73
  const props = getProps(openAI, generatedText) || {};
74
- const fromToolBar = openAI === "fromToolBar";
75
74
  const handleSendBtnClick = () => {
76
75
  if (isSendBtnDisabled) {
77
76
  return;
@@ -8,12 +8,14 @@ function CustomSelect({
8
8
  classes,
9
9
  options,
10
10
  onSend,
11
- show
11
+ show,
12
+ btnProps = {}
12
13
  }) {
13
14
  if (show) {
14
15
  return /*#__PURE__*/_jsx(Box, {
15
16
  component: "div",
16
17
  sx: classes.customSelectContainer,
18
+ className: "customSelectContainer",
17
19
  children: options?.map((groupOption, index) => {
18
20
  const {
19
21
  options,
@@ -28,7 +30,8 @@ function CustomSelect({
28
30
  return /*#__PURE__*/_jsx(DisplayOption, {
29
31
  option: option,
30
32
  classes: classes,
31
- onSend: onSend
33
+ onSend: onSend,
34
+ btnProps: btnProps
32
35
  }, i);
33
36
  })]
34
37
  }, index);
@@ -42,15 +45,18 @@ export default CustomSelect;
42
45
  function DisplayOption({
43
46
  option,
44
47
  classes,
45
- onSend
48
+ onSend,
49
+ btnProps = {}
46
50
  }) {
47
51
  const {
48
- Icon
52
+ Icon,
53
+ Component
49
54
  } = option;
50
55
  const [open, setOpen] = useState(false);
51
56
  const optionRef = useRef();
57
+ const showChild = option.options?.length || Component;
52
58
  const openOptions = e => {
53
- if (option.options?.length && !open) {
59
+ if (showChild && !open) {
54
60
  setOpen(e.currentTarget);
55
61
  return;
56
62
  }
@@ -66,7 +72,7 @@ function DisplayOption({
66
72
  e.stopPropagation();
67
73
 
68
74
  // is having child options
69
- if (option.options?.length) {
75
+ if (showChild) {
70
76
  openOptions(e);
71
77
  return;
72
78
  }
@@ -75,18 +81,19 @@ function DisplayOption({
75
81
  },
76
82
  id: "infinity-select-popover",
77
83
  className: open ? "active" : "",
84
+ ...btnProps,
78
85
  children: [/*#__PURE__*/_jsxs("div", {
79
86
  className: "option-label",
80
87
  id: "infinity-select-popover",
81
88
  children: [Icon && /*#__PURE__*/_jsx(Icon, {}), option.label]
82
- }), option.options?.length && /*#__PURE__*/_jsx(IconButton, {
89
+ }), showChild ? /*#__PURE__*/_jsx(IconButton, {
83
90
  children: /*#__PURE__*/_jsx(FaChevronRight, {
84
91
  color: "#94A3B8",
85
92
  size: 12
86
93
  })
87
- })]
94
+ }) : null]
88
95
  }), /*#__PURE__*/_jsx(Popper, {
89
- open: open && option.options,
96
+ open: open && showChild,
90
97
  anchorEl: open,
91
98
  sx: {
92
99
  zIndex: 9001,
@@ -96,7 +103,7 @@ function DisplayOption({
96
103
  setOpen(null);
97
104
  },
98
105
  placement: "right-start",
99
- children: /*#__PURE__*/_jsx(Box, {
106
+ children: Component ? /*#__PURE__*/_jsx(Component, {}) : /*#__PURE__*/_jsx(Box, {
100
107
  children: /*#__PURE__*/_jsx(CustomSelect, {
101
108
  options: option.options,
102
109
  onSend: onSend,
@@ -142,7 +142,13 @@ const Styles = theme => ({
142
142
  gap: "8px"
143
143
  },
144
144
  "&:hover": {
145
- background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`
145
+ backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
146
+ },
147
+ "& svg path": {
148
+ stroke: `${theme?.palette?.editor?.menuOptionTextColor} !important`
149
+ },
150
+ "& svg": {
151
+ color: `${theme?.palette?.editor?.menuOptionTextColor} !important`
146
152
  },
147
153
  "&.active": {
148
154
  background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`,
@@ -259,7 +259,7 @@ const EditorButton = props => {
259
259
  ...btnSp,
260
260
  borderStyle: borderStyle || "solid",
261
261
  color: `${textColor || "#FFFFFF"}`,
262
- fontSize: textSize || "inherit",
262
+ fontSize: textSize || "12px",
263
263
  fontFamily: fontFamily || "PoppinsRegular",
264
264
  display: "inline-flex",
265
265
  alignItems: "center",
@@ -37,7 +37,7 @@ const CarouselItem = props => {
37
37
  className: "element-toolbar hr",
38
38
  style: {
39
39
  top: "0px",
40
- right: "28px"
40
+ left: "0px"
41
41
  },
42
42
  contentEditable: false,
43
43
  children: /*#__PURE__*/_jsx(Tooltip, {
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { Box, IconButton, Popover } from "@mui/material";
3
- import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
3
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
@@ -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(ArrowDropDownIcon, {})
49
+ children: /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {})
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: "8px"
85
+ padding: "5px"
86
86
  },
87
87
  children: all.map((m, i) => {
88
88
  return /*#__PURE__*/_jsx(SingleColorButton, {
@@ -109,11 +109,13 @@ const ColorButtons = props => {
109
109
  forMiniTool,
110
110
  openColorTool,
111
111
  onClose,
112
- onColorPickerClick
112
+ onColorPickerClick,
113
+ defaultColors = []
113
114
  } = props;
114
115
  const [row1, ...restRows] = ColorChunks([]);
115
116
  const [anchorEl, setAnchorEl] = useState(null);
116
117
  const open = Boolean(anchorEl);
118
+ const firstRow = defaultColors?.length ? defaultColors : row1;
117
119
  const handleMore = e => {
118
120
  setAnchorEl(e.currentTarget);
119
121
  };
@@ -131,7 +133,7 @@ const ColorButtons = props => {
131
133
  sx: classes.colorButtons,
132
134
  children: [forMiniTool ? null : /*#__PURE__*/_jsx(Box, {
133
135
  className: "buttonsWrpr first",
134
- children: [row1].map((m, i) => {
136
+ children: [firstRow].map((m, i) => {
135
137
  return /*#__PURE__*/_jsx(SingleColorButton, {
136
138
  id: `p1_${id}`,
137
139
  crs: m,
@@ -9,13 +9,17 @@ const ColorPickerStyles = theme => ({
9
9
  width: "24px",
10
10
  height: "24px",
11
11
  marginRight: "8px",
12
- border: "1px solid #ccc"
12
+ border: "unset"
13
13
  }
14
14
  },
15
15
  colorPopper: {
16
16
  marginTop: "20px",
17
+ borderRadius: "7px !important",
17
18
  "& .MuiPaper-root": {
18
- backgroundColor: theme?.palette?.editor?.background,
19
+ backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
20
+ border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
21
+ borderRadius: "7px !important",
22
+ padding: "0px 5px",
19
23
  '@media only screen and (max-width: 600px)': {
20
24
  marginTop: "-40px"
21
25
  }
@@ -54,7 +58,7 @@ const ColorPickerStyles = theme => ({
54
58
  width: "24px",
55
59
  height: "24px",
56
60
  margin: "0px 4px",
57
- border: "1px solid #ccc"
61
+ border: "unset"
58
62
  }
59
63
  },
60
64
  colorPickerIcon: {
@@ -1,4 +1,4 @@
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"
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"
2
2
  // "#E6E6E6",
3
- // "#BEBEBE"
3
+ // "#BEBEBE",
4
4
  ];
@@ -0,0 +1,101 @@
1
+ import React from "react";
2
+ import { Node, Path, Transforms } from "slate";
3
+ import { ReactEditor, useSlateStatic } from "slate-react";
4
+ import { Box, useTheme } from "@mui/material";
5
+ import { DataViewProvider } from "./Providers/DataViewProvider";
6
+ import useDataViewStyles from "./styles";
7
+ import LayoutView from "./Layouts";
8
+ import FilterView from "./Layouts/FilterView";
9
+ import { insertLineBreakAtEndOfPath } from "../../utils/helper";
10
+ import { useEditorContext } from "../../hooks/useMouseMove";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ const DataView = props => {
14
+ const {
15
+ theme: appTheme
16
+ } = useEditorContext();
17
+ const theme = useTheme();
18
+ const editor = useSlateStatic();
19
+ const {
20
+ attributes,
21
+ children,
22
+ element,
23
+ customProps,
24
+ title
25
+ } = props;
26
+ const {
27
+ CHARACTERS,
28
+ readOnly
29
+ } = customProps || {};
30
+ const {
31
+ properties,
32
+ layouts,
33
+ rows
34
+ } = element;
35
+ const classes = useDataViewStyles(theme, appTheme);
36
+ const path = ReactEditor.findPath(editor, element);
37
+ const onDuplicate = () => {
38
+ try {
39
+ const newPath = ReactEditor.findPath(editor, element);
40
+ const dataViewNode = Node.get(editor, newPath);
41
+ const cloneNode = JSON.parse(JSON.stringify(dataViewNode));
42
+ const toPath = Path.next(Path.parent(newPath));
43
+ Transforms.insertNodes(editor, [{
44
+ type: "paragraph",
45
+ children: [{
46
+ ...cloneNode
47
+ }]
48
+ }], {
49
+ at: toPath
50
+ });
51
+ } catch (err) {
52
+ console.log(err);
53
+ }
54
+ };
55
+ const onDelete = () => {
56
+ try {
57
+ const newPath = ReactEditor.findPath(editor, element);
58
+ Transforms.removeNodes(editor, {
59
+ at: newPath
60
+ });
61
+ } catch (err) {
62
+ console.log(err);
63
+ }
64
+ };
65
+ const onEnter = () => {
66
+ try {
67
+ const newPath = ReactEditor.findPath(editor, element);
68
+ const toPath = Path.previous(Path.parent(newPath));
69
+ insertLineBreakAtEndOfPath(editor, toPath);
70
+ } catch (err) {
71
+ console.log(err);
72
+ }
73
+ };
74
+ return /*#__PURE__*/_jsx(Box, {
75
+ ...attributes,
76
+ className: "fe-dataview",
77
+ sx: classes.root,
78
+ children: /*#__PURE__*/_jsxs(DataViewProvider, {
79
+ initialData: {
80
+ properties,
81
+ layouts,
82
+ rows,
83
+ users: CHARACTERS,
84
+ tableTitle: title
85
+ },
86
+ path: path,
87
+ editor: editor,
88
+ children: [/*#__PURE__*/_jsx(FilterView, {
89
+ classes: classes,
90
+ onEnter: onEnter,
91
+ onDelete: onDelete,
92
+ onDuplicate: onDuplicate,
93
+ readOnly: readOnly
94
+ }), /*#__PURE__*/_jsx(LayoutView, {
95
+ readOnly: readOnly,
96
+ children: children
97
+ })]
98
+ })
99
+ });
100
+ };
101
+ export default DataView;