@genesislcap/ai-assistant 15.35.4 → 15.36.1

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/docs/styling.md CHANGED
@@ -60,6 +60,44 @@ Parts on the conversation area (the outer frame exposes many more — e.g.
60
60
  | `message-<type>` | A bubble of one kind: `message-user`, `message-ai`, `message-ai-thinking`, `message-ai-function`, `message-interaction` |
61
61
  | `message-interaction-<presentation>` | An interaction bubble in one presentation: `message-interaction-label`, `message-interaction-bare`, `message-interaction-bubble` |
62
62
  | `thinking` | The loading-indicator row |
63
+ | `avatar` | The avatar box beside a message (and beside the loading indicator) |
64
+ | `avatar-user` / `avatar-assistant` | That box, by **role** — `avatar-assistant` covers every assistant row whatever its type |
65
+ | `avatar-<type>` | That box for one kind of row: `avatar-user`, `avatar-ai`, `avatar-ai-thinking`, `avatar-ai-function`, `avatar-interaction` |
66
+ | `avatar-img` | The avatar image, when `image-src` / `user-image-src` is set |
67
+ | `avatar-img-user` / `avatar-img-assistant` | That image, by role |
68
+ | `avatar-img-<type>` | That image, by row type |
69
+ | `avatar-icon` | The inline SVG mark, when no image is set |
70
+ | `avatar-icon-user` / `avatar-icon-assistant` | That mark, by role |
71
+ | `avatar-icon-<type>` | That mark, by row type |
72
+ | `sender` | The name + timestamp row at the top of a bubble |
73
+ | `sender-label` | Just the name |
74
+ | `content` | The bubble's body (markdown, tool calls, interaction widgets) |
75
+
76
+ Each avatar element carries all three names at once, because `::part()` names
77
+ cannot be chained — `::part(avatar-assistant) ::part(avatar-img)` does not exist,
78
+ so every combination you might want to select has to be a name of its own.
79
+
80
+ **Reach for the role name first.** The assistant is split across four row types,
81
+ so `avatar-icon-ai` is only the *plain reply* — thinking, tool-call and
82
+ interaction rows are `avatar-icon-ai-thinking`, `avatar-icon-ai-function` and
83
+ `avatar-icon-interaction`. `avatar-icon-assistant` is all of them, and keeps
84
+ working if a row type is added later:
85
+
86
+ ```css
87
+ /* Every assistant mark, never the user's */
88
+ foundation-ai-assistant::part(avatar-icon-assistant) {
89
+ color: var(--accent-fill-rest);
90
+ }
91
+
92
+ /* Just the thinking rows */
93
+ foundation-ai-assistant::part(avatar-icon-ai-thinking) {
94
+ opacity: 0.6;
95
+ }
96
+ ```
97
+
98
+ The loading-indicator row uses the same avatar as a plain reply, so it answers to
99
+ `avatar`, `avatar-assistant` and `avatar-ai` like any other assistant row — hiding
100
+ avatars no longer leaves that one behind.
63
101
 
64
102
  Target them from an app stylesheet with `::part()`:
65
103
 
@@ -188,6 +226,121 @@ foundation-ai-assistant::part(messages-content) { max-width: none; }
188
226
  foundation-ai-assistant::part(messages-content) { display: contents; }
189
227
  ```
190
228
 
229
+ ### The header buttons
230
+
231
+ The header's popout and settings buttons are design-system buttons, so their
232
+ padded inner `control` sits two shadow boundaries from the app. `::part()` crosses
233
+ exactly one, so the assistant re-publishes them under its own namespace:
234
+
235
+ | Part | Element |
236
+ | --- | --- |
237
+ | `popout-button` / `settings-button` | The button hosts |
238
+ | `popout-button-control` / `settings-button-control` | The button's inner control — where padding and sizing actually live |
239
+ | `popout-button-content` / `settings-button-content` | The content slot wrapper inside the control |
240
+
241
+ Size the control, not the host: shrinking the host and clipping the overflow
242
+ flattens the glyph, which is the workaround these parts exist to remove.
243
+
244
+ ```css
245
+ foundation-ai-assistant::part(settings-button-control) {
246
+ padding: 2px;
247
+ min-width: 24px;
248
+ }
249
+ ```
250
+
251
+ The `-control` / `-content` names come from the registered design-system button.
252
+ A button exposing different parts forwards nothing and these rules simply do not
253
+ match.
254
+
255
+ ### Rendered markdown
256
+
257
+ Assistant replies are markdown rendered at runtime, so there is no template to
258
+ author parts on — the generated DOM is annotated after sanitising instead. Every
259
+ element kind gets a part, forwarded through the assistant's own shadow root:
260
+
261
+ | Part | Element |
262
+ | --- | --- |
263
+ | `md-p` | `<p>` |
264
+ | `md-ul` / `md-ol` / `md-li` | Lists and list items |
265
+ | `md-ul-level-<n>` / `md-ol-level-<n>` / `md-li-level-<n>` | The same, at nesting level `n` (1-based) |
266
+ | `md-pre` | Code block wrapper |
267
+ | `md-code` | Any `<code>` |
268
+ | `md-code-block` / `md-code-inline` | A `<code>` inside a `<pre>`, or standing alone |
269
+ | `md-link` | `<a>` |
270
+ | `md-quote` | `<blockquote>` |
271
+ | `md-table` / `md-thead` / `md-tbody` / `md-tr` / `md-th` / `md-td` | Table structure |
272
+ | `md-hr` | `<hr>` |
273
+ | `md-img` | `<img>` |
274
+ | `md-strong` / `md-em` | Bold and italic |
275
+ | `md-h1` … `md-h6` | Headings |
276
+
277
+ ```css
278
+ /* Inline code only — code blocks keep their own treatment */
279
+ foundation-ai-assistant::part(md-code-inline) {
280
+ background: var(--neutral-fill-secondary-rest);
281
+ }
282
+
283
+ /* Tighten nested lists */
284
+ foundation-ai-assistant::part(md-ul-level-2) {
285
+ margin-block: 0;
286
+ }
287
+ ```
288
+
289
+ If you render `<ai-chat-markdown>` yourself, inside your own shadow root, you
290
+ have the same forwarding problem — import the list rather than retyping it:
291
+
292
+ ```ts
293
+ import { MARKDOWN_EXPORTPARTS } from '@genesislcap/ai-assistant';
294
+ ```
295
+
296
+ Two caveats. **List levels stop at 3**: `exportparts` has no wildcard, so the
297
+ forwarded vocabulary has to be finite — a list nested four deep is tagged
298
+ `md-ul-level-3`, i.e. the deepest level means "this deep or deeper". And the part
299
+ vocabulary is exactly the table above whatever the model writes: `part` and
300
+ `exportparts` are stripped from the markdown during sanitising, so inline HTML in
301
+ a reply cannot mint a name of its own.
302
+
303
+ ### Suggestions
304
+
305
+ | Part | Element |
306
+ | --- | --- |
307
+ | `suggestions-container` | The row of suggestion pills |
308
+ | `suggestion-placeholder` | A skeleton pill, while suggestions load |
309
+ | `suggestion-pill` | One suggestion button |
310
+
311
+ ### The floating bubble
312
+
313
+ When the assistant runs as a floating bubble (`ai-chat-bubble`):
314
+
315
+ | Part | Element |
316
+ | --- | --- |
317
+ | `bubble` | The collapsed floating bubble |
318
+ | `pulse-ring` | The ring animating around it |
319
+ | `tooltip` | Its hover tooltip |
320
+ | `dialog` | The expanded dialog |
321
+ | `dialog-content` | The dialog's content area |
322
+
323
+ These three are positioned and sized by the component, and an outer `::part()`
324
+ rule beats both the component's own styles *and* its inline `style` attribute —
325
+ the tree-context comparison comes before the style-attribute one in the cascade.
326
+ So the component owns, and you should not set:
327
+
328
+ | Part | Properties the component owns |
329
+ | --- | --- |
330
+ | `bubble` | `translate` (its drag position) |
331
+ | `dialog` | `translate`, `width`, `height` (drag position and resize state) |
332
+ | `tooltip` | Its placement (set inline as the bubble moves) |
333
+
334
+ Overriding `width` / `height` on `dialog` does not resize the dialog so much as
335
+ desynchronise it: the resize handle keeps writing sizes that no longer apply.
336
+ Everything else — colours, borders, radius, shadow, typography — is yours.
337
+
338
+ One more on `dialog`: the exit animation is a real dependency, not decoration.
339
+ Removing it (`animation: none`) is handled — the dialog closes immediately
340
+ instead of waiting for an `animationend` that would never fire — but replacing it
341
+ with a non-terminating animation will leave the dialog open, since the close
342
+ waits for that animation to end.
343
+
191
344
  ---
192
345
 
193
346
  ## Responsive sizing
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.35.4",
4
+ "version": "15.36.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -82,32 +82,32 @@
82
82
  }
83
83
  },
84
84
  "devDependencies": {
85
- "@genesislcap/foundation-comms": "15.35.4",
86
- "@genesislcap/foundation-testing": "15.35.4",
87
- "@genesislcap/genx": "15.35.4",
88
- "@genesislcap/rollup-builder": "15.35.4",
89
- "@genesislcap/ts-builder": "15.35.4",
90
- "@genesislcap/uvu-playwright-builder": "15.35.4",
91
- "@genesislcap/vite-builder": "15.35.4",
92
- "@genesislcap/webpack-builder": "15.35.4",
85
+ "@genesislcap/foundation-comms": "15.36.1",
86
+ "@genesislcap/foundation-testing": "15.36.1",
87
+ "@genesislcap/genx": "15.36.1",
88
+ "@genesislcap/rollup-builder": "15.36.1",
89
+ "@genesislcap/ts-builder": "15.36.1",
90
+ "@genesislcap/uvu-playwright-builder": "15.36.1",
91
+ "@genesislcap/vite-builder": "15.36.1",
92
+ "@genesislcap/webpack-builder": "15.36.1",
93
93
  "@types/dompurify": "^3.0.5",
94
94
  "@types/marked": "^5.0.2",
95
95
  "esbuild": "0.25.12"
96
96
  },
97
97
  "dependencies": {
98
- "@genesislcap/foundation-ai": "15.35.4",
99
- "@genesislcap/foundation-logger": "15.35.4",
100
- "@genesislcap/foundation-notifications": "15.35.4",
101
- "@genesislcap/foundation-redux": "15.35.4",
102
- "@genesislcap/foundation-ui": "15.35.4",
103
- "@genesislcap/foundation-utils": "15.35.4",
104
- "@genesislcap/rapid-design-system": "15.35.4",
105
- "@genesislcap/web-core": "15.35.4",
98
+ "@genesislcap/foundation-ai": "15.36.1",
99
+ "@genesislcap/foundation-logger": "15.36.1",
100
+ "@genesislcap/foundation-notifications": "15.36.1",
101
+ "@genesislcap/foundation-redux": "15.36.1",
102
+ "@genesislcap/foundation-ui": "15.36.1",
103
+ "@genesislcap/foundation-utils": "15.36.1",
104
+ "@genesislcap/rapid-design-system": "15.36.1",
105
+ "@genesislcap/web-core": "15.36.1",
106
106
  "dompurify": "^3.3.1",
107
107
  "marked": "^17.0.3"
108
108
  },
109
109
  "peerDependencies": {
110
- "@genesislcap/foundation-comms": "^15.35.4"
110
+ "@genesislcap/foundation-comms": "^15.36.1"
111
111
  },
112
112
  "peerDependenciesMeta": {
113
113
  "@genesislcap/foundation-comms": {