Skip to main content
Track Changes records all edits with author attribution and timestamps, exactly like Microsoft Word.

Usage

Enable through document mode:
// Start tracking
superdoc.setDocumentMode('suggesting');

Commands

// Switch modes (controls tracking)
superdoc.setDocumentMode('suggesting'); // Enable tracking
superdoc.setDocumentMode('editing');    // Disable tracking

// Review changes
editor.commands.acceptChange();
editor.commands.rejectChange();
editor.commands.acceptAllChanges();
editor.commands.rejectAllChanges();

// Navigate
editor.commands.goToNextChange();
editor.commands.goToPreviousChange();

// View modes
editor.commands.toggleTrackChangesShowOriginal();
editor.commands.toggleTrackChangesShowFinal();

Working with changes

import { trackChangesHelpers } from '@harbour-enterprises/superdoc';

// Get all changes
const changes = trackChangesHelpers.getAllChanges(editor.state);

// Filter by user
const userChanges = trackChangesHelpers.getChangesByUser(
  editor.state,
  '[email protected]'
);

// Check state
const isTracking = trackChangesHelpers.isTrackingEnabled(editor.state);

Change types

  • Insertions - Green underline
  • Deletions - Red strikethrough
  • Format changes - Yellow highlight
Each change includes:
  • User information
  • Timestamp
  • Unique ID

Export behavior

Changes export to DOCX as Word revisions:
// With changes
await superdoc.export();

// Accept all first
editor.commands.acceptAllChanges();
await superdoc.export();