@artooi/ag-ui-web-component 0.33.1 → 0.34.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/CHANGELOG.md +63 -1
- package/README.md +47 -3
- package/dist/ag-ui-web-component.bundle.js +106 -49
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/constants.d.ts +7 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/index.js +433 -99
- package/dist/index.js.map +4 -4
- package/dist/ui/chart_block.d.ts +18 -0
- package/dist/ui/chart_block.d.ts.map +1 -1
- package/dist/ui/clamp_panel.d.ts +13 -0
- package/dist/ui/clamp_panel.d.ts.map +1 -0
- package/dist/ui/launcher_placement.d.ts.map +1 -1
- package/dist/ui/panel_drag.d.ts +40 -0
- package/dist/ui/panel_drag.d.ts.map +1 -0
- package/dist/ui/place_widget.d.ts +23 -0
- package/dist/ui/place_widget.d.ts.map +1 -0
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +8 -0
- package/src/core/ag_ui_chat.ts +207 -9
- package/src/ui/chart_block.ts +222 -57
- package/src/ui/clamp_panel.ts +24 -0
- package/src/ui/launcher_placement.ts +18 -54
- package/src/ui/panel_drag.ts +134 -0
- package/src/ui/place_widget.ts +56 -0
- package/src/ui/styles.ts +59 -2
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.34.0] — 2026-09-03
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The open panel moves by its header**, the way a window moves by its title
|
|
15
|
+
bar. The collapsed launcher has been draggable since 0.33.0 and the panel was
|
|
16
|
+
not, so a chat sitting over the thing it was being asked about could only be
|
|
17
|
+
moved by collapsing it first.
|
|
18
|
+
|
|
19
|
+
It is one widget being moved, not two things being placed: **the launcher
|
|
20
|
+
travels the same distance the panel does**, so a panel dragged 100px left
|
|
21
|
+
leaves the bubble it collapses into 100px left of where it was. The distance
|
|
22
|
+
is the panel's own rather than the pointer's -- a panel held against the
|
|
23
|
+
viewport's margin stops, and the bubble stops with it -- and the bubble is
|
|
24
|
+
then held on screen in its own right.
|
|
25
|
+
|
|
26
|
+
A stated position is also kept rather than re-derived, which is the whole
|
|
27
|
+
difference between the two drags. A launcher drag says where the bubble goes
|
|
28
|
+
and leaves the panel to open into whatever room the viewport has, re-decided
|
|
29
|
+
on every expand and every window resize; a header drag states the panel's own
|
|
30
|
+
position, so it survives collapsing, reopening and reloading, and dragging the
|
|
31
|
+
bubble again hands the decision back. Which corner the panel is pinned by is
|
|
32
|
+
re-picked when the drag ends, from where the bubble ended up, so the next
|
|
33
|
+
expand still opens into clear space -- and re-picking it moves nothing, since
|
|
34
|
+
both insets are written from positions that are already decided. Stored per
|
|
35
|
+
tab like the launcher's own position, and off under
|
|
36
|
+
`data-launcher-drag="false"` along with the launcher drag.
|
|
37
|
+
|
|
38
|
+
A press that starts on a control in the header stays that control's, including
|
|
39
|
+
one a host slotted in. There is no keyboard shortcut on the header on purpose:
|
|
40
|
+
a header is not a control, and making it focusable would put a tab stop with
|
|
41
|
+
no role ahead of the controls a keyboard user came for, while arrow keys on
|
|
42
|
+
the collapsed launcher already move the widget, panel included.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- **A chart no longer grows with the panel.** Widening the panel used to resize
|
|
47
|
+
what was already in it: the renderer drew into a fixed 480x220 viewBox, the
|
|
48
|
+
block stretched to the transcript's full width, and `width: 100%` scaled the
|
|
49
|
+
drawing to fit it. In a 1100px panel the axis labels came out **3.25x** the
|
|
50
|
+
size they are at the default width and the chart stood **489px** tall, pushing
|
|
51
|
+
the answer it belonged to off the screen.
|
|
52
|
+
|
|
53
|
+
Two separate things were wrong, and both are fixed:
|
|
54
|
+
|
|
55
|
+
- **It was magnified rather than sized.** Geometry is now computed for the
|
|
56
|
+
width the block actually has, one SVG unit per CSS pixel, and recomputed
|
|
57
|
+
when that width changes -- so a 10px axis label is 10px at every size,
|
|
58
|
+
including the narrow end, where the old drawing was shrunk to 7px in the
|
|
59
|
+
default 380px panel. Height follows width inside a 160-320px band, and the
|
|
60
|
+
480px width draws exactly the frame it always did. Where the labels no
|
|
61
|
+
longer fit, every second or third is drawn rather than a smear of
|
|
62
|
+
overlapping words -- a new answer to a collision that was there at every
|
|
63
|
+
size before. Below 220px the drawing scales down as it used to, since at
|
|
64
|
+
that width nothing fits either way.
|
|
65
|
+
- **It was stretched rather than sized too.** The block now takes the width it
|
|
66
|
+
needs and stops, capping at the new `--ag-ui-chart-max-width` (**480px**),
|
|
67
|
+
the way a message bubble caps rather than filling the panel. Raise the token
|
|
68
|
+
for a bigger chart and the labels stay 10px: the cap decides how much room
|
|
69
|
+
the drawing gets, never how big its type is.
|
|
70
|
+
|
|
10
71
|
## [0.33.1] — 2026-09-03
|
|
11
72
|
|
|
12
73
|
### Fixed
|
|
@@ -2840,7 +2901,8 @@ hosts that both arrange the page the way it expects.
|
|
|
2840
2901
|
### Notes
|
|
2841
2902
|
- First release — exercising the automated npm OIDC publish pipeline end-to-end.
|
|
2842
2903
|
|
|
2843
|
-
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.
|
|
2904
|
+
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.34.0...HEAD
|
|
2905
|
+
[0.34.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.33.1...v0.34.0
|
|
2844
2906
|
[0.33.1]: https://github.com/Artui/ag-ui-web-component/compare/v0.33.0...v0.33.1
|
|
2845
2907
|
[0.33.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.32.0...v0.33.0
|
|
2846
2908
|
[0.32.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.31.1...v0.32.0
|
package/README.md
CHANGED
|
@@ -183,7 +183,7 @@ another origin, add `credentials="include"` too; see
|
|
|
183
183
|
| `data-icon-url` | — | Header (and launcher) icon image URL. A slotted `slot="icon"` wins; see [Header & launcher icon](#header-and-launcher-icon). |
|
|
184
184
|
| `data-launcher-icon-url` | — | Icon image URL for the collapsed launcher only, when it should differ from the header's. Falls back to `data-icon-url`; a slotted `slot="launcher"` wins over both. |
|
|
185
185
|
| `data-unread-badge` | — | **On by default.** `="false"` hides the launcher's unread badge; the count and the `ag-ui-unread` event keep running. See [Collapsing to the launcher](#collapsing-to-the-launcher). |
|
|
186
|
-
| `data-launcher-drag` | — | **On by default.** `="false"` leaves the
|
|
186
|
+
| `data-launcher-drag` | — | **On by default.** `="false"` leaves the widget wherever your CSS puts it. Otherwise the collapsed launcher can be dragged anywhere on screen (the panel opens into the clearest space) and the open panel can be dragged by its header. See [Moving the launcher](#moving-the-launcher) and [Moving the panel](#moving-the-panel). |
|
|
187
187
|
| `data-quote-selection` | — | **On by default.** `="false"` stops the transcript offering to quote a selection. `quote()` keeps working either way. See [Quoting a selection](#quoting-a-selection). |
|
|
188
188
|
| `data-message-actions` | — | **All on by default.** A comma list of the actions a finished answer keeps: `copy` / `retry` / `feedback` (e.g. `"copy,retry"`). `="false"` removes the row entirely. See [Message actions](#message-actions-copy-retry-feedback). |
|
|
189
189
|
| `data-max-tool-rounds` | — | Upper bound on frontend tool-call → re-run rounds within one send (default 10; a value below 1 is ignored). Raise it for a page-driving agent whose turn takes many small steps. See [The run loop](#the-run-loop-and-the-ag-ui-client). |
|
|
@@ -997,6 +997,34 @@ against a placement. Switching to a placement that places itself hands both back
|
|
|
997
997
|
> property and your CSS decides, exactly as before. The geometry is built so that feeding it the
|
|
998
998
|
> resting position reproduces the default `auto 24px 24px auto` unchanged.
|
|
999
999
|
|
|
1000
|
+
#### Moving the panel
|
|
1001
|
+
|
|
1002
|
+
An open panel moves by its **header**, the way a window moves by its title bar.
|
|
1003
|
+
|
|
1004
|
+
**The launcher travels the same distance.** Drag the panel 100px left and the bubble it collapses
|
|
1005
|
+
into is 100px left of where it was — it is one widget being moved, not two things being placed.
|
|
1006
|
+
The distance is the panel's own, so a panel held against the viewport's margin stops and the
|
|
1007
|
+
bubble stops with it, and the bubble is then held on screen in its own right.
|
|
1008
|
+
|
|
1009
|
+
**A position you state is kept, not re-derived.** That is the difference between the two drags: a
|
|
1010
|
+
launcher drag says where the bubble goes and lets the panel open into whatever room the viewport
|
|
1011
|
+
has, which is re-decided on every expand and every window resize; a header drag states the
|
|
1012
|
+
panel's own position, so it survives collapsing, reopening and reloading. Dragging the bubble
|
|
1013
|
+
again hands the decision back. Both are stored per tab, and `data-launcher-drag="false"` turns
|
|
1014
|
+
off both.
|
|
1015
|
+
|
|
1016
|
+
Which corner the panel is *pinned* by is re-picked when the drag ends, from where the bubble has
|
|
1017
|
+
ended up, so the next expand still opens into clear space. Re-picking it moves nothing: the
|
|
1018
|
+
corner only says which edges the two insets are written from, and both are written from positions
|
|
1019
|
+
that are already decided.
|
|
1020
|
+
|
|
1021
|
+
The controls in the header keep their own presses — a drag started on a button, a link or a field
|
|
1022
|
+
never begins, including one you slot in.
|
|
1023
|
+
|
|
1024
|
+
There is no keyboard shortcut on the header, deliberately. A header is not a control, and making
|
|
1025
|
+
it focusable would put a tab stop with no role ahead of the controls a keyboard user came for —
|
|
1026
|
+
while arrow keys on the collapsed launcher already move the widget, panel included.
|
|
1027
|
+
|
|
1000
1028
|
```js
|
|
1001
1029
|
chat.unread; // 2
|
|
1002
1030
|
|
|
@@ -1074,8 +1102,24 @@ label — a shorter one misaligns every value after the gap, and a chart that is
|
|
|
1074
1102
|
subtly wrong still reads as authoritative, so the whole spec is dropped instead.
|
|
1075
1103
|
A pie's slices are its labels, so it draws the first series only.
|
|
1076
1104
|
|
|
1077
|
-
Theme the series with `--ag-ui-chart-1` … `--ag-ui-chart-6`,
|
|
1078
|
-
|
|
1105
|
+
Theme the series with `--ag-ui-chart-1` … `--ag-ui-chart-6`, size it with
|
|
1106
|
+
`--ag-ui-chart-max-width`, and style the block through the `chart-block`,
|
|
1107
|
+
`chart-title` and `chart-legend` parts.
|
|
1108
|
+
|
|
1109
|
+
**A chart stops at its own width, and is sized in pixels rather than scaled to
|
|
1110
|
+
them.** Two separate things, and a widened panel needs both.
|
|
1111
|
+
|
|
1112
|
+
It is drawn for the width the block actually has -- one SVG unit per CSS pixel
|
|
1113
|
+
-- and redrawn when that width changes, so a 10px axis label is 10px in a 380px
|
|
1114
|
+
panel and in a 1200px one. Where the labels no longer fit, the axis draws every
|
|
1115
|
+
second or third rather than a smear of overlapping words. Below 220px it goes
|
|
1116
|
+
back to scaling, since at that size nothing fits either way.
|
|
1117
|
+
|
|
1118
|
+
And it takes the width it needs rather than the width it is offered, capping at
|
|
1119
|
+
`--ag-ui-chart-max-width` (**480px**): widening the panel should no more resize
|
|
1120
|
+
a chart than it resizes a message. Raise the token for a bigger chart and the
|
|
1121
|
+
labels stay 10px -- the cap is about how much room the drawing gets, never
|
|
1122
|
+
about how big its type is. Height follows width inside a 160-320px band.
|
|
1079
1123
|
|
|
1080
1124
|
### Drawing something other than a chart
|
|
1081
1125
|
|