@eigenpal/docx-editor-agents 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-B3LQVYMR.js +74 -0
- package/dist/{chunk-NKRT67UB.js → chunk-E6DDF6BY.js} +2 -2
- package/dist/chunk-L7LXQOTH.mjs +74 -0
- package/dist/chunk-OCMVGKIA.mjs +5 -0
- package/dist/{chunk-XQG2G2LT.mjs → chunk-ON5FX5NO.mjs} +1 -1
- package/dist/{chunk-UIE7JPED.mjs → chunk-QU2WUEX3.mjs} +1 -1
- package/dist/{chunk-VGEZQUGC.js → chunk-UXHK7C33.js} +1 -1
- package/dist/chunk-ZDQ7OJ6K.js +5 -0
- package/dist/headless-6C4JSKYY.mjs +1 -0
- package/dist/headless-VGNLVFAJ.js +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- 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-BELKcdSd.d.mts → server-uM9UUIhk.d.mts} +166 -108
- package/dist/{server-BELKcdSd.d.ts → server-uM9UUIhk.d.ts} +166 -108
- 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/package.json +1 -1
- package/dist/chunk-F22XEI77.mjs +0 -5
- package/dist/chunk-FUL3O7MO.js +0 -5
- package/dist/chunk-QPFWFH5W.mjs +0 -72
- package/dist/chunk-YNUYVVTY.js +0 -72
- package/dist/headless-B66Z373X.mjs +0 -1
- package/dist/headless-Y3JKFH2E.js +0 -1
|
@@ -970,111 +970,6 @@ interface Table {
|
|
|
970
970
|
rows: TableRow[];
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
/**
|
|
974
|
-
* Structured Document Tags / content controls (`w:sdt`) — inline and
|
|
975
|
-
* block variants, plus properties (alias, tag, lock, list items,
|
|
976
|
-
* checkbox state) for the supported SDT types.
|
|
977
|
-
*/
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* SDT type (content control type)
|
|
981
|
-
*/
|
|
982
|
-
type SdtType = 'richText' | 'plainText' | 'date' | 'dropdown' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'unknown';
|
|
983
|
-
/**
|
|
984
|
-
* SDT properties (w:sdtPr)
|
|
985
|
-
*/
|
|
986
|
-
interface SdtProperties {
|
|
987
|
-
/** SDT type */
|
|
988
|
-
sdtType: SdtType;
|
|
989
|
-
/** Alias (friendly name) */
|
|
990
|
-
alias?: string;
|
|
991
|
-
/** Tag (developer identifier) */
|
|
992
|
-
tag?: string;
|
|
993
|
-
/** Lock content editing */
|
|
994
|
-
lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
|
|
995
|
-
/** Placeholder text */
|
|
996
|
-
placeholder?: string;
|
|
997
|
-
/** Whether showing placeholder */
|
|
998
|
-
showingPlaceholder?: boolean;
|
|
999
|
-
/** Date format for date controls */
|
|
1000
|
-
dateFormat?: string;
|
|
1001
|
-
/** Dropdown/combobox list items */
|
|
1002
|
-
listItems?: {
|
|
1003
|
-
displayText: string;
|
|
1004
|
-
value: string;
|
|
1005
|
-
}[];
|
|
1006
|
-
/** Checkbox checked state */
|
|
1007
|
-
checked?: boolean;
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Inline SDT (content control within a paragraph)
|
|
1011
|
-
*/
|
|
1012
|
-
interface InlineSdt {
|
|
1013
|
-
type: 'inlineSdt';
|
|
1014
|
-
/** SDT properties */
|
|
1015
|
-
properties: SdtProperties;
|
|
1016
|
-
/**
|
|
1017
|
-
* Inline content held inside the control. OOXML allows runs,
|
|
1018
|
-
* hyperlinks, simple/complex fields, nested SDTs, and math at this
|
|
1019
|
-
* level; the renderer must descend into all of them so docProps-bound
|
|
1020
|
-
* fields and similar template content survive paged rendering.
|
|
1021
|
-
*/
|
|
1022
|
-
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
|
|
1023
|
-
}
|
|
1024
|
-
/**
|
|
1025
|
-
* Block-level SDT (content control wrapping paragraphs/tables)
|
|
1026
|
-
*/
|
|
1027
|
-
interface BlockSdt {
|
|
1028
|
-
type: 'blockSdt';
|
|
1029
|
-
/** SDT properties */
|
|
1030
|
-
properties: SdtProperties;
|
|
1031
|
-
/** Block content inside the control */
|
|
1032
|
-
content: (Paragraph | Table)[];
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* Comments (`w:comment` in `comments.xml`) and the inline range markers
|
|
1037
|
-
* (`w:commentRangeStart`/`End`) that anchor them inside paragraphs.
|
|
1038
|
-
*/
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* A comment from `comments.xml` — the top-level entity for review
|
|
1042
|
-
* comments and replies. `id` matches the inline `CommentRangeStart` /
|
|
1043
|
-
* `CommentRangeEnd` markers that anchor it inside a paragraph; `parentId`
|
|
1044
|
-
* threads replies under their parent; `done` reflects Word's "Resolve"
|
|
1045
|
-
* state (`w15:done`).
|
|
1046
|
-
*/
|
|
1047
|
-
interface Comment {
|
|
1048
|
-
/** Comment ID (matches commentRangeStart/End) */
|
|
1049
|
-
id: number;
|
|
1050
|
-
/** Author name */
|
|
1051
|
-
author: string;
|
|
1052
|
-
/** Author initials */
|
|
1053
|
-
initials?: string;
|
|
1054
|
-
/** Date */
|
|
1055
|
-
date?: string;
|
|
1056
|
-
/** Comment content (paragraphs) */
|
|
1057
|
-
content: Paragraph[];
|
|
1058
|
-
/** Parent comment ID (for replies) */
|
|
1059
|
-
parentId?: number;
|
|
1060
|
-
/** Whether the comment is resolved/done */
|
|
1061
|
-
done?: boolean;
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Comment range start marker in paragraph content
|
|
1065
|
-
*/
|
|
1066
|
-
interface CommentRangeStart {
|
|
1067
|
-
type: 'commentRangeStart';
|
|
1068
|
-
id: number;
|
|
1069
|
-
}
|
|
1070
|
-
/**
|
|
1071
|
-
* Comment range end marker in paragraph content
|
|
1072
|
-
*/
|
|
1073
|
-
interface CommentRangeEnd {
|
|
1074
|
-
type: 'commentRangeEnd';
|
|
1075
|
-
id: number;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
973
|
/**
|
|
1079
974
|
* Page furniture — headers (`w:hdr`), footers (`w:ftr`), footnotes
|
|
1080
975
|
* (`w:footnote`), and endnotes (`w:endnote`), plus the section-level
|
|
@@ -1104,7 +999,7 @@ interface HeaderFooter {
|
|
|
1104
999
|
/** Header/footer type */
|
|
1105
1000
|
hdrFtrType: HeaderFooterType;
|
|
1106
1001
|
/** Content (paragraphs, tables, etc.) */
|
|
1107
|
-
content:
|
|
1002
|
+
content: BlockContent[];
|
|
1108
1003
|
}
|
|
1109
1004
|
/**
|
|
1110
1005
|
* Footnote position
|
|
@@ -1152,7 +1047,7 @@ interface Footnote {
|
|
|
1152
1047
|
* widened to match HeaderFooter / TableCell shape so the body pipeline
|
|
1153
1048
|
* (toProseDoc → toFlowBlocks) can render them uniformly.
|
|
1154
1049
|
*/
|
|
1155
|
-
content:
|
|
1050
|
+
content: BlockContent[];
|
|
1156
1051
|
}
|
|
1157
1052
|
/**
|
|
1158
1053
|
* Endnote (w:endnote)
|
|
@@ -1167,7 +1062,50 @@ interface Endnote {
|
|
|
1167
1062
|
* Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
|
|
1168
1063
|
* the body — paragraphs and tables. See note on `Footnote.content`.
|
|
1169
1064
|
*/
|
|
1170
|
-
content:
|
|
1065
|
+
content: BlockContent[];
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* Comments (`w:comment` in `comments.xml`) and the inline range markers
|
|
1070
|
+
* (`w:commentRangeStart`/`End`) that anchor them inside paragraphs.
|
|
1071
|
+
*/
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* A comment from `comments.xml` — the top-level entity for review
|
|
1075
|
+
* comments and replies. `id` matches the inline `CommentRangeStart` /
|
|
1076
|
+
* `CommentRangeEnd` markers that anchor it inside a paragraph; `parentId`
|
|
1077
|
+
* threads replies under their parent; `done` reflects Word's "Resolve"
|
|
1078
|
+
* state (`w15:done`).
|
|
1079
|
+
*/
|
|
1080
|
+
interface Comment {
|
|
1081
|
+
/** Comment ID (matches commentRangeStart/End) */
|
|
1082
|
+
id: number;
|
|
1083
|
+
/** Author name */
|
|
1084
|
+
author: string;
|
|
1085
|
+
/** Author initials */
|
|
1086
|
+
initials?: string;
|
|
1087
|
+
/** Date */
|
|
1088
|
+
date?: string;
|
|
1089
|
+
/** Comment content (paragraphs) */
|
|
1090
|
+
content: Paragraph[];
|
|
1091
|
+
/** Parent comment ID (for replies) */
|
|
1092
|
+
parentId?: number;
|
|
1093
|
+
/** Whether the comment is resolved/done */
|
|
1094
|
+
done?: boolean;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Comment range start marker in paragraph content
|
|
1098
|
+
*/
|
|
1099
|
+
interface CommentRangeStart {
|
|
1100
|
+
type: 'commentRangeStart';
|
|
1101
|
+
id: number;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Comment range end marker in paragraph content
|
|
1105
|
+
*/
|
|
1106
|
+
interface CommentRangeEnd {
|
|
1107
|
+
type: 'commentRangeEnd';
|
|
1108
|
+
id: number;
|
|
1171
1109
|
}
|
|
1172
1110
|
|
|
1173
1111
|
/**
|
|
@@ -1342,6 +1280,126 @@ interface DocumentBody {
|
|
|
1342
1280
|
comments?: Comment[];
|
|
1343
1281
|
}
|
|
1344
1282
|
|
|
1283
|
+
/**
|
|
1284
|
+
* Structured Document Tags / content controls (`w:sdt`) — inline and
|
|
1285
|
+
* block variants, plus properties (alias, tag, lock, list items,
|
|
1286
|
+
* checkbox state) for the supported SDT types.
|
|
1287
|
+
*/
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* SDT type (content control type).
|
|
1291
|
+
*
|
|
1292
|
+
* Values mirror the `w:sdtPr` type-marker element names from ECMA-376
|
|
1293
|
+
* §17.5.2 (`CT_SdtPr`), with two deliberate exceptions:
|
|
1294
|
+
* - `checkbox` is the `w14:checkbox` (Office 2010) extension, not a base
|
|
1295
|
+
* OOXML type marker.
|
|
1296
|
+
* - `buildingBlockGallery` covers both `w:docPartObj` and `w:docPartList`.
|
|
1297
|
+
*
|
|
1298
|
+
* A `w:sdtPr` with no type marker means `richText` (the spec default). A
|
|
1299
|
+
* type marker the parser does not model maps to `unknown` — it is never
|
|
1300
|
+
* coerced to `richText`, so the projection stays honest. Round-trip
|
|
1301
|
+
* fidelity does not depend on this enum: the raw `w:sdtPr` is replayed
|
|
1302
|
+
* verbatim (see `rawPropertiesXml`).
|
|
1303
|
+
*/
|
|
1304
|
+
type SdtType = 'richText' | 'plainText' | 'date' | 'dropDownList' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'equation' | 'citation' | 'bibliography' | 'unknown';
|
|
1305
|
+
/**
|
|
1306
|
+
* XML data binding (`w:dataBinding`) — links a content control to a node in a
|
|
1307
|
+
* Custom XML data store. Modeled read-only; the binding round-trips verbatim
|
|
1308
|
+
* via `rawPropertiesXml` (this projection is for inspection, e.g. "which
|
|
1309
|
+
* controls are bound, and to what XPath"). The editor does not resolve or
|
|
1310
|
+
* sync bound values.
|
|
1311
|
+
*/
|
|
1312
|
+
interface SdtDataBinding {
|
|
1313
|
+
/** XPath into the bound Custom XML part (`w:xpath`). */
|
|
1314
|
+
xpath?: string;
|
|
1315
|
+
/** Target Custom XML store id (`w:storeItemID`). */
|
|
1316
|
+
storeItemID?: string;
|
|
1317
|
+
/** Namespace prefix mappings used by the XPath (`w:prefixMappings`). */
|
|
1318
|
+
prefixMappings?: string;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* SDT properties (`w:sdtPr`).
|
|
1322
|
+
*
|
|
1323
|
+
* The modeled fields are a **read-only projection** for downstream tooling
|
|
1324
|
+
* (tag/alias addressing, template extraction). They are NOT the
|
|
1325
|
+
* serialization source: the original `w:sdtPr` is captured verbatim in
|
|
1326
|
+
* `rawPropertiesXml` and replayed on save, which preserves element order
|
|
1327
|
+
* (`CT_SdtPr` is an `xsd:sequence`), avoids double-emission, and keeps
|
|
1328
|
+
* unmodeled features (data binding, `w15:*`, `@lastValue`) lossless.
|
|
1329
|
+
*/
|
|
1330
|
+
interface SdtProperties {
|
|
1331
|
+
/** SDT type (projection; see {@link SdtType}). */
|
|
1332
|
+
sdtType: SdtType;
|
|
1333
|
+
/** Unique numeric id (`w:id`, signed). */
|
|
1334
|
+
id?: number;
|
|
1335
|
+
/** Alias (friendly name, `w:alias`). */
|
|
1336
|
+
alias?: string;
|
|
1337
|
+
/** Tag (developer identifier, `w:tag`). */
|
|
1338
|
+
tag?: string;
|
|
1339
|
+
/** Lock setting (`w:lock`). */
|
|
1340
|
+
lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
|
|
1341
|
+
/**
|
|
1342
|
+
* Placeholder building-block name (`w:placeholder/w:docPart@w:val`).
|
|
1343
|
+
* This is a reference to a glossary docPart that supplies the placeholder
|
|
1344
|
+
* content — NOT the literal placeholder text.
|
|
1345
|
+
*/
|
|
1346
|
+
placeholder?: string;
|
|
1347
|
+
/** Whether the control is currently showing its placeholder (`w:showingPlcHdr`). */
|
|
1348
|
+
showingPlaceholder?: boolean;
|
|
1349
|
+
/** Date format for date controls (`w:date@w:fullDate`). */
|
|
1350
|
+
dateFormat?: string;
|
|
1351
|
+
/** Dropdown/combobox list items. */
|
|
1352
|
+
listItems?: {
|
|
1353
|
+
displayText: string;
|
|
1354
|
+
value: string;
|
|
1355
|
+
}[];
|
|
1356
|
+
/** Checkbox checked state (`w14:checkbox`). */
|
|
1357
|
+
checked?: boolean;
|
|
1358
|
+
/** XML data binding (`w:dataBinding`), if the control is bound. */
|
|
1359
|
+
dataBinding?: SdtDataBinding;
|
|
1360
|
+
/**
|
|
1361
|
+
* The original `<w:sdtPr>` serialized verbatim as an XML string, captured
|
|
1362
|
+
* at parse time. Replayed unchanged on save so the properties block
|
|
1363
|
+
* round-trips losslessly. Stored as a string (not an `XmlElement`) so the
|
|
1364
|
+
* types layer stays free of the parser/`xml-js` dependency. Absent for
|
|
1365
|
+
* SDTs created programmatically — the serializer then synthesizes a
|
|
1366
|
+
* minimal, sequence-valid `w:sdtPr` from the modeled fields.
|
|
1367
|
+
*/
|
|
1368
|
+
rawPropertiesXml?: string;
|
|
1369
|
+
/** The original `<w:sdtEndPr>` serialized verbatim, if present. */
|
|
1370
|
+
rawEndPropertiesXml?: string;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Inline SDT (content control within a paragraph)
|
|
1374
|
+
*/
|
|
1375
|
+
interface InlineSdt {
|
|
1376
|
+
type: 'inlineSdt';
|
|
1377
|
+
/** SDT properties */
|
|
1378
|
+
properties: SdtProperties;
|
|
1379
|
+
/**
|
|
1380
|
+
* Inline content held inside the control. OOXML allows runs,
|
|
1381
|
+
* hyperlinks, simple/complex fields, nested SDTs, and math at this
|
|
1382
|
+
* level; the renderer must descend into all of them so docProps-bound
|
|
1383
|
+
* fields and similar template content survive paged rendering.
|
|
1384
|
+
*/
|
|
1385
|
+
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Block-level SDT (content control wrapping block content).
|
|
1389
|
+
*
|
|
1390
|
+
* `content` is `BlockContent[]` (not just paragraphs/tables) so a nested
|
|
1391
|
+
* block SDT survives the round trip. `CT_SdtContentBlock` also permits
|
|
1392
|
+
* run-level content (bookmarks, etc.); that is carried through the same
|
|
1393
|
+
* block-content parsing as elsewhere in the document.
|
|
1394
|
+
*/
|
|
1395
|
+
interface BlockSdt {
|
|
1396
|
+
type: 'blockSdt';
|
|
1397
|
+
/** SDT properties */
|
|
1398
|
+
properties: SdtProperties;
|
|
1399
|
+
/** Block content inside the control */
|
|
1400
|
+
content: BlockContent[];
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1345
1403
|
/**
|
|
1346
1404
|
* Paragraph (`w:p`) — the union of inline content that can sit inside a
|
|
1347
1405
|
* paragraph (runs, hyperlinks, bookmarks, fields, SDT, comment ranges,
|
|
@@ -970,111 +970,6 @@ interface Table {
|
|
|
970
970
|
rows: TableRow[];
|
|
971
971
|
}
|
|
972
972
|
|
|
973
|
-
/**
|
|
974
|
-
* Structured Document Tags / content controls (`w:sdt`) — inline and
|
|
975
|
-
* block variants, plus properties (alias, tag, lock, list items,
|
|
976
|
-
* checkbox state) for the supported SDT types.
|
|
977
|
-
*/
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* SDT type (content control type)
|
|
981
|
-
*/
|
|
982
|
-
type SdtType = 'richText' | 'plainText' | 'date' | 'dropdown' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'unknown';
|
|
983
|
-
/**
|
|
984
|
-
* SDT properties (w:sdtPr)
|
|
985
|
-
*/
|
|
986
|
-
interface SdtProperties {
|
|
987
|
-
/** SDT type */
|
|
988
|
-
sdtType: SdtType;
|
|
989
|
-
/** Alias (friendly name) */
|
|
990
|
-
alias?: string;
|
|
991
|
-
/** Tag (developer identifier) */
|
|
992
|
-
tag?: string;
|
|
993
|
-
/** Lock content editing */
|
|
994
|
-
lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
|
|
995
|
-
/** Placeholder text */
|
|
996
|
-
placeholder?: string;
|
|
997
|
-
/** Whether showing placeholder */
|
|
998
|
-
showingPlaceholder?: boolean;
|
|
999
|
-
/** Date format for date controls */
|
|
1000
|
-
dateFormat?: string;
|
|
1001
|
-
/** Dropdown/combobox list items */
|
|
1002
|
-
listItems?: {
|
|
1003
|
-
displayText: string;
|
|
1004
|
-
value: string;
|
|
1005
|
-
}[];
|
|
1006
|
-
/** Checkbox checked state */
|
|
1007
|
-
checked?: boolean;
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Inline SDT (content control within a paragraph)
|
|
1011
|
-
*/
|
|
1012
|
-
interface InlineSdt {
|
|
1013
|
-
type: 'inlineSdt';
|
|
1014
|
-
/** SDT properties */
|
|
1015
|
-
properties: SdtProperties;
|
|
1016
|
-
/**
|
|
1017
|
-
* Inline content held inside the control. OOXML allows runs,
|
|
1018
|
-
* hyperlinks, simple/complex fields, nested SDTs, and math at this
|
|
1019
|
-
* level; the renderer must descend into all of them so docProps-bound
|
|
1020
|
-
* fields and similar template content survive paged rendering.
|
|
1021
|
-
*/
|
|
1022
|
-
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
|
|
1023
|
-
}
|
|
1024
|
-
/**
|
|
1025
|
-
* Block-level SDT (content control wrapping paragraphs/tables)
|
|
1026
|
-
*/
|
|
1027
|
-
interface BlockSdt {
|
|
1028
|
-
type: 'blockSdt';
|
|
1029
|
-
/** SDT properties */
|
|
1030
|
-
properties: SdtProperties;
|
|
1031
|
-
/** Block content inside the control */
|
|
1032
|
-
content: (Paragraph | Table)[];
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* Comments (`w:comment` in `comments.xml`) and the inline range markers
|
|
1037
|
-
* (`w:commentRangeStart`/`End`) that anchor them inside paragraphs.
|
|
1038
|
-
*/
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* A comment from `comments.xml` — the top-level entity for review
|
|
1042
|
-
* comments and replies. `id` matches the inline `CommentRangeStart` /
|
|
1043
|
-
* `CommentRangeEnd` markers that anchor it inside a paragraph; `parentId`
|
|
1044
|
-
* threads replies under their parent; `done` reflects Word's "Resolve"
|
|
1045
|
-
* state (`w15:done`).
|
|
1046
|
-
*/
|
|
1047
|
-
interface Comment {
|
|
1048
|
-
/** Comment ID (matches commentRangeStart/End) */
|
|
1049
|
-
id: number;
|
|
1050
|
-
/** Author name */
|
|
1051
|
-
author: string;
|
|
1052
|
-
/** Author initials */
|
|
1053
|
-
initials?: string;
|
|
1054
|
-
/** Date */
|
|
1055
|
-
date?: string;
|
|
1056
|
-
/** Comment content (paragraphs) */
|
|
1057
|
-
content: Paragraph[];
|
|
1058
|
-
/** Parent comment ID (for replies) */
|
|
1059
|
-
parentId?: number;
|
|
1060
|
-
/** Whether the comment is resolved/done */
|
|
1061
|
-
done?: boolean;
|
|
1062
|
-
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Comment range start marker in paragraph content
|
|
1065
|
-
*/
|
|
1066
|
-
interface CommentRangeStart {
|
|
1067
|
-
type: 'commentRangeStart';
|
|
1068
|
-
id: number;
|
|
1069
|
-
}
|
|
1070
|
-
/**
|
|
1071
|
-
* Comment range end marker in paragraph content
|
|
1072
|
-
*/
|
|
1073
|
-
interface CommentRangeEnd {
|
|
1074
|
-
type: 'commentRangeEnd';
|
|
1075
|
-
id: number;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
973
|
/**
|
|
1079
974
|
* Page furniture — headers (`w:hdr`), footers (`w:ftr`), footnotes
|
|
1080
975
|
* (`w:footnote`), and endnotes (`w:endnote`), plus the section-level
|
|
@@ -1104,7 +999,7 @@ interface HeaderFooter {
|
|
|
1104
999
|
/** Header/footer type */
|
|
1105
1000
|
hdrFtrType: HeaderFooterType;
|
|
1106
1001
|
/** Content (paragraphs, tables, etc.) */
|
|
1107
|
-
content:
|
|
1002
|
+
content: BlockContent[];
|
|
1108
1003
|
}
|
|
1109
1004
|
/**
|
|
1110
1005
|
* Footnote position
|
|
@@ -1152,7 +1047,7 @@ interface Footnote {
|
|
|
1152
1047
|
* widened to match HeaderFooter / TableCell shape so the body pipeline
|
|
1153
1048
|
* (toProseDoc → toFlowBlocks) can render them uniformly.
|
|
1154
1049
|
*/
|
|
1155
|
-
content:
|
|
1050
|
+
content: BlockContent[];
|
|
1156
1051
|
}
|
|
1157
1052
|
/**
|
|
1158
1053
|
* Endnote (w:endnote)
|
|
@@ -1167,7 +1062,50 @@ interface Endnote {
|
|
|
1167
1062
|
* Content. Per ECMA-376 §17.11.4 endnotes can hold the same blocks as
|
|
1168
1063
|
* the body — paragraphs and tables. See note on `Footnote.content`.
|
|
1169
1064
|
*/
|
|
1170
|
-
content:
|
|
1065
|
+
content: BlockContent[];
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* Comments (`w:comment` in `comments.xml`) and the inline range markers
|
|
1070
|
+
* (`w:commentRangeStart`/`End`) that anchor them inside paragraphs.
|
|
1071
|
+
*/
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* A comment from `comments.xml` — the top-level entity for review
|
|
1075
|
+
* comments and replies. `id` matches the inline `CommentRangeStart` /
|
|
1076
|
+
* `CommentRangeEnd` markers that anchor it inside a paragraph; `parentId`
|
|
1077
|
+
* threads replies under their parent; `done` reflects Word's "Resolve"
|
|
1078
|
+
* state (`w15:done`).
|
|
1079
|
+
*/
|
|
1080
|
+
interface Comment {
|
|
1081
|
+
/** Comment ID (matches commentRangeStart/End) */
|
|
1082
|
+
id: number;
|
|
1083
|
+
/** Author name */
|
|
1084
|
+
author: string;
|
|
1085
|
+
/** Author initials */
|
|
1086
|
+
initials?: string;
|
|
1087
|
+
/** Date */
|
|
1088
|
+
date?: string;
|
|
1089
|
+
/** Comment content (paragraphs) */
|
|
1090
|
+
content: Paragraph[];
|
|
1091
|
+
/** Parent comment ID (for replies) */
|
|
1092
|
+
parentId?: number;
|
|
1093
|
+
/** Whether the comment is resolved/done */
|
|
1094
|
+
done?: boolean;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Comment range start marker in paragraph content
|
|
1098
|
+
*/
|
|
1099
|
+
interface CommentRangeStart {
|
|
1100
|
+
type: 'commentRangeStart';
|
|
1101
|
+
id: number;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* Comment range end marker in paragraph content
|
|
1105
|
+
*/
|
|
1106
|
+
interface CommentRangeEnd {
|
|
1107
|
+
type: 'commentRangeEnd';
|
|
1108
|
+
id: number;
|
|
1171
1109
|
}
|
|
1172
1110
|
|
|
1173
1111
|
/**
|
|
@@ -1342,6 +1280,126 @@ interface DocumentBody {
|
|
|
1342
1280
|
comments?: Comment[];
|
|
1343
1281
|
}
|
|
1344
1282
|
|
|
1283
|
+
/**
|
|
1284
|
+
* Structured Document Tags / content controls (`w:sdt`) — inline and
|
|
1285
|
+
* block variants, plus properties (alias, tag, lock, list items,
|
|
1286
|
+
* checkbox state) for the supported SDT types.
|
|
1287
|
+
*/
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* SDT type (content control type).
|
|
1291
|
+
*
|
|
1292
|
+
* Values mirror the `w:sdtPr` type-marker element names from ECMA-376
|
|
1293
|
+
* §17.5.2 (`CT_SdtPr`), with two deliberate exceptions:
|
|
1294
|
+
* - `checkbox` is the `w14:checkbox` (Office 2010) extension, not a base
|
|
1295
|
+
* OOXML type marker.
|
|
1296
|
+
* - `buildingBlockGallery` covers both `w:docPartObj` and `w:docPartList`.
|
|
1297
|
+
*
|
|
1298
|
+
* A `w:sdtPr` with no type marker means `richText` (the spec default). A
|
|
1299
|
+
* type marker the parser does not model maps to `unknown` — it is never
|
|
1300
|
+
* coerced to `richText`, so the projection stays honest. Round-trip
|
|
1301
|
+
* fidelity does not depend on this enum: the raw `w:sdtPr` is replayed
|
|
1302
|
+
* verbatim (see `rawPropertiesXml`).
|
|
1303
|
+
*/
|
|
1304
|
+
type SdtType = 'richText' | 'plainText' | 'date' | 'dropDownList' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'equation' | 'citation' | 'bibliography' | 'unknown';
|
|
1305
|
+
/**
|
|
1306
|
+
* XML data binding (`w:dataBinding`) — links a content control to a node in a
|
|
1307
|
+
* Custom XML data store. Modeled read-only; the binding round-trips verbatim
|
|
1308
|
+
* via `rawPropertiesXml` (this projection is for inspection, e.g. "which
|
|
1309
|
+
* controls are bound, and to what XPath"). The editor does not resolve or
|
|
1310
|
+
* sync bound values.
|
|
1311
|
+
*/
|
|
1312
|
+
interface SdtDataBinding {
|
|
1313
|
+
/** XPath into the bound Custom XML part (`w:xpath`). */
|
|
1314
|
+
xpath?: string;
|
|
1315
|
+
/** Target Custom XML store id (`w:storeItemID`). */
|
|
1316
|
+
storeItemID?: string;
|
|
1317
|
+
/** Namespace prefix mappings used by the XPath (`w:prefixMappings`). */
|
|
1318
|
+
prefixMappings?: string;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* SDT properties (`w:sdtPr`).
|
|
1322
|
+
*
|
|
1323
|
+
* The modeled fields are a **read-only projection** for downstream tooling
|
|
1324
|
+
* (tag/alias addressing, template extraction). They are NOT the
|
|
1325
|
+
* serialization source: the original `w:sdtPr` is captured verbatim in
|
|
1326
|
+
* `rawPropertiesXml` and replayed on save, which preserves element order
|
|
1327
|
+
* (`CT_SdtPr` is an `xsd:sequence`), avoids double-emission, and keeps
|
|
1328
|
+
* unmodeled features (data binding, `w15:*`, `@lastValue`) lossless.
|
|
1329
|
+
*/
|
|
1330
|
+
interface SdtProperties {
|
|
1331
|
+
/** SDT type (projection; see {@link SdtType}). */
|
|
1332
|
+
sdtType: SdtType;
|
|
1333
|
+
/** Unique numeric id (`w:id`, signed). */
|
|
1334
|
+
id?: number;
|
|
1335
|
+
/** Alias (friendly name, `w:alias`). */
|
|
1336
|
+
alias?: string;
|
|
1337
|
+
/** Tag (developer identifier, `w:tag`). */
|
|
1338
|
+
tag?: string;
|
|
1339
|
+
/** Lock setting (`w:lock`). */
|
|
1340
|
+
lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
|
|
1341
|
+
/**
|
|
1342
|
+
* Placeholder building-block name (`w:placeholder/w:docPart@w:val`).
|
|
1343
|
+
* This is a reference to a glossary docPart that supplies the placeholder
|
|
1344
|
+
* content — NOT the literal placeholder text.
|
|
1345
|
+
*/
|
|
1346
|
+
placeholder?: string;
|
|
1347
|
+
/** Whether the control is currently showing its placeholder (`w:showingPlcHdr`). */
|
|
1348
|
+
showingPlaceholder?: boolean;
|
|
1349
|
+
/** Date format for date controls (`w:date@w:fullDate`). */
|
|
1350
|
+
dateFormat?: string;
|
|
1351
|
+
/** Dropdown/combobox list items. */
|
|
1352
|
+
listItems?: {
|
|
1353
|
+
displayText: string;
|
|
1354
|
+
value: string;
|
|
1355
|
+
}[];
|
|
1356
|
+
/** Checkbox checked state (`w14:checkbox`). */
|
|
1357
|
+
checked?: boolean;
|
|
1358
|
+
/** XML data binding (`w:dataBinding`), if the control is bound. */
|
|
1359
|
+
dataBinding?: SdtDataBinding;
|
|
1360
|
+
/**
|
|
1361
|
+
* The original `<w:sdtPr>` serialized verbatim as an XML string, captured
|
|
1362
|
+
* at parse time. Replayed unchanged on save so the properties block
|
|
1363
|
+
* round-trips losslessly. Stored as a string (not an `XmlElement`) so the
|
|
1364
|
+
* types layer stays free of the parser/`xml-js` dependency. Absent for
|
|
1365
|
+
* SDTs created programmatically — the serializer then synthesizes a
|
|
1366
|
+
* minimal, sequence-valid `w:sdtPr` from the modeled fields.
|
|
1367
|
+
*/
|
|
1368
|
+
rawPropertiesXml?: string;
|
|
1369
|
+
/** The original `<w:sdtEndPr>` serialized verbatim, if present. */
|
|
1370
|
+
rawEndPropertiesXml?: string;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Inline SDT (content control within a paragraph)
|
|
1374
|
+
*/
|
|
1375
|
+
interface InlineSdt {
|
|
1376
|
+
type: 'inlineSdt';
|
|
1377
|
+
/** SDT properties */
|
|
1378
|
+
properties: SdtProperties;
|
|
1379
|
+
/**
|
|
1380
|
+
* Inline content held inside the control. OOXML allows runs,
|
|
1381
|
+
* hyperlinks, simple/complex fields, nested SDTs, and math at this
|
|
1382
|
+
* level; the renderer must descend into all of them so docProps-bound
|
|
1383
|
+
* fields and similar template content survive paged rendering.
|
|
1384
|
+
*/
|
|
1385
|
+
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Block-level SDT (content control wrapping block content).
|
|
1389
|
+
*
|
|
1390
|
+
* `content` is `BlockContent[]` (not just paragraphs/tables) so a nested
|
|
1391
|
+
* block SDT survives the round trip. `CT_SdtContentBlock` also permits
|
|
1392
|
+
* run-level content (bookmarks, etc.); that is carried through the same
|
|
1393
|
+
* block-content parsing as elsewhere in the document.
|
|
1394
|
+
*/
|
|
1395
|
+
interface BlockSdt {
|
|
1396
|
+
type: 'blockSdt';
|
|
1397
|
+
/** SDT properties */
|
|
1398
|
+
properties: SdtProperties;
|
|
1399
|
+
/** Block content inside the control */
|
|
1400
|
+
content: BlockContent[];
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1345
1403
|
/**
|
|
1346
1404
|
* Paragraph (`w:p`) — the union of inline content that can sit inside a
|
|
1347
1405
|
* paragraph (runs, hyperlinks, bookmarks, fields, SDT, comment ranges,
|
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-uM9UUIhk.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-uM9UUIhk.js';
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkUXHK7C33_js=require('./chunk-UXHK7C33.js'),chunkZDQ7OJ6K_js=require('./chunk-ZDQ7OJ6K.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"DocxReviewer",{enumerable:true,get:function(){return chunkUXHK7C33_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunkZDQ7OJ6K_js.m}});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-QU2WUEX3.mjs';export{m as createReviewerBridge}from'./chunk-OCMVGKIA.mjs';export{a as docxAgentTools,b as executeToolCall,c as getToolDisplayName,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eigenpal/docx-editor-agents",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Agent SDK and chat UI for the DOCX editor — framework-agnostic bridge, MCP server, AI SDK adapters, plus React UI (and Vue UI in 1.x)",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|