feat(docx-io): add tracked changes and comments import/export#4836
Open
arthrod wants to merge 1 commit intoudecode:mainfrom
Open
feat(docx-io): add tracked changes and comments import/export#4836arthrod wants to merge 1 commit intoudecode:mainfrom
arthrod wants to merge 1 commit intoudecode:mainfrom
Conversation
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
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Export pipeline:
App integration:
Key features:
Checklist
yarn typecheckyarn lint:fixyarn testyarn brlyarn changeset