export interface FeedbackData { id: string; timestamp: number; type: 'rating' | 'text' | 'category' | 'nps'; rating?: number; text?: string; category?: string; email?: string; metadata: { page: string; userAgent: string; viewport: { width: number; height: number; }; trigger: string; sessionId?: string; }; } export interface WidgetConfig { id: string; version: string; position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center'; triggers: TriggerConfig[]; appearance: AppearanceConfig; fields: FieldConfig[]; dataLayer: DataLayerConfig; analytics: AnalyticsConfig; } export interface TriggerConfig { type: 'page' | 'time' | 'scroll' | 'exit-intent' | 'element-click' | 'manual' | 'rage-click' | 'confused-navigation' | 'datalayer-event'; conditions: { pages?: string[]; timeDelay?: number; scrollPercentage?: number; elementSelector?: string; frequency?: 'once' | 'session' | 'always'; rageClick?: { clickThreshold?: number; timeWindow?: number; elementSelector?: string; excludeSelectors?: string[]; }; confusedNavigation?: { backAndForthThreshold?: number; timeWindow?: number; scrollJumpThreshold?: number; mouseMovementThreshold?: number; inactivityThreshold?: number; }; dataLayerEvent?: { eventName: string; eventProperties?: Record; objectName?: string; matchType?: 'exact' | 'partial' | 'exists'; debounceTime?: number; }; }; } export interface AppearanceConfig { theme: 'light' | 'dark' | 'custom'; colors: { primary: string; secondary: string; background: string; text: string; border: string; }; borderRadius: number; fontSize: string; fontFamily: string; animations: boolean; customCSS?: string; feedbackLeaf?: FeedbackLeafConfig; starRating?: StarRatingConfig; } export interface StarRatingConfig { style?: 'filled' | 'outlined' | 'custom'; icon?: string; size?: 'small' | 'medium' | 'large' | string; colors?: { empty?: string; filled?: string; hover?: string; }; animation?: { enabled?: boolean; type?: 'glow' | 'bounce' | 'scale' | 'pulse' | 'none'; duration?: string; }; spacing?: string; hoverEffect?: boolean; } export interface FeedbackLeafConfig { text?: string; icon?: string; shape?: 'tab' | 'circle' | 'square' | 'rounded'; size?: { width?: string; height?: string; }; colors?: { background?: string; text?: string; border?: string; }; positioning?: { offsetX?: string; offsetY?: string; }; animation?: { enabled?: boolean; type?: 'pulse' | 'bounce' | 'slide' | 'none'; duration?: string; }; shadow?: { enabled?: boolean; blur?: string; color?: string; }; hideAfter?: number; } export interface FieldConfig { type: 'rating' | 'text' | 'email' | 'category' | 'nps'; label: string; required: boolean; placeholder?: string; options?: string[]; validation?: { minLength?: number; maxLength?: number; pattern?: string; }; } export interface DataLayerConfig { enabled: boolean; eventName: string; objectName: string; customProperties?: Record; } export interface AnalyticsConfig { ga4?: { enabled: boolean; measurementId: string; eventName: string; }; adobeWebSDK?: { enabled: boolean; eventType: string; schema: string; }; custom?: { enabled: boolean; endpoint: string; headers?: Record; }; } export interface WidgetState { isVisible: boolean; isMinimized: boolean; currentStep: number; formData: Partial; isSubmitting: boolean; hasSubmitted: boolean; errors: Record; } export interface DataLayerEvent { event: string; feedback_data: FeedbackData; widget_config: { id: string; version: string; trigger: string; }; timestamp: number; }