Spaces:
Running
Running
| // βββ Shared Types βββ | |
| // Used by both client and server. | |
| // βββ CSS βββ | |
| export interface CssRule { | |
| id: string; | |
| selector: string; | |
| type: 'id' | 'class' | 'element' | 'universal' | 'attribute' | 'pseudo-class' | 'pseudo-element'; | |
| properties: CssProperty[]; | |
| mediaQuery?: string; | |
| enabled: boolean; | |
| } | |
| export interface CssProperty { | |
| id: string; | |
| name: string; | |
| value: string; | |
| important: boolean; | |
| type: 'standard' | 'variable' | 'custom'; | |
| unit: string; | |
| } | |
| // βββ Version History βββ | |
| export interface VersionDiffs { | |
| id: string; | |
| projectId: string; | |
| timestamp: number; | |
| userId: string; | |
| username: string; | |
| parentId: string | null; | |
| message: string; | |
| type: 'save' | 'restore' | 'branch'; | |
| diffs: Diff[]; | |
| } | |
| export interface Diff { | |
| id?: string; | |
| fileId: string; | |
| op: 'content_change' | 'file_add' | 'file_remove' | 'file_rename' | 'css_rule_change' | 'element_change' | 'project_meta_change'; | |
| oldValue?: any; | |
| newValue?: any; | |
| path?: string; | |
| } | |
| // βββ Visual Editor Outlines βββ | |
| export interface OutlineSlot { | |
| id: string; | |
| parentId: string; | |
| index: number; | |
| occupiedBy: string | null; | |
| } | |
| // βββ Collaboration βββ | |
| export interface PointerPosition { | |
| x: number; | |
| y: number; | |
| userId: string; | |
| username: string; | |
| } | |
| export interface BlockDragState { | |
| blockId: string; | |
| x: number; | |
| y: number; | |
| userId: string; | |
| } | |
| export interface TextCursorState { | |
| fieldId: string; | |
| fileId: string; | |
| cursorPosition: number; | |
| userId: string; | |
| username: string; | |
| active: boolean; | |
| } | |
| // βββ Element Registry βββ | |
| export interface ElementRef { | |
| id: string; | |
| tagName: string; | |
| classes: string[]; | |
| attributes: Record<string, string>; | |
| fileId: string; | |
| linkedTo: string[]; | |
| } | |
| // βββ File Upload βββ | |
| export interface UploadProgress { | |
| fileName: string; | |
| bytesReceived: number; | |
| totalBytes: number; | |
| status: 'uploading' | 'processing' | 'done' | 'error'; | |
| } | |
| // βββ Block Node βββ | |
| export interface BlockNodeData { | |
| id: string; | |
| blockId: string; | |
| position: { x: number; y: number }; | |
| config: Record<string, any>; | |
| connections: Record<string, string>; | |
| size?: { w: number; h: number }; | |
| } | |