@ansonlai/docx-redline-js 0.8.0 → 0.8.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/CHANGELOG.md +539 -486
- package/README.md +331 -309
- package/dist/docx-redline-js.esm.js +1083 -163
- package/dist/docx-redline-js.esm.js.map +4 -4
- package/dist/docx-redline-js.esm.min.js +107 -107
- package/dist/docx-redline-js.esm.min.js.map +4 -4
- package/dist/docx-redline.bundle.cjs +1083 -163
- package/dist/docx-redline.bundle.cjs.map +4 -4
- package/dist/docx-redline.bundle.js +1083 -163
- package/dist/docx-redline.bundle.js.map +4 -4
- package/docs/AGENT_KNOWLEDGE_BASE.md +69 -8
- package/docs/schemas/document-operations.schema.json +29 -0
- package/document/docx-document.js +416 -22
- package/engine/reconstruction-writer.js +18 -0
- package/index.d.ts +598 -575
- package/index.js +349 -348
- package/node/cli-help.js +5 -5
- package/node/cli.js +760 -754
- package/node/index.d.ts +1 -1
- package/package.json +2 -1
- package/scripts/generate-word-comment-edge-case-fixture.ps1 +58 -0
- package/scripts/generate-word-comment-thread-fixture.ps1 +36 -0
- package/scripts/generate-word-header-footer-fixture.ps1 +32 -0
- package/scripts/generate-word-multi-section-fixture.ps1 +27 -0
- package/scripts/generate-word-package-integrity-cases.mjs +141 -0
- package/scripts/generate-word-thread-state-fixtures.ps1 +50 -0
- package/scripts/word-com-package-integrity.ps1 +98 -0
- package/services/batch-operation-orchestrator.js +262 -259
- package/services/comment-replies.js +96 -95
- package/services/comment-thread-parts.js +280 -0
- package/services/document-inspection.js +366 -365
- package/services/document-operation-applier.js +230 -202
- package/services/document-operation-contract.js +17 -2
- package/services/error-recovery.js +6 -0
- package/services/headers-footers.js +206 -0
- package/services/operation-batch-compiler.js +1 -0
- package/services/operation-preflight.js +231 -218
- package/services/package-parts.js +80 -0
- package/services/standalone-docx-plumbing.js +631 -569
- package/services/standalone-operation-runner.d.ts +19 -3
|
@@ -37,8 +37,15 @@ export interface LocalizedReplacement {
|
|
|
37
37
|
occurrence?: number;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** A header/footer part path from `inspect().headersFooters`, or a selector. */
|
|
41
|
+
export type HeaderFooterPartSelector =
|
|
42
|
+
| string
|
|
43
|
+
| { kind: 'header' | 'footer'; type?: 'default' | 'first' | 'even'; section?: number };
|
|
44
|
+
|
|
40
45
|
export interface DocumentOperationBase {
|
|
41
46
|
operationId?: string;
|
|
47
|
+
/** Target a header or footer instead of the body. Comments are not supported there. */
|
|
48
|
+
part?: HeaderFooterPartSelector;
|
|
42
49
|
captureKey?: string;
|
|
43
50
|
target?: string | ParagraphTargetDescriptor;
|
|
44
51
|
targetRef?: number | string | null;
|
|
@@ -121,6 +128,14 @@ export interface CommentReplyDocumentOperation {
|
|
|
121
128
|
date?: string;
|
|
122
129
|
}
|
|
123
130
|
|
|
131
|
+
/** Resolves (or with `resolved: false`, reopens) the whole thread containing `commentId`. Body-only. */
|
|
132
|
+
export interface CommentResolveDocumentOperation {
|
|
133
|
+
type: 'comment_resolve';
|
|
134
|
+
operationId?: string;
|
|
135
|
+
commentId: number | string;
|
|
136
|
+
resolved?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
124
139
|
export interface CharacterFormatProperties {
|
|
125
140
|
bold?: boolean;
|
|
126
141
|
italic?: boolean;
|
|
@@ -165,6 +180,7 @@ export type DocumentOperation =
|
|
|
165
180
|
| DeleteDocumentOperation
|
|
166
181
|
| CommentDocumentOperation
|
|
167
182
|
| CommentReplyDocumentOperation
|
|
183
|
+
| CommentResolveDocumentOperation
|
|
168
184
|
| HighlightDocumentOperation
|
|
169
185
|
| CharacterFormatDocumentOperation
|
|
170
186
|
| ParagraphFormatDocumentOperation;
|
|
@@ -272,7 +288,7 @@ export interface DocumentOperationResult {
|
|
|
272
288
|
warnings?: string[];
|
|
273
289
|
status?: RedlineStatus;
|
|
274
290
|
error?: RedlineError;
|
|
275
|
-
operationType: 'redline' | 'comment' | 'comment_reply' | 'highlight' | 'format' | 'paragraph-format';
|
|
291
|
+
operationType: 'redline' | 'comment' | 'comment_reply' | 'comment_resolve' | 'highlight' | 'format' | 'paragraph-format';
|
|
276
292
|
authorUsed: string;
|
|
277
293
|
resolvedBy?: string;
|
|
278
294
|
resolvedTarget?: ResolvedDocumentTarget;
|
|
@@ -284,7 +300,7 @@ export interface DocumentOperationResult {
|
|
|
284
300
|
export interface BatchOperationItemResult {
|
|
285
301
|
index: number;
|
|
286
302
|
type: string;
|
|
287
|
-
operationType: 'redline' | 'comment' | 'comment_reply' | 'highlight' | 'format' | 'paragraph-format';
|
|
303
|
+
operationType: 'redline' | 'comment' | 'comment_reply' | 'comment_resolve' | 'highlight' | 'format' | 'paragraph-format';
|
|
288
304
|
status: 'applied' | 'no_change' | 'error';
|
|
289
305
|
authorUsed: string;
|
|
290
306
|
resolvedBy?: string;
|
|
@@ -329,7 +345,7 @@ export interface MutationRetryPlan {
|
|
|
329
345
|
export interface OperationPreflightItemResult {
|
|
330
346
|
index: number;
|
|
331
347
|
type: string;
|
|
332
|
-
operationType: 'redline' | 'comment' | 'comment_reply' | 'highlight' | 'format' | 'paragraph-format';
|
|
348
|
+
operationType: 'redline' | 'comment' | 'comment_reply' | 'comment_resolve' | 'highlight' | 'format' | 'paragraph-format';
|
|
333
349
|
status: 'ready' | 'deferred' | 'error';
|
|
334
350
|
authorUsed: string;
|
|
335
351
|
resolvedBy?: string;
|