Skip to content

feat(wysiwyg): Notion-style block editing (2.3.0) - #5

Merged
tacxou merged 3 commits into
mainfrom
claude/quasar-renderer-update-a5cae1
Nov 21, 2026
Merged

tacxou merged 3 commits into
mainfrom
claude/quasar-renderer-update-a5cae1

Conversation

@tacxou

@tacxou tacxou commented Nov 20, 2026

Copy link
Copy Markdown
Member

What

New options.blockEditor (boolean | { dragHandle, placeholders, bordered }) on the WYSIWYG renderer, for Notion-style block editing:

  • Gutter handle, shown when the pointer is over a top-level block:
    • + inserts a block below and opens the / palette when it is on.
    • The grip is dragged to move the block, or clicked to open the block menu: Turn into (paragraph, H1–H3, lists, quote, code), Clear formatting, Duplicate, Copy text, Move up/down, Delete.
  • Hint on the empty block holding the cursor (Heading 2, or "type '/'"). The host placeholder is kept while the document is empty.
  • Defaults when block mode is on: the formatting bubble and / palette replace the fixed toolbar, and the page is borderless with a left gutter. Explicit toolbar, bubbleMenu, slashCommands and density options still win.
  • Exports: the block API is exported from /advanced (resolveWysiwygBlockEditor, buildWysiwygBlockMenu, runWysiwygBlockAction, …).
  • Translations: FR/EN UI strings added.
  • Docs and playground: FR/EN docs, a playground example (nuxt-wysiwyg-blocks), the docs props and changelog/2.3.0.md are added, and CHANGELOG.md is regenerated.

Why not UEditorDragHandle

Nuxt UI's drag handle uses @tiptap/extension-drag-handle, which requires @tiptap/y-tiptap, yjs and y-protocols. The Vite import fails without them, and adding them would make them dependencies of every host using /advanced. This handle is built on ProseMirror alone (view.dragging and serializeForClipboard), so it adds no dependency.

Release order

⚠️ Merge only after 2.2.0 is published. main holds the unreleased 2.2.0; merging this first would ship the block editor inside 2.2.0.

Before 2.2.0 is published, changelog/2.2.0.md also needs a fix on main: it declares previous: 2.1.1, a version that was never tagged or published.

Checks

  • Automated checks: lint, typecheck/build, 766 tests (coverage 95.6%, block.ts 98.8%), docs:build, the MCP build, package:check, changelog:check and test:scripts all pass. The browser recipe passes 10/10, including "./core ships no Tiptap".
  • Checked in the browser:
    • + inserts a block and opens /.
    • Turn into and Move down act on the right block, including the first one.
    • The handle stays visible when the pointer moves onto it.
    • A drag using synthetic DragEvents moves the block, and a cancelled drag resets view.dragging.
    • Classic editors are unchanged.

Known limits / not verified

  • Not tested: drag with a real mouse (a CDP limitation) and Firefox. The draggable sits on a wrapper so that Firefox can drag it.
  • Top-level blocks only: a list or a table moves as a whole.
  • Keyboard: the handle cannot be reached from the keyboard, and closing the menu doesn't restore focus.
  • Narrow screens: the handle is hidden below sm.

🤖 Generated with Claude Code

`options.blockEditor` turns the WYSIWYG field into a page edited block by
block: a gutter handle (`+` to insert, grip to drag or open the block menu),
a hint on the empty block holding the cursor, the formatting bubble and the
`/` palette instead of the fixed toolbar, and a borderless page.

The handle is built on ProseMirror alone: Nuxt UI's `UEditorDragHandle`
requires `@tiptap/y-tiptap`, `yjs` and `y-protocols`, which would become
dependencies of every host using `/advanced`. Explicit options still win and
the stored content format is unchanged.

Prepares 2.3.0 (changelog/2.3.0.md, CHANGELOG.md regenerated).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.33555% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/advanced/index.ts 0.00% 1 Missing ⚠️
src/advanced/wysiwyg/block.ts 99.61% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

tacxou and others added 2 commits November 20, 2026 17:49
Codecov flagged uncovered patch lines: ordered list conversion, unknown
actions and node types, invalid positions, a heading without level, a block
without rendered element and an unknown density in block mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tacxou
tacxou merged commit 26b0789 into main Nov 21, 2026
8 checks passed
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