@contraagent/elements 0.0.0-stage → 0.1.0

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 (609) hide show
  1. package/README.md +72 -2
  2. package/custom-elements.json +4260 -0
  3. package/dist/charts/bar-chart.d.ts +32 -0
  4. package/dist/charts/bar-chart.d.ts.map +1 -0
  5. package/dist/charts/bar-chart.js +70 -0
  6. package/dist/charts/bar-chart.js.map +1 -0
  7. package/dist/charts/base.d.ts +48 -0
  8. package/dist/charts/base.d.ts.map +1 -0
  9. package/dist/charts/base.js +203 -0
  10. package/dist/charts/base.js.map +1 -0
  11. package/dist/charts/column-chart.d.ts +42 -0
  12. package/dist/charts/column-chart.d.ts.map +1 -0
  13. package/dist/charts/column-chart.js +146 -0
  14. package/dist/charts/column-chart.js.map +1 -0
  15. package/dist/charts/heatmap.d.ts +42 -0
  16. package/dist/charts/heatmap.d.ts.map +1 -0
  17. package/dist/charts/heatmap.js +124 -0
  18. package/dist/charts/heatmap.js.map +1 -0
  19. package/dist/charts/index.d.ts +9 -0
  20. package/dist/charts/index.d.ts.map +1 -0
  21. package/dist/charts/index.js +11 -0
  22. package/dist/charts/index.js.map +1 -0
  23. package/dist/charts/line-chart.d.ts +36 -0
  24. package/dist/charts/line-chart.d.ts.map +1 -0
  25. package/dist/charts/line-chart.js +118 -0
  26. package/dist/charts/line-chart.js.map +1 -0
  27. package/dist/charts/scale.d.ts +32 -0
  28. package/dist/charts/scale.d.ts.map +1 -0
  29. package/dist/charts/scale.js +50 -0
  30. package/dist/charts/scale.js.map +1 -0
  31. package/dist/charts/state-grid.d.ts +64 -0
  32. package/dist/charts/state-grid.d.ts.map +1 -0
  33. package/dist/charts/state-grid.js +223 -0
  34. package/dist/charts/state-grid.js.map +1 -0
  35. package/dist/charts/types.d.ts +34 -0
  36. package/dist/charts/types.d.ts.map +1 -0
  37. package/dist/charts/types.js +11 -0
  38. package/dist/charts/types.js.map +1 -0
  39. package/dist/checks/check-table.d.ts +32 -0
  40. package/dist/checks/check-table.d.ts.map +1 -0
  41. package/dist/checks/check-table.js +94 -0
  42. package/dist/checks/check-table.js.map +1 -0
  43. package/dist/checks/index.d.ts +4 -0
  44. package/dist/checks/index.d.ts.map +1 -0
  45. package/dist/checks/index.js +6 -0
  46. package/dist/checks/index.js.map +1 -0
  47. package/dist/checks/styles.d.ts +5 -0
  48. package/dist/checks/styles.d.ts.map +1 -0
  49. package/dist/checks/styles.js +30 -0
  50. package/dist/checks/styles.js.map +1 -0
  51. package/dist/checks/types.d.ts +35 -0
  52. package/dist/checks/types.d.ts.map +1 -0
  53. package/dist/checks/types.js +12 -0
  54. package/dist/checks/types.js.map +1 -0
  55. package/dist/core/clock.d.ts +20 -0
  56. package/dist/core/clock.d.ts.map +1 -0
  57. package/dist/core/clock.js +45 -0
  58. package/dist/core/clock.js.map +1 -0
  59. package/dist/core/define.d.ts +3 -0
  60. package/dist/core/define.d.ts.map +1 -0
  61. package/dist/core/define.js +8 -0
  62. package/dist/core/define.js.map +1 -0
  63. package/dist/core/events.d.ts +78 -0
  64. package/dist/core/events.d.ts.map +1 -0
  65. package/dist/core/events.js +8 -0
  66. package/dist/core/events.js.map +1 -0
  67. package/dist/core/format.d.ts +8 -0
  68. package/dist/core/format.d.ts.map +1 -0
  69. package/dist/core/format.js +28 -0
  70. package/dist/core/format.js.map +1 -0
  71. package/dist/core/frame.d.ts +4 -0
  72. package/dist/core/frame.d.ts.map +1 -0
  73. package/dist/core/frame.js +5 -0
  74. package/dist/core/frame.js.map +1 -0
  75. package/dist/core/strings.d.ts +3 -0
  76. package/dist/core/strings.d.ts.map +1 -0
  77. package/dist/core/strings.js +14 -0
  78. package/dist/core/strings.js.map +1 -0
  79. package/dist/core/tone.d.ts +8 -0
  80. package/dist/core/tone.d.ts.map +1 -0
  81. package/dist/core/tone.js +9 -0
  82. package/dist/core/tone.js.map +1 -0
  83. package/dist/count/count.d.ts +22 -0
  84. package/dist/count/count.d.ts.map +1 -0
  85. package/dist/count/count.js +60 -0
  86. package/dist/count/count.js.map +1 -0
  87. package/dist/count/elapsed.d.ts +18 -0
  88. package/dist/count/elapsed.d.ts.map +1 -0
  89. package/dist/count/elapsed.js +33 -0
  90. package/dist/count/elapsed.js.map +1 -0
  91. package/dist/count/index.d.ts +3 -0
  92. package/dist/count/index.d.ts.map +1 -0
  93. package/dist/count/index.js +5 -0
  94. package/dist/count/index.js.map +1 -0
  95. package/dist/define/all.d.ts +13 -0
  96. package/dist/define/all.d.ts.map +1 -0
  97. package/dist/define/all.js +14 -0
  98. package/dist/define/all.js.map +1 -0
  99. package/dist/define/charts.d.ts +8 -0
  100. package/dist/define/charts.d.ts.map +1 -0
  101. package/dist/define/charts.js +15 -0
  102. package/dist/define/charts.js.map +1 -0
  103. package/dist/define/check-table.d.ts +4 -0
  104. package/dist/define/check-table.d.ts.map +1 -0
  105. package/dist/define/check-table.js +7 -0
  106. package/dist/define/check-table.js.map +1 -0
  107. package/dist/define/count.d.ts +5 -0
  108. package/dist/define/count.d.ts.map +1 -0
  109. package/dist/define/count.js +9 -0
  110. package/dist/define/count.js.map +1 -0
  111. package/dist/define/data-table.d.ts +4 -0
  112. package/dist/define/data-table.d.ts.map +1 -0
  113. package/dist/define/data-table.js +7 -0
  114. package/dist/define/data-table.js.map +1 -0
  115. package/dist/define/graph.d.ts +6 -0
  116. package/dist/define/graph.d.ts.map +1 -0
  117. package/dist/define/graph.js +9 -0
  118. package/dist/define/graph.js.map +1 -0
  119. package/dist/define/json-tree.d.ts +4 -0
  120. package/dist/define/json-tree.d.ts.map +1 -0
  121. package/dist/define/json-tree.js +7 -0
  122. package/dist/define/json-tree.js.map +1 -0
  123. package/dist/define/lanes.d.ts +4 -0
  124. package/dist/define/lanes.d.ts.map +1 -0
  125. package/dist/define/lanes.js +7 -0
  126. package/dist/define/lanes.js.map +1 -0
  127. package/dist/define/markdown.d.ts +4 -0
  128. package/dist/define/markdown.d.ts.map +1 -0
  129. package/dist/define/markdown.js +7 -0
  130. package/dist/define/markdown.js.map +1 -0
  131. package/dist/define/matrix.d.ts +4 -0
  132. package/dist/define/matrix.d.ts.map +1 -0
  133. package/dist/define/matrix.js +7 -0
  134. package/dist/define/matrix.js.map +1 -0
  135. package/dist/define/segmented.d.ts +4 -0
  136. package/dist/define/segmented.d.ts.map +1 -0
  137. package/dist/define/segmented.js +7 -0
  138. package/dist/define/segmented.js.map +1 -0
  139. package/dist/define/tiles.d.ts +5 -0
  140. package/dist/define/tiles.d.ts.map +1 -0
  141. package/dist/define/tiles.js +9 -0
  142. package/dist/define/tiles.js.map +1 -0
  143. package/dist/define/transcript.d.ts +4 -0
  144. package/dist/define/transcript.d.ts.map +1 -0
  145. package/dist/define/transcript.js +7 -0
  146. package/dist/define/transcript.js.map +1 -0
  147. package/dist/graph/arrange.d.ts +43 -0
  148. package/dist/graph/arrange.d.ts.map +1 -0
  149. package/dist/graph/arrange.js +390 -0
  150. package/dist/graph/arrange.js.map +1 -0
  151. package/dist/graph/card.d.ts +71 -0
  152. package/dist/graph/card.d.ts.map +1 -0
  153. package/dist/graph/card.js +185 -0
  154. package/dist/graph/card.js.map +1 -0
  155. package/dist/graph/host.d.ts +82 -0
  156. package/dist/graph/host.d.ts.map +1 -0
  157. package/dist/graph/host.js +21 -0
  158. package/dist/graph/host.js.map +1 -0
  159. package/dist/graph/icons.d.ts +7 -0
  160. package/dist/graph/icons.d.ts.map +1 -0
  161. package/dist/graph/icons.js +18 -0
  162. package/dist/graph/icons.js.map +1 -0
  163. package/dist/graph/index.d.ts +15 -0
  164. package/dist/graph/index.d.ts.map +1 -0
  165. package/dist/graph/index.js +17 -0
  166. package/dist/graph/index.js.map +1 -0
  167. package/dist/graph/layered-graph.d.ts +226 -0
  168. package/dist/graph/layered-graph.d.ts.map +1 -0
  169. package/dist/graph/layered-graph.js +396 -0
  170. package/dist/graph/layered-graph.js.map +1 -0
  171. package/dist/graph/layout.d.ts +80 -0
  172. package/dist/graph/layout.d.ts.map +1 -0
  173. package/dist/graph/layout.js +264 -0
  174. package/dist/graph/layout.js.map +1 -0
  175. package/dist/graph/marks.d.ts +24 -0
  176. package/dist/graph/marks.d.ts.map +1 -0
  177. package/dist/graph/marks.js +38 -0
  178. package/dist/graph/marks.js.map +1 -0
  179. package/dist/graph/nav.d.ts +14 -0
  180. package/dist/graph/nav.d.ts.map +1 -0
  181. package/dist/graph/nav.js +14 -0
  182. package/dist/graph/nav.js.map +1 -0
  183. package/dist/graph/pan-zoom.d.ts +80 -0
  184. package/dist/graph/pan-zoom.d.ts.map +1 -0
  185. package/dist/graph/pan-zoom.js +191 -0
  186. package/dist/graph/pan-zoom.js.map +1 -0
  187. package/dist/graph/paths.d.ts +9 -0
  188. package/dist/graph/paths.d.ts.map +1 -0
  189. package/dist/graph/paths.js +44 -0
  190. package/dist/graph/paths.js.map +1 -0
  191. package/dist/graph/place-card.d.ts +36 -0
  192. package/dist/graph/place-card.d.ts.map +1 -0
  193. package/dist/graph/place-card.js +68 -0
  194. package/dist/graph/place-card.js.map +1 -0
  195. package/dist/graph/strings.d.ts +50 -0
  196. package/dist/graph/strings.d.ts.map +1 -0
  197. package/dist/graph/strings.js +37 -0
  198. package/dist/graph/strings.js.map +1 -0
  199. package/dist/graph/styles.d.ts +2 -0
  200. package/dist/graph/styles.d.ts.map +1 -0
  201. package/dist/graph/styles.js +203 -0
  202. package/dist/graph/styles.js.map +1 -0
  203. package/dist/graph/types.d.ts +184 -0
  204. package/dist/graph/types.d.ts.map +1 -0
  205. package/dist/graph/types.js +2 -0
  206. package/dist/graph/types.js.map +1 -0
  207. package/dist/graph/view.d.ts +17 -0
  208. package/dist/graph/view.d.ts.map +1 -0
  209. package/dist/graph/view.js +21 -0
  210. package/dist/graph/view.js.map +1 -0
  211. package/dist/graph/views/dag.d.ts +10 -0
  212. package/dist/graph/views/dag.d.ts.map +1 -0
  213. package/dist/graph/views/dag.js +292 -0
  214. package/dist/graph/views/dag.js.map +1 -0
  215. package/dist/graph/views/foot.d.ts +8 -0
  216. package/dist/graph/views/foot.d.ts.map +1 -0
  217. package/dist/graph/views/foot.js +103 -0
  218. package/dist/graph/views/foot.js.map +1 -0
  219. package/dist/graph/views/node-table.d.ts +17 -0
  220. package/dist/graph/views/node-table.d.ts.map +1 -0
  221. package/dist/graph/views/node-table.js +80 -0
  222. package/dist/graph/views/node-table.js.map +1 -0
  223. package/dist/index.d.ts +22 -0
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +26 -0
  226. package/dist/index.js.map +1 -0
  227. package/dist/json/index.d.ts +2 -0
  228. package/dist/json/index.d.ts.map +1 -0
  229. package/dist/json/index.js +3 -0
  230. package/dist/json/index.js.map +1 -0
  231. package/dist/json/json-tree.d.ts +21 -0
  232. package/dist/json/json-tree.d.ts.map +1 -0
  233. package/dist/json/json-tree.js +51 -0
  234. package/dist/json/json-tree.js.map +1 -0
  235. package/dist/lanes/index.d.ts +5 -0
  236. package/dist/lanes/index.d.ts.map +1 -0
  237. package/dist/lanes/index.js +7 -0
  238. package/dist/lanes/index.js.map +1 -0
  239. package/dist/lanes/lanes.d.ts +56 -0
  240. package/dist/lanes/lanes.d.ts.map +1 -0
  241. package/dist/lanes/lanes.js +160 -0
  242. package/dist/lanes/lanes.js.map +1 -0
  243. package/dist/lanes/stack.d.ts +26 -0
  244. package/dist/lanes/stack.d.ts.map +1 -0
  245. package/dist/lanes/stack.js +43 -0
  246. package/dist/lanes/stack.js.map +1 -0
  247. package/dist/lanes/styles.d.ts +2 -0
  248. package/dist/lanes/styles.d.ts.map +1 -0
  249. package/dist/lanes/styles.js +30 -0
  250. package/dist/lanes/styles.js.map +1 -0
  251. package/dist/lanes/types.d.ts +41 -0
  252. package/dist/lanes/types.d.ts.map +1 -0
  253. package/dist/lanes/types.js +6 -0
  254. package/dist/lanes/types.js.map +1 -0
  255. package/dist/markdown/cae-markdown.d.ts +37 -0
  256. package/dist/markdown/cae-markdown.d.ts.map +1 -0
  257. package/dist/markdown/cae-markdown.js +68 -0
  258. package/dist/markdown/cae-markdown.js.map +1 -0
  259. package/dist/markdown/highlight.d.ts +5 -0
  260. package/dist/markdown/highlight.d.ts.map +1 -0
  261. package/dist/markdown/highlight.js +86 -0
  262. package/dist/markdown/highlight.js.map +1 -0
  263. package/dist/markdown/index.d.ts +4 -0
  264. package/dist/markdown/index.d.ts.map +1 -0
  265. package/dist/markdown/index.js +6 -0
  266. package/dist/markdown/index.js.map +1 -0
  267. package/dist/markdown/markdown.d.ts +4 -0
  268. package/dist/markdown/markdown.d.ts.map +1 -0
  269. package/dist/markdown/markdown.js +105 -0
  270. package/dist/markdown/markdown.js.map +1 -0
  271. package/dist/matrix/grid-step.d.ts +8 -0
  272. package/dist/matrix/grid-step.d.ts.map +1 -0
  273. package/dist/matrix/grid-step.js +69 -0
  274. package/dist/matrix/grid-step.js.map +1 -0
  275. package/dist/matrix/index.d.ts +5 -0
  276. package/dist/matrix/index.d.ts.map +1 -0
  277. package/dist/matrix/index.js +7 -0
  278. package/dist/matrix/index.js.map +1 -0
  279. package/dist/matrix/mark-matrix.d.ts +97 -0
  280. package/dist/matrix/mark-matrix.d.ts.map +1 -0
  281. package/dist/matrix/mark-matrix.js +272 -0
  282. package/dist/matrix/mark-matrix.js.map +1 -0
  283. package/dist/matrix/styles.d.ts +4 -0
  284. package/dist/matrix/styles.d.ts.map +1 -0
  285. package/dist/matrix/styles.js +47 -0
  286. package/dist/matrix/styles.js.map +1 -0
  287. package/dist/matrix/types.d.ts +79 -0
  288. package/dist/matrix/types.d.ts.map +1 -0
  289. package/dist/matrix/types.js +5 -0
  290. package/dist/matrix/types.js.map +1 -0
  291. package/dist/primitives/fact-line.d.ts +14 -0
  292. package/dist/primitives/fact-line.d.ts.map +1 -0
  293. package/dist/primitives/fact-line.js +18 -0
  294. package/dist/primitives/fact-line.js.map +1 -0
  295. package/dist/primitives/icon.d.ts +14 -0
  296. package/dist/primitives/icon.d.ts.map +1 -0
  297. package/dist/primitives/icon.js +19 -0
  298. package/dist/primitives/icon.js.map +1 -0
  299. package/dist/primitives/index.d.ts +10 -0
  300. package/dist/primitives/index.d.ts.map +1 -0
  301. package/dist/primitives/index.js +13 -0
  302. package/dist/primitives/index.js.map +1 -0
  303. package/dist/primitives/legend.d.ts +28 -0
  304. package/dist/primitives/legend.d.ts.map +1 -0
  305. package/dist/primitives/legend.js +28 -0
  306. package/dist/primitives/legend.js.map +1 -0
  307. package/dist/primitives/pill.d.ts +23 -0
  308. package/dist/primitives/pill.d.ts.map +1 -0
  309. package/dist/primitives/pill.js +40 -0
  310. package/dist/primitives/pill.js.map +1 -0
  311. package/dist/primitives/roving-focus.d.ts +47 -0
  312. package/dist/primitives/roving-focus.d.ts.map +1 -0
  313. package/dist/primitives/roving-focus.js +111 -0
  314. package/dist/primitives/roving-focus.js.map +1 -0
  315. package/dist/primitives/segmented.d.ts +41 -0
  316. package/dist/primitives/segmented.d.ts.map +1 -0
  317. package/dist/primitives/segmented.js +88 -0
  318. package/dist/primitives/segmented.js.map +1 -0
  319. package/dist/primitives/share-bar.d.ts +37 -0
  320. package/dist/primitives/share-bar.d.ts.map +1 -0
  321. package/dist/primitives/share-bar.js +69 -0
  322. package/dist/primitives/share-bar.js.map +1 -0
  323. package/dist/primitives/states.d.ts +19 -0
  324. package/dist/primitives/states.d.ts.map +1 -0
  325. package/dist/primitives/states.js +11 -0
  326. package/dist/primitives/states.js.map +1 -0
  327. package/dist/primitives/window.d.ts +24 -0
  328. package/dist/primitives/window.d.ts.map +1 -0
  329. package/dist/primitives/window.js +56 -0
  330. package/dist/primitives/window.js.map +1 -0
  331. package/dist/styles/chips.d.ts +2 -0
  332. package/dist/styles/chips.d.ts.map +1 -0
  333. package/dist/styles/chips.js +18 -0
  334. package/dist/styles/chips.js.map +1 -0
  335. package/dist/styles/facts.d.ts +2 -0
  336. package/dist/styles/facts.d.ts.map +1 -0
  337. package/dist/styles/facts.js +7 -0
  338. package/dist/styles/facts.js.map +1 -0
  339. package/dist/styles/index.d.ts +16 -0
  340. package/dist/styles/index.d.ts.map +1 -0
  341. package/dist/styles/index.js +15 -0
  342. package/dist/styles/index.js.map +1 -0
  343. package/dist/styles/layout.d.ts +2 -0
  344. package/dist/styles/layout.d.ts.map +1 -0
  345. package/dist/styles/layout.js +33 -0
  346. package/dist/styles/layout.js.map +1 -0
  347. package/dist/styles/marks.d.ts +2 -0
  348. package/dist/styles/marks.d.ts.map +1 -0
  349. package/dist/styles/marks.js +30 -0
  350. package/dist/styles/marks.js.map +1 -0
  351. package/dist/styles/meter.d.ts +3 -0
  352. package/dist/styles/meter.d.ts.map +1 -0
  353. package/dist/styles/meter.js +9 -0
  354. package/dist/styles/meter.js.map +1 -0
  355. package/dist/styles/motion.d.ts +2 -0
  356. package/dist/styles/motion.d.ts.map +1 -0
  357. package/dist/styles/motion.js +27 -0
  358. package/dist/styles/motion.js.map +1 -0
  359. package/dist/styles/prose.d.ts +3 -0
  360. package/dist/styles/prose.d.ts.map +1 -0
  361. package/dist/styles/prose.js +59 -0
  362. package/dist/styles/prose.js.map +1 -0
  363. package/dist/styles/reset.d.ts +2 -0
  364. package/dist/styles/reset.d.ts.map +1 -0
  365. package/dist/styles/reset.js +13 -0
  366. package/dist/styles/reset.js.map +1 -0
  367. package/dist/styles/status.d.ts +2 -0
  368. package/dist/styles/status.d.ts.map +1 -0
  369. package/dist/styles/status.js +52 -0
  370. package/dist/styles/status.js.map +1 -0
  371. package/dist/styles/text.d.ts +2 -0
  372. package/dist/styles/text.d.ts.map +1 -0
  373. package/dist/styles/text.js +21 -0
  374. package/dist/styles/text.js.map +1 -0
  375. package/dist/styles/tokens.d.ts +8 -0
  376. package/dist/styles/tokens.d.ts.map +1 -0
  377. package/dist/styles/tokens.js +32 -0
  378. package/dist/styles/tokens.js.map +1 -0
  379. package/dist/table/data-table.d.ts +106 -0
  380. package/dist/table/data-table.d.ts.map +1 -0
  381. package/dist/table/data-table.js +408 -0
  382. package/dist/table/data-table.js.map +1 -0
  383. package/dist/table/index.d.ts +4 -0
  384. package/dist/table/index.d.ts.map +1 -0
  385. package/dist/table/index.js +6 -0
  386. package/dist/table/index.js.map +1 -0
  387. package/dist/table/styles.d.ts +2 -0
  388. package/dist/table/styles.d.ts.map +1 -0
  389. package/dist/table/styles.js +32 -0
  390. package/dist/table/styles.js.map +1 -0
  391. package/dist/table/types.d.ts +48 -0
  392. package/dist/table/types.d.ts.map +1 -0
  393. package/dist/table/types.js +30 -0
  394. package/dist/table/types.js.map +1 -0
  395. package/dist/themes/boot.d.ts +7 -0
  396. package/dist/themes/boot.d.ts.map +1 -0
  397. package/dist/themes/boot.js +14 -0
  398. package/dist/themes/boot.js.map +1 -0
  399. package/dist/themes/choice.d.ts +16 -0
  400. package/dist/themes/choice.d.ts.map +1 -0
  401. package/dist/themes/choice.js +45 -0
  402. package/dist/themes/choice.js.map +1 -0
  403. package/dist/themes/data.d.ts +43 -0
  404. package/dist/themes/data.d.ts.map +1 -0
  405. package/dist/themes/data.js +408 -0
  406. package/dist/themes/data.js.map +1 -0
  407. package/dist/themes/index.d.ts +7 -0
  408. package/dist/themes/index.d.ts.map +1 -0
  409. package/dist/themes/index.js +11 -0
  410. package/dist/themes/index.js.map +1 -0
  411. package/dist/themes/sheet.d.ts +16 -0
  412. package/dist/themes/sheet.d.ts.map +1 -0
  413. package/dist/themes/sheet.js +28 -0
  414. package/dist/themes/sheet.js.map +1 -0
  415. package/dist/themes/token-meanings.d.ts +3 -0
  416. package/dist/themes/token-meanings.d.ts.map +1 -0
  417. package/dist/themes/token-meanings.js +67 -0
  418. package/dist/themes/token-meanings.js.map +1 -0
  419. package/dist/themes/tokens-list.d.ts +14 -0
  420. package/dist/themes/tokens-list.d.ts.map +1 -0
  421. package/dist/themes/tokens-list.js +69 -0
  422. package/dist/themes/tokens-list.js.map +1 -0
  423. package/dist/tiles/index.d.ts +4 -0
  424. package/dist/tiles/index.d.ts.map +1 -0
  425. package/dist/tiles/index.js +6 -0
  426. package/dist/tiles/index.js.map +1 -0
  427. package/dist/tiles/stat-tiles.d.ts +40 -0
  428. package/dist/tiles/stat-tiles.d.ts.map +1 -0
  429. package/dist/tiles/stat-tiles.js +99 -0
  430. package/dist/tiles/stat-tiles.js.map +1 -0
  431. package/dist/tiles/styles.d.ts +2 -0
  432. package/dist/tiles/styles.d.ts.map +1 -0
  433. package/dist/tiles/styles.js +23 -0
  434. package/dist/tiles/styles.js.map +1 -0
  435. package/dist/tiles/types.d.ts +22 -0
  436. package/dist/tiles/types.d.ts.map +1 -0
  437. package/dist/tiles/types.js +2 -0
  438. package/dist/tiles/types.js.map +1 -0
  439. package/dist/transcript/follow-scroll.d.ts +21 -0
  440. package/dist/transcript/follow-scroll.d.ts.map +1 -0
  441. package/dist/transcript/follow-scroll.js +76 -0
  442. package/dist/transcript/follow-scroll.js.map +1 -0
  443. package/dist/transcript/index.d.ts +5 -0
  444. package/dist/transcript/index.d.ts.map +1 -0
  445. package/dist/transcript/index.js +7 -0
  446. package/dist/transcript/index.js.map +1 -0
  447. package/dist/transcript/styles.d.ts +2 -0
  448. package/dist/transcript/styles.d.ts.map +1 -0
  449. package/dist/transcript/styles.js +114 -0
  450. package/dist/transcript/styles.js.map +1 -0
  451. package/dist/transcript/tags.d.ts +6 -0
  452. package/dist/transcript/tags.d.ts.map +1 -0
  453. package/dist/transcript/tags.js +13 -0
  454. package/dist/transcript/tags.js.map +1 -0
  455. package/dist/transcript/tool-card.d.ts +16 -0
  456. package/dist/transcript/tool-card.d.ts.map +1 -0
  457. package/dist/transcript/tool-card.js +87 -0
  458. package/dist/transcript/tool-card.js.map +1 -0
  459. package/dist/transcript/transcript.d.ts +103 -0
  460. package/dist/transcript/transcript.d.ts.map +1 -0
  461. package/dist/transcript/transcript.js +397 -0
  462. package/dist/transcript/transcript.js.map +1 -0
  463. package/dist/transcript/types.d.ts +161 -0
  464. package/dist/transcript/types.d.ts.map +1 -0
  465. package/dist/transcript/types.js +25 -0
  466. package/dist/transcript/types.js.map +1 -0
  467. package/docs/charts.md +58 -0
  468. package/docs/check-table.md +40 -0
  469. package/docs/data-table.md +57 -0
  470. package/docs/examples/charts.ts +61 -0
  471. package/docs/examples/check-table.ts +19 -0
  472. package/docs/examples/ci-pipeline.ts +271 -0
  473. package/docs/examples/data-table.ts +39 -0
  474. package/docs/examples/graph.ts +57 -0
  475. package/docs/examples/lanes.ts +40 -0
  476. package/docs/examples/matrix.ts +56 -0
  477. package/docs/examples/page.css +34 -0
  478. package/docs/examples/segmented.ts +18 -0
  479. package/docs/examples/status.ts +30 -0
  480. package/docs/examples/theme.css +54 -0
  481. package/docs/examples/tiles.ts +27 -0
  482. package/docs/examples/transcript.ts +59 -0
  483. package/docs/graph.md +112 -0
  484. package/docs/lanes.md +48 -0
  485. package/docs/matrix.md +34 -0
  486. package/docs/page.md +87 -0
  487. package/docs/primitives.md +57 -0
  488. package/docs/strings.md +16 -0
  489. package/docs/theming.md +147 -0
  490. package/docs/tiles.md +40 -0
  491. package/docs/transcript.md +73 -0
  492. package/docs/tsconfig.json +20 -0
  493. package/package.json +161 -4
  494. package/src/charts/bar-chart.ts +74 -0
  495. package/src/charts/base.ts +188 -0
  496. package/src/charts/column-chart.ts +153 -0
  497. package/src/charts/heatmap.ts +129 -0
  498. package/src/charts/index.ts +10 -0
  499. package/src/charts/line-chart.ts +128 -0
  500. package/src/charts/scale.ts +61 -0
  501. package/src/charts/state-grid.ts +245 -0
  502. package/src/charts/types.ts +48 -0
  503. package/src/checks/check-table.ts +85 -0
  504. package/src/checks/index.ts +5 -0
  505. package/src/checks/styles.ts +31 -0
  506. package/src/checks/types.ts +48 -0
  507. package/src/core/clock.ts +46 -0
  508. package/src/core/define.ts +7 -0
  509. package/src/core/events.ts +89 -0
  510. package/src/core/format.ts +25 -0
  511. package/src/core/frame.ts +5 -0
  512. package/src/core/strings.ts +11 -0
  513. package/src/core/tone.ts +14 -0
  514. package/src/count/count.ts +54 -0
  515. package/src/count/elapsed.ts +33 -0
  516. package/src/count/index.ts +4 -0
  517. package/src/define/all.ts +13 -0
  518. package/src/define/charts.ts +17 -0
  519. package/src/define/check-table.ts +9 -0
  520. package/src/define/count.ts +11 -0
  521. package/src/define/data-table.ts +9 -0
  522. package/src/define/graph.ts +11 -0
  523. package/src/define/json-tree.ts +9 -0
  524. package/src/define/lanes.ts +9 -0
  525. package/src/define/markdown.ts +9 -0
  526. package/src/define/matrix.ts +9 -0
  527. package/src/define/segmented.ts +9 -0
  528. package/src/define/tiles.ts +11 -0
  529. package/src/define/transcript.ts +9 -0
  530. package/src/graph/arrange.ts +399 -0
  531. package/src/graph/card.ts +209 -0
  532. package/src/graph/host.ts +100 -0
  533. package/src/graph/icons.ts +23 -0
  534. package/src/graph/index.ts +16 -0
  535. package/src/graph/layered-graph.ts +417 -0
  536. package/src/graph/layout.ts +331 -0
  537. package/src/graph/marks.ts +42 -0
  538. package/src/graph/nav.ts +19 -0
  539. package/src/graph/pan-zoom.ts +219 -0
  540. package/src/graph/paths.ts +41 -0
  541. package/src/graph/place-card.ts +93 -0
  542. package/src/graph/strings.ts +86 -0
  543. package/src/graph/styles.ts +204 -0
  544. package/src/graph/types.ts +202 -0
  545. package/src/graph/view.ts +28 -0
  546. package/src/graph/views/dag.ts +294 -0
  547. package/src/graph/views/foot.ts +109 -0
  548. package/src/graph/views/node-table.ts +90 -0
  549. package/src/index.ts +25 -0
  550. package/src/json/index.ts +2 -0
  551. package/src/json/json-tree.ts +49 -0
  552. package/src/lanes/index.ts +6 -0
  553. package/src/lanes/lanes.ts +143 -0
  554. package/src/lanes/stack.ts +51 -0
  555. package/src/lanes/styles.ts +30 -0
  556. package/src/lanes/types.ts +51 -0
  557. package/src/markdown/cae-markdown.ts +64 -0
  558. package/src/markdown/highlight.ts +94 -0
  559. package/src/markdown/index.ts +5 -0
  560. package/src/markdown/markdown.ts +110 -0
  561. package/src/matrix/grid-step.ts +58 -0
  562. package/src/matrix/index.ts +6 -0
  563. package/src/matrix/mark-matrix.ts +285 -0
  564. package/src/matrix/styles.ts +48 -0
  565. package/src/matrix/types.ts +83 -0
  566. package/src/primitives/fact-line.ts +26 -0
  567. package/src/primitives/icon.ts +26 -0
  568. package/src/primitives/index.ts +12 -0
  569. package/src/primitives/legend.ts +56 -0
  570. package/src/primitives/pill.ts +58 -0
  571. package/src/primitives/roving-focus.ts +138 -0
  572. package/src/primitives/segmented.ts +92 -0
  573. package/src/primitives/share-bar.ts +94 -0
  574. package/src/primitives/states.ts +28 -0
  575. package/src/primitives/window.ts +65 -0
  576. package/src/styles/chips.ts +18 -0
  577. package/src/styles/facts.ts +7 -0
  578. package/src/styles/index.ts +19 -0
  579. package/src/styles/layout.ts +33 -0
  580. package/src/styles/marks.ts +30 -0
  581. package/src/styles/meter.ts +9 -0
  582. package/src/styles/motion.ts +27 -0
  583. package/src/styles/prose.ts +59 -0
  584. package/src/styles/reset.ts +13 -0
  585. package/src/styles/status.ts +52 -0
  586. package/src/styles/text.ts +21 -0
  587. package/src/styles/tokens.ts +35 -0
  588. package/src/table/data-table.ts +367 -0
  589. package/src/table/index.ts +5 -0
  590. package/src/table/styles.ts +32 -0
  591. package/src/table/types.ts +73 -0
  592. package/src/themes/boot.ts +14 -0
  593. package/src/themes/choice.ts +47 -0
  594. package/src/themes/data.ts +433 -0
  595. package/src/themes/index.ts +10 -0
  596. package/src/themes/sheet.ts +29 -0
  597. package/src/themes/token-meanings.ts +67 -0
  598. package/src/themes/tokens-list.ts +82 -0
  599. package/src/tiles/index.ts +5 -0
  600. package/src/tiles/stat-tiles.ts +92 -0
  601. package/src/tiles/styles.ts +23 -0
  602. package/src/tiles/types.ts +20 -0
  603. package/src/transcript/follow-scroll.ts +72 -0
  604. package/src/transcript/index.ts +6 -0
  605. package/src/transcript/styles.ts +114 -0
  606. package/src/transcript/tags.ts +18 -0
  607. package/src/transcript/tool-card.ts +103 -0
  608. package/src/transcript/transcript.ts +358 -0
  609. package/src/transcript/types.ts +167 -0
@@ -0,0 +1,294 @@
1
+ // The graph in the frame that pans and zooms: clusters, nodes with their marks,
2
+ // stubs and edges; and the keys that move between marks and along edges.
3
+ import { html, nothing, svg } from 'lit';
4
+ import { repeat } from 'lit/directives/repeat.js';
5
+ import { toneAttr, type Tone } from '../../core/tone.js';
6
+ import { stateCount } from '../../primitives/states.js';
7
+ import { isPoint } from '../arrange.js';
8
+ import { BAR_LIST, firstMark, gridOf, hlKeyOf, slotsOf, type GraphHost, type MarkGroup, type Slot } from '../host.js';
9
+ import { cycleIcon, innerIcon, toggleIcon } from '../icons.js';
10
+ import type { Rect } from '../layout.js';
11
+ import { asBar, barParts } from '../marks.js';
12
+ import { alongEdge } from '../nav.js';
13
+ import { edgePath, returnPath } from '../paths.js';
14
+ import type { GraphClusterInput, GraphNode } from '../types.js';
15
+
16
+ /** A note's class by its tone: failed, attention, running, muted. */
17
+ export const NOTE_CLASS: Partial<Record<Tone, string>> = { failed: 'err', attention: 'warn', running: 'live', muted: 'mut' };
18
+
19
+ /** The graph in its frame: dragging pans, a click on the frame clears the selection. */
20
+ export function dag(h: GraphHost) {
21
+ const pz = h.pz;
22
+ return html`<div class="frame gframe ${h.down ? 'down' : ''}" part="frame" style="height:${Math.round(pz.frameH)}px"
23
+ @pointerdown=${pz.onPointerDown} @pointermove=${pz.onPointerMove} @pointerup=${pz.onPointerUp} @pointercancel=${pz.onPointerUp}
24
+ @click=${(e: MouseEvent) => !(e.target as Element).closest('.node, .cluster, .stub, .tools') && h.select(null)}>
25
+ <div class="stage view" part="stage" style="transform:${pz.transform}">${graphView(h)}</div>
26
+ </div>`;
27
+ }
28
+
29
+ /** Where an item is drawn, from its parent's corner (a cluster's, inside its border), or hidden until laid out. */
30
+ function at(h: GraphHost, id: string, parent: Rect | null): string {
31
+ const r = h.lay?.at[id];
32
+ if (!r) return 'left:0;top:0';
33
+ const dx = parent ? parent.x + 1 : 0;
34
+ const dy = parent ? parent.y + 1 : 0;
35
+ return `left:${r.x - dx}px;top:${r.y - dy}px`;
36
+ }
37
+
38
+ function graphView(h: GraphHost) {
39
+ const { on } = h.lit();
40
+ const g = h.drawn;
41
+ const lay = h.lay;
42
+ const stubs = new Map(g.stubs.map((s) => [s.id, s]));
43
+ const items = (container: string): string[] => (h.arr.slots[container] ?? []).flat().filter((id) => !isPoint(id));
44
+ const item = (id: string, parent: Rect | null): unknown => {
45
+ const b = h.clusters.get(id);
46
+ if (b) return cluster(h, b, parent, (x, r) => item(x, r));
47
+ const s = stubs.get(id);
48
+ if (s) return html`<span class="stub" part="stub" data-id=${s.id} style=${at(h, s.id, parent)} title=${h.words.stubTip}>${s.label}</span>`;
49
+ const n = h.nodes.get(id);
50
+ return n ? node(h, n, parent) : nothing;
51
+ };
52
+ // Unplaced until a layout of this structure exists: the first render only measures.
53
+ const placed = !!lay && g.nodes.every((n) => lay.at[n.id]);
54
+ const w = lay?.w ?? 0;
55
+ const ht = lay?.h ?? 0;
56
+ return html`<div class="dag ${h.down ? 'down' : ''} ${on ? 'hl' : ''} ${placed ? '' : 'unplaced'}" style="width:${w}px;height:${ht}px"
57
+ @mouseleave=${() => (h.hover = null)}>
58
+ <svg class="edges" aria-hidden="true" width=${w} height=${ht}>
59
+ <defs>
60
+ <marker id="arr" viewBox="0 0 8 8" refX="8" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto">
61
+ <path d="M0,0.5 L8,4 L0,7.5 z" fill="var(--line2)" stroke="none"></path>
62
+ </marker>
63
+ <marker id="arr-ret" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto">
64
+ <path class="ret-tip" d="M0,0.5 L8,4 L0,7.5 z"></path>
65
+ </marker>
66
+ </defs>
67
+ ${(lay?.edges ?? []).map((e) => svg`<path class=${e.style} part="edge" d=${edgePath(e.runs, lay?.down)} marker-end="url(#arr)"></path>`)}
68
+ ${(lay?.returns ?? []).map((r) => svg`<path class="ret" data-cluster=${r.box} d=${returnPath(r, lay?.down)} marker-end="url(#arr-ret)"></path>`)}
69
+ </svg>
70
+ ${repeat(items(''), (id) => id, (id) => item(id, null))}
71
+ </div>`;
72
+ }
73
+
74
+ /** A click on a node or a cluster, not on one of its marks or on a node inside it: selects it. */
75
+ function onItemClick(h: GraphHost, e: MouseEvent, id: string): void {
76
+ const own = (e.target as HTMLElement).closest('.mark, .taskchip, .node, .cluster');
77
+ if (own !== e.currentTarget) return;
78
+ e.stopPropagation();
79
+ if (e.detail >= 2) return; // the second click of a double click
80
+ h.select(id);
81
+ }
82
+
83
+ function onItemDblClick(h: GraphHost, e: MouseEvent, id: string): void {
84
+ const own = (e.target as HTMLElement).closest('.mark, .taskchip, .node, .cluster');
85
+ if (own !== e.currentTarget) return;
86
+ e.stopPropagation();
87
+ h.act(id);
88
+ }
89
+
90
+ /** Enter on a node's or a cluster's name: its action (Space selects it, as a click does). */
91
+ function onNameKey(h: GraphHost, e: KeyboardEvent, id: string): void {
92
+ if (e.key !== 'Enter') return;
93
+ e.preventDefault();
94
+ h.act(id);
95
+ }
96
+
97
+ /** The control that opens or closes an item drawn closed or open (`toggle`), named with the item. */
98
+ function toggleControl(h: GraphHost, id: string, label: string, open: boolean) {
99
+ const word = open ? h.words.close : h.words.open;
100
+ return html`<button type="button" class="tog" part="toggle" aria-expanded=${open} aria-label=${`${word}: ${label}`} title=${word}
101
+ @click=${(e: MouseEvent) => {
102
+ e.stopPropagation();
103
+ h.toggle(id, !open);
104
+ }}
105
+ @dblclick=${(e: MouseEvent) => e.stopPropagation()}>${toggleIcon(open)}</button>`;
106
+ }
107
+
108
+ /** A cluster's name: its label, or the parts of its path, each after the first a link to its own inner view. */
109
+ function clusterName(h: GraphHost, b: GraphClusterInput, sel: boolean) {
110
+ const first = b.path?.[0];
111
+ const name = html`<button type="button" class="name" title=${(first?.tip ?? b.tip) || nothing} aria-pressed=${sel}
112
+ @focus=${() => h.focusSelect(b.id)} @keydown=${(e: KeyboardEvent) => onNameKey(h, e, b.id)}>${b.cycle ? cycleIcon() : nothing}${first?.label ?? b.label}</button>`;
113
+ if (!b.path || b.path.length < 2) return name;
114
+ return html`${name}${b.path.slice(1).map(
115
+ (p) => html`<span class="psep" aria-hidden="true">›</span><button type="button" class="part" title=${p.tip || nothing}
116
+ @click=${(e: MouseEvent) => {
117
+ e.stopPropagation();
118
+ h.drill(p.id);
119
+ }}
120
+ @dblclick=${(e: MouseEvent) => e.stopPropagation()}>${p.label}</button>`,
121
+ )}`;
122
+ }
123
+
124
+ function cluster(h: GraphHost, b: GraphClusterInput, parent: Rect | null, item: (id: string, r: Rect | null) => unknown) {
125
+ const r = h.lay?.at[b.id] ?? null;
126
+ const kids = (h.arr.slots[b.id] ?? []).flat().filter((id) => !isPoint(id));
127
+ const size = r ? `;width:${r.w}px;height:${r.h}px` : '';
128
+ const sel = h.selected === b.id;
129
+ return html`<section class="cluster ${sel ? 'sel' : ''}" part="cluster" role="group" data-cluster=${b.id} style=${at(h, b.id, parent) + size}
130
+ aria-label=${b.summary ?? b.label}
131
+ @click=${(e: MouseEvent) => onItemClick(h, e, b.id)} @dblclick=${(e: MouseEvent) => onItemDblClick(h, e, b.id)}>
132
+ <div class="hd" part="cluster-label" data-id=${`lbl:${b.id}`}>
133
+ <span class="line">
134
+ ${clusterName(h, b, sel)}
135
+ ${b.note ? html`<span class="count">${b.note}</span>` : nothing}
136
+ </span>
137
+ ${b.detail ? html`<span class="spread" title=${b.detailTip ?? nothing}>${b.detail}</span>` : nothing}
138
+ </div>
139
+ ${b.toggle
140
+ ? html`<span class="cue">${toggleControl(h, b.id, b.path?.map((p) => p.label).join(' › ') ?? b.label, true)}</span>`
141
+ : b.drill
142
+ ? html`<span class="cue" aria-hidden="true">${innerIcon()}</span>`
143
+ : nothing}
144
+ <div class="in">${repeat(kids, (id) => id, (id) => item(id, r))}</div>
145
+ </section>`;
146
+ }
147
+
148
+ /** A node's notes ("1 failed | 1 not started"), each in its tone's class. */
149
+ export const notes = (n: GraphNode, tag: 'span' | 'div' = 'span') =>
150
+ (n.notes ?? []).map((f) => (tag === 'span' ? html`<span class=${NOTE_CLASS[f.tone ?? 'neutral'] ?? ''}>${f.text}</span>` : html`<div class=${NOTE_CLASS[f.tone ?? 'neutral'] ?? ''}>${f.text}</div>`));
151
+
152
+ function node(h: GraphHost, n: GraphNode, parent: Rect | null) {
153
+ const series = h.drawn.series;
154
+ const bar = asBar(n, h.barAt);
155
+ const all = slotsOf(n, series);
156
+ const failed = (s: Slot | null): s is Slot => !!s && h.states[s.m.state]?.tone === 'failed';
157
+ const group: MarkGroup = bar
158
+ ? { id: n.id, slots: all.filter(failed), grid: { cols: BAR_LIST, size: 12, gap: 4 } }
159
+ : { id: n.id, slots: all, grid: gridOf(n, series.length) };
160
+ const sel = h.selected === n.id;
161
+ const icons = (n.icons ?? []).map((x) => h.renderIcon(x));
162
+ return html`<section class="node ${n.drill ? 'drill' : ''} ${n.accent ? 'accent' : ''} ${sel ? 'sel' : ''}" part="node" role="group" data-id=${n.id}
163
+ data-look=${n.look && n.look !== 'neutral' ? n.look : nothing} aria-label=${n.summary ?? n.label}
164
+ style="${at(h, n.id, parent)};--cols:${group.grid.cols};--m:${group.grid.size}px;--g:${group.grid.gap}px"
165
+ @click=${(e: MouseEvent) => onItemClick(h, e, n.id)} @dblclick=${(e: MouseEvent) => onItemDblClick(h, e, n.id)}>
166
+ <div class="hd" part="node-header">
167
+ <span class="nm">${icons}<button type="button" class="name" part="node-name" title=${n.tip ?? nothing} aria-pressed=${sel}
168
+ @focus=${() => h.focusSelect(n.id)} @keydown=${(e: KeyboardEvent) => onNameKey(h, e, n.id)}>${n.label}</button></span>
169
+ <span class="right"><span class="count" aria-hidden="true" title=${n.progress.label}>${n.progress.done}/${n.progress.total}</span>${n.toggle
170
+ ? toggleControl(h, n.id, n.label, false)
171
+ : n.drill
172
+ ? html`<span class="cue" aria-hidden="true">${innerIcon()}</span>`
173
+ : nothing}</span>
174
+ </div>
175
+ ${bar ? statusBar(h, n, group) : marks(h, group)}
176
+ ${n.notes?.length ? html`<div class="ex" aria-hidden="true">${notes(n)}</div>` : nothing}
177
+ </section>`;
178
+ }
179
+
180
+ /** A node with too many marks to draw: a bar of its counts, and its failed marks by name. */
181
+ function statusBar(h: GraphHost, n: GraphNode, g: MarkGroup) {
182
+ const order = Object.keys(h.states);
183
+ const parts = barParts(n.counts, order);
184
+ const shown = g.slots.slice(0, BAR_LIST);
185
+ const more = g.slots.length - shown.length;
186
+ const active = Math.min(h.active.get(g.id) ?? 0, Math.max(0, shown.length - 1));
187
+ const words = order.filter((s) => n.counts[s]).map((s) => stateCount(h.states, s, n.counts[s] ?? 0));
188
+ return html`<div class="sbar" role="img" aria-label=${words.join(' | ')}>
189
+ ${parts.map((p) => {
190
+ const look = h.states[p.state];
191
+ return html`<i data-tone=${toneAttr(look?.tone)} data-shape=${look?.shape ?? nothing} style="width:${p.pct}%" title=${stateCount(h.states, p.state, p.n)}></i>`;
192
+ })}
193
+ </div>
194
+ ${shown.length
195
+ ? html`<div class="fails" @keydown=${(e: KeyboardEvent) => onKey(h, e, { ...g, slots: shown, grid: { ...g.grid, cols: shown.length } })}>
196
+ ${shown.map((s, i) => (s ? mark(h, g, s, i, i === active, true) : nothing))}
197
+ ${more > 0 ? html`<span>${h.words.more(more)}</span>` : nothing}
198
+ </div>`
199
+ : nothing}`;
200
+ }
201
+
202
+ /** A group's marks, with one tab stop. */
203
+ function marks(h: GraphHost, g: MarkGroup) {
204
+ const active = Math.min(h.active.get(g.id) ?? firstMark(g.slots), g.slots.length - 1);
205
+ return html`<div class="marks ${g.grid.size >= 10 ? 'big' : ''}" @keydown=${(e: KeyboardEvent) => onKey(h, e, g)}>
206
+ ${g.slots.map((s, i) => (s ? mark(h, g, s, i, i === active) : html`<span class="slot"></span>`))}
207
+ </div>`;
208
+ }
209
+
210
+ function mark(h: GraphHost, g: MarkGroup, s: Slot, i: number, tabStop: boolean, chip = false) {
211
+ const { m } = s;
212
+ const { key, on } = h.lit();
213
+ const hlKey = hlKeyOf(s);
214
+ const lit = on !== null && ((s.series !== '' && s.series === key) || on.has(m.id));
215
+ const sel = h.selected === m.id ? 'sel' : '';
216
+ const focus = (e: FocusEvent) => {
217
+ h.hover = hlKey;
218
+ h.active.set(g.id, i);
219
+ h.pz.reveal(e.currentTarget as HTMLElement);
220
+ h.focusSelect(m.id);
221
+ };
222
+ if (chip) {
223
+ return html`<button type="button" class="taskchip ${lit ? 'on' : ''} ${sel}" part="mark" data-i=${i} tabindex=${tabStop ? 0 : -1}
224
+ title=${m.tip ?? nothing} aria-label=${m.label} aria-pressed=${!!sel}
225
+ @mouseenter=${() => (h.hover = hlKey)} @focus=${focus} @blur=${() => (h.hover = null)}
226
+ @click=${() => h.select(m.id)} @dblclick=${() => h.act(m.id)}>${m.name ?? (s.series || m.id)}</button>`;
227
+ }
228
+ const look = h.states[m.state];
229
+ return html`<button type="button" class="mark ${lit ? 'on' : ''} ${sel}" part="mark" data-tone=${toneAttr(look?.tone)} data-shape=${look?.shape ?? nothing}
230
+ data-i=${i} data-n=${m.badge ?? nothing} tabindex=${tabStop ? 0 : -1}
231
+ title=${m.tip ?? nothing}
232
+ aria-label=${m.label} aria-pressed=${!!sel}
233
+ @mouseenter=${() => (h.hover = hlKey)}
234
+ @focus=${focus}
235
+ @blur=${() => (h.hover = null)}
236
+ @click=${() => h.select(m.id)}
237
+ @dblclick=${() => h.act(m.id)}></button>`;
238
+ }
239
+
240
+ /** Arrow keys, Home and End within a group's marks, skipping empty slots; Shift and an arrow key along an edge to another node. */
241
+ function onKey(h: GraphHost, e: KeyboardEvent, g: MarkGroup): void {
242
+ const target = e.target as HTMLElement;
243
+ if (!target.classList.contains('mark') && !target.classList.contains('taskchip')) return;
244
+ if (e.shiftKey && e.key.startsWith('Arrow')) return toEdge(h, e, g);
245
+ const { slots } = g;
246
+ if (e.key === 'Enter') {
247
+ const s = slots[Number(target.dataset['i'])];
248
+ e.preventDefault();
249
+ if (s) h.act(s.m.id);
250
+ return;
251
+ }
252
+ const cur = h.active.get(g.id) ?? firstMark(slots);
253
+ const step: Record<string, number> = { ArrowRight: 1, ArrowLeft: -1, ArrowDown: g.grid.cols, ArrowUp: -g.grid.cols };
254
+ let next: number;
255
+ if (e.key === 'Home') next = firstMark(slots);
256
+ else if (e.key === 'End') next = slots.length - 1 - [...slots].reverse().findIndex((m) => m !== null);
257
+ else if (step[e.key] !== undefined) {
258
+ const d = step[e.key] as number;
259
+ next = cur + d;
260
+ while (next >= 0 && next < slots.length && !slots[next]) next += Math.sign(d);
261
+ if (next < 0 || next >= slots.length) return;
262
+ } else return;
263
+ e.preventDefault();
264
+ h.active.set(g.id, next);
265
+ h.requestUpdate();
266
+ const group = e.currentTarget as HTMLElement;
267
+ void h.updateComplete.then(() => group.querySelector<HTMLElement>(`[data-i="${next}"]`)?.focus());
268
+ }
269
+
270
+ /** To the node an edge joins: a later one (Shift and → or ↓) or an earlier one (Shift and ← or ↑), on the same series when it has a mark there. */
271
+ function toEdge(h: GraphHost, e: KeyboardEvent, g: MarkGroup): void {
272
+ const dir = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? 'later' : 'earlier';
273
+ const lay = h.lay;
274
+ const across = (id: string) => {
275
+ const r = lay?.at[id];
276
+ return !r ? 0 : lay?.down ? r.x + r.w / 2 : r.y + r.h / 2;
277
+ };
278
+ const to = alongEdge({ drawn: h.arr.drawn, edges: h.drawn.edges, back: h.arr.back }, g.id, dir, across);
279
+ e.preventDefault();
280
+ if (!to) return;
281
+ const n = h.nodes.get(to);
282
+ if (!n) return;
283
+ const series = g.slots[h.active.get(g.id) ?? firstMark(g.slots)]?.series ?? '';
284
+ const all = slotsOf(n, h.drawn.series);
285
+ const slots = asBar(n, h.barAt) ? all.filter((s) => !!s && h.states[s.m.state]?.tone === 'failed') : all;
286
+ const same = series ? slots.findIndex((s) => s?.series === series) : -1;
287
+ const i = same >= 0 ? same : (h.active.get(n.id) ?? firstMark(slots));
288
+ h.active.set(n.id, i);
289
+ h.requestUpdate();
290
+ void h.updateComplete.then(() => {
291
+ const el = h.renderRoot.querySelector<HTMLElement>(`.node[data-id="${CSS.escape(to)}"]`);
292
+ (el?.querySelector<HTMLElement>(`[data-i="${i}"]`) ?? el?.querySelector<HTMLElement>('.name'))?.focus();
293
+ });
294
+ }
@@ -0,0 +1,109 @@
1
+ // The row under the frame: the legend, the zoom buttons and the view switch, and the keys of the view shown.
2
+ import { html, nothing, svg } from 'lit';
3
+ import { toneAttr } from '../../core/tone.js';
4
+ import { legend as legendRow, type LegendItem } from '../../primitives/legend.js';
5
+ import type { MarkMatrixInput } from '../../matrix/types.js';
6
+ import { asBar } from '../marks.js';
7
+ import { slotsOf, type GraphHost } from '../host.js';
8
+ import { innerIcon } from '../icons.js';
9
+
10
+ /**
11
+ * The legend on the left, the tools at the right end of the first line, and the keys
12
+ * under them: their line keeps its room, and shows its words while the graph has the focus.
13
+ */
14
+ export function foot(h: GraphHost, matrix: MarkMatrixInput | null) {
15
+ const table = !!matrix || h.asTable;
16
+ return html`<div class="foot">
17
+ ${legend(h, matrix)}
18
+ <div class="tools">${table ? nothing : zoomTools(h)}${viewSwitch(h, table)}</div>
19
+ <div class="keys" part="keys">${keyHints(h, matrix).map((k, i) => html`${i ? ' | ' : ''}<span>${k}</span>`)}</div>
20
+ </div>`;
21
+ }
22
+
23
+ /** Zoom out, zoom in, and back to the whole drawing (which does nothing while the whole drawing shows at its own size). */
24
+ function zoomTools(h: GraphHost) {
25
+ const pz = h.pz;
26
+ const w = h.words;
27
+ const whole = !pz.moved && pz.fitK >= 1;
28
+ return html`<button type="button" aria-label=${w.zoomOut} title=${w.zoomOutTip} @click=${() => pz.zoomBy(1 / 1.25)}>−</button>
29
+ <button type="button" aria-label=${w.zoomIn} title=${w.zoomInTip} @click=${() => pz.zoomBy(1.25)}>+</button>
30
+ <button type="button" ?disabled=${whole} @click=${() => pz.showAll()}>${w.showAll}</button>`;
31
+ }
32
+
33
+ /** The two views, at the same place in each: the drawing, and the table (a mark matrix, or a row per node). */
34
+ function viewSwitch(h: GraphHost, table: boolean) {
35
+ const options = [
36
+ { value: 'graph', label: h.words.graph },
37
+ { value: 'table', label: h.words.table },
38
+ ];
39
+ return html`<cae-segmented class="views" .options=${options} .value=${table ? 'table' : 'graph'} label=${h.words.view}
40
+ @cae-change=${(e: CustomEvent<{ value: string }>) => {
41
+ e.stopPropagation();
42
+ h.showView(e.detail.value === 'table' ? 'table' : 'graph');
43
+ }}></cae-segmented>`;
44
+ }
45
+
46
+ /** The keys of the view shown. */
47
+ function keyHints(h: GraphHost, matrix: MarkMatrixInput | null): string[] {
48
+ const w = h.words;
49
+ const esc = h.selected ? w.clearKey : w.upKey;
50
+ const keys = matrix ? w.matrixKeys : h.asTable ? w.tableKeys : w.graphKeys;
51
+ return [...keys, esc].filter(Boolean);
52
+ }
53
+
54
+ /** A status mark in a state's look, as the legend shows it. */
55
+ const legendMark = (h: GraphHost, state: string, badge?: string) => {
56
+ const look = h.states[state];
57
+ return html`<i class="mark" data-tone=${toneAttr(look?.tone)} data-shape=${look?.shape ?? nothing} data-n=${badge ?? nothing}></i>`;
58
+ };
59
+
60
+ /**
61
+ * What the view shows that needs a word: the states of the marks shown, a badge when a
62
+ * mark shows one, the icons the host names, the edge styles when both are drawn, a
63
+ * cluster's return, and the mark of an item with an inner view.
64
+ */
65
+ function legend(h: GraphHost, mx: MarkMatrixInput | null) {
66
+ const g = h.drawn;
67
+ const flat = h.asTable && !mx;
68
+ // The marks drawn: a node with a bar draws its failed marks only (its badges none); the table draws none.
69
+ const marks = flat
70
+ ? []
71
+ : mx
72
+ ? mx.rows.flatMap((r) => r.cells).map((m) => m && { state: m.state, badge: undefined })
73
+ : g.nodes.flatMap((n) => slotsOf(n, g.series).map((s) => s && { state: s.m.state, badge: asBar(n, h.barAt) ? undefined : s.m.badge }));
74
+ const shown = marks.filter((m): m is { state: string; badge: string | undefined } => m !== null);
75
+ const present = new Set(shown.map((m) => m.state));
76
+ const badge = shown.some((m) => m.badge);
77
+ const dashed = !mx && !flat && [...g.edges, ...g.stubs].some((e) => e.style === 'dashed');
78
+ const icons = new Set(mx ? mx.head.flat().flatMap((c) => c.icons ?? []) : g.nodes.flatMap((n) => n.icons ?? []));
79
+ const cycles = !mx && !flat && g.clusters.some((c) => c.cycle);
80
+ const inner = !mx && ((!flat && g.clusters.some((c) => c.drill)) || g.nodes.some((n) => n.drill));
81
+ const first = Object.keys(h.states)[0] ?? '';
82
+ const line = (dash: boolean) => svg`<svg width="22" height="8" aria-hidden="true"><path d="M1,4 H21" stroke-dasharray=${dash ? '5 4' : 'none'}></path></svg>`;
83
+ const items: LegendItem[] = [
84
+ ...Object.entries(h.states)
85
+ .filter(([s]) => present.has(s))
86
+ .map(([s, look]) => ({ label: look.label, icon: legendMark(h, s), decorative: true })),
87
+ ...(badge ? [{ label: h.words.badge, icon: legendMark(h, first, '2'), decorative: true }] : []),
88
+ ...Object.entries(h.words.iconNames)
89
+ .filter(([name]) => icons.has(name))
90
+ .map(([name, label]) => ({ label, icon: h.renderIcon(name) })),
91
+ ...(dashed
92
+ ? [
93
+ { label: h.words.solidEdge, icon: line(false) },
94
+ { label: h.words.dashedEdge, icon: line(true) },
95
+ ]
96
+ : []),
97
+ ...(cycles
98
+ ? [
99
+ {
100
+ label: h.words.cycle,
101
+ icon: html`<svg width="24" height="12" aria-hidden="true"><path class="ret" d="M20,1.5 V5.5 Q20,9.5 16,9.5 H8 Q4,9.5 4,5.5 V5"></path>
102
+ <path class="ret-head" d="M4,0.8 L1.4,5 L6.6,5 z"></path></svg>`,
103
+ },
104
+ ]
105
+ : []),
106
+ ...(inner ? [{ label: h.words.drill, icon: innerIcon() }] : []),
107
+ ];
108
+ return legendRow(items, { cls: 'big' });
109
+ }
@@ -0,0 +1,90 @@
1
+ // The graph as a table, in its frame: a row per node.
2
+ import { html, nothing } from 'lit';
3
+ import { repeat } from 'lit/directives/repeat.js';
4
+ import { FRAME_MIN, FRAME_SHARE } from '../../core/frame.js';
5
+ import type { GraphHost } from '../host.js';
6
+ import { cycleIcon, innerIcon } from '../icons.js';
7
+ import type { EdgeStyle, GraphInput, GraphNode } from '../types.js';
8
+ import { notes } from './dag.js';
9
+
10
+ /** The names of the nodes `n` is joined to: by a solid edge, by a dashed one, and the later ones. */
11
+ export function neighbours(
12
+ n: GraphNode,
13
+ g: Pick<GraphInput, 'edges' | 'stubs'>,
14
+ nodes: ReadonlyMap<string, GraphNode>,
15
+ inCluster: (label: string) => string,
16
+ ): { solid: string[]; dashed: string[]; later: string[] } {
17
+ const label = (id: string) => {
18
+ const x = nodes.get(id);
19
+ return !x ? id : x.cluster ? inCluster(x.label) : x.label;
20
+ };
21
+ const into = (style: EdgeStyle) => [
22
+ ...g.stubs.filter((s) => s.to === n.id && s.style === style).map((s) => s.label),
23
+ ...g.edges.filter((e) => e.to === n.id && e.style === style).map((e) => label(e.from)),
24
+ ];
25
+ return { solid: into('solid'), dashed: into('dashed'), later: [...new Set(g.edges.filter((e) => e.from === n.id).map((e) => label(e.to)))] };
26
+ }
27
+
28
+ /**
29
+ * The graph as a table, in its frame: a row per node with its status (the node's
30
+ * count and notes) and the nodes it is joined to. A row is selected as a node is,
31
+ * with the same card.
32
+ */
33
+ export function nodeTable(h: GraphHost) {
34
+ const g = h.drawn;
35
+ const w = h.words;
36
+ const dashed = [...g.edges, ...g.stubs].some((e) => e.style === 'dashed');
37
+ const list = (xs: string[]) => w.list(xs) || w.none;
38
+ // The frame keeps the drawing's height when the drawing of this graph was laid out (left to right); else the table's own, up to the frame's limit.
39
+ const height = !h.down && h.laidOut && h.pz.frameH > 0 ? `height:${Math.round(h.pz.frameH)}px` : `max-height:max(${FRAME_MIN}px, ${FRAME_SHARE * 100}vh)`;
40
+ const rows = h.arr.drawn.map((id) => h.nodes.get(id)).filter((n): n is GraphNode => !!n);
41
+ return html`<div class="frame tframe" part="frame" data-scroll="x" style=${height} @scroll=${() => h.card.place()}
42
+ @click=${(e: MouseEvent) => !(e.target as Element).closest('tbody tr') && h.select(null)}>
43
+ <table class="list view" part="table">
44
+ <thead>
45
+ <tr>
46
+ <th scope="col" class="fit">${w.nameHeader}</th>
47
+ <th scope="col" class="fit">${w.statusHeader}</th>
48
+ <th scope="col">${w.solidHeader}</th>
49
+ ${dashed ? html`<th scope="col">${w.dashedHeader}</th>` : nothing}
50
+ <th scope="col">${w.laterHeader}</th>
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ ${repeat(rows, (n) => n.id, (n) => {
55
+ const nb = neighbours(n, g, h.nodes, w.inCluster);
56
+ const box = n.cluster ? h.clusters.get(n.cluster) : undefined;
57
+ const on = h.selected === n.id;
58
+ const icons = html`${(n.icons ?? []).map((x) => h.renderIcon(x))}${n.drill ? innerIcon() : nothing}`;
59
+ return html`<tr class=${on ? 'sel' : ''} part="row" data-id=${n.id}
60
+ @click=${(e: MouseEvent) => !(e.target as Element).closest('.loopchip') && e.detail < 2 && h.select(n.id)}
61
+ @dblclick=${(e: MouseEvent) => !(e.target as Element).closest('.loopchip') && h.act(n.id)}>
62
+ <th scope="row" class="fit">
63
+ <span class="nm">${icons}<button type="button" class="name" title=${n.tip ?? nothing} aria-pressed=${on}
64
+ @focus=${() => h.focusSelect(n.id)} @keydown=${(e: KeyboardEvent) => {
65
+ if (e.key !== 'Enter') return;
66
+ e.preventDefault();
67
+ h.act(n.id);
68
+ }}>${n.label}</button>${box?.drill
69
+ ? html`<button type="button" class="taskchip loopchip" title=${box.chipTip ?? nothing} aria-label=${box.chipLabel ?? nothing}
70
+ @click=${() => h.drill(box.id)}>${box.cycle ? cycleIcon(12) : nothing}${box.note ?? box.label}</button>`
71
+ : nothing}</span>
72
+ </th>
73
+ <td class="fit st">${statusLine(n)}</td>
74
+ <td class="rel"><span>${list(nb.solid)}</span></td>
75
+ ${dashed ? html`<td class="rel"><span>${list(nb.dashed)}</span></td>` : nothing}
76
+ <td class="rel"><span>${list(nb.later)}</span></td>
77
+ </tr>`;
78
+ })}
79
+ </tbody>
80
+ </table>
81
+ </div>`;
82
+ }
83
+
84
+ /** A node's status in one row, as its node in the graph says it: "28/30 | 1 failed | 1 not started". */
85
+ export function statusLine(n: GraphNode) {
86
+ const sep = html`<span class="sep" aria-hidden="true"> | </span>`;
87
+ return html`<span class="n" aria-hidden="true" title=${n.progress.label}>${n.progress.done}/${n.progress.total}</span><span class="sr">${n.progress.label}</span>${notes(n).map(
88
+ (x) => html`${sep}${x}`,
89
+ )}`;
90
+ }
package/src/index.ts ADDED
@@ -0,0 +1,25 @@
1
+ // @contraagent/elements: generic web components and the parts they are built
2
+ // from. Importing this module registers nothing: each class is registered by its
3
+ // `define` entry (`@contraagent/elements/define` registers every `cae-*`), or by
4
+ // the host under a tag name of its own.
5
+ export * from './core/tone.js';
6
+ export * from './core/events.js';
7
+ export * from './core/strings.js';
8
+ export * from './core/define.js';
9
+ export * from './core/format.js';
10
+ export * from './core/clock.js';
11
+ export * from './styles/index.js';
12
+ export * from './themes/index.js';
13
+ export * from './primitives/index.js';
14
+ export * from './json/index.js';
15
+ export * from './markdown/index.js';
16
+ export * from './count/index.js';
17
+ export * from './table/index.js';
18
+ export * from './tiles/index.js';
19
+ export * from './lanes/index.js';
20
+ export * from './charts/index.js';
21
+ export * from './checks/index.js';
22
+ export * from './matrix/index.js';
23
+ export * from './graph/index.js';
24
+ export * from './core/frame.js';
25
+ export * from './transcript/index.js';
@@ -0,0 +1,2 @@
1
+ // `@contraagent/elements/json-tree`: the class; `…/json-tree/define` registers it.
2
+ export * from './json-tree.js';
@@ -0,0 +1,49 @@
1
+ import { LitElement, html, type TemplateResult } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { base, prose } from '../styles/index.js';
4
+
5
+ const isLeaf = (x: unknown): boolean =>
6
+ x === null || typeof x !== 'object' || (Array.isArray(x) ? !x.length : !Object.keys(x).length);
7
+
8
+ /**
9
+ * Any JSON value as a foldable tree: the first level open, deeper levels folded.
10
+ *
11
+ * @tagname cae-json-tree
12
+ * @csspart tree - the tree
13
+ */
14
+ export class CaeJsonTree extends LitElement {
15
+ static override styles = [base, prose];
16
+
17
+ @property({ attribute: false }) value: unknown;
18
+ /** Levels opened from the start. */
19
+ @property({ type: Number }) open = 1;
20
+
21
+ override render() {
22
+ return html`<div class="jtree" part="tree" data-scroll="x">${this.node(this.value, 0)}</div>`;
23
+ }
24
+
25
+ private node(v: unknown, depth: number): TemplateResult | string {
26
+ if (v === null || typeof v !== 'object') {
27
+ return html`<span class=${typeof v === 'string' ? 'js' : 'jn'}>${JSON.stringify(v) ?? 'undefined'}</span>`;
28
+ }
29
+ const entries: [string | number, unknown][] = Array.isArray(v) ? v.map((x, i) => [i, x]) : Object.entries(v);
30
+ if (!entries.length) return Array.isArray(v) ? '[]' : '{}';
31
+ return html`${entries.map(([k, x]) =>
32
+ isLeaf(x)
33
+ ? html`<div class="jt"><span class="jk">${k}</span>: ${this.node(x, depth + 1)}</div>`
34
+ : html`<details class="jt" ?open=${depth < this.open}>
35
+ <summary>
36
+ <span class="jk">${k}</span>
37
+ <span class="meta">${Array.isArray(x) ? `[${x.length}]` : `{${Object.keys(x as object).length}}`}</span>
38
+ </summary>
39
+ ${this.node(x, depth + 1)}
40
+ </details>`,
41
+ )}`;
42
+ }
43
+ }
44
+
45
+ declare global {
46
+ interface HTMLElementTagNameMap {
47
+ 'cae-json-tree': CaeJsonTree;
48
+ }
49
+ }
@@ -0,0 +1,6 @@
1
+ // Bars on a time axis: `@contraagent/elements/lanes`. `CaeLanes` is registered
2
+ // by `@contraagent/elements/lanes/define`.
3
+ export * from './types.js';
4
+ export * from './stack.js';
5
+ export * from './styles.js';
6
+ export * from './lanes.js';