import * as React from 'react'; // FIX: Removed self-import of 'Block' which caused a conflict with the local declaration. export type NavItemKey = string; export interface NavSubItem { name: string; key: NavItemKey; } export interface NavItem { name:string; key: NavItemKey; icon: JSX.Element; children?: NavSubItem[]; } // --- Page Builder Types --- export type BlockType = 'header' | 'link' | 'social' | 'video' | 'image' | 'text' | 'map' | 'pdf' | 'email' | 'phone' | 'news' | 'product' | 'chat' | 'enterprise_info' | 'form' | 'award' | 'footer'; export interface BaseBlock { id: string; type: BlockType; visible: boolean; titleAlignment?: 'left' | 'center'; } export interface HeaderBlock extends BaseBlock { type: 'header'; text: string; } export interface LinkBlock extends BaseBlock { type: 'link'; title: string; url: string; thumbnailUrl?: string; iconUrl?: string; } export type SocialPlatform = 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'youtube' | 'tiktok' | 'github'; export interface SocialLink { id: string; platform: SocialPlatform; url: string; } export interface SocialBlock extends BaseBlock { type: 'social'; links: SocialLink[]; } export type MediaSource = | { type: 'url', value: string } | { type: 'file', value: { name: string, size: number, previewUrl: string } } | { type: 'aigc', videoId: string }; export interface VideoBlock extends BaseBlock { type: 'video'; sources: MediaSource[]; layout: 'single' | 'grid'; } export interface ImageBlock extends BaseBlock { type: 'image'; sources: MediaSource[]; layout: 'single' | 'grid'; } export interface TextBlock extends BaseBlock { type: 'text'; content: string; textAlign: 'left' | 'center' | 'right'; fontSize: string; // e.g., '16px' fontColor: string; // e.g., '#000000' isBold: boolean; isItalic: boolean; } export interface MapBlock extends BaseBlock { type: 'map'; address: string; displayStyle?: 'interactiveMap' | 'imageOverlay'; backgroundImageSource?: MediaSource; } export interface PdfBlock extends BaseBlock { type: 'pdf'; source: MediaSource; } export interface EmailBlock extends BaseBlock { type: 'email'; email: string; label: string; displayMode: 'labelOnly' | 'labelAndValue'; } export interface PhoneBlock extends BaseBlock { type: 'phone'; phone: string; label: string; displayMode: 'labelOnly' | 'labelAndValue'; } export interface NewsItemFromUrl { id: string; title: string; summary: string; url: string; } export type NewsBlock = BaseBlock & { type: 'news'; layout: 'list' | 'grid'; } & ( | { source: 'aigc'; articleIds: string[]; customItems?: never } | { source: 'custom'; customItems: NewsItemFromUrl[]; articleIds?: never } ); export interface ProductItem { id: string; url: string; title: string; imageUrl: string; price: string; } export interface ProductBlock extends BaseBlock { type: 'product'; items: ProductItem[]; layout: 'grid' | 'list'; } export interface ChatBlock extends BaseBlock { type: 'chat'; layout: 'button' | 'under_avatar' | 'widget'; } export type EnterpriseInfoIcon = 'building' | 'bank' | 'money' | 'location' | 'calendar' | 'users' | 'lightbulb'; export interface EnterpriseInfoItem { id: string; icon: EnterpriseInfoIcon; label: string; value: string; } export interface EnterpriseInfoBlock extends BaseBlock { type: 'enterprise_info'; items: EnterpriseInfoItem[]; alignment?: 'left' | 'center'; } export type FormFieldId = 'name' | 'email' | 'company' | 'phone' | 'industry' | 'position' | 'country'; export interface FormField { id: FormFieldId; label: string; enabled: boolean; required: boolean; } export interface FormPurposeOption { id: string; label: string; } export interface FormBlock extends BaseBlock { type: 'form'; title: string; description: string; fields: FormField[]; purposeOptions: FormPurposeOption[]; submitButtonText: string; } export interface AwardItem { id: string; title: string; subtitle?: string; year?: string; imageSource?: MediaSource; } export interface AwardBlock extends BaseBlock { type: 'award'; items: AwardItem[]; layout: 'grid' | 'single'; } export interface FooterLink { id: string; title: string; url: string; } export interface FooterBlock extends BaseBlock { type: 'footer'; layout: 'standard' | 'centered'; copyrightText: string; legalText?: string; statement?: string; navLinks: FooterLink[]; otherLinks: FooterLink[]; } export type Block = HeaderBlock | LinkBlock | SocialBlock | VideoBlock | ImageBlock | TextBlock | MapBlock | PdfBlock | EmailBlock | PhoneBlock | NewsBlock | ProductBlock | ChatBlock | EnterpriseInfoBlock | FormBlock | AwardBlock | FooterBlock; export type ThemeName = 'light' | 'dark' | 'synthwave' | 'retro' | 'custom'; export type ButtonStyle = 'filled' | 'outline'; export type ButtonShape = 'rounded' | 'pill' | 'square'; export type FontFamily = 'sans' | 'serif' | 'mono'; export type BackgroundType = 'color' | 'gradient' | 'image'; export type BannerType = 'color' | 'gradient' | 'image' | 'none'; export interface CustomThemeColors { background: string; text: string; button: string; buttonText: string; } export interface BannerSettings { type: BannerType; value: string; // For color and gradient imageSource: MediaSource; // For image type height: number; // in pixels width: 'full' | 'contained'; } export interface SideNavSettings { backgroundColor: string; textColor: string; activeLinkColor: string; hoverBackgroundColor: string; hoverTextColor: string; fontFamily: FontFamily; fontSize: string; // e.g. '14px' navFloatStyle?: 'normal' | 'top' | 'center'; navBackgroundStyle?: 'compact' | 'full'; } export interface ChatWidgetSettings { iconColor: string; headerBackgroundColor: string; headerTextColor: string; panelBackgroundColor: string; userMessageBackgroundColor: string; userMessageTextColor: string; aiMessageBackgroundColor: string; aiMessageTextColor: string; } export interface DesignSettings { theme: ThemeName; customThemeColors: CustomThemeColors; buttonStyle: ButtonStyle; buttonShape: ButtonShape; fontFamily: FontFamily; fontColor: string; fontSize: string; // Tailwind class like 'text-base' backgroundType: BackgroundType; backgroundValue: string; // hex code, gradient class, or image URL userBackgroundImages?: MediaSource[]; avatarSource?: MediaSource; bannerSettings: BannerSettings; sideNavSettings: SideNavSettings; chatWidgetSettings: ChatWidgetSettings; } export interface PageSettings { blocks: Block[]; design: DesignSettings; } // --- AI Assistant Types --- export interface ChatMessage { id: string; sender: 'user' | 'ai'; text: string; } export interface AIAssistantSettings { persona: string; voiceId: string; language: string; conversationStyle: 'friendly' | 'professional' | 'witty'; knowledgeBaseFiles: { name: string; size: number; type: string }[]; knowledgeBaseUrls: string[]; forbiddenUserKeywords: string[]; forbiddenAIKeywords: string[]; } // --- Analytics Types --- export interface Conversation { id: string; visitorId: string; timestamp: string; interactions: ChatMessage[]; visitCount: number; status: 'open' | 'resolved'; firstResponseTime?: number; // in seconds } export interface FormSubmissionData { [key: string]: string; } export interface FormSubmission { id: string; formId: string; visitorId: string; timestamp: string; data: FormSubmissionData; } export interface AnalyticsData { conversations: Conversation[]; formSubmissions?: FormSubmission[]; } export interface Visitor { id: string; lastSeen: string; visitCount: number; conversationCount: number; formSubmissionCount?: number; name?: string; email?: string; company?: string; } // --- AIGC Types --- export interface AIGCVideo { id: string; title: string; thumbnailUrl: string; videoUrl: string; } export interface AIGCArticle { id: string; title: string; summary: string; content: string; publicationDate: string; // ISO string sourceType: 'generated' | 'url' | 'text'; sourceUrl?: string; // For 'url' type } export interface SocialAccount { id: string; platform: 'Twitter' | 'Facebook' | 'Instagram' | 'LinkedIn'; username: string; icon: JSX.Element; } export interface ScheduledPost { id: string; videoId: string; date: string; // YYYY-MM-DD time: string; // HH:MM caption: string; socialAccountIds: string[]; status: 'scheduled' | 'distributed'; } export interface AIGCSettings { videos: AIGCVideo[]; articles: AIGCArticle[]; schedule: ScheduledPost[]; userMedia?: MediaSource[]; } // --- Video Creator Types --- export interface Avatar { id: string; name: string; imageUrl: string; } export interface Voice { id: string; name: string; accent: string; } export interface ScriptVersion { id: string; text: string; } export interface ScriptContent { versions: ScriptVersion[]; selectedVersionId: string; } export interface VideoScene { id: string; script: ScriptContent; avatarId: string; voiceId: string; background: { type: 'color' | 'image' | 'video'; value: string; // hex code or image URL }; avatarPosition: { x: number; y: number }; // In percentages avatarScale: number; } export interface VideoProject { id:string; name: string; scenes: VideoScene[]; aspectRatio: '16:9' | '9:16'; } // --- MASTER PAGE TYPE --- export interface GreenPage { id: string; name: string; slug: string; themeColor: string; pageSettings: PageSettings; aiAssistantSettings: AIAssistantSettings; analyticsData: AnalyticsData; aigcSettings: AIGCSettings; }