@elaraai/e3-ui 1.0.86 → 1.0.87

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 (385) hide show
  1. package/dist/src/bind/data-indexed.d.ts +159 -0
  2. package/dist/src/bind/data-indexed.d.ts.map +1 -0
  3. package/dist/src/bind/data-indexed.js +105 -0
  4. package/dist/src/bind/data-indexed.js.map +1 -0
  5. package/dist/src/bind/data.d.ts +5 -3
  6. package/dist/src/bind/data.d.ts.map +1 -1
  7. package/dist/src/bind/data.js +6 -0
  8. package/dist/src/bind/data.js.map +1 -1
  9. package/dist/src/bind/record.d.ts +34 -23
  10. package/dist/src/bind/record.d.ts.map +1 -1
  11. package/dist/src/bind/record.js +46 -19
  12. package/dist/src/bind/record.js.map +1 -1
  13. package/dist/src/calendar/index.d.ts +2923 -0
  14. package/dist/src/calendar/index.d.ts.map +1 -0
  15. package/dist/src/calendar/index.js +135 -0
  16. package/dist/src/calendar/index.js.map +1 -0
  17. package/dist/src/decision/queue.d.ts +3 -3
  18. package/dist/src/decision/queue.d.ts.map +1 -1
  19. package/dist/src/decision/queue.js +2 -2
  20. package/dist/src/decision/queue.js.map +1 -1
  21. package/dist/src/decision/types.d.ts +4 -0
  22. package/dist/src/decision/types.d.ts.map +1 -1
  23. package/dist/src/decision/types.js +4 -0
  24. package/dist/src/decision/types.js.map +1 -1
  25. package/dist/src/flowchart/canvas.d.ts +114 -0
  26. package/dist/src/flowchart/canvas.d.ts.map +1 -0
  27. package/dist/src/flowchart/canvas.js +84 -0
  28. package/dist/src/flowchart/canvas.js.map +1 -0
  29. package/dist/src/flowchart/flowchart.d.ts +79 -0
  30. package/dist/src/flowchart/flowchart.d.ts.map +1 -0
  31. package/dist/src/flowchart/flowchart.js +9 -0
  32. package/dist/src/flowchart/flowchart.js.map +1 -0
  33. package/dist/src/flowchart/index.d.ts +305 -0
  34. package/dist/src/flowchart/index.d.ts.map +1 -0
  35. package/dist/src/flowchart/index.js +267 -0
  36. package/dist/src/flowchart/index.js.map +1 -0
  37. package/dist/src/flowchart/library.d.ts +720 -0
  38. package/dist/src/flowchart/library.d.ts.map +1 -0
  39. package/dist/src/flowchart/library.js +611 -0
  40. package/dist/src/flowchart/library.js.map +1 -0
  41. package/dist/src/flowchart/over.d.ts +234 -0
  42. package/dist/src/flowchart/over.d.ts.map +1 -0
  43. package/dist/src/flowchart/over.js +220 -0
  44. package/dist/src/flowchart/over.js.map +1 -0
  45. package/dist/src/flowchart/patch.d.ts +64 -0
  46. package/dist/src/flowchart/patch.d.ts.map +1 -0
  47. package/dist/src/flowchart/patch.js +67 -0
  48. package/dist/src/flowchart/patch.js.map +1 -0
  49. package/dist/src/flowchart/payload.d.ts +8220 -0
  50. package/dist/src/flowchart/payload.d.ts.map +1 -0
  51. package/dist/src/flowchart/payload.js +521 -0
  52. package/dist/src/flowchart/payload.js.map +1 -0
  53. package/dist/src/flowchart/types.d.ts +393 -0
  54. package/dist/src/flowchart/types.d.ts.map +1 -0
  55. package/dist/src/flowchart/types.js +216 -0
  56. package/dist/src/flowchart/types.js.map +1 -0
  57. package/dist/src/flowchart/values.d.ts +267 -0
  58. package/dist/src/flowchart/values.d.ts.map +1 -0
  59. package/dist/src/flowchart/values.js +216 -0
  60. package/dist/src/flowchart/values.js.map +1 -0
  61. package/dist/src/flowchart/window.d.ts +521 -0
  62. package/dist/src/flowchart/window.d.ts.map +1 -0
  63. package/dist/src/flowchart/window.js +69 -0
  64. package/dist/src/flowchart/window.js.map +1 -0
  65. package/dist/src/index.d.ts +25 -1
  66. package/dist/src/index.d.ts.map +1 -1
  67. package/dist/src/index.js +48 -1
  68. package/dist/src/index.js.map +1 -1
  69. package/dist/src/internal.d.ts +35 -3
  70. package/dist/src/internal.d.ts.map +1 -1
  71. package/dist/src/internal.js +72 -3
  72. package/dist/src/internal.js.map +1 -1
  73. package/dist/src/plan/assemble.d.ts +2224 -0
  74. package/dist/src/plan/assemble.d.ts.map +1 -0
  75. package/dist/src/plan/assemble.js +210 -0
  76. package/dist/src/plan/assemble.js.map +1 -0
  77. package/dist/src/plan/builders.d.ts +790 -0
  78. package/dist/src/plan/builders.d.ts.map +1 -0
  79. package/dist/src/plan/builders.js +749 -0
  80. package/dist/src/plan/builders.js.map +1 -0
  81. package/dist/src/plan/event-rows.d.ts +2565 -0
  82. package/dist/src/plan/event-rows.d.ts.map +1 -0
  83. package/dist/src/plan/event-rows.js +689 -0
  84. package/dist/src/plan/event-rows.js.map +1 -0
  85. package/dist/src/plan/factories.d.ts +458 -0
  86. package/dist/src/plan/factories.d.ts.map +1 -0
  87. package/dist/src/plan/factories.js +484 -0
  88. package/dist/src/plan/factories.js.map +1 -0
  89. package/dist/src/plan/index.d.ts +672 -0
  90. package/dist/src/plan/index.d.ts.map +1 -0
  91. package/dist/src/plan/index.js +532 -0
  92. package/dist/src/plan/index.js.map +1 -0
  93. package/dist/src/plan/ir.d.ts +2594 -0
  94. package/dist/src/plan/ir.d.ts.map +1 -0
  95. package/dist/src/plan/ir.js +78 -0
  96. package/dist/src/plan/ir.js.map +1 -0
  97. package/dist/src/plan/library.d.ts +772 -0
  98. package/dist/src/plan/library.d.ts.map +1 -0
  99. package/dist/src/plan/library.js +424 -0
  100. package/dist/src/plan/library.js.map +1 -0
  101. package/dist/src/plan/ordered-source.d.ts +27 -0
  102. package/dist/src/plan/ordered-source.d.ts.map +1 -0
  103. package/dist/src/plan/ordered-source.js +48 -0
  104. package/dist/src/plan/ordered-source.js.map +1 -0
  105. package/dist/src/plan/over.d.ts +247 -0
  106. package/dist/src/plan/over.d.ts.map +1 -0
  107. package/dist/src/plan/over.js +266 -0
  108. package/dist/src/plan/over.js.map +1 -0
  109. package/dist/src/plan/pick.d.ts +78 -0
  110. package/dist/src/plan/pick.d.ts.map +1 -0
  111. package/dist/src/plan/pick.js +146 -0
  112. package/dist/src/plan/pick.js.map +1 -0
  113. package/dist/src/plan/plan.d.ts +11611 -0
  114. package/dist/src/plan/plan.d.ts.map +1 -0
  115. package/dist/src/plan/plan.js +428 -0
  116. package/dist/src/plan/plan.js.map +1 -0
  117. package/dist/src/plan/refs.d.ts +218 -0
  118. package/dist/src/plan/refs.d.ts.map +1 -0
  119. package/dist/src/plan/refs.js +226 -0
  120. package/dist/src/plan/refs.js.map +1 -0
  121. package/dist/src/plan/root.d.ts +290 -0
  122. package/dist/src/plan/root.d.ts.map +1 -0
  123. package/dist/src/plan/root.js +463 -0
  124. package/dist/src/plan/root.js.map +1 -0
  125. package/dist/src/plan/series.d.ts +13554 -0
  126. package/dist/src/plan/series.d.ts.map +1 -0
  127. package/dist/src/plan/series.js +1921 -0
  128. package/dist/src/plan/series.js.map +1 -0
  129. package/dist/src/plan/types.d.ts +12400 -0
  130. package/dist/src/plan/types.d.ts.map +1 -0
  131. package/dist/src/plan/types.js +1335 -0
  132. package/dist/src/plan/types.js.map +1 -0
  133. package/dist/src/roster/coverage.d.ts +240 -0
  134. package/dist/src/roster/coverage.d.ts.map +1 -0
  135. package/dist/src/roster/coverage.js +109 -0
  136. package/dist/src/roster/coverage.js.map +1 -0
  137. package/dist/src/roster/index.d.ts +4028 -0
  138. package/dist/src/roster/index.d.ts.map +1 -0
  139. package/dist/src/roster/index.js +115 -0
  140. package/dist/src/roster/index.js.map +1 -0
  141. package/dist/src/roster/library.d.ts +106 -0
  142. package/dist/src/roster/library.d.ts.map +1 -0
  143. package/dist/src/roster/library.js +78 -0
  144. package/dist/src/roster/library.js.map +1 -0
  145. package/dist/src/roster/people.d.ts +50 -0
  146. package/dist/src/roster/people.d.ts.map +1 -0
  147. package/dist/src/roster/people.js +32 -0
  148. package/dist/src/roster/people.js.map +1 -0
  149. package/dist/src/roster/rules.d.ts +275 -0
  150. package/dist/src/roster/rules.d.ts.map +1 -0
  151. package/dist/src/roster/rules.js +162 -0
  152. package/dist/src/roster/rules.js.map +1 -0
  153. package/dist/src/roster/types.d.ts +672 -0
  154. package/dist/src/roster/types.d.ts.map +1 -0
  155. package/dist/src/roster/types.js +248 -0
  156. package/dist/src/roster/types.js.map +1 -0
  157. package/dist/src/roster/visibility.d.ts +66 -0
  158. package/dist/src/roster/visibility.d.ts.map +1 -0
  159. package/dist/src/roster/visibility.js +25 -0
  160. package/dist/src/roster/visibility.js.map +1 -0
  161. package/dist/src/schedule/days.d.ts +54 -0
  162. package/dist/src/schedule/days.d.ts.map +1 -0
  163. package/dist/src/schedule/days.js +68 -0
  164. package/dist/src/schedule/days.js.map +1 -0
  165. package/dist/src/schedule/events.d.ts +433 -0
  166. package/dist/src/schedule/events.d.ts.map +1 -0
  167. package/dist/src/schedule/events.js +851 -0
  168. package/dist/src/schedule/events.js.map +1 -0
  169. package/dist/src/schedule/index.d.ts +150 -0
  170. package/dist/src/schedule/index.d.ts.map +1 -0
  171. package/dist/src/schedule/index.js +132 -0
  172. package/dist/src/schedule/index.js.map +1 -0
  173. package/dist/src/schedule/library.d.ts +70 -0
  174. package/dist/src/schedule/library.d.ts.map +1 -0
  175. package/dist/src/schedule/library.js +102 -0
  176. package/dist/src/schedule/library.js.map +1 -0
  177. package/dist/src/schedule/patch.d.ts +74 -0
  178. package/dist/src/schedule/patch.d.ts.map +1 -0
  179. package/dist/src/schedule/patch.js +68 -0
  180. package/dist/src/schedule/patch.js.map +1 -0
  181. package/dist/src/schedule/record-window.d.ts +189 -0
  182. package/dist/src/schedule/record-window.d.ts.map +1 -0
  183. package/dist/src/schedule/record-window.js +95 -0
  184. package/dist/src/schedule/record-window.js.map +1 -0
  185. package/dist/src/schedule/resources.d.ts +165 -0
  186. package/dist/src/schedule/resources.d.ts.map +1 -0
  187. package/dist/src/schedule/resources.js +234 -0
  188. package/dist/src/schedule/resources.js.map +1 -0
  189. package/dist/src/schedule/templates.d.ts +47 -0
  190. package/dist/src/schedule/templates.d.ts.map +1 -0
  191. package/dist/src/schedule/templates.js +61 -0
  192. package/dist/src/schedule/templates.js.map +1 -0
  193. package/dist/src/schedule/types.d.ts +1677 -0
  194. package/dist/src/schedule/types.d.ts.map +1 -0
  195. package/dist/src/schedule/types.js +374 -0
  196. package/dist/src/schedule/types.js.map +1 -0
  197. package/dist/src/schedule/window.d.ts +154 -0
  198. package/dist/src/schedule/window.d.ts.map +1 -0
  199. package/dist/src/schedule/window.js +363 -0
  200. package/dist/src/schedule/window.js.map +1 -0
  201. package/dist/src/sheet/bridge.d.ts +385 -0
  202. package/dist/src/sheet/bridge.d.ts.map +1 -0
  203. package/dist/src/sheet/bridge.js +809 -0
  204. package/dist/src/sheet/bridge.js.map +1 -0
  205. package/dist/src/sheet/columns.d.ts +410 -0
  206. package/dist/src/sheet/columns.d.ts.map +1 -0
  207. package/dist/src/sheet/columns.js +99 -0
  208. package/dist/src/sheet/columns.js.map +1 -0
  209. package/dist/src/sheet/context-bridge.d.ts +48 -0
  210. package/dist/src/sheet/context-bridge.d.ts.map +1 -0
  211. package/dist/src/sheet/context-bridge.js +216 -0
  212. package/dist/src/sheet/context-bridge.js.map +1 -0
  213. package/dist/src/sheet/draft-bridge.d.ts +37 -0
  214. package/dist/src/sheet/draft-bridge.d.ts.map +1 -0
  215. package/dist/src/sheet/draft-bridge.js +153 -0
  216. package/dist/src/sheet/draft-bridge.js.map +1 -0
  217. package/dist/src/sheet/drafts.d.ts +14 -0
  218. package/dist/src/sheet/drafts.d.ts.map +1 -0
  219. package/dist/src/sheet/drafts.js +14 -0
  220. package/dist/src/sheet/drafts.js.map +1 -0
  221. package/dist/src/sheet/editing-bridge.d.ts +40 -0
  222. package/dist/src/sheet/editing-bridge.d.ts.map +1 -0
  223. package/dist/src/sheet/editing-bridge.js +231 -0
  224. package/dist/src/sheet/editing-bridge.js.map +1 -0
  225. package/dist/src/sheet/editing-types.d.ts +268 -0
  226. package/dist/src/sheet/editing-types.d.ts.map +1 -0
  227. package/dist/src/sheet/editing-types.js +34 -0
  228. package/dist/src/sheet/editing-types.js.map +1 -0
  229. package/dist/src/sheet/edits.d.ts +37 -0
  230. package/dist/src/sheet/edits.d.ts.map +1 -0
  231. package/dist/src/sheet/edits.js +31 -0
  232. package/dist/src/sheet/edits.js.map +1 -0
  233. package/dist/src/sheet/fields.d.ts +693 -0
  234. package/dist/src/sheet/fields.d.ts.map +1 -0
  235. package/dist/src/sheet/fields.js +280 -0
  236. package/dist/src/sheet/fields.js.map +1 -0
  237. package/dist/src/sheet/group.d.ts +165 -0
  238. package/dist/src/sheet/group.d.ts.map +1 -0
  239. package/dist/src/sheet/group.js +52 -0
  240. package/dist/src/sheet/group.js.map +1 -0
  241. package/dist/src/sheet/index.d.ts +542 -0
  242. package/dist/src/sheet/index.d.ts.map +1 -0
  243. package/dist/src/sheet/index.js +387 -0
  244. package/dist/src/sheet/index.js.map +1 -0
  245. package/dist/src/sheet/library.d.ts +284 -0
  246. package/dist/src/sheet/library.d.ts.map +1 -0
  247. package/dist/src/sheet/library.js +259 -0
  248. package/dist/src/sheet/library.js.map +1 -0
  249. package/dist/src/sheet/link.d.ts +398 -0
  250. package/dist/src/sheet/link.d.ts.map +1 -0
  251. package/dist/src/sheet/link.js +228 -0
  252. package/dist/src/sheet/link.js.map +1 -0
  253. package/dist/src/sheet/record.d.ts +75 -0
  254. package/dist/src/sheet/record.d.ts.map +1 -0
  255. package/dist/src/sheet/record.js +128 -0
  256. package/dist/src/sheet/record.js.map +1 -0
  257. package/dist/src/sheet/registers.d.ts +681 -0
  258. package/dist/src/sheet/registers.d.ts.map +1 -0
  259. package/dist/src/sheet/registers.js +671 -0
  260. package/dist/src/sheet/registers.js.map +1 -0
  261. package/dist/src/sheet/root.d.ts +329 -0
  262. package/dist/src/sheet/root.d.ts.map +1 -0
  263. package/dist/src/sheet/root.js +511 -0
  264. package/dist/src/sheet/root.js.map +1 -0
  265. package/dist/src/sheet/seed-bridge.d.ts +14 -0
  266. package/dist/src/sheet/seed-bridge.d.ts.map +1 -0
  267. package/dist/src/sheet/seed-bridge.js +51 -0
  268. package/dist/src/sheet/seed-bridge.js.map +1 -0
  269. package/dist/src/sheet/sheet.d.ts +11819 -0
  270. package/dist/src/sheet/sheet.d.ts.map +1 -0
  271. package/dist/src/sheet/sheet.js +236 -0
  272. package/dist/src/sheet/sheet.js.map +1 -0
  273. package/dist/src/sheet/sub-rows.d.ts +299 -0
  274. package/dist/src/sheet/sub-rows.d.ts.map +1 -0
  275. package/dist/src/sheet/sub-rows.js +272 -0
  276. package/dist/src/sheet/sub-rows.js.map +1 -0
  277. package/dist/src/sheet/templates.d.ts +161 -0
  278. package/dist/src/sheet/templates.d.ts.map +1 -0
  279. package/dist/src/sheet/templates.js +122 -0
  280. package/dist/src/sheet/templates.js.map +1 -0
  281. package/dist/src/sheet/transactions.d.ts +76 -0
  282. package/dist/src/sheet/transactions.d.ts.map +1 -0
  283. package/dist/src/sheet/transactions.js +40 -0
  284. package/dist/src/sheet/transactions.js.map +1 -0
  285. package/dist/src/sheet/types.d.ts +15226 -0
  286. package/dist/src/sheet/types.d.ts.map +1 -0
  287. package/dist/src/sheet/types.js +1070 -0
  288. package/dist/src/sheet/types.js.map +1 -0
  289. package/dist/src/sheet/views.d.ts +29 -0
  290. package/dist/src/sheet/views.d.ts.map +1 -0
  291. package/dist/src/sheet/views.js +43 -0
  292. package/dist/src/sheet/views.js.map +1 -0
  293. package/dist/src/studio/component.d.ts.map +1 -1
  294. package/dist/src/studio/component.js +11 -8
  295. package/dist/src/studio/component.js.map +1 -1
  296. package/dist/src/utils/derive.d.ts +134 -8
  297. package/dist/src/utils/derive.d.ts.map +1 -1
  298. package/dist/src/utils/derive.js +409 -7
  299. package/dist/src/utils/derive.js.map +1 -1
  300. package/dist/src/utils/ordered-source.d.ts +38 -0
  301. package/dist/src/utils/ordered-source.d.ts.map +1 -0
  302. package/dist/src/utils/ordered-source.js +45 -0
  303. package/dist/src/utils/ordered-source.js.map +1 -0
  304. package/dist/src/utils/row-inspector.d.ts +36 -0
  305. package/dist/src/utils/row-inspector.d.ts.map +1 -0
  306. package/dist/src/utils/row-inspector.js +49 -0
  307. package/dist/src/utils/row-inspector.js.map +1 -0
  308. package/dist/test/bind/data/data.examples.d.ts +21 -19
  309. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  310. package/dist/test/bind/data/data.examples.js +122 -122
  311. package/dist/test/bind/data/data.examples.js.map +1 -1
  312. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  313. package/dist/test/bind/record/record.examples.js +9 -9
  314. package/dist/test/bind/record/record.examples.js.map +1 -1
  315. package/dist/test/calendar/calendar-records.examples.d.ts +228 -0
  316. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -0
  317. package/dist/test/calendar/calendar-records.examples.js +91 -0
  318. package/dist/test/calendar/calendar-records.examples.js.map +1 -0
  319. package/dist/test/calendar/calendar.examples.d.ts +776 -0
  320. package/dist/test/calendar/calendar.examples.d.ts.map +1 -0
  321. package/dist/test/calendar/calendar.examples.js +336 -0
  322. package/dist/test/calendar/calendar.examples.js.map +1 -0
  323. package/dist/test/decision/journal.examples.d.ts +28 -28
  324. package/dist/test/decision/journal.examples.d.ts.map +1 -1
  325. package/dist/test/decision/journal.examples.js +4 -4
  326. package/dist/test/decision/journal.examples.js.map +1 -1
  327. package/dist/test/decision/queue.examples.d.ts.map +1 -1
  328. package/dist/test/decision/queue.examples.js +5 -7
  329. package/dist/test/decision/queue.examples.js.map +1 -1
  330. package/dist/test/flowchart/flowchart.examples.d.ts +3713 -0
  331. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -0
  332. package/dist/test/flowchart/flowchart.examples.js +465 -0
  333. package/dist/test/flowchart/flowchart.examples.js.map +1 -0
  334. package/dist/test/plan/plan-events.examples.d.ts +3666 -0
  335. package/dist/test/plan/plan-events.examples.d.ts.map +1 -0
  336. package/dist/test/plan/plan-events.examples.js +773 -0
  337. package/dist/test/plan/plan-events.examples.js.map +1 -0
  338. package/dist/test/plan/plan-records.examples.d.ts +3 -0
  339. package/dist/test/plan/plan-records.examples.d.ts.map +1 -0
  340. package/dist/test/plan/plan-records.examples.js +45 -0
  341. package/dist/test/plan/plan-records.examples.js.map +1 -0
  342. package/dist/test/plan/plan-windows.examples.d.ts +588 -0
  343. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -0
  344. package/dist/test/plan/plan-windows.examples.js +170 -0
  345. package/dist/test/plan/plan-windows.examples.js.map +1 -0
  346. package/dist/test/plan/plan.examples.d.ts +8095 -0
  347. package/dist/test/plan/plan.examples.d.ts.map +1 -0
  348. package/dist/test/plan/plan.examples.js +2500 -0
  349. package/dist/test/plan/plan.examples.js.map +1 -0
  350. package/dist/test/roster/domain.examples.d.ts +367 -0
  351. package/dist/test/roster/domain.examples.d.ts.map +1 -0
  352. package/dist/test/roster/domain.examples.js +72 -0
  353. package/dist/test/roster/domain.examples.js.map +1 -0
  354. package/dist/test/roster/roster-records.examples.d.ts +729 -0
  355. package/dist/test/roster/roster-records.examples.d.ts.map +1 -0
  356. package/dist/test/roster/roster-records.examples.js +86 -0
  357. package/dist/test/roster/roster-records.examples.js.map +1 -0
  358. package/dist/test/roster/roster.examples.d.ts +750 -0
  359. package/dist/test/roster/roster.examples.d.ts.map +1 -0
  360. package/dist/test/roster/roster.examples.js +198 -0
  361. package/dist/test/roster/roster.examples.js.map +1 -0
  362. package/dist/test/roster/warehouse.d.ts +87 -0
  363. package/dist/test/roster/warehouse.d.ts.map +1 -0
  364. package/dist/test/roster/warehouse.js +883 -0
  365. package/dist/test/roster/warehouse.js.map +1 -0
  366. package/dist/test/sheet/sheet-link.examples.d.ts +7 -0
  367. package/dist/test/sheet/sheet-link.examples.d.ts.map +1 -0
  368. package/dist/test/sheet/sheet-link.examples.js +41 -0
  369. package/dist/test/sheet/sheet-link.examples.js.map +1 -0
  370. package/dist/test/sheet/sheet-records.examples.d.ts +421 -0
  371. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -0
  372. package/dist/test/sheet/sheet-records.examples.js +79 -0
  373. package/dist/test/sheet/sheet-records.examples.js.map +1 -0
  374. package/dist/test/sheet/sheet-transactions.examples.d.ts +7 -0
  375. package/dist/test/sheet/sheet-transactions.examples.d.ts.map +1 -0
  376. package/dist/test/sheet/sheet-transactions.examples.js +58 -0
  377. package/dist/test/sheet/sheet-transactions.examples.js.map +1 -0
  378. package/dist/test/sheet/sheet.examples.d.ts +5562 -0
  379. package/dist/test/sheet/sheet.examples.d.ts.map +1 -0
  380. package/dist/test/sheet/sheet.examples.js +1178 -0
  381. package/dist/test/sheet/sheet.examples.js.map +1 -0
  382. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  383. package/dist/test/studio/studio.examples.js +11 -11
  384. package/dist/test/studio/studio.examples.js.map +1 -1
  385. package/package.json +12 -9
@@ -0,0 +1,1335 @@
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 planned as one surface.
13
+ *
14
+ * Rows are an ordered STREAM in the IR (`ArrayType(PlanRowType)`, #822): the
15
+ * stream IS the render order. The top-level series list is the layout — each
16
+ * series contributes its rows in declared order, as BLOCKS that travel apart
17
+ * ({@link PlanBlockType}, #823): a data series is one block of its entries'
18
+ * rows, which a paged canvas pages on its own, and a section's header and
19
+ * hand-built rows are fixed blocks drawn once — and a parent is followed by
20
+ * its descendants. A row has a TYPED identity
21
+ * ({@link PlanRowIdType}: the series that made it and the path of entry keys
22
+ * that leads to it), which is what `parent` references, what `links` address,
23
+ * what every callback reports and what focus / collapse / selection state is
24
+ * keyed on. Hierarchy comes from the data's own nesting (a series'
25
+ * `children`), never from a field value; parent aggregates (rollup bands,
26
+ * per-bucket heat means, table subtotals) are derived renderer-side from the
27
+ * tree the `parent` ids encode.
28
+ *
29
+ * This file holds only plain data — no UIComponent slots. Since the
30
+ * data-interface redesign (`Plan Data Interface.md` §3.2/§3.3) that includes
31
+ * the WHOLE row vocabulary: elements (runs, bucket events, chips, event marks,
32
+ * decisions), the row kind and the row itself carry **no `UIComponentType`
33
+ * and no per-element UI embeds** — rich surfaces resolve through the ROOT's
34
+ * `popover` / `hover` / `expandRender` functions over
35
+ * {@link PlanElementRefType} / row refs, so a row is a storable, pageable
36
+ * dataset element. Only the root and the resolver signatures are
37
+ * UIComponent-coupled (`./ir.ts` — the canvas's root, which the `Plan`
38
+ * carrier's payload holds as its `plan`).
39
+ *
40
+ * @packageDocumentation
41
+ */
42
+ import { ArrayType, BlobType, BooleanType, DateTimeType, DictType, FloatType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, } from "@elaraai/east";
43
+ import { DensityType, EventStateType, IconType, LibraryRefType, PagedSourceType, RowSourceType, StatusValueType, TimeResolutionType, } from "@elaraai/east-ui";
44
+ import { ChartDomainType, ChartTickValuesType, ColorSchemeType, EditingDraftFieldType, EditingPatchEventTypeWith, EditingReadinessType, EditingSessionFields, MatrixFillType, TableAggregateType, TickFormatType, ValueFormatType, } from "@elaraai/east-ui/internal";
45
+ // ============================================================================
46
+ // Instants + axis — the shared scale, in one of three kinds
47
+ // ============================================================================
48
+ /**
49
+ * One instant on the Plan's shared axis — `{ time | number | ordinal }`, the
50
+ * retired Planner's slot type verbatim (#631). The axis KIND rides every
51
+ * element, so a canvas is typed end to end: a run's `start` / `end`, a tile's
52
+ * `at`, a chart point's `t`, a chip's `from` / `to` and a click payload's
53
+ * `at` are all this variant, and the root's {@link PlanAxisType} declares
54
+ * which arm the canvas positions on.
55
+ *
56
+ * @remarks
57
+ * Every instant on a canvas must ride the axis's arm — a row whose instants
58
+ * ride another arm is a render-time diagnostic naming the row and the axis
59
+ * kind, never a silent misplacement (the Planner's single-axis-kind rule).
60
+ *
61
+ * The element builders take the JS-typed sugar (`Date` ⇒ `time`, `number`
62
+ * ⇒ `number`, `string` ⇒ `ordinal`) and wrap East expressions by their
63
+ * STATIC type (`DateTimeType` ⇒ `time`, `FloatType` / `IntegerType` ⇒
64
+ * `number`, `StringType` ⇒ `ordinal`), so a `DateTimeType` accessor keeps
65
+ * compiling unchanged; `Plan.at.time` / `.number` / `.ordinal` build one
66
+ * explicitly, and element RECORDS stored in data carry the variant itself.
67
+ *
68
+ * @property time - A UTC instant on a `time` axis
69
+ * @property number - A position on a `number` axis (day 1..8, a shift index, a distance)
70
+ * @property ordinal - A declared value on an `ordinal` axis (a workflow phase)
71
+ */
72
+ export const PlanInstantType = VariantType({ time: DateTimeType, number: FloatType, ordinal: StringType });
73
+ // ============================================================================
74
+ // The phantom axis kind — a TYPE-only brand (#631)
75
+ // ============================================================================
76
+ /**
77
+ * The phantom axis-kind brand — a `unique symbol` that exists only in the
78
+ * TYPES. Every builder result whose instants have a known kind is intersected
79
+ * with `{ readonly [PlanAxisKindBrand]?: K }` ({@link PlanKinded}): `Plan.at.time(d)`
80
+ * is `"time"`, `Plan.run({ start: r.start })` takes the kind of `r.start`'s
81
+ * static type ({@link PlanKindOf}), a `Plan.series.span` whose accessor
82
+ * returns such runs collects their kind, `Plan.axis.number(...)` declares
83
+ * `"number"` — and the root demands every series' kind lie WITHIN its
84
+ * axis's. A `"time"` series on a `"number"` axis is then a compile error at
85
+ * the `<Plan>` tag, before anything renders.
86
+ *
87
+ * @remarks
88
+ * Nothing changes at runtime or on the wire: the property is optional and
89
+ * never written. Kind-ERASED values — a stored `Plan.Types.Run`, an
90
+ * `Expr<PlanInstantType>`, an East-mapped element list, a `$.let`-bound axis
91
+ * or series list — carry no brand, are accepted on any axis, and remain the
92
+ * render-time `AXIS MISMATCH` diagnostic's job. Chart rows are erased too:
93
+ * a Chart layer's TS face does not expose its x type.
94
+ */
95
+ export const PlanAxisKindBrand = Symbol("PlanAxisKind");
96
+ /**
97
+ * The `time` axis — the explicit window, the bucket resolution, the
98
+ * resolution segment options, the observed/plan divider, and the tick format.
99
+ *
100
+ * @remarks
101
+ * Construct via `Plan.axis({ … })` (or `Plan.axis.time`). The window is a
102
+ * half-open calendar range `[min, max)` interpreted in UTC — a 12-week window
103
+ * at `week` resolution is exactly 12 columns. When a bound slice carries a
104
+ * datetime range / resolution, the slice state supersedes these initial
105
+ * values (the slice is the single source of truth for window + resolution);
106
+ * `axis` seeds the defaults and covers the unbound case. There is no fit to
107
+ * the data (#822): a canvas states its window, or binds a slice whose range
108
+ * supplies it — the same inline and paged.
109
+ *
110
+ * @property window - Explicit window `[min, max)`. `none` ⇒ the bound slice's datetime range
111
+ * @property resolution - Initial bucket unit (see {@link TimeResolutionType}); the toolbar segment overrides via slice state
112
+ * @property resolutions - Resolution segment options (e.g. `[week, day]`); `[]` ⇒ no segment shown
113
+ * @property now - The observed/plan split instant. `none` ⇒ no now-line
114
+ * @property format - Tick-label pattern override; `none` ⇒ resolution defaults matching the spec ruler (week ⇒ ISO week `"W27"`, day ⇒ uppercase weekday `"MON"`)
115
+ */
116
+ export const PlanTimeAxisType = StructType({
117
+ window: OptionType(StructType({ min: DateTimeType, max: DateTimeType })),
118
+ resolution: TimeResolutionType,
119
+ resolutions: ArrayType(TimeResolutionType),
120
+ now: OptionType(DateTimeType),
121
+ format: OptionType(StringType),
122
+ });
123
+ /**
124
+ * The `number` axis — a numeric window divided by a `step` (the
125
+ * `TimeResolution` rule, numerically): `[min, max)` ÷ `step` = `n` buckets,
126
+ * bucket edges on whole multiples of `step`.
127
+ *
128
+ * @remarks
129
+ * Construct via `Plan.axis.number({ … })`. When a bound slice carries a
130
+ * `float` / `integer` range, that range is the window (the horizon brush and
131
+ * the `[` / `]` / `n` keys write it back); `window` seeds the unbound case —
132
+ * there is no fit to the data (#822). There is no resolution segment on a
133
+ * number axis — `step` is fixed by the declaration.
134
+ *
135
+ * @property window - Explicit half-open window `[min, max)`. `none` ⇒ the bound slice's numeric range
136
+ * @property step - The bucket width (`> 0`) — `n = window ÷ step`
137
+ * @property now - The observed/plan split position. `none` ⇒ no now-line
138
+ * @property format - Tick-label format (the shared {@link ValueFormatType} — `Chart.format.*`); `none` ⇒ plain numbers
139
+ */
140
+ export const PlanNumberAxisType = StructType({
141
+ window: OptionType(StructType({ min: FloatType, max: FloatType })),
142
+ step: FloatType,
143
+ now: OptionType(FloatType),
144
+ format: OptionType(ValueFormatType),
145
+ });
146
+ /**
147
+ * The `ordinal` axis — the declared values ARE the buckets, one column each,
148
+ * in the declared order; the window is the whole list.
149
+ *
150
+ * @remarks
151
+ * Construct via `Plan.axis.ordinal({ … })`. An ordinal axis has no slice
152
+ * range arm: the horizon brush does not mount and the window keys idle — the
153
+ * list is the window. An instant naming a value outside the list positions
154
+ * nowhere (it is culled, like an instant outside a time window).
155
+ *
156
+ * @property values - The ordered labels — the bucket identities and their ruler ticks
157
+ * @property now - The observed/plan split value. `none` ⇒ no now-line
158
+ */
159
+ export const PlanOrdinalAxisType = StructType({
160
+ values: ArrayType(StringType),
161
+ now: OptionType(StringType),
162
+ });
163
+ /**
164
+ * The Plan axis declaration — ONE of the three kinds. The arm IS the
165
+ * declaration: a canvas cannot mix kinds, and every element instant on it
166
+ * must ride the same arm ({@link PlanInstantType}).
167
+ *
168
+ * @property time - A calendar axis: UTC window ÷ resolution ({@link PlanTimeAxisType})
169
+ * @property number - A numeric axis: window ÷ step ({@link PlanNumberAxisType})
170
+ * @property ordinal - A declared list of values, one bucket each ({@link PlanOrdinalAxisType})
171
+ */
172
+ export const PlanAxisType = VariantType({
173
+ time: PlanTimeAxisType,
174
+ number: PlanNumberAxisType,
175
+ ordinal: PlanOrdinalAxisType,
176
+ });
177
+ /**
178
+ * The two grains of one canvas — GROUP (heat strips) and RESOURCE (rows, the
179
+ * default).
180
+ *
181
+ * @remarks
182
+ * The grain changes rows — never the axis, the charts or the vocabulary. Set
183
+ * the initial grain via the root's `grain`; thereafter the toolbar segment
184
+ * drives it as renderer state (observe via `onGrainChange`).
185
+ *
186
+ * @property group - Every group collapsed to its summary heat strip
187
+ * @property resource - Resource rows (the default)
188
+ */
189
+ export const PlanGrainType = VariantType({ group: NullType, resource: NullType });
190
+ // ============================================================================
191
+ // Values — quantities, and how a bucket folds what falls in it (#824)
192
+ // ============================================================================
193
+ /**
194
+ * How the values that fall in one bucket fold into the one value it shows
195
+ * (#824). A canvas re-buckets every cell and chart point at the scale's
196
+ * resolution: switch WEEK → MONTH over weekly cells and each month shows ONE
197
+ * cell, the fold of its weeks, where it used to stack four.
198
+ *
199
+ * @remarks
200
+ * A bucket holding one value shows it as it is — its label, its text, its own
201
+ * instant — for every fold but `count`. A bucket holding several shows their
202
+ * fold at the bucket's start. Values with nothing in them (a `none` cell, a
203
+ * gap in a chart) are skipped; a bucket with no values left shows none.
204
+ *
205
+ * The defaults follow what the values mean: a heat cell is a level (`mean`),
206
+ * a weight cell the FRACTION of its bucket booked (`mean` — a month's fraction
207
+ * is its weeks' mean, where a sum would fill every bar), a segment the amount
208
+ * each fill holds (`sum`), a table numeral and a chart column an amount
209
+ * (`sum`), and a line or an area a level (`mean`).
210
+ *
211
+ * @property sum - The values added up
212
+ * @property mean - Their mean
213
+ * @property min - The least of them
214
+ * @property max - The greatest of them
215
+ * @property last - The one at the latest instant
216
+ * @property count - How many there are
217
+ */
218
+ export const PlanFoldType = VariantType({
219
+ sum: NullType,
220
+ mean: NullType,
221
+ min: NullType,
222
+ max: NullType,
223
+ last: NullType,
224
+ count: NullType,
225
+ });
226
+ /**
227
+ * A quantity — a number, its unit, and how it prints (#824). Runs and links
228
+ * carry one: a run's bar prints it after its label, a link prints it as its
229
+ * caption and takes its weight from it, and a parent's rollup band sums its
230
+ * runs' quantities unit by unit.
231
+ *
232
+ * @remarks
233
+ * The number is the value the canvas computes with, and the words are derived
234
+ * from it: `format` (the shared `Format.*` vocabulary, in the viewer's locale)
235
+ * prints `value`, followed by `unit`. `text` overrides the printed caption
236
+ * where the author wants their own words — the value still sums and weighs.
237
+ *
238
+ * @property value - The amount — what sums, weighs and compares
239
+ * @property unit - The unit it is in (`"k sheets"`); quantities in different units never sum together
240
+ * @property format - How `value` prints (`Format.*`); `none` ⇒ the canvas's plain number
241
+ * @property text - The caption to print instead of the formatted value and unit
242
+ */
243
+ export const PlanQuantityType = StructType({
244
+ value: FloatType,
245
+ unit: OptionType(StringType),
246
+ format: OptionType(TickFormatType),
247
+ text: OptionType(StringType),
248
+ });
249
+ /**
250
+ * The scale heat cells paint on — the value at no depth, the value at full
251
+ * depth, and the threshold at or above which a cell wears the warn ring
252
+ * (#824 names it; it used to be three loose options on the heat arm).
253
+ *
254
+ * @property min - The value painted at no depth; `none` ⇒ the least value shown
255
+ * @property max - The value painted at full depth; `none` ⇒ the greatest value shown
256
+ * @property warnAt - The warn-ring threshold (a cell at or above it rings); `none` ⇒ no ring
257
+ */
258
+ export const PlanHeatScaleType = StructType({
259
+ min: OptionType(FloatType),
260
+ max: OptionType(FloatType),
261
+ warnAt: OptionType(FloatType),
262
+ });
263
+ // ============================================================================
264
+ // Gutter — the left cell's identity vocabulary
265
+ // ============================================================================
266
+ /**
267
+ * One chart-series legend chip printed in the gutter (colour swatch + label).
268
+ *
269
+ * @property color - The swatch colour (theme token, e.g. `"teal.solid"`, or CSS colour)
270
+ * @property label - The swatch caption (e.g. `"col"`, `"trend"`)
271
+ */
272
+ export const PlanGutterSwatchType = StructType({
273
+ color: StringType,
274
+ label: StringType,
275
+ });
276
+ /**
277
+ * The gutter identity — the left cell's whole vocabulary.
278
+ *
279
+ * @remarks
280
+ * The factories flatten these fields into their input bags (`label`, `id`,
281
+ * `sub`, `value`, `meta`, `stacked`, `swatches` ride on every row factory).
282
+ *
283
+ * @property label - The row name (12.5/500; groups and names)
284
+ * @property id - `true` ⇒ the label renders as a mono row id (11.5/600 — `H1-P03`, `ON-TIME`); `false` by default
285
+ * @property sub - The muted mono sub line (`"12k/h"`, `"week · 1 lane"`)
286
+ * @property value - The right-aligned mono value slot (`"94.2%"`, `"82"`) — the same aggregate slot a table group header uses
287
+ * @property meta - The group meta line (`"8 rs · 82%"`)
288
+ * @property stacked - `true` ⇒ two-line layout (label over sub; row min-height 42px); `false` by default
289
+ * @property swatches - Chart-series legend chips printed under the label
290
+ */
291
+ export const PlanGutterType = StructType({
292
+ label: StringType,
293
+ id: BooleanType,
294
+ sub: OptionType(StringType),
295
+ value: OptionType(StringType),
296
+ meta: OptionType(StringType),
297
+ stacked: BooleanType,
298
+ swatches: ArrayType(PlanGutterSwatchType),
299
+ });
300
+ // ============================================================================
301
+ // Span-row leaf data — ports, rollup, bands
302
+ // ============================================================================
303
+ /**
304
+ * A quantity in/out port glyph on a span row — cross-row relations are
305
+ * quantity through ports, never dependency arrows.
306
+ *
307
+ * @property at - The instant the quantity moves
308
+ * @property label - Optional port caption (e.g. `"−24 k sheets"`)
309
+ */
310
+ export const PlanPortType = StructType({
311
+ at: PlanInstantType,
312
+ label: OptionType(StringType),
313
+ });
314
+ /**
315
+ * How a parent span row rolls its descendants' runs up into bands.
316
+ *
317
+ * @property union - One band per busy interval (any child busy — the default)
318
+ * @property byStatus - One thin band per status, stacked
319
+ * @property sum - Quantity series emphasis (band quantities carry the sums — feed a chart row for the full series)
320
+ */
321
+ export const PlanRollupType = VariantType({ union: NullType, byStatus: NullType, sum: NullType });
322
+ /**
323
+ * How an event kind draws on a Plan (#1190, `Plan Builder Spec.md` §5.1) — a
324
+ * kind's `draw`. A resource shows one row per way its kinds draw, and kinds
325
+ * that draw alike share it.
326
+ *
327
+ * @property span - Bars from a start to an end
328
+ * @property buckets - Tiles in bucket cells
329
+ * @property cards - Chips spanning whole buckets
330
+ * @property marks - Marks at instants
331
+ */
332
+ export const PlanDrawType = VariantType({ span: NullType, buckets: NullType, cards: NullType, marks: NullType });
333
+ // ============================================================================
334
+ // Bucket-row leaf data — cell markers + the tile geometry vocabulary
335
+ // ============================================================================
336
+ /**
337
+ * A status marker on a bucket cell — rings the cell, paints the corner status
338
+ * icon, and surfaces `message` as a hover tooltip (the Planner marker,
339
+ * verbatim).
340
+ *
341
+ * @property at - The bucket instant the marker rings
342
+ * @property lane - The lane key within the cell (`none` in an unbucketed row)
343
+ * @property status - The semantic status — drives colour + paired icon
344
+ * @property message - The tooltip text
345
+ */
346
+ export const PlanCellMarkerType = StructType({
347
+ at: PlanInstantType,
348
+ lane: OptionType(StringType),
349
+ status: StatusValueType,
350
+ message: StringType,
351
+ });
352
+ /**
353
+ * Which axis a bucket-event tile stretches to fill its cell on. Absent ⇒ the
354
+ * tile is content-sized (intrinsic).
355
+ *
356
+ * @property horizontal - Fill the cell width
357
+ * @property vertical - Fill the cell height
358
+ * @property both - Fill both axes
359
+ */
360
+ export const PlanStretchType = VariantType({ horizontal: NullType, vertical: NullType, both: NullType });
361
+ /**
362
+ * One alignment position for a tile's content along a single axis.
363
+ *
364
+ * @property start - Align to the start (left / top)
365
+ * @property center - Centre
366
+ * @property end - Align to the end (right / bottom)
367
+ */
368
+ export const PlanContentAlignType = VariantType({ start: NullType, center: NullType, end: NullType });
369
+ /**
370
+ * Where a bucket-event tile's content sits inside the tile — a two-axis
371
+ * alignment. Both axes default to `start` (top-left) when omitted.
372
+ *
373
+ * @property horizontal - Horizontal content alignment (→ `justifyContent`)
374
+ * @property vertical - Vertical content alignment (→ `alignItems`)
375
+ */
376
+ export const PlanContentType = StructType({
377
+ horizontal: OptionType(PlanContentAlignType),
378
+ vertical: OptionType(PlanContentAlignType),
379
+ });
380
+ /**
381
+ * A bucket-event tile's optional attention animation. `pulse` honours
382
+ * `prefers-reduced-motion`.
383
+ *
384
+ * @property none - No animation (the default)
385
+ * @property pulse - A gentle opacity pulse
386
+ */
387
+ export const PlanAnimationType = VariantType({ none: NullType, pulse: NullType });
388
+ // ============================================================================
389
+ // Chart-row leaf data — first-class, data-only layers
390
+ // ============================================================================
391
+ /**
392
+ * One `{t, y}` point of a Plan chart layer — the reified form every consumed
393
+ * Chart layer builder reduces to. The x accessor's arm follows its static
394
+ * type (`DateTimeType` ⇒ `time`, numeric ⇒ `number`, `StringType` ⇒
395
+ * `ordinal`) and must match the canvas axis at render.
396
+ *
397
+ * @remarks
398
+ * A `y` that is not a finite number (`NaN`) is a GAP — a missing
399
+ * observation: a line or an area breaks there instead of bridging it, a
400
+ * column draws nothing, and the value counts toward no axis domain.
401
+ *
402
+ * @property t - The instant on the shared scale
403
+ * @property y - The measure value (`NaN` ⇒ a gap)
404
+ */
405
+ export const PlanChartPointType = StructType({ t: PlanInstantType, y: FloatType });
406
+ /**
407
+ * Which y-axis a chart layer scales against. Left ticks print inside the
408
+ * gutter cell's right edge; right ticks at the plot's right edge.
409
+ *
410
+ * @property left - The left (primary) y-axis
411
+ * @property right - The right (secondary) y-axis
412
+ */
413
+ export const PlanAxisSideType = VariantType({ left: NullType, right: NullType });
414
+ /**
415
+ * A breach threshold on a chart layer — buckets/points beyond it render in
416
+ * the warn tone, and contiguous breach buckets derive the outlined breach
417
+ * rectangle at expanded density.
418
+ *
419
+ * @property above - Breach when the value exceeds this threshold
420
+ * @property below - Breach when the value falls below this threshold
421
+ */
422
+ export const PlanBreachType = VariantType({ above: FloatType, below: FloatType });
423
+ /**
424
+ * One `{t, lo, hi}` point of a band (area-range) chart layer. A bound that is
425
+ * not finite (`NaN`) makes the point a gap: the band breaks there.
426
+ *
427
+ * @property t - The instant on the shared scale
428
+ * @property lo - The lower bound
429
+ * @property hi - The upper bound
430
+ */
431
+ export const PlanChartBandPointType = StructType({ t: PlanInstantType, lo: FloatType, hi: FloatType });
432
+ /**
433
+ * A chart row's y-axis declaration — the Chart axis vocabulary
434
+ * ({@link ChartDomainType} / {@link ChartTickValuesType} /
435
+ * {@link ValueFormatType}), restricted to a value axis: only the `number`
436
+ * arms are meaningful (a Plan chart row's time axis is the shared canvas
437
+ * scale, never per-axis).
438
+ *
439
+ * @property domain - Explicit `[min, max]` extent (`none` ⇒ derived from what the row draws: its values, an area's and each column's baseline, and every column stack's ends)
440
+ * @property tickValues - Explicit tick positions printed at the gutter/plot edge (`none` ⇒ no ticks)
441
+ * @property format - Optional tick format (the shared {@link ValueFormatType} — `Chart.format.*`)
442
+ */
443
+ export const PlanChartAxisType = StructType({
444
+ domain: OptionType(ChartDomainType),
445
+ tickValues: OptionType(ChartTickValuesType),
446
+ format: OptionType(ValueFormatType),
447
+ });
448
+ /**
449
+ * One data-only chart layer on a chart row — the reified form of a consumed
450
+ * `Chart.*` layer builder. The canvas renders every mark itself against the
451
+ * shared scale; nothing of `ChartSpec` reaches the Plan IR.
452
+ *
453
+ * @remarks
454
+ * Renderer vocabulary (fixed by the spec, not the IR): lines draw solid ≤ now
455
+ * and dashed after; columns observed `ink`, planned brand at half strength,
456
+ * breach warn; stacked columns pair by `series`, each value axis stacking on
457
+ * its own — positive parts up from the baseline, negative parts down;
458
+ * refLines are dotted gridlines with a mono label. Every mark sits at its
459
+ * true instant — a point beyond the window keeps its position and the plot
460
+ * clips it. Hovering a bucket reads each data layer's value there.
461
+ * `Chart.Bar` (horizontal) is a build-time error on every axis kind —
462
+ * horizontal bars flip the frame the shared axis owns.
463
+ *
464
+ * A line, an area and a column series FOLD what falls in one bucket (#824):
465
+ * at a coarser resolution than its points, a column series draws one column
466
+ * per bucket — the `sum` of its points there by default — and a line or an
467
+ * area one vertex — their `mean` ({@link PlanFoldType}). Scatter points and
468
+ * bands draw every point where it is.
469
+ *
470
+ * @property line - A continuous line series (optional breach threshold; folds by `mean`)
471
+ * @property area - A filled area series (folds by `mean`)
472
+ * @property column - Per-bucket columns (optional stack `series` id + breach; folds by `sum`)
473
+ * @property scatter - Point markers
474
+ * @property band - A filled range (lo/hi per instant)
475
+ * @property refLine - A horizontal reference line at a y value (dotted, mono label)
476
+ * @property refBand - A vertical reference band between two instants
477
+ * @property refDot - A reference marker at an instant × y value
478
+ */
479
+ export const PlanChartLayerType = VariantType({
480
+ line: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType,
481
+ breach: OptionType(PlanBreachType), fold: PlanFoldType }),
482
+ area: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType, fold: PlanFoldType }),
483
+ column: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType,
484
+ series: OptionType(StringType), breach: OptionType(PlanBreachType), fold: PlanFoldType }),
485
+ scatter: StructType({ points: ArrayType(PlanChartPointType), axis: PlanAxisSideType }),
486
+ band: StructType({ points: ArrayType(PlanChartBandPointType), axis: PlanAxisSideType }),
487
+ refLine: StructType({ y: FloatType, axis: PlanAxisSideType, label: OptionType(StringType) }),
488
+ refBand: StructType({ from: PlanInstantType, to: PlanInstantType, label: OptionType(StringType) }),
489
+ refDot: StructType({ t: PlanInstantType, y: FloatType, axis: PlanAxisSideType,
490
+ label: OptionType(StringType) }),
491
+ });
492
+ /**
493
+ * A chart row's height mode — spark (32px resting), expanded (88px), or an
494
+ * explicit height for a composed chart (via `Plan.fixed("120px")` — a CSS px
495
+ * size, the same String type as every component height).
496
+ *
497
+ * @property spark - The 32px resting sparkline density
498
+ * @property expanded - The 88px expanded density
499
+ * @property fixed - An explicit CSS px size (`"120px"`)
500
+ */
501
+ export const PlanChartHeightType = VariantType({ spark: NullType, expanded: NullType, fixed: StringType });
502
+ // ============================================================================
503
+ // Heat-row leaf data — heat depth / weight bars / segment compositions
504
+ // ============================================================================
505
+ /**
506
+ * One heat cell — a per-bucket scalar rendered as colour depth.
507
+ *
508
+ * @property at - The bucket instant
509
+ * @property value - The scalar (`none` ⇒ the 45° no-data hatch + `–`)
510
+ * @property label - Optional printed value text (shown when the cell is ≥ 12px tall); without one, a cell prints
511
+ * its value only when its arm declares a `format` (#824)
512
+ */
513
+ export const PlanHeatCellType = StructType({
514
+ at: PlanInstantType,
515
+ value: OptionType(FloatType),
516
+ label: OptionType(StringType),
517
+ });
518
+ /**
519
+ * One weight cell — a per-bucket booked-vs-free bar (the Matrix weight-bar
520
+ * recipe). Planned buckets render pale.
521
+ *
522
+ * @property at - The bucket instant
523
+ * @property fraction - The 0..1 filled fraction
524
+ * @property planned - `true` ⇒ the pale planned treatment
525
+ */
526
+ export const PlanWeightCellType = StructType({
527
+ at: PlanInstantType,
528
+ fraction: FloatType,
529
+ planned: BooleanType,
530
+ });
531
+ /**
532
+ * One segment of a segment-cell bar (the Matrix segment recipe).
533
+ *
534
+ * @property fill - The status-leveraged fill (see `MatrixFillType`)
535
+ * @property weight - The proportional weight (normalised with siblings)
536
+ * @property label - Optional in-bar % text (printed when the segment is wide enough)
537
+ */
538
+ export const PlanSegmentType = StructType({
539
+ fill: MatrixFillType,
540
+ weight: FloatType,
541
+ label: OptionType(StringType),
542
+ });
543
+ /**
544
+ * One segment cell — a per-bucket composition bar.
545
+ *
546
+ * @property at - The bucket instant
547
+ * @property segments - The weighted segments
548
+ */
549
+ export const PlanSegmentCellType = StructType({
550
+ at: PlanInstantType,
551
+ segments: ArrayType(PlanSegmentType),
552
+ });
553
+ /**
554
+ * A heat row's cells — one of the three Matrix-borrowed cell recipes, each
555
+ * declaring how a bucket folds the cells that fall in it and how their values
556
+ * print (#824).
557
+ *
558
+ * @remarks
559
+ * `heat` carries the scale its own cells paint on ({@link PlanHeatScaleType}:
560
+ * `min`/`max`, defaulting to the extent shown, and the `warnAt` ring). Group
561
+ * summary strips (§5) are exactly the `heat` arm computed over descendants.
562
+ *
563
+ * `fold` ({@link PlanFoldType}) is how a coarser resolution than the cells'
564
+ * shows them — one cell per bucket: heat `mean` and weight `mean` by default
565
+ * (a level and a fraction), segments `sum` (each fill's weight adds up, then
566
+ * normalises). `format` prints the arm's values where the canvas prints one:
567
+ * a heat cell without a `label` of its own, a folded or derived heat cell, and
568
+ * the words a reader hears for a weight or a segment share.
569
+ *
570
+ * @property heat - Colour-depth cells, their scale, fold (`mean`) and format
571
+ * @property weight - Booked-vs-free weight bars, their fold (`mean`) and format
572
+ * @property segments - Weighted segment compositions, their fold (`sum`) and format
573
+ */
574
+ export const PlanHeatCellsType = VariantType({
575
+ heat: StructType({ cells: ArrayType(PlanHeatCellType), scale: PlanHeatScaleType,
576
+ fold: PlanFoldType, format: OptionType(TickFormatType) }),
577
+ weight: StructType({ cells: ArrayType(PlanWeightCellType),
578
+ fold: PlanFoldType, format: OptionType(TickFormatType) }),
579
+ segments: StructType({ cells: ArrayType(PlanSegmentCellType),
580
+ fold: PlanFoldType, format: OptionType(TickFormatType) }),
581
+ });
582
+ /**
583
+ * How a parent heat row derives its per-bucket cells from its children.
584
+ *
585
+ * @property mean - The per-bucket mean over children
586
+ * @property max - The per-bucket maximum
587
+ * @property sum - The per-bucket sum
588
+ */
589
+ export const PlanAggregateType = VariantType({ mean: NullType, max: NullType, sum: NullType });
590
+ /**
591
+ * What a collapsed group strip shows (#824) — ONE declaration, where there
592
+ * used to be two independent options (explicit cells, and an aggregate) that
593
+ * could both be set.
594
+ *
595
+ * @property none - A plain band
596
+ * @property cells - Explicit strip cells
597
+ * @property aggregate - Cells the canvas derives from the members' heat cells, per bucket
598
+ */
599
+ export const PlanGroupSummaryType = VariantType({
600
+ none: NullType,
601
+ cells: PlanHeatCellsType,
602
+ aggregate: PlanAggregateType,
603
+ });
604
+ // ============================================================================
605
+ // Table-row leaf data — bucketed numerals
606
+ // ============================================================================
607
+ /**
608
+ * A table cell's semantic tone.
609
+ *
610
+ * @property neg - Negative emphasis (shortfalls print in the negative ink)
611
+ * @property muted - Muted (the no-data em-dash)
612
+ */
613
+ export const PlanTableToneType = VariantType({ neg: NullType, muted: NullType });
614
+ /**
615
+ * One table-row cell — a per-bucket numeral.
616
+ *
617
+ * @remarks
618
+ * The RENDERER prints `value` through the row's `format` (the shared
619
+ * {@link ValueFormatType}); `text` is an explicit display override and
620
+ * `tone` an explicit tone override (else negatives derive `neg`, `none`
621
+ * the muted em-dash).
622
+ *
623
+ * @property at - The bucket instant
624
+ * @property value - The numeric value (`none` ⇒ the muted em-dash)
625
+ * @property text - Optional explicit display override
626
+ * @property tone - Optional explicit semantic tone override
627
+ */
628
+ export const PlanTableCellType = StructType({
629
+ at: PlanInstantType,
630
+ value: OptionType(FloatType),
631
+ text: OptionType(StringType),
632
+ tone: OptionType(PlanTableToneType),
633
+ });
634
+ /**
635
+ * How a multi-series table row lays its per-bucket values out — side by side
636
+ * (`horizontal`, the default) or stacked lines (`vertical`; the row grows to
637
+ * fit the stack).
638
+ *
639
+ * @property horizontal - Values print side by side in the right-aligned cell
640
+ * @property vertical - Values stack as lines (the row grows)
641
+ */
642
+ export const PlanTableSplitType = VariantType({ horizontal: NullType, vertical: NullType });
643
+ /**
644
+ * One value series of a table row — its own raw cells plus the POSITION's
645
+ * style declarations. Style is declared ONCE per series (wire-lean — never
646
+ * replicated per cell); the cells stay raw values, with the same rare
647
+ * per-cell `text`/`tone` overrides a single-series cell has.
648
+ *
649
+ * @property cells - The series' per-bucket cells (raw values)
650
+ * @property format - Numeral format override for this series (`none` ⇒ the row's `format`)
651
+ * @property tone - Default tone for the series' values (per-cell tones and derived neg/muted win)
652
+ * @property strong - Semibold emphasis for this series' values (`false` by default)
653
+ * @property rollup - `true` ⇒ this series feeds declared parent aggregation — flag none and every series does (`false` by default)
654
+ * @property fold - How a bucket folds the cells that fall in it at a coarser resolution ({@link PlanFoldType}; `sum` by default, #824)
655
+ */
656
+ export const PlanTableSeriesType = StructType({
657
+ cells: ArrayType(PlanTableCellType),
658
+ format: OptionType(TickFormatType),
659
+ tone: OptionType(PlanTableToneType),
660
+ strong: BooleanType,
661
+ rollup: BooleanType,
662
+ fold: PlanFoldType,
663
+ });
664
+ /**
665
+ * A table row's emphasis — body, header (caption-styled numerals) or footer
666
+ * (the 2px top rule).
667
+ *
668
+ * @property body - A plain body row
669
+ * @property header - The caption-styled header emphasis
670
+ * @property footer - The footer emphasis (2px top rule, bold numerals)
671
+ */
672
+ export const PlanTableEmphasisType = VariantType({ body: NullType, header: NullType, footer: NullType });
673
+ // ============================================================================
674
+ // Event-row leaf data — the mark kind
675
+ // ============================================================================
676
+ /**
677
+ * An event mark's kind — ● milestone, ◇/◆ decision (pending / applied), or
678
+ * ▲ exception.
679
+ *
680
+ * @property milestone - A milestone dot (`--ink-4`)
681
+ * @property decision - A decision diamond; `applied` fills it
682
+ * @property exception - A warn exception triangle
683
+ */
684
+ export const PlanEventMarkKindType = VariantType({
685
+ milestone: NullType,
686
+ decision: StructType({ applied: BooleanType }),
687
+ exception: NullType,
688
+ });
689
+ // ============================================================================
690
+ // Refs + callback payloads
691
+ // ============================================================================
692
+ /**
693
+ * A row's identity (#822) — which series made it, and the path of entry keys
694
+ * that leads to it. Every callback that names a row (`onSelect`, an element
695
+ * ref's `row`, `links`, `expand`) carries this; `Plan.ref` /
696
+ * `Plan.sectionRef` build one.
697
+ *
698
+ * @remarks
699
+ * A path segment is an entry's key: at the top level the source key — the
700
+ * String itself, or its `.east` text (`printFor(K)`) for any other key type —
701
+ * and below that a `Dict` child's key or an `Array` child's index. A path is
702
+ * unique by construction (keys within a collection, indices within an array),
703
+ * and series keys are unique across the whole series tree, so two rows can
704
+ * share an id only when a hand-built `Plan.series.rows` repeats a key — which
705
+ * renders as a row diagnostic, never a silent drop.
706
+ *
707
+ * A drag grammar `CellRef.row` carries the id's canonical text
708
+ * (`printFor(PlanRowIdType)`), so the shared drag grammar stays string-based.
709
+ *
710
+ * @property entry - A row made from a source entry (or a hand-built row): `{ series, path }` — `["H1"]`, `["H1", "p03"]`
711
+ * @property section - A section header (`Plan.series.section`), at its parent's path
712
+ */
713
+ export const PlanRowIdType = VariantType({
714
+ entry: StructType({ series: StringType, path: ArrayType(StringType) }),
715
+ section: StructType({ series: StringType, path: ArrayType(StringType) }),
716
+ });
717
+ /**
718
+ * One run, by reference — its row's id and its key. What a `run` element ref
719
+ * carries, and what a link's two ends are.
720
+ *
721
+ * @property row - The row's id
722
+ * @property run - The run key
723
+ */
724
+ export const PlanRunRefType = StructType({ row: PlanRowIdType, run: StringType });
725
+ /**
726
+ * One canvas element, by reference — what the root's ONE element callback
727
+ * (`onElementClick`, #824) and its generalized `popover` / `hover` resolvers
728
+ * (`Plan Data Interface.md` §3.3) are called with. Each ref carries the row's
729
+ * id plus the element's key, so one function covers every element kind.
730
+ *
731
+ * @remarks
732
+ * Span decision diamonds ride the `mark` arm (mark keys are unique per row).
733
+ * A cell names its bucket by its instant (on the axis's arm), never an index:
734
+ * the cell's own instant, or — for a bucket that folds several cells — the
735
+ * bucket's start. A link names itself by its key and its two ends; it belongs
736
+ * to no one row. A resolver returning `none` for a ref opens no surface —
737
+ * per-element presence is the author's decision, made lazily at interaction
738
+ * time.
739
+ *
740
+ * @property run - A span run bar (`{ row, run }`)
741
+ * @property event - A bucket-event tile (`{ row, event }`)
742
+ * @property chip - A cards chip (`{ row, chip }`)
743
+ * @property mark - An event-row mark or span decision diamond (`{ row, mark }`)
744
+ * @property cell - A heat / table / weight / segment bucket cell (`{ row, at }`)
745
+ * @property link - A link ribbon (`{ key, from, to }` — the runs it joins)
746
+ */
747
+ export const PlanElementRefType = VariantType({
748
+ run: PlanRunRefType,
749
+ event: StructType({ row: PlanRowIdType, event: StringType }),
750
+ chip: StructType({ row: PlanRowIdType, chip: StringType }),
751
+ mark: StructType({ row: PlanRowIdType, mark: StringType }),
752
+ cell: StructType({ row: PlanRowIdType, at: PlanInstantType }),
753
+ link: StructType({ key: StringType, from: PlanRunRefType, to: PlanRunRefType }),
754
+ });
755
+ /**
756
+ * The `onGroupToggle` payload — a row with children was expanded or collapsed
757
+ * (fires after the in-place swap).
758
+ *
759
+ * @property row - The row's id
760
+ * @property expanded - The new expansion state
761
+ */
762
+ export const PlanGroupToggleEventType = StructType({ row: PlanRowIdType, expanded: BooleanType });
763
+ // ============================================================================
764
+ // Editing — the gestures a draft is made by (#880)
765
+ // ============================================================================
766
+ /**
767
+ * A library card dropped on a row (#880) — what an editable series' `create`
768
+ * builds its new item from.
769
+ *
770
+ * @remarks
771
+ * `at` is the start of the bucket the card landed in, on the axis's arm (a
772
+ * time axis's UTC instant, a number axis's bucket start, an ordinal axis's
773
+ * value) — the same instant a `cell` element ref reports.
774
+ *
775
+ * @property from - The card — the library that declared it and its item key
776
+ * @property row - The row it landed on
777
+ * @property at - The start of the bucket it landed in
778
+ * @property duplicate - Whether the drag was an alt-drag copy
779
+ */
780
+ export const PlanDropType = StructType({
781
+ from: LibraryRefType,
782
+ row: PlanRowIdType,
783
+ at: PlanInstantType,
784
+ duplicate: BooleanType,
785
+ });
786
+ /**
787
+ * A run, chip, tile or mark moved or resized (#825) — where its item goes and
788
+ * the instants it takes there, which the series write into the fields they
789
+ * declare (`edit: { key, start, end }`, or `at`).
790
+ *
791
+ * @remarks
792
+ * `key` is the element's key, which is its item's (`edit.key` names the item's
793
+ * key field). A move along its own row, or a resize, has `to` equal to `from`,
794
+ * and sets the item's instants where it is. A move to another row takes the
795
+ * item out of the list it was in and puts it, with its new instants, into the
796
+ * target row's list — even when the two rows come from different entries,
797
+ * which is then one gesture over both. A point element (a tile, a mark) moves
798
+ * to `start`, and `end` repeats it. A row's list keeps its keys unique, so a
799
+ * move onto a row whose list already holds the key is refused.
800
+ *
801
+ * @property key - The element's key — its item's key
802
+ * @property from - The row it was on
803
+ * @property to - The row it goes to — `from` itself for a resize, or a move along its row
804
+ * @property start - Its start after the gesture (a point element's instant)
805
+ * @property end - Its end after the gesture (a point element's instant again)
806
+ */
807
+ export const PlanMoveType = StructType({
808
+ key: StringType,
809
+ from: PlanRowIdType,
810
+ to: PlanRowIdType,
811
+ start: PlanInstantType,
812
+ end: PlanInstantType,
813
+ });
814
+ /**
815
+ * A gesture on the canvas — what one draft is made by (#880). A series writes
816
+ * it into the entry its row came from, through the fields it declares: a drop
817
+ * into its `edit.items`, a move into the item's instant fields (and, across
818
+ * rows, into another row's list — #825).
819
+ *
820
+ * @property drop - A library card dropped on a row
821
+ * @property move - A run, chip, tile or mark moved or resized ({@link PlanMoveType}, #825)
822
+ */
823
+ export const PlanGestureType = VariantType({
824
+ drop: PlanDropType,
825
+ move: PlanMoveType,
826
+ });
827
+ /**
828
+ * How a row's elements move (#825) — present when its series declares the
829
+ * instant fields a move writes (`edit: { key, start, end }`, or `at`).
830
+ *
831
+ * @remarks
832
+ * `items` is the East type of the row's items, as East prints it: a run, chip,
833
+ * tile or mark moves onto another row only when that row's items are the same
834
+ * type, since the item itself changes lists. `resize` says whether the
835
+ * elements have two ends to drag (a run, a chip) or one instant (a tile, a
836
+ * mark).
837
+ *
838
+ * @property items - The row's item type, printed — rows of one item type share it
839
+ * @property resize - Whether its elements have a start and an end to resize
840
+ */
841
+ export const PlanMoveEditsType = StructType({
842
+ items: StringType,
843
+ resize: BooleanType,
844
+ });
845
+ /**
846
+ * Which gestures a row takes (#880) — whether its series declares the fields
847
+ * each one writes, so the canvas offers only what a draft can hold: a card
848
+ * lands only on a `drop` row, and an element is picked up only on a `move`
849
+ * row (#825).
850
+ *
851
+ * @property drop - Its series names where a dropped card lands and how it becomes an item (`edit.create`)
852
+ * @property move - Its series names the item fields a move writes (`edit.key` and `start` / `end`, or `at`) — {@link PlanMoveEditsType}
853
+ */
854
+ export const PlanRowEditsType = StructType({
855
+ drop: BooleanType,
856
+ move: OptionType(PlanMoveEditsType),
857
+ });
858
+ /**
859
+ * The entries in one window a paged canvas reads — it pages its source at
860
+ * `w × PLAN_PAGE_SIZE`, and the editing session reads an entry back from the
861
+ * very window it came from, so a gesture never waits on a new request (#880).
862
+ */
863
+ export const PLAN_PAGE_SIZE = 200;
864
+ // ============================================================================
865
+ // The bound UI state (#824)
866
+ // ============================================================================
867
+ /**
868
+ * The canvas's interaction state, as a host holds it — the value behind a
869
+ * root's bound `ui` ({@link PlanUiBindType}). Bound, the canvas reads it and
870
+ * writes the user's actions back to it: a host selects a row, opens or folds
871
+ * one, expands a chart or brings a row into view from outside (a deep link, a
872
+ * list beside the canvas), and reads what the user did.
873
+ *
874
+ * @remarks
875
+ * Rows are named by their typed ids ({@link PlanRowIdType}) in lists — an
876
+ * East `Set` needs an immutable element type, and an id's path is an `Array`.
877
+ * The canvas treats each list as a set, keeps the order of what it finds there
878
+ * and adds what is new at the end.
879
+ *
880
+ * A row's collapse is the one it DECLARES (`collapsed`, per row) until
881
+ * someone decides otherwise: `collapsed` lists the rows folded against it
882
+ * or by the user, `expanded` the rows opened, and a row in neither follows its
883
+ * declaration — so binding `ui` changes nothing about a canvas until someone
884
+ * acts, and a row a paged window has not landed yet still folds as it
885
+ * declares. A row in both lists is collapsed.
886
+ *
887
+ * `focus` is a REQUEST, not a state: write a row's id and the canvas brings
888
+ * that row into view (opening the rows it nests under, and on a paged canvas
889
+ * loading its window — through the source's `seek` for a row it has not
890
+ * loaded yet), makes it the row the keyboard starts from, and clears the
891
+ * request (`none`). A row it cannot find clears it too.
892
+ *
893
+ * @property selected - The selected row (`none` ⇒ no selection)
894
+ * @property collapsed - Rows folded — overriding what they declare
895
+ * @property expanded - Rows opened — overriding what they declare
896
+ * @property charts - Chart rows expanded from spark to full height
897
+ * @property focus - A row to bring into view — spent (`none`) once the canvas has
898
+ */
899
+ export const PlanUiStateType = StructType({
900
+ selected: OptionType(PlanRowIdType),
901
+ collapsed: ArrayType(PlanRowIdType),
902
+ expanded: ArrayType(PlanRowIdType),
903
+ charts: ArrayType(PlanRowIdType),
904
+ focus: OptionType(PlanRowIdType),
905
+ });
906
+ /**
907
+ * A bound {@link PlanUiStateType} — EXACTLY `State.bind`'s handle at it, so
908
+ * `State.bind([Plan.Types.UiState], key, Plan.uiState())` passes straight
909
+ * through as a root's `ui` (#824).
910
+ *
911
+ * @remarks
912
+ * Field order is `read` / `write` / `has`: East struct subtyping is exact, so
913
+ * declaring the shape here means a change to `State.bind`'s fails this file's
914
+ * build rather than a canvas's.
915
+ *
916
+ * @property read - The current state
917
+ * @property write - Replace it
918
+ * @property has - Whether the key is set
919
+ */
920
+ export const PlanUiBindType = StructType({
921
+ read: FunctionType([], PlanUiStateType),
922
+ write: FunctionType([PlanUiStateType], NullType),
923
+ has: FunctionType([], BooleanType),
924
+ });
925
+ // ============================================================================
926
+ // Footer + style
927
+ // ============================================================================
928
+ /**
929
+ * One status-footer item (mono 10px). Items with `end: true` right-align.
930
+ *
931
+ * @property text - The footer text (`"512 RESOURCES · 12 GROUPS · 3 IN VIEW"`)
932
+ * @property tone - Optional status tint (`warning` for the exceptions count)
933
+ * @property end - `true` ⇒ pushed to the right edge (`false` by default)
934
+ */
935
+ export const PlanFooterItemType = StructType({
936
+ text: StringType,
937
+ tone: OptionType(StatusValueType),
938
+ end: BooleanType,
939
+ });
940
+ /**
941
+ * The Plan style — uniform sizing (#320), density, and the gutter width.
942
+ *
943
+ * @property height - Definite height (`"fill"` fills the parent); header chrome pinned, body scrolls within
944
+ * @property maxHeight - Max-height cap; content-sized up to it, then scrolls
945
+ * @property density - Row rhythm (`compact` ⇒ dense 24px span rows)
946
+ * @property gutterWidth - Explicit gutter width, a CSS px size (`"168px"`; default 168)
947
+ */
948
+ export const PlanStyleType = StructType({
949
+ height: OptionType(StringType),
950
+ maxHeight: OptionType(StringType),
951
+ density: OptionType(DensityType),
952
+ gutterWidth: OptionType(StringType),
953
+ });
954
+ // ============================================================================
955
+ // Links + expand — the plain vocabulary
956
+ // ============================================================================
957
+ /**
958
+ * One quantity link between two runs — the Plan's edge vocabulary. The root's
959
+ * `links` graph carries them and the links-focus control gathers a row's
960
+ * transitive upstream/downstream family over these edges. Each edge renders as
961
+ * an arrow out of its source run's end and into its destination run's start,
962
+ * each as it draws; its geometry is fixed by the links spec and lives in the
963
+ * renderer, and nothing of it leaves the plot.
964
+ *
965
+ * @remarks
966
+ * The quantity is a number with its unit and format (#824): its value's third
967
+ * of the family's largest sets the link's weight (2, 4 or 8), and its caption —
968
+ * `text`, else the value formatted with its unit — prints on the link, on a
969
+ * paper knockout. A link without one draws at the thinnest weight (1.5) and
970
+ * prints nothing. A click on a link reports the `link` arm of the element ref,
971
+ * which names the link by its `key`.
972
+ *
973
+ * @property key - The link's identity (what a `link` element ref names it by)
974
+ * @property from - The source run (`{ row, run }` — the link leaves its end)
975
+ * @property to - The destination run (the link enters at its start)
976
+ * @property quantity - The moved quantity (the link's weight and caption)
977
+ */
978
+ export const PlanLinkType = StructType({
979
+ key: StringType,
980
+ from: PlanRunRefType,
981
+ to: PlanRunRefType,
982
+ quantity: OptionType(PlanQuantityType),
983
+ });
984
+ /**
985
+ * How a row's expand-in-place developer render treats the shared axis lines
986
+ * (grid columns + the now-line) INSIDE the expanded row — the ruler above
987
+ * never moves.
988
+ *
989
+ * @property keep - Run the grid + now-line through the render (the default)
990
+ * @property dim - Wash them to 40% behind dense content
991
+ * @property off - Suppress them inside the row only
992
+ */
993
+ export const PlanExpandAxisType = VariantType({ keep: NullType, dim: NullType, off: NullType });
994
+ // ============================================================================
995
+ // Elements + rows — the data-only row vocabulary (pageable dataset shapes)
996
+ // ============================================================================
997
+ /**
998
+ * One span run — a continuous `[start, end)` state-run bar
999
+ * (`"RUN · J-4642 · 96 k sheets"`). Runs are quantity-bearing states, not tasks: no
1000
+ * dependency arrows, no critical path.
1001
+ *
1002
+ * @remarks
1003
+ * `quantity` is ONE value (#824, {@link PlanQuantityType}): the bar prints its
1004
+ * caption after the label (the muted `.q` suffix, `"96 k sheets"`), and a parent's
1005
+ * rollup band sums its runs' values unit by unit. `state` is the shared
1006
+ * `EventStateType` lifecycle driving the bar recipe; `status: warning` adds
1007
+ * the `.stuck` warn ring; `moved` collapses same-status churn to a `moved ×k`
1008
+ * counter. Rich click/hover surfaces resolve through the ROOT's `popover` /
1009
+ * `hover` functions with the `run` arm of {@link PlanElementRefType}.
1010
+ */
1011
+ export const PlanRunType = StructType({
1012
+ key: StringType,
1013
+ start: PlanInstantType,
1014
+ end: PlanInstantType,
1015
+ label: StringType,
1016
+ quantity: OptionType(PlanQuantityType),
1017
+ state: EventStateType,
1018
+ status: OptionType(StatusValueType),
1019
+ moved: OptionType(IntegerType),
1020
+ icon: OptionType(IconType),
1021
+ });
1022
+ /**
1023
+ * One decision mark — the ◇/◆ diamond sitting on the run transition it
1024
+ * fires (`applied` fills it). Decision detail resolves through the root's
1025
+ * `popover` with the `mark` arm of {@link PlanElementRefType}.
1026
+ */
1027
+ export const PlanDecisionMarkType = StructType({
1028
+ key: StringType,
1029
+ at: PlanInstantType,
1030
+ applied: BooleanType,
1031
+ });
1032
+ /**
1033
+ * One bucket-event tile — the full Planner point-event grammar carried over
1034
+ * whole (everything `PlannerEventType` had except `endSlot` — multi-bucket
1035
+ * spans are span rows; the slot coordinate is the shared
1036
+ * {@link PlanInstantType}).
1037
+ *
1038
+ * @remarks
1039
+ * `label: none` ⇒ the resting look — a ✓ chip for confirmed/actual, the
1040
+ * dashed `plan` chip for proposed. `icon` with `label: none` ⇒ an icon-only
1041
+ * tile. In a laned row, `lane: none` is the mixed grammar — the tile takes
1042
+ * the full cell across lanes. Rich surfaces resolve through the root's
1043
+ * `popover` / `hover` with the `event` arm of {@link PlanElementRefType}.
1044
+ */
1045
+ export const PlanBucketEventType = StructType({
1046
+ key: StringType,
1047
+ at: PlanInstantType,
1048
+ lane: OptionType(StringType),
1049
+ label: OptionType(StringType),
1050
+ icon: OptionType(IconType),
1051
+ state: EventStateType,
1052
+ tone: OptionType(StatusValueType),
1053
+ color: OptionType(StringType),
1054
+ colorPalette: OptionType(ColorSchemeType),
1055
+ stretch: OptionType(PlanStretchType),
1056
+ content: OptionType(PlanContentType),
1057
+ animation: OptionType(PlanAnimationType),
1058
+ });
1059
+ /**
1060
+ * One cards chip — a Roster shift chip spanning whole buckets. `confirmed`
1061
+ * renders the brand-tint chip, proposals dashed (`+64h`),
1062
+ * `proposed(removed)` the warn strikethrough, `estimated` the faint ghost a
1063
+ * tap would accept. Chip detail resolves through the root's `popover` with
1064
+ * the `chip` arm of {@link PlanElementRefType}.
1065
+ */
1066
+ export const PlanChipType = StructType({
1067
+ key: StringType,
1068
+ from: PlanInstantType,
1069
+ to: PlanInstantType,
1070
+ label: StringType,
1071
+ state: EventStateType,
1072
+ icon: OptionType(IconType),
1073
+ });
1074
+ /**
1075
+ * One event-row mark — ● milestone · ◇/◆ decision · ▲ exception at an
1076
+ * instant. Clusters collapse to `◇ ×3` in the renderer; labels print when
1077
+ * there is room. `icon` swaps the kind's default glyph for an FA icon
1078
+ * (12px, still kind-coloured) — hosts choose the glyph, never the geometry.
1079
+ * Mark detail resolves through the root's `popover` with the `mark` arm of
1080
+ * {@link PlanElementRefType}.
1081
+ */
1082
+ export const PlanEventMarkType = StructType({
1083
+ key: StringType,
1084
+ at: PlanInstantType,
1085
+ kind: PlanEventMarkKindType,
1086
+ icon: OptionType(IconType),
1087
+ label: OptionType(StringType),
1088
+ });
1089
+ /**
1090
+ * One bucket-row lane — a sub-slot within each column cell (`AM`/`PM`).
1091
+ * `label: none` renders an unlabelled lane strip.
1092
+ */
1093
+ export const PlanLaneType = StructType({
1094
+ key: StringType,
1095
+ label: OptionType(StringType),
1096
+ });
1097
+ /**
1098
+ * A row's expand-in-place declaration (R2) — pure data: the row grows and
1099
+ * the ROOT's `expandRender` resolver builds the mounted body when the
1100
+ * `expand` control fires. `height` is the developer region's minimum, a CSS
1101
+ * px size (`none` ⇒ the renderer default); `axis` chooses how the shared
1102
+ * grid + now-line run through the focused row's own plot.
1103
+ */
1104
+ export const PlanExpandType = StructType({
1105
+ height: OptionType(StringType),
1106
+ axis: PlanExpandAxisType,
1107
+ });
1108
+ /**
1109
+ * The eight-arm row kind — `group · span · buckets · chart · heat · table ·
1110
+ * cards · events` — each keeping its source component's rendered surface.
1111
+ *
1112
+ * @remarks
1113
+ * `span` positions continuously (real instants, may cross bucket edges);
1114
+ * `buckets` / `heat` / `table` / `cards` quantise to the bucket grid;
1115
+ * `chart` draws per-bucket and continuous marks; `events` places instant
1116
+ * marks; `group` is the heterogeneous container whose collapsed form is
1117
+ * its `summary` heat strip. Whether a row with children starts collapsed is
1118
+ * the ROW's `collapsed` (every kind may have children, #822).
1119
+ *
1120
+ * A span parent's rollup bands sum its runs' quantities unit by unit — the
1121
+ * unit rides each quantity (#824). A heat parent's derived cells paint on the
1122
+ * kind's `scale` (#824 — it used to ride an empty cells arm). A chart row's
1123
+ * height is its `height` mode (`fixed` is its px), `expandedHeight` what the
1124
+ * expanded state opens to, and `expandable` whether the user may toggle it.
1125
+ */
1126
+ export const PlanRowKindType = VariantType({
1127
+ group: StructType({
1128
+ summary: PlanGroupSummaryType,
1129
+ }),
1130
+ span: StructType({
1131
+ runs: ArrayType(PlanRunType),
1132
+ decisions: ArrayType(PlanDecisionMarkType),
1133
+ ports: ArrayType(PlanPortType),
1134
+ rollup: OptionType(PlanRollupType),
1135
+ }),
1136
+ buckets: StructType({
1137
+ lanes: ArrayType(PlanLaneType),
1138
+ events: ArrayType(PlanBucketEventType),
1139
+ markers: ArrayType(PlanCellMarkerType),
1140
+ }),
1141
+ chart: StructType({
1142
+ layers: ArrayType(PlanChartLayerType),
1143
+ left: OptionType(PlanChartAxisType),
1144
+ right: OptionType(PlanChartAxisType),
1145
+ height: PlanChartHeightType,
1146
+ /** Height the EXPANDED state opens to, a CSS px size like every
1147
+ * component height (`"120px"`; `none` ⇒ the 88px default). */
1148
+ expandedHeight: OptionType(StringType),
1149
+ expandable: BooleanType,
1150
+ }),
1151
+ heat: StructType({
1152
+ cells: PlanHeatCellsType,
1153
+ aggregate: OptionType(PlanAggregateType),
1154
+ /** The scale a parent's DERIVED cells paint on (#824); `none` ⇒ the extent they span. */
1155
+ scale: OptionType(PlanHeatScaleType),
1156
+ }),
1157
+ table: StructType({
1158
+ series: ArrayType(PlanTableSeriesType),
1159
+ split: PlanTableSplitType,
1160
+ aggregate: OptionType(TableAggregateType),
1161
+ format: OptionType(TickFormatType),
1162
+ emphasis: PlanTableEmphasisType,
1163
+ }),
1164
+ cards: StructType({
1165
+ chips: ArrayType(PlanChipType),
1166
+ }),
1167
+ events: StructType({
1168
+ marks: ArrayType(PlanEventMarkType),
1169
+ }),
1170
+ });
1171
+ /**
1172
+ * One canvas row — a pure-data, storable, pageable dataset element (no
1173
+ * `UIComponentType`, no `FunctionType`).
1174
+ *
1175
+ * @remarks
1176
+ * Rows ride the canvas's STREAM ({@link PlanRowsCollectionType}), whose order
1177
+ * is the render order. `id` is the row's typed identity and `parent` the id of
1178
+ * the row it nests under — the tree the renderer derives aggregates from and
1179
+ * collapses by. A parent precedes its descendants, but they need not follow it
1180
+ * directly: an entry's children under `Plan.series.views` come after ALL of
1181
+ * that entry's view rows while nesting under the first of them. `collapsed` is
1182
+ * the initial state of a row that has children; `pinned` rows render above
1183
+ * the virtualised body under the ruler (both `false` unless declared, #824);
1184
+ * `height` is a fixed CSS-px override; `status` the quiet gutter dot;
1185
+ * `expand` the R2 declaration (the render itself is the root's
1186
+ * `expandRender` resolver); `edits` the gestures the row takes (#880 —
1187
+ * neither, unless its series declares the fields they write).
1188
+ */
1189
+ export const PlanRowType = StructType({
1190
+ id: PlanRowIdType,
1191
+ parent: OptionType(PlanRowIdType),
1192
+ gutter: PlanGutterType,
1193
+ kind: PlanRowKindType,
1194
+ collapsed: BooleanType,
1195
+ pinned: BooleanType,
1196
+ height: OptionType(StringType),
1197
+ status: OptionType(StatusValueType),
1198
+ expand: OptionType(PlanExpandType),
1199
+ edits: PlanRowEditsType,
1200
+ });
1201
+ /**
1202
+ * The canvas's rows — an ordered STREAM (#822). The stream IS the render
1203
+ * order: the top-level series each contribute one contiguous block in
1204
+ * declared order, and a parent is followed by its subtree.
1205
+ *
1206
+ * @remarks
1207
+ * It used to be a `Dict` keyed by a row string, so the canvas sat in KEY
1208
+ * order and authors numbered their keys to get a layout; two series emitting
1209
+ * the same key silently lost a row. Identity is now the typed
1210
+ * {@link PlanRowIdType}, which is unique by construction, and order is the
1211
+ * series list's.
1212
+ */
1213
+ export const PlanRowsCollectionType = ArrayType(PlanRowType);
1214
+ /**
1215
+ * One BLOCK of the canvas's rows (#823) — the unit a paged canvas pages.
1216
+ *
1217
+ * @remarks
1218
+ * The series list lays the canvas out block by block, top to bottom. A data
1219
+ * series (`span`, `buckets`, `chart`, `heat`, `table`, `cards`, `events`,
1220
+ * `group`, `views`) is one block of its entries' rows, each entry's row
1221
+ * followed by its subtree: a window of a paged source holds its entries'
1222
+ * share, and a paged canvas pages each such block on its own over the one
1223
+ * source. A section's header and a `Plan.series.rows` block are FIXED — no
1224
+ * entry produces them, so every window serves them alike and the canvas draws
1225
+ * them once. A section is its header's block followed by its members' blocks,
1226
+ * so the series inside a section page on their own too: inline or paged, the
1227
+ * canvas draws the same rows in the same order.
1228
+ *
1229
+ * @property fixed - `true` when no entry produces the rows — a section's header, hand-built rows — so every window serves them alike
1230
+ * @property parent - The row the block's top rows nest under — the header of the section it sits in — or `none` at the top of the canvas
1231
+ * @property rows - The block's rows, in stream order
1232
+ */
1233
+ export const PlanBlockType = StructType({
1234
+ fixed: BooleanType,
1235
+ parent: OptionType(PlanRowIdType),
1236
+ rows: PlanRowsCollectionType,
1237
+ });
1238
+ /**
1239
+ * The canvas's BLOCKS (#823), in layout order — the series list's blocks, one
1240
+ * after another ({@link PlanBlockType}).
1241
+ *
1242
+ * @remarks
1243
+ * The blocks travel apart rather than concatenated so a paged canvas can page
1244
+ * each one on its own. A window of a paged source is every block's share of
1245
+ * that window's entries, so ONE read of a window serves every block, while
1246
+ * each block keeps its own residency over the source. Inline, the blocks are
1247
+ * the whole canvas, drawn one after another: the same rows in the same order
1248
+ * either way.
1249
+ */
1250
+ export const PlanBlocksType = ArrayType(PlanBlockType);
1251
+ /**
1252
+ * The paged source of a `data` + `series` canvas — the SHARED row-source
1253
+ * contract ({@link PagedSourceType}) instantiated at the canvas's BLOCKS
1254
+ * (`Plan Data Interface.md` §3.8). The factory builds it from the author's
1255
+ * source (a `Data.bindPaged` handle — paged data is bound) by wrapping each
1256
+ * window with the series' `derive` functions, so the renderer only ever sees
1257
+ * typed canvas-row windows — no bytes and no domain types. A window is the
1258
+ * canvas's blocks over that window's entries: each data series' block holds
1259
+ * the rows it derives from them, every entry with its whole subtree, and each
1260
+ * fixed block its rows as ever (#823).
1261
+ */
1262
+ export const PlanPagedSourceType = PagedSourceType(PlanBlocksType);
1263
+ /**
1264
+ * The root's rows channel — the shared {@link RowSourceType} at the canvas's
1265
+ * BLOCKS: `inline` blocks (what a `data`+`series` canvas over a collection
1266
+ * collapses to) or a `paged` source serving a window of every block at once.
1267
+ * One vocabulary across every collection, so a component never sniffs shapes
1268
+ * of its own (#567).
1269
+ */
1270
+ export const PlanRowsType = RowSourceType(PlanBlocksType);
1271
+ // ============================================================================
1272
+ // The editing wire (#880) — what the canvas hands the shared session
1273
+ // ============================================================================
1274
+ /**
1275
+ * What a Plan's `editing.onPatch` receives for entries of `R` (#880) — the
1276
+ * shared patch event (`Editing.Types.PatchEvent`) over the Plan's drafts,
1277
+ * which are whole entries (`Editing.Types.DraftField(R)`): every gesture
1278
+ * writes a complete entry, so a draft is always its `value`.
1279
+ *
1280
+ * @typeParam R - The entry type
1281
+ * @param entryType - The canvas's entry type
1282
+ * @returns The patch event type
1283
+ */
1284
+ export function PlanPatchEventTypeFor(entryType) {
1285
+ return EditingPatchEventTypeWith(entryType, EditingDraftFieldType(entryType));
1286
+ }
1287
+ /**
1288
+ * One entry's gesture, to be written (#880) — the entry's id (its key's text),
1289
+ * its bytes, the rows the gesture was made on, and the gesture. A move to
1290
+ * another row writes the entry holding its source row, then the one holding
1291
+ * its target (#825) — one request when both rows are the same entry's.
1292
+ *
1293
+ * @internal
1294
+ * @property id - The entry's id — its key, as a row path's first segment spells it
1295
+ * @property entry - The entry as it stands now (its draft, else the source's), encoded
1296
+ * @property rows - The rows the gesture was made on — one, or a move's source then target
1297
+ * @property gesture - The gesture
1298
+ */
1299
+ export const PlanWriteRequestType = StructType({
1300
+ id: StringType,
1301
+ entry: BlobType,
1302
+ rows: ArrayType(PlanRowIdType),
1303
+ gesture: PlanGestureType,
1304
+ });
1305
+ /**
1306
+ * A drafted entry the author's readiness check reads (#880).
1307
+ *
1308
+ * @internal
1309
+ * @property id - The entry's id
1310
+ * @property entry - The drafted entry, encoded
1311
+ */
1312
+ export const PlanReadyEntryType = StructType({ id: StringType, entry: BlobType });
1313
+ const PlanEditingTypeImpl = StructType({
1314
+ ...EditingSessionFields,
1315
+ derive: FunctionType([IntegerType, IntegerType, DictType(StringType, BlobType)], OptionType(PlanBlocksType)),
1316
+ deriveEntry: FunctionType([StringType, BlobType], PlanBlocksType),
1317
+ write: FunctionType([ArrayType(PlanWriteRequestType)], ArrayType(OptionType(BlobType))),
1318
+ entryIds: FunctionType([IntegerType, IntegerType], OptionType(ArrayType(StringType))),
1319
+ ready: OptionType(FunctionType([ArrayType(PlanReadyEntryType)], ArrayType(EditingReadinessType))),
1320
+ });
1321
+ /**
1322
+ * The Plan's editing declaration, on the wire (#880) — the shared session's
1323
+ * fields ({@link EditingSessionFields}) and the canvas's own. Every value
1324
+ * crosses as bytes at the exact entry type the wire names, so the payload
1325
+ * stays a closed type whatever the canvas's entries are.
1326
+ *
1327
+ * @internal
1328
+ * @property derive - The canvas's blocks with drafted entries in place of the source's — `(offset, limit, drafts by id)`: inline the whole source (offset and limit unread), paged the window `(offset, limit)`, `none` while it is in flight. The series applied to the drafted entries, so a draft draws exactly as the applied batch would.
1329
+ * @property deriveEntry - One entry's blocks — `(id, entry)` — the rows a draft is compared by, where it was made
1330
+ * @property write - Gestures written into their entries — each request's entry, or `none` when no series takes it; a move carries its item from the request holding its source row to the one holding its target, and is refused whole (every result `none`) unless both take it — a target whose list already holds the item's key does not (#825)
1331
+ * @property entryIds - The ids of the source's entries `[offset, offset + limit)`, `none` while in flight — how the session reads an entry back after an Apply
1332
+ * @property ready - The author's readiness check over drafted entries, one result each, in order
1333
+ */
1334
+ export const PlanEditingType = PlanEditingTypeImpl;
1335
+ //# sourceMappingURL=types.js.map