Skip to content

feat(vue): cherry-pick PR #245 + hardening foundation for vue-editor-robust-implementation#345

Merged
jedrazb merged 4 commits into1.0.0-releasefrom
vue-editor-robust-implementation
May 4, 2026
Merged

feat(vue): cherry-pick PR #245 + hardening foundation for vue-editor-robust-implementation#345
jedrazb merged 4 commits into1.0.0-releasefrom
vue-editor-robust-implementation

Conversation

@jedrazb
Copy link
Copy Markdown
Contributor

@jedrazb jedrazb commented May 4, 2026

Summary

Foundation drop for the vue-editor-robust-implementation OpenSpec change (proposal).

Cherry-picks the three meaningful commits from PR #245 (community Vue 3 implementation) onto a hardening branch off 1.0.0-release, then makes them build cleanly against today's core API.

The OpenSpec change documenting the full hardening plan ships in this PR too — proposal, design (22 decisions), specs (vue-adapter, vue-react-parity, framework-isolation-lint), and tasks (~115 items). This PR closes out task §1 (land #245) and §3.4 (audit + reactivity refactor input). Subsequent hardening work continues against this branch.

What's in this PR

Cherry-picked commits (original git authorship preserved)

PR #245 was opened on GitHub by @Cruiser13. The git-author on all three commits is Lennart Fries <mail@lennartsauter.de> — same person, different name across GitHub username vs git user.name.

Cherry-pick Original Git author Scope
389a264 3d3370a Lennart Fries feat: minimal Vue package harness + working editor component
35117c4 48026e6 Lennart Fries feat: full toolbar, dialogs, sidebar, command integration
d22da52 e731ee9 Lennart Fries fix: image handling — resize and replace

git log will surface these on the merge commit's history once squash-merge happens.

Hardening fixes on top (b77870e, this branch)

  • Adapter API drift. Rewrote useAutoSave.ts and useTableSelection.ts to match today's AutoSaveManager / TableSelectionManager / Subscribable APIs. The contributor wrote against an older snapshot — subscribe(() => void) + getSnapshot() (matches React's useSyncExternalStore pattern), interval not intervalMs, etc.
  • Vue package builder: tsup → vite. tsup/esbuild can't compile .vue SFCs. Switched packages/vue/ to vite build --lib with @vitejs/plugin-vue and vite-plugin-dts. Externalized vue, prosemirror-*, and @eigenpal/docx-editor-core. Output: index.js (es) + index.cjs + declarations.
  • Core exports map expansion. PR feat: add vue version of docx editor #245 reaches into ~25 deep core subpaths that weren't in the curated exports map after PR feat(core): expose framework-adapter subpaths via exports map #332. Added the missing paths to packages/core/package.json exports AND tsup.config.ts entry. Audit task tracked in the OpenSpec change.

Verification

  • bun run typecheck clean across all 5 packages
  • bun run build clean
  • bun run build:parity produces working examples/parity/dist with both /react/ and /vue/ routes
  • Manual smoke at 1-0-0.docx-editor.dev/vue/ once Vercel deploys this branch
  • Hardening tasks per tasks.md (this is task §1 + §3.4 only; §2-§14 follow on subsequent PRs against this branch)

Plumbing

  • New packages/vue/vite.config.ts (replaces tsup.config.ts)
  • Added vite-plugin-dts and prosemirror-model to vue devDeps
  • 24 new subpath entries in packages/core/package.json exports + matching tsup.config.ts entries

Out of scope (next PRs)

The full hardening list is in openspec/changes/vue-editor-robust-implementation/tasks.md:

  • §2-§3: branch scaffolding + audit notes
  • §4: framework-isolation lint
  • §5-§6: Vue API surface + plugin host
  • §7: Playwright parity test suite
  • §8b: parity gate infrastructure (export parity, i18n key parity, snapshot parity, smoke E2E, bundle size, pre-publish aggregate)
  • §9: agent SDK Vue subpath migration (incl. moving React agent UI from packages/react to packages/agent-use/src/react)
  • §10: agentic review passes (reactivity, accessibility, perf, framework isolation, visual diff)
  • §11: manual QA + perf budget
  • §12: docs (README, MIGRATING)
  • §13: un-stub gating
  • §14: ship

Attribution

The full Vue implementation foundation comes from PR #245 by @Cruiser13 (git author: Lennart Fries <mail@lennartsauter.de>). All three commits land on this branch with their original git author metadata intact. The un-stub release notes will credit the community foundation contribution explicitly per task §14.1.

🤖 Generated with Claude Code

Cruiser13 and others added 4 commits May 4, 2026 14:53
Implements a Vue 3 wrapper for the DOCX editor with DocxEditorVue component,
BasicToolbar, and useDocxEditor composable. Includes drag-to-select, blinking
caret, scroll-aware selection overlay, and working toolbar state updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation

Adds all Vue components (toolbar, dialogs, context menus, sidebar,
overlays), composables (zoom, auto-save, table selection), and i18n
support. Fixes toolbar reactivity for font size/family/color by reading
marks from first text node in selection range. Fixes page break
insertion, style dropdown (with style resolution), page setup re-layout,
text color, and clear formatting commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three sets of fixes on top of the cherry-picked Cruiser13 / Lennart
Fries commits so the parity build stays green on the hardening branch:

1) Adapter API drift since #245 was authored. The contributor wrote
   useAutoSave.ts and useTableSelection.ts against an older
   AutoSaveManager / TableSelectionManager / Subscribable API:
   - AutoSaveManagerOptions field is `interval` not `intervalMs`
   - subscribe() takes `() => void`, snapshot is read separately via
     getSnapshot() (matches React's useSyncExternalStore pattern)
   - lastSaveTime is `Date | null` not `number | null`
   - getRecoveryData() returns SavedDocumentData not string
   - save() is async and takes no args
   Rewrote both composables to match the current core API while
   keeping the same Vue-facing return shape. Drop unused `computed`
   import in i18n/index.ts (causes pre-commit lint trip).

2) Vue package builder: tsup → vite. PR #245 ships .vue SFCs which
   esbuild (under tsup) can't compile. Switched packages/vue/ to
   `vite build --lib` with @vitejs/plugin-vue and vite-plugin-dts.
   External: vue, prosemirror-*, and @eigenpal/docx-editor-core
   (consumers bring those). Output: index.js (es) + index.cjs +
   declaration files. Added prosemirror-model to vue's devDeps so
   the type imports resolve.

3) Core exports map expansion. PR #245 reaches into ~25 deep core
   subpaths that weren't in the curated exports map after PR #332.
   Added the missing paths to packages/core/package.json `exports`
   AND packages/core/tsup.config.ts `entry` so consumers (and the
   Vue package's build) actually resolve them. New subpaths under:
   - utils/ (headingCollector, textSelection)
   - docx/ (parser, rezip)
   - layout-bridge/ (clickToPositionDom, measuring, toFlowBlocks)
   - layout-engine/ (types)
   - layout-painter/ (renderPage)
   - managers/ (AutoSaveManager, TableSelectionManager, types)
   - prosemirror/ (commands/{formatting,pageBreak,paragraph},
     conversion/fromProseDoc, plugins/selectionTracker, schema, styles)

   These are framework-adapter integration points the Vue adapter
   genuinely needs. Audit (post-1.0) should evaluate whether some
   should fold back into the curated top-level subpaths from #332.

Verified: bun run typecheck clean across all 5 packages,
bun run build clean, bun run build:parity produces working
examples/parity/dist with both /react/ and /vue/ routes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docx-editor Ready Ready Preview, Comment May 4, 2026 1:03pm

Request Review

@jedrazb jedrazb merged commit c7d1c01 into 1.0.0-release May 4, 2026
2 checks passed
@jedrazb jedrazb deleted the vue-editor-robust-implementation branch May 4, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants