/**
 * @mvp-factory/holy-editor
 * 
 * Rich text editor with Bible verse integration and PWA support
 * Extracted from Holy Habit holy-editor-pro.js
 */

// Main editor class
export { HolyEditor } from './HolyEditor';
import { HolyEditor } from './HolyEditor';
import type { EditorConfig } from './types/Editor';

// Core components
export { BibleVerseEngine } from './core/BibleVerseEngine';
export { TextFormatter } from './core/TextFormatter';

// PWA components
export { PWAKeyboardTracker } from './pwa/PWAKeyboardTracker';

// UI components
export { ToastManager } from './ui/ToastManager';
export { ColorPicker } from './ui/ColorPicker';

// Utils
export { AutoSaveManager } from './utils/AutoSaveManager';

// Type definitions
export type {
  // Core types
  EditorConfig,
  EditorSelection,
  FormatAction,
  FormatState,
  
  // Bible verse types
  BibleVerse,
  BibleVerseData,
  BibleApiResponse,
  BibleBookMapping,
  VerseCache,
  SlashCommandMatch,
  
  // PWA types
  PWAEnvironment,
  KeyboardTrackingSettings,
  PlatformInfo,
  KeyboardOffsetData,
  
  // UI types
  ToastOptions,
  ColorOption,
  
  // Auto-save types
  AutoSaveData,
  AutoSaveOptions
} from './types/Editor';

// Error classes
export { EditorError, BibleApiError } from './types/Editor';

// Version info
export const VERSION = '1.0.0';

// Default configurations
export const DEFAULT_CONFIG: Partial<EditorConfig> = {
  enableBibleVerses: true,
  enableTextFormatting: true,
  enablePWAKeyboard: true,
  enableColorPicker: true,
  enableAutoSave: true,
  apiEndpoint: '/api/bible_verse_full.php',
  debounceMs: 300,
  autoSaveInterval: 30000,
  keyboardSettings: {
    threshold: 10,
    keyboardMin: 150,
    debounceTime: 0
  }
};

// Utility functions
export const createEditor = (editorId: string, config?: Partial<EditorConfig>) => {
  return new HolyEditor(editorId, config);
};

export const getVersion = () => VERSION;

// CSS classes used by the editor (for reference)
export const CSS_CLASSES = {
  editor: 'holy-editor',
  editorFocused: 'holy-editor-focused',
  bibleVerse: 'bible-verse',
  bibleVerseRange: 'bible-verse-range',
  verseText: 'verse-text',
  verseReference: 'verse-reference',
  inlineQuote: 'inline-quote',
  toast: 'holy-toast',
  toastContainer: 'holy-toast-container',
  colorPicker: 'holy-color-picker',
  keyboardActive: 'keyboard-active',
  keyboardTracking: 'keyboard-tracking'
} as const;