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

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 (50) 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/content-projection/validation.d.ts +3 -0
  6. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  7. package/dist/document-api/src/contract/operation-definitions.d.ts +31 -0
  8. package/dist/document-api/src/contract/operation-registry.d.ts +18 -1
  9. package/dist/document-api/src/contract/sd-fragment-schema.d.ts +4 -0
  10. package/dist/document-api/src/get-html/get-html.d.ts +6 -6
  11. package/dist/document-api/src/get-markdown/get-markdown.d.ts +2 -4
  12. package/dist/document-api/src/html-to-fragment/html-to-fragment.d.ts +8 -0
  13. package/dist/document-api/src/index.d.ts +24 -5
  14. package/dist/document-api/src/insert/insert.d.ts +1 -2
  15. package/dist/document-api/src/project-html/project-html.d.ts +5 -0
  16. package/dist/document-api/src/project-markdown/project-markdown.d.ts +5 -0
  17. package/dist/document-api/src/ranges/ranges.types.d.ts +5 -2
  18. package/dist/document-api/src/receipt-bridge.d.ts +24 -3
  19. package/dist/document-api/src/replace/replace.d.ts +29 -5
  20. package/dist/document-api/src/types/address.d.ts +2 -0
  21. package/dist/document-api/src/types/clipboard.d.ts +69 -6
  22. package/dist/document-api/src/types/content-projection.d.ts +126 -0
  23. package/dist/document-api/src/types/fragment.d.ts +1 -1
  24. package/dist/document-api/src/types/index.d.ts +2 -0
  25. package/dist/document-api/src/types/mutation-plan.types.d.ts +3 -0
  26. package/dist/document-api/src/types/receipt.d.ts +4 -0
  27. package/dist/document-api/src/types/sd-contract.d.ts +61 -5
  28. package/dist/document-api/src/types/sd-nodes.d.ts +9 -1
  29. package/dist/document-api/src/types/structural-input.d.ts +18 -3
  30. package/dist/document-api/src/write/write.d.ts +1 -1
  31. package/dist/layout-engine/painters/dom/src/index.d.ts +2 -0
  32. package/dist/layout-engine/painters/dom/src/web-flow/index.d.ts +3 -0
  33. package/dist/layout-engine/painters/dom/src/web-flow/painter.d.ts +2 -0
  34. package/dist/layout-engine/painters/dom/src/web-flow/render.d.ts +8 -0
  35. package/dist/layout-engine/painters/dom/src/web-flow/styles.d.ts +10 -0
  36. package/dist/layout-engine/painters/dom/src/web-flow/types.d.ts +77 -0
  37. package/dist/public/ui-react.cjs +1 -1
  38. package/dist/public/ui-react.es.js +1 -1
  39. package/dist/public/ui.cjs +1 -1
  40. package/dist/public/ui.es.js +1 -1
  41. package/dist/superdoc/src/composables/use-link-popover.d.ts +3 -14
  42. package/dist/superdoc/src/core/types/index.d.ts +12 -5
  43. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +2 -3
  44. package/dist/superdoc.cjs +36 -128
  45. package/dist/superdoc.es.js +36 -128
  46. package/dist/word-layout/src/index.d.ts +2 -0
  47. package/dist/word-layout/src/list-marker.d.ts +8 -0
  48. package/dist/word-layout/src/review-aware-numbering.d.ts +41 -0
  49. package/dist-cdn/superdoc.min.js +37 -37
  50. 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.10",
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.10",
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
@@ -0,0 +1,3 @@
1
+ import { SDProjectionReadInput } from '../types/content-projection.js';
2
+ export declare function validateProjectionReadInput(input: unknown, operationName: string, allowedFields: ReadonlySet<string>): asserts input is SDProjectionReadInput;
3
+ export declare function validateOptionalBoolean(value: unknown, field: string, operationName: string): void;
@@ -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" | "projectMarkdown" | "projectHtml" | "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. */
@@ -3481,6 +3481,28 @@ export declare const OPERATION_DEFINITIONS: {
3481
3481
  readonly intentGroup: "get_content";
3482
3482
  readonly intentAction: "html";
3483
3483
  };
3484
+ readonly projectMarkdown: {
3485
+ readonly memberPath: "projectMarkdown";
3486
+ readonly description: "Project document content as Markdown with review, scope, diagnostics, and provenance metadata.";
3487
+ readonly expectedResult: "Returns a Promise resolving to a detailed Markdown content projection result.";
3488
+ readonly requiresDocumentContext: true;
3489
+ readonly metadata: CommandStaticMetadata;
3490
+ readonly referenceDocPath: "project-markdown.mdx";
3491
+ readonly referenceGroup: "core";
3492
+ readonly intentGroup: "get_content";
3493
+ readonly intentAction: "markdown_projection";
3494
+ };
3495
+ readonly projectHtml: {
3496
+ readonly memberPath: "projectHtml";
3497
+ readonly description: "Project document content as HTML with review, scope, diagnostics, and provenance metadata.";
3498
+ readonly expectedResult: "Returns a Promise resolving to a detailed HTML content projection result.";
3499
+ readonly requiresDocumentContext: true;
3500
+ readonly metadata: CommandStaticMetadata;
3501
+ readonly referenceDocPath: "project-html.mdx";
3502
+ readonly referenceGroup: "core";
3503
+ readonly intentGroup: "get_content";
3504
+ readonly intentAction: "html_projection";
3505
+ };
3484
3506
  readonly markdownToFragment: {
3485
3507
  readonly memberPath: "markdownToFragment";
3486
3508
  readonly description: "Convert a Markdown string into an SDM/1 structural fragment.";
@@ -3490,6 +3512,15 @@ export declare const OPERATION_DEFINITIONS: {
3490
3512
  readonly referenceDocPath: "markdown-to-fragment.mdx";
3491
3513
  readonly referenceGroup: "core";
3492
3514
  };
3515
+ readonly htmlToFragment: {
3516
+ readonly memberPath: "htmlToFragment";
3517
+ readonly description: "Convert an HTML string into an SDM/1 structural fragment.";
3518
+ readonly expectedResult: "Returns an SDHtmlToFragmentResult with the converted fragment, lossy flag, and diagnostics.";
3519
+ readonly requiresDocumentContext: true;
3520
+ readonly metadata: CommandStaticMetadata;
3521
+ readonly referenceDocPath: "html-to-fragment.mdx";
3522
+ readonly referenceGroup: "core";
3523
+ };
3493
3524
  readonly info: {
3494
3525
  readonly memberPath: "info";
3495
3526
  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';
@@ -11,7 +11,9 @@ import { GetNodeByIdInput } from '../get-node/get-node.js';
11
11
  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
+ import { ProjectHtmlInput, ProjectMarkdownInput, SDContentProjectionResult } from '../types/content-projection.js';
14
15
  import { MarkdownToFragmentInput } from '../markdown-to-fragment/markdown-to-fragment.js';
16
+ import { HtmlToFragmentInput } from '../html-to-fragment/html-to-fragment.js';
15
17
  import { InfoInput } from '../info/info.js';
16
18
  import { ExtractInput } from '../extract/extract.js';
17
19
  import { ExtractResult } from '../types/extract.types.js';
@@ -102,11 +104,26 @@ export interface OperationRegistry extends FormatInlineAliasOperationRegistry {
102
104
  options: never;
103
105
  output: string;
104
106
  };
107
+ projectMarkdown: {
108
+ input: ProjectMarkdownInput;
109
+ options: never;
110
+ output: Promise<SDContentProjectionResult<'markdown'>>;
111
+ };
112
+ projectHtml: {
113
+ input: ProjectHtmlInput;
114
+ options: never;
115
+ output: Promise<SDContentProjectionResult<'html'>>;
116
+ };
105
117
  markdownToFragment: {
106
118
  input: MarkdownToFragmentInput;
107
119
  options: never;
108
120
  output: SDMarkdownToFragmentResult;
109
121
  };
122
+ htmlToFragment: {
123
+ input: HtmlToFragmentInput;
124
+ options: never;
125
+ output: SDHtmlToFragmentResult;
126
+ };
110
127
  info: {
111
128
  input: InfoInput;
112
129
  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 {};
@@ -1,10 +1,10 @@
1
- import { StoryLocator } from '../types/story.types.js';
2
- export interface GetHtmlInput {
3
- /** Restrict the read to a specific story. Omit for body (backward compatible). */
4
- in?: StoryLocator;
1
+ import { SDProjectionReadInput } from '../types/content-projection.js';
2
+ export interface GetHtmlInput extends SDProjectionReadInput {
5
3
  /**
6
- * Convert SuperDoc's internal flat-list representation to proper nested
7
- * `<ol>`/`<ul>` HTML. Defaults to `true`.
4
+ * Accepted for compatibility and ignored by V2. V2 always emits canonical
5
+ * nested semantic lists.
6
+ *
7
+ * @deprecated replaceWith=canonical nested V2 output compat-indefinitely=existing callers may keep passing the option
8
8
  */
9
9
  unflattenLists?: boolean;
10
10
  }
@@ -1,7 +1,5 @@
1
- import { StoryLocator } from '../types/story.types.js';
2
- export interface GetMarkdownInput {
3
- /** Restrict the read to a specific story. Omit for body (backward compatible). */
4
- in?: StoryLocator;
1
+ import { SDProjectionReadInput } from '../types/content-projection.js';
2
+ export interface GetMarkdownInput extends SDProjectionReadInput {
5
3
  }
6
4
  /**
7
5
  * Engine-specific adapter that the getMarkdown API delegates to.
@@ -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;
@@ -12,8 +12,12 @@ import { SDDocument } from './types/fragment.js';
12
12
  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
+ import { ProjectHtmlAdapter } from './project-html/project-html.js';
16
+ import { ProjectMarkdownAdapter } from './project-markdown/project-markdown.js';
17
+ import { ProjectHtmlInput, ProjectMarkdownInput, SDContentProjectionResult } from './types/content-projection.js';
15
18
  import { MarkdownToFragmentAdapter, MarkdownToFragmentInput } from './markdown-to-fragment/markdown-to-fragment.js';
16
- import { SDMarkdownToFragmentResult } from './types/sd-contract.js';
19
+ import { HtmlToFragmentAdapter, HtmlToFragmentInput } from './html-to-fragment/html-to-fragment.js';
20
+ import { SDHtmlToFragmentResult, SDMarkdownToFragmentResult } from './types/sd-contract.js';
17
21
  import { InfoAdapter, InfoInput } from './info/info.js';
18
22
  import { ExtractAdapter, ExtractInput } from './extract/extract.js';
19
23
  import { ClearContentAdapter, ClearContentInput } from './clear-content/clear-content.js';
@@ -76,6 +80,12 @@ export * from './header-footers/header-footers.types.js';
76
80
  export type { ClearContentAdapter, ClearContentInput } from './clear-content/clear-content.js';
77
81
  export type { MarkdownToFragmentInput, MarkdownToFragmentAdapter, } from './markdown-to-fragment/markdown-to-fragment.js';
78
82
  export { executeMarkdownToFragment } from './markdown-to-fragment/markdown-to-fragment.js';
83
+ export type { HtmlToFragmentInput, HtmlToFragmentAdapter } from './html-to-fragment/html-to-fragment.js';
84
+ export { executeHtmlToFragment } from './html-to-fragment/html-to-fragment.js';
85
+ export type { ProjectHtmlAdapter } from './project-html/project-html.js';
86
+ export { executeProjectHtml } from './project-html/project-html.js';
87
+ export type { ProjectMarkdownAdapter } from './project-markdown/project-markdown.js';
88
+ export { executeProjectMarkdown } from './project-markdown/project-markdown.js';
79
89
  export type { HistoryState, HistoryActionResult, HistoryNoopReason, SDHistoryStatus, SDHistoryCollaborationMeta, } from './history/history.types.js';
80
90
  export { executeTrackChangesGet, executeTrackChangesList, executeTrackChangesDecide, } from './track-changes/track-changes.js';
81
91
  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 +162,12 @@ export { executeBlocksList, executeBlocksDelete, executeBlocksDeleteRange, execu
152
162
  export { executeListsIndent, executeListsOutdent, executeListsGetState, executeListsApply, executeListsContinueV2, executeListsRestartV2, executeListsRemoveV2, } from './lists/lists.js';
153
163
  export { DocumentApiValidationError } from './errors.js';
154
164
  export { textReceiptToSDReceipt, buildStructuralReceipt } from './receipt-bridge.js';
155
- export type { StructuralReceiptParams } from './receipt-bridge.js';
165
+ export type { MutationReceiptBridgeContext, StructuralReceiptParams } from './receipt-bridge.js';
156
166
  export { isBlockNodeAddress } from './validation-primitives.js';
157
- export type { InsertInput, InsertContentType, TextInsertInput, LegacyInsertInput } from './insert/insert.js';
167
+ export type { InsertInput, InsertContentType, TextInsertInput, RichContentInsertInput, LegacyInsertInput, } from './insert/insert.js';
158
168
  export { isStructuralInsertInput } from './insert/insert.js';
159
- export type { ReplaceInput, TextReplaceInput } from './replace/replace.js';
160
- export { executeReplace, isStructuralReplaceInput } from './replace/replace.js';
169
+ export type { ReplaceInput, TextReplaceInput, RichContentReplaceInput } from './replace/replace.js';
170
+ export { executeReplace, isStructuralReplaceInput, isRichContentReplaceInput } from './replace/replace.js';
161
171
  export { executeFind } from './find/find.js';
162
172
  export { validateDocumentFragment, validateSDFragment } from './validation/fragment-validator.js';
163
173
  export type { DeleteInput } from './delete/delete.js';
@@ -284,10 +294,16 @@ export interface DocumentApi {
284
294
  * Return the full document content as an HTML string.
285
295
  */
286
296
  getHtml(input: GetHtmlInput): string;
297
+ projectHtml(input: ProjectHtmlInput): Promise<SDContentProjectionResult<'html'>>;
298
+ projectMarkdown(input: ProjectMarkdownInput): Promise<SDContentProjectionResult<'markdown'>>;
287
299
  /**
288
300
  * Convert a Markdown string into an SDM/1 structural fragment.
289
301
  */
290
302
  markdownToFragment(input: MarkdownToFragmentInput): SDMarkdownToFragmentResult;
303
+ /**
304
+ * Convert an HTML string into an SDM/1 structural fragment.
305
+ */
306
+ htmlToFragment(input: HtmlToFragmentInput): SDHtmlToFragmentResult;
291
307
  /**
292
308
  * Return document summary info including document counts and capabilities.
293
309
  */
@@ -502,7 +518,10 @@ export interface DocumentApiAdapters {
502
518
  getText: GetTextAdapter;
503
519
  getMarkdown: GetMarkdownAdapter;
504
520
  getHtml: GetHtmlAdapter;
521
+ projectHtml?: ProjectHtmlAdapter;
522
+ projectMarkdown?: ProjectMarkdownAdapter;
505
523
  markdownToFragment: MarkdownToFragmentAdapter;
524
+ htmlToFragment?: HtmlToFragmentAdapter;
506
525
  info: InfoAdapter;
507
526
  extract: ExtractAdapter;
508
527
  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
  /**
@@ -0,0 +1,5 @@
1
+ import { ProjectHtmlInput, SDContentProjectionResult } from '../types/content-projection.js';
2
+ export interface ProjectHtmlAdapter {
3
+ projectHtml(input: ProjectHtmlInput): Promise<SDContentProjectionResult<'html'>>;
4
+ }
5
+ export declare function executeProjectHtml(adapter: ProjectHtmlAdapter | undefined, input: ProjectHtmlInput): Promise<SDContentProjectionResult<'html'>>;
@@ -0,0 +1,5 @@
1
+ import { ProjectMarkdownInput, SDContentProjectionResult } from '../types/content-projection.js';
2
+ export interface ProjectMarkdownAdapter {
3
+ projectMarkdown(input: ProjectMarkdownInput): Promise<SDContentProjectionResult<'markdown'>>;
4
+ }
5
+ export declare function executeProjectMarkdown(adapter: ProjectMarkdownAdapter | undefined, input: ProjectMarkdownInput): Promise<SDContentProjectionResult<'markdown'>>;
@@ -108,8 +108,11 @@ export interface ScrollIntoViewInput {
108
108
  target: TextAddress | TextTarget | EntityAddress;
109
109
  /** Alignment within the viewport. Defaults to `'center'`. */
110
110
  block?: 'start' | 'center' | 'end' | 'nearest';
111
- /** Scroll behavior. Defaults to `'smooth'`. */
112
- behavior?: 'auto' | 'smooth';
111
+ /**
112
+ * Scroll behavior. Defaults to `'smooth'`. `'auto'` follows the computed
113
+ * CSS `scroll-behavior`; `'instant'` always moves without animation.
114
+ */
115
+ behavior?: 'auto' | 'instant' | 'smooth';
113
116
  }
114
117
  /**
115
118
  * Result of `ui.viewport.scrollIntoView`. `success: false` when the
@@ -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 {};
@@ -2,23 +2,47 @@ import { MutationOptions } from '../types/mutation-plan.types.js';
2
2
  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
- import { StoryLocator } from '../types/story.types.js';
5
+ import { BodyStoryLocator, 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
- /** Text replacement input: uses SelectionTarget / ref. */
9
- export type TextReplaceInput = TargetLocator & {
10
+ /** Text replacement input: uses SelectionTarget / ref, or the complete main body. */
11
+ export type TextReplaceInput = (TargetLocator & {
10
12
  target?: SelectionTarget;
11
13
  ref?: string;
12
14
  text: string;
13
15
  /** Target a specific document story (body, header, footer, footnote, endnote). */
14
16
  in?: StoryLocator;
17
+ }) | {
18
+ target: BodyStoryLocator;
19
+ text: string;
20
+ ref?: never;
21
+ in?: never;
22
+ };
23
+ /** HTML or Markdown replacement input for conversion and structured application. */
24
+ export type RichContentReplaceInput = {
25
+ value: string;
26
+ type: 'html' | 'markdown';
27
+ target?: SelectionTarget | BlockNodeAddress;
28
+ ref?: string;
29
+ in?: StoryLocator;
30
+ nestingPolicy?: NestingPolicy;
31
+ } | {
32
+ value: string;
33
+ type: 'html' | 'markdown';
34
+ target: BodyStoryLocator;
35
+ ref?: never;
36
+ in?: never;
37
+ nestingPolicy?: never;
15
38
  };
16
39
  /**
17
40
  * Input payload for the `doc.replace` operation.
18
41
  *
19
- * Discrimination: presence of `content` (structural) vs `text` (text replacement).
42
+ * Discrimination: `text` (plain), `value` (HTML/Markdown), or `content` (SDFragment).
20
43
  */
21
- export type ReplaceInput = TextReplaceInput | SDReplaceInput;
44
+ export type ReplaceInput = TextReplaceInput | RichContentReplaceInput | SDReplaceInput;
22
45
  /** Returns true when the input uses the structural SDFragment shape. */
23
46
  export declare function isStructuralReplaceInput(input: ReplaceInput): input is SDReplaceInput;
47
+ export declare function isRichContentReplaceInput(input: ReplaceInput): input is RichContentReplaceInput;
24
48
  export declare function executeReplace(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: ReplaceInput, options?: MutationOptions): SDMutationReceipt;
@@ -50,6 +50,8 @@ export type TextTarget = {
50
50
  segments: [TextSegment, ...TextSegment[]];
51
51
  /** Story containing this text target. Omit for body (backward compatible). */
52
52
  story?: StoryLocator;
53
+ /** Coordinate space for segment offsets. Omitted means `visible`. */
54
+ coordinateSpace?: TextCoordinateSpace;
53
55
  };
54
56
  /**
55
57
  * Block node types valid as `nodeEdge` selection anchors.