Skip to content

Commit c1ba6f1

Browse files
chore(template-builder): 1.5.0 [skip ci]
### What's New - **CDN bundle with vanilla JavaScript** β€” Ship SuperDoc via script tag (IIFE format, minified, 1.46 MB gzipped). Includes working vanilla example and jsdelivr/unpkg integration guides. - **Math equation rendering** β€” Render OMML math with MathML, including fractions, subscripts, superscripts, limits, accents, radicals, delimiters, equation arrays, and n-ary operators. Group character stacking and phantom elements also supported. - **doc.extract()** β€” Extract all document content with stable IDs for RAG pipelines. Returns blocks with full text, comments with anchored references, and tracked changes with excerpts. Every ID works directly with scrollToElement(). - **scrollToElement(id)** β€” Navigate to any element by its ID (paragraphs, comments, tracked changes). Single unified API for cross-session citation navigation. - **Headless toolbar API** β€” Control formatting programmatically. New useHeadlessToolbar() hook for React and Vue, plus 5 framework examples (React shadcn, React MUI, Vue Vuetify, Svelte, vanilla). Type-safe execute() and snapshot. - **contentControls.create with text wrapping** β€” Wrap arbitrary text ranges in content controls via the optional `at` field. No need to drop into editor internals. ### Improvements - **Math rendering precision** β€” Underbars on compound expressions stretch correctly (U+203E overline vs combining marks). Display style and Cambria Math font match Word's rendering exactly. - **Justified paragraphs with indents** β€” Fixed overlapping text when paragraphs have first-line or hanging indents and justify alignment. Text-indent offset now applied consistently across measurer, painter, selection, and hit-testing. - **Track changes on collaboration undo/redo** β€” Bubbles resync correctly when peers undo/redo. Tracked change comments no longer misalign during replay. - **Document export in collaboration** β€” settings.xml, custom XML parts, and endnotes now persist on export from a live collaboration session. Multi-author documents export cleanly without data loss. - **Form fields in tables** β€” Presentation updates correctly when typing inside table cells with structured content (SDT) fields. - **Comment and tracked-change rendering** β€” Fixed layout to allow bubbles and balloons to render in the right margin without clipping. Floating comment remeasure logic simplified. - **Table cell content on paste** β€” Preserve background color, margins, borders, vertical alignment, and header styling when pasting tables from Google Docs via inline HTML styles. - **Centered images in indented paragraphs** β€” Centering math now accounts for paragraph indents (w:ind). Inline shapeGroups no longer offset from Word's placement. - **Table of contents rendering** β€” Apply useAppliedOutlineLevel without requiring \o range switch. TOC with \u-only instructions now works. - **Inline structured content formatting** β€” Inherit run formatting (bold, color, font) when inserting inline SDT elements. Respect pending toolbar formatting. - **AI agent tooling** β€” MCP server, benchmark suite, and system prompts optimized for multi-turn agent workflows. Markdown insert patterns and mutations batch format documented. - **TypeScript type safety** β€” exportDocx overloads narrow return type per flag. Command chain returns properly typed. Comment type expanded with full runtime shape. Fixed type regressions from prosemirror and vue package overrides. ### Fixes - **Image resize handles in view mode** β€” No longer appear when document is in viewing mode. Properly cleared when switching modes. - **Centered inline drawingML** β€” ShapeGroups in indented paragraphs now centered relative to text column, not full page width. - **Selection rectangles in headers/footers** β€” Fixed position mapping in header/footer editing. - **Watermark and comment bubble layout** β€” Word art watermarks and comment metadata handling corrected. - **Tracked change bubble text after undo** β€” Partial undo now renders correct change text in bubble. - **Replacement text in tracked changes** β€” Tracked-change delete + insert (replacement) now shows correct replacement text. Distinction between deletion-then-insertion and true replacement clarified. - **Comment activation on click** β€” Clicking inside commented text now activates the comment bubble. elementFromPoint fallback works with pointer capture. - **RTL text click-to-position** β€” Clicks on right-to-left text map to correct document position. Fixed hidden span handling in line bounds. - **Document part objects with inline content** β€” Non-TOC gallery types (page numbers, bibliographies, cover pages) normalize inline nodes (bookmarks, comments, permissions) instead of failing. - **Table cell newlines** β€” Newline characters in structured content now split into separate paragraphs instead of losing content after first newline. - **SDT hover in view mode** β€” Block and inline structured content no longer highlight on hover in viewing mode. - **Comment export** β€” Resolved comments export with correct w15:done attribute. commentsExtended.xml included even with threaded comments only. - **Multi-block text.rewrite** β€” Text replacements spanning multiple paragraphs now split correctly on newlines. Paragraph attributes preserved. - **Per-script fonts in round-trip** β€” eastAsiaFontFamily and csFontFamily now survive mark encoding/decoding. Zero-edit export stops injecting rFonts into runs. - **Accept/reject formatting** β€” Rejecting multi-property format suggestions now reverts all properties, not just the last one. Inline keys preserved for imported docs. - **Run plugin inline keys** β€” Specific keys removed in accept/reject transaction no longer stripped from unrelated inline properties on same run. - **Collaboration document corruption** β€” Yjs fragment properly cleared during document rebuild. Custom XML parts, settings.xml, and endnotes persist on collab export. - **Form field visibility in SDT** β€” Fields update correctly when typing inside table cells within structured content. - **Math cursor positioning** β€” Clicks in overflow areas around inline equations resolve to correct positions. - **Math paragraph spacing** β€” Display math paragraphs inherit before/after spacing from containing paragraph. - **SVG image hyperlinks** β€” DrawingML images (a:hlinkClick) now support hyperlinks correctly in edit and view modes. - **Floating-only documents** β€” Layout handles documents with only floating objects. Paginator state stays in sync when pruning empty pages. - **Image resizing in web layout** β€” Table cell width constraint applied even in web layout mode. getMaxContentSize check moved before early return. - **List marker guard consistency** β€” Hit-testing, painter, and mapPmToX use same rendered-marker check based on measured text width. - **Paragraph split formatting inheritance** β€” Pressing Enter no longer inherits parent paragraph formatting. Clearing with empty storedMarks respected on split. - **Style equivalence inline keys** β€” Imported docs with explicit w:rPr that become style-equivalent no longer drop keys on export. - **Negative word-spacing whitespace** β€” Justified lines with manual tabs no longer apply negative word-spacing, preserving whitespace. - **Document mode changes in template-builder** β€” Mode switches no longer destroy/recreate editor. Queued during init if changed before ready. - **Field type styling** β€” fieldColors prop now respects partial color maps. Non-hex colors supported via color-mix(). DOM selector fixed to match actual structure. - **Lock mode in template-builder** β€” Lock mode now threaded through all field insertion and discovery paths. Delete respects lock state feedback from editor. - **Comment scrolling regression** β€” Fixed scroll behavior after painter refactor. - **Type augmentation at package boundary** β€” Command type augmentations (comment, formatting, track changes) now reach consumers via /// <reference> directives in dist. - **Ambient type shims** β€” Removed prosemirror, vue, yjs type overrides that broke consumers using those packages directly (e.g., Tiptap users). Added prosemirror as optional peer for re-exported types.
1 parent 009351f commit c1ba6f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

β€Žpackages/template-builder/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/template-builder",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"description": "React template builder component for SuperDoc",
55
"type": "module",
66
"main": "./dist/index.js",

0 commit comments

Comments
Β (0)