@adeu/core 1.13.0 → 1.15.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/index.cjs +2215 -1789
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -12
- package/dist/index.d.ts +7 -12
- package/dist/index.js +2215 -1789
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/comment_dedup.test.ts +269 -0
- package/src/domain.test.ts +280 -77
- package/src/domain.ts +146 -46
- package/src/engine.bugs.test.ts +20 -0
- package/src/engine.qa.test.ts +162 -0
- package/src/engine.ts +302 -89
- package/src/ingest.ts +283 -133
- package/src/mapper.ts +425 -196
- package/src/models.ts +2 -0
- package/src/repro_heading_bug.test.ts +174 -0
- package/src/search_write_engine.test.ts +112 -0
package/dist/index.d.cts
CHANGED
|
@@ -64,6 +64,7 @@ interface TextSpan {
|
|
|
64
64
|
ins_id?: string | null;
|
|
65
65
|
del_id?: string | null;
|
|
66
66
|
hyperlink_id?: string | null;
|
|
67
|
+
comment_ids?: string[];
|
|
67
68
|
}
|
|
68
69
|
declare class DocumentMapper {
|
|
69
70
|
doc: DocumentObject;
|
|
@@ -85,8 +86,8 @@ declare class DocumentMapper {
|
|
|
85
86
|
private _add_virtual_text;
|
|
86
87
|
private _replace_smart_quotes;
|
|
87
88
|
private _make_fuzzy_regex;
|
|
88
|
-
find_match_index(target_text: string): [number, number];
|
|
89
|
-
find_all_match_indices(target_text: string): [number, number][];
|
|
89
|
+
find_match_index(target_text: string, is_regex?: boolean): [number, number];
|
|
90
|
+
find_all_match_indices(target_text: string, is_regex?: boolean): [number, number][];
|
|
90
91
|
find_target_runs(target_text: string): Run[];
|
|
91
92
|
find_target_runs_by_index(start_index: number, length: number, rebuild_map?: boolean): Run[];
|
|
92
93
|
get_virtual_spans_in_range(start_index: number, length: number): TextSpan[];
|
|
@@ -132,6 +133,8 @@ interface ModifyText {
|
|
|
132
133
|
target_text: string;
|
|
133
134
|
new_text: string;
|
|
134
135
|
comment?: string | null;
|
|
136
|
+
match_mode?: 'strict' | 'first' | 'all';
|
|
137
|
+
regex?: boolean;
|
|
135
138
|
_match_start_index?: number | null;
|
|
136
139
|
_internal_op?: string | null;
|
|
137
140
|
_active_mapper_ref?: any | null;
|
|
@@ -185,6 +188,7 @@ declare class RedlineEngine {
|
|
|
185
188
|
private _check_punctuation_warning;
|
|
186
189
|
private _build_edit_context_previews;
|
|
187
190
|
private _scan_existing_ids;
|
|
191
|
+
private _get_heading_path_and_page;
|
|
188
192
|
accept_all_revisions(): void;
|
|
189
193
|
private _getNextId;
|
|
190
194
|
private _create_track_change_tag;
|
|
@@ -268,18 +272,9 @@ declare class RedlineEngine {
|
|
|
268
272
|
validate_review_actions(actions: any[]): string[];
|
|
269
273
|
process_batch(changes: DocumentChange[], dry_run?: boolean): any;
|
|
270
274
|
private _process_batch_internal;
|
|
271
|
-
apply_edits(edits: any[]): [number, number];
|
|
275
|
+
apply_edits(edits: any[], page_offsets?: number[]): [number, number];
|
|
272
276
|
apply_review_actions(actions: any[]): [number, number];
|
|
273
277
|
private _apply_table_edit;
|
|
274
|
-
/**
|
|
275
|
-
* Returns the first match of `target_text` in the raw mapper that is NOT
|
|
276
|
-
* entirely contained within a tracked deletion (<w:del>). Tracked-deleted
|
|
277
|
-
* copies are not live, editable text, so an edit must resolve to a live
|
|
278
|
-
* occurrence even when a dead copy appears earlier in the document
|
|
279
|
-
* (BUG-23-5). Falls back to the plain first match when no live copy is
|
|
280
|
-
* found (e.g. fuzzy/normalized matches the span filter cannot align).
|
|
281
|
-
*/
|
|
282
|
-
private _first_live_match;
|
|
283
278
|
private _pre_resolve_heuristic_edit;
|
|
284
279
|
private _apply_single_edit_indexed;
|
|
285
280
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ interface TextSpan {
|
|
|
64
64
|
ins_id?: string | null;
|
|
65
65
|
del_id?: string | null;
|
|
66
66
|
hyperlink_id?: string | null;
|
|
67
|
+
comment_ids?: string[];
|
|
67
68
|
}
|
|
68
69
|
declare class DocumentMapper {
|
|
69
70
|
doc: DocumentObject;
|
|
@@ -85,8 +86,8 @@ declare class DocumentMapper {
|
|
|
85
86
|
private _add_virtual_text;
|
|
86
87
|
private _replace_smart_quotes;
|
|
87
88
|
private _make_fuzzy_regex;
|
|
88
|
-
find_match_index(target_text: string): [number, number];
|
|
89
|
-
find_all_match_indices(target_text: string): [number, number][];
|
|
89
|
+
find_match_index(target_text: string, is_regex?: boolean): [number, number];
|
|
90
|
+
find_all_match_indices(target_text: string, is_regex?: boolean): [number, number][];
|
|
90
91
|
find_target_runs(target_text: string): Run[];
|
|
91
92
|
find_target_runs_by_index(start_index: number, length: number, rebuild_map?: boolean): Run[];
|
|
92
93
|
get_virtual_spans_in_range(start_index: number, length: number): TextSpan[];
|
|
@@ -132,6 +133,8 @@ interface ModifyText {
|
|
|
132
133
|
target_text: string;
|
|
133
134
|
new_text: string;
|
|
134
135
|
comment?: string | null;
|
|
136
|
+
match_mode?: 'strict' | 'first' | 'all';
|
|
137
|
+
regex?: boolean;
|
|
135
138
|
_match_start_index?: number | null;
|
|
136
139
|
_internal_op?: string | null;
|
|
137
140
|
_active_mapper_ref?: any | null;
|
|
@@ -185,6 +188,7 @@ declare class RedlineEngine {
|
|
|
185
188
|
private _check_punctuation_warning;
|
|
186
189
|
private _build_edit_context_previews;
|
|
187
190
|
private _scan_existing_ids;
|
|
191
|
+
private _get_heading_path_and_page;
|
|
188
192
|
accept_all_revisions(): void;
|
|
189
193
|
private _getNextId;
|
|
190
194
|
private _create_track_change_tag;
|
|
@@ -268,18 +272,9 @@ declare class RedlineEngine {
|
|
|
268
272
|
validate_review_actions(actions: any[]): string[];
|
|
269
273
|
process_batch(changes: DocumentChange[], dry_run?: boolean): any;
|
|
270
274
|
private _process_batch_internal;
|
|
271
|
-
apply_edits(edits: any[]): [number, number];
|
|
275
|
+
apply_edits(edits: any[], page_offsets?: number[]): [number, number];
|
|
272
276
|
apply_review_actions(actions: any[]): [number, number];
|
|
273
277
|
private _apply_table_edit;
|
|
274
|
-
/**
|
|
275
|
-
* Returns the first match of `target_text` in the raw mapper that is NOT
|
|
276
|
-
* entirely contained within a tracked deletion (<w:del>). Tracked-deleted
|
|
277
|
-
* copies are not live, editable text, so an edit must resolve to a live
|
|
278
|
-
* occurrence even when a dead copy appears earlier in the document
|
|
279
|
-
* (BUG-23-5). Falls back to the plain first match when no live copy is
|
|
280
|
-
* found (e.g. fuzzy/normalized matches the span filter cannot align).
|
|
281
|
-
*/
|
|
282
|
-
private _first_live_match;
|
|
283
278
|
private _pre_resolve_heuristic_edit;
|
|
284
279
|
private _apply_single_edit_indexed;
|
|
285
280
|
}
|