UNPKG

@veltdev/tiptap-velt-comments

Version:

Tiptap Extension to add Google Docs-style overlay comments to your Tiptap editor. Works with the Velt Collaboration SDK.

33 lines (32 loc) 1.19 kB
/** * Update content feature module. * * Purpose: Handle document changes and annotation context updates. * Orchestrates adapters and core to detect and process annotation changes. * * Key responsibilities: * - Detect document changes during transactions * - Compare current state with original annotations * - Detect content, occurrence, and container changes * - Update Velt contexts for changed annotations * - Update marks in editor if needed * * Dependencies: * - adapters/host/doc.ts (for change detection) * - adapters/velt.ts (for context updates) * - adapters/host/marks.ts (for mark updates) * - core/state.ts (for state access) * - utils/console.ts (for logging) * * IMPORTANT: This module MUST NOT import editor or Velt types directly. * All SDK access goes through adapters. */ /** * Handles content updates when document changes occur. * Detects annotation changes and updates Velt contexts accordingly. * * @param editorId Unique identifier for the editor * @param editor The editor instance * @param transaction The transaction object */ export declare const handleContentUpdate: (editorId: string, editor: unknown, transaction: unknown) => void;