@flozy/editor 11.2.3 → 11.2.4

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 (145) hide show
  1. package/dist/Editor/ChatEditor.js +7 -7
  2. package/dist/Editor/CommonEditor.js +86 -24
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +37 -4
  5. package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
  6. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  7. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
  8. package/dist/Editor/Elements/Attachments/Attachments.js +239 -11
  9. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +11 -4
  10. package/dist/Editor/Elements/Button/EditorButton.js +32 -44
  11. package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
  12. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  13. package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
  14. package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
  15. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
  16. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
  17. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
  18. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  19. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  20. package/dist/Editor/Elements/Embed/Embed.js +37 -43
  21. package/dist/Editor/Elements/Embed/Image.js +307 -26
  22. package/dist/Editor/Elements/Embed/Video.js +355 -35
  23. package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +9 -6
  24. package/dist/Editor/Elements/EmbedScript/styles.js +17 -1
  25. package/dist/Editor/Elements/Form/FormField.js +1 -1
  26. package/dist/Editor/Elements/Form/Workflow/Styles.js +25 -22
  27. package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
  28. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +37 -76
  29. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +9 -5
  30. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -1
  31. package/dist/Editor/Elements/FreeGrid/helper.js +194 -0
  32. package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
  33. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  34. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
  35. package/dist/Editor/Elements/Table/Table.js +2 -1
  36. package/dist/Editor/Elements/Table/TableCell.js +10 -3
  37. package/dist/Editor/Elements/Title/title.js +4 -5
  38. package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
  39. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
  40. package/dist/Editor/Styles/EditorStyles.js +19 -5
  41. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  42. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  43. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  44. package/dist/Editor/Toolbar/FormatTools/TextSize.js +33 -29
  45. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
  46. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +3 -1
  47. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
  48. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
  49. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +15 -5
  50. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
  51. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +65 -7
  52. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +66 -12
  53. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
  54. package/dist/Editor/Toolbar/PopupTool/index.js +6 -4
  55. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  56. package/dist/Editor/assets/svg/BackIcon.js +18 -0
  57. package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
  58. package/dist/Editor/common/ColorPickerButton.js +38 -19
  59. package/dist/Editor/common/CustomColorPicker/index.js +130 -0
  60. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  61. package/dist/Editor/common/CustomDialog2/index.js +94 -0
  62. package/dist/Editor/common/CustomDialog2/style.js +67 -0
  63. package/dist/Editor/common/CustomSelect.js +43 -0
  64. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  65. package/dist/Editor/common/FontLoader/FontLoader.js +1 -0
  66. package/dist/Editor/common/Icon.js +28 -0
  67. package/dist/Editor/common/ImageSelector/ImageSelector.js +66 -13
  68. package/dist/Editor/common/ImageSelector/Options/ChooseAssets.js +1 -1
  69. package/dist/Editor/common/ImageSelector/Options/RecentUploads.js +483 -0
  70. package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
  71. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  72. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  73. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  74. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  75. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  76. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  77. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
  78. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +20 -7
  79. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  80. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +2 -0
  81. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
  82. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  83. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  84. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  85. package/dist/Editor/common/RnD/Utils/gridDropItem.js +28 -11
  86. package/dist/Editor/common/RnD/Utils/index.js +3 -1
  87. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +52 -63
  88. package/dist/Editor/common/RnD/VirtualElement/helper.js +248 -68
  89. package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
  90. package/dist/Editor/common/RnD/index.js +61 -14
  91. package/dist/Editor/common/Shorthands/elements.js +55 -3
  92. package/dist/Editor/common/StyleBuilder/buttonStyle.js +5 -15
  93. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
  94. package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
  95. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +13 -3
  96. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  97. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  98. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
  99. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  100. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
  101. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +16 -4
  102. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  103. package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
  104. package/dist/Editor/common/StyleBuilder/index.js +10 -19
  105. package/dist/Editor/common/Uploader.js +118 -17
  106. package/dist/Editor/common/UploaderWithProgress.js +183 -0
  107. package/dist/Editor/common/iconslist.js +21 -0
  108. package/dist/Editor/commonStyle.js +111 -53
  109. package/dist/Editor/helper/index.js +4 -1
  110. package/dist/Editor/helper/theme.js +203 -2
  111. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  112. package/dist/Editor/hooks/useMouseMove.js +12 -3
  113. package/dist/Editor/hooks/useTable.js +62 -1
  114. package/dist/Editor/hooks/useThemeValues.js +63 -0
  115. package/dist/Editor/plugins/withEmbeds.js +1 -1
  116. package/dist/Editor/plugins/withHTML.js +56 -3
  117. package/dist/Editor/plugins/withTable.js +1 -1
  118. package/dist/Editor/service/fileTracking.js +22 -0
  119. package/dist/Editor/service/fileupload.js +77 -0
  120. package/dist/Editor/theme/ThemeList.js +50 -173
  121. package/dist/Editor/theme/index.js +149 -0
  122. package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
  123. package/dist/Editor/themeSettings/buttons/index.js +300 -0
  124. package/dist/Editor/themeSettings/buttons/style.js +23 -0
  125. package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
  126. package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
  127. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  128. package/dist/Editor/themeSettings/fonts/index.js +240 -0
  129. package/dist/Editor/themeSettings/fonts/style.js +62 -0
  130. package/dist/Editor/themeSettings/icons.js +60 -0
  131. package/dist/Editor/themeSettings/index.js +380 -0
  132. package/dist/Editor/themeSettings/style.js +299 -0
  133. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  134. package/dist/Editor/themeSettingsAI/index.js +355 -0
  135. package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
  136. package/dist/Editor/themeSettingsAI/style.js +332 -0
  137. package/dist/Editor/utils/SlateUtilityFunctions.js +165 -40
  138. package/dist/Editor/utils/accordion.js +1 -1
  139. package/dist/Editor/utils/attachments.js +138 -2
  140. package/dist/Editor/utils/button.js +1 -17
  141. package/dist/Editor/utils/font.js +40 -37
  142. package/dist/Editor/utils/formfield.js +2 -2
  143. package/dist/Editor/utils/helper.js +101 -3
  144. package/dist/Editor/utils/insertAppHeader.js +8 -4
  145. package/package.json +1 -1
@@ -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
  });
@@ -173,7 +173,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
173
173
  let {
174
174
  type
175
175
  } = mentions;
176
- if (type && type === "elements" && hideTools?.indexOf("slash") > -1) {
176
+ if (type && type === "elements" && hideTools.indexOf("slash") > -1) {
177
177
  type = null;
178
178
  }
179
179
  const chars = type ? Shorthands[type]({
@@ -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;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-unused-vars */
2
- import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
2
+ import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle, createContext } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { createEditor, Range, Transforms } from "slate";
5
5
  import { Slate, Editable, ReactEditor } from "slate-react";
@@ -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 } from "@mui/material";
20
+ import { Box, Typography, useTheme, IconButton } 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,9 +26,12 @@ import editorStyles from "./Styles/EditorStyles";
26
26
  import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
- import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
30
- import { getInitialValue, handleCopy, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
29
+ import { getTRBLBreakPoints, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
30
+ import { getInitialValue, handleCopy, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel, GetPageBgImage } 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";
32
35
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
33
36
  import RnDCopy from "./common/RnD/RnDCopy";
34
37
  import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
@@ -37,9 +40,11 @@ import "./font.css";
37
40
  import "./Editor.css";
38
41
  import "animate.css";
39
42
  import FontLoader from "./common/FontLoader/FontLoader";
43
+ import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
40
44
  import { CustomDialogComponent } from "./common/CustomDialog";
41
45
  import { jsx as _jsx } from "react/jsx-runtime";
42
46
  import { jsxs as _jsxs } from "react/jsx-runtime";
47
+ export const ThemeContext = /*#__PURE__*/createContext(null);
43
48
  const Item = /*#__PURE__*/forwardRef(({
44
49
  children,
45
50
  ...props
@@ -94,6 +99,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
94
99
  otherProps,
95
100
  isIframe,
96
101
  theme,
102
+ showThemeButtons,
97
103
  showViewport = false,
98
104
  overrideWrapperStyles = {},
99
105
  translation
@@ -127,14 +133,29 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
127
133
  fixedWidth = "60%",
128
134
  fullWidth = "80%",
129
135
  hideTools = [],
130
- translationMock
136
+ translationMock,
137
+ uploadFile,
138
+ resumeUploadState,
139
+ uploadTerminator,
140
+ isUploadInProgress = () => {}
131
141
  } = otherProps || {};
132
142
  const translationFn = translation || translationMock || (() => {});
143
+ const getTitleSaveData = title => {
144
+ const val = debouncedValue.current;
145
+ const data = {
146
+ text: serializeToText(val),
147
+ title: title
148
+ };
149
+ if (customProps.onSaveTitle) {
150
+ const isTitleChanged = true;
151
+ customProps.onSaveTitle(JSON.stringify(val), data, isTitleChanged);
152
+ }
153
+ };
133
154
  const editor = useMemo(() => {
134
155
  if (collaborativeEditor) return collaborativeEditor;
135
156
  const editor = createEditor();
136
157
  editor.needLayout = needLayout;
137
- editor.translation = translationFn;
158
+ editor.getTitleSaveData = getTitleSaveData;
138
159
  return withCommon(editor, {
139
160
  needLayout
140
161
  });
@@ -145,10 +166,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
145
166
  const {
146
167
  bannerSpacing,
147
168
  pageBgImage,
148
- pageColor,
169
+ pageColor = "",
149
170
  color: pageTextColor,
150
171
  pageWidth,
151
172
  maxWidth: pageMaxWidth,
173
+ theme: selectedTheme,
152
174
  lineHeight
153
175
  } = pageSt?.pageProps || {
154
176
  bannerSpacing: {
@@ -160,10 +182,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
160
182
  };
161
183
  const classes = editorStyles({
162
184
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
163
- placeHolderColor: invertColor(pageColor || "#FFF"),
185
+ placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
164
186
  theme,
165
187
  overrideWrapperStyles
166
188
  });
189
+ const [openTheme, setOpenTheme] = useState(false);
190
+ const [openAITheme, setOpenAITheme] = useState(false);
191
+ const [, setThemeUpdated] = useState(0);
192
+ const triggerRender = () => {
193
+ setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
194
+ };
195
+
167
196
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
168
197
  useEffect(() => {
169
198
  setValue(draftToSlate({
@@ -206,17 +235,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
206
235
  title: serializeToText(title?.children) || "Untitled"
207
236
  };
208
237
  };
209
- const getTitleSaveData = title => {
210
- const val = debouncedValue.current;
211
- const data = {
212
- text: serializeToText(val),
213
- title: title
214
- };
215
- if (customProps.onSaveTitle) {
216
- const isTitleChanged = true;
217
- customProps.onSaveTitle(JSON.stringify(val), data, isTitleChanged);
218
- }
219
- };
220
238
  const getPreviewImage = async (needBackground = false, options = {}) => {
221
239
  ReactEditor.blur(editor);
222
240
  const dom = needBackground ? editorWrapper?.current : editorWrapper?.current.getElementsByClassName("innert-editor-textbox")[0];
@@ -316,6 +334,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
316
334
  redo() {
317
335
  editor?.redo();
318
336
  },
337
+ toggleTheme() {
338
+ setOpenTheme(!openTheme);
339
+ },
340
+ toggleAITheme() {
341
+ setOpenAITheme(!openAITheme);
342
+ },
319
343
  getPageSettings: {
320
344
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
321
345
  }
@@ -370,7 +394,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
370
394
  ICON_API: "https://assets.agenciflow.com",
371
395
  translation: translationFn,
372
396
  getTitleSaveData,
373
- customLineHeight: lineH
397
+ customLineHeight: lineH,
398
+ uploadFile,
399
+ resumeUploadState,
400
+ uploadTerminator,
401
+ isUploadInProgress
374
402
  };
375
403
  const renderElement = useCallback(props => {
376
404
  return /*#__PURE__*/_jsx(Element, {
@@ -510,8 +538,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
510
538
  };
511
539
  const editorWrapperStyle = useMemo(() => {
512
540
  const style = {};
513
- if (pageBgImage && pageBgImage !== "none") {
514
- style.backgroundImage = `url(${pageBgImage})`;
541
+ const bgImageUrl = GetPageBgImage(pageBgImage);
542
+ if (bgImageUrl) {
543
+ style.backgroundImage = `url(${bgImageUrl})`;
515
544
  style.backgroundSize = `cover`;
516
545
  style.backgroundRepeat = "repeat";
517
546
  } else {
@@ -519,6 +548,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
519
548
  }
520
549
  return style;
521
550
  }, [pageBgImage, pageColor, pageTextColor]);
551
+ const themeProps = getTheme(selectedTheme);
522
552
 
523
553
  // const handleContextMenu = (e) => {
524
554
  // if (!readOnly) {
@@ -552,7 +582,23 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
552
582
  return /*#__PURE__*/_jsxs(EditorProvider, {
553
583
  theme: theme,
554
584
  editor: editor,
555
- children: [/*#__PURE__*/_jsx(FontLoader, {
585
+ openTheme: openTheme,
586
+ setOpenTheme: setOpenTheme,
587
+ triggerRender: triggerRender,
588
+ children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
589
+ className: "theme-buttons",
590
+ children: [/*#__PURE__*/_jsx(IconButton, {
591
+ onClick: () => setOpenTheme(true),
592
+ className: "themePaintIcon",
593
+ children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
594
+ }), /*#__PURE__*/_jsx(IconButton, {
595
+ onClick: () => setOpenAITheme(true),
596
+ style: {
597
+ marginTop: "4px"
598
+ },
599
+ children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
600
+ })]
601
+ }) : null, /*#__PURE__*/_jsx(FontLoader, {
556
602
  otherProps: {
557
603
  services: otherProps?.services
558
604
  },
@@ -562,6 +608,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
562
608
  ...props,
563
609
  fullScreen: fullScreen,
564
610
  footer: footer || "",
611
+ selectedTheme: selectedTheme,
565
612
  children: /*#__PURE__*/_jsx(Box, {
566
613
  component: "div",
567
614
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -589,13 +636,16 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
589
636
  id: "slate-wrapper-scroll-container",
590
637
  ref: editorWrapper,
591
638
  onClick: e => {
592
- handleInsertLastElement(e, editor);
639
+ if (!isReadOnly) {
640
+ handleInsertLastElement(e, editor);
641
+ }
593
642
  },
594
643
  onScroll: handleScroll,
595
644
  style: editorWrapperStyle,
596
645
  children: /*#__PURE__*/_jsxs(Box, {
597
646
  component: "div",
598
647
  className: "max-content",
648
+ sx: themeProps?.sxProps || {},
599
649
  "data-info": outsideEditorClickLabel,
600
650
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
601
651
  className: "scroll-area",
@@ -665,6 +715,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
665
715
  "data-info": outsideEditorClickLabel,
666
716
  onClick: handleFooterClick,
667
717
  children: footer
718
+ }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
719
+ open: openTheme,
720
+ setOpen: setOpenTheme,
721
+ editor: editor,
722
+ services: otherProps?.services,
723
+ appTheme: theme,
724
+ customProps: customProps
725
+ }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
726
+ openAITheme: openAITheme,
727
+ setOpenAITheme: setOpenAITheme,
728
+ onSaveTheme: otherProps?.onSaveTheme,
729
+ theme: theme
668
730
  })]
669
731
  })
670
732
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -2,6 +2,7 @@ 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";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  const DialogWrapper = props => {
@@ -9,40 +10,45 @@ const DialogWrapper = props => {
9
10
  fullScreen,
10
11
  onClose,
11
12
  children,
12
- classes
13
+ classes,
14
+ selectedTheme
13
15
  } = props;
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, {
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,
24
23
  style: {
25
- padding: "6px 8px"
24
+ zIndex: 1000
26
25
  },
27
- children: /*#__PURE__*/_jsx(Grid, {
26
+ sx: classes.fullScreenWrapper,
27
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
28
+ style: {
29
+ padding: "6px 8px"
30
+ },
28
31
  children: /*#__PURE__*/_jsx(Grid, {
29
- style: {
30
- display: "flex",
31
- justifyContent: "end"
32
- },
33
- children: /*#__PURE__*/_jsx(IconButton, {
34
- onClick: onClose,
32
+ children: /*#__PURE__*/_jsx(Grid, {
35
33
  style: {
36
- background: "rgba(255,255,255,0.5)"
34
+ display: "flex",
35
+ justifyContent: "end"
37
36
  },
38
- children: /*#__PURE__*/_jsx(CloseIcon, {})
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
+ })
39
44
  })
40
45
  })
41
- })
42
- }), /*#__PURE__*/_jsx(DialogContent, {
43
- children: children
44
- })]
46
+ }), /*#__PURE__*/_jsx(DialogContent, {
47
+ children: children
48
+ })]
49
+ })
45
50
  }) : /*#__PURE__*/_jsx(ViewportStimulator, {
51
+ selectedTheme: selectedTheme,
46
52
  children: children
47
53
  });
48
54
  };
@@ -1342,16 +1342,16 @@ blockquote {
1342
1342
 
1343
1343
  ::selection {
1344
1344
  color: inherit;
1345
- background: rgba(35, 131, 226, 0.35) !important;
1345
+ /* background: rgba(35, 131, 226, 0.35) !important; */
1346
1346
  }
1347
1347
 
1348
1348
  ::-moz-selection {
1349
- background: rgba(35, 131, 226, 0.35) !important;
1349
+ /* background: rgba(35, 131, 226, 0.35) !important; */
1350
1350
  color: inherit;
1351
1351
  }
1352
1352
 
1353
1353
  ::-webkit-selection {
1354
- background: rgba(35, 131, 226, 0.35) !important;
1354
+ /* background: rgba(35, 131, 226, 0.35) !important; */
1355
1355
  color: inherit;
1356
1356
  }
1357
1357
 
@@ -1383,6 +1383,39 @@ code.markcode {
1383
1383
  font-family: 'Source Code Pro' !important;
1384
1384
  }
1385
1385
 
1386
+ .theme-buttons {
1387
+ display: flex;
1388
+ justify-content: end;
1389
+ align-items: center;
1390
+ margin: auto;
1391
+ position: absolute;
1392
+ top: 60px;
1393
+ right: 20px;
1394
+ z-index: 1000;
1395
+ }
1396
+
1397
+ .themePaintIcon:hover .iconBorder {
1398
+ fill: #2563EB;
1399
+ }
1400
+
1401
+ .themePaintIcon:hover .iconStroke {
1402
+ stroke: #2563EB;
1403
+ }
1404
+
1386
1405
  .hyperLink {
1387
1406
  word-break: break-all;
1388
- }
1407
+ }
1408
+
1409
+ .truncateText {
1410
+ display: inline-block;
1411
+ width: 100%;
1412
+ white-space: nowrap;
1413
+ overflow: hidden;
1414
+ text-overflow: ellipsis;
1415
+ }
1416
+
1417
+ @media only screen and (max-width: 600px) {
1418
+ .truncateText {
1419
+ width: 180px;
1420
+ }
1421
+ }
@@ -167,6 +167,7 @@ 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("");
170
171
  const selectedEleRef = useRef({});
171
172
  const classes = Styles();
172
173
  const editor = useSlate();
@@ -188,6 +189,7 @@ function PopoverAIInput({
188
189
  useEffect(() => {
189
190
  if (openAI) {
190
191
  scrollToAIInput(editor);
192
+ setThreadId("");
191
193
  }
192
194
  }, [openAI]);
193
195
  useEffect(() => {
@@ -196,8 +198,12 @@ function PopoverAIInput({
196
198
  const framePayload = (type, option) => {
197
199
  let payload = {
198
200
  mode: option.mode || 0,
199
- query: option?.inputValue || inputValue
201
+ query: option?.inputValue || inputValue,
202
+ useSession: true
200
203
  };
204
+ if (threadId) {
205
+ payload.threadId = threadId;
206
+ }
201
207
  if (option.mode === MODES.translate || option.mode === MODES.rephraseTone) {
202
208
  payload.textOptionInput = type;
203
209
  }
@@ -257,12 +263,14 @@ function PopoverAIInput({
257
263
  setLoading(false);
258
264
  setInputValue("");
259
265
  let {
260
- data: text
261
- } = result || {};
266
+ body: text,
267
+ threadId
268
+ } = result?.data || {};
262
269
  if (!text) {
263
270
  onClickOutside();
264
271
  return;
265
272
  }
273
+ setThreadId(threadId || "");
266
274
 
267
275
  // if (!option.replace) {
268
276
  if (type === "continue_writing") {
@@ -268,7 +268,7 @@ function AppHeader(props) {
268
268
  style: {
269
269
  display: "inline-flex",
270
270
  alignItems: "center",
271
- color: textColor,
271
+ color: textColor || "#000000",
272
272
  fontSize: logoFontSize,
273
273
  fontFamily: titleFontFamily,
274
274
  justifyContent: isLogoRight ? "end" : "start"
@@ -323,7 +323,7 @@ function AppHeader(props) {
323
323
  fontFamily: fontFamily,
324
324
  textTransform: "none",
325
325
  fontSize: fontSize || "16px",
326
- color: textColor || "#FFF",
326
+ color: textColor || "#000",
327
327
  background: bgColor || "none",
328
328
  border: borderColorHover ? `1px solid transparent` : "none",
329
329
  "& .m-settings": {
@@ -339,7 +339,7 @@ function AppHeader(props) {
339
339
  background: "#FFF"
340
340
  },
341
341
  "&:hover": {
342
- color: textColorHover || textColor || "#FFF",
342
+ color: textColorHover || textColor || "#000",
343
343
  background: bgColorHover || bgColor || "none",
344
344
  border: borderColorHover ? `1px solid ${borderColorHover}` : "none",
345
345
  "& .m-settings": {
@@ -0,0 +1,16 @@
1
+ const useAttachmentStyle = theme => ({
2
+ attachmentRoot: {
3
+ "& .uploadinDetails": {
4
+ display: "flex",
5
+ gap: "10px",
6
+ "& .MuiCircularProgress-root": {
7
+ width: "15px !important",
8
+ height: "15px !important"
9
+ }
10
+ },
11
+ "& .cancelBtn": {
12
+ display: "contents"
13
+ }
14
+ }
15
+ });
16
+ export default useAttachmentStyle;