Skip to content

feat: render file links as inline pills#202

Merged
ocavue merged 11 commits into
masterfrom
feat/file-embed-pill
Jul 2, 2026
Merged

feat: render file links as inline pills#202
ocavue merged 11 commits into
masterfrom
feat/file-embed-pill

Conversation

@ocavue

@ocavue ocavue commented Jul 2, 2026

Copy link
Copy Markdown
Member

A host can now claim [label](url) links as files (resolveFileLink, read at editor creation) and render each claimed link as an inline pill: a file-kind icon, the name, and the size resolved (possibly async) by resolveFileInfo, with clicks reported through the new onFileClick. Serialization is untouched and claimed links behave like images (one caret atom, editable source). Also exports buildFileMarkdown so host commands that insert file links produce byte-identical markdown to a paste/drop.

@vercel

vercel Bot commented Jul 2, 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 Jul 2, 2026 11:58am

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/core@202
npm i https://pkg.pr.new/prosekit/meowdown/@meowdown/react@202

commit: 419d9fd

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.27% 2663 / 2855
🔵 Statements 91.08% 2922 / 3208
🔵 Functions 90.75% 658 / 725
🔵 Branches 84.07% 1673 / 1990
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/extension.ts 100% 100% 100% 100%
packages/core/src/extensions/file-click.ts 84.21% 62.5% 100% 100% 16, 54, 56
packages/core/src/extensions/file-paste.ts 92.68% 92% 90% 97.14% 52, 67, 102
packages/core/src/extensions/file-view.ts 100% 95% 100% 100%
packages/core/src/extensions/follow-link.ts 100% 89.65% 100% 100%
packages/core/src/extensions/inline-mark-plugin.ts 96.72% 86.36% 100% 100% 104, 138
packages/core/src/extensions/inline-marks.ts 90.62% 0% 93.33% 90.62% 90-91, 150
packages/core/src/extensions/inline-text-to-mark-chunks.ts 97.41% 94.44% 100% 97.81% 102, 249, 317, 401
packages/core/src/extensions/mark-names.ts 100% 100% 100% 100%
packages/core/src/testing/index.ts 100% 90% 100% 100%
packages/core/src/utils/format-file-size.ts 100% 100% 100% 100%
packages/react/src/components/editor-extensions.tsx 100% 97.05% 100% 100%
packages/react/src/components/editor.tsx 80.95% 68.75% 77.77% 80.95% 311, 341-347
packages/react/src/components/prosekit-editor.tsx 95.58% 90.19% 91.3% 96.72% 262, 307-310
Generated in workflow #905 for commit 419d9fd by the Vitest Coverage Report Action

@ocavue ocavue changed the title feat: render file links as inline pills via resolveFileLink and defineFileView feat: render file links as inline pills Jul 2, 2026
# Conflicts:
#	packages/core/src/extensions/extension.ts
#	packages/core/src/index.ts
#	packages/react/src/components/editor-extensions.tsx
@ocavue

ocavue commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Merged latest master. The merge also integrates #196: Mod-Enter now follows the file pill under the caret (FollowLinkHandlers gained onFileClick, checked before the link lookup since a claimed link carries no link marks), and FileClickPayload.event widened to MouseEvent | KeyboardEvent to match the other click payloads.

@ocavue ocavue marked this pull request as ready for review July 2, 2026 11:51
@ocavue ocavue merged commit 3ad27b9 into master Jul 2, 2026
11 checks passed
@ocavue ocavue deleted the feat/file-embed-pill branch July 2, 2026 12:03
@ocavuebot ocavuebot mentioned this pull request Jul 2, 2026
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