Files
multica/packages/views
Naiyuan Qing 8aab7d9b80 fix(editor): use native BubbleMenu and simplify link click
Revert to Tiptap's native <BubbleMenu> component which has
battle-tested focus management (preventHide, relatedTarget checks,
mousedown capture). The custom useFloating + createPortal approach
had unfixable focus/blur issues — portal DOM updates caused editor
blur cycles, and reimplementing the plugin's focus logic was
incomplete.

Also simplify link clicking: clicks on links now always open them
(both edit and readonly mode) instead of showing a preview card.
Remove EditorLinkPreview component entirely.

Changes:
- bubble-menu.tsx: back to <BubbleMenu> from @tiptap/react/menus
- content-editor.tsx: link click always opens, remove EditorLinkPreview
- link-preview.tsx: remove EditorLinkPreview, keep ReadonlyLinkWrapper
- shouldShowBubbleMenu: add .trim() to filter whitespace-only selections
- package.json: restore @tiptap/extension-bubble-menu dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 14:25:54 +08:00
..