@fusion.dev/helix-headless 0.10.2 → 0.11.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/custom-elements.json
CHANGED
|
@@ -7287,6 +7287,10 @@
|
|
|
7287
7287
|
"description": "The consumer's own markup.",
|
|
7288
7288
|
"name": "content"
|
|
7289
7289
|
},
|
|
7290
|
+
{
|
|
7291
|
+
"description": "The default wait, drawn only when nothing is slotted over it.",
|
|
7292
|
+
"name": "indicator"
|
|
7293
|
+
},
|
|
7290
7294
|
{
|
|
7291
7295
|
"description": "The status glyph beside a failure.",
|
|
7292
7296
|
"name": "mark"
|
|
@@ -7329,6 +7333,10 @@
|
|
|
7329
7333
|
"description": "Who said it.",
|
|
7330
7334
|
"name": "avatar"
|
|
7331
7335
|
},
|
|
7336
|
+
{
|
|
7337
|
+
"description": "The wait before the first token. Falls back to the typing indicator, so slotting nothing is what this has always done.",
|
|
7338
|
+
"name": "indicator"
|
|
7339
|
+
},
|
|
7332
7340
|
{
|
|
7333
7341
|
"description": "What it was said from: citations, documents, a retrieved page.",
|
|
7334
7342
|
"name": "sources"
|
|
@@ -7445,6 +7453,17 @@
|
|
|
7445
7453
|
},
|
|
7446
7454
|
"description": "The status glyph, behind a seam so a tier can draw its own.\n\n`TONE_MARKS.danger` rather than a glyph chosen here: the library has one\nstatus vocabulary, `Callout`, `Toast.Item` and `Announcement` all read from\nit, and a reader meets these four marks in a passage, in a message and now\non a turn and has to read them as the same four things. It carries the\naccessible name with it, which is the half that matters: `danger` is the\nword the API uses and \"Error\" is the word a reader understands."
|
|
7447
7455
|
},
|
|
7456
|
+
{
|
|
7457
|
+
"kind": "method",
|
|
7458
|
+
"name": "renderIndicator",
|
|
7459
|
+
"privacy": "protected",
|
|
7460
|
+
"return": {
|
|
7461
|
+
"type": {
|
|
7462
|
+
"text": "TemplateResult | typeof nothing"
|
|
7463
|
+
}
|
|
7464
|
+
},
|
|
7465
|
+
"description": "The wait, for a consumer who slots nothing.\n\n**The slot and its fallback together, in a seam of its own**, because the\ntwo answer different people: the slot lets a consumer put their own\nindicator in the bubble, and the method lets the tier above replace what\nthey get when they do not, without reimplementing the template around it.\nHeadless draws a box and paints nothing on it."
|
|
7466
|
+
},
|
|
7448
7467
|
{
|
|
7449
7468
|
"kind": "method",
|
|
7450
7469
|
"name": "renderState",
|
|
@@ -24,6 +24,8 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
24
24
|
* @slot - What was said.
|
|
25
25
|
* @slot actions - What can be done with it: copy, retry, react.
|
|
26
26
|
* @slot avatar - Who said it.
|
|
27
|
+
* @slot indicator - The wait before the first token. Falls back to the typing
|
|
28
|
+
* indicator, so slotting nothing is what this has always done.
|
|
27
29
|
* @slot sources - What it was said from: citations, documents, a retrieved page.
|
|
28
30
|
*
|
|
29
31
|
* @event {HelixSendEvent} helix-send - Fired when the reader asks to send a failed message again, and cancelable.
|
|
@@ -32,6 +34,7 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
32
34
|
* @csspart avatar - The leading slot's box.
|
|
33
35
|
* @csspart body - What was said, and the line under it.
|
|
34
36
|
* @csspart content - The consumer's own markup.
|
|
37
|
+
* @csspart indicator - The default wait, drawn only when nothing is slotted over it.
|
|
35
38
|
* @csspart mark - The status glyph beside a failure.
|
|
36
39
|
* @csspart message - The whole turn.
|
|
37
40
|
* @csspart meta - The line under a turn: its time, its state, and its controls.
|
|
@@ -104,6 +107,16 @@ export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
|
104
107
|
* word the API uses and "Error" is the word a reader understands.
|
|
105
108
|
*/
|
|
106
109
|
protected renderMark(): TemplateResult;
|
|
110
|
+
/**
|
|
111
|
+
* The wait, for a consumer who slots nothing.
|
|
112
|
+
*
|
|
113
|
+
* **The slot and its fallback together, in a seam of its own**, because the
|
|
114
|
+
* two answer different people: the slot lets a consumer put their own
|
|
115
|
+
* indicator in the bubble, and the method lets the tier above replace what
|
|
116
|
+
* they get when they do not, without reimplementing the template around it.
|
|
117
|
+
* Headless draws a box and paints nothing on it.
|
|
118
|
+
*/
|
|
119
|
+
protected renderIndicator(): TemplateResult | typeof nothing;
|
|
107
120
|
/**
|
|
108
121
|
* What has happened to it, in words, and the way back from a failure.
|
|
109
122
|
*
|
|
@@ -61,6 +61,9 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
61
61
|
${unsafeSVG(icon.content)}
|
|
62
62
|
</svg>`;
|
|
63
63
|
}
|
|
64
|
+
renderIndicator() {
|
|
65
|
+
return html `<slot name="indicator"><span part="indicator"></span></slot>`;
|
|
66
|
+
}
|
|
64
67
|
renderState() {
|
|
65
68
|
if (this.state === 'sending') {
|
|
66
69
|
return html `<span part="state">${this.sendingLabel}</span>`;
|
|
@@ -94,7 +97,10 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
94
97
|
return html `<div part="message">
|
|
95
98
|
<span part="avatar"><slot name="avatar"></slot></span>
|
|
96
99
|
<div part="body">
|
|
97
|
-
<div part="content"
|
|
100
|
+
<div part="content">
|
|
101
|
+
<slot @slotchange=${this.handleFill}></slot>
|
|
102
|
+
${this.renderIndicator()}
|
|
103
|
+
</div>
|
|
98
104
|
<div part="sources"><slot name="sources" @slotchange=${this.handleFill}></slot></div>
|
|
99
105
|
<span part="meta"
|
|
100
106
|
>${this.renderTime()} ${this.renderState()}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-headless",
|
|
3
3
|
"description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
},
|
|
46
46
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@fusion.dev/helix-core": "0.
|
|
49
|
-
"@fusion.dev/helix-icons": "0.
|
|
48
|
+
"@fusion.dev/helix-core": "0.11.0",
|
|
49
|
+
"@fusion.dev/helix-icons": "0.11.0",
|
|
50
50
|
"uqr": "^0.1.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
54
|
-
"@fusion.dev/helix-cem": "0.
|
|
55
|
-
"@fusion.dev/helix-testing": "0.
|
|
54
|
+
"@fusion.dev/helix-cem": "0.11.0",
|
|
55
|
+
"@fusion.dev/helix-testing": "0.11.0",
|
|
56
56
|
"@fusion.dev/scripts": "0.0.0-dev",
|
|
57
57
|
"@happy-dom/global-registrator": "^20.0.0",
|
|
58
58
|
"@lit-labs/ssr": "^3.3.0",
|
package/types/jsx.d.ts
CHANGED
|
@@ -17070,6 +17070,7 @@ export type CustomElements = {
|
|
|
17070
17070
|
* - `(default)`: What was said.
|
|
17071
17071
|
* - `actions`: What can be done with it: copy, retry, react.
|
|
17072
17072
|
* - `avatar`: Who said it.
|
|
17073
|
+
* - `indicator`: The wait before the first token. Falls back to the typing indicator, so slotting nothing is what this has always done.
|
|
17073
17074
|
* - `sources`: What it was said from: citations, documents, a retrieved page.
|
|
17074
17075
|
*
|
|
17075
17076
|
* ## CSS Parts
|
|
@@ -17080,6 +17081,7 @@ export type CustomElements = {
|
|
|
17080
17081
|
* - `avatar`: The leading slot's box.
|
|
17081
17082
|
* - `body`: What was said, and the line under it.
|
|
17082
17083
|
* - `content`: The consumer's own markup.
|
|
17084
|
+
* - `indicator`: The default wait, drawn only when nothing is slotted over it.
|
|
17083
17085
|
* - `mark`: The status glyph beside a failure.
|
|
17084
17086
|
* - `message`: The whole turn.
|
|
17085
17087
|
* - `meta`: The line under a turn: its time, its state, and its controls.
|
|
@@ -31282,6 +31284,7 @@ export type CustomElementsSolidJs = {
|
|
|
31282
31284
|
* - `(default)`: What was said.
|
|
31283
31285
|
* - `actions`: What can be done with it: copy, retry, react.
|
|
31284
31286
|
* - `avatar`: Who said it.
|
|
31287
|
+
* - `indicator`: The wait before the first token. Falls back to the typing indicator, so slotting nothing is what this has always done.
|
|
31285
31288
|
* - `sources`: What it was said from: citations, documents, a retrieved page.
|
|
31286
31289
|
*
|
|
31287
31290
|
* ## CSS Parts
|
|
@@ -31292,6 +31295,7 @@ export type CustomElementsSolidJs = {
|
|
|
31292
31295
|
* - `avatar`: The leading slot's box.
|
|
31293
31296
|
* - `body`: What was said, and the line under it.
|
|
31294
31297
|
* - `content`: The consumer's own markup.
|
|
31298
|
+
* - `indicator`: The default wait, drawn only when nothing is slotted over it.
|
|
31295
31299
|
* - `mark`: The status glyph beside a failure.
|
|
31296
31300
|
* - `message`: The whole turn.
|
|
31297
31301
|
* - `meta`: The line under a turn: its time, its state, and its controls.
|