@adeu/core 1.25.0 → 1.26.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 +298 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +296 -73
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/diff.ts +129 -4
- package/src/engine.ts +135 -18
- package/src/index.ts +1 -1
- package/src/ingest.ts +11 -2
- package/src/mapper.ts +99 -47
- package/src/repro_qa_report_v7.test.ts +380 -0
- package/src/sanitize/core.ts +3 -0
- package/src/sanitize/transforms.ts +29 -0
- package/src/utils/docx.ts +30 -2
package/dist/index.d.cts
CHANGED
|
@@ -67,6 +67,7 @@ interface TextSpan {
|
|
|
67
67
|
comment_ids?: string[];
|
|
68
68
|
part_index: number;
|
|
69
69
|
is_image_marker?: boolean;
|
|
70
|
+
run_offset?: number;
|
|
70
71
|
}
|
|
71
72
|
declare class DocumentMapper {
|
|
72
73
|
doc: DocumentObject;
|
|
@@ -393,6 +394,18 @@ declare class RedlineEngine {
|
|
|
393
394
|
*/
|
|
394
395
|
private _build_tracked_ins_for_line;
|
|
395
396
|
private _parse_markdown_style;
|
|
397
|
+
/**
|
|
398
|
+
* True when this edit's target or replacement text carries explicit
|
|
399
|
+
* bold/italic markers, making the markers AUTHORITATIVE for the inserted
|
|
400
|
+
* runs' formatting. Replacing `**X**` with `_X_` must yield italic-only
|
|
401
|
+
* text, and replacing `**X**` with `X` must yield plain text — inheriting
|
|
402
|
+
* the replaced span's run properties on top of (or instead of) the
|
|
403
|
+
* requested markers silently produces the wrong document while the report
|
|
404
|
+
* claims success (QA 2026-07-19 F-02). Plain-text edits (no markers on
|
|
405
|
+
* either side) keep inheriting the context style so partial replacements
|
|
406
|
+
* inside a styled span never lose formatting.
|
|
407
|
+
*/
|
|
408
|
+
private _edit_declares_emphasis;
|
|
396
409
|
private _parse_inline_markdown;
|
|
397
410
|
private _apply_run_props;
|
|
398
411
|
/**
|
|
@@ -509,6 +522,16 @@ declare function generate_structured_edits(text_orig: string, struct_orig: Extra
|
|
|
509
522
|
edits: DiffEdit[];
|
|
510
523
|
warnings: string[];
|
|
511
524
|
};
|
|
525
|
+
/**
|
|
526
|
+
* Compares embedded media bytes (word/media/*) between two DOCX packages.
|
|
527
|
+
* Adeu's diff is a text comparison: two documents whose images differ but
|
|
528
|
+
* whose projections agree produce an empty diff, which reads as "visually
|
|
529
|
+
* identical" unless the caller says otherwise (QA 2026-07-19 F-04). Returns
|
|
530
|
+
* warning strings describing changed/added/removed media members; empty when
|
|
531
|
+
* the media sets are byte-identical (or either package is unreadable — the
|
|
532
|
+
* caller has already surfaced package-level errors).
|
|
533
|
+
*/
|
|
534
|
+
declare function collect_media_difference_warnings(original_docx: Uint8Array, modified_docx: Uint8Array): string[];
|
|
512
535
|
declare function create_unified_diff(original_text: string, modified_text: string, context_lines?: number): string;
|
|
513
536
|
declare function create_word_patch_diff(original_text: string, modified_text: string, original_path?: string, modified_path?: string): string;
|
|
514
537
|
|
|
@@ -621,4 +644,4 @@ declare function userSearch(pattern: string, text: string, flags?: string): {
|
|
|
621
644
|
|
|
622
645
|
declare function identifyEngine(): string;
|
|
623
646
|
|
|
624
|
-
export { BatchValidationError, type DiffEdit, DocumentMapper, DocumentObject, type ExtractStructure, type FinalizeOptions, type FinalizeResult, type MarkupEditReport, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, RegexTimeoutError, type RowGeometry, type TableGeometry, type TextSpan, USER_PATTERN_TIMEOUT_MS, _extractTextFromDoc, apply_edits_to_markdown, create_unified_diff, create_word_patch_diff, describe_illegal_control_chars, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, generate_structured_edits, identifyEngine, paginate, split_structural_appendix, trim_common_context, userFindAllMatches, userSearch, validate_edit_strings };
|
|
647
|
+
export { BatchValidationError, type DiffEdit, DocumentMapper, DocumentObject, type ExtractStructure, type FinalizeOptions, type FinalizeResult, type MarkupEditReport, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, RegexTimeoutError, type RowGeometry, type TableGeometry, type TextSpan, USER_PATTERN_TIMEOUT_MS, _extractTextFromDoc, apply_edits_to_markdown, collect_media_difference_warnings, create_unified_diff, create_word_patch_diff, describe_illegal_control_chars, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, generate_structured_edits, identifyEngine, paginate, split_structural_appendix, trim_common_context, userFindAllMatches, userSearch, validate_edit_strings };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ interface TextSpan {
|
|
|
67
67
|
comment_ids?: string[];
|
|
68
68
|
part_index: number;
|
|
69
69
|
is_image_marker?: boolean;
|
|
70
|
+
run_offset?: number;
|
|
70
71
|
}
|
|
71
72
|
declare class DocumentMapper {
|
|
72
73
|
doc: DocumentObject;
|
|
@@ -393,6 +394,18 @@ declare class RedlineEngine {
|
|
|
393
394
|
*/
|
|
394
395
|
private _build_tracked_ins_for_line;
|
|
395
396
|
private _parse_markdown_style;
|
|
397
|
+
/**
|
|
398
|
+
* True when this edit's target or replacement text carries explicit
|
|
399
|
+
* bold/italic markers, making the markers AUTHORITATIVE for the inserted
|
|
400
|
+
* runs' formatting. Replacing `**X**` with `_X_` must yield italic-only
|
|
401
|
+
* text, and replacing `**X**` with `X` must yield plain text — inheriting
|
|
402
|
+
* the replaced span's run properties on top of (or instead of) the
|
|
403
|
+
* requested markers silently produces the wrong document while the report
|
|
404
|
+
* claims success (QA 2026-07-19 F-02). Plain-text edits (no markers on
|
|
405
|
+
* either side) keep inheriting the context style so partial replacements
|
|
406
|
+
* inside a styled span never lose formatting.
|
|
407
|
+
*/
|
|
408
|
+
private _edit_declares_emphasis;
|
|
396
409
|
private _parse_inline_markdown;
|
|
397
410
|
private _apply_run_props;
|
|
398
411
|
/**
|
|
@@ -509,6 +522,16 @@ declare function generate_structured_edits(text_orig: string, struct_orig: Extra
|
|
|
509
522
|
edits: DiffEdit[];
|
|
510
523
|
warnings: string[];
|
|
511
524
|
};
|
|
525
|
+
/**
|
|
526
|
+
* Compares embedded media bytes (word/media/*) between two DOCX packages.
|
|
527
|
+
* Adeu's diff is a text comparison: two documents whose images differ but
|
|
528
|
+
* whose projections agree produce an empty diff, which reads as "visually
|
|
529
|
+
* identical" unless the caller says otherwise (QA 2026-07-19 F-04). Returns
|
|
530
|
+
* warning strings describing changed/added/removed media members; empty when
|
|
531
|
+
* the media sets are byte-identical (or either package is unreadable — the
|
|
532
|
+
* caller has already surfaced package-level errors).
|
|
533
|
+
*/
|
|
534
|
+
declare function collect_media_difference_warnings(original_docx: Uint8Array, modified_docx: Uint8Array): string[];
|
|
512
535
|
declare function create_unified_diff(original_text: string, modified_text: string, context_lines?: number): string;
|
|
513
536
|
declare function create_word_patch_diff(original_text: string, modified_text: string, original_path?: string, modified_path?: string): string;
|
|
514
537
|
|
|
@@ -621,4 +644,4 @@ declare function userSearch(pattern: string, text: string, flags?: string): {
|
|
|
621
644
|
|
|
622
645
|
declare function identifyEngine(): string;
|
|
623
646
|
|
|
624
|
-
export { BatchValidationError, type DiffEdit, DocumentMapper, DocumentObject, type ExtractStructure, type FinalizeOptions, type FinalizeResult, type MarkupEditReport, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, RegexTimeoutError, type RowGeometry, type TableGeometry, type TextSpan, USER_PATTERN_TIMEOUT_MS, _extractTextFromDoc, apply_edits_to_markdown, create_unified_diff, create_word_patch_diff, describe_illegal_control_chars, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, generate_structured_edits, identifyEngine, paginate, split_structural_appendix, trim_common_context, userFindAllMatches, userSearch, validate_edit_strings };
|
|
647
|
+
export { BatchValidationError, type DiffEdit, DocumentMapper, DocumentObject, type ExtractStructure, type FinalizeOptions, type FinalizeResult, type MarkupEditReport, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, RegexTimeoutError, type RowGeometry, type TableGeometry, type TextSpan, USER_PATTERN_TIMEOUT_MS, _extractTextFromDoc, apply_edits_to_markdown, collect_media_difference_warnings, create_unified_diff, create_word_patch_diff, describe_illegal_control_chars, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, generate_structured_edits, identifyEngine, paginate, split_structural_appendix, trim_common_context, userFindAllMatches, userSearch, validate_edit_strings };
|