feat: add domains, ideas, layouts, widgets API modules
- Add DomainsModule with full CRUD, search, and activity logging - Add IdeasModule with quick capture endpoint - Add LayoutsModule for user dashboard layouts - Add WidgetsModule for widget definitions (read-only) - Update ActivityService with domain/idea logging methods - Register all new modules in AppModule
This commit is contained in:
@@ -128,3 +128,6 @@ export * from "./database.types";
|
||||
|
||||
// Export authentication types
|
||||
export * from "./auth.types";
|
||||
|
||||
// Export widget types
|
||||
export * from "./widget.types";
|
||||
|
||||
81
packages/shared/src/types/widget.types.ts
Normal file
81
packages/shared/src/types/widget.types.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Widget and layout type definitions for HUD system
|
||||
*/
|
||||
|
||||
import type { BaseEntity } from "./index";
|
||||
|
||||
/**
|
||||
* Widget placement in the grid
|
||||
*/
|
||||
export interface WidgetPlacement {
|
||||
i: string; // Widget ID
|
||||
x: number; // Column position
|
||||
y: number; // Row position
|
||||
w: number; // Width in grid units
|
||||
h: number; // Height in grid units
|
||||
minW?: number;
|
||||
maxW?: number;
|
||||
minH?: number;
|
||||
maxH?: number;
|
||||
static?: boolean;
|
||||
isDraggable?: boolean;
|
||||
isResizable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget definition from database
|
||||
*/
|
||||
export interface WidgetDefinition extends BaseEntity {
|
||||
name: string;
|
||||
displayName: string;
|
||||
description: string | null;
|
||||
component: string;
|
||||
defaultWidth: number;
|
||||
defaultHeight: number;
|
||||
minWidth: number;
|
||||
minHeight: number;
|
||||
maxWidth: number | null;
|
||||
maxHeight: number | null;
|
||||
configSchema: Record<string, unknown>;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* User layout configuration
|
||||
*/
|
||||
export interface UserLayout extends BaseEntity {
|
||||
workspaceId: string;
|
||||
userId: string;
|
||||
name: string;
|
||||
isDefault: boolean;
|
||||
layout: WidgetPlacement[];
|
||||
metadata: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout configuration for editor
|
||||
*/
|
||||
export interface LayoutConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
layout: WidgetPlacement[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Available widget types (component names)
|
||||
*/
|
||||
export type WidgetComponentType =
|
||||
| "TasksWidget"
|
||||
| "CalendarWidget"
|
||||
| "QuickCaptureWidget"
|
||||
| "AgentStatusWidget";
|
||||
|
||||
/**
|
||||
* Props for individual widgets
|
||||
*/
|
||||
export interface WidgetProps {
|
||||
id: string;
|
||||
config?: Record<string, unknown>;
|
||||
onEdit?: () => void;
|
||||
onRemove?: () => void;
|
||||
}
|
||||
Reference in New Issue
Block a user