@elaraai/east-ui 1.0.80 → 1.0.82

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 (353) hide show
  1. package/dist/src/charts/chart/index.d.ts +4 -0
  2. package/dist/src/charts/chart/index.d.ts.map +1 -1
  3. package/dist/src/charts/spec/index.d.ts +8 -0
  4. package/dist/src/charts/spec/index.d.ts.map +1 -1
  5. package/dist/src/collections/deck/index.d.ts +8 -0
  6. package/dist/src/collections/deck/index.d.ts.map +1 -1
  7. package/dist/src/collections/index.d.ts +2 -2
  8. package/dist/src/collections/index.d.ts.map +1 -1
  9. package/dist/src/collections/index.js.map +1 -1
  10. package/dist/src/collections/library/index.d.ts +4 -0
  11. package/dist/src/collections/library/index.d.ts.map +1 -1
  12. package/dist/src/collections/library/types.d.ts +4 -0
  13. package/dist/src/collections/library/types.d.ts.map +1 -1
  14. package/dist/src/collections/matrix/index.d.ts +56 -19
  15. package/dist/src/collections/matrix/index.d.ts.map +1 -1
  16. package/dist/src/collections/matrix/index.js +38 -24
  17. package/dist/src/collections/matrix/index.js.map +1 -1
  18. package/dist/src/collections/plan/assemble.d.ts +655 -2113
  19. package/dist/src/collections/plan/assemble.d.ts.map +1 -1
  20. package/dist/src/collections/plan/assemble.js +159 -136
  21. package/dist/src/collections/plan/assemble.js.map +1 -1
  22. package/dist/src/collections/plan/builders.d.ts +193 -40
  23. package/dist/src/collections/plan/builders.d.ts.map +1 -1
  24. package/dist/src/collections/plan/builders.js +162 -32
  25. package/dist/src/collections/plan/builders.js.map +1 -1
  26. package/dist/src/collections/plan/factories.d.ts +290 -116
  27. package/dist/src/collections/plan/factories.d.ts.map +1 -1
  28. package/dist/src/collections/plan/factories.js +281 -156
  29. package/dist/src/collections/plan/factories.js.map +1 -1
  30. package/dist/src/collections/plan/index.d.ts +111 -58
  31. package/dist/src/collections/plan/index.d.ts.map +1 -1
  32. package/dist/src/collections/plan/index.js +62 -31
  33. package/dist/src/collections/plan/index.js.map +1 -1
  34. package/dist/src/collections/plan/ir.d.ts +759 -1769
  35. package/dist/src/collections/plan/ir.d.ts.map +1 -1
  36. package/dist/src/collections/plan/ir.js +51 -27
  37. package/dist/src/collections/plan/ir.js.map +1 -1
  38. package/dist/src/collections/plan/pick.d.ts +89 -71
  39. package/dist/src/collections/plan/pick.d.ts.map +1 -1
  40. package/dist/src/collections/plan/pick.js +101 -86
  41. package/dist/src/collections/plan/pick.js.map +1 -1
  42. package/dist/src/collections/plan/root.d.ts +164 -77
  43. package/dist/src/collections/plan/root.d.ts.map +1 -1
  44. package/dist/src/collections/plan/root.js +350 -42
  45. package/dist/src/collections/plan/root.js.map +1 -1
  46. package/dist/src/collections/plan/series.d.ts +12524 -10527
  47. package/dist/src/collections/plan/series.d.ts.map +1 -1
  48. package/dist/src/collections/plan/series.js +1596 -298
  49. package/dist/src/collections/plan/series.js.map +1 -1
  50. package/dist/src/collections/plan/types.d.ts +6115 -2802
  51. package/dist/src/collections/plan/types.d.ts.map +1 -1
  52. package/dist/src/collections/plan/types.js +575 -170
  53. package/dist/src/collections/plan/types.js.map +1 -1
  54. package/dist/src/collections/sheet/bridge.d.ts +154 -43
  55. package/dist/src/collections/sheet/bridge.d.ts.map +1 -1
  56. package/dist/src/collections/sheet/bridge.js +383 -240
  57. package/dist/src/collections/sheet/bridge.js.map +1 -1
  58. package/dist/src/collections/sheet/columns.d.ts +66 -16
  59. package/dist/src/collections/sheet/columns.d.ts.map +1 -1
  60. package/dist/src/collections/sheet/columns.js +25 -25
  61. package/dist/src/collections/sheet/columns.js.map +1 -1
  62. package/dist/src/collections/sheet/context-bridge.d.ts +48 -0
  63. package/dist/src/collections/sheet/context-bridge.d.ts.map +1 -0
  64. package/dist/src/collections/sheet/context-bridge.js +216 -0
  65. package/dist/src/collections/sheet/context-bridge.js.map +1 -0
  66. package/dist/src/collections/sheet/draft-bridge.d.ts +37 -0
  67. package/dist/src/collections/sheet/draft-bridge.d.ts.map +1 -0
  68. package/dist/src/collections/sheet/draft-bridge.js +153 -0
  69. package/dist/src/collections/sheet/draft-bridge.js.map +1 -0
  70. package/dist/src/collections/sheet/drafts.d.ts +14 -0
  71. package/dist/src/collections/sheet/drafts.d.ts.map +1 -0
  72. package/dist/src/collections/sheet/drafts.js +14 -0
  73. package/dist/src/collections/sheet/drafts.js.map +1 -0
  74. package/dist/src/collections/sheet/editing-bridge.d.ts +36 -0
  75. package/dist/src/collections/sheet/editing-bridge.d.ts.map +1 -0
  76. package/dist/src/collections/sheet/editing-bridge.js +196 -0
  77. package/dist/src/collections/sheet/editing-bridge.js.map +1 -0
  78. package/dist/src/collections/sheet/editing-types.d.ts +268 -0
  79. package/dist/src/collections/sheet/editing-types.d.ts.map +1 -0
  80. package/dist/src/collections/sheet/editing-types.js +34 -0
  81. package/dist/src/collections/sheet/editing-types.js.map +1 -0
  82. package/dist/src/collections/sheet/edits.d.ts +37 -0
  83. package/dist/src/collections/sheet/edits.d.ts.map +1 -0
  84. package/dist/src/collections/sheet/edits.js +31 -0
  85. package/dist/src/collections/sheet/edits.js.map +1 -0
  86. package/dist/src/collections/sheet/group.d.ts +165 -0
  87. package/dist/src/collections/sheet/group.d.ts.map +1 -0
  88. package/dist/src/collections/sheet/group.js +52 -0
  89. package/dist/src/collections/sheet/group.js.map +1 -0
  90. package/dist/src/collections/sheet/index.d.ts +171 -27
  91. package/dist/src/collections/sheet/index.d.ts.map +1 -1
  92. package/dist/src/collections/sheet/index.js +99 -17
  93. package/dist/src/collections/sheet/index.js.map +1 -1
  94. package/dist/src/collections/sheet/link.d.ts +22 -16
  95. package/dist/src/collections/sheet/link.d.ts.map +1 -1
  96. package/dist/src/collections/sheet/link.js +18 -12
  97. package/dist/src/collections/sheet/link.js.map +1 -1
  98. package/dist/src/collections/sheet/registers.d.ts +152 -5
  99. package/dist/src/collections/sheet/registers.d.ts.map +1 -1
  100. package/dist/src/collections/sheet/registers.js +154 -5
  101. package/dist/src/collections/sheet/registers.js.map +1 -1
  102. package/dist/src/collections/sheet/root.d.ts +175 -26
  103. package/dist/src/collections/sheet/root.d.ts.map +1 -1
  104. package/dist/src/collections/sheet/root.js +150 -26
  105. package/dist/src/collections/sheet/root.js.map +1 -1
  106. package/dist/src/collections/sheet/seed-bridge.d.ts +14 -0
  107. package/dist/src/collections/sheet/seed-bridge.d.ts.map +1 -0
  108. package/dist/src/collections/sheet/seed-bridge.js +51 -0
  109. package/dist/src/collections/sheet/seed-bridge.js.map +1 -0
  110. package/dist/src/collections/sheet/sub-rows.d.ts +249 -0
  111. package/dist/src/collections/sheet/sub-rows.d.ts.map +1 -0
  112. package/dist/src/collections/sheet/sub-rows.js +222 -0
  113. package/dist/src/collections/sheet/sub-rows.js.map +1 -0
  114. package/dist/src/collections/sheet/transactions.d.ts +76 -0
  115. package/dist/src/collections/sheet/transactions.d.ts.map +1 -0
  116. package/dist/src/collections/sheet/transactions.js +40 -0
  117. package/dist/src/collections/sheet/transactions.js.map +1 -0
  118. package/dist/src/collections/sheet/types.d.ts +12034 -3651
  119. package/dist/src/collections/sheet/types.d.ts.map +1 -1
  120. package/dist/src/collections/sheet/types.js +365 -48
  121. package/dist/src/collections/sheet/types.js.map +1 -1
  122. package/dist/src/collections/table/index.d.ts +98 -123
  123. package/dist/src/collections/table/index.d.ts.map +1 -1
  124. package/dist/src/collections/table/index.js +97 -111
  125. package/dist/src/collections/table/index.js.map +1 -1
  126. package/dist/src/collections/table/types.d.ts +87 -31
  127. package/dist/src/collections/table/types.d.ts.map +1 -1
  128. package/dist/src/collections/table/types.js +51 -26
  129. package/dist/src/collections/table/types.js.map +1 -1
  130. package/dist/src/collections/value-tree/flatten.d.ts.map +1 -1
  131. package/dist/src/collections/value-tree/flatten.js +4 -1
  132. package/dist/src/collections/value-tree/flatten.js.map +1 -1
  133. package/dist/src/component.d.ts +5075 -4079
  134. package/dist/src/component.d.ts.map +1 -1
  135. package/dist/src/component.js +46 -46
  136. package/dist/src/component.js.map +1 -1
  137. package/dist/src/contracts/approval.d.ts +10 -8
  138. package/dist/src/contracts/approval.d.ts.map +1 -1
  139. package/dist/src/contracts/approval.js +10 -8
  140. package/dist/src/contracts/approval.js.map +1 -1
  141. package/dist/src/contracts/drag.d.ts +11 -9
  142. package/dist/src/contracts/drag.d.ts.map +1 -1
  143. package/dist/src/contracts/drag.js +28 -21
  144. package/dist/src/contracts/drag.js.map +1 -1
  145. package/dist/src/contracts/editing.d.ts +1283 -0
  146. package/dist/src/contracts/editing.d.ts.map +1 -0
  147. package/dist/src/contracts/editing.js +711 -0
  148. package/dist/src/contracts/editing.js.map +1 -0
  149. package/dist/src/contracts/index.d.ts +2 -1
  150. package/dist/src/contracts/index.d.ts.map +1 -1
  151. package/dist/src/contracts/index.js +2 -1
  152. package/dist/src/contracts/index.js.map +1 -1
  153. package/dist/src/contracts/pick.d.ts +6 -7
  154. package/dist/src/contracts/pick.d.ts.map +1 -1
  155. package/dist/src/contracts/pick.js +6 -7
  156. package/dist/src/contracts/pick.js.map +1 -1
  157. package/dist/src/contracts/review.d.ts +3 -1
  158. package/dist/src/contracts/review.d.ts.map +1 -1
  159. package/dist/src/contracts/review.js +3 -1
  160. package/dist/src/contracts/review.js.map +1 -1
  161. package/dist/src/contracts/source.d.ts +270 -80
  162. package/dist/src/contracts/source.d.ts.map +1 -1
  163. package/dist/src/contracts/source.js +357 -58
  164. package/dist/src/contracts/source.js.map +1 -1
  165. package/dist/src/display/chip-rail/index.d.ts.map +1 -1
  166. package/dist/src/display/chip-rail/index.js +10 -10
  167. package/dist/src/display/chip-rail/index.js.map +1 -1
  168. package/dist/src/extension.d.ts +2 -1
  169. package/dist/src/extension.d.ts.map +1 -1
  170. package/dist/src/extension.js +2 -1
  171. package/dist/src/extension.js.map +1 -1
  172. package/dist/src/format/index.d.ts +1 -154
  173. package/dist/src/format/index.d.ts.map +1 -1
  174. package/dist/src/format/types.d.ts +35 -23
  175. package/dist/src/format/types.d.ts.map +1 -1
  176. package/dist/src/format/types.js +16 -14
  177. package/dist/src/format/types.js.map +1 -1
  178. package/dist/src/forms/field/index.js +4 -4
  179. package/dist/src/forms/field/index.js.map +1 -1
  180. package/dist/src/forms/file-upload/index.js +16 -16
  181. package/dist/src/forms/file-upload/index.js.map +1 -1
  182. package/dist/src/index.d.ts +4 -2
  183. package/dist/src/index.d.ts.map +1 -1
  184. package/dist/src/index.js +12 -5
  185. package/dist/src/index.js.map +1 -1
  186. package/dist/src/internal.d.ts +8 -3
  187. package/dist/src/internal.d.ts.map +1 -1
  188. package/dist/src/internal.js +11 -3
  189. package/dist/src/internal.js.map +1 -1
  190. package/dist/src/layout/box/index.d.ts.map +1 -1
  191. package/dist/src/layout/box/index.js +47 -47
  192. package/dist/src/layout/box/index.js.map +1 -1
  193. package/dist/src/layout/flex/index.d.ts.map +1 -1
  194. package/dist/src/layout/flex/index.js +47 -47
  195. package/dist/src/layout/flex/index.js.map +1 -1
  196. package/dist/src/layout/grid/index.js +11 -11
  197. package/dist/src/layout/grid/index.js.map +1 -1
  198. package/dist/src/layout/scroll-area/index.d.ts.map +1 -1
  199. package/dist/src/layout/scroll-area/index.js +8 -8
  200. package/dist/src/layout/scroll-area/index.js.map +1 -1
  201. package/dist/src/layout/separator/index.d.ts.map +1 -1
  202. package/dist/src/layout/separator/index.js +6 -6
  203. package/dist/src/layout/separator/index.js.map +1 -1
  204. package/dist/src/layout/stack/index.d.ts.map +1 -1
  205. package/dist/src/layout/stack/index.js +46 -46
  206. package/dist/src/layout/stack/index.js.map +1 -1
  207. package/dist/src/layout/sticky/index.d.ts.map +1 -1
  208. package/dist/src/layout/sticky/index.js +8 -8
  209. package/dist/src/layout/sticky/index.js.map +1 -1
  210. package/dist/src/overlays/action-bar/index.d.ts.map +1 -1
  211. package/dist/src/overlays/action-bar/index.js +8 -8
  212. package/dist/src/overlays/action-bar/index.js.map +1 -1
  213. package/dist/src/platform/index.d.ts +1 -1
  214. package/dist/src/platform/index.d.ts.map +1 -1
  215. package/dist/src/platform/index.js +1 -1
  216. package/dist/src/platform/index.js.map +1 -1
  217. package/dist/src/platform/slice/impl.d.ts +62 -51
  218. package/dist/src/platform/slice/impl.d.ts.map +1 -1
  219. package/dist/src/platform/slice/impl.js +155 -72
  220. package/dist/src/platform/slice/impl.js.map +1 -1
  221. package/dist/src/platform/slice/index.d.ts +3744 -2226
  222. package/dist/src/platform/slice/index.d.ts.map +1 -1
  223. package/dist/src/platform/slice/index.js +43 -1
  224. package/dist/src/platform/slice/index.js.map +1 -1
  225. package/dist/src/runtime/collections/deck.d.ts +4 -0
  226. package/dist/src/runtime/collections/deck.d.ts.map +1 -1
  227. package/dist/src/runtime/collections/matrix.d.ts +10 -9
  228. package/dist/src/runtime/collections/matrix.d.ts.map +1 -1
  229. package/dist/src/runtime/collections/matrix.js +11 -6
  230. package/dist/src/runtime/collections/matrix.js.map +1 -1
  231. package/dist/src/runtime/collections/plan.d.ts +148 -65
  232. package/dist/src/runtime/collections/plan.d.ts.map +1 -1
  233. package/dist/src/runtime/collections/plan.js +155 -67
  234. package/dist/src/runtime/collections/plan.js.map +1 -1
  235. package/dist/src/runtime/collections/sheet.d.ts +56 -23
  236. package/dist/src/runtime/collections/sheet.d.ts.map +1 -1
  237. package/dist/src/runtime/collections/sheet.js +30 -22
  238. package/dist/src/runtime/collections/sheet.js.map +1 -1
  239. package/dist/src/runtime/collections/table.d.ts +18 -11
  240. package/dist/src/runtime/collections/table.d.ts.map +1 -1
  241. package/dist/src/runtime/collections/table.js +7 -4
  242. package/dist/src/runtime/collections/table.js.map +1 -1
  243. package/dist/src/shared/reify.d.ts +4 -46
  244. package/dist/src/shared/reify.d.ts.map +1 -1
  245. package/dist/src/shared/reify.js +4 -61
  246. package/dist/src/shared/reify.js.map +1 -1
  247. package/dist/src/shared/tree.d.ts +88 -0
  248. package/dist/src/shared/tree.d.ts.map +1 -0
  249. package/dist/src/shared/tree.js +134 -0
  250. package/dist/src/shared/tree.js.map +1 -0
  251. package/dist/src/slice/breakdown/index.d.ts +4 -0
  252. package/dist/src/slice/breakdown/index.d.ts.map +1 -1
  253. package/dist/src/slice/breakdown/types.d.ts +4 -0
  254. package/dist/src/slice/breakdown/types.d.ts.map +1 -1
  255. package/dist/src/slice/cohort/index.d.ts +24 -4
  256. package/dist/src/slice/cohort/index.d.ts.map +1 -1
  257. package/dist/src/slice/cohort/index.js +8 -4
  258. package/dist/src/slice/cohort/index.js.map +1 -1
  259. package/dist/src/slice/cohort/types.d.ts +11 -0
  260. package/dist/src/slice/cohort/types.d.ts.map +1 -1
  261. package/dist/src/slice/cohort/types.js +7 -0
  262. package/dist/src/slice/cohort/types.js.map +1 -1
  263. package/dist/src/slice/filter/index.d.ts +4 -0
  264. package/dist/src/slice/filter/index.d.ts.map +1 -1
  265. package/dist/src/slice/filter/types.d.ts +4 -0
  266. package/dist/src/slice/filter/types.d.ts.map +1 -1
  267. package/dist/src/slice/index.d.ts +736 -0
  268. package/dist/src/slice/index.d.ts.map +1 -1
  269. package/dist/src/slice/legend/index.d.ts +4 -0
  270. package/dist/src/slice/legend/index.d.ts.map +1 -1
  271. package/dist/src/slice/legend/types.d.ts +4 -0
  272. package/dist/src/slice/legend/types.d.ts.map +1 -1
  273. package/dist/src/slice/rail/index.d.ts +8 -4
  274. package/dist/src/slice/rail/index.d.ts.map +1 -1
  275. package/dist/src/slice/rail/index.js.map +1 -1
  276. package/dist/src/slice/range/index.d.ts +4 -0
  277. package/dist/src/slice/range/index.d.ts.map +1 -1
  278. package/dist/src/slice/range/types.d.ts +4 -0
  279. package/dist/src/slice/range/types.d.ts.map +1 -1
  280. package/dist/src/slice/search/index.d.ts +4 -0
  281. package/dist/src/slice/search/index.d.ts.map +1 -1
  282. package/dist/src/slice/search/types.d.ts +4 -0
  283. package/dist/src/slice/search/types.d.ts.map +1 -1
  284. package/dist/src/slice/summary/index.d.ts +4 -0
  285. package/dist/src/slice/summary/index.d.ts.map +1 -1
  286. package/dist/src/slice/summary/types.d.ts +4 -0
  287. package/dist/src/slice/summary/types.d.ts.map +1 -1
  288. package/dist/src/typography/code/index.js +1 -1
  289. package/dist/src/typography/code/index.js.map +1 -1
  290. package/dist/src/typography/code-block/index.js +7 -7
  291. package/dist/src/typography/code-block/index.js.map +1 -1
  292. package/dist/src/typography/heading/index.js +2 -2
  293. package/dist/src/typography/heading/index.js.map +1 -1
  294. package/dist/src/typography/list/index.js +1 -1
  295. package/dist/src/typography/list/index.js.map +1 -1
  296. package/dist/src/typography/mark/index.js +1 -1
  297. package/dist/src/typography/mark/index.js.map +1 -1
  298. package/dist/src/typography/note/index.js +1 -1
  299. package/dist/src/typography/note/index.js.map +1 -1
  300. package/dist/src/typography/numeric/index.d.ts +3 -308
  301. package/dist/src/typography/numeric/index.d.ts.map +1 -1
  302. package/dist/src/typography/numeric/index.js +4 -4
  303. package/dist/src/typography/numeric/index.js.map +1 -1
  304. package/dist/src/typography/numeric/types.d.ts +1 -154
  305. package/dist/src/typography/numeric/types.d.ts.map +1 -1
  306. package/dist/src/typography/text/index.js +1 -1
  307. package/dist/src/typography/text/index.js.map +1 -1
  308. package/dist/test/collections/matrix.examples.d.ts +7 -3
  309. package/dist/test/collections/matrix.examples.d.ts.map +1 -1
  310. package/dist/test/collections/matrix.examples.js +55 -24
  311. package/dist/test/collections/matrix.examples.js.map +1 -1
  312. package/dist/test/collections/paged-source.examples.d.ts +4 -0
  313. package/dist/test/collections/paged-source.examples.d.ts.map +1 -1
  314. package/dist/test/collections/paged-source.examples.js +98 -13
  315. package/dist/test/collections/paged-source.examples.js.map +1 -1
  316. package/dist/test/collections/plan.examples.d.ts +101 -26
  317. package/dist/test/collections/plan.examples.d.ts.map +1 -1
  318. package/dist/test/collections/plan.examples.js +1481 -755
  319. package/dist/test/collections/plan.examples.js.map +1 -1
  320. package/dist/test/collections/sheet-link.examples.d.ts +7 -0
  321. package/dist/test/collections/sheet-link.examples.d.ts.map +1 -0
  322. package/dist/test/collections/sheet-link.examples.js +41 -0
  323. package/dist/test/collections/sheet-link.examples.js.map +1 -0
  324. package/dist/test/collections/sheet-transactions.examples.d.ts +7 -0
  325. package/dist/test/collections/sheet-transactions.examples.d.ts.map +1 -0
  326. package/dist/test/collections/sheet-transactions.examples.js +58 -0
  327. package/dist/test/collections/sheet-transactions.examples.js.map +1 -0
  328. package/dist/test/collections/sheet.examples.d.ts +52 -5
  329. package/dist/test/collections/sheet.examples.d.ts.map +1 -1
  330. package/dist/test/collections/sheet.examples.js +500 -158
  331. package/dist/test/collections/sheet.examples.js.map +1 -1
  332. package/dist/test/collections/table.examples.d.ts +31 -3
  333. package/dist/test/collections/table.examples.d.ts.map +1 -1
  334. package/dist/test/collections/table.examples.js +188 -28
  335. package/dist/test/collections/table.examples.js.map +1 -1
  336. package/dist/test/contracts/editing.examples.d.ts +7 -0
  337. package/dist/test/contracts/editing.examples.d.ts.map +1 -0
  338. package/dist/test/contracts/editing.examples.js +58 -0
  339. package/dist/test/contracts/editing.examples.js.map +1 -0
  340. package/dist/test/layout/splitter.examples.d.ts.map +1 -1
  341. package/dist/test/layout/splitter.examples.js +3 -1
  342. package/dist/test/layout/splitter.examples.js.map +1 -1
  343. package/dist/test/platform/slice.examples.d.ts.map +1 -1
  344. package/dist/test/platform/slice.examples.js +1 -0
  345. package/dist/test/platform/slice.examples.js.map +1 -1
  346. package/dist/test/slice/slice.examples.d.ts.map +1 -1
  347. package/dist/test/slice/slice.examples.js +5 -2
  348. package/dist/test/slice/slice.examples.js.map +1 -1
  349. package/package.json +4 -3
  350. package/dist/src/collections/plan/data-forms.d.ts +0 -332
  351. package/dist/src/collections/plan/data-forms.d.ts.map +0 -1
  352. package/dist/src/collections/plan/data-forms.js +0 -212
  353. package/dist/src/collections/plan/data-forms.js.map +0 -1
@@ -18,13 +18,16 @@
18
18
  * This file holds only plain data and closed function types — no
19
19
  * `UIComponentType` — so `component.ts` imports it without a cycle. The
20
20
  * author-facing TYPED constructors (`Sheet.Types.Context(R, D)`, `Fill(T)`,
21
- * `Patch(R)`, `Proposal(R)`, `Edit(R)`, `CheckContext(R)`) live here too:
21
+ * `Patch(R)`, `Proposal(R)`, `CheckContext(R)`) live here too:
22
22
  * they are type-level twins of the wire types, instantiated per row type
23
23
  * (the `Plan.Types.Series(R)` pattern).
24
24
  *
25
25
  * @packageDocumentation
26
26
  */
27
- import { ArrayType, AsyncFunctionType, BooleanType, DateTimeType, DictType, EastTypeType, FloatType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, } from "@elaraai/east";
27
+ import { ArrayType, AsyncFunctionType, BooleanType, BlobType, DateTimeType, DictType, EastTypeType, FloatType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType, VariantType, } from "@elaraai/east";
28
+ import { SheetDraftTypeFor } from "./transactions.js";
29
+ import { SheetDraftGroupTypeFor } from "./drafts.js";
30
+ import { SheetEditingType } from "./editing-types.js";
28
31
  import { StatusValueType } from "../../feedback/status/types.js";
29
32
  import { TickFormatType } from "../../format/types.js";
30
33
  import { DensityType } from "../../style/interaction.js";
@@ -82,6 +85,7 @@ export const SheetLinkType = StructType({
82
85
  * the column kind's primitive; a `set` / `link` column's cell is a
83
86
  * {@link SheetLinkType} value, never a string.
84
87
  *
88
+ * @property Invalid - Unparseable draft text, retained verbatim until corrected
85
89
  * @property Null - The blank cell
86
90
  * @property Boolean - A boolean value
87
91
  * @property Integer - An integer value
@@ -91,6 +95,7 @@ export const SheetLinkType = StructType({
91
95
  * @property Link - A typed link (a `set` / `link` column's cell)
92
96
  */
93
97
  export const SheetCellType = VariantType({
98
+ Invalid: StringType,
94
99
  Null: NullType,
95
100
  Boolean: BooleanType,
96
101
  Integer: IntegerType,
@@ -99,6 +104,82 @@ export const SheetCellType = VariantType({
99
104
  DateTime: DateTimeType,
100
105
  Link: SheetLinkType,
101
106
  });
107
+ /**
108
+ * One labelled fact of a sub row's detail (#844).
109
+ *
110
+ * @property label - What the fact is (the renderer sets it in capitals)
111
+ * @property value - The fact, printed
112
+ */
113
+ export const SheetFacetType = StructType({
114
+ label: StringType,
115
+ value: StringType,
116
+ });
117
+ /**
118
+ * One SUB ROW on the wire (#844) — a read-only row under a line (or a flat
119
+ * row) that shares none of the sheet's columns: a lead (`code` and `name`),
120
+ * a detail (`chips`, then `facets`) and an `id` pinned right.
121
+ *
122
+ * @remarks
123
+ * `code` and `id` are display strings, `""` for none (the band's `sub`
124
+ * precedent). Build one with `Sheet.subRow({ … })`; declare where they come
125
+ * from with `Sheet.subRows(R, { … })`.
126
+ *
127
+ * @property code - The lead's code (`"ASM"`, or a word for what the row is); `""` for none
128
+ * @property name - The lead's words
129
+ * @property chips - The detail's parameter chips, first
130
+ * @property facets - The detail's labelled facts, after the chips
131
+ * @property id - The record the sub row traces to; `""` for none
132
+ */
133
+ export const SheetSubRowType = StructType({
134
+ code: StringType,
135
+ name: StringType,
136
+ chips: ArrayType(StringType),
137
+ facets: ArrayType(SheetFacetType),
138
+ id: StringType,
139
+ });
140
+ /**
141
+ * One LINE of a group row on the wire (#740) — its cells, addressed within
142
+ * its group by `key`.
143
+ *
144
+ * @remarks
145
+ * A line has no id of its own: its `key` is its index in the group's lines
146
+ * array, printed. The line's cells are the line columns' projection, exactly
147
+ * a flat row's `cells`.
148
+ *
149
+ * @property key - The line's address within its group
150
+ * @property cells - Column key → cell, one entry per declared line column
151
+ * @property subRows - The line's sub rows, in declaration order (#844; empty without `subRows`)
152
+ */
153
+ export const SheetLineType = StructType({
154
+ key: StringType,
155
+ cells: DictType(StringType, SheetCellType),
156
+ subRows: ArrayType(SheetSubRowType),
157
+ });
158
+ /**
159
+ * The band a group row draws above its lines (#740) — what the band shows
160
+ * beside its cells.
161
+ *
162
+ * @property sub - The eyebrow under the title (display only; `""` for none)
163
+ * @property folded - Whether the plan opens folded
164
+ */
165
+ export const SheetBandType = StructType({
166
+ sub: StringType,
167
+ folded: BooleanType,
168
+ });
169
+ /** The cell key a group row's title rides under (#740) — never a line column's key. */
170
+ export const SHEET_TITLE_CELL = "$title";
171
+ /**
172
+ * The key of an UNRENDERED cell a column's rule projects into (#844) — a
173
+ * date column's `level` / `actual`, a column's `detail`. The `$` prefix keeps
174
+ * it clear of every field name, as {@link SHEET_TITLE_CELL} is.
175
+ *
176
+ * @param rule - The rule (`"level"`, `"actual"`, `"detail"`)
177
+ * @param column - The column key
178
+ * @returns The cell key (`"$level:start"`)
179
+ */
180
+ export function sheetRuleCell(rule, column) {
181
+ return `$${rule}:${column}`;
182
+ }
102
183
  /**
103
184
  * One wire row — the closed projection of a host row.
104
185
  *
@@ -108,14 +189,28 @@ export const SheetCellType = VariantType({
108
189
  * the wire — the bridge (§4.8) reads it off the real row instead. Blank
109
190
  * padding rows are renderer state, never rows.
110
191
  *
192
+ * On a GROUPED sheet (#740) a group row's `cells` hold the band's cells (the
193
+ * group's fields under line columns, the title under
194
+ * {@link SHEET_TITLE_CELL}), `lines` its lines and `band` is `some`. On a
195
+ * flat sheet `lines` is empty and `band` is `none` — and so on a grouped
196
+ * sheet with LOOSE rows between its groups (#846): a loose row is a row of
197
+ * the line type, its `cells` the line columns' projection, with no lines
198
+ * and no band.
199
+ *
111
200
  * @property id - The row identity (the `id` field, or a keyed source's key)
112
201
  * @property owned - `true` ⇒ the row belongs to the upstream system: no copilot, stamped columns read-only
113
202
  * @property cells - Column key → cell, one entry per declared column
203
+ * @property lines - A group row's lines, in order (empty on a flat sheet, and for a loose row)
204
+ * @property band - A group row's band (`none` on a flat sheet, and for a loose row)
205
+ * @property subRows - A flat or loose row's sub rows (#844; empty for a group row, whose lines carry them)
114
206
  */
115
207
  export const SheetRowType = StructType({
116
208
  id: StringType,
117
209
  owned: BooleanType,
118
210
  cells: DictType(StringType, SheetCellType),
211
+ lines: ArrayType(SheetLineType),
212
+ band: OptionType(SheetBandType),
213
+ subRows: ArrayType(SheetSubRowType),
119
214
  });
120
215
  /**
121
216
  * The sheet's own row COLLECTION — wire rows in sheet order.
@@ -213,12 +308,14 @@ export const SheetStoreType = VariantType({ asTyped: NullType, canonical: NullTy
213
308
  * @property identified - The kind resolves by code (bare digits try the code prefix)
214
309
  * @property countable - The kind takes the counted form (`N x kind`)
215
310
  * @property resolvesTo - What a counted member of this kind resolves to later (`"machine"`)
311
+ * @property ranged - Runs of consecutive identified codes are offered and printed as one range (`M2140-45`, #844)
216
312
  */
217
313
  export const SheetMemberKindType = StructType({
218
314
  kind: StringType,
219
315
  identified: BooleanType,
220
316
  countable: BooleanType,
221
317
  resolvesTo: OptionType(StringType),
318
+ ranged: BooleanType,
222
319
  });
223
320
  /**
224
321
  * The counted-member grammar a link column declares (B§4.1).
@@ -282,20 +379,24 @@ export const SheetCountedType = StructType({ n: IntegerType, key: StringType });
282
379
  * driver lookup — so a field of the host's row that has no column keeps its
283
380
  * value in every provider, check, edit event and patch.
284
381
  *
285
- * @property rowIndex - Sheet position among REAL (resident) rows
286
- * @property rowId - The row's id — the source lookup's argument
382
+ * @property drafts - Row id → its current draft, encoded
383
+ * @property rowIndex - The row's index in `rows` (a grouped sheet: a line's index within its group)
384
+ * @property rowId - The row's id — the source lookup's argument (a grouped sheet: a line's GROUP's id, a loose row's own)
287
385
  * @property offset - The row's source offset — the paged arm's `page` lookup
288
- * @property row - The row as it would be if the open editor committed
289
- * @property rows - The resident sheet, real rows in sheet order
386
+ * @property line - A grouped sheet: the line's address within its group; `none` on a flat sheet, and for a loose row (#846)
387
+ * @property row - The row as it would be if the open editor committed (a grouped sheet: the LINE's cells)
388
+ * @property rows - The resident sheet, real rows in sheet order (a grouped sheet: the resident GROUP rows and loose rows)
290
389
  * @property rowsOffset - The source offset of `rows[0]` (`0` on the inline arm)
291
390
  * @property partial - `true` on a paged sheet whose source is not exhausted
292
391
  * @property driver - The resolved driver member's key
293
392
  * @property today - UTC midnight — so providers stay pure
294
393
  */
295
394
  export const SheetContextType = StructType({
395
+ drafts: DictType(StringType, BlobType),
296
396
  rowIndex: IntegerType,
297
397
  rowId: StringType,
298
398
  offset: IntegerType,
399
+ line: OptionType(StringType),
299
400
  row: DictType(StringType, SheetCellType),
300
401
  rows: ArrayType(SheetRowType),
301
402
  rowsOffset: IntegerType,
@@ -303,6 +404,47 @@ export const SheetContextType = StructType({
303
404
  driver: OptionType(StringType),
304
405
  today: DateTimeType,
305
406
  });
407
+ /**
408
+ * One row check of a readiness batch ({@link SheetReadyBatchType}, #882) —
409
+ * where its row sits among the batch's rows, and its driver.
410
+ * @internal
411
+ *
412
+ * @property index - The checked row's index in the batch's `rows` (a grouped sheet: a line's GROUP's)
413
+ * @property line - A grouped sheet: the checked line's index within its group; `none` on a flat sheet, and for a loose row (#846)
414
+ * @property driver - The resolved driver member's key
415
+ */
416
+ export const SheetReadyCheckType = StructType({
417
+ index: IntegerType,
418
+ line: OptionType(IntegerType),
419
+ driver: OptionType(StringType),
420
+ });
421
+ /**
422
+ * The WIRE readiness batch (#882) — every row check of one readiness
423
+ * evaluation, over the rows they share.
424
+ * @internal
425
+ *
426
+ * @remarks
427
+ * The shared fields cross the wire once, and the bridge builds the typed
428
+ * rows from them once. A check carries only its place and its driver: its
429
+ * row is the draft the bridge built at that place — the row's own cells over
430
+ * its own draft — so nothing is substituted into the rows, as a
431
+ * {@link SheetContextType}'s provisional row is.
432
+ *
433
+ * @property drafts - Row id → its current draft, encoded
434
+ * @property rows - The rows, in sheet order (a grouped sheet: the GROUP rows)
435
+ * @property rowsOffset - The source offset of `rows[0]`
436
+ * @property partial - `true` on a paged sheet whose source is not exhausted
437
+ * @property today - UTC midnight — so checks stay pure
438
+ * @property checks - The checks; their results return in this order
439
+ */
440
+ export const SheetReadyBatchType = StructType({
441
+ drafts: DictType(StringType, BlobType),
442
+ rows: ArrayType(SheetRowType),
443
+ rowsOffset: IntegerType,
444
+ partial: BooleanType,
445
+ today: DateTimeType,
446
+ checks: ArrayType(SheetReadyCheckType),
447
+ });
306
448
  /**
307
449
  * The WIRE fill — one proposed cell value with its provenance (B§5.1).
308
450
  *
@@ -360,17 +502,23 @@ export const SheetSuggestType = StructType({
360
502
  /**
361
503
  * The WIRE check context — what a bridged member check receives (B§2).
362
504
  *
363
- * @property rowIndex - Sheet position among real rows
364
- * @property rowId - The row's id (the source lookup's argument)
505
+ * @property drafts - Row id → its current draft, encoded
506
+ * @property group - A grouped sheet: the line's GROUP row; `none` on a flat sheet, and for a loose row (#846)
507
+ * @property rowIndex - Sheet position among real rows (a grouped sheet: a line's index within its group, a loose row's among the loose rows)
508
+ * @property rowId - The row's id (the source lookup's argument; a grouped sheet: a line's GROUP's id, a loose row's own)
365
509
  * @property offset - The row's source offset
366
- * @property row - The row as it would be if the editor committed
510
+ * @property line - A grouped sheet: the line's address within its group; `none` on a flat sheet, and for a loose row (#846)
511
+ * @property row - The row as it would be if the editor committed (a grouped sheet: the LINE's cells)
367
512
  * @property half - The half being edited
368
513
  * @property member - The resolved member under check
369
514
  */
370
515
  export const SheetCheckContextType = StructType({
516
+ drafts: DictType(StringType, BlobType),
517
+ group: OptionType(SheetRowType),
371
518
  rowIndex: IntegerType,
372
519
  rowId: StringType,
373
520
  offset: IntegerType,
521
+ line: OptionType(StringType),
374
522
  row: DictType(StringType, SheetCellType),
375
523
  half: SheetHalfType,
376
524
  member: SheetMemberType,
@@ -399,6 +547,25 @@ export const SheetArityType = StructType({
399
547
  // ============================================================================
400
548
  // Column kinds
401
549
  // ============================================================================
550
+ /**
551
+ * How deep a date column reads and takes a row's date (#844) —
552
+ * `Sheet.Types.DateLevel`, what a date column's `level` rule returns.
553
+ *
554
+ * @remarks
555
+ * The cell is still one UTC instant; the level says how it is printed,
556
+ * typed and compared with an `actual`.
557
+ *
558
+ * @property week - The week the date falls in (printed as its Monday)
559
+ * @property day - The day
560
+ * @property range - One end of the days the work may run in
561
+ * @property time - The day and the time of day
562
+ */
563
+ export const SheetDateLevelType = VariantType({ week: NullType, day: NullType, range: NullType, time: NullType });
564
+ /**
565
+ * A column's OPTIONS rule on the wire (#844) — the register member keys a
566
+ * row may be offered; `none` offers the whole register.
567
+ */
568
+ export const SheetOptionsRuleType = FunctionType([SheetContextType], OptionType(ArrayType(StringType)));
402
569
  /**
403
570
  * The column kind — what a column parses, displays and proposes (§3.2).
404
571
  *
@@ -410,26 +577,37 @@ export const SheetArityType = StructType({
410
577
  * applies them over the driver data, and they land as dictionaries keyed by
411
578
  * the driver member's key.
412
579
  *
580
+ * A date's `level` and `actual` and an `options` rule (#844) ride here too:
581
+ * `level` / `actual` name the unrendered cell ({@link sheetRuleCell}) the
582
+ * row projection filled, `options` is the bridged rule over the wire
583
+ * context — the renderer offers only those members, while typed text still
584
+ * resolves against the whole register.
585
+ *
413
586
  * @property text - Free text
414
- * @property date - A UTC-midnight date; `base` names the column relative entry counts from, `format` a display pattern
587
+ * @property date - A UTC-midnight date; `base` names the column relative entry counts from, `format` a display pattern, `level` the cell holding the row's {@link SheetDateLevelType} tag, `actual` the cell holding when the work really happened
415
588
  * @property quantity - A float with a unit per driver member (`uom`) and a display format
416
589
  * @property integer - A whole number
417
- * @property lookup - A scored register lookup — the driver column names the driver's register
590
+ * @property lookup - A scored register lookup — the driver column names the driver's register; `options` narrows what a row is offered
418
591
  * @property reference - A lookup over a flat member list
419
- * @property enum - An upper-cased register word with a valence dot
592
+ * @property enum - An upper-cased register word with a valence dot; `options` narrows what a row is offered
420
593
  * @property set - Comma members, the link grammar without an arrow
421
- * @property link - `from > to` — the split cell (§3.4)
594
+ * @property link - `from > to` — the split cell (§3.4); `options` narrows what a row is offered
422
595
  * @property stamped - A read-only code an upstream system owns
423
596
  * @property custom - An author parse / print pair over the field's own payload
424
597
  */
425
598
  export const SheetColumnKindType = VariantType({
426
599
  text: NullType,
427
- date: StructType({ base: OptionType(StringType), format: OptionType(StringType) }),
600
+ date: StructType({
601
+ base: OptionType(StringType),
602
+ format: OptionType(StringType),
603
+ level: OptionType(StringType),
604
+ actual: OptionType(StringType),
605
+ }),
428
606
  quantity: StructType({ uom: OptionType(DictType(StringType, StringType)), format: OptionType(TickFormatType) }),
429
607
  integer: NullType,
430
- lookup: StructType({ register: StringType }),
608
+ lookup: StructType({ register: StringType, options: OptionType(SheetOptionsRuleType) }),
431
609
  reference: StructType({ register: StringType }),
432
- enum: StructType({ register: StringType }),
610
+ enum: StructType({ register: StringType, options: OptionType(SheetOptionsRuleType) }),
433
611
  set: StructType({
434
612
  register: StringType,
435
613
  members: ArrayType(SheetMemberKindType),
@@ -444,6 +622,7 @@ export const SheetColumnKindType = VariantType({
444
622
  arity: OptionType(SheetArityType),
445
623
  check: ArrayType(SheetCheckType),
446
624
  store: SheetStoreType,
625
+ options: OptionType(SheetOptionsRuleType),
447
626
  }),
448
627
  stamped: StructType({ owner: OptionType(StringType) }),
449
628
  custom: StructType({
@@ -471,6 +650,7 @@ export const SheetColumnKindType = VariantType({
471
650
  * @property payloadType - The kind's payload type
472
651
  * @property editable - Whether the sheet writes the column
473
652
  * @property fill - The fill providers; the first that yields wins
653
+ * @property detailCell - The unrendered cell whose text is the column's detail — the hover and the strip (#844)
474
654
  */
475
655
  export const SheetColumnType = StructType({
476
656
  key: StringType,
@@ -482,6 +662,57 @@ export const SheetColumnType = StructType({
482
662
  payloadType: EastTypeType,
483
663
  editable: BooleanType,
484
664
  fill: ArrayType(SheetProviderType),
665
+ detailCell: OptionType(StringType),
666
+ });
667
+ // ============================================================================
668
+ // Grouped rows (#740) — the band's cells and the group declaration
669
+ // ============================================================================
670
+ /**
671
+ * One cell of a group row's band (#740) — a group field drawn under a line
672
+ * column (or the title), exactly a column declared over the group's row.
673
+ *
674
+ * @property key - The cell key: a line column's key, or {@link SHEET_TITLE_CELL}
675
+ * @property field - The group row's field the cell reads and writes
676
+ * @property kind - The cell's kind (the §3.2 table; no `lookup`, `set`, `link` or `custom` in a band)
677
+ * @property dataType - The group field's static type
678
+ * @property payloadType - The kind's payload type
679
+ * @property editable - Whether the band writes the field
680
+ */
681
+ export const SheetGroupCellType = StructType({
682
+ key: StringType,
683
+ field: StringType,
684
+ kind: SheetColumnKindType,
685
+ dataType: EastTypeType,
686
+ payloadType: EastTypeType,
687
+ editable: BooleanType,
688
+ });
689
+ /**
690
+ * The host's word for a group (#844) — what fold-all, the footer count, hints
691
+ * and the new-group button call a group. When the declaration names none the
692
+ * wire carries none, and the renderer says its own word — its message
693
+ * table's, so a translation reaches it (#861).
694
+ *
695
+ * @property singular - One group (`"order"`)
696
+ * @property plural - Several (`"orders"`)
697
+ */
698
+ export const SheetNounType = StructType({
699
+ singular: StringType,
700
+ plural: StringType,
701
+ });
702
+ /**
703
+ * The group declaration (#740) — how a grouped sheet's rows carry their
704
+ * lines, and what the band draws.
705
+ *
706
+ * @property lines - The group row's field that holds the lines — an `Array<L>`, so a line's key is its position
707
+ * @property cells - The band's cells, the title first under {@link SHEET_TITLE_CELL}
708
+ * @property noun - The host's word for a group (#844); `none` ⇒ the renderer's own (#861)
709
+ * @property loose - `true` ⇒ the source's entries are `Sheet.Types.Entry(P, "lines")`: a group, or a LOOSE row of the line type between the groups (#846) — a wire row with no band
710
+ */
711
+ export const SheetGroupType = StructType({
712
+ lines: StringType,
713
+ cells: ArrayType(SheetGroupCellType),
714
+ noun: OptionType(SheetNounType),
715
+ loose: BooleanType,
485
716
  });
486
717
  // ============================================================================
487
718
  // Views, edits, selection, footer, style
@@ -495,6 +726,7 @@ export const SheetColumnType = StructType({
495
726
  * @property narrowing - The slice state the view was made with
496
727
  * @property context - The lens's band width (`0` · `1` · `3`)
497
728
  * @property reveals - Revealed row indices
729
+ * @property folds - A grouped sheet's fold overrides (#740): group id → folded; a group not listed opens as its `folded` accessor says
498
730
  */
499
731
  export const SheetViewType = StructType({
500
732
  id: StringType,
@@ -502,6 +734,7 @@ export const SheetViewType = StructType({
502
734
  narrowing: SliceStateType,
503
735
  context: IntegerType,
504
736
  reveals: ArrayType(IntegerType),
737
+ folds: DictType(StringType, BooleanType),
505
738
  });
506
739
  /**
507
740
  * Where an edit came from — provenance a host can measure copilot uptake by (B§1).
@@ -521,26 +754,39 @@ export const SheetSourceType = VariantType({
521
754
  });
522
755
  /**
523
756
  * The WIRE edit event — a raw commit / insert / remove carrying the wire row
524
- * (§3.7). The author sees the typed twin, `Sheet.Types.Edit(R)`, through the
525
- * bridge.
757
+ * inside a renderer gesture. These records never call an author callback;
758
+ * the editing session emits one complete PatchEvent after the gesture.
759
+ * @internal
760
+ *
761
+ * On a grouped sheet (#740) the three row arms are the GROUP's — a band
762
+ * cell committed, a group created, groups removed — and the line arms carry
763
+ * a line's address within its group; `row` is always the whole group row.
526
764
  *
527
765
  * @property commit - One cell committed: the row AFTER the commit, and its source offset
528
766
  * @property insert - A row appended after `afterRowId` (`none` ⇒ at the end)
529
767
  * @property remove - Rows removed by id
768
+ * @property lineCommit - A line's cell committed: the GROUP row after the commit, the line's key, the column
769
+ * @property lineInsert - A line inserted into a group after `after` (`none` ⇒ first), at `line`
770
+ * @property lineRemove - Lines removed from a group, by key
530
771
  */
531
772
  export const SheetEditType = VariantType({
532
773
  commit: StructType({ rowId: StringType, offset: IntegerType, key: StringType, row: SheetRowType, source: SheetSourceType }),
533
774
  insert: StructType({ afterRowId: OptionType(StringType), row: SheetRowType, source: SheetSourceType }),
534
775
  remove: StructType({ rowIds: ArrayType(StringType) }),
776
+ lineCommit: StructType({ rowId: StringType, offset: IntegerType, line: StringType, key: StringType, row: SheetRowType, source: SheetSourceType }),
777
+ lineInsert: StructType({ rowId: StringType, offset: IntegerType, after: OptionType(StringType), line: StringType, row: SheetRowType, source: SheetSourceType }),
778
+ lineRemove: StructType({ rowId: StringType, offset: IntegerType, lines: ArrayType(StringType), row: SheetRowType }),
535
779
  });
536
780
  /**
537
781
  * The selection ring's position — `Sheet.Types.Selection`.
538
782
  *
539
- * @property rowId - The selected row (`none` ⇒ a blank padding row or nothing)
540
- * @property key - The selected column
783
+ * @property rowId - The selected row (`none` ⇒ a blank padding row or nothing); a grouped sheet: the GROUP's id
784
+ * @property line - A grouped sheet: the selected line's key within its group (`none` on the band, a blank line, or a flat sheet)
785
+ * @property key - The selected column (a band: the line column the cell sits under, or `$title`)
541
786
  */
542
787
  export const SheetSelectionType = StructType({
543
788
  rowId: OptionType(StringType),
789
+ line: OptionType(StringType),
544
790
  key: OptionType(StringType),
545
791
  });
546
792
  /**
@@ -573,9 +819,9 @@ export const SheetStyleType = StructType({
573
819
  * `Sheet` arm of `UIComponentType` references directly.
574
820
  *
575
821
  * @remarks
576
- * `onUpdate` never reaches the wire: the factory compiles it into `onEdit`
577
- * (§4.7), and a typed `onEdit` is bridged into the same closed function
578
- * (§4.8). `selection` present makes the selection controlled (§3.14).
822
+ * `editing` carries the exact schemas and checked batch callbacks. The
823
+ * live onUpdate adapter writes once per application. `selection` present
824
+ * makes the selection controlled (§3.14).
579
825
  *
580
826
  * @property rows - The row source: inline wire rows, or a paged source of them
581
827
  * @property columns - The declared columns, in order
@@ -586,10 +832,10 @@ export const SheetStyleType = StructType({
586
832
  * @property views - The saved views
587
833
  * @property activeView - The active view's id
588
834
  * @property onViewsChange - Views changed (snapshot, rename, reorder, close)
589
- * @property onEdit - The raw edit channel (`onUpdate` compiles to it)
590
835
  * @property onSelect - The ring moved
591
836
  * @property selection - Controlled selection when `some`
592
837
  * @property newRowId - Overrides the renderer's id minting for inserted rows
838
+ * @property group - The group declaration (#740); `none` on a flat sheet
593
839
  * @property readOnly - The whole sheet is read-only
594
840
  * @property blanks - Padding rows below the last real one (default 18)
595
841
  * @property density - Row rhythm
@@ -598,6 +844,7 @@ export const SheetStyleType = StructType({
598
844
  */
599
845
  export const SheetRootType = StructType({
600
846
  rows: SheetRowsType,
847
+ editing: SheetEditingType,
601
848
  columns: ArrayType(SheetColumnType),
602
849
  registers: DictType(StringType, SheetRegisterType),
603
850
  driver: OptionType(SheetDriverType),
@@ -606,10 +853,10 @@ export const SheetRootType = StructType({
606
853
  views: ArrayType(SheetViewType),
607
854
  activeView: OptionType(StringType),
608
855
  onViewsChange: OptionType(FunctionType([ArrayType(SheetViewType)], NullType)),
609
- onEdit: OptionType(FunctionType([SheetEditType], NullType)),
610
856
  onSelect: OptionType(FunctionType([SheetSelectionType], NullType)),
611
857
  selection: OptionType(SheetSelectionType),
612
858
  newRowId: OptionType(FunctionType([], StringType)),
859
+ group: OptionType(SheetGroupType),
613
860
  readOnly: OptionType(BooleanType),
614
861
  blanks: OptionType(IntegerType),
615
862
  density: OptionType(DensityType),
@@ -645,8 +892,9 @@ export const SheetRootType = StructType({
645
892
  export function SheetContextTypeFor(rowType, driverType) {
646
893
  return StructType({
647
894
  rowIndex: IntegerType,
648
- row: rowType,
649
- rows: ArrayType(rowType),
895
+ row: SheetDraftTypeFor(rowType),
896
+ rows: ArrayType(SheetDraftTypeFor(rowType)),
897
+ group: OptionType(NullType),
650
898
  partial: BooleanType,
651
899
  driver: OptionType((driverType ?? NullType)),
652
900
  today: DateTimeType,
@@ -700,26 +948,6 @@ export function SheetPatchTypeFor(rowType) {
700
948
  export function SheetProposalTypeFor(rowType) {
701
949
  return StructType({ patch: SheetPatchTypeFor(rowType), meta: StringType });
702
950
  }
703
- /**
704
- * `Sheet.Types.Edit(R)` — the raw edit event typed over the host's row
705
- * (§3.7): `commit` carries the row AFTER the commit, `insert` the new row,
706
- * `remove` the ids.
707
- *
708
- * @typeParam R - The host's row type
709
- * @param rowType - The row type value
710
- * @returns The concrete edit `VariantType`
711
- *
712
- * @property commit - One cell committed: `{ rowId, key, row, source }`
713
- * @property insert - A row inserted after `afterRowId` (`none` ⇒ at the end): `{ afterRowId, row, source }`
714
- * @property remove - Rows removed: `{ rowIds }`
715
- */
716
- export function SheetEditTypeFor(rowType) {
717
- return VariantType({
718
- commit: StructType({ rowId: StringType, key: StringType, row: rowType, source: SheetSourceType }),
719
- insert: StructType({ afterRowId: OptionType(StringType), row: rowType, source: SheetSourceType }),
720
- remove: StructType({ rowIds: ArrayType(StringType) }),
721
- });
722
- }
723
951
  /**
724
952
  * `Sheet.Types.CheckContext(R)` — what an author's member check sees (§3.4):
725
953
  * the typed row, the half and the resolved member.
@@ -736,9 +964,98 @@ export function SheetEditTypeFor(rowType) {
736
964
  export function SheetCheckContextTypeFor(rowType) {
737
965
  return StructType({
738
966
  rowIndex: IntegerType,
739
- row: rowType,
967
+ row: SheetDraftTypeFor(rowType),
968
+ group: OptionType(NullType),
740
969
  half: SheetHalfType,
741
970
  member: SheetMemberType,
742
971
  });
743
972
  }
973
+ /**
974
+ * The line type a group row's lines field holds, checked at build time.
975
+ *
976
+ * @param groupType - The group's row type value
977
+ * @param field - The lines field
978
+ * @returns The line type
979
+ * @throws Error naming the field when it is not an `Array<Struct>`
980
+ */
981
+ export function sheetLinesOf(groupType, field) {
982
+ const fields = groupType.fields;
983
+ const t = fields[field];
984
+ if (t === undefined) {
985
+ throw new Error(`Sheet: \`group\` names "${field}", which is not a field of the row type (${Object.keys(fields).join(", ")})`);
986
+ }
987
+ if (t.type === "Array" && t.value?.type === "Struct") {
988
+ return { lineType: t.value };
989
+ }
990
+ throw new Error(`Sheet: the lines field "${field}" must be an Array of row structs — got ${t.type ?? "an unknown type"}`);
991
+ }
992
+ /**
993
+ * `Sheet.Types.Context(P, "lines", D)` — the copilot context of a GROUPED
994
+ * sheet: the line as it would be, its group's lines, the group, the resident
995
+ * groups and the driver's row, all typed.
996
+ *
997
+ * @typeParam P - The group's row type
998
+ * @typeParam F - The lines field
999
+ * @typeParam D - The driver's row type
1000
+ * @param groupType - The group's row type value
1001
+ * @param lines - The lines field
1002
+ * @param driverType - The driver's row type value (default `NullType`)
1003
+ * @returns The concrete context `StructType`
1004
+ *
1005
+ * On a sheet with loose rows between its groups (#846), a LOOSE row's
1006
+ * context has no group: `rows` are the resident loose rows, `rowIndex` its
1007
+ * index among them.
1008
+ *
1009
+ * @property rowIndex - The line's index WITHIN its group (a loose row: its index in `rows`)
1010
+ * @property row - The line as it would be if the open editor committed
1011
+ * @property rows - The group's lines, in order (a loose row: the resident loose rows)
1012
+ * @property group - The group row (`none` for a loose row)
1013
+ * @property groups - The resident groups, in sheet order
1014
+ * @property partial - `true` on a paged sheet whose source is not exhausted
1015
+ * @property driver - The driver's row for `row`
1016
+ * @property today - UTC midnight
1017
+ */
1018
+ export function SheetGroupContextTypeFor(groupType, lines, driverType) {
1019
+ const { lineType } = sheetLinesOf(groupType, lines);
1020
+ return StructType({
1021
+ rowIndex: IntegerType,
1022
+ row: SheetDraftTypeFor(lineType),
1023
+ rows: ArrayType(SheetDraftTypeFor(lineType)),
1024
+ group: OptionType(SheetDraftGroupTypeFor(groupType, lines)),
1025
+ groups: ArrayType(SheetDraftGroupTypeFor(groupType, lines)),
1026
+ partial: BooleanType,
1027
+ driver: OptionType((driverType ?? NullType)),
1028
+ today: DateTimeType,
1029
+ });
1030
+ }
1031
+ /**
1032
+ * `Sheet.Types.CheckContext(P, "lines")` — what an author's member check
1033
+ * sees on a GROUPED sheet: the typed line, its group, the half and the member.
1034
+ *
1035
+ * @typeParam P - The group's row type
1036
+ * @typeParam F - The lines field
1037
+ * @param groupType - The group's row type value
1038
+ * @param lines - The lines field
1039
+ * @returns The concrete check-context `StructType`
1040
+ */
1041
+ export function SheetGroupCheckContextTypeFor(groupType, lines) {
1042
+ const { lineType } = sheetLinesOf(groupType, lines);
1043
+ return StructType({
1044
+ rowIndex: IntegerType,
1045
+ row: SheetDraftTypeFor(lineType),
1046
+ group: OptionType(SheetDraftGroupTypeFor(groupType, lines)),
1047
+ half: SheetHalfType,
1048
+ member: SheetMemberType,
1049
+ });
1050
+ }
1051
+ export function sheetContextType(first, second, third) {
1052
+ if (typeof second === "string")
1053
+ return SheetGroupContextTypeFor(first, second, third);
1054
+ return SheetContextTypeFor(first, second);
1055
+ }
1056
+ export function sheetCheckContextType(first, second) {
1057
+ if (typeof second === "string")
1058
+ return SheetGroupCheckContextTypeFor(first, second);
1059
+ return SheetCheckContextTypeFor(first);
1060
+ }
744
1061
  //# sourceMappingURL=types.js.map