@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.
- package/README.md +72 -2
- package/custom-elements.json +4260 -0
- package/dist/charts/bar-chart.d.ts +32 -0
- package/dist/charts/bar-chart.d.ts.map +1 -0
- package/dist/charts/bar-chart.js +70 -0
- package/dist/charts/bar-chart.js.map +1 -0
- package/dist/charts/base.d.ts +48 -0
- package/dist/charts/base.d.ts.map +1 -0
- package/dist/charts/base.js +203 -0
- package/dist/charts/base.js.map +1 -0
- package/dist/charts/column-chart.d.ts +42 -0
- package/dist/charts/column-chart.d.ts.map +1 -0
- package/dist/charts/column-chart.js +146 -0
- package/dist/charts/column-chart.js.map +1 -0
- package/dist/charts/heatmap.d.ts +42 -0
- package/dist/charts/heatmap.d.ts.map +1 -0
- package/dist/charts/heatmap.js +124 -0
- package/dist/charts/heatmap.js.map +1 -0
- package/dist/charts/index.d.ts +9 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +11 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/line-chart.d.ts +36 -0
- package/dist/charts/line-chart.d.ts.map +1 -0
- package/dist/charts/line-chart.js +118 -0
- package/dist/charts/line-chart.js.map +1 -0
- package/dist/charts/scale.d.ts +32 -0
- package/dist/charts/scale.d.ts.map +1 -0
- package/dist/charts/scale.js +50 -0
- package/dist/charts/scale.js.map +1 -0
- package/dist/charts/state-grid.d.ts +64 -0
- package/dist/charts/state-grid.d.ts.map +1 -0
- package/dist/charts/state-grid.js +223 -0
- package/dist/charts/state-grid.js.map +1 -0
- package/dist/charts/types.d.ts +34 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +11 -0
- package/dist/charts/types.js.map +1 -0
- package/dist/checks/check-table.d.ts +32 -0
- package/dist/checks/check-table.d.ts.map +1 -0
- package/dist/checks/check-table.js +94 -0
- package/dist/checks/check-table.js.map +1 -0
- package/dist/checks/index.d.ts +4 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +6 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/styles.d.ts +5 -0
- package/dist/checks/styles.d.ts.map +1 -0
- package/dist/checks/styles.js +30 -0
- package/dist/checks/styles.js.map +1 -0
- package/dist/checks/types.d.ts +35 -0
- package/dist/checks/types.d.ts.map +1 -0
- package/dist/checks/types.js +12 -0
- package/dist/checks/types.js.map +1 -0
- package/dist/core/clock.d.ts +20 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +45 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/define.d.ts +3 -0
- package/dist/core/define.d.ts.map +1 -0
- package/dist/core/define.js +8 -0
- package/dist/core/define.js.map +1 -0
- package/dist/core/events.d.ts +78 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +8 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/format.d.ts +8 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +28 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/frame.d.ts +4 -0
- package/dist/core/frame.d.ts.map +1 -0
- package/dist/core/frame.js +5 -0
- package/dist/core/frame.js.map +1 -0
- package/dist/core/strings.d.ts +3 -0
- package/dist/core/strings.d.ts.map +1 -0
- package/dist/core/strings.js +14 -0
- package/dist/core/strings.js.map +1 -0
- package/dist/core/tone.d.ts +8 -0
- package/dist/core/tone.d.ts.map +1 -0
- package/dist/core/tone.js +9 -0
- package/dist/core/tone.js.map +1 -0
- package/dist/count/count.d.ts +22 -0
- package/dist/count/count.d.ts.map +1 -0
- package/dist/count/count.js +60 -0
- package/dist/count/count.js.map +1 -0
- package/dist/count/elapsed.d.ts +18 -0
- package/dist/count/elapsed.d.ts.map +1 -0
- package/dist/count/elapsed.js +33 -0
- package/dist/count/elapsed.js.map +1 -0
- package/dist/count/index.d.ts +3 -0
- package/dist/count/index.d.ts.map +1 -0
- package/dist/count/index.js +5 -0
- package/dist/count/index.js.map +1 -0
- package/dist/define/all.d.ts +13 -0
- package/dist/define/all.d.ts.map +1 -0
- package/dist/define/all.js +14 -0
- package/dist/define/all.js.map +1 -0
- package/dist/define/charts.d.ts +8 -0
- package/dist/define/charts.d.ts.map +1 -0
- package/dist/define/charts.js +15 -0
- package/dist/define/charts.js.map +1 -0
- package/dist/define/check-table.d.ts +4 -0
- package/dist/define/check-table.d.ts.map +1 -0
- package/dist/define/check-table.js +7 -0
- package/dist/define/check-table.js.map +1 -0
- package/dist/define/count.d.ts +5 -0
- package/dist/define/count.d.ts.map +1 -0
- package/dist/define/count.js +9 -0
- package/dist/define/count.js.map +1 -0
- package/dist/define/data-table.d.ts +4 -0
- package/dist/define/data-table.d.ts.map +1 -0
- package/dist/define/data-table.js +7 -0
- package/dist/define/data-table.js.map +1 -0
- package/dist/define/graph.d.ts +6 -0
- package/dist/define/graph.d.ts.map +1 -0
- package/dist/define/graph.js +9 -0
- package/dist/define/graph.js.map +1 -0
- package/dist/define/json-tree.d.ts +4 -0
- package/dist/define/json-tree.d.ts.map +1 -0
- package/dist/define/json-tree.js +7 -0
- package/dist/define/json-tree.js.map +1 -0
- package/dist/define/lanes.d.ts +4 -0
- package/dist/define/lanes.d.ts.map +1 -0
- package/dist/define/lanes.js +7 -0
- package/dist/define/lanes.js.map +1 -0
- package/dist/define/markdown.d.ts +4 -0
- package/dist/define/markdown.d.ts.map +1 -0
- package/dist/define/markdown.js +7 -0
- package/dist/define/markdown.js.map +1 -0
- package/dist/define/matrix.d.ts +4 -0
- package/dist/define/matrix.d.ts.map +1 -0
- package/dist/define/matrix.js +7 -0
- package/dist/define/matrix.js.map +1 -0
- package/dist/define/segmented.d.ts +4 -0
- package/dist/define/segmented.d.ts.map +1 -0
- package/dist/define/segmented.js +7 -0
- package/dist/define/segmented.js.map +1 -0
- package/dist/define/tiles.d.ts +5 -0
- package/dist/define/tiles.d.ts.map +1 -0
- package/dist/define/tiles.js +9 -0
- package/dist/define/tiles.js.map +1 -0
- package/dist/define/transcript.d.ts +4 -0
- package/dist/define/transcript.d.ts.map +1 -0
- package/dist/define/transcript.js +7 -0
- package/dist/define/transcript.js.map +1 -0
- package/dist/graph/arrange.d.ts +43 -0
- package/dist/graph/arrange.d.ts.map +1 -0
- package/dist/graph/arrange.js +390 -0
- package/dist/graph/arrange.js.map +1 -0
- package/dist/graph/card.d.ts +71 -0
- package/dist/graph/card.d.ts.map +1 -0
- package/dist/graph/card.js +185 -0
- package/dist/graph/card.js.map +1 -0
- package/dist/graph/host.d.ts +82 -0
- package/dist/graph/host.d.ts.map +1 -0
- package/dist/graph/host.js +21 -0
- package/dist/graph/host.js.map +1 -0
- package/dist/graph/icons.d.ts +7 -0
- package/dist/graph/icons.d.ts.map +1 -0
- package/dist/graph/icons.js +18 -0
- package/dist/graph/icons.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +17 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/layered-graph.d.ts +226 -0
- package/dist/graph/layered-graph.d.ts.map +1 -0
- package/dist/graph/layered-graph.js +396 -0
- package/dist/graph/layered-graph.js.map +1 -0
- package/dist/graph/layout.d.ts +80 -0
- package/dist/graph/layout.d.ts.map +1 -0
- package/dist/graph/layout.js +264 -0
- package/dist/graph/layout.js.map +1 -0
- package/dist/graph/marks.d.ts +24 -0
- package/dist/graph/marks.d.ts.map +1 -0
- package/dist/graph/marks.js +38 -0
- package/dist/graph/marks.js.map +1 -0
- package/dist/graph/nav.d.ts +14 -0
- package/dist/graph/nav.d.ts.map +1 -0
- package/dist/graph/nav.js +14 -0
- package/dist/graph/nav.js.map +1 -0
- package/dist/graph/pan-zoom.d.ts +80 -0
- package/dist/graph/pan-zoom.d.ts.map +1 -0
- package/dist/graph/pan-zoom.js +191 -0
- package/dist/graph/pan-zoom.js.map +1 -0
- package/dist/graph/paths.d.ts +9 -0
- package/dist/graph/paths.d.ts.map +1 -0
- package/dist/graph/paths.js +44 -0
- package/dist/graph/paths.js.map +1 -0
- package/dist/graph/place-card.d.ts +36 -0
- package/dist/graph/place-card.d.ts.map +1 -0
- package/dist/graph/place-card.js +68 -0
- package/dist/graph/place-card.js.map +1 -0
- package/dist/graph/strings.d.ts +50 -0
- package/dist/graph/strings.d.ts.map +1 -0
- package/dist/graph/strings.js +37 -0
- package/dist/graph/strings.js.map +1 -0
- package/dist/graph/styles.d.ts +2 -0
- package/dist/graph/styles.d.ts.map +1 -0
- package/dist/graph/styles.js +203 -0
- package/dist/graph/styles.js.map +1 -0
- package/dist/graph/types.d.ts +184 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +2 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/view.d.ts +17 -0
- package/dist/graph/view.d.ts.map +1 -0
- package/dist/graph/view.js +21 -0
- package/dist/graph/view.js.map +1 -0
- package/dist/graph/views/dag.d.ts +10 -0
- package/dist/graph/views/dag.d.ts.map +1 -0
- package/dist/graph/views/dag.js +292 -0
- package/dist/graph/views/dag.js.map +1 -0
- package/dist/graph/views/foot.d.ts +8 -0
- package/dist/graph/views/foot.d.ts.map +1 -0
- package/dist/graph/views/foot.js +103 -0
- package/dist/graph/views/foot.js.map +1 -0
- package/dist/graph/views/node-table.d.ts +17 -0
- package/dist/graph/views/node-table.d.ts.map +1 -0
- package/dist/graph/views/node-table.js +80 -0
- package/dist/graph/views/node-table.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +3 -0
- package/dist/json/index.js.map +1 -0
- package/dist/json/json-tree.d.ts +21 -0
- package/dist/json/json-tree.d.ts.map +1 -0
- package/dist/json/json-tree.js +51 -0
- package/dist/json/json-tree.js.map +1 -0
- package/dist/lanes/index.d.ts +5 -0
- package/dist/lanes/index.d.ts.map +1 -0
- package/dist/lanes/index.js +7 -0
- package/dist/lanes/index.js.map +1 -0
- package/dist/lanes/lanes.d.ts +56 -0
- package/dist/lanes/lanes.d.ts.map +1 -0
- package/dist/lanes/lanes.js +160 -0
- package/dist/lanes/lanes.js.map +1 -0
- package/dist/lanes/stack.d.ts +26 -0
- package/dist/lanes/stack.d.ts.map +1 -0
- package/dist/lanes/stack.js +43 -0
- package/dist/lanes/stack.js.map +1 -0
- package/dist/lanes/styles.d.ts +2 -0
- package/dist/lanes/styles.d.ts.map +1 -0
- package/dist/lanes/styles.js +30 -0
- package/dist/lanes/styles.js.map +1 -0
- package/dist/lanes/types.d.ts +41 -0
- package/dist/lanes/types.d.ts.map +1 -0
- package/dist/lanes/types.js +6 -0
- package/dist/lanes/types.js.map +1 -0
- package/dist/markdown/cae-markdown.d.ts +37 -0
- package/dist/markdown/cae-markdown.d.ts.map +1 -0
- package/dist/markdown/cae-markdown.js +68 -0
- package/dist/markdown/cae-markdown.js.map +1 -0
- package/dist/markdown/highlight.d.ts +5 -0
- package/dist/markdown/highlight.d.ts.map +1 -0
- package/dist/markdown/highlight.js +86 -0
- package/dist/markdown/highlight.js.map +1 -0
- package/dist/markdown/index.d.ts +4 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +6 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/markdown.d.ts +4 -0
- package/dist/markdown/markdown.d.ts.map +1 -0
- package/dist/markdown/markdown.js +105 -0
- package/dist/markdown/markdown.js.map +1 -0
- package/dist/matrix/grid-step.d.ts +8 -0
- package/dist/matrix/grid-step.d.ts.map +1 -0
- package/dist/matrix/grid-step.js +69 -0
- package/dist/matrix/grid-step.js.map +1 -0
- package/dist/matrix/index.d.ts +5 -0
- package/dist/matrix/index.d.ts.map +1 -0
- package/dist/matrix/index.js +7 -0
- package/dist/matrix/index.js.map +1 -0
- package/dist/matrix/mark-matrix.d.ts +97 -0
- package/dist/matrix/mark-matrix.d.ts.map +1 -0
- package/dist/matrix/mark-matrix.js +272 -0
- package/dist/matrix/mark-matrix.js.map +1 -0
- package/dist/matrix/styles.d.ts +4 -0
- package/dist/matrix/styles.d.ts.map +1 -0
- package/dist/matrix/styles.js +47 -0
- package/dist/matrix/styles.js.map +1 -0
- package/dist/matrix/types.d.ts +79 -0
- package/dist/matrix/types.d.ts.map +1 -0
- package/dist/matrix/types.js +5 -0
- package/dist/matrix/types.js.map +1 -0
- package/dist/primitives/fact-line.d.ts +14 -0
- package/dist/primitives/fact-line.d.ts.map +1 -0
- package/dist/primitives/fact-line.js +18 -0
- package/dist/primitives/fact-line.js.map +1 -0
- package/dist/primitives/icon.d.ts +14 -0
- package/dist/primitives/icon.d.ts.map +1 -0
- package/dist/primitives/icon.js +19 -0
- package/dist/primitives/icon.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +13 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/legend.d.ts +28 -0
- package/dist/primitives/legend.d.ts.map +1 -0
- package/dist/primitives/legend.js +28 -0
- package/dist/primitives/legend.js.map +1 -0
- package/dist/primitives/pill.d.ts +23 -0
- package/dist/primitives/pill.d.ts.map +1 -0
- package/dist/primitives/pill.js +40 -0
- package/dist/primitives/pill.js.map +1 -0
- package/dist/primitives/roving-focus.d.ts +47 -0
- package/dist/primitives/roving-focus.d.ts.map +1 -0
- package/dist/primitives/roving-focus.js +111 -0
- package/dist/primitives/roving-focus.js.map +1 -0
- package/dist/primitives/segmented.d.ts +41 -0
- package/dist/primitives/segmented.d.ts.map +1 -0
- package/dist/primitives/segmented.js +88 -0
- package/dist/primitives/segmented.js.map +1 -0
- package/dist/primitives/share-bar.d.ts +37 -0
- package/dist/primitives/share-bar.d.ts.map +1 -0
- package/dist/primitives/share-bar.js +69 -0
- package/dist/primitives/share-bar.js.map +1 -0
- package/dist/primitives/states.d.ts +19 -0
- package/dist/primitives/states.d.ts.map +1 -0
- package/dist/primitives/states.js +11 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/window.d.ts +24 -0
- package/dist/primitives/window.d.ts.map +1 -0
- package/dist/primitives/window.js +56 -0
- package/dist/primitives/window.js.map +1 -0
- package/dist/styles/chips.d.ts +2 -0
- package/dist/styles/chips.d.ts.map +1 -0
- package/dist/styles/chips.js +18 -0
- package/dist/styles/chips.js.map +1 -0
- package/dist/styles/facts.d.ts +2 -0
- package/dist/styles/facts.d.ts.map +1 -0
- package/dist/styles/facts.js +7 -0
- package/dist/styles/facts.js.map +1 -0
- package/dist/styles/index.d.ts +16 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +15 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/layout.d.ts +2 -0
- package/dist/styles/layout.d.ts.map +1 -0
- package/dist/styles/layout.js +33 -0
- package/dist/styles/layout.js.map +1 -0
- package/dist/styles/marks.d.ts +2 -0
- package/dist/styles/marks.d.ts.map +1 -0
- package/dist/styles/marks.js +30 -0
- package/dist/styles/marks.js.map +1 -0
- package/dist/styles/meter.d.ts +3 -0
- package/dist/styles/meter.d.ts.map +1 -0
- package/dist/styles/meter.js +9 -0
- package/dist/styles/meter.js.map +1 -0
- package/dist/styles/motion.d.ts +2 -0
- package/dist/styles/motion.d.ts.map +1 -0
- package/dist/styles/motion.js +27 -0
- package/dist/styles/motion.js.map +1 -0
- package/dist/styles/prose.d.ts +3 -0
- package/dist/styles/prose.d.ts.map +1 -0
- package/dist/styles/prose.js +59 -0
- package/dist/styles/prose.js.map +1 -0
- package/dist/styles/reset.d.ts +2 -0
- package/dist/styles/reset.d.ts.map +1 -0
- package/dist/styles/reset.js +13 -0
- package/dist/styles/reset.js.map +1 -0
- package/dist/styles/status.d.ts +2 -0
- package/dist/styles/status.d.ts.map +1 -0
- package/dist/styles/status.js +52 -0
- package/dist/styles/status.js.map +1 -0
- package/dist/styles/text.d.ts +2 -0
- package/dist/styles/text.d.ts.map +1 -0
- package/dist/styles/text.js +21 -0
- package/dist/styles/text.js.map +1 -0
- package/dist/styles/tokens.d.ts +8 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/styles/tokens.js +32 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/table/data-table.d.ts +106 -0
- package/dist/table/data-table.d.ts.map +1 -0
- package/dist/table/data-table.js +408 -0
- package/dist/table/data-table.js.map +1 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +6 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/styles.d.ts +2 -0
- package/dist/table/styles.d.ts.map +1 -0
- package/dist/table/styles.js +32 -0
- package/dist/table/styles.js.map +1 -0
- package/dist/table/types.d.ts +48 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/table/types.js +30 -0
- package/dist/table/types.js.map +1 -0
- package/dist/themes/boot.d.ts +7 -0
- package/dist/themes/boot.d.ts.map +1 -0
- package/dist/themes/boot.js +14 -0
- package/dist/themes/boot.js.map +1 -0
- package/dist/themes/choice.d.ts +16 -0
- package/dist/themes/choice.d.ts.map +1 -0
- package/dist/themes/choice.js +45 -0
- package/dist/themes/choice.js.map +1 -0
- package/dist/themes/data.d.ts +43 -0
- package/dist/themes/data.d.ts.map +1 -0
- package/dist/themes/data.js +408 -0
- package/dist/themes/data.js.map +1 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +11 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/sheet.d.ts +16 -0
- package/dist/themes/sheet.d.ts.map +1 -0
- package/dist/themes/sheet.js +28 -0
- package/dist/themes/sheet.js.map +1 -0
- package/dist/themes/token-meanings.d.ts +3 -0
- package/dist/themes/token-meanings.d.ts.map +1 -0
- package/dist/themes/token-meanings.js +67 -0
- package/dist/themes/token-meanings.js.map +1 -0
- package/dist/themes/tokens-list.d.ts +14 -0
- package/dist/themes/tokens-list.d.ts.map +1 -0
- package/dist/themes/tokens-list.js +69 -0
- package/dist/themes/tokens-list.js.map +1 -0
- package/dist/tiles/index.d.ts +4 -0
- package/dist/tiles/index.d.ts.map +1 -0
- package/dist/tiles/index.js +6 -0
- package/dist/tiles/index.js.map +1 -0
- package/dist/tiles/stat-tiles.d.ts +40 -0
- package/dist/tiles/stat-tiles.d.ts.map +1 -0
- package/dist/tiles/stat-tiles.js +99 -0
- package/dist/tiles/stat-tiles.js.map +1 -0
- package/dist/tiles/styles.d.ts +2 -0
- package/dist/tiles/styles.d.ts.map +1 -0
- package/dist/tiles/styles.js +23 -0
- package/dist/tiles/styles.js.map +1 -0
- package/dist/tiles/types.d.ts +22 -0
- package/dist/tiles/types.d.ts.map +1 -0
- package/dist/tiles/types.js +2 -0
- package/dist/tiles/types.js.map +1 -0
- package/dist/transcript/follow-scroll.d.ts +21 -0
- package/dist/transcript/follow-scroll.d.ts.map +1 -0
- package/dist/transcript/follow-scroll.js +76 -0
- package/dist/transcript/follow-scroll.js.map +1 -0
- package/dist/transcript/index.d.ts +5 -0
- package/dist/transcript/index.d.ts.map +1 -0
- package/dist/transcript/index.js +7 -0
- package/dist/transcript/index.js.map +1 -0
- package/dist/transcript/styles.d.ts +2 -0
- package/dist/transcript/styles.d.ts.map +1 -0
- package/dist/transcript/styles.js +114 -0
- package/dist/transcript/styles.js.map +1 -0
- package/dist/transcript/tags.d.ts +6 -0
- package/dist/transcript/tags.d.ts.map +1 -0
- package/dist/transcript/tags.js +13 -0
- package/dist/transcript/tags.js.map +1 -0
- package/dist/transcript/tool-card.d.ts +16 -0
- package/dist/transcript/tool-card.d.ts.map +1 -0
- package/dist/transcript/tool-card.js +87 -0
- package/dist/transcript/tool-card.js.map +1 -0
- package/dist/transcript/transcript.d.ts +103 -0
- package/dist/transcript/transcript.d.ts.map +1 -0
- package/dist/transcript/transcript.js +397 -0
- package/dist/transcript/transcript.js.map +1 -0
- package/dist/transcript/types.d.ts +161 -0
- package/dist/transcript/types.d.ts.map +1 -0
- package/dist/transcript/types.js +25 -0
- package/dist/transcript/types.js.map +1 -0
- package/docs/charts.md +58 -0
- package/docs/check-table.md +40 -0
- package/docs/data-table.md +57 -0
- package/docs/examples/charts.ts +61 -0
- package/docs/examples/check-table.ts +19 -0
- package/docs/examples/ci-pipeline.ts +271 -0
- package/docs/examples/data-table.ts +39 -0
- package/docs/examples/graph.ts +57 -0
- package/docs/examples/lanes.ts +40 -0
- package/docs/examples/matrix.ts +56 -0
- package/docs/examples/page.css +34 -0
- package/docs/examples/segmented.ts +18 -0
- package/docs/examples/status.ts +30 -0
- package/docs/examples/theme.css +54 -0
- package/docs/examples/tiles.ts +27 -0
- package/docs/examples/transcript.ts +59 -0
- package/docs/graph.md +112 -0
- package/docs/lanes.md +48 -0
- package/docs/matrix.md +34 -0
- package/docs/page.md +87 -0
- package/docs/primitives.md +57 -0
- package/docs/strings.md +16 -0
- package/docs/theming.md +147 -0
- package/docs/tiles.md +40 -0
- package/docs/transcript.md +73 -0
- package/docs/tsconfig.json +20 -0
- package/package.json +161 -4
- package/src/charts/bar-chart.ts +74 -0
- package/src/charts/base.ts +188 -0
- package/src/charts/column-chart.ts +153 -0
- package/src/charts/heatmap.ts +129 -0
- package/src/charts/index.ts +10 -0
- package/src/charts/line-chart.ts +128 -0
- package/src/charts/scale.ts +61 -0
- package/src/charts/state-grid.ts +245 -0
- package/src/charts/types.ts +48 -0
- package/src/checks/check-table.ts +85 -0
- package/src/checks/index.ts +5 -0
- package/src/checks/styles.ts +31 -0
- package/src/checks/types.ts +48 -0
- package/src/core/clock.ts +46 -0
- package/src/core/define.ts +7 -0
- package/src/core/events.ts +89 -0
- package/src/core/format.ts +25 -0
- package/src/core/frame.ts +5 -0
- package/src/core/strings.ts +11 -0
- package/src/core/tone.ts +14 -0
- package/src/count/count.ts +54 -0
- package/src/count/elapsed.ts +33 -0
- package/src/count/index.ts +4 -0
- package/src/define/all.ts +13 -0
- package/src/define/charts.ts +17 -0
- package/src/define/check-table.ts +9 -0
- package/src/define/count.ts +11 -0
- package/src/define/data-table.ts +9 -0
- package/src/define/graph.ts +11 -0
- package/src/define/json-tree.ts +9 -0
- package/src/define/lanes.ts +9 -0
- package/src/define/markdown.ts +9 -0
- package/src/define/matrix.ts +9 -0
- package/src/define/segmented.ts +9 -0
- package/src/define/tiles.ts +11 -0
- package/src/define/transcript.ts +9 -0
- package/src/graph/arrange.ts +399 -0
- package/src/graph/card.ts +209 -0
- package/src/graph/host.ts +100 -0
- package/src/graph/icons.ts +23 -0
- package/src/graph/index.ts +16 -0
- package/src/graph/layered-graph.ts +417 -0
- package/src/graph/layout.ts +331 -0
- package/src/graph/marks.ts +42 -0
- package/src/graph/nav.ts +19 -0
- package/src/graph/pan-zoom.ts +219 -0
- package/src/graph/paths.ts +41 -0
- package/src/graph/place-card.ts +93 -0
- package/src/graph/strings.ts +86 -0
- package/src/graph/styles.ts +204 -0
- package/src/graph/types.ts +202 -0
- package/src/graph/view.ts +28 -0
- package/src/graph/views/dag.ts +294 -0
- package/src/graph/views/foot.ts +109 -0
- package/src/graph/views/node-table.ts +90 -0
- package/src/index.ts +25 -0
- package/src/json/index.ts +2 -0
- package/src/json/json-tree.ts +49 -0
- package/src/lanes/index.ts +6 -0
- package/src/lanes/lanes.ts +143 -0
- package/src/lanes/stack.ts +51 -0
- package/src/lanes/styles.ts +30 -0
- package/src/lanes/types.ts +51 -0
- package/src/markdown/cae-markdown.ts +64 -0
- package/src/markdown/highlight.ts +94 -0
- package/src/markdown/index.ts +5 -0
- package/src/markdown/markdown.ts +110 -0
- package/src/matrix/grid-step.ts +58 -0
- package/src/matrix/index.ts +6 -0
- package/src/matrix/mark-matrix.ts +285 -0
- package/src/matrix/styles.ts +48 -0
- package/src/matrix/types.ts +83 -0
- package/src/primitives/fact-line.ts +26 -0
- package/src/primitives/icon.ts +26 -0
- package/src/primitives/index.ts +12 -0
- package/src/primitives/legend.ts +56 -0
- package/src/primitives/pill.ts +58 -0
- package/src/primitives/roving-focus.ts +138 -0
- package/src/primitives/segmented.ts +92 -0
- package/src/primitives/share-bar.ts +94 -0
- package/src/primitives/states.ts +28 -0
- package/src/primitives/window.ts +65 -0
- package/src/styles/chips.ts +18 -0
- package/src/styles/facts.ts +7 -0
- package/src/styles/index.ts +19 -0
- package/src/styles/layout.ts +33 -0
- package/src/styles/marks.ts +30 -0
- package/src/styles/meter.ts +9 -0
- package/src/styles/motion.ts +27 -0
- package/src/styles/prose.ts +59 -0
- package/src/styles/reset.ts +13 -0
- package/src/styles/status.ts +52 -0
- package/src/styles/text.ts +21 -0
- package/src/styles/tokens.ts +35 -0
- package/src/table/data-table.ts +367 -0
- package/src/table/index.ts +5 -0
- package/src/table/styles.ts +32 -0
- package/src/table/types.ts +73 -0
- package/src/themes/boot.ts +14 -0
- package/src/themes/choice.ts +47 -0
- package/src/themes/data.ts +433 -0
- package/src/themes/index.ts +10 -0
- package/src/themes/sheet.ts +29 -0
- package/src/themes/token-meanings.ts +67 -0
- package/src/themes/tokens-list.ts +82 -0
- package/src/tiles/index.ts +5 -0
- package/src/tiles/stat-tiles.ts +92 -0
- package/src/tiles/styles.ts +23 -0
- package/src/tiles/types.ts +20 -0
- package/src/transcript/follow-scroll.ts +72 -0
- package/src/transcript/index.ts +6 -0
- package/src/transcript/styles.ts +114 -0
- package/src/transcript/tags.ts +18 -0
- package/src/transcript/tool-card.ts +103 -0
- package/src/transcript/transcript.ts +358 -0
- package/src/transcript/types.ts +167 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { css, html, nothing, svg, type TemplateResult } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import type { Tone } from '../core/tone.js';
|
|
4
|
+
import type { LegendItem } from '../primitives/legend.js';
|
|
5
|
+
import { ChartElement } from './base.js';
|
|
6
|
+
import { LABEL_GAP, labelStride } from './scale.js';
|
|
7
|
+
|
|
8
|
+
/** One cell of a state grid: its state in words, the tone that colours it, and a fact of its own for the tooltip. */
|
|
9
|
+
export interface StateCell {
|
|
10
|
+
label: string;
|
|
11
|
+
tone: Tone;
|
|
12
|
+
tip?: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const CELL_H = 22;
|
|
16
|
+
const GAP = 2;
|
|
17
|
+
const M = { top: 2, right: 2, bottom: 22 };
|
|
18
|
+
/** The narrowest cell that still holds its mark. */
|
|
19
|
+
const MARK_MIN = 14;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A tone's fill: a failure and what needs attention stand out, a cell that ended well
|
|
23
|
+
* stays quiet, so the exceptions are what the eye finds first.
|
|
24
|
+
*/
|
|
25
|
+
export function stateFill(tone: Tone): string {
|
|
26
|
+
switch (tone) {
|
|
27
|
+
case 'failed':
|
|
28
|
+
return 'color-mix(in srgb, var(--status-failed) 72%, var(--card))';
|
|
29
|
+
case 'attention':
|
|
30
|
+
return 'color-mix(in srgb, var(--status-attention) 68%, var(--card))';
|
|
31
|
+
case 'running':
|
|
32
|
+
return 'color-mix(in srgb, var(--status-running) 60%, var(--card))';
|
|
33
|
+
case 'done':
|
|
34
|
+
return 'color-mix(in srgb, var(--status-done) 30%, var(--card))';
|
|
35
|
+
case 'muted':
|
|
36
|
+
return 'color-mix(in srgb, var(--text-muted) 26%, var(--card))';
|
|
37
|
+
default:
|
|
38
|
+
return 'color-mix(in srgb, var(--text) 12%, var(--card))';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The mark a tone takes in a cell, beside its colour: ✓ done, ✕ failed, ◌ attention; none for the others. */
|
|
43
|
+
export function stateMark(tone: Tone): string {
|
|
44
|
+
return tone === 'done' ? '✓' : tone === 'failed' ? '✕' : tone === 'attention' ? '◌' : '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The order of the tones in a legend: the exceptions first, what ended well after. */
|
|
48
|
+
const TONE_ORDER: readonly Tone[] = ['failed', 'attention', 'running', 'done', 'muted', 'neutral'];
|
|
49
|
+
|
|
50
|
+
/** The textures that tell the states of one tone apart, after the first (plain): stripes, dots, crosshatch, lines. */
|
|
51
|
+
export const TEXTURES = ['', 'stripes', 'dots', 'cross', 'lines'] as const;
|
|
52
|
+
export type Texture = (typeof TEXTURES)[number];
|
|
53
|
+
|
|
54
|
+
/** Each state's texture, by `tone` and `label`: the first state of a tone plain, the next ones in `TEXTURES` order (again from the start past the fifth). */
|
|
55
|
+
export function texturesOf(states: readonly StateCell[]): Map<string, Texture> {
|
|
56
|
+
const n = new Map<Tone, number>();
|
|
57
|
+
const out = new Map<string, Texture>();
|
|
58
|
+
for (const s of states) {
|
|
59
|
+
const i = n.get(s.tone) ?? 0;
|
|
60
|
+
n.set(s.tone, i + 1);
|
|
61
|
+
out.set(stateKey(s), TEXTURES[i % TEXTURES.length]!);
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const stateKey = (c: StateCell): string => `${c.tone}\u0000${c.label}`;
|
|
67
|
+
|
|
68
|
+
/** A texture as a CSS background over a legend key's fill. */
|
|
69
|
+
function textureCss(t: Texture): string {
|
|
70
|
+
const ink = 'color-mix(in srgb, var(--text) 45%, transparent)';
|
|
71
|
+
switch (t) {
|
|
72
|
+
case 'stripes':
|
|
73
|
+
return `repeating-linear-gradient(45deg, ${ink} 0 1.5px, transparent 1.5px 4px)`;
|
|
74
|
+
case 'dots':
|
|
75
|
+
return `radial-gradient(${ink} 1px, transparent 1.3px) 0 0 / 4px 4px`;
|
|
76
|
+
case 'cross':
|
|
77
|
+
return `repeating-linear-gradient(45deg, ${ink} 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, ${ink} 0 1px, transparent 1px 4px)`;
|
|
78
|
+
case 'lines':
|
|
79
|
+
return `repeating-linear-gradient(0deg, ${ink} 0 1.5px, transparent 1.5px 4px)`;
|
|
80
|
+
default:
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Each state of the cells once: by tone (failed, attention, running, done, muted, neutral), then in the order the cells first give it. */
|
|
86
|
+
export function statesOf(cells: readonly (readonly (StateCell | null | undefined)[])[]): StateCell[] {
|
|
87
|
+
const seen = new Map<string, StateCell>();
|
|
88
|
+
for (const row of cells) for (const c of row) if (c && !seen.has(stateKey(c))) seen.set(stateKey(c), c);
|
|
89
|
+
return [...seen.values()].sort((a, b) => TONE_ORDER.indexOf(a.tone) - TONE_ORDER.indexOf(b.tone));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A state per row (`y`) and column (`x`), each cell coloured by its tone
|
|
94
|
+
* (`cells[row][column]`; a null cell is left empty): the states of hourly runs by day,
|
|
95
|
+
* say. The colour is never alone: a cell wide enough holds its tone's mark (✓ ✕ ◌), the
|
|
96
|
+
* states of one tone differ by a texture (the first plain, then stripes, dots,
|
|
97
|
+
* crosshatch, lines), the legend names every state with its texture, and pointing at a cell, or moving to it with the arrow keys
|
|
98
|
+
* (up and down by a row), shows its row, column, state and fact; the switch shows them
|
|
99
|
+
* all as a table of words.
|
|
100
|
+
*
|
|
101
|
+
* @tagname cae-state-grid
|
|
102
|
+
* @csspart plot - the grid
|
|
103
|
+
* @csspart table - the table of its states
|
|
104
|
+
* @csspart switch - the button between the two
|
|
105
|
+
* @csspart empty - what it shows with no cells
|
|
106
|
+
* @csspart legend - the legend
|
|
107
|
+
*/
|
|
108
|
+
export class CaeStateGrid extends ChartElement {
|
|
109
|
+
static override styles = [
|
|
110
|
+
...ChartElement.styles,
|
|
111
|
+
css`
|
|
112
|
+
.mark { font-size: 11px; font-weight: 700; fill: var(--text); pointer-events: none; }
|
|
113
|
+
/* a cell that ended well keeps its mark, quietly: the exceptions are what the eye finds */
|
|
114
|
+
.mark.quiet { font-weight: 400; fill: var(--text-muted); }
|
|
115
|
+
.legend .key { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 6px; border-radius: 3px;
|
|
116
|
+
font-size: 9.5px; font-weight: 700; color: var(--text); vertical-align: -2px; }
|
|
117
|
+
`,
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
@property({ attribute: false }) x: readonly string[] = [];
|
|
121
|
+
@property({ attribute: false }) y: readonly string[] = [];
|
|
122
|
+
@property({ attribute: false }) cells: readonly (readonly (StateCell | null)[])[] = [];
|
|
123
|
+
|
|
124
|
+
protected hasValues(): boolean {
|
|
125
|
+
return this.x.length > 0 && this.y.length > 0 && this.cells.some((r) => r.some((c) => !!c));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
protected legendItems(): LegendItem[] {
|
|
129
|
+
const states = statesOf(this.cells);
|
|
130
|
+
const textures = texturesOf(states);
|
|
131
|
+
return states.map((s) => {
|
|
132
|
+
const t = textureCss(textures.get(stateKey(s)) ?? '');
|
|
133
|
+
return {
|
|
134
|
+
label: s.label,
|
|
135
|
+
icon: html`<span class="key" aria-hidden="true" data-texture=${textures.get(stateKey(s)) || nothing}
|
|
136
|
+
style="background: ${t ? `${t}, ` : ''}${stateFill(s.tone)}">${stateMark(s.tone)}</span>`,
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
protected itemCount(): number {
|
|
142
|
+
return this.x.length * this.y.length;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
protected override rowLength(): number {
|
|
146
|
+
return this.x.length;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
protected plot(): TemplateResult {
|
|
150
|
+
const nx = this.x.length;
|
|
151
|
+
const ny = this.y.length;
|
|
152
|
+
const left = Math.max(...this.y.map((s) => this.labelWidth(s))) + 2;
|
|
153
|
+
const w = this.plotWidth;
|
|
154
|
+
const pw = w - left - M.right;
|
|
155
|
+
const cw = pw / nx;
|
|
156
|
+
const h = M.top + ny * CELL_H + M.bottom;
|
|
157
|
+
const stride = labelStride(nx, pw, Math.max(...this.x.map((s) => this.labelWidth(s))) + LABEL_GAP);
|
|
158
|
+
const a = this.active;
|
|
159
|
+
const marked = cw - GAP >= MARK_MIN;
|
|
160
|
+
const textures = texturesOf(statesOf(this.cells));
|
|
161
|
+
const cells: TemplateResult[] = [];
|
|
162
|
+
for (let r = 0; r < ny; r++)
|
|
163
|
+
for (let c = 0; c < nx; c++) {
|
|
164
|
+
const cell = this.cells[r]?.[c];
|
|
165
|
+
const x = left + c * cw;
|
|
166
|
+
const y = M.top + r * CELL_H;
|
|
167
|
+
const i = r * nx + c;
|
|
168
|
+
const box = { x: x + GAP / 2, y: y + GAP / 2, w: Math.max(1, cw - GAP), h: CELL_H - GAP };
|
|
169
|
+
if (!cell) {
|
|
170
|
+
cells.push(svg`<rect x=${box.x} y=${box.y} width=${box.w} height=${box.h} rx="2" fill="none" stroke="var(--line)"
|
|
171
|
+
@mouseenter=${() => (this.active = i)}></rect>`);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const mark = marked ? stateMark(cell.tone) : '';
|
|
175
|
+
const texture = textures.get(stateKey(cell)) ?? '';
|
|
176
|
+
cells.push(svg`<g @mouseenter=${() => (this.active = i)}>
|
|
177
|
+
<rect x=${box.x} y=${box.y} width=${box.w} height=${box.h} rx="2" fill=${stateFill(cell.tone)}
|
|
178
|
+
stroke=${a === i ? 'var(--text)' : 'none'} stroke-width="1.5"></rect>
|
|
179
|
+
${texture ? svg`<rect class="texture" data-texture=${texture} x=${box.x} y=${box.y} width=${box.w} height=${box.h} rx="2" fill=${`url(#${this.patternId(texture)})`} pointer-events="none"></rect>` : nothing}
|
|
180
|
+
${mark ? svg`<text class=${cell.tone === 'done' ? 'mark quiet' : 'mark'} x=${box.x + box.w / 2} y=${box.y + box.h / 2} dy="0.35em" text-anchor="middle" aria-hidden="true">${mark}</text>` : nothing}
|
|
181
|
+
</g>`);
|
|
182
|
+
}
|
|
183
|
+
const at = a !== null && a < nx * ny ? { r: Math.floor(a / nx), c: a % nx } : null;
|
|
184
|
+
return html`<svg width=${w} height=${h} role="img" aria-label=${this.label || nothing}>
|
|
185
|
+
${this.patterns(new Set(textures.values()))}
|
|
186
|
+
${this.y.map((label, r) => svg`<text class="axis" x=${left - 6} y=${M.top + r * CELL_H + CELL_H / 2} dy="0.32em" text-anchor="end">${label}</text>`)}
|
|
187
|
+
${cells}
|
|
188
|
+
${this.x.map((label, c) =>
|
|
189
|
+
c % stride === 0 ? svg`<text class="axis" x=${left + c * cw + cw / 2} y=${h - 6} text-anchor="middle">${label}</text>` : nothing,
|
|
190
|
+
)}
|
|
191
|
+
</svg>
|
|
192
|
+
${at ? this.tip(left + at.c * cw + cw / 2, M.top + (at.r + 1) * CELL_H, this.tipBody(at.r, at.c)) : nothing}`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** One id per element and texture: two grids in a page keep their own patterns. */
|
|
196
|
+
private readonly uid = `sg${Math.random().toString(36).slice(2, 8)}`;
|
|
197
|
+
|
|
198
|
+
private patternId(t: Texture): string {
|
|
199
|
+
return `${this.uid}-${t}`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** The SVG patterns of the textures in use, drawn in the text's colour over a cell's fill. */
|
|
203
|
+
private patterns(used: ReadonlySet<Texture>): TemplateResult {
|
|
204
|
+
const line = (d: string) => svg`<path d=${d} stroke="var(--text)" stroke-opacity="0.45" stroke-width="1.2"></path>`;
|
|
205
|
+
const body = (t: Texture) =>
|
|
206
|
+
t === 'stripes'
|
|
207
|
+
? line('M-1 1 L1 -1 M0 5 L5 0 M4 6 L6 4')
|
|
208
|
+
: t === 'dots'
|
|
209
|
+
? svg`<circle cx="2.5" cy="2.5" r="0.9" fill="var(--text)" fill-opacity="0.5"></circle>`
|
|
210
|
+
: t === 'cross'
|
|
211
|
+
? line('M0 0 L5 5 M5 0 L0 5')
|
|
212
|
+
: line('M0 2.5 L5 2.5');
|
|
213
|
+
return svg`<defs>${[...used].filter((t) => t).map(
|
|
214
|
+
(t) => svg`<pattern id=${this.patternId(t)} width="5" height="5" patternUnits="userSpaceOnUse">${body(t)}</pattern>`,
|
|
215
|
+
)}</defs>`;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private tipBody(r: number, c: number): TemplateResult {
|
|
219
|
+
const cell = this.cells[r]?.[c];
|
|
220
|
+
return html`<b>${this.y[r]} | ${this.x[c]}</b>
|
|
221
|
+
<div class="row">${cell
|
|
222
|
+
? html`<i style="background: ${stateFill(cell.tone)}"></i><span>${cell.label}</span>`
|
|
223
|
+
: html`<span>${this.words.none}</span>`}</div>
|
|
224
|
+
${cell?.tip ? html`<div class="row"><span>${cell.tip}</span></div>` : nothing}`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
protected table(): TemplateResult {
|
|
228
|
+
const none = this.words.none;
|
|
229
|
+
return html`<table aria-label=${this.label || nothing}>
|
|
230
|
+
<thead><tr><th scope="col">${this.words.label}</th>${this.x.map((l) => html`<th scope="col">${l}</th>`)}</tr></thead>
|
|
231
|
+
<tbody>${this.y.map(
|
|
232
|
+
(label, r) => html`<tr><th scope="row">${label}</th>${this.x.map((_, c) => {
|
|
233
|
+
const cell = this.cells[r]?.[c];
|
|
234
|
+
return html`<td title=${cell?.tip || nothing}>${cell ? cell.label : none}</td>`;
|
|
235
|
+
})}</tr>`,
|
|
236
|
+
)}</tbody>
|
|
237
|
+
</table>`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare global {
|
|
242
|
+
interface HTMLElementTagNameMap {
|
|
243
|
+
'cae-state-grid': CaeStateGrid;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// What the charts take: plain series of numbers, and their words.
|
|
2
|
+
import type { Tone } from '../core/tone.js';
|
|
3
|
+
|
|
4
|
+
/** One series: a value per label of the chart's `x`, in that order; null where it has none. */
|
|
5
|
+
export interface ChartSeries {
|
|
6
|
+
name: string;
|
|
7
|
+
values: readonly (number | null)[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** One horizontal bar: its label and value; `tone` gives it a status colour. */
|
|
11
|
+
export interface ChartBar {
|
|
12
|
+
label: string;
|
|
13
|
+
value: number;
|
|
14
|
+
tone?: Tone;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A number in words (`$1.20`, `42%`, `2m 05s`): the host's format for the chart's unit. */
|
|
18
|
+
export type ValueText = (value: number) => string;
|
|
19
|
+
|
|
20
|
+
/** The words of a chart. */
|
|
21
|
+
export interface ChartStrings {
|
|
22
|
+
/** What a chart with nothing to draw says. */
|
|
23
|
+
empty: string;
|
|
24
|
+
/** The button that shows the values as a table, and the one that shows the chart again. */
|
|
25
|
+
showTable: string;
|
|
26
|
+
showChart: string;
|
|
27
|
+
/** The column of a table view that holds the labels of `x` (or of the bars). */
|
|
28
|
+
label: string;
|
|
29
|
+
/** The name of the series past the sixth, folded into one. */
|
|
30
|
+
other: string;
|
|
31
|
+
/** The sum of a label's stacked series. */
|
|
32
|
+
total: string;
|
|
33
|
+
/** A value a series has not (null). */
|
|
34
|
+
none: string;
|
|
35
|
+
/** The heatmap's colour scale: its lowest and highest value. */
|
|
36
|
+
scale: (low: string, high: string) => string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const DEFAULT_CHART_STRINGS: ChartStrings = {
|
|
40
|
+
empty: 'No values',
|
|
41
|
+
showTable: 'Show table',
|
|
42
|
+
showChart: 'Show chart',
|
|
43
|
+
label: 'Label',
|
|
44
|
+
other: 'Other',
|
|
45
|
+
total: 'Total',
|
|
46
|
+
none: '—',
|
|
47
|
+
scale: (low, high) => `${low} to ${high}`,
|
|
48
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { LitElement, html, nothing, type TemplateResult } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { withDefaults } from '../core/strings.js';
|
|
4
|
+
import { base } from '../styles/index.js';
|
|
5
|
+
import { checkTableStyles, verdictStyles } from './styles.js';
|
|
6
|
+
import { DEFAULT_CHECK_TABLE_STRINGS, type CheckRow, type CheckTableStrings, type Verdict } from './types.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A verdict in words (`.verdict`, `data-verdict`; `verdictStyles`): ✓ before a
|
|
10
|
+
* pass, ✕ before a failure, hidden from screen readers, which read the word.
|
|
11
|
+
* Nothing for `none` without a word.
|
|
12
|
+
*/
|
|
13
|
+
export function verdict(v: Verdict, label: string, tip = ''): TemplateResult | typeof nothing {
|
|
14
|
+
if (v === 'none' && !label) return nothing;
|
|
15
|
+
const mark = v === 'pass' ? '✓' : v === 'fail' ? '✕' : '';
|
|
16
|
+
return html`<span class="verdict" part="verdict" data-verdict=${v} title=${tip || nothing}>${mark
|
|
17
|
+
? html`<span aria-hidden="true">${mark}</span> `
|
|
18
|
+
: nothing}${label}</span>`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const cut = (s: string, n: number) => (s.length > n ? `${s.slice(0, n)}…` : s);
|
|
22
|
+
|
|
23
|
+
/** A value in a line: a string quoted and cut, a list's length and first items, an object's first keys. */
|
|
24
|
+
function shortValue(v: unknown, s: CheckTableStrings): TemplateResult {
|
|
25
|
+
if (v === undefined) return html`<span class="jdim">—</span>`;
|
|
26
|
+
if (typeof v === 'string') return html`<span class="js" title=${v}>"${cut(v, 90)}"</span>`;
|
|
27
|
+
if (Array.isArray(v)) {
|
|
28
|
+
const head = v
|
|
29
|
+
.slice(0, 3)
|
|
30
|
+
.map((x) => (typeof x === 'string' ? `"${cut(x, 28)}"` : JSON.stringify(x)))
|
|
31
|
+
.join(', ');
|
|
32
|
+
return html`<span class="jn">${s.items(v.length)}</span>
|
|
33
|
+
<span class="jdim">${head}${v.length > 3 ? ', …' : ''}</span>`;
|
|
34
|
+
}
|
|
35
|
+
if (v !== null && typeof v === 'object') return html`<span class="jn">${s.object}</span> <span class="jdim">${Object.keys(v).slice(0, 4).join(', ')}</span>`;
|
|
36
|
+
return html`<span class="jn">${JSON.stringify(v)}</span>`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Named values checked one by one: a row per name, with what it must be, what
|
|
41
|
+
* it is and the verdict. Without `showValues`, only the names and what each
|
|
42
|
+
* must be (nothing to check them against).
|
|
43
|
+
*
|
|
44
|
+
* @tagname cae-check-table
|
|
45
|
+
* @csspart table - the `<table>`
|
|
46
|
+
* @csspart row - each row of a name
|
|
47
|
+
* @csspart verdict - each verdict
|
|
48
|
+
*/
|
|
49
|
+
export class CaeCheckTable extends LitElement {
|
|
50
|
+
static override styles = [base, verdictStyles, checkTableStyles];
|
|
51
|
+
|
|
52
|
+
@property({ attribute: false }) rows: readonly CheckRow[] = [];
|
|
53
|
+
/** Show the values and the verdicts. */
|
|
54
|
+
@property({ type: Boolean }) showValues = true;
|
|
55
|
+
@property({ attribute: false }) strings: Partial<CheckTableStrings> = {};
|
|
56
|
+
|
|
57
|
+
override render() {
|
|
58
|
+
const s = withDefaults(DEFAULT_CHECK_TABLE_STRINGS, this.strings);
|
|
59
|
+
const all = this.showValues;
|
|
60
|
+
return html`<table part="table">
|
|
61
|
+
<thead><tr>
|
|
62
|
+
<th scope="col">${s.name}</th><th scope="col">${s.expected}</th>
|
|
63
|
+
${all ? html`<th scope="col">${s.actual}</th><th scope="col">${s.verdict}</th>` : nothing}
|
|
64
|
+
</tr></thead>
|
|
65
|
+
<tbody>
|
|
66
|
+
${this.rows.map(
|
|
67
|
+
(r) => html`<tr part="row">
|
|
68
|
+
<td class="jmono">${r.name}</td>
|
|
69
|
+
<td class=${r.extra ? 'jdim' : 'jmono jdim'}>${r.expected}${r.optional ? html` <i>${s.optional}</i>` : nothing}</td>
|
|
70
|
+
${all
|
|
71
|
+
? html`<td class="value">${shortValue(r.hasValue ? r.value : undefined, s)}</td>
|
|
72
|
+
<td>${verdict(r.verdict, r.verdictLabel, r.tip)}</td>`
|
|
73
|
+
: nothing}
|
|
74
|
+
</tr>`,
|
|
75
|
+
)}
|
|
76
|
+
</tbody>
|
|
77
|
+
</table>`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare global {
|
|
82
|
+
interface HTMLElementTagNameMap {
|
|
83
|
+
'cae-check-table': CaeCheckTable;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The look of `<cae-check-table>`, and of a verdict (`verdict()`) wherever a
|
|
2
|
+
// host shows one.
|
|
3
|
+
import { css } from 'lit';
|
|
4
|
+
|
|
5
|
+
/** A verdict: ✓ and its word quiet, ✕ and its word in the failed tone, a warning in the attention tone. */
|
|
6
|
+
export const verdictStyles = css`
|
|
7
|
+
.verdict { font-size: 12px; }
|
|
8
|
+
.verdict[data-verdict='pass'] { color: var(--text-2); }
|
|
9
|
+
.verdict[data-verdict='pass'] > [aria-hidden] { color: var(--status-done); font-weight: 700; }
|
|
10
|
+
.verdict[data-verdict='fail'] { color: var(--status-failed); font-weight: 600; }
|
|
11
|
+
.verdict[data-verdict='warn'] { color: var(--status-attention); }
|
|
12
|
+
.verdict[data-verdict='none'] { color: var(--text-muted); }
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
/** Sized to its content, so a verdict sits next to the value it judges; a long value wraps. */
|
|
16
|
+
export const checkTableStyles = css`
|
|
17
|
+
:host { display: block; max-width: 100%; }
|
|
18
|
+
table { width: auto; max-width: 100%; border-collapse: collapse; }
|
|
19
|
+
th { text-align: left; font-size: 11.5px; color: var(--text-muted);
|
|
20
|
+
font-weight: 600; padding: 4px 20px 4px 0; border-bottom: 1px solid var(--line); }
|
|
21
|
+
td { padding: 5px 20px 5px 0; border: 0; border-bottom: 1px solid var(--line); vertical-align: baseline; font-size: 12.5px; }
|
|
22
|
+
th:last-child, td:last-child { padding-right: 0; }
|
|
23
|
+
td.value { overflow-wrap: anywhere; }
|
|
24
|
+
tbody tr:last-child td { border-bottom: 0; }
|
|
25
|
+
/* a name stays on one line while the table has the room, and breaks where it must */
|
|
26
|
+
td:first-child { font-weight: 600; overflow-wrap: anywhere; }
|
|
27
|
+
td:last-child { white-space: nowrap; }
|
|
28
|
+
i { font-style: normal; color: var(--text-muted); font-size: 11px; margin-left: 4px; }
|
|
29
|
+
.js { color: var(--code-string); }
|
|
30
|
+
.jn { color: var(--code-number); }
|
|
31
|
+
`;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// What `<cae-check-table>` shows: a row per named value, what it must be, what
|
|
2
|
+
// it is, and the verdict.
|
|
3
|
+
|
|
4
|
+
/** A check's result: passed, failed, a warning, or no verdict (a word may still say why). */
|
|
5
|
+
export type Verdict = 'pass' | 'fail' | 'warn' | 'none';
|
|
6
|
+
|
|
7
|
+
export interface CheckRow {
|
|
8
|
+
/** What is checked: a field's name. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** What it must be: a type, in code; with `extra`, a phrase. */
|
|
11
|
+
expected: string;
|
|
12
|
+
/** It may be absent: "optional" follows `expected`. */
|
|
13
|
+
optional?: boolean;
|
|
14
|
+
/** Not one of the expected names: `expected` is a phrase, not code. */
|
|
15
|
+
extra?: boolean;
|
|
16
|
+
/** The value was found (`value`, possibly undefined or null); else "—". */
|
|
17
|
+
hasValue: boolean;
|
|
18
|
+
value?: unknown;
|
|
19
|
+
verdict: Verdict;
|
|
20
|
+
/** The verdict in words; '' with `none` for an empty cell. */
|
|
21
|
+
verdictLabel: string;
|
|
22
|
+
/** The verdict's tooltip. */
|
|
23
|
+
tip?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CheckTableStrings {
|
|
27
|
+
/** The header of the names. */
|
|
28
|
+
name: string;
|
|
29
|
+
expected: string;
|
|
30
|
+
/** The header of the values. */
|
|
31
|
+
actual: string;
|
|
32
|
+
verdict: string;
|
|
33
|
+
optional: string;
|
|
34
|
+
/** A list's length. */
|
|
35
|
+
items: (n: number) => string;
|
|
36
|
+
/** An object's summary, before its first keys. */
|
|
37
|
+
object: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const DEFAULT_CHECK_TABLE_STRINGS: CheckTableStrings = {
|
|
41
|
+
name: 'Name',
|
|
42
|
+
expected: 'Expected',
|
|
43
|
+
actual: 'Value',
|
|
44
|
+
verdict: 'Check',
|
|
45
|
+
optional: 'optional',
|
|
46
|
+
items: (n) => (n === 1 ? '1 item' : `${n} items`),
|
|
47
|
+
object: 'object',
|
|
48
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// One shared once-a-second tick for every element that shows a running clock.
|
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
|
+
|
|
4
|
+
const hosts = new Set<ReactiveControllerHost>();
|
|
5
|
+
let timer: ReturnType<typeof setInterval> | null = null;
|
|
6
|
+
|
|
7
|
+
function tick(): void {
|
|
8
|
+
for (const h of hosts) h.requestUpdate();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Re-renders its host every second while it is connected. */
|
|
12
|
+
export class ClockController implements ReactiveController {
|
|
13
|
+
constructor(private readonly host: ReactiveControllerHost) {
|
|
14
|
+
host.addController(this);
|
|
15
|
+
}
|
|
16
|
+
hostConnected(): void {
|
|
17
|
+
hosts.add(this.host);
|
|
18
|
+
timer ??= setInterval(tick, 1000);
|
|
19
|
+
}
|
|
20
|
+
hostDisconnected(): void {
|
|
21
|
+
hosts.delete(this.host);
|
|
22
|
+
if (!hosts.size && timer) {
|
|
23
|
+
clearInterval(timer);
|
|
24
|
+
timer = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Start times that stay put. A process reports its age in whole seconds, so
|
|
31
|
+
* `now - age` jitters by a second between updates; the first value seen for an
|
|
32
|
+
* id is kept while later ones stay within a few seconds of it.
|
|
33
|
+
*/
|
|
34
|
+
export class StableStarts {
|
|
35
|
+
private readonly seen = new Map<string, number>();
|
|
36
|
+
at(id: string, ageS: number, now = Date.now()): number {
|
|
37
|
+
const t0 = Math.round(now - ageS * 1000);
|
|
38
|
+
const prev = this.seen.get(id);
|
|
39
|
+
if (prev !== undefined && Math.abs(prev - t0) < 5000) return prev;
|
|
40
|
+
this.seen.set(id, t0);
|
|
41
|
+
return t0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Shared by every view, so the same process shows the same start everywhere. */
|
|
46
|
+
export const starts = new StableStarts();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Registration. The element classes are plain classes: a `define/` module (or
|
|
2
|
+
// the host, under a tag name of its own) registers them.
|
|
3
|
+
|
|
4
|
+
/** Registers `cls` as `tag`, unless the tag is already registered. */
|
|
5
|
+
export function defineElement(tag: string, cls: CustomElementConstructor): void {
|
|
6
|
+
if (!customElements.get(tag)) customElements.define(tag, cls);
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// The events the generic elements send. Each bubbles and crosses shadow roots
|
|
2
|
+
// (`composed`), so a host listens on any ancestor. An element states what the
|
|
3
|
+
// reader did; its host decides what happens.
|
|
4
|
+
|
|
5
|
+
/** A control's value changed (a segmented control). */
|
|
6
|
+
export interface ChangeDetail {
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** An item, by its id (a row's key). */
|
|
11
|
+
export interface ItemDetail {
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** An item opened (`open`) or closed. */
|
|
16
|
+
export interface ToggleDetail {
|
|
17
|
+
id: string;
|
|
18
|
+
open: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The item chosen as the selection; null when the selection was cleared. */
|
|
22
|
+
export interface SelectDetail {
|
|
23
|
+
id: string | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A column to order the items by, and the direction. */
|
|
27
|
+
export interface SortDetail {
|
|
28
|
+
id: string;
|
|
29
|
+
direction: 'asc' | 'desc';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A view of the same data: a drawing, or a table. */
|
|
33
|
+
export interface ViewDetail {
|
|
34
|
+
view: 'graph' | 'table';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A named action of an item (a tile's link): the item's id and the action's id. */
|
|
38
|
+
export interface ActionDetail {
|
|
39
|
+
id: string;
|
|
40
|
+
action: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** A section of a list of sections (a transcript's), by its 0-based index; null: the latest. */
|
|
44
|
+
export interface SectionDetail {
|
|
45
|
+
index: number | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Every `cae-*` event and its detail. */
|
|
49
|
+
export interface CaeEventMap {
|
|
50
|
+
'cae-change': ChangeDetail;
|
|
51
|
+
/** The item's primary action (a click or Enter on an item that has one). */
|
|
52
|
+
'cae-activate': ItemDetail;
|
|
53
|
+
'cae-select': SelectDetail;
|
|
54
|
+
'cae-sort': SortDetail;
|
|
55
|
+
'cae-action': ActionDetail;
|
|
56
|
+
/** Enter an item's inner view (a cluster, a node or a mark that has one). */
|
|
57
|
+
'cae-drill': ItemDetail;
|
|
58
|
+
/** The reader opened or closed an item (`open`: it is to be drawn open). */
|
|
59
|
+
'cae-toggle': ToggleDetail;
|
|
60
|
+
/** The reader chose another view. */
|
|
61
|
+
'cae-view-change': ViewDetail;
|
|
62
|
+
/** The reader picked a section (null: follow the latest). */
|
|
63
|
+
'cae-section-change': SectionDetail;
|
|
64
|
+
/** The section on screen changed (-1: none). */
|
|
65
|
+
'cae-section-shown': { index: number };
|
|
66
|
+
/** The reader asked for the content before what is loaded. */
|
|
67
|
+
'cae-load-earlier': Record<string, never>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare global {
|
|
71
|
+
interface HTMLElementEventMap {
|
|
72
|
+
'cae-change': CustomEvent<ChangeDetail>;
|
|
73
|
+
'cae-activate': CustomEvent<ItemDetail>;
|
|
74
|
+
'cae-select': CustomEvent<SelectDetail>;
|
|
75
|
+
'cae-sort': CustomEvent<SortDetail>;
|
|
76
|
+
'cae-action': CustomEvent<ActionDetail>;
|
|
77
|
+
'cae-drill': CustomEvent<ItemDetail>;
|
|
78
|
+
'cae-toggle': CustomEvent<ToggleDetail>;
|
|
79
|
+
'cae-view-change': CustomEvent<ViewDetail>;
|
|
80
|
+
'cae-section-change': CustomEvent<SectionDetail>;
|
|
81
|
+
'cae-section-shown': CustomEvent<{ index: number }>;
|
|
82
|
+
'cae-load-earlier': CustomEvent<Record<string, never>>;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Sends a `cae-*` event from `el`: bubbling and composed. */
|
|
87
|
+
export function emit<K extends keyof CaeEventMap>(el: EventTarget, name: K, detail: CaeEventMap[K]): boolean {
|
|
88
|
+
return el.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
|
|
89
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Formats that read the same in every language: a duration, and HTML escaping
|
|
2
|
+
// for the few places that build markup as a string.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A duration in seconds, in one format: `<0.1s`, `4.2s`, `37s`, `2m 05s`,
|
|
6
|
+
* `1h 02m`; '—' when unknown.
|
|
7
|
+
*/
|
|
8
|
+
export function fmtDur(s: number | null | undefined): string {
|
|
9
|
+
if (s === null || s === undefined || Number.isNaN(s)) return '—';
|
|
10
|
+
const v = Math.max(0, s);
|
|
11
|
+
if (v < 0.05) return '<0.1s';
|
|
12
|
+
if (v < 9.95) return `${v.toFixed(1)}s`;
|
|
13
|
+
const r = Math.round(v);
|
|
14
|
+
if (r < 60) return `${r}s`;
|
|
15
|
+
if (r < 3600) return `${Math.floor(r / 60)}m ${String(r % 60).padStart(2, '0')}s`;
|
|
16
|
+
return `${Math.floor(r / 3600)}h ${String(Math.floor((r % 3600) / 60)).padStart(2, '0')}m`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** HTML-escape a text for the few places that build markup as a string (markdown, highlighting). */
|
|
20
|
+
export const esc = (s: string | number | null | undefined): string =>
|
|
21
|
+
String(s ?? '')
|
|
22
|
+
.replace(/&/g, '&')
|
|
23
|
+
.replace(/</g, '<')
|
|
24
|
+
.replace(/>/g, '>')
|
|
25
|
+
.replace(/"/g, '"');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// An element's visible words. Each element takes `strings: Partial<XStrings>`
|
|
2
|
+
// and falls back to its English defaults (`DEFAULT_X_STRINGS`) for a word it is
|
|
3
|
+
// not given; a word with a number is a function, so plural rules and word order
|
|
4
|
+
// belong to the host.
|
|
5
|
+
|
|
6
|
+
/** `given` over `defaults`: a word left out (or undefined) keeps its default. */
|
|
7
|
+
export function withDefaults<T extends object>(defaults: Readonly<T>, given: Partial<T> | null | undefined): T {
|
|
8
|
+
const out = { ...defaults };
|
|
9
|
+
if (given) for (const [k, v] of Object.entries(given)) if (v !== undefined) (out as Record<string, unknown>)[k] = v;
|
|
10
|
+
return out;
|
|
11
|
+
}
|
package/src/core/tone.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// A tone: the status colour a value takes. The names are the token names
|
|
2
|
+
// (`--ca-status-<tone>`); `neutral` is the text colour, with no `data-tone`.
|
|
3
|
+
// An element shows a tone as `data-tone` (styles/status.ts draws it).
|
|
4
|
+
import { nothing } from 'lit';
|
|
5
|
+
|
|
6
|
+
/** A status colour, or `neutral` for the text colour. */
|
|
7
|
+
export type Tone = 'failed' | 'attention' | 'done' | 'running' | 'muted' | 'neutral';
|
|
8
|
+
|
|
9
|
+
/** Every tone with a status colour (a `data-tone` value): each but `neutral`. */
|
|
10
|
+
export const TONES: readonly Exclude<Tone, 'neutral'>[] = ['failed', 'attention', 'done', 'running', 'muted'];
|
|
11
|
+
|
|
12
|
+
/** The `data-tone` attribute of a tone: none for `neutral` (or no tone). */
|
|
13
|
+
export const toneAttr = (tone: Tone | null | undefined): Exclude<Tone, 'neutral'> | typeof nothing =>
|
|
14
|
+
tone && tone !== 'neutral' ? tone : nothing;
|