| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- 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;
- }
|