@flozy/editor 9.8.4 → 9.8.5

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 (139) hide show
  1. package/dist/Editor/ChatEditor.js +18 -18
  2. package/dist/Editor/CommonEditor.js +18 -118
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +7 -11
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Button/EditorButton.js +25 -37
  8. package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -60
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
  11. package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
  12. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +2 -4
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +6 -21
  14. package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +1 -5
  15. package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +2 -3
  16. package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -11
  17. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +4 -8
  18. package/dist/Editor/Elements/Embed/Image.js +2 -2
  19. package/dist/Editor/Elements/Embed/Video.js +1 -1
  20. package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
  21. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +21 -48
  22. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -25
  23. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -46
  24. package/dist/Editor/Elements/FreeGrid/Options/More.js +2 -7
  25. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  26. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  27. package/dist/Editor/Elements/List/CheckList.js +1 -4
  28. package/dist/Editor/Elements/Search/SearchButton.js +1 -1
  29. package/dist/Editor/Elements/Search/SearchList.js +2 -3
  30. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +8 -2
  31. package/dist/Editor/Elements/SimpleText/index.js +1 -9
  32. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  33. package/dist/Editor/Elements/Table/Table.js +3 -3
  34. package/dist/Editor/Elements/Title/title.js +8 -9
  35. package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
  36. package/dist/Editor/MiniEditor.js +1 -2
  37. package/dist/Editor/Styles/EditorStyles.js +5 -5
  38. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  39. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  40. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  41. package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -4
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  44. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
  45. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -7
  46. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
  47. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +11 -71
  48. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +23 -95
  49. package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
  50. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  51. package/dist/Editor/common/ColorPickerButton.js +14 -39
  52. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  53. package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
  54. package/dist/Editor/common/Icon.js +1 -31
  55. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  56. package/dist/Editor/common/MUIIcon/index.js +3 -0
  57. package/dist/Editor/common/RnD/ContextMenu/CMenus.js +0 -24
  58. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  66. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -3
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  68. package/dist/Editor/common/RnD/ShadowElement.js +1 -2
  69. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -8
  70. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  71. package/dist/Editor/common/RnD/Utils/gridDropItem.js +9 -73
  72. package/dist/Editor/common/RnD/Utils/index.js +0 -3
  73. package/dist/Editor/common/RnD/VirtualElement/index.js +103 -187
  74. package/dist/Editor/common/RnD/VirtualElement/styles.js +7 -155
  75. package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +3 -5
  76. package/dist/Editor/common/RnD/index.js +10 -59
  77. package/dist/Editor/common/Shorthands/elements.js +0 -54
  78. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  81. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  82. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
  83. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -35
  84. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -16
  85. package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +6 -7
  86. package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +3 -3
  87. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  88. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
  89. package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
  90. package/dist/Editor/common/Uploader.js +0 -8
  91. package/dist/Editor/commonStyle.js +57 -68
  92. package/dist/Editor/helper/theme.js +2 -202
  93. package/dist/Editor/hooks/useMouseMove.js +3 -9
  94. package/dist/Editor/plugins/withEmbeds.js +1 -1
  95. package/dist/Editor/plugins/withHTML.js +9 -11
  96. package/dist/Editor/plugins/withTable.js +1 -1
  97. package/dist/Editor/theme/ThemeList.js +173 -50
  98. package/dist/Editor/utils/SlateUtilityFunctions.js +45 -171
  99. package/dist/Editor/utils/draftToSlate.js +2 -3
  100. package/dist/Editor/utils/font.js +37 -40
  101. package/dist/Editor/utils/freegrid.js +2 -2
  102. package/dist/Editor/utils/helper.js +19 -90
  103. package/package.json +4 -4
  104. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -448
  105. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -436
  106. package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
  107. package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
  108. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  109. package/dist/Editor/common/CustomColorPicker/index.js +0 -131
  110. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  111. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  112. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  113. package/dist/Editor/common/CustomSelect.js +0 -43
  114. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  115. package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +0 -43
  116. package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +0 -44
  117. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +0 -134
  118. package/dist/Editor/common/RnD/VirtualElement/helper.js +0 -382
  119. package/dist/Editor/common/SnackBar/index.js +0 -43
  120. package/dist/Editor/helper/textIndeces.js +0 -58
  121. package/dist/Editor/hooks/useAutoScroll.js +0 -38
  122. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  123. package/dist/Editor/hooks/useThemeValues.js +0 -63
  124. package/dist/Editor/theme/index.js +0 -149
  125. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  126. package/dist/Editor/themeSettings/buttons/index.js +0 -290
  127. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  128. package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
  129. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  130. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  131. package/dist/Editor/themeSettings/fonts/index.js +0 -240
  132. package/dist/Editor/themeSettings/fonts/style.js +0 -61
  133. package/dist/Editor/themeSettings/icons.js +0 -60
  134. package/dist/Editor/themeSettings/index.js +0 -351
  135. package/dist/Editor/themeSettings/style.js +0 -220
  136. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  137. package/dist/Editor/themeSettingsAI/index.js +0 -355
  138. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -205
  139. package/dist/Editor/themeSettingsAI/style.js +0 -259
@@ -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
@@ -171,7 +179,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
171
179
  const chars = type ? Shorthands[type]({
172
180
  ...mentions,
173
181
  CHARACTERS,
174
- hideTools: hideTools
182
+ hideTools: hideTools,
183
+ translation: translation || translationMock
175
184
  }) : [];
176
185
  const Leaf = ({
177
186
  attributes,
@@ -213,15 +222,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
213
222
  debounced(newValue);
214
223
  debouncedValue.current = newValue;
215
224
  };
216
- const dummyTranslation = () => {};
217
- const customProps = {
218
- ...(otherProps || {}),
219
- hideTools: ["settings", "add_column", "drag", "resize"],
220
- readOnly: isReadOnly,
221
- editorPlaceholder: "Write Something",
222
- page_id: 1,
223
- translation: translation || translationMock || dummyTranslation
224
- };
225
225
  const Element = props => {
226
226
  return getBlock(props);
227
227
  };
@@ -257,7 +257,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
257
257
  editor
258
258
  });
259
259
  } else if (event.key === "Enter" && !isMobile) {
260
- 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 === '';
261
261
  if (isEmpty) {
262
262
  event.preventDefault();
263
263
  return;
@@ -297,10 +297,10 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
297
297
  }
298
298
  };
299
299
 
300
- const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
301
300
  const handleFocus = () => {
302
301
  setIsFocused(true);
303
302
  };
303
+ const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
304
304
  return !isMarkDown ? /*#__PURE__*/_jsx(EditorProvider, {
305
305
  theme: theme,
306
306
  editor: editor,
@@ -314,13 +314,13 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
314
314
  closeMainPopup: handleClose,
315
315
  customProps: customProps
316
316
  }), /*#__PURE__*/_jsx(Editable, {
317
+ onFocus: handleFocus,
317
318
  className: "chatEditorRoot",
318
319
  renderElement: renderElement,
319
320
  renderLeaf: renderLeaf,
320
321
  decorate: decorators,
321
322
  placeholder: "Start typing ...",
322
323
  spellCheck: true,
323
- onFocus: handleFocus,
324
324
  onBlur: handleBlur,
325
325
  onKeyDown: onKeyDown,
326
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, 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);
@@ -138,7 +129,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
138
129
  hideTools = [],
139
130
  translationMock
140
131
  } = otherProps || {};
141
- const translationFn = translation || translationMock || dummyTranslation;
132
+ const translationFn = translation || translationMock;
142
133
  const editor = useMemo(() => {
143
134
  if (collaborativeEditor) return collaborativeEditor;
144
135
  const editor = createEditor();
@@ -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({
@@ -194,11 +177,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
194
177
  const debounced = useDebouncedCallback(
195
178
  // function
196
179
  value => {
197
- debouncedValue.current = value;
198
180
  const {
199
181
  value: strVal,
200
182
  ...restVal
201
183
  } = getOnSaveData(value);
184
+ debouncedValue.current = value;
202
185
  onSave(strVal, restVal);
203
186
  },
204
187
  // delay in ms
@@ -209,7 +192,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
209
192
  return {
210
193
  value: JSON.stringify(val),
211
194
  text: text,
212
- title: serializeToText(title?.children) || ""
195
+ title: serializeToText(title?.children) || "Untitled"
213
196
  };
214
197
  };
215
198
  const getTitleSaveData = title => {
@@ -241,9 +224,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
241
224
 
242
225
  const onSwitchBreakpoint = b => {
243
226
  setBreakpoint(b);
244
- setTimeout(() => {
245
- reRenderAllNodes();
246
- }, 0);
227
+ reRenderAllNodes();
247
228
  };
248
229
  useImperativeHandle(ref, () => ({
249
230
  async getThumbnail(needBackground = false, options = {}) {
@@ -298,6 +279,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
298
279
  },
299
280
  toggleFullscreen() {
300
281
  setFullScreen(!fullScreen);
282
+ Transforms.deselect(editor);
301
283
  },
302
284
  toggleToolbarShow() {
303
285
  setToolbarShow(!toolbarShow);
@@ -321,12 +303,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
321
303
  redo() {
322
304
  editor?.redo();
323
305
  },
324
- toggleTheme() {
325
- setOpenTheme(!openTheme);
326
- },
327
- toggleAITheme() {
328
- setOpenAITheme(!openAITheme);
329
- },
330
306
  getPageSettings: {
331
307
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
332
308
  }
@@ -369,7 +345,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
369
345
  const onDrawerOpen = status => {
370
346
  setIsDrawerOpen(status);
371
347
  };
372
- const lineH = getBreakpointLineSpacing(lineHeight, breakpoint || (isMobile ? "xs" : ""));
373
348
  const isReadOnly = readOnly === "readonly";
374
349
  const customProps = {
375
350
  ...(otherProps || {}),
@@ -382,9 +357,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
382
357
  onDrawerOpen: onDrawerOpen,
383
358
  ICON_API: "https://assets.agenciflow.com",
384
359
  translation: translationFn,
385
- getTitleSaveData,
386
- customLineHeight: lineH
360
+ getTitleSaveData
387
361
  };
362
+ const lineH = getBreakpointLineSpacing(lineHeight, breakpoint);
388
363
  const renderElement = useCallback(props => {
389
364
  return /*#__PURE__*/_jsx(Element, {
390
365
  ...props,
@@ -527,7 +502,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
527
502
  }
528
503
  return style;
529
504
  }, [pageBgImage, pageColor, pageTextColor]);
530
- const themeProps = getTheme(selectedTheme);
531
505
 
532
506
  // const handleContextMenu = (e) => {
533
507
  // if (!readOnly) {
@@ -558,74 +532,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
558
532
  console.log("handleCursorScroll", err);
559
533
  }
560
534
  };
561
- window.getTextIndeces = () => {
562
- try {
563
- const textWithPaths = extractTextWithPath(editor.children, []);
564
- return textWithPaths;
565
- } catch (err) {
566
- console.log(err);
567
- }
568
- };
569
- window.replaceTextIndeces = (path_data = []) => {
570
- try {
571
- const replacedJson = replaceTextPath(JSON.parse(JSON.stringify(editor.children)), path_data);
572
-
573
- // loop delete all
574
- editor.children.forEach(() => {
575
- Transforms.delete(editor, {
576
- at: [0]
577
- });
578
- });
579
-
580
- // Insert new nodes
581
- Transforms.insertNodes(editor, replacedJson, {
582
- at: [0]
583
- });
584
- } catch (err) {
585
- console.log(err);
586
- }
587
- };
588
- window.replaceEditorContent = (fragments = []) => {
589
- try {
590
- // loop delete all
591
- editor.children.forEach(() => {
592
- Transforms.delete(editor, {
593
- at: [0]
594
- });
595
- });
596
-
597
- // Insert new nodes
598
- Transforms.insertNodes(editor, fragments, {
599
- at: [0]
600
- });
601
- } catch (err) {
602
- console.log(err);
603
- }
604
- };
605
535
  return /*#__PURE__*/_jsxs(EditorProvider, {
606
536
  theme: theme,
607
537
  editor: editor,
608
- openTheme: openTheme,
609
- setOpenTheme: setOpenTheme,
610
- triggerRender: triggerRender,
611
- children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
612
- className: "theme-buttons",
613
- children: [/*#__PURE__*/_jsx(IconButton, {
614
- onClick: () => setOpenTheme(true),
615
- children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
616
- }), /*#__PURE__*/_jsx(IconButton, {
617
- onClick: () => setOpenAITheme(true),
618
- style: {
619
- marginTop: "4px"
620
- },
621
- children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
622
- })]
623
- }) : null, /*#__PURE__*/_jsx(DialogWrapper, {
538
+ children: [/*#__PURE__*/_jsx(DialogWrapper, {
624
539
  classes: classes,
625
540
  ...props,
626
541
  fullScreen: fullScreen,
627
542
  footer: footer || "",
628
- selectedTheme: selectedTheme,
629
543
  children: /*#__PURE__*/_jsxs(Box, {
630
544
  component: "div",
631
545
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -660,7 +574,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
660
574
  children: /*#__PURE__*/_jsxs(Box, {
661
575
  component: "div",
662
576
  className: "max-content",
663
- sx: themeProps?.sxProps || {},
664
577
  "data-info": outsideEditorClickLabel,
665
578
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
666
579
  className: "scroll-area",
@@ -705,8 +618,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
705
618
  chars: chars,
706
619
  type: type,
707
620
  theme: theme,
708
- customProps: customProps,
709
- otherProps: customProps
621
+ otherProps: customProps,
622
+ customProps: customProps
710
623
  }) : null, /*#__PURE__*/_jsx(RnDCopy, {
711
624
  readOnly: readOnly
712
625
  })]
@@ -729,18 +642,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
729
642
  "data-info": outsideEditorClickLabel,
730
643
  onClick: handleFooterClick,
731
644
  children: footer
732
- }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
733
- open: openTheme,
734
- setOpen: setOpenTheme,
735
- editor: editor,
736
- services: otherProps?.services,
737
- appTheme: theme,
738
- customProps: customProps
739
- }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
740
- openAITheme: openAITheme,
741
- setOpenAITheme: setOpenAITheme,
742
- onSaveTheme: otherProps?.onSaveTheme,
743
- theme: theme
744
645
  })]
745
646
  })
746
647
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -749,9 +650,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
749
650
  setIsTextSelected: setIsTextSelected,
750
651
  customProps: customProps,
751
652
  editorWrapper: editorWrapper
752
- }) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
653
+ }) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
753
654
  breakpoint: breakpoint,
754
- show: showViewport,
755
655
  onChange: b => onSwitchBreakpoint(b),
756
656
  translation: translation || translationMock
757
657
  }) : 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
  };
@@ -1342,23 +1342,19 @@ code.markcode {
1342
1342
  background-color: #f3f3f3;
1343
1343
  font-family: 'Source Code Pro' !important;
1344
1344
  }
1345
-
1346
1345
  /* Hide the popper when the reference is hidden */
1347
1346
  .hide-popper-on-overlap[data-popper-escaped],
1348
1347
  .hide-popper-on-overlap[data-popper-reference-hidden] {
1349
1348
  visibility: hidden;
1350
1349
  pointer-events: none;
1351
1350
  }
1352
-
1353
- .theme-buttons {
1354
- display: flex;
1355
- justify-content: end;
1356
- align-items: center;
1357
- margin: auto;
1358
- position: absolute;
1359
- top: 60px;
1360
- right: 20px;
1361
- z-index: 1000;
1351
+ code.markcode {
1352
+ border-radius: 4px;
1353
+ padding: 6px 8px;
1354
+ margin: 8px 0px;
1355
+ display: block;
1356
+ background-color: #f3f3f3;
1357
+ font-family: 'Source Code Pro' !important;
1362
1358
  }
1363
1359
 
1364
1360
  .hyperLink {
@@ -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") {
@@ -265,7 +265,7 @@ function AppHeader(props) {
265
265
  style: {
266
266
  display: "inline-flex",
267
267
  alignItems: "center",
268
- color: textColor || "#000000",
268
+ color: textColor,
269
269
  fontSize: logoFontSize,
270
270
  fontFamily: titleFontFamily,
271
271
  justifyContent: isLogoRight ? "end" : "start"
@@ -320,7 +320,7 @@ function AppHeader(props) {
320
320
  fontFamily: fontFamily,
321
321
  textTransform: "none",
322
322
  fontSize: fontSize || "16px",
323
- color: textColor || "#000",
323
+ color: textColor || "#FFF",
324
324
  background: bgColor || "none",
325
325
  "& .m-settings": {
326
326
  display: "none",
@@ -335,7 +335,7 @@ function AppHeader(props) {
335
335
  background: "#FFF"
336
336
  },
337
337
  "&:hover": {
338
- color: textColorHover || textColor || "#000",
338
+ color: textColorHover || textColor || "#FFF",
339
339
  background: bgColorHover || bgColor || "none",
340
340
  "& .m-settings": {
341
341
  display: "block"