@contraagent/elements 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +16 -5
  2. package/custom-elements.json +1107 -345
  3. package/dist/code/code.d.ts +83 -0
  4. package/dist/code/code.d.ts.map +1 -0
  5. package/dist/code/code.js +206 -0
  6. package/dist/code/code.js.map +1 -0
  7. package/dist/code/highlight.d.ts +25 -0
  8. package/dist/code/highlight.d.ts.map +1 -0
  9. package/dist/code/highlight.js +312 -0
  10. package/dist/code/highlight.js.map +1 -0
  11. package/dist/code/index.d.ts +3 -0
  12. package/dist/code/index.d.ts.map +1 -0
  13. package/dist/code/index.js +5 -0
  14. package/dist/code/index.js.map +1 -0
  15. package/dist/define/all.d.ts +2 -0
  16. package/dist/define/all.d.ts.map +1 -1
  17. package/dist/define/all.js +2 -0
  18. package/dist/define/all.js.map +1 -1
  19. package/dist/define/code.d.ts +4 -0
  20. package/dist/define/code.d.ts.map +1 -0
  21. package/dist/define/code.js +7 -0
  22. package/dist/define/code.js.map +1 -0
  23. package/dist/define/tree.d.ts +4 -0
  24. package/dist/define/tree.d.ts.map +1 -0
  25. package/dist/define/tree.js +7 -0
  26. package/dist/define/tree.js.map +1 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/markdown/highlight.d.ts +1 -4
  32. package/dist/markdown/highlight.d.ts.map +1 -1
  33. package/dist/markdown/highlight.js +2 -85
  34. package/dist/markdown/highlight.js.map +1 -1
  35. package/dist/styles/prose.d.ts.map +1 -1
  36. package/dist/styles/prose.js +5 -0
  37. package/dist/styles/prose.js.map +1 -1
  38. package/dist/tree/index.d.ts +2 -0
  39. package/dist/tree/index.d.ts.map +1 -0
  40. package/dist/tree/index.js +4 -0
  41. package/dist/tree/index.js.map +1 -0
  42. package/dist/tree/tree.d.ts +83 -0
  43. package/dist/tree/tree.d.ts.map +1 -0
  44. package/dist/tree/tree.js +251 -0
  45. package/dist/tree/tree.js.map +1 -0
  46. package/docs/code.md +55 -0
  47. package/docs/examples/code.ts +28 -0
  48. package/docs/examples/tree.ts +44 -0
  49. package/docs/tree.md +44 -0
  50. package/package.json +19 -3
  51. package/src/code/code.ts +199 -0
  52. package/src/code/highlight.ts +378 -0
  53. package/src/code/index.ts +4 -0
  54. package/src/define/all.ts +2 -0
  55. package/src/define/code.ts +9 -0
  56. package/src/define/tree.ts +9 -0
  57. package/src/index.ts +2 -0
  58. package/src/markdown/highlight.ts +2 -94
  59. package/src/styles/prose.ts +5 -0
  60. package/src/tree/index.ts +3 -0
  61. package/src/tree/tree.ts +263 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Generic web components (Lit) and the parts they are built from: the design
4
4
  tokens and the built-in themes, status pills, legends, rows of facts, icons, a
5
5
  segmented control, keyboard focus for a group of items, a data table, stat
6
- tiles, time lanes, a check table, a transcript, and elements for a JSON tree, markdown and counters. Nothing here knows contraagent's data: an element
6
+ tiles, time lanes, a check table, a transcript, and elements for a JSON tree, markdown, code, a tree of items and counters. Nothing here knows contraagent's data: an element
7
7
  takes plain data and its words, and reports what the reader did as a `cae-*`
8
8
  event. `@contraagent/ui` builds the contraagent monitor from them.
9
9
 
@@ -22,19 +22,28 @@ import '@contraagent/elements/data-table/define'; // <cae-data-table>
22
22
  import '@contraagent/elements/tiles/define'; // <cae-stat-tiles>
23
23
  import '@contraagent/elements/graph/define'; // <cae-layered-graph>, <cae-mark-matrix>, <cae-segmented>
24
24
  import '@contraagent/elements/charts/define'; // <cae-column-chart>, <cae-line-chart>, <cae-heatmap>, <cae-state-grid>, <cae-bar-chart>
25
+ import '@contraagent/elements/code/define'; // <cae-code>
26
+ import '@contraagent/elements/tree/define'; // <cae-tree>
25
27
  import '@contraagent/elements/define'; // every cae-* element
26
28
  import { pill, legend, base } from '@contraagent/elements';
27
29
  ```
28
30
 
29
31
  The subpaths are `primitives`, `styles`, `themes`, `data-table`, `graph`,
30
32
  `matrix`, `tiles`, `lanes`, `charts`, `check-table`, `transcript`, `json-tree`,
31
- `markdown` and `count`, and a `define` entry for each element
33
+ `markdown`, `code`, `tree` and `count`, and a `define` entry for each element
32
34
  (`segmented/define`, `data-table/define`, `graph/define`, `matrix/define`,
33
35
  `tiles/define`, `lanes/define`, `charts/define`, `check-table/define`,
34
- `transcript/define`, `json-tree/define`, `markdown/define`, `count/define`).
36
+ `transcript/define`, `json-tree/define`, `markdown/define`, `code/define`, `tree/define`,
37
+ `count/define`).
35
38
 
36
- The package is not in the npm registry; install it from a checkout of the
37
- repository.
39
+ Install the package from the npm registry:
40
+
41
+ ```
42
+ npm install @contraagent/elements
43
+ ```
44
+
45
+ A checkout of the repository packs its own version ([Use it from a
46
+ checkout](#use-it-from-a-checkout)).
38
47
 
39
48
  ## Use it from a checkout
40
49
 
@@ -64,6 +73,8 @@ pnpm add <checkout>/web/tarballs/contraagent-elements-*.tgz
64
73
  - [Lanes](docs/lanes.md): bars on a time axis, a lane per group, running bars growing until now.
65
74
  - [Charts](docs/charts.md): columns (stacked or side by side), lines, a heatmap and horizontal bars of plain series, each with a legend, a tooltip and a table of its values.
66
75
  - [Check table](docs/check-table.md): named values checked one by one, each with what it must be, what it is and the verdict.
76
+ - [Code](docs/code.md): a text highlighted by its language, its lines numbered and some marked, wrapped or scrolled, copied whole, and cut when long.
77
+ - [Tree](docs/tree.md): items in a tree, folded and opened with the mouse and the keyboard, one of them selected, each with an icon and a badge.
67
78
  - [Transcript](docs/transcript.md): a conversation with an agent in sessions: bubbles, reasoning, tool cards and web searches, following the end as it grows.
68
79
  - [Building a page](docs/page.md): a CI pipeline's page from several elements: a theme switch, stat tiles, a sortable table, a graph with shards and a retry loop, and a detail panel.
69
80