@flozy/editor 10.6.8 → 10.7.0

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 (128) hide show
  1. package/dist/Editor/ChatEditor.js +16 -17
  2. package/dist/Editor/CommonEditor.js +13 -116
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +11 -31
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
  6. package/dist/Editor/Elements/AI/Styles.js +0 -1
  7. package/dist/Editor/Elements/Accordion/Accordion.js +17 -25
  8. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  9. package/dist/Editor/Elements/Button/EditorButton.js +7 -23
  10. package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -61
  11. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
  13. package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
  15. package/dist/Editor/Elements/Embed/Video.js +1 -1
  16. package/dist/Editor/Elements/Form/FormField.js +1 -1
  17. package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
  18. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +30 -31
  19. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -7
  20. package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
  21. package/dist/Editor/Elements/FreeGrid/styles.js +0 -9
  22. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  23. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  24. package/dist/Editor/Elements/Table/Table.js +3 -3
  25. package/dist/Editor/Elements/Title/title.js +6 -6
  26. package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
  27. package/dist/Editor/MiniEditor.js +1 -2
  28. package/dist/Editor/Styles/EditorStyles.js +5 -9
  29. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  30. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  31. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  32. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
  33. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -2
  34. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -4
  35. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  36. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +2 -4
  37. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
  38. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -7
  39. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
  40. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +9 -69
  41. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +10 -58
  42. package/dist/Editor/Toolbar/PopupTool/index.js +2 -5
  43. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  44. package/dist/Editor/common/ColorPickerButton.js +16 -38
  45. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  46. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  47. package/dist/Editor/common/Icon.js +0 -28
  48. package/dist/Editor/common/ImageSelector/ImageSelector.js +2 -2
  49. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  50. package/dist/Editor/common/LinkSettings/NavComponents.js +2 -6
  51. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  52. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  53. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  54. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  55. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  56. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  57. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -3
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  61. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -11
  62. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  63. package/dist/Editor/common/RnD/Utils/gridDropItem.js +18 -28
  64. package/dist/Editor/common/RnD/Utils/index.js +1 -3
  65. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +58 -45
  66. package/dist/Editor/common/RnD/VirtualElement/helper.js +130 -320
  67. package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -22
  68. package/dist/Editor/common/RnD/index.js +11 -42
  69. package/dist/Editor/common/Shorthands/elements.js +0 -54
  70. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  71. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -4
  72. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  73. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -36
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -16
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +0 -2
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  81. package/dist/Editor/common/Uploader.js +0 -16
  82. package/dist/Editor/common/iconslist.js +0 -21
  83. package/dist/Editor/commonStyle.js +64 -107
  84. package/dist/Editor/helper/index.js +2 -7
  85. package/dist/Editor/helper/theme.js +2 -203
  86. package/dist/Editor/hooks/useMouseMove.js +3 -9
  87. package/dist/Editor/plugins/withEmbeds.js +1 -1
  88. package/dist/Editor/plugins/withHTML.js +1 -3
  89. package/dist/Editor/plugins/withTable.js +1 -1
  90. package/dist/Editor/theme/ThemeList.js +173 -50
  91. package/dist/Editor/utils/SlateUtilityFunctions.js +24 -229
  92. package/dist/Editor/utils/accordion.js +34 -62
  93. package/dist/Editor/utils/button.js +17 -1
  94. package/dist/Editor/utils/draftToSlate.js +2 -3
  95. package/dist/Editor/utils/font.js +37 -40
  96. package/dist/Editor/utils/helper.js +21 -97
  97. package/dist/Editor/utils/insertAppHeader.js +4 -8
  98. package/package.json +4 -4
  99. package/dist/Editor/Elements/FreeGrid/helper.js +0 -115
  100. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -439
  101. package/dist/Editor/assets/svg/BackIcon.js +0 -18
  102. package/dist/Editor/assets/svg/ThemeIcons.js +0 -293
  103. package/dist/Editor/common/CustomColorPicker/index.js +0 -130
  104. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  105. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  106. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  107. package/dist/Editor/common/CustomSelect.js +0 -43
  108. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  109. package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +0 -115
  110. package/dist/Editor/helper/textIndeces.js +0 -58
  111. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  112. package/dist/Editor/hooks/useThemeValues.js +0 -63
  113. package/dist/Editor/theme/index.js +0 -149
  114. package/dist/Editor/themeSettings/ActiveTheme.js +0 -82
  115. package/dist/Editor/themeSettings/buttons/index.js +0 -300
  116. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  117. package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
  118. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  119. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  120. package/dist/Editor/themeSettings/fonts/index.js +0 -240
  121. package/dist/Editor/themeSettings/fonts/style.js +0 -62
  122. package/dist/Editor/themeSettings/icons.js +0 -60
  123. package/dist/Editor/themeSettings/index.js +0 -380
  124. package/dist/Editor/themeSettings/style.js +0 -299
  125. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  126. package/dist/Editor/themeSettingsAI/index.js +0 -355
  127. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -202
  128. package/dist/Editor/themeSettingsAI/style.js +0 -332
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useMemo, useRef, useImperativeHandle, forwardRef, useState } from "react";
2
- import { Editable, Slate, ReactEditor } from "slate-react";
3
- import { createEditor, Transforms, Editor } from "slate";
2
+ import { Editable, Slate, ReactEditor } from 'slate-react';
3
+ import { createEditor, Transforms, Editor } from 'slate';
4
4
  import withCommon from "./hooks/withCommon";
5
5
  import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
6
6
  import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
@@ -33,15 +33,15 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
33
33
  isMobile = false,
34
34
  debounceTimeOut = 10,
35
35
  isMarkDown = false,
36
- markDownContent = "",
36
+ markDownContent = '',
37
37
  translation
38
38
  } = props;
39
39
  const classes = usePopupStyle(theme);
40
40
  const convertedContent = draftToSlate({
41
41
  data: content && content?.length > 0 ? content : [{
42
- type: "paragraph",
42
+ type: 'paragraph',
43
43
  children: [{
44
- text: ""
44
+ text: ''
45
45
  }]
46
46
  }]
47
47
  });
@@ -153,6 +153,14 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
153
153
  // needLayout = true,
154
154
  } = otherProps || {};
155
155
  const mentionsRef = useRef();
156
+ const customProps = {
157
+ ...(otherProps || {}),
158
+ hideTools: ["settings", "add_column", "drag", "resize"],
159
+ readOnly: isReadOnly,
160
+ editorPlaceholder: "Write Something",
161
+ page_id: 1,
162
+ translation: translation || translationMock
163
+ };
156
164
  const [mentions, setMentions] = useMentions({
157
165
  editor,
158
166
  selection: editor?.selection
@@ -214,15 +222,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
214
222
  debounced(newValue);
215
223
  debouncedValue.current = newValue;
216
224
  };
217
- const dummyTranslation = () => {};
218
- const customProps = {
219
- ...(otherProps || {}),
220
- hideTools: ["settings", "add_column", "drag", "resize"],
221
- readOnly: isReadOnly,
222
- editorPlaceholder: "Write Something",
223
- page_id: 1,
224
- translation: translation || translationMock || dummyTranslation
225
- };
226
225
  const Element = props => {
227
226
  return getBlock(props);
228
227
  };
@@ -258,7 +257,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
258
257
  editor
259
258
  });
260
259
  } else if (event.key === "Enter" && !isMobile) {
261
- const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === "paragraph" && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === "";
260
+ const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
262
261
  if (isEmpty) {
263
262
  event.preventDefault();
264
263
  return;
@@ -298,10 +297,10 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
298
297
  }
299
298
  };
300
299
 
301
- const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
302
300
  const handleFocus = () => {
303
301
  setIsFocused(true);
304
302
  };
303
+ const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
305
304
  return !isMarkDown ? /*#__PURE__*/_jsx(EditorProvider, {
306
305
  theme: theme,
307
306
  editor: editor,
@@ -315,13 +314,13 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
315
314
  closeMainPopup: handleClose,
316
315
  customProps: customProps
317
316
  }), /*#__PURE__*/_jsx(Editable, {
317
+ onFocus: handleFocus,
318
318
  className: "chatEditorRoot",
319
319
  renderElement: renderElement,
320
320
  renderLeaf: renderLeaf,
321
321
  decorate: decorators,
322
322
  placeholder: "Start typing ...",
323
323
  spellCheck: true,
324
- onFocus: handleFocus,
325
324
  onBlur: handleBlur,
326
325
  onKeyDown: onKeyDown,
327
326
  onPaste: handlePaste,
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-unused-vars */
2
- import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle, createContext } from "react";
2
+ import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
3
3
  import PropTypes from "prop-types";
4
- import { createEditor, Editor, Range, Transforms } from "slate";
4
+ import { createEditor, Range, Transforms } from "slate";
5
5
  import { Slate, Editable, ReactEditor } from "slate-react";
6
6
  import { useDebouncedCallback } from "use-debounce";
7
7
  import { getMarked, getBlock } from "./utils/SlateUtilityFunctions";
@@ -17,7 +17,7 @@ import { serializeToText } from "./utils/serializeToText";
17
17
  import { getPageSettings } from "./utils/pageSettings";
18
18
  import { getThumbnailImage, invertColor, pageTextStyle } from "./helper";
19
19
  import PopupTool from "./Toolbar/PopupTool";
20
- import { Box, Typography, useTheme, IconButton } from "@mui/material";
20
+ import { Box, Typography, useTheme } from "@mui/material";
21
21
  import Shorthands from "./common/Shorthands";
22
22
  import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
23
23
  import { EditorProvider } from "./hooks/useMouseMove";
@@ -26,12 +26,9 @@ 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, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
29
+ import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
30
30
  import { getInitialValue, handleCopy, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
- import { getTheme } from "./theme";
33
- import ThemeSettings from "./themeSettings";
34
- import ThemeSettingsAI from "./themeSettingsAI";
35
32
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
36
33
  import RnDCopy from "./common/RnD/RnDCopy";
37
34
  import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
@@ -40,12 +37,9 @@ import "./font.css";
40
37
  import "./Editor.css";
41
38
  import "animate.css";
42
39
  import FontLoader from "./common/FontLoader/FontLoader";
43
- import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
44
40
  import { CustomDialogComponent } from "./common/CustomDialog";
45
- import { extractTextWithPath, replaceTextPath } from "./helper/textIndeces.js";
46
41
  import { jsx as _jsx } from "react/jsx-runtime";
47
42
  import { jsxs as _jsxs } from "react/jsx-runtime";
48
- export const ThemeContext = /*#__PURE__*/createContext(null);
49
43
  const Item = /*#__PURE__*/forwardRef(({
50
44
  children,
51
45
  ...props
@@ -87,7 +81,6 @@ const updateTopBanner = (content = [], setTopBanner) => {
87
81
  return firstNode?.type === "topbanner" ? firstNode : null;
88
82
  });
89
83
  };
90
- const dummyTranslation = () => {};
91
84
  const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
92
85
  const {
93
86
  id,
@@ -101,7 +94,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
101
94
  otherProps,
102
95
  isIframe,
103
96
  theme,
104
- showThemeButtons,
105
97
  showViewport = false,
106
98
  overrideWrapperStyles = {},
107
99
  translation
@@ -109,8 +101,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
109
101
  const editorWrapper = useRef();
110
102
  const mentionsRef = useRef();
111
103
  const convertedContent = draftToSlate({
112
- data: content,
113
- needLayout: otherProps?.needLayout
104
+ data: content
114
105
  });
115
106
  const [value, setValue] = useState(convertedContent);
116
107
  const [isInteracted, setIsInteracted] = useState(false);
@@ -154,11 +145,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
154
145
  const {
155
146
  bannerSpacing,
156
147
  pageBgImage,
157
- pageColor = "",
148
+ pageColor,
158
149
  color: pageTextColor,
159
150
  pageWidth,
160
151
  maxWidth: pageMaxWidth,
161
- theme: selectedTheme,
162
152
  lineHeight
163
153
  } = pageSt?.pageProps || {
164
154
  bannerSpacing: {
@@ -170,17 +160,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
170
160
  };
171
161
  const classes = editorStyles({
172
162
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
173
- placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
163
+ placeHolderColor: invertColor(pageColor || "#FFF"),
174
164
  theme,
175
165
  overrideWrapperStyles
176
166
  });
177
- const [openTheme, setOpenTheme] = useState(false);
178
- const [openAITheme, setOpenAITheme] = useState(false);
179
- const [, setThemeUpdated] = useState(0);
180
- const triggerRender = () => {
181
- setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
182
- };
183
-
184
167
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
185
168
  useEffect(() => {
186
169
  setValue(draftToSlate({
@@ -205,11 +188,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
205
188
  const debounced = useDebouncedCallback(
206
189
  // function
207
190
  value => {
208
- debouncedValue.current = value;
209
191
  const {
210
192
  value: strVal,
211
193
  ...restVal
212
194
  } = getOnSaveData(value);
195
+ debouncedValue.current = value;
213
196
  onSave(strVal, restVal);
214
197
  },
215
198
  // delay in ms
@@ -220,7 +203,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
220
203
  return {
221
204
  value: JSON.stringify(val),
222
205
  text: text,
223
- title: serializeToText(title?.children) || ""
206
+ title: serializeToText(title?.children) || "Untitled"
224
207
  };
225
208
  };
226
209
  const getTitleSaveData = title => {
@@ -237,12 +220,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
237
220
  const getPreviewImage = async (needBackground = false, options = {}) => {
238
221
  ReactEditor.blur(editor);
239
222
  const dom = needBackground ? editorWrapper?.current : editorWrapper?.current.getElementsByClassName("innert-editor-textbox")[0];
240
- const pageBg = options?.fromBrains ? {
241
- pageColor
242
- } : {};
243
223
  const c = await getThumbnailImage(dom, {
244
224
  ...options,
245
- ...pageBg,
246
225
  proxy: `${otherProps?.PAGES_API_HOST}/page/2canvas`
247
226
  });
248
227
  return c;
@@ -337,12 +316,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
337
316
  redo() {
338
317
  editor?.redo();
339
318
  },
340
- toggleTheme() {
341
- setOpenTheme(!openTheme);
342
- },
343
- toggleAITheme() {
344
- setOpenAITheme(!openAITheme);
345
- },
346
319
  getPageSettings: {
347
320
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
348
321
  }
@@ -546,7 +519,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
546
519
  }
547
520
  return style;
548
521
  }, [pageBgImage, pageColor, pageTextColor]);
549
- const themeProps = getTheme(selectedTheme);
550
522
 
551
523
  // const handleContextMenu = (e) => {
552
524
  // if (!readOnly) {
@@ -577,80 +549,19 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
577
549
  console.log("handleCursorScroll", err);
578
550
  }
579
551
  };
580
- window.getTextIndeces = () => {
581
- try {
582
- const textWithPaths = extractTextWithPath(editor.children, []);
583
- return textWithPaths;
584
- } catch (err) {
585
- console.log(err);
586
- }
587
- };
588
- window.replaceTextIndeces = (path_data = []) => {
589
- try {
590
- const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
591
-
592
- // loop delete all
593
- editor.children.forEach(() => {
594
- Transforms.delete(editor, {
595
- at: [0]
596
- });
597
- });
598
-
599
- // Insert new nodes
600
- Transforms.insertNodes(editor, replacedJson, {
601
- at: [0]
602
- });
603
- } catch (err) {
604
- console.log(err);
605
- }
606
- };
607
- window.replaceEditorContent = (fragments = []) => {
608
- try {
609
- // loop delete all
610
- editor.children.forEach(() => {
611
- Transforms.delete(editor, {
612
- at: [0]
613
- });
614
- });
615
-
616
- // Insert new nodes
617
- Transforms.insertNodes(editor, fragments, {
618
- at: [0]
619
- });
620
- } catch (err) {
621
- console.log(err);
622
- }
623
- };
624
552
  return /*#__PURE__*/_jsxs(EditorProvider, {
625
553
  theme: theme,
626
554
  editor: editor,
627
- openTheme: openTheme,
628
- setOpenTheme: setOpenTheme,
629
- triggerRender: triggerRender,
630
555
  children: [/*#__PURE__*/_jsx(FontLoader, {
631
556
  otherProps: {
632
557
  services: otherProps?.services
633
558
  },
634
559
  readOnly: readOnly
635
- }), showThemeButtons ? /*#__PURE__*/_jsxs("div", {
636
- className: "theme-buttons",
637
- children: [/*#__PURE__*/_jsx(IconButton, {
638
- onClick: () => setOpenTheme(true),
639
- className: "themePaintIcon",
640
- children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
641
- }), /*#__PURE__*/_jsx(IconButton, {
642
- onClick: () => setOpenAITheme(true),
643
- style: {
644
- marginTop: "4px"
645
- },
646
- children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
647
- })]
648
- }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
560
+ }), /*#__PURE__*/_jsx(DialogWrapper, {
649
561
  classes: classes,
650
562
  ...props,
651
563
  fullScreen: fullScreen,
652
564
  footer: footer || "",
653
- selectedTheme: selectedTheme,
654
565
  children: /*#__PURE__*/_jsx(Box, {
655
566
  component: "div",
656
567
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -685,7 +596,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
685
596
  children: /*#__PURE__*/_jsxs(Box, {
686
597
  component: "div",
687
598
  className: "max-content",
688
- sx: themeProps?.sxProps || {},
689
599
  "data-info": outsideEditorClickLabel,
690
600
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
691
601
  className: "scroll-area",
@@ -731,8 +641,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
731
641
  chars: chars,
732
642
  type: type,
733
643
  theme: theme,
734
- customProps: customProps,
735
- otherProps: customProps
644
+ otherProps: customProps,
645
+ customProps: customProps
736
646
  }) : null, /*#__PURE__*/_jsx(RnDCopy, {
737
647
  readOnly: readOnly
738
648
  })]
@@ -755,18 +665,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
755
665
  "data-info": outsideEditorClickLabel,
756
666
  onClick: handleFooterClick,
757
667
  children: footer
758
- }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
759
- open: openTheme,
760
- setOpen: setOpenTheme,
761
- editor: editor,
762
- services: otherProps?.services,
763
- appTheme: theme,
764
- customProps: customProps
765
- }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
766
- openAITheme: openAITheme,
767
- setOpenAITheme: setOpenAITheme,
768
- onSaveTheme: otherProps?.onSaveTheme,
769
- theme: theme
770
668
  })]
771
669
  })
772
670
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -775,9 +673,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
775
673
  setIsTextSelected: setIsTextSelected,
776
674
  customProps: customProps,
777
675
  editorWrapper: editorWrapper
778
- }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
676
+ }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
779
677
  breakpoint: breakpoint,
780
- show: showViewport,
781
678
  onChange: b => onSwitchBreakpoint(b),
782
679
  translation: translationFn
783
680
  }) : null]
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import { Dialog, DialogTitle, DialogContent, IconButton, Grid } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import ViewportStimulator from "./common/RnD/Theme/ViewportStimulator";
5
- import MainThemeProvider from "./common/RnD/Theme/MainThemeProvider";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
7
  const DialogWrapper = props => {
@@ -10,45 +9,40 @@ const DialogWrapper = props => {
10
9
  fullScreen,
11
10
  onClose,
12
11
  children,
13
- classes,
14
- selectedTheme
12
+ classes
15
13
  } = props;
16
- return fullScreen ? /*#__PURE__*/_jsx(MainThemeProvider, {
17
- userSelectedTheme: selectedTheme,
18
- children: /*#__PURE__*/_jsxs(Dialog, {
19
- className: `dialogComp`,
20
- open: fullScreen,
21
- fullScreen: fullScreen,
22
- onClose: onClose,
14
+ return fullScreen ? /*#__PURE__*/_jsxs(Dialog, {
15
+ className: `dialogComp`,
16
+ open: fullScreen,
17
+ fullScreen: fullScreen,
18
+ onClose: onClose,
19
+ style: {
20
+ zIndex: 1000
21
+ },
22
+ sx: classes.fullScreenWrapper,
23
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
23
24
  style: {
24
- zIndex: 1000
25
+ padding: "6px 8px"
25
26
  },
26
- sx: classes.fullScreenWrapper,
27
- children: [/*#__PURE__*/_jsx(DialogTitle, {
28
- style: {
29
- padding: "6px 8px"
30
- },
27
+ children: /*#__PURE__*/_jsx(Grid, {
31
28
  children: /*#__PURE__*/_jsx(Grid, {
32
- children: /*#__PURE__*/_jsx(Grid, {
29
+ style: {
30
+ display: "flex",
31
+ justifyContent: "end"
32
+ },
33
+ children: /*#__PURE__*/_jsx(IconButton, {
34
+ onClick: onClose,
33
35
  style: {
34
- display: "flex",
35
- justifyContent: "end"
36
+ background: "rgba(255,255,255,0.5)"
36
37
  },
37
- children: /*#__PURE__*/_jsx(IconButton, {
38
- onClick: onClose,
39
- style: {
40
- background: "rgba(255,255,255,0.5)"
41
- },
42
- children: /*#__PURE__*/_jsx(CloseIcon, {})
43
- })
38
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
44
39
  })
45
40
  })
46
- }), /*#__PURE__*/_jsx(DialogContent, {
47
- children: children
48
- })]
49
- })
41
+ })
42
+ }), /*#__PURE__*/_jsx(DialogContent, {
43
+ children: children
44
+ })]
50
45
  }) : /*#__PURE__*/_jsx(ViewportStimulator, {
51
- selectedTheme: selectedTheme,
52
46
  children: children
53
47
  });
54
48
  };
@@ -1132,14 +1132,6 @@ blockquote {
1132
1132
  margin: 0px;
1133
1133
  }
1134
1134
 
1135
- .listItemMargin .accordion-container {
1136
- margin-left: -20px;
1137
- }
1138
-
1139
- .accordion-summary-container li:first-child {
1140
- list-style: none;
1141
- }
1142
-
1143
1135
  .content-editable.empty {
1144
1136
  position: relative;
1145
1137
  }
@@ -1350,16 +1342,16 @@ blockquote {
1350
1342
 
1351
1343
  ::selection {
1352
1344
  color: inherit;
1353
- /* background: rgba(35, 131, 226, 0.35) !important; */
1345
+ background: rgba(35, 131, 226, 0.35) !important;
1354
1346
  }
1355
1347
 
1356
1348
  ::-moz-selection {
1357
- /* background: rgba(35, 131, 226, 0.35) !important; */
1349
+ background: rgba(35, 131, 226, 0.35) !important;
1358
1350
  color: inherit;
1359
1351
  }
1360
1352
 
1361
1353
  ::-webkit-selection {
1362
- /* background: rgba(35, 131, 226, 0.35) !important; */
1354
+ background: rgba(35, 131, 226, 0.35) !important;
1363
1355
  color: inherit;
1364
1356
  }
1365
1357
 
@@ -1376,33 +1368,21 @@ code.markcode {
1376
1368
  background-color: #f3f3f3;
1377
1369
  font-family: 'Source Code Pro' !important;
1378
1370
  }
1379
-
1380
1371
  /* Hide the popper when the reference is hidden */
1381
1372
  .hide-popper-on-overlap[data-popper-escaped],
1382
1373
  .hide-popper-on-overlap[data-popper-reference-hidden] {
1383
1374
  visibility: hidden;
1384
1375
  pointer-events: none;
1385
1376
  }
1386
-
1387
- .theme-buttons {
1388
- display: flex;
1389
- justify-content: end;
1390
- align-items: center;
1391
- margin: auto;
1392
- position: absolute;
1393
- top: 60px;
1394
- right: 20px;
1395
- z-index: 1000;
1396
- }
1397
-
1398
- .themePaintIcon:hover .iconBorder {
1399
- fill: #2563EB;
1400
- }
1401
-
1402
- .themePaintIcon:hover .iconStroke {
1403
- stroke: #2563EB;
1377
+ code.markcode {
1378
+ border-radius: 4px;
1379
+ padding: 6px 8px;
1380
+ margin: 8px 0px;
1381
+ display: block;
1382
+ background-color: #f3f3f3;
1383
+ font-family: 'Source Code Pro' !important;
1404
1384
  }
1405
1385
 
1406
1386
  .hyperLink {
1407
1387
  word-break: break-all;
1408
- }
1388
+ }
@@ -167,7 +167,6 @@ function PopoverAIInput({
167
167
  const [generatedText, setGeneratedText] = useState("");
168
168
  const [inputValue, setInputValue] = useState("");
169
169
  const [selectedOption, setSelectedOption] = useState();
170
- const [threadId, setThreadId] = useState("");
171
170
  const selectedEleRef = useRef({});
172
171
  const classes = Styles();
173
172
  const editor = useSlate();
@@ -189,7 +188,6 @@ function PopoverAIInput({
189
188
  useEffect(() => {
190
189
  if (openAI) {
191
190
  scrollToAIInput(editor);
192
- setThreadId("");
193
191
  }
194
192
  }, [openAI]);
195
193
  useEffect(() => {
@@ -198,12 +196,8 @@ function PopoverAIInput({
198
196
  const framePayload = (type, option) => {
199
197
  let payload = {
200
198
  mode: option.mode || 0,
201
- query: option?.inputValue || inputValue,
202
- useSession: true
199
+ query: option?.inputValue || inputValue
203
200
  };
204
- if (threadId) {
205
- payload.threadId = threadId;
206
- }
207
201
  if (option.mode === MODES.translate || option.mode === MODES.rephraseTone) {
208
202
  payload.textOptionInput = type;
209
203
  }
@@ -263,14 +257,12 @@ function PopoverAIInput({
263
257
  setLoading(false);
264
258
  setInputValue("");
265
259
  let {
266
- body: text,
267
- threadId
268
- } = result?.data || {};
260
+ data: text
261
+ } = result || {};
269
262
  if (!text) {
270
263
  onClickOutside();
271
264
  return;
272
265
  }
273
- setThreadId(threadId || "");
274
266
 
275
267
  // if (!option.replace) {
276
268
  if (type === "continue_writing") {
@@ -145,7 +145,6 @@ const Styles = theme => ({
145
145
  "& .option-label": {
146
146
  display: "flex",
147
147
  alignItems: "center",
148
- whiteSpace: 'nowrap',
149
148
  gap: "8px"
150
149
  },
151
150
  "&:hover": {
@@ -1,5 +1,5 @@
1
- import React, { useState } from "react";
2
- import { Transforms } from "slate";
1
+ import React, { useEffect, useState } from "react";
2
+ import { Editor, Range, Transforms } from "slate";
3
3
  import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
4
  import AccordionBtnPopup from "./AccordionBtnPopup";
5
5
  import { IconButton, Tooltip, Box } from "@mui/material";
@@ -94,30 +94,22 @@ const Accordion = props => {
94
94
  theme
95
95
  } = useEditorContext();
96
96
  const classes = useCommonStyle(theme);
97
-
98
- // useEffect(() => {
99
- // if (!editor.selection || !children[1]) return;
100
-
101
- // try {
102
- // const accordionDetailsElement = element.children?.[1];
103
-
104
- // const detailsPath = ReactEditor.findPath(editor, accordionDetailsElement);
105
-
106
- // const detailsRange = Editor.range(editor, detailsPath);
107
-
108
- // const isInside = Range.intersection(detailsRange, editor.selection);
109
-
110
- // if (isInside && !toggle) {
111
- // setToggle(true);
112
- // }
113
- // } catch (e) {
114
- // console.error(e);
115
- // }
116
- // }, [editor.selection, children]);
117
-
97
+ useEffect(() => {
98
+ if (!editor.selection || !children[1]) return;
99
+ try {
100
+ const accordionDetailsElement = element.children?.[1];
101
+ const detailsPath = ReactEditor.findPath(editor, accordionDetailsElement);
102
+ const detailsRange = Editor.range(editor, detailsPath);
103
+ const isInside = Range.intersection(detailsRange, editor.selection);
104
+ if (isInside && !toggle) {
105
+ setToggle(true);
106
+ }
107
+ } catch (e) {
108
+ console.error(e);
109
+ }
110
+ }, [editor.selection, children]);
118
111
  const onToggle = () => {
119
112
  setToggle(!toggle);
120
- Transforms.deselect(editor);
121
113
  };
122
114
  const ToolBar = () => {
123
115
  return selected && !showTool ? /*#__PURE__*/_jsxs("div", {
@@ -214,6 +206,7 @@ const Accordion = props => {
214
206
  className: "accordion-title"
215
207
  // style={{ background: bgColor, ...borderStyle }}
216
208
  ,
209
+ onClick: onToggle,
217
210
  children: [/*#__PURE__*/_jsx(Box, {
218
211
  role: "button",
219
212
  className: "accordion-summary-collapse-btn",
@@ -228,7 +221,6 @@ const Accordion = props => {
228
221
  },
229
222
  cursor: "pointer"
230
223
  },
231
- onClick: onToggle,
232
224
  children: !toggle ? /*#__PURE__*/_jsx(Icon, {
233
225
  icon: "accordionArrow"
234
226
  }) : /*#__PURE__*/_jsx(Icon, {