@springbrand/message-panel 0.1.1 → 0.1.2
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/demo/camel-chat-showcase.d.ts +1 -0
- package/dist/demo/camel-chat-showcase.js +1007 -0
- package/dist/demo/fixtures.d.ts +32 -0
- package/dist/demo/fixtures.js +250 -0
- package/dist/demo/index.js +4 -0
- package/dist/demo/message-panel-chat-showcase.d.ts +1 -0
- package/dist/demo/message-panel-chat-showcase.js +114 -0
- package/dist/demo/message-panel-gallery.d.ts +1 -0
- package/dist/demo/message-panel-gallery.js +130 -0
- package/dist/src/adapters/ai-sdk.d.ts +4 -0
- package/dist/src/adapters/ai-sdk.js +25 -0
- package/dist/src/camel/camel-chat-messages.d.ts +44 -0
- package/dist/src/camel/camel-chat-messages.js +421 -0
- package/dist/src/camel/camel-model-select.d.ts +13 -0
- package/dist/src/camel/camel-model-select.js +7 -0
- package/dist/src/camel/camel-plan-bar.d.ts +5 -0
- package/dist/src/camel/camel-plan-bar.js +24 -0
- package/dist/src/camel/camel-prompt-input.d.ts +32 -0
- package/dist/src/camel/camel-prompt-input.js +182 -0
- package/dist/src/camel/camel-tool-presentation.d.ts +21 -0
- package/dist/src/camel/camel-tool-presentation.js +784 -0
- package/dist/src/camel/camel-turn.d.ts +57 -0
- package/dist/src/camel/camel-turn.js +203 -0
- package/dist/src/camel/index.js +7 -0
- package/dist/src/camel/turn-summary-bar.d.ts +8 -0
- package/dist/src/camel/turn-summary-bar.js +12 -0
- package/dist/src/chat-summary-panel.d.ts +22 -0
- package/dist/src/chat-summary-panel.js +26 -0
- package/dist/src/composer/chat-composer.d.ts +4 -0
- package/dist/src/composer/chat-composer.js +90 -0
- package/dist/src/composer/composer-attachments.d.ts +13 -0
- package/dist/src/composer/composer-attachments.js +47 -0
- package/dist/src/composer/composer-trigger-popover.d.ts +31 -0
- package/dist/src/composer/composer-trigger-popover.js +29 -0
- package/dist/src/composer/composer.d.ts +15 -0
- package/dist/src/composer/composer.js +180 -0
- package/dist/src/composer/drop-controller.d.ts +8 -0
- package/dist/src/composer/drop-controller.js +69 -0
- package/dist/src/composer/index.js +6 -0
- package/dist/src/composer/types.d.ts +62 -0
- package/dist/src/composer/types.js +1 -0
- package/dist/src/contracts.d.ts +94 -0
- package/dist/src/contracts.js +1 -0
- package/dist/src/conversation.d.ts +13 -0
- package/dist/src/conversation.js +18 -0
- package/dist/src/index.js +12 -0
- package/dist/src/internal/cn.d.ts +1 -0
- package/dist/src/internal/cn.js +3 -0
- package/dist/src/message-panel.d.ts +4 -0
- package/dist/src/message-panel.js +144 -0
- package/dist/src/message.d.ts +36 -0
- package/dist/src/message.js +83 -0
- package/dist/src/parts/index.d.ts +187 -0
- package/dist/src/parts/index.js +332 -0
- package/dist/src/parts/kind.d.ts +3 -0
- package/dist/src/parts/kind.js +69 -0
- package/dist/src/parts/plan.d.ts +10 -0
- package/dist/src/parts/plan.js +40 -0
- package/dist/src/parts/primitives.d.ts +70 -0
- package/dist/src/parts/primitives.js +153 -0
- package/dist/src/registry.d.ts +4 -0
- package/dist/src/registry.js +31 -0
- package/dist/src/status.d.ts +26 -0
- package/dist/src/status.js +74 -0
- package/package.json +17 -8
- package/demo/camel-chat-showcase.tsx +0 -1265
- package/demo/fixtures.ts +0 -292
- package/demo/message-panel-chat-showcase.tsx +0 -250
- package/demo/message-panel-gallery.tsx +0 -389
- package/src/adapters/ai-sdk.ts +0 -32
- package/src/camel/camel-chat-messages.tsx +0 -1420
- package/src/camel/camel-model-select.tsx +0 -88
- package/src/camel/camel-plan-bar.tsx +0 -115
- package/src/camel/camel-prompt-input.tsx +0 -540
- package/src/camel/camel-tool-presentation.tsx +0 -1270
- package/src/camel/camel-turn.ts +0 -315
- package/src/camel/turn-summary-bar.tsx +0 -81
- package/src/chat-summary-panel.tsx +0 -229
- package/src/composer/chat-composer.tsx +0 -216
- package/src/composer/composer-attachments.tsx +0 -138
- package/src/composer/composer-trigger-popover.tsx +0 -236
- package/src/composer/composer.tsx +0 -425
- package/src/composer/drop-controller.ts +0 -80
- package/src/composer/types.ts +0 -79
- package/src/contracts.ts +0 -139
- package/src/conversation.tsx +0 -76
- package/src/internal/cn.ts +0 -3
- package/src/message-panel.tsx +0 -368
- package/src/message.tsx +0 -254
- package/src/parts/index.tsx +0 -1149
- package/src/parts/kind.ts +0 -67
- package/src/parts/plan.ts +0 -63
- package/src/parts/primitives.tsx +0 -439
- package/src/registry.ts +0 -44
- package/src/status.tsx +0 -132
- /package/{demo/index.ts → dist/demo/index.d.ts} +0 -0
- /package/{src/camel/index.ts → dist/src/camel/index.d.ts} +0 -0
- /package/{src/composer/index.ts → dist/src/composer/index.d.ts} +0 -0
- /package/{src/index.ts → dist/src/index.d.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes } from "react";
|
|
2
|
+
import { type StreamdownProps } from "streamdown";
|
|
3
|
+
import type { MessageRole } from "./contracts";
|
|
4
|
+
export type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
from: MessageRole;
|
|
6
|
+
};
|
|
7
|
+
export declare const Message: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
from: MessageRole;
|
|
9
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const MessageContent: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const MessageActions: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export type MessageActionProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const MessageAction: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export type MessageResponseProps = StreamdownProps & {
|
|
21
|
+
streaming?: boolean;
|
|
22
|
+
resolveUrl?: MessageUrlResolver;
|
|
23
|
+
};
|
|
24
|
+
export type MessageUrlResolver = (url: string) => string | null | undefined;
|
|
25
|
+
export declare const MessageResponse: import("react").MemoExoticComponent<({ className, streaming, resolveUrl, rehypePlugins, ...props }: MessageResponseProps) => import("react").JSX.Element>;
|
|
26
|
+
export declare function AssistantMessageActions({ text, messageId, canRetry, onCopy, onRetry, onFork, }: {
|
|
27
|
+
text: string;
|
|
28
|
+
messageId: string;
|
|
29
|
+
canRetry: boolean;
|
|
30
|
+
onCopy?: (text: string) => void | Promise<void>;
|
|
31
|
+
onRetry?: (messageId: string) => void | Promise<void>;
|
|
32
|
+
onFork?: (messageId: string) => void | Promise<void>;
|
|
33
|
+
}): import("react").JSX.Element | null;
|
|
34
|
+
export declare function BrandMark({ className }: {
|
|
35
|
+
className?: string;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cjk } from "@streamdown/cjk";
|
|
3
|
+
import { code } from "@streamdown/code";
|
|
4
|
+
import { math } from "@streamdown/math";
|
|
5
|
+
import { mermaid } from "@streamdown/mermaid";
|
|
6
|
+
import { CheckIcon, CopyIcon, GitForkIcon, Loader2Icon, RefreshCcwIcon, } from "lucide-react";
|
|
7
|
+
import { forwardRef, memo, useCallback, useEffect, useRef, useState, } from "react";
|
|
8
|
+
import { defaultRehypePlugins, Streamdown, } from "streamdown";
|
|
9
|
+
import { cn } from "./internal/cn";
|
|
10
|
+
export const Message = forwardRef(({ className, from, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("sb-message", from === "user" ? "sb-message--user" : "sb-message--assistant", className), "data-role": from, ...props })));
|
|
11
|
+
Message.displayName = "Message";
|
|
12
|
+
export const MessageContent = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("sb-message__content", className), ...props })));
|
|
13
|
+
MessageContent.displayName = "MessageContent";
|
|
14
|
+
export const MessageActions = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("sb-message__actions", className), ...props })));
|
|
15
|
+
MessageActions.displayName = "MessageActions";
|
|
16
|
+
export const MessageAction = forwardRef(({ className, tooltip, label, children, ...props }, ref) => (_jsx("button", { ref: ref, type: "button", className: cn("sb-message__action", className), title: tooltip, "aria-label": label ?? tooltip, ...props, children: children })));
|
|
17
|
+
MessageAction.displayName = "MessageAction";
|
|
18
|
+
const streamdownPlugins = { cjk, code, math, mermaid };
|
|
19
|
+
const streamAnimation = {
|
|
20
|
+
animation: "fadeIn",
|
|
21
|
+
sep: "word",
|
|
22
|
+
duration: 260,
|
|
23
|
+
stagger: 14,
|
|
24
|
+
};
|
|
25
|
+
const streamdownRehypePlugins = Object.values(defaultRehypePlugins);
|
|
26
|
+
function resolveUrlsPlugin(resolveUrl) {
|
|
27
|
+
return () => (tree) => {
|
|
28
|
+
const visit = (node) => {
|
|
29
|
+
if (node.type === "element" && node.properties) {
|
|
30
|
+
const url = node.properties.href;
|
|
31
|
+
if (typeof url === "string") {
|
|
32
|
+
const resolved = resolveUrl(url);
|
|
33
|
+
if (resolved === null)
|
|
34
|
+
delete node.properties.href;
|
|
35
|
+
else if (resolved !== undefined)
|
|
36
|
+
node.properties.href = resolved;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
node.children?.forEach(visit);
|
|
40
|
+
};
|
|
41
|
+
visit(tree);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export const MessageResponse = memo(({ className, streaming = false, resolveUrl, rehypePlugins, ...props }) => (_jsx(Streamdown, { className: cn("sb-message-response", className), plugins: streamdownPlugins, rehypePlugins: resolveUrl
|
|
45
|
+
? [resolveUrlsPlugin(resolveUrl), ...(rehypePlugins ?? streamdownRehypePlugins)]
|
|
46
|
+
: rehypePlugins, ...(streaming
|
|
47
|
+
? {
|
|
48
|
+
mode: "streaming",
|
|
49
|
+
isAnimating: true,
|
|
50
|
+
animated: streamAnimation,
|
|
51
|
+
}
|
|
52
|
+
: { mode: "static" }), ...props })), (previous, next) => previous.children === next.children &&
|
|
53
|
+
previous.streaming === next.streaming &&
|
|
54
|
+
previous.resolveUrl === next.resolveUrl);
|
|
55
|
+
MessageResponse.displayName = "MessageResponse";
|
|
56
|
+
export function AssistantMessageActions({ text, messageId, canRetry, onCopy, onRetry, onFork, }) {
|
|
57
|
+
const [copied, setCopied] = useState(false);
|
|
58
|
+
const [forking, setForking] = useState(false);
|
|
59
|
+
const timer = useRef(null);
|
|
60
|
+
useEffect(() => () => {
|
|
61
|
+
if (timer.current !== null)
|
|
62
|
+
window.clearTimeout(timer.current);
|
|
63
|
+
}, []);
|
|
64
|
+
const copy = useCallback(async () => {
|
|
65
|
+
if (onCopy)
|
|
66
|
+
await onCopy(text);
|
|
67
|
+
else if (typeof navigator !== "undefined")
|
|
68
|
+
await navigator.clipboard.writeText(text);
|
|
69
|
+
setCopied(true);
|
|
70
|
+
if (timer.current !== null)
|
|
71
|
+
window.clearTimeout(timer.current);
|
|
72
|
+
timer.current = window.setTimeout(() => setCopied(false), 1500);
|
|
73
|
+
}, [onCopy, text]);
|
|
74
|
+
if (!text && (!canRetry || !onRetry) && !onFork)
|
|
75
|
+
return null;
|
|
76
|
+
return (_jsxs(MessageActions, { children: [text && (_jsx(MessageAction, { tooltip: copied ? "已复制" : "复制", label: "\u590D\u5236", onClick: () => void copy(), children: copied ? _jsx(CheckIcon, { size: 15 }) : _jsx(CopyIcon, { size: 15 }) })), canRetry && onRetry && (_jsx(MessageAction, { tooltip: "\u91CD\u8BD5", label: "\u91CD\u8BD5", onClick: () => void onRetry(messageId), children: _jsx(RefreshCcwIcon, { size: 15 }) })), onFork && (_jsx(MessageAction, { tooltip: forking ? "正在创建新会话…" : "从这里创建新会话", label: forking ? "正在创建新会话" : "从这里创建新会话", disabled: forking, onClick: () => {
|
|
77
|
+
setForking(true);
|
|
78
|
+
void Promise.resolve(onFork(messageId)).finally(() => setForking(false));
|
|
79
|
+
}, children: forking ? (_jsx(Loader2Icon, { size: 15, className: "sb-spin" })) : (_jsx(GitForkIcon, { size: 15 })) }))] }));
|
|
80
|
+
}
|
|
81
|
+
export function BrandMark({ className }) {
|
|
82
|
+
return (_jsx("span", { className: cn("sb-brand-mark", className), "aria-hidden": "true", children: _jsx("svg", { width: "17", height: "17", viewBox: "0 0 28 28", fill: "none", children: _jsx("path", { d: "M14 14 C 11.5 10.5, 6.5 10.5, 6.5 14 C 6.5 17.5, 11.5 17.5, 14 14 C 16.5 10.5, 21.5 10.5, 21.5 14 C 21.5 17.5, 16.5 17.5, 14 14 Z", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", className: "sb-brand-mark__loop" }) }) }));
|
|
83
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PartRendererContext, RichPartKind, AIToolPart } from "../contracts";
|
|
3
|
+
import { type PlanStep, type PlanStepStatus } from "./plan";
|
|
4
|
+
export { resolvePartKind, toolNameOfPart } from "./kind";
|
|
5
|
+
export { planStepsOfPart, projectLatestPlan, type PlanStep, type PlanStepStatus, } from "./plan";
|
|
6
|
+
export interface TextPartProps {
|
|
7
|
+
text: string;
|
|
8
|
+
streaming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const OUT_OF_BAND_PREFIX = "[Delivered to the user out of band]";
|
|
11
|
+
export declare function stripNoticePrefix(text: string): string;
|
|
12
|
+
export declare function TextPart({ text, streaming }: TextPartProps): import("react").JSX.Element | null;
|
|
13
|
+
export interface ReasoningPartProps {
|
|
14
|
+
text: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
streaming?: boolean;
|
|
17
|
+
duration?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function ReasoningPart({ text, label, streaming, duration, }: ReasoningPartProps): import("react").JSX.Element | null;
|
|
20
|
+
type ToolIcon = "web" | "news" | "code" | "image" | "file" | "terminal";
|
|
21
|
+
export interface ToolPartProps {
|
|
22
|
+
name: string;
|
|
23
|
+
state: AIToolPart["state"] | "interrupted";
|
|
24
|
+
input?: unknown;
|
|
25
|
+
output?: unknown;
|
|
26
|
+
errorText?: string;
|
|
27
|
+
icon?: ToolIcon;
|
|
28
|
+
label?: string;
|
|
29
|
+
meta?: string;
|
|
30
|
+
results?: Array<{
|
|
31
|
+
title: string;
|
|
32
|
+
domain: string;
|
|
33
|
+
}>;
|
|
34
|
+
command?: string;
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
activityId?: string;
|
|
37
|
+
onNavigate?: (target: string) => void;
|
|
38
|
+
}
|
|
39
|
+
export type ToolPart = AIToolPart;
|
|
40
|
+
export declare function ToolPart({ name, state, input, output, errorText, icon, label, meta, results, command, activityId, onNavigate, }: ToolPartProps): import("react").JSX.Element;
|
|
41
|
+
export declare function ErrorPart({ title, body, onRetry, }: {
|
|
42
|
+
title?: string;
|
|
43
|
+
body: string;
|
|
44
|
+
onRetry?: () => void;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
export declare function ImagePart({ src, alt, onPreview, }: {
|
|
47
|
+
src: string;
|
|
48
|
+
alt: string;
|
|
49
|
+
onPreview?: () => void;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
export interface ChartBar {
|
|
52
|
+
label: string;
|
|
53
|
+
value: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function ChartPart({ title, unit, bars, expandable, onPreview, }: {
|
|
56
|
+
title: string;
|
|
57
|
+
unit?: string;
|
|
58
|
+
bars: readonly ChartBar[];
|
|
59
|
+
expandable?: boolean;
|
|
60
|
+
onPreview?: () => void;
|
|
61
|
+
}): import("react").JSX.Element;
|
|
62
|
+
export declare function AgentCardPart({ title, agentName, agentDesc, onNavigate, }: {
|
|
63
|
+
title: string;
|
|
64
|
+
agentName: string;
|
|
65
|
+
agentDesc: string;
|
|
66
|
+
onNavigate?: () => void;
|
|
67
|
+
}): import("react").JSX.Element;
|
|
68
|
+
export declare function StepStatusIcon({ status, animated, }: {
|
|
69
|
+
status: PlanStepStatus;
|
|
70
|
+
animated?: boolean;
|
|
71
|
+
}): import("react").JSX.Element;
|
|
72
|
+
export declare function PlanPart({ title, steps, streaming, }: {
|
|
73
|
+
title: string;
|
|
74
|
+
steps: readonly PlanStep[];
|
|
75
|
+
streaming?: boolean;
|
|
76
|
+
}): import("react").JSX.Element;
|
|
77
|
+
export declare function SchedulePart({ title, cadence, nextRun, scheduled, onSchedule, }: {
|
|
78
|
+
title: string;
|
|
79
|
+
cadence: string;
|
|
80
|
+
nextRun: string;
|
|
81
|
+
scheduled?: boolean;
|
|
82
|
+
onSchedule?: () => void;
|
|
83
|
+
}): import("react").JSX.Element;
|
|
84
|
+
export interface ParallelTool {
|
|
85
|
+
icon?: Exclude<ToolIcon, "image" | "terminal">;
|
|
86
|
+
label: string;
|
|
87
|
+
meta?: string;
|
|
88
|
+
status?: "running" | "done" | "failed";
|
|
89
|
+
results?: Array<{
|
|
90
|
+
title: string;
|
|
91
|
+
domain: string;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
export declare function RunningRow({ tool }: {
|
|
95
|
+
tool: ParallelTool;
|
|
96
|
+
}): import("react").JSX.Element;
|
|
97
|
+
export declare function CollapsedRow({ tool }: {
|
|
98
|
+
tool: ParallelTool;
|
|
99
|
+
}): import("react").JSX.Element;
|
|
100
|
+
export declare function ParallelPart({ label, tools, isActive, }: {
|
|
101
|
+
label?: string;
|
|
102
|
+
tools: readonly ParallelTool[];
|
|
103
|
+
isActive?: boolean;
|
|
104
|
+
}): import("react").JSX.Element;
|
|
105
|
+
export interface SubAgent {
|
|
106
|
+
name: string;
|
|
107
|
+
tint?: string;
|
|
108
|
+
summary: string;
|
|
109
|
+
status?: "running" | "done" | "failed";
|
|
110
|
+
}
|
|
111
|
+
export declare function SubAgentsPart({ agents, isActive, }: {
|
|
112
|
+
agents: readonly SubAgent[];
|
|
113
|
+
isActive?: boolean;
|
|
114
|
+
}): import("react").JSX.Element;
|
|
115
|
+
export declare function ConfirmationPart({ id, title, body, confirmLabel, cancelLabel, state, onConfirm, }: {
|
|
116
|
+
id?: string;
|
|
117
|
+
title: string;
|
|
118
|
+
body?: string;
|
|
119
|
+
confirmLabel?: string;
|
|
120
|
+
cancelLabel?: string;
|
|
121
|
+
state?: "pending" | "confirmed" | "cancelled";
|
|
122
|
+
onConfirm?: (confirmed: boolean) => void | Promise<void>;
|
|
123
|
+
}): import("react").JSX.Element;
|
|
124
|
+
export type FileKind = "doc" | "image" | "html" | "audio" | "csv" | "code";
|
|
125
|
+
export declare function FilePart({ name, kind, note, url, artifact, onPreview, onDownload, }: {
|
|
126
|
+
name: string;
|
|
127
|
+
kind?: FileKind;
|
|
128
|
+
note?: string;
|
|
129
|
+
url?: string;
|
|
130
|
+
artifact?: unknown;
|
|
131
|
+
onPreview?: (artifact: unknown) => void;
|
|
132
|
+
onDownload?: (artifact: unknown) => void;
|
|
133
|
+
}): import("react").JSX.Element;
|
|
134
|
+
export interface DashboardData {
|
|
135
|
+
title: string;
|
|
136
|
+
cards?: Array<{
|
|
137
|
+
icon?: string;
|
|
138
|
+
title: string;
|
|
139
|
+
body: string;
|
|
140
|
+
}>;
|
|
141
|
+
tiles?: Array<{
|
|
142
|
+
label: string;
|
|
143
|
+
value: string;
|
|
144
|
+
}>;
|
|
145
|
+
badges?: string[];
|
|
146
|
+
fileNote?: {
|
|
147
|
+
title: string;
|
|
148
|
+
body: string;
|
|
149
|
+
};
|
|
150
|
+
table?: {
|
|
151
|
+
columns: string[];
|
|
152
|
+
rows: string[][];
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export declare function DashboardPart(data: DashboardData): import("react").JSX.Element;
|
|
156
|
+
export interface AskQuestion {
|
|
157
|
+
prompt: string;
|
|
158
|
+
kind: "single" | "multi";
|
|
159
|
+
options: string[];
|
|
160
|
+
}
|
|
161
|
+
export declare function AskUserPart({ questions, freeTextPlaceholder, submittedAnswer, onSubmit, }: {
|
|
162
|
+
questions: readonly AskQuestion[];
|
|
163
|
+
freeTextPlaceholder?: string;
|
|
164
|
+
submittedAnswer?: string;
|
|
165
|
+
onSubmit?: (payload: {
|
|
166
|
+
selections: string[][];
|
|
167
|
+
text: string;
|
|
168
|
+
}) => void | Promise<void>;
|
|
169
|
+
}): import("react").JSX.Element;
|
|
170
|
+
export declare function Suggestions({ items, onPick, }: {
|
|
171
|
+
items: readonly string[];
|
|
172
|
+
onPick?: (text: string) => void | Promise<void>;
|
|
173
|
+
}): import("react").JSX.Element;
|
|
174
|
+
export declare function InlineText({ children }: {
|
|
175
|
+
children: ReactNode;
|
|
176
|
+
}): import("react").JSX.Element;
|
|
177
|
+
export declare function PartLoading({ kind, label, }: {
|
|
178
|
+
kind: RichPartKind;
|
|
179
|
+
label?: string;
|
|
180
|
+
}): import("react").JSX.Element;
|
|
181
|
+
export declare function UnknownPart({ part }: {
|
|
182
|
+
part: unknown;
|
|
183
|
+
}): import("react").JSX.Element;
|
|
184
|
+
export declare function DefaultPartRenderer({ part, context, }: {
|
|
185
|
+
part: unknown;
|
|
186
|
+
context: PartRendererContext;
|
|
187
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|