@stll/docx-core 0.42.0 → 0.43.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.
- package/dist/{document-NtScxyHH.js → document-CEMwM5On.js} +44 -2
- package/dist/{document-BWDHON3T.d.ts → document-Ca6wPoTu.d.ts} +79 -5
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -6
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -1
- package/dist/ops/documentOps.d.ts +105 -7
- package/dist/ops/documentOps.js +1370 -209
- package/package.json +1 -1
|
@@ -9,6 +9,47 @@ const getSingularRunPropertyChange = (propertyChanges) => {
|
|
|
9
9
|
});
|
|
10
10
|
return propertyChanges?.at(0);
|
|
11
11
|
};
|
|
12
|
+
// src/model/contentControlLock.ts
|
|
13
|
+
/** Whether `lock` forbids changing what the control holds. */
|
|
14
|
+
const locksContent = (lock) => lock === "contentLocked" || lock === "sdtContentLocked";
|
|
15
|
+
/** Whether `lock` forbids removing the control. */
|
|
16
|
+
const locksControl = (lock) => lock === "sdtLocked" || lock === "sdtContentLocked";
|
|
17
|
+
/**
|
|
18
|
+
* Whether `lock` allows `change`: the one decision every editing path makes.
|
|
19
|
+
* No lock, and `unlocked`, allow both.
|
|
20
|
+
*/
|
|
21
|
+
const contentControlLockAllows = (lock, change) => {
|
|
22
|
+
switch (change) {
|
|
23
|
+
case "editContent": return !locksContent(lock);
|
|
24
|
+
case "removeControl": return !locksControl(lock);
|
|
25
|
+
default: throw new TypeError(`Unhandled content control change ${String(change)}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/** The skip or refusal reason every editing path reports for a lock. */
|
|
29
|
+
const CONTENT_CONTROL_LOCK = "contentControlLock";
|
|
30
|
+
/** What `control`'s lock says about `touch`: `null` when it allows it. */
|
|
31
|
+
const lockedControlViolation = (control, touch) => {
|
|
32
|
+
const { lock } = control;
|
|
33
|
+
const removes = touch.effect === "remove" && touch.from <= control.from && touch.to >= control.to;
|
|
34
|
+
const reachesContent = touch.from === touch.to ? touch.from >= control.contentFrom && touch.from <= control.contentTo : touch.from < control.contentTo && touch.to > control.contentFrom;
|
|
35
|
+
let change = null;
|
|
36
|
+
if (removes) change = "removeControl";
|
|
37
|
+
else if (reachesContent) change = "editContent";
|
|
38
|
+
return change === null || contentControlLockAllows(lock, change) ? null : {
|
|
39
|
+
lock,
|
|
40
|
+
change
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** The first violation any of `controls` reports for any of `touches`. */
|
|
44
|
+
const firstLockedControlViolation = (controls, touches) => {
|
|
45
|
+
for (const control of controls) for (const touch of touches) {
|
|
46
|
+
const violation = lockedControlViolation(control, touch);
|
|
47
|
+
if (violation !== null) return violation;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
/** A sentence naming what the lock refused. */
|
|
52
|
+
const lockedControlMessage = ({ lock, change }) => change === "editContent" ? `the change reaches inside a content control whose w:lock is ${lock}.` : `the change removes a content control whose w:lock is ${lock}.`;
|
|
12
53
|
// src/model/canonical.ts
|
|
13
54
|
/** Set modeled comments while keeping an empty comments part out of the document model. */
|
|
14
55
|
const setDocumentBodyComments = (body, comments) => {
|
|
@@ -107,7 +148,8 @@ const PARSE_WARNING_CODES = {
|
|
|
107
148
|
/** A block-level tracked-change wrapper Folio preserves without interpreting. */
|
|
108
149
|
revisionCarrierOpaque: "revision-carrier-opaque",
|
|
109
150
|
/** A row nested where the table model can only preserve it as opaque markup. */
|
|
110
|
-
nestedRowOpaque: "nested-row-opaque"
|
|
151
|
+
nestedRowOpaque: "nested-row-opaque",
|
|
152
|
+
reviewProvenanceDropped: "review-provenance-dropped"
|
|
111
153
|
};
|
|
112
154
|
const IMPORTED_ID_COLLISION_KINDS = {
|
|
113
155
|
bookmark: "bookmark",
|
|
@@ -1385,4 +1427,4 @@ const COMMENT_PART_RELATIONSHIPS = {
|
|
|
1385
1427
|
target: "commentsExtended.xml"
|
|
1386
1428
|
}
|
|
1387
1429
|
};
|
|
1388
|
-
export { outlineLevelStatedValue as $, BORDER_STYLES as A, isSchemeColorValue as B, PRESET_LINE_DASH_VALS as C, isBorderNone as D, isBorderNil as E, TEXT_DIRECTIONS as F, themeColorToken as G, knownThemeColor as H, TEXT_DIRECTION_FLOWS as I, relationshipIdOf as J, THEME_COLORS as K, TEXT_DIRECTION_FLOW_BY_TOKEN as L, PARAGRAPH_ALIGNMENTS as M, TABLE_ALIGNMENTS as N, isBorderStyle as O, TAB_STOP_ALIGNMENTS as P, outlineLevelFromStatedValue as Q, SCHEME_COLOR_VALUE_BY_THEME_COLOR as R, presetLineDashToken as S, borderStyleToken as T, readThemeColor as U, isThemeColor as V, themeColorSlot as W, headingLevelOf as X, BODY_TEXT_OUTLINE_LEVEL as Y, headingOutlineLevel as Z, numberingLevelHasMarkerSlot as _, isCanonicallyEmptyParagraphFormatting as _t, DRAWING_RAW_XML_MODES as a, paragraphNumberingFromSlots as at, isPresetLineDashVal as b, PARAGRAPH_MARK_CHANGE_KINDS as c, paragraphNumberingReferenceId as ct, isNoteReferenceId as d, sameEffectiveParagraphNumbering as dt, isNumberingLevel as et, isOoxmlSymbolCharacter as f, sameStatedParagraphNumbering as ft, numberingLevelEntries as g, finalizeParagraphFormatting as gt, numberingInstanceResolves as h, PARSE_WARNING_CODES as ht, BIDI_CONTROLS as i, mergeParagraphNumbering as it, NUMBER_FORMATS as j, statesNoBorder as k, PROPERTY_REVISION_KINDS as l, paragraphNumberingSlots as lt, levelShowsMarker as m, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as mt, DEFAULT_TAB_STOP_TWIPS as n, NO_PARAGRAPH_NUMBERING as nt, INSERTION_SEAM_POLICIES as o, paragraphNumberingLevel as ot, normalizeRevisionId as p, IMPORTED_ID_COLLISION_KINDS as pt, mintRelationshipId as q, DOCX_CONFORMANCE_CLASSES as r, isNumberingReference as rt, MAX_REVISION_ID as s, paragraphNumberingReference as st, COMMENT_PART_RELATIONSHIPS as t, NO_NUMBERING_NUM_ID as tt, REVIEW_CARRIERS as u, resolveParagraphNumbering as ut, resolveNumberingLevel as v, setDocumentBodyComments as vt, borderStyleFrom as w, presetLineDashFrom as x, COUNTER_FORMATS as y,
|
|
1430
|
+
export { outlineLevelStatedValue as $, BORDER_STYLES as A, isSchemeColorValue as B, PRESET_LINE_DASH_VALS as C, lockedControlViolation as Ct, isBorderNone as D, isBorderNil as E, getSingularRunPropertyChange as Et, TEXT_DIRECTIONS as F, themeColorToken as G, knownThemeColor as H, TEXT_DIRECTION_FLOWS as I, relationshipIdOf as J, THEME_COLORS as K, TEXT_DIRECTION_FLOW_BY_TOKEN as L, PARAGRAPH_ALIGNMENTS as M, TABLE_ALIGNMENTS as N, isBorderStyle as O, TAB_STOP_ALIGNMENTS as P, outlineLevelFromStatedValue as Q, SCHEME_COLOR_VALUE_BY_THEME_COLOR as R, presetLineDashToken as S, lockedControlMessage as St, borderStyleToken as T, locksControl as Tt, readThemeColor as U, isThemeColor as V, themeColorSlot as W, headingLevelOf as X, BODY_TEXT_OUTLINE_LEVEL as Y, headingOutlineLevel as Z, numberingLevelHasMarkerSlot as _, isCanonicallyEmptyParagraphFormatting as _t, DRAWING_RAW_XML_MODES as a, paragraphNumberingFromSlots as at, isPresetLineDashVal as b, contentControlLockAllows as bt, PARAGRAPH_MARK_CHANGE_KINDS as c, paragraphNumberingReferenceId as ct, isNoteReferenceId as d, sameEffectiveParagraphNumbering as dt, isNumberingLevel as et, isOoxmlSymbolCharacter as f, sameStatedParagraphNumbering as ft, numberingLevelEntries as g, finalizeParagraphFormatting as gt, numberingInstanceResolves as h, PARSE_WARNING_CODES as ht, BIDI_CONTROLS as i, mergeParagraphNumbering as it, NUMBER_FORMATS as j, statesNoBorder as k, PROPERTY_REVISION_KINDS as l, paragraphNumberingSlots as lt, levelShowsMarker as m, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as mt, DEFAULT_TAB_STOP_TWIPS as n, NO_PARAGRAPH_NUMBERING as nt, INSERTION_SEAM_POLICIES as o, paragraphNumberingLevel as ot, normalizeRevisionId as p, IMPORTED_ID_COLLISION_KINDS as pt, mintRelationshipId as q, DOCX_CONFORMANCE_CLASSES as r, isNumberingReference as rt, MAX_REVISION_ID as s, paragraphNumberingReference as st, COMMENT_PART_RELATIONSHIPS as t, NO_NUMBERING_NUM_ID as tt, REVIEW_CARRIERS as u, resolveParagraphNumbering as ut, resolveNumberingLevel as v, setDocumentBodyComments as vt, borderStyleFrom as w, locksContent as wt, presetLineDashFrom as x, firstLockedControlViolation as xt, COUNTER_FORMATS as y, CONTENT_CONTROL_LOCK as yt, THEME_COLOR_BY_SCHEME_COLOR_VALUE as z };
|
|
@@ -1708,8 +1708,12 @@ type Hyperlink = {
|
|
|
1708
1708
|
* run-level `w:customXml`, so an author may write `w:hyperlink > w:bdo`.
|
|
1709
1709
|
* That is the parse leg only: the editor carries a wrapper as a mark and the
|
|
1710
1710
|
* save leg writes the canonical order, wrapper outside the link.
|
|
1711
|
+
*
|
|
1712
|
+
* A complex field whose `begin` and `end` both sit inside the link is one
|
|
1713
|
+
* child: a table of contents links each entry's page number, a
|
|
1714
|
+
* `PAGEREF`, together with its heading text.
|
|
1711
1715
|
*/
|
|
1712
|
-
children: (Run | BookmarkStart | BookmarkEnd | CommentRangeStart | CommentRangeEnd | CommentReference | InlineWrapper | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | PreservedInline)[];
|
|
1716
|
+
children: (Run | ComplexField | BookmarkStart | BookmarkEnd | CommentRangeStart | CommentRangeEnd | CommentReference | InlineWrapper | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | PreservedInline)[];
|
|
1713
1717
|
};
|
|
1714
1718
|
/**
|
|
1715
1719
|
* Which side of a `w:customXml` element a range marker was displaced to
|
|
@@ -2279,7 +2283,7 @@ type ShapeTextBody = {
|
|
|
2279
2283
|
right?: number;
|
|
2280
2284
|
};
|
|
2281
2285
|
/** Block content inside the shape */
|
|
2282
|
-
content:
|
|
2286
|
+
content: TableCellBlock[];
|
|
2283
2287
|
};
|
|
2284
2288
|
/**
|
|
2285
2289
|
* Where a text box sits inside a DrawingML group (`wpg:wgp`; nested levels are
|
|
@@ -2373,7 +2377,7 @@ type TextBox = {
|
|
|
2373
2377
|
/** DrawingML transform applied to the text-box frame and content. */
|
|
2374
2378
|
transform?: ImageTransform;
|
|
2375
2379
|
/** Text and table content */
|
|
2376
|
-
content:
|
|
2380
|
+
content: TableCellBlock[];
|
|
2377
2381
|
/** Authored DrawingML WordArt metadata. */
|
|
2378
2382
|
wordArt?: ShapeTextBody["wordArt"];
|
|
2379
2383
|
/** Text fitting behavior */
|
|
@@ -2678,6 +2682,13 @@ type TrackedChangeInfo = {
|
|
|
2678
2682
|
attribute: string;
|
|
2679
2683
|
value: string;
|
|
2680
2684
|
};
|
|
2685
|
+
/**
|
|
2686
|
+
* The pending suggestion this revision belongs to. A suggestion is a set of
|
|
2687
|
+
* revisions proposed together and accepted or rejected together; a revision
|
|
2688
|
+
* without one is an ordinary tracked change. In memory only: no OOXML
|
|
2689
|
+
* attribute carries it.
|
|
2690
|
+
*/
|
|
2691
|
+
suggestionId?: string;
|
|
2681
2692
|
};
|
|
2682
2693
|
/**
|
|
2683
2694
|
* Generic tracked property-change wrapper metadata (w:*PrChange)
|
|
@@ -2710,6 +2721,11 @@ type TrackedResolutionJoins = {
|
|
|
2710
2721
|
after: number;
|
|
2711
2722
|
/** Exact join depth when the wrapper is removed. */
|
|
2712
2723
|
remove: number;
|
|
2724
|
+
/**
|
|
2725
|
+
* Sides where the wrapper now meets accepted new content rather than a
|
|
2726
|
+
* source piece: resolving it joins plain runs there and nothing else.
|
|
2727
|
+
*/
|
|
2728
|
+
plainSides?: readonly ("before" | "after")[];
|
|
2713
2729
|
/** A split seam survives only while all intervening insertions await rejection. */
|
|
2714
2730
|
deferredRemove?: readonly {
|
|
2715
2731
|
depth: number;
|
|
@@ -3257,6 +3273,14 @@ type ParagraphMarkChange = {
|
|
|
3257
3273
|
info: TrackedChangeInfo;
|
|
3258
3274
|
/** Exact source-cut depth for rejection; absent in ordinary imported revisions. */
|
|
3259
3275
|
resolutionJoin?: number | undefined;
|
|
3276
|
+
/**
|
|
3277
|
+
* Which paragraph rejecting this inserted mark keeps: `"first"` when the
|
|
3278
|
+
* paragraph after it took over the mark this one had, so this one is the
|
|
3279
|
+
* paragraph that was there before. Saved as folio's own ignorable review
|
|
3280
|
+
* provenance, so rejecting it after a reopen keeps the same paragraph; a
|
|
3281
|
+
* reader that does not know it joins as any rejected mark does.
|
|
3282
|
+
*/
|
|
3283
|
+
survivor?: "first" | undefined;
|
|
3260
3284
|
};
|
|
3261
3285
|
declare const REVIEW_CARRIERS: {
|
|
3262
3286
|
readonly TERMINAL_TABLE: "terminal-table";
|
|
@@ -3680,7 +3704,7 @@ type PreservedBlock = {
|
|
|
3680
3704
|
* the paragraph-level half unpaired, and an unpaired boundary is deleted: the
|
|
3681
3705
|
* bookmark would not merely move, it would go.
|
|
3682
3706
|
*/
|
|
3683
|
-
type BlockContent = Paragraph | Table | BlockSdt | BlockCustomXml | PreservedBlock | BookmarkStart | BookmarkEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd;
|
|
3707
|
+
type BlockContent = Paragraph | Table | BlockSdt | BlockCustomXml | PreservedBlock | BookmarkStart | BookmarkEnd | CommentRangeStart | CommentRangeEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd;
|
|
3684
3708
|
/** A block that can occur inside a table cell. */
|
|
3685
3709
|
type TableCellBlock = BlockContent;
|
|
3686
3710
|
/**
|
|
@@ -3737,6 +3761,55 @@ type DocumentBody = {
|
|
|
3737
3761
|
};
|
|
3738
3762
|
/** A run-property container has one pending formatting revision. */
|
|
3739
3763
|
declare const getSingularRunPropertyChange: (propertyChanges: readonly RunPropertyChange[] | undefined) => RunPropertyChange | undefined;
|
|
3764
|
+
type ContentControlLock = NonNullable<SdtProperties["lock"]>;
|
|
3765
|
+
/** Whether `lock` forbids changing what the control holds. */
|
|
3766
|
+
declare const locksContent: (lock: ContentControlLock | null | undefined) => lock is "contentLocked" | "sdtContentLocked";
|
|
3767
|
+
/** Whether `lock` forbids removing the control. */
|
|
3768
|
+
declare const locksControl: (lock: ContentControlLock | null | undefined) => lock is "sdtLocked" | "sdtContentLocked";
|
|
3769
|
+
/** What a change does to a control: changes what it holds, or removes it. */
|
|
3770
|
+
type ContentControlChange = "editContent" | "removeControl";
|
|
3771
|
+
/**
|
|
3772
|
+
* Whether `lock` allows `change`: the one decision every editing path makes.
|
|
3773
|
+
* No lock, and `unlocked`, allow both.
|
|
3774
|
+
*/
|
|
3775
|
+
declare const contentControlLockAllows: (lock: ContentControlLock | null | undefined, change: ContentControlChange) => boolean;
|
|
3776
|
+
/** A content control, on the caller's position scale. */
|
|
3777
|
+
type LockedControlSpan = {
|
|
3778
|
+
lock: ContentControlLock;
|
|
3779
|
+
/** Before the control. */
|
|
3780
|
+
from: number;
|
|
3781
|
+
/** After the control. */
|
|
3782
|
+
to: number;
|
|
3783
|
+
/** Where its content starts. */
|
|
3784
|
+
contentFrom: number;
|
|
3785
|
+
/** Where its content ends. */
|
|
3786
|
+
contentTo: number;
|
|
3787
|
+
};
|
|
3788
|
+
/**
|
|
3789
|
+
* The stretch a change touches. `remove` removes every control it wholly
|
|
3790
|
+
* covers, with its content, and changes what it partly covers; `edit`
|
|
3791
|
+
* changes the text or properties of what it reaches and keeps every control
|
|
3792
|
+
* standing (a text edit across a whole control rewrites its content). An
|
|
3793
|
+
* insertion is an `edit` whose `from` equals `to`.
|
|
3794
|
+
*/
|
|
3795
|
+
type LockedControlTouch = {
|
|
3796
|
+
from: number;
|
|
3797
|
+
to: number;
|
|
3798
|
+
effect: "remove" | "edit";
|
|
3799
|
+
};
|
|
3800
|
+
/** Why a lock refuses a change. */
|
|
3801
|
+
type LockedControlViolation = {
|
|
3802
|
+
lock: ContentControlLock;
|
|
3803
|
+
change: ContentControlChange;
|
|
3804
|
+
};
|
|
3805
|
+
/** The skip or refusal reason every editing path reports for a lock. */
|
|
3806
|
+
declare const CONTENT_CONTROL_LOCK: "contentControlLock";
|
|
3807
|
+
/** What `control`'s lock says about `touch`: `null` when it allows it. */
|
|
3808
|
+
declare const lockedControlViolation: (control: LockedControlSpan, touch: LockedControlTouch) => LockedControlViolation | null;
|
|
3809
|
+
/** The first violation any of `controls` reports for any of `touches`. */
|
|
3810
|
+
declare const firstLockedControlViolation: (controls: Iterable<LockedControlSpan>, touches: readonly LockedControlTouch[]) => LockedControlViolation | null;
|
|
3811
|
+
/** A sentence naming what the lock refused. */
|
|
3812
|
+
declare const lockedControlMessage: ({ lock, change }: LockedControlViolation) => string;
|
|
3740
3813
|
/** Set modeled comments while keeping an empty comments part out of the document model. */
|
|
3741
3814
|
declare const setDocumentBodyComments: (body: DocumentBody, comments: Comment[]) => void;
|
|
3742
3815
|
/**
|
|
@@ -3826,6 +3899,7 @@ declare const PARSE_WARNING_CODES: {
|
|
|
3826
3899
|
readonly revisionCarrierOpaque: "revision-carrier-opaque";
|
|
3827
3900
|
/** A row nested where the table model can only preserve it as opaque markup. */
|
|
3828
3901
|
readonly nestedRowOpaque: "nested-row-opaque";
|
|
3902
|
+
readonly reviewProvenanceDropped: "review-provenance-dropped";
|
|
3829
3903
|
};
|
|
3830
3904
|
declare const IMPORTED_ID_COLLISION_KINDS: {
|
|
3831
3905
|
readonly bookmark: "bookmark";
|
|
@@ -4359,4 +4433,4 @@ declare const COMMENT_PART_RELATIONSHIPS: {
|
|
|
4359
4433
|
readonly target: "commentsExtended.xml";
|
|
4360
4434
|
};
|
|
4361
4435
|
};
|
|
4362
|
-
export {
|
|
4436
|
+
export { locksContent as $, TEXT_DIRECTION_FLOWS as $i, ShapeGeometryAdjustment as $n, NumberingDefinitions as $r, ImageWrapPolygon as $t, ThemeColorScheme as A, BORDER_STYLES as Aa, mergeParagraphNumbering as Ai, PositionedBookmarkMarker as An, isOoxmlSymbolCharacter as Ar, EndnoteProperties as At, finalizeParagraphFormatting as B, HeadingOutlineLevel as Bi, RunContent as Bn, presetLineDashFrom as Br, HeaderFooterType as Bt, Relationship as C, UnrecognisedBorderStyle as Ca, NO_NUMBERING_NUM_ID as Ci, Paragraph as Cn, TrackedRunChange as Cr, DrawingAnchor as Ct, StyleDefinitions as D, isBorderNone as Da, ParagraphNumberingSlots as Di, ParagraphPropertyChange as Dn, WrapDistanceSlots as Dr, EffectExtentSlots as Dt, Style as E, isBorderNil as Ea, ParagraphNumberingReference as Ei, ParagraphMarkChangeKind as En, Watermark as Er, DrawingRawXmlMode as Et, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as F, paragraphNumberingSlots as Fi, PropertyChangeInfo as Fn, PreviewDescriptor as Fr, FooterReference as Ft, ContentControlLock as G, outlineLevelStatedValue as Gi, Section as Gn, COUNTER_FORMATS as Gr, ImageCrop as Gt, setDocumentBodyComments as H, headingLevelOf as Hi, SdtEndProperties as Hn, PRESET_LINE_DASH_VALS as Hr, Hyperlink as Ht, PARSE_WARNING_CODES as I, resolveParagraphNumbering as Ii, PropertyRevisionKind as In, PreviewShape as Ir, Footnote as It, LockedControlViolation as J, PARAGRAPH_ALIGNMENTS as Ji, SectionStart as Jn, LevelOverride as Jr, ImagePadding as Jt, LockedControlSpan as K, NUMBER_FORMATS as Ki, SectionProperties as Kn, CounterFormat as Kr, ImageDocPrLink as Kt, ParseWarning as L, sameEffectiveParagraphNumbering as Li, REVIEW_CARRIERS as Ln, PresetLineDashValue as Lr, FootnotePosition as Lt, ThemeFontScheme as M, paragraphNumberingLevel as Mi, PreservedInline as Mn, RelationshipId as Mr, FieldCharContent as Mt, IMPORTED_ID_COLLISION_KINDS as N, paragraphNumberingReference as Ni, PreservedXmlContent as Nn, mintRelationshipId as Nr, FieldType as Nt, StyleType as O, isBorderStyle as Oa, ResolvedParagraphNumbering as Oi, PictureWatermark as On, WrapDistances as Or, Endnote as Ot, ImportedIdCollisionKind as P, paragraphNumberingReferenceId as Pi, PropertyChange as Pn, relationshipIdOf as Pr, FoldedListNumber as Pt, lockedControlViolation as Q, TEXT_DIRECTIONS as Qi, ShapeFill as Qn, ListRendering as Qr, ImageWrap as Qt, ParseWarningCode as R, sameStatedParagraphNumbering as Ri, ReviewCarrier as Rn, UnrecognisedPresetLineDash as Rr, FootnoteProperties as Rt, MediaFile as S, BorderStyleValue as Sa, UnderlineStyle as Si, PageOrientation as Sn, TrackedChangeInfo as Sr, DocumentBody as St, RelationshipType as T, borderStyleToken as Ta, ParagraphNumberingOverride as Ti, ParagraphMarkChange as Tn, VerticalAlign as Tr, DrawingGroupChild as Tt, CONTENT_CONTROL_LOCK as U, headingOutlineLevel as Ui, SdtProperties as Un, PresetLineDashVal as Ur, INSERTION_SEAM_POLICIES as Ut, isCanonicallyEmptyParagraphFormatting as V, OutlineLevel as Vi, RunPropertyChange as Vn, presetLineDashToken as Vr, HeaderReference as Vt, ContentControlChange as W, outlineLevelFromStatedValue as Wi, SdtType as Wn, AbstractNumbering as Wr, Image as Wt, firstLockedControlViolation as X, TABLE_ALIGNMENTS as Xi, ShapeAlternateContent as Xn, ListLevel as Xr, ImageSize as Xt, contentControlLockAllows as Y, ParagraphAlignment as Yi, Shape as Yn, LevelSuffix as Yr, ImagePosition as Yt, lockedControlMessage as Z, TAB_STOP_ALIGNMENTS as Zi, ShapeContent as Zn, ListMarkerFormatting as Zr, ImageTransform as Zt, DocDefaults as _, themeColorToken as _a, TablePropertyExceptionFormatting as _i, NoteMarkerContent as _n, TableRowPropertyChange as _r, DRAWING_RAW_XML_MODES as _t, DocumentSettings as a, BorderSpec as aa, LineSpacingRule as ai, MAX_REVISION_ID as an, SymbolContent as ar, BlockCustomXml as at, FontInfo as b, THEME_COLORS as ba, TextEffect as bi, PARAGRAPH_MARK_CHANGE_KINDS as bn, TextContent as br, DocumentBackground as bt, NumberingLevelEntry as c, SCHEME_COLOR_VALUE_BY_THEME_COLOR as ca, TabLeader as ci, MoveBookmarkMarker as cn, TableCell as cr, BookmarkRangeMarker as ct, numberingInstanceResolves as d, UnrecognisedThemeColor as da, TableCellBorders as di, MoveFromRangeStart as dn, TableContentCarrier as dr, Column as dt, TEXT_DIRECTION_FLOW_BY_TOKEN as ea, NumberingInstance as ei, InlineSdt as en, ShapeOutline as er, locksControl as et, numberingLevelEntries as f, isSchemeColorValue as fa, TableCellFormatting as fi, MoveTo as fn, TableCustomXmlWrapper as fr, Comment as ft, ExhaustiveFields as g, themeColorSlot as ga, TableMeasurement as gi, NonVisualDrawingNames as gn, TableRow as gr, ComplexField as gt, isNumberingLevel as h, readThemeColor as ha, TableLook as hi, NoBreakHyphenContent as hn, TablePropertyExceptionChange as hr, CommentReference as ht, Document as i, TextDirectionFlow as ia, FloatingTableProperties as ii, LineNumberRestart as in, SoftHyphenContent as ir, BlockContent as it, ThemeFont as j, BorderStyle as ja, paragraphNumberingFromSlots as ji, PreservedBlock as jn, normalizeRevisionId as jr, Field as jt, Theme as k, statesNoBorder as ka, isNumberingReference as ki, PositionalTab as kn, WrapPolygonPoint as kr, EndnotePosition as kt, NumberingLevelResolution as l, THEME_COLOR_BY_SCHEME_COLOR_VALUE as la, TabStop as li, MoveFrom as ln, TableCellBlock as lr, BookmarkStart as lt, resolveNumberingLevel as m, knownThemeColor as ma, TableGridChange as mi, MoveToRangeStart as mn, TablePropertyChange as mr, CommentRangeStart as mt, DEFAULT_TAB_STOP_TWIPS as n, TableAlignment as na, ConditionalFormatStyle as ni, Insertion as nn, ShapeType as nr, BIDI_CONTROLS as nt, DocxConformanceClass as o, ColorValue as oa, ParagraphFormatting as oi, MarkupRangeMarker as on, TabContent as or, BlockSdt as ot, numberingLevelHasMarkerSlot as p, isThemeColor as pa, TableFormatting as pi, MoveToRangeEnd as pn, TablePreservedMarkup as pr, CommentRangeEnd as pt, LockedControlTouch as q, NumberFormat as qi, SectionPropertyChange as qn, LevelLegacy as qr, ImageFrameLocks as qt, DOCX_CONFORMANCE_CLASSES as r, TextDirection as ra, EmphasisMark as ri, InstrTextContent as rn, SimpleField as rr, BidiControl as rt, DocxPackage as s, ShadingProperties as sa, SpacingExplicit as si, MathEquation as sn, Table as sr, BookmarkEnd as st, COMMENT_PART_RELATIONSHIPS as t, TabStopAlignment as ta, CellMargins as ti, InlineWrapper as tn, ShapeTextBody as tr, getSingularRunPropertyChange as tt, levelShowsMarker as u, ThemeColorValue as ua, TableBorders as ui, MoveFromRangeEnd as un, TableCellPropertyChange as ur, BreakContent as ut, EmbeddedFontRef as v, SchemeColorSlot as va, TableRowFormatting as vi, NoteNumberRestart as vn, TableStructuralChangeInfo as vr, Deletion as vt, RelationshipMap as w, borderStyleFrom as wa, NO_PARAGRAPH_NUMBERING as wi, ParagraphContent as wn, TrackedRunContent as wr, DrawingContent as wt, FontTable as x, ThemeColor as xa, TextFormatting as xi, PROPERTY_REVISION_KINDS as xn, TextWatermark as xr, DocumentBackgroundDrawing as xt, FontCharset as y, SchemeColorValue as ya, TableWidthType as yi, NoteReferenceContent as yn, TextBox as yr, DisplacedByCustomXml as yt, ParseWarningLocation as z, BODY_TEXT_OUTLINE_LEVEL as zi, Run as zn, isPresetLineDashVal as zr, HeaderFooter as zt };
|
package/dist/docx_kernel_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
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,4 +1,4 @@
|
|
|
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-
|
|
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
3
|
import { i as serializeSequenceChildren } from "./sequenceChildren-CSn0-1ov.js";
|
|
4
4
|
import { _ as ZipError } from "./format-DXPXB02u.js";
|
|
@@ -367,6 +367,8 @@ const serializeBlock = (block) => {
|
|
|
367
367
|
case "preservedBlock": return block.xml;
|
|
368
368
|
case "bookmarkStart":
|
|
369
369
|
case "bookmarkEnd":
|
|
370
|
+
case "commentRangeStart":
|
|
371
|
+
case "commentRangeEnd":
|
|
370
372
|
case "moveFromRangeStart":
|
|
371
373
|
case "moveFromRangeEnd":
|
|
372
374
|
case "moveToRangeStart":
|
|
@@ -1226,6 +1228,8 @@ const validateBlocks = (blocks, path, ctx) => {
|
|
|
1226
1228
|
const blockRangeMarkerCounters = (ctx) => ({
|
|
1227
1229
|
bookmarkStart: ctx.bookmarkStarts,
|
|
1228
1230
|
bookmarkEnd: ctx.bookmarkEnds,
|
|
1231
|
+
commentRangeStart: ctx.commentRangeStarts,
|
|
1232
|
+
commentRangeEnd: ctx.commentRangeEnds,
|
|
1229
1233
|
moveFromRangeStart: ctx.moveFromStarts,
|
|
1230
1234
|
moveFromRangeEnd: ctx.moveFromEnds,
|
|
1231
1235
|
moveToRangeStart: ctx.moveToStarts,
|
|
@@ -1241,7 +1245,7 @@ const validateBlock = (block, path, ctx) => {
|
|
|
1241
1245
|
return;
|
|
1242
1246
|
}
|
|
1243
1247
|
if (block.type === "preservedBlock") return;
|
|
1244
|
-
if (block.type === "bookmarkStart" || block.type === "bookmarkEnd" || block.type === "moveFromRangeStart" || block.type === "moveFromRangeEnd" || block.type === "moveToRangeStart" || block.type === "moveToRangeEnd") {
|
|
1248
|
+
if (block.type === "bookmarkStart" || block.type === "bookmarkEnd" || block.type === "commentRangeStart" || block.type === "commentRangeEnd" || block.type === "moveFromRangeStart" || block.type === "moveFromRangeEnd" || block.type === "moveToRangeStart" || block.type === "moveToRangeEnd") {
|
|
1245
1249
|
increment(blockRangeMarkerCounters(ctx)[block.type], block.id);
|
|
1246
1250
|
return;
|
|
1247
1251
|
}
|
|
@@ -1415,6 +1419,10 @@ const validateHyperlinkChild = (child, path, ctx) => {
|
|
|
1415
1419
|
validateParagraphContent(child, path, ctx);
|
|
1416
1420
|
return;
|
|
1417
1421
|
}
|
|
1422
|
+
if (child.type === "complexField") {
|
|
1423
|
+
validateParagraphContent(child, path, ctx);
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1418
1426
|
panic(`Unsupported hyperlink child: ${JSON.stringify(child)}`);
|
|
1419
1427
|
};
|
|
1420
1428
|
const validateTrackedRunChange = (change, path, ctx) => {
|
|
@@ -1449,10 +1457,6 @@ const validateTable = (table, path, ctx) => {
|
|
|
1449
1457
|
for (const [index, row] of table.rows.entries()) validateTableRow(row, `${path}.rows[${index}]`, ctx);
|
|
1450
1458
|
};
|
|
1451
1459
|
const validateTableRow = (row, path, ctx) => {
|
|
1452
|
-
if (row.cells.length === 0) {
|
|
1453
|
-
addError(ctx, `${path}.cells`, "Table row must contain at least one cell.");
|
|
1454
|
-
return;
|
|
1455
|
-
}
|
|
1456
1460
|
for (const [index, cell] of row.cells.entries()) validateTableCell(cell, `${path}.cells[${index}]`, ctx);
|
|
1457
1461
|
};
|
|
1458
1462
|
const validateTableCell = (cell, path, ctx) => {
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
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";
|
|
2
2
|
import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "../preservedMarkup-9L4lbGnE.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, 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 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, finalizeParagraphFormatting, getSingularRunPropertyChange, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isCanonicallyEmptyParagraphFormatting, isNumberingLevel, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, levelShowsMarker, 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 };
|
|
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 };
|
package/dist/model/document.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as BIDI_CONTROLS, Y as BODY_TEXT_OUTLINE_LEVEL, A as BORDER_STYLES, t as COMMENT_PART_RELATIONSHIPS, y as COUNTER_FORMATS, n as DEFAULT_TAB_STOP_TWIPS, r as DOCX_CONFORMANCE_CLASSES, a as DRAWING_RAW_XML_MODES, pt as IMPORTED_ID_COLLISION_KINDS, mt as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, s as MAX_REVISION_ID, tt as NO_NUMBERING_NUM_ID, nt as NO_PARAGRAPH_NUMBERING, j as NUMBER_FORMATS, M as PARAGRAPH_ALIGNMENTS, c as PARAGRAPH_MARK_CHANGE_KINDS, ht as PARSE_WARNING_CODES, C as PRESET_LINE_DASH_VALS, l as PROPERTY_REVISION_KINDS, u as REVIEW_CARRIERS, R as SCHEME_COLOR_VALUE_BY_THEME_COLOR, N as TABLE_ALIGNMENTS, P as TAB_STOP_ALIGNMENTS, F as TEXT_DIRECTIONS, I as TEXT_DIRECTION_FLOWS, L as TEXT_DIRECTION_FLOW_BY_TOKEN, K as THEME_COLORS, z as THEME_COLOR_BY_SCHEME_COLOR_VALUE, w as borderStyleFrom, T as borderStyleToken, gt as finalizeParagraphFormatting,
|
|
1
|
+
export { i as BIDI_CONTROLS, Y as BODY_TEXT_OUTLINE_LEVEL, A as BORDER_STYLES, t as COMMENT_PART_RELATIONSHIPS, yt as CONTENT_CONTROL_LOCK, y as COUNTER_FORMATS, n as DEFAULT_TAB_STOP_TWIPS, r as DOCX_CONFORMANCE_CLASSES, a as DRAWING_RAW_XML_MODES, pt as IMPORTED_ID_COLLISION_KINDS, mt as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, s as MAX_REVISION_ID, tt as NO_NUMBERING_NUM_ID, nt as NO_PARAGRAPH_NUMBERING, j as NUMBER_FORMATS, M as PARAGRAPH_ALIGNMENTS, c as PARAGRAPH_MARK_CHANGE_KINDS, ht as PARSE_WARNING_CODES, C as PRESET_LINE_DASH_VALS, l as PROPERTY_REVISION_KINDS, u as REVIEW_CARRIERS, R as SCHEME_COLOR_VALUE_BY_THEME_COLOR, N as TABLE_ALIGNMENTS, P as TAB_STOP_ALIGNMENTS, F as TEXT_DIRECTIONS, I as TEXT_DIRECTION_FLOWS, L as TEXT_DIRECTION_FLOW_BY_TOKEN, K as THEME_COLORS, z as THEME_COLOR_BY_SCHEME_COLOR_VALUE, w as borderStyleFrom, T as borderStyleToken, bt as contentControlLockAllows, gt as finalizeParagraphFormatting, xt as firstLockedControlViolation, Et as getSingularRunPropertyChange, X as headingLevelOf, Z as headingOutlineLevel, E as isBorderNil, D as isBorderNone, O as isBorderStyle, _t as isCanonicallyEmptyParagraphFormatting, et as isNumberingLevel, rt as isNumberingReference, f as isOoxmlSymbolCharacter, b as isPresetLineDashVal, B as isSchemeColorValue, V as isThemeColor, H as knownThemeColor, m as levelShowsMarker, St as lockedControlMessage, Ct as lockedControlViolation, wt as locksContent, Tt as locksControl, it as mergeParagraphNumbering, q as mintRelationshipId, p as normalizeRevisionId, h as numberingInstanceResolves, g as numberingLevelEntries, _ as numberingLevelHasMarkerSlot, Q as outlineLevelFromStatedValue, $ as outlineLevelStatedValue, at as paragraphNumberingFromSlots, ot as paragraphNumberingLevel, st as paragraphNumberingReference, ct as paragraphNumberingReferenceId, lt as paragraphNumberingSlots, x as presetLineDashFrom, S as presetLineDashToken, U as readThemeColor, J as relationshipIdOf, v as resolveNumberingLevel, ut as resolveParagraphNumbering, dt as sameEffectiveParagraphNumbering, ft as sameStatedParagraphNumbering, vt as setDocumentBodyComments, k as statesNoBorder, W as themeColorSlot, G as themeColorToken } from "../document-CEMwM5On.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
2
2
|
import { Result, TaggedErrorClass } from "better-result";
|
|
3
3
|
/** JSON-safe map presence, including an explicitly undefined section map. */
|
|
4
4
|
type SectionMapState = {
|
|
@@ -151,7 +151,7 @@ type NewIds = {
|
|
|
151
151
|
* of making it: the stamp's id names the first record the edit creates and
|
|
152
152
|
* `newIds.revision` names the others, in document order. The id must be unused
|
|
153
153
|
* in the package. A new tracked wrapper that would sit next to one with the
|
|
154
|
-
* same author, date and
|
|
154
|
+
* same author, date, initials and suggestion merges into it and creates no record, so an
|
|
155
155
|
* author's burst of typing reads as one change.
|
|
156
156
|
*/
|
|
157
157
|
type RevisionStamp = {
|
|
@@ -160,6 +160,11 @@ type RevisionStamp = {
|
|
|
160
160
|
/** `w:date`, as the author's client stated it. */
|
|
161
161
|
date: string;
|
|
162
162
|
initials?: string;
|
|
163
|
+
/**
|
|
164
|
+
* The pending suggestion the records belong to. A record of one suggestion
|
|
165
|
+
* never merges into a record of another, or into an ordinary tracked change.
|
|
166
|
+
*/
|
|
167
|
+
suggestionId?: string;
|
|
163
168
|
};
|
|
164
169
|
/** The paragraph fields a split gives the new paragraph, besides its id, content and mark. */
|
|
165
170
|
type SplitParagraphFields = Omit<Paragraph, "type" | "paraId" | "content" | "sectionProperties" | "pPrMark">;
|
|
@@ -196,6 +201,7 @@ export declare const DOCUMENT_OP_TYPES: Readonly<{
|
|
|
196
201
|
readonly SET_PARAGRAPH_REVIEW: "setParagraphReview";
|
|
197
202
|
readonly REPLACE_INLINE: "replaceInline";
|
|
198
203
|
readonly RESOLVE_REVISION: "resolveRevision";
|
|
204
|
+
readonly SET_REVISION_INFO: "setRevisionInfo";
|
|
199
205
|
readonly INSERT_TABLE: "insertTable";
|
|
200
206
|
readonly DELETE_TABLE: "deleteTable";
|
|
201
207
|
readonly SET_CONTAINER_BLOCKS: "setContainerBlocks";
|
|
@@ -483,9 +489,10 @@ type BlockInsertionPoint = {
|
|
|
483
489
|
* Insert paragraphs beside an existing paragraph, with pre-minted ids.
|
|
484
490
|
* Section-bearing paragraphs are refused. With `revision`, each inserted
|
|
485
491
|
* paragraph receives an inserted mark and its content an insertion wrapper.
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
492
|
+
* A tracked insertion after a paragraph no paragraph follows marks the
|
|
493
|
+
* anchor's mark as the inserted one and gives the last new paragraph the
|
|
494
|
+
* anchor's former mark; it is refused as `untrackable` when the anchor's mark
|
|
495
|
+
* carries review records.
|
|
489
496
|
* Incoming revision and content-control identities are refused in tracked
|
|
490
497
|
* mode rather than nesting reviews or rewriting supplied identities.
|
|
491
498
|
*/
|
|
@@ -612,6 +619,18 @@ type ResolveRevisionOp = {
|
|
|
612
619
|
revisionIds: readonly number[];
|
|
613
620
|
decision: RevisionDecision;
|
|
614
621
|
};
|
|
622
|
+
/**
|
|
623
|
+
* Rewrite the metadata of the revisions with these ids, keeping their content
|
|
624
|
+
* and their ids: every record carrying an id takes the info given for it.
|
|
625
|
+
* Adopting a pending suggestion as ordinary tracked changes is this, with the
|
|
626
|
+
* suggestion id dropped and the adopter's attribution. Its inverse writes the
|
|
627
|
+
* previous metadata back.
|
|
628
|
+
*/
|
|
629
|
+
type SetRevisionInfoOp = {
|
|
630
|
+
type: typeof DOCUMENT_OP_TYPES.SET_REVISION_INFO;
|
|
631
|
+
story: OpStory;
|
|
632
|
+
infos: readonly TrackedChangeInfo[];
|
|
633
|
+
};
|
|
615
634
|
/**
|
|
616
635
|
* Insert a row at a zero-based index in the table holding `blockId`.
|
|
617
636
|
* The paragraph reference selects the innermost table containing it.
|
|
@@ -985,7 +1004,7 @@ type RestoreCommentStateOp = {
|
|
|
985
1004
|
};
|
|
986
1005
|
type CommentOp = CreateCommentOp | UpdateCommentContentOp | SetCommentResolutionOp | DeleteCommentOp | RestoreCommentStateOp;
|
|
987
1006
|
/** A schema-version-10 document operation. */
|
|
988
|
-
type DocumentOp = (CommentOp | CreateHeaderFooterOp | RemoveHeaderFooterOp | AddNoteOp | RemoveNoteOp | SetSectionPropsOp | RestoreStoryPartsOp | DeleteBlocksOp | InsertTableOp | DeleteTableOp | SetContainerBlocksOp | InsertBlocksOp | InsertTextOp | InsertContentOp | DeleteRangeOp | SplitInlineOp | JoinInlineOp | SetRunPropsOp | SetParagraphPropsOp | SplitBlockOp | JoinBlocksOp | ReplaceBlocksOp | SetParagraphReviewOp | ReplaceInlineOp | ResolveRevisionOp | InsertRowOp | DeleteRowOp | SetTableRowsOp | TableEditOp | SetTableOp | CreateNumberingInstanceOp | DeleteNumberingInstanceOp | SetSectionEndpointOp | SetPackageResourcesOp) & {
|
|
1007
|
+
type DocumentOp = (CommentOp | CreateHeaderFooterOp | RemoveHeaderFooterOp | AddNoteOp | RemoveNoteOp | SetSectionPropsOp | RestoreStoryPartsOp | DeleteBlocksOp | InsertTableOp | DeleteTableOp | SetContainerBlocksOp | InsertBlocksOp | InsertTextOp | InsertContentOp | DeleteRangeOp | SplitInlineOp | JoinInlineOp | SetRunPropsOp | SetParagraphPropsOp | SplitBlockOp | JoinBlocksOp | ReplaceBlocksOp | SetParagraphReviewOp | ReplaceInlineOp | ResolveRevisionOp | SetRevisionInfoOp | InsertRowOp | DeleteRowOp | SetTableRowsOp | TableEditOp | SetTableOp | CreateNumberingInstanceOp | DeleteNumberingInstanceOp | SetSectionEndpointOp | SetPackageResourcesOp) & {
|
|
989
1008
|
/** Own undefined fields recorded by the operation capture boundary. */
|
|
990
1009
|
undefinedFields?: readonly (readonly string[])[];
|
|
991
1010
|
};
|
|
@@ -1379,6 +1398,19 @@ type WellFormedRangePlan = {
|
|
|
1379
1398
|
export declare const planWellFormedRanges: (occurrences: readonly BoundaryOccurrence[]) => WellFormedRangePlan;
|
|
1380
1399
|
/** Capture own undefined fields before an operation enters its JSON journal. */
|
|
1381
1400
|
export declare const captureDocumentOp: (op: DocumentOp) => DocumentOp;
|
|
1401
|
+
/**
|
|
1402
|
+
* The document as a save writes it: every pending suggestion rejected. A
|
|
1403
|
+
* 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.
|
|
1405
|
+
*/
|
|
1406
|
+
export declare const withoutPendingSuggestions: (document: Document) => Result<Document, DocumentOpRefusal>;
|
|
1407
|
+
/**
|
|
1408
|
+
* The revisions of one pending suggestion in a story, one info per revision
|
|
1409
|
+
* id, in document order.
|
|
1410
|
+
*/
|
|
1411
|
+
export declare const suggestionRevisionInfos: (document: Document, story: OpStory, suggestionId: string) => TrackedChangeInfo[];
|
|
1412
|
+
/** The ids of every pending suggestion in a document, in every story. */
|
|
1413
|
+
export declare const pendingSuggestionIdsIn: (document: Document) => Set<string>;
|
|
1382
1414
|
type HyperlinkEditorIntent = {
|
|
1383
1415
|
type: "setHyperlink";
|
|
1384
1416
|
from: TextPosition;
|
|
@@ -1403,10 +1435,55 @@ type SplitParagraphIntent = {
|
|
|
1403
1435
|
at: TextPosition;
|
|
1404
1436
|
to?: TextPosition;
|
|
1405
1437
|
};
|
|
1438
|
+
/**
|
|
1439
|
+
* A row inserted into, or deleted from, the table holding `blockId`. An
|
|
1440
|
+
* inserted row's paragraphs take fresh identities from the compiler; the ids
|
|
1441
|
+
* it arrives with are not kept.
|
|
1442
|
+
*/
|
|
1443
|
+
type TableRowIntentOperation = Omit<InsertRowOp, "revision" | "newIds"> | Omit<DeleteRowOp, "revision" | "newIds">;
|
|
1444
|
+
/**
|
|
1445
|
+
* A table inserted after the paragraph `blockId`, with an empty paragraph
|
|
1446
|
+
* after it, as the editor inserts one; or the table holding `blockId`,
|
|
1447
|
+
* removed, or in suggesting mode recorded as deleted. An inserted table's
|
|
1448
|
+
* paragraphs take fresh identities from the compiler.
|
|
1449
|
+
*/
|
|
1450
|
+
type TableBlockIntentOperation = Omit<DeleteTableOp, "revision" | "newIds" | "expected"> | {
|
|
1451
|
+
type: typeof DOCUMENT_OP_TYPES.INSERT_TABLE;
|
|
1452
|
+
story: OpStory;
|
|
1453
|
+
blockId: string;
|
|
1454
|
+
table: Table;
|
|
1455
|
+
/**
|
|
1456
|
+
* Where the table goes against the anchor paragraph: after it (the
|
|
1457
|
+
* default, as from a caret), or before it, as from a selection of the
|
|
1458
|
+
* whole story, which the editor fills at the story's start.
|
|
1459
|
+
*/
|
|
1460
|
+
side?: "after" | "before";
|
|
1461
|
+
/**
|
|
1462
|
+
* An empty paragraph ahead of the table as well, as the editor writes
|
|
1463
|
+
* a table it inserts after another, so the two never touch.
|
|
1464
|
+
*/
|
|
1465
|
+
separated?: boolean;
|
|
1466
|
+
};
|
|
1406
1467
|
/** Positions use canonical physical offsets, including retained deleted content. */
|
|
1407
1468
|
type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
|
|
1408
1469
|
type: "table";
|
|
1409
1470
|
operation: TableIntentOperation;
|
|
1471
|
+
} | {
|
|
1472
|
+
type: "tableRow";
|
|
1473
|
+
operation: TableRowIntentOperation;
|
|
1474
|
+
} | {
|
|
1475
|
+
type: "tableBlock";
|
|
1476
|
+
operation: TableBlockIntentOperation;
|
|
1477
|
+
} | {
|
|
1478
|
+
/**
|
|
1479
|
+
* Whole paragraphs beside a paragraph, which keeps its identity: the
|
|
1480
|
+
* compiler gives each a fresh id, and a suggestion records each as
|
|
1481
|
+
* inserted.
|
|
1482
|
+
*/
|
|
1483
|
+
type: "insertParagraphs";
|
|
1484
|
+
story: OpStory;
|
|
1485
|
+
at: BlockInsertionPoint;
|
|
1486
|
+
paragraphs: readonly Paragraph[];
|
|
1410
1487
|
} | {
|
|
1411
1488
|
type: "replaceFragment";
|
|
1412
1489
|
from: TextPosition;
|
|
@@ -1429,6 +1506,15 @@ type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
|
|
|
1429
1506
|
text: string;
|
|
1430
1507
|
runProps?: TextFormatting;
|
|
1431
1508
|
runPropsPatch?: RunPropsPatch;
|
|
1509
|
+
/**
|
|
1510
|
+
* Whether the caret at each end stood just inside the edge of an inline
|
|
1511
|
+
* container (a content control) that opens at `from` or closes at
|
|
1512
|
+
* `to`, where the source gap alone cannot tell inside from outside.
|
|
1513
|
+
*/
|
|
1514
|
+
inside?: {
|
|
1515
|
+
start?: boolean;
|
|
1516
|
+
end?: boolean;
|
|
1517
|
+
};
|
|
1432
1518
|
} | {
|
|
1433
1519
|
type: "formatRun";
|
|
1434
1520
|
from: TextPosition;
|
|
@@ -1466,6 +1552,11 @@ type EditorIntent = HyperlinkEditorIntent | GenerateTOCIntent | {
|
|
|
1466
1552
|
story: OpStory;
|
|
1467
1553
|
blockId: string;
|
|
1468
1554
|
nextBlockId: string;
|
|
1555
|
+
/**
|
|
1556
|
+
* Which paragraph's identity a direct join keeps, by default the
|
|
1557
|
+
* second's; a tracked join always keeps the second.
|
|
1558
|
+
*/
|
|
1559
|
+
survivor?: SplitHalf;
|
|
1469
1560
|
};
|
|
1470
1561
|
/** Revision metadata and every fresh identity are supplied before compilation. */
|
|
1471
1562
|
type EditorIntentMode = {
|
|
@@ -1549,6 +1640,13 @@ type RegisterParagraphPropertySnapshotOptions = {
|
|
|
1549
1640
|
};
|
|
1550
1641
|
/** Bind effective formatting to the authored properties a review must record. */
|
|
1551
1642
|
export declare const registerParagraphPropertySnapshot: ({ paragraph, snapshot }: RegisterParagraphPropertySnapshotOptions) => void;
|
|
1643
|
+
/**
|
|
1644
|
+
* The registration a paragraph's snapshot stands on, as an opaque token: the
|
|
1645
|
+
* same object while nothing registers or transfers another one for it. A pass
|
|
1646
|
+
* that registered a snapshot can tell from it that registering again would
|
|
1647
|
+
* change nothing.
|
|
1648
|
+
*/
|
|
1649
|
+
export declare const paragraphPropertySnapshotToken: (paragraph: Paragraph) => object | undefined;
|
|
1552
1650
|
/** A document an operation produced, the operations that undo it, and what it changed. */
|
|
1553
1651
|
type AppliedDocumentOp = {
|
|
1554
1652
|
document: Document;
|
|
@@ -1873,4 +1971,4 @@ export declare const orderAddressingBeforeRemoval: <T, Block>(ordered: readonly
|
|
|
1873
1971
|
* requested sequence, which no series of single edits produces.
|
|
1874
1972
|
*/
|
|
1875
1973
|
export declare const groupInsertionRuns: <T>(operations: readonly T[], insertionPositionOf: (operation: T) => number | null, keepsGap?: (operation: T) => boolean) => T[][];
|
|
1876
|
-
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, TableEditOp, TableIntentOperation, TextPosition, TouchedBlocks, UpdateCommentContentOp, WellFormedRangePlan, ZeroWidthItem };
|
|
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 };
|