Files
multica/packages/views/package.json
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

97 lines
3.2 KiB
JSON

{
"name": "@multica/views",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"test": "vitest run"
},
"exports": {
"./navigation": "./navigation/index.ts",
"./common/actor-avatar": "./common/actor-avatar.tsx",
"./common/markdown": "./common/markdown.tsx",
"./editor": "./editor/index.ts",
"./issues/components": "./issues/components/index.ts",
"./issues/hooks": "./issues/hooks/index.ts",
"./issues/utils/filter": "./issues/utils/filter.ts",
"./issues/utils/sort": "./issues/utils/sort.ts",
"./issues/utils/redact": "./issues/utils/redact.ts",
"./projects/components": "./projects/components/index.ts",
"./modals/registry": "./modals/registry.tsx",
"./modals/create-issue": "./modals/create-issue.tsx",
"./my-issues": "./my-issues/index.ts",
"./skills": "./skills/index.ts",
"./agents": "./agents/index.ts",
"./inbox": "./inbox/index.ts",
"./runtimes": "./runtimes/index.ts",
"./workspace/workspace-avatar": "./workspace/workspace-avatar.tsx",
"./layout": "./layout/index.ts",
"./auth": "./auth/index.ts",
"./search": "./search/index.ts",
"./chat": "./chat/index.ts",
"./settings": "./settings/index.ts",
"./onboarding": "./onboarding/index.ts"
},
"dependencies": {
"@base-ui/react": "^1.3.0",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@floating-ui/dom": "^1.7.6",
"@multica/core": "workspace:*",
"@multica/ui": "workspace:*",
"@tiptap/core": "^3.22.1",
"@tiptap/extension-bubble-menu": "^3.22.1",
"@tiptap/extension-code-block-lowlight": "^3.22.1",
"@tiptap/extension-document": "^3.22.1",
"@tiptap/extension-image": "^3.22.1",
"@tiptap/extension-link": "^3.22.1",
"@tiptap/extension-mention": "^3.22.1",
"@tiptap/extension-paragraph": "^3.22.1",
"@tiptap/extension-placeholder": "^3.22.1",
"@tiptap/extension-table": "^3.22.1",
"@tiptap/extension-table-cell": "^3.22.1",
"@tiptap/extension-table-header": "^3.22.1",
"@tiptap/extension-table-row": "^3.22.1",
"@tiptap/extension-text": "^3.22.1",
"@tiptap/extension-typography": "^3.22.1",
"@tiptap/markdown": "^3.22.1",
"@tiptap/pm": "^3.22.1",
"@tiptap/react": "^3.22.1",
"@tiptap/starter-kit": "^3.22.1",
"@tiptap/suggestion": "^3.22.1",
"cmdk": "^1.1.1",
"hast-util-to-html": "^4.0.1",
"lowlight": "^3.3.0",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^4.7.5",
"recharts": "3.8.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"sonner": "^2.0.7"
},
"peerDependencies": {
"@tanstack/react-query": "catalog:",
"lucide-react": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"zustand": "catalog:"
},
"devDependencies": {
"@multica/tsconfig": "workspace:*",
"@testing-library/jest-dom": "catalog:",
"@testing-library/react": "catalog:",
"@testing-library/user-event": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@vitejs/plugin-react": "catalog:",
"jsdom": "catalog:",
"rehype-sanitize": "^6.0.0",
"typescript": "catalog:",
"vitest": "catalog:"
}
}