superdoc 2.6.1-next.3 → 2.7.0-next.2

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 (30) hide show
  1. package/dist/chunks/{create-super-doc-ui-DCjm-_Xo.es.js → create-super-doc-ui-BTNVc3UD.es.js} +7 -3
  2. package/dist/chunks/{create-super-doc-ui-CwCvqMOa.cjs → create-super-doc-ui-C44xPZxz.cjs} +7 -3
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  6. package/dist/document-api/src/contract/operation-definitions.d.ts +9 -0
  7. package/dist/document-api/src/contract/operation-registry.d.ts +7 -1
  8. package/dist/document-api/src/contract/sd-fragment-schema.d.ts +4 -0
  9. package/dist/document-api/src/html-to-fragment/html-to-fragment.d.ts +8 -0
  10. package/dist/document-api/src/index.d.ts +13 -5
  11. package/dist/document-api/src/insert/insert.d.ts +1 -2
  12. package/dist/document-api/src/receipt-bridge.d.ts +24 -3
  13. package/dist/document-api/src/replace/replace.d.ts +14 -2
  14. package/dist/document-api/src/types/clipboard.d.ts +69 -6
  15. package/dist/document-api/src/types/fragment.d.ts +1 -1
  16. package/dist/document-api/src/types/index.d.ts +1 -0
  17. package/dist/document-api/src/types/mutation-plan.types.d.ts +3 -0
  18. package/dist/document-api/src/types/receipt.d.ts +4 -0
  19. package/dist/document-api/src/types/sd-contract.d.ts +57 -3
  20. package/dist/document-api/src/types/sd-nodes.d.ts +9 -1
  21. package/dist/document-api/src/write/write.d.ts +1 -1
  22. package/dist/public/ui-react.cjs +1 -1
  23. package/dist/public/ui-react.es.js +1 -1
  24. package/dist/public/ui.cjs +1 -1
  25. package/dist/public/ui.es.js +1 -1
  26. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +2 -3
  27. package/dist/superdoc.cjs +2 -2
  28. package/dist/superdoc.es.js +2 -2
  29. package/dist-cdn/superdoc.min.js +3 -3
  30. package/package.json +2 -2
@@ -438,9 +438,8 @@ Object.freeze([
438
438
  * Classify the tracked-change identities carried by a v2 mutation event.
439
439
  *
440
440
  * Receipt entities are the durable invalidation contract between the document
441
- * kernel and derived review UI. Consumers apply removals/remaps locally; the
442
- * next committed window supplies surviving or restored rows. History follows
443
- * the same bounded path and never enumerates invisible review identities.
441
+ * kernel and derived review UI. Direct receipts carry entity refs; mutation
442
+ * plans carry the same identities through `trackedChanges` and per-step ids.
444
443
  */
445
444
  function getV2TrackedChangeMutationImpact(event) {
446
445
  if (event?.type !== "mutation:committed") return null;
@@ -461,6 +460,11 @@ function getV2TrackedChangeMutationImpact(event) {
461
460
  if (Array.isArray(payload.inserted)) payload.inserted.forEach((entry) => collectEntity(entry, upsertIds));
462
461
  if (Array.isArray(payload.updated)) payload.updated.forEach((entry) => collectEntity(entry, upsertIds));
463
462
  if (Array.isArray(payload.trackedChangeRefs)) payload.trackedChangeRefs.forEach((entry) => collectEntity(entry, upsertIds));
463
+ if (Array.isArray(payload.trackedChanges)) payload.trackedChanges.forEach((entry) => collectEntity(entry, upsertIds));
464
+ if (Array.isArray(payload.steps)) for (const step of payload.steps) {
465
+ if (!Array.isArray(step?.trackedChangeIds)) continue;
466
+ for (const id of step.trackedChangeIds) if (typeof id === "string" && id.length > 0) upsertIds.add(id);
467
+ }
464
468
  if (Array.isArray(payload.removed)) payload.removed.forEach((entry) => collectEntity(entry, removedIds));
465
469
  if (Array.isArray(payload.invalidatedRefs)) payload.invalidatedRefs.forEach((entry) => collectEntity(entry, removedIds));
466
470
  if (Array.isArray(payload.remappedRefs)) for (const mapping of payload.remappedRefs) {
@@ -438,9 +438,8 @@ Object.freeze([
438
438
  * Classify the tracked-change identities carried by a v2 mutation event.
439
439
  *
440
440
  * Receipt entities are the durable invalidation contract between the document
441
- * kernel and derived review UI. Consumers apply removals/remaps locally; the
442
- * next committed window supplies surviving or restored rows. History follows
443
- * the same bounded path and never enumerates invisible review identities.
441
+ * kernel and derived review UI. Direct receipts carry entity refs; mutation
442
+ * plans carry the same identities through `trackedChanges` and per-step ids.
444
443
  */
445
444
  function getV2TrackedChangeMutationImpact(event) {
446
445
  if (event?.type !== "mutation:committed") return null;
@@ -461,6 +460,11 @@ function getV2TrackedChangeMutationImpact(event) {
461
460
  if (Array.isArray(payload.inserted)) payload.inserted.forEach((entry) => collectEntity(entry, upsertIds));
462
461
  if (Array.isArray(payload.updated)) payload.updated.forEach((entry) => collectEntity(entry, upsertIds));
463
462
  if (Array.isArray(payload.trackedChangeRefs)) payload.trackedChangeRefs.forEach((entry) => collectEntity(entry, upsertIds));
463
+ if (Array.isArray(payload.trackedChanges)) payload.trackedChanges.forEach((entry) => collectEntity(entry, upsertIds));
464
+ if (Array.isArray(payload.steps)) for (const step of payload.steps) {
465
+ if (!Array.isArray(step?.trackedChangeIds)) continue;
466
+ for (const id of step.trackedChangeIds) if (typeof id === "string" && id.length > 0) upsertIds.add(id);
467
+ }
464
468
  if (Array.isArray(payload.removed)) payload.removed.forEach((entry) => collectEntity(entry, removedIds));
465
469
  if (Array.isArray(payload.invalidatedRefs)) payload.invalidatedRefs.forEach((entry) => collectEntity(entry, removedIds));
466
470
  if (Array.isArray(payload.remappedRefs)) for (const mapping of payload.remappedRefs) {
@@ -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.6.1-next.3",
22
+ superdocVersion: "2.7.0-next.2",
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.6.1-next.3",
21
+ superdocVersion: "2.7.0-next.2",
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" | "get" | "insert" | "info" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "format.bold" | "format.strike" | "format.color" | "format.italic" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.fitText" | "format.dstrike" | "format.vertAlign" | "format.position" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "extract" | "clearContent" | "formatRange" | "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" | "selection.current" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "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" | "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" | "get" | "insert" | "info" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "format.bold" | "format.strike" | "format.color" | "format.italic" | "format.rtl" | "format.cs" | "format.shading" | "format.fontFamily" | "format.lang" | "format.fontSize" | "format.fontSizeCs" | "format.highlight" | "format.underline" | "format.caps" | "format.smallCaps" | "format.outline" | "format.shadow" | "format.emboss" | "format.imprint" | "format.vanish" | "format.webHidden" | "format.specVanish" | "format.border" | "format.fitText" | "format.dstrike" | "format.vertAlign" | "format.position" | "format.bCs" | "format.iCs" | "format.snapToGrid" | "format.oMath" | "format.letterSpacing" | "format.charScale" | "format.kerning" | "format.rStyle" | "format.rFonts" | "format.eastAsianLayout" | "format.em" | "format.ligatures" | "format.numForm" | "format.numSpacing" | "format.stylisticSets" | "format.contextualAlternates" | "getNode" | "getNodeById" | "getText" | "getMarkdown" | "getHtml" | "markdownToFragment" | "htmlToFragment" | "extract" | "clearContent" | "formatRange" | "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" | "selection.current" | "mutations.preview" | "mutations.apply" | "plan.execute" | "capabilities.get" | "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" | "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. */
@@ -3490,6 +3490,15 @@ export declare const OPERATION_DEFINITIONS: {
3490
3490
  readonly referenceDocPath: "markdown-to-fragment.mdx";
3491
3491
  readonly referenceGroup: "core";
3492
3492
  };
3493
+ readonly htmlToFragment: {
3494
+ readonly memberPath: "htmlToFragment";
3495
+ readonly description: "Convert an HTML string into an SDM/1 structural fragment.";
3496
+ readonly expectedResult: "Returns an SDHtmlToFragmentResult with the converted fragment, lossy flag, and diagnostics.";
3497
+ readonly requiresDocumentContext: true;
3498
+ readonly metadata: CommandStaticMetadata;
3499
+ readonly referenceDocPath: "html-to-fragment.mdx";
3500
+ readonly referenceGroup: "core";
3501
+ };
3493
3502
  readonly info: {
3494
3503
  readonly memberPath: "info";
3495
3504
  readonly description: "Return document summary info including word, character, paragraph, heading, table, image, comment, tracked-change, SDT-field, list, and page counts, plus outline and capabilities.";
@@ -2,7 +2,7 @@ import { OperationId } from './types.js';
2
2
  import { NodeAddress } from '../types/index.js';
3
3
  import { SDNodeResult, SDFindInput, SDFindResult, SDGetInput } from '../types/sd-envelope.js';
4
4
  import { TextMutationReceipt, Receipt } from '../types/receipt.js';
5
- import { SDMutationReceipt, SDMarkdownToFragmentResult } from '../types/sd-contract.js';
5
+ import { SDHtmlToFragmentResult, SDMutationReceipt, SDMarkdownToFragmentResult } from '../types/sd-contract.js';
6
6
  import { DocumentInfo } from '../types/info.types.js';
7
7
  import { SDDocument } from '../types/fragment.js';
8
8
  import { CreateParagraphInput, CreateParagraphResult, CreateHeadingInput, CreateHeadingResult } from '../types/create.types.js';
@@ -12,6 +12,7 @@ import { GetTextInput } from '../get-text/get-text.js';
12
12
  import { GetMarkdownInput } from '../get-markdown/get-markdown.js';
13
13
  import { GetHtmlInput } from '../get-html/get-html.js';
14
14
  import { MarkdownToFragmentInput } from '../markdown-to-fragment/markdown-to-fragment.js';
15
+ import { HtmlToFragmentInput } from '../html-to-fragment/html-to-fragment.js';
15
16
  import { InfoInput } from '../info/info.js';
16
17
  import { ExtractInput } from '../extract/extract.js';
17
18
  import { ExtractResult } from '../types/extract.types.js';
@@ -107,6 +108,11 @@ export interface OperationRegistry extends FormatInlineAliasOperationRegistry {
107
108
  options: never;
108
109
  output: SDMarkdownToFragmentResult;
109
110
  };
111
+ htmlToFragment: {
112
+ input: HtmlToFragmentInput;
113
+ options: never;
114
+ output: SDHtmlToFragmentResult;
115
+ };
110
116
  info: {
111
117
  input: InfoInput;
112
118
  options: never;
@@ -0,0 +1,4 @@
1
+ type JsonSchema = Record<string, unknown>;
2
+ export declare const SD_CONVERSION_FRAGMENT_SCHEMA_DEFS: Record<string, JsonSchema>;
3
+ export declare const SD_CONVERSION_FRAGMENT_SCHEMA: JsonSchema;
4
+ export {};
@@ -0,0 +1,8 @@
1
+ import { SDHtmlToFragmentResult } from '../types/sd-contract.js';
2
+ export interface HtmlToFragmentInput {
3
+ html: string;
4
+ }
5
+ export interface HtmlToFragmentAdapter {
6
+ htmlToFragment(input: HtmlToFragmentInput): SDHtmlToFragmentResult;
7
+ }
8
+ export declare function executeHtmlToFragment(adapter: HtmlToFragmentAdapter | undefined, input: HtmlToFragmentInput): SDHtmlToFragmentResult;
@@ -13,7 +13,8 @@ import { GetTextAdapter, GetTextInput } from './get-text/get-text.js';
13
13
  import { GetMarkdownAdapter, GetMarkdownInput } from './get-markdown/get-markdown.js';
14
14
  import { GetHtmlAdapter, GetHtmlInput } from './get-html/get-html.js';
15
15
  import { MarkdownToFragmentAdapter, MarkdownToFragmentInput } from './markdown-to-fragment/markdown-to-fragment.js';
16
- import { SDMarkdownToFragmentResult } from './types/sd-contract.js';
16
+ import { HtmlToFragmentAdapter, HtmlToFragmentInput } from './html-to-fragment/html-to-fragment.js';
17
+ import { SDHtmlToFragmentResult, SDMarkdownToFragmentResult } from './types/sd-contract.js';
17
18
  import { InfoAdapter, InfoInput } from './info/info.js';
18
19
  import { ExtractAdapter, ExtractInput } from './extract/extract.js';
19
20
  import { ClearContentAdapter, ClearContentInput } from './clear-content/clear-content.js';
@@ -76,6 +77,8 @@ export * from './header-footers/header-footers.types.js';
76
77
  export type { ClearContentAdapter, ClearContentInput } from './clear-content/clear-content.js';
77
78
  export type { MarkdownToFragmentInput, MarkdownToFragmentAdapter, } from './markdown-to-fragment/markdown-to-fragment.js';
78
79
  export { executeMarkdownToFragment } from './markdown-to-fragment/markdown-to-fragment.js';
80
+ export type { HtmlToFragmentInput, HtmlToFragmentAdapter } from './html-to-fragment/html-to-fragment.js';
81
+ export { executeHtmlToFragment } from './html-to-fragment/html-to-fragment.js';
79
82
  export type { HistoryState, HistoryActionResult, HistoryNoopReason, SDHistoryStatus, SDHistoryCollaborationMeta, } from './history/history.types.js';
80
83
  export { executeTrackChangesGet, executeTrackChangesList, executeTrackChangesDecide, } from './track-changes/track-changes.js';
81
84
  export { createPlanApi, type PlanApi, type PlanExecuteInput, type PlanExecuteEntry, type PlanExecuteEntryExpect, type PlanExecuteResult, type PlanEntryReceipt, type PlanEntryReceiptStatus, type PlanExecuteFailure, type PlanCaptureRefMarker, type PlanProjectTextOffsetMarker, } from './plan/plan.js';
@@ -152,12 +155,12 @@ export { executeBlocksList, executeBlocksDelete, executeBlocksDeleteRange, execu
152
155
  export { executeListsIndent, executeListsOutdent, executeListsGetState, executeListsApply, executeListsContinueV2, executeListsRestartV2, executeListsRemoveV2, } from './lists/lists.js';
153
156
  export { DocumentApiValidationError } from './errors.js';
154
157
  export { textReceiptToSDReceipt, buildStructuralReceipt } from './receipt-bridge.js';
155
- export type { StructuralReceiptParams } from './receipt-bridge.js';
158
+ export type { MutationReceiptBridgeContext, StructuralReceiptParams } from './receipt-bridge.js';
156
159
  export { isBlockNodeAddress } from './validation-primitives.js';
157
- export type { InsertInput, InsertContentType, TextInsertInput, LegacyInsertInput } from './insert/insert.js';
160
+ export type { InsertInput, InsertContentType, TextInsertInput, RichContentInsertInput, LegacyInsertInput, } from './insert/insert.js';
158
161
  export { isStructuralInsertInput } from './insert/insert.js';
159
- export type { ReplaceInput, TextReplaceInput } from './replace/replace.js';
160
- export { executeReplace, isStructuralReplaceInput } from './replace/replace.js';
162
+ export type { ReplaceInput, TextReplaceInput, RichContentReplaceInput } from './replace/replace.js';
163
+ export { executeReplace, isStructuralReplaceInput, isRichContentReplaceInput } from './replace/replace.js';
161
164
  export { executeFind } from './find/find.js';
162
165
  export { validateDocumentFragment, validateSDFragment } from './validation/fragment-validator.js';
163
166
  export type { DeleteInput } from './delete/delete.js';
@@ -288,6 +291,10 @@ export interface DocumentApi {
288
291
  * Convert a Markdown string into an SDM/1 structural fragment.
289
292
  */
290
293
  markdownToFragment(input: MarkdownToFragmentInput): SDMarkdownToFragmentResult;
294
+ /**
295
+ * Convert an HTML string into an SDM/1 structural fragment.
296
+ */
297
+ htmlToFragment(input: HtmlToFragmentInput): SDHtmlToFragmentResult;
291
298
  /**
292
299
  * Return document summary info including document counts and capabilities.
293
300
  */
@@ -503,6 +510,7 @@ export interface DocumentApiAdapters {
503
510
  getMarkdown: GetMarkdownAdapter;
504
511
  getHtml: GetHtmlAdapter;
505
512
  markdownToFragment: MarkdownToFragmentAdapter;
513
+ htmlToFragment?: HtmlToFragmentAdapter;
506
514
  info: InfoAdapter;
507
515
  extract: ExtractAdapter;
508
516
  clearContent: ClearContentAdapter;
@@ -27,7 +27,6 @@ export type TextInsertInput = OptionalInsertLocator & {
27
27
  /**
28
28
  * Type-safe input for markdown/html inserts with block-level positioning.
29
29
  * Accepts BlockNodeAddress targets and placement (routed through the structural insert path).
30
- * Standalone export: not part of the InsertInput union to avoid type narrowing issues in the runtime.
31
30
  */
32
31
  export type RichContentInsertInput = {
33
32
  target?: SelectionTarget | BlockNodeAddress;
@@ -45,7 +44,7 @@ export type LegacyInsertInput = TextInsertInput;
45
44
  * Discrimination: presence of `content` (structural) vs `value` (text string).
46
45
  * These are mutually exclusive: providing both is an error.
47
46
  */
48
- export type InsertInput = TextInsertInput | SDInsertInput;
47
+ export type InsertInput = TextInsertInput | RichContentInsertInput | SDInsertInput;
49
48
  /** Returns true when the input uses the structural SDFragment shape. */
50
49
  export declare function isStructuralInsertInput(input: InsertInput): input is SDInsertInput;
51
50
  /**
@@ -1,4 +1,24 @@
1
- import { TextMutationReceipt, TextMutationRange, ReceiptEffects, SDMutationReceipt, SelectionTarget, MutationResolutionTarget } from './types/index.js';
1
+ import { TextMutationReceipt, TextMutationRange, ReceiptEffects, SDMutationReceipt, SelectionTarget, MutationResolutionTarget, ReceiptSuccess, SDMutationConversionReport } from './types/index.js';
2
+ export interface MutationReceiptBridgeContext {
3
+ evaluatedRevision?: {
4
+ before: string;
5
+ after: string;
6
+ };
7
+ conversion?: SDMutationConversionReport;
8
+ }
9
+ interface CanonicalSuccessMetadata {
10
+ id?: ReceiptSuccess['id'];
11
+ inserted?: ReceiptSuccess['inserted'];
12
+ updated?: ReceiptSuccess['updated'];
13
+ removed?: ReceiptSuccess['removed'];
14
+ invalidatedRefs?: ReceiptSuccess['invalidatedRefs'];
15
+ remappedRefs?: ReceiptSuccess['remappedRefs'];
16
+ affectedStories?: ReceiptSuccess['affectedStories'];
17
+ textRangeShifts?: ReceiptSuccess['textRangeShifts'];
18
+ txId?: ReceiptSuccess['txId'];
19
+ warnings?: ReceiptSuccess['warnings'];
20
+ effects?: ReceiptSuccess['effects'];
21
+ }
2
22
  /**
3
23
  * Wraps a TextMutationReceipt into an SDMutationReceipt at the public API boundary.
4
24
  *
@@ -6,9 +26,9 @@ import { TextMutationReceipt, TextMutationRange, ReceiptEffects, SDMutationRecei
6
26
  * - Resolution is passed through directly (both use TextAddress).
7
27
  * - Failure codes from the text pipeline are mapped to SDErrorCode.
8
28
  */
9
- export declare function textReceiptToSDReceipt(receipt: TextMutationReceipt): SDMutationReceipt;
29
+ export declare function textReceiptToSDReceipt(receipt: TextMutationReceipt, context?: MutationReceiptBridgeContext): SDMutationReceipt;
10
30
  /** Parameters for building a structural mutation receipt. */
11
- export interface StructuralReceiptParams {
31
+ export interface StructuralReceiptParams extends CanonicalSuccessMetadata, MutationReceiptBridgeContext {
12
32
  target: MutationResolutionTarget;
13
33
  range: TextMutationRange;
14
34
  selectionTarget?: SelectionTarget;
@@ -28,3 +48,4 @@ export declare function buildStructuralReceipt(success: false, params: Structura
28
48
  code: string;
29
49
  message: string;
30
50
  }): SDMutationReceipt;
51
+ export {};
@@ -3,6 +3,8 @@ import { SelectionTarget, TargetLocator } from '../types/address.js';
3
3
  import { SDMutationReceipt } from '../types/sd-contract.js';
4
4
  import { SDReplaceInput } from '../types/structural-input.js';
5
5
  import { StoryLocator } from '../types/story.types.js';
6
+ import { BlockNodeAddress } from '../types/base.js';
7
+ import { NestingPolicy } from '../types/placement.js';
6
8
  import { SelectionMutationAdapter } from '../selection-mutation.js';
7
9
  import { WriteAdapter } from '../write/write.js';
8
10
  /** Text replacement input: uses SelectionTarget / ref. */
@@ -13,12 +15,22 @@ export type TextReplaceInput = TargetLocator & {
13
15
  /** Target a specific document story (body, header, footer, footnote, endnote). */
14
16
  in?: StoryLocator;
15
17
  };
18
+ /** HTML or Markdown replacement input for conversion and structured application. */
19
+ export type RichContentReplaceInput = {
20
+ value: string;
21
+ type: 'html' | 'markdown';
22
+ target?: SelectionTarget | BlockNodeAddress;
23
+ ref?: string;
24
+ in?: StoryLocator;
25
+ nestingPolicy?: NestingPolicy;
26
+ };
16
27
  /**
17
28
  * Input payload for the `doc.replace` operation.
18
29
  *
19
- * Discrimination: presence of `content` (structural) vs `text` (text replacement).
30
+ * Discrimination: `text` (plain), `value` (HTML/Markdown), or `content` (SDFragment).
20
31
  */
21
- export type ReplaceInput = TextReplaceInput | SDReplaceInput;
32
+ export type ReplaceInput = TextReplaceInput | RichContentReplaceInput | SDReplaceInput;
22
33
  /** Returns true when the input uses the structural SDFragment shape. */
23
34
  export declare function isStructuralReplaceInput(input: ReplaceInput): input is SDReplaceInput;
35
+ export declare function isRichContentReplaceInput(input: ReplaceInput): input is RichContentReplaceInput;
24
36
  export declare function executeReplace(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: ReplaceInput, options?: MutationOptions): SDMutationReceipt;
@@ -1,6 +1,7 @@
1
1
  import { AdapterMutationFailure } from './adapter-result.js';
2
2
  import { SelectionTarget } from './address.js';
3
3
  import { ReceiptFailure, ReceiptSuccess, ReviewWarning } from './receipt.js';
4
+ import { SDConversionDiagnostic, SDDiagnostic } from './sd-contract.js';
4
5
  import { StoryLocator } from './story.types.js';
5
6
  export declare const SUPERDOC_V2_CLIPBOARD_MIME = "application/x-superdoc-v2-fragment";
6
7
  export declare const SUPERDOC_V22_CLIPBOARD_MIME = "application/x-superdoc-v2-fragment-v2.2";
@@ -46,11 +47,34 @@ export interface SDPasteRunMarks {
46
47
  export interface SDPasteRun {
47
48
  text: string;
48
49
  marks?: SDPasteRunMarks;
50
+ /** Transient conversion identity used to map mutation effects back to source nodes. */
51
+ sourcePath?: readonly (string | number)[];
49
52
  }
50
- export type SDPasteInline = {
53
+ export interface SDPasteParagraphProperties {
54
+ alignment?: 'left' | 'center' | 'right' | 'justify';
55
+ indent?: {
56
+ start?: number;
57
+ end?: number;
58
+ left?: number;
59
+ right?: number;
60
+ firstLine?: number;
61
+ hanging?: number;
62
+ };
63
+ spacing?: {
64
+ before?: number;
65
+ after?: number;
66
+ line?: number;
67
+ lineRule?: 'auto' | 'exact' | 'atLeast';
68
+ };
69
+ }
70
+ export type SDPasteLeafInline = {
51
71
  kind: 'text';
52
72
  text: string;
53
73
  marks?: SDPasteRunMarks;
74
+ sourcePath?: readonly (string | number)[];
75
+ } | {
76
+ kind: 'lineBreak';
77
+ sourcePath?: readonly (string | number)[];
54
78
  } | {
55
79
  kind: 'image';
56
80
  assetId: string;
@@ -59,11 +83,26 @@ export type SDPasteInline = {
59
83
  name?: string;
60
84
  alt?: string;
61
85
  title?: string;
86
+ sourcePath?: readonly (string | number)[];
87
+ };
88
+ export type SDPasteInline = SDPasteLeafInline | {
89
+ kind: 'hyperlink';
90
+ target: {
91
+ kind: 'external';
92
+ url: string;
93
+ } | {
94
+ kind: 'anchor';
95
+ anchor: string;
96
+ };
97
+ inlines: readonly SDPasteLeafInline[];
98
+ tooltip?: string;
99
+ sourcePath?: readonly (string | number)[];
62
100
  };
63
101
  export interface SDPasteParagraphBlock {
64
102
  kind: 'paragraph';
65
103
  runs: readonly SDPasteRun[];
66
104
  inlines?: readonly SDPasteInline[];
105
+ paragraphProps?: SDPasteParagraphProperties;
67
106
  styleRef?: string;
68
107
  /** Portable built-in style intent; destination style identity remains local. */
69
108
  semanticStyleRole?: 'default-paragraph' | 'title' | 'subtitle' | `heading-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`;
@@ -83,7 +122,12 @@ export interface SDPasteParagraphBlock {
83
122
  level?: number;
84
123
  /** True on the first block of a distinct adjacent portable list. */
85
124
  startsNewList?: boolean;
125
+ /** Positive ordinal for an ordered-list restart at `level`. */
126
+ start?: number;
127
+ format?: 'decimal' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman';
128
+ text?: string;
86
129
  };
130
+ listItemContinuationLevel?: number;
87
131
  /**
88
132
  * Pre-validated direct `<w:pPr>` properties. Same-document copy carries the
89
133
  * source paragraph's materialized properties for fidelity; external HTML
@@ -99,6 +143,16 @@ export interface SDPasteParagraphBlock {
99
143
  * paste anchor's paragraph, independent of whether they carry formatting.
100
144
  */
101
145
  complete?: boolean;
146
+ /** Transient conversion identity used to map mutation effects back to source nodes. */
147
+ sourcePath?: readonly (string | number)[];
148
+ }
149
+ export interface SDPasteHeadingBlock extends Omit<SDPasteParagraphBlock, 'kind' | 'semanticStyleRole'> {
150
+ kind: 'heading';
151
+ level: 1 | 2 | 3 | 4 | 5 | 6;
152
+ }
153
+ export interface SDPasteHorizontalRuleBlock {
154
+ kind: 'horizontalRule';
155
+ sourcePath?: readonly (string | number)[];
102
156
  }
103
157
  export interface SDPasteTableCell {
104
158
  /** Cell content: paragraph blocks rendered through the shared paste renderer. */
@@ -114,9 +168,12 @@ export interface SDPasteTableCell {
114
168
  bottomPt?: number;
115
169
  leftPt?: number;
116
170
  };
171
+ sourcePath?: readonly (string | number)[];
117
172
  }
118
173
  export interface SDPasteTableRow {
119
174
  cells: readonly SDPasteTableCell[];
175
+ header?: boolean;
176
+ sourcePath?: readonly (string | number)[];
120
177
  }
121
178
  /**
122
179
  * Table paste block: rendered as `w:tbl` with V1-parity defaults. Cell
@@ -126,8 +183,9 @@ export interface SDPasteTableRow {
126
183
  export interface SDPasteTableBlock {
127
184
  kind: 'table';
128
185
  rows: readonly SDPasteTableRow[];
186
+ sourcePath?: readonly (string | number)[];
129
187
  }
130
- export type SDPasteBlock = SDPasteParagraphBlock | SDPasteTableBlock;
188
+ export type SDPasteBlock = SDPasteParagraphBlock | SDPasteHeadingBlock | SDPasteHorizontalRuleBlock | SDPasteTableBlock;
131
189
  export interface SDPasteAsset {
132
190
  id: string;
133
191
  mimeType: 'image/png' | 'image/jpeg';
@@ -146,12 +204,17 @@ export interface SDPasteFragment {
146
204
  assets?: readonly SDPasteAsset[];
147
205
  diagnostics?: readonly ClipboardInsertDiagnostic[];
148
206
  }
149
- export interface ClipboardInsertDiagnostic {
150
- severity: 'error' | 'warning' | 'info';
207
+ export interface ClipboardInsertDiagnostic extends SDDiagnostic {
151
208
  reason: SDPasteUnsupportedReason;
152
- message: string;
153
209
  sourceKind?: ClipboardSourceKind;
154
- path?: Array<string | number>;
210
+ /** Fatal rich-conversion attempt retained when a plain-text fallback is selected. */
211
+ cause?: SDConversionDiagnostic;
212
+ }
213
+ /** HTML conversion diagnostic with the clipboard negotiation envelope retained. */
214
+ export interface ClipboardHtmlConversionDiagnostic extends SDConversionDiagnostic {
215
+ reason: SDPasteUnsupportedReason;
216
+ sourceKind: 'html';
217
+ cause?: SDConversionDiagnostic;
155
218
  }
156
219
  export interface ClipboardInsertPlanSummary {
157
220
  sourceKind: ClipboardSourceKind;
@@ -16,7 +16,7 @@ export interface SDDocument {
16
16
  annotations?: SDAnnotations;
17
17
  metadata?: SDDocumentMeta;
18
18
  }
19
- export declare const SD_CONTENT_NODE_KINDS: readonly ["paragraph", "heading", "list", "table", "toc", "index", "bibliography", "tableOfAuthorities", "break", "sectionBreak", "sectPr", "image", "drawing", "sdt", "customXml", "altChunk", "math", "field"];
19
+ export declare const SD_CONTENT_NODE_KINDS: readonly ["paragraph", "heading", "list", "table", "toc", "index", "bibliography", "tableOfAuthorities", "break", "horizontalRule", "sectionBreak", "sectPr", "image", "drawing", "sdt", "customXml", "altChunk", "math", "field"];
20
20
  export type SDContentNodeKind = (typeof SD_CONTENT_NODE_KINDS)[number];
21
21
  export declare const SD_INLINE_NODE_KINDS: readonly ["run", "hyperlink", "crossRef", "indexEntry", "sequenceField", "citation", "authorityEntry", "tocEntry", "image", "drawing", "sdt", "customXml", "math", "field", "tab", "lineBreak", "footnoteRef", "endnoteRef"];
22
22
  export type SDInlineNodeKind = (typeof SD_INLINE_NODE_KINDS)[number];
@@ -23,6 +23,7 @@ export * from './discovery.js';
23
23
  export * from './blocks.types.js';
24
24
  export * from './toc.types.js';
25
25
  export * from './fragment.js';
26
+ export * from './sd-contract.js';
26
27
  export * from './placement.js';
27
28
  export * from './adapter-result.js';
28
29
  export * from './structural-input.js';
@@ -5,6 +5,7 @@ import { InsertStylePolicy, StylePolicy } from './style-policy.types.js';
5
5
  import { InlineRunPatch } from '../format/inline-run-patch.js';
6
6
  import { SDFragment } from './fragment.js';
7
7
  import { Placement, NestingPolicy } from './placement.js';
8
+ import { AffectedRef } from './receipt.js';
8
9
  import { ChangeMode } from '../write/write.js';
9
10
  import { StoryLocator } from './story.types.js';
10
11
  export type SelectWhere = {
@@ -229,6 +230,8 @@ export type PlanReceipt = {
229
230
  };
230
231
  steps: StepOutcome[];
231
232
  trackedChanges?: TrackedChangeAddress[];
233
+ /** Caller-held refs that no longer resolve after the plan. */
234
+ invalidatedRefs?: AffectedRef[];
232
235
  timing: {
233
236
  totalMs: number;
234
237
  };
@@ -68,6 +68,8 @@ export interface TextRangeShift {
68
68
  /** A visible text span created by a mutation (e.g. `doc.insert`). */
69
69
  export interface TextMutationEffect {
70
70
  kind: 'insertedText';
71
+ /** Transient source fragment path that produced this created span. */
72
+ sourcePath?: readonly (string | number)[];
71
73
  /**
72
74
  * Block-absolute address of the created span. `range.start` is the base
73
75
  * offset within the target block (nonzero when text was appended into a
@@ -82,6 +84,8 @@ export interface TextMutationEffect {
82
84
  /** A block created by a structural mutation (e.g. paragraph/heading insert). */
83
85
  export interface BlockMutationEffect {
84
86
  kind: 'insertedBlock';
87
+ /** Transient source fragment path that produced this created block. */
88
+ sourcePath?: readonly (string | number)[];
85
89
  /** Address of the created block. */
86
90
  target: BlockNodeAddress;
87
91
  /**