@elaraai/e3-ui 1.0.97 → 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 (491) 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 +232 -25
  5. package/dist/src/allocation/index.d.ts.map +1 -1
  6. package/dist/src/allocation/index.js +35 -6
  7. package/dist/src/allocation/index.js.map +1 -1
  8. package/dist/src/allocation/types.d.ts +41 -0
  9. package/dist/src/allocation/types.d.ts.map +1 -1
  10. package/dist/src/allocation/types.js +35 -0
  11. package/dist/src/allocation/types.js.map +1 -1
  12. package/dist/src/bind/data-indexed.d.ts +286 -37
  13. package/dist/src/bind/data-indexed.d.ts.map +1 -1
  14. package/dist/src/bind/data-indexed.js +259 -38
  15. package/dist/src/bind/data-indexed.js.map +1 -1
  16. package/dist/src/bind/data.d.ts +48 -9
  17. package/dist/src/bind/data.d.ts.map +1 -1
  18. package/dist/src/bind/data.js +48 -3
  19. package/dist/src/bind/data.js.map +1 -1
  20. package/dist/src/bind/record.d.ts +61 -24
  21. package/dist/src/bind/record.d.ts.map +1 -1
  22. package/dist/src/bind/record.js +17 -57
  23. package/dist/src/bind/record.js.map +1 -1
  24. package/dist/src/calendar/index.d.ts +522 -36
  25. package/dist/src/calendar/index.d.ts.map +1 -1
  26. package/dist/src/calendar/index.js +53 -13
  27. package/dist/src/calendar/index.js.map +1 -1
  28. package/dist/src/calendar/paged.d.ts +89 -0
  29. package/dist/src/calendar/paged.d.ts.map +1 -0
  30. package/dist/src/calendar/paged.js +148 -0
  31. package/dist/src/calendar/paged.js.map +1 -0
  32. package/dist/src/flowchart/index.d.ts +35 -31
  33. package/dist/src/flowchart/index.d.ts.map +1 -1
  34. package/dist/src/flowchart/index.js +35 -31
  35. package/dist/src/flowchart/index.js.map +1 -1
  36. package/dist/src/flowchart/library.d.ts +108 -84
  37. package/dist/src/flowchart/library.d.ts.map +1 -1
  38. package/dist/src/flowchart/library.js +108 -84
  39. package/dist/src/flowchart/library.js.map +1 -1
  40. package/dist/src/flowchart/payload.d.ts +105 -17
  41. package/dist/src/flowchart/payload.d.ts.map +1 -1
  42. package/dist/src/flowchart/payload.js +3 -3
  43. package/dist/src/flowchart/payload.js.map +1 -1
  44. package/dist/src/flowchart/values.d.ts +35 -31
  45. package/dist/src/flowchart/values.d.ts.map +1 -1
  46. package/dist/src/flowchart/values.js +35 -31
  47. package/dist/src/flowchart/values.js.map +1 -1
  48. package/dist/src/flowchart/window.d.ts.map +1 -1
  49. package/dist/src/flowchart/window.js +3 -2
  50. package/dist/src/flowchart/window.js.map +1 -1
  51. package/dist/src/index.d.ts +13 -4
  52. package/dist/src/index.d.ts.map +1 -1
  53. package/dist/src/index.js +20 -1
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/internal.d.ts +18 -8
  56. package/dist/src/internal.d.ts.map +1 -1
  57. package/dist/src/internal.js +40 -10
  58. package/dist/src/internal.js.map +1 -1
  59. package/dist/src/plan/assemble.d.ts +8 -0
  60. package/dist/src/plan/assemble.d.ts.map +1 -1
  61. package/dist/src/plan/assemble.js +1 -1
  62. package/dist/src/plan/assemble.js.map +1 -1
  63. package/dist/src/plan/builders.d.ts +1530 -10
  64. package/dist/src/plan/builders.d.ts.map +1 -1
  65. package/dist/src/plan/builders.js +260 -122
  66. package/dist/src/plan/builders.js.map +1 -1
  67. package/dist/src/plan/event-rows.d.ts +224 -157
  68. package/dist/src/plan/event-rows.d.ts.map +1 -1
  69. package/dist/src/plan/event-rows.js +201 -56
  70. package/dist/src/plan/event-rows.js.map +1 -1
  71. package/dist/src/plan/factories.d.ts +72 -4
  72. package/dist/src/plan/factories.d.ts.map +1 -1
  73. package/dist/src/plan/factories.js +147 -1
  74. package/dist/src/plan/factories.js.map +1 -1
  75. package/dist/src/plan/index.d.ts +152 -125
  76. package/dist/src/plan/index.d.ts.map +1 -1
  77. package/dist/src/plan/index.js +138 -122
  78. package/dist/src/plan/index.js.map +1 -1
  79. package/dist/src/plan/ir.d.ts +1139 -8
  80. package/dist/src/plan/ir.d.ts.map +1 -1
  81. package/dist/src/plan/ir.js +5 -0
  82. package/dist/src/plan/ir.js.map +1 -1
  83. package/dist/src/plan/library.d.ts +65 -42
  84. package/dist/src/plan/library.d.ts.map +1 -1
  85. package/dist/src/plan/library.js +65 -42
  86. package/dist/src/plan/library.js.map +1 -1
  87. package/dist/src/plan/nested-checks.d.ts +146 -0
  88. package/dist/src/plan/nested-checks.d.ts.map +1 -0
  89. package/dist/src/plan/nested-checks.js +468 -0
  90. package/dist/src/plan/nested-checks.js.map +1 -0
  91. package/dist/src/plan/nested-patch.d.ts +35 -0
  92. package/dist/src/plan/nested-patch.d.ts.map +1 -0
  93. package/dist/src/plan/nested-patch.js +143 -0
  94. package/dist/src/plan/nested-patch.js.map +1 -0
  95. package/dist/src/plan/nested-read.d.ts +3250 -0
  96. package/dist/src/plan/nested-read.d.ts.map +1 -0
  97. package/dist/src/plan/nested-read.js +163 -0
  98. package/dist/src/plan/nested-read.js.map +1 -0
  99. package/dist/src/plan/nested.d.ts +280 -0
  100. package/dist/src/plan/nested.d.ts.map +1 -0
  101. package/dist/src/plan/nested.js +6 -0
  102. package/dist/src/plan/nested.js.map +1 -0
  103. package/dist/src/plan/ordered-source.d.ts +3067 -1
  104. package/dist/src/plan/ordered-source.d.ts.map +1 -1
  105. package/dist/src/plan/ordered-source.js +67 -17
  106. package/dist/src/plan/ordered-source.js.map +1 -1
  107. package/dist/src/plan/over.d.ts +111 -75
  108. package/dist/src/plan/over.d.ts.map +1 -1
  109. package/dist/src/plan/over.js +111 -75
  110. package/dist/src/plan/over.js.map +1 -1
  111. package/dist/src/plan/pick.d.ts +15 -3
  112. package/dist/src/plan/pick.d.ts.map +1 -1
  113. package/dist/src/plan/pick.js +75 -36
  114. package/dist/src/plan/pick.js.map +1 -1
  115. package/dist/src/plan/plan.d.ts +3143 -501
  116. package/dist/src/plan/plan.d.ts.map +1 -1
  117. package/dist/src/plan/plan.js +133 -34
  118. package/dist/src/plan/plan.js.map +1 -1
  119. package/dist/src/plan/reads.d.ts +421 -0
  120. package/dist/src/plan/reads.d.ts.map +1 -0
  121. package/dist/src/plan/reads.js +143 -0
  122. package/dist/src/plan/reads.js.map +1 -0
  123. package/dist/src/plan/refs.d.ts +111 -75
  124. package/dist/src/plan/refs.d.ts.map +1 -1
  125. package/dist/src/plan/refs.js +111 -75
  126. package/dist/src/plan/refs.js.map +1 -1
  127. package/dist/src/plan/root.d.ts +14 -7
  128. package/dist/src/plan/root.d.ts.map +1 -1
  129. package/dist/src/plan/root.js +82 -17
  130. package/dist/src/plan/root.js.map +1 -1
  131. package/dist/src/plan/series.d.ts +5153 -4331
  132. package/dist/src/plan/series.d.ts.map +1 -1
  133. package/dist/src/plan/series.js +1082 -266
  134. package/dist/src/plan/series.js.map +1 -1
  135. package/dist/src/plan/shade.d.ts +981 -0
  136. package/dist/src/plan/shade.d.ts.map +1 -0
  137. package/dist/src/plan/shade.js +60 -0
  138. package/dist/src/plan/shade.js.map +1 -0
  139. package/dist/src/plan/types.d.ts +192 -18
  140. package/dist/src/plan/types.d.ts.map +1 -1
  141. package/dist/src/plan/types.js +77 -19
  142. package/dist/src/plan/types.js.map +1 -1
  143. package/dist/src/query/builder.d.ts +3 -3
  144. package/dist/src/query/builder.d.ts.map +1 -1
  145. package/dist/src/query/builder.js +1 -1
  146. package/dist/src/query/library.d.ts +3 -3
  147. package/dist/src/query/library.d.ts.map +1 -1
  148. package/dist/src/query/library.js +1 -1
  149. package/dist/src/query/queries.d.ts +2 -2
  150. package/dist/src/query/queries.js +1 -1
  151. package/dist/src/query/saved.d.ts +8 -4
  152. package/dist/src/query/saved.d.ts.map +1 -1
  153. package/dist/src/query/saved.js +8 -4
  154. package/dist/src/query/saved.js.map +1 -1
  155. package/dist/src/query/types.d.ts +8 -3
  156. package/dist/src/query/types.d.ts.map +1 -1
  157. package/dist/src/query/types.js +8 -3
  158. package/dist/src/query/types.js.map +1 -1
  159. package/dist/src/roster/index.d.ts +583 -39
  160. package/dist/src/roster/index.d.ts.map +1 -1
  161. package/dist/src/roster/index.js +109 -35
  162. package/dist/src/roster/index.js.map +1 -1
  163. package/dist/src/roster/library.d.ts +12 -2
  164. package/dist/src/roster/library.d.ts.map +1 -1
  165. package/dist/src/roster/library.js +8 -0
  166. package/dist/src/roster/library.js.map +1 -1
  167. package/dist/src/roster/lists.d.ts +59 -12
  168. package/dist/src/roster/lists.d.ts.map +1 -1
  169. package/dist/src/roster/lists.js +51 -58
  170. package/dist/src/roster/lists.js.map +1 -1
  171. package/dist/src/roster/targets.d.ts +8 -4
  172. package/dist/src/roster/targets.d.ts.map +1 -1
  173. package/dist/src/roster/targets.js +9 -5
  174. package/dist/src/roster/targets.js.map +1 -1
  175. package/dist/src/roster/times.d.ts +402 -0
  176. package/dist/src/roster/times.d.ts.map +1 -1
  177. package/dist/src/roster/types.d.ts +913 -1
  178. package/dist/src/roster/types.d.ts.map +1 -1
  179. package/dist/src/roster/types.js +43 -3
  180. package/dist/src/roster/types.js.map +1 -1
  181. package/dist/src/schedule/cell-checks.d.ts +85 -0
  182. package/dist/src/schedule/cell-checks.d.ts.map +1 -0
  183. package/dist/src/schedule/cell-checks.js +211 -0
  184. package/dist/src/schedule/cell-checks.js.map +1 -0
  185. package/dist/src/schedule/days.d.ts +1 -1
  186. package/dist/src/schedule/days.js +1 -1
  187. package/dist/src/schedule/events.d.ts +52 -16
  188. package/dist/src/schedule/events.d.ts.map +1 -1
  189. package/dist/src/schedule/events.js +574 -356
  190. package/dist/src/schedule/events.js.map +1 -1
  191. package/dist/src/schedule/fields.d.ts +134 -0
  192. package/dist/src/schedule/fields.d.ts.map +1 -0
  193. package/dist/src/schedule/fields.js +207 -0
  194. package/dist/src/schedule/fields.js.map +1 -0
  195. package/dist/src/schedule/library.d.ts +11 -3
  196. package/dist/src/schedule/library.d.ts.map +1 -1
  197. package/dist/src/schedule/library.js +9 -6
  198. package/dist/src/schedule/library.js.map +1 -1
  199. package/dist/src/schedule/optimise.d.ts +124 -0
  200. package/dist/src/schedule/optimise.d.ts.map +1 -0
  201. package/dist/src/schedule/optimise.js +140 -0
  202. package/dist/src/schedule/optimise.js.map +1 -0
  203. package/dist/src/schedule/pages.d.ts +76 -0
  204. package/dist/src/schedule/pages.d.ts.map +1 -0
  205. package/dist/src/schedule/pages.js +86 -0
  206. package/dist/src/schedule/pages.js.map +1 -0
  207. package/dist/src/schedule/patch.d.ts +1 -1
  208. package/dist/src/schedule/patch.js +1 -1
  209. package/dist/src/schedule/periods.d.ts +8 -4
  210. package/dist/src/schedule/periods.d.ts.map +1 -1
  211. package/dist/src/schedule/periods.js +1 -1
  212. package/dist/src/schedule/periods.js.map +1 -1
  213. package/dist/src/schedule/record-window.d.ts +115 -22
  214. package/dist/src/schedule/record-window.d.ts.map +1 -1
  215. package/dist/src/schedule/record-window.js +140 -62
  216. package/dist/src/schedule/record-window.js.map +1 -1
  217. package/dist/src/schedule/resources.d.ts +9 -5
  218. package/dist/src/schedule/resources.d.ts.map +1 -1
  219. package/dist/src/schedule/resources.js +35 -15
  220. package/dist/src/schedule/resources.js.map +1 -1
  221. package/dist/src/schedule/session.d.ts +15 -1
  222. package/dist/src/schedule/session.d.ts.map +1 -1
  223. package/dist/src/schedule/session.js +30 -18
  224. package/dist/src/schedule/session.js.map +1 -1
  225. package/dist/src/schedule/types.d.ts +455 -37
  226. package/dist/src/schedule/types.d.ts.map +1 -1
  227. package/dist/src/schedule/types.js +79 -18
  228. package/dist/src/schedule/types.js.map +1 -1
  229. package/dist/src/schedule/window.d.ts +30 -9
  230. package/dist/src/schedule/window.d.ts.map +1 -1
  231. package/dist/src/schedule/window.js +101 -49
  232. package/dist/src/schedule/window.js.map +1 -1
  233. package/dist/src/schematic/index.d.ts +287 -0
  234. package/dist/src/schematic/index.d.ts.map +1 -0
  235. package/dist/src/schematic/index.js +216 -0
  236. package/dist/src/schematic/index.js.map +1 -0
  237. package/dist/src/schematic/kinds.d.ts +501 -0
  238. package/dist/src/schematic/kinds.d.ts.map +1 -0
  239. package/dist/src/schematic/kinds.js +1027 -0
  240. package/dist/src/schematic/kinds.js.map +1 -0
  241. package/dist/src/schematic/layers.d.ts +74 -0
  242. package/dist/src/schematic/layers.d.ts.map +1 -0
  243. package/dist/src/schematic/layers.js +99 -0
  244. package/dist/src/schematic/layers.js.map +1 -0
  245. package/dist/src/schematic/library.d.ts +202 -0
  246. package/dist/src/schematic/library.d.ts.map +1 -0
  247. package/dist/src/schematic/library.js +244 -0
  248. package/dist/src/schematic/library.js.map +1 -0
  249. package/dist/src/schematic/payload.d.ts +8310 -0
  250. package/dist/src/schematic/payload.d.ts.map +1 -0
  251. package/dist/src/schematic/payload.js +446 -0
  252. package/dist/src/schematic/payload.js.map +1 -0
  253. package/dist/src/schematic/schematic.d.ts +27 -0
  254. package/dist/src/schematic/schematic.d.ts.map +1 -0
  255. package/dist/src/schematic/schematic.js +17 -0
  256. package/dist/src/schematic/schematic.js.map +1 -0
  257. package/dist/src/schematic/shapes.d.ts +150 -0
  258. package/dist/src/schematic/shapes.d.ts.map +1 -0
  259. package/dist/src/schematic/shapes.js +171 -0
  260. package/dist/src/schematic/shapes.js.map +1 -0
  261. package/dist/src/schematic/templates.d.ts +96 -0
  262. package/dist/src/schematic/templates.d.ts.map +1 -0
  263. package/dist/src/schematic/templates.js +91 -0
  264. package/dist/src/schematic/templates.js.map +1 -0
  265. package/dist/src/schematic/types.d.ts +5766 -0
  266. package/dist/src/schematic/types.d.ts.map +1 -0
  267. package/dist/src/schematic/types.js +688 -0
  268. package/dist/src/schematic/types.js.map +1 -0
  269. package/dist/src/schematic/window.d.ts +213 -0
  270. package/dist/src/schematic/window.d.ts.map +1 -0
  271. package/dist/src/schematic/window.js +340 -0
  272. package/dist/src/schematic/window.js.map +1 -0
  273. package/dist/src/sheet/bridge.d.ts +19 -0
  274. package/dist/src/sheet/bridge.d.ts.map +1 -1
  275. package/dist/src/sheet/bridge.js +28 -21
  276. package/dist/src/sheet/bridge.js.map +1 -1
  277. package/dist/src/sheet/editing-bridge.d.ts +4 -2
  278. package/dist/src/sheet/editing-bridge.d.ts.map +1 -1
  279. package/dist/src/sheet/editing-bridge.js +8 -2
  280. package/dist/src/sheet/editing-bridge.js.map +1 -1
  281. package/dist/src/sheet/editing-types.d.ts +9 -5
  282. package/dist/src/sheet/editing-types.d.ts.map +1 -1
  283. package/dist/src/sheet/editing-types.js +9 -5
  284. package/dist/src/sheet/editing-types.js.map +1 -1
  285. package/dist/src/sheet/index.d.ts +84 -54
  286. package/dist/src/sheet/index.d.ts.map +1 -1
  287. package/dist/src/sheet/index.js +81 -53
  288. package/dist/src/sheet/index.js.map +1 -1
  289. package/dist/src/sheet/library.d.ts +13 -8
  290. package/dist/src/sheet/library.d.ts.map +1 -1
  291. package/dist/src/sheet/library.js +13 -8
  292. package/dist/src/sheet/library.js.map +1 -1
  293. package/dist/src/sheet/optimise.d.ts +69 -0
  294. package/dist/src/sheet/optimise.d.ts.map +1 -0
  295. package/dist/src/sheet/optimise.js +81 -0
  296. package/dist/src/sheet/optimise.js.map +1 -0
  297. package/dist/src/sheet/record.d.ts +1 -1
  298. package/dist/src/sheet/record.js +2 -2
  299. package/dist/src/sheet/record.js.map +1 -1
  300. package/dist/src/sheet/registers.d.ts +157 -133
  301. package/dist/src/sheet/registers.d.ts.map +1 -1
  302. package/dist/src/sheet/registers.js +157 -133
  303. package/dist/src/sheet/registers.js.map +1 -1
  304. package/dist/src/sheet/root.d.ts +6 -1
  305. package/dist/src/sheet/root.d.ts.map +1 -1
  306. package/dist/src/sheet/root.js +17 -5
  307. package/dist/src/sheet/root.js.map +1 -1
  308. package/dist/src/sheet/sheet.d.ts +696 -590
  309. package/dist/src/sheet/sheet.d.ts.map +1 -1
  310. package/dist/src/sheet/sheet.js +49 -15
  311. package/dist/src/sheet/sheet.js.map +1 -1
  312. package/dist/src/sheet/sub-rows.d.ts +106 -76
  313. package/dist/src/sheet/sub-rows.d.ts.map +1 -1
  314. package/dist/src/sheet/sub-rows.js +106 -76
  315. package/dist/src/sheet/sub-rows.js.map +1 -1
  316. package/dist/src/sheet/types.d.ts +57 -20
  317. package/dist/src/sheet/types.d.ts.map +1 -1
  318. package/dist/src/sheet/types.js +4 -8
  319. package/dist/src/sheet/types.js.map +1 -1
  320. package/dist/src/studio/builder.d.ts +3 -153
  321. package/dist/src/studio/builder.d.ts.map +1 -1
  322. package/dist/src/studio/builder.js +1 -1
  323. package/dist/src/studio/canvas.d.ts +5 -4
  324. package/dist/src/studio/canvas.d.ts.map +1 -1
  325. package/dist/src/studio/canvas.js +8 -7
  326. package/dist/src/studio/canvas.js.map +1 -1
  327. package/dist/src/studio/component.d.ts +30 -20
  328. package/dist/src/studio/component.d.ts.map +1 -1
  329. package/dist/src/studio/component.js +26 -61
  330. package/dist/src/studio/component.js.map +1 -1
  331. package/dist/src/studio/index.d.ts +2 -2
  332. package/dist/src/studio/index.d.ts.map +1 -1
  333. package/dist/src/studio/index.js +1 -1
  334. package/dist/src/studio/index.js.map +1 -1
  335. package/dist/src/studio/inspector.d.ts +10 -39
  336. package/dist/src/studio/inspector.d.ts.map +1 -1
  337. package/dist/src/studio/inspector.js +11 -31
  338. package/dist/src/studio/inspector.js.map +1 -1
  339. package/dist/src/studio/library.d.ts +3 -169
  340. package/dist/src/studio/library.d.ts.map +1 -1
  341. package/dist/src/studio/library.js +1 -1
  342. package/dist/src/studio/page.d.ts +0 -8
  343. package/dist/src/studio/page.d.ts.map +1 -1
  344. package/dist/src/studio/pages.d.ts +17 -591
  345. package/dist/src/studio/pages.d.ts.map +1 -1
  346. package/dist/src/studio/pages.js +17 -44
  347. package/dist/src/studio/pages.js.map +1 -1
  348. package/dist/src/studio/palette.d.ts +2 -7
  349. package/dist/src/studio/palette.d.ts.map +1 -1
  350. package/dist/src/studio/palette.js +4 -5
  351. package/dist/src/studio/palette.js.map +1 -1
  352. package/dist/src/studio/publish.d.ts +8 -18
  353. package/dist/src/studio/publish.d.ts.map +1 -1
  354. package/dist/src/studio/publish.js +10 -36
  355. package/dist/src/studio/publish.js.map +1 -1
  356. package/dist/src/utils/derive.d.ts +12 -12
  357. package/dist/src/utils/derive.d.ts.map +1 -1
  358. package/dist/src/utils/derive.js +5 -2
  359. package/dist/src/utils/derive.js.map +1 -1
  360. package/dist/src/utils/keyed-rows.d.ts +41 -0
  361. package/dist/src/utils/keyed-rows.d.ts.map +1 -0
  362. package/dist/src/utils/keyed-rows.js +64 -0
  363. package/dist/src/utils/keyed-rows.js.map +1 -0
  364. package/dist/src/utils/optimise.d.ts +79 -0
  365. package/dist/src/utils/optimise.d.ts.map +1 -0
  366. package/dist/src/utils/optimise.js +46 -0
  367. package/dist/src/utils/optimise.js.map +1 -0
  368. package/dist/src/utils/ordered-source.d.ts.map +1 -1
  369. package/dist/src/utils/ordered-source.js +14 -5
  370. package/dist/src/utils/ordered-source.js.map +1 -1
  371. package/dist/test/allocation/allocation.examples.d.ts +1900 -1610
  372. package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
  373. package/dist/test/allocation/allocation.examples.js +179 -89
  374. package/dist/test/allocation/allocation.examples.js.map +1 -1
  375. package/dist/test/allocation/optimise.examples.d.ts +109 -0
  376. package/dist/test/allocation/optimise.examples.d.ts.map +1 -0
  377. package/dist/test/allocation/optimise.examples.js +223 -0
  378. package/dist/test/allocation/optimise.examples.js.map +1 -0
  379. package/dist/test/bind/data/data.examples.d.ts +1172 -514
  380. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  381. package/dist/test/bind/data/data.examples.js +284 -164
  382. package/dist/test/bind/data/data.examples.js.map +1 -1
  383. package/dist/test/bind/record/record.examples.d.ts +457 -428
  384. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  385. package/dist/test/bind/record/record.examples.js +41 -21
  386. package/dist/test/bind/record/record.examples.js.map +1 -1
  387. package/dist/test/calendar/calendar-records.examples.d.ts +162 -170
  388. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
  389. package/dist/test/calendar/calendar-records.examples.js +20 -12
  390. package/dist/test/calendar/calendar-records.examples.js.map +1 -1
  391. package/dist/test/calendar/calendar-windows.examples.d.ts +9 -0
  392. package/dist/test/calendar/calendar-windows.examples.d.ts.map +1 -0
  393. package/dist/test/calendar/calendar-windows.examples.js +111 -0
  394. package/dist/test/calendar/calendar-windows.examples.js.map +1 -0
  395. package/dist/test/calendar/calendar.examples.d.ts +1172 -915
  396. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  397. package/dist/test/calendar/calendar.examples.js +211 -124
  398. package/dist/test/calendar/calendar.examples.js.map +1 -1
  399. package/dist/test/calendar/optimise.examples.d.ts +132 -0
  400. package/dist/test/calendar/optimise.examples.d.ts.map +1 -0
  401. package/dist/test/calendar/optimise.examples.js +75 -0
  402. package/dist/test/calendar/optimise.examples.js.map +1 -0
  403. package/dist/test/examples-package.d.ts +49 -16
  404. package/dist/test/examples-package.d.ts.map +1 -1
  405. package/dist/test/examples-package.js +138 -49
  406. package/dist/test/examples-package.js.map +1 -1
  407. package/dist/test/flowchart/flowchart.examples.d.ts +3841 -2840
  408. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  409. package/dist/test/flowchart/flowchart.examples.js +211 -121
  410. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  411. package/dist/test/plan/optimise.examples.d.ts +207 -0
  412. package/dist/test/plan/optimise.examples.d.ts.map +1 -0
  413. package/dist/test/plan/optimise.examples.js +98 -0
  414. package/dist/test/plan/optimise.examples.js.map +1 -0
  415. package/dist/test/plan/plan-events.examples.d.ts +4055 -3279
  416. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  417. package/dist/test/plan/plan-events.examples.js +492 -319
  418. package/dist/test/plan/plan-events.examples.js.map +1 -1
  419. package/dist/test/plan/plan-nested.examples.d.ts +1829 -0
  420. package/dist/test/plan/plan-nested.examples.d.ts.map +1 -0
  421. package/dist/test/plan/plan-nested.examples.js +321 -0
  422. package/dist/test/plan/plan-nested.examples.js.map +1 -0
  423. package/dist/test/plan/plan-records.examples.d.ts +391 -244
  424. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  425. package/dist/test/plan/plan-records.examples.js +186 -65
  426. package/dist/test/plan/plan-records.examples.js.map +1 -1
  427. package/dist/test/plan/plan-windows.examples.d.ts +1978 -803
  428. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
  429. package/dist/test/plan/plan-windows.examples.js +269 -99
  430. package/dist/test/plan/plan-windows.examples.js.map +1 -1
  431. package/dist/test/plan/plan.examples.d.ts +2238 -5726
  432. package/dist/test/plan/plan.examples.d.ts.map +1 -1
  433. package/dist/test/plan/plan.examples.js +846 -973
  434. package/dist/test/plan/plan.examples.js.map +1 -1
  435. package/dist/test/query/query.examples.d.ts +5221 -3005
  436. package/dist/test/query/query.examples.d.ts.map +1 -1
  437. package/dist/test/query/query.examples.js +169 -118
  438. package/dist/test/query/query.examples.js.map +1 -1
  439. package/dist/test/roster/domain.examples.d.ts +804 -0
  440. package/dist/test/roster/domain.examples.d.ts.map +1 -1
  441. package/dist/test/roster/domain.examples.js +3 -3
  442. package/dist/test/roster/domain.examples.js.map +1 -1
  443. package/dist/test/roster/optimise.examples.d.ts +485 -0
  444. package/dist/test/roster/optimise.examples.d.ts.map +1 -0
  445. package/dist/test/roster/optimise.examples.js +155 -0
  446. package/dist/test/roster/optimise.examples.js.map +1 -0
  447. package/dist/test/roster/roster-records.examples.d.ts +364 -404
  448. package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
  449. package/dist/test/roster/roster-records.examples.js +40 -26
  450. package/dist/test/roster/roster-records.examples.js.map +1 -1
  451. package/dist/test/roster/roster.examples.d.ts +5091 -1424
  452. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  453. package/dist/test/roster/roster.examples.js +255 -109
  454. package/dist/test/roster/roster.examples.js.map +1 -1
  455. package/dist/test/roster/warehouse.d.ts +150 -7
  456. package/dist/test/roster/warehouse.d.ts.map +1 -1
  457. package/dist/test/roster/warehouse.js +36 -11
  458. package/dist/test/roster/warehouse.js.map +1 -1
  459. package/dist/test/schedule/schedule.examples.d.ts +2646 -2473
  460. package/dist/test/schedule/schedule.examples.d.ts.map +1 -1
  461. package/dist/test/schedule/schedule.examples.js +144 -88
  462. package/dist/test/schedule/schedule.examples.js.map +1 -1
  463. package/dist/test/schematic/schematic-records.examples.d.ts +454 -0
  464. package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -0
  465. package/dist/test/schematic/schematic-records.examples.js +219 -0
  466. package/dist/test/schematic/schematic-records.examples.js.map +1 -0
  467. package/dist/test/schematic/schematic.examples.d.ts +2640 -0
  468. package/dist/test/schematic/schematic.examples.d.ts.map +1 -0
  469. package/dist/test/schematic/schematic.examples.js +559 -0
  470. package/dist/test/schematic/schematic.examples.js.map +1 -0
  471. package/dist/test/sheet/optimise.examples.d.ts +184 -0
  472. package/dist/test/sheet/optimise.examples.d.ts.map +1 -0
  473. package/dist/test/sheet/optimise.examples.js +79 -0
  474. package/dist/test/sheet/optimise.examples.js.map +1 -0
  475. package/dist/test/sheet/sheet-records.examples.d.ts +208 -356
  476. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
  477. package/dist/test/sheet/sheet-records.examples.js +66 -29
  478. package/dist/test/sheet/sheet-records.examples.js.map +1 -1
  479. package/dist/test/sheet/sheet.examples.d.ts +3650 -3377
  480. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  481. package/dist/test/sheet/sheet.examples.js +406 -296
  482. package/dist/test/sheet/sheet.examples.js.map +1 -1
  483. package/dist/test/studio/component.examples.js +2 -2
  484. package/dist/test/studio/component.examples.js.map +1 -1
  485. package/dist/test/studio/page.examples.js +6 -6
  486. package/dist/test/studio/page.examples.js.map +1 -1
  487. package/dist/test/studio/studio.examples.d.ts +2329 -873
  488. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  489. package/dist/test/studio/studio.examples.js +155 -107
  490. package/dist/test/studio/studio.examples.js.map +1 -1
  491. package/package.json +15 -11
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schematic.examples.d.ts","sourceRoot":"","sources":["../../../test/schematic/schematic.examples.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,559 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@elaraai/e3-ui/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2025 Elara AI Pty Ltd
4
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
5
+ */
6
+ /** @jsxImportSource @elaraai/e3-ui */
7
+ import { ArrayType, BooleanType, DictType, East, FloatType, FunctionType, IntegerType, NullType, OptionType, PatchType, StringType, StructType, VariantType, example, none, some, variant, } from "@elaraai/east";
8
+ import { Box, Button, HStack, Reactive, Slice, State, Text, UIComponentType, VStack } from "@elaraai/east-ui";
9
+ import { Data, Record, Schematic } from "@elaraai/e3-ui";
10
+ import e3 from "@elaraai/e3";
11
+ // ============================================================================
12
+ // A data centre floor (`Schematic Builder Spec.md` §13, D8): racks with power
13
+ // meters, halls and cages, hot and cold aisles, fibre runs, power distribution
14
+ // units feeding the racks, and power, cooling, network and structure layers —
15
+ // each the app's own record, its fields mapped to the Schematic's roles, and
16
+ // its own types: a shape, a pattern or a style is built by an accessor from
17
+ // the row's own fields (D35), and the layers are a record of the app's (D36).
18
+ /** A system the floor's equipment and areas belong to: a layer of the drawing, its colour a theme token. */
19
+ export const DcSystem = StructType({ label: StringType, colour: StringType, order: IntegerType, fixed: BooleanType, dim: FloatType });
20
+ export const schematicSystems = e3.record("schematic_systems", DictType(StringType, DcSystem), {
21
+ initial: new Map([
22
+ ["structure", { label: "Structure", colour: "fg.muted", order: 1n, fixed: true, dim: 0.6 }],
23
+ ["power", { label: "Power", colour: "status.warn", order: 2n, fixed: false, dim: 1.0 }],
24
+ ["cooling", { label: "Cooling", colour: "brand.solid", order: 3n, fixed: false, dim: 1.0 }],
25
+ ["network", { label: "Network", colour: "status.pos", order: 4n, fixed: false, dim: 1.0 }],
26
+ ]),
27
+ mutations: (mutation) => ({
28
+ // The systems' patch door: another session's change of a layer — its colour, say — which the floor redraws.
29
+ patch: mutation.patch(),
30
+ }),
31
+ });
32
+ // ============================================================================
33
+ // ----------------------------------------------------------------------------
34
+ // The smallest: one hall's racks, read only
35
+ // ----------------------------------------------------------------------------
36
+ export const FloorRack = StructType({ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, model: StringType, kw: FloatType, capacity: FloatType });
37
+ export const schematicFloorRacks = e3.record("schematic_floor_racks", DictType(StringType, FloorRack), {
38
+ initial: new Map([
39
+ ["A01", { name: "A01", x: 2.4, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 5.2, capacity: 8.0 }],
40
+ ["A02", { name: "A02", x: 6.0, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 7.4, capacity: 8.0 }],
41
+ ["A03", { name: "A03", x: 9.6, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 3.9, capacity: 8.0 }],
42
+ ["A04", { name: "A04", x: 13.2, y: 2.9, w: 3.2, h: 1.2, model: "48U · 12 kW", kw: 9.6, capacity: 12.0 }],
43
+ ["B01", { name: "B01", x: 2.4, y: 8.6, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 6.1, capacity: 8.0 }],
44
+ ["B02", { name: "B02", x: 6.0, y: 8.6, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 2.8, capacity: 8.0 }],
45
+ ]),
46
+ indexes: (index) => ({
47
+ // The racks by their model: what the binding matrix's source reads them through, built and never run.
48
+ schematic_floor_racks_by_model: index.on(["model"]),
49
+ }),
50
+ mutations: (mutation) => ({
51
+ // The floor's racks' patch door: the handover's Save, and another session's moves of a rack, which the floor redraws.
52
+ patch: mutation.patch(),
53
+ }),
54
+ });
55
+ export const schematicFloor = example({
56
+ keywords: ["Schematic", "Schematic.items", "Data.bind", "records", "racks", "meter", "read only", "canvas", "id"],
57
+ description: "One hall's racks, read only, with no panes: a record of racks bound with Data.bind, each rack's fields mapped to the Schematic's roles — its centre, its box, its name, its model and its power as a meter",
58
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
59
+ const racks = $.let(Data.bind(schematicFloorRacks));
60
+ return (_jsx(Box, { height: "440px", children: _jsx(Schematic, { id: "floor", extent: { width: 18, height: 12 }, scaleUnit: "m", items: {
61
+ racks: Schematic.items(racks, {
62
+ name: "Rack", icon: "server", x: "x", y: "y", width: "w", height: "h", label: "name",
63
+ sublabel: (r) => r.model,
64
+ meter: (r) => ({ value: r.kw, max: r.capacity }),
65
+ }),
66
+ } }) }));
67
+ } }))),
68
+ inputs: [],
69
+ });
70
+ // ----------------------------------------------------------------------------
71
+ // The handover: the same hall edited, with no pane
72
+ // ----------------------------------------------------------------------------
73
+ /**
74
+ * The same hall handed over to its install crew, who move its racks into
75
+ * place: the racks bound with their patch door, so Move moves them and Del
76
+ * deletes them, each a step of the history Save writes through it. It is
77
+ * given no pane — no library and no inspector — so its frame is its toolbar,
78
+ * its canvas and its footer.
79
+ */
80
+ export const schematicHandover = example({
81
+ keywords: [
82
+ "Schematic", "Schematic.items", "Record.bind", "records", "editing", "Move", "Delete", "Save", "undo", "history", "no pane", "toolbar", "footer", "id",
83
+ ],
84
+ description: "The same hall handed over to its install crew, who move its racks into place: the racks bound with their patch door, so Move moves them and Del deletes them, each a step of the history Save writes through it; with no pane — no library and no inspector — its frame is its toolbar, its canvas and its footer",
85
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
86
+ const racks = $.let(Record.bind(schematicFloorRacks));
87
+ return (_jsx(Box, { height: "440px", children: _jsx(Schematic, { id: "handover", extent: { width: 18, height: 12 }, scaleUnit: "m", items: {
88
+ racks: Schematic.items(racks, {
89
+ name: "Rack", icon: "server", x: "x", y: "y", width: "w", height: "h", label: "name",
90
+ sublabel: (r) => r.model,
91
+ meter: (r) => ({ value: r.kw, max: r.capacity }),
92
+ }),
93
+ } }) }));
94
+ } }))),
95
+ inputs: [],
96
+ });
97
+ // ----------------------------------------------------------------------------
98
+ // Shapes: footprints and zone geometry about their anchors, tones, layers
99
+ // ----------------------------------------------------------------------------
100
+ /** A corner of a unit's outline, about its centre, in metres. */
101
+ export const ShapePoint = StructType({ x: FloatType, y: FloatType });
102
+ /** A unit, measured as the site measures it: a cooling tower by its radius, a cooling unit by its outline's corners, or by neither. */
103
+ export const ShapeUnit = StructType({
104
+ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, kind: StringType,
105
+ radius: OptionType(FloatType), outline: ArrayType(ShapePoint), system: StringType, tint: OptionType(StringType),
106
+ });
107
+ /** A corner of an area's edge, about its box's centre; its bulge curves the edge to the next corner (0 is straight). */
108
+ export const ShapeCorner = StructType({ x: FloatType, y: FloatType, bulge: FloatType });
109
+ /** What an area is: a hall, outlined, or a duct bank, a hatched band of its width. */
110
+ export const ShapeAreaKind = VariantType({ hall: NullType, duct: StructType({ width: FloatType }) });
111
+ /** An area: its box, what it is, and its edge's corners. */
112
+ export const ShapeArea = StructType({
113
+ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, kind: ShapeAreaKind, corners: ArrayType(ShapeCorner), system: StringType,
114
+ });
115
+ export const schematicShapeUnits = e3.record("schematic_shape_units", DictType(StringType, ShapeUnit), {
116
+ initial: new Map([
117
+ ["CRAH-1", { name: "CRAH-1", x: 6.2, y: 4.6, w: 5.0, h: 3.4, kind: "cooling unit", system: "cooling", tint: some("status.info"), radius: none,
118
+ outline: [{ x: -2.2, y: -1.6 }, { x: 2.4, y: -1.1 }, { x: 2.1, y: 1.6 }, { x: -2.5, y: 1.1 }] }],
119
+ ["CT-2", { name: "CT-2", x: 16.4, y: 4.8, w: 4.6, h: 4.6, kind: "cooling tower", system: "cooling", tint: some("heat.3"), radius: some(2.3), outline: [] }],
120
+ ["PDU-3", { name: "PDU-3", x: 22.0, y: 4.6, w: 1.2, h: 0.8, kind: "power distribution unit", system: "power", tint: none, radius: none, outline: [] }],
121
+ ]),
122
+ });
123
+ export const schematicShapeAreas = e3.record("schematic_shape_areas", DictType(StringType, ShapeArea), {
124
+ initial: new Map([
125
+ ["hall-3", { name: "Hall 3", x: 1.6, y: 1.4, w: 9.3, h: 6.6, system: "structure", kind: variant("hall", null),
126
+ corners: [{ x: -4.65, y: -2.5, bulge: 0.0 }, { x: 4.15, y: -3.3, bulge: 0.0 }, { x: 4.65, y: 2.7, bulge: 0.0 }, { x: -4.25, y: 3.3, bulge: 0.0 }] }],
127
+ ["duct", { name: "Duct bank", x: 1.0, y: 9.1, w: 23.8, h: 3.4, system: "power", kind: variant("duct", { width: 1.4 }),
128
+ corners: [
129
+ { x: -11.7, y: 1.0, bulge: 0.0 }, { x: -6.3, y: -0.8, bulge: 0.45 }, { x: -0.1, y: 0.8, bulge: -0.45 }, { x: 5.7, y: -1.0, bulge: 0.35 }, { x: 11.5, y: 0.2, bulge: 0.0 },
130
+ ] }],
131
+ ]),
132
+ });
133
+ export const schematicShapes = example({
134
+ keywords: [
135
+ "Schematic", "Schematic.items", "Schematic.zones", "Schematic.layers", "footprint", "geometry", "accessor", "Schematic.circle", "Schematic.polygon",
136
+ "Schematic.polyline", "Schematic.hatch", "arc", "bulge", "anchor", "tone", "color", "theme token", "layers", "read only",
137
+ ],
138
+ description: "Footprints and zone shapes built by accessors from the rows' own fields and drawn about their anchors — a cooling unit's outline and a tower's radius about each unit's centre, a hall's corners and a duct bank's arcing band about each area's box centre — with theme colour tokens, tones and layers from a systems record, read only",
139
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
140
+ const units = $.let(Data.bind(schematicShapeUnits));
141
+ const areas = $.let(Data.bind(schematicShapeAreas));
142
+ const systems = $.let(Data.bind(schematicSystems));
143
+ return (_jsx(Box, { height: "440px", children: _jsx(Schematic, { id: "shapes", extent: { width: 26.5, height: 14 }, scaleUnit: "m", items: {
144
+ units: Schematic.items(units, {
145
+ name: "Equipment", icon: "gear", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
146
+ // A tower by its radius, a unit by its outline's corners, about its centre.
147
+ footprint: (u) => u.radius.match({
148
+ some: (_$2, r) => some(Schematic.circle(r)),
149
+ none: (_$2) => u.outline.size().greater(0n).ifElse((_$3) => some(Schematic.polygon(u.outline)), (_$3) => none),
150
+ }),
151
+ sublabel: (u) => u.kind,
152
+ color: (u) => u.tint,
153
+ fillOpacity: (_u) => some(0.18),
154
+ }),
155
+ }, zones: {
156
+ areas: Schematic.zones(areas, {
157
+ name: "Area", icon: "vector-square", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
158
+ // A hall outlined by its corners; a duct bank hatched, a band of its width along them.
159
+ pattern: (a) => a.kind.match({
160
+ hall: (_$2) => Schematic.outline(),
161
+ duct: (_$2) => Schematic.hatch({ tone: "warning" }),
162
+ }),
163
+ geometry: (a) => some(a.kind.match({
164
+ hall: (_$2) => Schematic.polygon(a.corners),
165
+ duct: (_$2, duct) => Schematic.polyline(a.corners, { width: duct.width }),
166
+ })),
167
+ }),
168
+ }, layers: Schematic.layers(systems.read(), {
169
+ label: (s) => s.label, color: (s) => some(s.colour), order: (s) => s.order, locked: (s) => s.fixed, opacity: (s) => s.dim,
170
+ }) }) }));
171
+ } }))),
172
+ inputs: [],
173
+ });
174
+ // ----------------------------------------------------------------------------
175
+ // The builder: racks, network frames, cooling units and power distribution
176
+ // units; halls, cages and aisles; fibre runs; power feeds; the racks' loads
177
+ // ----------------------------------------------------------------------------
178
+ /** A rack: placed by its centre, or unplaced until a drop places it. */
179
+ export const DcRack = StructType({
180
+ name: StringType, x: OptionType(FloatType), y: OptionType(FloatType), w: FloatType, h: FloatType,
181
+ model: StringType, hall: StringType, system: StringType, owner: StringType,
182
+ });
183
+ /** A rack's load: what its card's bar, figure and dot draw. */
184
+ export const DcLoad = StructType({ kw: FloatType, capacity: FloatType, alarm: VariantType({ ok: NullType, warm: NullType, hot: NullType }) });
185
+ /** A network frame or a power distribution unit. */
186
+ export const DcUnit = StructType({ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, kind: StringType, system: StringType });
187
+ /** A cooling unit: round, drawn by its radius. */
188
+ export const DcCooling = StructType({
189
+ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, radius: FloatType, setpoint: FloatType, system: StringType,
190
+ });
191
+ /** What an area is: a room or a cage, outlined, or a cold or a hot aisle, hatched. */
192
+ export const DcAreaKind = VariantType({ room: NullType, cold: NullType, hot: NullType });
193
+ /** A hall, a cage or an aisle. */
194
+ export const DcArea = StructType({ name: StringType, x: FloatType, y: FloatType, w: FloatType, h: FloatType, kind: DcAreaKind, system: StringType });
195
+ /** A fibre run's end: a rack, or a network frame. */
196
+ export const DcEnd = VariantType({ rack: StringType, frame: StringType });
197
+ /** A bend of a fibre run's path, in metres. */
198
+ export const DcPoint = StructType({ x: FloatType, y: FloatType });
199
+ /** What a run carries: fibre, drawn solid, or a logical link — management, a cross-connect — drawn dashed. */
200
+ export const DcCable = VariantType({ fibre: NullType, logical: NullType });
201
+ /** A fibre run between two ends. */
202
+ export const DcFibre = StructType({
203
+ from: DcEnd, to: DcEnd, path: ArrayType(DcPoint), label: OptionType(StringType), speed: OptionType(StringType), cable: DcCable, system: StringType,
204
+ });
205
+ /** A power feed: power distribution units feeding racks. */
206
+ export const DcFeed = StructType({ supply: ArrayType(StringType), racks: ArrayType(StringType), label: StringType, load: StringType, system: StringType });
207
+ /** A fibre trunk: one cable gathering several racks' runs into a frame. */
208
+ export const DcTrunk = StructType({ racks: ArrayType(StringType), frames: ArrayType(StringType), label: OptionType(StringType), system: StringType });
209
+ /** What a rack template gives a new rack: every field of a rack but its centre, which the drop places. */
210
+ export const DcRackValues = StructType({ name: StringType, w: FloatType, h: FloatType, model: StringType, hall: StringType, system: StringType, owner: StringType });
211
+ /** A rack template: its card's name and group, and the rack it creates. */
212
+ export const DcRackTemplate = StructType({ name: StringType, group: StringType, values: DcRackValues });
213
+ /** What a fibre template gives a run: every field of a run but its ends. */
214
+ export const DcFibreValues = StructType({
215
+ path: ArrayType(DcPoint), label: OptionType(StringType), speed: OptionType(StringType), cable: DcCable, system: StringType,
216
+ });
217
+ /** A fibre template: its card's name and system, and what it gives a run. */
218
+ export const DcFibreTemplate = StructType({ name: StringType, system: StringType, values: DcFibreValues });
219
+ /** A tenant of the floor: the owner a rack is let to, and who looks after its racks. */
220
+ export const DcOwner = StructType({ name: StringType, contact: StringType });
221
+ export const schematicRacks = e3.record("schematic_racks", DictType(StringType, DcRack), {
222
+ initial: new Map([
223
+ ["A01", { name: "A01", x: some(2.4), y: some(2.9), w: 3.2, h: 1.2, model: "42U · 8 kW", hall: "Cage A", system: "power", owner: "Harbour Labs" }],
224
+ ["A02", { name: "A02", x: some(6.0), y: some(2.9), w: 3.2, h: 1.2, model: "42U · 8 kW", hall: "Cage A", system: "power", owner: "Harbour Labs" }],
225
+ ["A03", { name: "A03", x: some(9.6), y: some(2.9), w: 3.2, h: 1.2, model: "42U · 8 kW", hall: "Cage A", system: "power", owner: "Northwind Media" }],
226
+ ["A04", { name: "A04", x: some(13.2), y: some(2.9), w: 3.2, h: 1.2, model: "48U · 12 kW", hall: "Cage A", system: "power", owner: "Northwind Media" }],
227
+ ["A05", { name: "A05", x: some(16.8), y: some(2.9), w: 3.2, h: 1.2, model: "48U · 12 kW", hall: "Cage A", system: "power", owner: "Elmway College" }],
228
+ ["A06", { name: "A06", x: none, y: none, w: 3.2, h: 1.2, model: "48U · 12 kW", hall: "Cage A", system: "power", owner: "Elmway College" }],
229
+ ["A07", { name: "A07", x: none, y: none, w: 3.2, h: 1.2, model: "42U · 8 kW", hall: "Cage A", system: "power", owner: "" }],
230
+ ]),
231
+ indexes: (index) => ({
232
+ schematic_racks_by_name: index.on(["name"]),
233
+ schematic_racks_by_hall: index.on(["hall"]),
234
+ schematic_racks_by_owner: index.on(["owner"]),
235
+ // The racks filed by their boxes at a 1 cm cell, for a floor read a window at a time (#1393): what a window reads whatever
236
+ // the rail chooses, and the racks with no position, under its unplaced clause, which the Backlog pages.
237
+ schematic_racks_by_area: index.area({
238
+ x: "x", y: "y", width: "w", height: "h", at: "centre", cell: 0.01,
239
+ }),
240
+ // Beside it, a choice of owners and the window — or the racks with no position — in one read.
241
+ schematic_racks_by_owner_area: index.area({
242
+ on: ["owner"], x: "x", y: "y", width: "w", height: "h", at: "centre", cell: 0.01,
243
+ }),
244
+ }),
245
+ mutations: (mutation) => ({
246
+ patch: mutation.patch(),
247
+ }),
248
+ });
249
+ export const schematicRackLoads = e3.record("schematic_rack_loads", DictType(StringType, DcLoad), {
250
+ initial: new Map([
251
+ ["A01", { kw: 5.2, capacity: 8.0, alarm: variant("ok", null) }],
252
+ ["A02", { kw: 7.4, capacity: 8.0, alarm: variant("warm", null) }],
253
+ ["A03", { kw: 3.9, capacity: 8.0, alarm: variant("ok", null) }],
254
+ ["A04", { kw: 11.6, capacity: 12.0, alarm: variant("hot", null) }],
255
+ ["A05", { kw: 0.0, capacity: 12.0, alarm: variant("ok", null) }],
256
+ ]),
257
+ mutations: (mutation) => ({
258
+ // The racks' loads' patch door: a rack's capacity edited in the inspector's details.
259
+ patch: mutation.patch(),
260
+ }),
261
+ });
262
+ export const schematicFrames = e3.record("schematic_frames", DictType(StringType, DcUnit), {
263
+ initial: new Map([
264
+ ["MMR-1", { name: "MMR-1", x: 24.2, y: 2.9, w: 4.0, h: 1.2, kind: "demarc · 48 ports", system: "network" }],
265
+ ["ODF-1", { name: "ODF-1", x: 8.4, y: 9.6, w: 12.8, h: 1.0, kind: "fibre frame · 288 F", system: "network" }],
266
+ ["CORE-1", { name: "CORE-1", x: 23.2, y: 9.7, w: 4.0, h: 1.2, kind: "core · 64 ports", system: "network" }],
267
+ ]),
268
+ });
269
+ export const schematicPdus = e3.record("schematic_pdus", DictType(StringType, DcUnit), {
270
+ initial: new Map([
271
+ ["PDU-A", { name: "PDU-A", x: 1.6, y: 4.2, w: 1.2, h: 0.6, kind: "PDU · 32 A", system: "power" }],
272
+ ["PDU-B", { name: "PDU-B", x: 18.6, y: 4.2, w: 1.2, h: 0.6, kind: "PDU · 32 A", system: "power" }],
273
+ ]),
274
+ });
275
+ export const schematicCooling = e3.record("schematic_cooling", DictType(StringType, DcCooling), {
276
+ initial: new Map([
277
+ ["CRAH-1", { name: "CRAH-1", x: 3.0, y: 11.9, w: 1.4, h: 1.4, radius: 0.7, setpoint: 22.0, system: "cooling" }],
278
+ ["CRAH-2", { name: "CRAH-2", x: 9.0, y: 11.9, w: 1.4, h: 1.4, radius: 0.7, setpoint: 22.0, system: "cooling" }],
279
+ ["CRAH-3", { name: "CRAH-3", x: 15.0, y: 11.9, w: 1.4, h: 1.4, radius: 0.7, setpoint: 23.0, system: "cooling" }],
280
+ ]),
281
+ mutations: (mutation) => ({
282
+ patch: mutation.patch(),
283
+ }),
284
+ });
285
+ export const schematicAreas = e3.record("schematic_areas", DictType(StringType, DcArea), {
286
+ initial: new Map([
287
+ ["cage-a", { name: "Cage A", x: 0.6, y: 0.6, w: 19.6, h: 4.6, kind: variant("room", null), system: "structure" }],
288
+ ["mmr", { name: "Meet-me room", x: 21.0, y: 0.6, w: 6.4, h: 4.6, kind: variant("room", null), system: "structure" }],
289
+ ["cold-a", { name: "Cold aisle A · 1.2 m", x: 0.6, y: 6.0, w: 26.8, h: 1.2, kind: variant("cold", null), system: "cooling" }],
290
+ ["net-room", { name: "Network room", x: 19.0, y: 7.8, w: 8.4, h: 3.8, kind: variant("room", null), system: "structure" }],
291
+ ["hot-a", { name: "Hot aisle A · 1.0 m", x: 0.6, y: 12.9, w: 18.0, h: 0.9, kind: variant("hot", null), system: "cooling" }],
292
+ ]),
293
+ });
294
+ /** The floor's fibre runs, as its record and the frozen floor's hold them. */
295
+ const dcFibreRuns = new Map([
296
+ ["u1", { from: variant("rack", "A01"), to: variant("frame", "ODF-1"), path: [], label: some("uplink"), speed: some("100G"), cable: variant("fibre", null), system: "network" }],
297
+ ["u2", { from: variant("rack", "A02"), to: variant("frame", "ODF-1"), path: [], label: some("uplink"), speed: some("100G"), cable: variant("fibre", null), system: "network" }],
298
+ ["u2m", { from: variant("rack", "A02"), to: variant("frame", "ODF-1"), path: [], label: some("OOB mgmt"), speed: none, cable: variant("logical", null), system: "network" }],
299
+ ["u3", { from: variant("rack", "A03"), to: variant("frame", "ODF-1"), path: [], label: none, speed: none, cable: variant("fibre", null), system: "network" }],
300
+ ["u4", { from: variant("rack", "A04"), to: variant("frame", "ODF-1"), path: [], label: none, speed: some("2 × 100G"), cable: variant("fibre", null), system: "network" }],
301
+ ["x1", { from: variant("frame", "MMR-1"), to: variant("frame", "CORE-1"), path: [{ x: 26.0, y: 6.6 }], label: none, speed: some("2 × 10G"), cable: variant("logical", null), system: "network" }],
302
+ ]);
303
+ export const schematicFibre = e3.record("schematic_fibre", DictType(StringType, DcFibre), {
304
+ initial: dcFibreRuns,
305
+ indexes: (index) => ({
306
+ // The fibre runs by system, for a floor whose rail narrows its runs through a source of their own: a run read complete
307
+ // through its narrowing, a run a draft changed that a choice leaves out waiting in its session (#1391).
308
+ schematic_fibre_by_system: index.on(["system"]),
309
+ }),
310
+ mutations: (mutation) => ({
311
+ patch: mutation.patch(),
312
+ }),
313
+ });
314
+ /** The fibre runs of a floor whose cabling is frozen: the same runs, which no Save changes. */
315
+ export const schematicFrozenFibre = e3.record("schematic_frozen_fibre", DictType(StringType, DcFibre), {
316
+ initial: dcFibreRuns,
317
+ mutations: (mutation) => ({
318
+ // The frozen floor's door, a checked one: it refuses every change, naming why — what a Save over it is answered.
319
+ patch: mutation.reduce(East.function([DictType(StringType, DcFibre), PatchType(DictType(StringType, DcFibre))], DictType(StringType, DcFibre), ($, runs, _patch) => {
320
+ $.error("the fibre runs are frozen");
321
+ return runs;
322
+ })),
323
+ }),
324
+ });
325
+ export const schematicFeeds = e3.record("schematic_feeds", DictType(StringType, DcFeed), {
326
+ initial: new Map([
327
+ ["feed-a", { supply: ["PDU-A"], racks: ["A01", "A02", "A03"], label: "PDU-A · A side", load: "16.5 kW", system: "power" }],
328
+ ["feed-b", { supply: ["PDU-B"], racks: ["A04", "A05"], label: "PDU-B · A side", load: "11.6 kW", system: "power" }],
329
+ ]),
330
+ mutations: (mutation) => ({
331
+ patch: mutation.patch(),
332
+ }),
333
+ });
334
+ /** The floor's fibre trunks: none yet — a Shift-connect from racks to a frame gathers their runs into one. */
335
+ export const schematicTrunks = e3.record("schematic_trunks", DictType(StringType, DcTrunk), {
336
+ initial: new Map(),
337
+ mutations: (mutation) => ({
338
+ patch: mutation.patch(),
339
+ }),
340
+ });
341
+ export const schematicRackTemplates = e3.record("schematic_rack_templates", DictType(StringType, DcRackTemplate), {
342
+ initial: new Map([
343
+ ["r42", { name: "42U rack · 8 kW", group: "Racks", values: { name: "New 42U rack", w: 3.2, h: 1.2, model: "42U · 8 kW", hall: "Cage A", system: "power", owner: "" } }],
344
+ ["r48", { name: "48U rack · 12 kW", group: "Racks", values: { name: "New 48U rack", w: 3.2, h: 1.2, model: "48U · 12 kW", hall: "Cage A", system: "power", owner: "" } }],
345
+ ["half", { name: "Half rack · 4 kW", group: "Half racks", values: { name: "New half rack", w: 1.6, h: 1.2, model: "24U · 4 kW", hall: "Cage A", system: "power", owner: "" } }],
346
+ ]),
347
+ indexes: (index) => ({
348
+ schematic_rack_templates_by_group: index.on(["group"]),
349
+ }),
350
+ });
351
+ export const schematicFibreTemplates = e3.record("schematic_fibre_templates", DictType(StringType, DcFibreTemplate), {
352
+ initial: new Map([
353
+ ["uplink", { name: "Uplink · 100G", system: "network",
354
+ values: { path: [], label: some("uplink"), speed: some("100G"), cable: variant("fibre", null), system: "network" } }],
355
+ ["oob", { name: "Out-of-band management", system: "network",
356
+ values: { path: [], label: some("OOB mgmt"), speed: none, cable: variant("logical", null), system: "network" } }],
357
+ ]),
358
+ indexes: (index) => ({
359
+ schematic_fibre_templates_by_system: index.on(["system"]),
360
+ }),
361
+ });
362
+ export const schematicOwners = e3.record("schematic_owners", DictType(StringType, DcOwner), {
363
+ initial: new Map([
364
+ ["elmway", { name: "Elmway College", contact: "IT services" }],
365
+ ["harbour", { name: "Harbour Labs", contact: "Network desk" }],
366
+ ["northwind", { name: "Northwind Media", contact: "Facilities" }],
367
+ ]),
368
+ });
369
+ export const schematicDataCentre = example({
370
+ keywords: [
371
+ "Schematic", "Schematic.items", "Schematic.zones", "Schematic.links", "Schematic.nets", "Schematic.details", "Schematic.templates",
372
+ "Schematic.layers", "Schematic.library", "Schematic.library.tab", "Schematic.patch", "Record.bind", "Data.bindPaged", "Slice.bindRecords", "records",
373
+ "details", "templates", "backlog", "layers", "narrowed", "inspector", "accessor", "id", "onSelect", "canConnect", "Schematic.Types.Ref",
374
+ "Schematic.Types.Candidate", "veto", "editing", "Save", "undo", "Move", "Connect", "nets", "drag and drop", "drop",
375
+ ],
376
+ description: "A data centre floor over the app's records, each holding its own fields: racks read through their source of the slice, editable with their patch door, their loads as details on each card, editable in the inspector; network frames, round cooling units with their own Details and power distribution units; halls, cages and aisles, outlined or hatched by what they are; fibre runs between racks and frames, solid or dashed by their cable, a run between two frames refused in the veto's words; power feeds, and fibre trunks a Shift-connect gathers runs into, none onto the core; every gesture a step of one history, Save writing each record through its patch door; the inspector; the whole selection kept by the host; and in the library every kind's templates, dropped on the canvas or on a fibre run, the racks with no position, a drop placing one, the zones' index, the layers, a systems record, and the floor's owners, an owner's card dropped on a rack making it the rack's owner",
377
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
378
+ const racks = $.let(Record.bind(schematicRacks));
379
+ const rackEntries = $.let(Data.bindPaged(schematicRacks));
380
+ // The racks' loads, edited in the inspector: their patch door, read by key beside the racks' source.
381
+ const loads = $.let(Record.bind(schematicRackLoads));
382
+ const loadEntries = $.let(Data.bindPaged(schematicRackLoads));
383
+ const frames = $.let(Data.bind(schematicFrames));
384
+ const pdus = $.let(Data.bind(schematicPdus));
385
+ const cooling = $.let(Record.bind(schematicCooling));
386
+ const areas = $.let(Data.bind(schematicAreas));
387
+ const fibre = $.let(Record.bind(schematicFibre));
388
+ const feeds = $.let(Record.bind(schematicFeeds));
389
+ const trunks = $.let(Record.bind(schematicTrunks));
390
+ const systems = $.let(Data.bind(schematicSystems));
391
+ const rackTemplates = $.let(Data.bind(schematicRackTemplates));
392
+ const fibreTemplates = $.let(Data.bind(schematicFibreTemplates));
393
+ const owners = $.let(Data.bind(schematicOwners));
394
+ // A cooling unit's own Details: its setpoint, and a button that lowers it — the edited unit goes back through `update`.
395
+ const coolingDetails = $.const(East.function([DcCooling, FunctionType([DcCooling], NullType)], UIComponentType, ($2, unit, update) => {
396
+ const lower = $2.const(East.function([], NullType, ($3) => {
397
+ // East has no struct spread: the unit, rebuilt with its new setpoint.
398
+ const edited = $3.const({
399
+ name: unit.name, x: unit.x, y: unit.y, w: unit.w, h: unit.h, radius: unit.radius, setpoint: unit.setpoint.subtract(1.0), system: unit.system,
400
+ }, DcCooling);
401
+ $3(update(edited));
402
+ }));
403
+ return (_jsxs(VStack, { gap: "2", align: "stretch", children: [_jsx(Text, { children: East.str `${unit.name} holds ${East.Float.printFixed(unit.setpoint, 1n)} °C` }), _jsx(Button, { variant: "outline", onClick: lower, children: "Lower the setpoint by 1 \u00B0C" })] }));
404
+ }));
405
+ // The whole selection, after each change — items, zones, links and nets alike, each by its kind's slot and
406
+ // key — kept where the rest of the app reads it.
407
+ const selected = $.let(State.bind([ArrayType(Schematic.Types.Ref)], "ex.schematicDataCentre.selected", []));
408
+ const onSelect = $.const(East.function([ArrayType(Schematic.Types.Ref)], NullType, ($2, refs) => {
409
+ $2(selected.write(refs));
410
+ }));
411
+ // Two frames are joined by a cross-connect, never a fibre run, and the racks' trunks land on a fibre frame,
412
+ // never on the core: the veto's words refuse the pair — a drag's draft shows them, and the footer says them of
413
+ // the inspector's ends, sides and Connect to….
414
+ const canConnect = $.const(East.function([Schematic.Types.Candidate], OptionType(StringType), ($2, candidate) => {
415
+ const reason = $2.let(none, OptionType(StringType));
416
+ $2.if(candidate.from.kind.equal("network").and(() => candidate.to.kind.equal("network")), ($3) => {
417
+ $3.assign(reason, some("Two frames are joined by a cross-connect"));
418
+ });
419
+ $2.if(candidate.kind.equal("trunks").and(() => candidate.to.key.equal("CORE-1")), ($3) => {
420
+ $3.assign(reason, some("A trunk lands on a fibre frame, never the core"));
421
+ });
422
+ return reason;
423
+ }));
424
+ // One rail: the racks by name, hall and owner, and each templates list by its group or system.
425
+ const slice = $.let(Slice.bindRecords("ex.schematicDataCentre", {
426
+ racks: { source: Data.bindPaged(schematicRacks, { indexes: ["schematic_racks_by_name", "schematic_racks_by_hall", "schematic_racks_by_owner"] }), icon: { prefix: "fas", name: "server" },
427
+ search: ["name", "owner"], fields: {
428
+ name: { label: "Rack" }, hall: { label: "Hall", hints: ["Cage A"] }, owner: { label: "Owner", hints: ["Harbour Labs", "Northwind Media", "Elmway College"] },
429
+ } },
430
+ rackTemplates: { source: Data.bindPaged(schematicRackTemplates, { indexes: ["schematic_rack_templates_by_group"] }), fields: { group: { label: "Group", hints: ["Racks", "Half racks"] } } },
431
+ fibreTemplates: { source: Data.bindPaged(schematicFibreTemplates, { indexes: ["schematic_fibre_templates_by_system"] }), fields: { system: { label: "System", hints: ["network"] } } },
432
+ }));
433
+ return (_jsx(Box, { height: "640px", children: _jsx(Schematic, { id: "dataCentre", inspector: true, extent: { width: 28, height: 14 }, scaleUnit: "m", slice: { slice }, narrowed: "dim", onSelect: onSelect, canConnect: canConnect, items: {
434
+ racks: Schematic.items(racks, {
435
+ name: "Rack", icon: "server", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system", entries: rackEntries,
436
+ sublabel: (r) => r.model,
437
+ details: Schematic.details(loads, {
438
+ entries: loadEntries,
439
+ meter: (l) => ({ value: l.kw, max: l.capacity }),
440
+ metric: (l) => some(East.str `${East.Float.printFixed(l.kw, 1n)} kW`),
441
+ status: { field: "alarm", cases: {
442
+ ok: { label: "OK", tone: variant("success", null), ring: false },
443
+ warm: { label: "Warm", tone: variant("warning", null), ring: false },
444
+ hot: { label: "Hot", tone: variant("danger", null), ring: false },
445
+ } },
446
+ }),
447
+ templates: Schematic.templates(rackTemplates.read(), {
448
+ name: (t) => t.name, group: (t) => some(t.group), values: (t) => t.values, source: "rackTemplates",
449
+ }),
450
+ }),
451
+ network: Schematic.items(frames, {
452
+ name: "Network frame", icon: "network-wired", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
453
+ sublabel: (f) => f.kind,
454
+ }),
455
+ cooling: Schematic.items(cooling, {
456
+ name: "Cooling unit", icon: "fan", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
457
+ footprint: (c) => some(Schematic.circle(c.radius)),
458
+ sublabel: (c) => East.str `set ${East.Float.printFixed(c.setpoint, 1n)} °C`,
459
+ inspector: coolingDetails,
460
+ }),
461
+ pdus: Schematic.items(pdus, {
462
+ name: "Power distribution unit", icon: "plug", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
463
+ sublabel: (p) => p.kind,
464
+ }),
465
+ }, zones: {
466
+ areas: Schematic.zones(areas, {
467
+ name: "Area", icon: "vector-square", x: "x", y: "y", width: "w", height: "h", label: "name", layer: "system",
468
+ pattern: (a) => a.kind.match({
469
+ room: (_$2) => Schematic.outline(),
470
+ cold: (_$2) => Schematic.hatch({ tone: "brand" }),
471
+ hot: (_$2) => Schematic.hatch({ tone: "warning" }),
472
+ }),
473
+ }),
474
+ }, links: {
475
+ fibre: Schematic.links(fibre, {
476
+ name: "Fibre run", icon: "bolt", layer: "system", via: "path",
477
+ from: { field: "from", of: { rack: "racks", frame: "network" } },
478
+ to: { field: "to", of: { rack: "racks", frame: "network" } },
479
+ label: (f) => f.label, metric: (f) => f.speed,
480
+ style: (f) => f.cable.match({ fibre: (_$2) => Schematic.solid(), logical: (_$2) => Schematic.dashed() }),
481
+ templates: Schematic.templates(fibreTemplates.read(), {
482
+ name: (t) => t.name, group: (t) => some(t.system), values: (t) => t.values, source: "fibreTemplates",
483
+ }),
484
+ }),
485
+ }, nets: {
486
+ feeds: Schematic.nets(feeds, {
487
+ name: "Power feed", icon: "plug-circle-bolt", layer: "system",
488
+ sources: { field: "supply", of: "pdus" }, destinations: { field: "racks", of: "racks" },
489
+ label: (f) => some(f.label), metric: (f) => some(f.load),
490
+ }),
491
+ // A Shift-connect from racks to a frame grows its first run into a trunk of them.
492
+ trunks: Schematic.nets(trunks, {
493
+ name: "Fibre trunk", icon: "diagram-project", layer: "system",
494
+ sources: { field: "racks", of: "racks" }, destinations: { field: "frames", of: "network" },
495
+ label: (t) => t.label,
496
+ }),
497
+ }, layers: Schematic.layers(systems.read(), {
498
+ label: (s) => s.label, color: (s) => some(s.colour), order: (s) => s.order, locked: (s) => s.fixed, opacity: (s) => s.dim,
499
+ }), library: [
500
+ Schematic.library.templates(),
501
+ Schematic.library.backlog(),
502
+ Schematic.library.index(),
503
+ Schematic.library.layers(),
504
+ // The floor's owners: a card dropped on a rack — its patch is over a rack's row — makes it the rack's owner.
505
+ Schematic.library.tab(owners.read(), {
506
+ name: "Owners", icon: "building", label: (o) => o.name, meta: (o) => some(o.contact),
507
+ drop: (o) => Schematic.patch(DcRack, { owner: o.name }),
508
+ }),
509
+ ] }) }));
510
+ } }))),
511
+ inputs: [],
512
+ });
513
+ // ----------------------------------------------------------------------------
514
+ // Conflicts: your edits meeting someone else's save
515
+ // ----------------------------------------------------------------------------
516
+ /** The racks the conflicts example edits, in a record of their own, so no other example's edits meet them. */
517
+ export const schematicConflictRacks = e3.record("schematic_conflict_racks", DictType(StringType, FloorRack), {
518
+ initial: new Map([
519
+ ["A01", { name: "A01", x: 2.4, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 5.2, capacity: 8.0 }],
520
+ ["A02", { name: "A02", x: 6.0, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 7.4, capacity: 8.0 }],
521
+ ["A03", { name: "A03", x: 9.6, y: 2.9, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 3.9, capacity: 8.0 }],
522
+ ["B01", { name: "B01", x: 2.4, y: 8.6, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 6.1, capacity: 8.0 }],
523
+ ["B02", { name: "B02", x: 6.0, y: 8.6, w: 3.2, h: 1.2, model: "42U · 8 kW", kw: 2.8, capacity: 8.0 }],
524
+ ]),
525
+ mutations: (mutation) => ({
526
+ // The racks' patch door — every Save commits through it.
527
+ patch: mutation.patch(),
528
+ // Someone else's save: every rack half a metre to the right, its other fields as they were.
529
+ elsewhere: mutation.reduce(East.function([DictType(StringType, FloorRack)], DictType(StringType, FloorRack), (_$, racks) => racks.map((_$2, rack) => ({
530
+ name: rack.name, x: rack.x.add(0.5), y: rack.y, w: rack.w, h: rack.h, model: rack.model, kw: rack.kw, capacity: rack.capacity,
531
+ })))),
532
+ }),
533
+ });
534
+ /**
535
+ * Your edits meeting someone else's save, in one window: edit, then press
536
+ * Someone else saves, which saves another person's change to the same racks —
537
+ * every rack half a metre to the right. A rack you moved sideways too is a
538
+ * conflict, waiting for you to choose; a rack you moved only up or down, or
539
+ * whose fields you changed in the panel, combines with theirs. Each press
540
+ * saves their change again.
541
+ */
542
+ export const schematicConflicts = example({
543
+ keywords: ["Schematic", "conflict", "conflicts", "combine", "someone else", "Choose", "Move", "Schematic.items", "Record.bind", "mutate", "Button", "inspector", "Save"],
544
+ description: "Your edits meeting someone else's save, in one window — move a rack sideways, then press Someone else saves, which saves another person's change to the same racks (every rack half a metre to the right), so yours conflict and wait to be chosen; a rack moved only up or down, or a field changed in the panel, combines with theirs",
545
+ fn: East.function([], UIComponentType, (_$) => (_jsx(Reactive, { children: $ => {
546
+ const racks = $.let(Record.bind(schematicConflictRacks, ["patch"]));
547
+ const others = $.let(Record.bind(schematicConflictRacks, ["elsewhere"]));
548
+ const theirs = $.const(East.function([], NullType, ($) => { $(others.mutate.elsewhere()); }));
549
+ 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 rack half a metre to the right" })] }), _jsx(Box, { height: "440px", children: _jsx(Schematic, { id: "conflicts", extent: { width: 18, height: 12 }, scaleUnit: "m", items: {
550
+ racks: Schematic.items(racks, {
551
+ name: "Rack", icon: "server", x: "x", y: "y", width: "w", height: "h", label: "name",
552
+ sublabel: (r) => r.model,
553
+ meter: (r) => ({ value: r.kw, max: r.capacity }),
554
+ }),
555
+ }, inspector: true }) })] }));
556
+ } }))),
557
+ inputs: [],
558
+ });
559
+ //# sourceMappingURL=schematic.examples.js.map