feat(blocks-editor): paste pipeline + dnd-kit multi-select + document outline - #465
Merged
Conversation
Detects the clipboard source via class/attribute fingerprints (docs-internal-guid, ms-Office-/mso-, notion-) and dispatches to a per-source HTML-to-block converter. Markdown falls back to a tiny hand-rolled parser so we don't take a CommonMark dep just for paste. Generic HTML and plain-text paths cover the long tail. The exported onPaste(event) reads ClipboardData and returns a BlockTree the host can splice into the document; null means "nothing to convert, let the browser do its thing". Tests cover happy-path detection + conversion for each source, plus the onPaste integration over a hand-rolled ClipboardEvent stub. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Tayeb Mokni <tayeb.mokni@gmail.com>
Adds @dnd-kit/core + sortable + utilities and wires them into a new SortableBlockList that wraps a flat block-id list in a SortableContext. Each row carries a six-dot grip handle: plain click replaces the selection, Cmd-click toggles a row, Shift-click selects the inclusive range from the current anchor (Finder-style — the anchor doesn't move on range clicks). Selection state lives in a small SelectionProvider/useSelection context so the outline + list-view (next commit) share the same highlight set with the canvas. SortableBlockList mounts its own provider by default, or reuses the host's if `externalSelectionProvider` is set. Drag-end logic supports multi-drag: if the picked row is in the selection set, the whole bag moves as a group; otherwise it's a single arrayMove. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Tayeb Mokni <tayeb.mokni@gmail.com>
#111) Adds two side-panel components and a chrome-level integration: - <DocumentOutline>: tree view of core/heading blocks built via a single-pass level-aware stack walker (handles skipped levels, nested innerBlocks, malformed level attrs). Clicking a row fires onSelect(clientId) so the host can jump-scroll the canvas. - <ListView>: flat hierarchical tree of every block in the document. Hover emits onHover(id|null) so the canvas can mirror the hover highlight; selected rows get emerald, multi-selected siblings get a soft emerald tint. The chrome additions are the **single integration point** for all three P2 features (#213, #117, #111). editor-chrome.tsx grows by: - <OutlineToggle>: top-bar button to open/close the outline rail. - <EditorWorkspace>: composes <SelectionProvider>, the paste handler, the optional <SortableBlockList>, and the outline / list-view panels into a single layout. Pasting over the workspace routes through detectPasteSource + convertPaste from paste-handler.ts; reorders flow through <SortableBlockList>; the side panels share selection via the same context. The block-edit-canvas.tsx file is intentionally untouched — the admin app composes <EditorWorkspace> around it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Tayeb Mokni <tayeb.mokni@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #213, #117, #111.
Three editor UX additions:
Single integration point in editor-chrome.tsx mounts all three.
🤖 Generated with Claude Code