You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(docx-io): add tracked changes and comments import/export
Add full round-trip support for DOCX tracked changes (suggestions) and
comments with threading. This enables import/export of Word documents
while preserving revision history and comment discussions.
Import pipeline:
- Custom mammoth.js fork emits [[DOCX_*:...]] tokens for ins/del/comments
- importTrackChanges.ts parses tokens, applies suggestion marks
- importComments.ts parses comment tokens, creates discussion structures
- importDocx.ts orchestrates full pipeline with token cleanup
- searchRange.ts provides text-based range finding for token placement
Export pipeline:
- exportTrackChanges.ts injects tracking tokens into serialized HTML
- exportComments.ts handles comment-specific OOXML generation
- html-to-docx enhanced with comments.xml, commentsExtended.xml,
commentsIds.xml, commentsExtensible.xml, and people.xml generation
- Proper paraId threading for reply chains
App integration:
- import-toolbar-button.tsx: full DOCX import with user registration
- export-toolbar-button.tsx: export with discussions and suggestions
- suggestion-node-docx.tsx: DOCX-safe suggestion rendering (no ins/del)
- discussion-kit.tsx: paraId fields for round-trip fidelity
- docx-export-kit.tsx: SuggestionLeafDocx override for clean export
Key features:
- Suggestion authorship preserved through round-trip
- Comment threading via paraId/parentParaId linking
- UTC date handling for cross-timezone compatibility
- Overlapping comment ranges supported
- ImportedUser type for user store registration
0 commit comments