@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.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 };