@jager-ai/holy-editor
Version:
Rich text editor with Bible verse slash commands and PWA keyboard tracking, extracted from Holy Habit project
176 lines • 3.81 kB
TypeScript
/**
* Holy Editor
*
* Main editor class that integrates all components
* Extracted from Holy Habit holy-editor-pro.js
*/
import { EditorConfig, FormatAction, FormatState } from './types/Editor';
export declare class HolyEditor {
private editorElement;
private config;
private isInitialized;
private bibleEngine;
private textFormatter;
private keyboardTracker;
private toastManager;
private colorPicker;
private autoSaveManager;
private eventListeners;
private isProcessingSlashCommand;
private lastInputTime;
private inputDebounceMs;
constructor(editorId: string, config?: Partial<EditorConfig>);
/**
* Initialize all editor components
*/
private initializeComponents;
/**
* Initialize the editor
*/
initialize(): void;
/**
* Setup editor element
*/
private setupEditor;
/**
* Setup all event listeners
*/
private setupEventListeners;
/**
* Initialize PWA features
*/
private initializePWAFeatures;
/**
* Initialize auto-save features
*/
private initializeAutoSave;
/**
* Handle input events
*/
private handleInput;
/**
* Handle keydown events
*/
private handleKeyDown;
/**
* Handle paste events
*/
private handlePaste;
/**
* Handle focus events
*/
private handleFocus;
/**
* Handle blur events
*/
private handleBlur;
/**
* Handle selection change
*/
private handleSelectionChange;
/**
* Process slash commands in editor content
*/
private processSlashCommands;
/**
* Process individual slash command
*/
private processSlashCommand;
/**
* Insert verse at specific position
*/
private insertVerseAtPosition;
/**
* Create HTML for verse display
*/
private createVerseHtml;
/**
* Position cursor after inserted content
*/
private positionCursorAfterVerse;
/**
* Find text node at specific position
*/
private findTextNodeAtPosition;
/**
* Toggle text formatting
*/
toggleFormat(action: FormatAction): void;
/**
* Apply text color
*/
applyTextColor(color: string): void;
/**
* Show color picker
*/
showColorPicker(): void;
/**
* Get current editor content
*/
getContent(): string;
/**
* Set editor content
*/
setContent(html: string): void;
/**
* Get plain text content
*/
getTextContent(): string;
/**
* Clear editor content
*/
clear(): void;
/**
* Focus the editor
*/
focus(): void;
/**
* Check if editor has focus
*/
isFocused(): boolean;
/**
* Get current format state
*/
getFormatState(): FormatState | null;
/**
* Insert verse programmatically
*/
insertVerse(ref: string): Promise<boolean>;
/**
* Destroy the editor and cleanup
*/
destroy(): void;
private addEventListener;
private findParentQuote;
private handleEnterInQuote;
private updateFormatButtons;
/**
* Manually save content (auto-save)
*/
saveContent(): boolean;
/**
* Clear saved content
*/
clearSavedContent(): boolean;
/**
* Check if there's saved content
*/
hasSavedContent(): boolean;
/**
* Get auto-save info
*/
getAutoSaveInfo(): {
isRunning: boolean;
lastSave?: number;
hasContent: boolean;
};
/**
* Update auto-save interval
*/
updateAutoSaveInterval(intervalMs: number): void;
/**
* Toggle auto-save
*/
toggleAutoSave(enable?: boolean): void;
}
//# sourceMappingURL=HolyEditor.d.ts.map