@flozy/editor 11.1.0 → 11.1.1

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 (140) hide show
  1. package/dist/Editor/ChatEditor.js +6 -6
  2. package/dist/Editor/CommonEditor.js +21 -82
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +4 -37
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  6. package/dist/Editor/Elements/Attachments/Attachments.js +11 -153
  7. package/dist/Editor/Elements/Attachments/AttachmentsButton.js +3 -8
  8. package/dist/Editor/Elements/Button/EditorButton.js +7 -22
  9. package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -61
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  11. package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
  12. package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +55 -134
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +8 -7
  15. package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +3 -8
  16. package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
  17. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
  18. package/dist/Editor/Elements/Embed/Embed.css +0 -5
  19. package/dist/Editor/Elements/Embed/Embed.js +43 -37
  20. package/dist/Editor/Elements/Embed/Image.js +22 -242
  21. package/dist/Editor/Elements/Embed/Video.js +32 -277
  22. package/dist/Editor/Elements/Form/Form.js +35 -10
  23. package/dist/Editor/Elements/Form/FormField.js +1 -1
  24. package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
  25. package/dist/Editor/Elements/Form/Workflow/constant.js +1 -25
  26. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +75 -34
  27. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +5 -9
  28. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -3
  29. package/dist/Editor/Elements/FreeGrid/styles.js +0 -15
  30. package/dist/Editor/Elements/Grid/GridItem.js +1 -1
  31. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -2
  32. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
  33. package/dist/Editor/Elements/Signature/SignaturePopup.js +13 -2
  34. package/dist/Editor/Elements/SimpleText/index.js +1 -4
  35. package/dist/Editor/Elements/Table/Table.js +1 -2
  36. package/dist/Editor/Elements/Table/TableCell.js +3 -10
  37. package/dist/Editor/Elements/Title/title.js +5 -4
  38. package/dist/Editor/Elements/TopBanner/TopBanner.js +2 -4
  39. package/dist/Editor/Elements/TopBanner/TopBannerButton.js +3 -5
  40. package/dist/Editor/Styles/EditorStyles.js +5 -16
  41. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  42. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  43. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  44. package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -33
  45. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -2
  46. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +1 -3
  47. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +23 -25
  48. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
  49. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +5 -15
  50. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
  51. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +7 -65
  52. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +12 -66
  53. package/dist/Editor/Toolbar/PopupTool/index.js +4 -6
  54. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  55. package/dist/Editor/common/ColorPickerButton.js +19 -38
  56. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  57. package/dist/Editor/common/FontLoader/FontLoader.js +0 -1
  58. package/dist/Editor/common/Icon.js +0 -28
  59. package/dist/Editor/common/ImageSelector/ImageSelector.js +7 -45
  60. package/dist/Editor/common/ImageSelector/Options/Upload.js +11 -26
  61. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  62. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  66. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -3
  68. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +7 -20
  69. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  70. package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +0 -2
  71. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +7 -20
  72. package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
  73. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  74. package/dist/Editor/common/RnD/Utils/gridDropItem.js +11 -28
  75. package/dist/Editor/common/RnD/Utils/index.js +1 -3
  76. package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +63 -52
  77. package/dist/Editor/common/RnD/VirtualElement/helper.js +68 -248
  78. package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -22
  79. package/dist/Editor/common/RnD/index.js +14 -61
  80. package/dist/Editor/common/Shorthands/elements.js +0 -54
  81. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  82. package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -4
  83. package/dist/Editor/common/StyleBuilder/fieldStyle.js +0 -1
  84. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -10
  85. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  86. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  87. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -36
  88. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  89. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +0 -2
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  91. package/dist/Editor/common/StyleBuilder/formStyle.js +13 -19
  92. package/dist/Editor/common/StyleBuilder/index.js +4 -8
  93. package/dist/Editor/common/Uploader.js +17 -118
  94. package/dist/Editor/common/iconslist.js +0 -21
  95. package/dist/Editor/commonStyle.js +3 -37
  96. package/dist/Editor/helper/index.js +1 -4
  97. package/dist/Editor/helper/theme.js +2 -203
  98. package/dist/Editor/hooks/useMouseMove.js +3 -12
  99. package/dist/Editor/hooks/useTable.js +1 -62
  100. package/dist/Editor/plugins/withEmbeds.js +1 -1
  101. package/dist/Editor/plugins/withHTML.js +3 -56
  102. package/dist/Editor/plugins/withTable.js +1 -1
  103. package/dist/Editor/service/fileupload.js +0 -70
  104. package/dist/Editor/theme/ThemeList.js +173 -50
  105. package/dist/Editor/utils/SlateUtilityFunctions.js +38 -162
  106. package/dist/Editor/utils/button.js +17 -1
  107. package/dist/Editor/utils/font.js +37 -40
  108. package/dist/Editor/utils/helper.js +3 -76
  109. package/dist/Editor/utils/insertAppHeader.js +4 -8
  110. package/package.json +1 -1
  111. package/dist/Editor/Elements/Attachments/AttachmentStyles.js +0 -16
  112. package/dist/Editor/Elements/FreeGrid/helper.js +0 -194
  113. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -439
  114. package/dist/Editor/assets/svg/BackIcon.js +0 -18
  115. package/dist/Editor/assets/svg/ThemeIcons.js +0 -293
  116. package/dist/Editor/common/CustomColorPicker/index.js +0 -130
  117. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  118. package/dist/Editor/common/CustomDialog2/index.js +0 -94
  119. package/dist/Editor/common/CustomDialog2/style.js +0 -67
  120. package/dist/Editor/common/CustomSelect.js +0 -43
  121. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  122. package/dist/Editor/common/UploaderWithProgress.js +0 -183
  123. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  124. package/dist/Editor/hooks/useThemeValues.js +0 -63
  125. package/dist/Editor/theme/index.js +0 -149
  126. package/dist/Editor/themeSettings/ActiveTheme.js +0 -82
  127. package/dist/Editor/themeSettings/buttons/index.js +0 -300
  128. package/dist/Editor/themeSettings/buttons/style.js +0 -23
  129. package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
  130. package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
  131. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  132. package/dist/Editor/themeSettings/fonts/index.js +0 -240
  133. package/dist/Editor/themeSettings/fonts/style.js +0 -62
  134. package/dist/Editor/themeSettings/icons.js +0 -60
  135. package/dist/Editor/themeSettings/index.js +0 -380
  136. package/dist/Editor/themeSettings/style.js +0 -299
  137. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  138. package/dist/Editor/themeSettingsAI/index.js +0 -355
  139. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -202
  140. 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
  });
@@ -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, createContext } from "react";
2
+ import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } 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, 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,11 +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
41
  import { jsx as _jsx } from "react/jsx-runtime";
46
42
  import { jsxs as _jsxs } from "react/jsx-runtime";
47
- export const ThemeContext = /*#__PURE__*/createContext(null);
48
43
  const Item = /*#__PURE__*/forwardRef(({
49
44
  children,
50
45
  ...props
@@ -99,7 +94,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
99
94
  otherProps,
100
95
  isIframe,
101
96
  theme,
102
- showThemeButtons,
103
97
  showViewport = false,
104
98
  overrideWrapperStyles = {},
105
99
  translation
@@ -133,29 +127,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
133
127
  fixedWidth = "60%",
134
128
  fullWidth = "80%",
135
129
  hideTools = [],
136
- translationMock,
137
- uploadFile,
138
- resumeUploadState,
139
- uploadTerminator,
140
- isUploadInProgress = () => {}
130
+ translationMock
141
131
  } = otherProps || {};
142
132
  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
- };
154
133
  const editor = useMemo(() => {
155
134
  if (collaborativeEditor) return collaborativeEditor;
156
135
  const editor = createEditor();
157
136
  editor.needLayout = needLayout;
158
- editor.getTitleSaveData = getTitleSaveData;
137
+ editor.translation = translationFn;
159
138
  return withCommon(editor, {
160
139
  needLayout
161
140
  });
@@ -166,11 +145,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
166
145
  const {
167
146
  bannerSpacing,
168
147
  pageBgImage,
169
- pageColor = "",
148
+ pageColor,
170
149
  color: pageTextColor,
171
150
  pageWidth,
172
151
  maxWidth: pageMaxWidth,
173
- theme: selectedTheme,
174
152
  lineHeight
175
153
  } = pageSt?.pageProps || {
176
154
  bannerSpacing: {
@@ -182,17 +160,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
182
160
  };
183
161
  const classes = editorStyles({
184
162
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
185
- placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
163
+ placeHolderColor: invertColor(pageColor || "#FFF"),
186
164
  theme,
187
165
  overrideWrapperStyles
188
166
  });
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
-
196
167
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
197
168
  useEffect(() => {
198
169
  setValue(draftToSlate({
@@ -235,6 +206,17 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
235
206
  title: serializeToText(title?.children) || "Untitled"
236
207
  };
237
208
  };
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
+ };
238
220
  const getPreviewImage = async (needBackground = false, options = {}) => {
239
221
  ReactEditor.blur(editor);
240
222
  const dom = needBackground ? editorWrapper?.current : editorWrapper?.current.getElementsByClassName("innert-editor-textbox")[0];
@@ -334,12 +316,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
334
316
  redo() {
335
317
  editor?.redo();
336
318
  },
337
- toggleTheme() {
338
- setOpenTheme(!openTheme);
339
- },
340
- toggleAITheme() {
341
- setOpenAITheme(!openAITheme);
342
- },
343
319
  getPageSettings: {
344
320
  background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
345
321
  }
@@ -394,11 +370,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
394
370
  ICON_API: "https://assets.agenciflow.com",
395
371
  translation: translationFn,
396
372
  getTitleSaveData,
397
- customLineHeight: lineH,
398
- uploadFile,
399
- resumeUploadState,
400
- uploadTerminator,
401
- isUploadInProgress
373
+ customLineHeight: lineH
402
374
  };
403
375
  const renderElement = useCallback(props => {
404
376
  return /*#__PURE__*/_jsx(Element, {
@@ -547,7 +519,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
547
519
  }
548
520
  return style;
549
521
  }, [pageBgImage, pageColor, pageTextColor]);
550
- const themeProps = getTheme(selectedTheme);
551
522
 
552
523
  // const handleContextMenu = (e) => {
553
524
  // if (!readOnly) {
@@ -581,23 +552,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
581
552
  return /*#__PURE__*/_jsxs(EditorProvider, {
582
553
  theme: theme,
583
554
  editor: editor,
584
- openTheme: openTheme,
585
- setOpenTheme: setOpenTheme,
586
- triggerRender: triggerRender,
587
- children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
588
- className: "theme-buttons",
589
- children: [/*#__PURE__*/_jsx(IconButton, {
590
- onClick: () => setOpenTheme(true),
591
- className: "themePaintIcon",
592
- children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
593
- }), /*#__PURE__*/_jsx(IconButton, {
594
- onClick: () => setOpenAITheme(true),
595
- style: {
596
- marginTop: "4px"
597
- },
598
- children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
599
- })]
600
- }) : null, /*#__PURE__*/_jsx(FontLoader, {
555
+ children: [/*#__PURE__*/_jsx(FontLoader, {
601
556
  otherProps: {
602
557
  services: otherProps?.services
603
558
  },
@@ -607,7 +562,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
607
562
  ...props,
608
563
  fullScreen: fullScreen,
609
564
  footer: footer || "",
610
- selectedTheme: selectedTheme,
611
565
  children: /*#__PURE__*/_jsx(Box, {
612
566
  component: "div",
613
567
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
@@ -635,16 +589,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
635
589
  id: "slate-wrapper-scroll-container",
636
590
  ref: editorWrapper,
637
591
  onClick: e => {
638
- if (!isReadOnly) {
639
- handleInsertLastElement(e, editor);
640
- }
592
+ handleInsertLastElement(e, editor);
641
593
  },
642
594
  onScroll: handleScroll,
643
595
  style: editorWrapperStyle,
644
596
  children: /*#__PURE__*/_jsxs(Box, {
645
597
  component: "div",
646
598
  className: "max-content",
647
- sx: themeProps?.sxProps || {},
648
599
  "data-info": outsideEditorClickLabel,
649
600
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
650
601
  className: "scroll-area",
@@ -714,18 +665,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
714
665
  "data-info": outsideEditorClickLabel,
715
666
  onClick: handleFooterClick,
716
667
  children: footer
717
- }), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
718
- open: openTheme,
719
- setOpen: setOpenTheme,
720
- editor: editor,
721
- services: otherProps?.services,
722
- appTheme: theme,
723
- customProps: customProps
724
- }) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
725
- openAITheme: openAITheme,
726
- setOpenAITheme: setOpenAITheme,
727
- onSaveTheme: otherProps?.onSaveTheme,
728
- theme: theme
729
668
  })]
730
669
  })
731
670
  }), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
@@ -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,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,39 +1383,6 @@ 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
-
1405
1386
  .hyperLink {
1406
1387
  word-break: break-all;
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
- }
1388
+ }
@@ -268,7 +268,7 @@ function AppHeader(props) {
268
268
  style: {
269
269
  display: "inline-flex",
270
270
  alignItems: "center",
271
- color: textColor || "#000000",
271
+ color: textColor,
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 || "#000",
326
+ color: textColor || "#FFF",
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 || "#000",
342
+ color: textColorHover || textColor || "#FFF",
343
343
  background: bgColorHover || bgColor || "none",
344
344
  border: borderColorHover ? `1px solid ${borderColorHover}` : "none",
345
345
  "& .m-settings": {
@@ -1,141 +1,33 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import Box from '@mui/material/Box';
3
- import Card from '@mui/material/Card';
4
- import CardMedia from '@mui/material/CardMedia';
5
- import CardContent from '@mui/material/CardContent';
6
- import Typography from '@mui/material/Typography';
7
- import CircularProgress from '@mui/material/CircularProgress';
8
- import IconButton from '@mui/material/IconButton';
1
+ import React from "react";
2
+ import { Box, Card, CardMedia, CardContent, Typography } from "@mui/material";
9
3
  import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";
10
4
  import TextSnippetIcon from "@mui/icons-material/TextSnippet";
11
- import HighlightOffRoundedIcon from "@mui/icons-material/HighlightOffRounded";
12
- import { Transforms } from "slate";
13
- import { ReactEditor, useSlateStatic } from "slate-react";
14
5
  import { formatDate } from "../../utils/helper";
15
6
  import Icon from "../../common/Icon";
16
7
  import { getEmbedURL } from "../../helper";
17
8
  import Video from "../Embed/Video";
18
- import { formatFileSize } from "../../service/fileupload";
19
- import { useEditorContext } from "../../hooks/useMouseMove";
20
- import useAttachmentStyle from "./AttachmentStyles";
21
9
  import { jsx as _jsx } from "react/jsx-runtime";
22
- import { Fragment as _Fragment } from "react/jsx-runtime";
23
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
11
  const Attachments = props => {
25
12
  const {
26
13
  attributes,
27
14
  element,
28
- children,
29
- customProps
15
+ children
30
16
  } = props;
31
17
  const {
32
18
  url,
33
19
  type,
34
- date,
35
- fileName,
36
- isUploading,
37
- file,
38
- fileSize,
39
- uniqueId
20
+ date
40
21
  } = element;
41
- const {
42
- resumeUploadState,
43
- services,
44
- uploadFile,
45
- uploadTerminator
46
- } = customProps || {};
47
22
  const {
48
23
  isEmbed
49
24
  } = getEmbedURL(element, true);
50
25
  const getLastName = url?.split("/").pop();
51
- const fileName2 = `${decodeURIComponent(getLastName)}`;
52
- const editor = useSlateStatic();
53
- const {
54
- theme
55
- } = useEditorContext();
56
- const classes = useAttachmentStyle(theme);
57
- const path = ReactEditor.findPath(editor, element);
58
- const [redirectURL, setRedirectURL] = useState(isUploading ? null : url);
59
- const [uploadStatus, setUploadStatus] = useState({
60
- isUploading: !!isUploading,
61
- uploadPercentage: 0,
62
- fileName: fileName || fileName2,
63
- fileSize: fileSize
64
- });
65
- const xhrRef = useRef(null);
66
- const cancelUpload = () => {
67
- Transforms.removeNodes(editor, {
68
- at: path
69
- });
70
- uploadTerminator(uniqueId, setUploadStatus);
71
- };
72
- const onSave = url => {
73
- setRedirectURL(url);
74
- Transforms.setNodes(editor, {
75
- url: url,
76
- isUploading: false
77
- }, {
78
- at: path
79
- });
80
- setUploadStatus({
81
- isUploading: false,
82
- uploadPercentage: 0,
83
- fileName: null,
84
- fileSize: null
85
- });
86
- };
87
- const handleFileUpload = async () => {
88
- if (!file) return;
89
- try {
90
- const id = !uniqueId ? crypto?.randomUUID() : uniqueId;
91
- const result = await services("uploadFile", file);
92
- const uploadUrl = result?.data?.[0];
93
- const fileEntry = {
94
- file: file,
95
- xhrRef,
96
- presidnedURL: uploadUrl,
97
- status: "uploading"
98
- };
99
- uploadFile(id, fileEntry, setUploadStatus, onSave, "document");
100
- Transforms.setNodes(editor, {
101
- uniqueId: id,
102
- isUploading: true
103
- }, {
104
- at: path
105
- });
106
- } catch (error) {
107
- console.error("Upload failed:", error);
108
- setUploadStatus(prev => ({
109
- ...prev,
110
- isUploading: false,
111
- uploadPercentage: 0
112
- }));
113
- }
114
- };
115
- const noUploadTracks = () => {
116
- setUploadStatus({
117
- isUploading: false,
118
- uploadPercentage: 0,
119
- fileName: null,
120
- fileSize: null
121
- });
122
- setRedirectURL(null);
123
- Transforms.removeNodes(editor, {
124
- at: path
125
- });
126
- };
127
- useEffect(() => {
128
- if (uniqueId && isUploading) {
129
- resumeUploadState(uniqueId, setUploadStatus, onSave, noUploadTracks, "document");
130
- } else if (file && isUploading) {
131
- handleFileUpload();
132
- }
133
- }, []);
26
+ const fileName = `${decodeURIComponent(getLastName)}`;
134
27
  return !isEmbed ? /*#__PURE__*/_jsxs(Box, {
135
28
  component: "div",
136
29
  className: "attachment-wrpr-ev2",
137
30
  ...attributes,
138
- sx: classes?.attachmentRoot,
139
31
  contentEditable: false,
140
32
  style: {
141
33
  display: "block"
@@ -149,8 +41,7 @@ const Attachments = props => {
149
41
  padding: "8px",
150
42
  boxShadow: "none",
151
43
  border: "1px solid #eae9e9",
152
- backgroundColor: "#F7F7F7",
153
- position: "relative"
44
+ backgroundColor: "#F7F7F7"
154
45
  },
155
46
  children: [/*#__PURE__*/_jsx(CardMedia, {
156
47
  sx: {
@@ -176,7 +67,7 @@ const Attachments = props => {
176
67
  })
177
68
  }), /*#__PURE__*/_jsxs(CardContent, {
178
69
  component: "a",
179
- href: redirectURL,
70
+ href: url,
180
71
  target: "_blank",
181
72
  style: {
182
73
  display: "flex",
@@ -185,8 +76,7 @@ const Attachments = props => {
185
76
  padding: "8px",
186
77
  textDecoration: "none",
187
78
  flexDirection: "column",
188
- color: "#0F172A",
189
- flexGrow: uploadStatus?.isUploading && 1
79
+ color: "#0F172A"
190
80
  },
191
81
  children: [/*#__PURE__*/_jsx(Typography, {
192
82
  style: {
@@ -195,48 +85,16 @@ const Attachments = props => {
195
85
  fontSize: "14px"
196
86
  },
197
87
  component: "div",
198
- className: "truncateText",
199
- children: fileName2 || fileName
200
- }), /*#__PURE__*/_jsxs(Typography, {
88
+ children: fileName
89
+ }), /*#__PURE__*/_jsx(Typography, {
201
90
  style: {
202
91
  fontWeight: "normal",
203
92
  color: "#64748b",
204
93
  fontSize: "11px"
205
94
  },
206
95
  component: "div",
207
- className: "uploadinDetails",
208
- children: [uploadStatus?.isUploading && /*#__PURE__*/_jsxs(_Fragment, {
209
- children: [/*#__PURE__*/_jsx(Typography, {
210
- sx: {
211
- fontSize: 12,
212
- color: "#64748b"
213
- },
214
- children: `${formatFileSize(fileSize)}`
215
- }), /*#__PURE__*/_jsx(CircularProgress, {
216
- variant: "determinate",
217
- value: uploadStatus?.uploadPercentage ?? 0,
218
- size: 20,
219
- thickness: 5
220
- }), /*#__PURE__*/_jsx(Typography, {
221
- sx: {
222
- fontSize: 12,
223
- color: "#64748b"
224
- },
225
- children: `${uploadStatus?.uploadPercentage?.toFixed(0) ?? 0}%`
226
- })]
227
- }), !uploadStatus?.isUploading && formatDate(date)]
96
+ children: formatDate(date)
228
97
  })]
229
- }), uploadStatus?.isUploading && /*#__PURE__*/_jsx(IconButton, {
230
- onClick: cancelUpload,
231
- sx: {
232
- position: "absolute",
233
- right: 4,
234
- top: 4
235
- },
236
- "aria-label": "Cancel upload",
237
- size: "small",
238
- className: "cancelBtn",
239
- children: /*#__PURE__*/_jsx(HighlightOffRoundedIcon, {})
240
98
  })]
241
99
  }), /*#__PURE__*/_jsx("span", {
242
100
  contentEditable: false,
@@ -4,7 +4,6 @@ import ToolbarIcon from "../../common/ToolbarIcon";
4
4
  import Icon from "../../common/Icon";
5
5
  import ImageSelector from "../../common/ImageSelector/ImageSelector";
6
6
  import { insertAttachments } from "../../utils/attachments";
7
- import { insertUploadStatusNodeForAttachment } from "../../service/fileupload";
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { Fragment as _Fragment } from "react/jsx-runtime";
10
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -22,13 +21,9 @@ const AttachmentsButton = props => {
22
21
  SetOpen(true);
23
22
  };
24
23
  const onSelectImage = url => {
25
- if (!url?.isUpload && url?.embedURL) {
26
- insertAttachments(editor, {
27
- url: url?.embedURL
28
- });
29
- } else {
30
- insertUploadStatusNodeForAttachment(editor, url?.file);
31
- }
24
+ insertAttachments(editor, {
25
+ url
26
+ });
32
27
  handleClose();
33
28
  };
34
29
  const handleClose = () => {