import { C as Collaborator, a as ConnectionState } from './document-editor-pane-IAEQn_Dl.js'; export { D as DocumentEditorBackend, b as DocumentEditorMode, c as DocumentEditorPane, d as DocumentEditorPaneCollaborationConfig, e as DocumentEditorPaneProps, E as EditorContextValue, f as EditorProvider, g as EditorProviderProps, h as EditorTokenRefreshResult, i as EditorUser, u as useEditorContext } from './document-editor-pane-IAEQn_Dl.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { Editor } from '@tiptap/react'; import { HocuspocusProvider } from '@hocuspocus/provider'; import 'react'; import './artifact-pane-DpuWcAiF.js'; import 'yjs'; /** * Editor toolbar component. * Provides basic formatting controls. */ declare function EditorToolbar({ editor, className, }: { editor: Editor | null; className?: string; }): react_jsx_runtime.JSX.Element | null; /** * Props for TiptapEditor component. */ interface TiptapEditorProps { /** Initial content for new documents (markdown string) */ initialContent?: string; /** Placeholder text when editor is empty */ placeholder?: string; /** Whether the editor is read-only */ readOnly?: boolean; /** Whether to auto-focus on mount */ autoFocus?: boolean; /** Custom className for the editor wrapper */ className?: string; /** Custom className for the editor content area */ contentClassName?: string; /** Callback when content changes */ onUpdate?: (editor: Editor) => void; /** Callback when selection changes */ onSelectionUpdate?: (editor: Editor) => void; /** Callback when editor is ready */ onReady?: (editor: Editor) => void; } /** * TiptapEditor - Collaborative markdown editor with Y.js sync. * Must be used within an EditorProvider. Loads its tiptap, Hocuspocus and * yjs peers on first render. */ declare function TiptapEditor(props: TiptapEditorProps): react_jsx_runtime.JSX.Element; /** * Collaborators list component. * Shows active users in the document. */ declare function CollaboratorsList({ collaborators, className, }: { collaborators: Collaborator[]; className?: string; }): react_jsx_runtime.JSX.Element | null; /** * Hook to get the current connection state and helpers. */ declare function useEditorConnection(): { /** Current connection state string */ state: ConnectionState; /** Whether connected to the server (connected or synced) */ isConnected: boolean; /** Whether currently attempting to connect */ isConnecting: boolean; /** Whether disconnected from the server */ isDisconnected: boolean; /** Whether the document is synced with the server */ isSynced: boolean; /** Connect to the collaboration server */ connect: () => void; /** Disconnect from the collaboration server */ disconnect: () => void; }; /** * Hook to get the list of active collaborators. */ declare function useCollaborators(): { /** List of active collaborators (excluding self) */ collaborators: Collaborator[]; /** Number of other collaborators */ count: number; /** Whether there are other collaborators present */ hasOthers: boolean; }; /** * Hook to track a specific collaborator's presence. */ declare function useCollaboratorPresence(userId: string): Collaborator | null; /** * Hook to sync local state with the Y.Doc. * Useful for persisting editor metadata. */ declare function useYjsState(key: string, initialValue: T): [T, (value: T) => void]; /** * Hook to track document changes. * Returns true if there are unsaved changes since the last save. */ declare function useDocumentChanges(onSave?: () => Promise): { /** Whether there are unsaved changes */ isDirty: boolean; /** Whether save is in progress */ isSaving: boolean; /** When the document was last saved */ lastSaved: Date | null; /** Save the document */ save: () => Promise; }; /** * Hook to get awareness state for presence features. * Provides lower-level access to the Hocuspocus awareness. */ declare function useAwareness(): { localState: Record; setLocalState: (state: Record) => void; setLocalStateField: (field: string, value: unknown) => void; awareness: HocuspocusProvider["awareness"] | undefined; }; export { Collaborator, CollaboratorsList, ConnectionState, EditorToolbar, TiptapEditor, type TiptapEditorProps, useAwareness, useCollaboratorPresence, useCollaborators, useDocumentChanges, useEditorConnection, useYjsState };