Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
ab27506
feat(edgeless): build a mind map with no editor, text measurement inj…
Nov 10, 2026
bb75335
fix(edgeless): bound a built mind map's text and wrap long words in l…
Nov 10, 2026
65767d7
chore(edgeless): regenerate the architecture map for the mind map bui…
Nov 10, 2026
b9b1c58
test(edgeless): read node boxes through the surface in the mind map p…
Nov 10, 2026
14cdacd
fix(edgeless): draw the canvas viewer under a strict content security…
Nov 10, 2026
78416b6
fix(edgeless): settle synced docs of named pages and follow only the …
Nov 10, 2026
13357b1
fix(blocks): keep emotion's rules out of a style element a strict pol…
Nov 10, 2026
70e5257
feat(edgeless): make the canvas viewer the editor itself, derived fro…
Nov 10, 2026
b3d0470
test(edgeless): paint the canvas viewer in a browser under a strict p…
Nov 10, 2026
aa0d642
fix(edgeless): viewer guard reads the mounted list, keys and clicks a…
Nov 10, 2026
50664cd
Merge remote-tracking branch 'origin/blocksuite-labre-main' into feat…
Nov 12, 2026
e97977c
chore(edgeless): regenerate the architecture map after the merge
Nov 12, 2026
d7f2d34
fix(database): read a malformed cell as its property default
Nov 12, 2026
a66a21c
fix(blocks): keep a fractional index key before its next neighbour
Nov 12, 2026
6d1f01e
feat(blocks): open the icon picker outside an editor from a public entry
Nov 12, 2026
6503e18
fix(blocks): keep the canvas selection when a table selects or clears
Nov 12, 2026
86eda11
fix(blocks): keep the start number of a numbered list on export
Nov 12, 2026
02a15cb
fix(edgeless): wrap a built mind map's text exactly as the editor does
Nov 12, 2026
730ca5b
test(edgeless): guard the mind map style colour past the palette
Nov 12, 2026
5247d70
feat(playground): build a mind map with no editor from the debug menu
Nov 12, 2026
918df2c
chore(playground): regenerate the architecture map for the mind map r…
Nov 12, 2026
ec83bf3
fix(edgeless): show a focused frame's title badge in the canvas viewer
Nov 12, 2026
b7952a6
test(edgeless): paint the canvas viewer under the site's own policy
Nov 12, 2026
4cb4426
docs: tell a host what a strict policy needs from the canvas viewer
Nov 12, 2026
9cb0812
feat(playground): open the document in the canvas viewer
Nov 12, 2026
f30fdd1
fix(blocks): flip the code toolbar wrap and line-number switches once
Nov 12, 2026
de965d5
fix(database): draw a blank select option as untitled
Nov 12, 2026
cfd83e2
test(edgeless): report the stage a framed canvas viewer stalls at
Nov 12, 2026
15c1284
fix(playground): keep the canvas viewer page's status off window.status
Nov 12, 2026
1020225
chore: refresh the architecture map for the canvas viewer
Nov 12, 2026
27ad2e4
fix(database): open a document row from a read-only desktop view
Nov 12, 2026
0256ac4
chore(database): refresh the architecture map for the tag label
Nov 12, 2026
4508572
fix(edgeless): ignore a pinch step whose fingers started on one point
Nov 12, 2026
73d8e84
fix(edgeless): name a frozen canvas view and repaint it when page fon…
Nov 12, 2026
d7d63f7
docs: say the canvas viewer repaints when the page's fonts load
Nov 12, 2026
56549a5
fix(blocks): keep a native modal dialog open when escape closes the i…
Nov 12, 2026
93d6697
fix(blocks): flip a menu toggle row once per click
Nov 12, 2026
ade058f
fix(blocks): bound the steps moving a fractional index key towards b
Nov 12, 2026
7d642d1
fix(blocks): write no list start past nine digits
Nov 12, 2026
c959280
fix(database): open a read-only kanban card from its cells
Nov 12, 2026
40f98a9
test(blocks): leave the column select-and-clear case to the unit spec
Nov 12, 2026
a1455f1
test(blocks): drop the words path from the code toggle unit spec
Nov 12, 2026
7e6fb0e
docs(edgeless): say why the export options menu rebuilds its rows
Nov 12, 2026
bab59d4
refactor(edgeless): carry the palette values in the library's theme
Nov 12, 2026
de28885
fix(blocks): keep the random postfix past the fractional index step b…
Nov 12, 2026
8004e3b
test(edgeless): drop a duplicate type check and a repeated comment
Nov 12, 2026
54a9907
fix(blocks): give a menu toggle row's focus back after a switch click
Nov 12, 2026
0069e9d
fix(blocks): give the library an emotion instance of its own
Nov 12, 2026
a140c46
fix(edgeless): deny the pages a canvas viewer is not given, free its …
Nov 12, 2026
c327fd2
docs: canvas viewer pages, host seams and emotion instance
Nov 12, 2026
4c08e54
fix(database): decide a kanban card's read-only open at the click
Nov 12, 2026
8c1aafa
fix(blocks): bound the last list number, not the start, on export
Nov 12, 2026
3e69def
chore: refresh the architecture map for the viewer's styles module
Nov 12, 2026
0179f24
docs(blocks): say why the fractional index fallback guard is required
Nov 12, 2026
3213bdc
fix(database): keep a read-only kanban card from opening a row twice
Nov 12, 2026
e6998e3
fix(edgeless): read the host's translation in the canvas viewer's own…
Nov 12, 2026
fe62de7
chore: refresh the architecture map after the viewer translation fix
Nov 12, 2026
aa5c39c
fix(playground): show the interactive canvas viewer across the whole …
Nov 12, 2026
54bf8cd
fix(page): store the outline type-icon switch's own value
Nov 12, 2026
c89de83
docs: record the unpushed host-session work and the browser-start fal…
Nov 12, 2026
bbb78fc
fix(database): read a malformed data-view cell as its column default
Nov 12, 2026
7385047
fix(blocks): refuse an oversized fractional index key with a named error
Nov 12, 2026
83af34d
fix(blocks): keep a shadow-held portal open on a click inside it
Nov 12, 2026
1982460
fix(blocks): count only list items when importing an html start number
Nov 12, 2026
33d8b68
fix(edgeless): cache a canvas character's width by the whole character
Nov 12, 2026
44335e0
docs(database): record the virtual table's missing row open button
Nov 12, 2026
09c9e1c
test(blocks): take every deep shadow query from the shared helper
Nov 12, 2026
b1c6ce3
feat(blocks): unify the emoji picker on the callout's emoji-mart picker
Nov 12, 2026
549b801
fix(blocks): write list markers in plain text
Nov 12, 2026
eb08a8e
fix(blocks): keep frequently used for every emoji picker after one wi…
Nov 12, 2026
945e2b0
fix(database): give a duplicated column its own option ids
Nov 12, 2026
1bc03d0
fix(edgeless): follow a middle click in the canvas viewer through its…
Nov 12, 2026
a49fc3f
fix(blocks): open no emoji picker on a read-only callout
Nov 12, 2026
e37de3f
fix(database): keep a rich-text cell stored as a string in a data-view
Nov 12, 2026
1367140
fix(database): keep a rich-text cell stored as a string
Nov 12, 2026
9d7d485
fix(blocks): name the fractional index stack overflow instead of boun…
Nov 12, 2026
47901a7
fix(blocks): separate copied blocks by a newline in plain text
Nov 12, 2026
d000e2c
fix(database): drag-to-fill a rich-text cell stored as a string
Nov 12, 2026
5e4f935
fix(blocks): name the fractional index overflow on firefox too
Nov 12, 2026
9b1226e
fix(edgeless): drop the canvas viewer's auxclick branch for other but…
Nov 12, 2026
de75035
refactor(blocks): move the list start number rule to affine-shared
Nov 12, 2026
66f812d
fix(blocks): copy the text alone from inside one list item
Nov 12, 2026
0de5685
Merge branch 'fix/fractional-index-between' into recette/2026-11-12
Nov 12, 2026
e5fcb33
Merge branch 'fix/list-export-start' into recette/2026-11-12
Nov 12, 2026
d1cb264
Merge branch 'fix/database-cell-default' into recette/2026-11-12
Nov 12, 2026
4163d80
Merge branch 'fix/select-tag-blank-name' into recette/2026-11-12
Nov 12, 2026
7fb6da6
Merge branch 'fix/database-readonly-row-open' into recette/2026-11-12
Nov 12, 2026
9d43478
Merge branch 'fix/table-selection-keeps-canvas' into recette/2026-11-12
Nov 12, 2026
2a56c1c
Merge branch 'fix/code-toggle-double' into recette/2026-11-12
Nov 12, 2026
1d2f5d2
Merge branch 'fix/menu-toggle-row' into recette/2026-11-12
Nov 12, 2026
91f4f67
Merge branch 'feat/icon-picker-standalone' into recette/2026-11-12
Nov 12, 2026
e4a9135
Merge branch 'feat/unified-emoji-picker' into recette/2026-11-12
Nov 12, 2026
08aa090
Merge branch 'feat/mindmap-headless-builder' into recette/2026-11-12
Nov 12, 2026
babac7d
Merge branch 'feat/canvas-viewer-editor' into recette/2026-11-12
Nov 12, 2026
3235c76
Merge branch 'fix/data-view-cell-default' into recette/2026-11-12
Nov 12, 2026
5bb7118
Merge branch 'fix/database-duplicate-property-options' into recette/2…
Nov 12, 2026
3586ae2
Merge branch 'fix/outline-setting-toggle' into recette/2026-11-12
Nov 12, 2026
4f5d947
Merge branch 'fix/portal-click-away-composed' into recette/2026-11-12
Nov 12, 2026
bff0877
Merge branch 'fix/text-char-width-codepoint' into recette/2026-11-12
Nov 12, 2026
e2c578e
Merge branch 'fix/list-html-import-order' into recette/2026-11-12
Nov 12, 2026
406824a
Merge branch 'fix/plain-text-list-markers' into recette/2026-11-12
Nov 12, 2026
d1d7c97
Merge branch 'fix/plain-text-block-separator' into recette/2026-11-12
Nov 12, 2026
a94136b
Merge branch 'docs/lessons-3-5-0' into recette/2026-11-12
Nov 12, 2026
bbbfb00
chore: refresh the architecture map for the recette merge
Nov 12, 2026
7cb87b5
chore(blocks): drop the switch click stop the toggle fix made redundant
Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .changeset/canvas-viewer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
'@labre/affine': minor
'@labre/std': minor
'@labre/affine-shared': minor
'@labre/affine-block-code': minor
---

New entry `@labre/affine/canvas-viewer` (ADR 0050): `mountCanvasViewer(host, state, options)` mounts a read-only canvas from a stored Y.Doc state, with no editor around it, for a host's public page. It pans (drag, wheel, two fingers), zooms (ctrl+wheel, trackpad pinch, two fingers) and follows links: a page link goes to `onOpenDoc(docId)`, an external one to `onLinkClick(url)` after `isSafeLinkUrl`; `getBlob` feeds images. It returns `{ zoomIn, zoomOut, fit, dispose }` and fits once at mount. `focus: { kind: 'frame' | 'group', id }` shows one element the way a surface reference shows it in a page (its proportions, its bounds, a frame without its border); with it the view is frozen by default (`interactive`), lets the page scroll, and calls `onExpand` on a click or Enter so the host can open the same `focus` with `interactive: true`. It imports the whole view graph (3.65 MB gzipped, browser ESM): load it with a dynamic `import()`. The wheel and pinch maths of the edgeless root moved to `zoomAtPointer`, `panByWheel` and `pinchStep` (`@labre/affine-block-root`), shared by both; the editor's behaviour does not change.
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 `<style>` moved to its static styles. The editor keeps `<style>` elements unless a host calls the two functions, which importing `@labre/affine/canvas-viewer` does for the whole page: load the viewer on a page without the editor.

A frozen frame shows its title badge above it, as the editor draws it: its `aspect-ratio` includes the badge's strip. `CommunityCanvasTextFonts` is also exported from `@labre/affine/canvas-viewer`; the viewer loads no face itself and paints the canvas again whenever the page's own faces finish loading (`document.fonts` `loadingdone`). A frozen view's button is named `com.labre.canvas-viewer.open-titled` ("Open canvas: {{title}}"), or `com.labre.canvas-viewer.open` ("Open canvas") for an element with no title. A page `docTitles` leaves out (unshared, private or deleted: the viewer cannot tell) is named "Access denied" (`com.labre.canvas-viewer.access-denied`, `com.labre.canvas-viewer.access-denied.description`) in references and linked or synced doc cards, shows no synced content, and opens nothing: `onOpenDoc` only receives pages of `docTitles`, still as untrusted input. Links and embeds render as their author placed them; a host gives the viewer its link preview service and image proxy in a provider of `viewExtensions`, or the public defaults apply as in the editor. A key stopped inside the viewer no longer leaves its pointer and wheel paused. The two-finger pinch of the edgeless editor, which the viewer runs, ignores a step whose fingers started on the same point instead of zooming to infinity. Under `default-src 'none'; script-src 'self'; style-src 'self'; font-src 'self'` the viewer still raises one `style-src-attr` report per icon (the `style` string `@blocksuite/icons` binds, whose declarations the viewer's sheet carries) and one `img-src` report (a `data:` drag image preloaded at import), neither visible (`docs/integrate/09-static-html.md`).
4 changes: 2 additions & 2 deletions architecture/domain.c4
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ model {
extend assembly.all.src {
metadata {
domain ['canvas']
domain_canvas '0.18'
domain_canvas '0.17'
}
}
extend assembly.all.store {
Expand Down Expand Up @@ -581,7 +581,7 @@ model {
extend features.blocks.root {
metadata {
domain ['canvas', 'file']
domain_canvas '0.51'
domain_canvas '0.50'
domain_file '0.15'
}
}
Expand Down
25 changes: 22 additions & 3 deletions docs/adr/0050-read-only-canvas-viewer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ADR 0050 — A read-only canvas viewer a host mounts from a Y.Doc state

- Status: accepted (2026-11-08, built as amended below)
- Status: accepted (2026-11-08, built as amended below); superseded in part
by [0051](0051-read-only-viewer-is-the-editor.md) (2026-11-10): the viewer
mounts the edgeless editor on a read-only store, not the preview scope
- Date: 2026-11-05
- Deciders: Mathieu Jolly
- Host side, never restated here: Labre Sites (labre ADR-0069), public pages
Expand Down Expand Up @@ -92,6 +94,7 @@ export function mountCanvasViewer(
focus?: { kind: 'frame' | 'group'; id: string };
interactive?: boolean; // defaults to !focus
onExpand?: () => void;
docTitles?: Readonly<Record<string, string>>;
}
): { zoomIn(): void; zoomOut(): void; fit(): void; dispose(): void };
```
Expand All @@ -117,9 +120,25 @@ export function mountCanvasViewer(
the larger view by mounting the same `focus` with `interactive: true`, as the
editor opens the referenced canvas. The "Expand" button is the host's: the
viewer still displays no library string.
- `docTitles` names the other pages for page references and linked doc
cards; a page left out shows as deleted, as in the editor.
- It holds under a public page's strict Content-Security-Policy (`style-src`
without `'unsafe-inline'`, `script-src` without `'wasm-unsafe-eval'`), checked
in a browser on 2026-11-10 against a release candidate that drew nothing:
`adoptShadowlessStyles()` (`@labre/std`) moves every light-DOM style from
`<style>` elements to adopted sheets, which the editor keeps off; the
viewer's own rules and emotion's (tables, databases) go to adopted sheets
too; code blocks highlight with shiki's JavaScript engine
(`CodeBlockConfig.engine`), not WebAssembly; the paragraph's in-template
`<style>` moved to its static styles; the file drop is not mounted. Two
reports remain and change nothing on screen: emotion's own `<style>`, created
at import before any viewer exists, and the `style` attribute
`@blocksuite/icons` binds on its icons, whose two declarations the viewer's
sheet carries. A click resolves its link from the elements under the
pointer, since a note's mask covers its content.
- The light theme is set as custom properties on the viewer's container only.
- §4 shipped as `utils/wheel-gesture.ts` in `blocks/root` (`zoomAtPointer`,
`panByWheel`, `pinchStep`), called by the edgeless root and the viewer.
- §4 shipped as `utils/wheel-gesture.ts`, then was dropped by ADR 0051: the
viewer now runs the editor's own handlers and has none to share.
- Events: one-finger or mouse drag pans, two fingers pinch, ctrl+wheel and a
trackpad pinch zoom, a plain wheel pans; every pointer, wheel and click
event stops on the viewer's container in capture, so no block reacts.
Expand Down
152 changes: 152 additions & 0 deletions docs/adr/0051-read-only-viewer-is-the-editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# ADR 0051 — The read-only viewer is the editor, mounted read-only, derived from the registry

- Status: **accepted** (2026-11-10)
- Deciders: Mathieu Jolly (PO principle, Labre Sites acceptance of 2026-11-10)
- Supersedes in part: [0050](0050-read-only-canvas-viewer.md), its decision to
mount the `preview-edgeless` scope and to add pan, zoom and links by a runtime
extension. 0050's entry point, sub-path and host contract stand.
- Related ADRs: [0009](0009-reversed-flag-contract.md) (a flag never gates
content), [0035](0035-core-database-bundle-and-panel-seams.md) (the database chrome
ships apart).

## Context

The PO's principle, verbatim: « Cet éditeur doit être un miroir de l'éditeur
interactif, c'est presque un fork quelque part. D'ailleurs ce serait bien qu'il
soit autogénéré par la lib elle-même pour qu'on n'ait pas à penser sa
maintenance alors que l'éditeur interactif est modifié. »

ADR 0050 mounted the `preview-edgeless` scope, a picture, and gave it back
pan, zoom and link clicks with its own handlers. That is a second interaction
layer that drifts from the editor's (the editor's wheel and pinch maths had to
be extracted to be shared), and the preview scope only shows what each
provider chose to register for previews. 0050 rejected the full `edgeless`
scope because "the clipboard, the toolbars and the widgets would each have to
be proven inert on a public page".

What the code says since:

- On a read-only store the edgeless root takes the pan tool
(`edgeless-root-block.ts`, `this.store.readonly`): a drag, the wheel, two
fingers and the pinch move the canvas with the editor's own handlers.
- Every write goes through the store, which refuses it when read-only.
- What a public page must not show is a short, nameable set of providers:
editing widgets, panels, collaboration, telemetry.

## Decision

`mountCanvasViewer` mounts the `edgeless` scope of:

```
getInternalViewExtensions() // the registry, every flag on
+ host providers // what the host adds for its editor
− READ_ONLY_EXCLUDED_VIEW_EXTENSIONS
```

then drops the single extensions in `READ_ONLY_EXCLUDED_EXTENSIONS`, on a
store opened `readonly`. Both lists live in `extensions/view.ts`, beside the
registry, and nowhere else:

- telemetry and the AI audit: `CommandTelemetry`, `CommandUsage`, `Audit`;
- editing widgets: drag handle, auto-connect, dragging areas, selected rect,
edgeless toolbar, zoom toolbar, keyboard toolbar, linked-doc menu, note
slicer, scroll anchoring, slash menu, toolbar;
- collaboration: remote selection, thread marks;
- panels: adapter panel, doc title, frame panel, outline;
- one extension inside a kept provider: the file drop, whose indicator lives
in `<body>`.

A provider added to the registry reaches the viewer without touching it. The
viewer keeps only the host's integration: links (a note's mask covers its
content, so a click is resolved from the elements under the pointer), the
frozen view of an inserted frame, framing, the light theme, and holding under
a strict Content-Security-Policy (`adoptShadowlessStyles`,
`adoptEmotionStyles`, shiki's JavaScript engine).

**The host's providers.** The published core leaves each framework to its own
bundle (`scripts/build-bundles.mjs` strips them from core's `view.ts`), so the
viewer takes `viewExtensions`: the same providers the host gives its editor
(each `descriptor.extensions[].viewExtension`, the database chrome). Without
them a framework's notation is not painted.

**The guard.** `read-only-view.unit.spec.ts` reads, in a real DI container,
what the editor and the viewer register, by identifier. It fails when an
excluded provider or extension registers content (a block view, a canvas
element's view or renderer), when the editor registers something the viewer
lacks without it being excluded, and when an exclusion is stale.

## Consequences

- The wheel and pinch extraction 0050 §4 asked for is dropped: the viewer has
no handler of its own to share them with. The editor's root is unchanged.
- The viewer is as heavy as the editor (3.65 MB gzipped, browser ESM); a host
loads it with a dynamic `import()`. 0050's measure stands.
- A frozen view locks the viewport and makes the editor host `inert`; the
wheel and touch then scroll the page.
- The library keeps no per-line deviation log ([0001](0001-assumed-divergence-from-upstream.md)
records the divergence as a whole): this ADR is the record.

## Open questions

- A widget that registers with a kept block provider (the code block's
toolbar, a framework's validation widgets) is part of the viewer. It is read
only on a read-only store; if one shows editing chrome on a public page, it
joins `READ_ONLY_EXCLUDED_EXTENSIONS` and the guard proves it paints no
content.

## Amendment 2026-11-12 — measured under the site's own policy; the frame's badge

- `canvas-viewer-csp.spec.ts` runs under Labre Sites' policy as the site sends
it: `default-src 'none'; script-src 'self'; style-src 'self'; font-src 'self'`,
no `style-src-attr`, no `'wasm-unsafe-eval'`. It ran before with
`style-src-attr 'unsafe-inline'`, so it could not see an attribute report. It
waits until the shape is painted rather than a fixed delay, and its page holds
a frame with a shape, a linked-doc card, a note of formatted text and a note
shown in the page only.
- Measured there, on the whole canvas and on the frozen frame alike: no
`<style>` element and no `style-src-elem` report from the library (emotion's
`<style>`, which 0050's amendment still listed, is gone: the viewer adopts
before emotion's first flush), one `style-src-attr` report per icon drawn,
and one `img-src` report. The spec fails on any other.
- The icons: `@blocksuite/icons` binds `user-select:none;flex-shrink:0;` and
its caller's declarations as a `style` string. The viewer's adopted sheet
carries them (`vertical-align: middle` for a page reference's icon, inline
in its text, now included); `font-size: inherit` is what an `svg` does
anyway, and the subpage icon's `margin-bottom: 0.1em` stays dropped.
- The image: `@atlaskit/pragmatic-drag-and-drop` preloads a 1×1 `data:` gif,
its native drag image, when `@labre/std`'s drag and drop module is
imported. Nothing is dragged on a read-only page. Removing it means
deferring that preload in `@labre/std` for the editor too; not done.
- The 48 `style-src-attr` reports the site saw on a release candidate in a
frozen frame do not reproduce here. Every style the library writes on that
path goes through the CSSOM (`@labre/global/lit`'s `styleMap`, the viewer's
container), which no policy checks; an attribute set as a string, or a
cloned element carrying one, is what a policy reports.
- A frozen frame with a title shows its title badge as the editor draws it,
above the frame's top edge: the view keeps a strip of the badge's height
(28px) above the frame, its `aspect-ratio` adds that strip in model units for
the current width, and is read again on each resize. The frame stays edge to
edge across the width. The guard spec names the frame-title widget among the
viewer's and the editing toolbars outside it.
- `CommunityCanvasTextFonts` is re-exported from `@labre/affine/canvas-viewer`,
for a public page that serves the faces itself and needs that entry only.
The viewer registers no font list.
- Links and embeds render as their author placed them (PO decision of
2026-11-12: an author who shares an external link means it to be seen),
through the editor's seams: a host gives the viewer its link preview
service (`di.override`) and its image proxy (a `LifeCycleWatcher` calling
`setImageProxyURL`, the proxy being a store extension) in a provider of
`viewExtensions`, or the public defaults apply. Tested with a bookmark that
stores no metadata.
- A page `docTitles` leaves out may be unshared, private or deleted; the
viewer cannot tell, so it says "Access denied" where the editor says
deleted (`com.labre.canvas-viewer.access-denied` and its `.description`),
by wrapping the host's translation, and a click on it opens nothing.
- The library's emotion rules come from an instance of its own (key
`labre`), inserted synchronously as before; the viewer adopts them from a
module it imports first, before any block module evaluates. A first version
patched `@emotion/css`'s default instance, shared with a host, and deferred
every rule.
- A key's pause of the viewer's dispatcher also ends on the next task: a
listener that stopped the key's propagation left the wheel and the drag
dead.
3 changes: 2 additions & 1 deletion docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ One file per decision. Format and lifecycle in
| [0047](0047-html-block-frame-served-by-the-host.md) | Html block frame served by the host | proposed, block retired | The html block may run in a page its host serves, through one seam; without it, `srcdoc`. The handshake is `postMessage`, on the frame's request. |
| [0048](0048-html-attachment-and-shared-frame.md) | Html attachment and shared frame | proposed, amended | An html file is an attachment; one component runs html; without a host's page it stays a card; a thumbnail is a real preview scaled down. |
| [0049](0049-bpmn-pool-title-sizes.md) | BPMN pool title sizes | accepted | Two optional fields on `bpmnPool`, `nameFontSize` / `laneFontSize` (absent = 15 / 13); a `sizeProp` on the background primitive's texts; not written to the `.bpmn` export. |
| [0050](0050-read-only-canvas-viewer.md) | Read-only canvas viewer | accepted | One exported mount over the preview scope, no new scope and no new bundle; pan, zoom and links added by one runtime extension. |
| [0050](0050-read-only-canvas-viewer.md) | Read-only canvas viewer | superseded in part (0051) | One exported mount over the preview scope, no new scope and no new bundle; pan, zoom and links added by one runtime extension. |
| [0051](0051-read-only-viewer-is-the-editor.md) | Read-only viewer is the editor | accepted | The viewer is the edgeless editor on a read-only store: the registry plus the host's providers, minus one exclusion list beside it, held by a DI guard. |

Related documents that are not ADRs:

Expand Down
Loading