Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a31b3cf
Consolidate ribbon, spellcheck, and editor updates
erophames Mar 11, 2026
d3757d4
Integrate main updates and ribbon improvements
erophames Mar 11, 2026
4684320
Fix spellcheck DTS collision and format toolbar items
erophames Mar 11, 2026
4648e0f
Wire ribbon commands, context menus, and tests
erophames Mar 12, 2026
83b47ab
Merge branch 'main' into feature/toolbar-ribbon
erophames Mar 12, 2026
bb6a125
Fix typecheck unused imports
erophames Mar 12, 2026
84619c7
Update
erophames Mar 25, 2026
0472a1d
feat(ribbon): merge upstream PR #132 ribbon bar with all conflicts re…
yash-giantanalytics Mar 26, 2026
8d5b6be
fix: header/footer editor line spacing mismatch (upstream PR #228)
yash-giantanalytics Mar 26, 2026
723f730
feat: live agent chat with client-side document tools (upstream PR #201)
yash-giantanalytics Mar 26, 2026
b66ff9a
feat(review): add review toolbar, comment UI, template callbacks, and…
yash-giantanalytics Mar 26, 2026
ca528e9
chore(ci): add changeset-based release and GitHub Packages publishing
yash-giantanalytics Mar 26, 2026
097ac8f
fix: resolve build errors from PR cherry-picks (unused imports, dupli…
yash-giantanalytics Mar 26, 2026
62be81b
fix: disable default web worker factory (not available from published…
yash-giantanalytics Mar 26, 2026
cb6c529
fix: handle null worker factory gracefully in published package
yash-giantanalytics Mar 26, 2026
b03cc95
feat(comments): add @mention autocomplete with MentionProvider
yash-giantanalytics Mar 27, 2026
3f9e4cf
feat: add default heading styles to StylePicker, brand color override…
yash-giantanalytics Mar 27, 2026
692e927
feat(collab): add real-time collaborative editing package
yash-giantanalytics Mar 27, 2026
3a0becb
fix(collab): add files field to include dist/ in npm pack
yash-giantanalytics Mar 27, 2026
ec04f8a
chore: update changeset to include collab package
yash-giantanalytics Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/legal-review-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@eigenpal/docx-js-editor': minor
'@eigenpal/docx-collab': minor
---

Add review toolbar, comment UI, template onTagSelect callback, find-replace with track changes, @mention in comments, default heading styles, and real-time collaborative editing package (Yjs + Hocuspocus)
52 changes: 11 additions & 41 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,29 @@
name: Publish to npm
name: Publish

on:
release:
types: [published]
workflow_dispatch:
inputs:
dry-run:
description: 'Perform a dry run (no actual publish)'
required: false
default: 'false'
type: boolean

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run tests
run: bun test
- run: bun install --frozen-lockfile

- name: Type check
run: bun run typecheck

- name: Build
run: bun run build

- name: Publish (dry run)
if: ${{ github.event.inputs.dry-run == 'true' }}
working-directory: packages/react
run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: bun run build

- name: Publish
if: ${{ github.event.inputs.dry-run != 'true' }}
- name: Publish to GitHub Packages
working-directory: packages/react
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "@eigenpal:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
npm publish
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install --frozen-lockfile

# When changeset files exist: opens a "Version Packages" PR.
# When that PR merges (no changeset files left): tags + GitHub Release.
- uses: changesets/action@v1
with:
version: bun run version-packages
publish: bun run release
title: 'chore: release packages'
commit: 'chore: release packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ screenshots/
# npm lock file (using bun.lock)
package-lock.json

# Build info
*.tsbuildinfo
next-env.d.ts

# Examples framework artifacts
examples/*/node_modules/
examples/plugins/*/node_modules/
Expand Down
191 changes: 125 additions & 66 deletions bun.lock

Large diffs are not rendered by default.

82 changes: 46 additions & 36 deletions docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,55 @@

## Props

| Prop | Type | Default | Description |
| ---------------------- | ------------------------------------------- | ----------- | -------------------------------------------------------------------------------------- |
| `documentBuffer` | `ArrayBuffer \| Uint8Array \| Blob \| File` | — | `.docx` file contents to load |
| `document` | `Document` | — | Pre-parsed document (alternative to buffer) |
| `author` | `string` | `'User'` | Author name for comments and track changes |
| `mode` | `'editing' \| 'suggesting' \| 'viewing'` | `'editing'` | Editor mode — editing, suggesting (track changes), or viewing (read-only with toolbar) |
| `onModeChange` | `(mode: EditorMode) => void` | — | Called when the user changes the editing mode |
| `readOnly` | `boolean` | `false` | Read-only preview (hides toolbar, rulers, panel) |
| `showToolbar` | `boolean` | `true` | Show formatting toolbar |
| `showRuler` | `boolean` | `false` | Show horizontal & vertical rulers |
| `rulerUnit` | `'inch' \| 'cm'` | `'inch'` | Unit for ruler display |
| `showZoomControl` | `boolean` | `true` | Show zoom controls in toolbar |
| `showPrintButton` | `boolean` | `true` | Show print button in toolbar |
| `showOutline` | `boolean` | `false` | Show document outline sidebar (table of contents) |
| `showMarginGuides` | `boolean` | `false` | Show page margin guide boundaries |
| `marginGuideColor` | `string` | `'#c0c0c0'` | Color for margin guides |
| `initialZoom` | `number` | `1.0` | Initial zoom level |
| `theme` | `Theme \| null` | — | Theme for styling |
| `toolbarExtra` | `ReactNode` | — | Custom toolbar items appended to the toolbar |
| `placeholder` | `ReactNode` | — | Placeholder when no document is loaded |
| `loadingIndicator` | `ReactNode` | — | Custom loading indicator |
| `className` | `string` | — | Additional CSS class name |
| `style` | `CSSProperties` | — | Additional inline styles |
| `onChange` | `(doc: Document) => void` | — | Called on document change |
| `onSave` | `(buffer: ArrayBuffer) => void` | — | Called on save |
| `onError` | `(error: Error) => void` | — | Called on error |
| `onSelectionChange` | `(state: SelectionState \| null) => void` | — | Called on selection change |
| `onFontsLoaded` | `() => void` | — | Called when fonts finish loading |
| `onPrint` | `() => void` | — | Called when print is triggered |
| `onCopy` | `() => void` | — | Called when content is copied |
| `onCut` | `() => void` | — | Called when content is cut |
| `onPaste` | `() => void` | — | Called when content is pasted |
| `renderLogo` | `() => ReactNode` | — | Custom logo in the title bar |
| `documentName` | `string` | — | Editable document name in the title bar |
| `onDocumentNameChange` | `(name: string) => void` | — | Called when the user edits the document name |
| `renderTitleBarRight` | `() => ReactNode` | — | Custom right-side actions in the title bar |
| Prop | Type | Default | Description |
| ------------------------- | ------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------- |
| `documentBuffer` | `ArrayBuffer \| Uint8Array \| Blob \| File` | — | `.docx` file contents to load |
| `document` | `Document` | — | Pre-parsed document (alternative to buffer) |
| `author` | `string` | `'User'` | Author name for comments and track changes |
| `mode` | `'editing' \| 'suggesting' \| 'viewing'` | `'editing'` | Editor mode — editing, suggesting (track changes), or viewing (read-only with toolbar) |
| `onModeChange` | `(mode: EditorMode) => void` | — | Called when the user changes the editing mode |
| `readOnly` | `boolean` | `false` | Read-only preview (toolbar hidden unless `showToolbarWhenReadOnly` is true) |
| `showToolbar` | `boolean` | `true` | Show the toolbar area |
| `toolbar` | `'compact' \| 'ribbon'` | `'compact'` | Toolbar mode. Defaults to compact; ribbon is opt-in |
| `showToolbarWhenReadOnly` | `boolean` | — | Show toolbar in read-only (defaults to `true` for ribbon, `false` for compact) |
| `showRuler` | `boolean` | `false` | Show horizontal & vertical rulers (acts as initial value unless controlled) |
| `onShowRulerChange` | `(visible: boolean) => void` | — | Called when ribbon toggles ruler visibility (controlled mode) |
| `rulerUnit` | `'inch' \| 'cm'` | `'inch'` | Unit for ruler display |
| `showZoomControl` | `boolean` | `true` | Show zoom controls in toolbar |
| `showPrintButton` | `boolean` | `true` | Show print button in toolbar |
| `showPageNumbers` | `boolean` | `true` | Show page number indicator |
| `enablePageNavigation` | `boolean` | `true` | Enable interactive page navigation |
| `pageNumberPosition` | `string` | `'bottom-center'` | Position of page number indicator |
| `pageNumberVariant` | `string` | `'default'` | Variant of page number indicator |
| `showOutline` | `boolean` | `false` | Show document outline sidebar (table of contents) |
| `showMarginGuides` | `boolean` | `false` | Show page margin guide boundaries |
| `marginGuideColor` | `string` | `'#c0c0c0'` | Color for margin guides |
| `initialZoom` | `number` | `1.0` | Initial zoom level |
| `theme` | `Theme \| null` | — | Theme for styling |
| `toolbarExtra` | `ReactNode` | — | Custom toolbar items appended to the toolbar |
| `renderLogo` | `() => ReactNode` | — | Custom logo in the title bar |
| `documentName` | `string` | — | Editable document name in the title bar |
| `onDocumentNameChange` | `(name: string) => void` | — | Called when the user edits the document name |
| `documentNameEditable` | `boolean` | `true` | Whether the document name is editable |
| `renderTitleBarRight` | `() => ReactNode` | — | Custom right-side actions in the title bar |
| `placeholder` | `ReactNode` | — | Placeholder when no document is loaded |
| `loadingIndicator` | `ReactNode` | — | Custom loading indicator |
| `className` | `string` | — | Additional CSS class name |
| `style` | `CSSProperties` | — | Additional inline styles |
| `onChange` | `(doc: Document) => void` | — | Called on document change |
| `onSave` | `(buffer: ArrayBuffer) => void` | — | Called on save |
| `onError` | `(error: Error) => void` | — | Called on error |
| `onSelectionChange` | `(state: SelectionState \| null) => void` | — | Called on selection change |
| `onFontsLoaded` | `() => void` | — | Called when fonts finish loading |
| `onPrint` | `() => void` | — | Called when print is triggered |
| `onCopy` | `() => void` | — | Called when content is copied |
| `onCut` | `() => void` | — | Called when content is cut |
| `onPaste` | `() => void` | — | Called when content is pasted |

Source: [`DocxEditorProps`](../packages/react/src/components/DocxEditor.tsx)

**Ribbon View modes:** The View tab’s `Print Layout` and `Web Layout` toggles are CSS-only presentation modes; they do not reflow document layout. `Show Bookmarks` maps to the existing “Show/Hide Marks” behavior.

## Ref Methods

```tsx
Expand Down
Loading