Skip to content

Feature: File uploads#87

Closed
sorokya wants to merge 5 commits intopanphora:mainfrom
sorokya:file-uploads
Closed

Feature: File uploads#87
sorokya wants to merge 5 commits intopanphora:mainfrom
sorokya:file-uploads

Conversation

@sorokya
Copy link

@sorokya sorokya commented Dec 26, 2025

Fixes #27

Not sure if the web-component code also needs updated?

I added a demo for the new code. There's no styling for drag-over but it works.


Summary by cubic

Adds file upload support with paste and drag‑and‑drop, including optional batch uploads and placeholder handling. Updates docs, types, and demo; bumps to v2.2.0.

  • New Features
    • Paste or drag-and-drop files into the editor; a placeholder is inserted and replaced after async upload.
    • New fileUpload options: enabled, maxSize (default 10 MB), mimeTypes filter, batch mode.
    • onInsertFile callback accepts File or File[] and returns markdown string(s) to insert.
    • Images are auto-detected and use the syntax; failures replace placeholders with Upload failed.
    • TypeScript defs, README examples, and a website demo with a batch toggle are included.

Written for commit d22ef60. Summary will update automatically on new commits.

panphora added a commit that referenced this pull request Feb 18, 2026
Adds fileUpload option with paste/drop handlers, placeholder insertion,
and async upload callback. Supports batch mode and mime type filtering.
Fixes from PR review: cleanup in destroy(), unique placeholders to
prevent collision with duplicate filenames, TypeScript definitions.
@panphora
Copy link
Owner

Implemented in v2.2.0. File upload via paste and drag-and-drop is now supported, with batch upload, toolbar button, and TypeScript types. Thanks @sorokya!

@panphora panphora closed this Feb 18, 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.

Feature request: File/image paste and drop support

2 participants

Comments