From 8bd2713385375aa827e50adec82538be36f44b28 Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Thu, 1 Jan 2026 01:16:47 +0700 Subject: [PATCH] fix: resolve tiptap duplicate Link extension warning StarterKit 3.10+ now includes Link by default. Our code was adding Link.configure() separately, causing duplicate extension warning and breaking the email builder visual editor modal. Fixed by configuring StarterKit with { link: false } so our custom Link.configure() with specific options is the only Link extension. --- admin-spa/src/components/ui/rich-text-editor.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/admin-spa/src/components/ui/rich-text-editor.tsx b/admin-spa/src/components/ui/rich-text-editor.tsx index cb7ff59..4c0bbee 100644 --- a/admin-spa/src/components/ui/rich-text-editor.tsx +++ b/admin-spa/src/components/ui/rich-text-editor.tsx @@ -45,7 +45,11 @@ export function RichTextEditor({ }: RichTextEditorProps) { const editor = useEditor({ extensions: [ - StarterKit, + // StarterKit 3.10+ includes Link by default, so disable it here + // since we configure Link separately below with custom options + StarterKit.configure({ + link: false, + }), Placeholder.configure({ placeholder, }), @@ -123,7 +127,7 @@ export function RichTextEditor({ const addImage = () => { openWPMediaImage((file) => { - editor.chain().focus().setImage({ + editor.chain().focus().setImage({ src: file.url, alt: file.alt || file.title, title: file.title, @@ -328,7 +332,7 @@ export function RichTextEditor({ {__('Add a styled button to your content. Use variables for dynamic links.')} - +
@@ -339,7 +343,7 @@ export function RichTextEditor({ placeholder={__('e.g., View Order')} />
- +
)}
- +
- +