@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
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.examples.d.ts","sourceRoot":"","sources":["../../../test/calendar/calendar.examples.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAQ,SAAS,EAAgB,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAW,UAAU,EAAE,UAAU,EAAE,WAAW,EAAuB,OAAO,EAAE,MAAM,eAAe,CAAC;AAKrM,uDAAuD;AACvD,eAAO,MAAM,eAAe;;;EAAqD,CAAC;AAClF,oEAAoE;AACpE,eAAO,MAAM,cAAc;;;EAAqD,CAAC;AACjF,yBAAyB;AACzB,eAAO,MAAM,gBAAgB;;;;EAAuE,CAAC;AACrG,gFAAgF;AAChF,eAAO,MAAM,WAAW;;;;;;;;;;;;;EAC8E,CAAC;AACvG,yDAAyD;AACzD,eAAO,MAAM,iBAAiB;;;;;;;;;;EAAqI,CAAC;AACpK,iFAAiF;AACjF,eAAO,MAAM,eAAe;;;;;;;EAA4I,CAAC;AACzK,8CAA8C;AAC9C,eAAO,MAAM,aAAa;;;;;;EAAmH,CAAC;AAC9I,yIAAyI;AACzI,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAAmG,CAAC;AACpI,mFAAmF;AACnF,eAAO,MAAM,uBAAuB;;;;;;;;;EAA8J,CAAC;AACnM,iEAAiE;AACjE,eAAO,MAAM,qBAAqB;;;;;;;;EAAuI,CAAC;AAE1K,eAAO,MAAM,gBAAgB;;;0EAG1B,CAAC;AACJ,eAAO,MAAM,cAAc;;;wEAExB,CAAC;AACJ,eAAO,MAAM,YAAY;;;;;;;;;;;;;sEAWtB,CAAC;AACJ,eAAO,MAAM,iBAAiB;;;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_jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
2
2
  /**
3
3
  * Copyright (c) 2025 Elara AI Pty Ltd
4
4
  * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
5
5
  */
6
6
  /** @jsxImportSource @elaraai/e3-ui */
7
7
  import { DateTimeType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, SetType, StringType, StructType, VariantType, example, none, some, variant } from "@elaraai/east";
8
- import { Box, Input, Reactive, Slice, UIComponentType } from "@elaraai/east-ui";
8
+ import { Box, Button, HStack, Input, Reactive, Slice, Text, UIComponentType, VStack } from "@elaraai/east-ui";
9
9
  import { Calendar, Data, Record } from "@elaraai/e3-ui";
10
10
  import e3 from "@elaraai/e3";
11
11
  /** The resources of a small metal fabrication shop. */
@@ -29,89 +29,144 @@ export const CalendarJobTemplate = StructType({ name: StringType, group: StringT
29
29
  export const CalendarServiceTemplate = StructType({ name: StringType, group: StringType, hours: FloatType, values: StructType({ title: StringType, technician: StringType, notes: StringType }) });
30
30
  /** Shift templates start at their hour when dropped on a day. */
31
31
  export const CalendarShiftTemplate = StructType({ name: StringType, group: StringType, hour: IntegerType, values: StructType({ title: StringType, notes: StringType }) });
32
- export const calendarMachines = e3.record("calendar_machines", DictType(StringType, CalendarMachine), new Map([
33
- ["press1", { name: "Press 1", area: "Press shop" }], ["press2", { name: "Press 2", area: "Press shop" }],
34
- ["lathe1", { name: "Lathe 1", area: "Machine shop" }], ["lathe2", { name: "Lathe 2", area: "Machine shop" }],
35
- ]));
36
- export const calendarPeople = e3.record("calendar_people", DictType(StringType, CalendarPerson), new Map([
37
- ["ash", { name: "A. Ash", team: "Maintenance" }], ["birch", { name: "B. Birch", team: "Production" }], ["cedar", { name: "C. Cedar", team: "Maintenance" }],
38
- ]));
39
- export const calendarJobs = e3.record("calendar_jobs", DictType(StringType, CalendarJob), new Map([
40
- ["job1", { title: "Mounting brackets · batch 42", start: some(new Date("2026-10-01T06:00:00Z")), end: some(new Date("2026-10-01T10:00:00Z")), machine: some("press1"), status: variant("active", null), hours: 4.0, customer: "Alder Works", due: some(new Date("2026-10-02T00:00:00Z")) }],
41
- ["job2", { title: "Pump housings", start: some(new Date("2026-10-01T08:00:00Z")), end: some(new Date("2026-10-01T13:00:00Z")), machine: some("lathe1"), status: variant("planned", null), hours: 5.0, customer: "Birch Engineering", due: none }],
42
- ["job3", { title: "Long title: stainless steel mounting plates for the prototype assembly", start: some(new Date("2026-10-01T11:00:00Z")), end: some(new Date("2026-10-01T11:30:00Z")), machine: some("press2"), status: variant("planned", null), hours: 0.5, customer: "Cedar Fabrication", due: none }],
43
- ["job4", { title: "Bearing collars", start: some(new Date("2026-10-02T09:00:00Z")), end: some(new Date("2026-10-02T12:00:00Z")), machine: some("lathe2"), status: variant("planned", null), hours: 3.0, customer: "Alder Works", due: none }],
44
- ["job5", { title: "Overnight batch", start: some(new Date("2026-10-01T22:00:00Z")), end: some(new Date("2026-10-02T02:00:00Z")), machine: some("press1"), status: variant("planned", null), hours: 4.0, customer: "Birch Engineering", due: none }],
45
- ["job6", { title: "September closeout", start: some(new Date("2026-09-30T08:00:00Z")), end: some(new Date("2026-09-30T10:00:00Z")), machine: some("press2"), status: variant("done", null), hours: 2.0, customer: "Alder Works", due: none }],
46
- ["backlog1", { title: "Torque-test fixtures", start: none, end: none, machine: some("press1"), status: variant("planned", null), hours: 2.0, customer: "Alder Works", due: some(new Date("2026-10-02T00:00:00Z")) }],
47
- ["backlog2", { title: "Valve bodies", start: none, end: none, machine: none, status: variant("planned", null), hours: 3.0, customer: "Cedar Fabrication", due: some(new Date("2026-10-06T00:00:00Z")) }],
48
- ["backlog3", { title: "Replacement shims", start: none, end: none, machine: none, status: variant("planned", null), hours: 1.0, customer: "Birch Engineering", due: some(new Date("2026-10-20T00:00:00Z")) }],
49
- ["backlog4", { title: "Prototype spacers", start: none, end: none, machine: none, status: variant("planned", null), hours: 2.5, customer: "Alder Works", due: none }],
50
- ]));
51
- export const calendarJobsPatch = e3.mutation.patch(calendarJobs);
52
- export const calendarServices = e3.record("calendar_services", DictType(StringType, CalendarService), new Map([
53
- ["service1", { title: "Preventive maintenance", start: new Date("2026-10-01T09:00:00Z"), end: new Date("2026-10-01T11:00:00Z"), machine: "press1", technician: "ash", notes: "Inspect the tooling and check torque." }],
54
- ["service2", { title: "Calibration", start: new Date("2026-10-02T13:00:00Z"), end: new Date("2026-10-02T14:00:00Z"), machine: "lathe1", technician: "cedar", notes: "Check against the reference gauge." }],
55
- ]));
56
- export const calendarServicesPatch = e3.mutation.patch(calendarServices);
57
- export const calendarShifts = e3.record("calendar_shifts", DictType(StringType, CalendarShift), new Map([
58
- ["shift1", { title: "Day shift", start: new Date("2026-10-01T06:00:00Z"), end: new Date("2026-10-01T14:00:00Z"), person: "ash", notes: "Press shop" }],
59
- ["shift2", { title: "Late shift", start: new Date("2026-10-01T14:00:00Z"), end: new Date("2026-10-01T22:00:00Z"), person: "birch", notes: "Machine shop" }],
60
- ]));
61
- export const calendarShiftsPatch = e3.mutation.patch(calendarShifts);
62
- export const calendarJobTemplates = e3.record("calendar_job_templates", DictType(StringType, CalendarJobTemplate), new Map([
63
- ["brackets", { name: "Bracket batch", group: "Fabrication", hours: 4.0, values: { title: "Bracket batch", status: variant("planned", null), hours: 4.0, customer: "", due: none } }],
64
- ["housings", { name: "Housing batch", group: "Machining", hours: 2.0, values: { title: "Housing batch", status: variant("planned", null), hours: 2.0, customer: "", due: none } }],
65
- ]));
66
- export const calendarServiceTemplates = e3.record("calendar_service_templates", DictType(StringType, CalendarServiceTemplate), new Map([
67
- ["calibration", { name: "Calibration", group: "Calibration", hours: 1.0, values: { title: "Calibration", technician: "cedar", notes: "Check against the reference gauge." } }],
68
- ["service", { name: "Preventive maintenance", group: "Preventive", hours: 2.0, values: { title: "Preventive maintenance", technician: "ash", notes: "" } }],
69
- ]));
70
- export const calendarShiftTemplates = e3.record("calendar_shift_templates", DictType(StringType, CalendarShiftTemplate), new Map([
71
- ["day", { name: "Day shift", group: "Day", hour: 6n, values: { title: "Day shift", notes: "" } }],
72
- ["late", { name: "Late shift", group: "Late", hour: 14n, values: { title: "Late shift", notes: "" } }],
73
- ]));
74
- // The shop edits its machines and job templates elsewhere, each through its patch door; the Calendar reads them live.
75
- export const calendarMachinesPatch = e3.mutation.patch(calendarMachines);
76
- export const calendarJobTemplatesPatch = e3.mutation.patch(calendarJobTemplates);
77
- // The rail narrows each record through its own indexes (#1343): each event kind over its interval index — on its own,
78
- // and after its status, its machine or its person — so a narrowing keeps every event overlapping the window once.
79
- export const calendarJobsByTime = e3.recordIndex.interval("calendar_jobs_by_time", calendarJobs, { from: "start", to: "end" });
80
- export const calendarJobsByStatusTime = e3.recordIndex.interval("calendar_jobs_by_status_time", calendarJobs, { on: ["status"], from: "start", to: "end" });
81
- export const calendarJobsByMachineTime = e3.recordIndex.interval("calendar_jobs_by_machine_time", calendarJobs, { on: ["machine"], from: "start", to: "end" });
82
- export const calendarServicesByTime = e3.recordIndex.interval("calendar_services_by_time", calendarServices, { from: "start", to: "end" });
83
- export const calendarServicesByMachineTime = e3.recordIndex.interval("calendar_services_by_machine_time", calendarServices, { on: ["machine"], from: "start", to: "end" });
84
- export const calendarShiftsByTime = e3.recordIndex.interval("calendar_shifts_by_time", calendarShifts, { from: "start", to: "end" });
85
- export const calendarShiftsByPersonTime = e3.recordIndex.interval("calendar_shifts_by_person_time", calendarShifts, { on: ["person"], from: "start", to: "end" });
86
- export const calendarMachinesByArea = e3.recordIndex("calendar_machines_by_area", calendarMachines, { on: ["area"] });
87
- export const calendarPeopleByTeam = e3.recordIndex("calendar_people_by_team", calendarPeople, { on: ["team"] });
88
- export const calendarJobTemplatesByGroup = e3.recordIndex("calendar_job_templates_by_group", calendarJobTemplates, { on: ["group"] });
89
- export const calendarServiceTemplatesByGroup = e3.recordIndex("calendar_service_templates_by_group", calendarServiceTemplates, { on: ["group"] });
90
- export const calendarShiftTemplatesByGroup = e3.recordIndex("calendar_shift_templates_by_group", calendarShiftTemplates, { on: ["group"] });
32
+ export const calendarMachines = e3.record("calendar_machines", DictType(StringType, CalendarMachine), {
33
+ initial: new Map([
34
+ ["press1", { name: "Press 1", area: "Press shop" }], ["press2", { name: "Press 2", area: "Press shop" }],
35
+ ["lathe1", { name: "Lathe 1", area: "Machine shop" }], ["lathe2", { name: "Lathe 2", area: "Machine shop" }],
36
+ ]),
37
+ indexes: (index) => ({
38
+ calendar_machines_by_area: index.on(["area"]),
39
+ }),
40
+ mutations: (mutation) => ({
41
+ // The shop edits its machines and job templates elsewhere, each through its patch door; the Calendar reads them live.
42
+ patch: mutation.patch(),
43
+ }),
44
+ });
45
+ export const calendarPeople = e3.record("calendar_people", DictType(StringType, CalendarPerson), {
46
+ initial: new Map([
47
+ ["ash", { name: "A. Ash", team: "Maintenance" }], ["birch", { name: "B. Birch", team: "Production" }], ["cedar", { name: "C. Cedar", team: "Maintenance" }],
48
+ ]),
49
+ indexes: (index) => ({
50
+ calendar_people_by_team: index.on(["team"]),
51
+ }),
52
+ });
53
+ export const calendarJobs = e3.record("calendar_jobs", DictType(StringType, CalendarJob), {
54
+ initial: new Map([
55
+ ["job1", { title: "Mounting brackets · batch 42", start: some(new Date("2026-10-01T06:00:00Z")), end: some(new Date("2026-10-01T10:00:00Z")), machine: some("press1"), status: variant("active", null), hours: 4.0, customer: "Alder Works", due: some(new Date("2026-10-02T00:00:00Z")) }],
56
+ ["job2", { title: "Pump housings", start: some(new Date("2026-10-01T08:00:00Z")), end: some(new Date("2026-10-01T13:00:00Z")), machine: some("lathe1"), status: variant("planned", null), hours: 5.0, customer: "Birch Engineering", due: none }],
57
+ ["job3", { title: "Long title: stainless steel mounting plates for the prototype assembly", start: some(new Date("2026-10-01T11:00:00Z")), end: some(new Date("2026-10-01T11:30:00Z")), machine: some("press2"), status: variant("planned", null), hours: 0.5, customer: "Cedar Fabrication", due: none }],
58
+ ["job4", { title: "Bearing collars", start: some(new Date("2026-10-02T09:00:00Z")), end: some(new Date("2026-10-02T12:00:00Z")), machine: some("lathe2"), status: variant("planned", null), hours: 3.0, customer: "Alder Works", due: none }],
59
+ ["job5", { title: "Overnight batch", start: some(new Date("2026-10-01T22:00:00Z")), end: some(new Date("2026-10-02T02:00:00Z")), machine: some("press1"), status: variant("planned", null), hours: 4.0, customer: "Birch Engineering", due: none }],
60
+ ["job6", { title: "September closeout", start: some(new Date("2026-09-30T08:00:00Z")), end: some(new Date("2026-09-30T10:00:00Z")), machine: some("press2"), status: variant("done", null), hours: 2.0, customer: "Alder Works", due: none }],
61
+ ["backlog1", { title: "Torque-test fixtures", start: none, end: none, machine: some("press1"), status: variant("planned", null), hours: 2.0, customer: "Alder Works", due: some(new Date("2026-10-02T00:00:00Z")) }],
62
+ ["backlog2", { title: "Valve bodies", start: none, end: none, machine: none, status: variant("planned", null), hours: 3.0, customer: "Cedar Fabrication", due: some(new Date("2026-10-06T00:00:00Z")) }],
63
+ ["backlog3", { title: "Replacement shims", start: none, end: none, machine: none, status: variant("planned", null), hours: 1.0, customer: "Birch Engineering", due: some(new Date("2026-10-20T00:00:00Z")) }],
64
+ ["backlog4", { title: "Prototype spacers", start: none, end: none, machine: none, status: variant("planned", null), hours: 2.5, customer: "Alder Works", due: none }],
65
+ ]),
66
+ indexes: (index) => ({
67
+ // The rail narrows each record through its own indexes (#1343): each event kind over its interval index — on its own,
68
+ // and after its status, its machine or its person — so a narrowing keeps every event overlapping the window once.
69
+ calendar_jobs_by_time: index.interval({ from: "start", to: "end" }),
70
+ calendar_jobs_by_status_time: index.interval({ on: ["status"], from: "start", to: "end" }),
71
+ calendar_jobs_by_machine_time: index.interval({ on: ["machine"], from: "start", to: "end" }),
72
+ // Each job is indexed under every UTC day it touches, leaving an exact midnight end out.
73
+ calendar_jobs_by_day: index.keys(East.function([StringType, CalendarJob], SetType(DateTimeType), ($, _key, row) => {
74
+ const days = $.const(Calendar.days);
75
+ return row.start.match({
76
+ some: (_$, start) => row.end.match({ some: (_$, end) => days(start, end), none: () => East.value(new Set(), SetType(DateTimeType)) }),
77
+ none: () => East.value(new Set(), SetType(DateTimeType)),
78
+ });
79
+ })),
80
+ // The unscheduled rows are indexed by due date; they remain in the jobs record.
81
+ calendar_jobs_unscheduled: index.keys(East.function([StringType, CalendarJob], SetType(OptionType(DateTimeType)), ($, _key, row) => {
82
+ const unscheduled = $.const(Calendar.unscheduled);
83
+ return unscheduled(row.start, row.due);
84
+ })),
85
+ }),
86
+ mutations: (mutation) => ({
87
+ patch: mutation.patch(),
88
+ }),
89
+ });
90
+ export const calendarServices = e3.record("calendar_services", DictType(StringType, CalendarService), {
91
+ initial: new Map([
92
+ ["service1", { title: "Preventive maintenance", start: new Date("2026-10-01T09:00:00Z"), end: new Date("2026-10-01T11:00:00Z"), machine: "press1", technician: "ash", notes: "Inspect the tooling and check torque." }],
93
+ ["service2", { title: "Calibration", start: new Date("2026-10-02T13:00:00Z"), end: new Date("2026-10-02T14:00:00Z"), machine: "lathe1", technician: "cedar", notes: "Check against the reference gauge." }],
94
+ ]),
95
+ indexes: (index) => ({
96
+ calendar_services_by_time: index.interval({ from: "start", to: "end" }),
97
+ calendar_services_by_machine_time: index.interval({ on: ["machine"], from: "start", to: "end" }),
98
+ }),
99
+ mutations: (mutation) => ({
100
+ patch: mutation.patch(),
101
+ }),
102
+ });
103
+ export const calendarShifts = e3.record("calendar_shifts", DictType(StringType, CalendarShift), {
104
+ initial: new Map([
105
+ ["shift1", { title: "Day shift", start: new Date("2026-10-01T06:00:00Z"), end: new Date("2026-10-01T14:00:00Z"), person: "ash", notes: "Press shop" }],
106
+ ["shift2", { title: "Late shift", start: new Date("2026-10-01T14:00:00Z"), end: new Date("2026-10-01T22:00:00Z"), person: "birch", notes: "Machine shop" }],
107
+ ]),
108
+ indexes: (index) => ({
109
+ calendar_shifts_by_time: index.interval({ from: "start", to: "end" }),
110
+ calendar_shifts_by_person_time: index.interval({ on: ["person"], from: "start", to: "end" }),
111
+ }),
112
+ mutations: (mutation) => ({
113
+ patch: mutation.patch(),
114
+ }),
115
+ });
116
+ export const calendarJobTemplates = e3.record("calendar_job_templates", DictType(StringType, CalendarJobTemplate), {
117
+ initial: new Map([
118
+ ["brackets", { name: "Bracket batch", group: "Fabrication", hours: 4.0, values: { title: "Bracket batch", status: variant("planned", null), hours: 4.0, customer: "", due: none } }],
119
+ ["housings", { name: "Housing batch", group: "Machining", hours: 2.0, values: { title: "Housing batch", status: variant("planned", null), hours: 2.0, customer: "", due: none } }],
120
+ ]),
121
+ indexes: (index) => ({
122
+ calendar_job_templates_by_group: index.on(["group"]),
123
+ }),
124
+ mutations: (mutation) => ({
125
+ patch: mutation.patch(),
126
+ }),
127
+ });
128
+ export const calendarServiceTemplates = e3.record("calendar_service_templates", DictType(StringType, CalendarServiceTemplate), {
129
+ initial: new Map([
130
+ ["calibration", { name: "Calibration", group: "Calibration", hours: 1.0, values: { title: "Calibration", technician: "cedar", notes: "Check against the reference gauge." } }],
131
+ ["service", { name: "Preventive maintenance", group: "Preventive", hours: 2.0, values: { title: "Preventive maintenance", technician: "ash", notes: "" } }],
132
+ ]),
133
+ indexes: (index) => ({
134
+ calendar_service_templates_by_group: index.on(["group"]),
135
+ }),
136
+ });
137
+ export const calendarShiftTemplates = e3.record("calendar_shift_templates", DictType(StringType, CalendarShiftTemplate), {
138
+ initial: new Map([
139
+ ["day", { name: "Day shift", group: "Day", hour: 6n, values: { title: "Day shift", notes: "" } }],
140
+ ["late", { name: "Late shift", group: "Late", hour: 14n, values: { title: "Late shift", notes: "" } }],
141
+ ]),
142
+ indexes: (index) => ({
143
+ calendar_shift_templates_by_group: index.on(["group"]),
144
+ }),
145
+ });
91
146
  export const calendarOperations = example({
92
147
  inputs: [],
93
148
  description: "A metal fabrication calendar over three event records and bound machines, people and templates: Calendar, Resources and Timeline share one frame, one Slice.bindRecords rail — a source per event kind, resource kind and template record — and Save history. Its library schedules the event record's backlog and assigns technicians; overlapping production and maintenance warn without blocking Save.",
94
- keywords: ["Calendar", "Record.bind", "Data.bind", "Calendar.templates", "Schedule", "Slice", "Slice.bindRecords", "Data.bindPaged", "recordIndex", "interval", "BuilderFrame", "library", "backlog", "inspector", "overlaps", "Save"],
149
+ keywords: ["Calendar", "Record.bind", "Data.bind", "Calendar.templates", "Schedule", "Slice", "Slice.bindRecords", "Data.bindPaged", "indexes", "interval", "BuilderFrame", "library", "backlog", "inspector", "overlaps", "Save"],
95
150
  fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
96
151
  // What the Calendar reads whole binds with Data.bind, which keeps it loaded beside its pages; the event records
97
152
  // it writes bind with Record.bind, and it reads their events through their pages alone.
98
153
  const machines = $.let(Data.bind(calendarMachines));
99
154
  const people = $.let(Data.bind(calendarPeople));
100
- const jobs = $.let(Record.bind(calendarJobs, [calendarJobsPatch]));
101
- const services = $.let(Record.bind(calendarServices, [calendarServicesPatch]));
102
- const shifts = $.let(Record.bind(calendarShifts, [calendarShiftsPatch]));
155
+ const jobs = $.let(Record.bind(calendarJobs));
156
+ const services = $.let(Record.bind(calendarServices));
157
+ const shifts = $.let(Record.bind(calendarShifts));
103
158
  const jobTemplates = $.let(Data.bind(calendarJobTemplates));
104
159
  const serviceTemplates = $.let(Data.bind(calendarServiceTemplates));
105
160
  const shiftTemplates = $.let(Data.bind(calendarShiftTemplates));
106
161
  // Every record paged: each event kind's interval indexes and its own entries, the others' fields' indexes.
107
- const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: [calendarJobsByTime, calendarJobsByStatusTime, calendarJobsByMachineTime] }));
108
- const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: [calendarServicesByTime, calendarServicesByMachineTime] }));
109
- const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: [calendarShiftsByTime, calendarShiftsByPersonTime] }));
110
- const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: [calendarMachinesByArea] }));
111
- const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: [calendarPeopleByTeam] }));
112
- const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: [calendarJobTemplatesByGroup] }));
113
- const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: [calendarServiceTemplatesByGroup] }));
114
- const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: [calendarShiftTemplatesByGroup] }));
162
+ const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: ["calendar_jobs_by_time", "calendar_jobs_by_status_time", "calendar_jobs_by_machine_time"] }));
163
+ const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: ["calendar_services_by_time", "calendar_services_by_machine_time"] }));
164
+ const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: ["calendar_shifts_by_time", "calendar_shifts_by_person_time"] }));
165
+ const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: ["calendar_machines_by_area"] }));
166
+ const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: ["calendar_people_by_team"] }));
167
+ const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: ["calendar_job_templates_by_group"] }));
168
+ const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: ["calendar_service_templates_by_group"] }));
169
+ const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: ["calendar_shift_templates_by_group"] }));
115
170
  const jobEntries = $.let(Data.bindPaged(calendarJobs));
116
171
  const serviceEntries = $.let(Data.bindPaged(calendarServices));
117
172
  const shiftEntries = $.let(Data.bindPaged(calendarShifts));
@@ -170,21 +225,21 @@ export const calendarMobile = example({
170
225
  // it writes bind with Record.bind, and it reads their events through their pages alone.
171
226
  const machines = $.let(Data.bind(calendarMachines));
172
227
  const people = $.let(Data.bind(calendarPeople));
173
- const jobs = $.let(Record.bind(calendarJobs, [calendarJobsPatch]));
174
- const services = $.let(Record.bind(calendarServices, [calendarServicesPatch]));
175
- const shifts = $.let(Record.bind(calendarShifts, [calendarShiftsPatch]));
228
+ const jobs = $.let(Record.bind(calendarJobs));
229
+ const services = $.let(Record.bind(calendarServices));
230
+ const shifts = $.let(Record.bind(calendarShifts));
176
231
  const jobTemplates = $.let(Data.bind(calendarJobTemplates));
177
232
  const serviceTemplates = $.let(Data.bind(calendarServiceTemplates));
178
233
  const shiftTemplates = $.let(Data.bind(calendarShiftTemplates));
179
234
  // Every record paged: each event kind's interval indexes and its own entries, the others' fields' indexes.
180
- const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: [calendarJobsByTime, calendarJobsByStatusTime, calendarJobsByMachineTime] }));
181
- const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: [calendarServicesByTime, calendarServicesByMachineTime] }));
182
- const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: [calendarShiftsByTime, calendarShiftsByPersonTime] }));
183
- const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: [calendarMachinesByArea] }));
184
- const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: [calendarPeopleByTeam] }));
185
- const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: [calendarJobTemplatesByGroup] }));
186
- const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: [calendarServiceTemplatesByGroup] }));
187
- const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: [calendarShiftTemplatesByGroup] }));
235
+ const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: ["calendar_jobs_by_time", "calendar_jobs_by_status_time", "calendar_jobs_by_machine_time"] }));
236
+ const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: ["calendar_services_by_time", "calendar_services_by_machine_time"] }));
237
+ const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: ["calendar_shifts_by_time", "calendar_shifts_by_person_time"] }));
238
+ const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: ["calendar_machines_by_area"] }));
239
+ const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: ["calendar_people_by_team"] }));
240
+ const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: ["calendar_job_templates_by_group"] }));
241
+ const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: ["calendar_service_templates_by_group"] }));
242
+ const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: ["calendar_shift_templates_by_group"] }));
188
243
  const jobEntries = $.let(Data.bindPaged(calendarJobs));
189
244
  const serviceEntries = $.let(Data.bindPaged(calendarServices));
190
245
  const shiftEntries = $.let(Data.bindPaged(calendarShifts));
@@ -243,21 +298,21 @@ export const calendarReadOnly = example({
243
298
  // it writes bind with Record.bind, and it reads their events through their pages alone.
244
299
  const machines = $.let(Data.bind(calendarMachines));
245
300
  const people = $.let(Data.bind(calendarPeople));
246
- const jobs = $.let(Record.bind(calendarJobs, [calendarJobsPatch]));
247
- const services = $.let(Record.bind(calendarServices, [calendarServicesPatch]));
248
- const shifts = $.let(Record.bind(calendarShifts, [calendarShiftsPatch]));
301
+ const jobs = $.let(Record.bind(calendarJobs));
302
+ const services = $.let(Record.bind(calendarServices));
303
+ const shifts = $.let(Record.bind(calendarShifts));
249
304
  const jobTemplates = $.let(Data.bind(calendarJobTemplates));
250
305
  const serviceTemplates = $.let(Data.bind(calendarServiceTemplates));
251
306
  const shiftTemplates = $.let(Data.bind(calendarShiftTemplates));
252
307
  // Every record paged: each event kind's interval indexes and its own entries, the others' fields' indexes.
253
- const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: [calendarJobsByTime, calendarJobsByStatusTime, calendarJobsByMachineTime] }));
254
- const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: [calendarServicesByTime, calendarServicesByMachineTime] }));
255
- const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: [calendarShiftsByTime, calendarShiftsByPersonTime] }));
256
- const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: [calendarMachinesByArea] }));
257
- const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: [calendarPeopleByTeam] }));
258
- const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: [calendarJobTemplatesByGroup] }));
259
- const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: [calendarServiceTemplatesByGroup] }));
260
- const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: [calendarShiftTemplatesByGroup] }));
308
+ const jobIndex = $.let(Data.bindPaged(calendarJobs, { indexes: ["calendar_jobs_by_time", "calendar_jobs_by_status_time", "calendar_jobs_by_machine_time"] }));
309
+ const serviceIndex = $.let(Data.bindPaged(calendarServices, { indexes: ["calendar_services_by_time", "calendar_services_by_machine_time"] }));
310
+ const shiftIndex = $.let(Data.bindPaged(calendarShifts, { indexes: ["calendar_shifts_by_time", "calendar_shifts_by_person_time"] }));
311
+ const machineIndex = $.let(Data.bindPaged(calendarMachines, { indexes: ["calendar_machines_by_area"] }));
312
+ const peopleIndex = $.let(Data.bindPaged(calendarPeople, { indexes: ["calendar_people_by_team"] }));
313
+ const jobTemplateIndex = $.let(Data.bindPaged(calendarJobTemplates, { indexes: ["calendar_job_templates_by_group"] }));
314
+ const serviceTemplateIndex = $.let(Data.bindPaged(calendarServiceTemplates, { indexes: ["calendar_service_templates_by_group"] }));
315
+ const shiftTemplateIndex = $.let(Data.bindPaged(calendarShiftTemplates, { indexes: ["calendar_shift_templates_by_group"] }));
261
316
  const jobEntries = $.let(Data.bindPaged(calendarJobs));
262
317
  const serviceEntries = $.let(Data.bindPaged(calendarServices));
263
318
  const shiftEntries = $.let(Data.bindPaged(calendarShifts));
@@ -313,36 +368,19 @@ export const calendarMinimal = example({
313
368
  keywords: ["Calendar", "minimal", "Record.bind", "day", "mobile", "optional panes"],
314
369
  fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
315
370
  const machines = $.let(Record.bind(calendarMachines, []));
316
- const jobs = $.let(Record.bind(calendarJobs, [calendarJobsPatch]));
371
+ const jobs = $.let(Record.bind(calendarJobs));
317
372
  return _jsx(Box, { height: "680px", children: _jsx(Calendar, { id: "minimal", view: { period: "day", date: new Date("2026-10-01T00:00:00Z") }, now: new Date("2026-10-01T10:15:00Z"), resources: { machines: Calendar.resources(machines.read(), { name: "Machines", icon: "gears", label: row => row.name }) }, events: { job: Calendar.events(jobs, { name: "Production", icon: "industry", title: "title", start: "start", end: "end", resource: { field: "machine", of: "machines" }, backlog: { duration: row => variant("hours", row.hours), due: row => row.due } }) } }) });
318
373
  } })),
319
374
  });
320
- /** Each job is indexed under every UTC day it touches, leaving an exact midnight end out. */
321
- export const calendarJobsByDay = e3.recordIndex("calendar_jobs_by_day", calendarJobs, {
322
- keys: East.function([StringType, CalendarJob], SetType(DateTimeType), ($, _key, row) => {
323
- const days = $.const(Calendar.days);
324
- return row.start.match({
325
- some: (_$, start) => row.end.match({ some: (_$, end) => days(start, end), none: () => East.value(new Set(), SetType(DateTimeType)) }),
326
- none: () => East.value(new Set(), SetType(DateTimeType)),
327
- });
328
- }),
329
- });
330
- /** The unscheduled rows are indexed by due date; they remain in the jobs record. */
331
- export const calendarJobsUnscheduled = e3.recordIndex("calendar_jobs_unscheduled", calendarJobs, {
332
- keys: East.function([StringType, CalendarJob], SetType(OptionType(DateTimeType)), ($, _key, row) => {
333
- const unscheduled = $.const(Calendar.unscheduled);
334
- return unscheduled(row.start, row.due);
335
- }),
336
- });
337
375
  export const calendarWindowed = example({
338
376
  inputs: [],
339
377
  description: "The jobs calendar read by its day and backlog indexes, with by-key reads for the inspector and checked saves. The calendar's own navigation picks the days read. Counts describe the loaded window. The same mobile agenda and explicit actions work over the paged record.",
340
- keywords: ["Calendar", "Data.bindPaged", "recordIndex", "window", "backlogWindow", "entries", "day keys", "mobile", "Save"],
378
+ keywords: ["Calendar", "Data.bindPaged", "indexes", "window", "backlogWindow", "entries", "day keys", "mobile", "Save"],
341
379
  fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
342
380
  const machines = $.let(Record.bind(calendarMachines, []));
343
- const jobs = $.let(Record.bind(calendarJobs, [calendarJobsPatch]));
344
- const days = $.let(Data.bindPaged(calendarJobs, { index: calendarJobsByDay, join: true }));
345
- const backlog = $.let(Data.bindPaged(calendarJobs, { index: calendarJobsUnscheduled, join: true }));
381
+ const jobs = $.let(Record.bind(calendarJobs));
382
+ const days = $.let(Data.bindPaged(calendarJobs, { index: "calendar_jobs_by_day", join: true }));
383
+ const backlog = $.let(Data.bindPaged(calendarJobs, { index: "calendar_jobs_unscheduled", join: true }));
346
384
  const entries = $.let(Data.bindPaged(calendarJobs));
347
385
  // The days in view are the calendar's own navigation's: it reads them through the day index, never the record whole.
348
386
  return _jsx(Box, { height: "760px", children: _jsx(Calendar, { id: "windowed", inspector: true, view: { period: "day", date: new Date("2026-10-01T00:00:00Z") }, now: new Date("2026-10-01T10:15:00Z"), resources: { machines: Calendar.resources(machines.read(), { name: "Machines", icon: "gears", label: row => row.name }) }, events: { job: Calendar.events(jobs, { name: "Production", icon: "industry", title: "title", start: "start", end: "end", resource: { field: "machine", of: "machines" },
@@ -352,17 +390,21 @@ export const calendarWindowed = example({
352
390
  });
353
391
  /** The smallest event record needs only its title and two instants. */
354
392
  export const CalendarAppointment = StructType({ title: StringType, start: DateTimeType, end: DateTimeType });
355
- export const calendarAppointments = e3.record("calendar_appointments", DictType(StringType, CalendarAppointment), new Map([
356
- ["check", { title: "Safety check", start: new Date("2026-10-01T09:00:00Z"), end: new Date("2026-10-01T10:00:00Z") }],
357
- ["review", { title: "Production review", start: new Date("2026-10-01T11:00:00Z"), end: new Date("2026-10-01T12:00:00Z") }],
358
- ]));
359
- export const calendarAppointmentsPatch = e3.mutation.patch(calendarAppointments);
393
+ export const calendarAppointments = e3.record("calendar_appointments", DictType(StringType, CalendarAppointment), {
394
+ initial: new Map([
395
+ ["check", { title: "Safety check", start: new Date("2026-10-01T09:00:00Z"), end: new Date("2026-10-01T10:00:00Z") }],
396
+ ["review", { title: "Production review", start: new Date("2026-10-01T11:00:00Z"), end: new Date("2026-10-01T12:00:00Z") }],
397
+ ]),
398
+ mutations: (mutation) => ({
399
+ patch: mutation.patch(),
400
+ }),
401
+ });
360
402
  export const calendarQuickstart = example({
361
403
  inputs: [],
362
404
  description: "The smallest Calendar: a bound appointment record and its patch mutation. Calendar owns its frame, toolbar and editing session; the app names the fields that scheduling writes.",
363
405
  keywords: ["Calendar", "quickstart", "Record.bind", "events", "Save"],
364
406
  fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
365
- const appointments = $.let(Record.bind(calendarAppointments, [calendarAppointmentsPatch]));
407
+ const appointments = $.let(Record.bind(calendarAppointments));
366
408
  return _jsx(Box, { height: "640px", children: _jsx(Calendar, { inspector: true, view: { period: "day", date: new Date("2026-10-01T00:00:00Z") }, events: { appointment: Calendar.events(appointments, { name: "Appointment", icon: "calendar", title: "title", start: "start", end: "end" }) } }) });
367
409
  } })),
368
410
  });
@@ -372,7 +414,7 @@ export const calendarCustomInspector = example({
372
414
  description: "A typed custom appointment inspector updates the whole row through Calendar's shared Undo, Redo and Save session.",
373
415
  keywords: ["Calendar", "inspector", "custom", "Schedule.events", "update", "Record.bind"],
374
416
  fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
375
- const appointments = $.let(Record.bind(calendarAppointments, [calendarAppointmentsPatch]));
417
+ const appointments = $.let(Record.bind(calendarAppointments));
376
418
  const inspect = $.const(East.function([CalendarAppointment, FunctionType([CalendarAppointment], NullType)], UIComponentType, ($2, row, update) => {
377
419
  const change = $2.const(East.function([StringType], NullType, ($3, title) => { $3(update({ title, start: row.start, end: row.end })); }));
378
420
  return _jsx(Input.String, { value: row.title, placeholder: "Appointment title", onChange: change });
@@ -380,4 +422,49 @@ export const calendarCustomInspector = example({
380
422
  return _jsx(Box, { height: "640px", children: _jsx(Calendar, { inspector: true, view: { period: "day", date: new Date("2026-10-01T00:00:00Z") }, events: { appointment: Calendar.events(appointments, { name: "Appointment", icon: "calendar", title: "title", start: "start", end: "end", inspector: inspect }) } }) });
381
423
  } })),
382
424
  });
425
+ /** The jobs the conflicts example edits, in a record of their own, so no other example's edits meet them. */
426
+ export const calendarConflictJobs = e3.record("calendar_conflict_jobs", DictType(StringType, CalendarJob), {
427
+ initial: new Map([
428
+ ["job1", { title: "Mounting brackets", start: some(new Date("2026-10-01T06:00:00Z")), end: some(new Date("2026-10-01T10:00:00Z")), machine: some("press1"), status: variant("active", null), hours: 4.0, customer: "Alder Works", due: none }],
429
+ ["job2", { title: "Pump housings", start: some(new Date("2026-10-01T08:00:00Z")), end: some(new Date("2026-10-01T13:00:00Z")), machine: some("lathe1"), status: variant("planned", null), hours: 5.0, customer: "Birch Engineering", due: none }],
430
+ ["job3", { title: "Mounting plates", start: some(new Date("2026-10-01T11:00:00Z")), end: some(new Date("2026-10-01T12:30:00Z")), machine: some("press2"), status: variant("planned", null), hours: 1.5, customer: "Cedar Fabrication", due: none }],
431
+ ["job4", { title: "Bearing collars", start: some(new Date("2026-10-01T09:00:00Z")), end: some(new Date("2026-10-01T12:00:00Z")), machine: some("lathe2"), status: variant("planned", null), hours: 3.0, customer: "Alder Works", due: none }],
432
+ ]),
433
+ mutations: (mutation) => ({
434
+ // The jobs' patch door — every Save commits through it.
435
+ patch: mutation.patch(),
436
+ // Someone else's save: every job an hour later, its length and its other fields as they were.
437
+ elsewhere: mutation.reduce(East.function([DictType(StringType, CalendarJob)], DictType(StringType, CalendarJob), (_$, jobs) => jobs.map((_$2, job) => ({
438
+ title: job.title,
439
+ start: job.start.match({
440
+ some: (_$3, at) => East.value(some(at.addHours(1n)), OptionType(DateTimeType)),
441
+ none: (_$3) => East.value(none, OptionType(DateTimeType)),
442
+ }),
443
+ end: job.end.match({
444
+ some: (_$3, at) => East.value(some(at.addHours(1n)), OptionType(DateTimeType)),
445
+ none: (_$3) => East.value(none, OptionType(DateTimeType)),
446
+ }),
447
+ machine: job.machine, status: job.status, hours: job.hours, customer: job.customer, due: job.due,
448
+ })))),
449
+ }),
450
+ });
451
+ /**
452
+ * Your edits meeting someone else's save, in one window: edit, then press
453
+ * Someone else saves, which saves another person's change to the same jobs —
454
+ * every job an hour later. A job you moved or resized too is a conflict, its
455
+ * dates one card to choose; a customer or hours you changed in the panel
456
+ * combines with theirs. Each press saves their change again.
457
+ */
458
+ export const calendarConflicts = example({
459
+ inputs: [],
460
+ description: "Your edits meeting someone else's save, in one window — move or resize a job, then press Someone else saves, which saves another person's change to the same jobs (every job an hour later), so yours conflict, its dates one card to choose; a customer or hours you change in the panel combines with theirs",
461
+ keywords: ["Calendar", "conflict", "conflicts", "combine", "someone else", "Choose", "dates", "Record.bind", "mutate", "Button", "inspector", "Save"],
462
+ fn: East.function([], UIComponentType, _$ => _jsx(Reactive, { children: $ => {
463
+ const machines = $.let(Record.bind(calendarMachines, []));
464
+ const jobs = $.let(Record.bind(calendarConflictJobs, ["patch"]));
465
+ const others = $.let(Record.bind(calendarConflictJobs, ["elsewhere"]));
466
+ const theirs = $.const(East.function([], NullType, ($) => { $(others.mutate.elsewhere()); }));
467
+ 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 job an hour later" })] }), _jsx(Box, { height: "680px", children: _jsx(Calendar, { id: "conflicts", inspector: true, view: { period: "week", date: new Date("2026-10-01T00:00:00Z") }, now: new Date("2026-10-01T10:15:00Z"), resources: { machines: Calendar.resources(machines.read(), { name: "Machines", icon: "gears", label: row => row.name }) }, events: { job: Calendar.events(jobs, { name: "Production", icon: "industry", title: "title", start: "start", end: "end", resource: { field: "machine", of: "machines" } }) } }) })] });
468
+ } })),
469
+ });
383
470
  //# sourceMappingURL=calendar.examples.js.map