@elaraai/e3-ui 1.0.98 → 1.0.99

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 (381) hide show
  1. package/README.md +0 -2
  2. package/dist/src/allocation/adapters.d.ts +1 -1
  3. package/dist/src/allocation/adapters.js +1 -1
  4. package/dist/src/allocation/index.d.ts +46 -90
  5. package/dist/src/allocation/index.d.ts.map +1 -1
  6. package/dist/src/allocation/index.js +5 -5
  7. package/dist/src/allocation/index.js.map +1 -1
  8. package/dist/src/bind/data-indexed.d.ts +273 -51
  9. package/dist/src/bind/data-indexed.d.ts.map +1 -1
  10. package/dist/src/bind/data-indexed.js +233 -56
  11. package/dist/src/bind/data-indexed.js.map +1 -1
  12. package/dist/src/bind/data.d.ts +48 -9
  13. package/dist/src/bind/data.d.ts.map +1 -1
  14. package/dist/src/bind/data.js +48 -3
  15. package/dist/src/bind/data.js.map +1 -1
  16. package/dist/src/bind/record.d.ts +61 -24
  17. package/dist/src/bind/record.d.ts.map +1 -1
  18. package/dist/src/bind/record.js +17 -57
  19. package/dist/src/bind/record.js.map +1 -1
  20. package/dist/src/calendar/index.d.ts +55 -95
  21. package/dist/src/calendar/index.d.ts.map +1 -1
  22. package/dist/src/calendar/index.js +10 -6
  23. package/dist/src/calendar/index.js.map +1 -1
  24. package/dist/src/flowchart/index.d.ts +35 -31
  25. package/dist/src/flowchart/index.d.ts.map +1 -1
  26. package/dist/src/flowchart/index.js +35 -31
  27. package/dist/src/flowchart/index.js.map +1 -1
  28. package/dist/src/flowchart/library.d.ts +108 -84
  29. package/dist/src/flowchart/library.d.ts.map +1 -1
  30. package/dist/src/flowchart/library.js +108 -84
  31. package/dist/src/flowchart/library.js.map +1 -1
  32. package/dist/src/flowchart/payload.d.ts +39 -107
  33. package/dist/src/flowchart/payload.d.ts.map +1 -1
  34. package/dist/src/flowchart/payload.js +3 -3
  35. package/dist/src/flowchart/payload.js.map +1 -1
  36. package/dist/src/flowchart/values.d.ts +35 -31
  37. package/dist/src/flowchart/values.d.ts.map +1 -1
  38. package/dist/src/flowchart/values.js +35 -31
  39. package/dist/src/flowchart/values.js.map +1 -1
  40. package/dist/src/flowchart/window.d.ts +0 -12
  41. package/dist/src/flowchart/window.d.ts.map +1 -1
  42. package/dist/src/flowchart/window.js +3 -2
  43. package/dist/src/flowchart/window.js.map +1 -1
  44. package/dist/src/index.d.ts +2 -2
  45. package/dist/src/index.d.ts.map +1 -1
  46. package/dist/src/index.js +1 -1
  47. package/dist/src/index.js.map +1 -1
  48. package/dist/src/internal.d.ts +7 -3
  49. package/dist/src/internal.d.ts.map +1 -1
  50. package/dist/src/internal.js +12 -3
  51. package/dist/src/internal.js.map +1 -1
  52. package/dist/src/plan/assemble.d.ts +8 -0
  53. package/dist/src/plan/assemble.d.ts.map +1 -1
  54. package/dist/src/plan/assemble.js +1 -1
  55. package/dist/src/plan/assemble.js.map +1 -1
  56. package/dist/src/plan/builders.d.ts +1518 -2
  57. package/dist/src/plan/builders.d.ts.map +1 -1
  58. package/dist/src/plan/builders.js +248 -114
  59. package/dist/src/plan/builders.js.map +1 -1
  60. package/dist/src/plan/event-rows.d.ts +9 -14
  61. package/dist/src/plan/event-rows.d.ts.map +1 -1
  62. package/dist/src/plan/event-rows.js +6 -46
  63. package/dist/src/plan/event-rows.js.map +1 -1
  64. package/dist/src/plan/factories.d.ts +72 -4
  65. package/dist/src/plan/factories.d.ts.map +1 -1
  66. package/dist/src/plan/factories.js +147 -1
  67. package/dist/src/plan/factories.js.map +1 -1
  68. package/dist/src/plan/index.d.ts +147 -125
  69. package/dist/src/plan/index.d.ts.map +1 -1
  70. package/dist/src/plan/index.js +135 -122
  71. package/dist/src/plan/index.js.map +1 -1
  72. package/dist/src/plan/ir.d.ts +1105 -44
  73. package/dist/src/plan/ir.d.ts.map +1 -1
  74. package/dist/src/plan/ir.js +5 -0
  75. package/dist/src/plan/ir.js.map +1 -1
  76. package/dist/src/plan/library.d.ts +65 -42
  77. package/dist/src/plan/library.d.ts.map +1 -1
  78. package/dist/src/plan/library.js +65 -42
  79. package/dist/src/plan/library.js.map +1 -1
  80. package/dist/src/plan/nested-checks.d.ts +146 -0
  81. package/dist/src/plan/nested-checks.d.ts.map +1 -0
  82. package/dist/src/plan/nested-checks.js +468 -0
  83. package/dist/src/plan/nested-checks.js.map +1 -0
  84. package/dist/src/plan/nested-patch.d.ts +35 -0
  85. package/dist/src/plan/nested-patch.d.ts.map +1 -0
  86. package/dist/src/plan/nested-patch.js +143 -0
  87. package/dist/src/plan/nested-patch.js.map +1 -0
  88. package/dist/src/plan/nested-read.d.ts +3250 -0
  89. package/dist/src/plan/nested-read.d.ts.map +1 -0
  90. package/dist/src/plan/nested-read.js +163 -0
  91. package/dist/src/plan/nested-read.js.map +1 -0
  92. package/dist/src/plan/nested.d.ts +280 -0
  93. package/dist/src/plan/nested.d.ts.map +1 -0
  94. package/dist/src/plan/nested.js +6 -0
  95. package/dist/src/plan/nested.js.map +1 -0
  96. package/dist/src/plan/ordered-source.d.ts +1030 -1
  97. package/dist/src/plan/ordered-source.d.ts.map +1 -1
  98. package/dist/src/plan/ordered-source.js +48 -6
  99. package/dist/src/plan/ordered-source.js.map +1 -1
  100. package/dist/src/plan/over.d.ts +111 -75
  101. package/dist/src/plan/over.d.ts.map +1 -1
  102. package/dist/src/plan/over.js +111 -75
  103. package/dist/src/plan/over.js.map +1 -1
  104. package/dist/src/plan/pick.d.ts +15 -3
  105. package/dist/src/plan/pick.d.ts.map +1 -1
  106. package/dist/src/plan/pick.js +75 -36
  107. package/dist/src/plan/pick.js.map +1 -1
  108. package/dist/src/plan/plan.d.ts +2719 -558
  109. package/dist/src/plan/plan.d.ts.map +1 -1
  110. package/dist/src/plan/plan.js +14 -2
  111. package/dist/src/plan/plan.js.map +1 -1
  112. package/dist/src/plan/reads.d.ts +421 -0
  113. package/dist/src/plan/reads.d.ts.map +1 -0
  114. package/dist/src/plan/reads.js +143 -0
  115. package/dist/src/plan/reads.js.map +1 -0
  116. package/dist/src/plan/refs.d.ts +111 -75
  117. package/dist/src/plan/refs.d.ts.map +1 -1
  118. package/dist/src/plan/refs.js +111 -75
  119. package/dist/src/plan/refs.js.map +1 -1
  120. package/dist/src/plan/root.d.ts +10 -5
  121. package/dist/src/plan/root.d.ts.map +1 -1
  122. package/dist/src/plan/root.js +76 -13
  123. package/dist/src/plan/root.js.map +1 -1
  124. package/dist/src/plan/series.d.ts +5140 -4331
  125. package/dist/src/plan/series.d.ts.map +1 -1
  126. package/dist/src/plan/series.js +1026 -264
  127. package/dist/src/plan/series.js.map +1 -1
  128. package/dist/src/plan/shade.d.ts +981 -0
  129. package/dist/src/plan/shade.d.ts.map +1 -0
  130. package/dist/src/plan/shade.js +60 -0
  131. package/dist/src/plan/shade.js.map +1 -0
  132. package/dist/src/plan/types.d.ts +178 -18
  133. package/dist/src/plan/types.d.ts.map +1 -1
  134. package/dist/src/plan/types.js +69 -19
  135. package/dist/src/plan/types.js.map +1 -1
  136. package/dist/src/query/builder.d.ts +3 -3
  137. package/dist/src/query/builder.d.ts.map +1 -1
  138. package/dist/src/query/builder.js +1 -1
  139. package/dist/src/query/library.d.ts +3 -3
  140. package/dist/src/query/library.d.ts.map +1 -1
  141. package/dist/src/query/library.js +1 -1
  142. package/dist/src/query/queries.d.ts +2 -2
  143. package/dist/src/query/queries.js +1 -1
  144. package/dist/src/query/saved.d.ts +8 -4
  145. package/dist/src/query/saved.d.ts.map +1 -1
  146. package/dist/src/query/saved.js +8 -4
  147. package/dist/src/query/saved.js.map +1 -1
  148. package/dist/src/query/types.d.ts +8 -3
  149. package/dist/src/query/types.d.ts.map +1 -1
  150. package/dist/src/query/types.js +8 -3
  151. package/dist/src/query/types.js.map +1 -1
  152. package/dist/src/roster/index.d.ts +47 -91
  153. package/dist/src/roster/index.d.ts.map +1 -1
  154. package/dist/src/roster/index.js +6 -6
  155. package/dist/src/roster/index.js.map +1 -1
  156. package/dist/src/roster/targets.d.ts +8 -4
  157. package/dist/src/roster/targets.d.ts.map +1 -1
  158. package/dist/src/roster/targets.js +9 -5
  159. package/dist/src/roster/targets.js.map +1 -1
  160. package/dist/src/schedule/cell-checks.js +3 -3
  161. package/dist/src/schedule/cell-checks.js.map +1 -1
  162. package/dist/src/schedule/days.d.ts +1 -1
  163. package/dist/src/schedule/days.js +1 -1
  164. package/dist/src/schedule/events.d.ts +10 -6
  165. package/dist/src/schedule/events.d.ts.map +1 -1
  166. package/dist/src/schedule/events.js +252 -228
  167. package/dist/src/schedule/events.js.map +1 -1
  168. package/dist/src/schedule/patch.d.ts +1 -1
  169. package/dist/src/schedule/patch.js +1 -1
  170. package/dist/src/schedule/periods.d.ts +8 -4
  171. package/dist/src/schedule/periods.d.ts.map +1 -1
  172. package/dist/src/schedule/periods.js +1 -1
  173. package/dist/src/schedule/periods.js.map +1 -1
  174. package/dist/src/schedule/record-window.d.ts +38 -58
  175. package/dist/src/schedule/record-window.d.ts.map +1 -1
  176. package/dist/src/schedule/record-window.js +15 -16
  177. package/dist/src/schedule/record-window.js.map +1 -1
  178. package/dist/src/schedule/resources.d.ts +1 -1
  179. package/dist/src/schedule/session.d.ts +1 -1
  180. package/dist/src/schedule/session.js +1 -1
  181. package/dist/src/schedule/types.d.ts +29 -1
  182. package/dist/src/schedule/types.d.ts.map +1 -1
  183. package/dist/src/schedule/types.js +16 -1
  184. package/dist/src/schedule/types.js.map +1 -1
  185. package/dist/src/schematic/index.d.ts +19 -9
  186. package/dist/src/schematic/index.d.ts.map +1 -1
  187. package/dist/src/schematic/index.js +19 -9
  188. package/dist/src/schematic/index.js.map +1 -1
  189. package/dist/src/schematic/kinds.d.ts +4 -4
  190. package/dist/src/schematic/kinds.js +9 -9
  191. package/dist/src/schematic/kinds.js.map +1 -1
  192. package/dist/src/schematic/payload.d.ts +38 -88
  193. package/dist/src/schematic/payload.d.ts.map +1 -1
  194. package/dist/src/schematic/payload.js +4 -4
  195. package/dist/src/schematic/payload.js.map +1 -1
  196. package/dist/src/schematic/window.d.ts +8 -7
  197. package/dist/src/schematic/window.d.ts.map +1 -1
  198. package/dist/src/schematic/window.js +22 -19
  199. package/dist/src/schematic/window.js.map +1 -1
  200. package/dist/src/sheet/bridge.d.ts +19 -0
  201. package/dist/src/sheet/bridge.d.ts.map +1 -1
  202. package/dist/src/sheet/bridge.js +28 -21
  203. package/dist/src/sheet/bridge.js.map +1 -1
  204. package/dist/src/sheet/index.d.ts +66 -46
  205. package/dist/src/sheet/index.d.ts.map +1 -1
  206. package/dist/src/sheet/index.js +66 -46
  207. package/dist/src/sheet/index.js.map +1 -1
  208. package/dist/src/sheet/library.d.ts +13 -8
  209. package/dist/src/sheet/library.d.ts.map +1 -1
  210. package/dist/src/sheet/library.js +13 -8
  211. package/dist/src/sheet/library.js.map +1 -1
  212. package/dist/src/sheet/record.d.ts +1 -1
  213. package/dist/src/sheet/record.js +2 -2
  214. package/dist/src/sheet/record.js.map +1 -1
  215. package/dist/src/sheet/registers.d.ts +152 -128
  216. package/dist/src/sheet/registers.d.ts.map +1 -1
  217. package/dist/src/sheet/registers.js +152 -128
  218. package/dist/src/sheet/registers.js.map +1 -1
  219. package/dist/src/sheet/root.d.ts +4 -1
  220. package/dist/src/sheet/root.d.ts.map +1 -1
  221. package/dist/src/sheet/root.js +15 -3
  222. package/dist/src/sheet/root.js.map +1 -1
  223. package/dist/src/sheet/sheet.d.ts +39 -113
  224. package/dist/src/sheet/sheet.d.ts.map +1 -1
  225. package/dist/src/sheet/sheet.js +7 -5
  226. package/dist/src/sheet/sheet.js.map +1 -1
  227. package/dist/src/sheet/sub-rows.d.ts +106 -76
  228. package/dist/src/sheet/sub-rows.d.ts.map +1 -1
  229. package/dist/src/sheet/sub-rows.js +106 -76
  230. package/dist/src/sheet/sub-rows.js.map +1 -1
  231. package/dist/src/sheet/types.d.ts +19 -62
  232. package/dist/src/sheet/types.d.ts.map +1 -1
  233. package/dist/src/studio/builder.d.ts +3 -153
  234. package/dist/src/studio/builder.d.ts.map +1 -1
  235. package/dist/src/studio/builder.js +1 -1
  236. package/dist/src/studio/canvas.d.ts +5 -4
  237. package/dist/src/studio/canvas.d.ts.map +1 -1
  238. package/dist/src/studio/canvas.js +8 -7
  239. package/dist/src/studio/canvas.js.map +1 -1
  240. package/dist/src/studio/component.d.ts +30 -20
  241. package/dist/src/studio/component.d.ts.map +1 -1
  242. package/dist/src/studio/component.js +26 -61
  243. package/dist/src/studio/component.js.map +1 -1
  244. package/dist/src/studio/index.d.ts +2 -2
  245. package/dist/src/studio/index.d.ts.map +1 -1
  246. package/dist/src/studio/index.js +1 -1
  247. package/dist/src/studio/index.js.map +1 -1
  248. package/dist/src/studio/inspector.d.ts +10 -39
  249. package/dist/src/studio/inspector.d.ts.map +1 -1
  250. package/dist/src/studio/inspector.js +11 -31
  251. package/dist/src/studio/inspector.js.map +1 -1
  252. package/dist/src/studio/library.d.ts +3 -169
  253. package/dist/src/studio/library.d.ts.map +1 -1
  254. package/dist/src/studio/library.js +1 -1
  255. package/dist/src/studio/page.d.ts +0 -8
  256. package/dist/src/studio/page.d.ts.map +1 -1
  257. package/dist/src/studio/pages.d.ts +17 -591
  258. package/dist/src/studio/pages.d.ts.map +1 -1
  259. package/dist/src/studio/pages.js +17 -44
  260. package/dist/src/studio/pages.js.map +1 -1
  261. package/dist/src/studio/palette.d.ts +2 -7
  262. package/dist/src/studio/palette.d.ts.map +1 -1
  263. package/dist/src/studio/palette.js +4 -5
  264. package/dist/src/studio/palette.js.map +1 -1
  265. package/dist/src/studio/publish.d.ts +8 -18
  266. package/dist/src/studio/publish.d.ts.map +1 -1
  267. package/dist/src/studio/publish.js +10 -36
  268. package/dist/src/studio/publish.js.map +1 -1
  269. package/dist/src/utils/derive.d.ts +12 -12
  270. package/dist/src/utils/derive.d.ts.map +1 -1
  271. package/dist/src/utils/derive.js +5 -2
  272. package/dist/src/utils/derive.js.map +1 -1
  273. package/dist/src/utils/ordered-source.d.ts.map +1 -1
  274. package/dist/src/utils/ordered-source.js +14 -5
  275. package/dist/src/utils/ordered-source.js.map +1 -1
  276. package/dist/test/allocation/allocation.examples.d.ts +1900 -1598
  277. package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
  278. package/dist/test/allocation/allocation.examples.js +179 -89
  279. package/dist/test/allocation/allocation.examples.js.map +1 -1
  280. package/dist/test/allocation/optimise.examples.d.ts.map +1 -1
  281. package/dist/test/allocation/optimise.examples.js +7 -7
  282. package/dist/test/allocation/optimise.examples.js.map +1 -1
  283. package/dist/test/bind/data/data.examples.d.ts +1057 -903
  284. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  285. package/dist/test/bind/data/data.examples.js +260 -204
  286. package/dist/test/bind/data/data.examples.js.map +1 -1
  287. package/dist/test/bind/record/record.examples.d.ts +457 -426
  288. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  289. package/dist/test/bind/record/record.examples.js +41 -21
  290. package/dist/test/bind/record/record.examples.js.map +1 -1
  291. package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
  292. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
  293. package/dist/test/calendar/calendar-records.examples.js +20 -12
  294. package/dist/test/calendar/calendar-records.examples.js.map +1 -1
  295. package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -1
  296. package/dist/test/calendar/calendar-windows.examples.js +12 -12
  297. package/dist/test/calendar/calendar-windows.examples.js.map +1 -1
  298. package/dist/test/calendar/calendar.examples.d.ts +1172 -901
  299. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  300. package/dist/test/calendar/calendar.examples.js +211 -124
  301. package/dist/test/calendar/calendar.examples.js.map +1 -1
  302. package/dist/test/calendar/optimise.examples.js +2 -2
  303. package/dist/test/calendar/optimise.examples.js.map +1 -1
  304. package/dist/test/examples-package.d.ts +6 -9
  305. package/dist/test/examples-package.d.ts.map +1 -1
  306. package/dist/test/examples-package.js +11 -32
  307. package/dist/test/examples-package.js.map +1 -1
  308. package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2820
  309. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  310. package/dist/test/flowchart/flowchart.examples.js +211 -121
  311. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  312. package/dist/test/plan/optimise.examples.js +2 -2
  313. package/dist/test/plan/optimise.examples.js.map +1 -1
  314. package/dist/test/plan/plan-events.examples.d.ts +4055 -3263
  315. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  316. package/dist/test/plan/plan-events.examples.js +492 -319
  317. package/dist/test/plan/plan-events.examples.js.map +1 -1
  318. package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
  319. package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
  320. package/dist/test/plan/plan-nested.examples.js +321 -0
  321. package/dist/test/plan/plan-nested.examples.js.map +1 -0
  322. package/dist/test/plan/plan-records.examples.d.ts +328 -362
  323. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  324. package/dist/test/plan/plan-records.examples.js +81 -57
  325. package/dist/test/plan/plan-records.examples.js.map +1 -1
  326. package/dist/test/plan/plan-windows.examples.d.ts +1756 -1398
  327. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
  328. package/dist/test/plan/plan-windows.examples.js +161 -128
  329. package/dist/test/plan/plan-windows.examples.js.map +1 -1
  330. package/dist/test/plan/plan.examples.d.ts +2238 -5712
  331. package/dist/test/plan/plan.examples.d.ts.map +1 -1
  332. package/dist/test/plan/plan.examples.js +839 -968
  333. package/dist/test/plan/plan.examples.js.map +1 -1
  334. package/dist/test/query/query.examples.d.ts +5221 -3005
  335. package/dist/test/query/query.examples.d.ts.map +1 -1
  336. package/dist/test/query/query.examples.js +169 -118
  337. package/dist/test/query/query.examples.js.map +1 -1
  338. package/dist/test/roster/optimise.examples.d.ts.map +1 -1
  339. package/dist/test/roster/optimise.examples.js +7 -7
  340. package/dist/test/roster/optimise.examples.js.map +1 -1
  341. package/dist/test/roster/roster-records.examples.d.ts +364 -392
  342. package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
  343. package/dist/test/roster/roster-records.examples.js +40 -26
  344. package/dist/test/roster/roster-records.examples.js.map +1 -1
  345. package/dist/test/roster/roster.examples.d.ts +4605 -4308
  346. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  347. package/dist/test/roster/roster.examples.js +212 -113
  348. package/dist/test/roster/roster.examples.js.map +1 -1
  349. package/dist/test/schedule/schedule.examples.d.ts +2646 -2471
  350. package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
  351. package/dist/test/schedule/schedule.examples.js +144 -88
  352. package/dist/test/schedule/schedule.examples.js.map +1 -1
  353. package/dist/test/schematic/schematic-records.examples.d.ts +286 -276
  354. package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -1
  355. package/dist/test/schematic/schematic-records.examples.js +52 -38
  356. package/dist/test/schematic/schematic-records.examples.js.map +1 -1
  357. package/dist/test/schematic/schematic.examples.d.ts +1842 -1491
  358. package/dist/test/schematic/schematic.examples.d.ts.map +1 -1
  359. package/dist/test/schematic/schematic.examples.js +240 -134
  360. package/dist/test/schematic/schematic.examples.js.map +1 -1
  361. package/dist/test/sheet/optimise.examples.d.ts +102 -95
  362. package/dist/test/sheet/optimise.examples.d.ts.map +1 -1
  363. package/dist/test/sheet/optimise.examples.js +7 -3
  364. package/dist/test/sheet/optimise.examples.js.map +1 -1
  365. package/dist/test/sheet/sheet-records.examples.d.ts +175 -214
  366. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
  367. package/dist/test/sheet/sheet-records.examples.js +29 -17
  368. package/dist/test/sheet/sheet-records.examples.js.map +1 -1
  369. package/dist/test/sheet/sheet.examples.d.ts +3642 -3353
  370. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  371. package/dist/test/sheet/sheet.examples.js +389 -282
  372. package/dist/test/sheet/sheet.examples.js.map +1 -1
  373. package/dist/test/studio/component.examples.js +2 -2
  374. package/dist/test/studio/component.examples.js.map +1 -1
  375. package/dist/test/studio/page.examples.js +6 -6
  376. package/dist/test/studio/page.examples.js.map +1 -1
  377. package/dist/test/studio/studio.examples.d.ts +2329 -873
  378. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  379. package/dist/test/studio/studio.examples.js +155 -107
  380. package/dist/test/studio/studio.examples.js.map +1 -1
  381. package/package.json +15 -11
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
5
5
  */
6
6
  /** @jsxImportSource @elaraai/e3-ui */
7
7
  import { East, ArrayType, BooleanType, DateTimeType, DictType, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, SetType, StringType, StructType, VariantType, example, none, some, variant, } from "@elaraai/east";
8
- import { Badge, Box, Configurator, Field, Format, HStack, Input, Reactive, SegmentGroup, Slice, State, StatusValueType, Style, Switch, Text, UIComponentType, VStack, } from "@elaraai/east-ui";
8
+ import { Badge, Box, Button, Configurator, Field, Format, HStack, Input, Reactive, SegmentGroup, Slice, State, StatusValueType, Style, Switch, Text, UIComponentType, VStack, } from "@elaraai/east-ui";
9
9
  import { Data, Record, Sheet } from "@elaraai/e3-ui";
10
10
  import e3 from "@elaraai/e3";
11
11
  // ============================================================================
@@ -31,7 +31,8 @@ import e3 from "@elaraai/e3";
31
31
  // narrows;
32
32
  // - `sheetLoose`, loose rows between the groups (#846);
33
33
  // - `sheetPaged`, a record read a window at a time;
34
- // - `sheetUpkeep`, the inspector's every field kind (#1220).
34
+ // - `sheetUpkeep`, the inspector's every field kind (#1220);
35
+ // - `sheetConflicts`, your edits meeting someone else's save, in one window.
35
36
  //
36
37
  // Its panes are optional props, and the examples show each combination:
37
38
  // none (`sheetBasic`, `sheetVariants`, `sheetStress`, `sheetLoose`,
@@ -57,29 +58,37 @@ import e3 from "@elaraai/e3";
57
58
  /** A job — what it is, when it starts and how many. */
58
59
  export const SheetJob = StructType({ task: StringType, start: OptionType(DateTimeType), qty: OptionType(FloatType) });
59
60
  /** The jobs, keyed J-0001, J-0002, …: the record's entries are the sheet's rows. */
60
- export const sheetJobs = e3.record("sheet_jobs", DictType(StringType, SheetJob), new Map([
61
- ["J-0001", { task: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0) }],
62
- ["J-0002", { task: "Edge banding", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0) }],
63
- ["J-0003", { task: "CNC routing", start: none, qty: some(48.0) }],
64
- ["J-0004", { task: "Spray finish", start: none, qty: none }],
65
- ]));
66
- /** The jobs' patch door — every Save commits through it. */
67
- export const sheetJobsPatch = e3.mutation.patch(sheetJobs);
61
+ export const sheetJobs = e3.record("sheet_jobs", DictType(StringType, SheetJob), {
62
+ initial: new Map([
63
+ ["J-0001", { task: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0) }],
64
+ ["J-0002", { task: "Edge banding", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0) }],
65
+ ["J-0003", { task: "CNC routing", start: none, qty: some(48.0) }],
66
+ ["J-0004", { task: "Spray finish", start: none, qty: none }],
67
+ ]),
68
+ mutations: (mutation) => ({
69
+ // The jobs' patch door — every Save commits through it.
70
+ patch: mutation.patch(),
71
+ }),
72
+ });
68
73
  /** The jobs again, as the edge bander's week holds them: a Save over them is refused for a reason the record gives. */
69
- export const sheetBookedJobs = e3.record("sheet_booked_jobs", DictType(StringType, SheetJob), new Map([
70
- ["J-0001", { task: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0) }],
71
- ["J-0002", { task: "Edge banding", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0) }],
72
- ["J-0003", { task: "CNC routing", start: none, qty: some(48.0) }],
73
- ["J-0004", { task: "Spray finish", start: none, qty: none }],
74
- ]));
75
- /** The booked jobs' patch door: it commits a patch unless a job it leaves bands both edges — the edge bander is booked that week. */
76
- export const sheetBookedJobsPatch = e3.mutation.reduce("patch", sheetBookedJobs, East.function([DictType(StringType, SheetJob), PatchType(DictType(StringType, SheetJob))], DictType(StringType, SheetJob), ($, jobs, patch) => {
77
- const next = $.let(East.applyPatch(jobs, patch));
78
- $.for(next, ($2, job) => {
79
- $2.if(job.task.endsWith("both edges"), ($3) => { $3.error("the edge bander is booked that week"); });
80
- });
81
- return next;
82
- }));
74
+ export const sheetBookedJobs = e3.record("sheet_booked_jobs", DictType(StringType, SheetJob), {
75
+ initial: new Map([
76
+ ["J-0001", { task: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0) }],
77
+ ["J-0002", { task: "Edge banding", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0) }],
78
+ ["J-0003", { task: "CNC routing", start: none, qty: some(48.0) }],
79
+ ["J-0004", { task: "Spray finish", start: none, qty: none }],
80
+ ]),
81
+ mutations: (mutation) => ({
82
+ // The booked jobs' patch door: it commits a patch unless a job it leaves bands both edges — the edge bander is booked that week.
83
+ patch: mutation.reduce(East.function([DictType(StringType, SheetJob), PatchType(DictType(StringType, SheetJob))], DictType(StringType, SheetJob), ($, jobs, patch) => {
84
+ const next = $.let(East.applyPatch(jobs, patch));
85
+ $.for(next, ($2, job) => {
86
+ $2.if(job.task.endsWith("both edges"), ($3) => { $3.error("the edge bander is booked that week"); });
87
+ });
88
+ return next;
89
+ })),
90
+ }),
91
+ });
83
92
  /**
84
93
  * The smallest sheet (§3.1) — the jobs an e3 record holds, in its frame: one
85
94
  * row per job in key order and a blank tail for the next, three typed
@@ -90,7 +99,7 @@ export const sheetBasic = example({
90
99
  keywords: ["Sheet", "basic", "BuilderFrame", "record", "Record", "Record.bind", "e3.record", "patch", "commit", "column", "date", "text", "quantity", "key order", "Reactive"],
91
100
  description: "The smallest sheet — an e3 record's entries as its rows, in key order, under three typed columns, edited as drafts and saved as one commit through the record's patch door, in its frame with no pane",
92
101
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
93
- const jobs = $.let(Record.bind(sheetJobs, [sheetJobsPatch]));
102
+ const jobs = $.let(Record.bind(sheetJobs));
94
103
  return (_jsx(Box, { height: "560px", children: _jsx(Sheet, { record: jobs, columns: {
95
104
  task: Sheet.column.text(SheetJob, { header: "Task", width: "240px" }),
96
105
  start: Sheet.column.date(SheetJob, { header: "Start", width: "96px" }),
@@ -107,15 +116,19 @@ export const VariantsJob = StructType({ id: StringType, start: OptionType(DateTi
107
116
  /** A plan — its jobs, in the planner's order. */
108
117
  export const VariantsPlan = StructType({ jobs: ArrayType(VariantsJob) });
109
118
  /** The plans — the configurator's sheet edits the week's jobs. */
110
- export const sheetVariantsPlans = e3.record("sheet_variants_plans", DictType(StringType, VariantsPlan), new Map([
111
- ["week", { jobs: [
112
- { id: "j1", start: some(new Date("2026-02-16T00:00:00Z")), task: "Routing", qty: some(1200.0), notes: "Nest the C-18 panels" },
113
- { id: "j2", start: some(new Date("2026-03-09T00:00:00Z")), task: "Spraying", qty: some(250.0), notes: "" },
114
- { id: "j3", start: none, task: "Wrapping", qty: none, notes: "" },
115
- ] }],
116
- ]));
117
- /** The record's patch door — every Save commits through it. */
118
- export const sheetVariantsPlansPatch = e3.mutation.patch(sheetVariantsPlans);
119
+ export const sheetVariantsPlans = e3.record("sheet_variants_plans", DictType(StringType, VariantsPlan), {
120
+ initial: new Map([
121
+ ["week", { jobs: [
122
+ { id: "j1", start: some(new Date("2026-02-16T00:00:00Z")), task: "Routing", qty: some(1200.0), notes: "Nest the C-18 panels" },
123
+ { id: "j2", start: some(new Date("2026-03-09T00:00:00Z")), task: "Spraying", qty: some(250.0), notes: "" },
124
+ { id: "j3", start: none, task: "Wrapping", qty: none, notes: "" },
125
+ ] }],
126
+ ]),
127
+ mutations: (mutation) => ({
128
+ // The record's patch door — every Save commits through it.
129
+ patch: mutation.patch(),
130
+ }),
131
+ });
119
132
  /**
120
133
  * THE Sheet configurator — ONE live sheet in its frame; every axis is an
121
134
  * expression-fed prop on that single instance: density, the blank tail, read
@@ -133,7 +146,7 @@ export const sheetVariants = example({
133
146
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
134
147
  const Ctx = Sheet.Types.DraftContext(VariantsJob);
135
148
  // The jobs, read from an e3 record bound with its patch door.
136
- const plans = $.let(Record.bind(sheetVariantsPlans, [sheetVariantsPlansPatch]));
149
+ const plans = $.let(Record.bind(sheetVariantsPlans));
137
150
  const rows = $.let(plans.read().get("week").jobs);
138
151
  const onApply = $.const(Record.onApply(plans, {
139
152
  entry: "week",
@@ -227,14 +240,18 @@ export const generateStressJobs = East.function([IntegerType], ArrayType(StressJ
227
240
  }));
228
241
  });
229
242
  /** The jobs, keyed by their id — two thousand made by {@link generateStressJobs}: what the stress sheet pages and its rail narrows (#1345). */
230
- export const sheetStressJobs = e3.record("sheet_stress_jobs", DictType(StringType, StressJob), East.compile(East.function([IntegerType], DictType(StringType, StressJob), ($, count) => {
231
- const generate = $.const(generateStressJobs);
232
- return generate(count).toDict((_$, job) => job.id, (_$, job) => job);
233
- }), [])(2000n));
234
- /** The jobs by activity, by status and by their notes: what the rail narrows them by, each choice one index's runs. */
235
- export const sheetStressByActivity = e3.recordIndex("sheet_stress_by_activity", sheetStressJobs, { on: ["activity"] });
236
- export const sheetStressByStatus = e3.recordIndex("sheet_stress_by_status", sheetStressJobs, { on: ["status"] });
237
- export const sheetStressByNotes = e3.recordIndex("sheet_stress_by_notes", sheetStressJobs, { on: ["notes"] });
243
+ export const sheetStressJobs = e3.record("sheet_stress_jobs", DictType(StringType, StressJob), {
244
+ initial: () => East.compile(East.function([IntegerType], DictType(StringType, StressJob), ($, count) => {
245
+ const generate = $.const(generateStressJobs);
246
+ return generate(count).toDict((_$, job) => job.id, (_$, job) => job);
247
+ }), [])(2000n),
248
+ indexes: (index) => ({
249
+ // The jobs by activity, by status and by their notes: what the rail narrows them by, each choice one index's runs.
250
+ sheet_stress_by_activity: index.on(["activity"]),
251
+ sheet_stress_by_status: index.on(["status"]),
252
+ sheet_stress_by_notes: index.on(["notes"]),
253
+ }),
254
+ });
238
255
  /**
239
256
  * Stress (§3.8) — two thousand jobs of an e3 record, read only, every row
240
257
  * virtualised, in the record's order. The rail is the sheet's
@@ -247,7 +264,7 @@ export const sheetStressByNotes = e3.recordIndex("sheet_stress_by_notes", sheetS
247
264
  * open, kept per viewer through a `State` bind handle. It is given no pane.
248
265
  */
249
266
  export const sheetStress = example({
250
- keywords: ["Sheet", "stress", "virtualization", "2000", "rows", "performance", "readOnly", "slice", "Slice.bindRecords", "rows", "Data.bindPaged", "recordIndex", "record", "search", "filter", "lens", "views", "RecordView", "State.bind", "activeView", "set", "register", "concat", "footer", "paged", "Reactive", "State"],
267
+ keywords: ["Sheet", "stress", "virtualization", "2000", "rows", "performance", "readOnly", "slice", "Slice.bindRecords", "rows", "Data.bindPaged", "indexes", "record", "search", "filter", "lens", "views", "RecordView", "State.bind", "activeView", "set", "register", "concat", "footer", "paged", "Reactive", "State"],
251
268
  description: "Two thousand jobs of an e3 record, read only and virtualised in the sheet's frame, in the record's order, the rail's narrowing — by activity, by status and by a prefix of their notes, each through the record's index — drawn over them as the lens, a filtered spreadsheet showing only the jobs it keeps, with saved views kept per viewer, each every source's narrowing",
252
269
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
253
270
  const MachineType = StructType({ code: StringType, family: StringType });
@@ -258,7 +275,7 @@ export const sheetStress = example({
258
275
  // One rail over the jobs: the sheet's rows are the record's, its `rows` source's narrowing drawn over them as the lens.
259
276
  const slice = $.let(Slice.bindRecords("sheet_stress", {
260
277
  rows: {
261
- source: Data.bindPaged(sheetStressJobs, { indexes: [sheetStressByActivity, sheetStressByStatus, sheetStressByNotes] }),
278
+ source: Data.bindPaged(sheetStressJobs, { indexes: ["sheet_stress_by_activity", "sheet_stress_by_status", "sheet_stress_by_notes"] }),
262
279
  fields: {
263
280
  activity: { label: "Activity", hints: ["Routing", "Spraying", "Wrapping", "Set-up", "Maintenance"] },
264
281
  status: { label: "Status", hints: ["PLANNED", "RELEASED", "COMPLETE"] },
@@ -308,7 +325,7 @@ export const sheetLibrary = example({
308
325
  keywords: ["Sheet", "BuilderFrame", "pane", "library", "Sheet.library", "Sheet.library.tab", "Sheet.library.columns", "tab", "cards", "drop", "Sheet.patch", "group"],
309
326
  description: "A sheet whose library pane lists a tab of the author's own — the tasks a job takes, grouped by stage, a card dropped on a job setting its task — beside the columns",
310
327
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
311
- const jobs = $.let(Record.bind(sheetJobs, [sheetJobsPatch]));
328
+ const jobs = $.let(Record.bind(sheetJobs));
312
329
  const tasks = $.let([
313
330
  { name: "Panel cutting", stage: "Cutting" },
314
331
  { name: "Edge banding", stage: "Cutting" },
@@ -374,134 +391,150 @@ export const sheetWorkshopActivities = e3.input("sheet_workshop_activities", Arr
374
391
  { name: "Delivery", uom: "loads", days: 1n, rate: 1.0, family: "", sides: variant("from", null) },
375
392
  ]));
376
393
  /** The machines, keyed by code — the work centres' register. */
377
- export const sheetWorkshopMachines = e3.record("sheet_workshop_machines", DictType(StringType, WorkshopMachine), new Map([
378
- ["S101", { family: "beam saw", bay: "Bay 1" }],
379
- ["S102", { family: "beam saw", bay: "Bay 1" }],
380
- ["S103", { family: "beam saw", bay: "Bay 1" }],
381
- ["E201", { family: "edge bander", bay: "Bay 2" }],
382
- ["E202", { family: "edge bander", bay: "Bay 2" }],
383
- ["R301", { family: "CNC router", bay: "Bay 3" }],
384
- ["R302", { family: "CNC router", bay: "Bay 3" }],
385
- ["R303", { family: "CNC router", bay: "Bay 3" }],
386
- ["F401", { family: "spray booth", bay: "Bay 4" }],
387
- ["F402", { family: "spray booth", bay: "Bay 4" }],
388
- ["A701", { family: "assembly bench", bay: "Bay 7" }],
389
- ["A702", { family: "assembly bench", bay: "Bay 7" }],
390
- ]));
394
+ export const sheetWorkshopMachines = e3.record("sheet_workshop_machines", DictType(StringType, WorkshopMachine), {
395
+ initial: new Map([
396
+ ["S101", { family: "beam saw", bay: "Bay 1" }],
397
+ ["S102", { family: "beam saw", bay: "Bay 1" }],
398
+ ["S103", { family: "beam saw", bay: "Bay 1" }],
399
+ ["E201", { family: "edge bander", bay: "Bay 2" }],
400
+ ["E202", { family: "edge bander", bay: "Bay 2" }],
401
+ ["R301", { family: "CNC router", bay: "Bay 3" }],
402
+ ["R302", { family: "CNC router", bay: "Bay 3" }],
403
+ ["R303", { family: "CNC router", bay: "Bay 3" }],
404
+ ["F401", { family: "spray booth", bay: "Bay 4" }],
405
+ ["F402", { family: "spray booth", bay: "Bay 4" }],
406
+ ["A701", { family: "assembly bench", bay: "Bay 7" }],
407
+ ["A702", { family: "assembly bench", bay: "Bay 7" }],
408
+ ]),
409
+ });
391
410
  /** The orders, keyed by order number: each a group, its operations its lines. */
392
- export const sheetWorkshopOrders = e3.record("sheet_workshop_orders", DictType(StringType, WorkshopOrder), new Map([
393
- ["WO-2201", { name: "WO-2201 · Kitchen, oak", customer: "Quillfeather Interiors", due: some(new Date("2026-10-23T00:00:00Z")), status: "RELEASED", ops: [
394
- { activity: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), end: some(new Date("2026-10-13T00:00:00Z")), qty: some(48.0),
395
- machines: { from: [variant("identified", { key: "S101" })], to: [variant("identified", { key: "E201" })] }, notes: "Oak veneered board", created_by: "planner" },
396
- { activity: "Edge banding", start: some(new Date("2026-10-14T00:00:00Z")), end: some(new Date("2026-10-15T00:00:00Z")), qty: some(120.0),
397
- machines: { from: [variant("identified", { key: "E201" })], to: [variant("identified", { key: "R301" })] }, notes: "", created_by: "planner" },
398
- { activity: "CNC routing", start: some(new Date("2026-10-15T00:00:00Z")), end: some(new Date("2026-10-17T00:00:00Z")), qty: some(48.0),
399
- machines: { from: [variant("identified", { key: "R301" })], to: [variant("identified", { key: "A701" })] }, notes: "Hinge cups and handle slots", created_by: "planner" },
400
- { activity: "Assembly", start: none, end: none, qty: some(12.0),
401
- machines: { from: [], to: [variant("identified", { key: "A701" })] }, notes: "Twelve carcasses", created_by: "planner" },
402
- { activity: "Spray finish", start: none, end: none, qty: some(24.0),
403
- machines: { from: [], to: [variant("identified", { key: "F401" })] }, notes: "Matt lacquer", created_by: "planner" },
404
- ] }],
405
- ["WO-2202", { name: "WO-2202 · Wardrobes, ash", customer: "Marrowby Lettings", due: some(new Date("2026-10-30T00:00:00Z")), status: "PLANNED", ops: [
406
- { activity: "Panel cutting", start: some(new Date("2026-10-13T00:00:00Z")), end: some(new Date("2026-10-14T00:00:00Z")), qty: some(36.0),
407
- machines: { from: [variant("identified", { key: "S102" })], to: [variant("identified", { key: "E202" })] }, notes: "", created_by: "planner" },
408
- { activity: "Edge banding", start: none, end: none, qty: some(90.0),
409
- machines: { from: [variant("identified", { key: "E202" })], to: [] }, notes: "", created_by: "planner" },
410
- { activity: "Drilling", start: none, end: none, qty: some(36.0),
411
- machines: { from: [], to: [variant("identified", { key: "R302" })] }, notes: "Hinge and shelf pins", created_by: "planner" },
412
- { activity: "Assembly", start: none, end: none, qty: some(6.0),
413
- machines: { from: [], to: [variant("identified", { key: "A702" })] }, notes: "", created_by: "planner" },
414
- ] }],
415
- ["WO-2203", { name: "WO-2203 · Vanity unit, walnut", customer: "Tallowmere Homes", due: some(new Date("2026-11-02T00:00:00Z")), status: "PLANNED", ops: [
416
- { activity: "Panel cutting", start: none, end: none, qty: some(12.0),
417
- machines: { from: [], to: [variant("identified", { key: "S101" })] }, notes: "", created_by: "planner" },
418
- { activity: "CNC routing", start: none, end: none, qty: some(12.0),
419
- machines: { from: [], to: [variant("counted", { n: 1n, key: "CNC router" })] }, notes: "Basin cut-out", created_by: "planner" },
420
- { activity: "Spray finish", start: none, end: none, qty: some(4.0),
421
- machines: { from: [], to: [variant("identified", { key: "F402" })] }, notes: "", created_by: "planner" },
422
- { activity: "Assembly", start: none, end: none, qty: some(2.0),
423
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
424
- ] }],
425
- ["WO-2204", { name: "WO-2204 · Shelving, birch", customer: "Pebblecombe School", due: some(new Date("2026-10-20T00:00:00Z")), status: "ON HOLD", ops: [
426
- { activity: "Panel cutting", start: none, end: none, qty: some(60.0),
427
- machines: { from: [], to: [variant("counted", { n: 2n, key: "beam saw" })] }, notes: "Awaiting board delivery", created_by: "planner" },
428
- { activity: "Edge banding", start: none, end: none, qty: some(150.0),
429
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
430
- { activity: "Sanding", start: none, end: none, qty: some(60.0),
431
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
432
- ] }],
433
- ["WO-2205", { name: "WO-2205 · Office fit-out, maple", customer: "", due: none, status: "PLANNED", ops: [
434
- { activity: "Panel cutting", start: none, end: none, qty: some(80.0),
435
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
436
- { activity: "CNC routing", start: none, end: none, qty: some(40.0),
437
- machines: { from: [], to: [] }, notes: "Cable ports", created_by: "planner" },
438
- { activity: "Assembly", start: none, end: none, qty: some(10.0),
439
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
440
- { activity: "Wrapping", start: none, end: none, qty: some(10.0),
441
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
442
- { activity: "Delivery", start: none, end: none, qty: some(2.0),
443
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
444
- ] }],
445
- ["WO-2206", { name: "WO-2206 · Kitchen, painted", customer: "Orrisdale Cottages", due: some(new Date("2026-11-06T00:00:00Z")), status: "PLANNED", ops: [
446
- { activity: "Panel cutting", start: none, end: none, qty: some(30.0),
447
- machines: { from: [], to: [variant("identified", { key: "S103" })] }, notes: "", created_by: "planner" },
448
- { activity: "Edge banding", start: none, end: none, qty: some(70.0),
449
- machines: { from: [], to: [variant("counted", { n: 1n, key: "edge bander" })] }, notes: "", created_by: "planner" },
450
- { activity: "Spray finish", start: none, end: none, qty: some(18.0),
451
- machines: { from: [], to: [variant("identified", { key: "F401" })] }, notes: "Primer, then two coats", created_by: "planner" },
452
- { activity: "Assembly", start: none, end: none, qty: some(8.0),
453
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
454
- { activity: "Wrapping", start: none, end: none, qty: some(8.0),
455
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
456
- { activity: "Delivery", start: none, end: none, qty: some(1.0),
457
- machines: { from: [], to: [] }, notes: "", created_by: "planner" },
458
- ] }],
459
- ]));
460
- /** The orders' patch door — every Save commits through it. */
461
- export const sheetWorkshopOrdersPatch = e3.mutation.patch(sheetWorkshopOrders);
462
- /** The orders by status and by customer: what the rail narrows them by, each choice one index's runs. */
463
- export const sheetWorkshopOrdersByStatus = e3.recordIndex("sheet_workshop_orders_by_status", sheetWorkshopOrders, { on: ["status"] });
464
- export const sheetWorkshopOrdersByCustomer = e3.recordIndex("sheet_workshop_orders_by_customer", sheetWorkshopOrders, { on: ["customer"] });
411
+ export const sheetWorkshopOrders = e3.record("sheet_workshop_orders", DictType(StringType, WorkshopOrder), {
412
+ initial: new Map([
413
+ ["WO-2201", { name: "WO-2201 · Kitchen, oak", customer: "Quillfeather Interiors", due: some(new Date("2026-10-23T00:00:00Z")), status: "RELEASED", ops: [
414
+ { activity: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), end: some(new Date("2026-10-13T00:00:00Z")), qty: some(48.0),
415
+ machines: { from: [variant("identified", { key: "S101" })], to: [variant("identified", { key: "E201" })] }, notes: "Oak veneered board", created_by: "planner" },
416
+ { activity: "Edge banding", start: some(new Date("2026-10-14T00:00:00Z")), end: some(new Date("2026-10-15T00:00:00Z")), qty: some(120.0),
417
+ machines: { from: [variant("identified", { key: "E201" })], to: [variant("identified", { key: "R301" })] }, notes: "", created_by: "planner" },
418
+ { activity: "CNC routing", start: some(new Date("2026-10-15T00:00:00Z")), end: some(new Date("2026-10-17T00:00:00Z")), qty: some(48.0),
419
+ machines: { from: [variant("identified", { key: "R301" })], to: [variant("identified", { key: "A701" })] }, notes: "Hinge cups and handle slots", created_by: "planner" },
420
+ { activity: "Assembly", start: none, end: none, qty: some(12.0),
421
+ machines: { from: [], to: [variant("identified", { key: "A701" })] }, notes: "Twelve carcasses", created_by: "planner" },
422
+ { activity: "Spray finish", start: none, end: none, qty: some(24.0),
423
+ machines: { from: [], to: [variant("identified", { key: "F401" })] }, notes: "Matt lacquer", created_by: "planner" },
424
+ ] }],
425
+ ["WO-2202", { name: "WO-2202 · Wardrobes, ash", customer: "Marrowby Lettings", due: some(new Date("2026-10-30T00:00:00Z")), status: "PLANNED", ops: [
426
+ { activity: "Panel cutting", start: some(new Date("2026-10-13T00:00:00Z")), end: some(new Date("2026-10-14T00:00:00Z")), qty: some(36.0),
427
+ machines: { from: [variant("identified", { key: "S102" })], to: [variant("identified", { key: "E202" })] }, notes: "", created_by: "planner" },
428
+ { activity: "Edge banding", start: none, end: none, qty: some(90.0),
429
+ machines: { from: [variant("identified", { key: "E202" })], to: [] }, notes: "", created_by: "planner" },
430
+ { activity: "Drilling", start: none, end: none, qty: some(36.0),
431
+ machines: { from: [], to: [variant("identified", { key: "R302" })] }, notes: "Hinge and shelf pins", created_by: "planner" },
432
+ { activity: "Assembly", start: none, end: none, qty: some(6.0),
433
+ machines: { from: [], to: [variant("identified", { key: "A702" })] }, notes: "", created_by: "planner" },
434
+ ] }],
435
+ ["WO-2203", { name: "WO-2203 · Vanity unit, walnut", customer: "Tallowmere Homes", due: some(new Date("2026-11-02T00:00:00Z")), status: "PLANNED", ops: [
436
+ { activity: "Panel cutting", start: none, end: none, qty: some(12.0),
437
+ machines: { from: [], to: [variant("identified", { key: "S101" })] }, notes: "", created_by: "planner" },
438
+ { activity: "CNC routing", start: none, end: none, qty: some(12.0),
439
+ machines: { from: [], to: [variant("counted", { n: 1n, key: "CNC router" })] }, notes: "Basin cut-out", created_by: "planner" },
440
+ { activity: "Spray finish", start: none, end: none, qty: some(4.0),
441
+ machines: { from: [], to: [variant("identified", { key: "F402" })] }, notes: "", created_by: "planner" },
442
+ { activity: "Assembly", start: none, end: none, qty: some(2.0),
443
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
444
+ ] }],
445
+ ["WO-2204", { name: "WO-2204 · Shelving, birch", customer: "Pebblecombe School", due: some(new Date("2026-10-20T00:00:00Z")), status: "ON HOLD", ops: [
446
+ { activity: "Panel cutting", start: none, end: none, qty: some(60.0),
447
+ machines: { from: [], to: [variant("counted", { n: 2n, key: "beam saw" })] }, notes: "Awaiting board delivery", created_by: "planner" },
448
+ { activity: "Edge banding", start: none, end: none, qty: some(150.0),
449
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
450
+ { activity: "Sanding", start: none, end: none, qty: some(60.0),
451
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
452
+ ] }],
453
+ ["WO-2205", { name: "WO-2205 · Office fit-out, maple", customer: "", due: none, status: "PLANNED", ops: [
454
+ { activity: "Panel cutting", start: none, end: none, qty: some(80.0),
455
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
456
+ { activity: "CNC routing", start: none, end: none, qty: some(40.0),
457
+ machines: { from: [], to: [] }, notes: "Cable ports", created_by: "planner" },
458
+ { activity: "Assembly", start: none, end: none, qty: some(10.0),
459
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
460
+ { activity: "Wrapping", start: none, end: none, qty: some(10.0),
461
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
462
+ { activity: "Delivery", start: none, end: none, qty: some(2.0),
463
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
464
+ ] }],
465
+ ["WO-2206", { name: "WO-2206 · Kitchen, painted", customer: "Orrisdale Cottages", due: some(new Date("2026-11-06T00:00:00Z")), status: "PLANNED", ops: [
466
+ { activity: "Panel cutting", start: none, end: none, qty: some(30.0),
467
+ machines: { from: [], to: [variant("identified", { key: "S103" })] }, notes: "", created_by: "planner" },
468
+ { activity: "Edge banding", start: none, end: none, qty: some(70.0),
469
+ machines: { from: [], to: [variant("counted", { n: 1n, key: "edge bander" })] }, notes: "", created_by: "planner" },
470
+ { activity: "Spray finish", start: none, end: none, qty: some(18.0),
471
+ machines: { from: [], to: [variant("identified", { key: "F401" })] }, notes: "Primer, then two coats", created_by: "planner" },
472
+ { activity: "Assembly", start: none, end: none, qty: some(8.0),
473
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
474
+ { activity: "Wrapping", start: none, end: none, qty: some(8.0),
475
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
476
+ { activity: "Delivery", start: none, end: none, qty: some(1.0),
477
+ machines: { from: [], to: [] }, notes: "", created_by: "planner" },
478
+ ] }],
479
+ ]),
480
+ indexes: (index) => ({
481
+ // The orders by status and by customer: what the rail narrows them by, each choice one index's runs.
482
+ sheet_workshop_orders_by_status: index.on(["status"]),
483
+ sheet_workshop_orders_by_customer: index.on(["customer"]),
484
+ }),
485
+ mutations: (mutation) => ({
486
+ // The orders' patch door — every Save commits through it.
487
+ patch: mutation.patch(),
488
+ }),
489
+ });
465
490
  /** An operation template — the Rows tab's card, the group it sits under, and the activity and work centres it drops. */
466
491
  export const WorkshopOperationTemplate = StructType({ name: StringType, group: StringType, activity: StringType, machines: Sheet.Types.Link });
467
492
  /** The operation templates, keyed by their key: a record of their own, the rail's `rowTemplates` source (#1345). */
468
- export const sheetWorkshopOperationTemplates = e3.record("sheet_workshop_operation_templates", DictType(StringType, WorkshopOperationTemplate), new Map([
469
- ["assemble", { name: "Assembly", group: "Operations", activity: "Assembly", machines: { from: [], to: [] } }],
470
- ["cut", { name: "Panel cutting", group: "Operations", activity: "Panel cutting", machines: { from: [], to: [variant("counted", { n: 1n, key: "beam saw" })] } }],
471
- ["deliver", { name: "Delivery", group: "Dispatch", activity: "Delivery", machines: { from: [], to: [] } }],
472
- ["edge", { name: "Edge banding", group: "Operations", activity: "Edge banding", machines: { from: [], to: [variant("counted", { n: 1n, key: "edge bander" })] } }],
473
- ["route", { name: "CNC routing", group: "Operations", activity: "CNC routing", machines: { from: [], to: [variant("counted", { n: 1n, key: "CNC router" })] } }],
474
- ["sand", { name: "Sanding", group: "Operations", activity: "Sanding", machines: { from: [], to: [] } }],
475
- ["spray", { name: "Spray finish", group: "Operations", activity: "Spray finish", machines: { from: [], to: [variant("counted", { n: 1n, key: "spray booth" })] } }],
476
- ["wrap", { name: "Wrapping", group: "Dispatch", activity: "Wrapping", machines: { from: [], to: [] } }],
477
- ]));
478
- /** The operation templates by their group: what the rail narrows them by. */
479
- export const sheetWorkshopOperationTemplatesByGroup = e3.recordIndex("sheet_workshop_operation_templates_by_group", sheetWorkshopOperationTemplates, { on: ["group"] });
493
+ export const sheetWorkshopOperationTemplates = e3.record("sheet_workshop_operation_templates", DictType(StringType, WorkshopOperationTemplate), {
494
+ initial: new Map([
495
+ ["assemble", { name: "Assembly", group: "Operations", activity: "Assembly", machines: { from: [], to: [] } }],
496
+ ["cut", { name: "Panel cutting", group: "Operations", activity: "Panel cutting", machines: { from: [], to: [variant("counted", { n: 1n, key: "beam saw" })] } }],
497
+ ["deliver", { name: "Delivery", group: "Dispatch", activity: "Delivery", machines: { from: [], to: [] } }],
498
+ ["edge", { name: "Edge banding", group: "Operations", activity: "Edge banding", machines: { from: [], to: [variant("counted", { n: 1n, key: "edge bander" })] } }],
499
+ ["route", { name: "CNC routing", group: "Operations", activity: "CNC routing", machines: { from: [], to: [variant("counted", { n: 1n, key: "CNC router" })] } }],
500
+ ["sand", { name: "Sanding", group: "Operations", activity: "Sanding", machines: { from: [], to: [] } }],
501
+ ["spray", { name: "Spray finish", group: "Operations", activity: "Spray finish", machines: { from: [], to: [variant("counted", { n: 1n, key: "spray booth" })] } }],
502
+ ["wrap", { name: "Wrapping", group: "Dispatch", activity: "Wrapping", machines: { from: [], to: [] } }],
503
+ ]),
504
+ indexes: (index) => ({
505
+ // The operation templates by their group: what the rail narrows them by.
506
+ sheet_workshop_operation_templates_by_group: index.on(["group"]),
507
+ }),
508
+ });
480
509
  /** An order template — the Rows tab's card, the group it sits under, and the operations each kind of order starts with. */
481
510
  export const WorkshopOrderTemplate = StructType({ name: StringType, group: StringType, ops: ArrayType(WorkshopOperation) });
482
511
  /** The order templates, keyed by their key: a record of their own, the rail's `groupTemplates` source (#1345). */
483
- export const sheetWorkshopOrderTemplates = e3.record("sheet_workshop_order_templates", DictType(StringType, WorkshopOrderTemplate), new Map([
484
- ["kitchen", { name: "Kitchen order", group: "Orders", ops: [
485
- { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
486
- { activity: "Edge banding", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
487
- { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
488
- { activity: "Spray finish", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
489
- ] }],
490
- ["vanity", { name: "Vanity unit", group: "Orders", ops: [
491
- { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
492
- { activity: "CNC routing", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
493
- { activity: "Spray finish", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
494
- { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
495
- ] }],
496
- ["wardrobe", { name: "Wardrobe order", group: "Orders", ops: [
497
- { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
498
- { activity: "Edge banding", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
499
- { activity: "Drilling", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
500
- { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
501
- ] }],
502
- ]));
503
- /** The order templates by their group: what the rail narrows them by. */
504
- export const sheetWorkshopOrderTemplatesByGroup = e3.recordIndex("sheet_workshop_order_templates_by_group", sheetWorkshopOrderTemplates, { on: ["group"] });
512
+ export const sheetWorkshopOrderTemplates = e3.record("sheet_workshop_order_templates", DictType(StringType, WorkshopOrderTemplate), {
513
+ initial: new Map([
514
+ ["kitchen", { name: "Kitchen order", group: "Orders", ops: [
515
+ { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
516
+ { activity: "Edge banding", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
517
+ { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
518
+ { activity: "Spray finish", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
519
+ ] }],
520
+ ["vanity", { name: "Vanity unit", group: "Orders", ops: [
521
+ { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
522
+ { activity: "CNC routing", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
523
+ { activity: "Spray finish", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
524
+ { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
525
+ ] }],
526
+ ["wardrobe", { name: "Wardrobe order", group: "Orders", ops: [
527
+ { activity: "Panel cutting", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
528
+ { activity: "Edge banding", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
529
+ { activity: "Drilling", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
530
+ { activity: "Assembly", start: none, end: none, qty: none, machines: { from: [], to: [] }, notes: "", created_by: "" },
531
+ ] }],
532
+ ]),
533
+ indexes: (index) => ({
534
+ // The order templates by their group: what the rail narrows them by.
535
+ sheet_workshop_order_templates_by_group: index.on(["group"]),
536
+ }),
537
+ });
505
538
  /** The model behind the workshop's async proposer — an e3 function, a service, a notebook; the sheet needs only its types. */
506
539
  const workshopRecommend = East.asyncPlatform("sheet_workshop_recommend", [Sheet.Types.DraftContext(WorkshopOrder, "ops", WorkshopActivity)], ArrayType(Sheet.Types.Proposal(WorkshopOperation)), { optional: true });
507
540
  /**
@@ -529,10 +562,10 @@ const workshopRecommend = East.asyncPlatform("sheet_workshop_recommend", [Sheet.
529
562
  * and the order with no customer is the batch's issue.
530
563
  */
531
564
  export const sheetWorkshop = example({
532
- keywords: ["Sheet", "BuilderFrame", "record", "Record", "Record.onApply", "group", "driver", "register", "members", "concat", "aliases", "meta", "parent", "Dict", "fold", "duplicate", "link", "multiple", "sides", "locks", "arity", "check", "exists", "uom", "Format", "templates", "Sheet.templates", "library", "Sheet.library", "Sheet.library.tab", "drop", "inspector", "fields", "Sheet.field", "readonly", "views", "RecordView", "slice", "Slice.bindRecords", "Data.bindPaged", "recordIndex", "search", "filter", "copilot", "fill", "provider", "derive", "history", "sequence", "default", "phrase", "capacity", "propose", "proposer", "suggest", "learned", "follower", "asyncFunction", "asyncPlatform", "ready", "newGroup", "newRow", "footer", "joinery"],
565
+ keywords: ["Sheet", "BuilderFrame", "record", "Record", "Record.onApply", "group", "driver", "register", "members", "concat", "aliases", "meta", "parent", "Dict", "fold", "duplicate", "link", "multiple", "sides", "locks", "arity", "check", "exists", "uom", "Format", "templates", "Sheet.templates", "library", "Sheet.library", "Sheet.library.tab", "drop", "inspector", "fields", "Sheet.field", "readonly", "views", "RecordView", "slice", "Slice.bindRecords", "Data.bindPaged", "indexes", "search", "filter", "copilot", "fill", "provider", "derive", "history", "sequence", "default", "phrase", "capacity", "propose", "proposer", "suggest", "learned", "follower", "asyncFunction", "asyncPlatform", "ready", "newGroup", "newRow", "footer", "joinery"],
533
566
  description: "The flagship sheet — the workshop's orders as groups and their operations as lines; an activity driver giving units, durations and live halves; one work-centre register joined from a machines record (Dict), the bays (aliases) and the families (folded), its link grammar counting, locking, implying and checking machines; the copilot's fills (derive, history, sequence, default, phrase, capacity) and proposers (a pattern, a learned follower, an async model); an order check; one rail over the orders and the operation and order templates records, each its own source; a library of the templates, the statuses (dropped on an order to set its status) and the columns; an inspector pane showing every field; views kept per viewer; and a footer",
534
567
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
535
- const orders = $.let(Record.bind(sheetWorkshopOrders, [sheetWorkshopOrdersPatch]));
568
+ const orders = $.let(Record.bind(sheetWorkshopOrders));
536
569
  const machines = $.let(Record.bind(sheetWorkshopMachines, []));
537
570
  const activities = $.let(Data.bind(sheetWorkshopActivities));
538
571
  const operationTemplates = $.let(Data.bind(sheetWorkshopOperationTemplates));
@@ -559,18 +592,18 @@ export const sheetWorkshop = example({
559
592
  // One rail over three records: the orders — the sheet's rows — and each templates record, its own source.
560
593
  const slice = $.let(Slice.bindRecords("sheet.workshop", {
561
594
  rows: {
562
- source: Data.bindPaged(sheetWorkshopOrders, { indexes: [sheetWorkshopOrdersByStatus, sheetWorkshopOrdersByCustomer] }),
595
+ source: Data.bindPaged(sheetWorkshopOrders, { indexes: ["sheet_workshop_orders_by_status", "sheet_workshop_orders_by_customer"] }),
563
596
  label: "Orders",
564
597
  fields: { status: { label: "Status", hints: ["PLANNED", "RELEASED", "ON HOLD"] }, customer: { label: "Customer" } },
565
598
  search: ["customer"],
566
599
  },
567
600
  rowTemplates: {
568
- source: Data.bindPaged(sheetWorkshopOperationTemplates, { indexes: [sheetWorkshopOperationTemplatesByGroup] }),
601
+ source: Data.bindPaged(sheetWorkshopOperationTemplates, { indexes: ["sheet_workshop_operation_templates_by_group"] }),
569
602
  label: "Operation templates",
570
603
  fields: { group: { label: "Group", hints: ["Operations", "Dispatch"] } },
571
604
  },
572
605
  groupTemplates: {
573
- source: Data.bindPaged(sheetWorkshopOrderTemplates, { indexes: [sheetWorkshopOrderTemplatesByGroup] }),
606
+ source: Data.bindPaged(sheetWorkshopOrderTemplates, { indexes: ["sheet_workshop_order_templates_by_group"] }),
574
607
  label: "Order templates",
575
608
  fields: { group: { label: "Group", hints: ["Orders"] } },
576
609
  },
@@ -824,29 +857,33 @@ export const WeekRow = StructType({
824
857
  /** One week's plan — when it starts, and its rows in the planner's order. */
825
858
  export const WeekPlan = StructType({ starts: DateTimeType, rows: ArrayType(WeekRow) });
826
859
  /** The plans, one per week, keyed 2026-W42, 2026-W43, … */
827
- export const sheetWeekPlans = e3.record("sheet_week_plans", DictType(StringType, WeekPlan), new Map([
828
- ["2026-W42", { starts: new Date("2026-10-12T00:00:00Z"), rows: [
829
- { id: "w42-1", task: "Cut the kitchen carcasses", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0), setups: some(2n), site: "Machine shop",
830
- status: "PLANNED", code: "", level: variant("day", null), started: none,
831
- machines: { from: [], to: [variant("range", { from: "S101", to: "S103" })] } },
832
- { id: "w42-2", task: "Band the carcass edges", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0), setups: some(1n), site: "Machine shop",
833
- status: "RELEASED", code: "WO-2201", level: variant("day", null), started: some(new Date("2026-10-13T07:30:00Z")),
834
- machines: { from: [], to: [variant("identified", { key: "E201" })] } },
835
- { id: "w42-3", task: "Route the door panels", start: none, qty: some(24.0), setups: none, site: "Bench room",
836
- status: "PLANNED", code: "", level: variant("week", null), started: none,
837
- machines: { from: [], to: [] } },
838
- ] }],
839
- ["2026-W43", { starts: new Date("2026-10-19T00:00:00Z"), rows: [
840
- { id: "w43-1", task: "Assemble the wardrobes", start: some(new Date("2026-10-19T00:00:00Z")), qty: some(6.0), setups: none, site: "Fitting shop",
841
- status: "PLANNED", code: "", level: variant("day", null), started: none,
842
- machines: { from: [], to: [variant("identified", { key: "A701" })] } },
843
- { id: "w43-2", task: "Spray the vanity doors", start: none, qty: some(4.0), setups: none, site: "Spray shop",
844
- status: "PLANNED", code: "", level: variant("time", null), started: none,
845
- machines: { from: [], to: [] } },
846
- ] }],
847
- ]));
848
- /** The plans' patch door — every Save commits through it. */
849
- export const sheetWeekPlansPatch = e3.mutation.patch(sheetWeekPlans);
860
+ export const sheetWeekPlans = e3.record("sheet_week_plans", DictType(StringType, WeekPlan), {
861
+ initial: new Map([
862
+ ["2026-W42", { starts: new Date("2026-10-12T00:00:00Z"), rows: [
863
+ { id: "w42-1", task: "Cut the kitchen carcasses", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0), setups: some(2n), site: "Machine shop",
864
+ status: "PLANNED", code: "", level: variant("day", null), started: none,
865
+ machines: { from: [], to: [variant("range", { from: "S101", to: "S103" })] } },
866
+ { id: "w42-2", task: "Band the carcass edges", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0), setups: some(1n), site: "Machine shop",
867
+ status: "RELEASED", code: "WO-2201", level: variant("day", null), started: some(new Date("2026-10-13T07:30:00Z")),
868
+ machines: { from: [], to: [variant("identified", { key: "E201" })] } },
869
+ { id: "w42-3", task: "Route the door panels", start: none, qty: some(24.0), setups: none, site: "Bench room",
870
+ status: "PLANNED", code: "", level: variant("week", null), started: none,
871
+ machines: { from: [], to: [] } },
872
+ ] }],
873
+ ["2026-W43", { starts: new Date("2026-10-19T00:00:00Z"), rows: [
874
+ { id: "w43-1", task: "Assemble the wardrobes", start: some(new Date("2026-10-19T00:00:00Z")), qty: some(6.0), setups: none, site: "Fitting shop",
875
+ status: "PLANNED", code: "", level: variant("day", null), started: none,
876
+ machines: { from: [], to: [variant("identified", { key: "A701" })] } },
877
+ { id: "w43-2", task: "Spray the vanity doors", start: none, qty: some(4.0), setups: none, site: "Spray shop",
878
+ status: "PLANNED", code: "", level: variant("time", null), started: none,
879
+ machines: { from: [], to: [] } },
880
+ ] }],
881
+ ]),
882
+ mutations: (mutation) => ({
883
+ // The plans' patch door — every Save commits through it.
884
+ patch: mutation.patch(),
885
+ }),
886
+ });
850
887
  /**
851
888
  * One entry's rows (§3.4) — the week the viewer picks, its rows in the
852
889
  * planner's order; each week keeps its own drafts until Save or Discard, and
@@ -867,7 +904,7 @@ export const sheetWeeks = example({
867
904
  keywords: ["Sheet", "BuilderFrame", "record", "entry", "one entry", "rows", "id", "week", "State", "SegmentGroup", "drafts per entry", "inspector", "update", "Field.Slider", "column", "date", "text", "quantity", "integer", "reference", "enum", "set", "stamped", "owned", "register", "options", "level", "actual", "detail", "ranged", "DateLevel", "week", "day", "range", "time", "rule", "ready", "row", "Readiness", "completeness", "validation", "onPatch", "PatchEvent", "provenance", "source", "newRowId", "newRow", "write-back"],
868
905
  description: "A sheet over one entry's rows — the week the viewer picks, its rows in the planner's order, each week its own drafts until Save or Discard — with every column kind and its rules (a date at each row's level with its actual, an integer, a reference, an enum narrowed by an options rule with a detail, a stamped code owning its row, a set of machines in ranges), a row rule, a journal of every gesture, ids minted by a counter, and its own Details in the inspector pane, a row's quantity on a slider written back as one transaction",
869
906
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
870
- const plans = $.let(Record.bind(sheetWeekPlans, [sheetWeekPlansPatch]));
907
+ const plans = $.let(Record.bind(sheetWeekPlans));
871
908
  // The week the viewer picked, the journal and the id counter: a viewer's own state.
872
909
  const week = $.let(State.bind([StringType], "sheet.weeks.week", "2026-W42"));
873
910
  const log = $.let(State.bind([ArrayType(StringType)], "sheet.weeks.journal", []));
@@ -957,50 +994,62 @@ export const Batch = StructType({ id: StringType, name: StringType, steps: Array
957
994
  /** One day's batches, in the planner's order. */
958
995
  export const BatchDay = StructType({ batches: ArrayType(Batch) });
959
996
  /** The days, keyed by date. */
960
- export const sheetBatchDays = e3.record("sheet_batch_days", DictType(StringType, BatchDay), new Map([
961
- ["2026-10-12", { batches: [
962
- { id: "B-101", name: "Doors, oak", steps: [
963
- { task: "Cut doors", qty: some(12.0), parts: [
964
- { id: "B-101-1", code: "CUT", name: "Cut the door blanks", materials: ["Oak veneered board × 6"], station: some("S101") },
965
- ], bookings: [variant("labour", { team: "Cutting", people: 1n, hours: 3.0 })] },
966
- { task: "Band doors", qty: some(48.0), parts: [], bookings: [variant("equipment", { resource: "Edge bander E201" })] },
967
- { task: "Spray doors", qty: some(12.0), parts: [
968
- { id: "B-101-3", code: "SPR", name: "Seal and lacquer", materials: ["Sealer", "Matt lacquer"], station: none },
969
- ], bookings: [] },
970
- ] },
971
- { id: "B-102", name: "Carcasses, birch", steps: [
972
- { task: "Cut carcasses", qty: some(8.0), parts: [], bookings: [] },
973
- { task: "Drill carcasses", qty: some(8.0), parts: [], bookings: [variant("labour", { team: "Machining", people: 2n, hours: 2.5 })] },
974
- ] },
975
- { id: "B-103", name: "Shelves, ash", steps: [
976
- { task: "Cut shelves", qty: some(20.0), parts: [], bookings: [] },
977
- { task: "Sand shelves", qty: some(20.0), parts: [], bookings: [] },
978
- ] },
979
- ] }],
980
- ]));
981
- /** The days' patch door — every Save commits through it. */
982
- export const sheetBatchDaysPatch = e3.mutation.patch(sheetBatchDays);
997
+ export const sheetBatchDays = e3.record("sheet_batch_days", DictType(StringType, BatchDay), {
998
+ initial: new Map([
999
+ ["2026-10-12", { batches: [
1000
+ { id: "B-101", name: "Doors, oak", steps: [
1001
+ { task: "Cut doors", qty: some(12.0), parts: [
1002
+ { id: "B-101-1", code: "CUT", name: "Cut the door blanks", materials: ["Oak veneered board × 6"], station: some("S101") },
1003
+ ], bookings: [variant("labour", { team: "Cutting", people: 1n, hours: 3.0 })] },
1004
+ { task: "Band doors", qty: some(48.0), parts: [], bookings: [variant("equipment", { resource: "Edge bander E201" })] },
1005
+ { task: "Spray doors", qty: some(12.0), parts: [
1006
+ { id: "B-101-3", code: "SPR", name: "Seal and lacquer", materials: ["Sealer", "Matt lacquer"], station: none },
1007
+ ], bookings: [] },
1008
+ ] },
1009
+ { id: "B-102", name: "Carcasses, birch", steps: [
1010
+ { task: "Cut carcasses", qty: some(8.0), parts: [], bookings: [] },
1011
+ { task: "Drill carcasses", qty: some(8.0), parts: [], bookings: [variant("labour", { team: "Machining", people: 2n, hours: 2.5 })] },
1012
+ ] },
1013
+ { id: "B-103", name: "Shelves, ash", steps: [
1014
+ { task: "Cut shelves", qty: some(20.0), parts: [], bookings: [] },
1015
+ { task: "Sand shelves", qty: some(20.0), parts: [], bookings: [] },
1016
+ ] },
1017
+ ] }],
1018
+ ]),
1019
+ mutations: (mutation) => ({
1020
+ // The days' patch door — every Save commits through it.
1021
+ patch: mutation.patch(),
1022
+ }),
1023
+ });
983
1024
  /** A step template — the Rows tab's card, the group it sits under, and the task of the step it drops. */
984
1025
  export const BatchStepTemplate = StructType({ name: StringType, group: StringType, task: StringType });
985
1026
  /** The step templates, keyed by their key: a record of their own, the rail's `rowTemplates` source (#1345). */
986
- export const sheetBatchStepTemplates = e3.record("sheet_batch_step_templates", DictType(StringType, BatchStepTemplate), new Map([
987
- ["sand", { name: "Sand", group: "Steps", task: "Sand" }],
988
- ["seal", { name: "Seal", group: "Steps", task: "Seal" }],
989
- ]));
990
- /** The step templates by their group: what the rail narrows them by. */
991
- export const sheetBatchStepTemplatesByGroup = e3.recordIndex("sheet_batch_step_templates_by_group", sheetBatchStepTemplates, { on: ["group"] });
1027
+ export const sheetBatchStepTemplates = e3.record("sheet_batch_step_templates", DictType(StringType, BatchStepTemplate), {
1028
+ initial: new Map([
1029
+ ["sand", { name: "Sand", group: "Steps", task: "Sand" }],
1030
+ ["seal", { name: "Seal", group: "Steps", task: "Seal" }],
1031
+ ]),
1032
+ indexes: (index) => ({
1033
+ // The step templates by their group: what the rail narrows them by.
1034
+ sheet_batch_step_templates_by_group: index.on(["group"]),
1035
+ }),
1036
+ });
992
1037
  /** A batch template — the Rows tab's card, the group it sits under, the batch's name and the steps it starts with. */
993
1038
  export const BatchTemplate = StructType({ name: StringType, group: StringType, batch: StringType, steps: ArrayType(BatchStep) });
994
1039
  /** The batch templates, keyed by their key: a record of their own, the rail's `groupTemplates` source (#1345). */
995
- export const sheetBatchTemplates = e3.record("sheet_batch_templates", DictType(StringType, BatchTemplate), new Map([
996
- ["finishing", { name: "Finishing batch", group: "Batches", batch: "Finishing", steps: [
997
- { task: "Sand", qty: none, parts: [], bookings: [] },
998
- { task: "Seal", qty: none, parts: [], bookings: [] },
999
- { task: "Spray", qty: none, parts: [], bookings: [] },
1000
- ] }],
1001
- ]));
1002
- /** The batch templates by their group: what the rail narrows them by. */
1003
- export const sheetBatchTemplatesByGroup = e3.recordIndex("sheet_batch_templates_by_group", sheetBatchTemplates, { on: ["group"] });
1040
+ export const sheetBatchTemplates = e3.record("sheet_batch_templates", DictType(StringType, BatchTemplate), {
1041
+ initial: new Map([
1042
+ ["finishing", { name: "Finishing batch", group: "Batches", batch: "Finishing", steps: [
1043
+ { task: "Sand", qty: none, parts: [], bookings: [] },
1044
+ { task: "Seal", qty: none, parts: [], bookings: [] },
1045
+ { task: "Spray", qty: none, parts: [], bookings: [] },
1046
+ ] }],
1047
+ ]),
1048
+ indexes: (index) => ({
1049
+ // The batch templates by their group: what the rail narrows them by.
1050
+ sheet_batch_templates_by_group: index.on(["group"]),
1051
+ }),
1052
+ });
1004
1053
  /**
1005
1054
  * One day's batches, in the planner's order (#1187, SB39, SB40, SB44) — a
1006
1055
  * grouped sheet over one entry's groups, each batch a group of its steps. A
@@ -1019,20 +1068,20 @@ export const sheetBatchTemplatesByGroup = e3.recordIndex("sheet_batch_templates_
1019
1068
  * their group.
1020
1069
  */
1021
1070
  export const sheetBatches = example({
1022
- keywords: ["Sheet", "BuilderFrame", "drag", "drop", "move", "grip", "seam", "templates", "Sheet.templates", "slice", "Slice.bindRecords", "Data.bindPaged", "recordIndex", "group", "grouped", "entry", "order", "Sheet.library.rows", "children", "newGroup", "newRow", "Patch", "defaults", "completeness", "fold", "undo", "redo", "ready", "subRows", "subRow", "sub rows", "SubRow", "Facet", "chips", "facets", "lead", "detail", "noun", "variant", "match", "read-only", "inspector", "Sheet.field", "hidden"],
1071
+ keywords: ["Sheet", "BuilderFrame", "drag", "drop", "move", "grip", "seam", "templates", "Sheet.templates", "slice", "Slice.bindRecords", "Data.bindPaged", "indexes", "group", "grouped", "entry", "order", "Sheet.library.rows", "children", "newGroup", "newRow", "Patch", "defaults", "completeness", "fold", "undo", "redo", "ready", "subRows", "subRow", "sub rows", "SubRow", "Facet", "chips", "facets", "lead", "detail", "noun", "variant", "match", "read-only", "inspector", "Sheet.field", "hidden"],
1023
1072
  description: "A sheet over one day's batches in the planner's order — templates dragged from the library onto a seam, steps and whole batches moved to another seam by their grips, a batch named before Save, new steps and batches from their defaults, and each step's parts and bookings as read-only sub rows under it, declared per array field like columns, beside a library and an inspector pane; its step and batch templates two records, each a source of one rail",
1024
1073
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1025
- const days = $.let(Record.bind(sheetBatchDays, [sheetBatchDaysPatch]));
1074
+ const days = $.let(Record.bind(sheetBatchDays));
1026
1075
  const stepTemplates = $.let(Data.bind(sheetBatchStepTemplates));
1027
1076
  const batchTemplates = $.let(Data.bind(sheetBatchTemplates));
1028
1077
  // One rail over the templates records, each its own source: they narrow the Rows tab's cards.
1029
1078
  const slice = $.let(Slice.bindRecords("sheet.batches", {
1030
1079
  rowTemplates: {
1031
- source: Data.bindPaged(sheetBatchStepTemplates, { indexes: [sheetBatchStepTemplatesByGroup] }),
1080
+ source: Data.bindPaged(sheetBatchStepTemplates, { indexes: ["sheet_batch_step_templates_by_group"] }),
1032
1081
  label: "Step templates", fields: { group: { label: "Group", hints: ["Steps"] } },
1033
1082
  },
1034
1083
  groupTemplates: {
1035
- source: Data.bindPaged(sheetBatchTemplates, { indexes: [sheetBatchTemplatesByGroup] }),
1084
+ source: Data.bindPaged(sheetBatchTemplates, { indexes: ["sheet_batch_templates_by_group"] }),
1036
1085
  label: "Batch templates", fields: { group: { label: "Group", hints: ["Batches"] } },
1037
1086
  },
1038
1087
  }));
@@ -1083,21 +1132,25 @@ export const LooseEntry = Sheet.Types.Entry(LoosePackage, "tasks");
1083
1132
  /** A week's work — its entries, in the planner's order. */
1084
1133
  export const LooseWork = StructType({ entries: ArrayType(LooseEntry) });
1085
1134
  /** The work, one entry per week. */
1086
- export const sheetLooseWork = e3.record("sheet_loose_work", DictType(StringType, LooseWork), new Map([
1087
- ["2026-W42", { entries: [
1088
- variant("row", { id: "brief", task: "Check the drawings", qty: none, notes: "Before any cutting" }),
1089
- variant("group", { id: "doors", name: "Kitchen doors", tasks: [
1090
- { id: "doors-1", task: "Cut door blanks", qty: some(24.0), notes: "Oak veneered board" },
1091
- { id: "doors-2", task: "Inspect the blanks", qty: some(4.0), notes: "Before finishing" },
1092
- ] }),
1093
- variant("row", { id: "handover", task: "Hand over to finishing", qty: none, notes: "" }),
1094
- variant("group", { id: "finish", name: "Door finishing", tasks: [
1095
- { id: "finish-1", task: "Spray the doors", qty: some(24.0), notes: "Matt lacquer" },
1096
- ] }),
1097
- ] }],
1098
- ]));
1099
- /** The work's patch door — every Save commits through it. */
1100
- export const sheetLooseWorkPatch = e3.mutation.patch(sheetLooseWork);
1135
+ export const sheetLooseWork = e3.record("sheet_loose_work", DictType(StringType, LooseWork), {
1136
+ initial: new Map([
1137
+ ["2026-W42", { entries: [
1138
+ variant("row", { id: "brief", task: "Check the drawings", qty: none, notes: "Before any cutting" }),
1139
+ variant("group", { id: "doors", name: "Kitchen doors", tasks: [
1140
+ { id: "doors-1", task: "Cut door blanks", qty: some(24.0), notes: "Oak veneered board" },
1141
+ { id: "doors-2", task: "Inspect the blanks", qty: some(4.0), notes: "Before finishing" },
1142
+ ] }),
1143
+ variant("row", { id: "handover", task: "Hand over to finishing", qty: none, notes: "" }),
1144
+ variant("group", { id: "finish", name: "Door finishing", tasks: [
1145
+ { id: "finish-1", task: "Spray the doors", qty: some(24.0), notes: "Matt lacquer" },
1146
+ ] }),
1147
+ ] }],
1148
+ ]),
1149
+ mutations: (mutation) => ({
1150
+ // The work's patch door — every Save commits through it.
1151
+ patch: mutation.patch(),
1152
+ }),
1153
+ });
1101
1154
  /**
1102
1155
  * Loose rows between the groups (#846) — the week's entries are
1103
1156
  * `Sheet.Types.Entry(LoosePackage, "tasks")`: a work package with its
@@ -1113,7 +1166,7 @@ export const sheetLoose = example({
1113
1166
  keywords: ["Sheet", "BuilderFrame", "group", "grouped", "loose", "ungrouped", "Entry", "Types.Entry", "variant", "entries", "insert", "move", "newRow", "newGroup", "noun", "entry", "record"],
1114
1167
  description: "A sheet over one week's entries — work packages and loose tasks: a loose task is a plain row numbered in the packages' sequence, inserted at the seam above a package or beside another loose task, and moved between the entries by its grip",
1115
1168
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1116
- const work = $.let(Record.bind(sheetLooseWork, [sheetLooseWorkPatch]));
1169
+ const work = $.let(Record.bind(sheetLooseWork));
1117
1170
  const newTask = $.const(East.function([Sheet.Types.NewRow], Sheet.Types.Patch(LooseTask), () => Sheet.patch(LooseTask, { qty: none, notes: "" })));
1118
1171
  const newPackage = $.const(East.function([Sheet.Types.NewGroup], Sheet.Types.Patch(LoosePackage), () => Sheet.patch(LoosePackage, { tasks: [] })));
1119
1172
  return (_jsx(Box, { height: "480px", children: _jsx(Sheet, { record: work, entry: { key: "2026-W42", rows: "entries", id: "id" }, group: Sheet.group(LoosePackage, "tasks", { title: "name", noun: { singular: "package", plural: "packages" } }), name: "loose", columns: {
@@ -1138,7 +1191,7 @@ export const sheetPaged = example({
1138
1191
  keywords: ["Sheet", "BuilderFrame", "record", "window", "Data.bindPaged", "paged", "key order", "key search", "edits", "insertRows", "removeRows", "insert", "before", "after", "Undo"],
1139
1192
  description: "A sheet over a large record, read a window at a time in key order — Data.bindPaged over the same record its Save commits to — whose edits add rows (gutter seams, the selection strip, Alt+Insert) and never remove one",
1140
1193
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1141
- const jobs = $.let(Record.bind(sheetJobs, [sheetJobsPatch]));
1194
+ const jobs = $.let(Record.bind(sheetJobs));
1142
1195
  const page = $.let(Data.bindPaged(sheetJobs));
1143
1196
  return (_jsx(Box, { height: "560px", children: _jsx(Sheet, { record: jobs, window: page, name: "paged", edits: { insertRows: true, removeRows: false }, columns: {
1144
1197
  task: Sheet.column.text(SheetJob, { header: "Task", width: "240px" }),
@@ -1175,32 +1228,36 @@ export const MachineUpkeep = StructType({
1175
1228
  serial: StringType, // a stamped column: read only
1176
1229
  });
1177
1230
  /** The machines' upkeep, keyed by machine code. */
1178
- export const sheetMachineUpkeep = e3.record("sheet_machine_upkeep", DictType(StringType, MachineUpkeep), new Map([
1179
- ["S101", { name: "Beam saw", bay: "Bay 1", hours: 1240n, family: variant("beam_saw", null), wear: some(35.5), crew: some("Cutting crew"),
1180
- tickets: new Set(["Panel saw ticket", "Dust extraction"]),
1181
- checks: [{ text: "Blade sharpened", done: true }, { text: "Fence squared", done: true }, { text: "Extraction cleaned", done: false }],
1182
- supplier: { name: "Kestrelmoor Saw Works", phone: "01632 960 118" },
1183
- in_service: true, guard_checked: some(true),
1184
- serviced: new Date("2026-09-28T07:30:00Z"), next_service: some(new Date("2026-11-09T07:30:00Z")), serial: "BS-4410-0193" }],
1185
- ["E201", { name: "Edge bander", bay: "Bay 2", hours: 860n, family: variant("edge_bander", null), wear: none, crew: none,
1186
- tickets: new Set(), checks: [], supplier: { name: "", phone: "" },
1187
- in_service: true, guard_checked: none,
1188
- serviced: new Date("2026-08-17T06:00:00Z"), next_service: none, serial: "EB-2207-0457" }],
1189
- ["R301", { name: "CNC router", bay: "Bay 3", hours: 2210n, family: variant("cnc_router", null), wear: some(62.0), crew: some("Machining crew"),
1190
- tickets: new Set(["Router ticket"]),
1191
- checks: [{ text: "Spindle greased", done: true }, { text: "Bed vacuum tested", done: false }],
1192
- supplier: { name: "Brindlecote Tooling", phone: "01632 960 342" },
1193
- in_service: false, guard_checked: some(false),
1194
- serviced: new Date("2026-07-06T13:15:00Z"), next_service: none, serial: "CR-5120-0088" }],
1195
- ["F401", { name: "Spray booth", bay: "Bay 4", hours: 540n, family: variant("spray_booth", null), wear: none, crew: some("Finishing crew"),
1196
- tickets: new Set(["Spray ticket", "First aid"]),
1197
- checks: [{ text: "Filters changed", done: true }],
1198
- supplier: { name: "Fennimarsh Coatings", phone: "01632 960 775" },
1199
- in_service: true, guard_checked: some(true),
1200
- serviced: new Date("2026-10-01T08:00:00Z"), next_service: some(new Date("2026-12-01T08:00:00Z")), serial: "SB-0391-0017" }],
1201
- ]));
1202
- /** The upkeep's patch door — every Save commits through it. */
1203
- export const sheetMachineUpkeepPatch = e3.mutation.patch(sheetMachineUpkeep);
1231
+ export const sheetMachineUpkeep = e3.record("sheet_machine_upkeep", DictType(StringType, MachineUpkeep), {
1232
+ initial: new Map([
1233
+ ["S101", { name: "Beam saw", bay: "Bay 1", hours: 1240n, family: variant("beam_saw", null), wear: some(35.5), crew: some("Cutting crew"),
1234
+ tickets: new Set(["Panel saw ticket", "Dust extraction"]),
1235
+ checks: [{ text: "Blade sharpened", done: true }, { text: "Fence squared", done: true }, { text: "Extraction cleaned", done: false }],
1236
+ supplier: { name: "Kestrelmoor Saw Works", phone: "01632 960 118" },
1237
+ in_service: true, guard_checked: some(true),
1238
+ serviced: new Date("2026-09-28T07:30:00Z"), next_service: some(new Date("2026-11-09T07:30:00Z")), serial: "BS-4410-0193" }],
1239
+ ["E201", { name: "Edge bander", bay: "Bay 2", hours: 860n, family: variant("edge_bander", null), wear: none, crew: none,
1240
+ tickets: new Set(), checks: [], supplier: { name: "", phone: "" },
1241
+ in_service: true, guard_checked: none,
1242
+ serviced: new Date("2026-08-17T06:00:00Z"), next_service: none, serial: "EB-2207-0457" }],
1243
+ ["R301", { name: "CNC router", bay: "Bay 3", hours: 2210n, family: variant("cnc_router", null), wear: some(62.0), crew: some("Machining crew"),
1244
+ tickets: new Set(["Router ticket"]),
1245
+ checks: [{ text: "Spindle greased", done: true }, { text: "Bed vacuum tested", done: false }],
1246
+ supplier: { name: "Brindlecote Tooling", phone: "01632 960 342" },
1247
+ in_service: false, guard_checked: some(false),
1248
+ serviced: new Date("2026-07-06T13:15:00Z"), next_service: none, serial: "CR-5120-0088" }],
1249
+ ["F401", { name: "Spray booth", bay: "Bay 4", hours: 540n, family: variant("spray_booth", null), wear: none, crew: some("Finishing crew"),
1250
+ tickets: new Set(["Spray ticket", "First aid"]),
1251
+ checks: [{ text: "Filters changed", done: true }],
1252
+ supplier: { name: "Fennimarsh Coatings", phone: "01632 960 775" },
1253
+ in_service: true, guard_checked: some(true),
1254
+ serviced: new Date("2026-10-01T08:00:00Z"), next_service: some(new Date("2026-12-01T08:00:00Z")), serial: "SB-0391-0017" }],
1255
+ ]),
1256
+ mutations: (mutation) => ({
1257
+ // The upkeep's patch door — every Save commits through it.
1258
+ patch: mutation.patch(),
1259
+ }),
1260
+ });
1204
1261
  /**
1205
1262
  * The inspector's every field kind (#1220) — the workshop's machines' upkeep,
1206
1263
  * a record keyed by machine code. The grid shows four columns: a machine's
@@ -1220,7 +1277,7 @@ export const sheetUpkeep = example({
1220
1277
  keywords: ["Sheet", "BuilderFrame", "inspector", "fields", "Sheet.field", "Fields", "form", "text", "placeholder", "number", "unit", "min", "max", "step", "select", "labels", "reference", "register", "checkbox", "datetime", "Option", "Set", "Clear", "tags", "options", "checklist", "nested", "struct", "stamped", "readonly", "integer", "ready", "row", "Readiness", "record"],
1221
1278
  description: "A sheet whose inspector pane edits one field of every kind over the workshop's machines' upkeep — a number with its unit and bounds, a select of a variant's cases, a reference, a text emptied to none, tags, a checklist, a nested struct's fields under its name, a checkbox, a date and a time, Options set and cleared, and a stamped code read only — the hinted fields leading, with a row rule's issue",
1222
1279
  fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1223
- const upkeep = $.let(Record.bind(sheetMachineUpkeep, [sheetMachineUpkeepPatch]));
1280
+ const upkeep = $.let(Record.bind(sheetMachineUpkeep));
1224
1281
  const bays = $.let(["Bay 1", "Bay 2", "Bay 3", "Bay 4", "Bay 7"], ArrayType(StringType));
1225
1282
  // A machine out of service needs its next service booked.
1226
1283
  const readyMachine = $.const(East.function([Sheet.Types.Draft(MachineUpkeep), Sheet.Types.DraftContext(MachineUpkeep)], Sheet.Types.Readiness, ($, row) => {
@@ -1252,4 +1309,54 @@ export const sheetUpkeep = example({
1252
1309
  } }))),
1253
1310
  inputs: [],
1254
1311
  });
1312
+ // ============================================================================
1313
+ // sheetConflicts — your edits meeting someone else's save
1314
+ // ============================================================================
1315
+ /** The jobs the conflicts example edits, in a record of their own, so no other example's edits meet them. */
1316
+ export const sheetConflictJobs = e3.record("sheet_conflict_jobs", DictType(StringType, SheetJob), {
1317
+ initial: new Map([
1318
+ ["J-0001", { task: "Panel cutting", start: some(new Date("2026-10-12T00:00:00Z")), qty: some(48.0) }],
1319
+ ["J-0002", { task: "Edge banding", start: some(new Date("2026-10-13T00:00:00Z")), qty: some(120.0) }],
1320
+ ["J-0003", { task: "CNC routing", start: some(new Date("2026-10-14T00:00:00Z")), qty: some(48.0) }],
1321
+ ["J-0004", { task: "Spray finish", start: some(new Date("2026-10-15T00:00:00Z")), qty: some(36.0) }],
1322
+ ]),
1323
+ mutations: (mutation) => ({
1324
+ // The jobs' patch door — every Save commits through it.
1325
+ patch: mutation.patch(),
1326
+ // Someone else's save: every job's quantity 12 more and its start a day later, its task as it was.
1327
+ elsewhere: mutation.reduce(East.function([DictType(StringType, SheetJob)], DictType(StringType, SheetJob), (_$, jobs) => jobs.map((_$2, job) => ({
1328
+ task: job.task,
1329
+ start: job.start.match({
1330
+ some: (_$3, at) => East.value(some(at.addDays(1n)), OptionType(DateTimeType)),
1331
+ none: (_$3) => East.value(none, OptionType(DateTimeType)),
1332
+ }),
1333
+ qty: job.qty.match({
1334
+ some: (_$3, n) => East.value(some(n.add(12.0)), OptionType(FloatType)),
1335
+ none: (_$3) => East.value(none, OptionType(FloatType)),
1336
+ }),
1337
+ })))),
1338
+ }),
1339
+ });
1340
+ /**
1341
+ * Your edits meeting someone else's save, in one window: edit, then press
1342
+ * Someone else saves, which saves another person's change to the same jobs —
1343
+ * every Qty 12 more and every Start a day later. A Qty or a Start you changed
1344
+ * too is a conflict, waiting for you to choose; a Task you changed combines
1345
+ * with theirs. Each press saves their change again.
1346
+ */
1347
+ export const sheetConflicts = example({
1348
+ keywords: ["Sheet", "conflict", "conflicts", "combine", "someone else", "carry over", "Choose", "record", "Record.bind", "mutate", "Button", "patch"],
1349
+ description: "Your edits meeting someone else's save, in one window — edit a Qty or a Start, then press Someone else saves, which saves another person's change to the same jobs (every Qty 12 more, every Start a day later), so yours conflict and wait to be chosen; a Task you change combines with theirs",
1350
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
1351
+ const jobs = $.let(Record.bind(sheetConflictJobs, ["patch"]));
1352
+ const others = $.let(Record.bind(sheetConflictJobs, ["elsewhere"]));
1353
+ const theirs = $.const(East.function([], NullType, ($) => { $(others.mutate.elsewhere()); }));
1354
+ return (_jsxs(VStack, { gap: "3", align: "stretch", children: [_jsxs(HStack, { gap: "3", children: [_jsx(Button, { variant: "outline", onClick: theirs, loading: others.mutate.pending(), children: "Someone else saves" }), _jsx(Text, { color: "fg.muted", children: "Their change: every Qty 12 more, every Start a day later" })] }), _jsx(Box, { height: "560px", children: _jsx(Sheet, { name: "conflicts", record: jobs, columns: {
1355
+ task: Sheet.column.text(SheetJob, { header: "Task", width: "240px" }),
1356
+ start: Sheet.column.date(SheetJob, { header: "Start", width: "96px" }),
1357
+ qty: Sheet.column.quantity(SheetJob, { header: "Qty", width: "96px" }),
1358
+ } }) })] }));
1359
+ } }))),
1360
+ inputs: [],
1361
+ });
1255
1362
  //# sourceMappingURL=sheet.examples.js.map