Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 54 additions & 4 deletions apps/docs/core/superdoc/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ new SuperDoc({
- `viewing` - Read-only display
- `suggesting` - Track changes enabled
</Expandable>
<Info>See the [Track Changes extension](/extensions/track-changes) for accept/reject commands, and the [runnable example](https://github.com/superdoc-dev/superdoc/tree/main/examples/features/track-changes) for a complete workflow.</Info>
<Info>See the [Track Changes module](/modules/track-changes) for accept/reject commands, the Document API, and configuration. The [runnable example](https://github.com/superdoc-dev/superdoc/tree/main/examples/features/track-changes) shows a complete workflow.</Info>
</ParamField>

<ParamField path="comments" type="Object">
Expand All @@ -124,11 +124,11 @@ new SuperDoc({
</Expandable>
</ParamField>

<ParamField path="trackChanges" type="Object">
Viewing-mode visibility controls for tracked changes
<ParamField path="trackChanges" type="Object" deprecated>
<Warning>**Deprecated** — Use [`modules.trackChanges`](#track-changes-module) instead. This top-level key remains supported as an alias and will emit a one-time console warning.</Warning>
<Expandable title="properties" defaultOpen>
<ParamField path="trackChanges.visible" type="boolean" default="false">
Show tracked-change markup and threads when `documentMode` is `viewing`
Show tracked-change markup and threads when `documentMode` is `viewing`.
</ParamField>
</Expandable>
</ParamField>
Expand Down Expand Up @@ -196,6 +196,56 @@ new SuperDoc({
</Expandable>
</ParamField>

### Track changes module

<ParamField path="modules.trackChanges" type="Object">
Track changes configuration. Supersedes the top-level `trackChanges` and `layoutEngineOptions.trackedChanges` keys, which remain supported as deprecated aliases.

<Expandable title="properties" defaultOpen>
<ParamField path="modules.trackChanges.visible" type="boolean" default="false">
Show tracked-change markup and threads when `documentMode` is `viewing`.
</ParamField>
<ParamField path="modules.trackChanges.mode" type="'review' | 'original' | 'final' | 'off'">
Rendering mode for tracked changes.
- `'review'`: show insertions and deletions inline (default for editing/suggesting).
- `'original'`: show the document as it existed before tracked changes (default for viewing when `visible` is `false`).
- `'final'`: show the document with changes applied.
- `'off'`: disable tracked-change rendering.
</ParamField>
<ParamField path="modules.trackChanges.enabled" type="boolean" default="true">
Whether the layout engine treats tracked changes as active.
</ParamField>
<ParamField path="modules.trackChanges.replacements" type="'paired' | 'independent'" default="'paired'">
How a tracked replacement (adjacent insertion + deletion created by typing over selected text) surfaces in the UI and API.
- `'paired'` (default, Google Docs model): the two halves share one id and resolve together with a single accept/reject click.
- `'independent'` (Microsoft Word / ECMA-376 §17.13.5 model): each insertion and each deletion has its own id, is addressable on its own, and resolves independently.
</ParamField>
</Expandable>
</ParamField>

```javascript
new SuperDoc({
selector: '#editor',
document: 'contract.docx',
documentMode: 'viewing',
modules: {
trackChanges: { visible: true, mode: 'review' },
},
});
```

Opt into Microsoft Word / ECMA-376-style independent revisions, where each insertion and each deletion has its own id and resolves on its own:

```javascript
new SuperDoc({
selector: '#editor',
document: 'contract.docx',
modules: {
trackChanges: { replacements: 'independent' },
},
});
```

### Toolbar module

<ParamField path="modules.toolbar" type="Object">
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
]
},
"modules/comments",
"modules/track-changes",
{
"group": "Toolbar",
"tag": "NEW",
Expand Down Expand Up @@ -455,6 +456,10 @@
"source": "/extensions/slash-menu",
"destination": "/extensions/context-menu"
},
{
"source": "/extensions/track-changes",
"destination": "/modules/track-changes"
},
{
"source": "/guides/breaking-changes-v1",
"destination": "/guides/migration/breaking-changes-v1"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/extensions/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Basic document capabilities:

### Advanced features
Complex functionality:
- **[Track Changes](/extensions/track-changes)** - Revision tracking
- **[Track Changes](/modules/track-changes)** - Revision tracking
- **[Comments](/extensions/comments)** - Discussions
- **[Field Annotation](/extensions/field-annotation)** - Form fields
- **[Document Section](/extensions/document-section)** - Locked sections
Expand Down
Loading
Loading