@plaisolutions/react 0.5.1 → 0.7.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/README.md CHANGED
@@ -97,6 +97,7 @@ import {
97
97
  MessageFooter,
98
98
  MessageHeader,
99
99
  MessageParts,
100
+ Thinking,
100
101
  Clipboard,
101
102
  ThumbDown,
102
103
  ThumbUp,
@@ -113,6 +114,7 @@ Available optional components:
113
114
  - `MessageHeader`
114
115
  - `MessageFooter`
115
116
  - `MessageParts`
117
+ - `Thinking`
116
118
  - `Clipboard`
117
119
  - `ThumbUp`
118
120
  - `ThumbDown`
@@ -129,6 +131,23 @@ same session-aware transport and dynamic authentication headers as
129
131
  `MessageHeader` and `MessageFooter` are optional layout children, while
130
132
  `MessageParts` renders a `UIMessage` and accepts custom text/tool renderers.
131
133
 
134
+ `MessageParts` automatically renders `thinking` parts streamed by the client.
135
+ `Thinking` displays provider-supplied summaries only, never private reasoning
136
+ or provider replay metadata. Use its labels, or the corresponding
137
+ `thinkingLabel` and `completedThinkingLabel` props on `MessageParts`, to
138
+ localize the UI.
139
+
140
+ ```tsx
141
+ <Thinking
142
+ part={{
143
+ type: "thinking",
144
+ thinking: "Checking the relevant sources.",
145
+ state: "completed",
146
+ }}
147
+ completedLabel="Thought process"
148
+ />
149
+ ```
150
+
132
151
  ```tsx
133
152
  <Message align={message.role === "user" ? "end" : "start"}>
134
153
  <MessageAvatar src={avatarUrl} fallback="John Doe" />
@@ -169,13 +188,24 @@ transcription remains a transport capability:
169
188
 
170
189
  ```tsx
171
190
  const { transcribeAudio } = useChat({ transport });
191
+ const speechToText = useSpeechToText({
192
+ transcribe: transcribeAudio,
193
+ onTranscriptionComplete: (text) => setInput(text),
194
+ });
172
195
 
173
196
  <SpeechToTextToggle
174
- transcribe={transcribeAudio}
175
- onTranscriptionComplete={(text) => setInput(text)}
197
+ controller={speechToText}
198
+ cancelOnClickWhileRecording
176
199
  />
177
200
  ```
178
201
 
202
+ `speechToText.finish()` stops an active recording and resolves with its
203
+ transcription. Concurrent calls share the same promise, so a prompt submit can
204
+ safely finish a recording while the microphone control is also processing it.
205
+ Pass `hasPendingInput={speechToText.status === "recording" ||
206
+ speechToText.status === "transcribing"}` to `PromptForm` to keep its submit
207
+ action enabled while voice input is pending.
208
+
179
209
  `transcribe` is required. Storybook and demos can pass the exported
180
210
  `dummyTranscribeAudio` explicitly.
181
211
 
@@ -1,6 +1,6 @@
1
1
  import * as react0 from "react";
2
2
  import { ButtonHTMLAttributes, DialogHTMLAttributes, HTMLAttributes, PropsWithChildren, ReactNode, SVGProps } from "react";
3
- import { ChatStatus, FileUploadState, ResourceReadModel, TranscribeAudioFn, UIAgentInvocationToolCallPart, UIBrowserToolCallPart, UIExternalDatasourceToolCallPart, UIFirecrawlSearchToolCallPart, UIHttpRequestToolCallPart, UIMcpToolCallPart, UIMessage, UIMessagePart, UIOfficeDocumentsToolCallPart, UIPerplexityToolCallPart, UIToolCallPart, UIWorkflowDispatchToolCallPart } from "@plaisolutions/client";
3
+ import { ChatStatus, FileUploadState, ResourceReadModel, TranscribeAudioFn, UIAgentInvocationToolCallPart, UIBrowserToolCallPart, UIExternalDatasourceToolCallPart, UIFirecrawlSearchToolCallPart, UIHttpRequestToolCallPart, UIMcpToolCallPart, UIMessage, UIMessagePart, UIOfficeDocumentsToolCallPart, UIPerplexityToolCallPart, UIThinkingPart, UIToolCallPart, UIWorkflowDispatchToolCallPart } from "@plaisolutions/client";
4
4
 
5
5
  //#region src/components/message.d.ts
6
6
  type MessageProps = HTMLAttributes<HTMLElement> & {
@@ -55,7 +55,12 @@ type MessagePartsProps = HTMLAttributes<HTMLDivElement> & {
55
55
  renderToolCall?: (part: UIToolCallPart, context: {
56
56
  message: UIMessage;
57
57
  }) => ReactNode;
58
+ renderThinking?: (part: UIThinkingPart, context: {
59
+ message: UIMessage;
60
+ }) => ReactNode;
58
61
  isStreaming?: boolean;
62
+ thinkingLabel?: string;
63
+ completedThinkingLabel?: string;
59
64
  readMoreLabel?: string;
60
65
  readLessLabel?: string;
61
66
  };
@@ -67,13 +72,32 @@ declare function MessageParts({
67
72
  locale,
68
73
  renderText,
69
74
  renderToolCall,
75
+ renderThinking,
70
76
  isStreaming,
77
+ thinkingLabel,
78
+ completedThinkingLabel,
71
79
  readMoreLabel,
72
80
  readLessLabel,
73
81
  className,
74
82
  ...props
75
83
  }: MessagePartsProps): react0.JSX.Element;
76
84
  //#endregion
85
+ //#region src/components/thinking.d.ts
86
+ type ThinkingProps = Omit<HTMLAttributes<HTMLElement>, "part"> & {
87
+ part: UIThinkingPart;
88
+ thinkingLabel?: string;
89
+ completedLabel?: string;
90
+ defaultOpen?: boolean;
91
+ };
92
+ declare function Thinking({
93
+ part,
94
+ thinkingLabel,
95
+ completedLabel,
96
+ defaultOpen,
97
+ className,
98
+ ...props
99
+ }: ThinkingProps): react0.JSX.Element;
100
+ //#endregion
77
101
  //#region src/components/datasource-tool-result-card.d.ts
78
102
  type DatasourceToolResultCardProps = {
79
103
  title: string;
@@ -278,6 +302,8 @@ type PromptFormProps = {
278
302
  uploadState?: FileUploadState;
279
303
  onStop?: () => void;
280
304
  disabled?: boolean;
305
+ /** Treat external input such as an active voice recording as submittable. */
306
+ hasPendingInput?: boolean;
281
307
  clearOnSubmit?: boolean;
282
308
  enabledTools?: string[];
283
309
  placeholder?: string;
@@ -314,6 +340,7 @@ declare function PromptForm({
314
340
  uploadState,
315
341
  onStop,
316
342
  disabled,
343
+ hasPendingInput,
317
344
  clearOnSubmit,
318
345
  enabledTools,
319
346
  placeholder,
@@ -361,24 +388,67 @@ declare function PromptFormAttachButton({
361
388
  //#region src/components/speech-to-text-toggle/transcribe-audio.d.ts
362
389
  declare function dummyTranscribeAudio(_audio: Blob, signal?: AbortSignal): Promise<string>;
363
390
  //#endregion
364
- //#region src/components/speech-to-text-toggle/speech-to-text-toggle.d.ts
365
- type SpeechToTextToggleProps = {
366
- onTranscriptionComplete: (text: string) => void;
367
- onTranscriptionError?: (error: Error) => void;
391
+ //#region src/components/speech-to-text-toggle/use-speech-to-text.d.ts
392
+ type SpeechToTextStatus = "idle" | "requesting" | "recording" | "transcribing";
393
+ type UseSpeechToTextOptions = {
368
394
  transcribe: TranscribeAudioFn;
395
+ onTranscriptionComplete?: (text: string) => void;
396
+ onTranscriptionError?: (error: Error) => void;
397
+ };
398
+ type SpeechToTextController = {
399
+ status: SpeechToTextStatus;
400
+ start: () => Promise<void>;
401
+ finish: () => Promise<string | null>;
402
+ cancel: () => void;
403
+ toggle: () => Promise<string | null>;
404
+ };
405
+ /**
406
+ * Owns the complete voice-input lifecycle. `finish` is safe to call from both
407
+ * the microphone control and a form submit: concurrent calls share the same
408
+ * transcription promise.
409
+ */
410
+ declare function useSpeechToText({
411
+ transcribe,
412
+ onTranscriptionComplete,
413
+ onTranscriptionError
414
+ }: UseSpeechToTextOptions): SpeechToTextController;
415
+ //#endregion
416
+ //#region src/components/speech-to-text-toggle/speech-to-text-toggle.d.ts
417
+ type SpeechToTextToggleCommonProps = {
369
418
  label?: string;
370
419
  listeningLabel?: string;
420
+ cancelLabel?: string;
421
+ requestingLabel?: string;
371
422
  loadingLabel?: string;
423
+ cancelOnClickWhileRecording?: boolean;
372
424
  } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onToggle">;
425
+ type StandaloneSpeechToTextToggleProps = {
426
+ controller?: never;
427
+ transcribe: TranscribeAudioFn;
428
+ onTranscriptionComplete: (text: string) => void;
429
+ onTranscriptionError?: (error: Error) => void;
430
+ };
431
+ type ControlledSpeechToTextToggleProps = {
432
+ controller: SpeechToTextController;
433
+ transcribe?: never;
434
+ onTranscriptionComplete?: never;
435
+ onTranscriptionError?: never;
436
+ };
437
+ type SpeechToTextToggleProps = SpeechToTextToggleCommonProps & (StandaloneSpeechToTextToggleProps | ControlledSpeechToTextToggleProps);
373
438
  declare function SpeechToTextToggle({
439
+ controller,
374
440
  onTranscriptionComplete,
375
441
  onTranscriptionError,
376
442
  transcribe,
377
443
  disabled,
378
444
  label,
379
445
  listeningLabel,
446
+ cancelLabel,
447
+ requestingLabel,
380
448
  loadingLabel,
449
+ cancelOnClickWhileRecording,
381
450
  className,
451
+ onClick,
382
452
  ...props
383
453
  }: SpeechToTextToggleProps): react0.JSX.Element;
384
454
  //#endregion
@@ -480,5 +550,5 @@ declare function ToolResultWorkflowDispatchCard({
480
550
  className
481
551
  }: ToolResultWorkflowDispatchCardProps): react0.JSX.Element;
482
552
  //#endregion
483
- export { ArrowUp, Clipboard, type ClipboardProps, type ClipboardState, DatasourceFolderCard, type DatasourceFolderCardProps, DatasourceToolResources, type DatasourceToolResourcesProps, DatasourceToolResultCard, type DatasourceToolResultCardProps, type InvalidPromptFormFile, Loader, type LocalizedOpenGraph, Message, MessageAvatar, type MessageAvatarProps, MessageContent, type MessageContentProps, MessageFooter, type MessageFooterProps, MessageHeader, type MessageHeaderProps, MessageParts, type MessagePartsProps, type MessageProps, Microphone, type OpenGraphContainer, type OpenGraphField, type OpenGraphTranslation, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, type PromptFormAttachButtonProps, PromptFormIconButton, type PromptFormIconButtonProps, type PromptFormProps, type PromptFormSubmitInput, ResourceCard, type ResourceCardProps, Sheet, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, SpeechToTextToggle, type SpeechToTextToggleProps, Stop, ThumbDown, type ThumbDownProps, ThumbUp, type ThumbUpProps, ToolResultAgentInvocationCard, type ToolResultAgentInvocationCardProps, ToolResultBrowserCard, type ToolResultBrowserCardProps, ToolResultCard, type ToolResultCardProps, ToolResultExternalDatasourceCard, type ToolResultExternalDatasourceCardProps, ToolResultHttpRequestCard, type ToolResultHttpRequestCardProps, ToolResultMcpCard, type ToolResultMcpCardProps, ToolResultOfficeDocumentsCard, type ToolResultOfficeDocumentsCardProps, ToolResultWebSearchCard, type ToolResultWebSearchCardProps, ToolResultWorkflowDispatchCard, type ToolResultWorkflowDispatchCardProps, type TranscribeAudioFn, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, isAllowedPromptFormFile, partitionPromptFormFiles };
553
+ export { ArrowUp, Clipboard, type ClipboardProps, type ClipboardState, DatasourceFolderCard, type DatasourceFolderCardProps, DatasourceToolResources, type DatasourceToolResourcesProps, DatasourceToolResultCard, type DatasourceToolResultCardProps, type InvalidPromptFormFile, Loader, type LocalizedOpenGraph, Message, MessageAvatar, type MessageAvatarProps, MessageContent, type MessageContentProps, MessageFooter, type MessageFooterProps, MessageHeader, type MessageHeaderProps, MessageParts, type MessagePartsProps, type MessageProps, Microphone, type OpenGraphContainer, type OpenGraphField, type OpenGraphTranslation, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, type PromptFormAttachButtonProps, PromptFormIconButton, type PromptFormIconButtonProps, type PromptFormProps, type PromptFormSubmitInput, ResourceCard, type ResourceCardProps, Sheet, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, type SpeechToTextController, type SpeechToTextStatus, SpeechToTextToggle, type SpeechToTextToggleProps, Stop, Thinking, type ThinkingProps, ThumbDown, type ThumbDownProps, ThumbUp, type ThumbUpProps, ToolResultAgentInvocationCard, type ToolResultAgentInvocationCardProps, ToolResultBrowserCard, type ToolResultBrowserCardProps, ToolResultCard, type ToolResultCardProps, ToolResultExternalDatasourceCard, type ToolResultExternalDatasourceCardProps, ToolResultHttpRequestCard, type ToolResultHttpRequestCardProps, ToolResultMcpCard, type ToolResultMcpCardProps, ToolResultOfficeDocumentsCard, type ToolResultOfficeDocumentsCardProps, ToolResultWebSearchCard, type ToolResultWebSearchCardProps, ToolResultWorkflowDispatchCard, type ToolResultWorkflowDispatchCardProps, type TranscribeAudioFn, type UseSpeechToTextOptions, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
484
554
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/components/message.tsx","../../src/components/datasource-tool-result-card.tsx","../../src/components/clipboard.tsx","../../src/components/thumbs.tsx","../../src/components/resource-card.tsx","../../src/components/datasource-folder-card.tsx","../../src/components/datasource-tool-resources.tsx","../../src/components/opengraph.ts","../../src/components/sheet/sheet.tsx","../../src/components/icons/arrow.tsx","../../src/components/icons/loader.tsx","../../src/components/icons/microphone.tsx","../../src/components/icons/paperclip.tsx","../../src/components/icons/stop.tsx","../../src/components/icons/x.tsx","../../src/components/prompt-form/file-attachments.ts","../../src/components/prompt-form/prompt-form.tsx","../../src/components/prompt-form/prompt-form-attach-button.tsx","../../src/components/speech-to-text-toggle/transcribe-audio.ts","../../src/components/speech-to-text-toggle/speech-to-text-toggle.tsx","../../src/components/tool-result-card.tsx","../../src/components/tool-result-agent-invocation-card.tsx","../../src/components/tool-result-browser-card.tsx","../../src/components/tool-result-external-datasource-card.tsx","../../src/components/tool-result-http-request-card.tsx","../../src/components/tool-result-mcp-card.tsx","../../src/components/tool-result-office-documents-card.tsx","../../src/components/tool-result-web-search-card.tsx","../../src/components/tool-result-workflow-dispatch-card.tsx"],"sourcesContent":[],"mappings":";;;;;KAUY,YAAA,GAAe,eAAe;;;AAA9B,iBAII,OAAA,CAJ0B;EAAA,KAAA;EAAA,SAAf;EAAA,GAAA;AAAc,CAAA,EAQtC,YARsC,CAAA,EAQ1B,MAAA,CAAA,G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DsC,CAAA,E4ByDH,MAAA,CAAA,GAAA,CAAA,O5BzDG"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/components/message.tsx","../../src/components/thinking.tsx","../../src/components/datasource-tool-result-card.tsx","../../src/components/clipboard.tsx","../../src/components/thumbs.tsx","../../src/components/resource-card.tsx","../../src/components/datasource-folder-card.tsx","../../src/components/datasource-tool-resources.tsx","../../src/components/opengraph.ts","../../src/components/sheet/sheet.tsx","../../src/components/icons/arrow.tsx","../../src/components/icons/loader.tsx","../../src/components/icons/microphone.tsx","../../src/components/icons/paperclip.tsx","../../src/components/icons/stop.tsx","../../src/components/icons/x.tsx","../../src/components/prompt-form/file-attachments.ts","../../src/components/prompt-form/prompt-form.tsx","../../src/components/prompt-form/prompt-form-attach-button.tsx","../../src/components/speech-to-text-toggle/transcribe-audio.ts","../../src/components/speech-to-text-toggle/use-speech-to-text.ts","../../src/components/speech-to-text-toggle/speech-to-text-toggle.tsx","../../src/components/tool-result-card.tsx","../../src/components/tool-result-agent-invocation-card.tsx","../../src/components/tool-result-browser-card.tsx","../../src/components/tool-result-external-datasource-card.tsx","../../src/components/tool-result-http-request-card.tsx","../../src/components/tool-result-mcp-card.tsx","../../src/components/tool-result-office-documents-card.tsx","../../src/components/tool-result-web-search-card.tsx","../../src/components/tool-result-workflow-dispatch-card.tsx"],"sourcesContent":[],"mappings":";;;;;KAYY,YAAA,GAAe,eAAe;;;AAA9B,iBAII,OAAA,CAJ0B;EAAA,KAAA;EAAA,SAAf;EAAA,GAAA;AAAc,CAAA,EAQtC,YARsC,CAAA,EAQ1B,MAAA,CAAA,GAAA,CAAA,OAR0B;AAIzB,KAkBJ,kBAAA,GAAqB,IAlBV,CAmBrB,cAnBqB,CAmBN,cAnBM,CAAA,EAAA,UAAA,CAAA,GAAA;EACrB,GAAA,EAAA,MAAA;EACA,QAAA,EAAA,MAAA;EAEC,GAAA,CAAA,EAAA,MAAA;EAAY,cAAA,CAAA,EAAA,MAAA;CAAA;AA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AA,E6BqItC,4B7BrIsC,CAAA,E6BqIV,MAAA,CAAA,GAAA,CAAA,O7BrIU;;;K8BA7B,mCAAA;QACJ;;;A9BDI,iB8BoDI,8BAAA,C9BpDW;EAAA,IAAc;EAAA;AAAA,CAAA,E8BuDtC,mC9BvDsC,CAAA,E8BuDH,MAAA,CAAA,GAAA,CAAA,O9BvDG"}
@@ -1,6 +1,6 @@
1
1
  import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { Bot, Check, CheckCircle2, Copy, Database, File, FileText, Globe, LoaderCircle, MessageSquare, Minus, Plug, Plus, ThumbsDown, ThumbsUp, Workflow, XCircle } from "lucide-react";
3
+ import { Bot, Brain, Check, CheckCircle2, ChevronDown, Copy, Database, File, FileText, Globe, LoaderCircle, MessageSquare, Minus, Plug, Plus, ThumbsDown, ThumbsUp, Workflow, XCircle } from "lucide-react";
4
4
 
5
5
  //#region src/components/internal/join-classes.ts
6
6
  function joinClasses(...classes) {
@@ -2140,6 +2140,61 @@ function ToolResultCard({ part, className, detailsOpen = true, locale, onOpenAge
2140
2140
  });
2141
2141
  }
2142
2142
 
2143
+ //#endregion
2144
+ //#region src/components/thinking.tsx
2145
+ function Thinking({ part, thinkingLabel = "Thinking…", completedLabel = "Thought process", defaultOpen, className,...props }) {
2146
+ const isStreaming = part.state === "streaming";
2147
+ const hasContent = Boolean(part.thinking.trim());
2148
+ const [isOpen, setIsOpen] = useState(defaultOpen ?? isStreaming);
2149
+ const previousState = useRef(part.state);
2150
+ const contentId = useId();
2151
+ const label = isStreaming ? thinkingLabel : completedLabel;
2152
+ useEffect(() => {
2153
+ if (previousState.current === "streaming" && !isStreaming) setIsOpen(false);
2154
+ previousState.current = part.state;
2155
+ }, [isStreaming, part.state]);
2156
+ return /* @__PURE__ */ jsxs("section", {
2157
+ className: joinClasses("text-sm text-neutral-600", className),
2158
+ "data-thinking-state": part.state,
2159
+ ...props,
2160
+ children: [
2161
+ /* @__PURE__ */ jsxs("button", {
2162
+ type: "button",
2163
+ "aria-controls": hasContent ? contentId : void 0,
2164
+ "aria-expanded": hasContent ? isOpen : void 0,
2165
+ "aria-label": hasContent ? `${isOpen ? "Collapse" : "Expand"} ${label}` : label,
2166
+ disabled: !hasContent,
2167
+ className: joinClasses("inline-flex items-center gap-2 rounded-md py-1 text-left font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-neutral-950", hasContent ? "cursor-pointer hover:text-neutral-900" : "cursor-default"),
2168
+ onClick: () => setIsOpen((value) => !value),
2169
+ children: [
2170
+ isStreaming ? /* @__PURE__ */ jsx(LoaderCircle, {
2171
+ className: "size-4 shrink-0 animate-spin motion-reduce:animate-none",
2172
+ "aria-hidden": "true"
2173
+ }) : /* @__PURE__ */ jsx(Brain, {
2174
+ className: "size-4 shrink-0",
2175
+ "aria-hidden": "true"
2176
+ }),
2177
+ /* @__PURE__ */ jsx("span", { children: label }),
2178
+ hasContent ? /* @__PURE__ */ jsx(ChevronDown, {
2179
+ className: joinClasses("size-4 shrink-0 transition-transform motion-reduce:transition-none", isOpen ? "rotate-180" : void 0),
2180
+ "aria-hidden": "true"
2181
+ }) : null
2182
+ ]
2183
+ }),
2184
+ /* @__PURE__ */ jsx("span", {
2185
+ className: "sr-only",
2186
+ "aria-live": "polite",
2187
+ children: isStreaming ? "Thinking in progress" : "Thinking complete"
2188
+ }),
2189
+ hasContent && isOpen ? /* @__PURE__ */ jsx("p", {
2190
+ id: contentId,
2191
+ className: "mt-1 whitespace-pre-wrap border-l-2 border-neutral-200 pl-3 text-sm leading-6 text-neutral-600",
2192
+ children: part.thinking
2193
+ }) : null
2194
+ ]
2195
+ });
2196
+ }
2197
+
2143
2198
  //#endregion
2144
2199
  //#region src/components/message.tsx
2145
2200
  function Message({ align = "start", className,...props }) {
@@ -2207,7 +2262,7 @@ function getDisplayExtension(label) {
2207
2262
  if (!ext || ext === label.toUpperCase()) return void 0;
2208
2263
  return ext;
2209
2264
  }
2210
- function renderPart(part, index, message, isStreaming, onOpenAgentThread, locale, renderText, renderToolCall) {
2265
+ function renderPart(part, index, message, isStreaming, onOpenAgentThread, locale, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel) {
2211
2266
  if (part.type === "text") {
2212
2267
  if (renderText) return /* @__PURE__ */ jsx("div", { children: renderText(part, {
2213
2268
  message,
@@ -2266,6 +2321,14 @@ function renderPart(part, index, message, isStreaming, onOpenAgentThread, locale
2266
2321
  onOpenAgentThread
2267
2322
  }, `tool-${part.id}-${index}`);
2268
2323
  }
2324
+ if (part.type === "thinking") {
2325
+ if (renderThinking) return /* @__PURE__ */ jsx("div", { children: renderThinking(part, { message }) }, `thinking-${index}`);
2326
+ return /* @__PURE__ */ jsx(Thinking, {
2327
+ part,
2328
+ thinkingLabel,
2329
+ completedLabel: completedThinkingLabel
2330
+ }, `thinking-${index}`);
2331
+ }
2269
2332
  if (part.type === "guardrail") return /* @__PURE__ */ jsx("p", {
2270
2333
  className: "rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",
2271
2334
  children: part.content
@@ -2284,7 +2347,7 @@ function orderMessageParts(parts, position) {
2284
2347
  else remainingParts.push(indexedPart);
2285
2348
  return [...datasourceParts, ...remainingParts];
2286
2349
  }
2287
- function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, datasourceToolResultsPosition = "inline", onOpenAgentThread, locale, renderText, renderToolCall, isStreaming = false, readMoreLabel = "Read more", readLessLabel = "Read less", className,...props }) {
2350
+ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD, datasourceToolResultsPosition = "inline", onOpenAgentThread, locale, renderText, renderToolCall, renderThinking, isStreaming = false, thinkingLabel, completedThinkingLabel, readMoreLabel = "Read more", readLessLabel = "Read less", className,...props }) {
2288
2351
  const [isExpanded, setIsExpanded] = useState(false);
2289
2352
  const textContent = useMemo(() => message.parts.filter((part) => part.type === "text").map((part) => part.text).join("\n"), [message.parts]);
2290
2353
  const canCollapse = message.role === "user" && message.parts.every((part) => part.type === "text") && textContent.length > collapseThreshold;
@@ -2297,7 +2360,7 @@ function MessageParts({ message, collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
2297
2360
  children: [canCollapse && !isExpanded ? /* @__PURE__ */ jsx("p", {
2298
2361
  className: "whitespace-pre-wrap text-sm leading-6",
2299
2362
  children: previewText
2300
- }) : orderedParts.map(({ part, index }) => renderPart(part, index, message, isStreaming, onOpenAgentThread, locale, renderText, renderToolCall)), canCollapse ? /* @__PURE__ */ jsx("button", {
2363
+ }) : orderedParts.map(({ part, index }) => renderPart(part, index, message, isStreaming, onOpenAgentThread, locale, renderText, renderToolCall, renderThinking, thinkingLabel, completedThinkingLabel)), canCollapse ? /* @__PURE__ */ jsx("button", {
2301
2364
  type: "button",
2302
2365
  className: "text-left text-xs font-medium text-slate-600 hover:text-slate-900",
2303
2366
  onClick: () => setIsExpanded((previous) => !previous),
@@ -2506,7 +2569,7 @@ function PromptFormIconButton({ className, type = "button",...props }) {
2506
2569
  ...props
2507
2570
  });
2508
2571
  }
2509
- function PromptForm({ value, onValueChange, onSubmit, status = "ready", uploadState, onStop, disabled = false, clearOnSubmit = true, enabledTools, placeholder = "Type a message...", sendLabel = "Send", stopLabel = "Stop", attachLabel = "Attach file", removeFileLabel = "Remove file", uploadingLabel = "Uploading", processingUploadLabel = "Processing upload", uploadErrorLabel = "Upload failed", enableAttachments = true, files: filesProp, onFilesChange, onInvalidFiles, accept = PROMPT_FORM_FILE_ACCEPT, className, textareaClassName, attachmentsClassName, uploadProgressClassName, maxRows = defaultMaxRows, submitButtonClassName, stopButtonClassName, leftSlot, rightSlot, submitOnEnter = true, onTextareaKeyDown }) {
2572
+ function PromptForm({ value, onValueChange, onSubmit, status = "ready", uploadState, onStop, disabled = false, hasPendingInput = false, clearOnSubmit = true, enabledTools, placeholder = "Type a message...", sendLabel = "Send", stopLabel = "Stop", attachLabel = "Attach file", removeFileLabel = "Remove file", uploadingLabel = "Uploading", processingUploadLabel = "Processing upload", uploadErrorLabel = "Upload failed", enableAttachments = true, files: filesProp, onFilesChange, onInvalidFiles, accept = PROMPT_FORM_FILE_ACCEPT, className, textareaClassName, attachmentsClassName, uploadProgressClassName, maxRows = defaultMaxRows, submitButtonClassName, stopButtonClassName, leftSlot, rightSlot, submitOnEnter = true, onTextareaKeyDown }) {
2510
2573
  const textareaRef = useRef(null);
2511
2574
  const [internalFiles, setInternalFiles] = useState([]);
2512
2575
  const [isSubmitting, setIsSubmitting] = useState(false);
@@ -2514,7 +2577,7 @@ function PromptForm({ value, onValueChange, onSubmit, status = "ready", uploadSt
2514
2577
  const setFiles = onFilesChange ?? setInternalFiles;
2515
2578
  const isStreaming = status === "streaming" || status === "submitted";
2516
2579
  const isUploading = uploadState?.status === "uploading" || uploadState?.status === "processing";
2517
- const hasContent = value.trim().length > 0 || files.length > 0;
2580
+ const hasContent = value.trim().length > 0 || files.length > 0 || hasPendingInput;
2518
2581
  const canSubmit = !disabled && !isSubmitting && !isStreaming && !isUploading && hasContent;
2519
2582
  const isInteractionDisabled = disabled || isSubmitting || isUploading;
2520
2583
  useLayoutEffect(() => {
@@ -2704,57 +2767,162 @@ function useVoiceRecording() {
2704
2767
  }
2705
2768
 
2706
2769
  //#endregion
2707
- //#region src/components/speech-to-text-toggle/speech-to-text-toggle.tsx
2708
- function SpeechToTextToggle({ onTranscriptionComplete, onTranscriptionError, transcribe, disabled = false, label = "Voice input", listeningLabel = "Stop recording", loadingLabel = "Transcribing...", className,...props }) {
2709
- const [isListening, setIsListening] = useState(false);
2710
- const [isTranscribing, setIsTranscribing] = useState(false);
2770
+ //#region src/components/speech-to-text-toggle/use-speech-to-text.ts
2771
+ function normalizeError(error, fallback) {
2772
+ return error instanceof Error ? error : new Error(fallback);
2773
+ }
2774
+ function isAbortError(error) {
2775
+ return error instanceof DOMException && error.name === "AbortError";
2776
+ }
2777
+ /**
2778
+ * Owns the complete voice-input lifecycle. `finish` is safe to call from both
2779
+ * the microphone control and a form submit: concurrent calls share the same
2780
+ * transcription promise.
2781
+ */
2782
+ function useSpeechToText({ transcribe, onTranscriptionComplete, onTranscriptionError }) {
2783
+ const [status, setStatus] = useState("idle");
2784
+ const statusRef = useRef("idle");
2785
+ const operationIdRef = useRef(0);
2786
+ const pendingFinishRef = useRef(null);
2711
2787
  const abortControllerRef = useRef(null);
2712
- const { start, stop, cancel } = useVoiceRecording();
2713
- useEffect(() => {
2714
- return () => {
2715
- abortControllerRef.current?.abort();
2716
- cancel();
2717
- };
2718
- }, [cancel]);
2719
- async function handleToggle() {
2720
- if (disabled || isTranscribing) return;
2721
- if (!isListening) {
2722
- try {
2723
- await start();
2724
- setIsListening(true);
2725
- } catch (error) {
2726
- onTranscriptionError?.(error instanceof Error ? error : /* @__PURE__ */ new Error("Microphone access was denied"));
2788
+ const optionsRef = useRef({
2789
+ transcribe,
2790
+ onTranscriptionComplete,
2791
+ onTranscriptionError
2792
+ });
2793
+ optionsRef.current = {
2794
+ transcribe,
2795
+ onTranscriptionComplete,
2796
+ onTranscriptionError
2797
+ };
2798
+ const { start: startRecording, stop: stopRecording, cancel: cancelRecording } = useVoiceRecording();
2799
+ const updateStatus = useCallback((nextStatus) => {
2800
+ statusRef.current = nextStatus;
2801
+ setStatus(nextStatus);
2802
+ }, []);
2803
+ const start = useCallback(async () => {
2804
+ if (statusRef.current !== "idle" || pendingFinishRef.current) return;
2805
+ const operationId = operationIdRef.current + 1;
2806
+ operationIdRef.current = operationId;
2807
+ updateStatus("requesting");
2808
+ try {
2809
+ await startRecording();
2810
+ if (operationIdRef.current !== operationId) {
2811
+ cancelRecording();
2812
+ return;
2727
2813
  }
2728
- return;
2814
+ updateStatus("recording");
2815
+ } catch (error) {
2816
+ if (operationIdRef.current !== operationId) return;
2817
+ updateStatus("idle");
2818
+ optionsRef.current.onTranscriptionError?.(normalizeError(error, "Microphone access was denied"));
2729
2819
  }
2730
- setIsListening(false);
2731
- setIsTranscribing(true);
2820
+ }, [
2821
+ cancelRecording,
2822
+ startRecording,
2823
+ updateStatus
2824
+ ]);
2825
+ const finish = useCallback(() => {
2826
+ if (pendingFinishRef.current) return pendingFinishRef.current;
2827
+ if (statusRef.current !== "recording") return Promise.resolve(null);
2828
+ const operationId = operationIdRef.current;
2732
2829
  const abortController = new AbortController();
2733
2830
  abortControllerRef.current = abortController;
2734
- try {
2735
- const text$1 = await transcribe(await stop(), abortController.signal);
2736
- if (text$1.trim()) onTranscriptionComplete(text$1);
2737
- } catch (error) {
2738
- if (error instanceof DOMException && error.name === "AbortError") return;
2739
- onTranscriptionError?.(error instanceof Error ? error : /* @__PURE__ */ new Error("Transcription failed"));
2740
- } finally {
2741
- abortControllerRef.current = null;
2742
- setIsTranscribing(false);
2831
+ updateStatus("transcribing");
2832
+ const pending = (async () => {
2833
+ try {
2834
+ const audio = await stopRecording();
2835
+ if (operationIdRef.current !== operationId) return null;
2836
+ const transcription = await optionsRef.current.transcribe(audio, abortController.signal);
2837
+ if (operationIdRef.current !== operationId) return null;
2838
+ const text$1 = transcription.trim();
2839
+ if (!text$1) return null;
2840
+ optionsRef.current.onTranscriptionComplete?.(text$1);
2841
+ return text$1;
2842
+ } catch (error) {
2843
+ if (operationIdRef.current !== operationId || abortController.signal.aborted || isAbortError(error)) return null;
2844
+ optionsRef.current.onTranscriptionError?.(normalizeError(error, "Transcription failed"));
2845
+ return null;
2846
+ } finally {
2847
+ pendingFinishRef.current = null;
2848
+ abortControllerRef.current = null;
2849
+ if (operationIdRef.current === operationId) updateStatus("idle");
2850
+ }
2851
+ })();
2852
+ pendingFinishRef.current = pending;
2853
+ return pending;
2854
+ }, [stopRecording, updateStatus]);
2855
+ const cancel = useCallback(() => {
2856
+ operationIdRef.current += 1;
2857
+ abortControllerRef.current?.abort();
2858
+ cancelRecording();
2859
+ updateStatus("idle");
2860
+ }, [cancelRecording, updateStatus]);
2861
+ const toggle = useCallback(async () => {
2862
+ if (statusRef.current === "idle") {
2863
+ await start();
2864
+ return null;
2743
2865
  }
2744
- }
2745
- const ariaLabel = isTranscribing ? loadingLabel : isListening ? listeningLabel : label;
2866
+ if (statusRef.current === "recording" || statusRef.current === "transcribing") return finish();
2867
+ return null;
2868
+ }, [finish, start]);
2869
+ useEffect(() => {
2870
+ return () => {
2871
+ operationIdRef.current += 1;
2872
+ abortControllerRef.current?.abort();
2873
+ cancelRecording();
2874
+ };
2875
+ }, [cancelRecording]);
2876
+ return useMemo(() => ({
2877
+ status,
2878
+ start,
2879
+ finish,
2880
+ cancel,
2881
+ toggle
2882
+ }), [
2883
+ cancel,
2884
+ finish,
2885
+ start,
2886
+ status,
2887
+ toggle
2888
+ ]);
2889
+ }
2890
+
2891
+ //#endregion
2892
+ //#region src/components/speech-to-text-toggle/speech-to-text-toggle.tsx
2893
+ async function missingTranscribe() {
2894
+ throw new Error("SpeechToTextToggle requires transcribe when no controller is provided.");
2895
+ }
2896
+ function SpeechToTextToggle({ controller, onTranscriptionComplete, onTranscriptionError, transcribe, disabled = false, label = "Voice input", listeningLabel = "Stop recording", cancelLabel = "Cancel recording", requestingLabel = "Requesting microphone access...", loadingLabel = "Transcribing...", cancelOnClickWhileRecording = false, className, onClick,...props }) {
2897
+ const internalController = useSpeechToText({
2898
+ transcribe: transcribe ?? missingTranscribe,
2899
+ onTranscriptionComplete,
2900
+ onTranscriptionError
2901
+ });
2902
+ const speechToText = controller ?? internalController;
2903
+ const isRequesting = speechToText.status === "requesting";
2904
+ const isListening = speechToText.status === "recording";
2905
+ const isTranscribing = speechToText.status === "transcribing";
2906
+ const cancelsRecording = isListening && cancelOnClickWhileRecording;
2907
+ const ariaLabel = isRequesting ? requestingLabel : isTranscribing ? loadingLabel : cancelsRecording ? cancelLabel : isListening ? listeningLabel : label;
2746
2908
  return /* @__PURE__ */ jsx(PromptFormIconButton, {
2747
2909
  type: "button",
2748
2910
  "aria-label": ariaLabel,
2749
2911
  "aria-pressed": isListening,
2750
- "aria-busy": isTranscribing,
2751
- disabled: disabled || isTranscribing,
2912
+ "aria-busy": isRequesting || isTranscribing,
2913
+ disabled: disabled || isRequesting || isTranscribing,
2752
2914
  className: joinClasses(isListening && !isTranscribing ? "text-red-600" : void 0, className),
2753
- onClick: () => {
2754
- handleToggle();
2915
+ onClick: (event) => {
2916
+ onClick?.(event);
2917
+ if (event.defaultPrevented) return;
2918
+ if (cancelsRecording) {
2919
+ speechToText.cancel();
2920
+ return;
2921
+ }
2922
+ speechToText.toggle();
2755
2923
  },
2756
2924
  ...props,
2757
- children: isTranscribing ? /* @__PURE__ */ jsx(Loader, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(Microphone, { className: "size-4" })
2925
+ children: isRequesting || isTranscribing ? /* @__PURE__ */ jsx(Loader, { className: "size-4 animate-spin" }) : cancelsRecording ? /* @__PURE__ */ jsx(X, { className: "size-4" }) : /* @__PURE__ */ jsx(Microphone, { className: "size-4" })
2758
2926
  });
2759
2927
  }
2760
2928
 
@@ -2773,5 +2941,5 @@ async function dummyTranscribeAudio(_audio, signal) {
2773
2941
  }
2774
2942
 
2775
2943
  //#endregion
2776
- export { ArrowUp, Clipboard, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, PromptFormIconButton, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, ThumbDown, ThumbUp, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, isAllowedPromptFormFile, partitionPromptFormFiles };
2944
+ export { ArrowUp, Clipboard, DatasourceFolderCard, DatasourceToolResources, DatasourceToolResultCard, Loader, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageParts, Microphone, PROMPT_FORM_FILE_ACCEPT, Paperclip, PromptForm, PromptFormAttachButton, PromptFormIconButton, ResourceCard, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SpeechToTextToggle, Stop, Thinking, ThumbDown, ThumbUp, ToolResultAgentInvocationCard, ToolResultBrowserCard, ToolResultCard, ToolResultExternalDatasourceCard, ToolResultHttpRequestCard, ToolResultMcpCard, ToolResultOfficeDocumentsCard, ToolResultWebSearchCard, ToolResultWorkflowDispatchCard, X, dummyTranscribeAudio, getLocalizedOpenGraphValue, getResourceDescription, getResourceIcon, getResourceOpenGraphImage, getResourceOpenGraphType, getResourceTitle, getResourceType, getResourceUrl, isAllowedPromptFormFile, partitionPromptFormFiles, useSpeechToText };
2777
2945
  //# sourceMappingURL=index.js.map