@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,285 @@
|
|
|
1
|
+
// A mark matrix: a row per series, a column per item, nested groups of columns
|
|
2
|
+
// above them; only the rows in view above `windowAt` rows.
|
|
3
|
+
import { LitElement, adoptStyles, html, nothing, type CSSResult, type PropertyValues } from 'lit';
|
|
4
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import { emit } from '../core/events.js';
|
|
6
|
+
import { withDefaults } from '../core/strings.js';
|
|
7
|
+
import { toneAttr } from '../core/tone.js';
|
|
8
|
+
import { icon } from '../primitives/icon.js';
|
|
9
|
+
import type { StateStyles } from '../primitives/states.js';
|
|
10
|
+
import { base, markStyles } from '../styles/index.js';
|
|
11
|
+
import { gridStep } from './grid-step.js';
|
|
12
|
+
import { ROW_H, matrixStyles } from './styles.js';
|
|
13
|
+
import { DEFAULT_MARK_MATRIX_STRINGS, type MarkMatrixInput, type MarkMatrixStrings, type MatrixHeadCell, type MatrixMark, type MatrixRowInput } from './types.js';
|
|
14
|
+
|
|
15
|
+
/** The rows drawn around those in view, when windowed. */
|
|
16
|
+
const OVERSCAN = 30;
|
|
17
|
+
|
|
18
|
+
const EMPTY: MarkMatrixInput = { caption: '', label: '', head: [], columns: [], rows: [] };
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A table of marks: a row per series (its label, then a value), a column per item,
|
|
22
|
+
* the columns under nested groups (a border where a group starts). A mark is
|
|
23
|
+
* drawn in its state's look (`states`). A click selects a mark (`cae-select`);
|
|
24
|
+
* a double click or Enter is its action (`cae-activate`, or `cae-drill` for a mark
|
|
25
|
+
* with an inner view). The arrow keys, Home, End, Page Up and Page Down move
|
|
26
|
+
* between the marks (Ctrl with Home and End: the first and the last row). The
|
|
27
|
+
* hovered, focused or selected mark's row is highlighted, else `highlight`'s. The
|
|
28
|
+
* host sorts the rows: the sort control sends `cae-sort`. Above `windowAt` rows,
|
|
29
|
+
* only the rows in view are drawn.
|
|
30
|
+
*
|
|
31
|
+
* @tagname cae-mark-matrix
|
|
32
|
+
* @fires cae-select - `{id}`: a mark was clicked or focused
|
|
33
|
+
* @fires cae-activate - `{id}`: a mark's action (a double click or Enter)
|
|
34
|
+
* @fires cae-drill - `{id}`: a mark's inner view (a double click or Enter on a mark with `drill`)
|
|
35
|
+
* @fires cae-sort - `{id, direction: 'asc'}`: an order was chosen
|
|
36
|
+
* @csspart matrix - the `<table>`
|
|
37
|
+
* @csspart head-cell - each header cell
|
|
38
|
+
* @csspart row-header - each row's label
|
|
39
|
+
* @csspart mark - each mark
|
|
40
|
+
* @csspart sort - the sort control
|
|
41
|
+
*/
|
|
42
|
+
export class CaeMarkMatrix extends LitElement {
|
|
43
|
+
static override styles = [base, markStyles, matrixStyles];
|
|
44
|
+
static override properties = {
|
|
45
|
+
matrix: { attribute: false },
|
|
46
|
+
states: { attribute: false },
|
|
47
|
+
selected: { attribute: false },
|
|
48
|
+
highlight: { attribute: false },
|
|
49
|
+
key: {},
|
|
50
|
+
windowAt: { type: Number },
|
|
51
|
+
strings: { attribute: false },
|
|
52
|
+
renderIcon: { attribute: false },
|
|
53
|
+
iconStyles: { attribute: false },
|
|
54
|
+
hover: { state: true },
|
|
55
|
+
scrollRow: { state: true },
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
matrix: MarkMatrixInput = EMPTY;
|
|
59
|
+
states: StateStyles = {};
|
|
60
|
+
/** The selected mark's id, or null. */
|
|
61
|
+
selected: string | null = null;
|
|
62
|
+
/** The row highlighted while no mark is hovered, focused or selected. */
|
|
63
|
+
highlight: string | null = null;
|
|
64
|
+
/** The matrix's identity: a new key is a new matrix (the scroll and the focused mark start over). */
|
|
65
|
+
key = '';
|
|
66
|
+
/** Above this many rows, only the rows in view are drawn. */
|
|
67
|
+
windowAt = 150;
|
|
68
|
+
strings: Partial<MarkMatrixStrings> = {};
|
|
69
|
+
/** Draws an icon of a header cell; default: `icon(name)`. */
|
|
70
|
+
renderIcon: (name: string) => unknown = (name) => icon(name);
|
|
71
|
+
/** Styles for what `renderIcon` draws, added to the element's own. */
|
|
72
|
+
iconStyles: readonly CSSResult[] = [];
|
|
73
|
+
|
|
74
|
+
/** The row (or a mark without one) under the pointer or focus. */
|
|
75
|
+
private hover: string | null = null;
|
|
76
|
+
/** The first row in view, and the focused cell (row, column). */
|
|
77
|
+
private scrollRow = 0;
|
|
78
|
+
private cell: [number, number] | null = null;
|
|
79
|
+
|
|
80
|
+
protected override willUpdate(changed: PropertyValues<this>): void {
|
|
81
|
+
if (changed.has('key') && changed.get('key') !== undefined) {
|
|
82
|
+
this.scrollRow = 0;
|
|
83
|
+
this.cell = null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
protected override updated(changed: PropertyValues<this>): void {
|
|
88
|
+
if (changed.has('iconStyles') && this.renderRoot instanceof ShadowRoot)
|
|
89
|
+
adoptStyles(this.renderRoot, [...(this.constructor as typeof LitElement).elementStyles, ...this.iconStyles]);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** The highlighted row: the one hovered or focused, else the selected mark's, else `highlight`. */
|
|
93
|
+
private lit(): string | null {
|
|
94
|
+
if (this.hover !== null) return this.hover;
|
|
95
|
+
const row = this.selected ? this.matrix.rows.find((r) => r.cells.some((m) => m?.id === this.selected)) : undefined;
|
|
96
|
+
return row ? row.id || this.selected : this.highlight;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private select(id: string): void {
|
|
100
|
+
if (id !== this.selected) emit(this, 'cae-select', { id });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private act(m: MatrixMark): void {
|
|
104
|
+
if (m.drill) emit(this, 'cae-drill', { id: m.id });
|
|
105
|
+
else emit(this, 'cae-activate', { id: m.id });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
override render() {
|
|
109
|
+
const mx = this.matrix;
|
|
110
|
+
const w = withDefaults(DEFAULT_MARK_MATRIX_STRINGS, this.strings);
|
|
111
|
+
const rows = mx.rows;
|
|
112
|
+
const cols = mx.columns;
|
|
113
|
+
const hl = this.lit();
|
|
114
|
+
// Where a group of columns starts: 0 at an outermost group, 1 at a group in it, ...
|
|
115
|
+
const starts = cols.map((c, i) => {
|
|
116
|
+
const p = cols[i - 1]?.groups;
|
|
117
|
+
if (!p) return -1;
|
|
118
|
+
const k = c.groups.findIndex((x, j) => x !== p[j]);
|
|
119
|
+
return k < 0 ? (c.groups.length !== p.length ? Math.min(c.groups.length, p.length) : -1) : k;
|
|
120
|
+
});
|
|
121
|
+
const groupCls = (ci: number) => (starts[ci] === 0 ? 'g0' : (starts[ci] ?? -1) > 0 ? 'g1' : '');
|
|
122
|
+
const headRows = mx.head.length;
|
|
123
|
+
const value = !!mx.value;
|
|
124
|
+
const lead = value ? 2 : 1;
|
|
125
|
+
// The rows in view (all of them up to `windowAt`).
|
|
126
|
+
const many = rows.length > this.windowAt;
|
|
127
|
+
const from = many ? Math.max(0, this.scrollRow - OVERSCAN) : 0;
|
|
128
|
+
const to = many ? Math.min(rows.length, this.scrollRow + 2 * OVERSCAN + 20) : rows.length;
|
|
129
|
+
const cur = this.cell && this.cell[0] < rows.length ? this.cell : firstCell(rows);
|
|
130
|
+
// A header cell's class: where a group of columns starts.
|
|
131
|
+
const headCls = (col: number) => (col === 0 || starts[col] === 0 ? 'g0' : (starts[col] ?? -1) > 0 ? 'g1' : '');
|
|
132
|
+
const headCell = (hd: MatrixHeadCell, col: number, level: number) => {
|
|
133
|
+
const style = `top:${level * 22}px`;
|
|
134
|
+
if (hd.type === 'group')
|
|
135
|
+
return html`<th scope="colgroup" part="head-cell" colspan=${hd.span} class="group ${hd.code ? 'code' : ''} ${headCls(col)}" style=${style}
|
|
136
|
+
title=${hd.tip ?? nothing} aria-label=${hd.summary ?? nothing}>${hd.label}</th>`;
|
|
137
|
+
return html`<th scope="col" part="head-cell" rowspan=${hd.rows} class="nh ${headCls(col)}" style=${style}
|
|
138
|
+
title=${hd.tip ?? nothing} aria-label=${hd.summary ?? nothing}>${(hd.icons ?? []).map((n) => this.renderIcon(n))}${hd.label}</th>`;
|
|
139
|
+
};
|
|
140
|
+
// The column each cell of a header row starts at: a cell under one that spans down starts after it.
|
|
141
|
+
const firstCols = (level: number) => {
|
|
142
|
+
const out: number[] = [];
|
|
143
|
+
let c = 0;
|
|
144
|
+
for (const hd of mx.head[level] ?? []) {
|
|
145
|
+
while (spannedAt(mx.head, level, c)) c++;
|
|
146
|
+
out.push(c);
|
|
147
|
+
c += hd.span;
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
};
|
|
151
|
+
const facts = (mx.facts ?? []).filter((f) => (typeof f === 'string' ? f : f.text));
|
|
152
|
+
return html`<div class="mxblock view">
|
|
153
|
+
<div class="mxbar">
|
|
154
|
+
<span class="cap" title=${mx.captionTip ?? nothing}>${mx.caption}</span>
|
|
155
|
+
${mx.sorts?.length
|
|
156
|
+
? html`<label>${w.sortBy}
|
|
157
|
+
<select part="sort" @change=${(e: Event) => emit(this, 'cae-sort', { id: (e.target as HTMLSelectElement).value, direction: 'asc' })}>
|
|
158
|
+
${mx.sorts.map((s) => html`<option value=${s.id} ?selected=${mx.sort === s.id}>${s.label}</option>`)}
|
|
159
|
+
</select>
|
|
160
|
+
</label>`
|
|
161
|
+
: nothing}
|
|
162
|
+
<span class="sum">${facts.map(
|
|
163
|
+
(f, i) =>
|
|
164
|
+
html`${i ? html`<span class="sep"> | </span>` : nothing}${typeof f === 'string'
|
|
165
|
+
? html`<span class="f">${f}</span>`
|
|
166
|
+
: html`<span class="f tone-text" data-tone=${toneAttr(f.tone)}>${f.text}</span>`}`,
|
|
167
|
+
)}</span>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="mx ${hl ? 'hl' : ''}" @scroll=${this.onScroll} @mouseleave=${() => (this.hover = null)}>
|
|
170
|
+
<table class="matrix big" part="matrix" role="grid" aria-rowcount=${rows.length + headRows} aria-colcount=${cols.length + lead} aria-label=${mx.label}>
|
|
171
|
+
<thead>
|
|
172
|
+
${mx.head.map((hr, level) => {
|
|
173
|
+
const fc = firstCols(level);
|
|
174
|
+
return html`<tr>
|
|
175
|
+
${level === 0
|
|
176
|
+
? html`<th scope="col" rowspan=${headRows} class="uh" style="top:0">${w.rowsHeader}</th>
|
|
177
|
+
${value ? html`<th scope="col" rowspan=${headRows} class="pn" style="top:0" title=${mx.value?.tip ?? nothing}>${mx.value?.label}</th>` : nothing}`
|
|
178
|
+
: nothing}
|
|
179
|
+
${hr.map((hd, i) => headCell(hd, fc[i] ?? 0, level))}
|
|
180
|
+
</tr>`;
|
|
181
|
+
})}
|
|
182
|
+
</thead>
|
|
183
|
+
<tbody @keydown=${(e: KeyboardEvent) => this.onKey(e, rows)}>
|
|
184
|
+
${from > 0 ? html`<tr class="gap" aria-hidden="true"><td colspan=${cols.length + lead} style="height:${from * ROW_H}px"></td></tr>` : nothing}
|
|
185
|
+
${repeat(
|
|
186
|
+
rows.slice(from, to),
|
|
187
|
+
(r) => r.id,
|
|
188
|
+
(r, k) => {
|
|
189
|
+
const ri = from + k;
|
|
190
|
+
return html`<tr class=${r.id && r.id === hl ? 'on' : ''} aria-rowindex=${ri + headRows + 1}>
|
|
191
|
+
<th scope="row" part="row-header" class=${r.muted ? 'none' : nothing} title=${r.tip ?? r.label}>${r.label}</th>
|
|
192
|
+
${value ? html`<td class="pn ${r.strong ? 'many' : ''}">${r.value}</td>` : nothing}
|
|
193
|
+
${r.cells.map((m, ci) => {
|
|
194
|
+
const focusable = !!m && cur !== null && cur[0] === ri && cur[1] === ci;
|
|
195
|
+
return html`<td class="c ${groupCls(ci)}" role="gridcell">${m ? this.mark(r, m, ri, ci, focusable, hl) : nothing}</td>`;
|
|
196
|
+
})}
|
|
197
|
+
</tr>`;
|
|
198
|
+
},
|
|
199
|
+
)}
|
|
200
|
+
${to < rows.length
|
|
201
|
+
? html`<tr class="gap" aria-hidden="true"><td colspan=${cols.length + lead} style="height:${(rows.length - to) * ROW_H}px"></td></tr>`
|
|
202
|
+
: nothing}
|
|
203
|
+
</tbody>
|
|
204
|
+
</table>
|
|
205
|
+
</div>
|
|
206
|
+
</div>`;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
private mark(r: MatrixRowInput, m: MatrixMark, ri: number, ci: number, tabStop: boolean, hl: string | null) {
|
|
210
|
+
const look = this.states[m.state];
|
|
211
|
+
const hlKey = r.id || m.id;
|
|
212
|
+
const sel = this.selected === m.id;
|
|
213
|
+
return html`<button type="button" part="mark" class="mark ${r.id && r.id === hl ? 'on' : ''} ${sel ? 'sel' : ''}"
|
|
214
|
+
data-tone=${toneAttr(look?.tone)} data-shape=${look?.shape ?? nothing} data-r=${ri} data-c=${ci} tabindex=${tabStop ? 0 : -1}
|
|
215
|
+
title=${m.tip ?? nothing} aria-label=${m.label} aria-pressed=${sel}
|
|
216
|
+
@mouseenter=${() => (this.hover = hlKey)}
|
|
217
|
+
@focus=${() => {
|
|
218
|
+
this.hover = hlKey;
|
|
219
|
+
this.cell = [ri, ci];
|
|
220
|
+
this.select(m.id);
|
|
221
|
+
}}
|
|
222
|
+
@blur=${() => (this.hover = null)}
|
|
223
|
+
@click=${() => this.select(m.id)}
|
|
224
|
+
@dblclick=${() => this.act(m)}></button>`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
private readonly onScroll = (e: Event): void => {
|
|
228
|
+
const top = Math.floor((e.currentTarget as HTMLElement).scrollTop / ROW_H);
|
|
229
|
+
if (Math.abs(top - this.scrollRow) >= OVERSCAN / 2) this.scrollRow = top;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
private onKey(e: KeyboardEvent, rows: readonly MatrixRowInput[]): void {
|
|
233
|
+
const t = e.target as HTMLElement;
|
|
234
|
+
if (!t.classList.contains('mark')) return;
|
|
235
|
+
const r = Number(t.dataset['r']);
|
|
236
|
+
const c = Number(t.dataset['c']);
|
|
237
|
+
if (e.key === 'Enter') {
|
|
238
|
+
const m = rows[r]?.cells[c];
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
if (m) this.act(m);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const has = rows.map((row) => row.cells.map((x) => x !== null));
|
|
244
|
+
const next = gridStep(has, r, c, e.key, e.ctrlKey || e.metaKey);
|
|
245
|
+
if (!next) return;
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
this.cell = next;
|
|
248
|
+
const box = this.renderRoot.querySelector<HTMLElement>('.mx');
|
|
249
|
+
if (box && rows.length > this.windowAt) {
|
|
250
|
+
// Bring the row into view first: only the rows in view are drawn.
|
|
251
|
+
const y = next[0] * ROW_H;
|
|
252
|
+
if (y < box.scrollTop + ROW_H * 2 || y > box.scrollTop + box.clientHeight - ROW_H * 3) box.scrollTop = Math.max(0, y - box.clientHeight / 2);
|
|
253
|
+
this.scrollRow = Math.floor(box.scrollTop / ROW_H);
|
|
254
|
+
}
|
|
255
|
+
this.requestUpdate();
|
|
256
|
+
void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>(`.matrix .mark[data-r="${next[0]}"][data-c="${next[1]}"]`)?.focus());
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** The first mark of the rows, as (row, column). */
|
|
261
|
+
function firstCell(rows: readonly MatrixRowInput[]): [number, number] | null {
|
|
262
|
+
for (let i = 0; i < rows.length; i++) {
|
|
263
|
+
const j = rows[i]?.cells.findIndex((c) => c !== null) ?? -1;
|
|
264
|
+
if (j >= 0) return [i, j];
|
|
265
|
+
}
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** A header row's column `c` is under a cell of an earlier row that spans down past it. */
|
|
270
|
+
function spannedAt(head: readonly (readonly MatrixHeadCell[])[], level: number, c: number): boolean {
|
|
271
|
+
for (let l = 0; l < level; l++) {
|
|
272
|
+
let x = 0;
|
|
273
|
+
for (const hd of head[l] ?? []) {
|
|
274
|
+
if (c >= x && c < x + hd.span && l + hd.rows > level) return true;
|
|
275
|
+
x += hd.span;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare global {
|
|
282
|
+
interface HTMLElementTagNameMap {
|
|
283
|
+
'cae-mark-matrix': CaeMarkMatrix;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// A mark matrix's styles: the line above it, the table, its sticky headers and its marks.
|
|
2
|
+
import { css, unsafeCSS } from 'lit';
|
|
3
|
+
import { FRAME_MIN, FRAME_SHARE } from '../core/frame.js';
|
|
4
|
+
|
|
5
|
+
/** A row's height, in px: what the windowing counts in. */
|
|
6
|
+
export const ROW_H = 24;
|
|
7
|
+
|
|
8
|
+
export const matrixStyles = css`
|
|
9
|
+
/* The block is the box: it lays out where the host is placed. */
|
|
10
|
+
:host { display: contents; }
|
|
11
|
+
/* At least wide enough for the caption and the sort beside it: a narrower table is stretched to it. */
|
|
12
|
+
.mxblock { display: flex; flex-direction: column; width: fit-content; max-width: 100%; min-width: min(100%, 27rem);
|
|
13
|
+
animation: view-in 0.1s var(--ease) both; }
|
|
14
|
+
@keyframes view-in { from { opacity: 0; } }
|
|
15
|
+
@media (prefers-reduced-motion: reduce) { .mxblock { animation: none; } }
|
|
16
|
+
.mxbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 8px; font-size: 12px; color: var(--text-2);
|
|
17
|
+
width: 0; min-width: 100%; box-sizing: border-box; }
|
|
18
|
+
.mxbar .cap { color: var(--text); font-weight: 600; }
|
|
19
|
+
.mxbar .sum { flex: 1 0 100%; min-width: 0; }
|
|
20
|
+
.mxbar .f { white-space: nowrap; }
|
|
21
|
+
.sep { color: var(--text-muted); }
|
|
22
|
+
.mxbar label { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
|
|
23
|
+
.mxbar select { font: inherit; font-size: 11.5px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
|
|
24
|
+
.mxbar select:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
|
|
25
|
+
.mx { overflow: auto; max-width: 100%; max-height: max(${FRAME_MIN}px, ${unsafeCSS(FRAME_SHARE * 100)}vh); border-radius: 6px; border: 1px solid var(--line); }
|
|
26
|
+
table.matrix { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; min-width: max-content; }
|
|
27
|
+
.matrix th, .matrix td { padding: 0 6px; height: ${ROW_H}px; border-bottom: 1px solid var(--line); white-space: nowrap; }
|
|
28
|
+
.matrix thead th { position: sticky; z-index: 2; background: var(--panel2); color: var(--text-muted); font-weight: 500; text-align: center; height: 22px; }
|
|
29
|
+
.matrix thead th.nh { font-family: var(--mono); color: var(--text-2); font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
|
|
30
|
+
.matrix thead th.group { color: var(--text-2); }
|
|
31
|
+
.matrix thead th.group.code { font-family: var(--mono); color: var(--text-muted); }
|
|
32
|
+
.matrix .uh, .matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; }
|
|
33
|
+
.matrix thead .uh { z-index: 3; }
|
|
34
|
+
.matrix thead .uh, .matrix thead .pn { background: var(--panel2); }
|
|
35
|
+
.matrix tbody th { font-family: var(--mono); font-weight: 600; color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
|
|
36
|
+
.matrix tbody th.none { font-family: var(--sans); font-weight: 500; color: var(--text-muted); }
|
|
37
|
+
.matrix .pn { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
|
|
38
|
+
.matrix .pn.many { color: var(--text); font-weight: 600; }
|
|
39
|
+
.matrix td.c { text-align: center; --m: 12px; }
|
|
40
|
+
.matrix td.c .mark { vertical-align: middle; }
|
|
41
|
+
.matrix .g0 { border-left: 1px solid var(--line2); }
|
|
42
|
+
.matrix .g1 { border-left: 1px dashed var(--line); }
|
|
43
|
+
.matrix tbody tr:hover td, .matrix tbody tr:hover th { background-color: color-mix(in srgb, var(--text-muted) 8%, transparent); }
|
|
44
|
+
.matrix tbody tr.on td, .matrix tbody tr.on th { background-color: var(--accent-bg); }
|
|
45
|
+
.matrix .gap td { padding: 0; border: 0; }
|
|
46
|
+
.mx.hl .mark:not(.on) { opacity: 0.4; }
|
|
47
|
+
.mx.hl .mark.on { transform: scale(1.2); }
|
|
48
|
+
`;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// A mark matrix's model: rows of marks under nested groups of columns.
|
|
2
|
+
import type { Fact } from '../primitives/fact-line.js';
|
|
3
|
+
|
|
4
|
+
/** One mark of a matrix cell (the same shape as a graph's mark). */
|
|
5
|
+
export interface MatrixMark {
|
|
6
|
+
/** Unique in the matrix: the selection id. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** A key of `StateStyles`. */
|
|
9
|
+
state: string;
|
|
10
|
+
/** The accessible name. */
|
|
11
|
+
label: string;
|
|
12
|
+
tip?: string;
|
|
13
|
+
/** The mark opens an inner view: Enter and a double click send `cae-drill`, not `cae-activate`. */
|
|
14
|
+
drill?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A header cell: a group of columns (`group`), or a column's own (`column`, spanning down to the last header row). */
|
|
18
|
+
export interface MatrixHeadCell {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
tip?: string;
|
|
22
|
+
/** The accessible name; default: `label`. */
|
|
23
|
+
summary?: string;
|
|
24
|
+
/** Icon names (`registerIcon`) before its label. */
|
|
25
|
+
icons?: readonly string[];
|
|
26
|
+
/** The label is a name in code: drawn in the monospace font. */
|
|
27
|
+
code?: boolean;
|
|
28
|
+
span: number;
|
|
29
|
+
rows: number;
|
|
30
|
+
type: 'group' | 'column';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface MatrixColumnInput {
|
|
34
|
+
id: string;
|
|
35
|
+
/** The ids of the groups it is under, outermost first: a border marks where a group starts. */
|
|
36
|
+
groups: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface MatrixRowInput {
|
|
40
|
+
/** Its id: what the matrix highlights (the series of the selected or hovered mark). */
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
tip?: string;
|
|
44
|
+
/** Its label in the plain, muted face (a row that stands for no item of its own). */
|
|
45
|
+
muted?: boolean;
|
|
46
|
+
/** The value column's cell, and whether it stands out. */
|
|
47
|
+
value?: string | number;
|
|
48
|
+
strong?: boolean;
|
|
49
|
+
/** One per column: its mark, or null. */
|
|
50
|
+
cells: readonly (MatrixMark | null)[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface MarkMatrixInput {
|
|
54
|
+
/** The line above the table, and its tooltip. */
|
|
55
|
+
caption: string;
|
|
56
|
+
captionTip?: string;
|
|
57
|
+
/** The table's accessible name. */
|
|
58
|
+
label: string;
|
|
59
|
+
/** Facts beside the caption. */
|
|
60
|
+
facts?: readonly (string | Fact)[];
|
|
61
|
+
/** The header rows, outermost first. */
|
|
62
|
+
head: readonly (readonly MatrixHeadCell[])[];
|
|
63
|
+
columns: readonly MatrixColumnInput[];
|
|
64
|
+
/** Already in the order chosen (`sort`): the host sorts them. */
|
|
65
|
+
rows: readonly MatrixRowInput[];
|
|
66
|
+
/** A column of one value per row, after the rows' labels, and its header. */
|
|
67
|
+
value?: { label: string; tip?: string };
|
|
68
|
+
/** The orders the reader may choose, and the one chosen. */
|
|
69
|
+
sorts?: readonly { id: string; label: string }[];
|
|
70
|
+
sort?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface MarkMatrixStrings {
|
|
74
|
+
/** The label of the sort control. */
|
|
75
|
+
sortBy: string;
|
|
76
|
+
/** The header of the rows' labels. */
|
|
77
|
+
rowsHeader: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const DEFAULT_MARK_MATRIX_STRINGS: Readonly<MarkMatrixStrings> = {
|
|
81
|
+
sortBy: 'Sort',
|
|
82
|
+
rowsHeader: 'Row',
|
|
83
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// A row of facts ("6 tasks", "6 attempts") in a narrow box: each fact is kept
|
|
2
|
+
// whole, and the line breaks between facts. Use it inside `.words`.
|
|
3
|
+
import { html, nothing, type TemplateResult } from 'lit';
|
|
4
|
+
import { toneAttr, type Tone } from '../core/tone.js';
|
|
5
|
+
|
|
6
|
+
/** A fact in a row of facts; a status fact has a tone. */
|
|
7
|
+
export interface Fact {
|
|
8
|
+
text: string;
|
|
9
|
+
tone?: Tone;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `facts`, each in a `.f` span that does not break inside unless it is wider than
|
|
14
|
+
* the box, separated by `sep`. A fact with a tone is in its status colour
|
|
15
|
+
* (`.tone-text`); an empty fact is left out.
|
|
16
|
+
*/
|
|
17
|
+
export function factLine(facts: readonly (string | Fact)[], sep = ' | '): TemplateResult | typeof nothing {
|
|
18
|
+
const shown = facts.filter((f) => (typeof f === 'string' ? f : f.text));
|
|
19
|
+
return shown.length
|
|
20
|
+
? html`${shown.map((f, i) =>
|
|
21
|
+
typeof f === 'string'
|
|
22
|
+
? html`${i ? sep : ''}<span class="f">${f}</span>`
|
|
23
|
+
: html`${i ? sep : ''}<span class="f tone-text" data-tone=${toneAttr(f.tone)}>${f.text}</span>`,
|
|
24
|
+
)}`
|
|
25
|
+
: nothing;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Small icons: a glyph or a template, registered by name.
|
|
2
|
+
import { html, nothing, type TemplateResult } from 'lit';
|
|
3
|
+
|
|
4
|
+
const icons = new Map<string, TemplateResult | string>();
|
|
5
|
+
|
|
6
|
+
/** Registers an icon under `name` (a later registration replaces it). */
|
|
7
|
+
export function registerIcon(name: string, template: TemplateResult | string): void {
|
|
8
|
+
icons.set(name, template);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IconOptions {
|
|
12
|
+
/** Classes on the icon's element. */
|
|
13
|
+
cls?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The icon `name` (the name itself when nothing is registered under it, so a
|
|
18
|
+
* glyph works as its own name). Without a label it is hidden from screen
|
|
19
|
+
* readers; with one, the label is its tooltip and what a screen reader reads.
|
|
20
|
+
*/
|
|
21
|
+
export function icon(name: string, label?: string | null, o: IconOptions = {}): TemplateResult {
|
|
22
|
+
const glyph = icons.get(name) ?? name;
|
|
23
|
+
return label
|
|
24
|
+
? html`<span class=${o.cls || nothing} part="icon" title=${label}><span aria-hidden="true">${glyph}</span><span class="sr">${label}</span></span>`
|
|
25
|
+
: html`<span class=${o.cls || nothing} part="icon" aria-hidden="true">${glyph}</span>`;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The parts every element is built from: `@contraagent/elements/primitives`.
|
|
2
|
+
// Template functions and controllers; `CaeSegmented` is registered by
|
|
3
|
+
// `@contraagent/elements/segmented/define`.
|
|
4
|
+
export * from './pill.js';
|
|
5
|
+
export * from './legend.js';
|
|
6
|
+
export * from './share-bar.js';
|
|
7
|
+
export * from './states.js';
|
|
8
|
+
export * from './fact-line.js';
|
|
9
|
+
export * from './icon.js';
|
|
10
|
+
export * from './roving-focus.js';
|
|
11
|
+
export * from './window.js';
|
|
12
|
+
export * from './segmented.js';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// A legend: a swatch and a word per entry.
|
|
2
|
+
import { css, html, nothing, type TemplateResult } from 'lit';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { toneAttr, type Tone } from '../core/tone.js';
|
|
5
|
+
|
|
6
|
+
/** The shape of a status mark: done round, failed square, not started hatched, waiting a ring, partly done a round with its lower half filled. */
|
|
7
|
+
export type MarkShape = 'round' | 'square' | 'hatched' | 'ring' | 'half';
|
|
8
|
+
|
|
9
|
+
export interface LegendItem {
|
|
10
|
+
label: string;
|
|
11
|
+
/** The swatch's colour: a CSS colour or `var(...)`. */
|
|
12
|
+
swatch?: string;
|
|
13
|
+
/** The swatch's status colour (instead of `swatch`). */
|
|
14
|
+
tone?: Tone;
|
|
15
|
+
shape?: MarkShape;
|
|
16
|
+
/** Classes on the swatch (`<i>`), for a swatch the host's styles draw. */
|
|
17
|
+
cls?: string;
|
|
18
|
+
/** What to draw instead of the swatch: an icon, a mark, a line. */
|
|
19
|
+
icon?: unknown;
|
|
20
|
+
/** Hidden from screen readers: the item names what the reader reaches another way. */
|
|
21
|
+
decorative?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface LegendOptions {
|
|
25
|
+
/** The legend's accessible name. */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** More classes on the legend. */
|
|
28
|
+
cls?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The swatch of an entry; none for an entry that is only a word (a note at the end). */
|
|
32
|
+
const swatch = (it: LegendItem): unknown =>
|
|
33
|
+
it.icon ??
|
|
34
|
+
(it.swatch || it.tone || it.shape || it.cls
|
|
35
|
+
? html`<i class=${it.cls || nothing} data-tone=${toneAttr(it.tone)} data-shape=${it.shape ?? nothing}
|
|
36
|
+
style=${it.swatch ? styleMap({ background: it.swatch }) : nothing}></i>`
|
|
37
|
+
: nothing);
|
|
38
|
+
|
|
39
|
+
/** A row of entries (`.legend`, part `legend`), each its swatch and its word, as a list. */
|
|
40
|
+
export function legend(items: readonly LegendItem[], o: LegendOptions = {}): TemplateResult {
|
|
41
|
+
return html`<div class="legend ${o.cls ?? ''}" part="legend" role="list" aria-label=${o.label || nothing}>
|
|
42
|
+
${items.map((it) => html`<span role="listitem" aria-hidden=${it.decorative ? 'true' : nothing}>${swatch(it)}${it.label}</span>`)}
|
|
43
|
+
</div>`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const legendStyles = css`
|
|
47
|
+
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--font-size-sm); color: var(--text-muted); }
|
|
48
|
+
.legend > span { white-space: nowrap; }
|
|
49
|
+
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
|
|
50
|
+
.legend i[data-tone] { background: var(--tone); }
|
|
51
|
+
.legend i[data-shape='round'] { border-radius: 50%; }
|
|
52
|
+
.legend i[data-shape='square'] { border-radius: 2px; }
|
|
53
|
+
.legend i[data-shape='ring'] { background: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--tone, var(--line2)); }
|
|
54
|
+
.legend i[data-shape='half'] { border-radius: 50%; background: linear-gradient(0deg, var(--tone, var(--line2)) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--tone, var(--line2)); }
|
|
55
|
+
.legend i[data-shape='hatched'] { border-radius: 2px; background: repeating-linear-gradient(135deg, transparent 0 2px, var(--tone, var(--line2)) 2px 3px); }
|
|
56
|
+
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// A status shown as a pill or as a word: the word, its tone (`data-tone`) and,
|
|
2
|
+
// where a mark belongs, its mark (`data-mark`: ✓ done, ✕ failed, ◌ pending).
|
|
3
|
+
// The look of each is in `styles/status.ts`; the mark is drawn by CSS and hidden
|
|
4
|
+
// from screen readers, which read the word.
|
|
5
|
+
import { html, nothing, type TemplateResult } from 'lit';
|
|
6
|
+
import { toneAttr, type Tone } from '../core/tone.js';
|
|
7
|
+
|
|
8
|
+
/** The shape before a status word. */
|
|
9
|
+
export type Mark = 'done' | 'failed' | 'pending';
|
|
10
|
+
|
|
11
|
+
/** The mark a tone takes by default: ✓ done, ✕ failed, ◌ attention; none for running, muted or neutral. */
|
|
12
|
+
export function markOf(tone: Tone): Mark | null {
|
|
13
|
+
switch (tone) {
|
|
14
|
+
case 'done':
|
|
15
|
+
return 'done';
|
|
16
|
+
case 'failed':
|
|
17
|
+
return 'failed';
|
|
18
|
+
case 'attention':
|
|
19
|
+
return 'pending';
|
|
20
|
+
default:
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PillSpec {
|
|
26
|
+
/** The word (a template may add a count after it). */
|
|
27
|
+
text: unknown;
|
|
28
|
+
tone?: Tone;
|
|
29
|
+
/** The mark: `markOf(tone)` when not given (or true); false or null for none. */
|
|
30
|
+
mark?: Mark | boolean | null;
|
|
31
|
+
title?: string | null;
|
|
32
|
+
/** More classes on the element. */
|
|
33
|
+
cls?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The `data-mark` of a spec. */
|
|
37
|
+
const markAttr = (p: PillSpec): Mark | typeof nothing => {
|
|
38
|
+
const m = p.mark === undefined || p.mark === true ? markOf(p.tone ?? 'neutral') : p.mark || null;
|
|
39
|
+
return m ?? nothing;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** A status as a pill (`.pill`, part `pill tone-<tone>`): tinted by its tone, a done pill quiet with its ✓. */
|
|
43
|
+
export function pill(p: PillSpec): TemplateResult {
|
|
44
|
+
const tone = p.tone ?? 'neutral';
|
|
45
|
+
return html`<span class="pill ${p.cls ?? ''}" part="pill tone-${tone}" data-tone=${toneAttr(tone)} data-mark=${markAttr(p)} title=${p.title || nothing}>${p.text}</span>`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** A status as a word in a row (`.jstop`, part `status tone-<tone>`): coloured for a problem, done quiet with its ✓. */
|
|
49
|
+
export function statusWord(p: PillSpec): TemplateResult {
|
|
50
|
+
const tone = p.tone ?? 'neutral';
|
|
51
|
+
return html`<span class="jstop ${p.cls ?? ''}" part="status tone-${tone}" data-tone=${toneAttr(tone)} data-mark=${markAttr(p)} title=${p.title || nothing}>${p.text}</span>`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** A status as a chip of the class `cls` (an element styles it): the tone and the mark, as on a pill. */
|
|
55
|
+
export function statusChip(cls: string, p: PillSpec): TemplateResult {
|
|
56
|
+
const tone = p.tone ?? 'neutral';
|
|
57
|
+
return html`<span class="${cls} ${p.cls ?? ''}" data-tone=${toneAttr(tone)} data-mark=${markAttr(p)} title=${p.title || nothing}>${p.text}</span>`;
|
|
58
|
+
}
|