+ {label &&
editor?.commands.focus()}>{label}}
+ {description && (
+
+ {description}
+
+ )}
+
+
+ {editorType === 'full' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
+
+ {editorType === 'simple' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
+
+ {additionalToolbarControls}
+
+
+
+
+ {(charError || error) && (
+
+ {error || charError}
+
+ )}
+
+ );
+};
diff --git a/frontend/src/components/common/Editor/index.tsx b/frontend/src/components/common/Editor/index.tsx
index 39a76af95d..0bfcbc5207 100644
--- a/frontend/src/components/common/Editor/index.tsx
+++ b/frontend/src/components/common/Editor/index.tsx
@@ -1,224 +1,27 @@
-import {Link, RichTextEditor} from "@mantine/tiptap";
-import {useEditor} from "@tiptap/react";
-import StarterKit from '@tiptap/starter-kit';
-import {TextAlign} from '@tiptap/extension-text-align';
-import {Color, TextStyle} from '@tiptap/extension-text-style';
-import React, {useEffect, useState} from "react";
-import {InputDescription, InputError, InputLabel, MantineFontSize} from "@mantine/core";
+import {InputLabel, Skeleton} from "@mantine/core";
+import {prefetchOnIdle} from "../../../utilites/helpers.ts";
+import {createLazyModule} from "../../../utilites/lazyModule.ts";
+import type {EditorProps} from "./Editor";
import classes from "./Editor.module.scss";
import classNames from "classnames";
-import {Trans} from "@lingui/macro";
-import {InsertImageControl} from "./Controls/InsertImageControl";
-import {ImageResize} from "./Extensions/ImageResizeExtension";
-import {Extension} from '@tiptap/core';
-interface EditorProps {
- onChange: (value: string) => void;
- value: string;
- label?: React.ReactNode;
- description?: React.ReactNode;
- required?: boolean;
- className?: string;
- error?: string | React.ReactNode;
- editorType?: 'full' | 'simple';
- maxLength?: number;
- size?: MantineFontSize;
- additionalExtensions?: Extension[];
- additionalToolbarControls?: React.ReactNode;
-}
+const editorModule = createLazyModule(() => import("./Editor"));
-export const Editor = ({
- error,
- onChange,
- value,
- label = '',
- required = false,
- className = '',
- description = '',
- editorType = 'full',
- maxLength,
- size = 'md',
- additionalExtensions = [],
- additionalToolbarControls,
- }: EditorProps) => {
- const [charError, setCharError] = useState