@stll/docx-core 0.36.2 → 0.37.0

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.
@@ -1,4 +1,15 @@
1
1
  import { panic } from "better-result";
2
+ //#region src/model/runPropertyReview.ts
3
+ /** A run-property container has one pending formatting revision. */
4
+ const getSingularRunPropertyChange = (propertyChanges) => {
5
+ const propertyChangeCount = propertyChanges?.length ?? 0;
6
+ if (propertyChangeCount > 1) panic("A run-property container cannot serialize more than one w:rPrChange", {
7
+ elementName: "w:rPrChange",
8
+ propertyChangeCount
9
+ });
10
+ return propertyChanges?.at(0);
11
+ };
12
+ //#endregion
2
13
  //#region src/model/parseWarning.ts
3
14
  /**
4
15
  * What folio normalised to open a document, as data rather than as prose.
@@ -31,6 +42,8 @@ const PARSE_WARNING_CODES = {
31
42
  documentModelIssue: "document-model-issue",
32
43
  /** A later `w:comment` repeating a `w:id` an earlier one defines. */
33
44
  duplicateCommentId: "duplicate-comment-id",
45
+ /** A source definition repeats an identity in its part or package scope. */
46
+ duplicateImportedId: "duplicate-imported-id",
34
47
  /** A `w:comment` with no readable `w:id`; it can anchor nothing. */
35
48
  missingCommentId: "missing-comment-id",
36
49
  /** A later `w:footnote`/`w:endnote` repeating an id an earlier one defines. */
@@ -76,6 +89,19 @@ const PARSE_WARNING_CODES = {
76
89
  /** A row nested where the table model can only preserve it as opaque markup. */
77
90
  nestedRowOpaque: "nested-row-opaque"
78
91
  };
92
+ const IMPORTED_ID_COLLISION_KINDS = {
93
+ bookmark: "bookmark",
94
+ comment: "comment",
95
+ footnote: "footnote",
96
+ endnote: "endnote",
97
+ revision: "revision",
98
+ paraId: "paraId",
99
+ textId: "textId",
100
+ numId: "numId",
101
+ abstractNumId: "abstractNumId",
102
+ drawing: "drawing",
103
+ relationship: "relationship"
104
+ };
79
105
  /**
80
106
  * The cap on retained warnings per code.
81
107
  *
@@ -1237,4 +1263,4 @@ const COMMENT_PART_RELATIONSHIPS = {
1237
1263
  }
1238
1264
  };
1239
1265
  //#endregion
1240
- export { mergeParagraphNumbering as $, TEXT_DIRECTIONS as A, themeColorToken as B, isBorderStyle as C, PARAGRAPH_ALIGNMENTS as D, NUMBER_FORMATS as E, isSchemeColorValue as F, headingLevelOf as G, mintRelationshipId as H, isThemeColor as I, outlineLevelStatedValue as J, headingOutlineLevel as K, knownThemeColor as L, TEXT_DIRECTION_FLOW_BY_TOKEN as M, SCHEME_COLOR_VALUE_BY_THEME_COLOR as N, TABLE_ALIGNMENTS as O, THEME_COLOR_BY_SCHEME_COLOR_VALUE as P, isNumberingReference as Q, readThemeColor as R, isBorderNone as S, BORDER_STYLES as T, relationshipIdOf as U, THEME_COLORS as V, BODY_TEXT_OUTLINE_LEVEL as W, NO_NUMBERING_NUM_ID as X, isNumberingLevel as Y, NO_PARAGRAPH_NUMBERING as Z, presetLineDashToken as _, DRAWING_RAW_XML_MODES as a, resolveParagraphNumbering as at, borderStyleToken as b, PARAGRAPH_MARK_CHANGE_KINDS as c, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as ct, isNoteReferenceId as d, paragraphNumberingFromSlots as et, isOoxmlSymbolCharacter as f, presetLineDashFrom as g, isPresetLineDashVal as h, BIDI_CONTROLS as i, paragraphNumberingSlots as it, TEXT_DIRECTION_FLOWS as j, TAB_STOP_ALIGNMENTS as k, PROPERTY_REVISION_KINDS as l, PARSE_WARNING_CODES as lt, COUNTER_FORMATS as m, DEFAULT_TAB_STOP_TWIPS as n, paragraphNumberingReference as nt, INSERTION_SEAM_POLICIES as o, sameEffectiveParagraphNumbering as ot, normalizeRevisionId as p, outlineLevelFromStatedValue as q, DOCX_CONFORMANCE_CLASSES as r, paragraphNumberingReferenceId as rt, MAX_REVISION_ID as s, sameStatedParagraphNumbering as st, COMMENT_PART_RELATIONSHIPS as t, paragraphNumberingLevel as tt, REVIEW_CARRIERS as u, PRESET_LINE_DASH_VALS as v, statesNoBorder as w, isBorderNil as x, borderStyleFrom as y, themeColorSlot as z };
1266
+ export { mergeParagraphNumbering as $, TEXT_DIRECTIONS as A, themeColorToken as B, isBorderStyle as C, PARAGRAPH_ALIGNMENTS as D, NUMBER_FORMATS as E, isSchemeColorValue as F, headingLevelOf as G, mintRelationshipId as H, isThemeColor as I, outlineLevelStatedValue as J, headingOutlineLevel as K, knownThemeColor as L, TEXT_DIRECTION_FLOW_BY_TOKEN as M, SCHEME_COLOR_VALUE_BY_THEME_COLOR as N, TABLE_ALIGNMENTS as O, THEME_COLOR_BY_SCHEME_COLOR_VALUE as P, isNumberingReference as Q, readThemeColor as R, isBorderNone as S, BORDER_STYLES as T, relationshipIdOf as U, THEME_COLORS as V, BODY_TEXT_OUTLINE_LEVEL as W, NO_NUMBERING_NUM_ID as X, isNumberingLevel as Y, NO_PARAGRAPH_NUMBERING as Z, presetLineDashToken as _, DRAWING_RAW_XML_MODES as a, resolveParagraphNumbering as at, borderStyleToken as b, PARAGRAPH_MARK_CHANGE_KINDS as c, IMPORTED_ID_COLLISION_KINDS as ct, isNoteReferenceId as d, getSingularRunPropertyChange as dt, paragraphNumberingFromSlots as et, isOoxmlSymbolCharacter as f, presetLineDashFrom as g, isPresetLineDashVal as h, BIDI_CONTROLS as i, paragraphNumberingSlots as it, TEXT_DIRECTION_FLOWS as j, TAB_STOP_ALIGNMENTS as k, PROPERTY_REVISION_KINDS as l, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as lt, COUNTER_FORMATS as m, DEFAULT_TAB_STOP_TWIPS as n, paragraphNumberingReference as nt, INSERTION_SEAM_POLICIES as o, sameEffectiveParagraphNumbering as ot, normalizeRevisionId as p, outlineLevelFromStatedValue as q, DOCX_CONFORMANCE_CLASSES as r, paragraphNumberingReferenceId as rt, MAX_REVISION_ID as s, sameStatedParagraphNumbering as st, COMMENT_PART_RELATIONSHIPS as t, paragraphNumberingLevel as tt, REVIEW_CARRIERS as u, PARSE_WARNING_CODES as ut, PRESET_LINE_DASH_VALS as v, statesNoBorder as w, isBorderNil as x, borderStyleFrom as y, themeColorSlot as z };
@@ -3738,6 +3738,10 @@ type DocumentBody = {
3738
3738
  comments?: Comment[];
3739
3739
  };
3740
3740
  //#endregion
3741
+ //#region src/model/runPropertyReview.d.ts
3742
+ /** A run-property container has one pending formatting revision. */
3743
+ declare const getSingularRunPropertyChange: (propertyChanges: readonly RunPropertyChange[] | undefined) => RunPropertyChange | undefined;
3744
+ //#endregion
3741
3745
  //#region src/model/parseWarning.d.ts
3742
3746
  /**
3743
3747
  * What folio normalised to open a document, as data rather than as prose.
@@ -3770,6 +3774,8 @@ declare const PARSE_WARNING_CODES: {
3770
3774
  readonly documentModelIssue: "document-model-issue";
3771
3775
  /** A later `w:comment` repeating a `w:id` an earlier one defines. */
3772
3776
  readonly duplicateCommentId: "duplicate-comment-id";
3777
+ /** A source definition repeats an identity in its part or package scope. */
3778
+ readonly duplicateImportedId: "duplicate-imported-id";
3773
3779
  /** A `w:comment` with no readable `w:id`; it can anchor nothing. */
3774
3780
  readonly missingCommentId: "missing-comment-id";
3775
3781
  /** A later `w:footnote`/`w:endnote` repeating an id an earlier one defines. */
@@ -3815,6 +3821,20 @@ declare const PARSE_WARNING_CODES: {
3815
3821
  /** A row nested where the table model can only preserve it as opaque markup. */
3816
3822
  readonly nestedRowOpaque: "nested-row-opaque";
3817
3823
  };
3824
+ declare const IMPORTED_ID_COLLISION_KINDS: {
3825
+ readonly bookmark: "bookmark";
3826
+ readonly comment: "comment";
3827
+ readonly footnote: "footnote";
3828
+ readonly endnote: "endnote";
3829
+ readonly revision: "revision";
3830
+ readonly paraId: "paraId";
3831
+ readonly textId: "textId";
3832
+ readonly numId: "numId";
3833
+ readonly abstractNumId: "abstractNumId";
3834
+ readonly drawing: "drawing";
3835
+ readonly relationship: "relationship";
3836
+ };
3837
+ type ImportedIdCollisionKind = (typeof IMPORTED_ID_COLLISION_KINDS)[keyof typeof IMPORTED_ID_COLLISION_KINDS];
3818
3838
  type ParseWarningCode = (typeof PARSE_WARNING_CODES)[keyof typeof PARSE_WARNING_CODES];
3819
3839
  /** Where a warning happened, as precisely as the part can say. */
3820
3840
  type ParseWarningLocation = {
@@ -3831,6 +3851,8 @@ type ParseWarningLocation = {
3831
3851
  };
3832
3852
  type ParseWarning = {
3833
3853
  code: ParseWarningCode;
3854
+ /** The identity domain, for imported collision diagnostics. */
3855
+ identityKind?: ImportedIdCollisionKind;
3834
3856
  location: ParseWarningLocation;
3835
3857
  /** The value folio declined to read, exactly as the source wrote it. */
3836
3858
  value?: string;
@@ -4293,4 +4315,4 @@ declare const COMMENT_PART_RELATIONSHIPS: {
4293
4315
  };
4294
4316
  };
4295
4317
  //#endregion
4296
- export { DrawingContent as $, borderStyleFrom as $i, TrackedRunContent as $n, NO_PARAGRAPH_NUMBERING as $r, ParagraphContent as $t, ParseWarningLocation as A, TabStopAlignment as Ai, ShapeTextBody as An, CellMargins as Ar, InlineWrapper as At, Column as B, UnrecognisedThemeColor as Bi, TableContentCarrier as Bn, TableCellBorders as Br, MoveFromRangeStart as Bt, ThemeColorScheme as C, PARAGRAPH_ALIGNMENTS as Ci, SectionStart as Cn, LevelOverride as Cr, ImagePadding as Ct, PARSE_WARNING_CODES as D, TEXT_DIRECTIONS as Di, ShapeFill as Dn, ListRendering as Dr, ImageWrap as Dt, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as E, TAB_STOP_ALIGNMENTS as Ei, ShapeContent as En, ListMarkerFormatting as Er, ImageTransform as Et, BlockSdt as F, ColorValue as Fi, TabContent as Fn, ParagraphFormatting as Fr, MarkupRangeMarker as Ft, ComplexField as G, themeColorSlot as Gi, TableRow as Gn, TableMeasurement as Gr, NonVisualDrawingNames as Gt, CommentRangeEnd as H, isThemeColor as Hi, TablePreservedMarkup as Hn, TableFormatting as Hr, MoveToRangeEnd as Ht, BookmarkEnd as I, ShadingProperties as Ii, Table as In, SpacingExplicit as Ir, MathEquation as It, DisplacedByCustomXml as J, SchemeColorValue as Ji, TextBox as Jn, TableWidthType as Jr, NoteReferenceContent as Jt, DRAWING_RAW_XML_MODES as K, themeColorToken as Ki, TableRowPropertyChange as Kn, TablePropertyExceptionFormatting as Kr, NoteMarkerContent as Kt, BookmarkRangeMarker as L, SCHEME_COLOR_VALUE_BY_THEME_COLOR as Li, TableCell as Ln, TabLeader as Lr, MoveBookmarkMarker as Lt, BidiControl as M, TextDirection as Mi, SimpleField as Mn, EmphasisMark as Mr, InstrTextContent as Mt, BlockContent as N, TextDirectionFlow as Ni, SoftHyphenContent as Nn, FloatingTableProperties as Nr, LineNumberRestart as Nt, ParseWarning as O, TEXT_DIRECTION_FLOWS as Oi, ShapeGeometryAdjustment as On, NumberingDefinitions as Or, ImageWrapPolygon as Ot, BlockCustomXml as P, BorderSpec as Pi, SymbolContent as Pn, LineSpacingRule as Pr, MAX_REVISION_ID as Pt, DrawingAnchor as Q, UnrecognisedBorderStyle as Qi, TrackedRunChange as Qn, NO_NUMBERING_NUM_ID as Qr, Paragraph as Qt, BookmarkStart as R, THEME_COLOR_BY_SCHEME_COLOR_VALUE as Ri, TableCellBlock as Rn, TabStop as Rr, MoveFrom as Rt, Theme as S, NumberFormat as Si, SectionPropertyChange as Sn, LevelLegacy as Sr, ImageFrameLocks as St, ThemeFontScheme as T, TABLE_ALIGNMENTS as Ti, ShapeAlternateContent as Tn, ListLevel as Tr, ImageSize as Tt, CommentRangeStart as U, knownThemeColor as Ui, TablePropertyChange as Un, TableGridChange as Ur, MoveToRangeStart as Ut, Comment as V, isSchemeColorValue as Vi, TableCustomXmlWrapper as Vn, TableCellFormatting as Vr, MoveTo as Vt, CommentReference as W, readThemeColor as Wi, TablePropertyExceptionChange as Wn, TableLook as Wr, NoBreakHyphenContent as Wt, DocumentBackgroundDrawing as X, ThemeColor as Xi, TextWatermark as Xn, TextFormatting as Xr, PROPERTY_REVISION_KINDS as Xt, DocumentBackground as Y, THEME_COLORS as Yi, TextContent as Yn, TextEffect as Yr, PARAGRAPH_MARK_CHANGE_KINDS as Yt, DocumentBody as Z, BorderStyleValue as Zi, TrackedChangeInfo as Zn, UnderlineStyle as Zr, PageOrientation as Zt, RelationshipMap as _, headingLevelOf as _i, SdtEndProperties as _n, PreviewDescriptor as _r, Hyperlink as _t, DocumentSettings as a, BORDER_STYLES as aa, mergeParagraphNumbering as ai, PositionedBookmarkMarker as an, isOoxmlSymbolCharacter as ar, EndnoteProperties as at, StyleDefinitions as b, outlineLevelStatedValue as bi, Section as bn, COUNTER_FORMATS as br, ImageCrop as bt, isNumberingLevel as c, paragraphNumberingReference as ci, PreservedXmlContent as cn, UnrecognisedPresetLineDash as cr, FieldType as ct, EmbeddedFontRef as d, resolveParagraphNumbering as di, PropertyRevisionKind as dn, presetLineDashToken as dr, Footnote as dt, borderStyleToken as ea, ParagraphNumberingOverride as ei, ParagraphMarkChange as en, VerticalAlign as er, DrawingGroupChild as et, FontCharset as f, sameEffectiveParagraphNumbering as fi, REVIEW_CARRIERS as fn, PRESET_LINE_DASH_VALS as fr, FootnotePosition as ft, Relationship as g, OutlineLevel as gi, RunPropertyChange as gn, relationshipIdOf as gr, HeaderReference as gt, MediaFile as h, HeadingOutlineLevel as hi, RunContent as hn, mintRelationshipId as hr, HeaderFooterType as ht, Document as i, statesNoBorder as ia, isNumberingReference as ii, PositionalTab as in, WrapPolygonPoint as ir, EndnotePosition as it, BIDI_CONTROLS as j, TableAlignment as ji, ShapeType as jn, ConditionalFormatStyle as jr, Insertion as jt, ParseWarningCode as k, TEXT_DIRECTION_FLOW_BY_TOKEN as ki, ShapeOutline as kn, NumberingInstance as kr, InlineSdt as kt, ExhaustiveFields as l, paragraphNumberingReferenceId as li, PropertyChange as ln, isPresetLineDashVal as lr, FoldedListNumber as lt, FontTable as m, BODY_TEXT_OUTLINE_LEVEL as mi, Run as mn, RelationshipId as mr, HeaderFooter as mt, DEFAULT_TAB_STOP_TWIPS as n, isBorderNone as na, ParagraphNumberingSlots as ni, ParagraphPropertyChange as nn, WrapDistanceSlots as nr, EffectExtentSlots as nt, DocxConformanceClass as o, BorderStyle as oa, paragraphNumberingFromSlots as oi, PreservedBlock as on, normalizeRevisionId as or, Field as ot, FontInfo as p, sameStatedParagraphNumbering as pi, ReviewCarrier as pn, PresetLineDashVal as pr, FootnoteProperties as pt, Deletion as q, SchemeColorSlot as qi, TableStructuralChangeInfo as qn, TableRowFormatting as qr, NoteNumberRestart as qt, DOCX_CONFORMANCE_CLASSES as r, isBorderStyle as ra, ResolvedParagraphNumbering as ri, PictureWatermark as rn, WrapDistances as rr, Endnote as rt, DocxPackage as s, paragraphNumberingLevel as si, PreservedInline as sn, PresetLineDashValue as sr, FieldCharContent as st, COMMENT_PART_RELATIONSHIPS as t, isBorderNil as ta, ParagraphNumberingReference as ti, ParagraphMarkChangeKind as tn, Watermark as tr, DrawingRawXmlMode as tt, DocDefaults as u, paragraphNumberingSlots as ui, PropertyChangeInfo as un, presetLineDashFrom as ur, FooterReference as ut, RelationshipType as v, headingOutlineLevel as vi, SdtProperties as vn, PreviewShape as vr, INSERTION_SEAM_POLICIES as vt, ThemeFont as w, ParagraphAlignment as wi, Shape as wn, LevelSuffix as wr, ImagePosition as wt, StyleType as x, NUMBER_FORMATS as xi, SectionProperties as xn, CounterFormat as xr, ImageDocPrLink as xt, Style as y, outlineLevelFromStatedValue as yi, SdtType as yn, AbstractNumbering as yr, Image as yt, BreakContent as z, ThemeColorValue as zi, TableCellPropertyChange as zn, TableBorders as zr, MoveFromRangeEnd as zt };
4318
+ export { DocumentBackgroundDrawing as $, ThemeColor as $i, TextWatermark as $n, TextFormatting as $r, PROPERTY_REVISION_KINDS as $t, ParseWarning as A, TEXT_DIRECTIONS as Ai, ShapeFill as An, ListRendering as Ar, ImageWrap as At, BookmarkRangeMarker as B, SCHEME_COLOR_VALUE_BY_THEME_COLOR as Bi, TableCell as Bn, TabLeader as Br, MoveBookmarkMarker as Bt, ThemeColorScheme as C, outlineLevelStatedValue as Ci, Section as Cn, COUNTER_FORMATS as Cr, ImageCrop as Ct, ImportedIdCollisionKind as D, ParagraphAlignment as Di, Shape as Dn, LevelSuffix as Dr, ImagePosition as Dt, IMPORTED_ID_COLLISION_KINDS as E, PARAGRAPH_ALIGNMENTS as Ei, SectionStart as En, LevelOverride as Er, ImagePadding as Et, BidiControl as F, TextDirection as Fi, SimpleField as Fn, EmphasisMark as Fr, InstrTextContent as Ft, CommentRangeEnd as G, isThemeColor as Gi, TablePreservedMarkup as Gn, TableFormatting as Gr, MoveToRangeEnd as Gt, BreakContent as H, ThemeColorValue as Hi, TableCellPropertyChange as Hn, TableBorders as Hr, MoveFromRangeEnd as Ht, BlockContent as I, TextDirectionFlow as Ii, SoftHyphenContent as In, FloatingTableProperties as Ir, LineNumberRestart as It, ComplexField as J, themeColorSlot as Ji, TableRow as Jn, TableMeasurement as Jr, NonVisualDrawingNames as Jt, CommentRangeStart as K, knownThemeColor as Ki, TablePropertyChange as Kn, TableGridChange as Kr, MoveToRangeStart as Kt, BlockCustomXml as L, BorderSpec as Li, SymbolContent as Ln, LineSpacingRule as Lr, MAX_REVISION_ID as Lt, ParseWarningLocation as M, TEXT_DIRECTION_FLOW_BY_TOKEN as Mi, ShapeOutline as Mn, NumberingInstance as Mr, InlineSdt as Mt, getSingularRunPropertyChange as N, TabStopAlignment as Ni, ShapeTextBody as Nn, CellMargins as Nr, InlineWrapper as Nt, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as O, TABLE_ALIGNMENTS as Oi, ShapeAlternateContent as On, ListLevel as Or, ImageSize as Ot, BIDI_CONTROLS as P, TableAlignment as Pi, ShapeType as Pn, ConditionalFormatStyle as Pr, Insertion as Pt, DocumentBackground as Q, THEME_COLORS as Qi, TextContent as Qn, TextEffect as Qr, PARAGRAPH_MARK_CHANGE_KINDS as Qt, BlockSdt as R, ColorValue as Ri, TabContent as Rn, ParagraphFormatting as Rr, MarkupRangeMarker as Rt, Theme as S, outlineLevelFromStatedValue as Si, SdtType as Sn, AbstractNumbering as Sr, Image as St, ThemeFontScheme as T, NumberFormat as Ti, SectionPropertyChange as Tn, LevelLegacy as Tr, ImageFrameLocks as Tt, Column as U, UnrecognisedThemeColor as Ui, TableContentCarrier as Un, TableCellBorders as Ur, MoveFromRangeStart as Ut, BookmarkStart as V, THEME_COLOR_BY_SCHEME_COLOR_VALUE as Vi, TableCellBlock as Vn, TabStop as Vr, MoveFrom as Vt, Comment as W, isSchemeColorValue as Wi, TableCustomXmlWrapper as Wn, TableCellFormatting as Wr, MoveTo as Wt, Deletion as X, SchemeColorSlot as Xi, TableStructuralChangeInfo as Xn, TableRowFormatting as Xr, NoteNumberRestart as Xt, DRAWING_RAW_XML_MODES as Y, themeColorToken as Yi, TableRowPropertyChange as Yn, TablePropertyExceptionFormatting as Yr, NoteMarkerContent as Yt, DisplacedByCustomXml as Z, SchemeColorValue as Zi, TextBox as Zn, TableWidthType as Zr, NoteReferenceContent as Zt, RelationshipMap as _, BODY_TEXT_OUTLINE_LEVEL as _i, Run as _n, RelationshipId as _r, HeaderFooter as _t, DocumentSettings as a, isBorderNone as aa, ParagraphNumberingSlots as ai, ParagraphPropertyChange as an, WrapDistanceSlots as ar, EffectExtentSlots as at, StyleDefinitions as b, headingLevelOf as bi, SdtEndProperties as bn, PreviewDescriptor as br, Hyperlink as bt, isNumberingLevel as c, BORDER_STYLES as ca, mergeParagraphNumbering as ci, PositionedBookmarkMarker as cn, isOoxmlSymbolCharacter as cr, EndnoteProperties as ct, EmbeddedFontRef as d, paragraphNumberingReference as di, PreservedXmlContent as dn, UnrecognisedPresetLineDash as dr, FieldType as dt, BorderStyleValue as ea, UnderlineStyle as ei, PageOrientation as en, TrackedChangeInfo as er, DocumentBody as et, FontCharset as f, paragraphNumberingReferenceId as fi, PropertyChange as fn, isPresetLineDashVal as fr, FoldedListNumber as ft, Relationship as g, sameStatedParagraphNumbering as gi, ReviewCarrier as gn, PresetLineDashVal as gr, FootnoteProperties as gt, MediaFile as h, sameEffectiveParagraphNumbering as hi, REVIEW_CARRIERS as hn, PRESET_LINE_DASH_VALS as hr, FootnotePosition as ht, Document as i, isBorderNil as ia, ParagraphNumberingReference as ii, ParagraphMarkChangeKind as in, Watermark as ir, DrawingRawXmlMode as it, ParseWarningCode as j, TEXT_DIRECTION_FLOWS as ji, ShapeGeometryAdjustment as jn, NumberingDefinitions as jr, ImageWrapPolygon as jt, PARSE_WARNING_CODES as k, TAB_STOP_ALIGNMENTS as ki, ShapeContent as kn, ListMarkerFormatting as kr, ImageTransform as kt, ExhaustiveFields as l, BorderStyle as la, paragraphNumberingFromSlots as li, PreservedBlock as ln, normalizeRevisionId as lr, Field as lt, FontTable as m, resolveParagraphNumbering as mi, PropertyRevisionKind as mn, presetLineDashToken as mr, Footnote as mt, DEFAULT_TAB_STOP_TWIPS as n, borderStyleFrom as na, NO_PARAGRAPH_NUMBERING as ni, ParagraphContent as nn, TrackedRunContent as nr, DrawingContent as nt, DocxConformanceClass as o, isBorderStyle as oa, ResolvedParagraphNumbering as oi, PictureWatermark as on, WrapDistances as or, Endnote as ot, FontInfo as p, paragraphNumberingSlots as pi, PropertyChangeInfo as pn, presetLineDashFrom as pr, FooterReference as pt, CommentReference as q, readThemeColor as qi, TablePropertyExceptionChange as qn, TableLook as qr, NoBreakHyphenContent as qt, DOCX_CONFORMANCE_CLASSES as r, borderStyleToken as ra, ParagraphNumberingOverride as ri, ParagraphMarkChange as rn, VerticalAlign as rr, DrawingGroupChild as rt, DocxPackage as s, statesNoBorder as sa, isNumberingReference as si, PositionalTab as sn, WrapPolygonPoint as sr, EndnotePosition as st, COMMENT_PART_RELATIONSHIPS as t, UnrecognisedBorderStyle as ta, NO_NUMBERING_NUM_ID as ti, Paragraph as tn, TrackedRunChange as tr, DrawingAnchor as tt, DocDefaults as u, paragraphNumberingLevel as ui, PreservedInline as un, PresetLineDashValue as ur, FieldCharContent as ut, RelationshipType as v, HeadingOutlineLevel as vi, RunContent as vn, mintRelationshipId as vr, HeaderFooterType as vt, ThemeFont as w, NUMBER_FORMATS as wi, SectionProperties as wn, CounterFormat as wr, ImageDocPrLink as wt, StyleType as x, headingOutlineLevel as xi, SdtProperties as xn, PreviewShape as xr, INSERTION_SEAM_POLICIES as xt, Style as y, OutlineLevel as yi, RunPropertyChange as yn, relationshipIdOf as yr, HeaderReference as yt, BookmarkEnd as z, ShadingProperties as zi, Table as zn, SpacingExplicit as zr, MathEquation as zt };
Binary file
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $t as ParagraphContent, Gn as TableRow, In as Table, Ln as TableCell, N as BlockContent, Or as NumberingDefinitions, Qt as Paragraph, X as DocumentBackgroundDrawing, Y as DocumentBackground, Yn as TextContent, Z as DocumentBody, hn as RunContent, i as Document, in as PositionalTab, mn as Run, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, xn as SectionProperties, y as Style, z as BreakContent } from "./document-YlRuGzLX.js";
1
+ import { $ as DocumentBackgroundDrawing, Bn as TableCell, H as BreakContent, I as BlockContent, Jn as TableRow, Q as DocumentBackground, Qn as TextContent, _n as Run, et as DocumentBody, i as Document, jr as NumberingDefinitions, nn as ParagraphContent, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, sn as PositionalTab, tn as Paragraph, vn as RunContent, wn as SectionProperties, y as Style, zn as Table } from "./document-wNmygRXS.js";
2
2
  import JSZip from "jszip";
3
3
  import { Buffer } from "node:buffer";
4
4
  //#region src/legal-source/types.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { K as headingOutlineLevel, b as borderStyleToken, d as isNoteReferenceId, f as isOoxmlSymbolCharacter, it as paragraphNumberingSlots, nt as paragraphNumberingReference, r as DOCX_CONFORMANCE_CLASSES, rt as paragraphNumberingReferenceId, s as MAX_REVISION_ID, tt as paragraphNumberingLevel, w as statesNoBorder } from "./document-CQ0oovh0.js";
1
+ import { K as headingOutlineLevel, b as borderStyleToken, d as isNoteReferenceId, f as isOoxmlSymbolCharacter, it as paragraphNumberingSlots, nt as paragraphNumberingReference, r as DOCX_CONFORMANCE_CLASSES, rt as paragraphNumberingReferenceId, s as MAX_REVISION_ID, tt as paragraphNumberingLevel, w as statesNoBorder } from "./document-C02Ulybe.js";
2
2
  import { writeZipPart } from "./zip/writeZipPart.js";
3
3
  import { i as serializeSequenceChildren } from "./sequenceChildren-B8ODeI3J.js";
4
4
  import { a as hasIllegalXmlCharacters, i as escapeXmlText, n as sanitizeMarkdownHref, o as sanitizeXmlCharacters, r as escapeXmlAttribute, t as sanitizeExternalUrl } from "./href-2XSCK-T8.js";
@@ -1,3 +1,3 @@
1
- import { $ as DrawingContent, $i as borderStyleFrom, $n as TrackedRunContent, $r as NO_PARAGRAPH_NUMBERING, $t as ParagraphContent, A as ParseWarningLocation, Ai as TabStopAlignment, An as ShapeTextBody, Ar as CellMargins, At as InlineWrapper, B as Column, Bi as UnrecognisedThemeColor, Bn as TableContentCarrier, Br as TableCellBorders, Bt as MoveFromRangeStart, C as ThemeColorScheme, Ci as PARAGRAPH_ALIGNMENTS, Cn as SectionStart, Cr as LevelOverride, Ct as ImagePadding, D as PARSE_WARNING_CODES, Di as TEXT_DIRECTIONS, Dn as ShapeFill, Dr as ListRendering, Dt as ImageWrap, E as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Ei as TAB_STOP_ALIGNMENTS, En as ShapeContent, Er as ListMarkerFormatting, Et as ImageTransform, F as BlockSdt, Fi as ColorValue, Fn as TabContent, Fr as ParagraphFormatting, Ft as MarkupRangeMarker, G as ComplexField, Gi as themeColorSlot, Gn as TableRow, Gr as TableMeasurement, Gt as NonVisualDrawingNames, H as CommentRangeEnd, Hi as isThemeColor, Hn as TablePreservedMarkup, Hr as TableFormatting, Ht as MoveToRangeEnd, I as BookmarkEnd, Ii as ShadingProperties, In as Table, Ir as SpacingExplicit, It as MathEquation, J as DisplacedByCustomXml, Ji as SchemeColorValue, Jn as TextBox, Jr as TableWidthType, Jt as NoteReferenceContent, K as DRAWING_RAW_XML_MODES, Ki as themeColorToken, Kn as TableRowPropertyChange, Kr as TablePropertyExceptionFormatting, Kt as NoteMarkerContent, L as BookmarkRangeMarker, Li as SCHEME_COLOR_VALUE_BY_THEME_COLOR, Ln as TableCell, Lr as TabLeader, Lt as MoveBookmarkMarker, M as BidiControl, Mi as TextDirection, Mn as SimpleField, Mr as EmphasisMark, Mt as InstrTextContent, N as BlockContent, Ni as TextDirectionFlow, Nn as SoftHyphenContent, Nr as FloatingTableProperties, Nt as LineNumberRestart, O as ParseWarning, Oi as TEXT_DIRECTION_FLOWS, On as ShapeGeometryAdjustment, Or as NumberingDefinitions, Ot as ImageWrapPolygon, P as BlockCustomXml, Pi as BorderSpec, Pn as SymbolContent, Pr as LineSpacingRule, Pt as MAX_REVISION_ID, Q as DrawingAnchor, Qi as UnrecognisedBorderStyle, Qn as TrackedRunChange, Qr as NO_NUMBERING_NUM_ID, Qt as Paragraph, R as BookmarkStart, Ri as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Rn as TableCellBlock, Rr as TabStop, Rt as MoveFrom, S as Theme, Si as NumberFormat, Sn as SectionPropertyChange, Sr as LevelLegacy, St as ImageFrameLocks, T as ThemeFontScheme, Ti as TABLE_ALIGNMENTS, Tn as ShapeAlternateContent, Tr as ListLevel, Tt as ImageSize, U as CommentRangeStart, Ui as knownThemeColor, Un as TablePropertyChange, Ur as TableGridChange, Ut as MoveToRangeStart, V as Comment, Vi as isSchemeColorValue, Vn as TableCustomXmlWrapper, Vr as TableCellFormatting, Vt as MoveTo, W as CommentReference, Wi as readThemeColor, Wn as TablePropertyExceptionChange, Wr as TableLook, Wt as NoBreakHyphenContent, X as DocumentBackgroundDrawing, Xi as ThemeColor, Xn as TextWatermark, Xr as TextFormatting, Xt as PROPERTY_REVISION_KINDS, Y as DocumentBackground, Yi as THEME_COLORS, Yn as TextContent, Yr as TextEffect, Yt as PARAGRAPH_MARK_CHANGE_KINDS, Z as DocumentBody, Zi as BorderStyleValue, Zn as TrackedChangeInfo, Zr as UnderlineStyle, Zt as PageOrientation, _ as RelationshipMap, _i as headingLevelOf, _n as SdtEndProperties, _r as PreviewDescriptor, _t as Hyperlink, a as DocumentSettings, aa as BORDER_STYLES, ai as mergeParagraphNumbering, an as PositionedBookmarkMarker, ar as isOoxmlSymbolCharacter, at as EndnoteProperties, b as StyleDefinitions, bi as outlineLevelStatedValue, bn as Section, br as COUNTER_FORMATS, bt as ImageCrop, c as isNumberingLevel, ci as paragraphNumberingReference, cn as PreservedXmlContent, cr as UnrecognisedPresetLineDash, ct as FieldType, d as EmbeddedFontRef, di as resolveParagraphNumbering, dn as PropertyRevisionKind, dr as presetLineDashToken, dt as Footnote, ea as borderStyleToken, ei as ParagraphNumberingOverride, en as ParagraphMarkChange, er as VerticalAlign, et as DrawingGroupChild, f as FontCharset, fi as sameEffectiveParagraphNumbering, fn as REVIEW_CARRIERS, fr as PRESET_LINE_DASH_VALS, ft as FootnotePosition, g as Relationship, gi as OutlineLevel, gn as RunPropertyChange, gr as relationshipIdOf, gt as HeaderReference, h as MediaFile, hi as HeadingOutlineLevel, hn as RunContent, hr as mintRelationshipId, ht as HeaderFooterType, i as Document, ia as statesNoBorder, ii as isNumberingReference, in as PositionalTab, ir as WrapPolygonPoint, it as EndnotePosition, j as BIDI_CONTROLS, ji as TableAlignment, jn as ShapeType, jr as ConditionalFormatStyle, jt as Insertion, k as ParseWarningCode, ki as TEXT_DIRECTION_FLOW_BY_TOKEN, kn as ShapeOutline, kr as NumberingInstance, kt as InlineSdt, l as ExhaustiveFields, li as paragraphNumberingReferenceId, ln as PropertyChange, lr as isPresetLineDashVal, lt as FoldedListNumber, m as FontTable, mi as BODY_TEXT_OUTLINE_LEVEL, mn as Run, mr as RelationshipId, mt as HeaderFooter, n as DEFAULT_TAB_STOP_TWIPS, na as isBorderNone, ni as ParagraphNumberingSlots, nn as ParagraphPropertyChange, nr as WrapDistanceSlots, nt as EffectExtentSlots, o as DocxConformanceClass, oa as BorderStyle, oi as paragraphNumberingFromSlots, on as PreservedBlock, or as normalizeRevisionId, ot as Field, p as FontInfo, pi as sameStatedParagraphNumbering, pn as ReviewCarrier, pr as PresetLineDashVal, pt as FootnoteProperties, q as Deletion, qi as SchemeColorSlot, qn as TableStructuralChangeInfo, qr as TableRowFormatting, qt as NoteNumberRestart, r as DOCX_CONFORMANCE_CLASSES, ra as isBorderStyle, ri as ResolvedParagraphNumbering, rn as PictureWatermark, rr as WrapDistances, rt as Endnote, s as DocxPackage, si as paragraphNumberingLevel, sn as PreservedInline, sr as PresetLineDashValue, st as FieldCharContent, t as COMMENT_PART_RELATIONSHIPS, ta as isBorderNil, ti as ParagraphNumberingReference, tn as ParagraphMarkChangeKind, tr as Watermark, tt as DrawingRawXmlMode, u as DocDefaults, ui as paragraphNumberingSlots, un as PropertyChangeInfo, ur as presetLineDashFrom, ut as FooterReference, v as RelationshipType, vi as headingOutlineLevel, vn as SdtProperties, vr as PreviewShape, w as ThemeFont, wi as ParagraphAlignment, wn as Shape, wr as LevelSuffix, wt as ImagePosition, x as StyleType, xi as NUMBER_FORMATS, xn as SectionProperties, xr as CounterFormat, xt as ImageDocPrLink, y as Style, yi as outlineLevelFromStatedValue, yn as SdtType, yr as AbstractNumbering, yt as Image, z as BreakContent, zi as ThemeColorValue, zn as TableCellPropertyChange, zr as TableBorders, zt as MoveFromRangeEnd } from "../document-YlRuGzLX.js";
1
+ import { $ as DocumentBackgroundDrawing, $i as ThemeColor, $n as TextWatermark, $r as TextFormatting, $t as PROPERTY_REVISION_KINDS, A as ParseWarning, Ai as TEXT_DIRECTIONS, An as ShapeFill, Ar as ListRendering, At as ImageWrap, B as BookmarkRangeMarker, Bi as SCHEME_COLOR_VALUE_BY_THEME_COLOR, Bn as TableCell, Br as TabLeader, Bt as MoveBookmarkMarker, C as ThemeColorScheme, Ci as outlineLevelStatedValue, Cn as Section, Cr as COUNTER_FORMATS, Ct as ImageCrop, D as ImportedIdCollisionKind, Di as ParagraphAlignment, Dn as Shape, Dr as LevelSuffix, Dt as ImagePosition, E as IMPORTED_ID_COLLISION_KINDS, Ei as PARAGRAPH_ALIGNMENTS, En as SectionStart, Er as LevelOverride, Et as ImagePadding, F as BidiControl, Fi as TextDirection, Fn as SimpleField, Fr as EmphasisMark, Ft as InstrTextContent, G as CommentRangeEnd, Gi as isThemeColor, Gn as TablePreservedMarkup, Gr as TableFormatting, Gt as MoveToRangeEnd, H as BreakContent, Hi as ThemeColorValue, Hn as TableCellPropertyChange, Hr as TableBorders, Ht as MoveFromRangeEnd, I as BlockContent, Ii as TextDirectionFlow, In as SoftHyphenContent, Ir as FloatingTableProperties, It as LineNumberRestart, J as ComplexField, Ji as themeColorSlot, Jn as TableRow, Jr as TableMeasurement, Jt as NonVisualDrawingNames, K as CommentRangeStart, Ki as knownThemeColor, Kn as TablePropertyChange, Kr as TableGridChange, Kt as MoveToRangeStart, L as BlockCustomXml, Li as BorderSpec, Ln as SymbolContent, Lr as LineSpacingRule, Lt as MAX_REVISION_ID, M as ParseWarningLocation, Mi as TEXT_DIRECTION_FLOW_BY_TOKEN, Mn as ShapeOutline, Mr as NumberingInstance, Mt as InlineSdt, N as getSingularRunPropertyChange, Ni as TabStopAlignment, Nn as ShapeTextBody, Nr as CellMargins, Nt as InlineWrapper, O as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Oi as TABLE_ALIGNMENTS, On as ShapeAlternateContent, Or as ListLevel, Ot as ImageSize, P as BIDI_CONTROLS, Pi as TableAlignment, Pn as ShapeType, Pr as ConditionalFormatStyle, Pt as Insertion, Q as DocumentBackground, Qi as THEME_COLORS, Qn as TextContent, Qr as TextEffect, Qt as PARAGRAPH_MARK_CHANGE_KINDS, R as BlockSdt, Ri as ColorValue, Rn as TabContent, Rr as ParagraphFormatting, Rt as MarkupRangeMarker, S as Theme, Si as outlineLevelFromStatedValue, Sn as SdtType, Sr as AbstractNumbering, St as Image, T as ThemeFontScheme, Ti as NumberFormat, Tn as SectionPropertyChange, Tr as LevelLegacy, Tt as ImageFrameLocks, U as Column, Ui as UnrecognisedThemeColor, Un as TableContentCarrier, Ur as TableCellBorders, Ut as MoveFromRangeStart, V as BookmarkStart, Vi as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Vn as TableCellBlock, Vr as TabStop, Vt as MoveFrom, W as Comment, Wi as isSchemeColorValue, Wn as TableCustomXmlWrapper, Wr as TableCellFormatting, Wt as MoveTo, X as Deletion, Xi as SchemeColorSlot, Xn as TableStructuralChangeInfo, Xr as TableRowFormatting, Xt as NoteNumberRestart, Y as DRAWING_RAW_XML_MODES, Yi as themeColorToken, Yn as TableRowPropertyChange, Yr as TablePropertyExceptionFormatting, Yt as NoteMarkerContent, Z as DisplacedByCustomXml, Zi as SchemeColorValue, Zn as TextBox, Zr as TableWidthType, Zt as NoteReferenceContent, _ as RelationshipMap, _i as BODY_TEXT_OUTLINE_LEVEL, _n as Run, _r as RelationshipId, _t as HeaderFooter, a as DocumentSettings, aa as isBorderNone, ai as ParagraphNumberingSlots, an as ParagraphPropertyChange, ar as WrapDistanceSlots, at as EffectExtentSlots, b as StyleDefinitions, bi as headingLevelOf, bn as SdtEndProperties, br as PreviewDescriptor, bt as Hyperlink, c as isNumberingLevel, ca as BORDER_STYLES, ci as mergeParagraphNumbering, cn as PositionedBookmarkMarker, cr as isOoxmlSymbolCharacter, ct as EndnoteProperties, d as EmbeddedFontRef, di as paragraphNumberingReference, dn as PreservedXmlContent, dr as UnrecognisedPresetLineDash, dt as FieldType, ea as BorderStyleValue, ei as UnderlineStyle, en as PageOrientation, er as TrackedChangeInfo, et as DocumentBody, f as FontCharset, fi as paragraphNumberingReferenceId, fn as PropertyChange, fr as isPresetLineDashVal, ft as FoldedListNumber, g as Relationship, gi as sameStatedParagraphNumbering, gn as ReviewCarrier, gr as PresetLineDashVal, gt as FootnoteProperties, h as MediaFile, hi as sameEffectiveParagraphNumbering, hn as REVIEW_CARRIERS, hr as PRESET_LINE_DASH_VALS, ht as FootnotePosition, i as Document, ia as isBorderNil, ii as ParagraphNumberingReference, in as ParagraphMarkChangeKind, ir as Watermark, it as DrawingRawXmlMode, j as ParseWarningCode, ji as TEXT_DIRECTION_FLOWS, jn as ShapeGeometryAdjustment, jr as NumberingDefinitions, jt as ImageWrapPolygon, k as PARSE_WARNING_CODES, ki as TAB_STOP_ALIGNMENTS, kn as ShapeContent, kr as ListMarkerFormatting, kt as ImageTransform, l as ExhaustiveFields, la as BorderStyle, li as paragraphNumberingFromSlots, ln as PreservedBlock, lr as normalizeRevisionId, lt as Field, m as FontTable, mi as resolveParagraphNumbering, mn as PropertyRevisionKind, mr as presetLineDashToken, mt as Footnote, n as DEFAULT_TAB_STOP_TWIPS, na as borderStyleFrom, ni as NO_PARAGRAPH_NUMBERING, nn as ParagraphContent, nr as TrackedRunContent, nt as DrawingContent, o as DocxConformanceClass, oa as isBorderStyle, oi as ResolvedParagraphNumbering, on as PictureWatermark, or as WrapDistances, ot as Endnote, p as FontInfo, pi as paragraphNumberingSlots, pn as PropertyChangeInfo, pr as presetLineDashFrom, pt as FooterReference, q as CommentReference, qi as readThemeColor, qn as TablePropertyExceptionChange, qr as TableLook, qt as NoBreakHyphenContent, r as DOCX_CONFORMANCE_CLASSES, ra as borderStyleToken, ri as ParagraphNumberingOverride, rn as ParagraphMarkChange, rr as VerticalAlign, rt as DrawingGroupChild, s as DocxPackage, sa as statesNoBorder, si as isNumberingReference, sn as PositionalTab, sr as WrapPolygonPoint, st as EndnotePosition, t as COMMENT_PART_RELATIONSHIPS, ta as UnrecognisedBorderStyle, ti as NO_NUMBERING_NUM_ID, tn as Paragraph, tr as TrackedRunChange, tt as DrawingAnchor, u as DocDefaults, ui as paragraphNumberingLevel, un as PreservedInline, ur as PresetLineDashValue, ut as FieldCharContent, v as RelationshipType, vi as HeadingOutlineLevel, vn as RunContent, vr as mintRelationshipId, vt as HeaderFooterType, w as ThemeFont, wi as NUMBER_FORMATS, wn as SectionProperties, wr as CounterFormat, wt as ImageDocPrLink, x as StyleType, xi as headingOutlineLevel, xn as SdtProperties, xr as PreviewShape, y as Style, yi as OutlineLevel, yn as RunPropertyChange, yr as relationshipIdOf, yt as HeaderReference, z as BookmarkEnd, zi as ShadingProperties, zn as Table, zr as SpacingExplicit, zt as MathEquation } from "../document-wNmygRXS.js";
2
2
  import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "../preservedMarkup-G8XjWhs2.js";
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, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, 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, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, 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 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, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
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, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, 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, 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 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, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
@@ -1,2 +1,2 @@
1
- import { $ as mergeParagraphNumbering, A as TEXT_DIRECTIONS, B as themeColorToken, C as isBorderStyle, D as PARAGRAPH_ALIGNMENTS, E as NUMBER_FORMATS, F as isSchemeColorValue, G as headingLevelOf, H as mintRelationshipId, I as isThemeColor, J as outlineLevelStatedValue, K as headingOutlineLevel, L as knownThemeColor, M as TEXT_DIRECTION_FLOW_BY_TOKEN, N as SCHEME_COLOR_VALUE_BY_THEME_COLOR, O as TABLE_ALIGNMENTS, P as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Q as isNumberingReference, R as readThemeColor, S as isBorderNone, T as BORDER_STYLES, U as relationshipIdOf, V as THEME_COLORS, W as BODY_TEXT_OUTLINE_LEVEL, X as NO_NUMBERING_NUM_ID, Y as isNumberingLevel, Z as NO_PARAGRAPH_NUMBERING, _ as presetLineDashToken, a as DRAWING_RAW_XML_MODES, at as resolveParagraphNumbering, b as borderStyleToken, c as PARAGRAPH_MARK_CHANGE_KINDS, ct as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, et as paragraphNumberingFromSlots, f as isOoxmlSymbolCharacter, g as presetLineDashFrom, h as isPresetLineDashVal, i as BIDI_CONTROLS, it as paragraphNumberingSlots, j as TEXT_DIRECTION_FLOWS, k as TAB_STOP_ALIGNMENTS, l as PROPERTY_REVISION_KINDS, lt as PARSE_WARNING_CODES, m as COUNTER_FORMATS, n as DEFAULT_TAB_STOP_TWIPS, nt as paragraphNumberingReference, ot as sameEffectiveParagraphNumbering, p as normalizeRevisionId, q as outlineLevelFromStatedValue, r as DOCX_CONFORMANCE_CLASSES, rt as paragraphNumberingReferenceId, s as MAX_REVISION_ID, st as sameStatedParagraphNumbering, t as COMMENT_PART_RELATIONSHIPS, tt as paragraphNumberingLevel, u as REVIEW_CARRIERS, v as PRESET_LINE_DASH_VALS, w as statesNoBorder, x as isBorderNil, y as borderStyleFrom, z as themeColorSlot } from "../document-CQ0oovh0.js";
2
- export { BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, COMMENT_PART_RELATIONSHIPS, COUNTER_FORMATS, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, REVIEW_CARRIERS, SCHEME_COLOR_VALUE_BY_THEME_COLOR, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, borderStyleFrom, borderStyleToken, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
1
+ import { $ as mergeParagraphNumbering, A as TEXT_DIRECTIONS, B as themeColorToken, C as isBorderStyle, D as PARAGRAPH_ALIGNMENTS, E as NUMBER_FORMATS, F as isSchemeColorValue, G as headingLevelOf, H as mintRelationshipId, I as isThemeColor, J as outlineLevelStatedValue, K as headingOutlineLevel, L as knownThemeColor, M as TEXT_DIRECTION_FLOW_BY_TOKEN, N as SCHEME_COLOR_VALUE_BY_THEME_COLOR, O as TABLE_ALIGNMENTS, P as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Q as isNumberingReference, R as readThemeColor, S as isBorderNone, T as BORDER_STYLES, U as relationshipIdOf, V as THEME_COLORS, W as BODY_TEXT_OUTLINE_LEVEL, X as NO_NUMBERING_NUM_ID, Y as isNumberingLevel, Z as NO_PARAGRAPH_NUMBERING, _ as presetLineDashToken, a as DRAWING_RAW_XML_MODES, at as resolveParagraphNumbering, b as borderStyleToken, c as PARAGRAPH_MARK_CHANGE_KINDS, ct as IMPORTED_ID_COLLISION_KINDS, dt as getSingularRunPropertyChange, et as paragraphNumberingFromSlots, f as isOoxmlSymbolCharacter, g as presetLineDashFrom, h as isPresetLineDashVal, i as BIDI_CONTROLS, it as paragraphNumberingSlots, j as TEXT_DIRECTION_FLOWS, k as TAB_STOP_ALIGNMENTS, l as PROPERTY_REVISION_KINDS, lt as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, m as COUNTER_FORMATS, n as DEFAULT_TAB_STOP_TWIPS, nt as paragraphNumberingReference, ot as sameEffectiveParagraphNumbering, p as normalizeRevisionId, q as outlineLevelFromStatedValue, r as DOCX_CONFORMANCE_CLASSES, rt as paragraphNumberingReferenceId, s as MAX_REVISION_ID, st as sameStatedParagraphNumbering, t as COMMENT_PART_RELATIONSHIPS, tt as paragraphNumberingLevel, u as REVIEW_CARRIERS, ut as PARSE_WARNING_CODES, v as PRESET_LINE_DASH_VALS, w as statesNoBorder, x as isBorderNil, y as borderStyleFrom, z as themeColorSlot } from "../document-C02Ulybe.js";
2
+ export { BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, COMMENT_PART_RELATIONSHIPS, COUNTER_FORMATS, DEFAULT_TAB_STOP_TWIPS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, IMPORTED_ID_COLLISION_KINDS, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, REVIEW_CARRIERS, SCHEME_COLOR_VALUE_BY_THEME_COLOR, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, borderStyleFrom, borderStyleToken, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
@@ -1,4 +1,4 @@
1
- import { $t as ParagraphContent, Fn as TabContent, Fr as ParagraphFormatting, Gn as TableRow, Hr as TableFormatting, In as Table, N as BlockContent, Or as NumberingDefinitions, Qt as Paragraph, V as Comment, Vr as TableCellFormatting, Xr as TextFormatting, Z as DocumentBody, a as DocumentSettings, b as StyleDefinitions, bn as Section, dt as Footnote, en as ParagraphMarkChange, g as Relationship, h as MediaFile, hi as HeadingOutlineLevel, hn as RunContent, ht as HeaderFooterType, i as Document, kr as NumberingInstance, l as ExhaustiveFields, mn as Run, mt as HeaderFooter, nn as ParagraphPropertyChange, qr as TableRowFormatting, rt as Endnote, s as DocxPackage, vt as INSERTION_SEAM_POLICIES, xn as SectionProperties, yr as AbstractNumbering, z as BreakContent } from "../document-YlRuGzLX.js";
1
+ import { $r as TextFormatting, Cn as Section, Gr as TableFormatting, H as BreakContent, I as BlockContent, Jn as TableRow, Mr as NumberingInstance, Rn as TabContent, Rr as ParagraphFormatting, Sr as AbstractNumbering, W as Comment, Wr as TableCellFormatting, Xr as TableRowFormatting, _n as Run, _t as HeaderFooter, a as DocumentSettings, an as ParagraphPropertyChange, b as StyleDefinitions, et as DocumentBody, g as Relationship, h as MediaFile, i as Document, jr as NumberingDefinitions, l as ExhaustiveFields, mt as Footnote, nn as ParagraphContent, ot as Endnote, rn as ParagraphMarkChange, s as DocxPackage, tn as Paragraph, vi as HeadingOutlineLevel, vn as RunContent, vt as HeaderFooterType, wn as SectionProperties, xt as INSERTION_SEAM_POLICIES, zn as Table } from "../document-wNmygRXS.js";
2
2
  import { Result } from "better-result";
3
3
  //#region src/ops/noteMarks.d.ts
4
4
  declare const noteUsesCustomMark: (document: Document, note: Footnote | Endnote) => boolean;
@@ -342,8 +342,8 @@ declare const PROPERTY_REVIEW_POLICIES: Readonly<{
342
342
  * set before the patch. A run already carrying one keeps it, and with it the
343
343
  * formatting it started from. A tracked patch joins nothing, so `joinStart`
344
344
  * and `joinEnd` must be absent.
345
- * `propertyReview: "append"` records a separately rejectable action over
346
- * existing review, preserving the current formatting as that action's baseline.
345
+ * `propertyReview: "append"` coalesces an editor action into one pending review.
346
+ * It retains the first baseline and records the latest formatter's metadata.
347
347
  */
348
348
  type SetRunPropsOp = {
349
349
  type: typeof DOCUMENT_OP_TYPES.SET_RUN_PROPS;
@@ -1311,6 +1311,10 @@ declare const editorParagraphGroups: (document: Document, story: OpStory) => {
1311
1311
  paragraphs: Paragraph[];
1312
1312
  text: string;
1313
1313
  }[];
1314
+ /** One logical paragraph and visible offset for a physical canonical address. */
1315
+ declare const editorPositionAtPhysicalPosition: (document: Document, at: TextPosition) => TextPosition;
1316
+ /** Translate an editing-view paragraph gap to its physical canonical address. */
1317
+ declare const physicalPositionAtEditorOffset: (document: Document, at: TextPosition) => TextPosition;
1314
1318
  /** Compile one batch; the caller applies it atomically and journals its exact inverse. */
1315
1319
  declare const compileEditorIntent: (document: Document, { intent, mode, firstBlockId }: CompileEditorIntentOptions) => Result<CompiledEditorIntent, DocumentOpRefusal>;
1316
1320
  //#endregion
@@ -1639,4 +1643,4 @@ declare const commentDocumentIssue: (document: Document, allowedOrphans?: Readon
1639
1643
  /** Allocate from the package's annotation domains without a hidden mutable counter. */
1640
1644
  declare const freshCommentId: (document: Document) => Result<number, DocumentOpRefusal>;
1641
1645
  //#endregion
1642
- export { type AddNoteOp, type AppliedDocumentOp, BATCH_REJECTION_REASONS, BATCH_WIRE_OP_TYPES, BatchRejection, type BatchRejectionReason, type BlockInsertionPoint, type CommentAnchor, type CommentState, type CreateCommentOp, type CreateHeaderFooterOp, type CreateNumberingInstanceOp, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, type DeleteBlocksOp, type DeleteColumnOp, type DeleteCommentOp, type DeleteNumberingInstanceOp, type DeleteRangeOp, type DeleteRowOp, type DeleteTableOp, type DocumentBatch, type DocumentOp, type DocumentOpEnvelope, DocumentOpRefusal, type DocumentOpRefusalReason, type DocumentOpType, DocumentOpsContractError, EMPTY_PROPERTY_SETS, type EditorIntent, type EditorIntentMode, type EmptyPropertySet, type FormattingPatch, type HeaderFooterStory, INHERIT_RUN_PROPS, type InlineSlice, type InsertBlocksOp, type InsertColumnOp, type InsertContentOp, type InsertRowOp, type InsertTableOp, type InsertTextOp, type InsertedRunProps, type JoinBlocksOp, type JoinInlineOp, MAX_BATCH_WIRE_BYTES, type MergeCellsOp, type NewIds, type NoteStory, type NumberingPartState, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, type OpStory, PARAGRAPH_MARK_FORMATTING_KEYS, PROPERTY_REVIEW_POLICIES, type PackageResourceEntry, type PackageResourceEntryChange, type PackageResourceMapChange, type PackageResourceMedia, type PackageResourcePart, type PackageResources, type ParagraphPropsPatch, type ParagraphReviewFields, type PlanTrackedDeletionOptions, type PlanTrackedReplaceOptions, REVISION_DECISIONS, type RemoveHeaderFooterOp, type RemoveNoteOp, type ReplaceBlocksOp, type ReplaceInlineOp, type ResolveRevisionOp, type RestoreCommentStateOp, type RestoreStoryPartsOp, type RevisionDecision, type RevisionStamp, type RunPropsPatch, SPLIT_HALVES, type SectionEndpoint, type SectionMapState, type SectionPropertiesState, type SectionViewEntry, type SectionViewState, type SequencedBatch, type SetCellPropsOp, type SetCommentResolutionOp, type SetContainerBlocksOp, type SetPackageResourcesOp, type SetParagraphPropsOp, type SetParagraphReviewOp, type SetRowPropsOp, type SetRunPropsOp, type SetSectionEndpointOp, type SetSectionPropsOp, type SetTableGridOp, type SetTableOp, type SetTablePropsOp, type SetTableRowsOp, type SplitBlockOp, type SplitCellOp, type SplitHalf, type SplitInlineOp, type SplitParagraphFields, type TableEditOp, type TableIntentOperation, type TextPosition, type TouchedBlocks, type UpdateCommentContentOp, allocateCommentAnchorIds, applyDocumentOp, applyDocumentOpEnvelope, applyDocumentOps, captureDocumentOp, combineEdits, commentDocumentIssue, compareGaps, compileEditorIntent, createClient, createEditorIntentIdAllocator, createSequencer, defaultInsertionGap, documentStories, editorParagraphGroups, findStoryBody, formattingEquals, freshCommentId, idKey, inlineLeafSpans, isTextOnlyRun, mapTocBookmarkPosition, mergeRunContent, normalizeForOps, noteUsesCustomMark, packageParagraphIds, packageResourcesOpOf, paragraphLength, paragraphLogicalText, paragraphVisibleText, parseDocumentBatch, physicalOffsetAtVisibleOffset, planTrackedDeletion, planTrackedReplace, registerParagraphPropertySnapshot, revisionIdDemand, runsMergeable, sameStory, sectionPropertiesAt, storyBody, toOpEnvelope, transformBatch, validateDocumentBatch, validateOpsDocument, validateSequencedBatch, withBodyContent, zeroWidthLeavesAt };
1646
+ export { type AddNoteOp, type AppliedDocumentOp, BATCH_REJECTION_REASONS, BATCH_WIRE_OP_TYPES, BatchRejection, type BatchRejectionReason, type BlockInsertionPoint, type CommentAnchor, type CommentState, type CreateCommentOp, type CreateHeaderFooterOp, type CreateNumberingInstanceOp, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, type DeleteBlocksOp, type DeleteColumnOp, type DeleteCommentOp, type DeleteNumberingInstanceOp, type DeleteRangeOp, type DeleteRowOp, type DeleteTableOp, type DocumentBatch, type DocumentOp, type DocumentOpEnvelope, DocumentOpRefusal, type DocumentOpRefusalReason, type DocumentOpType, DocumentOpsContractError, EMPTY_PROPERTY_SETS, type EditorIntent, type EditorIntentMode, type EmptyPropertySet, type FormattingPatch, type HeaderFooterStory, INHERIT_RUN_PROPS, type InlineSlice, type InsertBlocksOp, type InsertColumnOp, type InsertContentOp, type InsertRowOp, type InsertTableOp, type InsertTextOp, type InsertedRunProps, type JoinBlocksOp, type JoinInlineOp, MAX_BATCH_WIRE_BYTES, type MergeCellsOp, type NewIds, type NoteStory, type NumberingPartState, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, type OpStory, PARAGRAPH_MARK_FORMATTING_KEYS, PROPERTY_REVIEW_POLICIES, type PackageResourceEntry, type PackageResourceEntryChange, type PackageResourceMapChange, type PackageResourceMedia, type PackageResourcePart, type PackageResources, type ParagraphPropsPatch, type ParagraphReviewFields, type PlanTrackedDeletionOptions, type PlanTrackedReplaceOptions, REVISION_DECISIONS, type RemoveHeaderFooterOp, type RemoveNoteOp, type ReplaceBlocksOp, type ReplaceInlineOp, type ResolveRevisionOp, type RestoreCommentStateOp, type RestoreStoryPartsOp, type RevisionDecision, type RevisionStamp, type RunPropsPatch, SPLIT_HALVES, type SectionEndpoint, type SectionMapState, type SectionPropertiesState, type SectionViewEntry, type SectionViewState, type SequencedBatch, type SetCellPropsOp, type SetCommentResolutionOp, type SetContainerBlocksOp, type SetPackageResourcesOp, type SetParagraphPropsOp, type SetParagraphReviewOp, type SetRowPropsOp, type SetRunPropsOp, type SetSectionEndpointOp, type SetSectionPropsOp, type SetTableGridOp, type SetTableOp, type SetTablePropsOp, type SetTableRowsOp, type SplitBlockOp, type SplitCellOp, type SplitHalf, type SplitInlineOp, type SplitParagraphFields, type TableEditOp, type TableIntentOperation, type TextPosition, type TouchedBlocks, type UpdateCommentContentOp, allocateCommentAnchorIds, applyDocumentOp, applyDocumentOpEnvelope, applyDocumentOps, captureDocumentOp, combineEdits, commentDocumentIssue, compareGaps, compileEditorIntent, createClient, createEditorIntentIdAllocator, createSequencer, defaultInsertionGap, documentStories, editorParagraphGroups, editorPositionAtPhysicalPosition, findStoryBody, formattingEquals, freshCommentId, idKey, inlineLeafSpans, isTextOnlyRun, mapTocBookmarkPosition, mergeRunContent, normalizeForOps, noteUsesCustomMark, packageParagraphIds, packageResourcesOpOf, paragraphLength, paragraphLogicalText, paragraphVisibleText, parseDocumentBatch, physicalOffsetAtVisibleOffset, physicalPositionAtEditorOffset, planTrackedDeletion, planTrackedReplace, registerParagraphPropertySnapshot, revisionIdDemand, runsMergeable, sameStory, sectionPropertiesAt, storyBody, toOpEnvelope, transformBatch, validateDocumentBatch, validateOpsDocument, validateSequencedBatch, withBodyContent, zeroWidthLeavesAt };
@@ -1,4 +1,4 @@
1
- import { D as PARAGRAPH_ALIGNMENTS, Q as isNumberingReference, Y as isNumberingLevel, nt as paragraphNumberingReference, o as INSERTION_SEAM_POLICIES, s as MAX_REVISION_ID, t as COMMENT_PART_RELATIONSHIPS } from "../document-CQ0oovh0.js";
1
+ import { D as PARAGRAPH_ALIGNMENTS, Q as isNumberingReference, Y as isNumberingLevel, dt as getSingularRunPropertyChange, nt as paragraphNumberingReference, o as INSERTION_SEAM_POLICIES, s as MAX_REVISION_ID, t as COMMENT_PART_RELATIONSHIPS } from "../document-C02Ulybe.js";
2
2
  import { a as hasIllegalXmlCharacters, t as sanitizeExternalUrl } from "../href-2XSCK-T8.js";
3
3
  import { Result, TaggedError, panic } from "better-result";
4
4
  //#region src/ops/equality.ts
@@ -3842,7 +3842,7 @@ const bindRetainedIdentities = (before, after) => {
3842
3842
  return Object.assign({}, node, { resolutionJoins: Object.assign({}, joins, { retainedAfter: bound }) });
3843
3843
  });
3844
3844
  };
3845
- const bindCutRetainedIdentities = ({ before, after }) => {
3845
+ const rebindRetainedIdentities = ({ before, after }) => {
3846
3846
  const groups = /* @__PURE__ */ new Map();
3847
3847
  const collect = ({ oldNodes, freshNodes }) => {
3848
3848
  for (const [index, old] of oldNodes.entries()) {
@@ -4097,7 +4097,7 @@ const freshenIdentities = ({ before, after, newIds, usedElsewhere, inserted = /*
4097
4097
  kind: "fresh",
4098
4098
  paragraphs: bindDeferredIdentities({
4099
4099
  before: after,
4100
- after: bindCutRetainedIdentities({
4100
+ after: rebindRetainedIdentities({
4101
4101
  before: after,
4102
4102
  after: paragraphs
4103
4103
  })
@@ -5754,6 +5754,37 @@ const foldAtSeam = (left, right, emptied) => {
5754
5754
  ...rightChildren.slice(1)
5755
5755
  ])];
5756
5756
  };
5757
+ const deferRunReviewSeam = ({ left, right, depth }) => {
5758
+ if (depth === 0) return [left, right];
5759
+ if (left.type !== "run" || right.type !== "run") {
5760
+ const leftChildren = childNodes(left);
5761
+ const rightChildren = childNodes(right);
5762
+ const last = leftChildren?.at(-1);
5763
+ const first = rightChildren?.at(0);
5764
+ if (leftChildren === void 0 || rightChildren === void 0 || last === void 0 || first === void 0 || !sameOwnFields(left, right)) return [left, right];
5765
+ const deferred = deferRunReviewSeam({
5766
+ left: last,
5767
+ right: first,
5768
+ depth: depth - 1
5769
+ });
5770
+ const deferredLeft = deferred.at(0) ?? panic("A deferred seam retains its left node.");
5771
+ const deferredRight = deferred.at(1) ?? panic("A deferred seam retains its right node.");
5772
+ return [deferredLeft === last ? left : rebuildNode(left, [...leftChildren.slice(0, -1), deferredLeft]), deferredRight === first ? right : rebuildNode(right, [deferredRight, ...rightChildren.slice(1)])];
5773
+ }
5774
+ if (sameOwnFields(left, right)) return [left, right];
5775
+ const retain = (run, side) => {
5776
+ const change = getSingularRunPropertyChange(run.propertyChanges);
5777
+ if (change === void 0 || change.boundaryJoins === void 0 || change.boundaryJoins.includes(side)) return run;
5778
+ return {
5779
+ ...run,
5780
+ propertyChanges: [{
5781
+ ...change,
5782
+ boundaryJoins: [...change.boundaryJoins, side]
5783
+ }]
5784
+ };
5785
+ };
5786
+ return [retain(left, "after"), retain(right, "before")];
5787
+ };
5757
5788
  /**
5758
5789
  * Two records meeting where a change was resolved, merged as far as they are
5759
5790
  * alike. A piece of a cut container that resolution emptied (one `emptied`
@@ -5769,7 +5800,11 @@ const mergeAtSeam = (left, right, emptied = NOTHING_EMPTIED) => {
5769
5800
  return leftChildren === void 0 || rightChildren === void 0 ? mergeAlike([left], [right]) : [rebuildNode(left, mergedAtSeam(leftChildren, rightChildren, emptied))];
5770
5801
  }
5771
5802
  const folded = foldedPiece(left, right, emptied);
5772
- return folded === void 0 ? [left, right] : [folded];
5803
+ return folded === void 0 ? deferRunReviewSeam({
5804
+ left,
5805
+ right,
5806
+ depth: Number.POSITIVE_INFINITY
5807
+ }) : [folded];
5773
5808
  };
5774
5809
  /** Two lists end to end, merged at the seam as {@link mergeAtSeam} merges. */
5775
5810
  const mergedAtSeam = (left, right, emptied) => {
@@ -6087,7 +6122,17 @@ const resolveList = (nodes, resolution) => {
6087
6122
  else if (exactDepth === void 0) met = foldAtSeam(left, right, resolution.emptied);
6088
6123
  else {
6089
6124
  const folded = foldAtSeam(left, right, resolution.emptied);
6090
- met = folded.length === 1 ? folded : mergeLists([left], [right], exactDepth, { mode: "asFarAsAlike" }) ?? panic("An as-far-as-alike merge always returns its records.");
6125
+ if (folded.length === 1) met = folded;
6126
+ else {
6127
+ const deferred = deferRunReviewSeam({
6128
+ left,
6129
+ right,
6130
+ depth: exactDepth
6131
+ });
6132
+ const deferredLeft = deferred.at(0) ?? panic("A recorded seam retains its left node.");
6133
+ const deferredRight = deferred.at(1) ?? panic("A recorded seam retains its right node.");
6134
+ met = mergeLists([deferredLeft], [deferredRight], exactDepth, { mode: "asFarAsAlike" }) ?? panic("An as-far-as-alike merge always returns its records.");
6135
+ }
6091
6136
  }
6092
6137
  if (met.length === 1) {
6093
6138
  const merged = met.at(0) ?? panic("A single merged record exists.");
@@ -9374,9 +9419,11 @@ const setRunProps = (document, op) => {
9374
9419
  const changes = /* @__PURE__ */ new Map();
9375
9420
  const recordChange = (options) => {
9376
9421
  const { patched: patchedRun, previous } = options;
9377
- if ((previous.propertyChanges?.length ?? 0) > 0 && op.propertyReview !== PROPERTY_REVIEW_POLICIES.APPEND) return patchedRun;
9378
- changes.set(patchedRun, options);
9379
- return patchedRun;
9422
+ if (getSingularRunPropertyChange(previous.propertyChanges) !== void 0 && op.propertyReview !== PROPERTY_REVIEW_POLICIES.APPEND) return patchedRun;
9423
+ const next = Object.assign({}, patchedRun);
9424
+ delete next.propertyChanges;
9425
+ changes.set(next, options);
9426
+ return next;
9380
9427
  };
9381
9428
  const tracked = patchRunsBetween(paragraph.content, from, to, op.patch, op.whenEmpty, recordChange);
9382
9429
  if (tracked === void 0) return unchanged(document);
@@ -9388,6 +9435,7 @@ const setRunProps = (document, op) => {
9388
9435
  newIds: op.newIds
9389
9436
  });
9390
9437
  if (freshened.isErr()) return Result.err(freshened.error);
9438
+ const priorIdentities = /* @__PURE__ */ new WeakMap();
9391
9439
  const appendChanges = (source, fresh) => {
9392
9440
  if (source.length !== fresh.length) panic("Freshening changed the run patch's structure.");
9393
9441
  return fresh.map((node, index) => {
@@ -9401,9 +9449,16 @@ const setRunProps = (document, op) => {
9401
9449
  info: stampInfo(revision),
9402
9450
  boundaryJoins: options.boundaryJoins
9403
9451
  };
9404
- if (options.previous.formatting !== void 0) change.previousFormatting = options.previous.formatting;
9452
+ const pending = getSingularRunPropertyChange(options.previous.propertyChanges);
9453
+ const previousFormatting = pending === void 0 ? options.previous.formatting : pending.previousFormatting;
9454
+ if (previousFormatting !== void 0) change.previousFormatting = previousFormatting;
9455
+ if (pending !== void 0) if (pending.boundaryJoins === void 0 || change.boundaryJoins === void 0) delete change.boundaryJoins;
9456
+ else change.boundaryJoins = [.../* @__PURE__ */ new Set([...pending.boundaryJoins, ...change.boundaryJoins])];
9405
9457
  const changed = Object.assign({}, node);
9406
- changed.propertyChanges = (node.propertyChanges ?? []).concat(change);
9458
+ changed.propertyChanges = [change];
9459
+ const prior = Object.assign({}, node);
9460
+ if (options.previous.propertyChanges !== void 0) prior.propertyChanges = options.previous.propertyChanges;
9461
+ priorIdentities.set(changed, prior);
9407
9462
  return changed;
9408
9463
  }
9409
9464
  const children = childNodes(node);
@@ -9417,12 +9472,21 @@ const setRunProps = (document, op) => {
9417
9472
  const sourceFresh = freshened.value.at(0);
9418
9473
  if (sourceFresh === void 0) panic("Freshening removed the run patch's paragraph.");
9419
9474
  const content = asParagraphContent(appendChanges(tracked.content, sourceFresh.content));
9475
+ const restorePriorIdentities = (nodes) => nodes.map((node) => {
9476
+ const prior = priorIdentities.get(node) ?? node;
9477
+ const children = childNodes(prior);
9478
+ return children === void 0 ? prior : rebuildNode(prior, restorePriorIdentities(children));
9479
+ });
9480
+ const rebound = rebindRetainedIdentities({
9481
+ before: [withContent(paragraph, asParagraphContent(restorePriorIdentities(content)))],
9482
+ after: [withContent(paragraph, content)]
9483
+ }).at(0) ?? panic("A run patch preserves its paragraph during identity rebinding.");
9420
9484
  return editOne({
9421
9485
  document,
9422
9486
  op,
9423
9487
  story,
9424
9488
  at: location,
9425
- paragraph: withContent(paragraph, content),
9489
+ paragraph: rebound,
9426
9490
  newIds: op.newIds
9427
9491
  }, (result) => Result.ok([contentRestoring(story, result, paragraph)]));
9428
9492
  }
@@ -11758,6 +11822,17 @@ const physicalOffsetAtVisibleOffset = (paragraph, offset) => {
11758
11822
  }
11759
11823
  return offset === visible ? paragraphLength(paragraph) : paragraphLength(paragraph) + 1;
11760
11824
  };
11825
+ /** The visible offset corresponding to a physical source position. */
11826
+ const visibleOffsetAtPhysicalOffset = (paragraph, offset) => {
11827
+ if (!Number.isInteger(offset) || offset < 0 || offset > paragraphLength(paragraph)) return -1;
11828
+ let visible = 0;
11829
+ for (const span of leafSpans(paragraph.content)) {
11830
+ if (span.before.offset >= offset) break;
11831
+ if (span.ancestors.some(isRemovedRevisionNode)) continue;
11832
+ visible += Math.min(offset, span.after.offset) - span.before.offset;
11833
+ }
11834
+ return visible;
11835
+ };
11761
11836
  /** Deleted paragraph marks concatenate physical paragraphs in the editing view. */
11762
11837
  const editorParagraphGroups = (document, story) => {
11763
11838
  const groups = [];
@@ -11790,6 +11865,46 @@ const editorParagraphGroups = (document, story) => {
11790
11865
  });
11791
11866
  return groups;
11792
11867
  };
11868
+ /** One logical paragraph and visible offset for a physical canonical address. */
11869
+ const editorPositionAtPhysicalPosition = (document, at) => {
11870
+ const group = editorParagraphGroups(document, at.story).find(({ paragraphs }) => paragraphs.some(({ paraId }) => idKey(paraId ?? "") === idKey(at.blockId)));
11871
+ if (group === void 0) return at;
11872
+ let offset = 0;
11873
+ for (const paragraph of group.paragraphs) {
11874
+ if (idKey(paragraph.paraId ?? "") === idKey(at.blockId)) {
11875
+ const local = visibleOffsetAtPhysicalOffset(paragraph, at.offset);
11876
+ return {
11877
+ story: at.story,
11878
+ blockId: group.blockId,
11879
+ offset: local < 0 ? -1 : offset + local
11880
+ };
11881
+ }
11882
+ offset += paragraphVisibleText(paragraph).length;
11883
+ }
11884
+ return panic("A logical paragraph lost its source position");
11885
+ };
11886
+ /** Translate an editing-view paragraph gap to its physical canonical address. */
11887
+ const physicalPositionAtEditorOffset = (document, at) => {
11888
+ const group = editorParagraphGroups(document, at.story).find(({ blockId }) => idKey(blockId) === idKey(at.blockId));
11889
+ if (group === void 0) return at;
11890
+ let remaining = at.offset;
11891
+ for (const [index, paragraph] of group.paragraphs.entries()) {
11892
+ const width = paragraphVisibleText(paragraph).length;
11893
+ if (remaining < width || index === group.paragraphs.length - 1) return {
11894
+ story: at.story,
11895
+ blockId: paragraph.paraId ?? "",
11896
+ offset: physicalOffsetAtVisibleOffset(paragraph, remaining)
11897
+ };
11898
+ remaining -= width;
11899
+ }
11900
+ return at;
11901
+ };
11902
+ const replacementCaret = (at, text) => ({
11903
+ story: at.story,
11904
+ blockId: at.blockId,
11905
+ offset: at.offset + text.length,
11906
+ ...text.length === 0 && at.zeroWidthBefore !== void 0 ? { zeroWidthBefore: at.zeroWidthBefore } : {}
11907
+ });
11793
11908
  const paragraphAt = (document, at) => storyParagraphs(storyBody(document, at.story)).find(({ paragraph }) => idKey(paragraph.paraId ?? "") === idKey(at.blockId))?.paragraph;
11794
11909
  /** Zero-width markers and empty leaves never supply the formatting of typed content. */
11795
11910
  const visibleFormattingSpans = (paragraph) => leafSpans(paragraph.content).filter(({ ancestors, before, after }) => after.offset > before.offset && !ancestors.some(isRemovedRevisionNode));
@@ -11812,9 +11927,27 @@ const intentRunFormatting = (document, { from, to, runProps, runPropsPatch }) =>
11812
11927
  const authored = runProps ?? authoredFormatting(document, from, to);
11813
11928
  return runPropsPatch === void 0 ? authored : applyFormattingPatch(authored, runPropsPatch) ?? {};
11814
11929
  };
11930
+ /** The ending physical mark owns one logical paragraph's properties. */
11931
+ const createParagraphMarkOwnerLookup = (document) => {
11932
+ const stories = /* @__PURE__ */ new Map();
11933
+ return (at) => {
11934
+ const key = JSON.stringify(at.story);
11935
+ let owners = stories.get(key);
11936
+ if (owners === void 0) {
11937
+ owners = /* @__PURE__ */ new Map();
11938
+ for (const { paragraphs } of editorParagraphGroups(document, at.story)) {
11939
+ const owner = paragraphs.at(-1);
11940
+ if (owner === void 0) panic("A logical paragraph has no property owner");
11941
+ for (const paragraph of paragraphs) owners.set(idKey(paragraph.paraId ?? ""), owner);
11942
+ }
11943
+ stories.set(key, owners);
11944
+ }
11945
+ return owners.get(idKey(at.blockId));
11946
+ };
11947
+ };
11815
11948
  /** A new logical paragraph inherits the surviving paragraph mark's formatting. */
11816
11949
  const splitParagraphFields = (document, at) => {
11817
- const survivor = editorParagraphGroups(document, at.story).find(({ paragraphs }) => paragraphs.some(({ paraId }) => idKey(paraId ?? "") === idKey(at.blockId)))?.paragraphs.at(-1);
11950
+ const survivor = createParagraphMarkOwnerLookup(document)(at);
11818
11951
  return survivor?.formatting === void 0 ? {} : { formatting: survivor.formatting };
11819
11952
  };
11820
11953
  /** A compound intent consumes one identity pool across its sequential plans. */
@@ -12564,7 +12697,16 @@ const compileEditorIntent = (document, { intent, mode, firstBlockId }) => {
12564
12697
  num: intent.target.num,
12565
12698
  ...intent.target.abstractNum === void 0 ? {} : { abstractNum: intent.target.abstractNum }
12566
12699
  }] : [];
12567
- const paragraphOps = intent.items.map(({ at, ilvl }) => ({
12700
+ const itemsByMark = /* @__PURE__ */ new Map();
12701
+ const paragraphMarkOwner = createParagraphMarkOwnerLookup(document);
12702
+ for (const { at, ilvl } of intent.items) {
12703
+ const blockId = paragraphMarkOwner(at)?.paraId ?? at.blockId;
12704
+ itemsByMark.set(`${JSON.stringify(at.story)}:${idKey(blockId)}`, {
12705
+ at: Object.assign({}, at, { blockId }),
12706
+ ilvl
12707
+ });
12708
+ }
12709
+ const paragraphOps = Array.from(itemsByMark.values(), ({ at, ilvl }) => ({
12568
12710
  type: DOCUMENT_OP_TYPES.SET_PARAGRAPH_PROPS,
12569
12711
  story: at.story,
12570
12712
  blockId: at.blockId,
@@ -12597,7 +12739,7 @@ const compileEditorIntent = (document, { intent, mode, firstBlockId }) => {
12597
12739
  ops = [{
12598
12740
  type: DOCUMENT_OP_TYPES.SET_PARAGRAPH_PROPS,
12599
12741
  story: intent.at.story,
12600
- blockId: intent.at.blockId,
12742
+ blockId: createParagraphMarkOwnerLookup(document)(intent.at)?.paraId ?? intent.at.blockId,
12601
12743
  patch: intent.patch,
12602
12744
  ...mode.type === "suggesting" ? { propertyReview: PROPERTY_REVIEW_POLICIES.APPEND } : {},
12603
12745
  ...mode.type === "suggesting" ? { revision: mode.revision } : {}
@@ -12764,11 +12906,7 @@ const compileEditorIntent = (document, { intent, mode, firstBlockId }) => {
12764
12906
  ...selection,
12765
12907
  blockId: op.nextBlockId
12766
12908
  };
12767
- if (op.type === DOCUMENT_OP_TYPES.INSERT_CONTENT) selection = {
12768
- ...op.at,
12769
- offset: op.at.offset + text.length,
12770
- ...text.length > 0 && op.at.zeroWidthBefore !== void 0 ? { zeroWidthBefore: 0 } : {}
12771
- };
12909
+ if (op.type === DOCUMENT_OP_TYPES.INSERT_CONTENT) selection = replacementCaret(op.at, text);
12772
12910
  }
12773
12911
  break;
12774
12912
  }
@@ -12846,11 +12984,7 @@ const compileEditorIntent = (document, { intent, mode, firstBlockId }) => {
12846
12984
  },
12847
12985
  ...allocationFields
12848
12986
  });
12849
- selection = {
12850
- ...at,
12851
- offset: from.offset + text.length,
12852
- ...text.length > 0 && at.zeroWidthBefore !== void 0 ? { zeroWidthBefore: 0 } : {}
12853
- };
12987
+ selection = replacementCaret(at, text);
12854
12988
  break;
12855
12989
  }
12856
12990
  case "splitParagraph": {
@@ -14330,4 +14464,4 @@ const createClient = (document) => {
14330
14464
  };
14331
14465
  };
14332
14466
  //#endregion
14333
- export { BATCH_REJECTION_REASONS, BATCH_WIRE_OP_TYPES, BatchRejection, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, DocumentOpRefusal, DocumentOpsContractError, EMPTY_PROPERTY_SETS, INHERIT_RUN_PROPS, MAX_BATCH_WIRE_BYTES, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, PARAGRAPH_MARK_FORMATTING_KEYS, PROPERTY_REVIEW_POLICIES, REVISION_DECISIONS, SPLIT_HALVES, allocateCommentAnchorIds, applyDocumentOp, applyDocumentOpEnvelope, applyDocumentOps, captureDocumentOp, combineEdits, commentDocumentIssue, compareGaps, compileEditorIntent, createClient, createEditorIntentIdAllocator, createSequencer, defaultInsertionGap, documentStories, editorParagraphGroups, findStoryBody, formattingEquals, freshCommentId, idKey, inlineLeafSpans, isTextOnlyRun, mapTocBookmarkPosition, mergeRunContent, normalizeForOps, noteUsesCustomMark, packageParagraphIds, packageResourcesOpOf, paragraphLength, paragraphLogicalText, paragraphVisibleText, parseDocumentBatch, physicalOffsetAtVisibleOffset, planTrackedDeletion, planTrackedReplace, registerParagraphPropertySnapshot, revisionIdDemand, runsMergeable, sameStory, sectionPropertiesAt, storyBody, toOpEnvelope, transformBatch, validateDocumentBatch, validateOpsDocument, validateSequencedBatch, withBodyContent, zeroWidthLeavesAt };
14467
+ export { BATCH_REJECTION_REASONS, BATCH_WIRE_OP_TYPES, BatchRejection, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, DocumentOpRefusal, DocumentOpsContractError, EMPTY_PROPERTY_SETS, INHERIT_RUN_PROPS, MAX_BATCH_WIRE_BYTES, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, PARAGRAPH_MARK_FORMATTING_KEYS, PROPERTY_REVIEW_POLICIES, REVISION_DECISIONS, SPLIT_HALVES, allocateCommentAnchorIds, applyDocumentOp, applyDocumentOpEnvelope, applyDocumentOps, captureDocumentOp, combineEdits, commentDocumentIssue, compareGaps, compileEditorIntent, createClient, createEditorIntentIdAllocator, createSequencer, defaultInsertionGap, documentStories, editorParagraphGroups, editorPositionAtPhysicalPosition, findStoryBody, formattingEquals, freshCommentId, idKey, inlineLeafSpans, isTextOnlyRun, mapTocBookmarkPosition, mergeRunContent, normalizeForOps, noteUsesCustomMark, packageParagraphIds, packageResourcesOpOf, paragraphLength, paragraphLogicalText, paragraphVisibleText, parseDocumentBatch, physicalOffsetAtVisibleOffset, physicalPositionAtEditorOffset, planTrackedDeletion, planTrackedReplace, registerParagraphPropertySnapshot, revisionIdDemand, runsMergeable, sameStory, sectionPropertiesAt, storyBody, toOpEnvelope, transformBatch, validateDocumentBatch, validateOpsDocument, validateSequencedBatch, withBodyContent, zeroWidthLeavesAt };
@@ -135,36 +135,36 @@ function __wbg_get_imports() {
135
135
  __proto__: null,
136
136
  "./docx_kernel_bg.js": {
137
137
  __proto__: null,
138
- __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
138
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
139
139
  throw new Error(getStringFromWasm0(arg0, arg1));
140
140
  },
141
- __wbg_new_32b398fb48b6d94a: function() {
142
- return addHeapObject(new Array());
143
- },
144
- __wbg_new_b667d279fd5aa943: function(arg0, arg1) {
141
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
145
142
  return addHeapObject(new Error(getStringFromWasm0(arg0, arg1)));
146
143
  },
147
- __wbg_new_da52cf8fe3429cb2: function() {
144
+ __wbg_new_617a8cdb8bb1130e: function() {
148
145
  return addHeapObject(/* @__PURE__ */ new Object());
149
146
  },
150
- __wbg_new_with_length_f8cbc3a5b9ff9368: function(arg0) {
147
+ __wbg_new_ee2291f50781bf1d: function() {
148
+ return addHeapObject(new Array());
149
+ },
150
+ __wbg_new_with_length_469fcc27bd71672e: function(arg0) {
151
151
  return addHeapObject(new Array(arg0 >>> 0));
152
152
  },
153
- __wbg_push_d2ae3af0c1217ae6: function(arg0, arg1) {
153
+ __wbg_push_2baf45db356cf468: function(arg0, arg1) {
154
154
  return getObject(arg0).push(getObject(arg1));
155
155
  },
156
- __wbg_set_8535240470bf2500: function() {
156
+ __wbg_set_145a351398b48c65: function() {
157
157
  return handleError(function(arg0, arg1, arg2) {
158
158
  return Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
159
159
  }, arguments);
160
160
  },
161
- __wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
161
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
162
162
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
163
163
  },
164
- __wbindgen_cast_0000000000000001: function(arg0) {
164
+ __wbindgen_generic_0000000000000001: function(arg0) {
165
165
  return addHeapObject(arg0);
166
166
  },
167
- __wbindgen_cast_0000000000000002: function(arg0, arg1) {
167
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
168
168
  return addHeapObject(getStringFromWasm0(arg0, arg1));
169
169
  },
170
170
  __wbindgen_object_drop_ref: function(arg0) {
@@ -251,10 +251,11 @@ function __wbg_finalize_init(instance, module) {
251
251
  }
252
252
  async function __wbg_load(module, imports) {
253
253
  if (typeof Response === "function" && module instanceof Response) {
254
+ if (!module.ok) throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
254
255
  if (typeof WebAssembly.instantiateStreaming === "function") try {
255
256
  return await WebAssembly.instantiateStreaming(module, imports);
256
257
  } catch (e) {
257
- if (module.ok && expectedResponseType(module.type) && module.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
258
+ if (expectedResponseType(module.type) && module.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
258
259
  else throw e;
259
260
  }
260
261
  const bytes = await module.arrayBuffer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/docx-core",
3
- "version": "0.36.2",
3
+ "version": "0.37.0",
4
4
  "description": "Typed OOXML/DOCX model, validation, serialization, legal-source compilation, and browser-native package projection.",
5
5
  "keywords": [
6
6
  "document-model",
@@ -65,7 +65,7 @@
65
65
  "build": "rm -rf dist && tsdown",
66
66
  "pack:dry-run": "bun pm pack --dry-run",
67
67
  "test": "bun test src",
68
- "typecheck": "bun ../../scripts/tsc-native.ts --noEmit -p tsconfig.build.json",
68
+ "typecheck": "bun check --no-pretty --all --project=tsconfig.build.json",
69
69
  "wasm:check": "bun ../../scripts/build-docx-kernel-wasm.ts --check",
70
70
  "wasm:generate": "bun ../../scripts/build-docx-kernel-wasm.ts --write",
71
71
  "format": "oxfmt .",