Skip to content

feat: add link and wikilink hover cards and Mod+click handlers#28

Draft
ocavue wants to merge 5 commits into
masterfrom
ocavue/on-link
Draft

feat: add link and wikilink hover cards and Mod+click handlers#28
ocavue wants to merge 5 commits into
masterfrom
ocavue/on-link

Conversation

@ocavue

@ocavue ocavue commented Jun 13, 2026

Copy link
Copy Markdown
Member

Adds four <Editor> props: onLinkHover, onLinkClick, onWikilinkHover, onWikilinkClick.

  • Hover (while focused) over a link/wikilink opens a floating card after a short dwell. The host fills it by returning a React node (sync or as a promise) from onLinkHover / onWikilinkHover; returning nothing shows a built-in card (URL plus Edit / Copy / Open for links, Edit / Open for wikilinks).
  • Plain click edits the link text; Mod+click (Cmd/Ctrl) fires onLinkClick / onWikilinkClick for host-controlled navigation.
  • @meowdown/core gains defineLinkClickHandler / defineWikilinkClickHandler and the linkAt / wikilinkAt hit-test helpers.

The hover card anchors to the hovered element via ProseKit's new InlinePopoverRoot anchor prop (prosekit#1678).

Depends on the prosekit beta (@prosekit/react@0.8.0-beta.0, @prosekit/web@0.9.0-beta.0, @prosekit/extensions@0.17.5-beta.0); repin to a stable release before merging.

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meowdown Ready Ready Preview, Comment Jun 13, 2026 6:24pm

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.42% 1165 / 1247
🔵 Statements 91.25% 1304 / 1429
🔵 Functions 90.06% 263 / 292
🔵 Branches 83% 679 / 818
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/index.ts 0% 0% 0% 0%
packages/core/src/style.css 0% 0% 0% 0%
packages/core/src/extensions/link-click.ts 68% 56.25% 100% 73.68% 39-43, 67
packages/core/src/extensions/link-hit.ts 90.62% 83.33% 100% 100% 46, 48, 85, 87, 113, 116
packages/react/src/index.ts 0% 0% 0% 0%
packages/react/src/components/editor.tsx 100% 75% 100% 100%
packages/react/src/components/link-card-default.tsx 100% 62.5% 100% 100%
packages/react/src/components/link-hover-card.module.css 0% 0% 0% 0%
packages/react/src/components/link-hover-card.module.d.css.ts 0% 0% 0% 0%
packages/react/src/components/link-hover-card.tsx 80.41% 76% 68.96% 81.06% 81-82, 97-98, 102-103, 109-114, 119-120, 129, 135-149, 173-174, 184, 188, 200-201, 211, 223-224, 230
packages/react/src/components/prosekit-editor.tsx 98.14% 91.42% 100% 100% 123
packages/react/src/components/types.ts 0% 0% 0% 0%
Generated in workflow #95 for commit a9de9e9 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant