@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.
@@ -507,7 +507,9 @@ export declare class AgUiChat extends HTMLElement {
507
507
  * `movable` folds two separate reasons into the one answer a caller needs:
508
508
  * a placement that places itself owns its position, and a panel that fills
509
509
  * the screen has nowhere to go. Reporting them apart would make every caller
510
- * re-derive the same conjunction.
510
+ * re-derive the same conjunction. A corner panel docked under
511
+ * `collapse-to="bar"` or `"none"` is movable on a wide viewport, like the
512
+ * corner panel it is.
511
513
  */
512
514
  describeSurface(): ChatSurfaceReport;
513
515
  /**
@@ -519,7 +521,8 @@ export declare class AgUiChat extends HTMLElement {
519
521
  * the corner it opens from is re-picked, and switching placement hands
520
522
  * everything back. What it must not do is claim a move it did not make --
521
523
  * hence the boolean, and hence {@link describeSurface} existing so a caller
522
- * can ask first.
524
+ * can ask first. A docked panel moves too, within the room above its bar or
525
+ * anchor, and remembers the spot as a header drag would.
523
526
  */
524
527
  moveTo(corner: ChatCorner, options?: {
525
528
  readonly announce?: boolean;
@@ -527,6 +530,9 @@ export declare class AgUiChat extends HTMLElement {
527
530
  /**
528
531
  * Drop a size the user dragged, and its stored copy, so the placement's
529
532
  * default and the host's `--ag-ui-width` / `--ag-ui-height` apply again.
533
+ * Under `collapse-to="bar"` or `"none"` it also returns a panel the user
534
+ * dragged off its dock to the dock, and forgets the stored spot; a corner
535
+ * panel keeps a dragged position.
530
536
  */
531
537
  resetSize(): void;
532
538
  /** Flip the collapsed state. Bound to the built-in header toggle. */
@@ -1 +1 @@
1
- {"version":3,"file":"ag_ui_chat.d.ts","sourceRoot":"","sources":["../../src/core/ag_ui_chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAgBL,KAAK,oBAAoB,EAE1B,MAAM,iBAAiB,CAAC;AACzB,OAAO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EAAE,MAAM,GAAG,IAAI,CAKnC;IAED;;;;;OAKG;IACH,iBAAiB,IAAI,IAAI,CAMxB;IAED;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI,CA8Bd;IAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CA0DtC;IAED;;;;;;;;;OASG;IACH,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAEhE;IAgkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,SAAS,aAAa,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAoE/F;IA6BD;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAE9B;IA2JD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,MAAM,GAAE,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,EAAyB,GAAG,IAAI,CA0BlF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,wBAAwB,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAEjE;IAED;;;;;;;;OAQG;IACH,IAAI,sBAAsB,IAAI,SAAS,MAAM,EAAE,CAE9C;CACF"}
package/dist/index.js CHANGED
@@ -284,7 +284,7 @@ function createChatSurfaceTools(surface) {
284
284
  if (!report.movable) {
285
285
  return {
286
286
  moved: false,
287
- reason: report.fullBleed ? "the panel fills the screen, so there is nowhere to move it to" : report.collapseTo === "bar" || report.collapseTo === "none" ? "the panel is docked: it rises from the page's bottom bar and stays there" : report.draggable === false ? "this page has turned off moving the panel" : `the "${report.placement ?? ""}" placement owns the panel's position`,
287
+ reason: report.fullBleed ? "the panel fills the screen, so there is nowhere to move it to" : report.draggable === false ? "this page has turned off moving the panel" : `the "${report.placement ?? ""}" placement owns the panel's position`,
288
288
  suggestion: report.collapsible ? "minimise_chat" : null
289
289
  };
290
290
  }
@@ -5810,12 +5810,14 @@ function boxAt(grip, axis, rect, x2, y2) {
5810
5810
  var CORNER = {
5811
5811
  collapseTo: "launcher",
5812
5812
  launcherDraggable: true,
5813
+ panelMovable: true,
5813
5814
  resizeAxis: "both",
5814
5815
  startsCollapsed: true
5815
5816
  };
5816
5817
  var DOCKED = {
5817
5818
  collapseTo: "launcher",
5818
5819
  launcherDraggable: false,
5820
+ panelMovable: false,
5819
5821
  resizeAxis: "width",
5820
5822
  startsCollapsed: false
5821
5823
  };
@@ -5831,22 +5833,36 @@ var SURFACES = /* @__PURE__ */ new Map([
5831
5833
  {
5832
5834
  collapseTo: "launcher",
5833
5835
  launcherDraggable: false,
5836
+ panelMovable: false,
5834
5837
  resizeAxis: "none",
5835
5838
  startsCollapsed: false
5836
5839
  }
5837
5840
  ],
5838
5841
  [
5839
5842
  "page",
5840
- { collapseTo: null, launcherDraggable: false, resizeAxis: "none", startsCollapsed: false }
5843
+ {
5844
+ collapseTo: null,
5845
+ launcherDraggable: false,
5846
+ panelMovable: false,
5847
+ resizeAxis: "none",
5848
+ startsCollapsed: false
5849
+ }
5841
5850
  ],
5842
5851
  [
5843
5852
  "embedded",
5844
- { collapseTo: "header", launcherDraggable: false, resizeAxis: "both", startsCollapsed: false }
5853
+ {
5854
+ collapseTo: "header",
5855
+ launcherDraggable: false,
5856
+ panelMovable: false,
5857
+ resizeAxis: "both",
5858
+ startsCollapsed: false
5859
+ }
5845
5860
  ]
5846
5861
  ]);
5847
5862
  var UNKNOWN = {
5848
5863
  collapseTo: "launcher",
5849
5864
  launcherDraggable: false,
5865
+ panelMovable: false,
5850
5866
  resizeAxis: "both",
5851
5867
  startsCollapsed: false
5852
5868
  };
@@ -5868,6 +5884,7 @@ var DRAG_HEIGHT = "--_drag-height";
5868
5884
  var DOCK_BOTTOM = "--_dock-bottom";
5869
5885
  var DOCK_RIGHT = "--_dock-right";
5870
5886
  var LAUNCHER_KEY = "ag-ui-chat:launcher";
5887
+ var DOCK_KEY = "ag-ui-chat:dock";
5871
5888
  function asPoint(value) {
5872
5889
  if (typeof value !== "object" || value === null) {
5873
5890
  return null;
@@ -5908,7 +5925,7 @@ var PanelPlacement = class {
5908
5925
  */
5909
5926
  enablePanelDrag(header) {
5910
5927
  enablePanelDrag(header, {
5911
- enabled: () => !this.#host.collapsed() && this.#launcherDraggable(),
5928
+ enabled: () => !this.#host.collapsed() && this.#canDragPanel(),
5912
5929
  rect: () => this.#host.element.getBoundingClientRect(),
5913
5930
  apply: (box, from) => this.#movePanel(box, from),
5914
5931
  commit: (box, from) => this.#commitPanel(box, from)
@@ -5954,11 +5971,23 @@ var PanelPlacement = class {
5954
5971
  * Drop the dragged size and its stored copy, so the placement's own size and
5955
5972
  * the host's tokens apply again. For a host entering a sized state of its
5956
5973
  * own, which a user's drag would otherwise outrank.
5974
+ *
5975
+ * A docked panel the user dragged off its dock goes back to it as well, and
5976
+ * the stored spot with it: there the position is part of the same resting
5977
+ * state the host is asking for. A corner panel keeps a dragged position, as
5978
+ * it always has.
5957
5979
  */
5958
5980
  resetSize() {
5959
5981
  this.#host.element.style.removeProperty(DRAG_WIDTH);
5960
5982
  this.#host.element.style.removeProperty(DRAG_HEIGHT);
5961
5983
  this.#host.clearPreference(SIZE_KEY);
5984
+ if (this.#docked()) {
5985
+ if (this.#dockPos !== null) {
5986
+ this.#host.element.style.removeProperty("--ag-ui-inset");
5987
+ }
5988
+ this.#dockPos = null;
5989
+ this.#storeDockPosition(null);
5990
+ }
5962
5991
  this.syncResizeAnchor();
5963
5992
  }
5964
5993
  /**
@@ -5985,6 +6014,23 @@ var PanelPlacement = class {
5985
6014
  * from the launcher would move the panel the user just placed.
5986
6015
  */
5987
6016
  #panelPos = null;
6017
+ /**
6018
+ * Where the user dragged a docked panel, in viewport coordinates, or null
6019
+ * while it stands on the bar or the anchor.
6020
+ *
6021
+ * Apart from the two corner positions above because it moves nothing else:
6022
+ * a docked panel has no launcher to carry, and the corner it opens from is
6023
+ * the dock's. Held as the user stated it and never as clamped, so a bar that
6024
+ * grew, or a phone that took the panel full-bleed, gives the spot back
6025
+ * unchanged once there is room for it again.
6026
+ */
6027
+ #dockPos = null;
6028
+ /**
6029
+ * The line a docked panel stays above, in viewport coordinates: the bar's
6030
+ * top, or the anchor's. Infinite where neither is drawn. Measured by
6031
+ * syncDock, which runs on every change either can make.
6032
+ */
6033
+ #dockTop = Number.POSITIVE_INFINITY;
5988
6034
  /**
5989
6035
  * The corner the panel opens away from, once this element is placing itself.
5990
6036
  * Null means the host's layout still decides, and the anchor is measured.
@@ -6013,7 +6059,7 @@ var PanelPlacement = class {
6013
6059
  * rather than collapsed to nothing.
6014
6060
  */
6015
6061
  #withinViewport(box) {
6016
- const viewport = this.#viewport();
6062
+ const viewport = this.#docked() && this.#panelMovable() ? this.#dockRoom() : this.#viewport();
6017
6063
  const left = viewport.left + SCREEN_EDGE_MARGIN;
6018
6064
  const top = viewport.top + SCREEN_EDGE_MARGIN;
6019
6065
  const right = viewport.left + viewport.width - SCREEN_EDGE_MARGIN;
@@ -6045,8 +6091,12 @@ var PanelPlacement = class {
6045
6091
  collapseTo: this.#surface().collapseTo,
6046
6092
  collapsed: this.#host.collapsed(),
6047
6093
  collapsible: this.#host.collapsible(),
6048
- movable: this.#launcherDraggable() && !fullBleed,
6049
- draggable: this.#launcherDraggable(),
6094
+ movable: this.#panelMovable() && !fullBleed,
6095
+ // Whether the page left moving on, which is not the same question as
6096
+ // whether this panel moves: a docked sidebar's position is owned by its
6097
+ // placement, and reporting that as the host having turned moving off is
6098
+ // the sentence the move refusal would then get wrong.
6099
+ draggable: this.#host.element.getAttribute("data-launcher-drag") !== "false" && (this.#surface().launcherDraggable || this.#docked()),
6050
6100
  fullBleed,
6051
6101
  box: {
6052
6102
  left: Math.round(box.left),
@@ -6064,7 +6114,7 @@ var PanelPlacement = class {
6064
6114
  }
6065
6115
  /** The move behind `AgUiChat.moveTo`, whose doc is the contract. */
6066
6116
  moveTo(corner, options = {}) {
6067
- if (!this.#launcherDraggable()) {
6117
+ if (!this.#panelMovable()) {
6068
6118
  return false;
6069
6119
  }
6070
6120
  const restore = options.announce === true ? this.#captureGeometry() : null;
@@ -6074,11 +6124,22 @@ var PanelPlacement = class {
6074
6124
  return false;
6075
6125
  }
6076
6126
  const [edgeY, edgeX] = corner.split("-");
6077
- const nearX = viewport.left + EDGE_MARGIN;
6078
- const nearY = viewport.top + EDGE_MARGIN;
6079
- const left = edgeX === "left" ? nearX : Math.max(nearX, viewport.left + viewport.width - EDGE_MARGIN - box.width);
6080
- const top = edgeY === "top" ? nearY : Math.max(nearY, viewport.top + viewport.height - EDGE_MARGIN - box.height);
6127
+ const docked = this.#docked();
6128
+ const room = docked ? this.#dockRoom() : viewport;
6129
+ const nearX = room.left + EDGE_MARGIN;
6130
+ const nearY = room.top + EDGE_MARGIN;
6131
+ const left = edgeX === "left" ? nearX : Math.max(nearX, room.left + room.width - EDGE_MARGIN - box.width);
6132
+ const top = edgeY === "top" ? nearY : Math.max(nearY, room.top + room.height - EDGE_MARGIN - box.height);
6081
6133
  const host = { left, top, right: left + box.width, bottom: top + box.height };
6134
+ if (docked) {
6135
+ this.#dockPos = { left, top };
6136
+ this.#writeDockInset(host);
6137
+ this.#storeDockPosition(this.#dockPos);
6138
+ if (restore !== null) {
6139
+ this.#host.announceSurfaceChange(this.#host.strings().chatMoved, restore);
6140
+ }
6141
+ return true;
6142
+ }
6082
6143
  const launcherWidth = this.#host.launcher.offsetWidth;
6083
6144
  const launcherHeight = this.#host.launcher.offsetHeight;
6084
6145
  this.#placePanelAndLauncher(host, {
@@ -6109,6 +6170,7 @@ var PanelPlacement = class {
6109
6170
  const corner = this.#host.element.getAttribute("data-expand-corner");
6110
6171
  const launcherPos = this.#launcherPos;
6111
6172
  const panelPos = this.#panelPos;
6173
+ const dockPos = this.#dockPos;
6112
6174
  const expandCorner = this.#expandCorner;
6113
6175
  return () => {
6114
6176
  this.#restoreProperty("--ag-ui-inset", inset2);
@@ -6120,7 +6182,13 @@ var PanelPlacement = class {
6120
6182
  }
6121
6183
  this.#launcherPos = launcherPos;
6122
6184
  this.#panelPos = panelPos;
6185
+ this.#dockPos = dockPos;
6123
6186
  this.#expandCorner = expandCorner;
6187
+ if (this.#docked()) {
6188
+ this.#storeDockPosition(dockPos);
6189
+ this.syncResizeAnchor();
6190
+ return;
6191
+ }
6124
6192
  if (launcherPos === null) {
6125
6193
  this.#host.clearPreference(LAUNCHER_KEY);
6126
6194
  } else {
@@ -6242,7 +6310,10 @@ var PanelPlacement = class {
6242
6310
  const element = this.#host.element;
6243
6311
  return surfaceFor(element.getAttribute("placement"), element.getAttribute("collapse-to"));
6244
6312
  }
6245
- /** Whether the panel rises from the bottom bar or the host's anchor. */
6313
+ /**
6314
+ * Whether the panel rises from the bottom bar or the host's anchor, until the
6315
+ * user drags it somewhere else.
6316
+ */
6246
6317
  #docked() {
6247
6318
  const target = this.#surface().collapseTo;
6248
6319
  return target === "bar" || target === "none";
@@ -6275,8 +6346,97 @@ var PanelPlacement = class {
6275
6346
  element.style.removeProperty(DOCK_RIGHT);
6276
6347
  }
6277
6348
  element.toggleAttribute("data-dock-anchored", target === "none" && anchor !== null);
6349
+ this.#dockTop = target === "bar" && height > 0 ? bar.getBoundingClientRect().top : target === "none" && anchor !== null ? anchor.getBoundingClientRect().top : Number.POSITIVE_INFINITY;
6350
+ this.#placeDocked();
6278
6351
  return height;
6279
6352
  }
6353
+ /**
6354
+ * The part of the usable viewport a docked panel may stand in: all of it
6355
+ * above the dock's line. The bar is what it minimises to, and the anchor is
6356
+ * the host's own way back, so a dragged panel never covers either.
6357
+ */
6358
+ #dockRoom() {
6359
+ const viewport = this.#viewport();
6360
+ const bottom = Math.min(viewport.top + viewport.height, this.#dockTop);
6361
+ return { ...viewport, height: Math.max(0, bottom - viewport.top) };
6362
+ }
6363
+ /**
6364
+ * Put a docked panel back where the user dragged it, held inside its room.
6365
+ *
6366
+ * The inline inset comes off first, which is both how the panel's resting
6367
+ * box is measured and what leaves a phone full-bleed: the small-viewport
6368
+ * block reads the host's inset before its own, so a dragged spot written
6369
+ * there would hold the panel off the screen's edges. The spot itself stays,
6370
+ * for the next time there is room for it.
6371
+ */
6372
+ #placeDocked() {
6373
+ if (!this.#docked() || !this.#panelMovable() || this.dragging()) {
6374
+ return;
6375
+ }
6376
+ const at2 = this.#dockPos ?? this.#readDockPosition();
6377
+ if (at2 === null) {
6378
+ return;
6379
+ }
6380
+ this.#dockPos = at2;
6381
+ this.#host.element.style.removeProperty("--ag-ui-inset");
6382
+ const rest = this.#host.element.getBoundingClientRect();
6383
+ if (coversViewport(rest, this.#viewport())) {
6384
+ return;
6385
+ }
6386
+ this.syncResizeAnchor();
6387
+ this.#writeDockInset(
6388
+ clampPanel(
6389
+ { left: at2.left, top: at2.top, right: at2.left + rest.width, bottom: at2.top + rest.height },
6390
+ this.#dockRoom(),
6391
+ SCREEN_EDGE_MARGIN
6392
+ )
6393
+ );
6394
+ }
6395
+ /** Write the inset that stands a docked panel at `box`. */
6396
+ #writeDockInset(box) {
6397
+ this.#host.element.style.setProperty(
6398
+ "--ag-ui-inset",
6399
+ insetFrom(this.#anchor, box, this.#screen())
6400
+ );
6401
+ }
6402
+ /** Remember a docked panel's dragged spot, or forget it for null. */
6403
+ #storeDockPosition(at2) {
6404
+ if (at2 === null) {
6405
+ this.#host.clearPreference(DOCK_KEY);
6406
+ return;
6407
+ }
6408
+ this.#host.writePreference(DOCK_KEY, JSON.stringify({ left: at2.left, top: at2.top }));
6409
+ }
6410
+ /** The stored spot of a docked panel, or null for none or anything corrupt. */
6411
+ #readDockPosition() {
6412
+ const raw = this.#host.readPreference(DOCK_KEY);
6413
+ if (raw === null) {
6414
+ return null;
6415
+ }
6416
+ try {
6417
+ return asPoint(JSON.parse(raw));
6418
+ } catch {
6419
+ return null;
6420
+ }
6421
+ }
6422
+ /**
6423
+ * Whether the header drag and moveTo may move the open panel: the
6424
+ * placement's answer, unless the host turned moving off.
6425
+ */
6426
+ #panelMovable() {
6427
+ return this.#host.element.getAttribute("data-launcher-drag") !== "false" && this.#surface().panelMovable;
6428
+ }
6429
+ /**
6430
+ * Whether a header drag may start now. A docked panel on a phone is the
6431
+ * screen, and a drag there would pull it off the edges it fills; a corner
6432
+ * panel's header is left as it was.
6433
+ */
6434
+ #canDragPanel() {
6435
+ if (!this.#panelMovable()) {
6436
+ return false;
6437
+ }
6438
+ return !this.#docked() || !coversViewport(this.#host.element.getBoundingClientRect(), this.#viewport());
6439
+ }
6280
6440
  /**
6281
6441
  * Whether this placement lets the launcher be dragged, read per interaction
6282
6442
  * because `placement` is a live attribute. `data-launcher-drag="false"` opts
@@ -6453,6 +6613,12 @@ var PanelPlacement = class {
6453
6613
  * other still names the old one would move the launcher for no reason.
6454
6614
  */
6455
6615
  #movePanel(box, from) {
6616
+ if (this.#docked()) {
6617
+ const held2 = clampPanel(box, this.#dockRoom(), SCREEN_EDGE_MARGIN);
6618
+ this.#dockPos = { left: held2.left, top: held2.top };
6619
+ this.#writeDockInset(held2);
6620
+ return { held: held2, launcher: null };
6621
+ }
6456
6622
  if (!this.#launcherDraggable()) {
6457
6623
  return { held: box, launcher: null };
6458
6624
  }
@@ -6492,6 +6658,10 @@ var PanelPlacement = class {
6492
6658
  */
6493
6659
  #commitPanel(box, from) {
6494
6660
  const { held, launcher } = this.#movePanel(box, from);
6661
+ if (this.#docked()) {
6662
+ this.#storeDockPosition({ left: held.left, top: held.top });
6663
+ return;
6664
+ }
6495
6665
  if (launcher === null) {
6496
6666
  return;
6497
6667
  }
@@ -6572,6 +6742,10 @@ var PanelPlacement = class {
6572
6742
  * unreachable -- it is the only way back to a collapsed conversation.
6573
6743
  */
6574
6744
  restoreLauncherPosition() {
6745
+ if (this.#docked()) {
6746
+ this.#placeDocked();
6747
+ return;
6748
+ }
6575
6749
  const stored = this.#readLauncherPosition();
6576
6750
  const launcher = this.#launcherPos ?? stored;
6577
6751
  if (launcher === null) {
@@ -6615,6 +6789,10 @@ var PanelPlacement = class {
6615
6789
  * the switch inline and pins a sidebar to wherever the floating launcher was.
6616
6790
  */
6617
6791
  releaseLauncherPosition() {
6792
+ if (this.#dockPos !== null && !(this.#docked() && this.#panelMovable())) {
6793
+ this.#dockPos = null;
6794
+ this.#host.element.style.removeProperty("--ag-ui-inset");
6795
+ }
6618
6796
  if (this.#launcherDraggable()) {
6619
6797
  return;
6620
6798
  }
@@ -6641,7 +6819,7 @@ var PanelPlacement = class {
6641
6819
  */
6642
6820
  #applyResize(grip, box) {
6643
6821
  box = this.#withinViewport(box);
6644
- if (this.#docked()) {
6822
+ if (this.#docked() && this.#dockPos === null) {
6645
6823
  const now = this.#host.element.getBoundingClientRect();
6646
6824
  box = {
6647
6825
  left: grip.x === this.#anchor.x ? now.left : box.left,
@@ -6653,6 +6831,9 @@ var PanelPlacement = class {
6653
6831
  return box;
6654
6832
  }
6655
6833
  this.#applySize({ width: box.right - box.left, height: box.bottom - box.top });
6834
+ if (this.#docked()) {
6835
+ this.#dockPos = { left: box.left, top: box.top };
6836
+ }
6656
6837
  if (grip.x !== this.#anchor.x && grip.y !== this.#anchor.y) {
6657
6838
  return box;
6658
6839
  }
@@ -6675,6 +6856,9 @@ var PanelPlacement = class {
6675
6856
  const held = this.#applyResize(grip, box);
6676
6857
  this.#persistSize({ width: held.right - held.left, height: held.bottom - held.top });
6677
6858
  this.#storeLauncherPosition();
6859
+ if (this.#dockPos !== null) {
6860
+ this.#storeDockPosition(this.#dockPos);
6861
+ }
6678
6862
  this.syncResizeAnchor();
6679
6863
  }
6680
6864
  /**
@@ -8914,7 +9098,11 @@ var DOCK_STYLES = `
8914
9098
  The cap follows the token block's rule: what the host left free less the
8915
9099
  one gutter the anchored edge spends, so a panel grown to the cap runs from
8916
9100
  just above the bar to the far edge. A host therefore needs no inset to keep
8917
- the panel off its bar; --ag-ui-inset still wins when set.
9101
+ the panel off its bar; --ag-ui-inset still wins when set. A panel the user
9102
+ dragged off its dock is written there inline, which is how the dragged spot
9103
+ outranks every rule below, the anchor gap included; the element holds that
9104
+ spot above the bar or the anchor itself, and drops it on a phone, where the
9105
+ small-viewport block reads the same property first.
8918
9106
 
8919
9107
  These blocks restate tokens and nothing else, and sit ahead of the phone
8920
9108
  block at no more weight than it has, so on a phone the panel is the screen
@@ -9891,7 +10079,8 @@ ${GROUPED} .tool-group[data-open="false"] .tool-group-list {
9891
10079
 
9892
10080
  /* A card inside the group is one line of the list: icon, name, and its
9893
10081
  Details control at the end, with the arguments and result opening under
9894
- the whole row. */
10082
+ the whole row. Its ink is the second ink in every theme, unless the host
10083
+ set the tool token, which then reaches the grouped calls too. */
9895
10084
  ${GROUPED} .tool-group .tool-call {
9896
10085
  max-width: 100%;
9897
10086
  align-self: stretch;
@@ -9902,7 +10091,7 @@ ${GROUPED} .tool-group .tool-call {
9902
10091
  border: 0;
9903
10092
  border-radius: 0;
9904
10093
  background: transparent;
9905
- color: var(--_ink-2);
10094
+ color: var(--_tool-fg-set, var(--_ink-2));
9906
10095
  font-family: inherit;
9907
10096
  font-size: var(--_text-sm);
9908
10097
  }
@@ -10662,6 +10851,23 @@ var TOKEN_STYLES = `
10662
10851
  --_tool-fg: var(--ag-ui-tool-fg, var(--_ink-2));
10663
10852
  --_header-bg: var(--ag-ui-header-bg, var(--_bg));
10664
10853
  --_header-fg: var(--ag-ui-header-fg, var(--_fg));
10854
+ /* Switches: a public token read with no fallback, named for it with -set.
10855
+ With the token unset the switch computes to the guaranteed-invalid value,
10856
+ so a rule that reads it with a fallback gets the fallback; that is how a
10857
+ rule tells a token the host set from the theme's default for it. The
10858
+ default theme's header buttons follow the header text only once a host
10859
+ sets it, and a step group's calls follow the tool token only once a host
10860
+ sets it (classic defaults --_tool-fg to the accent, which a group never
10861
+ drew). */
10862
+ --_header-fg-set: var(--ag-ui-header-fg);
10863
+ --_tool-fg-set: var(--ag-ui-tool-fg);
10864
+ /* The header buttons' hover square, by default, once the header text is
10865
+ set. Here it is the text at about a fifth, which every browser can mix;
10866
+ where relative colour syntax is supported (see the block at the end) it
10867
+ is the text's opposite instead. It reads the switch, so it is unset with
10868
+ it, and the square below falls to the panel's hover shade. */
10869
+ --_header-btn-hover-auto: color-mix(in srgb, var(--_header-fg-set) 18%, transparent);
10870
+ --_header-btn-hover: var(--ag-ui-header-btn-hover, var(--_header-btn-hover-auto, var(--_hover)));
10665
10871
  --_border: var(--ag-ui-border, var(--_line));
10666
10872
  --_radius: var(--ag-ui-radius, 12px);
10667
10873
  /* The panel's own frame, which is the one corner a placement can put against
@@ -11034,6 +11240,19 @@ var TOKEN_STYLES = `
11034
11240
  --_on-accent: var(--ag-ui-on-accent, #ffffff);
11035
11241
  }
11036
11242
  }
11243
+
11244
+ /* The header buttons' default hover square as the header text's opposite,
11245
+ so white text gets a darker square and dark text a lighter one. A square
11246
+ mixed from the text itself moves the ground toward the glyph: white on a
11247
+ mid-blue header fell from 5.1:1 to 3.75:1 under the pointer. Moving away
11248
+ from it can only raise what the host's own pair reads. Gated on this
11249
+ exact expression, so a browser that cannot compute it keeps the square
11250
+ mixed from the text rather than losing the square altogether. */
11251
+ @supports (color: rgb(from red calc(255 - r) calc(255 - g) calc(255 - b))) {
11252
+ :host {
11253
+ --_header-btn-hover-auto: color-mix(in srgb, rgb(from var(--_header-fg-set) calc(255 - r) calc(255 - g) calc(255 - b)) 18%, transparent);
11254
+ }
11255
+ }
11037
11256
  `;
11038
11257
 
11039
11258
  // src/ui/themes/classic_styles.ts
@@ -11448,14 +11667,30 @@ ${THEME_HOST.quiet} .header-title {
11448
11667
  letter-spacing: -0.01em;
11449
11668
  }
11450
11669
 
11670
+ /* The buttons sit back in the third ink on the panel. Once the host sets the
11671
+ header text they draw in it instead, since the header behind them is then
11672
+ the host's colour (see the switches in the token defaults). So does their
11673
+ rest opacity: the frame's 0.85 lets the header through the glyph, which
11674
+ took white on a mid-blue header from 5.1:1 to 4.2:1. With the header text
11675
+ set, the opacity below reads a colour, which no opacity can be, so it is
11676
+ invalid at computed-value time and falls to the initial 1; unset, it reads
11677
+ the fallback, the frame's own 0.85. */
11451
11678
  ${THEME_HOST.quiet} .header-btn {
11452
- color: var(--_ink-3);
11679
+ color: var(--_header-fg-set, var(--_ink-3));
11680
+ opacity: var(--_header-fg-set, 0.85);
11453
11681
  border-radius: 8px;
11454
11682
  }
11455
11683
 
11684
+ /* The hover square is the host's own when it set one; otherwise it is mixed
11685
+ from the header text when the host set that, so it reads on any header the
11686
+ host painted; otherwise it is the panel shade.
11687
+ The glyph takes the header text, which is the full ink when that is unset.
11688
+ The opacity restates the frame's hover value, which the rest rule above
11689
+ outweighs. */
11456
11690
  ${THEME_HOST.quiet} .header-btn:hover {
11457
- color: var(--_fg);
11458
- background: var(--_hover);
11691
+ color: var(--_header-fg);
11692
+ opacity: 1;
11693
+ background: var(--_header-btn-hover);
11459
11694
  }
11460
11695
 
11461
11696
  ${THEME_HOST.quiet} .message--user {
@@ -20800,7 +21035,9 @@ var AgUiChat = class extends HTMLElement {
20800
21035
  * `movable` folds two separate reasons into the one answer a caller needs:
20801
21036
  * a placement that places itself owns its position, and a panel that fills
20802
21037
  * the screen has nowhere to go. Reporting them apart would make every caller
20803
- * re-derive the same conjunction.
21038
+ * re-derive the same conjunction. A corner panel docked under
21039
+ * `collapse-to="bar"` or `"none"` is movable on a wide viewport, like the
21040
+ * corner panel it is.
20804
21041
  */
20805
21042
  describeSurface() {
20806
21043
  return this.#placement.describeSurface();
@@ -20814,7 +21051,8 @@ var AgUiChat = class extends HTMLElement {
20814
21051
  * the corner it opens from is re-picked, and switching placement hands
20815
21052
  * everything back. What it must not do is claim a move it did not make --
20816
21053
  * hence the boolean, and hence {@link describeSurface} existing so a caller
20817
- * can ask first.
21054
+ * can ask first. A docked panel moves too, within the room above its bar or
21055
+ * anchor, and remembers the spot as a header drag would.
20818
21056
  */
20819
21057
  moveTo(corner, options = {}) {
20820
21058
  return this.#placement.moveTo(corner, options);
@@ -20822,6 +21060,9 @@ var AgUiChat = class extends HTMLElement {
20822
21060
  /**
20823
21061
  * Drop a size the user dragged, and its stored copy, so the placement's
20824
21062
  * default and the host's `--ag-ui-width` / `--ag-ui-height` apply again.
21063
+ * Under `collapse-to="bar"` or `"none"` it also returns a panel the user
21064
+ * dragged off its dock to the dock, and forgets the stored spot; a corner
21065
+ * panel keeps a dragged position.
20825
21066
  */
20826
21067
  resetSize() {
20827
21068
  this.#placement.resetSize();
@@ -21984,7 +22225,7 @@ function setControlValue(el2, value) {
21984
22225
  }
21985
22226
 
21986
22227
  // src/version.ts
21987
- var VERSION = "0.48.0";
22228
+ var VERSION = "0.49.0";
21988
22229
  export {
21989
22230
  ATTACHMENT_EVENT,
21990
22231
  AgUiChat,