@artooi/ag-ui-web-component 0.49.0 → 0.50.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.
@@ -21,12 +21,15 @@ export interface ChatSurfaceReport {
21
21
  /** Whether the panel can be moved, or the placement owns its position. */
22
22
  readonly movable: boolean;
23
23
  /**
24
- * Whether this page allows the panel to be moved at all.
24
+ * Whether this page allows the panel to be moved at all: true for every
25
+ * placement unless the host set `data-launcher-drag="false"`. It is the
26
+ * page's setting alone and does not vary with the placement or `collapse-to`;
27
+ * whether this panel moves is {@link ChatSurfaceReport.movable}.
25
28
  *
26
- * Reported apart from {@link ChatSurfaceReport.movable} only because the two
27
- * reasons a move is refused call for different sentences: a host that turned
28
- * dragging off is not the placement owning the position, and telling the
29
- * user the second when the first is true is a plain falsehood.
29
+ * Reported apart from `movable` only because the two reasons a move is
30
+ * refused call for different sentences: a host that turned dragging off is
31
+ * not the placement owning the position, and telling the user the second
32
+ * when the first is true is a plain falsehood.
30
33
  */
31
34
  readonly draggable: boolean;
32
35
  /** Whether the panel currently covers the whole viewport. */
@@ -1 +1 @@
1
- {"version":3,"file":"chat_surface_tools.d.ts","sourceRoot":"","sources":["../../src/tools/chat_surface_tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,kFAAkF;AAClF,eAAO,MAAM,YAAY,YAAI,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,CAAU,CAAC;AAE9F,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,QAA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CAAC;IACF;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,sDAAsD;AACtD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,eAAe,IAAI,iBAAiB,CAAC;IACrC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;IAC/E,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACnF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CA4GzE"}
@@ -80,7 +80,9 @@ export declare class PanelPlacement {
80
80
  *
81
81
  * Read from the stamp the drag helpers already set, rather than tracked
82
82
  * separately: one source of truth, and it clears on `pointercancel` as well
83
- * as `pointerup`, which is the end a touch gesture usually gets.
83
+ * as `pointerup`, which is the end a touch gesture usually gets. The one
84
+ * gesture that stamps nothing is an arrow key on a grip, which applies a box
85
+ * per key and states it only when the key comes up, hence #resizing.
84
86
  */
85
87
  dragging(): boolean;
86
88
  /** The report behind `AgUiChat.describeSurface`, whose doc is the contract. */
@@ -129,8 +131,18 @@ export declare class PanelPlacement {
129
131
  * whenever the window resizes, and before an expand. The viewport that
130
132
  * stored a position may since have shrunk, and a launcher past the edge is
131
133
  * unreachable -- it is the only way back to a collapsed conversation.
134
+ *
135
+ * The one gate on whether a stored position is this element's to honour: the
136
+ * gestures check their own before they ever reach the placing below.
132
137
  */
133
138
  restoreLauncherPosition(): void;
139
+ /**
140
+ * Re-apply it for a change in the panel's own layout, which needs no window or
141
+ * reopen to happen: a line typed in the composer is one. A position waiting to
142
+ * be handed back under data-launcher-drag="false" waits on, because a panel that leaves for the
143
+ * host's corner as the reader starts typing is a jump with no cause they can see.
144
+ */
145
+ settleLauncherPosition(): void;
134
146
  /**
135
147
  * Give the position back to the host when the new placement owns it, the way
136
148
  * releaseOwnedAxes gives back a size. Without this a dragged inset survives
@@ -1 +1 @@
1
- {"version":3,"file":"panel_placement.d.ts","sourceRoot":"","sources":["../../../src/ui/placement/panel_placement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAgHlD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC;IAClC,uCAAuC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC;IAClC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC;IACpC,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,SAAS,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACzD,kDAAkD;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ings":"AACA,eAAO,MAAM,YAAY,EAAE,MAqH1B,CAAC"}
1
+ {"version":3,"file":"frame_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/shell/frame_styles.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,EAAE,MAyI1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"token_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/shell/token_styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,EAAE,MA4c1B,CAAC"}
1
+ {"version":3,"file":"token_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/shell/token_styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,EAAE,MA6c1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"classic_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/classic_tokens.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,EAAE,MA+C5B,CAAC"}
1
+ {"version":3,"file":"classic_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/classic_tokens.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,EAAE,MAgD5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ledger_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/ledger_styles.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,EAAE,MAsK3B,CAAC"}
1
+ {"version":3,"file":"ledger_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/ledger_styles.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,EAAE,MAuK3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ledger_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/ledger_tokens.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,EAAE,MA8B3B,CAAC"}
1
+ {"version":3,"file":"ledger_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/ledger_tokens.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,EAAE,MA+B3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"quiet_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/quiet_styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,EAAE,MA8H1B,CAAC"}
1
+ {"version":3,"file":"quiet_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/quiet_styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,EAAE,MAiH1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"soft_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/soft_styles.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MAkJzB,CAAC"}
1
+ {"version":3,"file":"soft_styles.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/soft_styles.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MAmJzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"soft_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/soft_tokens.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MA0BzB,CAAC"}
1
+ {"version":3,"file":"soft_tokens.d.ts","sourceRoot":"","sources":["../../../src/ui/themes/soft_tokens.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MA2BzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artooi/ag-ui-web-component",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Framework-free <ag-ui-chat> Web Component over the AG-UI protocol. Drop-in chat sidebar with a pluggable client-side tool registry, DOM driver primitives, animations, and destructive-action confirmation modal.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -633,6 +633,24 @@ export class AgUiChat extends HTMLElement {
633
633
  * a field so `removeEventListener` on disconnect gets the same reference.
634
634
  */
635
635
  readonly #onViewportResize = (): void => {
636
+ if (this.#readyToPlace()) {
637
+ this.#placement.restoreLauncherPosition();
638
+ }
639
+ };
640
+
641
+ /**
642
+ * The same for a change only the panel's own layout shows: a host's size, a
643
+ * viewport inset token, a line typed in the composer. Not a moment to hand a
644
+ * position back, so a panel under data-launcher-drag="false" stays put.
645
+ */
646
+ readonly #onLayoutChange = (): void => {
647
+ if (this.#readyToPlace()) {
648
+ this.#placement.settleLauncherPosition();
649
+ }
650
+ };
651
+
652
+ /** Bring the viewport's readings up to date, and say whether placing may follow. */
653
+ #readyToPlace(): boolean {
636
654
  this.#placement.publishVisualViewport();
637
655
  this.#syncDock();
638
656
  // Not while a gesture owns the position. Restoring re-applies the *stored*
@@ -647,11 +665,8 @@ export class AgUiChat extends HTMLElement {
647
665
  // sent me looking -- that was an inset measured from the wrong box -- so it
648
666
  // is a guard against a fight that had not been observed rather than a fix
649
667
  // for one that had.
650
- if (this.#placement.dragging()) {
651
- return;
652
- }
653
- this.#placement.restoreLauncherPosition();
654
- };
668
+ return !this.#placement.dragging();
669
+ }
655
670
 
656
671
  /** Mic button mount point (input row); the control mounts on connect when enabled. */
657
672
  readonly #voiceSlot: HTMLSpanElement;
@@ -1586,6 +1601,25 @@ export class AgUiChat extends HTMLElement {
1586
1601
  const dockObserver = new ResizeObserver(() => this.#syncDock());
1587
1602
  dockObserver.observe(this.#dockBar);
1588
1603
  this.#connection.signal.addEventListener("abort", () => dockObserver.disconnect());
1604
+ // A host's own size arrives with no event: a token written or a class changed
1605
+ // moves nothing here until the next window resize or reopen, and a panel
1606
+ // re-placed under a size that has since gone stays held short of its spot. The
1607
+ // transcript is watched rather than this element, whose box it follows, because
1608
+ // a page publishing a token from an observer of its own, as the README's recipe
1609
+ // does, changes this box after that observer has run, and the browser reports
1610
+ // the answer to a target no deeper than that one as a loop on the window. One
1611
+ // of its own already watches the transcript, so this adds no report of its own.
1612
+ const layoutObserver = new ResizeObserver(this.#onLayoutChange);
1613
+ layoutObserver.observe(this.#messages);
1614
+ this.#connection.signal.addEventListener("abort", () => layoutObserver.disconnect());
1615
+ // The viewport insets arrive the same way, and a page's observer writes them after
1616
+ // the window's resize event, so that restore reads the bar as it was. The probe
1617
+ // carries them, and an observer on it would be a report on the window for the same
1618
+ // reason, so it takes them as a transition instead: heard the next frame, whichever
1619
+ // element wrote them and however late.
1620
+ this.#placement.probe.addEventListener("transitionrun", this.#onLayoutChange, {
1621
+ signal: this.#connection.signal,
1622
+ });
1589
1623
  this.#syncDock();
1590
1624
  // Under collapse-to="none" the host draws the collapsed state itself, so
1591
1625
  // it has to learn the state the element mounted in -- restored from
@@ -2795,6 +2829,13 @@ export class AgUiChat extends HTMLElement {
2795
2829
  const probe = this.#placement.probe;
2796
2830
  probe.className = "viewport-probe";
2797
2831
  probe.setAttribute("aria-hidden", "true");
2832
+ // A transition, so a token changing is an event. On the corners of a box with no
2833
+ // size, which draw nothing: a margin would push it out by the token again, and that
2834
+ // is scroll on a page or a card holding the chat. Not on the padding, which the
2835
+ // viewport is read from and has to stay instant.
2836
+ probe.style.borderRadius =
2837
+ "var(--_viewport-inset-top) var(--_viewport-inset-right) var(--_viewport-inset-bottom) var(--_viewport-inset-left)";
2838
+ probe.style.transition = "border-radius 1ms";
2798
2839
  this.#root.replaceChildren(probe, this.#announcer.region, this.#chat, this.#dockBar);
2799
2840
  }
2800
2841
 
@@ -25,12 +25,15 @@ export interface ChatSurfaceReport {
25
25
  /** Whether the panel can be moved, or the placement owns its position. */
26
26
  readonly movable: boolean;
27
27
  /**
28
- * Whether this page allows the panel to be moved at all.
28
+ * Whether this page allows the panel to be moved at all: true for every
29
+ * placement unless the host set `data-launcher-drag="false"`. It is the
30
+ * page's setting alone and does not vary with the placement or `collapse-to`;
31
+ * whether this panel moves is {@link ChatSurfaceReport.movable}.
29
32
  *
30
- * Reported apart from {@link ChatSurfaceReport.movable} only because the two
31
- * reasons a move is refused call for different sentences: a host that turned
32
- * dragging off is not the placement owning the position, and telling the
33
- * user the second when the first is true is a plain falsehood.
33
+ * Reported apart from `movable` only because the two reasons a move is
34
+ * refused call for different sentences: a host that turned dragging off is
35
+ * not the placement owning the position, and telling the user the second
36
+ * when the first is true is a plain falsehood.
34
37
  */
35
38
  readonly draggable: boolean;
36
39
  /** Whether the panel currently covers the whole viewport. */