@artooi/ag-ui-web-component 0.48.0 → 0.49.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 +71 -1
- package/README.md +70 -7
- package/dist/ag-ui-web-component.bundle.js +157 -106
- package/dist/ag-ui-web-component.bundle.js.map +3 -3
- package/dist/core/ag_ui_chat.d.ts +8 -2
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/index.js +264 -23
- package/dist/index.js.map +3 -3
- package/dist/tools/chat_surface_tools.d.ts.map +1 -1
- package/dist/ui/placement/dock_styles.d.ts.map +1 -1
- package/dist/ui/placement/panel_placement.d.ts +5 -0
- package/dist/ui/placement/panel_placement.d.ts.map +1 -1
- package/dist/ui/placement/surface_for.d.ts +15 -6
- package/dist/ui/placement/surface_for.d.ts.map +1 -1
- package/dist/ui/progress/tool_group_styles.d.ts.map +1 -1
- package/dist/ui/shell/token_styles.d.ts.map +1 -1
- package/dist/ui/themes/quiet_styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +10 -3
- package/src/tools/chat_surface_tools.ts +3 -5
- package/src/ui/placement/dock_styles.ts +5 -1
- package/src/ui/placement/panel_placement.ts +232 -16
- package/src/ui/placement/surface_for.ts +33 -8
- package/src/ui/progress/tool_group_styles.ts +3 -2
- package/src/ui/shell/token_styles.ts +30 -0
- package/src/ui/themes/quiet_styles.ts +19 -3
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.49.0] — 2026-11-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`--ag-ui-header-btn-hover`, the header buttons' hover square.** Drawn
|
|
15
|
+
exactly as given under Quiet and a host's own theme word, whether or not
|
|
16
|
+
`--ag-ui-header-fg` is set. Unset, the square follows the header text as
|
|
17
|
+
below, or is the panel's hover shade when that is unset too. A host that
|
|
18
|
+
prefers the lightening square of its old `::part(header-button):hover`
|
|
19
|
+
rule sets this token to that colour instead of keeping the rule.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **A docked panel moves and remembers where it was put.** Under
|
|
24
|
+
`collapse-to="bar"`, and under `collapse-to="none"` with or without an
|
|
25
|
+
`anchor`, a corner panel on a wide viewport now moves by its header and by
|
|
26
|
+
`moveTo`, like the default corner panel. Minimising and reopening, and a
|
|
27
|
+
reload, bring it back where it was dragged, and a panel never dragged still
|
|
28
|
+
opens at the dock. A dragged panel stays inside the viewport and above the
|
|
29
|
+
bar, or above the anchor's top under `none` (the anchor gap no longer
|
|
30
|
+
applies once dragged), and a stored spot is held there if the window or the
|
|
31
|
+
bar changed since. Once dragged off, every resize edge follows its grip.
|
|
32
|
+
`resetSize()` returns a dragged docked panel to the dock and forgets the
|
|
33
|
+
stored spot; under `auto` it still drops only the size. The spot is stored
|
|
34
|
+
apart from the corner panel's, so a spot dragged under `auto` never lands on
|
|
35
|
+
a docked panel. On a phone the panel stays full-bleed and does not move.
|
|
36
|
+
`describeSurface()` and `read_chat_surface` report `movable: true` and
|
|
37
|
+
`draggable: true` for it on a wide viewport, and `move_chat` no longer
|
|
38
|
+
refuses with "the panel is docked". `side` and `full` under `bar`, and
|
|
39
|
+
`sidebar` and `embedded` under `none`, still own their position; they now
|
|
40
|
+
report `draggable: true` where they reported `false`, so a refused move
|
|
41
|
+
there names the placement rather than the dock or the page. **A host has
|
|
42
|
+
nothing to do**: every host using `bar` or `none` gets the movable panel on
|
|
43
|
+
upgrade. A host that wants the 0.48.0 fixed dock sets
|
|
44
|
+
`data-launcher-drag="false"`, which turns the header drag and `moveTo` off
|
|
45
|
+
here as it does on a corner panel.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- **Quiet's header buttons follow `--ag-ui-header-fg`.** The accent recipe
|
|
50
|
+
(0.45.0) put the accent on the header, but Quiet drew the history, new-chat,
|
|
51
|
+
theme and collapse buttons in its third ink at 0.85 opacity, about 1.2:1 on
|
|
52
|
+
a `#3d5afe` header, and hovered them on the panel's near-white or near-black
|
|
53
|
+
shade. Once a host sets `--ag-ui-header-fg`, the buttons draw in it at full
|
|
54
|
+
opacity, and the hover square is the opposite of that text at 18% (darker
|
|
55
|
+
under white text, lighter under dark), so a hovered button reads at least
|
|
56
|
+
what the host's header pair reads: white on `#3d5afe` is 5.1:1 at rest and
|
|
57
|
+
about 7:1 hovered. Browsers without relative colour syntax (Firefox 120
|
|
58
|
+
to 127, Safari 17.5 and 17.6) mix the square from the text itself instead.
|
|
59
|
+
This applies under Quiet and under a host's own theme word, which starts
|
|
60
|
+
from Quiet, in every scheme; Soft, Ledger, Classic and code are unchanged.
|
|
61
|
+
Unset, nothing changes. **No opt-in is needed.** A host that
|
|
62
|
+
wrote `ag-ui-chat::part(header-button) { color: var(--ag-ui-header-fg) }`
|
|
63
|
+
and the `:hover` background beside it may delete both: kept, the colour
|
|
64
|
+
rule is harmless, but the page's 18% tint of the text still beats the new
|
|
65
|
+
square, and on a mid-tone accent it takes the hovered glyph under 4.5:1
|
|
66
|
+
(3.75:1 on `#3d5afe`). Delete the hover background at least; to keep a
|
|
67
|
+
lightening square, set `--ag-ui-header-btn-hover` to it. With the header
|
|
68
|
+
text set, the header buttons no longer read `--ag-ui-hover`; the rest of
|
|
69
|
+
the panel still does. A host that sets neither `--ag-ui-header-fg`
|
|
70
|
+
nor `--ag-ui-tool-fg`, the Django admin among them, sees no change.
|
|
71
|
+
- **`--ag-ui-tool-fg` reaches the calls in a step group.** Under the grouped
|
|
72
|
+
default (0.46.0) every call in a group was drawn in the second ink whatever
|
|
73
|
+
the token said, so the recipe's tool colour reached nothing. A set
|
|
74
|
+
`--ag-ui-tool-fg` now colours grouped calls under every theme; unset, they
|
|
75
|
+
keep the second ink, Classic included. **No opt-in is needed**, but a host
|
|
76
|
+
that set the token and kept the grouped default sees its calls in that
|
|
77
|
+
colour from this release.
|
|
78
|
+
|
|
10
79
|
## [0.48.0] — 2026-11-07
|
|
11
80
|
|
|
12
81
|
### Added
|
|
@@ -4979,7 +5048,8 @@ hosts that both arrange the page the way it expects.
|
|
|
4979
5048
|
### Notes
|
|
4980
5049
|
- First release — exercising the automated npm OIDC publish pipeline end-to-end.
|
|
4981
5050
|
|
|
4982
|
-
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.
|
|
5051
|
+
[Unreleased]: https://github.com/Artui/ag-ui-web-component/compare/v0.49.0...HEAD
|
|
5052
|
+
[0.49.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.48.0...v0.49.0
|
|
4983
5053
|
[0.48.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.47.0...v0.48.0
|
|
4984
5054
|
[0.47.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.46.0...v0.47.0
|
|
4985
5055
|
[0.46.0]: https://github.com/Artui/ag-ui-web-component/compare/v0.45.0...v0.46.0
|
package/README.md
CHANGED
|
@@ -208,7 +208,7 @@ another origin, add `credentials="include"` too; see
|
|
|
208
208
|
| `data-side` | — | CSS-only, for `placement="sidebar"`: which edge it docks to — `right` (default) / `left`. |
|
|
209
209
|
| `data-answer-well` | — | CSS-only boolean: box each assistant turn (its text, tool cards, and thinking) in one bordered "well". Off by default. See [The answer well](#the-answer-well). |
|
|
210
210
|
| `collapsed` | `collapsed` | Reflected boolean; collapses the widget to its [launcher](#collapsing-to-the-launcher) (a rail under `placement="sidebar"`, the header bar under `embedded`). Persisted per tab. `placement="page"` has no collapsed state and ignores it. |
|
|
211
|
-
| `collapse-to` | — | What the panel collapses to: `auto` (the default; absent or any other value reads the same) leaves every placement as it is, `bar` draws a strip along the bottom edge in place of the round launcher, `none` hides the collapsed widget so the host's own control brings it back. Live. See [Collapsing to a bottom bar](#collapsing-to-a-bottom-bar). |
|
|
211
|
+
| `collapse-to` | — | What the panel collapses to: `auto` (the default; absent or any other value reads the same) leaves every placement as it is, `bar` draws a strip along the bottom edge in place of the round launcher, `none` hides the collapsed widget so the host's own control brings it back. Under either, a corner panel still moves by its header and `moveTo` on a wide viewport, and remembers where it was dragged. Live. See [Collapsing to a bottom bar](#collapsing-to-a-bottom-bar). |
|
|
212
212
|
| `anchor` | `anchor` | Under `collapse-to="none"`, a selector for the host's element the panel rises from, right-aligned to it. The `anchor` property takes an element instead and wins over the attribute. Live. |
|
|
213
213
|
| `data-dragging` | — | **Written by the element, not by you.** Stamped on whichever handle a gesture is currently using, so the styles can react and so the element knows not to re-place the widget under a drag in progress. Cleared on `pointerup` and on `pointercancel`. |
|
|
214
214
|
| `data-expand-corner` | — | **Written by the element, not by you.** It stamps the corner a dragged or agent-moved panel opens from, so the collapse animation starts where the panel actually is. Listed because the element reads its own stamp back; setting it yourself is overwritten on the next move. |
|
|
@@ -1183,10 +1183,13 @@ matching JS API:
|
|
|
1183
1183
|
- `moveTo(corner)` — send the panel to `top-left` / `top-right` / `bottom-left` / `bottom-right`,
|
|
1184
1184
|
returning whether it went. It takes the axes the same way a user drag does, so the launcher
|
|
1185
1185
|
travels with it and switching placement hands them back. Returns `false` rather than pretending
|
|
1186
|
-
when the placement owns its position or the panel fills the screen.
|
|
1186
|
+
when the placement owns its position or the panel fills the screen. Under `collapse-to="bar"`
|
|
1187
|
+
or `"none"` it moves the panel within the room above the bar or the anchor.
|
|
1187
1188
|
- `resetSize()` — drop a size the user dragged, and its stored copy, so the placement's own
|
|
1188
1189
|
size and your `--ag-ui-width` / `--ag-ui-height` apply again. For a host that enters a sized
|
|
1189
1190
|
state of its own (an expanded mode): a user's drag outranks host tokens, so call this first.
|
|
1191
|
+
Under `collapse-to="bar"` or `"none"` it also returns a panel the user dragged off its dock to
|
|
1192
|
+
the dock and forgets the stored spot; a corner panel under `auto` keeps its dragged position.
|
|
1190
1193
|
- `setCollapsed(collapsed)` / `toggleCollapsed()` — collapse or expand the widget. The state is
|
|
1191
1194
|
reflected as the boolean `collapsed` attribute/property and persisted per-tab in
|
|
1192
1195
|
`sessionStorage`, so it survives a reload.
|
|
@@ -1485,14 +1488,35 @@ body {
|
|
|
1485
1488
|
your toolbar: its max height is the viewport less the bar's height (or, under `none`, the
|
|
1486
1489
|
distance to the anchor's top) and one gutter, and its bottom sits on the bar or the anchor.
|
|
1487
1490
|
|
|
1488
|
-
**Docked
|
|
1489
|
-
`
|
|
1490
|
-
|
|
1491
|
-
|
|
1491
|
+
**Docked, and still movable.** On a wide viewport a docked corner panel (the corner placements
|
|
1492
|
+
under `bar`, or under `none` with or without an anchor) moves by its header, and `moveTo` moves
|
|
1493
|
+
it, as it would the corner panel it is; `describeSurface()` reports `movable: true`. There is no
|
|
1494
|
+
launcher to drag: the bar and your own control stay where they are.
|
|
1495
|
+
|
|
1496
|
+
- **Above the dock.** A dragged panel stays inside the viewport and above the bar's top edge, so it
|
|
1497
|
+
never covers the bar it minimises to. Under `none` with an anchor it stays above the anchor's
|
|
1498
|
+
top edge the same way, because the anchor is your own way back and has to stay in view;
|
|
1499
|
+
`--ag-ui-anchor-gap` no longer applies once the panel is dragged, and the screen-edge margin
|
|
1500
|
+
(8px) does. Under `none` with no anchor only the viewport holds it, as for a corner panel.
|
|
1501
|
+
- **Remembered like a corner panel.** Minimising and reopening brings it back where it was
|
|
1502
|
+
dragged, and so does a reload. The spot is kept apart from the one a corner panel stores under
|
|
1503
|
+
`auto`, so switching `collapse-to` never puts one surface's spot on the other. A spot that no
|
|
1504
|
+
longer fits, because the window shrank or the bar grew, is held inside the room that is left
|
|
1505
|
+
and comes back whole when there is room again.
|
|
1506
|
+
- **Resizing.** A panel standing on its dock keeps the edges on the bar or the anchor still and the
|
|
1507
|
+
free ones follow the grip. Once dragged off, every edge follows its grip, as on a corner panel.
|
|
1508
|
+
- **Back to the dock.** `resetSize()` drops the dragged size and returns the panel to its dock,
|
|
1509
|
+
forgetting the stored spot, so a reload opens it there too.
|
|
1510
|
+
- **Keeping it fixed.** `data-launcher-drag="false"` turns the header drag and `moveTo` off here as
|
|
1511
|
+
everywhere else, and the panel stays on its dock.
|
|
1512
|
+
|
|
1513
|
+
Placements that own their position (`side` and `full` under `bar`, `sidebar` and `embedded`
|
|
1514
|
+
under `none`) do not move, as without `collapse-to`.
|
|
1492
1515
|
|
|
1493
1516
|
**Phones.** At 600px or less the open panel stays full-bleed, over the bar, and the header's
|
|
1494
1517
|
minimise control is the way back; the bar shows only while collapsed, so no second strip sits
|
|
1495
|
-
at the bottom edge while the keyboard is up.
|
|
1518
|
+
at the bottom edge while the keyboard is up. The panel does not move there, and a spot dragged on
|
|
1519
|
+
a wide viewport does not apply: it comes back when the window is wide again.
|
|
1496
1520
|
|
|
1497
1521
|
The bar is styled through the parts `bar` (the strip's wrapper, holding the launcher and the
|
|
1498
1522
|
history button) and `bar-history`, and the launcher's own parts (`launcher`, `rail-label`,
|
|
@@ -3302,6 +3326,45 @@ fallback white (2.5:1), as it always was. What they miss is the correction for a
|
|
|
3302
3326
|
mid-tone brand accent can fall under 4.5:1 there, under any theme. If you support those browsers
|
|
3303
3327
|
and set a mid-tone accent, set `--ag-ui-on-accent` yourself. There is no script path.
|
|
3304
3328
|
|
|
3329
|
+
#### Keeping a brand accent on the header
|
|
3330
|
+
|
|
3331
|
+
Quiet draws the header, the launcher and the tool names in the panel's own colours, so a host that
|
|
3332
|
+
sets only `--ag-ui-accent` gets a neutral header. To put the accent back without leaving Quiet, set
|
|
3333
|
+
the surfaces to the accent and the text on them to a colour that reads on it:
|
|
3334
|
+
|
|
3335
|
+
```css
|
|
3336
|
+
ag-ui-chat {
|
|
3337
|
+
--ag-ui-header-bg: #3d5afe;
|
|
3338
|
+
--ag-ui-header-fg: #ffffff;
|
|
3339
|
+
--ag-ui-launcher-bg: #3d5afe;
|
|
3340
|
+
--ag-ui-launcher-fg: #ffffff;
|
|
3341
|
+
--ag-ui-tool-fg: #3d5afe;
|
|
3342
|
+
}
|
|
3343
|
+
```
|
|
3344
|
+
|
|
3345
|
+
- **The header buttons follow `--ag-ui-header-fg`.** Unset, Quiet draws them in its third ink at
|
|
3346
|
+
0.85 opacity, on a hover square of the panel's hover shade. Once you set the header text they
|
|
3347
|
+
draw in it at full opacity, and the hover square is the opposite of that text at about a fifth
|
|
3348
|
+
(a darker square under white text, a lighter one under dark text), so a hovered button reads at
|
|
3349
|
+
least what your header pair reads. The same holds under a theme word of your own, which starts
|
|
3350
|
+
from Quiet. No `::part(header-button)` rule is needed. The opposite is computed with relative
|
|
3351
|
+
colour syntax; the browsers without it (see the fallback above) mix the square from the text
|
|
3352
|
+
itself, which on a mid-tone header can take the hovered glyph under your pair (white on
|
|
3353
|
+
`#3d5afe`: 3.75:1).
|
|
3354
|
+
- **`--ag-ui-header-btn-hover` sets the hover square outright** under Quiet and a theme word of your
|
|
3355
|
+
own, whether or not the header text is set, and is drawn exactly as given. Classic, Soft and
|
|
3356
|
+
Ledger draw their own squares and do not read it. For a square that lightens under white text
|
|
3357
|
+
instead, at the cost of contrast on a mid-tone header:
|
|
3358
|
+
|
|
3359
|
+
```css
|
|
3360
|
+
ag-ui-chat { --ag-ui-header-btn-hover: color-mix(in srgb, #ffffff 18%, transparent); }
|
|
3361
|
+
```
|
|
3362
|
+
- **`--ag-ui-tool-fg` colours every tool call**, in a step group as well as in the card displays.
|
|
3363
|
+
Unset, a grouped call is drawn in the second ink (`--ag-ui-ink-2`) under every theme.
|
|
3364
|
+
- Pick the pair yourself: `--ag-ui-header-fg` is not derived from the header colour the way
|
|
3365
|
+
`--ag-ui-on-accent` is from the accent. Under Soft and Ledger the header buttons keep their own
|
|
3366
|
+
third ink whatever you set.
|
|
3367
|
+
|
|
3305
3368
|
#### Overriding a theme, lightest layer first
|
|
3306
3369
|
|
|
3307
3370
|
Four layers, each documented and each lighter than the next. Reach for the first one that does
|