@eigenpal/docx-editor-agents 1.2.1 → 1.3.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/bridge.d.mts +1 -1
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/chunk-2OIX7TUX.mjs +75 -0
- package/dist/chunk-4W7OEW2I.js +75 -0
- package/dist/{chunk-E6DDF6BY.js → chunk-7PTBNHAH.js} +2 -2
- package/dist/chunk-LX3NJWKV.js +1 -0
- package/dist/chunk-NFAEIOLC.mjs +1 -0
- package/dist/chunk-P4DRISTP.mjs +5 -0
- package/dist/chunk-XUAUDUJU.js +5 -0
- package/dist/{chunk-ON5FX5NO.mjs → chunk-YQIAKHOL.mjs} +2 -2
- package/dist/headless-ES4B5CTK.js +1 -0
- package/dist/headless-OEZEYHNL.mjs +1 -0
- package/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{server-uM9UUIhk.d.mts → server-BaVhdHCd.d.mts} +192 -11
- package/dist/{server-uM9UUIhk.d.ts → server-BaVhdHCd.d.ts} +192 -11
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/vue.js +6 -6
- package/dist/vue.mjs +72 -56
- package/package.json +1 -1
- package/dist/chunk-B3LQVYMR.js +0 -74
- package/dist/chunk-L7LXQOTH.mjs +0 -74
- package/dist/chunk-OCMVGKIA.mjs +0 -5
- package/dist/chunk-QU2WUEX3.mjs +0 -1
- package/dist/chunk-UXHK7C33.js +0 -1
- package/dist/chunk-ZDQ7OJ6K.js +0 -5
- package/dist/headless-6C4JSKYY.mjs +0 -1
- package/dist/headless-VGNLVFAJ.js +0 -1
|
@@ -970,6 +970,70 @@ interface Table {
|
|
|
970
970
|
rows: TableRow[];
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
+
/**
|
|
974
|
+
* Watermark — the MS Word "Design → Watermark" feature.
|
|
975
|
+
*
|
|
976
|
+
* In OOXML a watermark is legacy VML stored inside a header part, inside a
|
|
977
|
+
* paragraph run: `<w:pict><v:shape>…</v:shape></w:pict>`. It renders behind
|
|
978
|
+
* the body content on every page of the section. Word supports two kinds:
|
|
979
|
+
*
|
|
980
|
+
* - **Text** — `<v:shape type="#_x0000_t136"><v:textpath string="DRAFT"/>`
|
|
981
|
+
* with a fill color, font, optional rotation (diagonal vs horizontal) and a
|
|
982
|
+
* reduced-opacity "semitransparent" look.
|
|
983
|
+
* - **Picture** — `<v:shape><v:imagedata r:id="rIdN"/>` referencing a media
|
|
984
|
+
* file, scaled, optionally "washed out" (lightened).
|
|
985
|
+
*
|
|
986
|
+
* We model the watermark as a dedicated field on the owning `HeaderFooter`
|
|
987
|
+
* rather than as editable run content, so it stays out of the ProseMirror text
|
|
988
|
+
* flow while still round-tripping through parse → render → serialize.
|
|
989
|
+
*/
|
|
990
|
+
/**
|
|
991
|
+
* Text watermark (e.g. "CONFIDENTIAL", "DRAFT").
|
|
992
|
+
*/
|
|
993
|
+
interface TextWatermark {
|
|
994
|
+
kind: 'text';
|
|
995
|
+
/** The watermark text. */
|
|
996
|
+
text: string;
|
|
997
|
+
/** Font family (e.g. 'Calibri'). */
|
|
998
|
+
font: string;
|
|
999
|
+
/** Fill color as a CSS hex string (e.g. '#C0C0C0'). */
|
|
1000
|
+
color: string;
|
|
1001
|
+
/** Word's "Semitransparent" checkbox — renders at reduced opacity. */
|
|
1002
|
+
semitransparent: boolean;
|
|
1003
|
+
/** Diagonal (≈ -45°) or horizontal layout. */
|
|
1004
|
+
layout: 'diagonal' | 'horizontal';
|
|
1005
|
+
/** Font size in points. When undefined the renderer auto-sizes to the page (Word's "Auto"). */
|
|
1006
|
+
fontSize?: number;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Picture watermark — a scaled, optionally washed-out background image.
|
|
1010
|
+
*/
|
|
1011
|
+
interface PictureWatermark {
|
|
1012
|
+
kind: 'picture';
|
|
1013
|
+
/** Header-part relationship id of the media (set for images parsed from an existing file). */
|
|
1014
|
+
relId?: string;
|
|
1015
|
+
/** Package path of the media, e.g. 'word/media/image1.png'. */
|
|
1016
|
+
mediaPath?: string;
|
|
1017
|
+
/** Raw bytes for an image added in-editor (no rId yet). */
|
|
1018
|
+
data?: Uint8Array;
|
|
1019
|
+
/** MIME type for `data`. */
|
|
1020
|
+
contentType?: string;
|
|
1021
|
+
/** Ready-to-use data URL for rendering (resolved from media or `data`). */
|
|
1022
|
+
dataUrl?: string;
|
|
1023
|
+
/** Scale factor; 1 = 100% / Word's "Auto". */
|
|
1024
|
+
scale: number;
|
|
1025
|
+
/** Word's "Washout" checkbox — lightens the image so text stays readable. */
|
|
1026
|
+
washout: boolean;
|
|
1027
|
+
/** Natural width in EMUs (when known). */
|
|
1028
|
+
widthEmu?: number;
|
|
1029
|
+
/** Natural height in EMUs (when known). */
|
|
1030
|
+
heightEmu?: number;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* A document watermark — text or picture.
|
|
1034
|
+
*/
|
|
1035
|
+
type Watermark = TextWatermark | PictureWatermark;
|
|
1036
|
+
|
|
973
1037
|
/**
|
|
974
1038
|
* Page furniture — headers (`w:hdr`), footers (`w:ftr`), footnotes
|
|
975
1039
|
* (`w:footnote`), and endnotes (`w:endnote`), plus the section-level
|
|
@@ -1000,6 +1064,12 @@ interface HeaderFooter {
|
|
|
1000
1064
|
hdrFtrType: HeaderFooterType;
|
|
1001
1065
|
/** Content (paragraphs, tables, etc.) */
|
|
1002
1066
|
content: BlockContent[];
|
|
1067
|
+
/**
|
|
1068
|
+
* Watermark stored on this header (MS Word "Design → Watermark"). Lives
|
|
1069
|
+
* here, not in `content`, so it stays out of the editable text flow while
|
|
1070
|
+
* still round-tripping. Only headers carry watermarks; footers never do.
|
|
1071
|
+
*/
|
|
1072
|
+
watermark?: Watermark;
|
|
1003
1073
|
}
|
|
1004
1074
|
/**
|
|
1005
1075
|
* Footnote position
|
|
@@ -1042,12 +1112,23 @@ interface Footnote {
|
|
|
1042
1112
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1043
1113
|
/**
|
|
1044
1114
|
* Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as
|
|
1045
|
-
* the body
|
|
1046
|
-
*
|
|
1047
|
-
*
|
|
1048
|
-
* (toProseDoc → toFlowBlocks)
|
|
1115
|
+
* the body, so the note parser reuses the body's `parseBlockContent`: the
|
|
1116
|
+
* full block model — paragraphs, tables, and block-level `w:sdt` content
|
|
1117
|
+
* controls (as `BlockSdt`) — flows through the body pipeline
|
|
1118
|
+
* (toProseDoc → toFlowBlocks) and stays editable on round-trip.
|
|
1049
1119
|
*/
|
|
1050
1120
|
content: BlockContent[];
|
|
1121
|
+
/**
|
|
1122
|
+
* Verbatim original XML of the entire `<w:footnote>` element, captured at
|
|
1123
|
+
* parse time ONLY when the note body carries a block-level construct the
|
|
1124
|
+
* model still can't represent — note-level bookmarks
|
|
1125
|
+
* (`w:bookmarkStart`/`w:bookmarkEnd`) or `w:customXml`. Block-level `w:sdt`
|
|
1126
|
+
* is NOT a trigger: it round-trips through the model as `BlockSdt`. When
|
|
1127
|
+
* present the serializer re-emits these bytes instead of rebuilding from
|
|
1128
|
+
* `content`, restoring pre-#646 fidelity for the unmodeled constructs.
|
|
1129
|
+
* See `parseNoteBlockContent` / `serializeNote` for the gate (#646 F3).
|
|
1130
|
+
*/
|
|
1131
|
+
verbatimXml?: string;
|
|
1051
1132
|
}
|
|
1052
1133
|
/**
|
|
1053
1134
|
* Endnote (w:endnote)
|
|
@@ -1060,9 +1141,12 @@ interface Endnote {
|
|
|
1060
1141
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1061
1142
|
/**
|
|
1062
1143
|
* Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
|
|
1063
|
-
* the body — paragraphs and
|
|
1144
|
+
* the body — paragraphs, tables, and block-level content controls. See note
|
|
1145
|
+
* on `Footnote.content`.
|
|
1064
1146
|
*/
|
|
1065
1147
|
content: BlockContent[];
|
|
1148
|
+
/** Verbatim original XML — see `Footnote.verbatimXml` (#646 F3). */
|
|
1149
|
+
verbatimXml?: string;
|
|
1066
1150
|
}
|
|
1067
1151
|
|
|
1068
1152
|
/**
|
|
@@ -1763,6 +1847,29 @@ interface NoteReferenceContent {
|
|
|
1763
1847
|
/** Note ID */
|
|
1764
1848
|
id: number;
|
|
1765
1849
|
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Footnote/endnote auto-number mark (`w:footnoteRef` / `w:endnoteRef`).
|
|
1852
|
+
*
|
|
1853
|
+
* Distinct from {@link NoteReferenceContent}: that is the *reference* placed in
|
|
1854
|
+
* the document body (`w:footnoteReference`), whereas this is the numbering
|
|
1855
|
+
* placeholder that lives *inside* the note body — the run carrying it is what
|
|
1856
|
+
* Word renders as the note's leading superscript number. Preserving it keeps
|
|
1857
|
+
* the note's own number visible on round-trip.
|
|
1858
|
+
*/
|
|
1859
|
+
interface NoteRefMarkContent {
|
|
1860
|
+
type: 'footnoteRefMark' | 'endnoteRefMark';
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Footnote/endnote separator mark (`w:separator` / `w:continuationSeparator`).
|
|
1864
|
+
*
|
|
1865
|
+
* These appear inside the special separator notes (`w:type="separator"` and
|
|
1866
|
+
* `w:type="continuationSeparator"`) and draw the horizontal rule Word places
|
|
1867
|
+
* between the body and its notes. They carry no content; Word rejects a notes
|
|
1868
|
+
* part whose separator notes have lost these markers, so they must round-trip.
|
|
1869
|
+
*/
|
|
1870
|
+
interface SeparatorContent {
|
|
1871
|
+
type: 'separator' | 'continuationSeparator';
|
|
1872
|
+
}
|
|
1766
1873
|
/**
|
|
1767
1874
|
* Field character (begin/separate/end)
|
|
1768
1875
|
*/
|
|
@@ -1814,7 +1921,7 @@ interface ShapeContent {
|
|
|
1814
1921
|
/**
|
|
1815
1922
|
* All possible run content types
|
|
1816
1923
|
*/
|
|
1817
|
-
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
|
|
1924
|
+
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | NoteRefMarkContent | SeparatorContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
|
|
1818
1925
|
/**
|
|
1819
1926
|
* A run (`w:r`) — a contiguous span of inline content sharing one set of
|
|
1820
1927
|
* character properties (bold, italic, font, color, etc.). Runs are the
|
|
@@ -2121,10 +2228,20 @@ interface DocxPackage {
|
|
|
2121
2228
|
settings?: DocumentSettings;
|
|
2122
2229
|
/** Font table */
|
|
2123
2230
|
fontTable?: FontTable;
|
|
2124
|
-
/** Footnotes */
|
|
2231
|
+
/** Footnotes (normal notes only — separators live in `footnoteSeparators`) */
|
|
2125
2232
|
footnotes?: Footnote[];
|
|
2126
|
-
/** Endnotes */
|
|
2233
|
+
/** Endnotes (normal notes only — separators live in `endnoteSeparators`) */
|
|
2127
2234
|
endnotes?: Endnote[];
|
|
2235
|
+
/**
|
|
2236
|
+
* Separator footnotes (`w:type="separator"` / `"continuationSeparator"` /
|
|
2237
|
+
* `"continuationNotice"`) kept out of `footnotes` so rendering/layout only
|
|
2238
|
+
* sees real notes. Retained for round-trip: Word rejects a footnotes part
|
|
2239
|
+
* whose separator notes are missing, so the serializer re-emits these ahead
|
|
2240
|
+
* of the normal notes.
|
|
2241
|
+
*/
|
|
2242
|
+
footnoteSeparators?: Footnote[];
|
|
2243
|
+
/** Separator endnotes — see `footnoteSeparators`. */
|
|
2244
|
+
endnoteSeparators?: Endnote[];
|
|
2128
2245
|
/** Headers by relationship ID */
|
|
2129
2246
|
headers?: Map<string, HeaderFooter>;
|
|
2130
2247
|
/** Footers by relationship ID */
|
|
@@ -2218,7 +2335,24 @@ interface ReviewChange {
|
|
|
2218
2335
|
date: string | null;
|
|
2219
2336
|
text: string;
|
|
2220
2337
|
context: string;
|
|
2338
|
+
/**
|
|
2339
|
+
* Index of the containing paragraph. For body changes this is the
|
|
2340
|
+
* document-wide paragraph index; for note changes it is the paragraph index
|
|
2341
|
+
* *within that note* (note bodies have their own numbering), so pair it with
|
|
2342
|
+
* `noteId` / `noteType` rather than reading it as a body index.
|
|
2343
|
+
*/
|
|
2221
2344
|
paragraphIndex: number;
|
|
2345
|
+
/**
|
|
2346
|
+
* Set when the change lives inside a footnote or endnote. Such changes are
|
|
2347
|
+
* surfaced for discovery only — accept/reject operate on the body, so an id
|
|
2348
|
+
* that resolves *only* to a note change throws `NoteChangeNotEditableError`
|
|
2349
|
+
* (an id also present on a body change resolves to the body change). The
|
|
2350
|
+
* raw `id` is not namespaced across parts, so pair it with `noteId` /
|
|
2351
|
+
* `noteType` to identify the change.
|
|
2352
|
+
*/
|
|
2353
|
+
noteId?: number;
|
|
2354
|
+
/** Which note store the change came from. Absent for body changes. */
|
|
2355
|
+
noteType?: 'footnote' | 'endnote';
|
|
2222
2356
|
}
|
|
2223
2357
|
interface ReviewCommentReply {
|
|
2224
2358
|
id: number;
|
|
@@ -2239,6 +2373,10 @@ interface ReviewComment {
|
|
|
2239
2373
|
interface ChangeFilter {
|
|
2240
2374
|
author?: string;
|
|
2241
2375
|
type?: 'insertion' | 'deletion' | 'moveFrom' | 'moveTo';
|
|
2376
|
+
/** Also report tracked changes inside footnote bodies. Default: false. */
|
|
2377
|
+
includeFootnotes?: boolean;
|
|
2378
|
+
/** Also report tracked changes inside endnote bodies. Default: false. */
|
|
2379
|
+
includeEndnotes?: boolean;
|
|
2242
2380
|
}
|
|
2243
2381
|
interface CommentFilter {
|
|
2244
2382
|
author?: string;
|
|
@@ -2457,7 +2595,21 @@ declare class DocxReviewer {
|
|
|
2457
2595
|
* Avoids JSON quote-escaping issues — LLMs can copy text verbatim.
|
|
2458
2596
|
*/
|
|
2459
2597
|
getContentAsText(options?: GetContentOptions): string;
|
|
2460
|
-
/**
|
|
2598
|
+
/**
|
|
2599
|
+
* Get all tracked changes in the document. Pass `includeFootnotes` /
|
|
2600
|
+
* `includeEndnotes` in the filter to also report changes inside note bodies
|
|
2601
|
+
* (each such change carries `noteId` / `noteType`).
|
|
2602
|
+
*
|
|
2603
|
+
* The reported `id` is the raw `w:id`, which is unique only within its part
|
|
2604
|
+
* (document.xml / footnotes.xml / endnotes.xml) — it is NOT namespaced across
|
|
2605
|
+
* parts, so the same `id` can appear on a body change and a note change. Use
|
|
2606
|
+
* `noteType` / `noteId` to disambiguate.
|
|
2607
|
+
*
|
|
2608
|
+
* Note changes are surfaced for discovery only. `acceptChange` /
|
|
2609
|
+
* `rejectChange` operate on the document body, so an id that resolves *only*
|
|
2610
|
+
* to a note change throws {@link NoteChangeNotEditableError} rather than
|
|
2611
|
+
* mutating it (an id shared with a body change resolves to the body change).
|
|
2612
|
+
*/
|
|
2461
2613
|
getChanges(filter?: ChangeFilter): ReviewChange[];
|
|
2462
2614
|
/** Get all comments with their replies. */
|
|
2463
2615
|
getComments(filter?: CommentFilter): ReviewComment[];
|
|
@@ -2505,9 +2657,38 @@ declare class DocxReviewer {
|
|
|
2505
2657
|
proposeInsertion(options: ProposeInsertionOptions): void;
|
|
2506
2658
|
/** Delete text as a tracked change. */
|
|
2507
2659
|
proposeDeletion(options: ProposeDeletionOptions): void;
|
|
2508
|
-
/**
|
|
2660
|
+
/**
|
|
2661
|
+
* Guard the body-only accept/reject path against in-note changes.
|
|
2662
|
+
*
|
|
2663
|
+
* A tracked-change `w:id` is unique only within its part, so the same id can
|
|
2664
|
+
* appear in the body and in a footnote/endnote. When the id resolves to a
|
|
2665
|
+
* body change we let the body-only impl handle it (body wins; the note, if
|
|
2666
|
+
* any, is left untouched). When the id resolves ONLY to a note change we fail
|
|
2667
|
+
* closed with {@link NoteChangeNotEditableError} rather than mis-reporting it
|
|
2668
|
+
* as not-found — accept/reject cannot yet mutate note bodies.
|
|
2669
|
+
*/
|
|
2670
|
+
private assertNotNoteOnly;
|
|
2671
|
+
/**
|
|
2672
|
+
* Accept a tracked change by its revision ID. Operates on the document body
|
|
2673
|
+
* only.
|
|
2674
|
+
*
|
|
2675
|
+
* The public `id` is a `w:id`, which is unique only within its part, so the
|
|
2676
|
+
* same id may appear in the body and in a footnote/endnote. Resolution is
|
|
2677
|
+
* body-first: if a body change carries this id it is accepted and any
|
|
2678
|
+
* same-id note change is left untouched. If the id resolves *only* to a note
|
|
2679
|
+
* change, this throws {@link NoteChangeNotEditableError} (note bodies are not
|
|
2680
|
+
* yet mutable here). If it resolves to nothing, it throws
|
|
2681
|
+
* {@link ChangeNotFoundError}.
|
|
2682
|
+
*/
|
|
2509
2683
|
acceptChange(id: number): void;
|
|
2510
|
-
/**
|
|
2684
|
+
/**
|
|
2685
|
+
* Reject a tracked change by its revision ID. Operates on the document body
|
|
2686
|
+
* only.
|
|
2687
|
+
*
|
|
2688
|
+
* Same resolution rules as {@link acceptChange}: body-first, throws
|
|
2689
|
+
* {@link NoteChangeNotEditableError} for a note-only id, and
|
|
2690
|
+
* {@link ChangeNotFoundError} when the id matches nothing.
|
|
2691
|
+
*/
|
|
2511
2692
|
rejectChange(id: number): void;
|
|
2512
2693
|
/** Accept all tracked changes. Returns count accepted. */
|
|
2513
2694
|
acceptAll(): number;
|
|
@@ -970,6 +970,70 @@ interface Table {
|
|
|
970
970
|
rows: TableRow[];
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
+
/**
|
|
974
|
+
* Watermark — the MS Word "Design → Watermark" feature.
|
|
975
|
+
*
|
|
976
|
+
* In OOXML a watermark is legacy VML stored inside a header part, inside a
|
|
977
|
+
* paragraph run: `<w:pict><v:shape>…</v:shape></w:pict>`. It renders behind
|
|
978
|
+
* the body content on every page of the section. Word supports two kinds:
|
|
979
|
+
*
|
|
980
|
+
* - **Text** — `<v:shape type="#_x0000_t136"><v:textpath string="DRAFT"/>`
|
|
981
|
+
* with a fill color, font, optional rotation (diagonal vs horizontal) and a
|
|
982
|
+
* reduced-opacity "semitransparent" look.
|
|
983
|
+
* - **Picture** — `<v:shape><v:imagedata r:id="rIdN"/>` referencing a media
|
|
984
|
+
* file, scaled, optionally "washed out" (lightened).
|
|
985
|
+
*
|
|
986
|
+
* We model the watermark as a dedicated field on the owning `HeaderFooter`
|
|
987
|
+
* rather than as editable run content, so it stays out of the ProseMirror text
|
|
988
|
+
* flow while still round-tripping through parse → render → serialize.
|
|
989
|
+
*/
|
|
990
|
+
/**
|
|
991
|
+
* Text watermark (e.g. "CONFIDENTIAL", "DRAFT").
|
|
992
|
+
*/
|
|
993
|
+
interface TextWatermark {
|
|
994
|
+
kind: 'text';
|
|
995
|
+
/** The watermark text. */
|
|
996
|
+
text: string;
|
|
997
|
+
/** Font family (e.g. 'Calibri'). */
|
|
998
|
+
font: string;
|
|
999
|
+
/** Fill color as a CSS hex string (e.g. '#C0C0C0'). */
|
|
1000
|
+
color: string;
|
|
1001
|
+
/** Word's "Semitransparent" checkbox — renders at reduced opacity. */
|
|
1002
|
+
semitransparent: boolean;
|
|
1003
|
+
/** Diagonal (≈ -45°) or horizontal layout. */
|
|
1004
|
+
layout: 'diagonal' | 'horizontal';
|
|
1005
|
+
/** Font size in points. When undefined the renderer auto-sizes to the page (Word's "Auto"). */
|
|
1006
|
+
fontSize?: number;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Picture watermark — a scaled, optionally washed-out background image.
|
|
1010
|
+
*/
|
|
1011
|
+
interface PictureWatermark {
|
|
1012
|
+
kind: 'picture';
|
|
1013
|
+
/** Header-part relationship id of the media (set for images parsed from an existing file). */
|
|
1014
|
+
relId?: string;
|
|
1015
|
+
/** Package path of the media, e.g. 'word/media/image1.png'. */
|
|
1016
|
+
mediaPath?: string;
|
|
1017
|
+
/** Raw bytes for an image added in-editor (no rId yet). */
|
|
1018
|
+
data?: Uint8Array;
|
|
1019
|
+
/** MIME type for `data`. */
|
|
1020
|
+
contentType?: string;
|
|
1021
|
+
/** Ready-to-use data URL for rendering (resolved from media or `data`). */
|
|
1022
|
+
dataUrl?: string;
|
|
1023
|
+
/** Scale factor; 1 = 100% / Word's "Auto". */
|
|
1024
|
+
scale: number;
|
|
1025
|
+
/** Word's "Washout" checkbox — lightens the image so text stays readable. */
|
|
1026
|
+
washout: boolean;
|
|
1027
|
+
/** Natural width in EMUs (when known). */
|
|
1028
|
+
widthEmu?: number;
|
|
1029
|
+
/** Natural height in EMUs (when known). */
|
|
1030
|
+
heightEmu?: number;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* A document watermark — text or picture.
|
|
1034
|
+
*/
|
|
1035
|
+
type Watermark = TextWatermark | PictureWatermark;
|
|
1036
|
+
|
|
973
1037
|
/**
|
|
974
1038
|
* Page furniture — headers (`w:hdr`), footers (`w:ftr`), footnotes
|
|
975
1039
|
* (`w:footnote`), and endnotes (`w:endnote`), plus the section-level
|
|
@@ -1000,6 +1064,12 @@ interface HeaderFooter {
|
|
|
1000
1064
|
hdrFtrType: HeaderFooterType;
|
|
1001
1065
|
/** Content (paragraphs, tables, etc.) */
|
|
1002
1066
|
content: BlockContent[];
|
|
1067
|
+
/**
|
|
1068
|
+
* Watermark stored on this header (MS Word "Design → Watermark"). Lives
|
|
1069
|
+
* here, not in `content`, so it stays out of the editable text flow while
|
|
1070
|
+
* still round-tripping. Only headers carry watermarks; footers never do.
|
|
1071
|
+
*/
|
|
1072
|
+
watermark?: Watermark;
|
|
1003
1073
|
}
|
|
1004
1074
|
/**
|
|
1005
1075
|
* Footnote position
|
|
@@ -1042,12 +1112,23 @@ interface Footnote {
|
|
|
1042
1112
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1043
1113
|
/**
|
|
1044
1114
|
* Content. Per ECMA-376 §17.11.10 footnotes can hold the same blocks as
|
|
1045
|
-
* the body
|
|
1046
|
-
*
|
|
1047
|
-
*
|
|
1048
|
-
* (toProseDoc → toFlowBlocks)
|
|
1115
|
+
* the body, so the note parser reuses the body's `parseBlockContent`: the
|
|
1116
|
+
* full block model — paragraphs, tables, and block-level `w:sdt` content
|
|
1117
|
+
* controls (as `BlockSdt`) — flows through the body pipeline
|
|
1118
|
+
* (toProseDoc → toFlowBlocks) and stays editable on round-trip.
|
|
1049
1119
|
*/
|
|
1050
1120
|
content: BlockContent[];
|
|
1121
|
+
/**
|
|
1122
|
+
* Verbatim original XML of the entire `<w:footnote>` element, captured at
|
|
1123
|
+
* parse time ONLY when the note body carries a block-level construct the
|
|
1124
|
+
* model still can't represent — note-level bookmarks
|
|
1125
|
+
* (`w:bookmarkStart`/`w:bookmarkEnd`) or `w:customXml`. Block-level `w:sdt`
|
|
1126
|
+
* is NOT a trigger: it round-trips through the model as `BlockSdt`. When
|
|
1127
|
+
* present the serializer re-emits these bytes instead of rebuilding from
|
|
1128
|
+
* `content`, restoring pre-#646 fidelity for the unmodeled constructs.
|
|
1129
|
+
* See `parseNoteBlockContent` / `serializeNote` for the gate (#646 F3).
|
|
1130
|
+
*/
|
|
1131
|
+
verbatimXml?: string;
|
|
1051
1132
|
}
|
|
1052
1133
|
/**
|
|
1053
1134
|
* Endnote (w:endnote)
|
|
@@ -1060,9 +1141,12 @@ interface Endnote {
|
|
|
1060
1141
|
noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
|
|
1061
1142
|
/**
|
|
1062
1143
|
* Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
|
|
1063
|
-
* the body — paragraphs and
|
|
1144
|
+
* the body — paragraphs, tables, and block-level content controls. See note
|
|
1145
|
+
* on `Footnote.content`.
|
|
1064
1146
|
*/
|
|
1065
1147
|
content: BlockContent[];
|
|
1148
|
+
/** Verbatim original XML — see `Footnote.verbatimXml` (#646 F3). */
|
|
1149
|
+
verbatimXml?: string;
|
|
1066
1150
|
}
|
|
1067
1151
|
|
|
1068
1152
|
/**
|
|
@@ -1763,6 +1847,29 @@ interface NoteReferenceContent {
|
|
|
1763
1847
|
/** Note ID */
|
|
1764
1848
|
id: number;
|
|
1765
1849
|
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Footnote/endnote auto-number mark (`w:footnoteRef` / `w:endnoteRef`).
|
|
1852
|
+
*
|
|
1853
|
+
* Distinct from {@link NoteReferenceContent}: that is the *reference* placed in
|
|
1854
|
+
* the document body (`w:footnoteReference`), whereas this is the numbering
|
|
1855
|
+
* placeholder that lives *inside* the note body — the run carrying it is what
|
|
1856
|
+
* Word renders as the note's leading superscript number. Preserving it keeps
|
|
1857
|
+
* the note's own number visible on round-trip.
|
|
1858
|
+
*/
|
|
1859
|
+
interface NoteRefMarkContent {
|
|
1860
|
+
type: 'footnoteRefMark' | 'endnoteRefMark';
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Footnote/endnote separator mark (`w:separator` / `w:continuationSeparator`).
|
|
1864
|
+
*
|
|
1865
|
+
* These appear inside the special separator notes (`w:type="separator"` and
|
|
1866
|
+
* `w:type="continuationSeparator"`) and draw the horizontal rule Word places
|
|
1867
|
+
* between the body and its notes. They carry no content; Word rejects a notes
|
|
1868
|
+
* part whose separator notes have lost these markers, so they must round-trip.
|
|
1869
|
+
*/
|
|
1870
|
+
interface SeparatorContent {
|
|
1871
|
+
type: 'separator' | 'continuationSeparator';
|
|
1872
|
+
}
|
|
1766
1873
|
/**
|
|
1767
1874
|
* Field character (begin/separate/end)
|
|
1768
1875
|
*/
|
|
@@ -1814,7 +1921,7 @@ interface ShapeContent {
|
|
|
1814
1921
|
/**
|
|
1815
1922
|
* All possible run content types
|
|
1816
1923
|
*/
|
|
1817
|
-
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
|
|
1924
|
+
type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | NoteRefMarkContent | SeparatorContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
|
|
1818
1925
|
/**
|
|
1819
1926
|
* A run (`w:r`) — a contiguous span of inline content sharing one set of
|
|
1820
1927
|
* character properties (bold, italic, font, color, etc.). Runs are the
|
|
@@ -2121,10 +2228,20 @@ interface DocxPackage {
|
|
|
2121
2228
|
settings?: DocumentSettings;
|
|
2122
2229
|
/** Font table */
|
|
2123
2230
|
fontTable?: FontTable;
|
|
2124
|
-
/** Footnotes */
|
|
2231
|
+
/** Footnotes (normal notes only — separators live in `footnoteSeparators`) */
|
|
2125
2232
|
footnotes?: Footnote[];
|
|
2126
|
-
/** Endnotes */
|
|
2233
|
+
/** Endnotes (normal notes only — separators live in `endnoteSeparators`) */
|
|
2127
2234
|
endnotes?: Endnote[];
|
|
2235
|
+
/**
|
|
2236
|
+
* Separator footnotes (`w:type="separator"` / `"continuationSeparator"` /
|
|
2237
|
+
* `"continuationNotice"`) kept out of `footnotes` so rendering/layout only
|
|
2238
|
+
* sees real notes. Retained for round-trip: Word rejects a footnotes part
|
|
2239
|
+
* whose separator notes are missing, so the serializer re-emits these ahead
|
|
2240
|
+
* of the normal notes.
|
|
2241
|
+
*/
|
|
2242
|
+
footnoteSeparators?: Footnote[];
|
|
2243
|
+
/** Separator endnotes — see `footnoteSeparators`. */
|
|
2244
|
+
endnoteSeparators?: Endnote[];
|
|
2128
2245
|
/** Headers by relationship ID */
|
|
2129
2246
|
headers?: Map<string, HeaderFooter>;
|
|
2130
2247
|
/** Footers by relationship ID */
|
|
@@ -2218,7 +2335,24 @@ interface ReviewChange {
|
|
|
2218
2335
|
date: string | null;
|
|
2219
2336
|
text: string;
|
|
2220
2337
|
context: string;
|
|
2338
|
+
/**
|
|
2339
|
+
* Index of the containing paragraph. For body changes this is the
|
|
2340
|
+
* document-wide paragraph index; for note changes it is the paragraph index
|
|
2341
|
+
* *within that note* (note bodies have their own numbering), so pair it with
|
|
2342
|
+
* `noteId` / `noteType` rather than reading it as a body index.
|
|
2343
|
+
*/
|
|
2221
2344
|
paragraphIndex: number;
|
|
2345
|
+
/**
|
|
2346
|
+
* Set when the change lives inside a footnote or endnote. Such changes are
|
|
2347
|
+
* surfaced for discovery only — accept/reject operate on the body, so an id
|
|
2348
|
+
* that resolves *only* to a note change throws `NoteChangeNotEditableError`
|
|
2349
|
+
* (an id also present on a body change resolves to the body change). The
|
|
2350
|
+
* raw `id` is not namespaced across parts, so pair it with `noteId` /
|
|
2351
|
+
* `noteType` to identify the change.
|
|
2352
|
+
*/
|
|
2353
|
+
noteId?: number;
|
|
2354
|
+
/** Which note store the change came from. Absent for body changes. */
|
|
2355
|
+
noteType?: 'footnote' | 'endnote';
|
|
2222
2356
|
}
|
|
2223
2357
|
interface ReviewCommentReply {
|
|
2224
2358
|
id: number;
|
|
@@ -2239,6 +2373,10 @@ interface ReviewComment {
|
|
|
2239
2373
|
interface ChangeFilter {
|
|
2240
2374
|
author?: string;
|
|
2241
2375
|
type?: 'insertion' | 'deletion' | 'moveFrom' | 'moveTo';
|
|
2376
|
+
/** Also report tracked changes inside footnote bodies. Default: false. */
|
|
2377
|
+
includeFootnotes?: boolean;
|
|
2378
|
+
/** Also report tracked changes inside endnote bodies. Default: false. */
|
|
2379
|
+
includeEndnotes?: boolean;
|
|
2242
2380
|
}
|
|
2243
2381
|
interface CommentFilter {
|
|
2244
2382
|
author?: string;
|
|
@@ -2457,7 +2595,21 @@ declare class DocxReviewer {
|
|
|
2457
2595
|
* Avoids JSON quote-escaping issues — LLMs can copy text verbatim.
|
|
2458
2596
|
*/
|
|
2459
2597
|
getContentAsText(options?: GetContentOptions): string;
|
|
2460
|
-
/**
|
|
2598
|
+
/**
|
|
2599
|
+
* Get all tracked changes in the document. Pass `includeFootnotes` /
|
|
2600
|
+
* `includeEndnotes` in the filter to also report changes inside note bodies
|
|
2601
|
+
* (each such change carries `noteId` / `noteType`).
|
|
2602
|
+
*
|
|
2603
|
+
* The reported `id` is the raw `w:id`, which is unique only within its part
|
|
2604
|
+
* (document.xml / footnotes.xml / endnotes.xml) — it is NOT namespaced across
|
|
2605
|
+
* parts, so the same `id` can appear on a body change and a note change. Use
|
|
2606
|
+
* `noteType` / `noteId` to disambiguate.
|
|
2607
|
+
*
|
|
2608
|
+
* Note changes are surfaced for discovery only. `acceptChange` /
|
|
2609
|
+
* `rejectChange` operate on the document body, so an id that resolves *only*
|
|
2610
|
+
* to a note change throws {@link NoteChangeNotEditableError} rather than
|
|
2611
|
+
* mutating it (an id shared with a body change resolves to the body change).
|
|
2612
|
+
*/
|
|
2461
2613
|
getChanges(filter?: ChangeFilter): ReviewChange[];
|
|
2462
2614
|
/** Get all comments with their replies. */
|
|
2463
2615
|
getComments(filter?: CommentFilter): ReviewComment[];
|
|
@@ -2505,9 +2657,38 @@ declare class DocxReviewer {
|
|
|
2505
2657
|
proposeInsertion(options: ProposeInsertionOptions): void;
|
|
2506
2658
|
/** Delete text as a tracked change. */
|
|
2507
2659
|
proposeDeletion(options: ProposeDeletionOptions): void;
|
|
2508
|
-
/**
|
|
2660
|
+
/**
|
|
2661
|
+
* Guard the body-only accept/reject path against in-note changes.
|
|
2662
|
+
*
|
|
2663
|
+
* A tracked-change `w:id` is unique only within its part, so the same id can
|
|
2664
|
+
* appear in the body and in a footnote/endnote. When the id resolves to a
|
|
2665
|
+
* body change we let the body-only impl handle it (body wins; the note, if
|
|
2666
|
+
* any, is left untouched). When the id resolves ONLY to a note change we fail
|
|
2667
|
+
* closed with {@link NoteChangeNotEditableError} rather than mis-reporting it
|
|
2668
|
+
* as not-found — accept/reject cannot yet mutate note bodies.
|
|
2669
|
+
*/
|
|
2670
|
+
private assertNotNoteOnly;
|
|
2671
|
+
/**
|
|
2672
|
+
* Accept a tracked change by its revision ID. Operates on the document body
|
|
2673
|
+
* only.
|
|
2674
|
+
*
|
|
2675
|
+
* The public `id` is a `w:id`, which is unique only within its part, so the
|
|
2676
|
+
* same id may appear in the body and in a footnote/endnote. Resolution is
|
|
2677
|
+
* body-first: if a body change carries this id it is accepted and any
|
|
2678
|
+
* same-id note change is left untouched. If the id resolves *only* to a note
|
|
2679
|
+
* change, this throws {@link NoteChangeNotEditableError} (note bodies are not
|
|
2680
|
+
* yet mutable here). If it resolves to nothing, it throws
|
|
2681
|
+
* {@link ChangeNotFoundError}.
|
|
2682
|
+
*/
|
|
2509
2683
|
acceptChange(id: number): void;
|
|
2510
|
-
/**
|
|
2684
|
+
/**
|
|
2685
|
+
* Reject a tracked change by its revision ID. Operates on the document body
|
|
2686
|
+
* only.
|
|
2687
|
+
*
|
|
2688
|
+
* Same resolution rules as {@link acceptChange}: body-first, throws
|
|
2689
|
+
* {@link NoteChangeNotEditableError} for a note-only id, and
|
|
2690
|
+
* {@link ChangeNotFoundError} when the id matches nothing.
|
|
2691
|
+
*/
|
|
2511
2692
|
rejectChange(id: number): void;
|
|
2512
2693
|
/** Accept all tracked changes. Returns count accepted. */
|
|
2513
2694
|
acceptAll(): number;
|
package/dist/server.d.mts
CHANGED
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
* @packageDocumentation
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-
|
|
34
|
+
export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-BaVhdHCd.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
* @packageDocumentation
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-
|
|
34
|
+
export { s as AgentContextSnapshot, j as AgentToolDefinition, k as AgentToolResult, D as DocxReviewer, E as EditorBridge, S as SelectionInfo, o as createReviewerBridge, n as docxAgentTools, p as executeToolCall, t as getToolDisplayName, q as getToolSchemas } from './server-BaVhdHCd.js';
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkLX3NJWKV_js=require('./chunk-LX3NJWKV.js'),chunkXUAUDUJU_js=require('./chunk-XUAUDUJU.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"DocxReviewer",{enumerable:true,get:function(){return chunkLX3NJWKV_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunkXUAUDUJU_js.n}});Object.defineProperty(exports,"docxAgentTools",{enumerable:true,get:function(){return chunkRI5S75JY_js.a}});Object.defineProperty(exports,"executeToolCall",{enumerable:true,get:function(){return chunkRI5S75JY_js.b}});Object.defineProperty(exports,"getToolDisplayName",{enumerable:true,get:function(){return chunkRI5S75JY_js.c}});Object.defineProperty(exports,"getToolSchemas",{enumerable:true,get:function(){return chunkRI5S75JY_js.d}});
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DocxReviewer}from'./chunk-
|
|
1
|
+
export{a as DocxReviewer}from'./chunk-NFAEIOLC.mjs';export{n as createReviewerBridge}from'./chunk-P4DRISTP.mjs';export{a as docxAgentTools,b as executeToolCall,c as getToolDisplayName,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';
|