feat(docx-io): add tracked changes and comments import/export#4836
feat(docx-io): add tracked changes and comments import/export#4836arthrod wants to merge 121 commits 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. |
52af579 to
04d04d8
Compare
…oth.js - Remove redundant biome suppression comment in roundtrip.spec.tsx - Use literal key instead of computed expression in export-comment-ids.spec.ts - Exclude vendored mammoth.js directory from biome linting https://claude.ai/code/session_016HSa8FaK9T51SfKE9TvZX4
fix(docx-io): fix lint errors in test files and exclude vendored mamm…
- Fix roundtrip test: replace registry imports with Base* plugins, resolve mammoth fixtures from npm package, add render.as config for table/link plugins to enable proper HTML serialization - Fix export-replies test: update date expectations to match normalizeDate output format (no milliseconds) - Fix lists test: unskip and update expected output to match BaseListPlugin indent-based flat paragraph behavior - Fix testDocxImporter: rewrite to use Base* plugins instead of React plugin variants that required unavailable packages - Add missing devDependencies for test plugins - Fix type error: use any[] for editorPlugins array in tests All 300 tests pass, 0 failures, 0 skipped. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Removed the 'generate_from_rules' setting from skills.
Removed 'mammoth' dependency from package.json.
Removes ~700MB of downloads (puppeteer ~500MB Chromium, playwright ~200MB). These caused OOM during CI builds. Scripts now print install instructions instead of failing silently. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
- Fix DocxExportPlugin import in DocxIOPlugin.spec.tsx (not re-exported from DocxIOPlugin) - Fix SlatePlugin[] type incompatibility in roundtrip.spec.tsx - Add @playwright/test as devDep to @platejs/playwright (was only peerDep, needed for typecheck after removing from root) - Fix biome lint error (template literal) https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Skiller moved .claude/rules/ to .claude/skills/ and added SKILL.md metadata files. Also includes external spec file updates. https://claude.ai/code/session_01Re6XP9ZEbTqXe4ng3mFRr1
Bumps the npm_and_yarn group with 16 updates in the / directory: | Package | From | To | | --- | --- | --- | | [lodash](https://github.com/lodash/lodash) | `4.17.21` | `4.17.23` | | [next](https://github.com/vercel/next.js) | `16.0.10` | `16.1.5` | | [glob](https://github.com/isaacs/node-glob) | `11.0.2` | `12.0.0` | | [validator](https://github.com/validatorjs/validator.js) | `13.15.15` | `13.15.22` | | [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) | `1.12.1` | `1.27.0` | | [@trpc/server](https://github.com/trpc/trpc/tree/HEAD/packages/server) | `11.7.1` | `11.10.0` | | [bn.js](https://github.com/indutny/bn.js) | `4.12.2` | `4.12.3` | | [diff](https://github.com/kpdecker/jsdiff) | `4.0.2` | `4.0.4` | | [mdast-util-to-hast](https://github.com/syntax-tree/mdast-util-to-hast) | `13.2.0` | `13.2.1` | | [pbkdf2](https://github.com/browserify/pbkdf2) | `3.1.2` | `3.1.5` | | [qs](https://github.com/ljharb/qs) | `6.14.0` | `6.15.0` | | [sha.js](https://github.com/crypto-browserify/sha.js) | `2.4.11` | `2.4.12` | | [tar-fs](https://github.com/mafintosh/tar-fs) | `3.0.9` | `3.1.1` | | [tar](https://github.com/isaacs/node-tar) | `7.4.3` | `7.5.9` | | [undici](https://github.com/nodejs/undici) | `7.10.0` | `7.22.0` | | [zx](https://github.com/google/zx) | `7.2.3` | `7.2.4` | Bumps the npm_and_yarn group with 3 updates in the /apps/www directory: [lodash](https://github.com/lodash/lodash), [next](https://github.com/vercel/next.js) and [glob](https://github.com/isaacs/node-glob). Bumps the npm_and_yarn group with 2 updates in the /templates/plate-playground-template directory: [ai](https://github.com/vercel/ai) and [next](https://github.com/vercel/next.js). Bumps the npm_and_yarn group with 1 update in the /templates/plate-template directory: [next](https://github.com/vercel/next.js). Updates `lodash` from 4.17.21 to 4.17.23 - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) Updates `next` from 16.0.10 to 16.1.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v16.0.10...v16.1.5) Updates `glob` from 11.0.2 to 12.0.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v11.0.2...v12.0.0) Updates `validator` from 13.15.15 to 13.15.22 - [Release notes](https://github.com/validatorjs/validator.js/releases) - [Changelog](https://github.com/validatorjs/validator.js/blob/master/CHANGELOG.md) - [Commits](validatorjs/validator.js@13.15.15...13.15.22) Updates `@modelcontextprotocol/sdk` from 1.12.1 to 1.27.0 - [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases) - [Commits](modelcontextprotocol/typescript-sdk@1.12.1...v1.27.0) Updates `@trpc/server` from 11.7.1 to 11.10.0 - [Release notes](https://github.com/trpc/trpc/releases) - [Commits](https://github.com/trpc/trpc/commits/v11.10.0/packages/server) Updates `bn.js` from 4.12.2 to 4.12.3 - [Release notes](https://github.com/indutny/bn.js/releases) - [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md) - [Commits](indutny/bn.js@v4.12.2...v4.12.3) Updates `body-parser` from 2.2.0 to 2.2.2 - [Release notes](https://github.com/expressjs/body-parser/releases) - [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md) - [Commits](expressjs/body-parser@v2.2.0...v2.2.2) Updates `diff` from 4.0.2 to 4.0.4 - [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md) - [Commits](kpdecker/jsdiff@v4.0.2...v4.0.4) Updates `mdast-util-to-hast` from 13.2.0 to 13.2.1 - [Release notes](https://github.com/syntax-tree/mdast-util-to-hast/releases) - [Commits](syntax-tree/mdast-util-to-hast@13.2.0...13.2.1) Updates `pbkdf2` from 3.1.2 to 3.1.5 - [Changelog](https://github.com/browserify/pbkdf2/blob/master/CHANGELOG.md) - [Commits](browserify/pbkdf2@v3.1.2...v3.1.5) Updates `qs` from 6.14.0 to 6.15.0 - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](ljharb/qs@v6.14.0...v6.15.0) Updates `sha.js` from 2.4.11 to 2.4.12 - [Changelog](https://github.com/browserify/sha.js/blob/master/CHANGELOG.md) - [Commits](browserify/sha.js@v2.4.11...v2.4.12) Updates `tar-fs` from 3.0.9 to 3.1.1 - [Commits](mafintosh/tar-fs@v3.0.9...v3.1.1) Updates `tar` from 7.4.3 to 7.5.9 - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v7.4.3...v7.5.9) Updates `undici` from 7.10.0 to 7.22.0 - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](nodejs/undici@v7.10.0...v7.22.0) Updates `zx` from 7.2.3 to 7.2.4 - [Release notes](https://github.com/google/zx/releases) - [Commits](google/zx@7.2.3...7.2.4) Updates `lodash` from 4.17.21 to 4.17.23 - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) Updates `next` from 16.0.10 to 16.1.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v16.0.10...v16.1.5) Updates `glob` from 11.0.2 to 12.0.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v11.0.2...v12.0.0) Updates `ai` from 5.0.28 to 5.0.52 - [Release notes](https://github.com/vercel/ai/releases) - [Changelog](https://github.com/vercel/ai/blob/main/CHANGELOG.md) - [Commits](https://github.com/vercel/ai/compare/ai@5.0.28...ai@5.0.52) Updates `next` from 16.0.3 to 16.1.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v16.0.10...v16.1.5) Updates `next` from 16.0.3 to 16.1.5 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v16.0.10...v16.1.5) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: next dependency-version: 16.1.5 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: glob dependency-version: 12.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: validator dependency-version: 13.15.22 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: "@modelcontextprotocol/sdk" dependency-version: 1.27.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: "@trpc/server" dependency-version: 11.10.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: bn.js dependency-version: 4.12.3 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: body-parser dependency-version: 2.2.2 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: diff dependency-version: 4.0.4 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: mdast-util-to-hast dependency-version: 13.2.1 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: pbkdf2 dependency-version: 3.1.5 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: qs dependency-version: 6.15.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: sha.js dependency-version: 2.4.12 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tar-fs dependency-version: 3.1.1 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: tar dependency-version: 7.5.9 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: undici dependency-version: 7.22.0 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: zx dependency-version: 7.2.4 dependency-type: indirect dependency-group: npm_and_yarn - dependency-name: lodash dependency-version: 4.17.23 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: next dependency-version: 16.1.5 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: glob dependency-version: 12.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: ai dependency-version: 5.0.52 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: next dependency-version: 16.1.5 dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: next dependency-version: 16.1.5 dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com>
…yarn-7f4e323a06 Bump the npm_and_yarn group across 4 directories with 18 updates
…sfy useThrowOnlyError lint rule https://claude.ai/code/session_01V5zGakMe6vBHVZEAinNrsC
tests(docx-io): throw Error objects in applyDocxTracking.spec to sati…
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry I missed this you can only focus on playground I will update template later |
|
I was able to take care of the template! Now just the docxio needs review. |
.claude/commands/changeset.md
Outdated
There was a problem hiding this comment.
.claude folder is removed by accident?
There was a problem hiding this comment.
Yes! I'm updating to pnpm, but will leave open until I'm done.
templates/plate-template/bun.lock
Outdated
There was a problem hiding this comment.
Should we remove this? same for plate-playground-template
Apply validated PR #184 review feedback and resolve conflicts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document dot-starting diffs vs main and docxio direct/indirect file inventory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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