@asymmetric-effort/specifyjs 0.2.143 → 0.2.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ import type { ProjectCard } from './types';
2
+ import type { BoardState } from './types';
3
+ import type { BoardAction } from './BoardState';
4
+ export interface BoardProps {
5
+ state: BoardState;
6
+ dispatch: (action: BoardAction) => void;
7
+ searchQuery: string;
8
+ gridEnabled: boolean;
9
+ selectedCardId: string | null;
10
+ onSelectCard: (cardId: string | null) => void;
11
+ colorFilter?: string | null;
12
+ }
13
+ export declare function snapToGrid(pos: {
14
+ x: number;
15
+ y: number;
16
+ }, gridSize: number): {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ export declare function screenToCanvas(screenX: number, screenY: number, viewport: {
21
+ panX: number;
22
+ panY: number;
23
+ zoom: number;
24
+ }): {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ export declare function computeFitAll(cards: ProjectCard[], containerWidth: number, containerHeight: number, padding?: number): {
29
+ panX: number;
30
+ panY: number;
31
+ zoom: number;
32
+ };
33
+ export declare function Board(props: BoardProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,76 @@
1
+ import type { BoardState, BoardStorage, ProjectCard, CardConnection } from './types';
2
+ export type BoardAction = {
3
+ type: 'ADD_CARD';
4
+ card: ProjectCard;
5
+ } | {
6
+ type: 'REMOVE_CARD';
7
+ cardId: string;
8
+ } | {
9
+ type: 'MOVE_CARD';
10
+ cardId: string;
11
+ position: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ } | {
16
+ type: 'RESIZE_CARD';
17
+ cardId: string;
18
+ size: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ } | {
23
+ type: 'UPDATE_CARD';
24
+ cardId: string;
25
+ updates: Partial<ProjectCard>;
26
+ } | {
27
+ type: 'DUPLICATE_CARD';
28
+ cardId: string;
29
+ newId: string;
30
+ offset?: {
31
+ x: number;
32
+ y: number;
33
+ };
34
+ } | {
35
+ type: 'ADD_CONNECTION';
36
+ connection: CardConnection;
37
+ } | {
38
+ type: 'REMOVE_CONNECTION';
39
+ connectionId: string;
40
+ } | {
41
+ type: 'PAN';
42
+ panX: number;
43
+ panY: number;
44
+ } | {
45
+ type: 'ZOOM';
46
+ zoom: number;
47
+ } | {
48
+ type: 'SET_BOARD';
49
+ state: BoardState;
50
+ };
51
+ export interface HistoryState {
52
+ past: BoardState[];
53
+ present: BoardState;
54
+ future: BoardState[];
55
+ }
56
+ export declare const DEFAULT_BOARD_STATE: BoardState;
57
+ export declare function boardReducer(state: BoardState, action: BoardAction): BoardState;
58
+ type HistoryAction = {
59
+ type: 'UNDO';
60
+ } | {
61
+ type: 'REDO';
62
+ } | {
63
+ type: 'BOARD_ACTION';
64
+ action: BoardAction;
65
+ };
66
+ export declare function historyReducer(state: HistoryState, action: HistoryAction): HistoryState;
67
+ export interface UseBoardStateResult {
68
+ state: BoardState;
69
+ dispatch: (action: BoardAction) => void;
70
+ undo: () => void;
71
+ redo: () => void;
72
+ canUndo: boolean;
73
+ canRedo: boolean;
74
+ }
75
+ export declare function useBoardState(storage?: BoardStorage, boardId?: string): UseBoardStateResult;
76
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ProjectCard } from './types';
2
+ export interface CardProps {
3
+ card: ProjectCard;
4
+ selected: boolean;
5
+ onSelect: (cardId: string) => void;
6
+ onMove: (cardId: string, position: {
7
+ x: number;
8
+ y: number;
9
+ }) => void;
10
+ onResize: (cardId: string, size: {
11
+ width: number;
12
+ height: number;
13
+ }) => void;
14
+ onDelete: (cardId: string) => void;
15
+ onDoubleClick: (cardId: string) => void;
16
+ onDragStart?: (cardId: string, e: Event) => void;
17
+ onDuplicate?: (cardId: string) => void;
18
+ onChangeColor?: (cardId: string, color: string) => void;
19
+ onChangePriority?: (cardId: string, priority: 'low' | 'medium' | 'high' | 'critical') => void;
20
+ onAnchorDragStart?: (cardId: string, anchor: string, x: number, y: number) => void;
21
+ }
22
+ export declare function Card(props: CardProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,10 @@
1
+ import type { ProjectCard } from './types';
2
+ export interface CardEditorProps {
3
+ card: ProjectCard;
4
+ onSave: (cardId: string, updates: {
5
+ title: string;
6
+ description: string;
7
+ }) => void;
8
+ onClose: () => void;
9
+ }
10
+ export declare function CardEditor(props: CardEditorProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,11 @@
1
+ import type { ProjectCard, CardConnection } from './types';
2
+ export interface ConnectionsOverlayProps {
3
+ connections: CardConnection[];
4
+ cards: ProjectCard[];
5
+ selectedConnectionId: string | null;
6
+ onSelectConnection: (connectionId: string | null) => void;
7
+ onDeleteConnection: (connectionId: string) => void;
8
+ canvasWidth: number;
9
+ canvasHeight: number;
10
+ }
11
+ export declare function ConnectionsOverlay(props: ConnectionsOverlayProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,7 @@
1
+ import type { ProjectCard } from './types';
2
+ export interface InterAppWrapperProps {
3
+ cards: ProjectCard[];
4
+ onCardDropped: (title: string, description: string) => void;
5
+ children: unknown;
6
+ }
7
+ export declare function InterAppWrapper(props: InterAppWrapperProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * LocalStorage.ts -- localStorage persistence implementation for BoardStorage.
3
+ */
4
+ import type { BoardState, BoardStorage } from './types';
5
+ export declare class LocalBoardStorage implements BoardStorage {
6
+ load(boardId: string): Promise<BoardState>;
7
+ save(boardId: string, state: BoardState): Promise<void>;
8
+ }
@@ -0,0 +1,16 @@
1
+ export declare const CARD_COLORS: string[];
2
+ export interface ToolbarProps {
3
+ zoom: number;
4
+ gridEnabled: boolean;
5
+ selectedColor: string;
6
+ colorFilter?: string | null;
7
+ onNewCard: () => void;
8
+ onZoomIn: () => void;
9
+ onZoomOut: () => void;
10
+ onZoomReset: () => void;
11
+ onColorSelect: (color: string) => void;
12
+ onColorFilter?: (color: string | null) => void;
13
+ onGridToggle: () => void;
14
+ onSearch: (query: string) => void;
15
+ }
16
+ export declare function BoardToolbar(props: ToolbarProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,14 @@
1
+ export type { ProjectCard, CardConnection, BoardState, BoardStorage } from './types';
2
+ export { useBoardState, boardReducer, historyReducer, DEFAULT_BOARD_STATE } from './BoardState';
3
+ export type { BoardAction, HistoryState, UseBoardStateResult } from './BoardState';
4
+ export { LocalBoardStorage } from './LocalStorage';
5
+ export { Card } from './Card';
6
+ export { CardEditor } from './CardEditor';
7
+ export { ConnectionsOverlay } from './Connection';
8
+ export { BoardToolbar, CARD_COLORS } from './Toolbar';
9
+ export { Board, snapToGrid, screenToCanvas, computeFitAll } from './Board';
10
+ export { InterAppWrapper } from './InterApp';
11
+ export interface ProjectManagerAppProps {
12
+ boardId?: string;
13
+ }
14
+ export declare function ProjectManagerApp(props: ProjectManagerAppProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * types.ts -- Interfaces for the Whiteboard Project Manager.
3
+ */
4
+ export interface ProjectCard {
5
+ id: string;
6
+ title: string;
7
+ description: string;
8
+ color: string;
9
+ position: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ size: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ tags?: string[];
18
+ priority?: 'low' | 'medium' | 'high' | 'critical';
19
+ assignee?: string;
20
+ createdAt: number;
21
+ updatedAt: number;
22
+ }
23
+ export interface CardConnection {
24
+ id: string;
25
+ fromCardId: string;
26
+ toCardId: string;
27
+ label?: string;
28
+ style?: 'solid' | 'dashed' | 'dotted';
29
+ }
30
+ export interface BoardState {
31
+ cards: ProjectCard[];
32
+ connections: CardConnection[];
33
+ viewport: {
34
+ panX: number;
35
+ panY: number;
36
+ zoom: number;
37
+ };
38
+ }
39
+ export interface BoardStorage {
40
+ load(boardId: string): Promise<BoardState>;
41
+ save(boardId: string, state: BoardState): Promise<void>;
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asymmetric-effort/specifyjs",
3
- "version": "0.2.143",
3
+ "version": "0.2.145",
4
4
  "description": "A declarative TypeScript UI framework built for performance and simplicity",
5
5
  "publishConfig": {
6
6
  "access": "public"