@asymmetric-effort/specifyjs 0.2.150 → 0.2.151

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.
@@ -1,34 +1,14 @@
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
- showConnections?: boolean;
13
- }
14
- export declare function snapToGrid(pos: {
15
- x: number;
16
- y: number;
17
- }, gridSize: number): {
18
- x: number;
19
- y: number;
20
- };
21
- export declare function screenToCanvas(screenX: number, screenY: number, viewport: {
22
- panX: number;
23
- panY: number;
24
- zoom: number;
25
- }): {
26
- x: number;
27
- y: number;
28
- };
29
- export declare function computeFitAll(cards: ProjectCard[], containerWidth: number, containerHeight: number, padding?: number): {
1
+ /**
2
+ * Board.ts -- Thin wrapper around the reusable Board component.
3
+ * Re-exports the Board and its helpers from the library.
4
+ * Keeps demo-specific helpers (computeFitAll) locally.
5
+ */
6
+ import type { BoardItem } from './types';
7
+ export { Board } from '../../../components/data/board/src/Board';
8
+ export { snapToGrid, screenToCanvas } from '../../../components/data/board/src/Board';
9
+ export type { BoardProps } from '../../../components/data/board/src/Board';
10
+ export declare function computeFitAll(collection: BoardItem[], containerWidth: number, containerHeight: number, padding?: number): {
30
11
  panX: number;
31
12
  panY: number;
32
13
  zoom: number;
33
14
  };
34
- export declare function Board(props: BoardProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -1,76 +1,5 @@
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 {};
1
+ import type { BoardStorage } from './types';
2
+ export type { BoardAction, HistoryState, UseBoardReducerResult } from '../../../components/data/board/src/BoardReducer';
3
+ export { boardReducer, historyReducer, useBoardReducer, DEFAULT_BOARD_STATE } from '../../../components/data/board/src/BoardReducer';
4
+ export type UseBoardStateResult = import('../../../components/data/board/src/BoardReducer').UseBoardReducerResult;
5
+ export declare function useBoardState(storage?: BoardStorage, boardId?: string): import('../../../components/data/board/src/BoardReducer').UseBoardReducerResult;
@@ -1,36 +1,11 @@
1
- import type { ProjectCard } from './types';
2
- export declare const PRIORITY_COLORS: Record<string, string>;
1
+ /**
2
+ * Card.ts -- Re-exports the CardComponent from the reusable Board library.
3
+ * Keeps demo-specific constants (context menu colors, priority options).
4
+ */
5
+ export { CardComponent as Card, PRIORITY_COLORS, CARD_TYPE_OPTIONS } from '../../../components/data/board/src/Card';
6
+ export type { CardComponentProps as CardProps } from '../../../components/data/board/src/Card';
3
7
  export declare const CONTEXT_MENU_COLORS: string[];
4
8
  export declare const PRIORITY_OPTIONS: Array<{
5
9
  label: string;
6
10
  value: 'low' | 'medium' | 'high' | 'critical';
7
11
  }>;
8
- export interface CardProps {
9
- card: ProjectCard;
10
- selected: boolean;
11
- onSelect: (cardId: string) => void;
12
- onMove: (cardId: string, position: {
13
- x: number;
14
- y: number;
15
- }) => void;
16
- onResize: (cardId: string, size: {
17
- width: number;
18
- height: number;
19
- }) => void;
20
- onDelete: (cardId: string) => void;
21
- onDoubleClick: (cardId: string) => void;
22
- onUpdate?: (cardId: string, updates: {
23
- title?: string;
24
- description?: string;
25
- }) => void;
26
- onDragStart?: (cardId: string, e: Event) => void;
27
- onDuplicate?: (cardId: string) => void;
28
- onChangeColor?: (cardId: string, color: string) => void;
29
- onChangePriority?: (cardId: string, priority: 'low' | 'medium' | 'high' | 'critical') => void;
30
- onAnchorDragStart?: (cardId: string, anchor: string, x: number, y: number) => void;
31
- onCardContextMenu?: (cardId: string, pos: {
32
- x: number;
33
- y: number;
34
- }) => void;
35
- }
36
- export declare function Card(props: CardProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
@@ -1,6 +1,6 @@
1
- import type { ProjectCard } from './types';
1
+ import type { Card } from './types';
2
2
  export interface CardEditorProps {
3
- card: ProjectCard;
3
+ card: Card;
4
4
  onSave: (cardId: string, updates: {
5
5
  title: string;
6
6
  description: string;
@@ -1,11 +1,6 @@
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>;
1
+ /**
2
+ * Connection.ts -- Re-exports the CardLinkOverlay from the reusable Board library.
3
+ * The old ConnectionsOverlay is replaced by CardLinkOverlay.
4
+ */
5
+ export { CardLinkOverlay as ConnectionsOverlay } from '../../../components/data/board/src/CardLink';
6
+ export type { CardLinkOverlayProps as ConnectionsOverlayProps } from '../../../components/data/board/src/CardLink';
@@ -1,6 +1,6 @@
1
- import type { ProjectCard } from './types';
1
+ import type { BoardItem } from './types';
2
2
  export interface InterAppWrapperProps {
3
- cards: ProjectCard[];
3
+ collection: BoardItem[];
4
4
  onCardDropped: (title: string, description: string) => void;
5
5
  children: unknown;
6
6
  }
@@ -1,8 +1,9 @@
1
- export type { ProjectCard, CardConnection, BoardState, BoardStorage } from './types';
1
+ export type { Card, CardLink, BoardState, BoardItem } from './types';
2
+ export type { BoardStorage } from './types';
2
3
  export { useBoardState, boardReducer, historyReducer, DEFAULT_BOARD_STATE } from './BoardState';
3
4
  export type { BoardAction, HistoryState, UseBoardStateResult } from './BoardState';
4
5
  export { LocalBoardStorage } from './LocalStorage';
5
- export { Card } from './Card';
6
+ export { Card as CardComponent } from './Card';
6
7
  export { CardEditor } from './CardEditor';
7
8
  export { ConnectionsOverlay } from './Connection';
8
9
  export { BoardToolbar, CARD_COLORS } from './Toolbar';
@@ -1,49 +1,10 @@
1
1
  /**
2
- * types.ts -- Interfaces for the Whiteboard Project Manager.
2
+ * types.ts -- Re-exports types from the reusable Board component library.
3
+ * Keeps demo-specific interfaces (BoardStorage) locally.
3
4
  */
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
- /** Board UUID (v4) — unique identifier for this board instance */
32
- id: string;
33
- /** User-assigned board name (default: "Untitled") */
34
- name: string;
35
- /** Board contents — cards placed on the whiteboard */
36
- cards: ProjectCard[];
37
- /** Connections between cards */
38
- connections: CardConnection[];
39
- /** Viewport configuration */
40
- viewport: {
41
- panX: number;
42
- panY: number;
43
- zoom: number;
44
- };
45
- }
5
+ export type { BoardState, BoardItem, Card, Container, CardLink, CardType, TextContent, JsonContent, TaskContent, ProjectContent, } from '../../../components/data/board/src/types';
6
+ export { isCard, isContainer, generateUUID, getItemId, getItemName, } from '../../../components/data/board/src/types';
46
7
  export interface BoardStorage {
47
- load(boardId: string): Promise<BoardState>;
48
- save(boardId: string, state: BoardState): Promise<void>;
8
+ load(boardId: string): Promise<import('../../../components/data/board/src/types').BoardState>;
9
+ save(boardId: string, state: import('../../../components/data/board/src/types').BoardState): Promise<void>;
49
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asymmetric-effort/specifyjs",
3
- "version": "0.2.150",
3
+ "version": "0.2.151",
4
4
  "description": "A declarative TypeScript UI framework built for performance and simplicity",
5
5
  "publishConfig": {
6
6
  "access": "public"