Skip to content

HAR-6913 - super-editor: strikethrough and underline #8

Merged
harbournick merged 1 commit intosuper-editorfrom
HAR-6913_super-editor
Jun 19, 2024
Merged

HAR-6913 - super-editor: strikethrough and underline #8
harbournick merged 1 commit intosuper-editorfrom
HAR-6913_super-editor

Conversation

@mattConnHarbour
Copy link
Contributor

(previously this pr: #7)

Thanks for teeing this up :)
This branch comes from Artem's branch, so I'm using his as the trunk.

fyi: I had some issues with this line in packages/super-editor/src/extensions/Comments/comments.js :
import { v4 as uuidv4 } from 'uuid';
I think we might need to change it to uuidv4? But I see this is imported as uuid everywhere else so maybe it's just a problem for me?

@harbournick harbournick merged commit 94979c0 into super-editor Jun 19, 2024
@harbournick harbournick deleted the HAR-6913_super-editor branch August 23, 2024 22:43
tupizz added a commit that referenced this pull request Mar 20, 2026
- Q&A tests (#8, #9, #10): replaced false-positive fixture data checks
  with tool_usage assertions (verify model actually called search/read)
- Glossary test: now checks definitions were added, not just heading
- List comments test: now verifies comment list action was called
- Enrollment update: added collateral check for City Medical Center
- Lease tracked rent: added missing traceAllOk
- Lease comment: added missing tool_usage check for comment tool
harbournick pushed a commit that referenced this pull request Mar 20, 2026
* fix(sdk): hide story scope and comment flat params from agent tools

- Hide `in` param from all tools (body is default scope, model guessed wrong values)
- Exclude `blockId`/`start`/`end` from superdoc_comment create/patch
- Apply PARAM_EXCLUSIONS to extra CLI params (not just schema-derived)
- Add comment creation workflow to system prompt (search then pass ref)
- Add rules: plain text search, refs expire after mutations, use require:all

* chore: update document API and evaluation suite

- Regenerate the manifest with updated source hash.
- Enhance comment schema to clarify parent comment ID usage.
- Add new customer workflow tests for NDA and lease agreements.
- Introduce new document fixtures for testing.
- Update evaluation README for improved clarity on execution flow and quick start instructions.
- Refactor SDK tools to include additional methods for handling different tool types.

* fix(sdk): only annotate minority-scoped params with "Only for action"

Params appearing in most actions (>50%) should not get "Only for" annotations.
The previous version annotated target/ref on superdoc_edit as "Only for
insert, replace, delete" which caused the model to avoid them and use flat
params instead, causing regressions.

* fix(sdk): remove parentCommentId from agent comment tool schema

Models see the field, fill it with "", and the API rejects it.
The only reliable fix is to remove it from the schema entirely.
Replies are rare in agent workflows — can re-expose later with
proper guidance if needed.

* fix(sdk): strip empty strings in tool dispatch instead of hiding params

Revert parentCommentId exclusion — the field is useful for replies.
Instead, strip empty-string values in dispatchSuperDocTool before
dispatch. LLMs fill optional string fields with "" instead of
omitting them; this silently drops those values so the API doesn't
reject them.

* chore: update comment schema and regenerate manifest

- Enhanced the comment schema for improved clarity on input fields.
- Regenerated the manifest with a new source hash to reflect recent changes.

* feat(sdk): embed style workflow hints in tool descriptions

Tool descriptions are always sent to the LLM regardless of system
prompt. Developers don't control the system prompt, but tool
definitions always reach the model.

- superdoc_create: "New content uses default style. Follow up with
  superdoc_format set_style to match existing formatting."
- superdoc_format: explains inline vs set_style actions
- styleId param: describes common values and how to discover them

* chore: update comment schema and enhance documentation

- Improved clarity in the comment schema input fields.
- Updated descriptions for `parentCommentId` and `styleId` parameters to provide better guidance.
- Regenerated the manifest with a new source hash to reflect recent changes.

* feat(document-api): add styleId to create and styles to info

Two features that work together for style-aware content creation:

1. `create.paragraph` and `create.heading` now accept an optional
   `styleId` parameter. The paragraph node already supports
   `paragraphProperties.styleId` from DOCX import — this wires
   it through the creation API so callers can set styles in one call.

2. `doc.info` now returns a `styles` object with `paragraphStyles` —
   a frequency-sorted list of styleIds used in the document. This
   lets agents discover available styles before creating content.

Together: call info to see styles, pass styleId to create.

* docs(sdk): update system prompt for styleId and info styles

- Add style-aware creation workflow (info → discover styles → create with styleId)
- Promote re-search after each mutation to workflow step 4
- Update tool overview to mention styleId and info styles
- Reorder important rules with ref expiry first (most impactful)
- Remove redundant parentId/status/limit guidance (handled by tool annotations)

* feat(super-editor): auto-inherit paragraph style from nearest sibling

When insertParagraphAt is called without an explicit styleId, it now
looks at the nearest sibling paragraph (before, then after the
insertion point) and copies its paragraphProperties.styleId.

This means new paragraphs created via superdoc_create automatically
match the document's existing formatting without the LLM needing to
call info, discover styles, or pass a styleId. The model just says
"add a paragraph" and it looks right.

Explicit styleId still takes precedence when provided.

* feat(document-api): auto-resolve paragraph style in create wrapper

Reverts the PM-command-level style inheritance (paragraphs in DOCX
often don't have explicit styleIds). Instead, the create wrapper
scans the full document for the most common non-heading paragraph
style and applies it automatically when no styleId is provided.

This is server-side — the LLM doesn't need to call info, discover
styles, or pass a styleId. It just calls superdoc_create and the
new paragraph matches the document.

* fix(document-api): fall back to Normal style when no explicit styles found

Most DOCX paragraphs don't have explicit styleIds — they implicitly
use Normal (no <w:pStyle> in XML). The scanner returned undefined,
so new paragraphs got no style and looked wrong.

Now defaults to 'Normal' when no explicit styles are found. The
style engine resolves 'Normal' to the document's actual default
formatting (correct font, size, spacing).

* feat(super-editor): copy text marks from nearest sibling on create

When creating paragraphs or headings, copy the text marks (fontFamily,
fontSize, color, etc.) from the nearest existing paragraph/heading.
This makes new content match the document's actual formatting without
relying on the style engine to cascade run properties from styleId.

- insertParagraphAt: copies marks from nearest non-heading paragraph
- insertHeadingAt: copies marks from nearest heading paragraph

* feat(document-api): enrich info with font data, defaults, and tool hints

Three changes that work together:

1. Info response now returns font data and document defaults:
   - styles.paragraphStyles includes fontFamily and fontSize from marks
   - defaults: most common body font, size, and styleId

2. Tool descriptions reference info as the first step:
   - superdoc_get_content: "Use action info first to get structure and styles"
   - superdoc_create: "Get available styles from superdoc_get_content info"
   - superdoc_format: "Use styleId from superdoc_get_content info"

3. These descriptions are in INTENT_GROUP_META, not the system prompt.
   They're always sent to the LLM regardless of what system prompt
   the developer uses.

* docs(sdk): make info call mandatory first step in system prompt

Changed from "Read first" (optional guidance) to "ALWAYS start by
calling info before any other tool" (mandatory instruction). The
model was skipping the info call and creating content without
knowing the document's styles.

* fix(super-editor): heading mark copy falls back to body paragraph

When creating a heading in a document with no existing headings,
the mark-copying function now falls back to the nearest body
paragraph's marks. This ensures the heading at least uses the
document's font family instead of the browser default.

* feat(document-api): add defaults for font settings in info response

Enhanced the info response to include a new `defaults` object, specifying common body text formatting options such as `fontFamily`, `fontSize`, and `styleId`. This allows for consistent styling when creating new content. Updated the manifest with a new source hash to reflect these changes.

* refactor(super-editor): extract shared findNearbyMarks helper

DRY cleanup from code review:

- Extract findNearbyMarks() into core/helpers/findNearbyMarks.js
  with preference option ('body' | 'heading') replacing two
  near-identical functions (findNearbyTextMarks, findNearbyHeadingMarks)
- Export HEADING_STYLE_PATTERN constant (was duplicated 4 times)
- Filter parasitic marks (textStyle with all-null attrs from DOCX import)
- Both commands and adapters now import from the shared helper

* fix: address code review findings from 5 parallel agents

- Remove (tadeu) debug marker from shipped system prompt
- Scope empty-string stripping to known optional ID/enum params
  (was stripping ALL empty strings, could drop intentional empties)
- Fix extractTextFormatting early-exit: stop after first text node
  consistently instead of mixed fontFamily/fontSize termination
- Restore test script in document-api package.json

* fix(super-editor): smart quote normalization and better MATCH_NOT_FOUND errors

Three fixes for the remaining eval failures:

1. Smart quote normalization in text search: literal search patterns
   now match both straight quotes ("') and Unicode smart quotes
   (U+201C/201D/2018/2019). DOCX stores smart quotes but LLMs send
   straight quotes, causing MATCH_NOT_FOUND on quoted text.

2. MATCH_NOT_FOUND errors now include a document text preview (first
   ~200 chars) in both query.match and mutation compiler errors. This
   gives the model enough context to see the actual text formatting
   and retry with the correct pattern.

3. Test assertion updated to accept superdoc_mutations with inline
   selectors (by: "select") as a valid search+edit pattern.

* fix(evals): strengthen customer workflow test assertions

- Q&A tests (#8, #9, #10): replaced false-positive fixture data checks
  with tool_usage assertions (verify model actually called search/read)
- Glossary test: now checks definitions were added, not just heading
- List comments test: now verifies comment list action was called
- Enrollment update: added collateral check for City Medical Center
- Lease tracked rent: added missing traceAllOk
- Lease comment: added missing tool_usage check for comment tool

* feat(sdk): include browser SDK in generate:all pipeline

The browser SDK was using stale copies of tool artifacts. Now:

- tools/ directory replaced with symlink to ../../tools (matches
  Node SDK pattern). Always serves canonical generated artifacts.
- intent-dispatch.ts auto-generated from codegen (was manual copy)
- system-prompt.ts auto-generated from system-prompt.md (was manual)
- generate-intent-tools.mjs now writes both Node and browser outputs

Previously, running generate:all updated Node + Python SDKs but
left browser SDK with old tool definitions and system prompt.

* feat(sdk): expose blocks.list as superdoc_get_content blocks action

The blocks.list operation already existed but wasn't mapped to any
grouped tool. Now available as superdoc_get_content({action: "blocks"})
returning all block IDs, types, and text previews.

This gives LLMs a compact document tree — every paragraph, heading,
table, and image with its nodeId and text preview — so they can make
informed decisions about targeting and placement.

* feat(document-api): enrich blocks.list with formatting per block

superdoc_get_content({action: "blocks"}) now returns styling data
for every block:
- styleId: named paragraph style (e.g. 'Normal', 'Heading1')
- fontFamily: from first text run marks
- fontSize: from first text run marks
- bold: true if text is bold
- alignment: paragraph alignment
- headingLevel: 1-6 for headings

This gives LLMs a complete document map in one call — every block
with its ID, type, text preview, AND formatting. The LLM can see
exactly what font/size/style each paragraph uses and create new
content that matches.

* docs(sdk): change system prompt to call blocks instead of info first

The blocks action returns every block with formatting (styleId,
fontFamily, fontSize, bold, alignment). The info action only returns
aggregate counts and an often-empty styles array. Blocks gives the
LLM the full document map it needs to create matching content.

* fix(document-api): return full text in blocks.list instead of 80-char preview

* fix(sdk): make styleId directive in tool descriptions

Changed from "Omit for default" (model skips it) to "ALWAYS pass
a styleId" with concrete fallback values ('Normal' for paragraphs,
'Heading1'-'Heading6' for headings). The model now knows to always
include style info when creating content.

* fix(sdk): only pass styleId when blocks data has styled blocks

The previous "ALWAYS pass styleId" instruction caused the model to
use Heading1/Normal even when the document doesn't define those
styles, resulting in wrong fonts (Calibri instead of Times New Roman).

Now: "pass styleId only if blocks data shows styled blocks. If blocks
have no styleId, omit it — the engine matches nearby fonts
automatically." This lets the mark-copying code handle unstyled
documents correctly.

* refactor(sdk): remove styleId from create, use agentic format-after approach

The styleId approach failed because documents often don't define
custom styles — using Heading1/Normal applied the wrong font.

New approach: the model creates content, then applies formatting
from neighboring blocks using superdoc_format inline:

1. Call blocks to see document formatting (fontFamily, fontSize)
2. Create the content (paragraph/heading)
3. Search for the new text to get a ref
4. Apply inline formatting matching the neighbors

This is fully agentic — the model reads the document, creates,
then formats. No engine-level style guessing needed.

* fix(sdk): clarify one-paragraph-per-call and one-item-per-paragraph in tool descriptions

- superdoc_create text param: "Each call creates ONE paragraph. For
  multiple items, call separately — do NOT use newlines"
- superdoc_list mode param: "each paragraph becomes one item, so
  create one paragraph per item first"

* fix(sdk): remove flat params from format, fix list and create descriptions

Three fixes from trace analysis:

1. Exclude blockId/start/end from ALL format operations — LLMs used
   flat params instead of ref, causing "must provide target + inline
   or ref + inline" errors

2. superdoc_list fromParagraphs target: "Each call converts ONE
   paragraph — call for EACH paragraph to make multiple list items"

3. superdoc_create description: "For multiple paragraphs, use
   superdoc_mutations with text.insert steps instead of calling
   create repeatedly"

* chore(docs): update API documentation with additional descriptions and remove styleId references

- Added descriptions for parameters in blocks.list and create operations to clarify usage.
- Removed styleId from create.heading and create.paragraph as it is no longer needed.
- Updated descriptions to emphasize the need for separate calls for multiple paragraphs and list items.

* fix(cli): use agentVisible instead of PARAM_EXCLUSIONS for flat params

PARAM_EXCLUSIONS removed blockId/start/end from CLI metadata, breaking
--block-id/--start/--end flags for comments and format operations.

New approach: TEXT_TARGET_FLAT_PARAMS_AGENT_HIDDEN sets agentVisible:false
on individual params. This hides them from LLM tool schemas while
preserving them in CLI metadata for human users.
superdoc-bot bot pushed a commit that referenced this pull request Mar 20, 2026
# [0.3.0](cli-v0.2.0...cli-v0.3.0) (2026-03-20)

### Bug Fixes

* arrow key navigation through and out of tables (SD-2236) ([#2476](#2476)) ([d5317ef](d5317ef))
* behavior tests ([#2436](#2436)) ([2d087f2](2d087f2))
* bug text edit commands fail on targets returned by find ([#2488](#2488)) ([7a9a448](7a9a448))
* change default link protocol ([#2319](#2319)) ([1deda06](1deda06))
* clear linked style for the next paragraph ([#2344](#2344)) ([9714ffb](9714ffb))
* clear selection on undo/redo ([#2385](#2385)) ([6473acf](6473acf))
* cli skills install ([ed7436a](ed7436a))
* **cli:** include allowed values in oneOf const validation errors ([#2455](#2455)) ([8802f90](8802f90))
* **cli:** restore tracked diff redline roundtrip ([#2438](#2438)) ([f609371](f609371))
* close toolbar overflow menu on click outside ([#2377](#2377)) ([ba74245](ba74245))
* **collaboration:** preserve body section properties across Yjs sync ([#2356](#2356)) ([ea702d6](ea702d6))
* **comments:** keep floating comment bubbles aligned with the selected thread (SD-2210 and SD-2223) ([#2390](#2390)) ([b014618](b014618))
* **comments:** resolve double-click activation and edit mode issues (SD-2035) ([#2259](#2259)) ([d9465aa](d9465aa))
* declare w15 namespace when bootstrapping numbering.xml ([#2470](#2470)) ([a14004d](a14004d))
* **diffing:** ignore volatile OOXML attrs in image and paragraph diff comparison ([#2421](#2421)) ([ca91225](ca91225))
* disable table resizing UI in viewing mode ([#2403](#2403)) ([697e799](697e799))
* doc-api story regressions and export app.xml stats ([#2478](#2478)) ([d06ff4e](d06ff4e))
* **doc-api:** gate textStyle attrs and sync reference coverage ([#2430](#2430)) ([e2d6ca6](e2d6ca6))
* **docs:** coherence pass on doc api, clean up dead code, update CLI SKILL.md ([#2424](#2424)) ([bf0d4b8](bf0d4b8))
* **document-api:** add document diff API and fix tracked diff replay in CLI host session ([#2418](#2418)) ([2a804f7](2a804f7))
* **document-api:** add mutation-ready cell addresses to tables.getCells ([#2461](#2461)) ([99bd4e5](99bd4e5))
* **document-api:** clear styles before paragraph.setStyle ([#2449](#2449)) ([bce4bb8](bce4bb8))
* **document-api:** make find/get treat content controls as sdt ([6688b8c](6688b8c))
* **document-api:** rename atRowIndex to rowIndex in tables.split ([#2473](#2473)) ([7de2864](7de2864))
* **document-api:** return fresh table ref in mutation responses ([#2453](#2453)) ([af6de73](af6de73))
* **document-api:** return NodeAddress from find and getNode instead of SDAddress (SD-2168) ([#2342](#2342)) ([edcb3c6](edcb3c6))
* **editor:** arrow key navigation across page boundaries and auto-scroll (SD-1950) ([#2191](#2191)) ([f7961d7](f7961d7)), closes [#scrollCaretIntoViewIfNeeded](https://github.com/superdoc-dev/superdoc/issues/scrollCaretIntoViewIfNeeded) [this.#painterHost](https://github.com/this./issues/painterHost) [#scrollScreenRectIntoView](https://github.com/superdoc-dev/superdoc/issues/scrollScreenRectIntoView) [#scrollCaretIntoViewIfNeeded](https://github.com/superdoc-dev/superdoc/issues/scrollCaretIntoViewIfNeeded) [#scrollActiveEndIntoView](https://github.com/superdoc-dev/superdoc/issues/scrollActiveEndIntoView)
* **editor:** prevent scroll-to-top when clicking toolbar buttons ([#2236](#2236)) ([ab30a36](ab30a36))
* ensure ruler 0 is visible ([#2487](#2487)) ([096d9f0](096d9f0))
* **export:** prevent DOCX corruption from UTF-16 XML parts and schema violations (SD-2170) ([#2349](#2349)) ([fed1d6b](fed1d6b))
* faulty TOC import/export (SD-2183) ([#2371](#2371)) ([45b4452](45b4452))
* guard drawing export against invalid structures and zero IDs (SD-824) ([#2363](#2363)) ([9c7fc2e](9c7fc2e))
* **header-footer:** normalize page-relative anchor layout ([#2484](#2484)) ([6e62198](6e62198))
* **image:** sync headless image media to Y.Doc for collab persistence ([#2313](#2313)) ([72c64ed](72c64ed))
* import regression ([#2452](#2452)) ([cac5e24](cac5e24))
* improve document API dry runs, query matching, and reference block mutations ([#2498](#2498)) ([5959c5f](5959c5f))
* improve multi-column rendering ([#2369](#2369)) ([d231640](d231640))
* isolate document surface and toolbar/ruler stacking contexts ([#2491](#2491)) ([976ce14](976ce14))
* issue with vertical cells merging ([#2387](#2387)) ([e8f1c10](e8f1c10))
* **layout-engine:** match partial-row split height to renderer semantics ([#2486](#2486)) ([e0982da](e0982da))
* **layout-engine:** require bilateral opt-in for contextual spacing ([#2475](#2475)) ([40e04c2](40e04c2))
* **layout-engine:** skip redundant pageBreakBefore after page-forcing section breaks ([a950ed2](a950ed2))
* **lists:** stabilize list item addresses for docs without paraIds ([#2429](#2429)) ([0070de6](0070de6))
* match Word list marker geometry and section-carrier pagination ([#2358](#2358)) ([36d562f](36d562f))
* merged table cells owning outer borders in DOM painter ([c55f65a](c55f65a))
* newline formatting inheritance without serializing style-derived formatting (SD-2228) ([#2417](#2417)) ([5a3318f](5a3318f))
* open links in view mode ([#2350](#2350)) ([25f0aad](25f0aad))
* **painter-dom:** skip non-scrollable scroll container in virtualization (SD-2199) ([#2383](#2383)) ([1e075f6](1e075f6))
* **presentation-editor:** arrow key scroll-into-view with unconstrained containers (SD-1950) ([#2411](#2411)) ([fa8afc8](fa8afc8)), closes [#findScrollableAncestor](https://github.com/superdoc-dev/superdoc/issues/findScrollableAncestor)
* preserve imported letter spacing through editor and layout ([ca9cf6a](ca9cf6a))
* preserve tracked format changes through DOCX export roundtrip ([#2395](#2395)) ([0ee9fa0](0ee9fa0))
* register DOCX numbering metadata for lists.create ([#2432](#2432)) ([129772f](129772f))
* remove syncing of runProperties with paragraph (SD-2143) ([#2343](#2343)) ([3e74426](3e74426))
* **rendering:** apply superscript/subscript font-size scaling during layout ([#2340](#2340)) ([7e9c24f](7e9c24f))
* **rendering:** show comment highlight on text with Word highlight formatting (SD-2188) ([#2370](#2370)) ([8fe0afd](8fe0afd)), closes [#ffff00](https://github.com/superdoc-dev/superdoc/issues/ffff00)
* replace file running twice ([#2396](#2396)) ([a79fcaa](a79fcaa))
* **sdk:** improve agent tool definitions for better LLM accuracy ([#2494](#2494)) ([e914af7](e914af7)), closes [#8](#8) [#9](#9) [#10](#10)
* seed base docx package for collaboration exports ([#2416](#2416)) ([df36853](df36853))
* show correct paragraph font in toolbar when selection is empty (SD-2145) ([#2402](#2402)) ([39e1477](39e1477))
* **super-editor:** guard against style definition nodes without elements ([#2379](#2379)) ([7dd57f8](7dd57f8))
* **super-editor:** make notes-part mutations canonical for footnotes ([#2361](#2361)) ([e232129](e232129))
* **super-editor:** preserve fontFamily in runProperties when set via document API (SD-2249) ([#2433](#2433)) ([491c3fe](491c3fe))
* **super-editor:** preserve root doc attrs during collaboration seeding ([#2359](#2359)) ([018469a](018469a))
* **super-editor:** prevent cursor jump when changing font from toolbar ([#2468](#2468)) ([c315599](c315599))
* **super-editor:** reconcile OPC package metadata during DOCX export ([#2357](#2357)) ([863254a](863254a))
* **superdoc:** expose header/footer edits in update callbacks ([#2368](#2368)) ([78d0056](78d0056))
* **superdoc:** prevent duplicate prosemirror-view bundles in dist ([32c1045](32c1045))
* surface hyperlink tracked changes in comments ([#2485](#2485)) ([ae55118](ae55118))
* **tables:** handle insertColumn right of last column ([#2451](#2451)) ([74c37ff](74c37ff))
* **tables:** prevent resize overlay artifacts during drag ([#2479](#2479)) ([1b1e712](1b1e712))
* text selection inside headers/footers ([#2404](#2404)) ([09677dc](09677dc))
* **toc:** anchor scroll precision within pages navigation (SD-2186) ([#2372](#2372)) ([cfb9a72](cfb9a72)), closes [#scrollContainer](https://github.com/superdoc-dev/superdoc/issues/scrollContainer)
* **toc:** inject _Toc bookmarks so exported DOCX TOC links work without manual Update Table ([#2431](#2431)) ([54c5aa7](54c5aa7))
* toolbar state after document load (SD-2145) ([#2448](#2448)) ([6347ffe](6347ffe))
* **track-changes:** allow linked style changes in suggesting mode (SD-2182) ([#2373](#2373)) ([6400a1f](6400a1f))
* **track-changes:** cancel tracked format changes when reverted to original (SD-2181) ([#2365](#2365)) ([72077b2](72077b2))
* **track-changes:** remove logic that combines adjacent TCs with different IDs ([#2326](#2326)) ([b2f088b](b2f088b))
* **tracked-changes:** do not render empty space in TC within lists ([#2316](#2316)) ([00672dc](00672dc))
* **tracked-changes:** sync tracked changes store on undo and redo ([#2164](#2164)) ([94f0056](94f0056))
* **tracked-changes:** undo/redo applies to both document and comment bubbles ([#2437](#2437)) ([bc7cba3](bc7cba3))
* **types:** fix broken .d.ts imports in published superdoc package (SD-2227) ([#2392](#2392)) ([77807e5](77807e5))
* update list marker font before adding list item ([#2312](#2312)) ([8721614](8721614))
* update skill file ([240fb66](240fb66))
* watermark shading mismatch (SD-2147) ([#2353](#2353)) ([c94320c](c94320c))

### Features

* charts ([#2322](#2322)) ([dff2edc](dff2edc))
* cli improvements, block deletion ([#2360](#2360)) ([26972ff](26972ff))
* **cli:** add --version flag ([6199a9c](6199a9c))
* **collab:** wait for Y fragment settling before initializing editor ([b75ee17](b75ee17))
* **comments:** add scrollToComment API ([#2440](#2440)) ([0132d0e](0132d0e))
* diffing extension for comparing documents (SD-1324 and SD-89) ([#2306](#2306)) ([33e2ce6](33e2ce6))
* **doc-info:** add live page counts to doc.info ([#2435](#2435)) ([e631f4b](e631f4b))
* **doc-info:** live doc.info counts for characters, tracked changes, SDT fields, and lists ([#2428](#2428)) ([2978507](2978507))
* **document-api:** accept table coordinates in unmergeCells ([#2462](#2462)) ([5eca65b](5eca65b))
* **document-api:** add 'story' targeting for parts targeting with main api functions ([#2477](#2477)) ([49dc4ef](49dc4ef))
* **document-api:** add paragraph direction ops and clarify format.rtl ([#2474](#2474)) ([86600ac](86600ac))
* **document-api:** add table convenience ops and sync reference doc ([#2471](#2471)) ([137b1d9](137b1d9))
* **document-api:** content controls ([#2320](#2320)) ([2747e81](2747e81))
* **document-api:** headers & footers ([#2323](#2323)) ([b6511ca](b6511ca))
* **document-api:** improve cross block selection and deleting ([#2391](#2391)) ([cb8fedd](cb8fedd))
* **document-api:** insert/replace structural content ([#2305](#2305)) ([ce0c719](ce0c719))
* **document-api:** list creation and style edit commands ([#2457](#2457)) ([1d6d4bb](1d6d4bb))
* **document-api:** references ([#2321](#2321)) ([6da4d9c](6da4d9c))
* **docx:** support Word document statistic fields and F9 field updates ([#2460](#2460)) ([57b3ecc](57b3ecc))
* **headless:** collaborative comment and tracked-change parity ([#2315](#2315)) ([4dc1be1](4dc1be1))
* **layout:** implement AutoFit table layout algorithm (SD-2174) ([#2355](#2355)) ([5c05535](5c05535))
* llm tools beta ([#2393](#2393)) ([f725f36](f725f36))
* make images uploaded into table cell adjust to width of cell ([#2317](#2317)) ([c79b1d1](c79b1d1))
* parts sync system including yjs ([#2325](#2325)) ([84d8945](84d8945))
* **presentation-editor:** enhance zoom functionality in web layout ([#2408](#2408)) ([d44de69](d44de69)), closes [#applyZoom](https://github.com/superdoc-dev/superdoc/issues/applyZoom)
* remove naive ui ([#2240](#2240)) ([fd5444f](fd5444f))
* **sdk:** ensure sdk clients are not global, change open() to return document handle ([#2497](#2497)) ([3b6eede](3b6eede))
* **sdk:** improve AI tool definitions for LLM accuracy (25% → 95% pass rate) ([#2446](#2446)) ([2e10e26](2e10e26))
* seed blank docx parts when loading JSON into editor ([#2401](#2401)) ([89c982f](89c982f))
* **super-editor:** bridge editor selection into Document API commands ([#2458](#2458)) ([26cef26](26cef26))
* support paragraph between borders (w:pBdr/w:between) ([#2324](#2324)) ([03f8207](03f8207)), closes [#2074](#2074)
* **tables:** support lastRow style options with OOXML roundtrip parity ([#2467](#2467)) ([e84f695](e84f695))
* theming with css variables ([#2386](#2386)) ([529c500](529c500)), closes [#2441](#2441) [#ffffff](https://github.com/superdoc-dev/superdoc/issues/ffffff) [#dbdbdb](https://github.com/superdoc-dev/superdoc/issues/dbdbdb) [hi#level](https://github.com/hi/issues/level) [hi#contrast](https://github.com/hi/issues/contrast) [#f3f6fd](https://github.com/superdoc-dev/superdoc/issues/f3f6fd) [hi#level](https://github.com/hi/issues/level) [#2445](#2445) [#2469](#2469) [#ffffff](https://github.com/superdoc-dev/superdoc/issues/ffffff)

### Performance Improvements

* **test:** move one-time setup to beforeAll in contract-conformance ([#2483](#2483)) ([ed4839b](ed4839b))
* **test:** speed up unit tests and migrate to bun ([#2492](#2492)) ([af44051](af44051))

### Reverts

* Revert "fix(types): fix broken .d.ts imports in published superdoc package (S…" ([#2443](#2443)) ([33215ee](33215ee))
* Revert "fix(types): fix broken .d.ts imports in published superdoc package (S…" ([#2443](#2443)) ([#2444](#2444)) ([2bde895](2bde895))
harbournick pushed a commit that referenced this pull request Mar 20, 2026
# [1.21.0](v1.20.0...v1.21.0) (2026-03-20)

### Bug Fixes

* arrow key navigation through and out of tables (SD-2236) ([#2476](#2476)) ([d5317ef](d5317ef))
* bug text edit commands fail on targets returned by find ([#2488](#2488)) ([7a9a448](7a9a448))
* declare w15 namespace when bootstrapping numbering.xml ([#2470](#2470)) ([a14004d](a14004d))
* doc-api story regressions and export app.xml stats ([#2478](#2478)) ([d06ff4e](d06ff4e))
* **document-api:** add mutation-ready cell addresses to tables.getCells ([#2461](#2461)) ([99bd4e5](99bd4e5))
* **document-api:** clear styles before paragraph.setStyle ([#2449](#2449)) ([bce4bb8](bce4bb8))
* **document-api:** rename atRowIndex to rowIndex in tables.split ([#2473](#2473)) ([7de2864](7de2864))
* **document-api:** return fresh table ref in mutation responses ([#2453](#2453)) ([af6de73](af6de73))
* ensure ruler 0 is visible ([#2487](#2487)) ([096d9f0](096d9f0))
* **header-footer:** normalize page-relative anchor layout ([#2484](#2484)) ([6e62198](6e62198))
* import regression ([#2452](#2452)) ([cac5e24](cac5e24))
* improve document API dry runs, query matching, and reference block mutations ([#2498](#2498)) ([5959c5f](5959c5f))
* isolate document surface and toolbar/ruler stacking contexts ([#2491](#2491)) ([976ce14](976ce14))
* issue with vertical cells merging ([#2387](#2387)) ([e8f1c10](e8f1c10))
* **layout-engine:** match partial-row split height to renderer semantics ([#2486](#2486)) ([e0982da](e0982da))
* **layout-engine:** require bilateral opt-in for contextual spacing ([#2475](#2475)) ([40e04c2](40e04c2))
* **sdk:** improve agent tool definitions for better LLM accuracy ([#2494](#2494)) ([e914af7](e914af7)), closes [#8](#8) [#9](#9) [#10](#10)
* **super-editor:** preserve fontFamily in runProperties when set via document API (SD-2249) ([#2433](#2433)) ([491c3fe](491c3fe))
* **super-editor:** prevent cursor jump when changing font from toolbar ([#2468](#2468)) ([c315599](c315599))
* surface hyperlink tracked changes in comments ([#2485](#2485)) ([ae55118](ae55118))
* **tables:** handle insertColumn right of last column ([#2451](#2451)) ([74c37ff](74c37ff))
* **tables:** prevent resize overlay artifacts during drag ([#2479](#2479)) ([1b1e712](1b1e712))
* toolbar state after document load (SD-2145) ([#2448](#2448)) ([6347ffe](6347ffe))
* **track-changes:** allow linked style changes in suggesting mode (SD-2182) ([#2373](#2373)) ([6400a1f](6400a1f))
* **tracked-changes:** undo/redo applies to both document and comment bubbles ([#2437](#2437)) ([bc7cba3](bc7cba3))
* update list marker font before adding list item ([#2312](#2312)) ([8721614](8721614))

### Features

* **document-api:** accept table coordinates in unmergeCells ([#2462](#2462)) ([5eca65b](5eca65b))
* **document-api:** add 'story' targeting for parts targeting with main api functions ([#2477](#2477)) ([49dc4ef](49dc4ef))
* **document-api:** add paragraph direction ops and clarify format.rtl ([#2474](#2474)) ([86600ac](86600ac))
* **document-api:** add table convenience ops and sync reference doc ([#2471](#2471)) ([137b1d9](137b1d9))
* **document-api:** list creation and style edit commands ([#2457](#2457)) ([1d6d4bb](1d6d4bb))
* **docx:** support Word document statistic fields and F9 field updates ([#2460](#2460)) ([57b3ecc](57b3ecc))
* make images uploaded into table cell adjust to width of cell ([#2317](#2317)) ([c79b1d1](c79b1d1))
* **super-editor:** bridge editor selection into Document API commands ([#2458](#2458)) ([26cef26](26cef26))
* **tables:** support lastRow style options with OOXML roundtrip parity ([#2467](#2467)) ([e84f695](e84f695))
* theming with css variables ([#2386](#2386)) ([529c500](529c500)), closes [#2441](#2441) [#ffffff](https://github.com/superdoc-dev/superdoc/issues/ffffff) [#dbdbdb](https://github.com/superdoc-dev/superdoc/issues/dbdbdb) [hi#level](https://github.com/hi/issues/level) [hi#contrast](https://github.com/hi/issues/contrast) [#f3f6fd](https://github.com/superdoc-dev/superdoc/issues/f3f6fd) [hi#level](https://github.com/hi/issues/level) [#2445](#2445) [#2469](#2469) [#ffffff](https://github.com/superdoc-dev/superdoc/issues/ffffff)

### Performance Improvements

* **test:** move one-time setup to beforeAll in contract-conformance ([#2483](#2483)) ([ed4839b](ed4839b))
* **test:** speed up unit tests and migrate to bun ([#2492](#2492)) ([af44051](af44051))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants