@adia-ai/web-modules 0.8.30 → 0.8.31

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 CHANGED
@@ -1,11 +1,20 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.8.31] — 2026-08-07
4
+
5
+ ### Fixed
6
+ - **`chat-empty` is now registered** (gh#655). It had every sidecar (yaml/a2ui.json/examples) but no `defineIfFree('chat-empty', …)` anywhere — the tag never upgraded, so `customElements.whenDefined('chat-empty')` never resolved for any consumer awaiting it (light-DOM children still rendered; CSS tag-selectors still painted it, since neither cares about upgrade status — but the element itself stayed undefined). Added `chat-empty.js` with a minimal `UIElement` subclass (no reactive props, matching its CSS-only visibility contract) registered the way the sibling JS-bearing chat-cluster modules are (`chat-sidebar`, `chat-thread`, `chat-composer`); wired into `chat/index.js`'s barrel export.
7
+
8
+ ### Maintenance
9
+ - **`dist/` bundles rebuilt** in this cut's window (1 file(s)) — regenerated from the source changes described above, not independent edits.
10
+
3
11
  ## [0.8.30] — 2026-08-07
4
12
 
5
13
  ### Added
6
14
  - **`chatShell.setStreamedText(text)`** — replaces the streaming assistant message's text outright, the counterpart to `appendChunk` for a producer that revises what it already streamed.
7
15
 
8
16
  ### Fixed
17
+ - **`chat-composer` stops the inner `submit` event at its re-dispatch boundary (gh#676).** The re-emitted `composer-submit` was riding alongside the raw `submit` bubbling in from `chat-input-ui` unstopped — a host could receive both. `stopPropagation()` on the inner event before re-dispatching as `composer-submit` closes the second path.
9
18
  - **A rewritten or withheld turn now leaves the screen agreeing with the transcript (gh#665).** `wireAgentEvents` treated every `text` event as an append, so an `@adia-ai/agent` output guardrail's re-snapshot (`{ text: '', snapshot: <rewritten> }`) appended nothing and the ORIGINAL text stayed on screen while the session recorded the rewrite — a redaction that redacted nothing visible. An empty delta is now a replace from `snapshot` (an empty snapshot clears the bubble), which is safe for any text event since the snapshot is always the authoritative text.
10
19
 
11
20
  ### Maintenance
@@ -49,6 +49,12 @@ class ChatComposer extends UIElement {
49
49
  this.#inputEl = this.querySelector('chat-input-ui') || this.querySelector('input-ui') || this.querySelector('textarea-ui');
50
50
 
51
51
  this.#onSubmit = (e) => {
52
+ // Stop the inner 'submit' event at this re-dispatch boundary too —
53
+ // this component re-emits it as 'composer-submit' below, so letting
54
+ // the raw 'submit' keep bubbling past chat-composer would let a
55
+ // host that (also) listens for raw 'submit' receive a duplicate
56
+ // (gh#676).
57
+ e.stopPropagation();
52
58
  // Re-emit as 'composer-submit' so host listens to one event
53
59
  // regardless of which inner input it is
54
60
  this.dispatchEvent(new CustomEvent('composer-submit', {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://adiaui.dev/a2ui/v0_9/components/ChatEmpty.json",
4
4
  "title": "ChatEmpty",
5
- "description": "Module-tier chat empty state. CSS-only no behavior, no JS. Sits\nas the first child of <chat-thread> as the empty state placeholder.\nVisibility is driven by <chat-thread>'s [empty] reflected attribute\nvia CSS (no JS toggling needed) when messages arrive, the parent\nthread loses [empty] and CSS hides this stub.\n\nReplaces the legacy <empty-state-ui data-chat-empty> child of the\nmessages container per ADR-0023. The legacy shape was retired in\nv0.4.0 per ADR-0024 and is no longer recognized.\n",
5
+ "description": "Module-tier chat empty state. No reactive props visibility is\ndriven by <chat-thread>'s [empty] reflected attribute via CSS (no\nJS toggling needed); when messages arrive, the parent thread loses\n[empty] and CSS hides this stub. Registered (defineIfFree) so the\ntag upgrades and resolves customElements.whenDefined('chat-empty')\n(gh#655) — sits as the first child of <chat-thread> as the empty\nstate placeholder.\n\nReplaces the legacy <empty-state-ui data-chat-empty> child of the\nmessages container per ADR-0023. The legacy shape was retired in\nv0.4.0 per ADR-0024 and is no longer recognized.\n",
6
6
  "type": "object",
7
7
  "allOf": [
8
8
  {
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `<chat-empty>` — Module-tier chat empty state. No reactive props — visibility is
3
+ driven by <chat-thread>'s [empty] reflected attribute via CSS (no
4
+ JS toggling needed); when messages arrive, the parent thread loses
5
+ [empty] and CSS hides this stub. Registered (defineIfFree) so the
6
+ tag upgrades and resolves customElements.whenDefined('chat-empty')
7
+ (gh#655) — sits as the first child of <chat-thread> as the empty
8
+ state placeholder.
9
+
10
+ Replaces the legacy <empty-state-ui data-chat-empty> child of the
11
+ messages container per ADR-0023. The legacy shape was retired in
12
+ v0.4.0 per ADR-0024 and is no longer recognized.
13
+
14
+ *
15
+ * @see https://ui-kit.exe.xyz/site/components/chat-empty
16
+ *
17
+ * Type declarations generated by scripts/build/dts-codegen.mjs from
18
+ * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
19
+ * run `npm run build:components`, then `npm run codegen:dts` to
20
+ * regenerate; or hand-author this file fully if rich event types are
21
+ * needed beyond what the yaml `events:` block can express.
22
+ */
23
+
24
+ import { UIElement } from '../../../web-components/core/element.js';
25
+
26
+ export class ChatEmpty extends UIElement {
27
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * <chat-empty>
3
+ * <empty-state-ui icon="chat-circle" heading="Hello!" description="Ask me anything."></empty-state-ui>
4
+ * </chat-empty>
5
+ *
6
+ * Module-tier chat empty state — the bespoke replacement for legacy
7
+ * `<empty-state-ui data-chat-empty>` per ADR-0023. Sits as the first
8
+ * child of <chat-thread>; visibility is driven entirely by CSS off
9
+ * <chat-thread>'s [empty] reflected attribute (see
10
+ * chat-shell/css/chat-shell.bespoke.css) — no JS toggling needed.
11
+ *
12
+ * Registered (gh#655) even though the element carries no reactive
13
+ * state: an unregistered custom element never resolves
14
+ * `customElements.whenDefined('chat-empty')` and never matches
15
+ * `:defined` — a host or test that waits on either hangs/mismatches
16
+ * forever, even though CSS tag-selectors keep painting it either way.
17
+ * Matches the sibling JS-bearing chat-cluster modules' own-file
18
+ * registration shape (chat-sidebar, chat-thread, chat-composer);
19
+ * chat-header/chat-status stay genuinely unregistered CSS-only markup
20
+ * wrappers — chat-empty is the one with a live tag reference in
21
+ * consumer surfaces (patient-visit), so it gets the class.
22
+ */
23
+
24
+ import { defineIfFree } from '../../../web-components/core/register.js';
25
+ import { UIElement } from '../../../web-components/core/element.js';
26
+
27
+ class ChatEmpty extends UIElement {
28
+ static properties = {};
29
+
30
+ static template = () => null;
31
+ }
32
+
33
+ defineIfFree('chat-empty', ChatEmpty);
34
+ export { ChatEmpty };
@@ -7,11 +7,13 @@ component: ChatEmpty
7
7
  category: feedback
8
8
  version: 1
9
9
  description: |
10
- Module-tier chat empty state. CSS-only no behavior, no JS. Sits
11
- as the first child of <chat-thread> as the empty state placeholder.
12
- Visibility is driven by <chat-thread>'s [empty] reflected attribute
13
- via CSS (no JS toggling needed) when messages arrive, the parent
14
- thread loses [empty] and CSS hides this stub.
10
+ Module-tier chat empty state. No reactive props visibility is
11
+ driven by <chat-thread>'s [empty] reflected attribute via CSS (no
12
+ JS toggling needed); when messages arrive, the parent thread loses
13
+ [empty] and CSS hides this stub. Registered (defineIfFree) so the
14
+ tag upgrades and resolves customElements.whenDefined('chat-empty')
15
+ (gh#655) — sits as the first child of <chat-thread> as the empty
16
+ state placeholder.
15
17
 
16
18
  Replaces the legacy <empty-state-ui data-chat-empty> child of the
17
19
  messages container per ADR-0023. The legacy shape was retired in
@@ -43,8 +45,8 @@ a2ui:
43
45
  <empty-state-ui data-chat-empty>. Place as the first child of
44
46
  <chat-thread>; visibility is automatic via the [empty]
45
47
  reflected attribute.
46
- - rule: 'CSS-only no JS module needed in shell HTML imports.'
47
- reason: 'CSS-only primitive.'
48
+ - rule: 'No reactive props — visibility is CSS-driven off the parent [empty] attribute, not a JS toggle.'
49
+ reason: 'State contract.'
48
50
  - rule: 'For non-chat empty states (lists, tables, canvas) use <empty-state-ui> primitive instead; chat-empty is chat-cluster-namespaced.'
49
51
  reason: 'Cluster vs primitive distinction.'
50
52
 
package/chat/index.js CHANGED
@@ -2,4 +2,5 @@ export { ChatShell } from './chat-shell/chat-shell.js';
2
2
  export { ChatThread } from './chat-thread/chat-thread.js';
3
3
  export { ChatComposer } from './chat-composer/chat-composer.js';
4
4
  export { ChatSidebar } from './chat-sidebar/chat-sidebar.js';
5
+ export { ChatEmpty } from './chat-empty/chat-empty.js';
5
6
  export { createSurfaceRegistry, wireAgentEvents, PROGRESS_LABELS } from './chat-surfaces/chat-surfaces.js';