@elaraai/e3-ui 1.0.94 → 1.0.95

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 (303) hide show
  1. package/dist/src/allocation/adapters.d.ts +159 -0
  2. package/dist/src/allocation/adapters.d.ts.map +1 -0
  3. package/dist/src/allocation/adapters.js +241 -0
  4. package/dist/src/allocation/adapters.js.map +1 -0
  5. package/dist/src/allocation/functions.d.ts +664 -0
  6. package/dist/src/allocation/functions.d.ts.map +1 -0
  7. package/dist/src/allocation/functions.js +782 -0
  8. package/dist/src/allocation/functions.js.map +1 -0
  9. package/dist/src/allocation/index.d.ts +2985 -0
  10. package/dist/src/allocation/index.d.ts.map +1 -0
  11. package/dist/src/allocation/index.js +499 -0
  12. package/dist/src/allocation/index.js.map +1 -0
  13. package/dist/src/allocation/types.d.ts +832 -0
  14. package/dist/src/allocation/types.d.ts.map +1 -0
  15. package/dist/src/allocation/types.js +360 -0
  16. package/dist/src/allocation/types.js.map +1 -0
  17. package/dist/src/bind/func.d.ts +14 -0
  18. package/dist/src/bind/func.d.ts.map +1 -1
  19. package/dist/src/bind/func.js +22 -1
  20. package/dist/src/bind/func.js.map +1 -1
  21. package/dist/src/calendar/index.d.ts +510 -1639
  22. package/dist/src/calendar/index.d.ts.map +1 -1
  23. package/dist/src/calendar/index.js +56 -29
  24. package/dist/src/calendar/index.js.map +1 -1
  25. package/dist/src/flowchart/canvas.d.ts +9 -21
  26. package/dist/src/flowchart/canvas.d.ts.map +1 -1
  27. package/dist/src/flowchart/canvas.js +10 -22
  28. package/dist/src/flowchart/canvas.js.map +1 -1
  29. package/dist/src/flowchart/flowchart.d.ts +19 -13
  30. package/dist/src/flowchart/flowchart.d.ts.map +1 -1
  31. package/dist/src/flowchart/flowchart.js.map +1 -1
  32. package/dist/src/flowchart/index.d.ts +44 -21
  33. package/dist/src/flowchart/index.d.ts.map +1 -1
  34. package/dist/src/flowchart/index.js +43 -20
  35. package/dist/src/flowchart/index.js.map +1 -1
  36. package/dist/src/flowchart/library.d.ts +166 -81
  37. package/dist/src/flowchart/library.d.ts.map +1 -1
  38. package/dist/src/flowchart/library.js +232 -105
  39. package/dist/src/flowchart/library.js.map +1 -1
  40. package/dist/src/flowchart/over.d.ts +9 -16
  41. package/dist/src/flowchart/over.d.ts.map +1 -1
  42. package/dist/src/flowchart/over.js +9 -16
  43. package/dist/src/flowchart/over.js.map +1 -1
  44. package/dist/src/flowchart/payload.d.ts +710 -508
  45. package/dist/src/flowchart/payload.d.ts.map +1 -1
  46. package/dist/src/flowchart/payload.js +128 -74
  47. package/dist/src/flowchart/payload.js.map +1 -1
  48. package/dist/src/flowchart/window.d.ts +132 -347
  49. package/dist/src/flowchart/window.d.ts.map +1 -1
  50. package/dist/src/flowchart/window.js +48 -55
  51. package/dist/src/flowchart/window.js.map +1 -1
  52. package/dist/src/index.d.ts +11 -7
  53. package/dist/src/index.d.ts.map +1 -1
  54. package/dist/src/index.js +14 -6
  55. package/dist/src/index.js.map +1 -1
  56. package/dist/src/internal.d.ts +18 -7
  57. package/dist/src/internal.d.ts.map +1 -1
  58. package/dist/src/internal.js +28 -9
  59. package/dist/src/internal.js.map +1 -1
  60. package/dist/src/plan/event-rows.d.ts +26 -10
  61. package/dist/src/plan/event-rows.d.ts.map +1 -1
  62. package/dist/src/plan/event-rows.js +39 -13
  63. package/dist/src/plan/event-rows.js.map +1 -1
  64. package/dist/src/plan/ir.d.ts +244 -815
  65. package/dist/src/plan/ir.d.ts.map +1 -1
  66. package/dist/src/plan/ir.js +8 -6
  67. package/dist/src/plan/ir.js.map +1 -1
  68. package/dist/src/plan/library.d.ts +3 -0
  69. package/dist/src/plan/library.d.ts.map +1 -1
  70. package/dist/src/plan/library.js +1 -1
  71. package/dist/src/plan/library.js.map +1 -1
  72. package/dist/src/plan/ordered-source.d.ts +1 -0
  73. package/dist/src/plan/ordered-source.d.ts.map +1 -1
  74. package/dist/src/plan/plan.d.ts +559 -1667
  75. package/dist/src/plan/plan.d.ts.map +1 -1
  76. package/dist/src/plan/plan.js +123 -45
  77. package/dist/src/plan/plan.js.map +1 -1
  78. package/dist/src/plan/root.d.ts +16 -20
  79. package/dist/src/plan/root.d.ts.map +1 -1
  80. package/dist/src/plan/root.js +23 -33
  81. package/dist/src/plan/root.js.map +1 -1
  82. package/dist/src/roster/coverage.d.ts +17 -231
  83. package/dist/src/roster/coverage.d.ts.map +1 -1
  84. package/dist/src/roster/coverage.js +94 -90
  85. package/dist/src/roster/coverage.js.map +1 -1
  86. package/dist/src/roster/fit.d.ts +59 -0
  87. package/dist/src/roster/fit.d.ts.map +1 -0
  88. package/dist/src/roster/fit.js +155 -0
  89. package/dist/src/roster/fit.js.map +1 -0
  90. package/dist/src/roster/index.d.ts +2862 -3662
  91. package/dist/src/roster/index.d.ts.map +1 -1
  92. package/dist/src/roster/index.js +383 -81
  93. package/dist/src/roster/index.js.map +1 -1
  94. package/dist/src/roster/library.d.ts +37 -92
  95. package/dist/src/roster/library.d.ts.map +1 -1
  96. package/dist/src/roster/library.js +25 -64
  97. package/dist/src/roster/library.js.map +1 -1
  98. package/dist/src/roster/lists.d.ts +195 -0
  99. package/dist/src/roster/lists.d.ts.map +1 -0
  100. package/dist/src/roster/lists.js +233 -0
  101. package/dist/src/roster/lists.js.map +1 -0
  102. package/dist/src/roster/rules.d.ts +17 -260
  103. package/dist/src/roster/rules.d.ts.map +1 -1
  104. package/dist/src/roster/rules.js +135 -132
  105. package/dist/src/roster/rules.js.map +1 -1
  106. package/dist/src/roster/targets.d.ts +115 -0
  107. package/dist/src/roster/targets.d.ts.map +1 -0
  108. package/dist/src/roster/targets.js +213 -0
  109. package/dist/src/roster/targets.js.map +1 -0
  110. package/dist/src/roster/times.d.ts +251 -0
  111. package/dist/src/roster/times.d.ts.map +1 -0
  112. package/dist/src/roster/times.js +174 -0
  113. package/dist/src/roster/times.js.map +1 -0
  114. package/dist/src/roster/types.d.ts +828 -183
  115. package/dist/src/roster/types.d.ts.map +1 -1
  116. package/dist/src/roster/types.js +224 -97
  117. package/dist/src/roster/types.js.map +1 -1
  118. package/dist/src/schedule/accessor.d.ts +28 -0
  119. package/dist/src/schedule/accessor.d.ts.map +1 -0
  120. package/dist/src/schedule/accessor.js +39 -0
  121. package/dist/src/schedule/accessor.js.map +1 -0
  122. package/dist/src/schedule/events.d.ts +170 -42
  123. package/dist/src/schedule/events.d.ts.map +1 -1
  124. package/dist/src/schedule/events.js +431 -171
  125. package/dist/src/schedule/events.js.map +1 -1
  126. package/dist/src/schedule/index.d.ts +41 -4
  127. package/dist/src/schedule/index.d.ts.map +1 -1
  128. package/dist/src/schedule/index.js +35 -3
  129. package/dist/src/schedule/index.js.map +1 -1
  130. package/dist/src/schedule/library.d.ts +13 -3
  131. package/dist/src/schedule/library.d.ts.map +1 -1
  132. package/dist/src/schedule/library.js +11 -4
  133. package/dist/src/schedule/library.js.map +1 -1
  134. package/dist/src/schedule/periods.d.ts +115 -0
  135. package/dist/src/schedule/periods.d.ts.map +1 -0
  136. package/dist/src/schedule/periods.js +215 -0
  137. package/dist/src/schedule/periods.js.map +1 -0
  138. package/dist/src/schedule/record-window.d.ts +25 -3
  139. package/dist/src/schedule/record-window.d.ts.map +1 -1
  140. package/dist/src/schedule/record-window.js +31 -18
  141. package/dist/src/schedule/record-window.js.map +1 -1
  142. package/dist/src/schedule/resources.d.ts +82 -4
  143. package/dist/src/schedule/resources.d.ts.map +1 -1
  144. package/dist/src/schedule/resources.js +44 -14
  145. package/dist/src/schedule/resources.js.map +1 -1
  146. package/dist/src/schedule/session.d.ts +69 -0
  147. package/dist/src/schedule/session.d.ts.map +1 -0
  148. package/dist/src/schedule/session.js +121 -0
  149. package/dist/src/schedule/session.js.map +1 -0
  150. package/dist/src/schedule/templates.d.ts +14 -2
  151. package/dist/src/schedule/templates.d.ts.map +1 -1
  152. package/dist/src/schedule/templates.js +5 -3
  153. package/dist/src/schedule/templates.js.map +1 -1
  154. package/dist/src/schedule/types.d.ts +1671 -37
  155. package/dist/src/schedule/types.d.ts.map +1 -1
  156. package/dist/src/schedule/types.js +196 -5
  157. package/dist/src/schedule/types.js.map +1 -1
  158. package/dist/src/schedule/window.d.ts +14 -0
  159. package/dist/src/schedule/window.d.ts.map +1 -1
  160. package/dist/src/schedule/window.js +14 -4
  161. package/dist/src/schedule/window.js.map +1 -1
  162. package/dist/src/schedule/words.d.ts +22 -0
  163. package/dist/src/schedule/words.d.ts.map +1 -0
  164. package/dist/src/schedule/words.js +25 -0
  165. package/dist/src/schedule/words.js.map +1 -0
  166. package/dist/src/sheet/index.d.ts +61 -27
  167. package/dist/src/sheet/index.d.ts.map +1 -1
  168. package/dist/src/sheet/index.js +59 -25
  169. package/dist/src/sheet/index.js.map +1 -1
  170. package/dist/src/sheet/library.d.ts +21 -3
  171. package/dist/src/sheet/library.d.ts.map +1 -1
  172. package/dist/src/sheet/library.js +23 -6
  173. package/dist/src/sheet/library.js.map +1 -1
  174. package/dist/src/sheet/registers.d.ts +100 -85
  175. package/dist/src/sheet/registers.d.ts.map +1 -1
  176. package/dist/src/sheet/registers.js +100 -85
  177. package/dist/src/sheet/registers.js.map +1 -1
  178. package/dist/src/sheet/root.d.ts +8 -12
  179. package/dist/src/sheet/root.d.ts.map +1 -1
  180. package/dist/src/sheet/root.js +6 -40
  181. package/dist/src/sheet/root.js.map +1 -1
  182. package/dist/src/sheet/sheet.d.ts +598 -2349
  183. package/dist/src/sheet/sheet.d.ts.map +1 -1
  184. package/dist/src/sheet/sheet.js +124 -37
  185. package/dist/src/sheet/sheet.js.map +1 -1
  186. package/dist/src/sheet/sub-rows.d.ts +74 -28
  187. package/dist/src/sheet/sub-rows.d.ts.map +1 -1
  188. package/dist/src/sheet/sub-rows.js +74 -28
  189. package/dist/src/sheet/sub-rows.js.map +1 -1
  190. package/dist/src/sheet/templates.d.ts +98 -34
  191. package/dist/src/sheet/templates.d.ts.map +1 -1
  192. package/dist/src/sheet/templates.js +102 -58
  193. package/dist/src/sheet/templates.js.map +1 -1
  194. package/dist/src/sheet/types.d.ts +289 -1359
  195. package/dist/src/sheet/types.d.ts.map +1 -1
  196. package/dist/src/sheet/types.js +20 -26
  197. package/dist/src/sheet/types.js.map +1 -1
  198. package/dist/src/sheet/views.d.ts +10 -11
  199. package/dist/src/sheet/views.d.ts.map +1 -1
  200. package/dist/src/sheet/views.js +15 -20
  201. package/dist/src/sheet/views.js.map +1 -1
  202. package/dist/src/{roster/visibility.d.ts → utils/key-visibility.d.ts} +42 -7
  203. package/dist/src/utils/key-visibility.d.ts.map +1 -0
  204. package/dist/src/utils/key-visibility.js +36 -0
  205. package/dist/src/utils/key-visibility.js.map +1 -0
  206. package/dist/src/utils/ordered-source.d.ts +1 -0
  207. package/dist/src/utils/ordered-source.d.ts.map +1 -1
  208. package/dist/src/utils/ordered-source.js +8 -3
  209. package/dist/src/utils/ordered-source.js.map +1 -1
  210. package/dist/src/utils/record-sources.d.ts +107 -0
  211. package/dist/src/utils/record-sources.d.ts.map +1 -0
  212. package/dist/src/utils/record-sources.js +132 -0
  213. package/dist/src/utils/record-sources.js.map +1 -0
  214. package/dist/test/allocation/allocation.examples.d.ts +2902 -0
  215. package/dist/test/allocation/allocation.examples.d.ts.map +1 -0
  216. package/dist/test/allocation/allocation.examples.js +643 -0
  217. package/dist/test/allocation/allocation.examples.js.map +1 -0
  218. package/dist/test/allocation/fit.examples.d.ts +546 -0
  219. package/dist/test/allocation/fit.examples.d.ts.map +1 -0
  220. package/dist/test/allocation/fit.examples.js +171 -0
  221. package/dist/test/allocation/fit.examples.js.map +1 -0
  222. package/dist/test/allocation/kiln-yard.d.ts +181 -0
  223. package/dist/test/allocation/kiln-yard.d.ts.map +1 -0
  224. package/dist/test/allocation/kiln-yard.js +228 -0
  225. package/dist/test/allocation/kiln-yard.js.map +1 -0
  226. package/dist/test/bind/data/data.examples.d.ts +651 -1
  227. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  228. package/dist/test/bind/data/data.examples.js +140 -2
  229. package/dist/test/bind/data/data.examples.js.map +1 -1
  230. package/dist/test/bind/func/func.examples.d.ts +10 -1
  231. package/dist/test/bind/func/func.examples.d.ts.map +1 -1
  232. package/dist/test/bind/func/func.examples.js +8 -1
  233. package/dist/test/bind/func/func.examples.js.map +1 -1
  234. package/dist/test/bind/record/record.examples.d.ts +633 -1
  235. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  236. package/dist/test/bind/record/record.examples.js +26 -2
  237. package/dist/test/bind/record/record.examples.js.map +1 -1
  238. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -1
  239. package/dist/test/calendar/calendar-records.examples.js +18 -14
  240. package/dist/test/calendar/calendar-records.examples.js.map +1 -1
  241. package/dist/test/calendar/calendar.examples.d.ts +521 -16
  242. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  243. package/dist/test/calendar/calendar.examples.js +182 -135
  244. package/dist/test/calendar/calendar.examples.js.map +1 -1
  245. package/dist/test/examples-package.d.ts +75 -0
  246. package/dist/test/examples-package.d.ts.map +1 -0
  247. package/dist/test/examples-package.js +263 -0
  248. package/dist/test/examples-package.js.map +1 -0
  249. package/dist/test/flowchart/flowchart.examples.d.ts +211 -19
  250. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  251. package/dist/test/flowchart/flowchart.examples.js +102 -75
  252. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  253. package/dist/test/plan/plan-events.examples.d.ts +1439 -209
  254. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  255. package/dist/test/plan/plan-events.examples.js +199 -59
  256. package/dist/test/plan/plan-events.examples.js.map +1 -1
  257. package/dist/test/plan/plan-records.examples.d.ts +420 -0
  258. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  259. package/dist/test/plan/plan-records.examples.js +70 -19
  260. package/dist/test/plan/plan-records.examples.js.map +1 -1
  261. package/dist/test/plan/plan-windows.examples.d.ts +636 -55
  262. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -1
  263. package/dist/test/plan/plan-windows.examples.js +69 -33
  264. package/dist/test/plan/plan-windows.examples.js.map +1 -1
  265. package/dist/test/plan/plan.examples.d.ts +153 -31
  266. package/dist/test/plan/plan.examples.d.ts.map +1 -1
  267. package/dist/test/plan/plan.examples.js +178 -101
  268. package/dist/test/plan/plan.examples.js.map +1 -1
  269. package/dist/test/roster/domain.examples.d.ts +467 -250
  270. package/dist/test/roster/domain.examples.d.ts.map +1 -1
  271. package/dist/test/roster/domain.examples.js +92 -29
  272. package/dist/test/roster/domain.examples.js.map +1 -1
  273. package/dist/test/roster/roster-records.examples.d.ts +430 -586
  274. package/dist/test/roster/roster-records.examples.d.ts.map +1 -1
  275. package/dist/test/roster/roster-records.examples.js +102 -43
  276. package/dist/test/roster/roster-records.examples.js.map +1 -1
  277. package/dist/test/roster/roster.examples.d.ts +2319 -606
  278. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  279. package/dist/test/roster/roster.examples.js +456 -148
  280. package/dist/test/roster/roster.examples.js.map +1 -1
  281. package/dist/test/roster/warehouse.d.ts +172 -63
  282. package/dist/test/roster/warehouse.d.ts.map +1 -1
  283. package/dist/test/roster/warehouse.js +172 -39
  284. package/dist/test/roster/warehouse.js.map +1 -1
  285. package/dist/test/schedule/schedule.examples.d.ts +3499 -0
  286. package/dist/test/schedule/schedule.examples.d.ts.map +1 -0
  287. package/dist/test/schedule/schedule.examples.js +192 -0
  288. package/dist/test/schedule/schedule.examples.js.map +1 -0
  289. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -1
  290. package/dist/test/sheet/sheet-records.examples.js +22 -18
  291. package/dist/test/sheet/sheet-records.examples.js.map +1 -1
  292. package/dist/test/sheet/sheet.examples.d.ts +715 -26
  293. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  294. package/dist/test/sheet/sheet.examples.js +204 -130
  295. package/dist/test/sheet/sheet.examples.js.map +1 -1
  296. package/package.json +17 -10
  297. package/dist/src/roster/people.d.ts +0 -50
  298. package/dist/src/roster/people.d.ts.map +0 -1
  299. package/dist/src/roster/people.js +0 -32
  300. package/dist/src/roster/people.js.map +0 -1
  301. package/dist/src/roster/visibility.d.ts.map +0 -1
  302. package/dist/src/roster/visibility.js +0 -25
  303. package/dist/src/roster/visibility.js.map +0 -1
@@ -22,22 +22,31 @@
22
22
  * transition, a lane's header or a decision's diamond.
23
23
  *
24
24
  * Each data tab takes its own bound data (the user, 2026-10-08), apart from
25
- * the flows and from the other tabs: its rows are an `Array<T>` or a
26
- * `Dict<String, T>` the app binds — a value, or an expression such as a
27
- * binding's `read()` — read as `Sheet.library.tab` reads its rows: its
28
- * accessors `(row, key) => …` reified once into a describe function the rows'
29
- * map then calls, a Dict's key the second argument and an Array's index,
30
- * printed, in its place; a key that repeats keeps its first card. A card
31
- * crosses the closed payload as the fields its drop sets, typed by the row it
32
- * lands on — a flow's rows are the flowchart's own types. Dropped on the
33
- * canvas (#1249), a state template adds a state where it lands on a lane, a
34
- * transition template retypes the transition it lands on, and an author's card
35
- * sets its fields on what its drop's type names; ⏎ on a card drops it on the
36
- * canvas's selection.
25
+ * the flows and from the other tabs, read as `Sheet.library.tab` reads its
26
+ * rows: its accessors `(row, key) => …` reified once into a describe function
27
+ * the rows' map then calls, a Dict's key the second argument and an Array's
28
+ * index, printed, in its place. A card crosses the closed payload as the
29
+ * fields its drop sets, typed by the row it lands on — a flow's rows are the
30
+ * flowchart's own types. Dropped on the canvas (#1249), a state template adds
31
+ * a state where it lands on a lane, a transition template retypes the
32
+ * transition it lands on, and an author's card sets its fields on what its
33
+ * drop's type names; ⏎ on a card drops it on the canvas's selection.
34
+ *
35
+ * Templates are records (#1340, ruling 9): the state and the transition
36
+ * templates are each a record of their own, read whole
37
+ * (`Data.bind(record).read()`, a `Dict<String, T>`), each card keyed by its
38
+ * record's key, and each list names its `source` of the flowchart's one
39
+ * `Slice.bindRecords`, which narrows its cards by those keys as it narrows
40
+ * anything of that record's — a list written in the code names none, and is
41
+ * refused, naming the change (#1346). An author's tab reads an `Array<T>` or
42
+ * a `Dict<String, T>`, each card keyed by its `key`, a key that repeats
43
+ * keeping its first card; naming a `source` it follows that source by its
44
+ * cards' keys, and naming none it lists its rows whole.
37
45
  *
38
46
  * @packageDocumentation
39
47
  */
40
48
  import { ArrayType, DictType, East, Expr, NullType, OptionType, SetType, StringType, StructType, VariantType, isTypeEqual, none, printType, some, variant, } from "@elaraai/east";
49
+ import { tabSource, templatesSource } from "../utils/record-sources.js";
41
50
  import { FlowchartPatchTypeFor } from "./patch.js";
42
51
  import { FlowchartLaneType, FlowchartLinkType, FlowchartStateType, FlowchartTriggerType } from "./types.js";
43
52
  // ============================================================================
@@ -113,16 +122,16 @@ export const FlowchartLandsType = VariantType({
113
122
  * tab's name is the author's when given; left out, the renderer names it in
114
123
  * its words (`States`, `Transitions`), so a host translates it.
115
124
  *
116
- * @property flows - Every flow in the record; a click opens one
117
- * @property states - State templates from the tab's own rows: its name, its icon and its cards
118
- * @property transitions - Transition templates from the tab's own rows: its name, its icon and its cards
119
- * @property tab - The author's own cards: its name, its icon, and its cards by what they land on
125
+ * @property flows - Every flow in the record — over a slice, those its `flows` source narrows them to; a click opens one
126
+ * @property states - State templates from the tab's own record: its name, its icon, its cards, and the source of the slice they follow, by their keys (#1346)
127
+ * @property transitions - Transition templates from the tab's own record: its name, its icon, its cards, and the source of the slice they follow, by their keys (#1346)
128
+ * @property tab - The author's own cards: its name, its icon, its cards by what they land on, and the source of the slice they follow, by their keys — none, its cards whole (#1346)
120
129
  */
121
130
  export const FlowchartLibraryTabType = VariantType({
122
131
  flows: NullType,
123
- states: StructType({ name: OptionType(StringType), icon: OptionType(StringType), cards: ArrayType(FlowchartStateCardType) }),
124
- transitions: StructType({ name: OptionType(StringType), icon: OptionType(StringType), cards: ArrayType(FlowchartTransitionCardType) }),
125
- tab: StructType({ name: StringType, icon: OptionType(StringType), lands: FlowchartLandsType }),
132
+ states: StructType({ name: OptionType(StringType), icon: OptionType(StringType), cards: ArrayType(FlowchartStateCardType), source: StringType }),
133
+ transitions: StructType({ name: OptionType(StringType), icon: OptionType(StringType), cards: ArrayType(FlowchartTransitionCardType), source: StringType }),
134
+ tab: StructType({ name: StringType, icon: OptionType(StringType), lands: FlowchartLandsType, source: OptionType(StringType) }),
126
135
  });
127
136
  /**
128
137
  * The Flows tab — `Flowchart.library.flows()` (FB13, FB14): every flow the
@@ -197,33 +206,35 @@ export function libraryFlows() {
197
206
  }
198
207
  /**
199
208
  * The state templates — `Flowchart.library.states(rows, { … })` (FB26,
200
- * decisions 6 and 7): one card per row of the tab's own rows — its label, the
201
- * line under it, the tab's icon — grouped by its `group` and searched by its
202
- * key, label and line. Each card is a drag source, and a click selects it, a
203
- * click on the selected card letting it go. A card dropped on a lane adds a
204
- * state there, seeded with the fields its `drop` sets over a state's defaults
205
- * (#1249).
209
+ * decisions 6 and 7): one card per row of the tab's own templates record —
210
+ * its label, the line under it, the tab's icon — grouped by its `group` and
211
+ * searched by its key, label and line. Each card is a drag source, and a click
212
+ * selects it, a click on the selected card letting it go. A card dropped on a
213
+ * lane adds a state there, seeded with the fields its `drop` sets over a
214
+ * state's defaults (#1249).
206
215
  *
207
216
  * @remarks
208
- * The rows are the app's own — an input or a record the app binds, apart from
209
- * the flows and from the other tabs — read as `Sheet.library.tab` reads its
210
- * rows: an `Array<T>` or a `Dict<String, T>`, each accessor taking a row and
211
- * its key, a Dict's key or an Array's index, printed. A key that repeats keeps
212
- * its first card. Left out, the tab's name is `States`, in the flowchart's
213
- * words. Refused when the surface is built: rows that are neither an Array
214
- * nor a `Dict<String, T>`, a `drop` over another type than
215
- * `Flowchart.Types.State`, and the tab listed twice.
217
+ * Templates are records (#1340, ruling 9): the rows are a templates record's,
218
+ * read whole — `Data.bind(record).read()`, a `Dict<String, T>` — apart from
219
+ * the flows and from the other tabs, each accessor taking a row and its key.
220
+ * A card's key is its record's key, and the tab follows `source`, the
221
+ * flowchart's slice's source over that record, by it (#1346). Left out, the
222
+ * tab's name is `States`, in the flowchart's words. Refused when the surface
223
+ * is built: a list naming no source — one written in the code — or one the
224
+ * slice lacks, or `flows`; rows that are no `Dict<String, T>`; a `key`, which
225
+ * the record's keys are; a `drop` over another type than
226
+ * `Flowchart.Types.State`; and the tab listed twice.
216
227
  *
217
228
  * @typeParam T - The rows' element type
218
- * @param rows - The rows — an `Array<T>` or a `Dict<String, T>` value or expression, such as a binding's `read()`
219
- * @param config - The tab's name and icon, what each card shows, and its `drop` ({@link FlowchartStatesConfig})
229
+ * @param rows - The templates record's rows — a `Dict<String, T>` expression, its binding's `read()`
230
+ * @param config - The tab's name and icon, what each card shows, its `drop` and its `source` ({@link FlowchartStatesConfig})
220
231
  * @returns The tab
221
232
  *
222
233
  * @example
223
234
  * ```tsx
224
235
  * // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
225
- * import { ArrayType, DictType, East, IntegerType, OptionType, StringType, StructType, none, some, variant } from "@elaraai/east";
226
- * import { Box, Reactive, UIComponentType } from "@elaraai/east-ui";
236
+ * import { DictType, East, IntegerType, OptionType, StringType, StructType, none, some, variant } from "@elaraai/east";
237
+ * import { Box, Reactive, Slice, UIComponentType } from "@elaraai/east-ui";
227
238
  * import { Data, Flowchart, Record } from "@elaraai/e3-ui";
228
239
  * import e3 from "@elaraai/e3";
229
240
  *
@@ -257,57 +268,71 @@ export function libraryFlows() {
257
268
  * },
258
269
  * }));
259
270
  * export const depotFlowsPatch = e3.mutation.patch(depotFlows);
260
- * export const StepTemplate = StructType({ code: StringType, name: StringType, kind: StringType, slots: OptionType(IntegerType) });
261
- * export const stepTemplates = e3.input("flowchart_step_templates", ArrayType(StepTemplate), variant("value", [
262
- * { code: "ARV", name: "Arrived", kind: "Intake", slots: none },
263
- * { code: "SCN", name: "Scanned", kind: "Intake", slots: none },
264
- * { code: "CH*", name: "Sort chutes", kind: "Sort", slots: some(12n) },
265
- * { code: "HLD", name: "Held", kind: "Hold", slots: none },
266
- * { code: "LDD", name: "Loaded", kind: "Load", slots: none },
271
+ * export const StepTemplate = StructType({ name: StringType, kind: StringType, slots: OptionType(IntegerType) });
272
+ * export const stepTemplates = e3.record("flowchart_step_templates", DictType(StringType, StepTemplate), new Map([
273
+ * ["ARV", { name: "Arrived", kind: "Intake", slots: none }],
274
+ * ["SCN", { name: "Scanned", kind: "Intake", slots: none }],
275
+ * ["CH*", { name: "Sort chutes", kind: "Sort", slots: some(12n) }],
276
+ * ["HLD", { name: "Held", kind: "Hold", slots: none }],
277
+ * ["LDD", { name: "Loaded", kind: "Load", slots: none }],
267
278
  * ]));
279
+ * export const stepsByKind = e3.recordIndex("flowchart_steps_by_kind", stepTemplates, { on: ["kind"] });
268
280
  * export const MoveTemplate = StructType({ kind: Flowchart.Types.Kind, decision: OptionType(StringType), note: StringType });
269
281
  * export const moveTemplates = e3.record("flowchart_move_templates", DictType(StringType, MoveTemplate), new Map([
270
282
  * ["Observed", { kind: variant("observed", null), decision: none, note: "Mined from the scans" }],
271
283
  * ["Planned", { kind: variant("planned", null), decision: none, note: "The designed path" }],
272
284
  * ["Routed", { kind: variant("planned", null), decision: some("route"), note: "Governed by the route decision" }],
273
285
  * ]));
274
- * export const DecisionOwner = StructType({ role: StringType, name: StringType, desk: StringType });
275
- * export const decisionOwners = e3.input("flowchart_decision_owners", ArrayType(DecisionOwner), variant("value", [
276
- * { role: "sort-planner", name: "Sort planner", desk: "Sort hall" },
277
- * { role: "customs-desk", name: "Customs desk", desk: "Hold bay" },
286
+ * export const movesByKind = e3.recordIndex("flowchart_moves_by_kind", moveTemplates, { on: ["kind"] });
287
+ * export const DecisionOwner = StructType({ name: StringType, desk: StringType });
288
+ * export const decisionOwners = e3.record("flowchart_decision_owners", DictType(StringType, DecisionOwner), new Map([
289
+ * ["sort-planner", { name: "Sort planner", desk: "Sort hall" }],
290
+ * ["customs-desk", { name: "Customs desk", desk: "Hold bay" }],
278
291
  * ]));
292
+ * export const ownersByDesk = e3.recordIndex("flowchart_owners_by_desk", decisionOwners, { on: ["desk"] });
279
293
  *
280
294
  * const flowchart = East.function([], UIComponentType, (_$) => (
281
295
  * <Reactive>{$ => {
282
296
  * const flows = $.let(Record.bind(depotFlows, [depotFlowsPatch]));
297
+ * // What a tab reads whole binds with Data.bind, which keeps it loaded beside its pages.
283
298
  * const steps = $.let(Data.bind(stepTemplates));
284
- * const moves = $.let(Record.bind(moveTemplates, []));
299
+ * const moves = $.let(Data.bind(moveTemplates));
285
300
  * const owners = $.let(Data.bind(decisionOwners));
301
+ * // One rail over the library's records, a source each (#1346): each tab follows the source it names.
302
+ * const slice = $.let(Slice.bindRecords("flowchart.depot", {
303
+ * steps: { source: Data.bindPaged(stepTemplates, { indexes: [stepsByKind] }), label: "Steps", icon: { prefix: "fas", name: "box" },
304
+ * fields: { kind: { label: "Step kind", hints: ["Intake", "Sort", "Hold", "Load"] } } },
305
+ * moves: { source: Data.bindPaged(moveTemplates, { indexes: [movesByKind] }), label: "Transitions", icon: { prefix: "fas", name: "arrow-right" },
306
+ * fields: { kind: { label: "Transition kind" } } },
307
+ * owners: { source: Data.bindPaged(decisionOwners, { indexes: [ownersByDesk] }), label: "Owners", icon: { prefix: "fas", name: "user-tie" },
308
+ * fields: { desk: { label: "Desk", hints: ["Sort hall", "Hold bay"] } } },
309
+ * }));
286
310
  * return (
287
311
  * <Box height="560px">
288
312
  * <Flowchart
289
313
  * record={flows}
290
314
  * flow="Inbound parcels"
291
315
  * name="depot"
316
+ * slice={{ slice }}
292
317
  * library={[
293
318
  * Flowchart.library.flows(),
294
- * // Step types, an input's rows: a card dropped on a lane adds a state seeded with what its drop sets.
319
+ * // Step types, a templates record by code: a card dropped on a lane adds a state seeded with what its drop sets.
295
320
  * Flowchart.library.states(steps.read(), {
296
- * name: "Steps", icon: "box",
297
- * key: s => s.code, label: s => s.name, meta: s => some(s.code), group: s => s.kind,
298
- * drop: s => Flowchart.patch(Flowchart.Types.State, { key: s.code, label: some(s.name), members: s.slots }),
321
+ * name: "Steps", icon: "box", source: "steps",
322
+ * label: s => s.name, meta: (_s, code) => some(code), group: s => s.kind,
323
+ * drop: (s, code) => Flowchart.patch(Flowchart.Types.State, { key: code, label: some(s.name), members: s.slots }),
299
324
  * }),
300
- * // Transition types, a record's rows by name: a card dropped on a transition retypes it.
325
+ * // Transition types, a templates record by name: a card dropped on a transition retypes it.
301
326
  * Flowchart.library.transitions(moves.read(), {
302
- * icon: "arrow-right",
303
- * key: (_m, name) => name, label: (_m, name) => name, meta: m => some(m.note),
327
+ * icon: "arrow-right", source: "moves",
328
+ * label: (_m, name) => name, meta: m => some(m.note),
304
329
  * drop: m => Flowchart.patch(Flowchart.Types.Link, { kind: some(m.kind), trigger: m.decision }),
305
330
  * }),
306
- * // The author's own cards: a role dropped on a decision owns it.
331
+ * // The author's own cards, a record of roles: a role dropped on a decision owns it.
307
332
  * Flowchart.library.tab(owners.read(), {
308
- * name: "Owners", icon: "user-tie",
309
- * key: o => o.role, label: o => o.name, meta: o => some(o.desk),
310
- * drop: o => Flowchart.patch(Flowchart.Types.Trigger, { owner: some(o.role) }),
333
+ * name: "Owners", icon: "user-tie", source: "owners",
334
+ * key: (_o, role) => role, label: o => o.name, meta: o => some(o.desk),
335
+ * drop: (_o, role) => Flowchart.patch(Flowchart.Types.Trigger, { owner: some(role) }),
311
336
  * }),
312
337
  * ]}
313
338
  * />
@@ -329,17 +354,19 @@ export function libraryStates(rows, config) {
329
354
  * connection makes a transition of the default type, and a card retypes it.
330
355
  *
331
356
  * @remarks
332
- * The rows are read as {@link libraryStates}' are. Left out, the tab's name is
333
- * `Transitions`, in the flowchart's words. Refused when the surface is built:
334
- * rows that are neither an Array nor a `Dict<String, T>`, a `drop` over
335
- * another type than `Flowchart.Types.Link`, and the tab listed twice; and,
336
- * when the tab's cards are read, a card whose `drop` sets the transition's
337
- * `key`, `from` or `to` — the fields a patch sets are values its rows give,
338
- * which the build cannot see.
357
+ * The rows are a templates record's, read as {@link libraryStates}' are, each
358
+ * card keyed by its record's key, and the tab follows its `source` as theirs
359
+ * does. Left out, the tab's name is `Transitions`, in the flowchart's words.
360
+ * Refused when the surface is built: a list naming no source, or one the slice
361
+ * lacks, or `flows`; rows that are no `Dict<String, T>`; a `key`; a `drop`
362
+ * over another type than `Flowchart.Types.Link`; and the tab listed twice;
363
+ * and, when the tab's cards are read, a card whose `drop` sets the
364
+ * transition's `key`, `from` or `to` — the fields a patch sets are values its
365
+ * rows give, which the build cannot see.
339
366
  *
340
367
  * @typeParam T - The rows' element type
341
- * @param rows - The rows — an `Array<T>` or a `Dict<String, T>` value or expression, such as a binding's `read()`
342
- * @param config - The tab's name and icon, what each card shows, and its `drop` ({@link FlowchartTransitionsConfig})
368
+ * @param rows - The templates record's rows — a `Dict<String, T>` expression, its binding's `read()`
369
+ * @param config - The tab's name and icon, what each card shows, its `drop` and its `source` ({@link FlowchartTransitionsConfig})
343
370
  * @returns The tab
344
371
  */
345
372
  export function libraryTransitions(rows, config) {
@@ -354,15 +381,19 @@ export function libraryTransitions(rows, config) {
354
381
  * its fields there (#1249); without one, the cards are read, never dragged.
355
382
  *
356
383
  * @remarks
357
- * The rows are read as {@link libraryStates}' are. A tab's name is its
358
- * identity in `library`. Refused when the surface is built: rows that are
359
- * neither an Array nor a `Dict<String, T>`, a `drop` over none of a flow's
360
- * row types, and two tabs of one name.
384
+ * The rows are an `Array<T>` or a `Dict<String, T>` the app binds, each
385
+ * accessor taking a row and its key, a Dict's key or an Array's index,
386
+ * printed; a key that repeats keeps its first card. Naming a `source` of the
387
+ * flowchart's slice (#1346), the tab follows it by its cards' keys, each a
388
+ * row's key in that record; naming none, it lists its rows whole. A tab's
389
+ * name is its identity in `library`. Refused when the surface is built: rows
390
+ * that are neither an Array nor a `Dict<String, T>`; a `source` the slice
391
+ * lacks; a `drop` over none of a flow's row types; and two tabs of one name.
361
392
  *
362
393
  * @typeParam T - The rows' element type
363
394
  * @typeParam P - The patch `drop` returns
364
395
  * @param rows - The rows — an `Array<T>` or a `Dict<String, T>` value or expression, such as a binding's `read()`
365
- * @param config - The tab's name and icon, what each card shows, and its `drop` ({@link FlowchartTabConfig})
396
+ * @param config - The tab's name and icon, what each card shows, its `drop` and its `source` ({@link FlowchartTabConfig})
366
397
  * @returns The tab
367
398
  */
368
399
  export function libraryTab(rows, config) {
@@ -406,20 +437,42 @@ function tabName(tab) {
406
437
  return tab.kind === "tab" ? `the "${tab.config.name}" tab` : `Flowchart.library.${tab.kind}()`;
407
438
  }
408
439
  /**
409
- * A data tab's rows: an Array, or a Dict by String keys.
440
+ * A data tab's rows: a Dict by String keys — for a templates list, its
441
+ * templates record's, each card that record's row by its key (#1346) — or,
442
+ * for an author's tab, an Array too.
410
443
  *
411
444
  * @param tab - The tab
412
445
  * @returns The rows, as East reads them
413
- * @throws {Error} Naming the tab: rows that are neither an Array nor a `Dict<String, T>`
446
+ * @throws {Error} Naming the tab: rows that are neither an Array nor a `Dict<String, T>`, or a templates list's that are no `Dict<String, T>`
414
447
  */
415
448
  function rowsOf(tab) {
416
449
  const expr = East.value(tab.rows);
417
450
  const type = Expr.type(expr);
418
- if (type.type === "Array")
419
- return { expr, dict: false, row: type.value };
420
451
  if (type.type === "Dict" && type.key.type === "String")
421
452
  return { expr, dict: true, row: type.value };
422
- throw new Error(`Flowchart: ${tabName(tab)} reads its rows as an Array<T> or a Dict<String, T> — a value, or an expression such as a binding's read(), its own apart from the flows and the other tabs — and these are ${printType(type)}`);
453
+ // A templates list's rows are its templates record's.
454
+ const templates = tab.kind !== "tab";
455
+ if (type.type === "Array" && !templates)
456
+ return { expr, dict: false, row: type.value };
457
+ if (type.type === "Array") {
458
+ throw new Error(`Flowchart: ${tabName(tab)} lists templates, which are records — its rows are its templates record's, each card a row by its key: a Dict<String, T>, its binding's read() — and these are an Array`);
459
+ }
460
+ throw new Error(templates
461
+ ? `Flowchart: ${tabName(tab)} reads its rows as a Dict<String, T> — its templates record's, its binding's read(), its own apart from the flows and the other tabs — and these are ${printType(type)}`
462
+ : `Flowchart: ${tabName(tab)} reads its rows as an Array<T> or a Dict<String, T> — a value, or an expression such as a binding's read(), its own apart from the flows and the other tabs — and these are ${printType(type)}`);
463
+ }
464
+ /**
465
+ * A templates list's cards are its record's rows, each keyed by its record's
466
+ * key (#1346): a `key` given beside them — the accessor every list took
467
+ * before its rows were a record's — is refused, naming the change.
468
+ *
469
+ * @param tab - The templates list
470
+ * @throws {Error} Naming the list, when its config gives a `key`
471
+ */
472
+ function keyedByRecord(tab) {
473
+ if ("key" in tab.config) {
474
+ throw new Error(`Flowchart: ${tabName(tab)}'s cards are its templates record's rows, each keyed by the record's key, which its source follows — leave \`key\` out`);
475
+ }
423
476
  }
424
477
  /**
425
478
  * A data tab's drop, reified once over its rows' type: the function a card's
@@ -435,14 +488,15 @@ function dropOf(rows, drop) {
435
488
  * keeping its first card.
436
489
  *
437
490
  * @param rows - The tab's rows
438
- * @param config - What each card shows
491
+ * @param config - What each card shows, and — an author's tab's — its key; with none, each card's key is its row's
439
492
  * @param cardType - The cards' type
440
493
  * @param sets - What a card sets, from its row and its key, checked as it is read; `undefined` for cards that set nothing
441
494
  * @returns The cards, in the rows' order
442
495
  */
443
496
  function cardsOf(rows, config, cardType, sets) {
497
+ const keyOf = config.key;
444
498
  const describe = East.function([rows.row, StringType], cardType, ($, row, key) => {
445
- const card = $.let(config.key(row, key), StringType);
499
+ const card = $.let(keyOf === undefined ? key : keyOf(row, key), StringType);
446
500
  return {
447
501
  key: card,
448
502
  label: config.label(row, key),
@@ -464,14 +518,17 @@ function cardsOf(rows, config, cardType, sets) {
464
518
  return fold(list);
465
519
  }
466
520
  /**
467
- * The state templates on the wire: the tab's name and icon, and its cards,
468
- * each with the state its drop seeds.
521
+ * The state templates on the wire: the tab's name and icon, its cards, each
522
+ * with the state its drop seeds, and the source they follow.
469
523
  *
470
524
  * @param tab - The tab
525
+ * @param sources - The slice's sources
471
526
  * @returns The tab's wire value
472
- * @throws {Error} Naming the tab: rows that are neither an Array nor a `Dict<String, T>`, or a `drop` over another type than a state's patch
527
+ * @throws {Error} Naming the tab: a list naming no source of the slice, a `key`, rows that are no `Dict<String, T>`, or a `drop` over another type than a state's patch
473
528
  */
474
- function statesTab(tab) {
529
+ function statesTab(tab, sources) {
530
+ const source = templatesSource("Flowchart", TEMPLATES_CALL.states, tab.config.source, sources);
531
+ keyedByRecord(tab);
475
532
  const rows = rowsOf(tab);
476
533
  const drop = dropOf(rows, tab.config.drop);
477
534
  if (!isTypeEqual(drop.patch, FlowchartPatchTypeFor(FlowchartStateType))) {
@@ -486,18 +543,23 @@ function statesTab(tab) {
486
543
  name: tab.config.name === undefined ? none : some(tab.config.name),
487
544
  icon: tab.config.icon === undefined ? none : some(tab.config.icon),
488
545
  cards,
546
+ source,
489
547
  }), FlowchartLibraryTabType);
490
548
  }
491
549
  /**
492
- * The transition templates on the wire: the tab's name and icon, and its
493
- * cards, each with what it sets on the transition it lands on — refused, as
494
- * the card is read, when that is the transition's `key`, `from` or `to`.
550
+ * The transition templates on the wire: the tab's name and icon, its cards,
551
+ * each with what it sets on the transition it lands on — refused, as the card
552
+ * is read, when that is the transition's `key`, `from` or `to` — and the source
553
+ * they follow.
495
554
  *
496
555
  * @param tab - The tab
556
+ * @param sources - The slice's sources
497
557
  * @returns The tab's wire value
498
- * @throws {Error} Naming the tab: rows that are neither an Array nor a `Dict<String, T>`, or a `drop` over another type than a transition's patch
558
+ * @throws {Error} Naming the tab: a list naming no source of the slice, a `key`, rows that are no `Dict<String, T>`, or a `drop` over another type than a transition's patch
499
559
  */
500
- function transitionsTab(tab) {
560
+ function transitionsTab(tab, sources) {
561
+ const source = templatesSource("Flowchart", TEMPLATES_CALL.transitions, tab.config.source, sources);
562
+ keyedByRecord(tab);
501
563
  const rows = rowsOf(tab);
502
564
  const drop = dropOf(rows, tab.config.drop);
503
565
  if (!isTypeEqual(drop.patch, FlowchartPatchTypeFor(FlowchartLinkType))) {
@@ -519,18 +581,21 @@ function transitionsTab(tab) {
519
581
  name: tab.config.name === undefined ? none : some(tab.config.name),
520
582
  icon: tab.config.icon === undefined ? none : some(tab.config.icon),
521
583
  cards,
584
+ source,
522
585
  }), FlowchartLibraryTabType);
523
586
  }
524
587
  /**
525
- * An author's tab on the wire: its name and icon, and its cards by what they
526
- * land on — the row type of the patch its `drop` returns — or read, never
527
- * dragged, without one.
588
+ * An author's tab on the wire: its name and icon, its cards by what they land
589
+ * on — the row type of the patch its `drop` returns — or read, never dragged,
590
+ * without one, and the source it follows, if it names one.
528
591
  *
529
592
  * @param tab - The tab
593
+ * @param sources - The slice's sources
530
594
  * @returns The tab's wire value
531
- * @throws {Error} Naming the tab: rows that are neither an Array nor a `Dict<String, T>`, or a `drop` over none of a flow's row types
595
+ * @throws {Error} Naming the tab: a source the slice lacks, rows that are neither an Array nor a `Dict<String, T>`, or a `drop` over none of a flow's row types
532
596
  */
533
- function authorTab(tab) {
597
+ function authorTab(tab, sources) {
598
+ const source = tabSource("Flowchart", `"${tab.config.name}"`, tab.config.source, sources);
534
599
  const rows = rowsOf(tab);
535
600
  const config = tab.config;
536
601
  // Without a drop, its cards are read, never dragged: they land nowhere.
@@ -554,10 +619,72 @@ function authorTab(tab) {
554
619
  name: config.name,
555
620
  icon: config.icon === undefined ? none : some(config.icon),
556
621
  lands,
622
+ source,
557
623
  }), FlowchartLibraryTabType);
558
624
  }
559
625
  /** The kinds of tab `library` lists. */
560
626
  const KINDS = new Set(["flows", "states", "transitions", "tab"]);
627
+ /** How a templates refusal writes the declaration to make, by the list's kind. */
628
+ const TEMPLATES_CALL = {
629
+ states: "Flowchart.library.states(rows, { …, source: \"stateTemplates\" })",
630
+ transitions: "Flowchart.library.transitions(rows, { …, source: \"transitionTemplates\" })",
631
+ };
632
+ /** A tab `library` lists, as a `Flowchart.library.*` call makes one; `undefined` for anything else. */
633
+ function declaredTab(given) {
634
+ const tab = given;
635
+ if (tab === null || tab === undefined || typeof tab !== "object" || !KINDS.has(tab.kind)
636
+ || (tab.kind !== "flows" && (typeof tab.config !== "object" || tab.config === null))) {
637
+ return undefined;
638
+ }
639
+ return tab;
640
+ }
641
+ /** Each tab `library` lists, as declared, those of no `Flowchart.library.*` call left out. */
642
+ function declaredTabs(library) {
643
+ return (Array.isArray(library) ? library : []).flatMap((given) => {
644
+ const tab = declaredTab(given);
645
+ return tab === undefined ? [] : [tab];
646
+ });
647
+ }
648
+ /**
649
+ * Checks the library's templates lists against the flowchart's slice, before
650
+ * the slice itself is checked, so a list written in the code is refused with
651
+ * the change to make before a source no list names is (#1340, ruling 9): each
652
+ * templates list is a record of its own, naming its source of the flowchart's
653
+ * one `Slice.bindRecords`.
654
+ *
655
+ * @param library - The flowchart's `library`, as given
656
+ * @param names - The sources the slice names, read before it is checked (`sliceSourceNames`)
657
+ * @throws {Error} Naming the list and the change to make: a list naming no source — one written in the code — or one the slice lacks, a list naming `flows`, and the state and the transition templates naming one source
658
+ * @internal
659
+ */
660
+ export function checkTemplatesSources(library, names) {
661
+ const lists = declaredTabs(library).flatMap((tab) => (tab.kind === "states" || tab.kind === "transitions" ? [tab] : []));
662
+ for (const list of lists)
663
+ templatesSource("Flowchart", TEMPLATES_CALL[list.kind], list.config.source, names);
664
+ const flows = lists.find((list) => list.config.source === "flows");
665
+ if (flows !== undefined) {
666
+ throw new Error(`Flowchart: ${tabName(flows)} names the source 'flows', which narrows the flows — each templates list is a record of its own, and its own source of the slice`);
667
+ }
668
+ // The two lists naming one source; a list listed twice is the library's refusal (`buildLibrary`).
669
+ const states = lists.find((list) => list.kind === "states");
670
+ const transitions = lists.find((list) => list.kind === "transitions");
671
+ if (states !== undefined && transitions !== undefined && states.config.source === transitions.config.source) {
672
+ throw new Error(`Flowchart: the state templates and the transition templates both name the source '${states.config.source}' — each templates list is a record of its own, and its own source of the slice`);
673
+ }
674
+ }
675
+ /**
676
+ * The sources the library names (#1346), each once, in its order: each
677
+ * templates list's and each author's tab's — what the flowchart's slice may
678
+ * hold beside `flows`.
679
+ *
680
+ * @param library - The flowchart's `library`, as given
681
+ * @returns The sources' names
682
+ * @internal
683
+ */
684
+ export function librarySources(library) {
685
+ const named = declaredTabs(library).flatMap((tab) => (tab.kind === "flows" || tab.config.source === undefined ? [] : [tab.config.source]));
686
+ return named.filter((source, i) => named.indexOf(source) === i);
687
+ }
561
688
  /**
562
689
  * The library pane on the wire (`Flowchart Builder Spec.md` §4.2, §4.4, FB16,
563
690
  * FB25–FB29): its tabs in the order `library` lists them; none when it is
@@ -565,16 +692,18 @@ const KINDS = new Set(["flows", "states", "transitions", "tab"]);
565
692
  *
566
693
  * @param library - The tabs, each a `Flowchart.library.*` call
567
694
  * @param many - Whether the flowchart holds flows by name, rather than one flow
695
+ * @param sources - The flowchart's slice's sources, which each templates list's and each author's tab's `source` must be one of
568
696
  * @returns The tabs on the wire
569
697
  * @throws {Error} Naming the tab and the remedy: a `library` that is no list
570
698
  * of `Flowchart.library.*` calls; a tab listed twice — the Flows tab, the
571
699
  * state templates or the transition templates, or two of the author's tabs
572
700
  * of one name; the Flows tab over one flow; and each of a data tab's
573
- * refusals — rows that are neither an Array nor a `Dict<String, T>`, and a
574
- * `drop` of another type than its tab's
701
+ * refusals — a source the slice lacks, rows that are neither an Array nor a
702
+ * `Dict<String, T>` (a templates record's, for a templates list), a
703
+ * templates list's `key`, and a `drop` of another type than its tab's
575
704
  * @internal
576
705
  */
577
- export function buildLibrary(library, many) {
706
+ export function buildLibrary(library, many, sources = []) {
578
707
  if (library === undefined)
579
708
  return East.value([], ArrayType(FlowchartLibraryTabType));
580
709
  const LIST = "Flowchart: `library` lists the library pane's tabs, each a Flowchart.library.* call — library={[Flowchart.library.flows()]}";
@@ -582,11 +711,9 @@ export function buildLibrary(library, many) {
582
711
  throw new Error(LIST);
583
712
  const seen = new Set();
584
713
  const wires = library.map((given) => {
585
- const tab = given;
586
- if (tab === null || tab === undefined || typeof tab !== "object" || !KINDS.has(tab.kind)
587
- || (tab.kind !== "flows" && (typeof tab.config !== "object" || tab.config === null))) {
714
+ const tab = declaredTab(given);
715
+ if (tab === undefined)
588
716
  throw new Error(LIST);
589
- }
590
717
  // A tab once: the Flows tab and the templates by kind, an author's tab by its name.
591
718
  const id = tab.kind === "tab" ? `tab:${tab.config.name}` : tab.kind;
592
719
  if (seen.has(id)) {
@@ -601,9 +728,9 @@ export function buildLibrary(library, many) {
601
728
  throw new Error(`Flowchart: ${tabName(tab)} lists flows by name, and this \`data\` is one flow, Flowchart.Types.Flow — leave the Flows tab out of \`library\`, or pass the flows by name`);
602
729
  }
603
730
  return East.value(variant("flows", null), FlowchartLibraryTabType);
604
- case "states": return statesTab(tab);
605
- case "transitions": return transitionsTab(tab);
606
- case "tab": return authorTab(tab);
731
+ case "states": return statesTab(tab, sources);
732
+ case "transitions": return transitionsTab(tab, sources);
733
+ case "tab": return authorTab(tab, sources);
607
734
  }
608
735
  });
609
736
  return East.value(wires, ArrayType(FlowchartLibraryTabType));
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","sourceRoot":"","sources":["../../../src/flowchart/library.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,OAAO,GAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAyB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE5G,+EAA+E;AAC/E,WAAW;AACX,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IACxC,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC;CAChC,CAAC,CAA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