1.15.0 release notes
RSSNutrient Document Authoring SDK 1.15.0 introduces the command palette, new selection content APIs, a programmatic API for paragraph properties, four-sided table cell padding, restructured section storage, and unified import and export. See the changelog for full details.
Breaking changes
This release includes one breaking change.
Sections are now stored around section breaks
This release changes how sections are stored, organizing them around section breaks instead of a list. Rather than grouping content under each section, the document body now contains one continuous list of block-level elements. Each section ends with a paragraph containing a section break (an inline element), and the content from one such paragraph to the next forms a section.
Impact: Stored documents need no action, because older DocJSON is upgraded automatically on load. You only need to update code that reads or constructs raw DocJSON directly, or that uses the section-mutation programmatic API.
DocJSON changes
body.sections(an array of sections, each with its own elements) is removed.body.elementsis now a single list of block-level elements (paragraphs and tables) for the body, with section boundaries marked inline rather than by grouping.- Section boundaries are marked by a new
break/sectioninline element on the last paragraph of a section. body.finalSectionPrholds the trailing section’s properties (the last section has no closing break).
New programmatic API
Body.content(): BlockLevelContainerreturns a single block-level container for the whole document.Paragraph.hasSectionBreak(): boolean,addSectionBreak(): void,removeSectionBreak(): void, andfindSection(): Section | undefinedlet you inspect, add, remove, and locate section breaks on a paragraph, respectively.Table.findSection(): Section | undefinedreturns the section a table belongs to.
Migration: Replace iteration over body.sections() and the body.addSection()/body.removeSection()/section.replaceText() mutators with the new flat body and per-paragraph section-break controls.
Before:
// Iterate per-section content.for (const section of body.sections()) { for (const block of section.content().blocklevels()) { /* ... */ }}
// Add or remove sections via the body.body.addSection(/* ... */);body.removeSection(/* ... */);
// Mutate section text in place.section.replaceText(/* ... */);After:
// Iterate the whole body as one flat block-level container.for (const block of body.content().blocklevels()) { /* ... */}
// Section is now a properties-only handle; find the one a block belongs to.const section = paragraph.findSection(); // or table.findSection()
// Split or merge sections by toggling the break on a paragraph.if (!paragraph.hasSectionBreak()) { paragraph.addSectionBreak();} else { paragraph.removeSectionBreak();}Section.content(), Section.replaceText(), Body.addSection(), and Body.removeSection() are removed. Body.sections() always returns N + 1 entries, where N is the number of paragraphs carrying a section break (the last entry is the trailing section). Callers that assumed sections().length matches the number of section breaks must be updated.
Command palette
This release adds a command palette (open with Mod+/ or the toolbar button) for searching and executing editor actions. Parameterized actions (zoom levels, font sizes, colors, and so on) are expanded into individual entries.
The palette is wired into the public Actions and Toolbar APIs as the built-in view.open-command-palette action and the command-palette toolbar item, so it can be re-bound, repositioned, or removed via editor.setActions() and the toolbar configuration.
Selection content APIs
This release adds new APIs for reading the current selection and inserting content at the cursor.
- Added
getSelectionContent()to read the current selection as plain text or as a portable fragment. - Added
insertContentAtCursor()to insert text or a fragment at the cursor, replacing any active range selection. - Added
hasActiveCursor()to check whether the editor has an insertion point before attempting content writes. - Fragments use a versioned wire format with tagged errors (
isInvalidFragmentTypeError,isUnsupportedFragmentVersionError,isMissingFragmentContentError) for safe roundtripping. insertContentAtCursor()accepts aninlineFormattingoption to either preserve source formatting or adopt the destination’s.
Programmatic API for paragraph properties
This release adds a programmatic API for paragraph properties.
Supported properties cover:
- Built-in styles —
styleId: 'Normal','Title','Subtitle', and'Heading 1'–'Heading 6'. - Alignment —
'left','center','right', or'justify'. - Spacing —
lineSpacingFactor,spaceBefore,spaceAfter, andcontextualSpacing. - Indentation —
left,right, and first-line shift (negative values produce a hanging indent). - Tab stops —
position,alignment, andleader. - Border — per-side colors, widths, spaces, and corner radii.
- Shading — a single fill color (hex).
Table cell padding
This release adds support for top and bottom table cell padding, complementing the existing left and right padding.
Deprecations
doc.exportPDF(),doc.exportDOCX(), andsystem.importDOCX()are deprecated in favor of the unifieddoc.export({ format })andsystem.import(blob, { format }).editor.insertTextAtCursor()is deprecated in favor ofeditor.insertContentAtCursor({ content }).
Stability and bug fixes
- Fixes
moveTotrack change DOCX import. - Fixes an issue where text selection would be reset when the page scrollbar is clicked.
- Fixes comment reply DOCX export.