@nonoun/native-chat 0.1.3 → 0.3.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/dist/avatar/chat-avatar-element.d.ts +18 -0
- package/dist/avatar/chat-avatar-element.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/n-chat-avatar.d.ts +2 -0
- package/dist/avatar/n-chat-avatar.d.ts.map +1 -0
- package/dist/chat-input-element.d.ts +10 -0
- package/dist/chat-input-element.d.ts.map +1 -1
- package/dist/chat-input-structured-element-Cpar3CeA.js +1069 -0
- package/dist/chat-panel-element.d.ts +28 -7
- package/dist/chat-panel-element.d.ts.map +1 -1
- package/dist/feed/chat-feed-element.d.ts +29 -0
- package/dist/feed/chat-feed-element.d.ts.map +1 -0
- package/dist/feed/index.d.ts +2 -0
- package/dist/feed/index.d.ts.map +1 -0
- package/dist/feed/n-chat-feed.d.ts +2 -0
- package/dist/feed/n-chat-feed.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/message/chat-input-structured-element.d.ts +43 -0
- package/dist/message/chat-input-structured-element.d.ts.map +1 -0
- package/dist/message/chat-message-activity-element.d.ts +32 -0
- package/dist/message/chat-message-activity-element.d.ts.map +1 -0
- package/dist/message/chat-message-element.d.ts +28 -0
- package/dist/message/chat-message-element.d.ts.map +1 -0
- package/dist/message/chat-message-genui-element.d.ts +45 -0
- package/dist/message/chat-message-genui-element.d.ts.map +1 -0
- package/dist/message/chat-message-seed-element.d.ts +33 -0
- package/dist/message/chat-message-seed-element.d.ts.map +1 -0
- package/dist/message/chat-message-text-element.d.ts +37 -0
- package/dist/message/chat-message-text-element.d.ts.map +1 -0
- package/dist/message/chat-messages-element.d.ts +28 -0
- package/dist/message/chat-messages-element.d.ts.map +1 -0
- package/dist/message/index.d.ts +8 -0
- package/dist/message/index.d.ts.map +1 -0
- package/dist/message/n-chat-message.d.ts +2 -0
- package/dist/message/n-chat-message.d.ts.map +1 -0
- package/dist/native-chat.css +477 -28
- package/dist/native-chat.js +323 -2
- package/dist/register.d.ts +10 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +4 -4
- package/dist/stream/create-transport.d.ts +19 -0
- package/dist/stream/create-transport.d.ts.map +1 -0
- package/dist/stream/index.d.ts +7 -0
- package/dist/stream/index.d.ts.map +1 -0
- package/dist/stream/parse-json.d.ts +9 -0
- package/dist/stream/parse-json.d.ts.map +1 -0
- package/dist/stream/parse-ndjson.d.ts +9 -0
- package/dist/stream/parse-ndjson.d.ts.map +1 -0
- package/dist/stream/parse-sse.d.ts +9 -0
- package/dist/stream/parse-sse.d.ts.map +1 -0
- package/dist/stream/types.d.ts +23 -0
- package/dist/stream/types.d.ts.map +1 -0
- package/dist/telemetry/emitter.d.ts +20 -0
- package/dist/telemetry/emitter.d.ts.map +1 -0
- package/dist/telemetry/events.d.ts +11 -0
- package/dist/telemetry/events.d.ts.map +1 -0
- package/dist/telemetry/index.d.ts +5 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/redactor.d.ts +17 -0
- package/dist/telemetry/redactor.d.ts.map +1 -0
- package/dist/telemetry/types.d.ts +27 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/chat-panel-element-CXPbtkyi.js +0 -113
|
@@ -6,19 +6,40 @@ import { NativeElement } from '@nonoun/native-ui';
|
|
|
6
6
|
* `<n-chat-content>`, and `<n-footer>` with `<n-chat-input>` directly
|
|
7
7
|
* as children. The host element itself is the panel surface.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* ## Extension Points
|
|
10
|
+
*
|
|
11
|
+
* **Header trailing slot** — move consumer-provided controls into the header:
|
|
10
12
|
* ```html
|
|
11
|
-
* <native-chat-panel
|
|
13
|
+
* <native-chat-panel>
|
|
14
|
+
* <div slot="header-trailing"><n-button variant="ghost">Custom</n-button></div>
|
|
15
|
+
* </native-chat-panel>
|
|
12
16
|
* ```
|
|
13
17
|
*
|
|
14
|
-
*
|
|
15
|
-
* ```
|
|
16
|
-
* panel
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* **Footer leading slot** — insert content before the chat input:
|
|
19
|
+
* ```html
|
|
20
|
+
* <native-chat-panel>
|
|
21
|
+
* <div slot="footer-leading">Powered by AI</div>
|
|
22
|
+
* </native-chat-panel>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* **Stop / Restart buttons** — toggle via attributes:
|
|
26
|
+
* ```html
|
|
27
|
+
* <native-chat-panel show-stop></native-chat-panel>
|
|
19
28
|
* ```
|
|
29
|
+
* @attr {boolean} show-stop - Show a stop button in the header; fires `native:chat-stop`
|
|
30
|
+
* @attr {boolean} show-restart - Show a restart button in the header; fires `native:chat-restart`
|
|
31
|
+
* @fires native:chat-stop - Fired when the stop button is pressed
|
|
32
|
+
* @fires native:chat-restart - Fired when the restart button is pressed
|
|
33
|
+
* @fires native:send - Fired on submit with `{ value }` detail
|
|
20
34
|
*/
|
|
21
35
|
export declare class NChatPanel extends NativeElement {
|
|
36
|
+
#private;
|
|
37
|
+
static observedAttributes: string[];
|
|
38
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
39
|
+
get showStop(): boolean;
|
|
40
|
+
set showStop(val: boolean);
|
|
41
|
+
get showRestart(): boolean;
|
|
42
|
+
set showRestart(val: boolean);
|
|
22
43
|
setup(): void;
|
|
23
44
|
teardown(): void;
|
|
24
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-panel-element.d.ts","sourceRoot":"","sources":["../src/chat-panel-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"chat-panel-element.d.ts","sourceRoot":"","sources":["../src/chat-panel-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,UAAW,SAAQ,aAAa;;IAC3C,MAAM,CAAC,kBAAkB,WAAiC;IAa1D,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAepF,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAED,IAAI,WAAW,IAAI,OAAO,CAAoC;IAC9D,IAAI,WAAW,CAAC,GAAG,EAAE,OAAO,EAG3B;IAID,KAAK,IAAI,IAAI;IA4Hb,QAAQ,IAAI,IAAI;CA6CjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Chat feed coordinator — scrollable thread of message groups.
|
|
4
|
+
*
|
|
5
|
+
* Wraps `n-chat-messages` groups and manages auto-scroll behavior.
|
|
6
|
+
* When pinned to bottom, new content automatically scrolls into view.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <n-chat-feed auto-scroll>
|
|
10
|
+
* <n-chat-messages role="assistant">...</n-chat-messages>
|
|
11
|
+
* <n-chat-messages role="user">...</n-chat-messages>
|
|
12
|
+
* </n-chat-feed>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @attr {boolean} auto-scroll - Enable auto-scroll to bottom on new content (default: true)
|
|
16
|
+
* @fires native:feed-scroll - Fired when scroll pinned state changes
|
|
17
|
+
*/
|
|
18
|
+
export declare class NChatFeed extends NativeElement {
|
|
19
|
+
#private;
|
|
20
|
+
static observedAttributes: string[];
|
|
21
|
+
constructor();
|
|
22
|
+
get isPinned(): boolean;
|
|
23
|
+
/** Scroll to the bottom of the feed. */
|
|
24
|
+
scrollToBottom(smooth?: boolean): void;
|
|
25
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
26
|
+
setup(): void;
|
|
27
|
+
teardown(): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=chat-feed-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-feed-element.d.ts","sourceRoot":"","sources":["../../src/feed/chat-feed-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAI1D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAU,SAAQ,aAAa;;IAC1C,MAAM,CAAC,kBAAkB,WAAiC;;IAc1D,IAAI,QAAQ,IAAI,OAAO,CAAiC;IAExD,wCAAwC;IACxC,cAAc,CAAC,MAAM,UAAO,GAAG,IAAI;IAUnC,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUpF,KAAK,IAAI,IAAI;IA4Bb,QAAQ,IAAI,IAAI;CAuCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n-chat-feed.d.ts","sourceRoot":"","sources":["../../src/feed/n-chat-feed.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import './register.ts';
|
|
2
2
|
export { NChatInput } from './chat-input-element.ts';
|
|
3
3
|
export { NChatPanel } from './chat-panel-element.ts';
|
|
4
|
+
export { NChatFeed } from './feed/index.ts';
|
|
5
|
+
export { NChatAvatar } from './avatar/index.ts';
|
|
6
|
+
export { NChatMessage, NChatMessages, NChatMessageText, NChatMessageActivity, NChatMessageSeed, NChatMessageGenUI, NChatInputStructured, } from './message/index.ts';
|
|
7
|
+
export type { SeedOption } from './message/chat-message-seed-element.ts';
|
|
8
|
+
export type { StructuredOption } from './message/chat-input-structured-element.ts';
|
|
9
|
+
export type { GenUINode } from './message/chat-message-genui-element.ts';
|
|
10
|
+
export { renderMarkdown, renderInline, sanitizeHtml } from './message/chat-message-text-element.ts';
|
|
11
|
+
export type { ChatStreamChunk, StreamFormat, ChatTransportOptions, ChatStreamEvent, ChatTransport, } from './stream/index.ts';
|
|
12
|
+
export { parseSSE, parseNDJSON, parseJSON, detectFormat, createChatStream, createChatTransport, } from './stream/index.ts';
|
|
13
|
+
export type { TelemetryCorrelation, TelemetryTiming, TelemetryRetry, TelemetryLevel, TelemetryEvent, TelemetryRedactor, } from './telemetry/index.ts';
|
|
14
|
+
export { CHAT_EVENTS, SAFE_FIELDS, SENSITIVE_FIELDS, scrubPII, createDefaultRedactor, TelemetryEmitter, } from './telemetry/index.ts';
|
|
4
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,YAAY,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAGpG,YAAY,EACV,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
export interface StructuredOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Structured multi-choice input — appears before submission for
|
|
10
|
+
* guided input (like modern Claude chat's multiple-choice UI).
|
|
11
|
+
*
|
|
12
|
+
* ```html
|
|
13
|
+
* <n-chat-input-structured
|
|
14
|
+
* question="What would you like to do?"
|
|
15
|
+
* type="single"
|
|
16
|
+
* options='[{"value":"a","label":"Option A"},{"value":"b","label":"Option B"}]'>
|
|
17
|
+
* </n-chat-input-structured>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @attr {string} question - Prompt text
|
|
21
|
+
* @attr {string} type - `single` (default) | `multi`
|
|
22
|
+
* @attr {string} options - JSON array of `{ value, label, description?, icon? }`
|
|
23
|
+
* @attr {boolean} required - At least one selection required before submit
|
|
24
|
+
* @attr {boolean} disabled - Disables interaction
|
|
25
|
+
* @fires native:structured-submit - Fired on submit with selections
|
|
26
|
+
* @fires native:structured-cancel - Fired when dismissed without selecting
|
|
27
|
+
*/
|
|
28
|
+
export declare class NChatInputStructured extends NativeElement {
|
|
29
|
+
#private;
|
|
30
|
+
static observedAttributes: string[];
|
|
31
|
+
constructor();
|
|
32
|
+
get question(): string;
|
|
33
|
+
set question(val: string);
|
|
34
|
+
get options(): StructuredOption[];
|
|
35
|
+
set options(val: StructuredOption[]);
|
|
36
|
+
get selections(): StructuredOption[];
|
|
37
|
+
get disabled(): boolean;
|
|
38
|
+
set disabled(val: boolean);
|
|
39
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
40
|
+
setup(): void;
|
|
41
|
+
teardown(): void;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=chat-input-structured-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-input-structured-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-input-structured-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,mBAAmB,CAAC;AAEhF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;;IACrD,MAAM,CAAC,kBAAkB,WAA2D;;IAiBpF,IAAI,QAAQ,IAAI,MAAM,CAAiC;IACvD,IAAI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAGvB;IAED,IAAI,OAAO,IAAI,gBAAgB,EAAE,CAAgC;IACjE,IAAI,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,EAGlC;IAED,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAGnC;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAiBpF,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,IAAI;CA0HjB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Streaming activity indicator — typing, thinking, or tool-use status.
|
|
4
|
+
*
|
|
5
|
+
* When `active`, shows an animated indicator with elapsed time.
|
|
6
|
+
* When `expandable`, clicking toggles visibility of slotted trace content.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <n-chat-message-activity type="thinking" active>
|
|
10
|
+
* <pre>Reasoning trace here...</pre>
|
|
11
|
+
* </n-chat-message-activity>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @attr {string} type - `typing` | `thinking` | `tool-use`
|
|
15
|
+
* @attr {string} label - Custom label text (overrides default per-type label)
|
|
16
|
+
* @attr {boolean} active - Currently streaming / in progress
|
|
17
|
+
* @attr {boolean} expandable - Allow click to expand trace content
|
|
18
|
+
* @fires native:activity-toggle - Fired when trace is expanded/collapsed
|
|
19
|
+
*/
|
|
20
|
+
export declare class NChatMessageActivity extends NativeElement {
|
|
21
|
+
#private;
|
|
22
|
+
static observedAttributes: string[];
|
|
23
|
+
constructor();
|
|
24
|
+
get active(): boolean;
|
|
25
|
+
set active(val: boolean);
|
|
26
|
+
get expanded(): boolean;
|
|
27
|
+
set expanded(val: boolean);
|
|
28
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
29
|
+
setup(): void;
|
|
30
|
+
teardown(): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=chat-message-activity-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-activity-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-activity-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;;IACrD,MAAM,CAAC,kBAAkB,WAA6C;;IAsBtE,IAAI,MAAM,IAAI,OAAO,CAA+B;IACpD,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,EAGtB;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAapF,KAAK,IAAI,IAAI;IAyCb,QAAQ,IAAI,IAAI;CAmFjB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Individual chat message bubble.
|
|
4
|
+
*
|
|
5
|
+
* Accepts slotted content: `n-chat-message-text`, `n-chat-message-genui`,
|
|
6
|
+
* `n-chat-message-seed`, or any custom content.
|
|
7
|
+
*
|
|
8
|
+
* @attr {string} role - `user` | `assistant` | `system`
|
|
9
|
+
* @attr {string} message-id - Unique message identifier
|
|
10
|
+
* @attr {string} timestamp - Epoch milliseconds
|
|
11
|
+
* @attr {string} status - `sending` | `sent` | `error` | `streaming`
|
|
12
|
+
* @fires native:message-action - Fired when an action button is clicked
|
|
13
|
+
*/
|
|
14
|
+
export declare class NChatMessage extends NativeElement {
|
|
15
|
+
#private;
|
|
16
|
+
static observedAttributes: string[];
|
|
17
|
+
constructor();
|
|
18
|
+
get role(): string;
|
|
19
|
+
set role(val: string);
|
|
20
|
+
get messageId(): string;
|
|
21
|
+
get timestamp(): number;
|
|
22
|
+
get status(): string;
|
|
23
|
+
set status(val: string);
|
|
24
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
25
|
+
setup(): void;
|
|
26
|
+
teardown(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=chat-message-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,aAAa;;IAC7C,MAAM,CAAC,kBAAkB,WAAiD;;IAc1E,IAAI,IAAI,IAAI,MAAM,CAA6B;IAC/C,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,EAGnB;IAED,IAAI,SAAS,IAAI,MAAM,CAAkD;IAEzE,IAAI,SAAS,IAAI,MAAM,CAAwD;IAE/E,IAAI,MAAM,IAAI,MAAM,CAA+B;IACnD,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAGrB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAWpF,KAAK,IAAI,IAAI;IAeb,QAAQ,IAAI,IAAI;CAsDjB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/** Minimal UINode shape for schema-driven rendering. */
|
|
3
|
+
export interface GenUINode {
|
|
4
|
+
tag: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
attributes?: Record<string, string>;
|
|
7
|
+
properties?: Record<string, unknown>;
|
|
8
|
+
children?: GenUINode[];
|
|
9
|
+
text?: string;
|
|
10
|
+
slot?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* GenUI message card — renders UI from a schema (A2UI, MCPUI, etc).
|
|
14
|
+
*
|
|
15
|
+
* Validates the schema before rendering. Forbidden tags are rejected.
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <n-chat-message-genui schema-type="a2ui" mode="inline"></n-chat-message-genui>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Set the schema via property:
|
|
22
|
+
* ```js
|
|
23
|
+
* el.schema = { tag: 'n-card', children: [{ tag: 'p', text: 'Hello' }] };
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @attr {string} schema-type - `a2ui` | `mcpui`
|
|
27
|
+
* @attr {string} mode - `inline` (default) | `lightbox`
|
|
28
|
+
* @fires native:genui-action - Fired when an action occurs within the rendered UI
|
|
29
|
+
* @fires native:genui-error - Fired when schema validation fails
|
|
30
|
+
*/
|
|
31
|
+
export declare class NChatMessageGenUI extends NativeElement {
|
|
32
|
+
#private;
|
|
33
|
+
static observedAttributes: string[];
|
|
34
|
+
constructor();
|
|
35
|
+
get schema(): GenUINode | null;
|
|
36
|
+
set schema(val: GenUINode | null);
|
|
37
|
+
get schemaType(): string;
|
|
38
|
+
set schemaType(val: string);
|
|
39
|
+
get mode(): 'inline' | 'lightbox';
|
|
40
|
+
set mode(val: 'inline' | 'lightbox');
|
|
41
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
42
|
+
setup(): void;
|
|
43
|
+
teardown(): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=chat-message-genui-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-genui-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-genui-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;;IAClD,MAAM,CAAC,kBAAkB,WAA2B;;IAepD,IAAI,MAAM,IAAI,SAAS,GAAG,IAAI,CAA+B;IAC7D,IAAI,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,EAE/B;IAED,IAAI,UAAU,IAAI,MAAM,CAAmC;IAC3D,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,EAGzB;IAED,IAAI,IAAI,IAAI,QAAQ,GAAG,UAAU,CAA6B;IAC9D,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,UAAU,EAGlC;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAWpF,KAAK,IAAI,IAAI;IA0Cb,QAAQ,IAAI,IAAI;CAsEjB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
export interface SeedOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Suggestion chips — pre-seeded quick responses.
|
|
9
|
+
*
|
|
10
|
+
* Options can be provided as JSON attribute or via the `options` property.
|
|
11
|
+
*
|
|
12
|
+
* ```html
|
|
13
|
+
* <n-chat-message-seed options='[{"value":"yes","label":"Yes"},{"value":"no","label":"No"}]'>
|
|
14
|
+
* </n-chat-message-seed>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @attr {string} options - JSON array of `{ value, label, icon? }`
|
|
18
|
+
* @attr {boolean} disabled - Disables all chips
|
|
19
|
+
* @fires native:seed-select - Fired when a chip is clicked
|
|
20
|
+
*/
|
|
21
|
+
export declare class NChatMessageSeed extends NativeElement {
|
|
22
|
+
#private;
|
|
23
|
+
static observedAttributes: string[];
|
|
24
|
+
constructor();
|
|
25
|
+
get options(): SeedOption[];
|
|
26
|
+
set options(val: SeedOption[]);
|
|
27
|
+
get disabled(): boolean;
|
|
28
|
+
set disabled(val: boolean);
|
|
29
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
30
|
+
setup(): void;
|
|
31
|
+
teardown(): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=chat-message-seed-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-seed-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-seed-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgC,MAAM,mBAAmB,CAAC;AAEhF,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,MAAM,CAAC,kBAAkB,WAA2B;;IAapD,IAAI,OAAO,IAAI,UAAU,EAAE,CAAgC;IAC3D,IAAI,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,EAG5B;IAED,IAAI,QAAQ,IAAI,OAAO,CAAiC;IACxD,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAGxB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAgBpF,KAAK,IAAI,IAAI;IAmCb,QAAQ,IAAI,IAAI;CAsBjB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Rich text message renderer with lightweight markdown support.
|
|
4
|
+
*
|
|
5
|
+
* Renders a markdown subset (paragraphs, headings, lists, code fences,
|
|
6
|
+
* inline code, bold, italic, links, blockquotes) to sanitized HTML.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <n-chat-message-text format="markdown">
|
|
10
|
+
* Hello **world**!
|
|
11
|
+
* </n-chat-message-text>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Or set content via property:
|
|
15
|
+
* ```js
|
|
16
|
+
* el.content = '# Title\nSome **bold** text';
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @attr {string} format - `markdown` (default) | `plain`
|
|
20
|
+
*/
|
|
21
|
+
export declare class NChatMessageText extends NativeElement {
|
|
22
|
+
#private;
|
|
23
|
+
static observedAttributes: string[];
|
|
24
|
+
get content(): string;
|
|
25
|
+
set content(val: string);
|
|
26
|
+
get format(): 'markdown' | 'plain';
|
|
27
|
+
set format(val: 'markdown' | 'plain');
|
|
28
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
29
|
+
setup(): void;
|
|
30
|
+
teardown(): void;
|
|
31
|
+
}
|
|
32
|
+
declare function renderInline(text: string): string;
|
|
33
|
+
declare function renderMarkdown(src: string): string;
|
|
34
|
+
/** Sanitize rendered HTML — strip any tags not in allowlist. */
|
|
35
|
+
export declare function sanitizeHtml(html: string): string;
|
|
36
|
+
export { renderMarkdown, renderInline };
|
|
37
|
+
//# sourceMappingURL=chat-message-text-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-text-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-message-text-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,gBAAiB,SAAQ,aAAa;;IACjD,MAAM,CAAC,kBAAkB,WAAc;IAQvC,IAAI,OAAO,IAAI,MAAM,CAAgC;IACrD,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,EAEtB;IAED,IAAI,MAAM,IAAI,UAAU,GAAG,OAAO,CAA+B;IACjE,IAAI,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAGnC;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUpF,KAAK,IAAI,IAAI;IA8Bb,QAAQ,IAAI,IAAI;CAIjB;AAuBD,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmB1C;AAED,iBAAS,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA4F3C;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Message group — cluster of messages from the same sender.
|
|
4
|
+
*
|
|
5
|
+
* Provides alignment (user = right, assistant/system = left) and
|
|
6
|
+
* groups an avatar + message column.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <n-chat-messages role="user" sender="Kim">
|
|
10
|
+
* <n-chat-avatar name="Kim"></n-chat-avatar>
|
|
11
|
+
* <n-chat-message role="user" message-id="1">
|
|
12
|
+
* <n-chat-message-text>Hello!</n-chat-message-text>
|
|
13
|
+
* </n-chat-message>
|
|
14
|
+
* </n-chat-messages>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @attr {string} role - `user` | `assistant` | `system`
|
|
18
|
+
* @attr {string} sender - Display name of the sender
|
|
19
|
+
*/
|
|
20
|
+
export declare class NChatMessages extends NativeElement {
|
|
21
|
+
#private;
|
|
22
|
+
static observedAttributes: string[];
|
|
23
|
+
constructor();
|
|
24
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
25
|
+
setup(): void;
|
|
26
|
+
teardown(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=chat-messages-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-messages-element.d.ts","sourceRoot":"","sources":["../../src/message/chat-messages-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,aAAa;;IAC9C,MAAM,CAAC,kBAAkB,WAAsB;;IAS/C,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKpF,KAAK,IAAI,IAAI;IASb,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { NChatMessage } from './chat-message-element.ts';
|
|
2
|
+
export { NChatMessages } from './chat-messages-element.ts';
|
|
3
|
+
export { NChatMessageText } from './chat-message-text-element.ts';
|
|
4
|
+
export { NChatMessageActivity } from './chat-message-activity-element.ts';
|
|
5
|
+
export { NChatMessageSeed } from './chat-message-seed-element.ts';
|
|
6
|
+
export { NChatMessageGenUI } from './chat-message-genui-element.ts';
|
|
7
|
+
export { NChatInputStructured } from './chat-input-structured-element.ts';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n-chat-message.d.ts","sourceRoot":"","sources":["../../src/message/n-chat-message.ts"],"names":[],"mappings":""}
|