diff --git a/.changeset/canvas-viewer.md b/.changeset/canvas-viewer.md deleted file mode 100644 index 6f2d66a1782c..000000000000 --- a/.changeset/canvas-viewer.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@labre/affine': minor -'@labre/std': minor -'@labre/affine-shared': minor -'@labre/affine-block-code': minor ---- - -New entry `@labre/affine/canvas-viewer` (ADR 0050, ADR 0051): `mountCanvasViewer(host, state, options)` shows a stored canvas, read-only, on a host's public page. It is the edgeless editor itself on a read-only store, built from the view registry plus the host's own providers (`viewExtensions`: each framework bundle's view extensions, which the published core leaves to the bundles) minus the tooling listed in `READ_ONLY_EXCLUDED_VIEW_EXTENSIONS` and `READ_ONLY_EXCLUDED_EXTENSIONS` (exported from `@labre/affine/extensions/view` with `getReadOnlyViewProviders`); a guard spec proves no excluded entry paints content. The editor pans and zooms as it does for a read-only document. A page link goes to `onOpenDoc(docId)`, an external one to `onLinkClick(url)` after `isSafeLinkUrl`, with the main or the middle button (without `onLinkClick`, a click navigates the page and a middle click opens a new tab, `noopener`; a frozen view follows no link with either); `getBlob` feeds images; `docTitles` names the other pages. `focus: { kind: 'frame' | 'group', id }` shows one element the way a surface reference shows it in a page, frozen by default (`interactive`) with `onExpand` on a click or Enter. It returns `{ zoomIn, zoomOut, fit, dispose }` and imports the whole view graph (3.65 MB gzipped): load it with a dynamic `import()`. - -It holds under a strict Content-Security-Policy (no `'unsafe-inline'` style, no `'wasm-unsafe-eval'`): new `adoptShadowlessStyles()` (`@labre/std`) moves light-DOM styles to adopted style sheets, new `adoptEmotionStyles()` (`@labre/affine-shared/styles`) does the same for the library's own emotion instance (key `labre`, so its classes read `labre-…`; the table and database blocks now use it, and a host's `@emotion/css` is never touched, its rules still inserted as before), new `CodeBlockConfig.engine: 'oniguruma' | 'javascript'` (default `oniguruma`) highlights code without WebAssembly, and the paragraph block's in-template `