superdoc 2.24.0-next.9 → 2.25.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/collaboration-upgrade-engine.cjs +1 -1
  2. package/dist/collaboration-upgrade-engine.es.js +1 -1
  3. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  4. package/dist/document-api/src/contract/operation-definitions.d.ts +19 -1
  5. package/dist/document-api/src/get/get.d.ts +2 -1
  6. package/dist/document-api/src/index.d.ts +9 -6
  7. package/dist/document-api/src/inline-semantics/token-sets.d.ts +11 -0
  8. package/dist/document-api/src/styles/apply.d.ts +5 -0
  9. package/dist/document-api/src/styles/catalog.d.ts +40 -19
  10. package/dist/document-api/src/styles/create.d.ts +160 -0
  11. package/dist/document-api/src/styles/index.d.ts +8 -4
  12. package/dist/document-api/src/styles/registry.d.ts +34 -2
  13. package/dist/document-api/src/styles/schema.d.ts +24 -5
  14. package/dist/document-api/src/styles/theme.d.ts +32 -0
  15. package/dist/document-api/src/styles/validation.d.ts +11 -2
  16. package/dist/document-api/src/templates/apply.d.ts +13 -15
  17. package/dist/document-api/src/types/fragment.d.ts +3 -0
  18. package/dist/document-api/src/types/query-match.types.d.ts +43 -5
  19. package/dist/document-api/src/types/sd-props.d.ts +54 -14
  20. package/dist/document-api/src/types/sd-styles.d.ts +58 -3
  21. package/dist/style.css +22 -22
  22. package/dist/style.layered.css +22 -22
  23. package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +2 -0
  24. package/dist/superdoc.cjs +11 -8
  25. package/dist/superdoc.es.js +11 -8
  26. package/dist-cdn/style.layered.css +1 -1
  27. package/dist-cdn/superdoc.min.css +1 -1
  28. package/dist-cdn/superdoc.min.js +18 -18
  29. package/package.json +2 -2
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
19
19
  var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
20
20
  var ENGINE_INFO = Object.freeze({
21
21
  ...PRIVATE_ENGINE_INFO,
22
- superdocVersion: "2.24.0-next.9",
22
+ superdocVersion: "2.25.0-next.1",
23
23
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
24
24
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
25
25
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
18
18
  var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
19
19
  var ENGINE_INFO = Object.freeze({
20
20
  ...PRIVATE_ENGINE_INFO,
21
- superdocVersion: "2.24.0-next.9",
21
+ superdocVersion: "2.25.0-next.1",
22
22
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
23
23
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
24
24
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -1,7 +1,7 @@
1
1
  import { CommandCatalog, CommandStaticMetadata, OperationId } from './types.js';
2
2
  export declare const COMMAND_CATALOG: CommandCatalog;
3
3
  /** Operation IDs whose catalog entry has `mutates: true`. */
4
- export declare const MUTATING_OPERATION_IDS: ("replace" | "find" | "delete" | "selection.extractOoxml" | "selection.current" | "selection.releaseSnapshot" | "insert" | "info" | "projectHtml" | "projectMarkdown" | "capabilities.check" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "tables.moveColumn" | "format.bold" | "format.strike" | "format.color" | "format.position" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.italic" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.dstrike" | "format.vertAlign" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.fitText" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "get" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "htmlToFragment" | "extract" | "clearContent" | "formatRange" | "blocks.findText" | "blocks.list" | "blocks.delete" | "blocks.deleteRange" | "styles.apply" | "styles.getCatalog" | "templates.apply" | "create.paragraph" | "create.heading" | "create.sectionBreak" | "sections.list" | "sections.get" | "sections.setBreakType" | "sections.setPageMargins" | "sections.setHeaderFooterMargins" | "sections.setPageSetup" | "sections.setColumns" | "sections.setLineNumbering" | "sections.setPageNumbering" | "sections.setTitlePage" | "sections.setOddEvenHeadersFooters" | "sections.setVerticalAlign" | "sections.setSectionDirection" | "sections.setHeaderFooterRef" | "sections.clearHeaderFooterRef" | "sections.setLinkToPrevious" | "sections.setPageBorders" | "sections.clearPageBorders" | "styles.paragraph.setStyle" | "styles.paragraph.setStyleRef" | "styles.paragraph.clearStyle" | "format.paragraph.resetDirectFormatting" | "format.paragraph.setAlignment" | "format.paragraph.clearAlignment" | "format.paragraph.setIndentation" | "format.paragraph.clearIndentation" | "format.paragraph.setSpacing" | "format.paragraph.clearSpacing" | "format.paragraph.setKeepOptions" | "format.paragraph.setOutlineLevel" | "format.paragraph.setFlowOptions" | "format.paragraph.setTabStop" | "format.paragraph.clearTabStop" | "format.paragraph.clearAllTabStops" | "format.paragraph.setBorder" | "format.paragraph.clearBorder" | "format.paragraph.setShading" | "format.paragraph.clearShading" | "format.paragraph.setDirection" | "format.paragraph.clearDirection" | "format.paragraph.setNumbering" | "lists.list" | "lists.get" | "lists.insert" | "lists.create" | "lists.attach" | "lists.detach" | "lists.delete" | "lists.indent" | "lists.outdent" | "lists.join" | "lists.canJoin" | "lists.separate" | "lists.merge" | "lists.split" | "lists.setLevel" | "lists.setValue" | "lists.continuePrevious" | "lists.canContinuePrevious" | "lists.setLevelRestart" | "lists.convertToText" | "lists.applyTemplate" | "lists.applyPreset" | "lists.setType" | "lists.captureTemplate" | "lists.setLevelNumbering" | "lists.setLevelBullet" | "lists.setLevelPictureBullet" | "lists.setLevelAlignment" | "lists.setLevelIndents" | "lists.setLevelTrailingCharacter" | "lists.setLevelMarkerFont" | "lists.clearLevelOverrides" | "lists.getStyle" | "lists.applyStyle" | "lists.restartAt" | "lists.setLevelNumberStyle" | "lists.setLevelText" | "lists.setLevelStart" | "lists.setLevelLayout" | "comments.create" | "comments.patch" | "comments.delete" | "comments.get" | "comments.list" | "trackChanges.list" | "trackChanges.get" | "trackChanges.decide" | "query.match" | "ranges.resolve" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "capabilities.resolve" | "create.table" | "tables.convertFromText" | "tables.delete" | "tables.clearContents" | "tables.move" | "tables.split" | "tables.convertToText" | "tables.setLayout" | "tables.insertRow" | "tables.deleteRow" | "tables.setRowHeight" | "tables.distributeRows" | "tables.setRowOptions" | "tables.insertColumn" | "tables.deleteColumn" | "tables.setColumnWidth" | "tables.distributeColumns" | "tables.insertCell" | "tables.deleteCell" | "tables.mergeCells" | "tables.unmergeCells" | "tables.splitCell" | "tables.setCellProperties" | "tables.setCellText" | "tables.sort" | "tables.setAltText" | "tables.setStyle" | "tables.clearStyle" | "tables.setStyleOption" | "tables.setBorder" | "tables.clearBorder" | "tables.applyBorderPreset" | "tables.setShading" | "tables.clearShading" | "tables.setTablePadding" | "tables.setCellPadding" | "tables.setCellSpacing" | "tables.clearCellSpacing" | "tables.applyStyle" | "tables.setBorders" | "tables.setTableOptions" | "tables.applyPreset" | "tables.get" | "tables.getCells" | "tables.getProperties" | "tables.getStyles" | "tables.setDefaultStyle" | "tables.clearDefaultStyle" | "create.tableOfContents" | "toc.list" | "toc.get" | "toc.configure" | "toc.update" | "toc.remove" | "toc.markEntry" | "toc.unmarkEntry" | "toc.listEntries" | "toc.getEntry" | "toc.editEntry" | "history.get" | "history.undo" | "history.redo" | "create.image" | "images.list" | "images.get" | "images.delete" | "images.move" | "images.convertToInline" | "images.convertToFloating" | "images.setSize" | "images.setWrapType" | "images.setWrapSide" | "images.setWrapDistances" | "images.setPosition" | "images.setAnchorOptions" | "images.setZOrder" | "images.scale" | "images.setLockAspectRatio" | "images.rotate" | "images.flip" | "images.crop" | "images.resetCrop" | "images.replaceSource" | "images.setAltText" | "images.setDecorative" | "images.setName" | "images.setHyperlink" | "images.insertCaption" | "images.updateCaption" | "images.removeCaption" | "hyperlinks.list" | "hyperlinks.get" | "hyperlinks.wrap" | "hyperlinks.insert" | "hyperlinks.patch" | "hyperlinks.remove" | "headerFooters.list" | "headerFooters.get" | "headerFooters.resolve" | "headerFooters.refs.set" | "headerFooters.refs.clear" | "headerFooters.refs.setLinkedToPrevious" | "headerFooters.parts.list" | "headerFooters.parts.create" | "headerFooters.parts.delete" | "headerFooters.pageNumbers.get" | "headerFooters.pageNumbers.insert" | "headerFooters.pageNumbers.set" | "headerFooters.pageNumbers.remove" | "watermarks.apply" | "watermarks.list" | "watermarks.insert" | "watermarks.replace" | "watermarks.remove" | "create.contentControl" | "contentControls.list" | "contentControls.get" | "contentControls.listInRange" | "contentControls.selectByTag" | "contentControls.selectByTitle" | "contentControls.listChildren" | "contentControls.getParent" | "contentControls.wrap" | "contentControls.unwrap" | "contentControls.delete" | "contentControls.copy" | "contentControls.move" | "contentControls.patch" | "contentControls.setLockMode" | "contentControls.setType" | "contentControls.getContent" | "contentControls.replaceContent" | "contentControls.clearContent" | "contentControls.appendContent" | "contentControls.prependContent" | "contentControls.insertBefore" | "contentControls.insertAfter" | "contentControls.getBinding" | "contentControls.setBinding" | "contentControls.clearBinding" | "contentControls.getRawProperties" | "contentControls.patchRawProperties" | "contentControls.validateWordCompatibility" | "contentControls.normalizeWordCompatibility" | "contentControls.normalizeTagPayload" | "contentControls.text.setMultiline" | "contentControls.text.setValue" | "contentControls.text.clearValue" | "contentControls.date.setValue" | "contentControls.date.clearValue" | "contentControls.date.setDisplayFormat" | "contentControls.date.setDisplayLocale" | "contentControls.date.setStorageFormat" | "contentControls.date.setCalendar" | "contentControls.checkbox.getState" | "contentControls.checkbox.setState" | "contentControls.checkbox.toggle" | "contentControls.checkbox.setSymbolPair" | "contentControls.choiceList.getItems" | "contentControls.choiceList.setItems" | "contentControls.choiceList.setSelected" | "contentControls.repeatingSection.listItems" | "contentControls.repeatingSection.insertItemBefore" | "contentControls.repeatingSection.insertItemAfter" | "contentControls.repeatingSection.cloneItem" | "contentControls.repeatingSection.deleteItem" | "contentControls.repeatingSection.setAllowInsertDelete" | "contentControls.group.wrap" | "contentControls.group.ungroup" | "bookmarks.list" | "bookmarks.get" | "bookmarks.insert" | "bookmarks.rename" | "bookmarks.remove" | "footnotes.list" | "footnotes.get" | "footnotes.insert" | "footnotes.update" | "footnotes.remove" | "footnotes.configure" | "clipboard.parse" | "clipboard.insert" | "clipboard.serializeSelection" | "crossRefs.list" | "crossRefs.get" | "crossRefs.insert" | "crossRefs.rebuild" | "crossRefs.remove" | "index.list" | "index.get" | "index.insert" | "index.configure" | "index.rebuild" | "index.remove" | "index.entries.list" | "index.entries.get" | "index.entries.insert" | "index.entries.update" | "index.entries.remove" | "captions.list" | "captions.get" | "captions.insert" | "captions.update" | "captions.remove" | "captions.configure" | "fields.list" | "fields.get" | "fields.insert" | "fields.rebuild" | "fields.remove" | "citations.list" | "citations.get" | "citations.insert" | "citations.update" | "citations.remove" | "citations.sources.list" | "citations.sources.get" | "citations.sources.insert" | "citations.sources.update" | "citations.sources.remove" | "citations.bibliography.get" | "citations.bibliography.insert" | "citations.bibliography.rebuild" | "citations.bibliography.configure" | "citations.bibliography.remove" | "authorities.list" | "authorities.get" | "authorities.insert" | "authorities.configure" | "authorities.rebuild" | "authorities.remove" | "authorities.entries.list" | "authorities.entries.get" | "authorities.entries.insert" | "authorities.entries.update" | "authorities.entries.remove" | "diff.capture" | "diff.compare" | "diff.apply" | "export.toDocx" | "protection.get" | "protection.setEditingRestriction" | "protection.clearEditingRestriction" | "permissionRanges.list" | "permissionRanges.get" | "permissionRanges.create" | "permissionRanges.remove" | "permissionRanges.updatePrincipal" | "customXml.parts.list" | "customXml.parts.get" | "customXml.parts.create" | "customXml.parts.patch" | "customXml.parts.remove" | "metadata.attach" | "metadata.list" | "metadata.get" | "metadata.update" | "metadata.remove" | "metadata.resolve")[];
4
+ export declare const MUTATING_OPERATION_IDS: ("replace" | "find" | "delete" | "selection.extractOoxml" | "selection.current" | "selection.releaseSnapshot" | "insert" | "info" | "projectHtml" | "projectMarkdown" | "capabilities.check" | "format.apply" | "styles.getCatalog" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "tables.moveColumn" | "format.bold" | "format.strike" | "format.color" | "format.position" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.italic" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.dstrike" | "format.vertAlign" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.fitText" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "get" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "htmlToFragment" | "extract" | "clearContent" | "formatRange" | "blocks.findText" | "blocks.list" | "blocks.delete" | "blocks.deleteRange" | "styles.apply" | "styles.create" | "styles.getTheme" | "templates.apply" | "create.paragraph" | "create.heading" | "create.sectionBreak" | "sections.list" | "sections.get" | "sections.setBreakType" | "sections.setPageMargins" | "sections.setHeaderFooterMargins" | "sections.setPageSetup" | "sections.setColumns" | "sections.setLineNumbering" | "sections.setPageNumbering" | "sections.setTitlePage" | "sections.setOddEvenHeadersFooters" | "sections.setVerticalAlign" | "sections.setSectionDirection" | "sections.setHeaderFooterRef" | "sections.clearHeaderFooterRef" | "sections.setLinkToPrevious" | "sections.setPageBorders" | "sections.clearPageBorders" | "styles.paragraph.setStyle" | "styles.paragraph.setStyleRef" | "styles.paragraph.clearStyle" | "format.paragraph.resetDirectFormatting" | "format.paragraph.setAlignment" | "format.paragraph.clearAlignment" | "format.paragraph.setIndentation" | "format.paragraph.clearIndentation" | "format.paragraph.setSpacing" | "format.paragraph.clearSpacing" | "format.paragraph.setKeepOptions" | "format.paragraph.setOutlineLevel" | "format.paragraph.setFlowOptions" | "format.paragraph.setTabStop" | "format.paragraph.clearTabStop" | "format.paragraph.clearAllTabStops" | "format.paragraph.setBorder" | "format.paragraph.clearBorder" | "format.paragraph.setShading" | "format.paragraph.clearShading" | "format.paragraph.setDirection" | "format.paragraph.clearDirection" | "format.paragraph.setNumbering" | "lists.list" | "lists.get" | "lists.insert" | "lists.create" | "lists.attach" | "lists.detach" | "lists.delete" | "lists.indent" | "lists.outdent" | "lists.join" | "lists.canJoin" | "lists.separate" | "lists.merge" | "lists.split" | "lists.setLevel" | "lists.setValue" | "lists.continuePrevious" | "lists.canContinuePrevious" | "lists.setLevelRestart" | "lists.convertToText" | "lists.applyTemplate" | "lists.applyPreset" | "lists.setType" | "lists.captureTemplate" | "lists.setLevelNumbering" | "lists.setLevelBullet" | "lists.setLevelPictureBullet" | "lists.setLevelAlignment" | "lists.setLevelIndents" | "lists.setLevelTrailingCharacter" | "lists.setLevelMarkerFont" | "lists.clearLevelOverrides" | "lists.getStyle" | "lists.applyStyle" | "lists.restartAt" | "lists.setLevelNumberStyle" | "lists.setLevelText" | "lists.setLevelStart" | "lists.setLevelLayout" | "comments.create" | "comments.patch" | "comments.delete" | "comments.get" | "comments.list" | "trackChanges.list" | "trackChanges.get" | "trackChanges.decide" | "query.match" | "ranges.resolve" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "capabilities.resolve" | "create.table" | "tables.convertFromText" | "tables.delete" | "tables.clearContents" | "tables.move" | "tables.split" | "tables.convertToText" | "tables.setLayout" | "tables.insertRow" | "tables.deleteRow" | "tables.setRowHeight" | "tables.distributeRows" | "tables.setRowOptions" | "tables.insertColumn" | "tables.deleteColumn" | "tables.setColumnWidth" | "tables.distributeColumns" | "tables.insertCell" | "tables.deleteCell" | "tables.mergeCells" | "tables.unmergeCells" | "tables.splitCell" | "tables.setCellProperties" | "tables.setCellText" | "tables.sort" | "tables.setAltText" | "tables.setStyle" | "tables.clearStyle" | "tables.setStyleOption" | "tables.setBorder" | "tables.clearBorder" | "tables.applyBorderPreset" | "tables.setShading" | "tables.clearShading" | "tables.setTablePadding" | "tables.setCellPadding" | "tables.setCellSpacing" | "tables.clearCellSpacing" | "tables.applyStyle" | "tables.setBorders" | "tables.setTableOptions" | "tables.applyPreset" | "tables.get" | "tables.getCells" | "tables.getProperties" | "tables.getStyles" | "tables.setDefaultStyle" | "tables.clearDefaultStyle" | "create.tableOfContents" | "toc.list" | "toc.get" | "toc.configure" | "toc.update" | "toc.remove" | "toc.markEntry" | "toc.unmarkEntry" | "toc.listEntries" | "toc.getEntry" | "toc.editEntry" | "history.get" | "history.undo" | "history.redo" | "create.image" | "images.list" | "images.get" | "images.delete" | "images.move" | "images.convertToInline" | "images.convertToFloating" | "images.setSize" | "images.setWrapType" | "images.setWrapSide" | "images.setWrapDistances" | "images.setPosition" | "images.setAnchorOptions" | "images.setZOrder" | "images.scale" | "images.setLockAspectRatio" | "images.rotate" | "images.flip" | "images.crop" | "images.resetCrop" | "images.replaceSource" | "images.setAltText" | "images.setDecorative" | "images.setName" | "images.setHyperlink" | "images.insertCaption" | "images.updateCaption" | "images.removeCaption" | "hyperlinks.list" | "hyperlinks.get" | "hyperlinks.wrap" | "hyperlinks.insert" | "hyperlinks.patch" | "hyperlinks.remove" | "headerFooters.list" | "headerFooters.get" | "headerFooters.resolve" | "headerFooters.refs.set" | "headerFooters.refs.clear" | "headerFooters.refs.setLinkedToPrevious" | "headerFooters.parts.list" | "headerFooters.parts.create" | "headerFooters.parts.delete" | "headerFooters.pageNumbers.get" | "headerFooters.pageNumbers.insert" | "headerFooters.pageNumbers.set" | "headerFooters.pageNumbers.remove" | "watermarks.apply" | "watermarks.list" | "watermarks.insert" | "watermarks.replace" | "watermarks.remove" | "create.contentControl" | "contentControls.list" | "contentControls.get" | "contentControls.listInRange" | "contentControls.selectByTag" | "contentControls.selectByTitle" | "contentControls.listChildren" | "contentControls.getParent" | "contentControls.wrap" | "contentControls.unwrap" | "contentControls.delete" | "contentControls.copy" | "contentControls.move" | "contentControls.patch" | "contentControls.setLockMode" | "contentControls.setType" | "contentControls.getContent" | "contentControls.replaceContent" | "contentControls.clearContent" | "contentControls.appendContent" | "contentControls.prependContent" | "contentControls.insertBefore" | "contentControls.insertAfter" | "contentControls.getBinding" | "contentControls.setBinding" | "contentControls.clearBinding" | "contentControls.getRawProperties" | "contentControls.patchRawProperties" | "contentControls.validateWordCompatibility" | "contentControls.normalizeWordCompatibility" | "contentControls.normalizeTagPayload" | "contentControls.text.setMultiline" | "contentControls.text.setValue" | "contentControls.text.clearValue" | "contentControls.date.setValue" | "contentControls.date.clearValue" | "contentControls.date.setDisplayFormat" | "contentControls.date.setDisplayLocale" | "contentControls.date.setStorageFormat" | "contentControls.date.setCalendar" | "contentControls.checkbox.getState" | "contentControls.checkbox.setState" | "contentControls.checkbox.toggle" | "contentControls.checkbox.setSymbolPair" | "contentControls.choiceList.getItems" | "contentControls.choiceList.setItems" | "contentControls.choiceList.setSelected" | "contentControls.repeatingSection.listItems" | "contentControls.repeatingSection.insertItemBefore" | "contentControls.repeatingSection.insertItemAfter" | "contentControls.repeatingSection.cloneItem" | "contentControls.repeatingSection.deleteItem" | "contentControls.repeatingSection.setAllowInsertDelete" | "contentControls.group.wrap" | "contentControls.group.ungroup" | "bookmarks.list" | "bookmarks.get" | "bookmarks.insert" | "bookmarks.rename" | "bookmarks.remove" | "footnotes.list" | "footnotes.get" | "footnotes.insert" | "footnotes.update" | "footnotes.remove" | "footnotes.configure" | "clipboard.parse" | "clipboard.insert" | "clipboard.serializeSelection" | "crossRefs.list" | "crossRefs.get" | "crossRefs.insert" | "crossRefs.rebuild" | "crossRefs.remove" | "index.list" | "index.get" | "index.insert" | "index.configure" | "index.rebuild" | "index.remove" | "index.entries.list" | "index.entries.get" | "index.entries.insert" | "index.entries.update" | "index.entries.remove" | "captions.list" | "captions.get" | "captions.insert" | "captions.update" | "captions.remove" | "captions.configure" | "fields.list" | "fields.get" | "fields.insert" | "fields.rebuild" | "fields.remove" | "citations.list" | "citations.get" | "citations.insert" | "citations.update" | "citations.remove" | "citations.sources.list" | "citations.sources.get" | "citations.sources.insert" | "citations.sources.update" | "citations.sources.remove" | "citations.bibliography.get" | "citations.bibliography.insert" | "citations.bibliography.rebuild" | "citations.bibliography.configure" | "citations.bibliography.remove" | "authorities.list" | "authorities.get" | "authorities.insert" | "authorities.configure" | "authorities.rebuild" | "authorities.remove" | "authorities.entries.list" | "authorities.entries.get" | "authorities.entries.insert" | "authorities.entries.update" | "authorities.entries.remove" | "diff.capture" | "diff.compare" | "diff.apply" | "export.toDocx" | "protection.get" | "protection.setEditingRestriction" | "protection.clearEditingRestriction" | "permissionRanges.list" | "permissionRanges.get" | "permissionRanges.create" | "permissionRanges.remove" | "permissionRanges.updatePrincipal" | "customXml.parts.list" | "customXml.parts.get" | "customXml.parts.create" | "customXml.parts.patch" | "customXml.parts.remove" | "metadata.attach" | "metadata.list" | "metadata.get" | "metadata.update" | "metadata.remove" | "metadata.resolve")[];
5
5
  /** Maps each operation to its human-readable description. */
6
6
  export declare const OPERATION_DESCRIPTION_MAP: Record<OperationId, string>;
7
7
  /** Maps each operation to whether it requires an open document to execute. */
@@ -40,6 +40,15 @@ export declare const OPERATION_DEFINITIONS: {
40
40
  readonly referenceDocPath: "styles/apply.mdx";
41
41
  readonly referenceGroup: "styles";
42
42
  };
43
+ readonly 'styles.create': {
44
+ readonly memberPath: "styles.create";
45
+ readonly description: "Define or redefine a named paragraph or character style in the Style Definitions part. Replaces the definition rather than merging into it, and decides conflicts on both styleId and name, because Word keys its Styles gallery on the name. Linked style pairs and table/numbering styles are out of scope.";
46
+ readonly expectedResult: "Returns a StylesCreateReceipt reporting whether the style was created or redefined, with per-channel before/after state for the paragraph and run properties.";
47
+ readonly requiresDocumentContext: true;
48
+ readonly metadata: CommandStaticMetadata;
49
+ readonly referenceDocPath: "styles/create.mdx";
50
+ readonly referenceGroup: "styles";
51
+ };
43
52
  readonly 'styles.getCatalog': {
44
53
  readonly memberPath: "styles.getCatalog";
45
54
  readonly description: "List the available styles as a normalized catalogue with stable IDs, display names, type, visibility, priority, provenance, and source diagnostics. Supports view (quickGallery/recommended/currentDocument/all/inUse), type filtering, hidden/latent inclusion, usage rollups, and UI-safe preview tokens. Distinct from DocumentInfo.styles, which is a usage summary.";
@@ -49,6 +58,15 @@ export declare const OPERATION_DEFINITIONS: {
49
58
  readonly referenceDocPath: "styles/get-catalog.mdx";
50
59
  readonly referenceGroup: "styles";
51
60
  };
61
+ readonly 'styles.getTheme': {
62
+ readonly memberPath: "styles.getTheme";
63
+ readonly description: "Read the document theme: its 12 theme colors, major and minor fonts, and the color mapping from settings.xml. A missing or malformed theme part returns the default Office theme labeled source 'fallback', with part status and diagnostics. Same theme as doc.get().theme, without the rest of the document.";
64
+ readonly expectedResult: "Returns a StylesGetThemeResult with the theme (always present, labeled document or fallback), the theme and settings part status, and diagnostics.";
65
+ readonly requiresDocumentContext: true;
66
+ readonly metadata: CommandStaticMetadata;
67
+ readonly referenceDocPath: "styles/get-theme.mdx";
68
+ readonly referenceGroup: "styles";
69
+ };
52
70
  readonly 'templates.apply': {
53
71
  readonly memberPath: "templates.apply";
54
72
  readonly description: "Apply detected DOCX template/substrate (styles, numbering, settings, theme, font table, web settings, headers/footers, section defaults) from a source package onto the current document, preserving body content. Scopes are auto-detected from source package evidence.";
@@ -3650,7 +3668,7 @@ export declare const OPERATION_DEFINITIONS: {
3650
3668
  readonly get: {
3651
3669
  readonly memberPath: "get";
3652
3670
  readonly description: "Read the full document as an SDDocument structure.";
3653
- readonly expectedResult: "Returns an SDDocument with body content projected into SDM/1 canonical shapes.";
3671
+ readonly expectedResult: "Returns an SDDocument with body content projected into SDM/1 canonical shapes, plus the document's authored styles, theme (labeled document or fallback), docDefaults, and diagnostics for missing or unreadable style parts.";
3654
3672
  readonly requiresDocumentContext: true;
3655
3673
  readonly metadata: CommandStaticMetadata;
3656
3674
  readonly referenceDocPath: "get.mdx";
@@ -14,6 +14,7 @@ export interface GetAdapter {
14
14
  *
15
15
  * @param adapter - Engine-specific get adapter.
16
16
  * @param input - Canonical get input object.
17
- * @returns An SDDocument with body content projected into SDM/1 canonical shapes.
17
+ * @returns An SDDocument with body content projected into SDM/1 canonical shapes,
18
+ * plus the document's authored styles, theme, docDefaults and diagnostics.
18
19
  */
19
20
  export declare function executeGet(adapter: GetAdapter, input: SDGetInput): SDDocument;
@@ -4,7 +4,7 @@ import { DeleteInput } from './delete/delete.js';
4
4
  import { FindAdapter } from './find/find.js';
5
5
  import { SDFindInput, SDFindResult, SDGetInput, SDNodeResult } from './types/sd-envelope.js';
6
6
  import { FormatApi, FormatRangeInput } from './format/format.js';
7
- import { StylesAdapter, StylesApi } from './styles/index.js';
7
+ import { StylesAdapter, StylesApi, StylesCreateAdapter, StylesCreateApi } from './styles/index.js';
8
8
  import { TemplatesAdapter, TemplatesApi } from './templates/index.js';
9
9
  import { GetNodeAdapter, GetNodeByIdInput } from './get-node/get-node.js';
10
10
  import { GetAdapter } from './get/get.js';
@@ -112,8 +112,10 @@ export type { FormatInlineAliasApi, FormatInlineAliasInput, FormatBoldInput, For
112
112
  export type { InlineRunPatch, InlineRunPatchKey, InlinePropertyStorage, InlinePropertyType, InlinePropertyCarrier, InlinePropertyRegistryEntry, UnderlinePatch, ShadingPatch, BorderPatch, FitTextPatch, LangPatch, RFontsPatch, EastAsianLayoutPatch, StylisticSetPatch, } from './format/inline-run-patch.js';
113
113
  export { INLINE_PROPERTY_REGISTRY, INLINE_PROPERTY_KEY_SET, INLINE_PROPERTY_BY_KEY, INLINE_PROPERTY_KEYS_BY_STORAGE, validateInlineRunPatch, buildInlineRunPatchSchema, } from './format/inline-run-patch.js';
114
114
  export { PROPERTY_REGISTRY, EXCLUDED_KEYS, ALLOWED_KEYS_BY_CHANNEL, getPropertyDefinition, toJsonSchema, buildPatchSchema, buildStateSchema, } from './styles/index.js';
115
- export type { ValueSchema, MergeStrategy, PropertyDefinition, StylesAdapter, StylesApplyInput, StylesApplyRunInput, StylesApplyParagraphInput, StylesApplyOptions, StylesApplyReceipt, StylesBooleanState, StylesNumberState, StylesEnumState, StylesObjectState, StylesArrayState, StylesStateMap, StylesChannel, StylesRunPatch, StylesParagraphPatch, StylesTargetResolution, StylesApplyReceiptSuccess, StylesApplyReceiptFailure, NormalizedStylesApplyOptions, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogDiagnosticSeverity, StyleSourcePartStatus, StyleCatalogUsageStatus, StyleCatalogPreviewStatus, StyleCatalogViewStatus, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, StylesGetCatalogAdapter, } from './styles/index.js';
116
- export { STYLE_CATALOG_VIEWS, STYLE_CATALOG_FILTER_TYPES, executeStylesGetCatalog, validateStylesGetCatalogInput, } from './styles/index.js';
115
+ export type { ValueSchema, MergeStrategy, PropertyDefinition, StylesAdapter, StylesApplyInput, StylesApplyRunInput, StylesApplyParagraphInput, StylesApplyOptions, StylesApplyReceipt, StylesBooleanState, StylesNumberState, StylesEnumState, StylesObjectState, StylesArrayState, StylesStateMap, StylesChannel, StylesRunPatch, StylesParagraphPatch, StylesTargetResolution, StylesApplyReceiptSuccess, StylesApplyReceiptFailure, NormalizedStylesApplyOptions, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogDiagnosticSeverity, StyleSourcePartStatus, StyleCatalogUsageStatus, StyleCatalogPreviewStatus, StyleCatalogViewStatus, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogPreviewFontSource, StyleCatalogPreviewColorSource, StyleCatalogPreviewSources, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, StylesGetCatalogAdapter, StylesGetThemeInput, StylesThemeSourceStatus, StylesGetThemeResult, StylesGetThemeAdapter, } from './styles/index.js';
116
+ export { STYLE_CATALOG_VIEWS, STYLE_CATALOG_FILTER_TYPES, executeStylesGetCatalog, validateStylesGetCatalogInput, executeStylesGetTheme, validateStylesGetThemeInput, } from './styles/index.js';
117
+ export type { StylesScope, StyleRunPatch, StyleConflictPolicy, StyleChannelState, StylesCreateAdapter, StylesCreateApi, StylesCreateInput, StylesCreateParagraphInput, StylesCreateCharacterInput, StylesCreateOptions, NormalizedStylesCreateOptions, StylesCreateResolution, StylesCreateReceipt, StylesCreateReceiptSuccess, StylesCreateReceiptFailure, } from './styles/index.js';
118
+ export { STYLE_EXCLUDED_KEYS, EXCLUDED_KEYS_BY_SCOPE, SCOPE_LABEL, STYLE_XML_PATH, executeStylesCreate, validateStylesCreateInput, validateStylesCreateOptions, validatePatchObject, } from './styles/index.js';
117
119
  export type { TemplatesAdapter, TemplatesApi, TemplatesApplyInput, TemplatesApplyOptions, TemplatesApplySource, TemplatesApplySourcePath, TemplatesApplySourceBase64, TemplateBodyPolicy, TemplateScope, NormalizedTemplatesApplyOptions, TemplateScopeReport, TemplateSkipReason, TemplateScopeSkip, TemplateUnsupportedItem, TemplateChangeKind, TemplateChangedPart, TemplateIdMapping, TemplateApplyWarning, TemplatesApplySourceInfo, TemplatesApplyReceiptSuccess, TemplatesApplyFailureCode, TemplatesApplyReceiptFailure, TemplatesApplyReceipt, } from './templates/index.js';
118
120
  export { executeTemplatesApply } from './templates/index.js';
119
121
  export type { CreateAdapter, CreateApi } from './create/create.js';
@@ -280,7 +282,8 @@ export interface DocumentApiSurface {
280
282
  /**
281
283
  * Read the full document as an SDDocument structure.
282
284
  * @param input - Get input with optional read options.
283
- * @returns An SDDocument with body content projected into SDM/1 canonical shapes.
285
+ * @returns An SDDocument with body content projected into SDM/1 canonical shapes,
286
+ * plus the document's authored styles, theme, docDefaults and diagnostics.
284
287
  */
285
288
  get(input: SDGetInput): SDDocument;
286
289
  /**
@@ -373,7 +376,7 @@ export interface DocumentApiSurface {
373
376
  /**
374
377
  * Stylesheet operations (docDefaults, style definitions, paragraph style references).
375
378
  */
376
- styles: StylesApi & {
379
+ styles: StylesApi & StylesCreateApi & {
377
380
  paragraph: ParagraphStylesApi;
378
381
  };
379
382
  /**
@@ -560,7 +563,7 @@ export interface DocumentApiAdapters {
560
563
  comments: CommentsAdapter;
561
564
  write: WriteAdapter;
562
565
  selectionMutation: SelectionMutationAdapter;
563
- styles: StylesAdapter;
566
+ styles: StylesAdapter & Partial<StylesCreateAdapter>;
564
567
  templates: TemplatesAdapter;
565
568
  trackChanges: TrackChangesAdapter;
566
569
  create: CreateAdapter;
@@ -32,3 +32,14 @@ export declare const ST_THEME_COLOR_VALUES: readonly ["dark1", "light1", "dark2"
32
32
  export type StThemeColorValue = (typeof ST_THEME_COLOR_VALUES)[number];
33
33
  /** Runtime set for O(1) ST_ThemeColor validation. */
34
34
  export declare const ST_THEME_COLOR_VALUE_SET: ReadonlySet<string>;
35
+ /**
36
+ * Accepted `w:val` values for `w:highlight`. A closed enumeration, unlike a
37
+ * colour value: anything outside it produces a document Word offers to repair.
38
+ *
39
+ * No `StHighlightValue` alias beside it, unlike the sets above:
40
+ * {@link SDHighlightColor} in `types/sd-props.ts` is already derived from this
41
+ * list, and a second name for one union is a second thing to keep in step.
42
+ */
43
+ export declare const ST_HIGHLIGHT_VALUES: readonly ["black", "blue", "cyan", "green", "magenta", "red", "yellow", "white", "darkBlue", "darkCyan", "darkGreen", "darkMagenta", "darkRed", "darkYellow", "darkGray", "lightGray", "none"];
44
+ /** Runtime set for O(1) ST_HighlightColor validation. */
45
+ export declare const ST_HIGHLIGHT_VALUE_SET: ReadonlySet<string>;
@@ -1,6 +1,7 @@
1
1
  import { ReceiptFailure } from '../types/receipt.js';
2
2
  import { StylesChannel } from './registry.js';
3
3
  import { StylesGetCatalogInput, StylesGetCatalogResult } from './catalog.js';
4
+ import { StylesGetThemeInput, StylesGetThemeResult } from './theme.js';
4
5
  /** Tri-state for OOXML boolean style properties. */
5
6
  export type StylesBooleanState = 'on' | 'off' | 'inherit';
6
7
  export type StylesNumberState = number | 'inherit';
@@ -123,6 +124,8 @@ export interface StylesAdapter {
123
124
  apply(input: StylesApplyInput, options: NormalizedStylesApplyOptions): StylesApplyReceipt;
124
125
  /** Read the normalized style catalogue. See `styles/catalog.ts`. */
125
126
  getCatalog?(input?: StylesGetCatalogInput): StylesGetCatalogResult;
127
+ /** Read the document theme. See `styles/theme.ts`. */
128
+ getTheme?(input?: StylesGetThemeInput): StylesGetThemeResult;
126
129
  }
127
130
  export interface NormalizedStylesApplyOptions {
128
131
  dryRun: boolean;
@@ -134,6 +137,8 @@ export interface StylesApi {
134
137
  apply(input: StylesApplyInput, options?: StylesApplyOptions): StylesApplyReceipt;
135
138
  /** Read the normalized style catalogue for discovery and quick-gallery UI. */
136
139
  getCatalog(input?: StylesGetCatalogInput): StylesGetCatalogResult;
140
+ /** Read the document theme: colors, fonts and color mapping. */
141
+ getTheme(input?: StylesGetThemeInput): StylesGetThemeResult;
137
142
  }
138
143
  /**
139
144
  * Executes `styles.apply` using the provided adapter.
@@ -1,22 +1,4 @@
1
- /**
2
- * `styles.getCatalog`: read-only style catalogue projection.
3
- *
4
- * The catalogue is the stable, normalized, editor-neutral view of the styles
5
- * available in a document. It is the SDK / CLI / MCP / custom-UI integration
6
- * point for style discovery, and the source the built-in toolbar and the
7
- * future Styles pane consume.
8
- *
9
- * This module owns only the public contract types, input validation, and the
10
- * execution entry point. The runtime projection is produced by the v2 adapter
11
- * (which compiles a Word style model from package parts and calls the shared
12
- * style-model projector); the raw style-engine shapes never reach this public
13
- * surface.
14
- *
15
- * `DocumentInfo.styles` is a usage summary and intentionally stays separate
16
- * from this available-style catalogue.
17
- *
18
- * Engine-agnostic: no ProseMirror, Yjs, or converter imports.
19
- */
1
+ import { SDThemeColorName, SDThemeFontRef } from '../types/sd-props.js';
20
2
  /** Catalogue view selector. `inUse` lists styles referenced by document content. */
21
3
  export type StyleCatalogView = 'quickGallery' | 'recommended' | 'currentDocument' | 'all' | 'inUse';
22
4
  /** Normalized style kind. `linked` is a deduplicated paragraph/character pair. */
@@ -60,10 +42,47 @@ export interface StyleCatalogItemUsage {
60
42
  tableCount?: number;
61
43
  numberingCount?: number;
62
44
  }
45
+ /**
46
+ * Where a preview font came from. `theme` names the theme font slot it was
47
+ * resolved from; `fallback: true` means the document has no usable theme and
48
+ * the value is the default Office theme's.
49
+ */
50
+ export type StyleCatalogPreviewFontSource = {
51
+ origin: 'literal';
52
+ } | {
53
+ origin: 'theme';
54
+ themeFont: SDThemeFontRef;
55
+ fallback?: true;
56
+ };
57
+ /**
58
+ * Where a preview color came from. `theme` names the theme color and the
59
+ * tint/shade bytes (0-255) applied to it, as in `SDColorRef`.
60
+ */
61
+ export type StyleCatalogPreviewColorSource = {
62
+ origin: 'literal';
63
+ } | {
64
+ origin: 'theme';
65
+ themeColor: SDThemeColorName;
66
+ tint?: number;
67
+ shade?: number;
68
+ fallback?: true;
69
+ }
70
+ /** The document sets no color (Word's automatic color); the value is the black text renders with. */
71
+ | {
72
+ origin: 'default';
73
+ };
74
+ /** Origin of the theme-capable preview tokens. A token without a source is absent from `css`. */
75
+ export interface StyleCatalogPreviewSources {
76
+ fontFamily?: StyleCatalogPreviewFontSource;
77
+ color?: StyleCatalogPreviewColorSource;
78
+ }
63
79
  /** Optional resolved preview tokens. Present when `includePreview` is requested. */
64
80
  export interface StyleCatalogItemPreview {
65
81
  available: boolean;
82
+ /** UI-safe CSS tokens. Theme fonts and colors are already resolved. */
66
83
  css?: Record<string, string | number>;
84
+ /** Whether `css.fontFamily` and `css.color` came from the theme or were set directly. */
85
+ sources?: StyleCatalogPreviewSources;
67
86
  unsupportedReason?: string;
68
87
  }
69
88
  /** One normalized style. Linked paragraph/character pairs are deduplicated. */
@@ -108,6 +127,8 @@ export interface StyleCatalogDiagnostic {
108
127
  export interface StyleCatalogSourceStatus {
109
128
  styles: StyleSourcePartStatus;
110
129
  settings: StyleSourcePartStatus;
130
+ /** The theme part that theme-backed preview fonts and colors resolve against. */
131
+ theme?: StyleSourcePartStatus;
111
132
  usage: StyleCatalogUsageStatus;
112
133
  preview: StyleCatalogPreviewStatus;
113
134
  view: StyleCatalogViewStatus;
@@ -0,0 +1,160 @@
1
+ import { ReceiptFailure } from '../types/receipt.js';
2
+ import { SDHighlightColor } from '../types/sd-props.js';
3
+ import { StylesParagraphPatch, StylesRunPatch, StylesStateMap } from './apply.js';
4
+ /**
5
+ * Run properties of a named style.
6
+ *
7
+ * A superset of {@link StylesRunPatch}: the four properties Word forbids in
8
+ * `w:docDefaults` and allows on a `w:style` are reachable here and nowhere
9
+ * else. `rtl` in particular is the property that makes a run right-to-left, so
10
+ * without it no right-to-left style could be authored through this API.
11
+ */
12
+ export interface StyleRunPatch extends StylesRunPatch {
13
+ /** `w:cs` — treat the run as complex-script. */
14
+ cs?: boolean;
15
+ /** `w:rtl` — right-to-left run. */
16
+ rtl?: boolean;
17
+ /** `w:oMath` — the run is part of an equation. */
18
+ oMath?: boolean;
19
+ /** `w:highlight` — one of the closed `ST_HighlightColor` tokens. */
20
+ highlight?: SDHighlightColor;
21
+ }
22
+ /** What to do when a style with this `id`, or this `name`, already exists. */
23
+ export type StyleConflictPolicy = 'fail' | 'replace';
24
+ interface StylesCreateCommon {
25
+ /** `w:styleId`. Named `id` to match {@link StyleCatalogItem.id} on read. */
26
+ id: string;
27
+ /** `w:name`. */
28
+ name: string;
29
+ /** `w:basedOn`. `null` states "based on nothing" explicitly. */
30
+ basedOn?: string | null;
31
+ /** `w:aliases`, one entry per alias. */
32
+ aliases?: string[];
33
+ /** `w:uiPriority`. Named `priority` to match the catalogue on read. */
34
+ priority?: number | null;
35
+ /** `w:qFormat` — offer the style in Word's quick gallery. */
36
+ qFormat?: boolean;
37
+ /** `w:hidden`. */
38
+ hidden?: boolean;
39
+ /** `w:semiHidden`. */
40
+ semiHidden?: boolean;
41
+ /** `w:unhideWhenUsed`. */
42
+ unhideWhenUsed?: boolean;
43
+ /** `w:locked`. */
44
+ locked?: boolean;
45
+ /**
46
+ * `w:customStyle`. Defaults to `true`, which is what a style authored
47
+ * through this API is. Setting it `false` on a style whose name is not a
48
+ * built-in makes Word treat the name as one and re-label or hide the style.
49
+ */
50
+ custom?: boolean;
51
+ /** Defaults to `'fail'`. */
52
+ conflictPolicy?: StyleConflictPolicy;
53
+ }
54
+ export interface StylesCreateParagraphInput extends StylesCreateCommon {
55
+ type: 'paragraph';
56
+ /** `w:next`. May name the style being created. */
57
+ next?: string | null;
58
+ /** `w:style/w:pPr`. */
59
+ paragraph?: StylesParagraphPatch;
60
+ /** `w:style/w:rPr`. */
61
+ run?: StyleRunPatch;
62
+ }
63
+ export interface StylesCreateCharacterInput extends StylesCreateCommon {
64
+ type: 'character';
65
+ /** A character style has no following-paragraph style. */
66
+ next?: never;
67
+ /** A character style has no paragraph properties. */
68
+ paragraph?: never;
69
+ /** `w:style/w:rPr`. */
70
+ run?: StyleRunPatch;
71
+ }
72
+ export type StylesCreateInput = StylesCreateParagraphInput | StylesCreateCharacterInput;
73
+ export interface StylesCreateOptions {
74
+ dryRun?: boolean;
75
+ expectedRevision?: string;
76
+ }
77
+ export interface NormalizedStylesCreateOptions {
78
+ dryRun: boolean;
79
+ expectedRevision: string | undefined;
80
+ }
81
+ export interface StylesCreateResolution {
82
+ scope: 'style';
83
+ id: string;
84
+ type: 'paragraph' | 'character';
85
+ xmlPart: string;
86
+ /**
87
+ * Literal, not `string`: `styles.apply` pins its two paths in the published
88
+ * schema and exports them as constants for the adapter to bind to. Without
89
+ * the narrowing an adapter could report the more specific
90
+ * `w:styles/w:style[@w:styleId='X']`, type-check, and then fail the schema.
91
+ */
92
+ xmlPath: typeof STYLE_XML_PATH;
93
+ }
94
+ /** The `w:style` element path. Predicate-free, like `XML_PATH_BY_CHANNEL`. */
95
+ export declare const STYLE_XML_PATH = "w:styles/w:style";
96
+ /**
97
+ * Per-channel state, unlike {@link StylesApplyReceipt}'s flat map.
98
+ *
99
+ * `styles.apply` can be flat because `resolution.channel` says which channel
100
+ * the map describes. One `w:style` carries both at once, and `snapToGrid`,
101
+ * `shading` and `borders` exist on both — `borders` with genuinely different
102
+ * shapes (`w:bdr`, one border, against `w:pBdr`, six edges). Folded together
103
+ * they would be indistinguishable.
104
+ */
105
+ export interface StyleChannelState {
106
+ paragraph: StylesStateMap | null;
107
+ run: StylesStateMap | null;
108
+ }
109
+ export interface StylesCreateReceiptSuccess {
110
+ success: true;
111
+ /** `false` when the definition already matched the input. */
112
+ changed: boolean;
113
+ /**
114
+ * `false` when an existing style was redefined under `conflictPolicy:
115
+ * 'replace'`. `created: true` implies `changed: true`. Under `dryRun` it
116
+ * describes what the call would have done.
117
+ *
118
+ * `ReceiptSuccess.inserted` / `updated` are deliberately not used: they take
119
+ * `EntityAddress`, and a style definition is not addressable as a document
120
+ * entity.
121
+ */
122
+ created: boolean;
123
+ resolution: StylesCreateResolution;
124
+ dryRun: boolean;
125
+ /** `null` when the style did not exist. */
126
+ before: StyleChannelState | null;
127
+ after: StyleChannelState;
128
+ }
129
+ export interface StylesCreateReceiptFailure {
130
+ success: false;
131
+ failure: ReceiptFailure;
132
+ }
133
+ export type StylesCreateReceipt = StylesCreateReceiptSuccess | StylesCreateReceiptFailure;
134
+ export interface StylesCreateAdapter {
135
+ create(input: StylesCreateInput, options: NormalizedStylesCreateOptions): StylesCreateReceipt;
136
+ }
137
+ export interface StylesCreateApi {
138
+ create(input: StylesCreateInput, options?: StylesCreateOptions): StylesCreateReceipt;
139
+ }
140
+ /**
141
+ * Validates the shape of `styles.create` input.
142
+ *
143
+ * Deliberately shallow on identifiers: `id` is checked for "non-empty string"
144
+ * and nothing more, exactly as `styles.paragraph.setStyleRef` checks the same
145
+ * field. `w:styleId` is an `ST_String`, real documents carry ids with spaces,
146
+ * and a stricter rule here would mean `setStyleRef` could apply a style that
147
+ * `styles.create` cannot express.
148
+ */
149
+ export declare function validateStylesCreateInput(input: unknown): asserts input is StylesCreateInput;
150
+ export declare function validateStylesCreateOptions(options: unknown): void;
151
+ /**
152
+ * Executes `styles.create` using the provided adapter.
153
+ *
154
+ * Fails closed when the host engine has no `create` hook, the same way
155
+ * `executeStylesGetCatalog` does for its optional catalogue hook — input is
156
+ * validated first, so a malformed call is reported as malformed rather than as
157
+ * an unavailable capability.
158
+ */
159
+ export declare function executeStylesCreate(adapter: Partial<StylesCreateAdapter> | null | undefined, input: StylesCreateInput, options?: StylesCreateOptions): StylesCreateReceipt;
160
+ export {};
@@ -3,12 +3,16 @@
3
3
  *
4
4
  * Public surface only: internal validation/schema helpers are not exposed.
5
5
  */
6
- export type { ValueSchema, StylesChannel, MergeStrategy, PropertyDefinition } from './registry.js';
7
- export { PROPERTY_REGISTRY, ALLOWED_KEYS_BY_CHANNEL, EXCLUDED_KEYS, XML_PATH_BY_CHANNEL, getPropertyDefinition, ST_VERTICAL_ALIGN_RUN, ST_EM, ST_TEXT_ALIGNMENT, ST_TEXT_DIRECTION, ST_TEXTBOX_TIGHT_WRAP, ST_TEXT_TRANSFORM, ST_JUSTIFICATION, } from './registry.js';
6
+ export type { ValueSchema, StylesChannel, StylesScope, MergeStrategy, PropertyDefinition } from './registry.js';
7
+ export { PROPERTY_REGISTRY, ALLOWED_KEYS_BY_CHANNEL, EXCLUDED_KEYS, STYLE_EXCLUDED_KEYS, EXCLUDED_KEYS_BY_SCOPE, SCOPE_LABEL, XML_PATH_BY_CHANNEL, getPropertyDefinition, ST_VERTICAL_ALIGN_RUN, ST_EM, ST_TEXT_ALIGNMENT, ST_TEXT_DIRECTION, ST_TEXTBOX_TIGHT_WRAP, ST_TEXT_TRANSFORM, ST_JUSTIFICATION, } from './registry.js';
8
8
  export { toJsonSchema, buildPatchSchema, buildStateSchema } from './schema.js';
9
9
  export type { StylesBooleanState, StylesNumberState, StylesEnumState, StylesObjectState, StylesArrayState, StylesRunPatch, StylesParagraphPatch, StylesTargetResolution, StylesApplyRunInput, StylesApplyParagraphInput, StylesApplyInput, StylesApplyOptions, StylesStateMap, StylesApplyReceiptSuccess, StylesApplyReceiptFailure, StylesApplyReceipt, StylesAdapter, NormalizedStylesApplyOptions, StylesApi, } from './apply.js';
10
10
  export { executeStylesApply } from './apply.js';
11
- export type { StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogDiagnosticSeverity, StyleSourcePartStatus, StyleCatalogUsageStatus, StyleCatalogPreviewStatus, StyleCatalogViewStatus, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, StylesGetCatalogAdapter, } from './catalog.js';
11
+ export type { StyleRunPatch, StyleConflictPolicy, StyleChannelState, StylesCreateParagraphInput, StylesCreateCharacterInput, StylesCreateInput, StylesCreateOptions, NormalizedStylesCreateOptions, StylesCreateResolution, StylesCreateReceiptSuccess, StylesCreateReceiptFailure, StylesCreateReceipt, StylesCreateAdapter, StylesCreateApi, } from './create.js';
12
+ export { STYLE_XML_PATH, executeStylesCreate, validateStylesCreateInput, validateStylesCreateOptions, } from './create.js';
13
+ export type { StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogDiagnosticSeverity, StyleSourcePartStatus, StyleCatalogUsageStatus, StyleCatalogPreviewStatus, StyleCatalogViewStatus, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogPreviewFontSource, StyleCatalogPreviewColorSource, StyleCatalogPreviewSources, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, StylesGetCatalogAdapter, } from './catalog.js';
12
14
  export { STYLE_CATALOG_VIEWS, STYLE_CATALOG_FILTER_TYPES, executeStylesGetCatalog, validateStylesGetCatalogInput, } from './catalog.js';
15
+ export type { StylesGetThemeInput, StylesThemeSourceStatus, StylesGetThemeResult, StylesGetThemeAdapter, } from './theme.js';
16
+ export { executeStylesGetTheme, validateStylesGetThemeInput } from './theme.js';
13
17
  export type { PatchKeyClassification } from './validation.js';
14
- export { validateValue, classifyPatchKey } from './validation.js';
18
+ export { validateValue, classifyPatchKey, validatePatchObject } from './validation.js';
@@ -1,4 +1,4 @@
1
- import { ST_UNDERLINE_VALUES } from '../inline-semantics/token-sets.js';
1
+ import { ST_HIGHLIGHT_VALUES, ST_UNDERLINE_VALUES } from '../inline-semantics/token-sets.js';
2
2
  export declare const ST_VERTICAL_ALIGN_RUN: readonly ["superscript", "subscript", "baseline"];
3
3
  export declare const ST_EM: readonly ["none", "dot", "comma", "circle", "sesame"];
4
4
  export declare const ST_TEXT_ALIGNMENT: readonly ["top", "center", "baseline", "bottom", "auto"];
@@ -6,7 +6,7 @@ export declare const ST_TEXT_DIRECTION: readonly ["lrTb", "tbRl", "btLr", "lrTbV
6
6
  export declare const ST_TEXTBOX_TIGHT_WRAP: readonly ["none", "allLines", "firstAndLastLine", "firstLineOnly", "lastLineOnly"];
7
7
  export declare const ST_TEXT_TRANSFORM: readonly ["uppercase", "none"];
8
8
  export declare const ST_JUSTIFICATION: readonly ["left", "center", "right", "justify", "distribute"];
9
- export { ST_UNDERLINE_VALUES };
9
+ export { ST_HIGHLIGHT_VALUES, ST_UNDERLINE_VALUES };
10
10
  /** Recursive schema AST describing the shape of a property value. */
11
11
  export type ValueSchema = {
12
12
  kind: 'boolean';
@@ -41,3 +41,35 @@ export declare const ALLOWED_KEYS_BY_CHANNEL: Record<StylesChannel, Set<string>>
41
41
  export declare function getPropertyDefinition(key: string, channel: StylesChannel): PropertyDefinition | undefined;
42
42
  export declare const EXCLUDED_KEYS: Record<StylesChannel, Map<string, string>>;
43
43
  export declare const XML_PATH_BY_CHANNEL: Record<StylesChannel, string>;
44
+ /**
45
+ * Where in `word/styles.xml` a patch is being written.
46
+ *
47
+ * The exclusion list is a property of the *destination*, not of the property:
48
+ * `w:rtl` is disallowed in `w:docDefaults` and perfectly legal on a named
49
+ * `w:style`. Before this split, `EXCLUDED_KEYS` was the docDefaults list and
50
+ * the only list, so every caller inherited a restriction that only one of
51
+ * them was subject to.
52
+ *
53
+ * `docDefaults` is unchanged and remains what `styles.apply` uses.
54
+ */
55
+ export type StylesScope = 'docDefaults' | 'style';
56
+ /**
57
+ * Keys excluded from a named `w:style`.
58
+ *
59
+ * Narrower than the docDefaults list on the run channel by exactly the four
60
+ * properties the style model reads back off a `w:style` (see the registry
61
+ * entries). `w:rPrChange` stays out because it is a revision-tracking wrapper
62
+ * around document content, and `w:rStyle` because the style model does not
63
+ * carry it on `StyleDefinition.runProperties`.
64
+ *
65
+ * The paragraph channel is unchanged: every key it excludes — `w:cnfStyle`,
66
+ * `w:divId`, `w:pPrChange`, `w:pStyle`, `w:pPr/w:rPr`, `w:sectPr` — is as
67
+ * out of place inside `w:style/w:pPr` as it is inside docDefaults. Run
68
+ * properties on a style live in `w:style/w:rPr`, which is the `run` channel
69
+ * here, not in `w:pPr/w:rPr`.
70
+ */
71
+ export declare const STYLE_EXCLUDED_KEYS: Record<StylesChannel, Map<string, string>>;
72
+ /** Exclusion lists by destination. Defaults everywhere are `docDefaults`. */
73
+ export declare const EXCLUDED_KEYS_BY_SCOPE: Record<StylesScope, Record<StylesChannel, Map<string, string>>>;
74
+ /** Human-readable destination, for validation messages. */
75
+ export declare const SCOPE_LABEL: Record<StylesScope, string>;
@@ -1,9 +1,28 @@
1
- import { ValueSchema, StylesChannel } from './registry.js';
1
+ import { ValueSchema, StylesChannel, StylesScope } from './registry.js';
2
2
  type JsonSchema = Record<string, unknown>;
3
3
  /** Converts a ValueSchema AST node to a JSON Schema object. */
4
4
  export declare function toJsonSchema(schema: ValueSchema): JsonSchema;
5
- /** Builds a JSON Schema for the patch object of a given channel. */
6
- export declare function buildPatchSchema(channel: StylesChannel): JsonSchema;
7
- /** Builds a JSON Schema for the before/after state map covering all registry keys. */
8
- export declare function buildStateSchema(): JsonSchema;
5
+ /**
6
+ * Builds a JSON Schema for the patch object of a given channel and scope.
7
+ *
8
+ * The scope filter is what keeps the published `styles.apply` schema honest:
9
+ * the registry now carries run properties that only a named style accepts, and
10
+ * a schema that advertised them on `docDefaults` would describe an input the
11
+ * validator rejects.
12
+ */
13
+ export declare function buildPatchSchema(channel: StylesChannel, scope?: StylesScope): JsonSchema;
14
+ /**
15
+ * Builds a JSON Schema for the before/after state map of a given scope.
16
+ *
17
+ * Scoped for the same reason `buildPatchSchema` is: a receipt cannot report
18
+ * state for a property the scope does not accept, and advertising one both
19
+ * misleads a contract-driven caller and loosens receipt validation, since these
20
+ * objects carry `additionalProperties: false`.
21
+ *
22
+ * `channel` narrows it further, for a receipt that reports the two channels
23
+ * separately. Omitted, both fold into one map — correct only where something
24
+ * else in the receipt says which channel it describes, as `styles.apply`'s
25
+ * `resolution.channel` does.
26
+ */
27
+ export declare function buildStateSchema(scope?: StylesScope, channel?: StylesChannel): JsonSchema;
9
28
  export {};
@@ -0,0 +1,32 @@
1
+ import { SDTheme } from '../types/sd-styles.js';
2
+ import { StyleCatalogDiagnostic, StyleSourcePartStatus } from './catalog.js';
3
+ /** `styles.getTheme` takes no options. */
4
+ export type StylesGetThemeInput = Record<string, never>;
5
+ /**
6
+ * Status of the package parts the theme is read from. A `missing` or
7
+ * `malformed` theme part still yields a theme: the default Office theme,
8
+ * labeled `source: 'fallback'`.
9
+ */
10
+ export interface StylesThemeSourceStatus {
11
+ theme: StyleSourcePartStatus;
12
+ /** `word/settings.xml`, which carries `w:clrSchemeMapping`. */
13
+ settings: StyleSourcePartStatus;
14
+ }
15
+ export interface StylesGetThemeResult {
16
+ /** Always present. `source` says whether it is the document's own theme or the Office fallback. */
17
+ theme: SDTheme & {
18
+ source: 'document' | 'fallback';
19
+ };
20
+ sourceStatus: StylesThemeSourceStatus;
21
+ diagnostics: StyleCatalogDiagnostic[];
22
+ }
23
+ export interface StylesGetThemeAdapter {
24
+ getTheme(input?: StylesGetThemeInput): StylesGetThemeResult;
25
+ }
26
+ /** Validates `styles.getTheme` input. `undefined` and `{}` are the only valid calls. */
27
+ export declare function validateStylesGetThemeInput(input?: StylesGetThemeInput): void;
28
+ /**
29
+ * Executes `styles.getTheme` using the provided adapter.
30
+ * Validates input, then delegates to the adapter.
31
+ */
32
+ export declare function executeStylesGetTheme(adapter: Partial<StylesGetThemeAdapter> | null | undefined, input?: StylesGetThemeInput): StylesGetThemeResult;