@elaraai/east-ui 1.0.28 → 1.0.30
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/README.md +3 -3
- package/dist/src/charts/chart/index.d.ts +102 -0
- package/dist/src/charts/chart/index.d.ts.map +1 -1
- package/dist/src/charts/chart/index.js +30 -11
- package/dist/src/charts/chart/index.js.map +1 -1
- package/dist/src/charts/spec/index.d.ts +204 -0
- package/dist/src/charts/spec/index.d.ts.map +1 -1
- package/dist/src/charts/spec/types.d.ts +3 -11
- package/dist/src/charts/spec/types.d.ts.map +1 -1
- package/dist/src/charts/spec/types.js +5 -20
- package/dist/src/charts/spec/types.js.map +1 -1
- package/dist/src/collections/blend/index.d.ts.map +1 -1
- package/dist/src/collections/blend/index.js +2 -1
- package/dist/src/collections/blend/index.js.map +1 -1
- package/dist/src/collections/board/index.d.ts +490 -0
- package/dist/src/collections/board/index.d.ts.map +1 -0
- package/dist/src/collections/board/index.js +282 -0
- package/dist/src/collections/board/index.js.map +1 -0
- package/dist/src/collections/board/types.d.ts +308 -0
- package/dist/src/collections/board/types.d.ts.map +1 -0
- package/dist/src/collections/board/types.js +156 -0
- package/dist/src/collections/board/types.js.map +1 -0
- package/dist/src/collections/calendar/index.d.ts.map +1 -1
- package/dist/src/collections/calendar/index.js +2 -1
- package/dist/src/collections/calendar/index.js.map +1 -1
- package/dist/src/collections/gantt/index.d.ts +1 -1
- package/dist/src/collections/gantt/index.d.ts.map +1 -1
- package/dist/src/collections/gantt/index.js +45 -52
- package/dist/src/collections/gantt/index.js.map +1 -1
- package/dist/src/collections/index.d.ts +1 -0
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js +1 -0
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/library/index.d.ts.map +1 -1
- package/dist/src/collections/library/index.js +2 -1
- package/dist/src/collections/library/index.js.map +1 -1
- package/dist/src/collections/map/index.d.ts.map +1 -1
- package/dist/src/collections/map/index.js +5 -4
- package/dist/src/collections/map/index.js.map +1 -1
- package/dist/src/collections/matrix/index.d.ts.map +1 -1
- package/dist/src/collections/matrix/index.js +2 -1
- package/dist/src/collections/matrix/index.js.map +1 -1
- package/dist/src/collections/planner/index.d.ts.map +1 -1
- package/dist/src/collections/planner/index.js +2 -1
- package/dist/src/collections/planner/index.js.map +1 -1
- package/dist/src/collections/roster/index.d.ts +3 -0
- package/dist/src/collections/roster/index.d.ts.map +1 -1
- package/dist/src/collections/roster/index.js +4 -2
- package/dist/src/collections/roster/index.js.map +1 -1
- package/dist/src/collections/roster/types.d.ts +3 -0
- package/dist/src/collections/roster/types.d.ts.map +1 -1
- package/dist/src/collections/roster/types.js +3 -0
- package/dist/src/collections/roster/types.js.map +1 -1
- package/dist/src/collections/schematic/index.d.ts +537 -709
- package/dist/src/collections/schematic/index.d.ts.map +1 -1
- package/dist/src/collections/schematic/index.js +289 -9
- package/dist/src/collections/schematic/index.js.map +1 -1
- package/dist/src/collections/schematic/types.d.ts +562 -841
- package/dist/src/collections/schematic/types.d.ts.map +1 -1
- package/dist/src/collections/schematic/types.js +416 -46
- package/dist/src/collections/schematic/types.js.map +1 -1
- package/dist/src/collections/table/index.d.ts +19 -11
- package/dist/src/collections/table/index.d.ts.map +1 -1
- package/dist/src/collections/table/index.js +65 -78
- package/dist/src/collections/table/index.js.map +1 -1
- package/dist/src/component.d.ts +1572 -63
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +55 -15
- package/dist/src/component.js.map +1 -1
- package/dist/src/contracts/format.d.ts +39 -0
- package/dist/src/contracts/format.d.ts.map +1 -0
- package/dist/src/contracts/format.js +38 -0
- package/dist/src/contracts/format.js.map +1 -0
- package/dist/src/contracts/index.d.ts +1 -0
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +1 -0
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/contracts/slice-affordances.d.ts +13 -3
- package/dist/src/contracts/slice-affordances.d.ts.map +1 -1
- package/dist/src/contracts/slice-affordances.js +12 -2
- package/dist/src/contracts/slice-affordances.js.map +1 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +1 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +1 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/platform/slice/impl.d.ts +1 -0
- package/dist/src/platform/slice/impl.d.ts.map +1 -1
- package/dist/src/platform/slice/impl.js +85 -34
- package/dist/src/platform/slice/impl.js.map +1 -1
- package/dist/src/platform/slice/index.d.ts +2098 -29
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +145 -12
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/runtime/collections/board.d.ts +73 -0
- package/dist/src/runtime/collections/board.d.ts.map +1 -0
- package/dist/src/runtime/collections/board.js +68 -0
- package/dist/src/runtime/collections/board.js.map +1 -0
- package/dist/src/runtime/collections/index.d.ts +1 -0
- package/dist/src/runtime/collections/index.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.js +1 -0
- package/dist/src/runtime/collections/index.js.map +1 -1
- package/dist/src/runtime/collections/schematic.d.ts +11 -4
- package/dist/src/runtime/collections/schematic.d.ts.map +1 -1
- package/dist/src/runtime/collections/schematic.js +8 -2
- package/dist/src/runtime/collections/schematic.js.map +1 -1
- package/dist/src/runtime/slice.d.ts +7 -3
- package/dist/src/runtime/slice.d.ts.map +1 -1
- package/dist/src/runtime/slice.js +62 -14
- package/dist/src/runtime/slice.js.map +1 -1
- package/dist/src/shared/reify.d.ts +76 -0
- package/dist/src/shared/reify.d.ts.map +1 -0
- package/dist/src/shared/reify.js +85 -0
- package/dist/src/shared/reify.js.map +1 -0
- package/dist/src/slice/breakdown/index.d.ts +100 -0
- package/dist/src/slice/breakdown/index.d.ts.map +1 -1
- package/dist/src/slice/breakdown/types.d.ts +100 -0
- package/dist/src/slice/breakdown/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.d.ts +787 -10
- package/dist/src/slice/cohort/index.d.ts.map +1 -1
- package/dist/src/slice/cohort/index.js +33 -10
- package/dist/src/slice/cohort/index.js.map +1 -1
- package/dist/src/slice/cohort/types.d.ts +225 -99
- package/dist/src/slice/cohort/types.d.ts.map +1 -1
- package/dist/src/slice/cohort/types.js +31 -9
- package/dist/src/slice/cohort/types.js.map +1 -1
- package/dist/src/slice/filter/index.d.ts +100 -0
- package/dist/src/slice/filter/index.d.ts.map +1 -1
- package/dist/src/slice/filter/types.d.ts +100 -0
- package/dist/src/slice/filter/types.d.ts.map +1 -1
- package/dist/src/slice/index.d.ts +2862 -126
- package/dist/src/slice/index.d.ts.map +1 -1
- package/dist/src/slice/index.js +6 -4
- package/dist/src/slice/index.js.map +1 -1
- package/dist/src/slice/legend/index.d.ts +124 -7
- package/dist/src/slice/legend/index.d.ts.map +1 -1
- package/dist/src/slice/legend/index.js +20 -10
- package/dist/src/slice/legend/index.js.map +1 -1
- package/dist/src/slice/legend/types.d.ts +233 -108
- package/dist/src/slice/legend/types.d.ts.map +1 -1
- package/dist/src/slice/legend/types.js +26 -5
- package/dist/src/slice/legend/types.js.map +1 -1
- package/dist/src/slice/rail/index.d.ts +22 -0
- package/dist/src/slice/rail/index.d.ts.map +1 -1
- package/dist/src/slice/rail/index.js +9 -1
- package/dist/src/slice/rail/index.js.map +1 -1
- package/dist/src/slice/range/index.d.ts +100 -0
- package/dist/src/slice/range/index.d.ts.map +1 -1
- package/dist/src/slice/range/types.d.ts +100 -0
- package/dist/src/slice/range/types.d.ts.map +1 -1
- package/dist/src/slice/search/index.d.ts +100 -0
- package/dist/src/slice/search/index.d.ts.map +1 -1
- package/dist/src/slice/search/types.d.ts +100 -0
- package/dist/src/slice/search/types.d.ts.map +1 -1
- package/dist/src/slice/summary/index.d.ts +100 -0
- package/dist/src/slice/summary/index.d.ts.map +1 -1
- package/dist/src/slice/summary/types.d.ts +100 -0
- package/dist/src/slice/summary/types.d.ts.map +1 -1
- package/dist/test/collections/board.examples.d.ts +7 -0
- package/dist/test/collections/board.examples.d.ts.map +1 -0
- package/dist/test/collections/board.examples.js +191 -0
- package/dist/test/collections/board.examples.js.map +1 -0
- package/dist/test/collections/gantt.examples.js +2 -2
- package/dist/test/collections/gantt.examples.js.map +1 -1
- package/dist/test/collections/matrix.examples.d.ts.map +1 -1
- package/dist/test/collections/matrix.examples.js +4 -3
- package/dist/test/collections/matrix.examples.js.map +1 -1
- package/dist/test/collections/schematic.examples.d.ts +11 -1
- package/dist/test/collections/schematic.examples.d.ts.map +1 -1
- package/dist/test/collections/schematic.examples.js +354 -24
- package/dist/test/collections/schematic.examples.js.map +1 -1
- package/dist/test/collections/table.examples.d.ts.map +1 -1
- package/dist/test/collections/table.examples.js +9 -6
- package/dist/test/collections/table.examples.js.map +1 -1
- package/dist/test/disclosure/story.examples.js +1 -1
- package/dist/test/disclosure/story.examples.js.map +1 -1
- package/dist/test/display/combine.examples.js +2 -2
- package/dist/test/display/combine.examples.js.map +1 -1
- package/dist/test/display/editable-chip.examples.js +1 -1
- package/dist/test/display/editable-chip.examples.js.map +1 -1
- package/dist/test/slice/slice.examples.d.ts +5 -0
- package/dist/test/slice/slice.examples.d.ts.map +1 -1
- package/dist/test/slice/slice.examples.js +216 -6
- package/dist/test/slice/slice.examples.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `Board` — the single-day assignment board: an areas × shifts grid where
|
|
7
|
+
* each cell holds multiple people as chips under the shared event-state
|
|
8
|
+
* grammar (committed / proposed / rejected, with the `model` flavour
|
|
9
|
+
* rendering as a dashed ghost). Takes the flat tables a dataset naturally
|
|
10
|
+
* provides — areas, shifts, people, and assignments — each with a
|
|
11
|
+
* chart-style field encoding; the factory joins assignments to people by
|
|
12
|
+
* person key and groups them into cells by `area × shift`. Optional
|
|
13
|
+
* `requirements` add per-cell coverage (`n/required` numerals, open-slot
|
|
14
|
+
* placeholders, under / over tones).
|
|
15
|
+
*
|
|
16
|
+
* Declares the drag & drop **target** role: `id` + `sources` connect it to
|
|
17
|
+
* sibling Libraries, and every completed drag (add / move / remove) funnels
|
|
18
|
+
* through one `onDrag` callback as a `DragEventType` value. The component
|
|
19
|
+
* renders no built-in user-facing copy — every string it shows arrives as
|
|
20
|
+
* data or a prop.
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
import { East, Expr, variant, some, none, ArrayType, StringType, StructType, } from "@elaraai/east";
|
|
25
|
+
import { UIComponentType } from "../../component.js";
|
|
26
|
+
import { mapRows } from "../../shared/reify.js";
|
|
27
|
+
import { DensityType } from "../../style/interaction.js";
|
|
28
|
+
import {} from "../../contracts/drag.js";
|
|
29
|
+
import { PlannerStateType } from "../planner/types.js";
|
|
30
|
+
import { BoardModeType, BoardEntityType, BoardAssignmentType, BoardRequirementType, BoardRootType, } from "./types.js";
|
|
31
|
+
// Re-export types
|
|
32
|
+
export { BoardModeType, BoardEntityType, BoardAssignmentType, BoardRequirementType, BoardRootType, } from "./types.js";
|
|
33
|
+
function resolveEntities(rows, mapper) {
|
|
34
|
+
if (mapper === undefined) {
|
|
35
|
+
return East.value(rows, ArrayType(BoardEntityType));
|
|
36
|
+
}
|
|
37
|
+
return mapRows(East.value(rows), BoardEntityType, (row) => {
|
|
38
|
+
const r = mapper(row);
|
|
39
|
+
if (r instanceof Expr)
|
|
40
|
+
return East.value(r, BoardEntityType);
|
|
41
|
+
return East.value({
|
|
42
|
+
key: r.key,
|
|
43
|
+
label: r.label,
|
|
44
|
+
sublabel: r.sublabel !== undefined ? some(r.sublabel) : none,
|
|
45
|
+
}, BoardEntityType);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function buildRoot(areas, shifts, people, assignments, config) {
|
|
49
|
+
const assignmentMapper = config.assignment;
|
|
50
|
+
const resolvedAssignments = assignmentMapper === undefined
|
|
51
|
+
? East.value(assignments, ArrayType(BoardAssignmentType))
|
|
52
|
+
: mapRows(East.value(assignments), BoardAssignmentType, (row) => {
|
|
53
|
+
const r = assignmentMapper(row);
|
|
54
|
+
if (r instanceof Expr)
|
|
55
|
+
return East.value(r, BoardAssignmentType);
|
|
56
|
+
return East.value({
|
|
57
|
+
key: r.key,
|
|
58
|
+
person: r.person,
|
|
59
|
+
area: r.area,
|
|
60
|
+
shift: r.shift,
|
|
61
|
+
state: r.state,
|
|
62
|
+
}, BoardAssignmentType);
|
|
63
|
+
});
|
|
64
|
+
const requirementMapper = config.requirement;
|
|
65
|
+
const resolvedRequirements = config.requirements === undefined
|
|
66
|
+
? none
|
|
67
|
+
: some(requirementMapper === undefined
|
|
68
|
+
? East.value(config.requirements, ArrayType(BoardRequirementType))
|
|
69
|
+
: mapRows(East.value(config.requirements), BoardRequirementType, (row) => {
|
|
70
|
+
const r = requirementMapper(row);
|
|
71
|
+
if (r instanceof Expr)
|
|
72
|
+
return East.value(r, BoardRequirementType);
|
|
73
|
+
return East.value({
|
|
74
|
+
area: r.area,
|
|
75
|
+
shift: r.shift,
|
|
76
|
+
required: r.required,
|
|
77
|
+
}, BoardRequirementType);
|
|
78
|
+
}));
|
|
79
|
+
const mode = config.mode !== undefined
|
|
80
|
+
? (typeof config.mode === "string" ? East.value(variant(config.mode, null), BoardModeType) : config.mode)
|
|
81
|
+
: East.value(variant("published", null), BoardModeType);
|
|
82
|
+
const density = config.density !== undefined
|
|
83
|
+
? some(typeof config.density === "string" ? East.value(variant(config.density, null), DensityType) : config.density)
|
|
84
|
+
: none;
|
|
85
|
+
const maxVisible = config.maxVisible !== undefined
|
|
86
|
+
? some(typeof config.maxVisible === "number" ? BigInt(config.maxVisible) : config.maxVisible)
|
|
87
|
+
: none;
|
|
88
|
+
return East.value(variant("Board", {
|
|
89
|
+
id: config.id,
|
|
90
|
+
sources: East.value(config.sources ?? [], ArrayType(StringType)),
|
|
91
|
+
mode,
|
|
92
|
+
areaHeader: config.areaHeader !== undefined ? some(config.areaHeader) : none,
|
|
93
|
+
areaWidth: config.areaWidth !== undefined ? some(config.areaWidth) : none,
|
|
94
|
+
areas: resolveEntities(areas, config.area),
|
|
95
|
+
shifts: resolveEntities(shifts, config.shift),
|
|
96
|
+
people: resolveEntities(people, config.person),
|
|
97
|
+
assignments: resolvedAssignments,
|
|
98
|
+
requirements: resolvedRequirements,
|
|
99
|
+
density,
|
|
100
|
+
maxVisible,
|
|
101
|
+
summary: config.summary !== undefined ? some(config.summary) : none,
|
|
102
|
+
canAssign: config.canAssign !== undefined ? some(config.canAssign) : none,
|
|
103
|
+
onDrag: config.onDrag !== undefined ? some(config.onDrag) : none,
|
|
104
|
+
onSelect: config.onSelect !== undefined ? some(config.onSelect) : none,
|
|
105
|
+
onAccept: config.onAccept !== undefined ? some(config.onAccept) : none,
|
|
106
|
+
onAddAt: config.onAddAt !== undefined ? some(config.onAddAt) : none,
|
|
107
|
+
}), UIComponentType);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates a Board — single-day areas × shifts assignment scheduling.
|
|
111
|
+
*
|
|
112
|
+
* @typeParam A - The areas-table input
|
|
113
|
+
* @typeParam S - The shifts-table input
|
|
114
|
+
* @typeParam P - The people-table input
|
|
115
|
+
* @typeParam X - The assignments-table input
|
|
116
|
+
* @param areas - The area rows (one grid row each)
|
|
117
|
+
* @param shifts - The shift rows (one grid column each, in order)
|
|
118
|
+
* @param people - The people rows (chip faces, joined by the encoded person key)
|
|
119
|
+
* @param assignments - The assignment rows (grouped into cells by area × shift)
|
|
120
|
+
* @param config - The Board configuration ({@link BoardConfig})
|
|
121
|
+
* @returns An East expression of `UIComponentType`
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* import { East, variant } from "@elaraai/east";
|
|
126
|
+
* import { Board, UIComponentType } from "@elaraai/east-ui";
|
|
127
|
+
*
|
|
128
|
+
* const example = East.function([], UIComponentType, _$ =>
|
|
129
|
+
* Board.Root(
|
|
130
|
+
* [{ id: "icu", name: "ICU" }],
|
|
131
|
+
* [{ id: "am", name: "AM" }],
|
|
132
|
+
* [{ id: "patel", name: "Patel, R." }],
|
|
133
|
+
* [{ id: "x1", personId: "patel", areaId: "icu", shiftId: "am", state: variant("committed", null) }],
|
|
134
|
+
* {
|
|
135
|
+
* id: "board-tue",
|
|
136
|
+
* sources: ["people"],
|
|
137
|
+
* mode: "edit",
|
|
138
|
+
* area: a => ({ key: a.id, label: a.name }),
|
|
139
|
+
* shift: s => ({ key: s.id, label: s.name }),
|
|
140
|
+
* person: p => ({ key: p.id, label: p.name }),
|
|
141
|
+
* assignment: x => ({ key: x.id, person: x.personId, area: x.areaId,
|
|
142
|
+
* shift: x.shiftId, state: x.state }),
|
|
143
|
+
* },
|
|
144
|
+
* ),
|
|
145
|
+
* );
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
function createBoard(areas, shifts, people, assignments, config) {
|
|
149
|
+
return buildRoot(areas, shifts, people, assignments, config);
|
|
150
|
+
}
|
|
151
|
+
// ============================================================================
|
|
152
|
+
// Namespace export
|
|
153
|
+
// ============================================================================
|
|
154
|
+
/**
|
|
155
|
+
* Board component namespace.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* `Board.Root(areas, shifts, people, assignments, config)` builds the
|
|
159
|
+
* single-day grid from the flat tables; assignment states reuse the Planner
|
|
160
|
+
* event-state grammar (`Board.Types.State`), so data carries typed
|
|
161
|
+
* `variant(...)` values.
|
|
162
|
+
*/
|
|
163
|
+
export const Board = {
|
|
164
|
+
/**
|
|
165
|
+
* Creates a Board — single-day areas × shifts assignment scheduling with
|
|
166
|
+
* the drag & drop target role.
|
|
167
|
+
*
|
|
168
|
+
* @typeParam A - The areas-table input
|
|
169
|
+
* @typeParam S - The shifts-table input
|
|
170
|
+
* @typeParam P - The people-table input
|
|
171
|
+
* @typeParam X - The assignments-table input
|
|
172
|
+
* @param areas - The area rows (one grid row each)
|
|
173
|
+
* @param shifts - The shift rows (one grid column each, in order)
|
|
174
|
+
* @param people - The people rows (chip faces, joined by the encoded person key)
|
|
175
|
+
* @param assignments - The assignment rows (grouped into cells by area × shift)
|
|
176
|
+
* @param config - The Board configuration ({@link BoardConfig})
|
|
177
|
+
* @returns An East expression of `UIComponentType`
|
|
178
|
+
*
|
|
179
|
+
* @remarks
|
|
180
|
+
* Published mode renders committed assignments only, pointer-immutable;
|
|
181
|
+
* edit mode enables drag handles on proposed assignments, open-slot /
|
|
182
|
+
* empty-cell add, and ghost acceptance. Dropping a person onto a cell
|
|
183
|
+
* that already holds them is a no-op (the duplicate-person guard); the
|
|
184
|
+
* same person in different cells is legal — host policy. Cross-area
|
|
185
|
+
* moves arrive as plain `move` events — the host derives any swap
|
|
186
|
+
* representation from `from.row ≠ to.row`.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* import { East, variant } from "@elaraai/east";
|
|
191
|
+
* import { Board, UIComponentType } from "@elaraai/east-ui";
|
|
192
|
+
*
|
|
193
|
+
* const example = East.function([], UIComponentType, _$ =>
|
|
194
|
+
* Board.Root(
|
|
195
|
+
* [{ id: "icu", name: "ICU" }],
|
|
196
|
+
* [{ id: "am", name: "AM" }],
|
|
197
|
+
* [{ id: "patel", name: "Patel, R." }],
|
|
198
|
+
* [{ id: "x1", personId: "patel", areaId: "icu", shiftId: "am", state: variant("committed", null) }],
|
|
199
|
+
* {
|
|
200
|
+
* id: "board-tue",
|
|
201
|
+
* area: a => ({ key: a.id, label: a.name }),
|
|
202
|
+
* shift: s => ({ key: s.id, label: s.name }),
|
|
203
|
+
* person: p => ({ key: p.id, label: p.name }),
|
|
204
|
+
* assignment: x => ({ key: x.id, person: x.personId, area: x.areaId,
|
|
205
|
+
* shift: x.shiftId, state: x.state }),
|
|
206
|
+
* },
|
|
207
|
+
* ),
|
|
208
|
+
* );
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
Root: createBoard,
|
|
212
|
+
Types: {
|
|
213
|
+
/**
|
|
214
|
+
* East StructType for the Board component.
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* Flat resolved tables; the renderer groups assignments into cells
|
|
218
|
+
* by `area × shift` and joins each to `people` by person key. See
|
|
219
|
+
* {@link BoardRootType} for per-field docs.
|
|
220
|
+
*
|
|
221
|
+
* @property id - DnD target identity
|
|
222
|
+
* @property sources - Library ids accepted for `add` drags
|
|
223
|
+
* @property mode - `published` or `edit`
|
|
224
|
+
* @property areaHeader - Optional frozen area column header
|
|
225
|
+
* @property areas - The grid rows
|
|
226
|
+
* @property shifts - The grid columns, in order
|
|
227
|
+
* @property people - The chip directory (faces)
|
|
228
|
+
* @property assignments - The person chips
|
|
229
|
+
* @property requirements - Optional per-cell coverage
|
|
230
|
+
* @property density - Optional density
|
|
231
|
+
* @property maxVisible - Optional per-cell chip cap
|
|
232
|
+
* @property summary - Optional status-strip text
|
|
233
|
+
* @property onDrag - Drag funnel
|
|
234
|
+
* @property onSelect - Assignment / cell click callback
|
|
235
|
+
* @property onAccept - Ghost acceptance callback
|
|
236
|
+
* @property onAddAt - Open-slot / empty-cell click callback
|
|
237
|
+
*/
|
|
238
|
+
Board: BoardRootType,
|
|
239
|
+
/**
|
|
240
|
+
* Board render mode (`published` / `edit`).
|
|
241
|
+
*
|
|
242
|
+
* @property published - Committed-only, pointer-immutable
|
|
243
|
+
* @property edit - Operator + model proposals are interactive
|
|
244
|
+
*/
|
|
245
|
+
Mode: BoardModeType,
|
|
246
|
+
/**
|
|
247
|
+
* A resolved board entity — area row, shift column, or person face.
|
|
248
|
+
*
|
|
249
|
+
* @property key - Entity identity — the key assignments reference
|
|
250
|
+
* @property label - Display name
|
|
251
|
+
* @property sublabel - Optional muted second line
|
|
252
|
+
*/
|
|
253
|
+
Entity: BoardEntityType,
|
|
254
|
+
/**
|
|
255
|
+
* A resolved assignment — one person chip in one (area, shift) cell.
|
|
256
|
+
*
|
|
257
|
+
* @property key - Stable assignment identity
|
|
258
|
+
* @property person - The person key (joined for the chip face)
|
|
259
|
+
* @property area - The area key (the grid row)
|
|
260
|
+
* @property shift - The shift key (the grid column)
|
|
261
|
+
* @property state - The audit state
|
|
262
|
+
*/
|
|
263
|
+
Assignment: BoardAssignmentType,
|
|
264
|
+
/**
|
|
265
|
+
* A resolved coverage requirement for one (area, shift) cell.
|
|
266
|
+
*
|
|
267
|
+
* @property area - The area key
|
|
268
|
+
* @property shift - The shift key
|
|
269
|
+
* @property required - Required headcount for the cell
|
|
270
|
+
*/
|
|
271
|
+
Requirement: BoardRequirementType,
|
|
272
|
+
/**
|
|
273
|
+
* The shared event-state grammar (committed / proposed / rejected).
|
|
274
|
+
*
|
|
275
|
+
* @property committed - A published assignment
|
|
276
|
+
* @property proposed - A proposal (`added` / `model` / `removed`)
|
|
277
|
+
* @property rejected - A rejected proposal
|
|
278
|
+
*/
|
|
279
|
+
State: PlannerStateType,
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/collections/board/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAIH,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,EAIT,UAAU,EACV,UAAU,GAEb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAuB,MAAM,4BAA4B,CA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QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;QACtE,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;KACtE,CAAC,EAAE,eAAe,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,SAAS,WAAW,CAOhB,KAAQ,EACR,MAAS,EACT,MAAS,EACT,WAAc,EACd,MAC0B;IAE1B,OAAO,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MACa,CAAC,CAAC;AACxE,CAAC;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE;QACH;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH,KAAK,EAAE,aAAa;QACpB;;;;;WAKG;QACH,IAAI,EAAE,aAAa;QACnB;;;;;;WAMG;QACH,MAAM,EAAE,eAAe;QACvB;;;;;;;;WAQG;QACH,UAAU,EAAE,mBAAmB;QAC/B;;;;;;WAMG;QACH,WAAW,EAAE,oBAAoB;QACjC;;;;;;WAMG;QACH,KAAK,EAAE,gBAAgB;KAC1B;CACK,CAAC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { ArrayType, BooleanType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType } from "@elaraai/east";
|
|
6
|
+
/**
|
|
7
|
+
* Board render mode.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Published boards render committed assignments only, with no grips and no
|
|
11
|
+
* pointer interaction; edit mode enables drag handles, open-slot / empty-cell
|
|
12
|
+
* add, and ghost acceptance.
|
|
13
|
+
*
|
|
14
|
+
* @property published - Committed-only, pointer-immutable
|
|
15
|
+
* @property edit - Operator + model proposals are interactive
|
|
16
|
+
*/
|
|
17
|
+
export declare const BoardModeType: VariantType<{
|
|
18
|
+
/** Committed-only, pointer-immutable */
|
|
19
|
+
readonly published: NullType;
|
|
20
|
+
/** Operator + model proposals are interactive */
|
|
21
|
+
readonly edit: NullType;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Type representing board mode values.
|
|
25
|
+
*/
|
|
26
|
+
export type BoardModeType = typeof BoardModeType;
|
|
27
|
+
/**
|
|
28
|
+
* String literal form of {@link BoardModeType} tags.
|
|
29
|
+
*/
|
|
30
|
+
export type BoardModeLiteral = "published" | "edit";
|
|
31
|
+
/**
|
|
32
|
+
* A resolved board entity — an area row, a shift column, or a person face.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* One generic `key` / `label` / `sublabel` shape serves all three board
|
|
36
|
+
* tables: `areas` (rows), `shifts` (columns; `sublabel` typically the time
|
|
37
|
+
* window), and `people` (the chip directory assignments join by person key).
|
|
38
|
+
*
|
|
39
|
+
* @property key - Entity identity — the key assignments reference
|
|
40
|
+
* @property label - Display name
|
|
41
|
+
* @property sublabel - Optional muted second line (e.g. wing, time window, role)
|
|
42
|
+
*/
|
|
43
|
+
export declare const BoardEntityType: StructType<{
|
|
44
|
+
/** Entity identity — the key assignments reference */
|
|
45
|
+
readonly key: StringType;
|
|
46
|
+
/** Display name */
|
|
47
|
+
readonly label: StringType;
|
|
48
|
+
/** Optional muted second line (e.g. wing, time window, role) */
|
|
49
|
+
readonly sublabel: OptionType<StringType>;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Type representing resolved board entities.
|
|
53
|
+
*/
|
|
54
|
+
export type BoardEntityType = typeof BoardEntityType;
|
|
55
|
+
/**
|
|
56
|
+
* A resolved assignment — one person chip in one (area, shift) cell.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Carries no display label: the chip face comes from joining `person` to the
|
|
60
|
+
* board's `people` table by key.
|
|
61
|
+
*
|
|
62
|
+
* @property key - Stable assignment identity — referenced by drag-grammar cell refs
|
|
63
|
+
* @property person - The person key (joined to `people` for the chip face)
|
|
64
|
+
* @property area - The area key (the grid row)
|
|
65
|
+
* @property shift - The shift key (the grid column)
|
|
66
|
+
* @property state - The audit state (committed / proposed / rejected)
|
|
67
|
+
*/
|
|
68
|
+
export declare const BoardAssignmentType: StructType<{
|
|
69
|
+
/** Stable assignment identity — referenced by drag-grammar cell refs */
|
|
70
|
+
readonly key: StringType;
|
|
71
|
+
/** The person key (joined to `people` for the chip face) */
|
|
72
|
+
readonly person: StringType;
|
|
73
|
+
/** The area key (the grid row) */
|
|
74
|
+
readonly area: StringType;
|
|
75
|
+
/** The shift key (the grid column) */
|
|
76
|
+
readonly shift: StringType;
|
|
77
|
+
/** The audit state (committed / proposed / rejected) */
|
|
78
|
+
readonly state: VariantType<{
|
|
79
|
+
readonly committed: NullType;
|
|
80
|
+
readonly proposed: VariantType<{
|
|
81
|
+
readonly added: NullType;
|
|
82
|
+
readonly model: NullType;
|
|
83
|
+
readonly removed: NullType;
|
|
84
|
+
}>;
|
|
85
|
+
readonly rejected: NullType;
|
|
86
|
+
}>;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Type representing resolved assignments.
|
|
90
|
+
*/
|
|
91
|
+
export type BoardAssignmentType = typeof BoardAssignmentType;
|
|
92
|
+
/**
|
|
93
|
+
* A resolved coverage requirement for one (area, shift) cell.
|
|
94
|
+
*
|
|
95
|
+
* @property area - The area key
|
|
96
|
+
* @property shift - The shift key
|
|
97
|
+
* @property required - Required headcount for the cell
|
|
98
|
+
*/
|
|
99
|
+
export declare const BoardRequirementType: StructType<{
|
|
100
|
+
/** The area key */
|
|
101
|
+
readonly area: StringType;
|
|
102
|
+
/** The shift key */
|
|
103
|
+
readonly shift: StringType;
|
|
104
|
+
/** Required headcount for the cell */
|
|
105
|
+
readonly required: IntegerType;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Type representing resolved coverage requirements.
|
|
109
|
+
*/
|
|
110
|
+
export type BoardRequirementType = typeof BoardRequirementType;
|
|
111
|
+
/**
|
|
112
|
+
* East StructType for the Board component.
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
* Flat resolved tables — the renderer groups assignments into cells by
|
|
116
|
+
* `area × shift` and joins each to `people` by person key for the chip face.
|
|
117
|
+
* Assignment states reuse the Planner event-state grammar
|
|
118
|
+
* ({@link PlannerStateType}); the `model` flavour renders as the dashed
|
|
119
|
+
* ghost with the acceptance affordance. The component renders no built-in
|
|
120
|
+
* user-facing copy: every string it shows arrives as data or a prop, and its
|
|
121
|
+
* own chrome is numerals, glyphs and tones.
|
|
122
|
+
*
|
|
123
|
+
* @property id - DnD target identity
|
|
124
|
+
* @property sources - Library ids accepted for `add` drags
|
|
125
|
+
* @property mode - `published` (committed-only, immutable) or `edit`
|
|
126
|
+
* @property areaHeader - Optional frozen area column header (none = blank)
|
|
127
|
+
* @property areaWidth - Optional CSS width for the frozen area column
|
|
128
|
+
* @property areas - The grid rows
|
|
129
|
+
* @property shifts - The grid columns (this day's shift types, in order)
|
|
130
|
+
* @property people - The chip directory (faces), joined by person key
|
|
131
|
+
* @property assignments - The person chips (grouped into cells by area × shift)
|
|
132
|
+
* @property requirements - Optional per-cell coverage (none = no coverage chrome)
|
|
133
|
+
* @property density - Optional density
|
|
134
|
+
* @property maxVisible - Optional per-cell chip cap before the `+N` overflow
|
|
135
|
+
* @property summary - Optional status-strip text (open / proposed counts)
|
|
136
|
+
* @property canAssign - Optional assignability predicate `(person, area, shift) => Boolean`
|
|
137
|
+
* @property onDrag - Drag funnel — add / move / remove events
|
|
138
|
+
* @property onSelect - Assignment / cell click callback
|
|
139
|
+
* @property onAccept - Ghost-assignment acceptance callback
|
|
140
|
+
* @property onAddAt - Open-slot / empty-cell click callback (edit mode)
|
|
141
|
+
*/
|
|
142
|
+
export declare const BoardRootType: StructType<{
|
|
143
|
+
/** DnD target identity */
|
|
144
|
+
readonly id: StringType;
|
|
145
|
+
/** Library ids accepted for `add` drags */
|
|
146
|
+
readonly sources: ArrayType<StringType>;
|
|
147
|
+
/** `published` (committed-only, immutable) or `edit` */
|
|
148
|
+
readonly mode: VariantType<{
|
|
149
|
+
/** Committed-only, pointer-immutable */
|
|
150
|
+
readonly published: NullType;
|
|
151
|
+
/** Operator + model proposals are interactive */
|
|
152
|
+
readonly edit: NullType;
|
|
153
|
+
}>;
|
|
154
|
+
/** Optional frozen area column header (none = blank) */
|
|
155
|
+
readonly areaHeader: OptionType<StringType>;
|
|
156
|
+
/** Optional CSS width for the frozen area column (none = the Planner-consistent 150px) */
|
|
157
|
+
readonly areaWidth: OptionType<StringType>;
|
|
158
|
+
/** The grid rows */
|
|
159
|
+
readonly areas: ArrayType<StructType<{
|
|
160
|
+
/** Entity identity — the key assignments reference */
|
|
161
|
+
readonly key: StringType;
|
|
162
|
+
/** Display name */
|
|
163
|
+
readonly label: StringType;
|
|
164
|
+
/** Optional muted second line (e.g. wing, time window, role) */
|
|
165
|
+
readonly sublabel: OptionType<StringType>;
|
|
166
|
+
}>>;
|
|
167
|
+
/** The grid columns (this day's shift types, in order) */
|
|
168
|
+
readonly shifts: ArrayType<StructType<{
|
|
169
|
+
/** Entity identity — the key assignments reference */
|
|
170
|
+
readonly key: StringType;
|
|
171
|
+
/** Display name */
|
|
172
|
+
readonly label: StringType;
|
|
173
|
+
/** Optional muted second line (e.g. wing, time window, role) */
|
|
174
|
+
readonly sublabel: OptionType<StringType>;
|
|
175
|
+
}>>;
|
|
176
|
+
/** The chip directory (faces), joined by person key */
|
|
177
|
+
readonly people: ArrayType<StructType<{
|
|
178
|
+
/** Entity identity — the key assignments reference */
|
|
179
|
+
readonly key: StringType;
|
|
180
|
+
/** Display name */
|
|
181
|
+
readonly label: StringType;
|
|
182
|
+
/** Optional muted second line (e.g. wing, time window, role) */
|
|
183
|
+
readonly sublabel: OptionType<StringType>;
|
|
184
|
+
}>>;
|
|
185
|
+
/** The person chips (grouped into cells by area × shift) */
|
|
186
|
+
readonly assignments: ArrayType<StructType<{
|
|
187
|
+
/** Stable assignment identity — referenced by drag-grammar cell refs */
|
|
188
|
+
readonly key: StringType;
|
|
189
|
+
/** The person key (joined to `people` for the chip face) */
|
|
190
|
+
readonly person: StringType;
|
|
191
|
+
/** The area key (the grid row) */
|
|
192
|
+
readonly area: StringType;
|
|
193
|
+
/** The shift key (the grid column) */
|
|
194
|
+
readonly shift: StringType;
|
|
195
|
+
/** The audit state (committed / proposed / rejected) */
|
|
196
|
+
readonly state: VariantType<{
|
|
197
|
+
readonly committed: NullType;
|
|
198
|
+
readonly proposed: VariantType<{
|
|
199
|
+
readonly added: NullType;
|
|
200
|
+
readonly model: NullType;
|
|
201
|
+
readonly removed: NullType;
|
|
202
|
+
}>;
|
|
203
|
+
readonly rejected: NullType;
|
|
204
|
+
}>;
|
|
205
|
+
}>>;
|
|
206
|
+
/** Optional per-cell coverage (none = no coverage chrome) */
|
|
207
|
+
readonly requirements: OptionType<ArrayType<StructType<{
|
|
208
|
+
/** The area key */
|
|
209
|
+
readonly area: StringType;
|
|
210
|
+
/** The shift key */
|
|
211
|
+
readonly shift: StringType;
|
|
212
|
+
/** Required headcount for the cell */
|
|
213
|
+
readonly required: IntegerType;
|
|
214
|
+
}>>>;
|
|
215
|
+
/** Optional density */
|
|
216
|
+
readonly density: OptionType<VariantType<{
|
|
217
|
+
readonly comfortable: NullType;
|
|
218
|
+
readonly compact: NullType;
|
|
219
|
+
readonly condensed: NullType;
|
|
220
|
+
}>>;
|
|
221
|
+
/** Optional per-cell chip cap before the `+N` overflow */
|
|
222
|
+
readonly maxVisible: OptionType<IntegerType>;
|
|
223
|
+
/** Optional status-strip text (open / proposed counts) */
|
|
224
|
+
readonly summary: OptionType<StringType>;
|
|
225
|
+
/** Optional assignability predicate `(person, area, shift) => Boolean` — a
|
|
226
|
+
* `false` verdict renders the invalid-drop treatment and vetoes the drop */
|
|
227
|
+
readonly canAssign: OptionType<FunctionType<[StringType, StringType, StringType], BooleanType>>;
|
|
228
|
+
/** Drag funnel — add / move / remove events */
|
|
229
|
+
readonly onDrag: OptionType<FunctionType<[VariantType<{
|
|
230
|
+
readonly add: StructType<{
|
|
231
|
+
readonly from: StructType<{
|
|
232
|
+
readonly library: StringType;
|
|
233
|
+
readonly key: StringType;
|
|
234
|
+
}>;
|
|
235
|
+
readonly into: StructType<{
|
|
236
|
+
readonly surface: StringType;
|
|
237
|
+
readonly row: StringType;
|
|
238
|
+
readonly slot: StringType;
|
|
239
|
+
readonly event: OptionType<StringType>;
|
|
240
|
+
}>;
|
|
241
|
+
readonly duplicate: BooleanType;
|
|
242
|
+
}>;
|
|
243
|
+
readonly move: StructType<{
|
|
244
|
+
readonly from: StructType<{
|
|
245
|
+
readonly surface: StringType;
|
|
246
|
+
readonly row: StringType;
|
|
247
|
+
readonly slot: StringType;
|
|
248
|
+
readonly event: OptionType<StringType>;
|
|
249
|
+
}>;
|
|
250
|
+
readonly to: StructType<{
|
|
251
|
+
readonly surface: StringType;
|
|
252
|
+
readonly row: StringType;
|
|
253
|
+
readonly slot: StringType;
|
|
254
|
+
readonly event: OptionType<StringType>;
|
|
255
|
+
}>;
|
|
256
|
+
}>;
|
|
257
|
+
readonly remove: StructType<{
|
|
258
|
+
readonly from: StructType<{
|
|
259
|
+
readonly surface: StringType;
|
|
260
|
+
readonly row: StringType;
|
|
261
|
+
readonly slot: StringType;
|
|
262
|
+
readonly event: OptionType<StringType>;
|
|
263
|
+
}>;
|
|
264
|
+
readonly to: VariantType<{
|
|
265
|
+
readonly trash: NullType;
|
|
266
|
+
readonly source: NullType;
|
|
267
|
+
}>;
|
|
268
|
+
}>;
|
|
269
|
+
readonly resize: StructType<{
|
|
270
|
+
readonly event: StructType<{
|
|
271
|
+
readonly surface: StringType;
|
|
272
|
+
readonly row: StringType;
|
|
273
|
+
readonly slot: StringType;
|
|
274
|
+
readonly event: OptionType<StringType>;
|
|
275
|
+
}>;
|
|
276
|
+
readonly edge: VariantType<{
|
|
277
|
+
readonly start: NullType;
|
|
278
|
+
readonly end: NullType;
|
|
279
|
+
}>;
|
|
280
|
+
}>;
|
|
281
|
+
}>], NullType>>;
|
|
282
|
+
/** Assignment / cell click callback */
|
|
283
|
+
readonly onSelect: OptionType<FunctionType<[StructType<{
|
|
284
|
+
readonly surface: StringType;
|
|
285
|
+
readonly row: StringType;
|
|
286
|
+
readonly slot: StringType;
|
|
287
|
+
readonly event: OptionType<StringType>;
|
|
288
|
+
}>], NullType>>;
|
|
289
|
+
/** Ghost-assignment acceptance callback */
|
|
290
|
+
readonly onAccept: OptionType<FunctionType<[StructType<{
|
|
291
|
+
readonly surface: StringType;
|
|
292
|
+
readonly row: StringType;
|
|
293
|
+
readonly slot: StringType;
|
|
294
|
+
readonly event: OptionType<StringType>;
|
|
295
|
+
}>], NullType>>;
|
|
296
|
+
/** Open-slot / empty-cell click callback (edit mode) */
|
|
297
|
+
readonly onAddAt: OptionType<FunctionType<[StructType<{
|
|
298
|
+
readonly surface: StringType;
|
|
299
|
+
readonly row: StringType;
|
|
300
|
+
readonly slot: StringType;
|
|
301
|
+
readonly event: OptionType<StringType>;
|
|
302
|
+
}>], NullType>>;
|
|
303
|
+
}>;
|
|
304
|
+
/**
|
|
305
|
+
* Type representing the Board component.
|
|
306
|
+
*/
|
|
307
|
+
export type BoardRootType = typeof BoardRootType;
|
|
308
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/collections/board/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;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