@anchrd/intel-ui 0.16.1 → 0.18.0

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.
Files changed (38) hide show
  1. package/package.json +10 -2
  2. package/src/agent/agent-calendar/agent-calendar.tsx +27 -2
  3. package/src/agent/agent-profile/agent-profile.tsx +20 -2
  4. package/src/agent/agent.tsx +27 -2
  5. package/src/board/board-calendar/board-calendar.tsx +89 -0
  6. package/src/board/board-card/board-card.tsx +106 -0
  7. package/src/board/board-data/board-data.ts +241 -0
  8. package/src/board/board-data/board-data.types.ts +63 -0
  9. package/src/board/board-detail/board-detail.tsx +629 -0
  10. package/src/board/board-gantt/board-gantt.ts +545 -0
  11. package/src/board/board-gantt/board-gantt.tsx +286 -0
  12. package/src/board/board-graph/board-graph.ts +174 -0
  13. package/src/board/board-graph/board-graph.tsx +168 -0
  14. package/src/board/board-items/board-items.ts +183 -0
  15. package/src/board/board-kanban/board-kanban.ts +137 -0
  16. package/src/board/board-kanban/board-kanban.tsx +257 -0
  17. package/src/board/board-status/board-status.ts +59 -0
  18. package/src/board/board-statuses/board-statuses.ts +63 -0
  19. package/src/board/board-statuses/board-statuses.tsx +228 -0
  20. package/src/board/board-table/board-table.ts +33 -0
  21. package/src/board/board-table/board-table.tsx +413 -0
  22. package/src/board/board-views/board-views.tsx +68 -0
  23. package/src/board/board-views/board-views.types.ts +29 -0
  24. package/src/board/board.tsx +251 -0
  25. package/src/components/ui/dropdown-menu.tsx +25 -0
  26. package/src/components/ui/item-calendar.tsx +181 -0
  27. package/src/components/ui/item-gantt.tsx +463 -0
  28. package/src/components/ui/kanban.tsx +282 -0
  29. package/src/components/ui/switch.tsx +25 -0
  30. package/src/data/intel-data-provider/intel-data-provider.ts +52 -0
  31. package/src/data/intel-data-provider/intel-data-provider.types.ts +31 -0
  32. package/src/i18n/de.json +90 -1
  33. package/src/i18n/en.json +90 -1
  34. package/src/i18n/es.json +90 -1
  35. package/src/node-table/node-table.tsx +3 -2
  36. package/src/nodes/nodes.tsx +16 -0
  37. package/src/resource-menu/resource-menu.tsx +26 -6
  38. package/src/styles.css +33 -0
@@ -0,0 +1,63 @@
1
+ import type {
2
+ AddBoardTaskInput,
3
+ BoardStatus,
4
+ BoardStatusInput,
5
+ BoardTask,
6
+ BoardTaskResult,
7
+ ConfigureBoardResult,
8
+ DeleteBoardTaskResult,
9
+ MoveBoardTaskInput,
10
+ NodeBoard,
11
+ UpdateBoardTaskInput,
12
+ } from "@anchrd/intel-contract";
13
+ import type { UseMutationResult, UseQueryResult } from "@tanstack/react-query";
14
+
15
+ // What a caller hands over, minus what the data layer fills in for it: the node it is on and the
16
+ // idempotency key. Neither is a decision any view makes, and a view that could get them wrong is a
17
+ // view that could write to the wrong board.
18
+ export type AddTask = Omit<AddBoardTaskInput, "nodeId" | "idempotencyKey">;
19
+ export type UpdateTask = Omit<UpdateBoardTaskInput, "nodeId" | "idempotencyKey">;
20
+ export type MoveTask = Omit<MoveBoardTaskInput, "nodeId" | "idempotencyKey">;
21
+
22
+ /**
23
+ * The board, and every way to change it — the one thing a view is handed (anchrd/intel#286).
24
+ *
25
+ * ⚠️ No view loads and no view writes. Five of them draw the same list, the last of which (Gantt,
26
+ * anchrd/intel#293) arrived as a renderer rather than a rebuild — which only holds while the
27
+ * loading, the cache and the five operations live in exactly one place. A view that reached for
28
+ * `useQuery` itself would be a second cache entry for the same board: two readers, one stale, the
29
+ * same task in two states on one screen.
30
+ */
31
+ export interface BoardHandle {
32
+ nodeId: string;
33
+ query: UseQueryResult<NodeBoard>;
34
+ // The status list in the order it is drawn, `archived` included. A view that wants the columns a
35
+ // person works in filters it with `visibleStatuses`.
36
+ statuses: BoardStatus[];
37
+ // Every task of the board, ordered by status and then by `order`. Archived ones are in here too:
38
+ // hiding them is the KANBAN's switch, not a fact about the data, and a view that never saw them
39
+ // could not offer to show them.
40
+ tasks: BoardTask[];
41
+ byId: Map<string, BoardTask>;
42
+ // The direct children of a task, keyed by parent. Built once for every view that asks, and each
43
+ // building its own map would walk the whole board again.
44
+ childrenOf: Map<string, BoardTask[]>;
45
+ /**
46
+ * Whether something this task waits for is still open.
47
+ *
48
+ * ⚠️ "Open" is the status list's own `terminal` flag and nothing else (anchrd/intel#311). It is
49
+ * not a position: reading it as "the last column before `archived`" made a board configured to
50
+ * `… done → blocked → archived` treat "blocked" as finished, silently, with a wrong marker as the
51
+ * only symptom.
52
+ */
53
+ blockedBy(task: BoardTask): BoardTask[];
54
+ // The other half of the same question: a task nobody is waiting for any more. It is what a subtask
55
+ // counter counts and what `blockedBy` measures its dependencies against, so both come from one
56
+ // definition rather than two that can drift apart.
57
+ settled(task: BoardTask): boolean;
58
+ add: UseMutationResult<BoardTaskResult, Error, AddTask>;
59
+ update: UseMutationResult<BoardTaskResult, Error, UpdateTask>;
60
+ move: UseMutationResult<BoardTaskResult, Error, MoveTask>;
61
+ remove: UseMutationResult<DeleteBoardTaskResult, Error, { taskId: string }>;
62
+ configure: UseMutationResult<ConfigureBoardResult, Error, BoardStatusInput[]>;
63
+ }