From cfc75c11d958d597cf49f939620c46d522832914 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Thu, 17 Jul 2025 20:42:45 +0700 Subject: [PATCH] feat: add wordpress --- .../src/components/new-launch/editor.tsx | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/apps/frontend/src/components/new-launch/editor.tsx b/apps/frontend/src/components/new-launch/editor.tsx index 17860ce3..2339da85 100644 --- a/apps/frontend/src/components/new-launch/editor.tsx +++ b/apps/frontend/src/components/new-launch/editor.tsx @@ -198,13 +198,6 @@ export const EditorWrapper: FC<{ setLoaded(true); }, [loaded, loadedState]); - useEffect(() => { - if (editor) { - setLoaded(false); - setLoadedState(false); - } - }, [editor]); - const canEdit = useMemo(() => { return current === 'global' || !!internal; }, [current, internal]); @@ -724,29 +717,6 @@ export const OnlyEditor = forwardRef< paste?: (event: ClipboardEvent | File[]) => void; } >(({ editorType, value, onChange, paste }, ref) => { - const editorOptions = useMemo(() => { - if (editorType === 'normal') { - return []; - } - - const list = []; - - if ( - editorType === ('markdown' as const) || - editorType === ('html' as const) - ) { - list.push( - BulletList, - ListItem, - Heading.configure({ - levels: [1, 2, 3], - }) - ); - } - - return list; - }, [editorType]); - const editor = useEditor({ extensions: [ Document, @@ -757,11 +727,15 @@ export const OnlyEditor = forwardRef< InterceptBoldShortcut, InterceptUnderlineShortcut, Span, + BulletList, + ListItem, + Heading.configure({ + levels: [1, 2, 3], + }), History.configure({ depth: 100, // default is 100 newGroupDelay: 100, // default is 500ms }), - ...editorOptions, ], content: value || '', shouldRerenderOnTransaction: true,