superdoc 2.7.0-next.2 → 2.7.0-next.20

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 (56) hide show
  1. package/dist/chunks/{create-super-doc-ui-C44xPZxz.cjs → create-super-doc-ui-B5nhSKqa.cjs} +11 -3
  2. package/dist/chunks/{create-super-doc-ui-BTNVc3UD.es.js → create-super-doc-ui-BJ6D4BfN.es.js} +11 -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/capabilities/capabilities.d.ts +3 -0
  6. package/dist/document-api/src/capabilities/html-markdown-support.d.ts +66 -0
  7. package/dist/document-api/src/content-projection/validation.d.ts +3 -0
  8. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  9. package/dist/document-api/src/contract/operation-definitions.d.ts +34 -1
  10. package/dist/document-api/src/contract/operation-registry.d.ts +20 -3
  11. package/dist/document-api/src/diff/diff.types.d.ts +19 -8
  12. package/dist/document-api/src/diff/index.d.ts +1 -1
  13. package/dist/document-api/src/get-html/get-html.d.ts +6 -6
  14. package/dist/document-api/src/get-markdown/get-markdown.d.ts +2 -4
  15. package/dist/document-api/src/index.d.ts +19 -4
  16. package/dist/document-api/src/insert/insert.d.ts +12 -2
  17. package/dist/document-api/src/project-html/project-html.d.ts +5 -0
  18. package/dist/document-api/src/project-markdown/project-markdown.d.ts +5 -0
  19. package/dist/document-api/src/ranges/ranges.types.d.ts +5 -2
  20. package/dist/document-api/src/replace/replace.d.ts +18 -6
  21. package/dist/document-api/src/types/address.d.ts +2 -0
  22. package/dist/document-api/src/types/content-projection.d.ts +129 -0
  23. package/dist/document-api/src/types/index.d.ts +1 -0
  24. package/dist/document-api/src/types/mutation-plan.types.d.ts +1 -1
  25. package/dist/document-api/src/types/receipt.d.ts +1 -1
  26. package/dist/document-api/src/types/sd-contract.d.ts +9 -3
  27. package/dist/document-api/src/types/structural-input.d.ts +18 -3
  28. package/dist/document-api/src/write/write.d.ts +8 -3
  29. package/dist/layout-engine/painters/dom/src/index.d.ts +2 -0
  30. package/dist/layout-engine/painters/dom/src/web-flow/index.d.ts +3 -0
  31. package/dist/layout-engine/painters/dom/src/web-flow/painter.d.ts +2 -0
  32. package/dist/layout-engine/painters/dom/src/web-flow/render.d.ts +8 -0
  33. package/dist/layout-engine/painters/dom/src/web-flow/styles.d.ts +10 -0
  34. package/dist/layout-engine/painters/dom/src/web-flow/types.d.ts +77 -0
  35. package/dist/public/ui-react.cjs +1 -1
  36. package/dist/public/ui-react.es.js +1 -1
  37. package/dist/public/ui.cjs +1 -1
  38. package/dist/public/ui.es.js +1 -1
  39. package/dist/style.css +10 -4
  40. package/dist/style.layered.css +10 -4
  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/public/index.d.cts +6 -0
  44. package/dist/superdoc/src/public/index.d.ts +1 -0
  45. package/dist/superdoc/src/public/ui/types.d.ts +1 -1
  46. package/dist/superdoc/src/public/ui.d.cts +4 -0
  47. package/dist/superdoc/src/public/ui.d.ts +1 -1
  48. package/dist/superdoc.cjs +49 -129
  49. package/dist/superdoc.es.js +49 -129
  50. package/dist/word-layout/src/index.d.ts +2 -0
  51. package/dist/word-layout/src/list-marker.d.ts +8 -0
  52. package/dist/word-layout/src/review-aware-numbering.d.ts +41 -0
  53. package/dist-cdn/style.layered.css +1 -1
  54. package/dist-cdn/superdoc.min.css +1 -1
  55. package/dist-cdn/superdoc.min.js +37 -37
  56. package/package.json +2 -2
@@ -8115,11 +8115,19 @@ function createSuperDocUI(options) {
8115
8115
  try {
8116
8116
  if (spec.action === "insert-row-before" || spec.action === "insert-row-after") {
8117
8117
  const host = getHost();
8118
- const insertRow = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8119
- if (typeof insertRow?.insertRow !== "function") return false;
8118
+ const tableCommands = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8119
+ if (typeof tableCommands?.insertRow !== "function") return false;
8120
8120
  const options = editorMutationOptionsForRoute(descriptor.docRoute);
8121
8121
  if (options && options.success === false) return options;
8122
- return options ? insertRow.insertRow(input, options) : insertRow.insertRow(input);
8122
+ return options ? tableCommands.insertRow(input, options) : tableCommands.insertRow(input);
8123
+ }
8124
+ if (spec.action === "insert-column-before" || spec.action === "insert-column-after") {
8125
+ const host = getHost();
8126
+ const tableCommands = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8127
+ if (typeof tableCommands?.insertColumn !== "function") return false;
8128
+ const options = editorMutationOptionsForRoute(descriptor.docRoute);
8129
+ if (options && options.success === false) return options;
8130
+ return options ? tableCommands.insertColumn(input, context.rowIndex, options) : tableCommands.insertColumn(input, context.rowIndex);
8123
8131
  }
8124
8132
  return callEditorMutation(descriptor.docRoute, op, input);
8125
8133
  } catch {
@@ -8115,11 +8115,19 @@ function createSuperDocUI(options) {
8115
8115
  try {
8116
8116
  if (spec.action === "insert-row-before" || spec.action === "insert-row-after") {
8117
8117
  const host = getHost();
8118
- const insertRow = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8119
- if (typeof insertRow?.insertRow !== "function") return false;
8118
+ const tableCommands = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8119
+ if (typeof tableCommands?.insertRow !== "function") return false;
8120
8120
  const options = editorMutationOptionsForRoute(descriptor.docRoute);
8121
8121
  if (options && options.success === false) return options;
8122
- return options ? insertRow.insertRow(input, options) : insertRow.insertRow(input);
8122
+ return options ? tableCommands.insertRow(input, options) : tableCommands.insertRow(input);
8123
+ }
8124
+ if (spec.action === "insert-column-before" || spec.action === "insert-column-after") {
8125
+ const host = getHost();
8126
+ const tableCommands = ((typeof host?.getHandles === "function" ? host.getHandles() : null)?.editing)?.tables;
8127
+ if (typeof tableCommands?.insertColumn !== "function") return false;
8128
+ const options = editorMutationOptionsForRoute(descriptor.docRoute);
8129
+ if (options && options.success === false) return options;
8130
+ return options ? tableCommands.insertColumn(input, context.rowIndex, options) : tableCommands.insertColumn(input, context.rowIndex);
8123
8131
  }
8124
8132
  return callEditorMutation(descriptor.docRoute, op, input);
8125
8133
  } catch {
@@ -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.7.0-next.2",
22
+ superdocVersion: "2.7.0-next.20",
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.7.0-next.2",
21
+ superdocVersion: "2.7.0-next.20",
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,5 +1,6 @@
1
1
  import { OperationId } from '../contract/types.js';
2
2
  import { InlinePropertyStorage, InlinePropertyType, InlineRunPatchKey } from '../format/inline-run-patch.js';
3
+ import { SDHtmlMarkdownSupportCheckInput, SDHtmlMarkdownSupportCheckResult } from './html-markdown-support.js';
3
4
  export declare const CAPABILITY_REASON_CODES: readonly ["COMMAND_UNAVAILABLE", "HELPER_UNAVAILABLE", "OPERATION_UNAVAILABLE", "TRACKED_MODE_UNAVAILABLE", "DRY_RUN_UNAVAILABLE", "NAMESPACE_UNAVAILABLE", "STYLES_PART_MISSING", "COLLABORATION_ACTIVE"];
4
5
  export type CapabilityReasonCode = (typeof CAPABILITY_REASON_CODES)[number];
5
6
  /**
@@ -72,6 +73,7 @@ export interface DocumentApiCapabilities {
72
73
  /** Engine-specific adapter that resolves runtime capabilities for the current editor instance. */
73
74
  export interface CapabilitiesAdapter {
74
75
  get(): DocumentApiCapabilities;
76
+ check?(input: SDHtmlMarkdownSupportCheckInput): Promise<SDHtmlMarkdownSupportCheckResult>;
75
77
  }
76
78
  /**
77
79
  * Delegates to the capabilities adapter to retrieve the current capability snapshot.
@@ -80,3 +82,4 @@ export interface CapabilitiesAdapter {
80
82
  * @returns The resolved capabilities for this editor instance.
81
83
  */
82
84
  export declare function executeCapabilities(adapter: CapabilitiesAdapter): DocumentApiCapabilities;
85
+ export declare function executeCapabilitiesCheck(adapter: CapabilitiesAdapter, input: SDHtmlMarkdownSupportCheckInput): Promise<SDHtmlMarkdownSupportCheckResult>;
@@ -0,0 +1,66 @@
1
+ import { RichContentInsertInput } from '../insert/insert.js';
2
+ import { RichContentReplaceInput } from '../replace/replace.js';
3
+ import { ChangeMode } from '../write/write.js';
4
+ import { ProjectHtmlInput, ProjectMarkdownInput, SDContentProjectionResult, SDProjectionReviewMode, SDResolvedProjectionScope } from '../types/content-projection.js';
5
+ import { SDFragment } from '../types/fragment.js';
6
+ import { SDError, SDHtmlMarkdownOutcome, SDMutationConversionReport, SDMutationReceipt } from '../types/sd-contract.js';
7
+ import { StoryLocator } from '../types/story.types.js';
8
+ export interface SDHtmlMarkdownCheckGuard {
9
+ version: 'sd-html-markdown-check/1';
10
+ operation: 'insert' | 'replace';
11
+ evaluatedRevision: string;
12
+ requestSha256: string;
13
+ analysisSha256: string;
14
+ }
15
+ export type SDHtmlMarkdownSupportCheckInput = {
16
+ operation: 'insert';
17
+ input: RichContentInsertInput;
18
+ options?: {
19
+ changeMode?: ChangeMode;
20
+ };
21
+ } | {
22
+ operation: 'replace';
23
+ input: RichContentReplaceInput;
24
+ options?: {
25
+ changeMode?: ChangeMode;
26
+ };
27
+ } | {
28
+ operation: 'projectHtml';
29
+ input?: ProjectHtmlInput;
30
+ } | {
31
+ operation: 'projectMarkdown';
32
+ input?: ProjectMarkdownInput;
33
+ };
34
+ interface SDHtmlMarkdownCheckCommon {
35
+ operation: SDHtmlMarkdownSupportCheckInput['operation'];
36
+ format: 'html' | 'markdown';
37
+ supported: boolean;
38
+ outcome: SDHtmlMarkdownOutcome;
39
+ evaluatedRevision: string;
40
+ failure?: SDError;
41
+ }
42
+ export interface SDHtmlMarkdownWriteCheckResult extends SDHtmlMarkdownCheckCommon {
43
+ operation: 'insert' | 'replace';
44
+ wouldChange: boolean;
45
+ conversion: SDMutationConversionReport;
46
+ plan?: {
47
+ fragment: SDFragment;
48
+ resolution: NonNullable<SDMutationReceipt['resolution']>;
49
+ changeMode: ChangeMode;
50
+ atomic: true;
51
+ };
52
+ guard?: SDHtmlMarkdownCheckGuard;
53
+ }
54
+ export interface SDHtmlMarkdownProjectionCheckResult extends SDHtmlMarkdownCheckCommon {
55
+ operation: 'projectHtml' | 'projectMarkdown';
56
+ plan?: {
57
+ reviewMode: SDProjectionReviewMode;
58
+ story: StoryLocator;
59
+ scope: SDResolvedProjectionScope;
60
+ includeSourceMap: boolean;
61
+ };
62
+ projection?: SDContentProjectionResult<'html' | 'markdown'>;
63
+ }
64
+ export type SDHtmlMarkdownSupportCheckResult = SDHtmlMarkdownWriteCheckResult | SDHtmlMarkdownProjectionCheckResult;
65
+ export declare function validateSDHtmlMarkdownSupportCheckInput(input: unknown): asserts input is SDHtmlMarkdownSupportCheckInput;
66
+ export {};
@@ -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" | "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")[];
4
+ export declare const MUTATING_OPERATION_IDS: ("replace" | "find" | "delete" | "get" | "insert" | "info" | "projectHtml" | "projectMarkdown" | "capabilities.check" | "format.apply" | "blocks.split" | "blocks.merge" | "blocks.move" | "lists.getState" | "lists.apply" | "lists.continue" | "lists.restart" | "lists.remove" | "format.paragraph.setMarkRunProps" | "tables.moveRow" | "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. */
@@ -1055,6 +1055,17 @@ export declare const OPERATION_DEFINITIONS: {
1055
1055
  readonly referenceDocPath: "capabilities/get.mdx";
1056
1056
  readonly referenceGroup: "capabilities";
1057
1057
  };
1058
+ readonly 'capabilities.check': {
1059
+ readonly memberPath: "capabilities.check";
1060
+ readonly description: "Check an exact HTML or Markdown insert, replace, or detailed projection against the current document without mutating it.";
1061
+ readonly expectedResult: "Returns a Promise resolving to structured support, fidelity outcome, diagnostics, and a revision-bound guard for supported writes.";
1062
+ readonly requiresDocumentContext: true;
1063
+ readonly metadata: CommandStaticMetadata;
1064
+ readonly referenceDocPath: "capabilities/check.mdx";
1065
+ readonly referenceGroup: "capabilities";
1066
+ readonly intentGroup: "edit";
1067
+ readonly intentAction: "check_support";
1068
+ };
1058
1069
  readonly 'create.table': {
1059
1070
  readonly memberPath: "create.table";
1060
1071
  readonly description: "Create a new table at the target position.";
@@ -3172,7 +3183,7 @@ export declare const OPERATION_DEFINITIONS: {
3172
3183
  readonly 'diff.apply': {
3173
3184
  readonly memberPath: "diff.apply";
3174
3185
  readonly description: string;
3175
- readonly expectedResult: "Returns a DiffApplyResult with applied operation count and diagnostics.";
3186
+ readonly expectedResult: "Returns a DiffApplyResult with per-operation review receipts, applied operation count, and diagnostics.";
3176
3187
  readonly requiresDocumentContext: true;
3177
3188
  readonly metadata: CommandStaticMetadata;
3178
3189
  readonly referenceDocPath: "diff/apply.mdx";
@@ -3481,6 +3492,28 @@ export declare const OPERATION_DEFINITIONS: {
3481
3492
  readonly intentGroup: "get_content";
3482
3493
  readonly intentAction: "html";
3483
3494
  };
3495
+ readonly projectMarkdown: {
3496
+ readonly memberPath: "projectMarkdown";
3497
+ readonly description: "Project document content as Markdown with review, scope, diagnostics, and provenance metadata.";
3498
+ readonly expectedResult: "Returns a Promise resolving to a detailed Markdown content projection result.";
3499
+ readonly requiresDocumentContext: true;
3500
+ readonly metadata: CommandStaticMetadata;
3501
+ readonly referenceDocPath: "project-markdown.mdx";
3502
+ readonly referenceGroup: "core";
3503
+ readonly intentGroup: "get_content";
3504
+ readonly intentAction: "markdown_projection";
3505
+ };
3506
+ readonly projectHtml: {
3507
+ readonly memberPath: "projectHtml";
3508
+ readonly description: "Project document content as HTML with review, scope, diagnostics, and provenance metadata.";
3509
+ readonly expectedResult: "Returns a Promise resolving to a detailed HTML content projection result.";
3510
+ readonly requiresDocumentContext: true;
3511
+ readonly metadata: CommandStaticMetadata;
3512
+ readonly referenceDocPath: "project-html.mdx";
3513
+ readonly referenceGroup: "core";
3514
+ readonly intentGroup: "get_content";
3515
+ readonly intentAction: "html_projection";
3516
+ };
3484
3517
  readonly markdownToFragment: {
3485
3518
  readonly memberPath: "markdownToFragment";
3486
3519
  readonly description: "Convert a Markdown string into an SDM/1 structural fragment.";
@@ -11,6 +11,7 @@ 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';
15
16
  import { HtmlToFragmentInput } from '../html-to-fragment/html-to-fragment.js';
16
17
  import { InfoInput } from '../info/info.js';
@@ -20,7 +21,7 @@ import { ClearContentInput } from '../clear-content/clear-content.js';
20
21
  import { InsertInput } from '../insert/insert.js';
21
22
  import { ReplaceInput } from '../replace/replace.js';
22
23
  import { DeleteInput } from '../delete/delete.js';
23
- import { MutationOptions, RevisionGuardOptions } from '../write/write.js';
24
+ import { MutationOptions, RevisionGuardOptions, RichContentMutationOptions } from '../write/write.js';
24
25
  import { FormatInlineAliasInput, FormatRangeInput, StyleApplyInput } from '../format/format.js';
25
26
  import { InlineRunPatchKey } from '../format/inline-run-patch.js';
26
27
  import { StylesApplyInput, StylesApplyOptions, StylesApplyReceipt, StylesGetCatalogInput, StylesGetCatalogResult } from '../styles/index.js';
@@ -30,6 +31,7 @@ import { CommentInfo, CommentsListQuery, CommentsListResult } from '../comments/
30
31
  import { TrackChangesListInput, TrackChangesGetInput, ReviewDecideInput } from '../track-changes/track-changes.js';
31
32
  import { TrackChangeInfo, TrackChangesListResult } from '../types/track-changes.types.js';
32
33
  import { DocumentApiCapabilities } from '../capabilities/capabilities.js';
34
+ import { SDHtmlMarkdownSupportCheckInput, SDHtmlMarkdownSupportCheckResult } from '../capabilities/html-markdown-support.js';
33
35
  import { HistoryState, HistoryActionResult } from '../history/history.types.js';
34
36
  import { DiffSnapshot, DiffPayload, DiffApplyResult, DiffCompareInput, DiffApplyInput, DiffApplyOptions } from '../diff/diff.types.js';
35
37
  import { ExportToDocxInput, ExportToDocxResult } from '../export/export.types.js';
@@ -103,6 +105,16 @@ export interface OperationRegistry extends FormatInlineAliasOperationRegistry {
103
105
  options: never;
104
106
  output: string;
105
107
  };
108
+ projectMarkdown: {
109
+ input: ProjectMarkdownInput;
110
+ options: never;
111
+ output: Promise<SDContentProjectionResult<'markdown'>>;
112
+ };
113
+ projectHtml: {
114
+ input: ProjectHtmlInput;
115
+ options: never;
116
+ output: Promise<SDContentProjectionResult<'html'>>;
117
+ };
106
118
  markdownToFragment: {
107
119
  input: MarkdownToFragmentInput;
108
120
  options: never;
@@ -130,12 +142,12 @@ export interface OperationRegistry extends FormatInlineAliasOperationRegistry {
130
142
  };
131
143
  insert: {
132
144
  input: InsertInput;
133
- options: MutationOptions;
145
+ options: RichContentMutationOptions;
134
146
  output: SDMutationReceipt;
135
147
  };
136
148
  replace: {
137
149
  input: ReplaceInput;
138
- options: MutationOptions;
150
+ options: RichContentMutationOptions;
139
151
  output: SDMutationReceipt;
140
152
  };
141
153
  delete: {
@@ -718,6 +730,11 @@ export interface OperationRegistry extends FormatInlineAliasOperationRegistry {
718
730
  options: never;
719
731
  output: DocumentApiCapabilities;
720
732
  };
733
+ 'capabilities.check': {
734
+ input: SDHtmlMarkdownSupportCheckInput;
735
+ options: never;
736
+ output: Promise<SDHtmlMarkdownSupportCheckResult>;
737
+ };
721
738
  'history.get': {
722
739
  input: undefined;
723
740
  options: never;
@@ -1,10 +1,6 @@
1
- /**
2
- * Public types for the snapshot-based document diff contract.
3
- *
4
- * These types are engine-agnostic wrappers around opaque engine payloads.
5
- * The `payload` field in both DiffSnapshot and DiffPayload is engine-owned
6
- * and must not be inspected by consumers.
7
- */
1
+ import { TrackedChangeAddress } from '../types/address.js';
2
+ import { StoryLocator } from '../types/story.types.js';
3
+ import { TrackChangeNavigationTarget } from '../types/track-changes.types.js';
8
4
  /** Identifier for the engine adapter that produced the opaque payload. */
9
5
  export type DiffEngineId = 'superdoc-v2';
10
6
  /** Declares which document components are included in a snapshot or diff. */
@@ -58,9 +54,24 @@ export interface DiffPayload {
58
54
  /** Opaque engine-owned diff data. Do not inspect or modify. */
59
55
  payload: Record<string, unknown>;
60
56
  }
61
- /** Result metadata returned after applying a diff. */
57
+ export interface DiffApplyReviewItem {
58
+ id: string;
59
+ story: StoryLocator;
60
+ address: TrackedChangeAddress;
61
+ navigationTarget?: TrackChangeNavigationTarget;
62
+ }
63
+ export type DiffApplyOperationReceipt = {
64
+ operationId: string;
65
+ disposition: 'review-created';
66
+ reviewItems: [DiffApplyReviewItem, ...DiffApplyReviewItem[]];
67
+ } | {
68
+ operationId: string;
69
+ disposition: 'applied-directly';
70
+ reviewItems: [];
71
+ };
62
72
  export interface DiffApplyResult {
63
73
  appliedOperations: number;
74
+ operationReceipts: DiffApplyOperationReceipt[];
64
75
  baseFingerprint: string;
65
76
  targetFingerprint: string;
66
77
  coverage: DiffCoverage;
@@ -1,3 +1,3 @@
1
1
  export type { DiffAdapter, DiffApi } from './diff.js';
2
2
  export { executeDiffCapture, executeDiffCompare, executeDiffApply } from './diff.js';
3
- export type { DiffSnapshot, DiffPayload, DiffApplyResult, DiffSummary, DiffCoverage, DiffEngineId, DiffCompareInput, DiffApplyInput, DiffApplyOptions, DiffChangeMode, } from './diff.types.js';
3
+ export type { DiffSnapshot, DiffPayload, DiffApplyResult, DiffSummary, DiffCoverage, DiffEngineId, DiffCompareInput, DiffApplyInput, DiffApplyOptions, DiffChangeMode, DiffApplyOperationReceipt, DiffApplyReviewItem, } from './diff.types.js';
@@ -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.
@@ -12,6 +12,9 @@ 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
19
  import { HtmlToFragmentAdapter, HtmlToFragmentInput } from './html-to-fragment/html-to-fragment.js';
17
20
  import { SDHtmlToFragmentResult, SDMarkdownToFragmentResult } from './types/sd-contract.js';
@@ -27,9 +30,10 @@ import { CreateAdapter, CreateApi } from './create/create.js';
27
30
  import { BlocksAdapter, BlocksApi } from './blocks/blocks.js';
28
31
  import { TableLocator, TableMutationResult, TablesConvertFromTextInput, TablesMoveInput, TablesSplitInput, TablesConvertToTextInput, TablesSetLayoutInput, TablesInsertRowInput, TablesDeleteRowInput, TablesMoveRowInput, TablesSetRowHeightInput, TablesDistributeRowsInput, TablesSetRowOptionsInput, TablesInsertColumnInput, TablesDeleteColumnInput, TablesSetColumnWidthInput, TablesDistributeColumnsInput, TablesInsertCellInput, TablesDeleteCellInput, TablesMergeCellsInput, TablesUnmergeCellsInput, TablesSplitCellInput, TablesSetCellPropertiesInput, TablesSetCellTextInput, TablesSortInput, TablesSetAltTextInput, TablesSetStyleInput, TablesClearStyleInput, TablesSetStyleOptionInput, TablesSetBorderInput, TablesClearBorderInput, TablesApplyBorderPresetInput, TablesSetShadingInput, TablesClearShadingInput, TablesSetTablePaddingInput, TablesSetCellPaddingInput, TablesSetCellSpacingInput, TablesClearCellSpacingInput, TablesApplyStyleInput, TablesSetBordersInput, TablesSetTableOptionsInput, TablesApplyPresetInput, TablesGetInput, TablesGetOutput, TablesGetCellsInput, TablesGetCellsOutput, TablesGetPropertiesInput, TablesGetPropertiesOutput, TablesGetStylesInput, TablesGetStylesOutput, TablesSetDefaultStyleInput, TablesClearDefaultStyleInput } from './types/table-operations.types.js';
29
32
  import { TrackChangesAdapter, TrackChangesApi } from './track-changes/track-changes.js';
30
- import { MutationOptions, RevisionGuardOptions, WriteAdapter } from './write/write.js';
33
+ import { MutationOptions, RevisionGuardOptions, RichContentMutationOptions, WriteAdapter } from './write/write.js';
31
34
  import { SelectionMutationAdapter } from './selection-mutation.js';
32
35
  import { CapabilitiesAdapter, DocumentApiCapabilities } from './capabilities/capabilities.js';
36
+ import { SDHtmlMarkdownSupportCheckInput, SDHtmlMarkdownSupportCheckResult } from './capabilities/html-markdown-support.js';
33
37
  import { OperationId } from './contract/types.js';
34
38
  import { DynamicInvokeRequest, InvokeRequest, InvokeResult } from './contract/operation-registry.js';
35
39
  import { PlanApi } from './plan/plan.js';
@@ -60,6 +64,7 @@ import { AuthoritiesApi, AuthoritiesAdapter } from './authorities/authorities.js
60
64
  export * from './types/index.js';
61
65
  export * from './contract/index.js';
62
66
  export * from './capabilities/capabilities.js';
67
+ export * from './capabilities/html-markdown-support.js';
63
68
  export * from './inline-semantics/index.js';
64
69
  export type { HistoryAdapter, HistoryApi } from './history/history.js';
65
70
  export { executeHistoryGet, executeHistoryUndo, executeHistoryRedo } from './history/history.js';
@@ -79,9 +84,14 @@ export type { MarkdownToFragmentInput, MarkdownToFragmentAdapter, } from './mark
79
84
  export { executeMarkdownToFragment } from './markdown-to-fragment/markdown-to-fragment.js';
80
85
  export type { HtmlToFragmentInput, HtmlToFragmentAdapter } from './html-to-fragment/html-to-fragment.js';
81
86
  export { executeHtmlToFragment } from './html-to-fragment/html-to-fragment.js';
87
+ export type { ProjectHtmlAdapter } from './project-html/project-html.js';
88
+ export { executeProjectHtml } from './project-html/project-html.js';
89
+ export type { ProjectMarkdownAdapter } from './project-markdown/project-markdown.js';
90
+ export { executeProjectMarkdown } from './project-markdown/project-markdown.js';
82
91
  export type { HistoryState, HistoryActionResult, HistoryNoopReason, SDHistoryStatus, SDHistoryCollaborationMeta, } from './history/history.types.js';
83
92
  export { executeTrackChangesGet, executeTrackChangesList, executeTrackChangesDecide, } from './track-changes/track-changes.js';
84
93
  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';
94
+ export type { DiffSnapshot, DiffPayload, DiffApplyResult, DiffCompareInput, DiffApplyInput, DiffApplyOptions, DiffApplyOperationReceipt, DiffApplyReviewItem, } from './diff/diff.types.js';
85
95
  export type { GetAdapter } from './get/get.js';
86
96
  export type { FindAdapter, FindOptions } from './find/find.js';
87
97
  export type { GetNodeAdapter, GetNodeByIdInput } from './get-node/get-node.js';
@@ -90,7 +100,7 @@ export type { GetMarkdownAdapter, GetMarkdownInput } from './get-markdown/get-ma
90
100
  export type { GetHtmlAdapter, GetHtmlInput } from './get-html/get-html.js';
91
101
  export type { InfoAdapter, InfoInput } from './info/info.js';
92
102
  export type { ExtractAdapter, ExtractInput } from './extract/extract.js';
93
- export type { WriteAdapter, WriteRequest } from './write/write.js';
103
+ export type { WriteAdapter, WriteRequest, RichContentMutationOptions } from './write/write.js';
94
104
  export type { FormatInlineAliasApi, FormatInlineAliasInput, FormatBoldInput, FormatItalicInput, FormatRangeInput, FormatUnderlineInput, FormatStrikethroughInput, StyleApplyInput, StyleApplyOptions, } from './format/format.js';
95
105
  export type { InlineRunPatch, InlineRunPatchKey, InlinePropertyStorage, InlinePropertyType, InlinePropertyCarrier, InlinePropertyRegistryEntry, UnderlinePatch, ShadingPatch, BorderPatch, FitTextPatch, LangPatch, RFontsPatch, EastAsianLayoutPatch, StylisticSetPatch, } from './format/inline-run-patch.js';
96
106
  export { INLINE_PROPERTY_REGISTRY, INLINE_PROPERTY_KEY_SET, INLINE_PROPERTY_BY_KEY, INLINE_PROPERTY_KEYS_BY_STORAGE, validateInlineRunPatch, buildInlineRunPatchSchema, } from './format/inline-run-patch.js';
@@ -225,6 +235,7 @@ export type TablesAdapter = Omit<TablesApi, 'moveRow'> & {
225
235
  export interface CapabilitiesApi {
226
236
  (): DocumentApiCapabilities;
227
237
  get(): DocumentApiCapabilities;
238
+ check(input: SDHtmlMarkdownSupportCheckInput): Promise<SDHtmlMarkdownSupportCheckResult>;
228
239
  }
229
240
  export interface QueryApi {
230
241
  /** Accepts canonical nested input or a selector shorthand normalized to `{ select: ... }` internally. */
@@ -287,6 +298,8 @@ export interface DocumentApi {
287
298
  * Return the full document content as an HTML string.
288
299
  */
289
300
  getHtml(input: GetHtmlInput): string;
301
+ projectHtml(input: ProjectHtmlInput): Promise<SDContentProjectionResult<'html'>>;
302
+ projectMarkdown(input: ProjectMarkdownInput): Promise<SDContentProjectionResult<'markdown'>>;
290
303
  /**
291
304
  * Convert a Markdown string into an SDM/1 structural fragment.
292
305
  */
@@ -316,11 +329,11 @@ export interface DocumentApi {
316
329
  * Insert content at a target location.
317
330
  * If target is omitted, inserts at the end of the document.
318
331
  */
319
- insert(input: InsertInput, options?: MutationOptions): SDMutationReceipt;
332
+ insert(input: InsertInput, options?: RichContentMutationOptions): SDMutationReceipt;
320
333
  /**
321
334
  * Replace text at a target range.
322
335
  */
323
- replace(input: ReplaceInput, options?: MutationOptions): SDMutationReceipt;
336
+ replace(input: ReplaceInput, options?: RichContentMutationOptions): SDMutationReceipt;
324
337
  /**
325
338
  * Delete text at a target range.
326
339
  */
@@ -509,6 +522,8 @@ export interface DocumentApiAdapters {
509
522
  getText: GetTextAdapter;
510
523
  getMarkdown: GetMarkdownAdapter;
511
524
  getHtml: GetHtmlAdapter;
525
+ projectHtml?: ProjectHtmlAdapter;
526
+ projectMarkdown?: ProjectMarkdownAdapter;
512
527
  markdownToFragment: MarkdownToFragmentAdapter;
513
528
  htmlToFragment?: HtmlToFragmentAdapter;
514
529
  info: InfoAdapter;
@@ -1,4 +1,4 @@
1
- import { MutationOptions, WriteAdapter } from '../write/write.js';
1
+ import { RichContentMutationOptions, WriteAdapter } from '../write/write.js';
2
2
  import { SelectionTarget, TargetLocator, SDMutationReceipt } from '../types/index.js';
3
3
  import { SDInsertInput } from '../types/structural-input.js';
4
4
  import { StoryLocator } from '../types/story.types.js';
@@ -45,8 +45,18 @@ export type LegacyInsertInput = TextInsertInput;
45
45
  * These are mutually exclusive: providing both is an error.
46
46
  */
47
47
  export type InsertInput = TextInsertInput | RichContentInsertInput | SDInsertInput;
48
+ export declare function isRichContentInsertInput(input: InsertInput): input is RichContentInsertInput;
48
49
  /** Returns true when the input uses the structural SDFragment shape. */
49
50
  export declare function isStructuralInsertInput(input: InsertInput): input is SDInsertInput;
51
+ /**
52
+ * Validates InsertInput as either text or structural shape.
53
+ *
54
+ * Validation order:
55
+ * 0. Input shape guard (must be non-null plain object)
56
+ * 1. Union conflict detection (mutually exclusive discriminants)
57
+ * 2. Shape-specific field and type validation
58
+ */
59
+ export declare function validateInsertInput(input: unknown): asserts input is InsertInput;
50
60
  /**
51
61
  * Executes an insert operation, routing to the appropriate adapter path.
52
62
  *
@@ -60,5 +70,5 @@ export declare function isStructuralInsertInput(input: InsertInput): input is SD
60
70
  * @param options - Optional mutation options (changeMode, dryRun, expectedRevision).
61
71
  * @returns Receipt indicating success/failure and mutation metadata.
62
72
  */
63
- export declare function executeInsert(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: InsertInput, options?: MutationOptions): SDMutationReceipt;
73
+ export declare function executeInsert(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: InsertInput, options?: RichContentMutationOptions): SDMutationReceipt;
64
74
  export {};
@@ -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