@usejunior/docx-core 0.9.0 → 0.10.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/.tsbuildinfo +1 -1
- package/dist/atomizer.d.ts +49 -0
- package/dist/atomizer.d.ts.map +1 -1
- package/dist/atomizer.js +90 -0
- package/dist/atomizer.js.map +1 -1
- package/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -1
- package/dist/baselines/atomizer/documentReconstructor.js +289 -92
- package/dist/baselines/atomizer/documentReconstructor.js.map +1 -1
- package/dist/baselines/atomizer/formattingFidelity.d.ts +99 -0
- package/dist/baselines/atomizer/formattingFidelity.d.ts.map +1 -0
- package/dist/baselines/atomizer/formattingFidelity.js +449 -0
- package/dist/baselines/atomizer/formattingFidelity.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts +37 -0
- package/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-bookmarks.js +189 -0
- package/dist/baselines/atomizer/inPlaceModifier-bookmarks.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-containers.d.ts +74 -0
- package/dist/baselines/atomizer/inPlaceModifier-containers.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-containers.js +171 -0
- package/dist/baselines/atomizer/inPlaceModifier-containers.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts +88 -0
- package/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-deletion.js +326 -0
- package/dist/baselines/atomizer/inPlaceModifier-deletion.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts +85 -0
- package/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-postprocess.js +402 -0
- package/dist/baselines/atomizer/inPlaceModifier-postprocess.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts +39 -0
- package/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-presplit.js +265 -0
- package/dist/baselines/atomizer/inPlaceModifier-presplit.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-shared.d.ts +62 -0
- package/dist/baselines/atomizer/inPlaceModifier-shared.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-shared.js +139 -0
- package/dist/baselines/atomizer/inPlaceModifier-shared.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts +189 -0
- package/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier-wrappers.js +427 -0
- package/dist/baselines/atomizer/inPlaceModifier-wrappers.js.map +1 -0
- package/dist/baselines/atomizer/inPlaceModifier.d.ts +6 -290
- package/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -1
- package/dist/baselines/atomizer/inPlaceModifier.js +23 -1828
- package/dist/baselines/atomizer/inPlaceModifier.js.map +1 -1
- package/dist/baselines/atomizer/pipeline.d.ts +76 -1
- package/dist/baselines/atomizer/pipeline.d.ts.map +1 -1
- package/dist/baselines/atomizer/pipeline.js +445 -108
- package/dist/baselines/atomizer/pipeline.js.map +1 -1
- package/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -1
- package/dist/baselines/atomizer/trackChangesAcceptorAst.js +56 -160
- package/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -1
- package/dist/compare-types.d.ts +151 -0
- package/dist/compare-types.d.ts.map +1 -0
- package/dist/compare-types.js +2 -0
- package/dist/compare-types.js.map +1 -0
- package/dist/core-types.d.ts +5 -1
- package/dist/core-types.d.ts.map +1 -1
- package/dist/core-types.js +5 -1
- package/dist/core-types.js.map +1 -1
- package/dist/footnotes.d.ts +8 -3
- package/dist/footnotes.d.ts.map +1 -1
- package/dist/footnotes.js +8 -3
- package/dist/footnotes.js.map +1 -1
- package/dist/index.d.ts +6 -150
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/integration/libreoffice-oracle.d.ts +41 -0
- package/dist/integration/libreoffice-oracle.d.ts.map +1 -0
- package/dist/integration/libreoffice-oracle.js +282 -0
- package/dist/integration/libreoffice-oracle.js.map +1 -0
- package/dist/integration/synthetic-docx-fixture.d.ts +62 -0
- package/dist/integration/synthetic-docx-fixture.d.ts.map +1 -0
- package/dist/integration/synthetic-docx-fixture.js +171 -0
- package/dist/integration/synthetic-docx-fixture.js.map +1 -0
- package/dist/primitives/accept_changes.d.ts +2 -2
- package/dist/primitives/accept_changes.d.ts.map +1 -1
- package/dist/primitives/accept_changes.js +24 -79
- package/dist/primitives/accept_changes.js.map +1 -1
- package/dist/primitives/comments.d.ts +12 -3
- package/dist/primitives/comments.d.ts.map +1 -1
- package/dist/primitives/comments.js +374 -97
- package/dist/primitives/comments.js.map +1 -1
- package/dist/primitives/content_fingerprint.d.ts +29 -0
- package/dist/primitives/content_fingerprint.d.ts.map +1 -0
- package/dist/primitives/content_fingerprint.js +63 -0
- package/dist/primitives/content_fingerprint.js.map +1 -0
- package/dist/primitives/document.d.ts +56 -15
- package/dist/primitives/document.d.ts.map +1 -1
- package/dist/primitives/document.js +303 -32
- package/dist/primitives/document.js.map +1 -1
- package/dist/primitives/document_view-comments.d.ts +18 -0
- package/dist/primitives/document_view-comments.d.ts.map +1 -0
- package/dist/primitives/document_view-comments.js +159 -0
- package/dist/primitives/document_view-comments.js.map +1 -0
- package/dist/primitives/document_view-headings.d.ts +45 -0
- package/dist/primitives/document_view-headings.d.ts.map +1 -0
- package/dist/primitives/document_view-headings.js +247 -0
- package/dist/primitives/document_view-headings.js.map +1 -0
- package/dist/primitives/document_view-styles.d.ts +11 -0
- package/dist/primitives/document_view-styles.d.ts.map +1 -0
- package/dist/primitives/document_view-styles.js +104 -0
- package/dist/primitives/document_view-styles.js.map +1 -0
- package/dist/primitives/document_view-toon.d.ts +37 -0
- package/dist/primitives/document_view-toon.d.ts.map +1 -0
- package/dist/primitives/document_view-toon.js +199 -0
- package/dist/primitives/document_view-toon.js.map +1 -0
- package/dist/primitives/document_view-types.d.ts +137 -0
- package/dist/primitives/document_view-types.d.ts.map +1 -0
- package/dist/primitives/document_view-types.js +2 -0
- package/dist/primitives/document_view-types.js.map +1 -0
- package/dist/primitives/document_view.d.ts +8 -106
- package/dist/primitives/document_view.d.ts.map +1 -1
- package/dist/primitives/document_view.js +134 -301
- package/dist/primitives/document_view.js.map +1 -1
- package/dist/primitives/dom-helpers.d.ts +9 -0
- package/dist/primitives/dom-helpers.d.ts.map +1 -1
- package/dist/primitives/dom-helpers.js +10 -1
- package/dist/primitives/dom-helpers.js.map +1 -1
- package/dist/primitives/footnotes.d.ts +4 -3
- package/dist/primitives/footnotes.d.ts.map +1 -1
- package/dist/primitives/footnotes.js +232 -44
- package/dist/primitives/footnotes.js.map +1 -1
- package/dist/primitives/formatting_tags.d.ts +6 -0
- package/dist/primitives/formatting_tags.d.ts.map +1 -1
- package/dist/primitives/formatting_tags.js +6 -1
- package/dist/primitives/formatting_tags.js.map +1 -1
- package/dist/primitives/index.d.ts +6 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +5 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/layout.d.ts +4 -3
- package/dist/primitives/layout.d.ts.map +1 -1
- package/dist/primitives/layout.js +32 -3
- package/dist/primitives/layout.js.map +1 -1
- package/dist/primitives/merge_runs.d.ts +21 -3
- package/dist/primitives/merge_runs.d.ts.map +1 -1
- package/dist/primitives/merge_runs.js +32 -10
- package/dist/primitives/merge_runs.js.map +1 -1
- package/dist/primitives/namespaces.d.ts +6 -0
- package/dist/primitives/namespaces.d.ts.map +1 -1
- package/dist/primitives/namespaces.js +9 -0
- package/dist/primitives/namespaces.js.map +1 -1
- package/dist/primitives/reject_changes.d.ts +2 -2
- package/dist/primitives/reject_changes.d.ts.map +1 -1
- package/dist/primitives/reject_changes.js +24 -81
- package/dist/primitives/reject_changes.js.map +1 -1
- package/dist/primitives/semantic_tags.d.ts +7 -0
- package/dist/primitives/semantic_tags.d.ts.map +1 -1
- package/dist/primitives/semantic_tags.js +21 -3
- package/dist/primitives/semantic_tags.js.map +1 -1
- package/dist/primitives/serialize_html.d.ts +36 -0
- package/dist/primitives/serialize_html.d.ts.map +1 -0
- package/dist/primitives/serialize_html.js +393 -0
- package/dist/primitives/serialize_html.js.map +1 -0
- package/dist/primitives/serialize_markdown.d.ts +16 -0
- package/dist/primitives/serialize_markdown.d.ts.map +1 -0
- package/dist/primitives/serialize_markdown.js +300 -0
- package/dist/primitives/serialize_markdown.js.map +1 -0
- package/dist/primitives/serialize_plaintext.d.ts +15 -0
- package/dist/primitives/serialize_plaintext.d.ts.map +1 -0
- package/dist/primitives/serialize_plaintext.js +154 -0
- package/dist/primitives/serialize_plaintext.js.map +1 -0
- package/dist/primitives/styles.js +22 -22
- package/dist/primitives/styles.js.map +1 -1
- package/dist/primitives/tables.d.ts.map +1 -1
- package/dist/primitives/tables.js +13 -3
- package/dist/primitives/tables.js.map +1 -1
- package/dist/primitives/text.d.ts +2 -1
- package/dist/primitives/text.d.ts.map +1 -1
- package/dist/primitives/text.js +116 -12
- package/dist/primitives/text.js.map +1 -1
- package/dist/primitives/track-changes-emitter.d.ts +139 -0
- package/dist/primitives/track-changes-emitter.d.ts.map +1 -0
- package/dist/primitives/track-changes-emitter.js +241 -0
- package/dist/primitives/track-changes-emitter.js.map +1 -0
- package/dist/primitives/xml-helpers.d.ts +29 -0
- package/dist/primitives/xml-helpers.d.ts.map +1 -0
- package/dist/primitives/xml-helpers.js +35 -0
- package/dist/primitives/xml-helpers.js.map +1 -0
- package/dist/shared/ooxml/namespaces.d.ts +4 -1
- package/dist/shared/ooxml/namespaces.d.ts.map +1 -1
- package/dist/shared/ooxml/namespaces.js +4 -1
- package/dist/shared/ooxml/namespaces.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-Place AST Modifier
|
|
3
|
+
*
|
|
4
|
+
* Modifies the revised document's AST in-place to add track changes markup.
|
|
5
|
+
* This replaces the reconstruction-based approach with direct tree manipulation.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComparisonUnitAtom } from '../../core-types.js';
|
|
8
|
+
import { type RevisionIdState } from './inPlaceModifier-shared.js';
|
|
9
|
+
export type TrackChangeTag = 'w:ins' | 'w:del' | 'w:moveFrom' | 'w:moveTo';
|
|
10
|
+
export declare const TRACK_CHANGE_WRAPPERS: Set<TrackChangeTag>;
|
|
11
|
+
export type AtomRunBoundary = 'start' | 'end';
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the run associated with an atom boundary.
|
|
14
|
+
*
|
|
15
|
+
* For collapsed field atoms, sourceRunElement points at the first run in the
|
|
16
|
+
* field sequence. For insertion-point tracking we often need the trailing run,
|
|
17
|
+
* otherwise deleted/moved fragments can be inserted inside the field sequence.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAtomRunAtBoundary(atom: ComparisonUnitAtom, boundary: AtomRunBoundary): Element | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve all run elements represented by an atom.
|
|
22
|
+
*
|
|
23
|
+
* For collapsed-field atoms, we must treat the entire field run sequence as a
|
|
24
|
+
* single logical unit. Wrapping only the first run leaves trailing field-code
|
|
25
|
+
* runs untracked, which can leak revised field text after Reject All.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAtomRuns(atom: ComparisonUnitAtom): Element[];
|
|
28
|
+
/**
|
|
29
|
+
* True iff `atom` represents a collapsed-field sequence (a complex field
|
|
30
|
+
* captured as a single logical atom). See {@link getAtomRuns} for the
|
|
31
|
+
* multi-run resolution.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isCollapsedFieldAtom(atom: ComparisonUnitAtom): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Convert a run node to the correct insertion anchor.
|
|
36
|
+
*
|
|
37
|
+
* If the run is wrapped in a track-change container, the insertion anchor
|
|
38
|
+
* must be the wrapper (a paragraph child), not the nested run.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRunInsertionAnchor(run: Element): Element;
|
|
41
|
+
/**
|
|
42
|
+
* Options for wrapping a run with track change markup.
|
|
43
|
+
*/
|
|
44
|
+
export interface WrapRunOptions {
|
|
45
|
+
/** The run element to wrap */
|
|
46
|
+
run: Element;
|
|
47
|
+
/** The track change tag name */
|
|
48
|
+
tagName: TrackChangeTag;
|
|
49
|
+
/** Author name for track changes */
|
|
50
|
+
author: string;
|
|
51
|
+
/** Formatted date string */
|
|
52
|
+
dateStr: string;
|
|
53
|
+
/** Revision ID state */
|
|
54
|
+
state: RevisionIdState;
|
|
55
|
+
/** Whether to convert w:t to w:delText (for deleted/moveFrom content) */
|
|
56
|
+
convertTextToDelText?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Wrap a run element with track change markup.
|
|
60
|
+
*
|
|
61
|
+
* This is the shared implementation for wrapAsInserted, wrapAsDeleted,
|
|
62
|
+
* and the inner wrapping logic of move operations.
|
|
63
|
+
*
|
|
64
|
+
* @param options - Wrapping options
|
|
65
|
+
* @returns true if wrapped, false if run was already wrapped or has no parent
|
|
66
|
+
*/
|
|
67
|
+
export declare function wrapRunWithTrackChange(options: WrapRunOptions): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Ensure w:pPr/w:rPr exists and add a paragraph-mark revision marker (w:ins/w:del)
|
|
70
|
+
* in the paragraph properties.
|
|
71
|
+
*
|
|
72
|
+
* This is the critical piece for whole-paragraph insert/delete idempotency:
|
|
73
|
+
* - Reject All should remove inserted paragraphs entirely (no stub breaks)
|
|
74
|
+
* - Accept All should remove deleted paragraphs entirely
|
|
75
|
+
*/
|
|
76
|
+
export declare function addParagraphMarkRevisionMarker(paragraph: Element, markerTag: 'w:ins' | 'w:del', author: string, dateStr: string, state: RevisionIdState): void;
|
|
77
|
+
export declare function wrapAsInserted(run: Element, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Wrap a run element with <w:del> to mark it as deleted.
|
|
80
|
+
* Also converts w:t to w:delText within the run.
|
|
81
|
+
*
|
|
82
|
+
* @param run - The w:r element to wrap
|
|
83
|
+
* @param author - Author name for track changes
|
|
84
|
+
* @param dateStr - Formatted date string
|
|
85
|
+
* @param state - Revision ID state
|
|
86
|
+
* @returns true if wrapped, false if run was already wrapped or has no parent
|
|
87
|
+
*/
|
|
88
|
+
export declare function wrapAsDeleted(run: Element, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
89
|
+
export type MoveDirection = 'from' | 'to';
|
|
90
|
+
/**
|
|
91
|
+
* Configuration for move wrapping based on direction.
|
|
92
|
+
*/
|
|
93
|
+
export interface MoveWrapConfig {
|
|
94
|
+
wrapperTag: 'w:moveFrom' | 'w:moveTo';
|
|
95
|
+
rangeStartTag: 'w:moveFromRangeStart' | 'w:moveToRangeStart';
|
|
96
|
+
rangeEndTag: 'w:moveFromRangeEnd' | 'w:moveToRangeEnd';
|
|
97
|
+
rangeIdKey: 'sourceRangeId' | 'destRangeId';
|
|
98
|
+
convertTextToDelText: boolean;
|
|
99
|
+
}
|
|
100
|
+
export declare const MOVE_CONFIG: Record<MoveDirection, MoveWrapConfig>;
|
|
101
|
+
/**
|
|
102
|
+
* Wrap a run element with move tracking (shared implementation for moveFrom/moveTo).
|
|
103
|
+
*
|
|
104
|
+
* @param run - The w:r element to wrap
|
|
105
|
+
* @param moveName - Name for linking source and destination
|
|
106
|
+
* @param direction - 'from' for moveFrom, 'to' for moveTo
|
|
107
|
+
* @param author - Author name
|
|
108
|
+
* @param dateStr - Formatted date
|
|
109
|
+
* @param state - Revision ID state
|
|
110
|
+
* @returns true if wrapped
|
|
111
|
+
*/
|
|
112
|
+
export declare function wrapAsMove(run: Element, moveName: string, direction: MoveDirection, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Wrap a run element with <w:moveFrom> for moved-from content.
|
|
115
|
+
*
|
|
116
|
+
* @param run - The w:r element to wrap
|
|
117
|
+
* @param moveName - Name for linking source and destination
|
|
118
|
+
* @param author - Author name
|
|
119
|
+
* @param dateStr - Formatted date
|
|
120
|
+
* @param state - Revision ID state
|
|
121
|
+
* @returns true if wrapped
|
|
122
|
+
*/
|
|
123
|
+
export declare function wrapAsMoveFrom(run: Element, moveName: string, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Wrap a run element with <w:moveTo> for moved-to content.
|
|
126
|
+
*
|
|
127
|
+
* @param run - The w:r element to wrap
|
|
128
|
+
* @param moveName - Name for linking source and destination
|
|
129
|
+
* @param author - Author name
|
|
130
|
+
* @param dateStr - Formatted date
|
|
131
|
+
* @param state - Revision ID state
|
|
132
|
+
* @returns true if wrapped
|
|
133
|
+
*/
|
|
134
|
+
export declare function wrapAsMoveTo(run: Element, moveName: string, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Add format change tracking to a run's properties.
|
|
137
|
+
*
|
|
138
|
+
* @param run - The w:r element with changed formatting
|
|
139
|
+
* @param oldRunProperties - The original run properties (w:rPr)
|
|
140
|
+
* @param author - Author name
|
|
141
|
+
* @param dateStr - Formatted date
|
|
142
|
+
* @param state - Revision ID state
|
|
143
|
+
*/
|
|
144
|
+
export declare function addFormatChange(run: Element, oldRunProperties: Element | null, author: string, dateStr: string, state: RevisionIdState): void;
|
|
145
|
+
/**
|
|
146
|
+
* Add a paragraph property change element (w:pPrChange) to record the "before"
|
|
147
|
+
* state of paragraph properties. This is needed for Google Docs to display
|
|
148
|
+
* inserted paragraphs as tracked changes.
|
|
149
|
+
*
|
|
150
|
+
* The child `<w:pPr>` inside `w:pPrChange` must conform to CT_PPrBase — it
|
|
151
|
+
* MUST NOT contain w:rPr, w:sectPr, or w:pPrChange.
|
|
152
|
+
*
|
|
153
|
+
* @param paragraph - The w:p element
|
|
154
|
+
* @param author - Author name
|
|
155
|
+
* @param dateStr - Formatted date
|
|
156
|
+
* @param state - Revision ID state
|
|
157
|
+
*/
|
|
158
|
+
export declare function addParagraphPropertyChange(paragraph: Element, author: string, dateStr: string, state: RevisionIdState): void;
|
|
159
|
+
/**
|
|
160
|
+
* Tag names that represent visible content inside a w:r element.
|
|
161
|
+
* A run containing at least one of these is considered substantive (non-empty).
|
|
162
|
+
*/
|
|
163
|
+
export declare const RUN_VISIBLE_CONTENT_TAGS: ReadonlySet<string>;
|
|
164
|
+
/**
|
|
165
|
+
* Returns true if a w:r element contains at least one visible content child.
|
|
166
|
+
* Empty runs (containing only w:rPr or nothing) return false.
|
|
167
|
+
*/
|
|
168
|
+
export declare function runHasVisibleContent(run: Element): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Wrap an inserted empty paragraph with <w:ins>.
|
|
171
|
+
*
|
|
172
|
+
* For empty paragraphs (no content, only pPr), we wrap the entire paragraph.
|
|
173
|
+
*
|
|
174
|
+
* @param paragraph - The w:p element
|
|
175
|
+
* @param author - Author name
|
|
176
|
+
* @param dateStr - Formatted date
|
|
177
|
+
* @param state - Revision ID state
|
|
178
|
+
*/
|
|
179
|
+
export declare function wrapParagraphAsInserted(paragraph: Element, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Wrap a deleted empty paragraph with <w:del>.
|
|
182
|
+
*
|
|
183
|
+
* @param paragraph - The w:p element
|
|
184
|
+
* @param author - Author name
|
|
185
|
+
* @param dateStr - Formatted date
|
|
186
|
+
* @param state - Revision ID state
|
|
187
|
+
*/
|
|
188
|
+
export declare function wrapParagraphAsDeleted(paragraph: Element, author: string, dateStr: string, state: RevisionIdState): boolean;
|
|
189
|
+
//# sourceMappingURL=inPlaceModifier-wrappers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inPlaceModifier-wrappers.d.ts","sourceRoot":"","sources":["../../../src/baselines/atomizer/inPlaceModifier-wrappers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,CAAC;AAE3E,eAAO,MAAM,qBAAqB,qBAKhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,eAAe,GACxB,OAAO,GAAG,SAAS,CAcrB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,EAAE,CAe/D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAM3D;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,GAAG,EAAE,OAAO,CAAC;IACb,gCAAgC;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,yEAAyE;IACzE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CA4BvE;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,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YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GACrB,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,gBAAgB,EAAE,OAAO,GAAG,IAAI,EAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GACrB,IAAI,CA8BN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GACrB,IAAI,CAyBN;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAGvD,CAAC;AAEH;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAQ1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GACrB,OAAO,CAmBT;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GACrB,OAAO,CAKT"}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-Place AST Modifier
|
|
3
|
+
*
|
|
4
|
+
* Modifies the revised document's AST in-place to add track changes markup.
|
|
5
|
+
* This replaces the reconstruction-based approach with direct tree manipulation.
|
|
6
|
+
*/
|
|
7
|
+
import { childElements, findChildByTagName, insertAfterElement, wrapElement } from '../../primitives/index.js';
|
|
8
|
+
import { allocateRevisionId, convertToDelText, createEl, findAncestorByTag, getMoveRangeIds, parentElement, } from './inPlaceModifier-shared.js';
|
|
9
|
+
export const TRACK_CHANGE_WRAPPERS = new Set([
|
|
10
|
+
'w:ins',
|
|
11
|
+
'w:del',
|
|
12
|
+
'w:moveFrom',
|
|
13
|
+
'w:moveTo',
|
|
14
|
+
]);
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the run associated with an atom boundary.
|
|
17
|
+
*
|
|
18
|
+
* For collapsed field atoms, sourceRunElement points at the first run in the
|
|
19
|
+
* field sequence. For insertion-point tracking we often need the trailing run,
|
|
20
|
+
* otherwise deleted/moved fragments can be inserted inside the field sequence.
|
|
21
|
+
*/
|
|
22
|
+
export function getAtomRunAtBoundary(atom, boundary) {
|
|
23
|
+
if (atom.collapsedFieldAtoms && atom.collapsedFieldAtoms.length > 0) {
|
|
24
|
+
const fieldAtoms = boundary === 'start'
|
|
25
|
+
? atom.collapsedFieldAtoms
|
|
26
|
+
: [...atom.collapsedFieldAtoms].reverse();
|
|
27
|
+
for (const fieldAtom of fieldAtoms) {
|
|
28
|
+
const run = fieldAtom.sourceRunElement ?? findAncestorByTag(fieldAtom, 'w:r');
|
|
29
|
+
if (run)
|
|
30
|
+
return run;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return atom.sourceRunElement ?? findAncestorByTag(atom, 'w:r');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve all run elements represented by an atom.
|
|
37
|
+
*
|
|
38
|
+
* For collapsed-field atoms, we must treat the entire field run sequence as a
|
|
39
|
+
* single logical unit. Wrapping only the first run leaves trailing field-code
|
|
40
|
+
* runs untracked, which can leak revised field text after Reject All.
|
|
41
|
+
*/
|
|
42
|
+
export function getAtomRuns(atom) {
|
|
43
|
+
if (!atom.collapsedFieldAtoms || atom.collapsedFieldAtoms.length === 0) {
|
|
44
|
+
const run = atom.sourceRunElement ?? findAncestorByTag(atom, 'w:r');
|
|
45
|
+
return run ? [run] : [];
|
|
46
|
+
}
|
|
47
|
+
const runs = [];
|
|
48
|
+
const seen = new Set();
|
|
49
|
+
for (const fieldAtom of atom.collapsedFieldAtoms) {
|
|
50
|
+
const run = fieldAtom.sourceRunElement ?? findAncestorByTag(fieldAtom, 'w:r');
|
|
51
|
+
if (!run || seen.has(run))
|
|
52
|
+
continue;
|
|
53
|
+
seen.add(run);
|
|
54
|
+
runs.push(run);
|
|
55
|
+
}
|
|
56
|
+
return runs;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* True iff `atom` represents a collapsed-field sequence (a complex field
|
|
60
|
+
* captured as a single logical atom). See {@link getAtomRuns} for the
|
|
61
|
+
* multi-run resolution.
|
|
62
|
+
*/
|
|
63
|
+
export function isCollapsedFieldAtom(atom) {
|
|
64
|
+
return !!(atom.collapsedFieldAtoms && atom.collapsedFieldAtoms.length > 0);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Convert a run node to the correct insertion anchor.
|
|
68
|
+
*
|
|
69
|
+
* If the run is wrapped in a track-change container, the insertion anchor
|
|
70
|
+
* must be the wrapper (a paragraph child), not the nested run.
|
|
71
|
+
*/
|
|
72
|
+
export function getRunInsertionAnchor(run) {
|
|
73
|
+
const parent = parentElement(run);
|
|
74
|
+
if (parent && TRACK_CHANGE_WRAPPERS.has(parent.tagName)) {
|
|
75
|
+
return parent;
|
|
76
|
+
}
|
|
77
|
+
return run;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Wrap a run element with track change markup.
|
|
81
|
+
*
|
|
82
|
+
* This is the shared implementation for wrapAsInserted, wrapAsDeleted,
|
|
83
|
+
* and the inner wrapping logic of move operations.
|
|
84
|
+
*
|
|
85
|
+
* @param options - Wrapping options
|
|
86
|
+
* @returns true if wrapped, false if run was already wrapped or has no parent
|
|
87
|
+
*/
|
|
88
|
+
export function wrapRunWithTrackChange(options) {
|
|
89
|
+
const { run, tagName, author, dateStr, state, convertTextToDelText: convertText = false } = options;
|
|
90
|
+
// Skip if already wrapped
|
|
91
|
+
if (state.wrappedRuns.has(run)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
// Skip if the run has no parent in the tree
|
|
95
|
+
if (!run.parentNode) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
// Convert w:t to w:delText if requested (for deleted content)
|
|
99
|
+
if (convertText) {
|
|
100
|
+
convertToDelText(run);
|
|
101
|
+
}
|
|
102
|
+
const id = allocateRevisionId(state);
|
|
103
|
+
const wrapper = createEl(tagName, {
|
|
104
|
+
'w:id': String(id),
|
|
105
|
+
'w:author': author,
|
|
106
|
+
'w:date': dateStr,
|
|
107
|
+
});
|
|
108
|
+
wrapElement(run, wrapper);
|
|
109
|
+
state.wrappedRuns.add(run);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Ensure w:pPr/w:rPr exists and add a paragraph-mark revision marker (w:ins/w:del)
|
|
114
|
+
* in the paragraph properties.
|
|
115
|
+
*
|
|
116
|
+
* This is the critical piece for whole-paragraph insert/delete idempotency:
|
|
117
|
+
* - Reject All should remove inserted paragraphs entirely (no stub breaks)
|
|
118
|
+
* - Accept All should remove deleted paragraphs entirely
|
|
119
|
+
*/
|
|
120
|
+
export function addParagraphMarkRevisionMarker(paragraph, markerTag, author, dateStr, state) {
|
|
121
|
+
// Find or create pPr.
|
|
122
|
+
let pPr = findChildByTagName(paragraph, 'w:pPr');
|
|
123
|
+
if (!pPr) {
|
|
124
|
+
pPr = createEl('w:pPr');
|
|
125
|
+
// pPr should be the first child in a paragraph.
|
|
126
|
+
paragraph.insertBefore(pPr, paragraph.firstChild);
|
|
127
|
+
}
|
|
128
|
+
// Find or create rPr within pPr (paragraph mark properties).
|
|
129
|
+
let rPr = findChildByTagName(pPr, 'w:rPr');
|
|
130
|
+
if (!rPr) {
|
|
131
|
+
rPr = createEl('w:rPr');
|
|
132
|
+
// CT_PPr ordering: ... base props ..., w:rPr, w:sectPr?, w:pPrChange?
|
|
133
|
+
// Insert rPr in schema-correct position (before sectPr/pPrChange).
|
|
134
|
+
const sectPr = findChildByTagName(pPr, 'w:sectPr');
|
|
135
|
+
const pPrChange = findChildByTagName(pPr, 'w:pPrChange');
|
|
136
|
+
const insertBefore = sectPr ?? pPrChange ?? null;
|
|
137
|
+
if (insertBefore) {
|
|
138
|
+
pPr.insertBefore(rPr, insertBefore);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
pPr.appendChild(rPr);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Avoid duplicating markers.
|
|
145
|
+
if (findChildByTagName(rPr, markerTag))
|
|
146
|
+
return;
|
|
147
|
+
const id = allocateRevisionId(state);
|
|
148
|
+
const marker = createEl(markerTag, {
|
|
149
|
+
'w:id': String(id),
|
|
150
|
+
'w:author': author,
|
|
151
|
+
'w:date': dateStr,
|
|
152
|
+
});
|
|
153
|
+
// Insert marker at the start of rPr for consistency with Aspose/Word patterns.
|
|
154
|
+
rPr.insertBefore(marker, rPr.firstChild);
|
|
155
|
+
}
|
|
156
|
+
// @lean-segment: field-wrapper-emission
|
|
157
|
+
// Lean traceability anchor — cited by verification/lean/LeanSpike/Spec.lean and
|
|
158
|
+
// packages/docx-core/src/integration/lean-spec-bridge.test.ts. These wrapping
|
|
159
|
+
// primitives (wrapAsInserted/wrapAsDeleted and the move/format variants below)
|
|
160
|
+
// emit whole field sequences as SINGLE track-change wrappers, which is why the
|
|
161
|
+
// engine currently satisfies the stronger `fieldContextNeutral ∀ ctx` property.
|
|
162
|
+
// When ECMA-376 field fragmentation lands (#217) this anchor marks the code the
|
|
163
|
+
// Lean predicate-strength choice depends on. Grep this anchor, not line numbers.
|
|
164
|
+
export function wrapAsInserted(run, author, dateStr, state) {
|
|
165
|
+
return wrapRunWithTrackChange({
|
|
166
|
+
run,
|
|
167
|
+
tagName: 'w:ins',
|
|
168
|
+
author,
|
|
169
|
+
dateStr,
|
|
170
|
+
state,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Wrap a run element with <w:del> to mark it as deleted.
|
|
175
|
+
* Also converts w:t to w:delText within the run.
|
|
176
|
+
*
|
|
177
|
+
* @param run - The w:r element to wrap
|
|
178
|
+
* @param author - Author name for track changes
|
|
179
|
+
* @param dateStr - Formatted date string
|
|
180
|
+
* @param state - Revision ID state
|
|
181
|
+
* @returns true if wrapped, false if run was already wrapped or has no parent
|
|
182
|
+
*/
|
|
183
|
+
export function wrapAsDeleted(run, author, dateStr, state) {
|
|
184
|
+
return wrapRunWithTrackChange({
|
|
185
|
+
run,
|
|
186
|
+
tagName: 'w:del',
|
|
187
|
+
author,
|
|
188
|
+
dateStr,
|
|
189
|
+
state,
|
|
190
|
+
convertTextToDelText: true,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
export const MOVE_CONFIG = {
|
|
194
|
+
from: {
|
|
195
|
+
wrapperTag: 'w:moveFrom',
|
|
196
|
+
rangeStartTag: 'w:moveFromRangeStart',
|
|
197
|
+
rangeEndTag: 'w:moveFromRangeEnd',
|
|
198
|
+
rangeIdKey: 'sourceRangeId',
|
|
199
|
+
convertTextToDelText: true, // Moved-from content appears as deleted
|
|
200
|
+
},
|
|
201
|
+
to: {
|
|
202
|
+
wrapperTag: 'w:moveTo',
|
|
203
|
+
rangeStartTag: 'w:moveToRangeStart',
|
|
204
|
+
rangeEndTag: 'w:moveToRangeEnd',
|
|
205
|
+
rangeIdKey: 'destRangeId',
|
|
206
|
+
convertTextToDelText: false, // Moved-to content keeps w:t
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Wrap a run element with move tracking (shared implementation for moveFrom/moveTo).
|
|
211
|
+
*
|
|
212
|
+
* @param run - The w:r element to wrap
|
|
213
|
+
* @param moveName - Name for linking source and destination
|
|
214
|
+
* @param direction - 'from' for moveFrom, 'to' for moveTo
|
|
215
|
+
* @param author - Author name
|
|
216
|
+
* @param dateStr - Formatted date
|
|
217
|
+
* @param state - Revision ID state
|
|
218
|
+
* @returns true if wrapped
|
|
219
|
+
*/
|
|
220
|
+
export function wrapAsMove(run, moveName, direction, author, dateStr, state) {
|
|
221
|
+
if (state.wrappedRuns.has(run)) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
const parent = parentElement(run);
|
|
225
|
+
if (!parent) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
const config = MOVE_CONFIG[direction];
|
|
229
|
+
const ids = getMoveRangeIds(state, moveName);
|
|
230
|
+
const moveId = allocateRevisionId(state);
|
|
231
|
+
const rangeId = ids[config.rangeIdKey];
|
|
232
|
+
// Convert w:t to w:delText if needed (for moveFrom content)
|
|
233
|
+
if (config.convertTextToDelText) {
|
|
234
|
+
convertToDelText(run);
|
|
235
|
+
}
|
|
236
|
+
// Create range start marker
|
|
237
|
+
const rangeStart = createEl(config.rangeStartTag, {
|
|
238
|
+
'w:id': String(rangeId),
|
|
239
|
+
'w:name': moveName,
|
|
240
|
+
'w:author': author,
|
|
241
|
+
'w:date': dateStr,
|
|
242
|
+
});
|
|
243
|
+
// Create move wrapper
|
|
244
|
+
const moveWrapper = createEl(config.wrapperTag, {
|
|
245
|
+
'w:id': String(moveId),
|
|
246
|
+
'w:author': author,
|
|
247
|
+
'w:date': dateStr,
|
|
248
|
+
});
|
|
249
|
+
// Create range end marker
|
|
250
|
+
const rangeEnd = createEl(config.rangeEndTag, {
|
|
251
|
+
'w:id': String(rangeId),
|
|
252
|
+
});
|
|
253
|
+
// Insert: rangeStart -> moveWrapper(run) -> rangeEnd
|
|
254
|
+
run.parentNode.insertBefore(rangeStart, run);
|
|
255
|
+
wrapElement(run, moveWrapper);
|
|
256
|
+
insertAfterElement(moveWrapper, rangeEnd);
|
|
257
|
+
state.wrappedRuns.add(run);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Wrap a run element with <w:moveFrom> for moved-from content.
|
|
262
|
+
*
|
|
263
|
+
* @param run - The w:r element to wrap
|
|
264
|
+
* @param moveName - Name for linking source and destination
|
|
265
|
+
* @param author - Author name
|
|
266
|
+
* @param dateStr - Formatted date
|
|
267
|
+
* @param state - Revision ID state
|
|
268
|
+
* @returns true if wrapped
|
|
269
|
+
*/
|
|
270
|
+
export function wrapAsMoveFrom(run, moveName, author, dateStr, state) {
|
|
271
|
+
return wrapAsMove(run, moveName, 'from', author, dateStr, state);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Wrap a run element with <w:moveTo> for moved-to content.
|
|
275
|
+
*
|
|
276
|
+
* @param run - The w:r element to wrap
|
|
277
|
+
* @param moveName - Name for linking source and destination
|
|
278
|
+
* @param author - Author name
|
|
279
|
+
* @param dateStr - Formatted date
|
|
280
|
+
* @param state - Revision ID state
|
|
281
|
+
* @returns true if wrapped
|
|
282
|
+
*/
|
|
283
|
+
export function wrapAsMoveTo(run, moveName, author, dateStr, state) {
|
|
284
|
+
return wrapAsMove(run, moveName, 'to', author, dateStr, state);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Add format change tracking to a run's properties.
|
|
288
|
+
*
|
|
289
|
+
* @param run - The w:r element with changed formatting
|
|
290
|
+
* @param oldRunProperties - The original run properties (w:rPr)
|
|
291
|
+
* @param author - Author name
|
|
292
|
+
* @param dateStr - Formatted date
|
|
293
|
+
* @param state - Revision ID state
|
|
294
|
+
*/
|
|
295
|
+
export function addFormatChange(run, oldRunProperties, author, dateStr, state) {
|
|
296
|
+
// Find or create w:rPr
|
|
297
|
+
let rPr = findChildByTagName(run, 'w:rPr');
|
|
298
|
+
if (!rPr) {
|
|
299
|
+
rPr = createEl('w:rPr');
|
|
300
|
+
// Insert rPr at the beginning of run's children
|
|
301
|
+
run.insertBefore(rPr, run.firstChild);
|
|
302
|
+
}
|
|
303
|
+
// Create rPrChange
|
|
304
|
+
const id = allocateRevisionId(state);
|
|
305
|
+
const rPrChange = createEl('w:rPrChange', {
|
|
306
|
+
'w:id': String(id),
|
|
307
|
+
'w:author': author,
|
|
308
|
+
'w:date': dateStr,
|
|
309
|
+
});
|
|
310
|
+
// Clone old properties into a w:rPr wrapper inside rPrChange (OOXML spec requires
|
|
311
|
+
// rPrChange to contain a single w:rPr child holding the previous formatting).
|
|
312
|
+
if (oldRunProperties) {
|
|
313
|
+
const oldRPr = createEl('w:rPr');
|
|
314
|
+
for (const child of childElements(oldRunProperties)) {
|
|
315
|
+
const cloned = child.cloneNode(true);
|
|
316
|
+
oldRPr.appendChild(cloned);
|
|
317
|
+
}
|
|
318
|
+
rPrChange.appendChild(oldRPr);
|
|
319
|
+
}
|
|
320
|
+
// Add rPrChange to rPr
|
|
321
|
+
rPr.appendChild(rPrChange);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Add a paragraph property change element (w:pPrChange) to record the "before"
|
|
325
|
+
* state of paragraph properties. This is needed for Google Docs to display
|
|
326
|
+
* inserted paragraphs as tracked changes.
|
|
327
|
+
*
|
|
328
|
+
* The child `<w:pPr>` inside `w:pPrChange` must conform to CT_PPrBase — it
|
|
329
|
+
* MUST NOT contain w:rPr, w:sectPr, or w:pPrChange.
|
|
330
|
+
*
|
|
331
|
+
* @param paragraph - The w:p element
|
|
332
|
+
* @param author - Author name
|
|
333
|
+
* @param dateStr - Formatted date
|
|
334
|
+
* @param state - Revision ID state
|
|
335
|
+
*/
|
|
336
|
+
export function addParagraphPropertyChange(paragraph, author, dateStr, state) {
|
|
337
|
+
let pPr = findChildByTagName(paragraph, 'w:pPr');
|
|
338
|
+
if (!pPr) {
|
|
339
|
+
pPr = createEl('w:pPr');
|
|
340
|
+
paragraph.insertBefore(pPr, paragraph.firstChild);
|
|
341
|
+
}
|
|
342
|
+
// Idempotent — don't add a second pPrChange.
|
|
343
|
+
if (findChildByTagName(pPr, 'w:pPrChange'))
|
|
344
|
+
return;
|
|
345
|
+
const id = allocateRevisionId(state);
|
|
346
|
+
const pPrChange = createEl('w:pPrChange', {
|
|
347
|
+
'w:id': String(id),
|
|
348
|
+
'w:author': author,
|
|
349
|
+
'w:date': dateStr,
|
|
350
|
+
});
|
|
351
|
+
// Clone current pPr content as "before" snapshot.
|
|
352
|
+
// pPrChange child pPr must be CT_PPrBase — exclude rPr, rPrChange, sectPr, pPrChange.
|
|
353
|
+
const EXCLUDED = new Set(['w:rPr', 'w:rPrChange', 'w:pPrChange', 'w:sectPr']);
|
|
354
|
+
const oldPPr = createEl('w:pPr');
|
|
355
|
+
for (const child of childElements(pPr)) {
|
|
356
|
+
if (!EXCLUDED.has(child.tagName))
|
|
357
|
+
oldPPr.appendChild(child.cloneNode(true));
|
|
358
|
+
}
|
|
359
|
+
pPrChange.appendChild(oldPPr);
|
|
360
|
+
pPr.appendChild(pPrChange); // pPrChange goes last in pPr per schema
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Tag names that represent visible content inside a w:r element.
|
|
364
|
+
* A run containing at least one of these is considered substantive (non-empty).
|
|
365
|
+
*/
|
|
366
|
+
export const RUN_VISIBLE_CONTENT_TAGS = new Set([
|
|
367
|
+
'w:t', 'w:tab', 'w:br', 'w:cr', 'w:drawing', 'w:object', 'w:pict',
|
|
368
|
+
'w:sym', 'w:fldChar', 'w:instrText',
|
|
369
|
+
]);
|
|
370
|
+
/**
|
|
371
|
+
* Returns true if a w:r element contains at least one visible content child.
|
|
372
|
+
* Empty runs (containing only w:rPr or nothing) return false.
|
|
373
|
+
*/
|
|
374
|
+
export function runHasVisibleContent(run) {
|
|
375
|
+
for (let i = 0; i < run.childNodes.length; i++) {
|
|
376
|
+
const child = run.childNodes[i];
|
|
377
|
+
if (child.nodeType === 1 && RUN_VISIBLE_CONTENT_TAGS.has(child.tagName)) {
|
|
378
|
+
return true;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Wrap an inserted empty paragraph with <w:ins>.
|
|
385
|
+
*
|
|
386
|
+
* For empty paragraphs (no content, only pPr), we wrap the entire paragraph.
|
|
387
|
+
*
|
|
388
|
+
* @param paragraph - The w:p element
|
|
389
|
+
* @param author - Author name
|
|
390
|
+
* @param dateStr - Formatted date
|
|
391
|
+
* @param state - Revision ID state
|
|
392
|
+
*/
|
|
393
|
+
export function wrapParagraphAsInserted(paragraph, author, dateStr, state) {
|
|
394
|
+
// Mark the paragraph MARK as inserted (<w:pPr><w:rPr><w:ins/>). For a genuinely
|
|
395
|
+
// inserted paragraph the paragraph break itself is a tracked insertion, so this
|
|
396
|
+
// marker is what makes Reject All remove the whole paragraph (mark + content) and
|
|
397
|
+
// Accept All keep it. The individual runs are wrapped in <w:ins> separately; this
|
|
398
|
+
// function only adds the paragraph-mark marker.
|
|
399
|
+
//
|
|
400
|
+
// We ALWAYS emit the marker, including for non-empty paragraphs. A prior heuristic
|
|
401
|
+
// omitted it when the paragraph had substantive run content, on the (uncited) belief
|
|
402
|
+
// that Google Docs hides w:ins-wrapped runs that coexist with a PPR-INS marker. That
|
|
403
|
+
// is false — Google Docs renders the inserted runs identically with or without
|
|
404
|
+
// PPR-INS, and rejecting WITH the marker is cleaner there (it leaves no empty
|
|
405
|
+
// paragraph). Omitting the marker forced Reject All to guess via a content-based
|
|
406
|
+
// "all content is inside w:ins" heuristic that over-deleted foreign paragraphs whose
|
|
407
|
+
// mark is untracked (i.e. text inserted into a pre-existing paragraph, which Word and
|
|
408
|
+
// LibreOffice keep as an empty paragraph on reject). Reject is now purely mark-based
|
|
409
|
+
// (see rejectAllChanges / rejectChanges), which requires this marker to be present.
|
|
410
|
+
addParagraphMarkRevisionMarker(paragraph, 'w:ins', author, dateStr, state);
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Wrap a deleted empty paragraph with <w:del>.
|
|
415
|
+
*
|
|
416
|
+
* @param paragraph - The w:p element
|
|
417
|
+
* @param author - Author name
|
|
418
|
+
* @param dateStr - Formatted date
|
|
419
|
+
* @param state - Revision ID state
|
|
420
|
+
*/
|
|
421
|
+
export function wrapParagraphAsDeleted(paragraph, author, dateStr, state) {
|
|
422
|
+
// See wrapParagraphAsInserted: represent paragraph deletion via a paragraph-mark
|
|
423
|
+
// revision marker in w:pPr/w:rPr so Accept/Reject All behaves correctly.
|
|
424
|
+
addParagraphMarkRevisionMarker(paragraph, 'w:del', author, dateStr, state);
|
|
425
|
+
return true;
|
|
426
|
+
}
|
|
427
|
+
//# sourceMappingURL=inPlaceModifier-wrappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inPlaceModifier-wrappers.js","sourceRoot":"","sources":["../../../src/baselines/atomizer/inPlaceModifier-wrappers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,aAAa,GAEd,MAAM,6BAA6B,CAAC;AAIrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAiB;IAC3D,OAAO;IACP,OAAO;IACP,YAAY;IACZ,UAAU;CACX,CAAC,CAAC;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAwB,EACxB,QAAyB;IAEzB,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpE,MAAM,UAAU,GACd,QAAQ,KAAK,OAAO;YAClB,CAAC,CAAC,IAAI,CAAC,mBAAmB;YAC1B,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE,CAAC;QAE9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,SAAS,CAAC,gBAAgB,IAAI,iBAAiB,CAA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