@elaraai/east-ui 1.0.68 → 1.0.69

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 (306) hide show
  1. package/README.md +2 -2
  2. package/dist/src/charts/chart/index.d.ts +39 -4
  3. package/dist/src/charts/chart/index.d.ts.map +1 -1
  4. package/dist/src/charts/chart/index.js +3 -3
  5. package/dist/src/charts/chart/index.js.map +1 -1
  6. package/dist/src/charts/spec/index.d.ts +61 -3
  7. package/dist/src/charts/spec/index.d.ts.map +1 -1
  8. package/dist/src/charts/spec/types.d.ts +1 -1
  9. package/dist/src/charts/spec/types.js +1 -1
  10. package/dist/src/collections/blend/index.d.ts +1 -1
  11. package/dist/src/collections/blend/index.d.ts.map +1 -1
  12. package/dist/src/collections/blend/index.js +1 -1
  13. package/dist/src/collections/blend/index.js.map +1 -1
  14. package/dist/src/collections/blend/types.js +1 -1
  15. package/dist/src/collections/blend/types.js.map +1 -1
  16. package/dist/src/collections/board/index.d.ts +4 -4
  17. package/dist/src/collections/board/index.d.ts.map +1 -1
  18. package/dist/src/collections/board/index.js +1 -1
  19. package/dist/src/collections/board/index.js.map +1 -1
  20. package/dist/src/collections/board/types.js +1 -1
  21. package/dist/src/collections/board/types.js.map +1 -1
  22. package/dist/src/collections/calendar/index.d.ts +1 -1
  23. package/dist/src/collections/calendar/index.d.ts.map +1 -1
  24. package/dist/src/collections/deck/index.d.ts +58 -0
  25. package/dist/src/collections/deck/index.d.ts.map +1 -1
  26. package/dist/src/collections/index.d.ts +1 -2
  27. package/dist/src/collections/index.d.ts.map +1 -1
  28. package/dist/src/collections/index.js +1 -2
  29. package/dist/src/collections/index.js.map +1 -1
  30. package/dist/src/collections/library/index.d.ts +29 -0
  31. package/dist/src/collections/library/index.d.ts.map +1 -1
  32. package/dist/src/collections/library/types.d.ts +29 -0
  33. package/dist/src/collections/library/types.d.ts.map +1 -1
  34. package/dist/src/collections/matrix/index.d.ts +1 -1
  35. package/dist/src/collections/matrix/index.d.ts.map +1 -1
  36. package/dist/src/collections/plan/assemble.d.ts +3732 -0
  37. package/dist/src/collections/plan/assemble.d.ts.map +1 -0
  38. package/dist/src/collections/plan/assemble.js +187 -0
  39. package/dist/src/collections/plan/assemble.js.map +1 -0
  40. package/dist/src/collections/plan/builders.d.ts +612 -0
  41. package/dist/src/collections/plan/builders.d.ts.map +1 -0
  42. package/dist/src/collections/plan/builders.js +543 -0
  43. package/dist/src/collections/plan/builders.js.map +1 -0
  44. package/dist/src/collections/plan/data-forms.d.ts +332 -0
  45. package/dist/src/collections/plan/data-forms.d.ts.map +1 -0
  46. package/dist/src/collections/plan/data-forms.js +212 -0
  47. package/dist/src/collections/plan/data-forms.js.map +1 -0
  48. package/dist/src/collections/plan/factories.d.ts +338 -0
  49. package/dist/src/collections/plan/factories.d.ts.map +1 -0
  50. package/dist/src/collections/plan/factories.js +414 -0
  51. package/dist/src/collections/plan/factories.js.map +1 -0
  52. package/dist/src/collections/plan/index.d.ts +271 -0
  53. package/dist/src/collections/plan/index.d.ts.map +1 -0
  54. package/dist/src/collections/plan/index.js +162 -0
  55. package/dist/src/collections/plan/index.js.map +1 -0
  56. package/dist/src/collections/plan/ir.d.ts +3496 -0
  57. package/dist/src/collections/plan/ir.d.ts.map +1 -0
  58. package/dist/src/collections/plan/ir.js +83 -0
  59. package/dist/src/collections/plan/ir.js.map +1 -0
  60. package/dist/src/collections/plan/pick.d.ts +115 -0
  61. package/dist/src/collections/plan/pick.d.ts.map +1 -0
  62. package/dist/src/collections/plan/pick.js +193 -0
  63. package/dist/src/collections/plan/pick.js.map +1 -0
  64. package/dist/src/collections/plan/root.d.ts +210 -0
  65. package/dist/src/collections/plan/root.d.ts.map +1 -0
  66. package/dist/src/collections/plan/root.js +146 -0
  67. package/dist/src/collections/plan/root.js.map +1 -0
  68. package/dist/src/collections/plan/series.d.ts +11890 -0
  69. package/dist/src/collections/plan/series.d.ts.map +1 -0
  70. package/dist/src/collections/plan/series.js +412 -0
  71. package/dist/src/collections/plan/series.js.map +1 -0
  72. package/dist/src/collections/plan/types.d.ts +9291 -0
  73. package/dist/src/collections/plan/types.d.ts.map +1 -0
  74. package/dist/src/collections/plan/types.js +940 -0
  75. package/dist/src/collections/plan/types.js.map +1 -0
  76. package/dist/src/collections/roster/index.d.ts +4 -4
  77. package/dist/src/collections/roster/index.d.ts.map +1 -1
  78. package/dist/src/collections/roster/index.js +1 -1
  79. package/dist/src/collections/roster/index.js.map +1 -1
  80. package/dist/src/collections/roster/types.d.ts +1 -1
  81. package/dist/src/collections/roster/types.d.ts.map +1 -1
  82. package/dist/src/collections/roster/types.js +4 -3
  83. package/dist/src/collections/roster/types.js.map +1 -1
  84. package/dist/src/collections/table/index.d.ts +70 -2
  85. package/dist/src/collections/table/index.d.ts.map +1 -1
  86. package/dist/src/collections/table/index.js +55 -11
  87. package/dist/src/collections/table/index.js.map +1 -1
  88. package/dist/src/collections/table/types.d.ts +1 -1
  89. package/dist/src/collections/table/types.d.ts.map +1 -1
  90. package/dist/src/component.d.ts +3898 -1339
  91. package/dist/src/component.d.ts.map +1 -1
  92. package/dist/src/component.js +83 -146
  93. package/dist/src/component.js.map +1 -1
  94. package/dist/src/container/card/types.d.ts +1 -1
  95. package/dist/src/container/card/types.d.ts.map +1 -1
  96. package/dist/src/contracts/approval.d.ts +117 -0
  97. package/dist/src/contracts/approval.d.ts.map +1 -0
  98. package/dist/src/contracts/approval.js +105 -0
  99. package/dist/src/contracts/approval.js.map +1 -0
  100. package/dist/src/contracts/drag.d.ts +3 -3
  101. package/dist/src/contracts/drag.d.ts.map +1 -1
  102. package/dist/src/contracts/drag.js +23 -10
  103. package/dist/src/contracts/drag.js.map +1 -1
  104. package/dist/src/contracts/index.d.ts +4 -1
  105. package/dist/src/contracts/index.d.ts.map +1 -1
  106. package/dist/src/contracts/index.js +4 -1
  107. package/dist/src/contracts/index.js.map +1 -1
  108. package/dist/src/contracts/pick.d.ts +705 -0
  109. package/dist/src/contracts/pick.d.ts.map +1 -0
  110. package/dist/src/contracts/pick.js +360 -0
  111. package/dist/src/contracts/pick.js.map +1 -0
  112. package/dist/src/contracts/review.d.ts +7 -99
  113. package/dist/src/contracts/review.d.ts.map +1 -1
  114. package/dist/src/contracts/review.js +11 -85
  115. package/dist/src/contracts/review.js.map +1 -1
  116. package/dist/src/contracts/slice-affordances.d.ts +13 -4
  117. package/dist/src/contracts/slice-affordances.d.ts.map +1 -1
  118. package/dist/src/contracts/slice-affordances.js +13 -3
  119. package/dist/src/contracts/slice-affordances.js.map +1 -1
  120. package/dist/src/contracts/source.d.ts +432 -0
  121. package/dist/src/contracts/source.d.ts.map +1 -0
  122. package/dist/src/contracts/source.js +505 -0
  123. package/dist/src/contracts/source.js.map +1 -0
  124. package/dist/src/contracts/states.d.ts +130 -0
  125. package/dist/src/contracts/states.d.ts.map +1 -1
  126. package/dist/src/contracts/states.js +122 -0
  127. package/dist/src/contracts/states.js.map +1 -1
  128. package/dist/src/contracts/time.d.ts +76 -0
  129. package/dist/src/contracts/time.d.ts.map +1 -0
  130. package/dist/src/contracts/time.js +78 -0
  131. package/dist/src/contracts/time.js.map +1 -0
  132. package/dist/src/display/trace/types.d.ts +1 -1
  133. package/dist/src/display/trace/types.d.ts.map +1 -1
  134. package/dist/src/index.d.ts +10 -2
  135. package/dist/src/index.d.ts.map +1 -1
  136. package/dist/src/index.js +22 -2
  137. package/dist/src/index.js.map +1 -1
  138. package/dist/src/internal.d.ts +5 -3
  139. package/dist/src/internal.d.ts.map +1 -1
  140. package/dist/src/internal.js +4 -3
  141. package/dist/src/internal.js.map +1 -1
  142. package/dist/src/layout/dock/index.d.ts +1 -1
  143. package/dist/src/layout/dock/index.js +1 -1
  144. package/dist/src/layout/index.d.ts +0 -1
  145. package/dist/src/layout/index.d.ts.map +1 -1
  146. package/dist/src/layout/index.js +0 -1
  147. package/dist/src/layout/index.js.map +1 -1
  148. package/dist/src/overlays/drawer/types.d.ts +1 -1
  149. package/dist/src/overlays/drawer/types.d.ts.map +1 -1
  150. package/dist/src/pick/index.d.ts +443 -0
  151. package/dist/src/pick/index.d.ts.map +1 -0
  152. package/dist/src/pick/index.js +64 -0
  153. package/dist/src/pick/index.js.map +1 -0
  154. package/dist/src/pick/panel/index.d.ts +64 -0
  155. package/dist/src/pick/panel/index.d.ts.map +1 -0
  156. package/dist/src/pick/panel/index.js +61 -0
  157. package/dist/src/pick/panel/index.js.map +1 -0
  158. package/dist/src/platform/slice/index.d.ts +291 -0
  159. package/dist/src/platform/slice/index.d.ts.map +1 -1
  160. package/dist/src/platform/slice/index.js +16 -0
  161. package/dist/src/platform/slice/index.js.map +1 -1
  162. package/dist/src/runtime/collections/deck.d.ts +29 -0
  163. package/dist/src/runtime/collections/deck.d.ts.map +1 -1
  164. package/dist/src/runtime/collections/index.d.ts +1 -2
  165. package/dist/src/runtime/collections/index.d.ts.map +1 -1
  166. package/dist/src/runtime/collections/index.js +1 -2
  167. package/dist/src/runtime/collections/index.js.map +1 -1
  168. package/dist/src/runtime/collections/library.d.ts +1 -1
  169. package/dist/src/runtime/collections/library.js +1 -1
  170. package/dist/src/runtime/collections/plan.d.ts +98 -0
  171. package/dist/src/runtime/collections/plan.d.ts.map +1 -0
  172. package/dist/src/runtime/collections/plan.js +98 -0
  173. package/dist/src/runtime/collections/plan.js.map +1 -0
  174. package/dist/src/runtime/collections/schematic.d.ts +1 -1
  175. package/dist/src/runtime/collections/schematic.js +1 -1
  176. package/dist/src/runtime/collections/table.d.ts +9 -1
  177. package/dist/src/runtime/collections/table.d.ts.map +1 -1
  178. package/dist/src/runtime/collections/table.js +1 -7
  179. package/dist/src/runtime/collections/table.js.map +1 -1
  180. package/dist/src/runtime/layout/dock.d.ts +2 -2
  181. package/dist/src/runtime/layout/dock.js +2 -2
  182. package/dist/src/runtime/layout/index.d.ts +0 -1
  183. package/dist/src/runtime/layout/index.d.ts.map +1 -1
  184. package/dist/src/runtime/layout/index.js +0 -1
  185. package/dist/src/runtime/layout/index.js.map +1 -1
  186. package/dist/src/shared/plot-gutter.d.ts +6 -23
  187. package/dist/src/shared/plot-gutter.d.ts.map +1 -1
  188. package/dist/src/shared/plot-gutter.js +6 -19
  189. package/dist/src/shared/plot-gutter.js.map +1 -1
  190. package/dist/src/shared/reify.d.ts +47 -4
  191. package/dist/src/shared/reify.d.ts.map +1 -1
  192. package/dist/src/shared/reify.js +62 -4
  193. package/dist/src/shared/reify.js.map +1 -1
  194. package/dist/src/slice/breakdown/index.d.ts +27 -0
  195. package/dist/src/slice/breakdown/index.d.ts.map +1 -1
  196. package/dist/src/slice/breakdown/types.d.ts +27 -0
  197. package/dist/src/slice/breakdown/types.d.ts.map +1 -1
  198. package/dist/src/slice/cohort/index.d.ts +54 -0
  199. package/dist/src/slice/cohort/index.d.ts.map +1 -1
  200. package/dist/src/slice/cohort/types.d.ts +27 -0
  201. package/dist/src/slice/cohort/types.d.ts.map +1 -1
  202. package/dist/src/slice/filter/index.d.ts +27 -0
  203. package/dist/src/slice/filter/index.d.ts.map +1 -1
  204. package/dist/src/slice/filter/types.d.ts +27 -0
  205. package/dist/src/slice/filter/types.d.ts.map +1 -1
  206. package/dist/src/slice/index.d.ts +405 -0
  207. package/dist/src/slice/index.d.ts.map +1 -1
  208. package/dist/src/slice/legend/index.d.ts +27 -0
  209. package/dist/src/slice/legend/index.d.ts.map +1 -1
  210. package/dist/src/slice/legend/types.d.ts +27 -0
  211. package/dist/src/slice/legend/types.d.ts.map +1 -1
  212. package/dist/src/slice/range/index.d.ts +60 -18
  213. package/dist/src/slice/range/index.d.ts.map +1 -1
  214. package/dist/src/slice/range/index.js +9 -1
  215. package/dist/src/slice/range/index.js.map +1 -1
  216. package/dist/src/slice/range/types.d.ts +63 -22
  217. package/dist/src/slice/range/types.d.ts.map +1 -1
  218. package/dist/src/slice/range/types.js +12 -5
  219. package/dist/src/slice/range/types.js.map +1 -1
  220. package/dist/src/slice/search/index.d.ts +27 -0
  221. package/dist/src/slice/search/index.d.ts.map +1 -1
  222. package/dist/src/slice/search/types.d.ts +27 -0
  223. package/dist/src/slice/search/types.d.ts.map +1 -1
  224. package/dist/src/slice/summary/index.d.ts +27 -0
  225. package/dist/src/slice/summary/index.d.ts.map +1 -1
  226. package/dist/src/slice/summary/types.d.ts +27 -0
  227. package/dist/src/slice/summary/types.d.ts.map +1 -1
  228. package/dist/src/style/content.d.ts +4 -6
  229. package/dist/src/style/content.d.ts.map +1 -1
  230. package/dist/src/style/content.js +4 -6
  231. package/dist/src/style/content.js.map +1 -1
  232. package/dist/src/style/scheme.js +1 -1
  233. package/dist/src/style/scheme.js.map +1 -1
  234. package/dist/test/collections/index.d.ts +2 -2
  235. package/dist/test/collections/index.d.ts.map +1 -1
  236. package/dist/test/collections/index.js +2 -2
  237. package/dist/test/collections/index.js.map +1 -1
  238. package/dist/test/collections/paged-source.examples.d.ts +9 -0
  239. package/dist/test/collections/paged-source.examples.d.ts.map +1 -0
  240. package/dist/test/collections/paged-source.examples.js +136 -0
  241. package/dist/test/collections/paged-source.examples.js.map +1 -0
  242. package/dist/test/collections/plan.examples.d.ts +125 -0
  243. package/dist/test/collections/plan.examples.d.ts.map +1 -0
  244. package/dist/test/collections/plan.examples.js +2939 -0
  245. package/dist/test/collections/plan.examples.js.map +1 -0
  246. package/dist/test/contracts/pick.examples.d.ts +6 -0
  247. package/dist/test/contracts/pick.examples.d.ts.map +1 -0
  248. package/dist/test/contracts/pick.examples.js +89 -0
  249. package/dist/test/contracts/pick.examples.js.map +1 -0
  250. package/dist/test/layout/dock.examples.d.ts +4 -4
  251. package/dist/test/layout/dock.examples.d.ts.map +1 -1
  252. package/dist/test/layout/dock.examples.js +34 -16
  253. package/dist/test/layout/dock.examples.js.map +1 -1
  254. package/dist/test/slice/slice.examples.d.ts +2 -1
  255. package/dist/test/slice/slice.examples.d.ts.map +1 -1
  256. package/dist/test/slice/slice.examples.js +67 -9
  257. package/dist/test/slice/slice.examples.js.map +1 -1
  258. package/package.json +3 -3
  259. package/dist/src/collections/gantt/index.d.ts +0 -377
  260. package/dist/src/collections/gantt/index.d.ts.map +0 -1
  261. package/dist/src/collections/gantt/index.js +0 -896
  262. package/dist/src/collections/gantt/index.js.map +0 -1
  263. package/dist/src/collections/gantt/types.d.ts +0 -353
  264. package/dist/src/collections/gantt/types.d.ts.map +0 -1
  265. package/dist/src/collections/gantt/types.js +0 -207
  266. package/dist/src/collections/gantt/types.js.map +0 -1
  267. package/dist/src/collections/planner/index.d.ts +0 -624
  268. package/dist/src/collections/planner/index.d.ts.map +0 -1
  269. package/dist/src/collections/planner/index.js +0 -941
  270. package/dist/src/collections/planner/index.js.map +0 -1
  271. package/dist/src/collections/planner/types.d.ts +0 -615
  272. package/dist/src/collections/planner/types.d.ts.map +0 -1
  273. package/dist/src/collections/planner/types.js +0 -423
  274. package/dist/src/collections/planner/types.js.map +0 -1
  275. package/dist/src/layout/aligned-stack/index.d.ts +0 -101
  276. package/dist/src/layout/aligned-stack/index.d.ts.map +0 -1
  277. package/dist/src/layout/aligned-stack/index.js +0 -105
  278. package/dist/src/layout/aligned-stack/index.js.map +0 -1
  279. package/dist/src/layout/aligned-stack/types.d.ts +0 -50
  280. package/dist/src/layout/aligned-stack/types.d.ts.map +0 -1
  281. package/dist/src/layout/aligned-stack/types.js +0 -24
  282. package/dist/src/layout/aligned-stack/types.js.map +0 -1
  283. package/dist/src/runtime/collections/gantt.d.ts +0 -67
  284. package/dist/src/runtime/collections/gantt.d.ts.map +0 -1
  285. package/dist/src/runtime/collections/gantt.js +0 -58
  286. package/dist/src/runtime/collections/gantt.js.map +0 -1
  287. package/dist/src/runtime/collections/planner.d.ts +0 -80
  288. package/dist/src/runtime/collections/planner.d.ts.map +0 -1
  289. package/dist/src/runtime/collections/planner.js +0 -76
  290. package/dist/src/runtime/collections/planner.js.map +0 -1
  291. package/dist/src/runtime/layout/aligned-stack.d.ts +0 -38
  292. package/dist/src/runtime/layout/aligned-stack.d.ts.map +0 -1
  293. package/dist/src/runtime/layout/aligned-stack.js +0 -36
  294. package/dist/src/runtime/layout/aligned-stack.js.map +0 -1
  295. package/dist/test/collections/gantt.examples.d.ts +0 -33
  296. package/dist/test/collections/gantt.examples.d.ts.map +0 -1
  297. package/dist/test/collections/gantt.examples.js +0 -359
  298. package/dist/test/collections/gantt.examples.js.map +0 -1
  299. package/dist/test/collections/planner.examples.d.ts +0 -47
  300. package/dist/test/collections/planner.examples.d.ts.map +0 -1
  301. package/dist/test/collections/planner.examples.js +0 -546
  302. package/dist/test/collections/planner.examples.js.map +0 -1
  303. package/dist/test/layout/aligned-stack.examples.d.ts +0 -25
  304. package/dist/test/layout/aligned-stack.examples.d.ts.map +0 -1
  305. package/dist/test/layout/aligned-stack.examples.js +0 -294
  306. package/dist/test/layout/aligned-stack.examples.js.map +0 -1
@@ -0,0 +1,940 @@
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
+ * `Plan` IR — the UIComponent-free types. A Plan is an axis-aligned
7
+ * composite canvas: ONE shared axis — `{ time | number | ordinal }`, declared
8
+ * once by the root and carried by every element instant (#631) — divided into
9
+ * `n` buckets (a window ÷ a resolution or step, or an ordinal list) over
10
+ * heterogeneous rows — Gantt-style state-runs, Planner allocation lanes,
11
+ * Chart measures, Matrix heat cells, Table numerals, Roster chips and event
12
+ * marks — sliced and reviewed as one surface.
13
+ *
14
+ * Rows are **flat and KEYED** in the IR (`DictType(StringType, PlanRowType)`)
15
+ * with `parent: Option<String>` keys — no nested `RecursiveType`. A row has
16
+ * identity, not position: its `key` is what `parent` references, what `links`
17
+ * address, what drag refs name and what focus / collapse / selection state is
18
+ * keyed on, so the collection is a dictionary and two rows under one key are
19
+ * unconstructable (#568). Dictionaries decode to a `SortedMap`, so the canvas
20
+ * order is canonical KEY order — the order a paged Dict source's windows
21
+ * already arrive in. The factories accept nested `rows: [...]` input and
22
+ * flatten; parent aggregates (rollup bands, per-bucket heat means, table
23
+ * subtotals) are derived renderer-side from the tree the `parent` keys encode.
24
+ *
25
+ * This file holds only plain data — no UIComponent slots — so `component.ts`
26
+ * can import it without a circular dependency. Since the data-interface
27
+ * redesign (`Plan Data Interface.md` §3.2/§3.3) that includes the WHOLE row
28
+ * vocabulary: elements (runs, bucket events, chips, event marks, decisions),
29
+ * the row kind, the row itself and templates carry **no
30
+ * `UIComponentType` and no per-element UI embeds** — rich surfaces resolve
31
+ * through the ROOT's `popover` / `hover` / `expandRender` functions over
32
+ * {@link PlanElementRefType} / row refs, so a row is
33
+ * a storable, pageable dataset element. Only the root, review and the
34
+ * resolver signatures stay UIComponent-coupled (`./ir.ts`, mirrored inline
35
+ * with the recursion `node` in the `Plan` arm of `component.ts` — every
36
+ * factory-built value is subtype-checked against the arm when the `Plan`
37
+ * variant is constructed, so drift fails the specs).
38
+ *
39
+ * @packageDocumentation
40
+ */
41
+ import { ArrayType, BooleanType, DateTimeType, DictType, FloatType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, } from "@elaraai/east";
42
+ import { StatusValueType } from "../../feedback/status/types.js";
43
+ import { IconType } from "../../display/icon/types.js";
44
+ import { ColorSchemeType } from "../../style/scheme.js";
45
+ import { EventStateType } from "../../contracts/states.js";
46
+ import { ApprovalStateType } from "../../contracts/approval.js";
47
+ import { TickFormatType } from "../../format/types.js";
48
+ import { TimeResolutionType } from "../../contracts/time.js";
49
+ import { ValueFormatType } from "../../contracts/format.js";
50
+ import { PagedSourceType, RowSourceType } from "../../contracts/source.js";
51
+ import { ChartDomainType, ChartTickValuesType } from "../../charts/spec/index.js";
52
+ import { MatrixFillType } from "../matrix/types.js";
53
+ import { TableAggregateType } from "../table/types.js";
54
+ import { DensityType } from "../../style/interaction.js";
55
+ // ============================================================================
56
+ // Instants + axis — the shared scale, in one of three kinds
57
+ // ============================================================================
58
+ /**
59
+ * One instant on the Plan's shared axis — `{ time | number | ordinal }`, the
60
+ * retired Planner's slot type verbatim (#631). The axis KIND rides every
61
+ * element, so a canvas is typed end to end: a run's `start` / `end`, a tile's
62
+ * `at`, a chart point's `t`, a chip's `from` / `to` and a click payload's
63
+ * `at` are all this variant, and the root's {@link PlanAxisType} declares
64
+ * which arm the canvas positions on.
65
+ *
66
+ * @remarks
67
+ * Every instant on a canvas must ride the axis's arm — a row whose instants
68
+ * ride another arm is a render-time diagnostic naming the row and the axis
69
+ * kind, never a silent misplacement (the Planner's single-axis-kind rule).
70
+ *
71
+ * The element builders take the JS-typed sugar (`Date` ⇒ `time`, `number`
72
+ * ⇒ `number`, `string` ⇒ `ordinal`) and wrap East expressions by their
73
+ * STATIC type (`DateTimeType` ⇒ `time`, `FloatType` / `IntegerType` ⇒
74
+ * `number`, `StringType` ⇒ `ordinal`), so a `DateTimeType` accessor keeps
75
+ * compiling unchanged; `Plan.at.time` / `.number` / `.ordinal` build one
76
+ * explicitly, and element RECORDS stored in data carry the variant itself.
77
+ *
78
+ * @property time - A UTC instant on a `time` axis
79
+ * @property number - A position on a `number` axis (day 1..8, a shift index, a distance)
80
+ * @property ordinal - A declared value on an `ordinal` axis (a workflow phase)
81
+ */
82
+ export const PlanInstantType = VariantType({ time: DateTimeType, number: FloatType, ordinal: StringType });
83
+ // ============================================================================
84
+ // The phantom axis kind — a TYPE-only brand (#631)
85
+ // ============================================================================
86
+ /**
87
+ * The phantom axis-kind brand — a `unique symbol` that exists only in the
88
+ * TYPES. Every builder result whose instants have a known kind is intersected
89
+ * with `{ readonly [PlanAxisKindBrand]?: K }` ({@link PlanKinded}): `Plan.at.time(d)`
90
+ * is `"time"`, `Plan.run({ start: r.start })` takes the kind of `r.start`'s
91
+ * static type ({@link PlanKindOf}), a `Plan.series.span` whose accessor
92
+ * returns such runs collects their kind, `Plan.axis.number(...)` declares
93
+ * `"number"` — and the root demands every series' kind lie WITHIN its
94
+ * axis's. A `"time"` series on a `"number"` axis is then a compile error at
95
+ * the `<Plan>` tag, before anything renders.
96
+ *
97
+ * @remarks
98
+ * Nothing changes at runtime or on the wire: the property is optional and
99
+ * never written. Kind-ERASED values — a stored `Plan.Types.Run`, an
100
+ * `Expr<PlanInstantType>`, an East-mapped element list, a `$.let`-bound axis
101
+ * or series list — carry no brand, are accepted on any axis, and remain the
102
+ * render-time `AXIS MISMATCH` diagnostic's job. Chart rows are erased too:
103
+ * a Chart layer's TS face does not expose its x type.
104
+ */
105
+ export const PlanAxisKindBrand = Symbol("PlanAxisKind");
106
+ /**
107
+ * The `time` axis — the explicit window, the bucket resolution, the
108
+ * resolution segment options, the observed/plan divider, and the tick format.
109
+ *
110
+ * @remarks
111
+ * Construct via `Plan.axis({ … })` (or `Plan.axis.time`). The window is a
112
+ * half-open calendar range `[min, max)` interpreted in UTC — a 12-week window
113
+ * at `week` resolution is exactly 12 columns. When a bound slice carries a
114
+ * datetime range / resolution, the slice state supersedes these initial
115
+ * values (the slice is the single source of truth for window + resolution);
116
+ * `axis` seeds the defaults and covers the unbound case.
117
+ *
118
+ * @property window - Explicit window `[min, max)`. `none` ⇒ the bound slice's datetime range; else fit to the data
119
+ * @property resolution - Initial bucket unit (see {@link TimeResolutionType}); the toolbar segment overrides via slice state
120
+ * @property resolutions - Resolution segment options (e.g. `[week, day]`); `[]` ⇒ no segment shown
121
+ * @property now - The observed/plan split instant. `none` ⇒ no now-line
122
+ * @property format - Tick-label pattern override; `none` ⇒ resolution defaults matching the spec ruler (week ⇒ ISO week `"W27"`, day ⇒ uppercase weekday `"MON"`)
123
+ */
124
+ export const PlanTimeAxisType = StructType({
125
+ window: OptionType(StructType({ min: DateTimeType, max: DateTimeType })),
126
+ resolution: TimeResolutionType,
127
+ resolutions: ArrayType(TimeResolutionType),
128
+ now: OptionType(DateTimeType),
129
+ format: OptionType(StringType),
130
+ });
131
+ /**
132
+ * The `number` axis — a numeric window divided by a `step` (the
133
+ * `TimeResolution` rule, numerically): `[min, max)` ÷ `step` = `n` buckets,
134
+ * bucket edges on whole multiples of `step`.
135
+ *
136
+ * @remarks
137
+ * Construct via `Plan.axis.number({ … })`. When a bound slice carries a
138
+ * `float` / `integer` range, that range is the window (the horizon brush and
139
+ * the `[` / `]` / `n` keys write it back); `window` seeds the unbound case,
140
+ * else the axis fits to the data. There is no resolution segment on a
141
+ * number axis — `step` is fixed by the declaration.
142
+ *
143
+ * @property window - Explicit half-open window `[min, max)`. `none` ⇒ the bound slice's numeric range; else fit to the data
144
+ * @property step - The bucket width (`> 0`) — `n = window ÷ step`
145
+ * @property now - The observed/plan split position. `none` ⇒ no now-line
146
+ * @property format - Tick-label format (the shared {@link ValueFormatType} — `Chart.format.*`); `none` ⇒ plain numbers
147
+ */
148
+ export const PlanNumberAxisType = StructType({
149
+ window: OptionType(StructType({ min: FloatType, max: FloatType })),
150
+ step: FloatType,
151
+ now: OptionType(FloatType),
152
+ format: OptionType(ValueFormatType),
153
+ });
154
+ /**
155
+ * The `ordinal` axis — the declared values ARE the buckets, one column each,
156
+ * in the declared order; the window is the whole list.
157
+ *
158
+ * @remarks
159
+ * Construct via `Plan.axis.ordinal({ … })`. An ordinal axis has no slice
160
+ * range arm: the horizon brush does not mount and the window keys idle — the
161
+ * list is the window. An instant naming a value outside the list positions
162
+ * nowhere (it is culled, like an instant outside a time window).
163
+ *
164
+ * @property values - The ordered labels — the bucket identities and their ruler ticks
165
+ * @property now - The observed/plan split value. `none` ⇒ no now-line
166
+ */
167
+ export const PlanOrdinalAxisType = StructType({
168
+ values: ArrayType(StringType),
169
+ now: OptionType(StringType),
170
+ });
171
+ /**
172
+ * The Plan axis declaration — ONE of the three kinds. The arm IS the
173
+ * declaration: a canvas cannot mix kinds, and every element instant on it
174
+ * must ride the same arm ({@link PlanInstantType}).
175
+ *
176
+ * @property time - A calendar axis: UTC window ÷ resolution ({@link PlanTimeAxisType})
177
+ * @property number - A numeric axis: window ÷ step ({@link PlanNumberAxisType})
178
+ * @property ordinal - A declared list of values, one bucket each ({@link PlanOrdinalAxisType})
179
+ */
180
+ export const PlanAxisType = VariantType({
181
+ time: PlanTimeAxisType,
182
+ number: PlanNumberAxisType,
183
+ ordinal: PlanOrdinalAxisType,
184
+ });
185
+ /**
186
+ * The two grains of one canvas — GROUP (heat strips) and RESOURCE (rows, the
187
+ * default).
188
+ *
189
+ * @remarks
190
+ * The grain changes rows — never the axis, the charts or the vocabulary. Set
191
+ * the initial grain via the root's `grain`; thereafter the toolbar segment
192
+ * drives it as renderer state (observe via `onGrainChange`).
193
+ *
194
+ * @property group - Every group collapsed to its summary heat strip
195
+ * @property resource - Resource rows (the default)
196
+ */
197
+ export const PlanGrainType = VariantType({ group: NullType, resource: NullType });
198
+ // ============================================================================
199
+ // Gutter — the left cell's identity vocabulary
200
+ // ============================================================================
201
+ /**
202
+ * One chart-series legend chip printed in the gutter (colour swatch + label).
203
+ *
204
+ * @property color - The swatch colour (theme token, e.g. `"teal.solid"`, or CSS colour)
205
+ * @property label - The swatch caption (e.g. `"col"`, `"trend"`)
206
+ */
207
+ export const PlanGutterSwatchType = StructType({
208
+ color: StringType,
209
+ label: StringType,
210
+ });
211
+ /**
212
+ * The gutter identity — the left cell's whole vocabulary.
213
+ *
214
+ * @remarks
215
+ * The factories flatten these fields into their input bags (`label`, `id`,
216
+ * `sub`, `value`, `meta`, `stacked`, `swatches` ride on every row factory).
217
+ *
218
+ * @property label - The row name (12.5/500; groups and names)
219
+ * @property id - `true` ⇒ the label renders as a mono row id (11.5/600 — `L1-M03`, `COVERAGE`)
220
+ * @property sub - The muted mono sub line (`"120 t"`, `"week · 1 lane"`)
221
+ * @property value - The right-aligned mono value slot (`"94.2%"`, `"82"`) — the same aggregate slot a table group header uses
222
+ * @property meta - The group meta line (`"8 rs · 82%"`)
223
+ * @property stacked - `true` ⇒ two-line layout (label over sub; row min-height 42px)
224
+ * @property swatches - Chart-series legend chips printed under the label
225
+ */
226
+ export const PlanGutterType = StructType({
227
+ label: StringType,
228
+ id: OptionType(BooleanType),
229
+ sub: OptionType(StringType),
230
+ value: OptionType(StringType),
231
+ meta: OptionType(StringType),
232
+ stacked: OptionType(BooleanType),
233
+ swatches: ArrayType(PlanGutterSwatchType),
234
+ });
235
+ // ============================================================================
236
+ // Span-row leaf data — ports, rollup, bands
237
+ // ============================================================================
238
+ /**
239
+ * A quantity in/out port glyph on a span row — cross-row relations are
240
+ * quantity through ports, never dependency arrows.
241
+ *
242
+ * @property at - The instant the quantity moves
243
+ * @property label - Optional port caption (e.g. `"−24 t"`)
244
+ */
245
+ export const PlanPortType = StructType({
246
+ at: PlanInstantType,
247
+ label: OptionType(StringType),
248
+ });
249
+ /**
250
+ * How a parent span row rolls its descendants' runs up into bands.
251
+ *
252
+ * @property union - One band per busy interval (any child busy — the default)
253
+ * @property byStatus - One thin band per status, stacked
254
+ * @property sum - Quantity series emphasis (band quantities carry the sums — feed a chart row for the full series)
255
+ */
256
+ export const PlanRollupType = VariantType({ union: NullType, byStatus: NullType, sum: NullType });
257
+ // ============================================================================
258
+ // Bucket-row leaf data — cell markers + the tile geometry vocabulary
259
+ // ============================================================================
260
+ /**
261
+ * A status marker on a bucket cell — rings the cell, paints the corner status
262
+ * icon, and surfaces `message` as a hover tooltip (the Planner marker,
263
+ * verbatim).
264
+ *
265
+ * @property at - The bucket instant the marker rings
266
+ * @property lane - The lane key within the cell (`none` in an unbucketed row)
267
+ * @property status - The semantic status — drives colour + paired icon
268
+ * @property message - The tooltip text
269
+ */
270
+ export const PlanCellMarkerType = StructType({
271
+ at: PlanInstantType,
272
+ lane: OptionType(StringType),
273
+ status: StatusValueType,
274
+ message: StringType,
275
+ });
276
+ /**
277
+ * Which axis a bucket-event tile stretches to fill its cell on. Absent ⇒ the
278
+ * tile is content-sized (intrinsic).
279
+ *
280
+ * @property horizontal - Fill the cell width
281
+ * @property vertical - Fill the cell height
282
+ * @property both - Fill both axes
283
+ */
284
+ export const PlanStretchType = VariantType({ horizontal: NullType, vertical: NullType, both: NullType });
285
+ /**
286
+ * One alignment position for a tile's content along a single axis.
287
+ *
288
+ * @property start - Align to the start (left / top)
289
+ * @property center - Centre
290
+ * @property end - Align to the end (right / bottom)
291
+ */
292
+ export const PlanContentAlignType = VariantType({ start: NullType, center: NullType, end: NullType });
293
+ /**
294
+ * Where a bucket-event tile's content sits inside the tile — a two-axis
295
+ * alignment. Both axes default to `start` (top-left) when omitted.
296
+ *
297
+ * @property horizontal - Horizontal content alignment (→ `justifyContent`)
298
+ * @property vertical - Vertical content alignment (→ `alignItems`)
299
+ */
300
+ export const PlanContentType = StructType({
301
+ horizontal: OptionType(PlanContentAlignType),
302
+ vertical: OptionType(PlanContentAlignType),
303
+ });
304
+ /**
305
+ * A bucket-event tile's optional attention animation. `pulse` honours
306
+ * `prefers-reduced-motion`.
307
+ *
308
+ * @property none - No animation (the default)
309
+ * @property pulse - A gentle opacity pulse
310
+ */
311
+ export const PlanAnimationType = VariantType({ none: NullType, pulse: NullType });
312
+ // ============================================================================
313
+ // Chart-row leaf data — first-class, data-only layers
314
+ // ============================================================================
315
+ /**
316
+ * One `{t, y}` point of a Plan chart layer — the reified form every consumed
317
+ * Chart layer builder reduces to. The x accessor's arm follows its static
318
+ * type (`DateTimeType` ⇒ `time`, numeric ⇒ `number`, `StringType` ⇒
319
+ * `ordinal`) and must match the canvas axis at render.
320
+ *
321
+ * @property t - The instant on the shared scale
322
+ * @property y - The measure value
323
+ */
324
+ export const PlanChartPointType = StructType({ t: PlanInstantType, y: FloatType });
325
+ /**
326
+ * Which y-axis a chart layer scales against. Left ticks print inside the
327
+ * gutter cell's right edge; right ticks at the plot's right edge.
328
+ *
329
+ * @property left - The left (primary) y-axis
330
+ * @property right - The right (secondary) y-axis
331
+ */
332
+ export const PlanAxisSideType = VariantType({ left: NullType, right: NullType });
333
+ /**
334
+ * A breach threshold on a chart layer — buckets/points beyond it render in
335
+ * the warn tone, and contiguous breach buckets derive the outlined breach
336
+ * rectangle at expanded density.
337
+ *
338
+ * @property above - Breach when the value exceeds this threshold
339
+ * @property below - Breach when the value falls below this threshold
340
+ */
341
+ export const PlanBreachType = VariantType({ above: FloatType, below: FloatType });
342
+ /**
343
+ * One `{t, lo, hi}` point of a band (area-range) chart layer.
344
+ *
345
+ * @property t - The instant on the shared scale
346
+ * @property lo - The lower bound
347
+ * @property hi - The upper bound
348
+ */
349
+ export const PlanChartBandPointType = StructType({ t: PlanInstantType, lo: FloatType, hi: FloatType });
350
+ /**
351
+ * A chart row's y-axis declaration — the Chart axis vocabulary
352
+ * ({@link ChartDomainType} / {@link ChartTickValuesType} /
353
+ * {@link ValueFormatType}), restricted to a value axis: only the `number`
354
+ * arms are meaningful (a Plan chart row's time axis is the shared canvas
355
+ * scale, never per-axis).
356
+ *
357
+ * @property domain - Explicit `[min, max]` extent (`none` ⇒ derived from the data)
358
+ * @property tickValues - Explicit tick positions printed at the gutter/plot edge (`none` ⇒ no ticks)
359
+ * @property format - Optional tick format (the shared {@link ValueFormatType} — `Chart.format.*`)
360
+ */
361
+ export const PlanChartAxisType = StructType({
362
+ domain: OptionType(ChartDomainType),
363
+ tickValues: OptionType(ChartTickValuesType),
364
+ format: OptionType(ValueFormatType),
365
+ });
366
+ /**
367
+ * One data-only chart layer on a chart row — the reified form of a consumed
368
+ * `Chart.*` layer builder. The canvas renders every mark itself against the
369
+ * shared scale; nothing of `ChartSpec` reaches the Plan IR.
370
+ *
371
+ * @remarks
372
+ * Renderer vocabulary (fixed by the spec, not the IR): lines draw solid ≤ now
373
+ * and dashed after; columns observed `ink`, planned brand at half strength,
374
+ * breach warn; stacked columns pair by `series`; refLines are dotted
375
+ * gridlines with a mono label. `Chart.Bar` (horizontal) is a build-time error
376
+ * on every axis kind — horizontal bars flip the frame the shared axis owns.
377
+ *
378
+ * @property line - A continuous line series (optional breach threshold)
379
+ * @property area - A filled area series
380
+ * @property column - Per-bucket columns (optional stack `series` id + breach)
381
+ * @property scatter - Point markers
382
+ * @property band - A filled range (lo/hi per instant)
383
+ * @property refLine - A horizontal reference line at a y value (dotted, mono label)
384
+ * @property refBand - A vertical reference band between two instants
385
+ * @property refDot - A reference marker at an instant × y value
386
+ */
387
+ export const PlanChartLayerType = VariantType({
388
+ line: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType,
389
+ breach: OptionType(PlanBreachType) }),
390
+ area: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType }),
391
+ column: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType,
392
+ series: OptionType(StringType), breach: OptionType(PlanBreachType) }),
393
+ scatter: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType }),
394
+ band: StructType({ points: ArrayType(PlanChartBandPointType), axis: PlanAxisSideType }),
395
+ refLine: StructType({ y: FloatType, axis: PlanAxisSideType, label: OptionType(StringType) }),
396
+ refBand: StructType({ from: PlanInstantType, to: PlanInstantType, label: OptionType(StringType) }),
397
+ refDot: StructType({ t: PlanInstantType, y: FloatType, axis: PlanAxisSideType,
398
+ label: OptionType(StringType) }),
399
+ });
400
+ /**
401
+ * A chart row's height mode — spark (32px resting), expanded (88px), or an
402
+ * explicit height for a composed chart (via `Plan.fixed("120px")` — a CSS px
403
+ * size, the same String type as every component height).
404
+ *
405
+ * @property spark - The 32px resting sparkline density
406
+ * @property expanded - The 88px expanded density
407
+ * @property fixed - An explicit CSS px size (`"120px"`)
408
+ */
409
+ export const PlanChartHeightType = VariantType({ spark: NullType, expanded: NullType, fixed: StringType });
410
+ // ============================================================================
411
+ // Heat-row leaf data — heat depth / weight bars / segment compositions
412
+ // ============================================================================
413
+ /**
414
+ * One heat cell — a per-bucket scalar rendered as colour depth.
415
+ *
416
+ * @property at - The bucket instant
417
+ * @property value - The scalar (`none` ⇒ the 45° no-data hatch + `–`)
418
+ * @property label - Optional printed value text (shown when the cell is ≥ 12px tall)
419
+ */
420
+ export const PlanHeatCellType = StructType({
421
+ at: PlanInstantType,
422
+ value: OptionType(FloatType),
423
+ label: OptionType(StringType),
424
+ });
425
+ /**
426
+ * One weight cell — a per-bucket booked-vs-free bar (the Matrix weight-bar
427
+ * recipe). Planned buckets render pale.
428
+ *
429
+ * @property at - The bucket instant
430
+ * @property fraction - The 0..1 filled fraction
431
+ * @property planned - `true` ⇒ the pale planned treatment
432
+ */
433
+ export const PlanWeightCellType = StructType({
434
+ at: PlanInstantType,
435
+ fraction: FloatType,
436
+ planned: BooleanType,
437
+ });
438
+ /**
439
+ * One segment of a segment-cell bar (the Matrix segment recipe).
440
+ *
441
+ * @property fill - The status-leveraged fill (see `MatrixFillType`)
442
+ * @property weight - The proportional weight (normalised with siblings)
443
+ * @property label - Optional in-bar % text (printed when the segment is wide enough)
444
+ */
445
+ export const PlanSegmentType = StructType({
446
+ fill: MatrixFillType,
447
+ weight: FloatType,
448
+ label: OptionType(StringType),
449
+ });
450
+ /**
451
+ * One segment cell — a per-bucket composition bar.
452
+ *
453
+ * @property at - The bucket instant
454
+ * @property segments - The weighted segments
455
+ */
456
+ export const PlanSegmentCellType = StructType({
457
+ at: PlanInstantType,
458
+ segments: ArrayType(PlanSegmentType),
459
+ });
460
+ /**
461
+ * A heat row's cells — one of the three Matrix-borrowed cell recipes.
462
+ *
463
+ * @remarks
464
+ * `heat` carries its own scale (`min`/`max`, defaulting to the observed
465
+ * extent) and an optional `warnAt` threshold (≥ it ⇒ the warn ring). Group
466
+ * summary strips (§5) are exactly the `heat` arm computed over descendants.
467
+ *
468
+ * @property heat - Colour-depth cells + scale + warn threshold
469
+ * @property weight - Booked-vs-free weight bars
470
+ * @property segments - Weighted segment compositions
471
+ */
472
+ export const PlanHeatCellsType = VariantType({
473
+ heat: StructType({ cells: ArrayType(PlanHeatCellType),
474
+ min: OptionType(FloatType), max: OptionType(FloatType),
475
+ warnAt: OptionType(FloatType) }),
476
+ weight: ArrayType(PlanWeightCellType),
477
+ segments: ArrayType(PlanSegmentCellType),
478
+ });
479
+ /**
480
+ * How a parent heat row derives its per-bucket cells from its children.
481
+ *
482
+ * @property mean - The per-bucket mean over children
483
+ * @property max - The per-bucket maximum
484
+ * @property sum - The per-bucket sum
485
+ */
486
+ export const PlanAggregateType = VariantType({ mean: NullType, max: NullType, sum: NullType });
487
+ // ============================================================================
488
+ // Table-row leaf data — bucketed numerals
489
+ // ============================================================================
490
+ /**
491
+ * A table cell's semantic tone.
492
+ *
493
+ * @property neg - Negative emphasis (shortfalls print in the negative ink)
494
+ * @property muted - Muted (the no-data em-dash)
495
+ */
496
+ export const PlanTableToneType = VariantType({ neg: NullType, muted: NullType });
497
+ /**
498
+ * One table-row cell — a per-bucket numeral.
499
+ *
500
+ * @remarks
501
+ * The RENDERER prints `value` through the row's `format` (the shared
502
+ * {@link ValueFormatType}); `text` is an explicit display override and
503
+ * `tone` an explicit tone override (else negatives derive `neg`, `none`
504
+ * the muted em-dash).
505
+ *
506
+ * @property at - The bucket instant
507
+ * @property value - The numeric value (`none` ⇒ the muted em-dash)
508
+ * @property text - Optional explicit display override
509
+ * @property tone - Optional explicit semantic tone override
510
+ */
511
+ export const PlanTableCellType = StructType({
512
+ at: PlanInstantType,
513
+ value: OptionType(FloatType),
514
+ text: OptionType(StringType),
515
+ tone: OptionType(PlanTableToneType),
516
+ });
517
+ /**
518
+ * How a multi-series table row lays its per-bucket values out — side by side
519
+ * (`horizontal`, the default) or stacked lines (`vertical`; the row grows to
520
+ * fit the stack).
521
+ *
522
+ * @property horizontal - Values print side by side in the right-aligned cell
523
+ * @property vertical - Values stack as lines (the row grows)
524
+ */
525
+ export const PlanTableSplitType = VariantType({ horizontal: NullType, vertical: NullType });
526
+ /**
527
+ * One value series of a table row — its own raw cells plus the POSITION's
528
+ * style declarations. Style is declared ONCE per series (wire-lean — never
529
+ * replicated per cell); the cells stay raw values, with the same rare
530
+ * per-cell `text`/`tone` overrides a single-series cell has.
531
+ *
532
+ * @property cells - The series' per-bucket cells (raw values)
533
+ * @property format - Numeral format override for this series (`none` ⇒ the row's `format`)
534
+ * @property tone - Default tone for the series' values (per-cell tones and derived neg/muted win)
535
+ * @property strong - Semibold emphasis for this series' values
536
+ * @property rollup - `true` ⇒ this series feeds declared parent aggregation (default: the first series)
537
+ */
538
+ export const PlanTableSeriesType = StructType({
539
+ cells: ArrayType(PlanTableCellType),
540
+ format: OptionType(TickFormatType),
541
+ tone: OptionType(PlanTableToneType),
542
+ strong: OptionType(BooleanType),
543
+ rollup: OptionType(BooleanType),
544
+ });
545
+ /**
546
+ * A table row's emphasis — body, header (caption-styled numerals) or footer
547
+ * (the 2px top rule).
548
+ *
549
+ * @property body - A plain body row
550
+ * @property header - The caption-styled header emphasis
551
+ * @property footer - The footer emphasis (2px top rule, bold numerals)
552
+ */
553
+ export const PlanTableEmphasisType = VariantType({ body: NullType, header: NullType, footer: NullType });
554
+ // ============================================================================
555
+ // Event-row leaf data — the mark kind
556
+ // ============================================================================
557
+ /**
558
+ * An event mark's kind — ● milestone, ◇/◆ decision (pending / applied), or
559
+ * ▲ exception.
560
+ *
561
+ * @property milestone - A milestone dot (`--ink-4`)
562
+ * @property decision - A decision diamond; `applied` fills it
563
+ * @property exception - A warn exception triangle
564
+ */
565
+ export const PlanEventMarkKindType = VariantType({
566
+ milestone: NullType,
567
+ decision: StructType({ applied: BooleanType }),
568
+ exception: NullType,
569
+ });
570
+ // ============================================================================
571
+ // Refs + callback payloads
572
+ // ============================================================================
573
+ /**
574
+ * The Plan row-subject reference — rows are addressed by their stable `key`
575
+ * (never an index; the flat row array reorders under grouping and grain).
576
+ *
577
+ * @property key - The row key
578
+ */
579
+ export const PlanRowRefType = StructType({ key: StringType });
580
+ /**
581
+ * The `onRunClick` payload — a span bar was clicked.
582
+ *
583
+ * @property row - The row key
584
+ * @property run - The run key
585
+ */
586
+ export const PlanRunClickEventType = StructType({ row: StringType, run: StringType });
587
+ /**
588
+ * The `onEventClick` payload — a bucket-event tile was clicked.
589
+ *
590
+ * @property row - The row key
591
+ * @property event - The event key
592
+ */
593
+ export const PlanEventClickEventType = StructType({ row: StringType, event: StringType });
594
+ /**
595
+ * The `onMarkClick` payload — an event-row mark or a span row's decision
596
+ * diamond was clicked (mark keys are unique per row).
597
+ *
598
+ * @property row - The row key
599
+ * @property mark - The mark / decision key
600
+ */
601
+ export const PlanMarkClickEventType = StructType({ row: StringType, mark: StringType });
602
+ /**
603
+ * The `onChipClick` payload — a cards-row chip was clicked.
604
+ *
605
+ * @property row - The row key
606
+ * @property chip - The chip key
607
+ */
608
+ export const PlanChipClickEventType = StructType({ row: StringType, chip: StringType });
609
+ /**
610
+ * The `onCellClick` payload — a heat / table / weight / segment bucket cell
611
+ * was clicked. Carries the bucket instant (on the axis's arm), never an
612
+ * index.
613
+ *
614
+ * @property row - The row key
615
+ * @property at - The clicked bucket's instant
616
+ */
617
+ export const PlanCellClickEventType = StructType({ row: StringType, at: PlanInstantType });
618
+ /**
619
+ * One canvas element, by reference — the subject of the root's generalized
620
+ * `popover` / `hover` resolvers (`Plan Data Interface.md` §3.3). Every arm
621
+ * reuses its click-event payload, so each ref carries the row key plus the
622
+ * element key; one resolver function covers every element kind.
623
+ *
624
+ * @remarks
625
+ * Span decision diamonds ride the `mark` arm (mark keys are unique per row).
626
+ * A resolver returning `none` for a ref opens no surface — per-element
627
+ * presence is the author's decision, made lazily at interaction time.
628
+ *
629
+ * @property run - A span run bar (`{ row, run }`)
630
+ * @property event - A bucket-event tile (`{ row, event }`)
631
+ * @property chip - A cards chip (`{ row, chip }`)
632
+ * @property mark - An event-row mark or span decision diamond (`{ row, mark }`)
633
+ * @property cell - A heat / table / weight / segment bucket cell (`{ row, at }`)
634
+ */
635
+ export const PlanElementRefType = VariantType({
636
+ run: PlanRunClickEventType,
637
+ event: PlanEventClickEventType,
638
+ chip: PlanChipClickEventType,
639
+ mark: PlanMarkClickEventType,
640
+ cell: PlanCellClickEventType,
641
+ });
642
+ /**
643
+ * The `onGroupToggle` payload — a group strip was expanded or collapsed
644
+ * (fires after the in-place swap).
645
+ *
646
+ * @property row - The group row key
647
+ * @property expanded - The new expansion state
648
+ */
649
+ export const PlanGroupToggleEventType = StructType({ row: StringType, expanded: BooleanType });
650
+ // ============================================================================
651
+ // Footer + style
652
+ // ============================================================================
653
+ /**
654
+ * One status-footer item (mono 10px). Items with `end: true` right-align.
655
+ *
656
+ * @property text - The footer text (`"512 RESOURCES · 12 GROUPS · 3 IN VIEW"`)
657
+ * @property tone - Optional status tint (`warning` for the exceptions count)
658
+ * @property end - `true` ⇒ pushed to the right edge
659
+ */
660
+ export const PlanFooterItemType = StructType({
661
+ text: StringType,
662
+ tone: OptionType(StatusValueType),
663
+ end: OptionType(BooleanType),
664
+ });
665
+ /**
666
+ * The Plan style — uniform sizing (#320), density, and the gutter width.
667
+ *
668
+ * @property height - Definite height (`"fill"` fills the parent); header chrome pinned, body scrolls within
669
+ * @property maxHeight - Max-height cap; content-sized up to it, then scrolls
670
+ * @property density - Row rhythm (`compact` ⇒ dense 24px span rows)
671
+ * @property gutterWidth - Explicit gutter width, a CSS px size (`"168px"`; default 168)
672
+ */
673
+ export const PlanStyleType = StructType({
674
+ height: OptionType(StringType),
675
+ maxHeight: OptionType(StringType),
676
+ density: OptionType(DensityType),
677
+ gutterWidth: OptionType(StringType),
678
+ });
679
+ // ============================================================================
680
+ // Templates + links — the plain vocabulary
681
+ // ============================================================================
682
+ /**
683
+ * One quantity link between two runs — the Plan's edge vocabulary. The root's
684
+ * `links` graph carries them and the links-focus control gathers a row's
685
+ * transitive upstream/downstream family over these edges. Each edge renders as
686
+ * a quantity-weighted ribbon between the run edges it names; geometry is fixed
687
+ * by the spec and lives in the renderer.
688
+ *
689
+ * @property fromRow - The source row key
690
+ * @property fromRun - The source run key
691
+ * @property toRow - The destination row key
692
+ * @property toRun - The destination run key
693
+ * @property quantity - The moved quantity (drives edge share + opacity)
694
+ * @property label - The printed quantity caption (`"34 t"`)
695
+ */
696
+ export const PlanLinkType = StructType({
697
+ fromRow: StringType,
698
+ fromRun: StringType,
699
+ toRow: StringType,
700
+ toRun: StringType,
701
+ quantity: FloatType,
702
+ label: StringType,
703
+ });
704
+ /**
705
+ * How a row's expand-in-place developer render treats the shared axis lines
706
+ * (grid columns + the now-line) INSIDE the expanded row — the ruler above
707
+ * never moves.
708
+ *
709
+ * @property keep - Run the grid + now-line through the render (the default)
710
+ * @property dim - Wash them to 40% behind dense content
711
+ * @property off - Suppress them inside the row only
712
+ */
713
+ export const PlanExpandAxisType = VariantType({ keep: NullType, dim: NullType, off: NullType });
714
+ // ============================================================================
715
+ // Elements + rows — the data-only row vocabulary (pageable dataset shapes)
716
+ // ============================================================================
717
+ /**
718
+ * One span run — a continuous `[start, end)` state-run bar
719
+ * (`"RUN · B-214 · 96 t"`). Runs are quantity-bearing states, not tasks: no
720
+ * dependency arrows, no critical path.
721
+ *
722
+ * @remarks
723
+ * `quantity` is the displayed `.q` suffix (`"96 t"`); `qty` is the optional
724
+ * numeric twin the renderer sums into parent rollup bands — display and
725
+ * arithmetic deliberately separate. `state` is the shared `EventStateType`
726
+ * lifecycle driving the bar recipe; `status: warning` adds the `.stuck`
727
+ * warn ring; `moved` collapses same-status churn to a `moved ×k` counter.
728
+ * Rich click/hover surfaces resolve through the ROOT's `popover` / `hover`
729
+ * functions with the `run` arm of {@link PlanElementRefType}.
730
+ */
731
+ export const PlanRunType = StructType({
732
+ key: StringType,
733
+ start: PlanInstantType,
734
+ end: PlanInstantType,
735
+ label: StringType,
736
+ quantity: OptionType(StringType),
737
+ qty: OptionType(FloatType),
738
+ state: EventStateType,
739
+ status: OptionType(StatusValueType),
740
+ moved: OptionType(IntegerType),
741
+ icon: OptionType(IconType),
742
+ });
743
+ /**
744
+ * One decision mark — the ◇/◆ diamond sitting on the run transition it
745
+ * fires (`applied` fills it). Decision detail resolves through the root's
746
+ * `popover` with the `mark` arm of {@link PlanElementRefType}.
747
+ */
748
+ export const PlanDecisionMarkType = StructType({
749
+ key: StringType,
750
+ at: PlanInstantType,
751
+ applied: BooleanType,
752
+ });
753
+ /**
754
+ * One bucket-event tile — the full Planner point-event grammar carried over
755
+ * whole (everything `PlannerEventType` had except `endSlot` — multi-bucket
756
+ * spans are span rows; the slot coordinate is the shared
757
+ * {@link PlanInstantType}).
758
+ *
759
+ * @remarks
760
+ * `label: none` ⇒ the resting look — a ✓ chip for confirmed/actual, the
761
+ * dashed `plan` chip for proposed. `icon` with `label: none` ⇒ an icon-only
762
+ * tile. In a laned row, `lane: none` is the mixed grammar — the tile takes
763
+ * the full cell across lanes. Rich surfaces resolve through the root's
764
+ * `popover` / `hover` with the `event` arm of {@link PlanElementRefType}.
765
+ */
766
+ export const PlanBucketEventType = StructType({
767
+ key: StringType,
768
+ at: PlanInstantType,
769
+ lane: OptionType(StringType),
770
+ label: OptionType(StringType),
771
+ icon: OptionType(IconType),
772
+ state: EventStateType,
773
+ tone: OptionType(StatusValueType),
774
+ color: OptionType(StringType),
775
+ colorPalette: OptionType(ColorSchemeType),
776
+ stretch: OptionType(PlanStretchType),
777
+ content: OptionType(PlanContentType),
778
+ animation: OptionType(PlanAnimationType),
779
+ });
780
+ /**
781
+ * One cards chip — a Roster shift chip spanning whole buckets. `confirmed`
782
+ * renders the brand-tint chip, proposals dashed (`+64h`),
783
+ * `proposed(removed)` the warn strikethrough, `estimated` the faint ghost a
784
+ * tap would accept. Chip detail resolves through the root's `popover` with
785
+ * the `chip` arm of {@link PlanElementRefType}.
786
+ */
787
+ export const PlanChipType = StructType({
788
+ key: StringType,
789
+ from: PlanInstantType,
790
+ to: PlanInstantType,
791
+ label: StringType,
792
+ state: EventStateType,
793
+ icon: OptionType(IconType),
794
+ });
795
+ /**
796
+ * One event-row mark — ● milestone · ◇/◆ decision · ▲ exception at an
797
+ * instant. Clusters collapse to `◇ ×3` in the renderer; labels print when
798
+ * there is room. `icon` swaps the kind's default glyph for an FA icon
799
+ * (12px, still kind-coloured) — hosts choose the glyph, never the geometry.
800
+ * Mark detail resolves through the root's `popover` with the `mark` arm of
801
+ * {@link PlanElementRefType}.
802
+ */
803
+ export const PlanEventMarkType = StructType({
804
+ key: StringType,
805
+ at: PlanInstantType,
806
+ kind: PlanEventMarkKindType,
807
+ icon: OptionType(IconType),
808
+ label: OptionType(StringType),
809
+ });
810
+ /**
811
+ * One bucket-row lane — a sub-slot within each column cell (`AM`/`PM`).
812
+ * `label: none` renders an unlabelled lane strip.
813
+ */
814
+ export const PlanLaneType = StructType({
815
+ key: StringType,
816
+ label: OptionType(StringType),
817
+ });
818
+ /**
819
+ * A row's expand-in-place declaration (R2) — pure data: the row grows and
820
+ * the ROOT's `expandRender` resolver builds the mounted body when the
821
+ * `expand` control fires. `height` is the developer region's minimum, a CSS
822
+ * px size (`none` ⇒ the renderer default); `axis` chooses how the shared
823
+ * grid + now-line run through the focused row's own plot.
824
+ */
825
+ export const PlanExpandType = StructType({
826
+ height: OptionType(StringType),
827
+ axis: PlanExpandAxisType,
828
+ });
829
+ /**
830
+ * The eight-arm row kind — `group · span · buckets · chart · heat · table ·
831
+ * cards · events` — each keeping its source component's rendered surface.
832
+ *
833
+ * @remarks
834
+ * `span` positions continuously (real instants, may cross bucket edges);
835
+ * `buckets` / `heat` / `table` / `cards` quantise to the bucket grid;
836
+ * `chart` draws per-bucket and continuous marks; `events` places instant
837
+ * marks; `group` is the heterogeneous container whose collapsed form is
838
+ * its `summary` heat strip.
839
+ */
840
+ export const PlanRowKindType = VariantType({
841
+ group: StructType({
842
+ summary: OptionType(PlanHeatCellsType),
843
+ summaryAggregate: OptionType(PlanAggregateType),
844
+ collapsed: OptionType(BooleanType),
845
+ }),
846
+ span: StructType({
847
+ runs: ArrayType(PlanRunType),
848
+ decisions: ArrayType(PlanDecisionMarkType),
849
+ ports: ArrayType(PlanPortType),
850
+ rollup: OptionType(PlanRollupType),
851
+ unit: OptionType(StringType),
852
+ }),
853
+ buckets: StructType({
854
+ lanes: ArrayType(PlanLaneType),
855
+ events: ArrayType(PlanBucketEventType),
856
+ markers: ArrayType(PlanCellMarkerType),
857
+ }),
858
+ chart: StructType({
859
+ layers: ArrayType(PlanChartLayerType),
860
+ left: OptionType(PlanChartAxisType),
861
+ right: OptionType(PlanChartAxisType),
862
+ height: PlanChartHeightType,
863
+ /** Height the EXPANDED state opens to, a CSS px size like every
864
+ * component height (`"120px"`; `none` ⇒ the 88px default). */
865
+ expandedHeight: OptionType(StringType),
866
+ expandable: OptionType(BooleanType),
867
+ }),
868
+ heat: StructType({
869
+ cells: PlanHeatCellsType,
870
+ aggregate: OptionType(PlanAggregateType),
871
+ }),
872
+ table: StructType({
873
+ series: ArrayType(PlanTableSeriesType),
874
+ split: PlanTableSplitType,
875
+ aggregate: OptionType(TableAggregateType),
876
+ format: OptionType(TickFormatType),
877
+ emphasis: PlanTableEmphasisType,
878
+ }),
879
+ cards: StructType({
880
+ chips: ArrayType(PlanChipType),
881
+ }),
882
+ events: StructType({
883
+ marks: ArrayType(PlanEventMarkType),
884
+ }),
885
+ });
886
+ /**
887
+ * One flat canvas row — a pure-data, storable, pageable dataset element
888
+ * (no `UIComponentType`, no `FunctionType`).
889
+ *
890
+ * @remarks
891
+ * Rows are flat and keyed, in canonical KEY order; `parent` keys encode the
892
+ * tree (depth structurally unlimited — the Table `groupBy` guarantee), which
893
+ * the renderer walks from the roots, so a subtree need not be contiguous in
894
+ * the collection. `pinned`
895
+ * rows render above the virtualised body under the ruler; `height` is a
896
+ * fixed CSS-px override; `status` the quiet gutter dot; `approval` the
897
+ * review verdict (rendered only with the root's review chrome); `expand`
898
+ * the R2 declaration (the render itself is the root's `expandRender`
899
+ * resolver).
900
+ */
901
+ export const PlanRowType = StructType({
902
+ key: StringType,
903
+ parent: OptionType(StringType),
904
+ gutter: PlanGutterType,
905
+ kind: PlanRowKindType,
906
+ pinned: OptionType(BooleanType),
907
+ height: OptionType(StringType),
908
+ status: OptionType(StatusValueType),
909
+ approval: OptionType(ApprovalStateType),
910
+ expand: OptionType(PlanExpandType),
911
+ });
912
+ /**
913
+ * The canvas's row COLLECTION — rows keyed by their stable `key` (#568).
914
+ *
915
+ * @remarks
916
+ * A `Dict` cannot hold two entries under one key, so the duplicate rows a
917
+ * per-window pipeline used to synthesize (a group parent re-emitted per paged
918
+ * window) are unconstructable rather than gated. `Dict` also decodes to a
919
+ * `SortedMap`, so the collection's order is canonical and deterministic —
920
+ * `Array` preserved construction order and nothing else.
921
+ */
922
+ export const PlanRowsCollectionType = DictType(StringType, PlanRowType);
923
+ /**
924
+ * The paged source of a `data` + `series` canvas — the SHARED row-source
925
+ * contract ({@link PagedSourceType}) instantiated at the canvas-row
926
+ * COLLECTION (`Plan Data Interface.md` §3.8). The factory builds it from the
927
+ * author's source (a `Data.bindPaged` handle, a `Paged.of` fixture) by
928
+ * wrapping each window with the series' `derive` functions, so the renderer only
929
+ * ever sees typed, KEYED canvas-row windows — no bytes, no domain types, and
930
+ * no row a later window can duplicate.
931
+ */
932
+ export const PlanPagedSourceType = PagedSourceType(PlanRowsCollectionType);
933
+ /**
934
+ * The root's rows channel — the shared {@link RowSourceType} at the canvas-row
935
+ * COLLECTION: `inline` rows (what a `data`+`series` canvas over a collection
936
+ * collapses to) or a `paged` source of the same shape. One vocabulary across
937
+ * every collection, so a component never sniffs shapes of its own (#567).
938
+ */
939
+ export const PlanRowsType = RowSourceType(PlanRowsCollectionType);
940
+ //# sourceMappingURL=types.js.map