@mieweb/ui 0.10.0-dev.30 → 0.10.0-dev.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/dist/components/SuperChat/index.cjs +28 -4
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +93 -2
- package/dist/components/SuperChat/index.d.ts +93 -2
- package/dist/components/SuperChat/index.js +28 -4
- package/dist/components/SuperChat/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,78 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { S as SuperChatConversation, a as SuperChatView, b as SuperChatMediaFeedProps, c as SuperChatMediaLabels, d as SuperChatRenderPlugin, A as AIRenderTextContent, e as AttachmentKind, f as SuperChatLinkBuilder, g as SuperChatCopyFormat, C as ComposerAttachment, h as SuperChatRef, i as SuperChatMediaItem } from '../../types-Cx1FHLq2.cjs';
|
|
3
4
|
export { j as AIMessageContent, k as AIMessageStatus, l as AITextRenderContext, G as GenUIBlockPayload, m as GenUIPrefetchPolicy, n as GenUIRegistry, o as GenUIWidgetEntry, p as GenUIWidgetProps, M as MCPResourceLink, P as Participant, q as ParticipantKind, r as ParticipantStatus, s as StandardSchemaV1, t as SuperChatChannel, u as SuperChatItemType, v as SuperChatMediaAttachment, w as SuperChatMessage, x as SuperChatPluggable, y as SuperChatPluggableList } from '../../types-Cx1FHLq2.cjs';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
type ProviderModelValue = {
|
|
7
|
+
provider: string;
|
|
8
|
+
model: string;
|
|
9
|
+
};
|
|
10
|
+
type ProviderModelOption = ProviderModelValue & {
|
|
11
|
+
label?: string;
|
|
12
|
+
providerLabel?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
/** A reasoning-effort level offered alongside the model. */
|
|
16
|
+
type ComposerEffortOption = {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Optional secondary line, e.g. a caveat about cost or latency. */
|
|
20
|
+
description?: string;
|
|
21
|
+
};
|
|
22
|
+
type ComposerModelSelectorBaseProps = {
|
|
23
|
+
models: ProviderModelOption[];
|
|
24
|
+
value: ProviderModelValue | null;
|
|
25
|
+
onChange: (value: ProviderModelValue) => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Trigger appearance: 'default' is the bordered pill; 'ghost' is a quiet
|
|
29
|
+
* text trigger that matches ChatComposer's selector-row controls.
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'default' | 'ghost';
|
|
32
|
+
className?: string;
|
|
33
|
+
boundaryRef?: React.RefObject<HTMLElement | null>;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
anyLabel?: string;
|
|
36
|
+
emptyLabel?: string;
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Reasoning-effort levels for the selected model. Omit or pass an empty
|
|
40
|
+
* array to hide the effort row entirely, which is what a model that cannot
|
|
41
|
+
* reason should resolve to — the levels are provider-specific, so the caller
|
|
42
|
+
* owns deciding which apply.
|
|
43
|
+
*/
|
|
44
|
+
effortOptions?: ComposerEffortOption[];
|
|
45
|
+
/** Currently selected effort. */
|
|
46
|
+
effort?: string | null;
|
|
47
|
+
/** Effort marked with a "default" badge in the list. */
|
|
48
|
+
defaultEffort?: string;
|
|
49
|
+
onEffortChange?: (value: string) => void;
|
|
50
|
+
effortLabel?: string;
|
|
51
|
+
effortHint?: string;
|
|
52
|
+
defaultBadgeLabel?: string;
|
|
53
|
+
backLabel?: string;
|
|
54
|
+
};
|
|
55
|
+
type ControlledProviderFilterProps = {
|
|
56
|
+
providerFilter: string | null;
|
|
57
|
+
onProviderFilterChange: (provider: string | null) => void;
|
|
58
|
+
};
|
|
59
|
+
type UncontrolledProviderFilterProps = {
|
|
60
|
+
providerFilter?: undefined;
|
|
61
|
+
onProviderFilterChange?: (provider: string | null) => void;
|
|
62
|
+
};
|
|
63
|
+
type ComposerModelSelectorProps = ComposerModelSelectorBaseProps & (ControlledProviderFilterProps | UncontrolledProviderFilterProps);
|
|
64
|
+
|
|
65
|
+
/** An agent shown in the composer's agent selector. */
|
|
66
|
+
interface ChatComposerAgentOption {
|
|
67
|
+
/** Stable id (returned via `onAgentChange`). */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Display label. */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Optional leading icon (defaults to a bot glyph in the trigger). */
|
|
72
|
+
icon?: React.ReactNode;
|
|
73
|
+
/** Optional secondary text shown in the menu. */
|
|
74
|
+
description?: string;
|
|
75
|
+
}
|
|
5
76
|
|
|
6
77
|
interface SuperChatProps {
|
|
7
78
|
/** The conversation to display (host-owned state). */
|
|
@@ -58,6 +129,26 @@ interface SuperChatProps {
|
|
|
58
129
|
defaultCopyFormat?: SuperChatCopyFormat;
|
|
59
130
|
/** Additional class name. */
|
|
60
131
|
className?: string;
|
|
132
|
+
/** Show the conversation header (title + participants). Defaults to `true`. */
|
|
133
|
+
showHeader?: boolean;
|
|
134
|
+
/** Composer placeholder override. */
|
|
135
|
+
placeholder?: string;
|
|
136
|
+
/** Allow file attachments in the composer. Defaults to `true` unless read-only. */
|
|
137
|
+
allowAttachments?: boolean;
|
|
138
|
+
/** Agents offered by the composer's agent selector (shown when non-empty). */
|
|
139
|
+
agents?: ChatComposerAgentOption[];
|
|
140
|
+
/** Selected agent id for the composer's agent selector. */
|
|
141
|
+
selectedAgent?: string | null;
|
|
142
|
+
onAgentChange?: (agentId: string) => void;
|
|
143
|
+
/** Localized accessible label / empty-state text for the agent selector. */
|
|
144
|
+
agentSelectorLabel?: string;
|
|
145
|
+
/** Props for the composer's model selector (shown when provided). */
|
|
146
|
+
modelSelectorProps?: ComposerModelSelectorProps;
|
|
147
|
+
/** While true, the send button becomes a stop button (requires `onStop`). */
|
|
148
|
+
isStreaming?: boolean;
|
|
149
|
+
onStop?: () => void;
|
|
150
|
+
/** Localized accessible label for the icon-only stop button. */
|
|
151
|
+
stopLabel?: string;
|
|
61
152
|
/**
|
|
62
153
|
* Fired when the local user sends a message. If the callback returns a
|
|
63
154
|
* promise it is awaited, and a rejected send restores the typed text into
|
|
@@ -90,7 +181,7 @@ interface SuperChatProps {
|
|
|
90
181
|
* Single-conversation chat panel. See the module `MAINTAINERS.md` for the
|
|
91
182
|
* participant model and render-plugin architecture.
|
|
92
183
|
*/
|
|
93
|
-
declare function SuperChat({ conversation, view, defaultView, onViewChange, mediaFeedProps, mediaLabels, currentParticipantId, renderPlugins, renderTextContent, trustedContent, readOnly, acceptedFileTypes, order, virtualized, linkBuilder, defaultCopyFormat, className, onMessageSent, onMessageEdited, onConversationClosed, onReferenceClick, onBack, }: SuperChatProps): react_jsx_runtime.JSX.Element;
|
|
184
|
+
declare function SuperChat({ conversation, view, defaultView, onViewChange, mediaFeedProps, mediaLabels, currentParticipantId, renderPlugins, renderTextContent, trustedContent, readOnly, acceptedFileTypes, order, virtualized, linkBuilder, defaultCopyFormat, className, showHeader, placeholder, allowAttachments, agents, selectedAgent, onAgentChange, agentSelectorLabel, modelSelectorProps, isStreaming, onStop, stopLabel, onMessageSent, onMessageEdited, onConversationClosed, onReferenceClick, onBack, }: SuperChatProps): react_jsx_runtime.JSX.Element;
|
|
94
185
|
|
|
95
186
|
interface SuperChatConversationsProps {
|
|
96
187
|
/** All conversations (host-owned state). */
|
|
@@ -1,7 +1,78 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { S as SuperChatConversation, a as SuperChatView, b as SuperChatMediaFeedProps, c as SuperChatMediaLabels, d as SuperChatRenderPlugin, A as AIRenderTextContent, e as AttachmentKind, f as SuperChatLinkBuilder, g as SuperChatCopyFormat, C as ComposerAttachment, h as SuperChatRef, i as SuperChatMediaItem } from '../../types-Cx1FHLq2.js';
|
|
3
4
|
export { j as AIMessageContent, k as AIMessageStatus, l as AITextRenderContext, G as GenUIBlockPayload, m as GenUIPrefetchPolicy, n as GenUIRegistry, o as GenUIWidgetEntry, p as GenUIWidgetProps, M as MCPResourceLink, P as Participant, q as ParticipantKind, r as ParticipantStatus, s as StandardSchemaV1, t as SuperChatChannel, u as SuperChatItemType, v as SuperChatMediaAttachment, w as SuperChatMessage, x as SuperChatPluggable, y as SuperChatPluggableList } from '../../types-Cx1FHLq2.js';
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
type ProviderModelValue = {
|
|
7
|
+
provider: string;
|
|
8
|
+
model: string;
|
|
9
|
+
};
|
|
10
|
+
type ProviderModelOption = ProviderModelValue & {
|
|
11
|
+
label?: string;
|
|
12
|
+
providerLabel?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
/** A reasoning-effort level offered alongside the model. */
|
|
16
|
+
type ComposerEffortOption = {
|
|
17
|
+
value: string;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Optional secondary line, e.g. a caveat about cost or latency. */
|
|
20
|
+
description?: string;
|
|
21
|
+
};
|
|
22
|
+
type ComposerModelSelectorBaseProps = {
|
|
23
|
+
models: ProviderModelOption[];
|
|
24
|
+
value: ProviderModelValue | null;
|
|
25
|
+
onChange: (value: ProviderModelValue) => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Trigger appearance: 'default' is the bordered pill; 'ghost' is a quiet
|
|
29
|
+
* text trigger that matches ChatComposer's selector-row controls.
|
|
30
|
+
*/
|
|
31
|
+
variant?: 'default' | 'ghost';
|
|
32
|
+
className?: string;
|
|
33
|
+
boundaryRef?: React.RefObject<HTMLElement | null>;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
anyLabel?: string;
|
|
36
|
+
emptyLabel?: string;
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Reasoning-effort levels for the selected model. Omit or pass an empty
|
|
40
|
+
* array to hide the effort row entirely, which is what a model that cannot
|
|
41
|
+
* reason should resolve to — the levels are provider-specific, so the caller
|
|
42
|
+
* owns deciding which apply.
|
|
43
|
+
*/
|
|
44
|
+
effortOptions?: ComposerEffortOption[];
|
|
45
|
+
/** Currently selected effort. */
|
|
46
|
+
effort?: string | null;
|
|
47
|
+
/** Effort marked with a "default" badge in the list. */
|
|
48
|
+
defaultEffort?: string;
|
|
49
|
+
onEffortChange?: (value: string) => void;
|
|
50
|
+
effortLabel?: string;
|
|
51
|
+
effortHint?: string;
|
|
52
|
+
defaultBadgeLabel?: string;
|
|
53
|
+
backLabel?: string;
|
|
54
|
+
};
|
|
55
|
+
type ControlledProviderFilterProps = {
|
|
56
|
+
providerFilter: string | null;
|
|
57
|
+
onProviderFilterChange: (provider: string | null) => void;
|
|
58
|
+
};
|
|
59
|
+
type UncontrolledProviderFilterProps = {
|
|
60
|
+
providerFilter?: undefined;
|
|
61
|
+
onProviderFilterChange?: (provider: string | null) => void;
|
|
62
|
+
};
|
|
63
|
+
type ComposerModelSelectorProps = ComposerModelSelectorBaseProps & (ControlledProviderFilterProps | UncontrolledProviderFilterProps);
|
|
64
|
+
|
|
65
|
+
/** An agent shown in the composer's agent selector. */
|
|
66
|
+
interface ChatComposerAgentOption {
|
|
67
|
+
/** Stable id (returned via `onAgentChange`). */
|
|
68
|
+
id: string;
|
|
69
|
+
/** Display label. */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Optional leading icon (defaults to a bot glyph in the trigger). */
|
|
72
|
+
icon?: React.ReactNode;
|
|
73
|
+
/** Optional secondary text shown in the menu. */
|
|
74
|
+
description?: string;
|
|
75
|
+
}
|
|
5
76
|
|
|
6
77
|
interface SuperChatProps {
|
|
7
78
|
/** The conversation to display (host-owned state). */
|
|
@@ -58,6 +129,26 @@ interface SuperChatProps {
|
|
|
58
129
|
defaultCopyFormat?: SuperChatCopyFormat;
|
|
59
130
|
/** Additional class name. */
|
|
60
131
|
className?: string;
|
|
132
|
+
/** Show the conversation header (title + participants). Defaults to `true`. */
|
|
133
|
+
showHeader?: boolean;
|
|
134
|
+
/** Composer placeholder override. */
|
|
135
|
+
placeholder?: string;
|
|
136
|
+
/** Allow file attachments in the composer. Defaults to `true` unless read-only. */
|
|
137
|
+
allowAttachments?: boolean;
|
|
138
|
+
/** Agents offered by the composer's agent selector (shown when non-empty). */
|
|
139
|
+
agents?: ChatComposerAgentOption[];
|
|
140
|
+
/** Selected agent id for the composer's agent selector. */
|
|
141
|
+
selectedAgent?: string | null;
|
|
142
|
+
onAgentChange?: (agentId: string) => void;
|
|
143
|
+
/** Localized accessible label / empty-state text for the agent selector. */
|
|
144
|
+
agentSelectorLabel?: string;
|
|
145
|
+
/** Props for the composer's model selector (shown when provided). */
|
|
146
|
+
modelSelectorProps?: ComposerModelSelectorProps;
|
|
147
|
+
/** While true, the send button becomes a stop button (requires `onStop`). */
|
|
148
|
+
isStreaming?: boolean;
|
|
149
|
+
onStop?: () => void;
|
|
150
|
+
/** Localized accessible label for the icon-only stop button. */
|
|
151
|
+
stopLabel?: string;
|
|
61
152
|
/**
|
|
62
153
|
* Fired when the local user sends a message. If the callback returns a
|
|
63
154
|
* promise it is awaited, and a rejected send restores the typed text into
|
|
@@ -90,7 +181,7 @@ interface SuperChatProps {
|
|
|
90
181
|
* Single-conversation chat panel. See the module `MAINTAINERS.md` for the
|
|
91
182
|
* participant model and render-plugin architecture.
|
|
92
183
|
*/
|
|
93
|
-
declare function SuperChat({ conversation, view, defaultView, onViewChange, mediaFeedProps, mediaLabels, currentParticipantId, renderPlugins, renderTextContent, trustedContent, readOnly, acceptedFileTypes, order, virtualized, linkBuilder, defaultCopyFormat, className, onMessageSent, onMessageEdited, onConversationClosed, onReferenceClick, onBack, }: SuperChatProps): react_jsx_runtime.JSX.Element;
|
|
184
|
+
declare function SuperChat({ conversation, view, defaultView, onViewChange, mediaFeedProps, mediaLabels, currentParticipantId, renderPlugins, renderTextContent, trustedContent, readOnly, acceptedFileTypes, order, virtualized, linkBuilder, defaultCopyFormat, className, showHeader, placeholder, allowAttachments, agents, selectedAgent, onAgentChange, agentSelectorLabel, modelSelectorProps, isStreaming, onStop, stopLabel, onMessageSent, onMessageEdited, onConversationClosed, onReferenceClick, onBack, }: SuperChatProps): react_jsx_runtime.JSX.Element;
|
|
94
185
|
|
|
95
186
|
interface SuperChatConversationsProps {
|
|
96
187
|
/** All conversations (host-owned state). */
|
|
@@ -1254,6 +1254,17 @@ function SuperChat({
|
|
|
1254
1254
|
linkBuilder,
|
|
1255
1255
|
defaultCopyFormat,
|
|
1256
1256
|
className,
|
|
1257
|
+
showHeader = true,
|
|
1258
|
+
placeholder,
|
|
1259
|
+
allowAttachments,
|
|
1260
|
+
agents,
|
|
1261
|
+
selectedAgent,
|
|
1262
|
+
onAgentChange,
|
|
1263
|
+
agentSelectorLabel,
|
|
1264
|
+
modelSelectorProps,
|
|
1265
|
+
isStreaming,
|
|
1266
|
+
onStop,
|
|
1267
|
+
stopLabel,
|
|
1257
1268
|
onMessageSent,
|
|
1258
1269
|
onMessageEdited,
|
|
1259
1270
|
onConversationClosed,
|
|
@@ -1662,7 +1673,7 @@ function SuperChat({
|
|
|
1662
1673
|
className
|
|
1663
1674
|
),
|
|
1664
1675
|
children: [
|
|
1665
|
-
/* @__PURE__ */ jsxs(
|
|
1676
|
+
showHeader ? /* @__PURE__ */ jsxs(
|
|
1666
1677
|
"header",
|
|
1667
1678
|
{
|
|
1668
1679
|
"data-slot": "superchat-header",
|
|
@@ -1726,6 +1737,9 @@ function SuperChat({
|
|
|
1726
1737
|
)
|
|
1727
1738
|
]
|
|
1728
1739
|
}
|
|
1740
|
+
) : (
|
|
1741
|
+
// Keeps the panel's aria-labelledby reference valid without a visible header.
|
|
1742
|
+
/* @__PURE__ */ jsx("h2", { id: headingId, className: "sr-only", children: conversation.title })
|
|
1729
1743
|
),
|
|
1730
1744
|
activeView === "media" ? /* @__PURE__ */ jsxs(
|
|
1731
1745
|
"div",
|
|
@@ -1860,13 +1874,23 @@ function SuperChat({
|
|
|
1860
1874
|
onSend: handleComposerSend,
|
|
1861
1875
|
disabled: readOnly,
|
|
1862
1876
|
className: "px-4 pb-4",
|
|
1863
|
-
placeholder: readOnly ? "Read-only conversation" : "Type a message\u2026 use @ to address an agent",
|
|
1877
|
+
placeholder: readOnly ? "Read-only conversation" : placeholder ?? "Type a message\u2026 use @ to address an agent",
|
|
1864
1878
|
mentionOptions,
|
|
1865
|
-
allowAttachments: !readOnly,
|
|
1879
|
+
allowAttachments: !readOnly && (allowAttachments ?? true),
|
|
1866
1880
|
acceptedFileTypes: composerAccept,
|
|
1867
1881
|
maxFileSize: 25 * 1024 * 1024,
|
|
1868
1882
|
maxLength: 1e5,
|
|
1869
|
-
inputLabel: "Message"
|
|
1883
|
+
inputLabel: "Message",
|
|
1884
|
+
showAgentSelector: !!agents?.length,
|
|
1885
|
+
agents,
|
|
1886
|
+
selectedAgent,
|
|
1887
|
+
onAgentChange,
|
|
1888
|
+
agentSelectorLabel,
|
|
1889
|
+
showModelSelector: !!modelSelectorProps,
|
|
1890
|
+
modelSelectorProps,
|
|
1891
|
+
isStreaming,
|
|
1892
|
+
onStop,
|
|
1893
|
+
stopLabel
|
|
1870
1894
|
}
|
|
1871
1895
|
)
|
|
1872
1896
|
]
|