@stll/docx-core 0.43.0 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1325,6 +1325,12 @@ type NumberingDefinitions = {
1325
1325
  preserved?: PreservedMarkup;
1326
1326
  /** Attributes of `w:numbering` the model has no field for. */
1327
1327
  preservedAttributes?: PreservedAttribute[];
1328
+ /**
1329
+ * `w:numId` values a paragraph or style names that resolve to no list, in
1330
+ * ascending order. The reader shows those paragraphs unnumbered, while a
1331
+ * paragraph saved as read still names the id: a new list never takes one.
1332
+ */
1333
+ danglingNumIds?: number[];
1328
1334
  };
1329
1335
  /**
1330
1336
  * GENERATED FILE — do not edit.
@@ -2596,6 +2602,12 @@ type Comment = {
2596
2602
  parentId?: number;
2597
2603
  /** Whether the comment is resolved/done */
2598
2604
  done?: boolean;
2605
+ /**
2606
+ * The pending suggestion that proposed this comment. In memory only, never
2607
+ * written to a file: a save leaves a proposed comment out, accepting its
2608
+ * suggestion clears this, and rejecting it removes the comment.
2609
+ */
2610
+ suggestionId?: string;
2599
2611
  /**
2600
2612
  * Body markup `content` cannot hold: a table, an equation, a content
2601
2613
  * control, a bookmark or range marker, a tracked-change wrapper. The
@@ -2743,6 +2755,22 @@ type TrackedResolutionJoins = {
2743
2755
  id: number;
2744
2756
  }[];
2745
2757
  }[];
2758
+ /**
2759
+ * Identities of the record `levels` above this wrapper, handed to the
2760
+ * piece of it that an edit cut off after this wrapper, when removing this
2761
+ * wrapper leaves that record empty. Saved as its own ignorable attribute.
2762
+ */
2763
+ retainedEnclosing?: readonly {
2764
+ levels: number;
2765
+ source: readonly {
2766
+ space: "revision" | "control";
2767
+ id: number;
2768
+ }[];
2769
+ target: readonly {
2770
+ space: "revision" | "control";
2771
+ id: number;
2772
+ }[];
2773
+ }[];
2746
2774
  };
2747
2775
  /**
2748
2776
  * Insertion wrapper (w:ins) — runs inserted by tracked changes
Binary file
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $r as NumberingDefinitions, B as finalizeParagraphFormatting, Bn as RunContent, Cn as Paragraph, E as Style, H as setDocumentBodyComments, Kn as SectionProperties, St as DocumentBody, V as isCanonicallyEmptyParagraphFormatting, br as TextContent, bt as DocumentBackground, cr as TableCell, gr as TableRow, i as Document, it as BlockContent, kn as PositionalTab, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, sr as Table, ut as BreakContent, wn as ParagraphContent, xt as DocumentBackgroundDrawing, zn as Run } from "./document-Ca6wPoTu.js";
1
+ import { $r as NumberingDefinitions, B as finalizeParagraphFormatting, Bn as RunContent, Cn as Paragraph, E as Style, H as setDocumentBodyComments, Kn as SectionProperties, St as DocumentBody, V as isCanonicallyEmptyParagraphFormatting, br as TextContent, bt as DocumentBackground, cr as TableCell, gr as TableRow, i as Document, it as BlockContent, kn as PositionalTab, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, sr as Table, ut as BreakContent, wn as ParagraphContent, xt as DocumentBackgroundDrawing, zn as Run } from "./document-CaGfolcU.js";
2
2
  import { TaggedErrorClass } from "better-result";
3
3
  import { Buffer } from "node:buffer";
4
4
  type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { T as borderStyleToken, Z as headingOutlineLevel, _t as isCanonicallyEmptyParagraphFormatting, ct as paragraphNumberingReferenceId, d as isNoteReferenceId, f as isOoxmlSymbolCharacter, gt as finalizeParagraphFormatting, k as statesNoBorder, lt as paragraphNumberingSlots, ot as paragraphNumberingLevel, r as DOCX_CONFORMANCE_CLASSES, s as MAX_REVISION_ID, st as paragraphNumberingReference, vt as setDocumentBodyComments } from "./document-CEMwM5On.js";
2
2
  import { d as ID_VALUE_ELEMENTS, f as NUMBERING_ATTRIBUTES, m as localName$2, o as readXml, p as isOoxmlNumericIdAttributeName, t as XmlReadError } from "./streamingXmlParser-GnKxUuw_.js";
3
- import { i as serializeSequenceChildren } from "./sequenceChildren-CSn0-1ov.js";
3
+ import { i as serializeSequenceChildren } from "./sequenceChildren-BEcOm3tR.js";
4
4
  import { _ as ZipError } from "./format-DXPXB02u.js";
5
5
  import { t as ZipArchive } from "./archive-yBR7X-Qc.js";
6
6
  import { a as hasIllegalXmlCharacters, i as escapeXmlText, n as sanitizeMarkdownHref, o as sanitizeXmlCharacters, r as escapeXmlAttribute, t as sanitizeExternalUrl } from "./href-ogmJmncc.js";
@@ -1,3 +1,3 @@
1
- import { $ as locksContent, $i as TEXT_DIRECTION_FLOWS, $n as ShapeGeometryAdjustment, $r as NumberingDefinitions, $t as ImageWrapPolygon, A as ThemeColorScheme, Aa as BORDER_STYLES, Ai as mergeParagraphNumbering, An as PositionedBookmarkMarker, Ar as isOoxmlSymbolCharacter, At as EndnoteProperties, B as finalizeParagraphFormatting, Bi as HeadingOutlineLevel, Bn as RunContent, Br as presetLineDashFrom, Bt as HeaderFooterType, C as Relationship, Ca as UnrecognisedBorderStyle, Ci as NO_NUMBERING_NUM_ID, Cn as Paragraph, Cr as TrackedRunChange, Ct as DrawingAnchor, D as StyleDefinitions, Da as isBorderNone, Di as ParagraphNumberingSlots, Dn as ParagraphPropertyChange, Dr as WrapDistanceSlots, Dt as EffectExtentSlots, E as Style, Ea as isBorderNil, Ei as ParagraphNumberingReference, En as ParagraphMarkChangeKind, Er as Watermark, Et as DrawingRawXmlMode, F as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Fi as paragraphNumberingSlots, Fn as PropertyChangeInfo, Fr as PreviewDescriptor, Ft as FooterReference, G as ContentControlLock, Gi as outlineLevelStatedValue, Gn as Section, Gr as COUNTER_FORMATS, Gt as ImageCrop, H as setDocumentBodyComments, Hi as headingLevelOf, Hn as SdtEndProperties, Hr as PRESET_LINE_DASH_VALS, Ht as Hyperlink, I as PARSE_WARNING_CODES, Ii as resolveParagraphNumbering, In as PropertyRevisionKind, Ir as PreviewShape, It as Footnote, J as LockedControlViolation, Ji as PARAGRAPH_ALIGNMENTS, Jn as SectionStart, Jr as LevelOverride, Jt as ImagePadding, K as LockedControlSpan, Ki as NUMBER_FORMATS, Kn as SectionProperties, Kr as CounterFormat, Kt as ImageDocPrLink, L as ParseWarning, Li as sameEffectiveParagraphNumbering, Ln as REVIEW_CARRIERS, Lr as PresetLineDashValue, Lt as FootnotePosition, M as ThemeFontScheme, Mi as paragraphNumberingLevel, Mn as PreservedInline, Mr as RelationshipId, Mt as FieldCharContent, N as IMPORTED_ID_COLLISION_KINDS, Ni as paragraphNumberingReference, Nn as PreservedXmlContent, Nr as mintRelationshipId, Nt as FieldType, O as StyleType, Oa as isBorderStyle, Oi as ResolvedParagraphNumbering, On as PictureWatermark, Or as WrapDistances, Ot as Endnote, P as ImportedIdCollisionKind, Pi as paragraphNumberingReferenceId, Pn as PropertyChange, Pr as relationshipIdOf, Pt as FoldedListNumber, Q as lockedControlViolation, Qi as TEXT_DIRECTIONS, Qn as ShapeFill, Qr as ListRendering, Qt as ImageWrap, R as ParseWarningCode, Ri as sameStatedParagraphNumbering, Rn as ReviewCarrier, Rr as UnrecognisedPresetLineDash, Rt as FootnoteProperties, S as MediaFile, Sa as BorderStyleValue, Si as UnderlineStyle, Sn as PageOrientation, Sr as TrackedChangeInfo, St as DocumentBody, T as RelationshipType, Ta as borderStyleToken, Ti as ParagraphNumberingOverride, Tn as ParagraphMarkChange, Tr as VerticalAlign, Tt as DrawingGroupChild, U as CONTENT_CONTROL_LOCK, Ui as headingOutlineLevel, Un as SdtProperties, Ur as PresetLineDashVal, V as isCanonicallyEmptyParagraphFormatting, Vi as OutlineLevel, Vn as RunPropertyChange, Vr as presetLineDashToken, Vt as HeaderReference, W as ContentControlChange, Wi as outlineLevelFromStatedValue, Wn as SdtType, Wr as AbstractNumbering, Wt as Image, X as firstLockedControlViolation, Xi as TABLE_ALIGNMENTS, Xn as ShapeAlternateContent, Xr as ListLevel, Xt as ImageSize, Y as contentControlLockAllows, Yi as ParagraphAlignment, Yn as Shape, Yr as LevelSuffix, Yt as ImagePosition, Z as lockedControlMessage, Zi as TAB_STOP_ALIGNMENTS, Zn as ShapeContent, Zr as ListMarkerFormatting, Zt as ImageTransform, _ as DocDefaults, _a as themeColorToken, _i as TablePropertyExceptionFormatting, _n as NoteMarkerContent, _r as TableRowPropertyChange, _t as DRAWING_RAW_XML_MODES, a as DocumentSettings, aa as BorderSpec, ai as LineSpacingRule, an as MAX_REVISION_ID, ar as SymbolContent, at as BlockCustomXml, b as FontInfo, ba as THEME_COLORS, bi as TextEffect, bn as PARAGRAPH_MARK_CHANGE_KINDS, br as TextContent, bt as DocumentBackground, c as NumberingLevelEntry, ca as SCHEME_COLOR_VALUE_BY_THEME_COLOR, ci as TabLeader, cn as MoveBookmarkMarker, cr as TableCell, ct as BookmarkRangeMarker, d as numberingInstanceResolves, da as UnrecognisedThemeColor, di as TableCellBorders, dn as MoveFromRangeStart, dr as TableContentCarrier, dt as Column, ea as TEXT_DIRECTION_FLOW_BY_TOKEN, ei as NumberingInstance, en as InlineSdt, er as ShapeOutline, et as locksControl, f as numberingLevelEntries, fa as isSchemeColorValue, fi as TableCellFormatting, fn as MoveTo, fr as TableCustomXmlWrapper, ft as Comment, g as ExhaustiveFields, ga as themeColorSlot, gi as TableMeasurement, gn as NonVisualDrawingNames, gr as TableRow, gt as ComplexField, h as isNumberingLevel, ha as readThemeColor, hi as TableLook, hn as NoBreakHyphenContent, hr as TablePropertyExceptionChange, ht as CommentReference, i as Document, ia as TextDirectionFlow, ii as FloatingTableProperties, in as LineNumberRestart, ir as SoftHyphenContent, it as BlockContent, j as ThemeFont, ja as BorderStyle, ji as paragraphNumberingFromSlots, jn as PreservedBlock, jr as normalizeRevisionId, jt as Field, k as Theme, ka as statesNoBorder, ki as isNumberingReference, kn as PositionalTab, kr as WrapPolygonPoint, kt as EndnotePosition, l as NumberingLevelResolution, la as THEME_COLOR_BY_SCHEME_COLOR_VALUE, li as TabStop, ln as MoveFrom, lr as TableCellBlock, lt as BookmarkStart, m as resolveNumberingLevel, ma as knownThemeColor, mi as TableGridChange, mn as MoveToRangeStart, mr as TablePropertyChange, mt as CommentRangeStart, n as DEFAULT_TAB_STOP_TWIPS, na as TableAlignment, ni as ConditionalFormatStyle, nn as Insertion, nr as ShapeType, nt as BIDI_CONTROLS, o as DocxConformanceClass, oa as ColorValue, oi as ParagraphFormatting, on as MarkupRangeMarker, or as TabContent, ot as BlockSdt, p as numberingLevelHasMarkerSlot, pa as isThemeColor, pi as TableFormatting, pn as MoveToRangeEnd, pr as TablePreservedMarkup, pt as CommentRangeEnd, q as LockedControlTouch, qi as NumberFormat, qn as SectionPropertyChange, qr as LevelLegacy, qt as ImageFrameLocks, r as DOCX_CONFORMANCE_CLASSES, ra as TextDirection, ri as EmphasisMark, rn as InstrTextContent, rr as SimpleField, rt as BidiControl, s as DocxPackage, sa as ShadingProperties, si as SpacingExplicit, sn as MathEquation, sr as Table, st as BookmarkEnd, t as COMMENT_PART_RELATIONSHIPS, ta as TabStopAlignment, ti as CellMargins, tn as InlineWrapper, tr as ShapeTextBody, tt as getSingularRunPropertyChange, u as levelShowsMarker, ua as ThemeColorValue, ui as TableBorders, un as MoveFromRangeEnd, ur as TableCellPropertyChange, ut as BreakContent, v as EmbeddedFontRef, va as SchemeColorSlot, vi as TableRowFormatting, vn as NoteNumberRestart, vr as TableStructuralChangeInfo, vt as Deletion, w as RelationshipMap, wa as borderStyleFrom, wi as NO_PARAGRAPH_NUMBERING, wn as ParagraphContent, wr as TrackedRunContent, wt as DrawingContent, x as FontTable, xa as ThemeColor, xi as TextFormatting, xn as PROPERTY_REVISION_KINDS, xr as TextWatermark, xt as DocumentBackgroundDrawing, y as FontCharset, ya as SchemeColorValue, yi as TableWidthType, yn as NoteReferenceContent, yr as TextBox, yt as DisplacedByCustomXml, z as ParseWarningLocation, zi as BODY_TEXT_OUTLINE_LEVEL, zn as Run, zr as isPresetLineDashVal, zt as HeaderFooter } from "../document-Ca6wPoTu.js";
1
+ import { $ as locksContent, $i as TEXT_DIRECTION_FLOWS, $n as ShapeGeometryAdjustment, $r as NumberingDefinitions, $t as ImageWrapPolygon, A as ThemeColorScheme, Aa as BORDER_STYLES, Ai as mergeParagraphNumbering, An as PositionedBookmarkMarker, Ar as isOoxmlSymbolCharacter, At as EndnoteProperties, B as finalizeParagraphFormatting, Bi as HeadingOutlineLevel, Bn as RunContent, Br as presetLineDashFrom, Bt as HeaderFooterType, C as Relationship, Ca as UnrecognisedBorderStyle, Ci as NO_NUMBERING_NUM_ID, Cn as Paragraph, Cr as TrackedRunChange, Ct as DrawingAnchor, D as StyleDefinitions, Da as isBorderNone, Di as ParagraphNumberingSlots, Dn as ParagraphPropertyChange, Dr as WrapDistanceSlots, Dt as EffectExtentSlots, E as Style, Ea as isBorderNil, Ei as ParagraphNumberingReference, En as ParagraphMarkChangeKind, Er as Watermark, Et as DrawingRawXmlMode, F as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Fi as paragraphNumberingSlots, Fn as PropertyChangeInfo, Fr as PreviewDescriptor, Ft as FooterReference, G as ContentControlLock, Gi as outlineLevelStatedValue, Gn as Section, Gr as COUNTER_FORMATS, Gt as ImageCrop, H as setDocumentBodyComments, Hi as headingLevelOf, Hn as SdtEndProperties, Hr as PRESET_LINE_DASH_VALS, Ht as Hyperlink, I as PARSE_WARNING_CODES, Ii as resolveParagraphNumbering, In as PropertyRevisionKind, Ir as PreviewShape, It as Footnote, J as LockedControlViolation, Ji as PARAGRAPH_ALIGNMENTS, Jn as SectionStart, Jr as LevelOverride, Jt as ImagePadding, K as LockedControlSpan, Ki as NUMBER_FORMATS, Kn as SectionProperties, Kr as CounterFormat, Kt as ImageDocPrLink, L as ParseWarning, Li as sameEffectiveParagraphNumbering, Ln as REVIEW_CARRIERS, Lr as PresetLineDashValue, Lt as FootnotePosition, M as ThemeFontScheme, Mi as paragraphNumberingLevel, Mn as PreservedInline, Mr as RelationshipId, Mt as FieldCharContent, N as IMPORTED_ID_COLLISION_KINDS, Ni as paragraphNumberingReference, Nn as PreservedXmlContent, Nr as mintRelationshipId, Nt as FieldType, O as StyleType, Oa as isBorderStyle, Oi as ResolvedParagraphNumbering, On as PictureWatermark, Or as WrapDistances, Ot as Endnote, P as ImportedIdCollisionKind, Pi as paragraphNumberingReferenceId, Pn as PropertyChange, Pr as relationshipIdOf, Pt as FoldedListNumber, Q as lockedControlViolation, Qi as TEXT_DIRECTIONS, Qn as ShapeFill, Qr as ListRendering, Qt as ImageWrap, R as ParseWarningCode, Ri as sameStatedParagraphNumbering, Rn as ReviewCarrier, Rr as UnrecognisedPresetLineDash, Rt as FootnoteProperties, S as MediaFile, Sa as BorderStyleValue, Si as UnderlineStyle, Sn as PageOrientation, Sr as TrackedChangeInfo, St as DocumentBody, T as RelationshipType, Ta as borderStyleToken, Ti as ParagraphNumberingOverride, Tn as ParagraphMarkChange, Tr as VerticalAlign, Tt as DrawingGroupChild, U as CONTENT_CONTROL_LOCK, Ui as headingOutlineLevel, Un as SdtProperties, Ur as PresetLineDashVal, V as isCanonicallyEmptyParagraphFormatting, Vi as OutlineLevel, Vn as RunPropertyChange, Vr as presetLineDashToken, Vt as HeaderReference, W as ContentControlChange, Wi as outlineLevelFromStatedValue, Wn as SdtType, Wr as AbstractNumbering, Wt as Image, X as firstLockedControlViolation, Xi as TABLE_ALIGNMENTS, Xn as ShapeAlternateContent, Xr as ListLevel, Xt as ImageSize, Y as contentControlLockAllows, Yi as ParagraphAlignment, Yn as Shape, Yr as LevelSuffix, Yt as ImagePosition, Z as lockedControlMessage, Zi as TAB_STOP_ALIGNMENTS, Zn as ShapeContent, Zr as ListMarkerFormatting, Zt as ImageTransform, _ as DocDefaults, _a as themeColorToken, _i as TablePropertyExceptionFormatting, _n as NoteMarkerContent, _r as TableRowPropertyChange, _t as DRAWING_RAW_XML_MODES, a as DocumentSettings, aa as BorderSpec, ai as LineSpacingRule, an as MAX_REVISION_ID, ar as SymbolContent, at as BlockCustomXml, b as FontInfo, ba as THEME_COLORS, bi as TextEffect, bn as PARAGRAPH_MARK_CHANGE_KINDS, br as TextContent, bt as DocumentBackground, c as NumberingLevelEntry, ca as SCHEME_COLOR_VALUE_BY_THEME_COLOR, ci as TabLeader, cn as MoveBookmarkMarker, cr as TableCell, ct as BookmarkRangeMarker, d as numberingInstanceResolves, da as UnrecognisedThemeColor, di as TableCellBorders, dn as MoveFromRangeStart, dr as TableContentCarrier, dt as Column, ea as TEXT_DIRECTION_FLOW_BY_TOKEN, ei as NumberingInstance, en as InlineSdt, er as ShapeOutline, et as locksControl, f as numberingLevelEntries, fa as isSchemeColorValue, fi as TableCellFormatting, fn as MoveTo, fr as TableCustomXmlWrapper, ft as Comment, g as ExhaustiveFields, ga as themeColorSlot, gi as TableMeasurement, gn as NonVisualDrawingNames, gr as TableRow, gt as ComplexField, h as isNumberingLevel, ha as readThemeColor, hi as TableLook, hn as NoBreakHyphenContent, hr as TablePropertyExceptionChange, ht as CommentReference, i as Document, ia as TextDirectionFlow, ii as FloatingTableProperties, in as LineNumberRestart, ir as SoftHyphenContent, it as BlockContent, j as ThemeFont, ja as BorderStyle, ji as paragraphNumberingFromSlots, jn as PreservedBlock, jr as normalizeRevisionId, jt as Field, k as Theme, ka as statesNoBorder, ki as isNumberingReference, kn as PositionalTab, kr as WrapPolygonPoint, kt as EndnotePosition, l as NumberingLevelResolution, la as THEME_COLOR_BY_SCHEME_COLOR_VALUE, li as TabStop, ln as MoveFrom, lr as TableCellBlock, lt as BookmarkStart, m as resolveNumberingLevel, ma as knownThemeColor, mi as TableGridChange, mn as MoveToRangeStart, mr as TablePropertyChange, mt as CommentRangeStart, n as DEFAULT_TAB_STOP_TWIPS, na as TableAlignment, ni as ConditionalFormatStyle, nn as Insertion, nr as ShapeType, nt as BIDI_CONTROLS, o as DocxConformanceClass, oa as ColorValue, oi as ParagraphFormatting, on as MarkupRangeMarker, or as TabContent, ot as BlockSdt, p as numberingLevelHasMarkerSlot, pa as isThemeColor, pi as TableFormatting, pn as MoveToRangeEnd, pr as TablePreservedMarkup, pt as CommentRangeEnd, q as LockedControlTouch, qi as NumberFormat, qn as SectionPropertyChange, qr as LevelLegacy, qt as ImageFrameLocks, r as DOCX_CONFORMANCE_CLASSES, ra as TextDirection, ri as EmphasisMark, rn as InstrTextContent, rr as SimpleField, rt as BidiControl, s as DocxPackage, sa as ShadingProperties, si as SpacingExplicit, sn as MathEquation, sr as Table, st as BookmarkEnd, t as COMMENT_PART_RELATIONSHIPS, ta as TabStopAlignment, ti as CellMargins, tn as InlineWrapper, tr as ShapeTextBody, tt as getSingularRunPropertyChange, u as levelShowsMarker, ua as ThemeColorValue, ui as TableBorders, un as MoveFromRangeEnd, ur as TableCellPropertyChange, ut as BreakContent, v as EmbeddedFontRef, va as SchemeColorSlot, vi as TableRowFormatting, vn as NoteNumberRestart, vr as TableStructuralChangeInfo, vt as Deletion, w as RelationshipMap, wa as borderStyleFrom, wi as NO_PARAGRAPH_NUMBERING, wn as ParagraphContent, wr as TrackedRunContent, wt as DrawingContent, x as FontTable, xa as ThemeColor, xi as TextFormatting, xn as PROPERTY_REVISION_KINDS, xr as TextWatermark, xt as DocumentBackgroundDrawing, y as FontCharset, ya as SchemeColorValue, yi as TableWidthType, yn as NoteReferenceContent, yr as TextBox, yt as DisplacedByCustomXml, z as ParseWarningLocation, zi as BODY_TEXT_OUTLINE_LEVEL, zn as Run, zr as isPresetLineDashVal, zt as HeaderFooter } from "../document-CaGfolcU.js";
2
2
  import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "../preservedMarkup-9L4lbGnE.js";
3
3
  export { type AbstractNumbering, BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, type BidiControl, type BlockContent, type BlockCustomXml, type BlockSdt, type BookmarkEnd, type BookmarkRangeMarker, type BookmarkStart, type BorderSpec, type BorderStyle, type BorderStyleValue, type BreakContent, COMMENT_PART_RELATIONSHIPS, CONTENT_CONTROL_LOCK, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, type ContentControlChange, type ContentControlLock, type CounterFormat, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, type Deletion, type DisplacedByCustomXml, type DocDefaults, Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingAnchor, type DrawingContent, type DrawingGroupChild, type DrawingRawXmlMode, type EffectExtentSlots, type EmbeddedFontRef, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type ExhaustiveFields, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FoldedListNumber, type FontCharset, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type HeadingOutlineLevel, type Hyperlink, IMPORTED_ID_COLLISION_KINDS, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type ImportedIdCollisionKind, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, type LockedControlSpan, type LockedControlTouch, type LockedControlViolation, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, type MarkupRangeMarker, type MathEquation, type MediaFile, type MoveBookmarkMarker, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, type NoBreakHyphenContent, type NonVisualDrawingNames, type NoteMarkerContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type NumberingLevelEntry, type NumberingLevelResolution, type OutlineLevel, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphNumberingOverride, type ParagraphNumberingReference, type ParagraphNumberingSlots, type ParagraphPropertyChange, type ParseWarning, type ParseWarningCode, type ParseWarningLocation, type PictureWatermark, type PositionalTab, type PositionedBookmarkMarker, type PreservedAttribute, type PreservedBlock, type PreservedChild, type PreservedInline, type PreservedMarkup, type PreservedXmlContent, type PresetLineDashVal, type PresetLineDashValue, type PreviewDescriptor, type PreviewShape, type PropertyChange, type PropertyChangeInfo, type PropertyRevisionKind, REVIEW_CARRIERS, type Relationship, type RelationshipId, type RelationshipMap, type RelationshipType, type ResolvedParagraphNumbering, type ReviewCarrier, type Run, type RunContent, type RunPropertyChange, SCHEME_COLOR_VALUE_BY_THEME_COLOR, type SchemeColorSlot, type SchemeColorValue, type SdtEndProperties, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeAlternateContent, type ShapeContent, type ShapeFill, type ShapeGeometryAdjustment, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableAlignment, type TableBorders, type TableCell, type TableCellBlock, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableContentCarrier, type TableCustomXmlWrapper, type TableFormatting, type TableGridChange, type TableLook, type TableMeasurement, type TablePreservedMarkup, type TablePropertyChange, type TablePropertyExceptionChange, type TablePropertyExceptionFormatting, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextDirection, type TextDirectionFlow, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColor, type ThemeColorScheme, type ThemeColorValue, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type TrackedRunContent, type UnderlineStyle, type UnrecognisedBorderStyle, type UnrecognisedPresetLineDash, type UnrecognisedThemeColor, type VerticalAlign, type Watermark, type WrapDistanceSlots, type WrapDistances, type WrapPolygonPoint, borderStyleFrom, borderStyleToken, contentControlLockAllows, finalizeParagraphFormatting, firstLockedControlViolation, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isCanonicallyEmptyParagraphFormatting, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, levelShowsMarker, lockedControlMessage, lockedControlViolation, locksContent, locksControl, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, numberingInstanceResolves, numberingLevelEntries, numberingLevelHasMarkerSlot, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveNumberingLevel, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, setDocumentBodyComments, statesNoBorder, themeColorSlot, themeColorToken };
@@ -1,4 +1,4 @@
1
- import { $r as NumberingDefinitions, Bi as HeadingOutlineLevel, Bn as RunContent, Bt as HeaderFooterType, C as Relationship, Cn as Paragraph, D as StyleDefinitions, Dn as ParagraphPropertyChange, Gn as Section, It as Footnote, Kn as SectionProperties, Ot as Endnote, S as MediaFile, Sr as TrackedChangeInfo, St as DocumentBody, Tn as ParagraphMarkChange, Ut as INSERTION_SEAM_POLICIES, Wr as AbstractNumbering, a as DocumentSettings, ei as NumberingInstance, fi as TableCellFormatting, ft as Comment, g as ExhaustiveFields, gr as TableRow, i as Document, it as BlockContent, oi as ParagraphFormatting, or as TabContent, pi as TableFormatting, s as DocxPackage, sr as Table, st as BookmarkEnd, ut as BreakContent, vi as TableRowFormatting, wn as ParagraphContent, xi as TextFormatting, zn as Run, zt as HeaderFooter } from "../document-Ca6wPoTu.js";
1
+ import { $r as NumberingDefinitions, Bi as HeadingOutlineLevel, Bn as RunContent, Bt as HeaderFooterType, C as Relationship, Cn as Paragraph, D as StyleDefinitions, Dn as ParagraphPropertyChange, Gn as Section, It as Footnote, Kn as SectionProperties, Ot as Endnote, S as MediaFile, Sr as TrackedChangeInfo, St as DocumentBody, Tn as ParagraphMarkChange, Ut as INSERTION_SEAM_POLICIES, Wr as AbstractNumbering, a as DocumentSettings, ei as NumberingInstance, fi as TableCellFormatting, ft as Comment, g as ExhaustiveFields, gr as TableRow, i as Document, it as BlockContent, oi as ParagraphFormatting, or as TabContent, pi as TableFormatting, s as DocxPackage, sr as Table, st as BookmarkEnd, ut as BreakContent, vi as TableRowFormatting, wn as ParagraphContent, xi as TextFormatting, zn as Run, zt as HeaderFooter } from "../document-CaGfolcU.js";
2
2
  import { Result, TaggedErrorClass } from "better-result";
3
3
  /** JSON-safe map presence, including an explicitly undefined section map. */
4
4
  type SectionMapState = {
@@ -502,6 +502,8 @@ type InsertBlocksOp = {
502
502
  at: BlockInsertionPoint;
503
503
  blocks: readonly Paragraph[];
504
504
  revision?: RevisionStamp;
505
+ /** With `revision`, the insertion is the destination of a move: `w:moveTo`. */
506
+ move?: true;
505
507
  newIds?: NewIds;
506
508
  };
507
509
  /**
@@ -522,6 +524,8 @@ type DeleteBlocksOp = {
522
524
  story: OpStory;
523
525
  blockIds: readonly string[];
524
526
  revision?: RevisionStamp;
527
+ /** With `revision`, the deletion is the source of a move: `w:moveFrom`. */
528
+ move?: true;
525
529
  newIds?: NewIds;
526
530
  };
527
531
  /**
@@ -963,7 +967,8 @@ type UpdateCommentContentOp = {
963
967
  type: typeof DOCUMENT_OP_TYPES.UPDATE_COMMENT_CONTENT;
964
968
  id: number;
965
969
  content: readonly Paragraph[];
966
- patch?: FormattingPatch<Pick<Comment, "author" | "initials" | "date">>;
970
+ /** `suggestionId: null` adopts a proposed comment as an ordinary one. */
971
+ patch?: FormattingPatch<Pick<Comment, "author" | "initials" | "date" | "suggestionId">>;
967
972
  };
968
973
  type SetCommentResolutionOp = {
969
974
  type: typeof DOCUMENT_OP_TYPES.SET_COMMENT_RESOLUTION;
@@ -1034,6 +1039,49 @@ type DocumentEdit = {
1034
1039
  };
1035
1040
  /** Edits made in turn, starting from `document`, as one edit. */
1036
1041
  export declare const combineEdits: (document: Document, edits: readonly DocumentEdit[]) => DocumentEdit;
1042
+ /** A place between two leaves. */
1043
+ type Gap = {
1044
+ offset: number;
1045
+ zeroWidthBefore: number;
1046
+ };
1047
+ /** A node of a paragraph's content tree: a paragraph child or a run child. */
1048
+ type InlineNode = ParagraphContent | RunContent;
1049
+ /** Comment anchors are preserved by planned deletion and cannot be wrapped. */
1050
+ declare const COMMENT_ANCHOR_TYPES: {
1051
+ readonly commentRangeStart: true;
1052
+ readonly commentRangeEnd: true;
1053
+ readonly commentReference: true;
1054
+ };
1055
+ type CommentAnchorCarrier = Extract<InlineNode, {
1056
+ type: keyof typeof COMMENT_ANCHOR_TYPES;
1057
+ }>;
1058
+ /** Whether a leaf carries an anchor rather than content covered by its range. */
1059
+ export declare const isCommentAnchorCarrierType: (type: string) => boolean;
1060
+ /** The zero-width leaves at an offset, in document order. */
1061
+ export declare const zeroWidthLeavesAt: (items: readonly InlineNode[], offset: number) => InlineNode[];
1062
+ /**
1063
+ * The gap an insertion defaults to: before the first zero-width leaf at the
1064
+ * offset that opens a range, so a marker opening there stays with what
1065
+ * follows it and every other one with what precedes it.
1066
+ */
1067
+ export declare const defaultInsertionGap: (items: readonly InlineNode[], offset: number) => Gap;
1068
+ /**
1069
+ * The stretch of a paragraph's content the given revisions hold: from the
1070
+ * first leaf inside one of their tracked wrappers to the last, or `undefined`
1071
+ * when none is there.
1072
+ */
1073
+ export declare const revisionSpan: (items: readonly InlineNode[], revisionIds: ReadonlySet<number>) => {
1074
+ from: number;
1075
+ to: number;
1076
+ } | undefined;
1077
+ /** Source leaf coordinates without the ancestry needed by edit planning. */
1078
+ export declare const inlineLeafSpans: (items: readonly InlineNode[]) => {
1079
+ node: InlineNode;
1080
+ before: Gap;
1081
+ after: Gap;
1082
+ }[];
1083
+ /** Gaps in document order: by offset, then by the zero-width leaves before them. */
1084
+ export declare const compareGaps: (left: Gap, right: Gap) => number;
1037
1085
  declare const DocumentOpRefusalBase: TaggedErrorClass<"DocumentOpRefusal">;
1038
1086
  /**
1039
1087
  * Why an operation was not applied. A refused operation changes nothing: the
@@ -1141,40 +1189,6 @@ export declare class DocumentOpRefusal extends DocumentOpRefusalBase<{
1141
1189
  reason: DocumentOpRefusalReason;
1142
1190
  opType: DocumentOpType | undefined;
1143
1191
  }> {}
1144
- /** A place between two leaves. */
1145
- type Gap = {
1146
- offset: number;
1147
- zeroWidthBefore: number;
1148
- };
1149
- /** A node of a paragraph's content tree: a paragraph child or a run child. */
1150
- type InlineNode = ParagraphContent | RunContent;
1151
- /** Comment anchors are preserved by planned deletion and cannot be wrapped. */
1152
- declare const COMMENT_ANCHOR_TYPES: {
1153
- readonly commentRangeStart: true;
1154
- readonly commentRangeEnd: true;
1155
- readonly commentReference: true;
1156
- };
1157
- type CommentAnchorCarrier = Extract<InlineNode, {
1158
- type: keyof typeof COMMENT_ANCHOR_TYPES;
1159
- }>;
1160
- /** Whether a leaf carries an anchor rather than content covered by its range. */
1161
- export declare const isCommentAnchorCarrierType: (type: string) => boolean;
1162
- /** The zero-width leaves at an offset, in document order. */
1163
- export declare const zeroWidthLeavesAt: (items: readonly InlineNode[], offset: number) => InlineNode[];
1164
- /**
1165
- * The gap an insertion defaults to: before the first zero-width leaf at the
1166
- * offset that opens a range, so a marker opening there stays with what
1167
- * follows it and every other one with what precedes it.
1168
- */
1169
- export declare const defaultInsertionGap: (items: readonly InlineNode[], offset: number) => Gap;
1170
- /** Source leaf coordinates without the ancestry needed by edit planning. */
1171
- export declare const inlineLeafSpans: (items: readonly InlineNode[]) => {
1172
- node: InlineNode;
1173
- before: Gap;
1174
- after: Gap;
1175
- }[];
1176
- /** Gaps in document order: by offset, then by the zero-width leaves before them. */
1177
- export declare const compareGaps: (left: Gap, right: Gap) => number;
1178
1192
  type CommentExhaustionInput = {
1179
1193
  type: "document";
1180
1194
  document: Document;
@@ -1217,6 +1231,33 @@ export declare const sameStory: (left: OpStory, right: OpStory) => boolean;
1217
1231
  export declare const findStoryBody: (document: Document, story: OpStory) => DocumentBody | undefined;
1218
1232
  export declare const storyBody: (document: Document, story: OpStory) => DocumentBody;
1219
1233
  export declare const documentStories: (document: Document) => OpStory[];
1234
+ type ReplaceStoryBodyOptions = {
1235
+ document: Document;
1236
+ story: OpStory;
1237
+ body: DocumentBody;
1238
+ };
1239
+ export declare const replaceStoryBody: ({ document, story, body }: ReplaceStoryBodyOptions) => Document;
1240
+ /** One step from a block list down to a block list nested in one of its blocks. */
1241
+ type BlockListStep = {
1242
+ kind: "tableCell";
1243
+ block: number;
1244
+ row: number;
1245
+ cell: number;
1246
+ } | {
1247
+ kind: "blockSdt";
1248
+ block: number;
1249
+ } | {
1250
+ kind: "blockCustomXml";
1251
+ block: number;
1252
+ };
1253
+ /** Where a paragraph sits: the block list that holds it, and its index there. */
1254
+ type ParagraphLocation = {
1255
+ list: readonly BlockListStep[];
1256
+ index: number;
1257
+ paragraph: Paragraph;
1258
+ };
1259
+ /** Every paragraph of a story's block tree, in document order. */
1260
+ export declare const storyParagraphs: (body: DocumentBody) => ParagraphLocation[];
1220
1261
  /**
1221
1262
  * A body holding other blocks, its section view derived from them. A view
1222
1263
  * that does not line up with the blocks (a different section count) is left
@@ -1272,18 +1313,29 @@ export declare const OBJECT_REPLACEMENT_CHARACTER = "";
1272
1313
  */
1273
1314
  export declare const paragraphLogicalText: (paragraph: Paragraph) => string;
1274
1315
  /** The single structural outcome of resolving a paragraph mark. */
1275
- export declare const paragraphMarkOutcome: ({ follows, holdsContent, markWasAdded, containerStillEndsWithParagraph, followingTableCanReceiveRunIn, needsFollowingCommentHost, tableRemovalIsTrackable, removedSectionProperties, precedingSectionOwner, followingHasSectionProperties }: {
1276
- follows: "paragraph" | "table" | "nothing";
1316
+ export declare const paragraphMarkOutcome: ({ follows, holdsContent, markWasAdded, containerStillEndsWithParagraph, followingTableCanReceiveRunIn, holdsContentOnceAccepted, followingBlockCanReceiveRunIn, needsFollowingCommentHost, tableRemovalIsTrackable, removedSectionProperties, precedingSectionOwner, followingHasSectionProperties }: {
1317
+ /** `block` is a follower {@link isOpaqueFollower} admits. */
1318
+ follows: "paragraph" | "table" | "block" | "nothing";
1277
1319
  /** From {@link paragraphHoldsContent} or the editor's view of the same rule, never re-derived. */
1278
1320
  holdsContent: ParagraphContentVerdict;
1279
1321
  markWasAdded: boolean;
1280
1322
  /**
1281
- * Read only when nothing follows: whether the block BEFORE this paragraph,
1282
- * which becomes the container's last block once this one is removed, is a
1283
- * paragraph. Never the container's current last child, which is this one.
1323
+ * Read when nothing or a block follows. When nothing does: whether the
1324
+ * block BEFORE this paragraph, which becomes the container's last block
1325
+ * once this one is removed, is a paragraph; never the container's current
1326
+ * last child, which is this one. When a block does: whether the container's
1327
+ * last block is a paragraph.
1284
1328
  */
1285
1329
  containerStillEndsWithParagraph: boolean;
1286
1330
  followingTableCanReceiveRunIn: boolean;
1331
+ /**
1332
+ * Read when a block follows: whether the paragraph still holds content
1333
+ * once every change in it is accepted, from
1334
+ * {@link paragraphHoldsContentOnceAccepted}.
1335
+ */
1336
+ holdsContentOnceAccepted?: ParagraphContentVerdict;
1337
+ /** Read when a block follows: whether it offers a {@link paragraphBlockRunInTarget}. */
1338
+ followingBlockCanReceiveRunIn?: boolean;
1287
1339
  needsFollowingCommentHost?: boolean;
1288
1340
  tableRemovalIsTrackable?: boolean;
1289
1341
  removedSectionProperties?: boolean;
@@ -1398,10 +1450,16 @@ type WellFormedRangePlan = {
1398
1450
  export declare const planWellFormedRanges: (occurrences: readonly BoundaryOccurrence[]) => WellFormedRangePlan;
1399
1451
  /** Capture own undefined fields before an operation enters its JSON journal. */
1400
1452
  export declare const captureDocumentOp: (op: DocumentOp) => DocumentOp;
1453
+ /**
1454
+ * The ids of the comments pending suggestions propose: every one, or those of
1455
+ * one suggestion. A reply is removed with the comment it answers.
1456
+ */
1457
+ export declare const suggestedCommentIds: (document: Document, suggestionId?: string) => number[];
1401
1458
  /**
1402
1459
  * The document as a save writes it: every pending suggestion rejected. A
1403
1460
  * suggestion is a proposal the host holds, not a change in the file, so the
1404
- * file reads as if it had never been made; ordinary tracked changes stay.
1461
+ * file reads as if it had never been made; ordinary tracked changes stay. A
1462
+ * comment a suggestion proposes is left out with it.
1405
1463
  */
1406
1464
  export declare const withoutPendingSuggestions: (document: Document) => Result<Document, DocumentOpRefusal>;
1407
1465
  /**
@@ -1409,8 +1467,37 @@ export declare const withoutPendingSuggestions: (document: Document) => Result<D
1409
1467
  * id, in document order.
1410
1468
  */
1411
1469
  export declare const suggestionRevisionInfos: (document: Document, story: OpStory, suggestionId: string) => TrackedChangeInfo[];
1412
- /** The ids of every pending suggestion in a document, in every story. */
1470
+ /**
1471
+ * The ids of every pending suggestion in a document, in every story, and of
1472
+ * every suggestion that proposes a comment.
1473
+ */
1413
1474
  export declare const pendingSuggestionIdsIn: (document: Document) => Set<string>;
1475
+ /** A document an operation produced, the operations that undo it, and what it changed. */
1476
+ type AppliedDocumentOp = {
1477
+ document: Document;
1478
+ /** Apply in order to restore the input document. */
1479
+ inverse: readonly DocumentOp[];
1480
+ touched: TouchedBlocks;
1481
+ /**
1482
+ * Newly allocated tracked revision ids, in document order: its stamp's
1483
+ * id and the new ids its other records took. Existing ids retained by a
1484
+ * folded or continued review are excluded; a direct operation reports none.
1485
+ */
1486
+ revisions: readonly number[];
1487
+ };
1488
+ /** Apply one operation to a document that meets the seed contract. */
1489
+ export declare const applyDocumentOp: (document: Document, input: DocumentOp) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1490
+ /** Apply a journal envelope only when its schema matches this reader. */
1491
+ export declare const applyDocumentOpEnvelope: (document: Document, envelope: {
1492
+ schema: number;
1493
+ op: DocumentOp;
1494
+ }) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1495
+ /**
1496
+ * Apply operations in order, atomically: the first refusal is returned and
1497
+ * the document is unchanged. The inverse undoes the whole list, and
1498
+ * `revisions` lists each operation's in turn.
1499
+ */
1500
+ export declare const applyDocumentOps: (document: Document, ops: readonly DocumentOp[]) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1414
1501
  type HyperlinkEditorIntent = {
1415
1502
  type: "setHyperlink";
1416
1503
  from: TextPosition;
@@ -1434,6 +1521,12 @@ type SplitParagraphIntent = {
1434
1521
  type: "splitParagraph";
1435
1522
  at: TextPosition;
1436
1523
  to?: TextPosition;
1524
+ /**
1525
+ * Which half takes the new identity: by default the first, as typing a
1526
+ * break moves the text before it to a paragraph of its own; the second
1527
+ * keeps the paragraph's identity on the text before the split.
1528
+ */
1529
+ newHalf?: SplitHalf;
1437
1530
  };
1438
1531
  /**
1439
1532
  * A row inserted into, or deleted from, the table holding `blockId`. An
@@ -1484,6 +1577,17 @@ type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
1484
1577
  story: OpStory;
1485
1578
  at: BlockInsertionPoint;
1486
1579
  paragraphs: readonly Paragraph[];
1580
+ /** A suggestion records the paragraphs as a move's destination. */
1581
+ move?: true;
1582
+ /** A list instance the paragraphs' numbering names, created first. */
1583
+ newList?: NewListInstance;
1584
+ } | {
1585
+ /** Whole adjacent paragraphs removed with their marks. */
1586
+ type: "deleteParagraphs";
1587
+ story: OpStory;
1588
+ blockIds: readonly string[];
1589
+ /** A suggestion records the paragraphs as a move's source. */
1590
+ move?: true;
1487
1591
  } | {
1488
1592
  type: "replaceFragment";
1489
1593
  from: TextPosition;
@@ -1524,6 +1628,8 @@ type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
1524
1628
  type: "formatParagraph";
1525
1629
  at: TextPosition;
1526
1630
  patch: ParagraphPropsPatch;
1631
+ /** A list instance the patch's numbering names, created first. */
1632
+ newList?: NewListInstance;
1527
1633
  } | {
1528
1634
  type: "setList";
1529
1635
  items: readonly {
@@ -1558,6 +1664,11 @@ type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
1558
1664
  */
1559
1665
  survivor?: SplitHalf;
1560
1666
  };
1667
+ /** A numbering instance, with its abstract definition, an edit creates. */
1668
+ type NewListInstance = {
1669
+ num: NumberingInstance;
1670
+ abstractNum?: AbstractNumbering;
1671
+ };
1561
1672
  /** Revision metadata and every fresh identity are supplied before compilation. */
1562
1673
  type EditorIntentMode = {
1563
1674
  /** Identities consumed during this editor lifetime, including undone insertions. */
@@ -1579,11 +1690,22 @@ type CompileEditorIntentOptions = {
1579
1690
  type CompiledEditorIntent = {
1580
1691
  ops: DocumentOp[];
1581
1692
  selection: TextPosition;
1693
+ /**
1694
+ * What applying `ops` to the compiled document gives, when the compiler
1695
+ * already applied exactly them; a caller applies `ops` itself otherwise.
1696
+ */
1697
+ applied?: AppliedDocumentOp;
1582
1698
  };
1583
1699
  /** A split's paragraph identity is allocated with its other fresh identities. */
1584
1700
  type EditorIntentAllocation = EditorIntent | SplitParagraphIntent;
1585
- /** Cache only immutable document versions; never retain a retired version strongly. */
1586
- export declare const createEditorIntentIdAllocator: () => (document: Document, intent: EditorIntentAllocation) => {
1701
+ /**
1702
+ * Cache only immutable document versions; never retain a retired version
1703
+ * strongly. A new paragraph identity avoids `reservedBlockIds`, the ones
1704
+ * consumed elsewhere, such as an undone insertion's.
1705
+ */
1706
+ export declare const createEditorIntentIdAllocator: ({ reservedBlockIds }?: {
1707
+ reservedBlockIds?: ReadonlySet<string>;
1708
+ }) => (document: Document, intent: EditorIntentAllocation) => {
1587
1709
  revisionId: number;
1588
1710
  newBlockId: string;
1589
1711
  newIds: {
@@ -1647,32 +1769,6 @@ export declare const registerParagraphPropertySnapshot: ({ paragraph, snapshot }
1647
1769
  * change nothing.
1648
1770
  */
1649
1771
  export declare const paragraphPropertySnapshotToken: (paragraph: Paragraph) => object | undefined;
1650
- /** A document an operation produced, the operations that undo it, and what it changed. */
1651
- type AppliedDocumentOp = {
1652
- document: Document;
1653
- /** Apply in order to restore the input document. */
1654
- inverse: readonly DocumentOp[];
1655
- touched: TouchedBlocks;
1656
- /**
1657
- * Newly allocated tracked revision ids, in document order: its stamp's
1658
- * id and the new ids its other records took. Existing ids retained by a
1659
- * folded or continued review are excluded; a direct operation reports none.
1660
- */
1661
- revisions: readonly number[];
1662
- };
1663
- /** Apply one operation to a document that meets the seed contract. */
1664
- export declare const applyDocumentOp: (document: Document, input: DocumentOp) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1665
- /** Apply a journal envelope only when its schema matches this reader. */
1666
- export declare const applyDocumentOpEnvelope: (document: Document, envelope: {
1667
- schema: number;
1668
- op: DocumentOp;
1669
- }) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1670
- /**
1671
- * Apply operations in order, atomically: the first refusal is returned and
1672
- * the document is unchanged. The inverse undoes the whole list, and
1673
- * `revisions` lists each operation's in turn.
1674
- */
1675
- export declare const applyDocumentOps: (document: Document, ops: readonly DocumentOp[]) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1676
1772
  /**
1677
1773
  * Every `TextFormatting` field, named so the comparison below is total.
1678
1774
  *
@@ -1776,6 +1872,8 @@ export declare const planTrackedDeletion: (document: Document, options: PlanTrac
1776
1872
  * paragraphs require an explicit package import policy.
1777
1873
  */
1778
1874
  type PlanTrackedReplaceOptions = PlanTrackedDeletionOptions & {
1875
+ /** How the deletion carrying the edit's own id is recorded, when not as `revision`. */
1876
+ deletionRevision?: RevisionStamp;
1779
1877
  sourceContainerPolicy: "join" | "separate";
1780
1878
  seamPolicy?: Extract<DocumentOp, {
1781
1879
  type: "insertContent";
@@ -1971,4 +2069,4 @@ export declare const orderAddressingBeforeRemoval: <T, Block>(ordered: readonly
1971
2069
  * requested sequence, which no series of single edits produces.
1972
2070
  */
1973
2071
  export declare const groupInsertionRuns: <T>(operations: readonly T[], insertionPositionOf: (operation: T) => number | null, keepsGap?: (operation: T) => boolean) => T[][];
1974
- export type { AddNoteOp, AppliedDocumentOp, BatchBlockAccess, BatchOrderAddress, BatchRejectionReason, BlockInsertionPoint, BoundaryOccurrence, CommentAnchor, CommentExhaustionInput, CommentState, CopyOriginAncestorList, CreateCommentOp, CreateHeaderFooterOp, CreateNumberingInstanceOp, DeleteBlocksOp, DeleteColumnOp, DeleteCommentOp, DeleteNumberingInstanceOp, DeleteRangeOp, DeleteRowOp, DeleteTableOp, DocumentBatch, DocumentOp, DocumentOpEnvelope, DocumentOpRefusalReason, DocumentOpType, EditorIntent, EditorIntentMode, EmptyPropertySet, FormattingPatch, HeaderFooterStory, InlineSlice, InsertBlocksOp, InsertColumnOp, InsertContentOp, InsertRowOp, InsertTableOp, InsertTextOp, InsertedRunProps, JoinBlocksOp, JoinInlineOp, MergeCellsOp, NewIds, NoteStory, NumberingPartState, OpStory, PackageResourceEntry, PackageResourceEntryChange, PackageResourceMapChange, PackageResourceMedia, PackageResourcePart, PackageResources, ParagraphContentVerdict, ParagraphPropsPatch, ParagraphReviewFields, PlanTrackedDeletionOptions, PlanTrackedReplaceOptions, RemoveHeaderFooterOp, RemoveNoteOp, ReplaceBlocksOp, ReplaceInlineOp, ResolveRevisionOp, RestoreCommentStateOp, RestoreStoryPartsOp, RevisionDecision, RevisionStamp, RunPropsPatch, SectionEndpoint, SectionMapState, SectionPropertiesState, SectionViewEntry, SectionViewState, SequencedBatch, SetCellPropsOp, SetCommentResolutionOp, SetContainerBlocksOp, SetPackageResourcesOp, SetParagraphPropsOp, SetParagraphReviewOp, SetRowPropsOp, SetRunPropsOp, SetSectionEndpointOp, SetSectionPropsOp, SetTableGridOp, SetTableOp, SetTablePropsOp, SetTableRowsOp, SplitBlockOp, SplitCellOp, SplitHalf, SplitInlineOp, SplitParagraphFields, TableBlockIntentOperation, TableEditOp, TableIntentOperation, TableRowIntentOperation, TextPosition, TouchedBlocks, UpdateCommentContentOp, WellFormedRangePlan, ZeroWidthItem };
2072
+ export type { AddNoteOp, AppliedDocumentOp, BatchBlockAccess, BatchOrderAddress, BatchRejectionReason, BlockInsertionPoint, BoundaryOccurrence, CommentAnchor, CommentExhaustionInput, CommentState, CopyOriginAncestorList, CreateCommentOp, CreateHeaderFooterOp, CreateNumberingInstanceOp, DeleteBlocksOp, DeleteColumnOp, DeleteCommentOp, DeleteNumberingInstanceOp, DeleteRangeOp, DeleteRowOp, DeleteTableOp, DocumentBatch, DocumentOp, DocumentOpEnvelope, DocumentOpRefusalReason, DocumentOpType, EditorIntent, EditorIntentMode, EmptyPropertySet, FormattingPatch, HeaderFooterStory, InlineSlice, InsertBlocksOp, InsertColumnOp, InsertContentOp, InsertRowOp, InsertTableOp, InsertTextOp, InsertedRunProps, JoinBlocksOp, JoinInlineOp, MergeCellsOp, NewIds, NewListInstance, NoteStory, NumberingPartState, OpStory, PackageResourceEntry, PackageResourceEntryChange, PackageResourceMapChange, PackageResourceMedia, PackageResourcePart, PackageResources, ParagraphContentVerdict, ParagraphPropsPatch, ParagraphReviewFields, PlanTrackedDeletionOptions, PlanTrackedReplaceOptions, RemoveHeaderFooterOp, RemoveNoteOp, ReplaceBlocksOp, ReplaceInlineOp, ResolveRevisionOp, RestoreCommentStateOp, RestoreStoryPartsOp, RevisionDecision, RevisionStamp, RunPropsPatch, SectionEndpoint, SectionMapState, SectionPropertiesState, SectionViewEntry, SectionViewState, SequencedBatch, SetCellPropsOp, SetCommentResolutionOp, SetContainerBlocksOp, SetPackageResourcesOp, SetParagraphPropsOp, SetParagraphReviewOp, SetRowPropsOp, SetRunPropsOp, SetSectionEndpointOp, SetSectionPropsOp, SetTableGridOp, SetTableOp, SetTablePropsOp, SetTableRowsOp, SplitBlockOp, SplitCellOp, SplitHalf, SplitInlineOp, SplitParagraphFields, TableBlockIntentOperation, TableEditOp, TableIntentOperation, TableRowIntentOperation, TextPosition, TouchedBlocks, UpdateCommentContentOp, WellFormedRangePlan, ZeroWidthItem };