rift-ds 1.10.0 → 1.12.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 +3 -3
- package/behaviors/LinkProvider.d.ts +36 -0
- package/behaviors/LinkProvider.js +15 -0
- package/behaviors/useFocusScope.d.ts +12 -6
- package/behaviors/useFocusScope.js +12 -2
- package/behaviors/useLayer.d.ts +39 -15
- package/behaviors/useLayer.js +23 -11
- package/chat/AssistantTurn.d.ts +18 -1
- package/chat/AssistantTurn.js +22 -5
- package/chat/ChatAgentPane.d.ts +22 -4
- package/chat/ChatAgentPane.js +20 -6
- package/chat/ChatArtifactPane.d.ts +16 -1
- package/chat/ChatArtifactPane.js +12 -10
- package/chat/ChatLauncher.d.ts +12 -5
- package/chat/ChatLauncher.js +3 -1
- package/chat/ChatProvider.d.ts +10 -5
- package/chat/ChatProvider.js +12 -2
- package/chat/ChatTabs.d.ts +6 -1
- package/chat/ChatTabs.js +3 -2
- package/chat/ChatThreads.d.ts +19 -4
- package/chat/ChatThreads.js +22 -3
- package/chat/ChatWidget.d.ts +110 -5
- package/chat/ChatWidget.js +145 -69
- package/chat/FollowupSuggestions.d.ts +4 -1
- package/chat/FollowupSuggestions.js +9 -3
- package/chat/ResponseActions.d.ts +14 -0
- package/chat/ResponseActions.js +15 -6
- package/chat/TurnQuestion.d.ts +7 -2
- package/chat/TurnQuestion.js +11 -3
- package/chat/demo-card-components.js +2 -1
- package/chat/index.d.ts +1 -1
- package/chat/threads.d.ts +17 -0
- package/chat/threads.js +22 -14
- package/chat/useChat.d.ts +8 -2
- package/chat/useChat.js +3 -2
- package/components/Accordion/Accordion.d.ts +18 -3
- package/components/Accordion/Accordion.js +71 -69
- package/components/AgentPlan/AgentPlan.d.ts +16 -0
- package/components/AgentPlan/AgentPlan.js +8 -3
- package/components/AgentRail/AgentRail.d.ts +24 -4
- package/components/AgentRail/AgentRail.js +13 -6
- package/components/AgentStatus/AgentStatus.css +1 -0
- package/components/AiButton/AiButton.css +3 -1
- package/components/AiButton/AiButton.d.ts +14 -1
- package/components/AiButton/AiButton.js +10 -4
- package/components/Alert/Alert.d.ts +15 -4
- package/components/Alert/Alert.js +46 -40
- package/components/AlertDialog/AlertDialog.d.ts +21 -5
- package/components/AlertDialog/AlertDialog.js +34 -15
- package/components/AnchorNav/AnchorNav.d.ts +4 -1
- package/components/AnchorNav/AnchorNav.js +8 -8
- package/components/AppLayout/AppLayout.d.ts +17 -2
- package/components/AppLayout/AppLayout.js +57 -42
- package/components/AppSidebar/AppSidebar.css +4 -4
- package/components/AppSidebar/AppSidebar.d.ts +34 -2
- package/components/AppSidebar/AppSidebar.js +35 -16
- package/components/ArtifactPanel/ArtifactPanel.d.ts +3 -0
- package/components/ArtifactPanel/ArtifactPanel.js +6 -5
- package/components/Attachment/Attachment.css +1 -0
- package/components/Attachment/AttachmentGroup.d.ts +6 -0
- package/components/Attachment/AttachmentGroup.js +10 -1
- package/components/Attachment/AttachmentTile.d.ts +2 -0
- package/components/Attachment/AttachmentTile.js +3 -2
- package/components/Attachment/AttachmentViewer.js +4 -4
- package/components/Attachment/fileTypes.d.ts +8 -0
- package/components/Avatar/Avatar.css +3 -3
- package/components/Avatar/Avatar.d.ts +11 -3
- package/components/Avatar/Avatar.js +56 -51
- package/components/AvatarGroup/AvatarGroup.css +3 -3
- package/components/AvatarGroup/AvatarGroup.d.ts +6 -3
- package/components/AvatarGroup/AvatarGroup.js +5 -2
- package/components/Badge/Badge.d.ts +9 -2
- package/components/Badge/Badge.js +10 -10
- package/components/Banner/Banner.d.ts +2 -0
- package/components/Banner/Banner.js +2 -1
- package/components/BentoTile/BentoTile.css +527 -0
- package/components/BentoTile/BentoTile.d.ts +64 -0
- package/components/BentoTile/BentoTile.js +303 -0
- package/components/BentoTile/BentoTileArt.d.ts +28 -0
- package/components/BentoTile/BentoTileArt.js +19 -0
- package/components/BottomNav/BottomNav.css +2 -2
- package/components/BottomNav/BottomNav.d.ts +13 -0
- package/components/BottomNav/BottomNav.js +8 -3
- package/components/Breadcrumb/Breadcrumb.d.ts +24 -5
- package/components/Breadcrumb/Breadcrumb.js +33 -33
- package/components/Button/Button.css +123 -20
- package/components/Button/Button.d.ts +25 -3
- package/components/Button/Button.js +23 -3
- package/components/ButtonGroup/ButtonGroup.d.ts +17 -3
- package/components/ButtonGroup/ButtonGroup.js +24 -24
- package/components/Card/Card.d.ts +7 -0
- package/components/Card/Card.js +4 -1
- package/components/CardStack/CardStack.d.ts +5 -0
- package/components/CardStack/CardStack.js +3 -7
- package/components/Carousel/Carousel.d.ts +33 -3
- package/components/Carousel/Carousel.js +178 -137
- package/components/Chart/AreaChart.d.ts +11 -3
- package/components/Chart/AreaChart.js +20 -11
- package/components/Chart/BarChart.d.ts +11 -3
- package/components/Chart/BarChart.js +19 -9
- package/components/Chart/ComboChart.d.ts +11 -3
- package/components/Chart/ComboChart.js +21 -11
- package/components/Chart/LineChart.d.ts +11 -3
- package/components/Chart/LineChart.js +19 -10
- package/components/Chart/PieChart.d.ts +11 -3
- package/components/Chart/PieChart.js +18 -9
- package/components/Chart/RadarChart.d.ts +11 -3
- package/components/Chart/RadarChart.js +20 -11
- package/components/Chart/RadialChart.d.ts +11 -3
- package/components/Chart/RadialChart.js +18 -9
- package/components/Chart/ScatterChart.d.ts +11 -3
- package/components/Chart/ScatterChart.js +23 -11
- package/components/Chart/StackedBarChart.d.ts +11 -3
- package/components/Chart/StackedBarChart.js +19 -10
- package/components/Chart/Treemap.d.ts +13 -3
- package/components/Chart/Treemap.js +23 -13
- package/components/Chart/palette.d.ts +9 -0
- package/components/Chart/palette.js +8 -1
- package/components/Chart/useChartAnimation.d.ts +42 -0
- package/components/Chart/useChartAnimation.js +32 -0
- package/components/ChatMessage/ChatMessage.css +1 -0
- package/components/ChatThread/ChatThread.js +8 -0
- package/components/Checkbox/Checkbox.d.ts +12 -2
- package/components/Checkbox/Checkbox.js +13 -3
- package/components/Chip/Chip.css +24 -1
- package/components/Chip/Chip.d.ts +28 -7
- package/components/Chip/Chip.js +80 -64
- package/components/CircularButton/CircularButton.css +127 -1
- package/components/CircularButton/CircularButton.d.ts +26 -4
- package/components/CircularButton/CircularButton.js +17 -3
- package/components/CodeBlock/CodeBlock.d.ts +24 -3
- package/components/CodeBlock/CodeBlock.js +93 -80
- package/components/CodeDiff/CodeDiff.d.ts +30 -4
- package/components/CodeDiff/CodeDiff.js +64 -20
- package/components/ColorPicker/ColorPicker.d.ts +18 -0
- package/components/ColorPicker/ColorPicker.js +27 -21
- package/components/ColourSwatch/ColourSwatch.css +1 -1
- package/components/Combobox/Combobox.css +1 -0
- package/components/Combobox/Combobox.d.ts +26 -8
- package/components/Combobox/Combobox.js +30 -17
- package/components/CommandPalette/CommandPalette.css +12 -0
- package/components/CommandPalette/CommandPalette.d.ts +27 -4
- package/components/CommandPalette/CommandPalette.js +108 -70
- package/components/Composer/Composer.css +1 -0
- package/components/Composer/Composer.d.ts +10 -0
- package/components/Composer/Composer.js +7 -0
- package/components/ContactCard/ContactCard.css +1 -1
- package/components/ContactCard/ContactCard.d.ts +41 -5
- package/components/ContactCard/ContactCard.js +75 -58
- package/components/ContextMenu/ContextMenu.css +3 -3
- package/components/ContextMenu/ContextMenu.js +7 -10
- package/components/ContributionGraph/ContributionGraph.d.ts +37 -3
- package/components/ContributionGraph/ContributionGraph.js +32 -31
- package/components/DataTable/DataTable.d.ts +29 -0
- package/components/DataTable/DataTable.js +15 -10
- package/components/DateInput/DateInput.js +2 -2
- package/components/DatePicker/DatePicker.css +19 -4
- package/components/DatePicker/DatePicker.d.ts +31 -0
- package/components/DatePicker/DatePicker.js +145 -61
- package/components/Dialog/Dialog.d.ts +2 -0
- package/components/Dialog/Dialog.js +4 -3
- package/components/Divider/Divider.d.ts +10 -2
- package/components/Divider/Divider.js +56 -25
- package/components/DocumentChip/DocumentChip.d.ts +3 -1
- package/components/DocumentChip/DocumentChip.js +3 -2
- package/components/Drawer/Drawer.css +1 -0
- package/components/Drawer/Drawer.d.ts +2 -0
- package/components/Drawer/Drawer.js +4 -3
- package/components/Dropdown/Dropdown.d.ts +9 -2
- package/components/Dropdown/Dropdown.js +26 -16
- package/components/DropdownMenu/DropdownMenu.css +4 -4
- package/components/DropdownMenu/DropdownMenu.d.ts +13 -4
- package/components/DropdownMenu/DropdownMenu.js +41 -22
- package/components/EmptyState/EmptyState.d.ts +12 -4
- package/components/EmptyState/EmptyState.js +30 -26
- package/components/EntityCard/EntityCard.d.ts +7 -2
- package/components/EntityCard/EntityCard.js +19 -21
- package/components/EventCalendar/EventCalendar.d.ts +28 -0
- package/components/EventCalendar/EventCalendar.js +29 -27
- package/components/Figure/Figure.d.ts +14 -5
- package/components/Figure/Figure.js +19 -21
- package/components/FileInput/FileInput.d.ts +6 -0
- package/components/FileInput/FileInput.js +9 -9
- package/components/FilterBar/FilterBar.css +2 -2
- package/components/FilterBar/FilterBar.d.ts +6 -1
- package/components/FilterBar/FilterBar.js +15 -11
- package/components/FunnelChart/FunnelChart.d.ts +13 -1
- package/components/FunnelChart/FunnelChart.js +8 -1
- package/components/GanttChart/GanttChart.css +1 -1
- package/components/GanttChart/GanttChart.d.ts +19 -2
- package/components/GanttChart/GanttChart.js +17 -8
- package/components/Gauge/Gauge.d.ts +4 -1
- package/components/Globe/Globe.css +23 -0
- package/components/Globe/Globe.d.ts +19 -2
- package/components/Globe/Globe.js +66 -19
- package/components/HoverCard/HoverCard.d.ts +4 -1
- package/components/HoverCard/HoverCard.js +26 -15
- package/components/ImageCompare/ImageCompare.d.ts +4 -0
- package/components/ImageCompare/ImageCompare.js +4 -2
- package/components/Input/Input.js +2 -2
- package/components/Inspector/Inspector.css +55 -38
- package/components/Inspector/InspectorDropdown.d.ts +6 -1
- package/components/Inspector/InspectorDropdown.js +2 -0
- package/components/Inspector/InspectorSegmentedControl.d.ts +4 -3
- package/components/Inspector/InspectorSegmentedControl.js +63 -11
- package/components/Inspector/InspectorToggleSwitch.d.ts +4 -3
- package/components/Inspector/InspectorToggleSwitch.js +35 -2
- package/components/Instructions/Instructions.css +1 -1
- package/components/Instructions/Instructions.d.ts +16 -5
- package/components/Instructions/Instructions.js +31 -26
- package/components/InterruptCard/InterruptCard.d.ts +13 -2
- package/components/InterruptCard/InterruptCard.js +9 -7
- package/components/Lightbox/Lightbox.d.ts +8 -0
- package/components/Lightbox/Lightbox.js +10 -6
- package/components/LinkList/LinkList.css +2 -2
- package/components/LinkList/LinkList.d.ts +19 -2
- package/components/LinkList/LinkList.js +41 -36
- package/components/Mention/Mention.d.ts +4 -1
- package/components/MessageActions/MessageActions.css +8 -0
- package/components/MessageActions/MessageActions.d.ts +2 -0
- package/components/MessageActions/MessageActions.js +2 -1
- package/components/MessageCard/MessageCard.d.ts +4 -1
- package/components/Meter/Meter.d.ts +5 -1
- package/components/ModelPicker/ModelPicker.css +1 -1
- package/components/ModelPicker/ModelPicker.d.ts +12 -1
- package/components/ModelPicker/ModelPicker.js +27 -16
- package/components/MotionSwatch/MotionSwatch.d.ts +3 -1
- package/components/MotionSwatch/MotionSwatch.js +2 -1
- package/components/Nav/Nav.d.ts +2 -2
- package/components/Nav/Nav.js +17 -21
- package/components/NavList/NavList.d.ts +11 -0
- package/components/NavList/NavList.js +5 -1
- package/components/NotificationCenter/NotificationCenter.css +1 -1
- package/components/NotificationCenter/NotificationCenter.d.ts +48 -5
- package/components/NotificationCenter/NotificationCenter.js +32 -15
- package/components/NumberInput/NumberInput.d.ts +4 -0
- package/components/NumberInput/NumberInput.js +4 -2
- package/components/Pagination/Pagination.d.ts +33 -7
- package/components/Pagination/Pagination.js +67 -55
- package/components/PinInput/PinInput.d.ts +6 -0
- package/components/PinInput/PinInput.js +3 -1
- package/components/Popover/Popover.d.ts +21 -5
- package/components/Popover/Popover.js +102 -97
- package/components/ProgressBar/ProgressBar.d.ts +10 -3
- package/components/ProgressBar/ProgressBar.js +34 -22
- package/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
- package/components/PromptSuggestions/PromptSuggestions.js +9 -2
- package/components/QuestionCard/QuestionCard.d.ts +2 -0
- package/components/QuestionCard/QuestionCard.js +10 -3
- package/components/Quote/Quote.d.ts +8 -3
- package/components/Quote/Quote.js +18 -21
- package/components/RadioButton/RadioButton.d.ts +6 -1
- package/components/RadioButton/RadioButton.js +7 -2
- package/components/Rating/Rating.d.ts +6 -0
- package/components/Rating/Rating.js +4 -2
- package/components/Reasoning/Reasoning.css +1 -0
- package/components/Reasoning/Reasoning.d.ts +7 -1
- package/components/Reasoning/Reasoning.js +4 -1
- package/components/RichDropdown/RichDropdown.d.ts +3 -1
- package/components/RichDropdown/RichDropdown.js +20 -15
- package/components/SectionTitle/SectionTitle.d.ts +15 -3
- package/components/SectionTitle/SectionTitle.js +15 -17
- package/components/SegmentedControl/SegmentedControl.css +3 -2
- package/components/SegmentedControl/SegmentedControl.d.ts +49 -7
- package/components/SegmentedControl/SegmentedControl.js +248 -223
- package/components/SelectionCard/SelectionCard.d.ts +7 -1
- package/components/SelectionCard/SelectionCard.js +16 -2
- package/components/ShaderField/ShaderField.js +2 -1
- package/components/ShaderField/useShaderField.js +3 -2
- package/components/SidebarPanel/SidebarPanel.d.ts +13 -1
- package/components/SidebarPanel/SidebarPanel.js +6 -2
- package/components/Skeleton/Skeleton.d.ts +12 -3
- package/components/Skeleton/Skeleton.js +53 -19
- package/components/Slider/Slider.d.ts +11 -2
- package/components/Slider/Slider.js +11 -6
- package/components/SourceChip/SourceChip.d.ts +12 -2
- package/components/SourceChip/SourceChip.js +19 -16
- package/components/SourceTrail/SourceTrail.d.ts +22 -0
- package/components/SourceTrail/SourceTrail.js +12 -4
- package/components/Sparkline/Sparkline.d.ts +4 -3
- package/components/Sparkline/Sparkline.js +2 -1
- package/components/Spinner/Spinner.d.ts +21 -4
- package/components/Spinner/Spinner.js +38 -37
- package/components/SplitButton/SplitButton.d.ts +10 -1
- package/components/SplitButton/SplitButton.js +13 -3
- package/components/Stat/Stat.d.ts +7 -2
- package/components/Stat/Stat.js +30 -25
- package/components/StatusDot/StatusDot.css +1 -0
- package/components/Stepper/Stepper.css +13 -0
- package/components/Stepper/Stepper.d.ts +6 -0
- package/components/Stepper/Stepper.js +2 -0
- package/components/StreamingText/StreamingText.d.ts +4 -4
- package/components/StreamingText/StreamingText.js +3 -2
- package/components/Tabs/Tabs.d.ts +41 -6
- package/components/Tabs/Tabs.js +99 -69
- package/components/TagInput/TagInput.d.ts +2 -0
- package/components/TagInput/TagInput.js +7 -2
- package/components/Textarea/Textarea.d.ts +6 -1
- package/components/Textarea/Textarea.js +11 -5
- package/components/ThreadPanel/ThreadPanel.css +1 -1
- package/components/ThreadPanel/ThreadPanel.d.ts +19 -4
- package/components/ThreadPanel/ThreadPanel.js +12 -3
- package/components/ThreadTabs/ThreadTabs.d.ts +7 -2
- package/components/ThreadTabs/ThreadTabs.js +1 -1
- package/components/TimePicker/TimePicker.d.ts +14 -1
- package/components/TimePicker/TimePicker.js +22 -17
- package/components/Timeline/Timeline.css +2 -2
- package/components/Timeline/Timeline.d.ts +11 -2
- package/components/Timeline/Timeline.js +37 -26
- package/components/Toast/Toast.css +1 -1
- package/components/Toast/Toast.d.ts +24 -6
- package/components/Toast/Toast.js +50 -41
- package/components/ToggleGroup/ToggleGroup.css +3 -2
- package/components/ToggleGroup/ToggleGroup.d.ts +26 -4
- package/components/ToggleGroup/ToggleGroup.js +12 -5
- package/components/ToggleSwitch/ToggleSwitch.d.ts +6 -1
- package/components/ToggleSwitch/ToggleSwitch.js +7 -2
- package/components/ToolCall/ToolCall.js +1 -1
- package/components/Tooltip/Tooltip.css +4 -4
- package/components/Tooltip/Tooltip.d.ts +15 -4
- package/components/Tooltip/Tooltip.js +80 -61
- package/components/TopAppBar/TopAppBar.d.ts +16 -1
- package/components/TopAppBar/TopAppBar.js +7 -2
- package/components/TypographySwatch/TypographySwatch.css +1 -1
- package/components/UsageCard/UsageCard.d.ts +4 -1
- package/components/Waveform/Waveform.css +1 -0
- package/components/Waveform/Waveform.d.ts +1 -1
- package/components/Widget/Widget.d.ts +8 -0
- package/components/Widget/Widget.js +3 -2
- package/components/WorldMap/WorldMap.d.ts +12 -0
- package/components/WorldMap/WorldMap.js +11 -5
- package/components/registry.json +36 -19
- package/components/registry.json.d.ts +36 -19
- package/components/registry.json.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +4 -0
- package/package.json +5 -1
- package/tokens/motion.d.ts +14 -0
- package/tokens/motion.js +15 -1
- package/tokens/presets/mono.css +168 -168
- package/tokens/registry.json +7 -0
- package/tokens/registry.json.d.ts +7 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +7 -0
- package/tokens/tokens-light.css +19 -0
package/chat/ChatLauncher.js
CHANGED
|
@@ -42,6 +42,7 @@ function ChatLauncher({
|
|
|
42
42
|
panelId = CHAT_PANEL_ID,
|
|
43
43
|
hostAttribute = "data-chat",
|
|
44
44
|
panelLabel = "Chat",
|
|
45
|
+
aiButtonLabels,
|
|
45
46
|
widget,
|
|
46
47
|
children
|
|
47
48
|
}) {
|
|
@@ -223,6 +224,7 @@ function ChatLauncher({
|
|
|
223
224
|
return /* @__PURE__ */ jsx("div", { className: "ds-chat-launcher__fab", children: /* @__PURE__ */ jsx(
|
|
224
225
|
AiButton,
|
|
225
226
|
{
|
|
227
|
+
...aiButtonLabels,
|
|
226
228
|
label,
|
|
227
229
|
icon,
|
|
228
230
|
"aria-expanded": false,
|
|
@@ -244,7 +246,7 @@ function ChatLauncher({
|
|
|
244
246
|
}
|
|
245
247
|
const handleKeyDown = (event) => {
|
|
246
248
|
if (event.key === "Escape") {
|
|
247
|
-
setOpen(false);
|
|
249
|
+
if (!event.defaultPrevented) setOpen(false);
|
|
248
250
|
return;
|
|
249
251
|
}
|
|
250
252
|
if (modal && event.key === "Tab" && panelRef.current) {
|
package/chat/ChatProvider.d.ts
CHANGED
|
@@ -18,11 +18,12 @@ export interface ChatProviderProps {
|
|
|
18
18
|
defaultPlacement?: ChatPlacement;
|
|
19
19
|
/**
|
|
20
20
|
* Where follow-up questions come from after an answer commits: a source
|
|
21
|
-
* function, an endpoint for the built-in fetcher, or `false` for none
|
|
22
|
-
*
|
|
21
|
+
* function, an endpoint for the built-in fetcher, or `false` for none:
|
|
22
|
+
* with `false` no chips show under an answer at all, not even the written
|
|
23
|
+
* `fallbackFollowups`. Defaults to the fetcher against `/api/chat/followups`.
|
|
23
24
|
*/
|
|
24
25
|
followups?: FollowupsSource | string | false;
|
|
25
|
-
/** The written questions offered when the source returns none. */
|
|
26
|
+
/** The written questions offered when the source returns none or fails. Unused when `followups` is `false`. */
|
|
26
27
|
fallbackFollowups?: readonly string[];
|
|
27
28
|
/**
|
|
28
29
|
* Where a thumbs verdict goes: a sink function, an endpoint for the
|
|
@@ -35,13 +36,17 @@ export interface ChatProviderProps {
|
|
|
35
36
|
renderers?: ChatCardRenderers;
|
|
36
37
|
/** Draws an artifact's preview by kind, for artifacts that are live React content rather than a document or a URL. */
|
|
37
38
|
artifactRenderers?: ChatArtifactRenderers;
|
|
38
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Renders a same-site link in an answer. The default renders through the
|
|
41
|
+
* nearest LinkProvider's link component, else a plain anchor; passing
|
|
42
|
+
* this wins over both.
|
|
43
|
+
*/
|
|
39
44
|
renderLink?: ChatLinkRenderer;
|
|
40
45
|
/** Which hrefs in an answer become links. Everything else renders as text. */
|
|
41
46
|
isInternalHref?: (href: string) => boolean;
|
|
42
47
|
/** Seeds the thread lifecycle behind the `threads` and `tabs` slots. */
|
|
43
48
|
threads?: ThreadsOptions;
|
|
44
|
-
/** Replacement copy for the hook
|
|
49
|
+
/** Replacement copy for the words the hook writes itself, merged over the English defaults: the status line of a reply that has not started ("Thinking") and the placeholder replies for an empty, stopped or failed turn. */
|
|
45
50
|
placeholders?: Partial<ChatPlaceholderCopy>;
|
|
46
51
|
children: ReactNode;
|
|
47
52
|
}
|
package/chat/ChatProvider.js
CHANGED
|
@@ -7,7 +7,17 @@ import { createFollowupsFetcher, followupTarget, DEFAULT_FALLBACK_FOLLOWUPS, pic
|
|
|
7
7
|
import { useThreads } from "./threads.js";
|
|
8
8
|
import { createFetchTransport } from "./transport.js";
|
|
9
9
|
import { DEFAULT_PLACEHOLDER_COPY, useChat } from "./useChat.js";
|
|
10
|
-
|
|
10
|
+
import { useLinkComponent } from "../behaviors/LinkProvider.js";
|
|
11
|
+
function DefaultChatLink({ href, children, onNavigate }) {
|
|
12
|
+
const Link = useLinkComponent();
|
|
13
|
+
return (
|
|
14
|
+
// The hook returns a stable reference from context (or 'a'), never a
|
|
15
|
+
// component created here, which is what the rule guards against.
|
|
16
|
+
// eslint-disable-next-line react-hooks/static-components
|
|
17
|
+
/* @__PURE__ */ jsx(Link, { href, onClick: onNavigate, children })
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const defaultRenderLink = (props) => /* @__PURE__ */ jsx(DefaultChatLink, { ...props });
|
|
11
21
|
function ChatProvider({
|
|
12
22
|
transport,
|
|
13
23
|
endpoint = "/api/chat",
|
|
@@ -51,7 +61,7 @@ function ChatProvider({
|
|
|
51
61
|
setFreshFollowupsId(target.id);
|
|
52
62
|
};
|
|
53
63
|
if (!followupsSource) {
|
|
54
|
-
|
|
64
|
+
setTurnFollowups(target.id, []);
|
|
55
65
|
return;
|
|
56
66
|
}
|
|
57
67
|
void followupsSource(target.question, target.answer, AbortSignal.timeout(1e4)).catch(() => []).then(offer);
|
package/chat/ChatTabs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ThreadTabsProps } from '../components/ThreadTabs/ThreadTabs';
|
|
1
2
|
/**
|
|
2
3
|
* The built-in open-sessions strip: a ThreadTabs over the provider's
|
|
3
4
|
* thread lifecycle. Tabs hold thread ids; selecting one moves the rail's
|
|
@@ -9,5 +10,9 @@
|
|
|
9
10
|
export interface ChatTabsProps {
|
|
10
11
|
/** Accessible name for the tab strip. */
|
|
11
12
|
ariaLabel?: string;
|
|
13
|
+
/** Accessible name of each tab's close button. A string is followed by a colon and the tab's title; a function is given the title and returns the whole name. Defaults to "Close chat". */
|
|
14
|
+
closeLabel?: ThreadTabsProps['closeLabel'];
|
|
15
|
+
/** Spoken text for each tab's status, merged over ThreadTabs' English defaults (Working, Unread, Needs input, Failed). */
|
|
16
|
+
statusLabels?: ThreadTabsProps['statusLabels'];
|
|
12
17
|
}
|
|
13
|
-
export declare function ChatTabs({ ariaLabel }: ChatTabsProps): import("react").JSX.Element | null;
|
|
18
|
+
export declare function ChatTabs({ ariaLabel, closeLabel, statusLabels }: ChatTabsProps): import("react").JSX.Element | null;
|
package/chat/ChatTabs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ThreadTabs } from "../components/ThreadTabs/ThreadTabs.js";
|
|
4
4
|
import { useChatWidget } from "./context.js";
|
|
5
|
-
function ChatTabs({ ariaLabel = "Open chats" }) {
|
|
5
|
+
function ChatTabs({ ariaLabel = "Open chats", closeLabel = "Close chat", statusLabels }) {
|
|
6
6
|
const { threads } = useChatWidget();
|
|
7
7
|
if (threads.tabs.length === 0) return null;
|
|
8
8
|
return /* @__PURE__ */ jsx(
|
|
@@ -14,7 +14,8 @@ function ChatTabs({ ariaLabel = "Open chats" }) {
|
|
|
14
14
|
onTabClose: threads.closeTab,
|
|
15
15
|
onAdd: threads.startNew,
|
|
16
16
|
addLabel: threads.newThreadLabel,
|
|
17
|
-
closeLabel
|
|
17
|
+
closeLabel,
|
|
18
|
+
statusLabels,
|
|
18
19
|
ariaLabel
|
|
19
20
|
}
|
|
20
21
|
);
|
package/chat/ChatThreads.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ThreadPanelProfile } from '../components/ThreadPanel/ThreadPanel';
|
|
2
|
+
import { ThreadPanelProfile, ThreadPanelProps } from '../components/ThreadPanel/ThreadPanel';
|
|
3
3
|
export interface ChatThreadsProps {
|
|
4
4
|
/** The widget seated the rail as a sheet over the conversation rather than beside it. */
|
|
5
5
|
overlay: boolean;
|
|
@@ -7,20 +7,35 @@ export interface ChatThreadsProps {
|
|
|
7
7
|
close: () => void;
|
|
8
8
|
/** The brand row's mark, in both seats. */
|
|
9
9
|
logo?: ReactNode;
|
|
10
|
-
/** The brand row's text. Shown on the sheet
|
|
10
|
+
/** The brand row's text. Shown only on the sheet, where the chat header is hidden behind it; the inline rail leaves it out. */
|
|
11
11
|
logoText?: string;
|
|
12
12
|
/** The signed-in person, shown on the inline rail. */
|
|
13
13
|
profile?: ThreadPanelProfile;
|
|
14
14
|
/** Whether the inline rail can collapse to its icon strip. */
|
|
15
15
|
collapsible?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Whether the inline rail starts expanded. Defaults to `false`: it starts
|
|
18
|
+
* collapsed to its icon strip. The sheet, and a rail that is not
|
|
19
|
+
* `collapsible`, always show expanded.
|
|
20
|
+
*/
|
|
17
21
|
defaultExpanded?: boolean;
|
|
18
22
|
/** Accessible heading over the history. */
|
|
19
23
|
historyLabel?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The words the ThreadPanel writes, merged over its English defaults: the
|
|
26
|
+
* spoken pin and status text ("Pinned", "Working"…), each row's menu
|
|
27
|
+
* trigger ("Thread options"), the rename field ("Rename thread"), the
|
|
28
|
+
* projects header and its add button ("Projects", "New project"), and the
|
|
29
|
+
* collapse toggle ("Collapse the panel", "Expand the panel"). The history's
|
|
30
|
+
* own name is `historyLabel`.
|
|
31
|
+
*/
|
|
32
|
+
threadPanelLabels?: Pick<ThreadPanelProps, 'statusLabels' | 'pinnedLabel' | 'threadMenuLabel' | 'renameLabel' | 'projectsLabel' | 'newProjectLabel' | 'collapseLabel' | 'expandLabel'>;
|
|
33
|
+
/** The rows of each thread's menu, by action; a key left out keeps its English. Defaults to "Pin", "Unpin", "Rename" and "Delete". */
|
|
34
|
+
actionLabels?: Partial<Record<'pin' | 'unpin' | 'rename' | 'delete', string>>;
|
|
20
35
|
}
|
|
21
36
|
/**
|
|
22
37
|
* The built-in session-history rail: a ThreadPanel over the provider's
|
|
23
38
|
* thread lifecycle (`useThreads`). The widget seats it inline on a wide
|
|
24
39
|
* host and as a slide-over sheet on a narrow one, and tells it which.
|
|
25
40
|
*/
|
|
26
|
-
export declare function ChatThreads({ overlay, close, logo, logoText, profile, collapsible, defaultExpanded, historyLabel, }: ChatThreadsProps): import("react").JSX.Element;
|
|
41
|
+
export declare function ChatThreads({ overlay, close, logo, logoText, profile, collapsible, defaultExpanded, historyLabel, threadPanelLabels, actionLabels, }: ChatThreadsProps): import("react").JSX.Element;
|
package/chat/ChatThreads.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { useState, useMemo } from "react";
|
|
4
4
|
import { ThreadPanel } from "../components/ThreadPanel/ThreadPanel.js";
|
|
5
5
|
import { useChatWidget } from "./context.js";
|
|
6
6
|
function ChatThreads({
|
|
@@ -11,15 +11,34 @@ function ChatThreads({
|
|
|
11
11
|
profile,
|
|
12
12
|
collapsible = true,
|
|
13
13
|
defaultExpanded = false,
|
|
14
|
-
historyLabel = "Chat history"
|
|
14
|
+
historyLabel = "Chat history",
|
|
15
|
+
threadPanelLabels,
|
|
16
|
+
actionLabels
|
|
15
17
|
}) {
|
|
16
18
|
const { threads } = useChatWidget();
|
|
17
19
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
18
20
|
const hasProjects = threads.projects.length > 0;
|
|
21
|
+
const groups = useMemo(() => {
|
|
22
|
+
if (!actionLabels) return threads.groups;
|
|
23
|
+
return threads.groups.map((group) => ({
|
|
24
|
+
...group,
|
|
25
|
+
threads: group.threads.map(
|
|
26
|
+
(thread) => thread.actions ? {
|
|
27
|
+
...thread,
|
|
28
|
+
actions: thread.actions.map((action) => {
|
|
29
|
+
const key = action.id === "pin" ? thread.pinned ? "unpin" : "pin" : action.id;
|
|
30
|
+
const label = actionLabels[key];
|
|
31
|
+
return label === void 0 ? action : { ...action, label };
|
|
32
|
+
})
|
|
33
|
+
} : thread
|
|
34
|
+
)
|
|
35
|
+
}));
|
|
36
|
+
}, [threads.groups, actionLabels]);
|
|
19
37
|
return /* @__PURE__ */ jsx(
|
|
20
38
|
ThreadPanel,
|
|
21
39
|
{
|
|
22
|
-
|
|
40
|
+
...threadPanelLabels,
|
|
41
|
+
groups,
|
|
23
42
|
activeThreadId: threads.activeThreadId,
|
|
24
43
|
onThreadSelect: (id) => {
|
|
25
44
|
threads.select(id);
|
package/chat/ChatWidget.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { AgentRailProfile, AgentRailTab } from '../components/AgentRail/AgentRail';
|
|
2
|
+
import { AgentRailProfile, AgentRailProps, AgentRailTab } from '../components/AgentRail/AgentRail';
|
|
3
|
+
import { ArtifactPanelProps } from '../components/ArtifactPanel/ArtifactPanel';
|
|
4
|
+
import { AttachmentDropZoneProps } from '../components/Attachment/AttachmentDropZone';
|
|
5
|
+
import { AttachmentGroupProps } from '../components/Attachment/AttachmentGroup';
|
|
6
|
+
import { ChatThreadProps } from '../components/ChatThread/ChatThread';
|
|
7
|
+
import { CodeBlockProps } from '../components/CodeBlock/CodeBlock';
|
|
8
|
+
import { ComposerProps } from '../components/Composer/Composer';
|
|
3
9
|
import { MentionSource } from '../components/Mention/Mention';
|
|
10
|
+
import { ModelPickerProps } from '../components/ModelPicker/ModelPicker';
|
|
11
|
+
import { PromptSuggestionsProps } from '../components/PromptSuggestions/PromptSuggestions';
|
|
12
|
+
import { QuestionCardLabels, QuestionSummaryProps } from '../components/QuestionCard/QuestionCard';
|
|
13
|
+
import { ChatTabsProps } from './ChatTabs';
|
|
4
14
|
import { ChatThreadsProps } from './ChatThreads';
|
|
15
|
+
import { GreetingCopy } from './greeting';
|
|
16
|
+
import { ChatPlacement } from './placement';
|
|
5
17
|
import { ChatModelOption, Starter } from './types';
|
|
6
18
|
/** A rail slot: the widget's own panel, or a render prop for a custom one. */
|
|
7
19
|
export type RailSlot = boolean | ((ctx: {
|
|
@@ -10,7 +22,7 @@ export type RailSlot = boolean | ((ctx: {
|
|
|
10
22
|
}) => ReactNode);
|
|
11
23
|
/** What the built-in agent pane shows. */
|
|
12
24
|
export interface ChatAgentOptions {
|
|
13
|
-
/** The agent's portrait block. Defaults to the widget's title with
|
|
25
|
+
/** The agent's portrait block. Defaults to the widget's title with the widget's `agentStatus` ("Connected" unless set). A profile with neither `avatar` nor `avatarSrc` wears a PixelAvatar seeded by the widget's title, the mark the header toggle wears. */
|
|
14
26
|
profile?: AgentRailProfile;
|
|
15
27
|
/** The panes, in display order. */
|
|
16
28
|
tabs: AgentRailTab[];
|
|
@@ -35,7 +47,10 @@ export interface ChatWidgetProps {
|
|
|
35
47
|
the middle of the empty thread, starters directly above the composer,
|
|
36
48
|
composer pinned to the bottom from the first paint. */
|
|
37
49
|
phone?: boolean;
|
|
38
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The header brand name, which also seeds the agent's PixelAvatar.
|
|
52
|
+
* Note: not the native `title` tooltip attribute; ChatWidget spreads no native attributes.
|
|
53
|
+
*/
|
|
39
54
|
title?: string;
|
|
40
55
|
/**
|
|
41
56
|
* Which way the conversation reads. `top-down` (the default) floats each
|
|
@@ -86,6 +101,8 @@ export interface ChatWidgetProps {
|
|
|
86
101
|
threadsProps?: Omit<ChatThreadsProps, 'overlay' | 'close'>;
|
|
87
102
|
/** An open-sessions tab strip as its own row under the header. `true` seats the built-in ChatTabs; a node seats your own. */
|
|
88
103
|
tabs?: boolean | ReactNode;
|
|
104
|
+
/** Props for the built-in tab strip when `tabs` is `true`: its name, its close buttons' names and its spoken statuses. */
|
|
105
|
+
tabsProps?: ChatTabsProps;
|
|
89
106
|
/** A companion rail on the trailing edge, the mirror of `threads`: a render prop for your own pane, seated inline on a wide host and raised as a bottom sheet from a header button on a narrow one. For the built-in pane pass `agent` instead. */
|
|
90
107
|
aside?: (ctx: {
|
|
91
108
|
overlay: boolean;
|
|
@@ -95,8 +112,24 @@ export interface ChatWidgetProps {
|
|
|
95
112
|
agent?: ChatAgentOptions;
|
|
96
113
|
/** Seat the artifact panel: a reply that carries an artifact draws a tile in the thread, and the tile (or the header's artifact button) opens the artifact beside the conversation on a wide host and as a bottom sheet on a narrow one. The trailing seat holds one panel at a time, so an open artifact stands in for the agent pane. Off, none of it exists: no header button, no tile, no panel. */
|
|
97
114
|
artifacts?: boolean;
|
|
98
|
-
/** The composer's context note, naming what the chat is looking at. Omit for none. */
|
|
115
|
+
/** The composer's context note, naming what the chat is looking at. Omit for none. The note's wording comes from `contextNote`. */
|
|
99
116
|
contextLabel?: string | null;
|
|
117
|
+
/** The composer's context note, written from `contextLabel`. Defaults to `Looking at “<title>”`. */
|
|
118
|
+
contextNote?: (title: string) => string;
|
|
119
|
+
/** The second line of the drop overlay with attachments on, written from the limits: the largest file as text ("50 MB"), the most files per message, and the largest file in bytes for a host that formats sizes itself. Defaults to `Up to <maxSize> each · <maxFiles> files max`. */
|
|
120
|
+
attachHint?: (maxSize: string, maxFiles: number, maxBytes: number) => string;
|
|
121
|
+
/** The welcome greeting for each part of the visitor's day; a key left out keeps its English. Defaults to "Good morning", "Good afternoon" and "Good evening". */
|
|
122
|
+
greetings?: Partial<GreetingCopy>;
|
|
123
|
+
/** The Chat position menu's rows, one per seat; a key left out keeps its English. Defaults to "Dock right", "Dock left" and "Floating". */
|
|
124
|
+
placementLabels?: Partial<Record<ChatPlacement, string>>;
|
|
125
|
+
/** The status line under the agent's name in the agent pane, where `agent` brings no `profile` of its own. Defaults to "Connected". */
|
|
126
|
+
agentStatus?: string;
|
|
127
|
+
/** The artifact panel's title while nothing is on stage. Defaults to "Artifacts". */
|
|
128
|
+
artifactPanelTitle?: string;
|
|
129
|
+
/** The artifact panel's empty-state heading. Defaults to "Nothing here yet". */
|
|
130
|
+
artifactEmptyTitle?: string;
|
|
131
|
+
/** The artifact panel's empty-state description. Defaults to "What the chat makes for you, like a dashboard or a page, opens in this panel." */
|
|
132
|
+
artifactEmptyDescription?: string;
|
|
100
133
|
/** A widget slot on the welcome screen, under the composer and its
|
|
101
134
|
starters. It takes any content and keeps its natural height, so the
|
|
102
135
|
composer rides up by half of it instead of holding dead centre: the
|
|
@@ -114,6 +147,78 @@ export interface ChatWidgetProps {
|
|
|
114
147
|
widgetsWidth?: 'column' | 'wide';
|
|
115
148
|
/** The quiet line pinned to the widget's floor: what the chat is and where its policy lives. */
|
|
116
149
|
disclaimer?: ReactNode;
|
|
150
|
+
/** Accessible name of the welcome screen's conversation starters. Defaults to "Conversation starters". */
|
|
151
|
+
startersLabel?: string;
|
|
152
|
+
/** Accessible name of the header's new-chat button. Defaults to "New chat". */
|
|
153
|
+
newChatLabel?: string;
|
|
154
|
+
/** Accessible name of the agent-pane toggle while the pane is closed. Defaults to "Show the agent panel". */
|
|
155
|
+
showAgentLabel?: string;
|
|
156
|
+
/** Accessible name of the agent-pane toggle while the pane is open. Defaults to "Hide the agent panel". */
|
|
157
|
+
hideAgentLabel?: string;
|
|
158
|
+
/** Accessible name of the agent pane's own close button, and of the scrim that closes the pane's bottom sheet. Defaults to "Close the agent panel". */
|
|
159
|
+
closeAgentLabel?: string;
|
|
160
|
+
/** Accessible name of the artifact-panel toggle while the panel is closed. Defaults to "Show the artifact panel". */
|
|
161
|
+
showArtifactLabel?: string;
|
|
162
|
+
/** Accessible name of the artifact-panel toggle while the panel is open. Defaults to "Hide the artifact panel". */
|
|
163
|
+
hideArtifactLabel?: string;
|
|
164
|
+
/** Accessible name of the scrim that closes the artifact panel's bottom sheet. Defaults to "Close the artifact panel". */
|
|
165
|
+
closeArtifactLabel?: string;
|
|
166
|
+
/** Accessible name of the Chat position menu's button, and the heading of its group. Defaults to "Chat position". */
|
|
167
|
+
placementLabel?: string;
|
|
168
|
+
/** Accessible name of the expand toggle in panel view. Defaults to "Enter full screen". */
|
|
169
|
+
enterFullscreenLabel?: string;
|
|
170
|
+
/** Accessible name of the expand toggle in full-screen view. Defaults to "Exit full screen". */
|
|
171
|
+
exitFullscreenLabel?: string;
|
|
172
|
+
/** Accessible name of the header's close button. Defaults to "Close chat". */
|
|
173
|
+
closeLabel?: string;
|
|
174
|
+
/** Accessible name of the header button that opens the chat-history sheet on a narrow host. Defaults to "Open the chat history". */
|
|
175
|
+
openThreadsLabel?: string;
|
|
176
|
+
/** Accessible name of the scrim that closes the chat-history sheet. Defaults to "Close the chat history". */
|
|
177
|
+
closeThreadsLabel?: string;
|
|
178
|
+
/** Accessible name of the composer's model picker. Defaults to "Choose a model". */
|
|
179
|
+
modelPickerLabel?: string;
|
|
180
|
+
/** Accessible name of the composer's send button. Defaults to "Send". */
|
|
181
|
+
sendLabel?: string;
|
|
182
|
+
/** Accessible name of a reply's copy button. Defaults to "Copy response". */
|
|
183
|
+
copyResponseLabel?: string;
|
|
184
|
+
/** Accessible name of a reply's copy button once the copy has landed. Defaults to "Copied". */
|
|
185
|
+
copiedResponseLabel?: string;
|
|
186
|
+
/** What screen readers hear once a reply has been copied. Defaults to "Copied to clipboard". */
|
|
187
|
+
copiedAnnouncementLabel?: string;
|
|
188
|
+
/** Accessible name of a reply's thumbs-up button. Defaults to "Good response". */
|
|
189
|
+
goodResponseLabel?: string;
|
|
190
|
+
/** Accessible name of a reply's thumbs-down button. Defaults to "Bad response". */
|
|
191
|
+
badResponseLabel?: string;
|
|
192
|
+
/** Accessible name of the follow-up question row under a finished answer. Defaults to "Follow-up questions". */
|
|
193
|
+
followupsLabel?: string;
|
|
194
|
+
/** The name a long paste's tile wears in the composer and the sent message. Defaults to "Pasted text". */
|
|
195
|
+
pastedTextLabel?: string;
|
|
196
|
+
/** The reasoning disclosure's summary once the thinking is over, given the seconds it took when known. Defaults to "Thought for <n>s", or "Thought process" with no duration. */
|
|
197
|
+
reasoningLabel?: (durationSeconds: number | undefined) => string;
|
|
198
|
+
/** The composer's words, over Composer's English defaults: the attach button ("Attach files"), the drop overlay on the shell ("Drop files to attach"), the queued files' list ("Attachments") and their tiles (`attachmentTileLabels`), the stop button ("Stop generating"), the text field's name ("Message"), and the sentences announced when files or mention matches change. The send button's name is `sendLabel`. */
|
|
199
|
+
composerLabels?: Pick<ComposerProps, 'attachLabel' | 'dropLabel' | 'filesLabel' | 'attachmentTileLabels' | 'stopLabel' | 'aria-label' | 'formatFileAnnouncement' | 'formatMentionAnnouncement'>;
|
|
200
|
+
/** The drop overlay's headline when a file is dragged over the chat with attachments on, over AttachmentDropZone's "Drop files to attach". Its second line is `attachHint`. */
|
|
201
|
+
attachmentDropZoneLabels?: Pick<AttachmentDropZoneProps, 'label'>;
|
|
202
|
+
/** The words of the files on a sent message, over AttachmentGroup's English defaults: the list's name ("Attachments"), the overflow buttons ("Show 3 more", "Show fewer"), the tiles' status lines (`attachmentTileLabels`) and the viewer a pressed file opens in (`attachmentViewerLabels`). */
|
|
203
|
+
attachmentGroupLabels?: Pick<AttachmentGroupProps, 'label' | 'showMoreLabel' | 'showLessLabel' | 'attachmentTileLabels' | 'attachmentViewerLabels'>;
|
|
204
|
+
/** The conversation's names, over ChatThread's English defaults: the scrolling region ("Conversation") and the scroll-to-latest control ("Scroll to the latest message"). */
|
|
205
|
+
chatThreadLabels?: Pick<ChatThreadProps, 'ariaLabel' | 'jumpLabel'>;
|
|
206
|
+
/** The model picker's words, over ModelPicker's English defaults: the open list's name ("Model") and the trigger's text when nothing is selected ("Choose a model"). The trigger's own name is `modelPickerLabel`. */
|
|
207
|
+
modelPickerLabels?: Pick<ModelPickerProps, 'listLabel' | 'placeholder'>;
|
|
208
|
+
/** The artifact panel's words, over ArtifactPanel's English defaults: the view switch ("Preview", "Code", "Artifact view"), the expand and close buttons ("Expand the artifact", "Collapse the artifact", "Close the artifact") and the code view's CodeBlock (`codeBlockLabels`). */
|
|
209
|
+
artifactPanelLabels?: Pick<ArtifactPanelProps, 'previewLabel' | 'codeLabel' | 'viewLabel' | 'expandLabel' | 'collapseLabel' | 'closeLabel' | 'codeBlockLabels'>;
|
|
210
|
+
/** The agent pane's words, over AgentRail's English defaults: the tab strip's name ("Agent views"). The pane's close is `closeAgentLabel`. */
|
|
211
|
+
agentRailLabels?: Pick<AgentRailProps, 'tabsLabel'>;
|
|
212
|
+
/** The words of a question card a reply ends in, over QuestionCard's English defaults: the step count ("1 of 3"), the buttons ("Back", "Next", "Send", "Skip"), the records ("Skipped", "Not answered", "(chosen)"), the pick lines ("Choose one") and the "Something else" row. */
|
|
213
|
+
questionCardLabels?: Partial<QuestionCardLabels>;
|
|
214
|
+
/** The words of a sent set of answers, over QuestionSummary's English default: what stands in for a question left without an answer ("No answer"). */
|
|
215
|
+
questionSummaryLabels?: Pick<QuestionSummaryProps, 'missingLabel'>;
|
|
216
|
+
/** The words of a reply's fenced code, over CodeBlock's English defaults: the copy button ("Copy code", "Copy", "Copied"), and the code region's name, given the fence's language ("Code: bash", or "Code" with none). */
|
|
217
|
+
codeBlockLabels?: Pick<CodeBlockProps, 'copyLabel' | 'copyText' | 'copiedLabel'> & {
|
|
218
|
+
codeLabel?: (language: string | undefined) => string;
|
|
219
|
+
};
|
|
220
|
+
/** The follow-up row's words, over PromptSuggestions' English default: the hidden text read after the sent suggestion ("(chosen)"). The row's name is `followupsLabel`. */
|
|
221
|
+
promptSuggestionsLabels?: Pick<PromptSuggestionsProps, 'chosenLabel'>;
|
|
117
222
|
}
|
|
118
223
|
/**
|
|
119
224
|
* The composed chat: header, thread, composer, starters, disclaimer, and the
|
|
@@ -121,4 +226,4 @@ export interface ChatWidgetProps {
|
|
|
121
226
|
* a stage card, a whole page). It reads all of its state from ChatProvider,
|
|
122
227
|
* so the conversation is the same object wherever it shows.
|
|
123
228
|
*/
|
|
124
|
-
export declare function ChatWidget({ fullscreenEnabled, closeEnabled, placementEnabled, compact, phone, title, flow, placeholder, questionsPlaceholder, showStarters, logo, tagline, starters: startersInput, startersKey, composerActions, models, defaultModel, lockedModelDescription, fileAttachments, maxAttachments, maxAttachmentBytes, mentions, threads, threadsProps, tabs, aside, agent, artifacts, contextLabel, widgets, widgetsLayout, widgetsWidth, disclaimer, }: ChatWidgetProps): import("react").JSX.Element;
|
|
229
|
+
export declare function ChatWidget({ fullscreenEnabled, closeEnabled, placementEnabled, compact, phone, title, flow, placeholder, questionsPlaceholder, showStarters, logo, tagline, starters: startersInput, startersKey, composerActions, models, defaultModel, lockedModelDescription, fileAttachments, maxAttachments, maxAttachmentBytes, mentions, threads, threadsProps, tabs, aside, agent, artifacts, contextLabel, contextNote, attachHint: attachHintText, greetings, placementLabels, agentStatus, artifactPanelTitle, artifactEmptyTitle, artifactEmptyDescription, widgets, widgetsLayout, widgetsWidth, disclaimer, startersLabel, newChatLabel, showAgentLabel, hideAgentLabel, closeAgentLabel, showArtifactLabel, hideArtifactLabel, closeArtifactLabel, placementLabel, enterFullscreenLabel, exitFullscreenLabel, closeLabel, openThreadsLabel, closeThreadsLabel, modelPickerLabel, sendLabel, copyResponseLabel, copiedResponseLabel, copiedAnnouncementLabel, goodResponseLabel, badResponseLabel, followupsLabel, pastedTextLabel, reasoningLabel, tabsProps, composerLabels, attachmentDropZoneLabels, attachmentGroupLabels, chatThreadLabels, modelPickerLabels, artifactPanelLabels, agentRailLabels, questionCardLabels, questionSummaryLabels, codeBlockLabels, promptSuggestionsLabels, }: ChatWidgetProps): import("react").JSX.Element;
|