package model import "gorm.io/datatypes" // WidgetThemeConfig stores custom theme configuration for a web widget inbox. // Reference: Chatwoot app/models/channel/web_widget.rb — custom_theme attribute // Stores advanced branding, layout, and visual customization beyond basic widget_color. type WidgetThemeConfig struct { Base InboxID uint `gorm:"index;not null" json:"inbox_id"` // === Branding === PrimaryColor string `gorm:"size:20;default:'#1f93ff'" json:"primary_color"` // Primary brand color (hex) SecondaryColor string `gorm:"size:20;default:''" json:"secondary_color,omitempty"` // Secondary brand color (hex) BackgroundColor string `gorm:"size:20;default:'#ffffff'" json:"background_color"` // Widget background color TextColor string `gorm:"size:20;default:'#1f1f1f'" json:"text_color"` // Primary text color LinkColor string `gorm:"size:20" json:"link_color,omitempty"` // Link color // === Typography === FontFamily string `gorm:"size:100;default:'Inter, sans-serif'" json:"font_family"` // CSS font-family stack FontSize string `gorm:"size:10;default:'14px'" json:"font_size"` // Base font size HeadingFont string `gorm:"size:100" json:"heading_font,omitempty"` // Heading font-family (if different) // === Layout === WidgetPosition string `gorm:"size:20;default:'right'" json:"widget_position"` // "left" or "right" WidgetAlignment string `gorm:"size:20;default:'bottom'" json:"widget_alignment"` // "bottom" or "center" AvatarRadius string `gorm:"size:10;default:'50%'" json:"avatar_radius"` // CSS border-radius for avatars ButtonRadius string `gorm:"size:10;default:'8px'" json:"button_radius"` // CSS border-radius for buttons // === Custom CSS === CustomCSS string `gorm:"type:text" json:"custom_css,omitempty"` // Raw CSS overrides injected into widget // === Images === BrandLogoURL string `gorm:"size:512" json:"brand_logo_url,omitempty"` // Brand logo image URL FaviconURL string `gorm:"size:512" json:"favicon_url,omitempty"` // Custom favicon URL AvatarURL string `gorm:"size:512" json:"avatar_url,omitempty"` // Default agent avatar URL WelcomeAvatarURL string `gorm:"size:512" json:"welcome_avatar_url,omitempty"` // Welcome screen avatar URL // === Advanced === HideMessageBubble bool `gorm:"default:false" json:"hide_message_bubble"` // Hide the unread message bubble ShowPopUpWindow bool `gorm:"default:false" json:"show_pop_up_window"` // Auto-pop-up widget window on load DarkMode string `gorm:"size:10;default:'light'" json:"dark_mode"` // "light", "dark", or "auto" DarkModeColors datatypes.JSON `gorm:"type:jsonb" json:"dark_mode_colors,omitempty"` // Dark mode overrides (JSON object) Inbox Inbox `gorm:"foreignKey:InboxID" json:"inbox,omitempty"` } func (WidgetThemeConfig) TableName() string { return "widget_theme_configs" } // WidgetThemeDarkColors holds the dark mode color overrides. type WidgetThemeDarkColors struct { PrimaryColor string `json:"primary_color"` BackgroundColor string `json:"background_color"` TextColor string `json:"text_color"` LinkColor string `json:"link_color"` ButtonColor string `json:"button_color"` }