superdoc 2.7.0-next.1 → 2.7.0-next.11

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 (49) 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/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 +33 -0
  10. package/dist/document-api/src/contract/operation-registry.d.ts +20 -3
  11. package/dist/document-api/src/get-html/get-html.d.ts +6 -6
  12. package/dist/document-api/src/get-markdown/get-markdown.d.ts +2 -4
  13. package/dist/document-api/src/index.d.ts +18 -4
  14. package/dist/document-api/src/insert/insert.d.ts +12 -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/replace/replace.d.ts +18 -6
  19. package/dist/document-api/src/types/address.d.ts +2 -0
  20. package/dist/document-api/src/types/content-projection.d.ts +129 -0
  21. package/dist/document-api/src/types/index.d.ts +1 -0
  22. package/dist/document-api/src/types/mutation-plan.types.d.ts +4 -1
  23. package/dist/document-api/src/types/receipt.d.ts +1 -1
  24. package/dist/document-api/src/types/sd-contract.d.ts +9 -3
  25. package/dist/document-api/src/types/structural-input.d.ts +18 -3
  26. package/dist/document-api/src/write/write.d.ts +8 -3
  27. package/dist/layout-engine/painters/dom/src/index.d.ts +2 -0
  28. package/dist/layout-engine/painters/dom/src/web-flow/index.d.ts +3 -0
  29. package/dist/layout-engine/painters/dom/src/web-flow/painter.d.ts +2 -0
  30. package/dist/layout-engine/painters/dom/src/web-flow/render.d.ts +8 -0
  31. package/dist/layout-engine/painters/dom/src/web-flow/styles.d.ts +10 -0
  32. package/dist/layout-engine/painters/dom/src/web-flow/types.d.ts +77 -0
  33. package/dist/public/ui-react.cjs +1 -1
  34. package/dist/public/ui-react.es.js +1 -1
  35. package/dist/public/ui.cjs +1 -1
  36. package/dist/public/ui.es.js +1 -1
  37. package/dist/superdoc/src/composables/use-link-popover.d.ts +3 -14
  38. package/dist/superdoc/src/core/types/index.d.ts +12 -5
  39. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +2 -3
  40. package/dist/superdoc/src/public/ui/types.d.ts +1 -1
  41. package/dist/superdoc/src/public/ui.d.cts +4 -0
  42. package/dist/superdoc/src/public/ui.d.ts +1 -1
  43. package/dist/superdoc.cjs +36 -128
  44. package/dist/superdoc.es.js +36 -128
  45. package/dist/word-layout/src/index.d.ts +2 -0
  46. package/dist/word-layout/src/list-marker.d.ts +8 -0
  47. package/dist/word-layout/src/review-aware-numbering.d.ts +41 -0
  48. package/dist-cdn/superdoc.min.js +37 -37
  49. 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.7.0-next.1",
22
+ superdocVersion: "2.7.0-next.11",
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.1",
21
+ superdocVersion: "2.7.0-next.11",
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.";
@@ -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,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,6 +84,10 @@ 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';
@@ -90,7 +99,7 @@ export type { GetMarkdownAdapter, GetMarkdownInput } from './get-markdown/get-ma
90
99
  export type { GetHtmlAdapter, GetHtmlInput } from './get-html/get-html.js';
91
100
  export type { InfoAdapter, InfoInput } from './info/info.js';
92
101
  export type { ExtractAdapter, ExtractInput } from './extract/extract.js';
93
- export type { WriteAdapter, WriteRequest } from './write/write.js';
102
+ export type { WriteAdapter, WriteRequest, RichContentMutationOptions } from './write/write.js';
94
103
  export type { FormatInlineAliasApi, FormatInlineAliasInput, FormatBoldInput, FormatItalicInput, FormatRangeInput, FormatUnderlineInput, FormatStrikethroughInput, StyleApplyInput, StyleApplyOptions, } from './format/format.js';
95
104
  export type { InlineRunPatch, InlineRunPatchKey, InlinePropertyStorage, InlinePropertyType, InlinePropertyCarrier, InlinePropertyRegistryEntry, UnderlinePatch, ShadingPatch, BorderPatch, FitTextPatch, LangPatch, RFontsPatch, EastAsianLayoutPatch, StylisticSetPatch, } from './format/inline-run-patch.js';
96
105
  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 +234,7 @@ export type TablesAdapter = Omit<TablesApi, 'moveRow'> & {
225
234
  export interface CapabilitiesApi {
226
235
  (): DocumentApiCapabilities;
227
236
  get(): DocumentApiCapabilities;
237
+ check(input: SDHtmlMarkdownSupportCheckInput): Promise<SDHtmlMarkdownSupportCheckResult>;
228
238
  }
229
239
  export interface QueryApi {
230
240
  /** Accepts canonical nested input or a selector shorthand normalized to `{ select: ... }` internally. */
@@ -287,6 +297,8 @@ export interface DocumentApi {
287
297
  * Return the full document content as an HTML string.
288
298
  */
289
299
  getHtml(input: GetHtmlInput): string;
300
+ projectHtml(input: ProjectHtmlInput): Promise<SDContentProjectionResult<'html'>>;
301
+ projectMarkdown(input: ProjectMarkdownInput): Promise<SDContentProjectionResult<'markdown'>>;
290
302
  /**
291
303
  * Convert a Markdown string into an SDM/1 structural fragment.
292
304
  */
@@ -316,11 +328,11 @@ export interface DocumentApi {
316
328
  * Insert content at a target location.
317
329
  * If target is omitted, inserts at the end of the document.
318
330
  */
319
- insert(input: InsertInput, options?: MutationOptions): SDMutationReceipt;
331
+ insert(input: InsertInput, options?: RichContentMutationOptions): SDMutationReceipt;
320
332
  /**
321
333
  * Replace text at a target range.
322
334
  */
323
- replace(input: ReplaceInput, options?: MutationOptions): SDMutationReceipt;
335
+ replace(input: ReplaceInput, options?: RichContentMutationOptions): SDMutationReceipt;
324
336
  /**
325
337
  * Delete text at a target range.
326
338
  */
@@ -509,6 +521,8 @@ export interface DocumentApiAdapters {
509
521
  getText: GetTextAdapter;
510
522
  getMarkdown: GetMarkdownAdapter;
511
523
  getHtml: GetHtmlAdapter;
524
+ projectHtml?: ProjectHtmlAdapter;
525
+ projectMarkdown?: ProjectMarkdownAdapter;
512
526
  markdownToFragment: MarkdownToFragmentAdapter;
513
527
  htmlToFragment?: HtmlToFragmentAdapter;
514
528
  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
@@ -1,19 +1,23 @@
1
- import { MutationOptions } from '../types/mutation-plan.types.js';
1
+ import { RichContentMutationOptions, WriteAdapter } from '../write/write.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
6
  import { BlockNodeAddress } from '../types/base.js';
7
7
  import { NestingPolicy } from '../types/placement.js';
8
8
  import { SelectionMutationAdapter } from '../selection-mutation.js';
9
- import { WriteAdapter } from '../write/write.js';
10
- /** Text replacement input: uses SelectionTarget / ref. */
11
- export type TextReplaceInput = TargetLocator & {
9
+ /** Text replacement input: uses SelectionTarget / ref, or the complete main body. */
10
+ export type TextReplaceInput = (TargetLocator & {
12
11
  target?: SelectionTarget;
13
12
  ref?: string;
14
13
  text: string;
15
14
  /** Target a specific document story (body, header, footer, footnote, endnote). */
16
15
  in?: StoryLocator;
16
+ }) | {
17
+ target: BodyStoryLocator;
18
+ text: string;
19
+ ref?: never;
20
+ in?: never;
17
21
  };
18
22
  /** HTML or Markdown replacement input for conversion and structured application. */
19
23
  export type RichContentReplaceInput = {
@@ -23,6 +27,13 @@ export type RichContentReplaceInput = {
23
27
  ref?: string;
24
28
  in?: StoryLocator;
25
29
  nestingPolicy?: NestingPolicy;
30
+ } | {
31
+ value: string;
32
+ type: 'html' | 'markdown';
33
+ target: BodyStoryLocator;
34
+ ref?: never;
35
+ in?: never;
36
+ nestingPolicy?: never;
26
37
  };
27
38
  /**
28
39
  * Input payload for the `doc.replace` operation.
@@ -33,4 +44,5 @@ export type ReplaceInput = TextReplaceInput | RichContentReplaceInput | SDReplac
33
44
  /** Returns true when the input uses the structural SDFragment shape. */
34
45
  export declare function isStructuralReplaceInput(input: ReplaceInput): input is SDReplaceInput;
35
46
  export declare function isRichContentReplaceInput(input: ReplaceInput): input is RichContentReplaceInput;
36
- export declare function executeReplace(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: ReplaceInput, options?: MutationOptions): SDMutationReceipt;
47
+ export declare function validateReplaceInput(input: unknown): asserts input is ReplaceInput;
48
+ export declare function executeReplace(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: ReplaceInput, options?: RichContentMutationOptions): 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.