feat(renderer)!: multi-page canvas with bounded layout output (3.0.0)#35
Merged
Conversation
BREAKING CHANGE: renderCanvas no longer emits chrome / grid / labels.
The renderer now produces a single bounded `<div class="wf-canvas">` of the
exact layout extent containing absolutely-positioned `<div class="wf-canvas-board">`
wrappers. Hosts (dashboard infinite-canvas viewer, markdown-plugin, vscode-extension,
SVG export) are responsible for chrome, grid, pan-zoom, and labels.
Removed:
- `CanvasChrome` type and `chrome` / `canvasBackground` options on `CanvasOptions`
- chrome routing in `render()` / `renderToSvg()`
Added:
- `page "X" at(x, y) { ... }` grammar — canvas coordinates resolved into
`Page.x` / `Page.y` for explicit placement; pages without `at(...)` auto-flow
horizontally with configurable gap (default 64px)
- `renderPage(page)` — pure single-page export primitive
- `renderCanvas(doc, opts?)` — multi-page composition (gap-only options)
- `layoutCanvas(pages, gap?)` — pure utility that returns `{ placed, width, height }`
so hosts can compose their own DOM
- `PlacedPage` public type
- `data-page-x` / `data-page-y` / `data-page-w` / `data-page-h` /
`data-page-title` attributes on each board for host-DOM communication
Migration:
- `renderCanvas(doc, { chrome: 'editor' })` → `renderCanvas(doc)` and let the host
apply its own chrome (Figma-style grid is the dashboard editor's responsibility)
- `chrome: 'preview'` consumers (markdown-plugin, vscode-extension preview)
already work — they don't pass `chrome` and now receive bare bounded layout
Manually setting package.json to 3.0.0 caused release-it to compute 3.0.0 + BREAKING -> 4.0.0-beta.0 instead of the intended 2.8.0 -> 3.0.0-beta.0. Restoring to 2.8.0 so release-it can auto-bump from the actual prior release.
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.
Summary
renderCanvasno longer emits chrome / grid / labels. Output is a single bounded<div class="wf-canvas">containing absolutely-positioned<div class="wf-canvas-board">wrappers. Hosts (dashboard infinite-canvas viewer, markdown-plugin, vscode-extension, SVG export) own chrome, grid, pan-zoom, and labels.page "X" at(x, y) { ... }grammar — explicit canvas placement; pages withoutat(...)auto-flow horizontally with configurable gap (default 64px).renderPage(page)(single-page export),renderCanvas(doc, opts?)(multi-page composition),layoutCanvas(pages, gap?)(pure utility for hosts to compose their own DOM).PlacedPagetype exported.data-page-x/data-page-y/data-page-w/data-page-h/data-page-titleattributes for host-DOM communication.2.8.0→3.0.0.Migration
renderCanvas(doc, { chrome: 'editor' })→renderCanvas(doc)— host applies its own chrome (Figma-style grid is the dashboard editor's responsibility, landing in a follow-up PR).chrome: 'preview'consumers (markdown-plugin, vscode-extension) already work — they don't passchromeand now receive bare bounded layout.CanvasChrometype andchrome/canvasBackgroundoptions onCanvasOptionsare removed.Test plan
pnpm test— 639/639 tests passing locallypnpm build— TypeScript + DTS build cleantsc --noEmit— clean@wireweave/coreto^3.0.0in dependent repos viascripts/update-core-deps.shapi-server/src/services/guide.tslines 545/547/549 (chrome guide strings) — affected scope already audited (only api-server has chrome-related guide text; markdown-plugin / vscode-extension / dashboard / admin / examples / ux-rules / language-data are clean)🤖 Generated with Claude Code