v1.40.0
Now I have enough context. Let me write the release notes based on the actual changes:
What's New
- Textbox content editing β Click, type, and edit text inside VML and DrawingML textboxes. Selection, caret rendering, and text updates work across body, header/footer, and table cell contexts.
- Zoom modes and fit-width β Set zoom as
manualorfit-width(auto-fit to container).ui.zoomexposes mode, value, calculated fit-zoom, bounds, and viewport metrics; PDF documents measure at their rendered scale. - Viewport metrics and responsive layout events β
viewport-changeevent fires on container resize with measurements (document width, available width, fit-zoom). Consume viewport metrics fromgetViewportMetrics()to implement responsive zoom without polling. - Font family combobox β Typeahead-enabled font picker in toolbar with per-document font options and substitution evidence (metric-safe vs. visual-only); dropdown stays in viewport.
- Comments API expansion β
ui.comments.setActive()highlights a comment without scrolling;pendingSelectionon pending comment events gives consumers the captured selection to pass to comment creation APIs. - Text range viewport targets β
ui.viewport.getRect()now accepts Document API text targets (addresses and segments), resolving to painted DOM rects for custom overlay and floating-UI anchoring. - Scroll container exposure β
ui.viewport.getScrollContainer()returns the actual scrollable ancestor (or null for document/window scroll), letting overlay consumers attach scroll listeners to the right element. - Sidebar geometry signals β
ui.viewport.observefires when the comments rail opens/closes, invalidating cached viewport geometry. - TOC interactions β Hover highlighting and section-link navigation for table of contents.
Improvements
- Column balancing at continuous breaks β Multi-column sections now balance correctly at continuous section breaks, matching Word's layout. Explicit column widths (equal or unequal) and per-column spacing extract accurately.
- Tracked change granularity β Inline cell changes within a whole-table tracked change consolidate into one logical change in the review API (groupTrackedChanges), mirroring the comments containment rule.
- Line break handling in mutations β Generated newlines in text-mode mutations serialize as Word-native
<w:br/>elements; read model treats lineBreak nodes as\nso search/query/rewrite stay consistent. - Caret geometry for tabs and soft breaks β Tab carets anchor to line top; soft-break continuation carets position at line start with alignment-aware offset instead of the page right edge.
- Page break suppression β Style-driven pageBreakBefore directly after an explicit page break no longer renders a redundant blank page, matching Word's structural rule.
- Textbox table content rendering β Tables inside textboxes render with correct alignment and text flow.
- Plan-engine block identity repair β Runtime self-healing of duplicate block identities on compile, preventing stale cross-document references.
- Font substitution evidence β Font reports carry per-face evidence (metric-safe, visual-only, glyph exceptions) from the docfonts registry, giving consumers the fidelity detail behind each substitution.
Fixes
- Table cell selection collapse β Dragging a body selection into an empty table cell no longer collapses the selection; prosemirror-tables normalization guard keeps the extended range.
- Multiline selection rendering β Interior lines of multi-line selections now render the full width highlight instead of slivers; per-line rect computation handles absolutely-positioned
.superdoc-lineelements across browsers. - Empty cell geometry β Empty table cell paragraphs (no runs) resolve to their PM start instead of null, preventing frozen selections during active drags.
- Image alpha export β Process alphaModFix for images on export, preserving transparency properties.
- Text selection in generated lineBreak contexts β Search and offset resolution now treat lineBreak nodes as
\n, so a match spanning text+lineBreak+text coalesces to one contiguous range. - Font toolbar updates β Document font toolbar rebuilds and layout re-renders on fonts-changed events; dropdown state persists through editor handoff.
- UV-deprecated legacy visual testing infrastructure β Removed
/devtools/visual-testing; layout validation now runs in the standard test suite.