@asymmetric-effort/specifyjs 0.2.150 → 0.2.153
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.
- package/dist/esm/components-barrel.js +2400 -1211
- package/dist/specifyjs-components.cjs.js +3 -3
- package/dist/specifyjs-components.esm.js +2400 -1211
- package/dist/types/components/data/board/src/Board.d.ts +14 -1
- package/dist/types/components/data/board/src/Card.d.ts +14 -0
- package/dist/types/components/data/board/src/CardLink.d.ts +4 -0
- package/dist/types/components/data/board/src/Container.d.ts +2 -0
- package/dist/types/demos/project-manager/src/Board.d.ts +10 -30
- package/dist/types/demos/project-manager/src/BoardState.d.ts +5 -76
- package/dist/types/demos/project-manager/src/InterApp.d.ts +2 -2
- package/dist/types/demos/project-manager/src/index.d.ts +2 -10
- package/dist/types/demos/project-manager/src/types.d.ts +6 -45
- package/package.json +2 -2
- package/dist/types/demos/project-manager/src/Card.d.ts +0 -36
- package/dist/types/demos/project-manager/src/CardEditor.d.ts +0 -10
- package/dist/types/demos/project-manager/src/Connection.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BoardState } from './types';
|
|
1
|
+
import type { BoardState, BoardItem } from './types';
|
|
2
2
|
import type { BoardAction } from './BoardReducer';
|
|
3
3
|
export interface BoardProps {
|
|
4
4
|
state: BoardState;
|
|
@@ -9,7 +9,20 @@ export interface BoardProps {
|
|
|
9
9
|
searchQuery?: string;
|
|
10
10
|
colorFilter?: string | null;
|
|
11
11
|
onOpenProject?: (projectId: string) => void;
|
|
12
|
+
onCardContextMenu?: (cardId: string, pos: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
onUpdateItem?: (cardId: string, updates: {
|
|
17
|
+
card_title?: string;
|
|
18
|
+
content?: unknown;
|
|
19
|
+
}) => void;
|
|
12
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Find the first container whose bounding box contains the given point.
|
|
23
|
+
* Optionally excludes a specific item ID (e.g., the dragged item itself).
|
|
24
|
+
*/
|
|
25
|
+
export declare function findContainerAtPoint(collection: BoardItem[], x: number, y: number, excludeId?: string): string | null;
|
|
13
26
|
export declare function snapToGrid(pos: {
|
|
14
27
|
x: number;
|
|
15
28
|
y: number;
|
|
@@ -20,5 +20,19 @@ export interface CardComponentProps {
|
|
|
20
20
|
onDelete?: (cardId: string) => void;
|
|
21
21
|
dispatch?: (action: BoardAction) => void;
|
|
22
22
|
onOpenProject?: (projectId: string) => void;
|
|
23
|
+
onCardContextMenu?: (cardId: string, pos: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
onUpdate?: (cardId: string, updates: {
|
|
28
|
+
card_title?: string;
|
|
29
|
+
content?: unknown;
|
|
30
|
+
}) => void;
|
|
31
|
+
onDragStart?: (cardId: string) => void;
|
|
32
|
+
onDragEnd?: (cardId: string) => void;
|
|
33
|
+
onAnchorDragStart?: (cardId: string, anchor: string, pos: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}) => void;
|
|
23
37
|
}
|
|
24
38
|
export declare function CardComponent(props: CardComponentProps): import("specifyjs/shared/types").SpecElement<import("specifyjs/shared/types").Props>;
|
|
@@ -7,6 +7,10 @@ export interface CardLinkOverlayProps {
|
|
|
7
7
|
cards: Card[];
|
|
8
8
|
selectedLinkId: string | null;
|
|
9
9
|
onSelectLink: (linkId: string | null) => void;
|
|
10
|
+
onLinkContextMenu?: (linkId: string, cardId: string, pos: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}) => void;
|
|
10
14
|
canvasWidth: number;
|
|
11
15
|
canvasHeight: number;
|
|
12
16
|
}
|
|
@@ -2,6 +2,7 @@ import type { Container } from './types';
|
|
|
2
2
|
export interface ContainerComponentProps {
|
|
3
3
|
container: Container;
|
|
4
4
|
selected?: boolean;
|
|
5
|
+
highlighted?: boolean;
|
|
5
6
|
onSelect?: (containerId: string) => void;
|
|
6
7
|
onMove?: (containerId: string, position: {
|
|
7
8
|
x: number;
|
|
@@ -11,6 +12,7 @@ export interface ContainerComponentProps {
|
|
|
11
12
|
width: number;
|
|
12
13
|
height: number;
|
|
13
14
|
}) => void;
|
|
15
|
+
onDelete?: (containerId: string) => void;
|
|
14
16
|
onDrop?: (itemId: string, containerId: string) => void;
|
|
15
17
|
children?: unknown;
|
|
16
18
|
}
|
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 {
|
|
2
|
-
export type BoardAction
|
|
3
|
-
|
|
4
|
-
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BoardItem } from './types';
|
|
2
2
|
export interface InterAppWrapperProps {
|
|
3
|
-
|
|
3
|
+
collection: BoardItem[];
|
|
4
4
|
onCardDropped: (title: string, description: string) => void;
|
|
5
5
|
children: unknown;
|
|
6
6
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
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
1
|
export interface ProjectManagerAppProps {
|
|
12
2
|
boardId?: string;
|
|
3
|
+
/** Called when the project name changes — consumer should update the window title */
|
|
4
|
+
onTitleChange?: (title: string) => void;
|
|
13
5
|
}
|
|
14
6
|
export declare function ProjectManagerApp(props: ProjectManagerAppProps): import("specifyjs").SpecElement<import("specifyjs").Props>;
|
|
@@ -1,49 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* types.ts --
|
|
2
|
+
* types.ts -- Re-exports types from the reusable Board component library.
|
|
3
|
+
* Keeps demo-specific interfaces (BoardStorage) locally.
|
|
3
4
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
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.
|
|
3
|
+
"version": "0.2.153",
|
|
4
4
|
"description": "A declarative TypeScript UI framework built for performance and simplicity",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
],
|
|
96
96
|
"license": "MIT",
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@asymmetric-effort/nogginlessdom": "^0.0.
|
|
98
|
+
"@asymmetric-effort/nogginlessdom": "^0.0.25",
|
|
99
99
|
"@playwright/test": "^1.59.0",
|
|
100
100
|
"@types/node": "^25.6.2",
|
|
101
101
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ProjectCard } from './types';
|
|
2
|
-
export declare const PRIORITY_COLORS: Record<string, string>;
|
|
3
|
-
export declare const CONTEXT_MENU_COLORS: string[];
|
|
4
|
-
export declare const PRIORITY_OPTIONS: Array<{
|
|
5
|
-
label: string;
|
|
6
|
-
value: 'low' | 'medium' | 'high' | 'critical';
|
|
7
|
-
}>;
|
|
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,10 +0,0 @@
|
|
|
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>;
|
|
@@ -1,11 +0,0 @@
|
|
|
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>;
|