@parallelworks/ui 0.44.0 → 0.45.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 +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +5 -1
- package/dist/components/Select.js +43 -44
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FaAngleRight } from "../../icons/fa/FaAngleRight.js";
|
|
1
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "../../icons.js";
|
|
3
2
|
import { useChatConfig } from "../core/config.js";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { useMemo } from "react";
|
|
@@ -34,7 +33,7 @@ function BranchNavigator({ messages, currentMessageId, onNavigate }) {
|
|
|
34
33
|
className: "p-1.5 rounded-md transition-colors enabled:hover:chat-tint enabled:hover:theme-text disabled:opacity-30 disabled:cursor-not-allowed",
|
|
35
34
|
title: t.previous,
|
|
36
35
|
"aria-label": t.previous,
|
|
37
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "w-3.5 h-3.5" })
|
|
38
37
|
}),
|
|
39
38
|
/* @__PURE__ */ jsxs("span", {
|
|
40
39
|
className: "min-w-[3ch] text-center tabular-nums",
|
|
@@ -51,7 +50,7 @@ function BranchNavigator({ messages, currentMessageId, onNavigate }) {
|
|
|
51
50
|
className: "p-1.5 rounded-md transition-colors enabled:hover:chat-tint enabled:hover:theme-text disabled:opacity-30 disabled:cursor-not-allowed",
|
|
52
51
|
title: t.next,
|
|
53
52
|
"aria-label": t.next,
|
|
54
|
-
children: /* @__PURE__ */ jsx(
|
|
53
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-3.5 h-3.5" })
|
|
55
54
|
})
|
|
56
55
|
]
|
|
57
56
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FaPlus } from "../../icons/fa/FaPlus.js";
|
|
1
|
+
import { AddIcon, CloudIcon } from "../../icons.js";
|
|
3
2
|
import { keyedByContent } from "../../components/keys.js";
|
|
3
|
+
import { useStrings } from "../../components/Provider.js";
|
|
4
4
|
import { useChatConfig } from "../core/config.js";
|
|
5
5
|
import { useChat } from "../core/ChatProvider.js";
|
|
6
6
|
import BlockedGroupBanner from "./BlockedGroupBanner.js";
|
|
@@ -20,6 +20,7 @@ function pickRandom(arr, count) {
|
|
|
20
20
|
}
|
|
21
21
|
function ChatEmptyState({ targetSession }) {
|
|
22
22
|
const { extraLinks, LinkComponent, slots, suggestedPrompts, strings } = useChatConfig();
|
|
23
|
+
const { common } = useStrings();
|
|
23
24
|
const t = strings.emptyState;
|
|
24
25
|
const tInput = strings.input;
|
|
25
26
|
const { adapter, currentUser, models, loadProviders, loadConversations, sendMessage, isLoading, isLoadingModels, hasLoadedModels, clearCurrentConversation, setSelectedProvider, refreshModels } = useChat();
|
|
@@ -81,7 +82,7 @@ function ChatEmptyState({ targetSession }) {
|
|
|
81
82
|
children: /* @__PURE__ */ jsxs(NoticeCard, {
|
|
82
83
|
tone: "warning",
|
|
83
84
|
onDismiss: () => setSessionBannerDismissed(true),
|
|
84
|
-
dismissLabel:
|
|
85
|
+
dismissLabel: common.dismiss,
|
|
85
86
|
children: [
|
|
86
87
|
/* @__PURE__ */ jsx("span", {
|
|
87
88
|
className: "block font-medium",
|
|
@@ -95,7 +96,7 @@ function ChatEmptyState({ targetSession }) {
|
|
|
95
96
|
type: "button",
|
|
96
97
|
onClick: () => refreshModels(),
|
|
97
98
|
className: "mt-1 font-medium underline-offset-2 hover:underline",
|
|
98
|
-
children:
|
|
99
|
+
children: common.retry
|
|
99
100
|
})
|
|
100
101
|
]
|
|
101
102
|
})
|
|
@@ -112,7 +113,7 @@ function ChatEmptyState({ targetSession }) {
|
|
|
112
113
|
hasLoadedModels && models.length === 0 && /* @__PURE__ */ jsxs("div", {
|
|
113
114
|
className: "mx-auto mb-6 flex max-w-md flex-col items-center gap-3 px-8 text-center",
|
|
114
115
|
children: [
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
+
/* @__PURE__ */ jsx(CloudIcon, { className: "h-10 w-10 theme-muted-text opacity-60" }),
|
|
116
117
|
/* @__PURE__ */ jsx("p", {
|
|
117
118
|
className: "text-lg font-medium theme-text",
|
|
118
119
|
children: t.noProvidersTitle
|
|
@@ -126,8 +127,8 @@ function ChatEmptyState({ targetSession }) {
|
|
|
126
127
|
kind: "external",
|
|
127
128
|
href: extraLinks.addProvider
|
|
128
129
|
},
|
|
129
|
-
className: "mt-1 inline-flex items-center gap-2 px-4 py-2 rounded-full transition-opacity text-sm font-medium theme-
|
|
130
|
-
children: [/* @__PURE__ */ jsx(
|
|
130
|
+
className: "mt-1 inline-flex items-center gap-2 px-4 py-2 rounded-full transition-opacity text-sm font-medium theme-accent hover:opacity-90",
|
|
131
|
+
children: [/* @__PURE__ */ jsx(AddIcon, { className: "h-3 w-3" }), t.addProvider]
|
|
131
132
|
})
|
|
132
133
|
]
|
|
133
134
|
}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { GoPlus } from "../../icons/go/GoPlus.js";
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { AddIcon, ArrowUpIcon, StopIcon } from "../../icons.js";
|
|
4
3
|
import { useChatConfig } from "../core/config.js";
|
|
5
4
|
import { useChat } from "../core/ChatProvider.js";
|
|
6
5
|
import AttachmentUpload from "./AttachmentUpload.js";
|
|
@@ -11,7 +10,6 @@ import DragOverlay from "./DragOverlay.js";
|
|
|
11
10
|
import { PasteFileCard } from "./PastedText.js";
|
|
12
11
|
import { SlashMenu, useSlashMenu } from "./SlashMenu.js";
|
|
13
12
|
import { usePasteCards } from "./usePasteCards.js";
|
|
14
|
-
import { clsx } from "clsx";
|
|
15
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
14
|
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
17
15
|
//#region src/ai/components/ChatInput.tsx
|
|
@@ -35,10 +33,10 @@ function AttachButton({ open, disabled, label, onClick }) {
|
|
|
35
33
|
onClick,
|
|
36
34
|
disabled,
|
|
37
35
|
"aria-expanded": open,
|
|
38
|
-
className:
|
|
36
|
+
className: cx("flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full transition-colors", open ? "theme-text chat-tint-strong" : "theme-muted-text hover:theme-text hover:chat-tint", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
39
37
|
"aria-label": label,
|
|
40
38
|
title: label,
|
|
41
|
-
children: /* @__PURE__ */ jsx(
|
|
39
|
+
children: /* @__PURE__ */ jsx(AddIcon, { className: cx("h-5 w-5 transition-transform duration-200", open && "rotate-45") })
|
|
42
40
|
});
|
|
43
41
|
}
|
|
44
42
|
function SendButton({ onClick, enabled, emphasised, label, testId }) {
|
|
@@ -47,10 +45,10 @@ function SendButton({ onClick, enabled, emphasised, label, testId }) {
|
|
|
47
45
|
onClick,
|
|
48
46
|
disabled: !enabled,
|
|
49
47
|
"data-testid": testId,
|
|
50
|
-
className:
|
|
48
|
+
className: cx("flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full transition-[background-color,color,transform] duration-150 active:scale-95", emphasised ? "theme-accent hover:opacity-90" : "chat-send-idle", !enabled && "cursor-not-allowed active:scale-100"),
|
|
51
49
|
"aria-label": label,
|
|
52
50
|
title: label,
|
|
53
|
-
children: /* @__PURE__ */ jsx(
|
|
51
|
+
children: /* @__PURE__ */ jsx(ArrowUpIcon, { className: "h-4 w-4" })
|
|
54
52
|
});
|
|
55
53
|
}
|
|
56
54
|
/** A host-driven turn stands in for the provider's stream and queue. */
|
|
@@ -190,10 +188,10 @@ var ChatInput = forwardRef(function ChatInput({ onSend, disabled = false, placeh
|
|
|
190
188
|
type: "button",
|
|
191
189
|
onClick: stopStreaming,
|
|
192
190
|
disabled: turn?.stopping,
|
|
193
|
-
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-(--theme-
|
|
191
|
+
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-(--theme-app) text-(--theme-panel-bg) transition-opacity hover:opacity-85 disabled:opacity-50",
|
|
194
192
|
"aria-label": t.stopGenerating,
|
|
195
193
|
title: t.stopGenerating,
|
|
196
|
-
children: /* @__PURE__ */ jsx(
|
|
194
|
+
children: /* @__PURE__ */ jsx(StopIcon, { className: "h-3 w-3" })
|
|
197
195
|
}) : /* @__PURE__ */ jsx(SendButton, {
|
|
198
196
|
onClick: handleSubmit,
|
|
199
197
|
enabled: canSend,
|
|
@@ -249,7 +247,7 @@ var ChatInput = forwardRef(function ChatInput({ onSend, disabled = false, placeh
|
|
|
249
247
|
})
|
|
250
248
|
}),
|
|
251
249
|
/* @__PURE__ */ jsxs("div", {
|
|
252
|
-
className:
|
|
250
|
+
className: cx(!toolbar && "flex items-end gap-2 pr-2 pb-2"),
|
|
253
251
|
children: [/* @__PURE__ */ jsx("div", {
|
|
254
252
|
className: "max-h-[200px] min-w-0 flex-1 overflow-y-auto",
|
|
255
253
|
children: /* @__PURE__ */ jsx("textarea", {
|
|
@@ -263,7 +261,7 @@ var ChatInput = forwardRef(function ChatInput({ onSend, disabled = false, placeh
|
|
|
263
261
|
"aria-label": inputLabel ?? effectivePlaceholder,
|
|
264
262
|
disabled,
|
|
265
263
|
rows: 1,
|
|
266
|
-
className:
|
|
264
|
+
className: cx("theme-text block w-full resize-none overflow-hidden", "bg-transparent border-0 px-4", toolbar ? "pt-3.5 pb-1" : "pt-3 pb-1", "placeholder:theme-muted-text", "focus:outline-none focus:ring-0", "disabled:opacity-50 disabled:cursor-not-allowed", "text-[1rem] leading-relaxed")
|
|
267
265
|
})
|
|
268
266
|
}), !toolbar && action]
|
|
269
267
|
}),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
1
2
|
import { useChatConfig } from "../core/config.js";
|
|
2
3
|
import { useReportSidebarPresentation } from "../core/sidebarState.js";
|
|
3
4
|
import { useChat } from "../core/ChatProvider.js";
|
|
4
5
|
import { KeyboardShortcutsProvider } from "../core/KeyboardShortcutsProvider.js";
|
|
5
6
|
import { SidebarToggle } from "../ui/sidebar.js";
|
|
6
7
|
import ChatSidebar from "./ChatSidebar.js";
|
|
7
|
-
import { clsx } from "clsx";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
10
10
|
//#region src/ai/components/ChatLayout.tsx
|
|
@@ -51,9 +51,9 @@ function ConversationLayout({ sidebar, children, sidebarMode = "inline", drawerB
|
|
|
51
51
|
const { strings } = useChatConfig();
|
|
52
52
|
return /* @__PURE__ */ jsxs("div", {
|
|
53
53
|
ref,
|
|
54
|
-
className:
|
|
54
|
+
className: cx("flex h-full", drawer && "relative overflow-hidden"),
|
|
55
55
|
children: [sidebar, /* @__PURE__ */ jsxs("main", {
|
|
56
|
-
className:
|
|
56
|
+
className: cx("flex min-w-0 flex-1 flex-col", CHAT_COLUMN_SCOPE),
|
|
57
57
|
children: [drawer && (drawerToggle || drawerBar) && /* @__PURE__ */ jsxs("div", {
|
|
58
58
|
className: "flex shrink-0 items-center gap-2 bg-(--theme-panel-bg) px-2 pt-2",
|
|
59
59
|
children: [drawerToggle && /* @__PURE__ */ jsx(SidebarToggle, {
|
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FaEdit } from "../../icons/fa/FaEdit.js";
|
|
4
|
-
import { FaUndoAlt } from "../../icons/fa/FaUndoAlt.js";
|
|
5
|
-
import { FiCopy } from "../../icons/fi/FiCopy.js";
|
|
6
|
-
import { FiDownload } from "../../icons/fi/FiDownload.js";
|
|
7
|
-
import { FiFile } from "../../icons/fi/FiFile.js";
|
|
8
|
-
import { MdRefresh } from "../../icons/md/MdRefresh.js";
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { CheckIcon, CopyIcon, DownloadIcon, EditIcon, ErrorIcon, FileIcon, RetryIcon } from "../../icons.js";
|
|
9
3
|
import { safeUrl } from "../../safeUrl.js";
|
|
10
|
-
import {
|
|
4
|
+
import { useStrings } from "../../components/Provider.js";
|
|
5
|
+
import { useCopy } from "../../components/useCopy.js";
|
|
6
|
+
import { Avatar } from "../../components/Avatar.js";
|
|
7
|
+
import { formatBytes, formatDuration } from "../../format.js";
|
|
8
|
+
import { RelativeTime } from "../../components/relativeTime.js";
|
|
11
9
|
import { useChatConfig } from "../core/config.js";
|
|
12
|
-
import { formatFileSize } from "../utils.js";
|
|
13
10
|
import Markdown from "../ui/Markdown.js";
|
|
14
11
|
import { chatProseClasses } from "../ui/prose.js";
|
|
15
|
-
import {
|
|
12
|
+
import { Reasoning } from "./Reasoning.js";
|
|
16
13
|
import AgentMessageParts from "./agent/AgentMessageParts.js";
|
|
17
14
|
import BranchNavigator from "./BranchNavigator.js";
|
|
18
15
|
import { UserMessageText } from "./PastedText.js";
|
|
19
|
-
import { Avatar } from "../ui/Avatar.js";
|
|
20
|
-
import { clsx } from "clsx";
|
|
21
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
17
|
import { memo, useEffect, useRef, useState } from "react";
|
|
23
|
-
import { DateTime
|
|
18
|
+
import { DateTime } from "luxon";
|
|
24
19
|
//#region src/ai/components/ChatMessage.tsx
|
|
25
|
-
function formatDuration(ms) {
|
|
26
|
-
if (!ms) return "";
|
|
27
|
-
return durationToAbsHumanDuration(Duration.fromMillis(ms));
|
|
28
|
-
}
|
|
29
20
|
var COLLAPSE_THRESHOLD = 680;
|
|
30
21
|
function parseTimestamp(iso) {
|
|
31
22
|
if (!iso) return null;
|
|
@@ -54,8 +45,9 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
54
45
|
const toolCallCount = message.parts?.filter((p) => p.kind === "tool_call").length ?? 0;
|
|
55
46
|
const showReasoningButton = !isUser && !isStreaming && hasReasoning;
|
|
56
47
|
const showTurnDurationLabel = !isUser && !isStreaming && !hasReasoning && (!!message.reasoningDuration || toolCallCount > 0);
|
|
57
|
-
const t = useChatConfig().strings
|
|
58
|
-
const
|
|
48
|
+
const { messageMeta: t, thinking: tThinking } = useChatConfig().strings;
|
|
49
|
+
const { common } = useStrings();
|
|
50
|
+
const { copy, copied } = useCopy();
|
|
59
51
|
const [showActions, setShowActions] = useState(false);
|
|
60
52
|
const [editContent, setEditContent] = useState(message.content || "");
|
|
61
53
|
const textareaRef = useRef(null);
|
|
@@ -102,7 +94,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
102
94
|
};
|
|
103
95
|
const hasParts = !!message.parts?.length;
|
|
104
96
|
if (hasParts && !message.content) return /* @__PURE__ */ jsx("div", {
|
|
105
|
-
className:
|
|
97
|
+
className: cx("group py-3 w-full", !flush && "px-4"),
|
|
106
98
|
children: /* @__PURE__ */ jsx(AgentMessageParts, {
|
|
107
99
|
message,
|
|
108
100
|
isStreaming,
|
|
@@ -115,15 +107,11 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
115
107
|
const totalTokens = message.tokensUsed?.total_tokens;
|
|
116
108
|
const collapsed = !isUser && collapsible && !expanded && !isStreaming && !latest;
|
|
117
109
|
const copyToClipboard = async () => {
|
|
118
|
-
if (message.content) {
|
|
119
|
-
await navigator.clipboard.writeText(message.content);
|
|
120
|
-
setCopied(true);
|
|
121
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
122
|
-
}
|
|
110
|
+
if (message.content) await copy(message.content, { quiet: true });
|
|
123
111
|
};
|
|
124
112
|
return /* @__PURE__ */ jsx("div", {
|
|
125
113
|
role: "none",
|
|
126
|
-
className:
|
|
114
|
+
className: cx("group w-full", isUser ? "pt-8 pb-5" : "py-3", !flush && "px-4"),
|
|
127
115
|
onMouseEnter: () => setShowActions(true),
|
|
128
116
|
onMouseLeave: () => setShowActions(false),
|
|
129
117
|
onFocus: () => setShowActions(true),
|
|
@@ -142,34 +130,36 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
142
130
|
children: [/* @__PURE__ */ jsx("button", {
|
|
143
131
|
type: "button",
|
|
144
132
|
onClick: onCancelEdit,
|
|
145
|
-
className: "px-4 py-1.5 text-sm font-medium rounded-full transition-colors chat-tint hover:chat-tint-strong text-(--theme-
|
|
146
|
-
children:
|
|
133
|
+
className: "px-4 py-1.5 text-sm font-medium rounded-full transition-colors chat-tint hover:chat-tint-strong text-(--theme-app)",
|
|
134
|
+
children: common.cancel
|
|
147
135
|
}), /* @__PURE__ */ jsx("button", {
|
|
148
136
|
type: "button",
|
|
149
137
|
onClick: handleSave,
|
|
150
138
|
disabled: !editContent.trim(),
|
|
151
|
-
className: "px-4 py-1.5 text-sm font-medium rounded-full transition-colors hover:opacity-85 disabled:opacity-50 disabled:cursor-not-allowed bg-(--theme-
|
|
152
|
-
children:
|
|
139
|
+
className: "px-4 py-1.5 text-sm font-medium rounded-full transition-colors hover:opacity-85 disabled:opacity-50 disabled:cursor-not-allowed bg-(--theme-app) text-(--theme-panel-bg)",
|
|
140
|
+
children: common.send
|
|
153
141
|
})]
|
|
154
142
|
})]
|
|
155
143
|
}) : /* @__PURE__ */ jsx("div", {
|
|
156
|
-
className:
|
|
144
|
+
className: cx("flex gap-3 w-full", isRightAligned ? "flex-row-reverse" : "flex-row"),
|
|
157
145
|
children: /* @__PURE__ */ jsxs("div", {
|
|
158
|
-
className:
|
|
146
|
+
className: cx("flex-1 min-w-0 space-y-1", isRightAligned && "relative flex flex-col items-end"),
|
|
159
147
|
children: [
|
|
160
|
-
showReasoningButton && /* @__PURE__ */
|
|
148
|
+
showReasoningButton && /* @__PURE__ */ jsx("div", {
|
|
161
149
|
className: "mb-2",
|
|
162
|
-
children:
|
|
150
|
+
children: /* @__PURE__ */ jsx(Reasoning, {
|
|
151
|
+
label: message.reasoningDuration ? tThinking.thoughtFor(formatDuration(message.reasoningDuration)) : tThinking.thoughtProcess,
|
|
163
152
|
open: reasoningOpen,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
onOpenChange: setReasoningOpen,
|
|
154
|
+
onOpenPanel: onOpenReasoning && (() => onOpenReasoning(message.reasoning || "", message.reasoningDuration ?? null)),
|
|
155
|
+
children: /* @__PURE__ */ jsx(Markdown, { children: message.reasoning || "" })
|
|
156
|
+
})
|
|
167
157
|
}),
|
|
168
158
|
showTurnDurationLabel && /* @__PURE__ */ jsx("div", {
|
|
169
159
|
className: "mb-2",
|
|
170
160
|
children: /* @__PURE__ */ jsx("div", {
|
|
171
161
|
className: "flex items-center gap-x-1.5 text-sm theme-muted-text",
|
|
172
|
-
children: /* @__PURE__ */ jsx("span", { children: message.reasoningDuration ?
|
|
162
|
+
children: /* @__PURE__ */ jsx("span", { children: message.reasoningDuration ? tThinking.thoughtFor(formatDuration(message.reasoningDuration)) : tThinking.ranToolCalls(toolCallCount) })
|
|
173
163
|
})
|
|
174
164
|
}),
|
|
175
165
|
!isUser && hasParts && /* @__PURE__ */ jsx("div", {
|
|
@@ -187,25 +177,26 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
187
177
|
message.content ? otherAuthor ? /* @__PURE__ */ jsxs("div", {
|
|
188
178
|
className: "flex items-end gap-2",
|
|
189
179
|
children: [/* @__PURE__ */ jsx(Avatar, {
|
|
190
|
-
src: otherAuthor.avatarUrl
|
|
180
|
+
src: otherAuthor.avatarUrl,
|
|
191
181
|
name: otherAuthor.name || otherAuthor.username,
|
|
192
|
-
|
|
182
|
+
size: "sm",
|
|
183
|
+
className: "mb-0.5"
|
|
193
184
|
}), /* @__PURE__ */ jsx("div", {
|
|
194
|
-
className:
|
|
185
|
+
className: cx("px-4 py-2.5 chat-ink rounded-[1.25rem] max-w-[80%] inline-block whitespace-pre-wrap wrap-break-word text-[1rem] leading-6 chat-tint", hasPastes && "chat-bubble-roomy"),
|
|
195
186
|
children: /* @__PURE__ */ jsx(UserMessageText, {
|
|
196
187
|
content: message.content,
|
|
197
188
|
pastes: message.pastes
|
|
198
189
|
})
|
|
199
190
|
})]
|
|
200
191
|
}) : isUser ? /* @__PURE__ */ jsx("div", {
|
|
201
|
-
className:
|
|
192
|
+
className: cx("px-4 py-2.5 chat-ink rounded-[1.25rem] max-w-[80%] inline-block whitespace-pre-wrap wrap-break-word text-[1rem] leading-6 chat-bubble-user", hasPastes && "chat-bubble-roomy"),
|
|
202
193
|
children: /* @__PURE__ */ jsx(UserMessageText, {
|
|
203
194
|
content: message.content,
|
|
204
195
|
pastes: message.pastes
|
|
205
196
|
})
|
|
206
197
|
}) : /* @__PURE__ */ jsx("div", {
|
|
207
198
|
ref: contentRef,
|
|
208
|
-
className:
|
|
199
|
+
className: cx(chatProseClasses, collapsed && "chat-message-clamp"),
|
|
209
200
|
children: /* @__PURE__ */ jsx(Markdown, {
|
|
210
201
|
isStreaming,
|
|
211
202
|
children: message.content
|
|
@@ -215,7 +206,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
215
206
|
type: "button",
|
|
216
207
|
onClick: () => setExpanded((e) => !e),
|
|
217
208
|
className: "text-xs font-medium theme-muted-text hover:theme-text transition-colors",
|
|
218
|
-
children: expanded ?
|
|
209
|
+
children: expanded ? common.showLess : common.showMore
|
|
219
210
|
}),
|
|
220
211
|
message.stopped && !isStreaming && /* @__PURE__ */ jsx("span", {
|
|
221
212
|
className: "inline-flex items-center mt-1 text-[11px] italic theme-muted-text",
|
|
@@ -224,7 +215,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
224
215
|
hasError && /* @__PURE__ */ jsxs("div", {
|
|
225
216
|
className: "flex items-center gap-2 mt-2 p-3 rounded-lg bg-red-500/10 border border-red-500/30",
|
|
226
217
|
children: [
|
|
227
|
-
/* @__PURE__ */ jsx(
|
|
218
|
+
/* @__PURE__ */ jsx(ErrorIcon, { className: "w-4 h-4 text-red-600 flex-shrink-0" }),
|
|
228
219
|
/* @__PURE__ */ jsx("span", {
|
|
229
220
|
className: "text-sm text-red-700 flex-1",
|
|
230
221
|
children: message.error
|
|
@@ -233,7 +224,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
233
224
|
type: "button",
|
|
234
225
|
onClick: () => onRetry(message.id),
|
|
235
226
|
className: "flex items-center gap-1 px-2 py-1 text-xs font-medium text-red-700 hover:bg-red-500/15 rounded transition-colors",
|
|
236
|
-
children: [/* @__PURE__ */ jsx(
|
|
227
|
+
children: [/* @__PURE__ */ jsx(RetryIcon, { className: "w-3 h-3" }), common.retry]
|
|
237
228
|
})
|
|
238
229
|
]
|
|
239
230
|
}),
|
|
@@ -261,7 +252,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
261
252
|
onClick: () => onOpenAttachment ? onOpenAttachment(att) : triggerDownload(downloadUrl, att.filename || "File"),
|
|
262
253
|
className: "inline-flex items-center gap-1.5 text-xs px-2.5 py-1.5 rounded-lg bg-(--theme-muted-panel-bg) hover:theme-hover transition-colors cursor-pointer",
|
|
263
254
|
children: [
|
|
264
|
-
/* @__PURE__ */ jsx(
|
|
255
|
+
/* @__PURE__ */ jsx(FileIcon, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
265
256
|
/* @__PURE__ */ jsx("span", {
|
|
266
257
|
className: "truncate max-w-[150px]",
|
|
267
258
|
children: att.filename || "File"
|
|
@@ -270,11 +261,11 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
270
261
|
className: "theme-muted-text",
|
|
271
262
|
children: [
|
|
272
263
|
"(",
|
|
273
|
-
|
|
264
|
+
formatBytes(att.size),
|
|
274
265
|
")"
|
|
275
266
|
]
|
|
276
267
|
}) : null,
|
|
277
|
-
/* @__PURE__ */ jsx(
|
|
268
|
+
/* @__PURE__ */ jsx(DownloadIcon, { className: "w-3 h-3 flex-shrink-0" })
|
|
278
269
|
]
|
|
279
270
|
}, att.id);
|
|
280
271
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -285,7 +276,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
285
276
|
style: { cursor: "pointer" }
|
|
286
277
|
} : {},
|
|
287
278
|
children: [
|
|
288
|
-
/* @__PURE__ */ jsx(
|
|
279
|
+
/* @__PURE__ */ jsx(FileIcon, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
289
280
|
/* @__PURE__ */ jsx("span", {
|
|
290
281
|
className: "truncate max-w-[150px]",
|
|
291
282
|
children: att.filename || "File"
|
|
@@ -294,7 +285,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
294
285
|
className: "theme-muted-text",
|
|
295
286
|
children: [
|
|
296
287
|
"(",
|
|
297
|
-
|
|
288
|
+
formatBytes(att.size),
|
|
298
289
|
")"
|
|
299
290
|
]
|
|
300
291
|
}) : null
|
|
@@ -303,28 +294,28 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
303
294
|
})
|
|
304
295
|
}),
|
|
305
296
|
!isStreaming && !isEditing && /* @__PURE__ */ jsxs("div", {
|
|
306
|
-
className:
|
|
297
|
+
className: cx("chat-actions flex items-center gap-0.5 transition-opacity duration-150", isRightAligned ? "absolute right-0 top-full -mr-1.5 mt-0.5" : "-ml-1.5 mt-2", isRightAligned && (showActions ? "opacity-100" : "opacity-0 pointer-events-none")),
|
|
307
298
|
children: [
|
|
308
299
|
/* @__PURE__ */ jsx("button", {
|
|
309
300
|
type: "button",
|
|
310
301
|
onClick: copyToClipboard,
|
|
311
302
|
className: "p-1.5 rounded-md hover:chat-tint theme-muted-text hover:theme-text transition-colors",
|
|
312
303
|
title: t.copy,
|
|
313
|
-
children: copied ? /* @__PURE__ */ jsx(
|
|
304
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ jsx(CopyIcon, { className: "w-4 h-4" })
|
|
314
305
|
}),
|
|
315
306
|
isUser && !isOtherUser && onEdit && /* @__PURE__ */ jsx("button", {
|
|
316
307
|
type: "button",
|
|
317
308
|
onClick: () => onEdit(message.id),
|
|
318
309
|
className: "p-1.5 rounded-md hover:chat-tint theme-muted-text hover:theme-text transition-colors",
|
|
319
310
|
title: t.edit,
|
|
320
|
-
children: /* @__PURE__ */ jsx(
|
|
311
|
+
children: /* @__PURE__ */ jsx(EditIcon, { className: "w-4 h-4" })
|
|
321
312
|
}),
|
|
322
313
|
!isUser && onRegenerate && /* @__PURE__ */ jsx("button", {
|
|
323
314
|
type: "button",
|
|
324
315
|
onClick: () => onRegenerate(message.id),
|
|
325
316
|
className: "p-1.5 rounded-md hover:chat-tint theme-muted-text hover:theme-text transition-colors",
|
|
326
317
|
title: t.regenerate,
|
|
327
|
-
children: /* @__PURE__ */ jsx(
|
|
318
|
+
children: /* @__PURE__ */ jsx(RetryIcon, { className: "w-4 h-4" })
|
|
328
319
|
}),
|
|
329
320
|
!isUser && onNavigateBranch && /* @__PURE__ */ jsx(BranchNavigator, {
|
|
330
321
|
messages: allMessages,
|
|
@@ -332,12 +323,9 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
332
323
|
onNavigate: onNavigateBranch
|
|
333
324
|
}),
|
|
334
325
|
(timestamp || !isUser && (message.model || totalTokens)) && /* @__PURE__ */ jsxs("span", {
|
|
335
|
-
className:
|
|
326
|
+
className: cx("chat-meta flex items-center gap-2 ml-2 text-xs tabular-nums theme-muted-text transition-opacity duration-150 select-none", showActions ? "opacity-100" : "opacity-0"),
|
|
336
327
|
children: [
|
|
337
|
-
|
|
338
|
-
title: timestamp.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS),
|
|
339
|
-
children: timestamp.toRelative()
|
|
340
|
-
}),
|
|
328
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: timestamp }),
|
|
341
329
|
!isUser && message.model && /* @__PURE__ */ jsx("span", { children: message.model }),
|
|
342
330
|
!isUser && totalTokens ? /* @__PURE__ */ jsx("span", {
|
|
343
331
|
title: message.tokensUsed?.prompt_tokens !== void 0 && message.tokensUsed?.completion_tokens !== void 0 ? t.tokensBreakdown(message.tokensUsed.prompt_tokens, message.tokensUsed.completion_tokens) : void 0,
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { CheckIcon, ClockIcon } from "../../icons.js";
|
|
3
|
+
import { useStrings } from "../../components/Provider.js";
|
|
4
|
+
import { formatDuration } from "../../format.js";
|
|
5
|
+
import { useElapsed } from "../../components/relativeTime.js";
|
|
4
6
|
import { useChatConfig } from "../core/config.js";
|
|
5
7
|
import { useChat } from "../core/ChatProvider.js";
|
|
6
8
|
import Markdown from "../ui/Markdown.js";
|
|
7
|
-
import {
|
|
9
|
+
import { Reasoning, ReasoningBody } from "./Reasoning.js";
|
|
8
10
|
import AgentMessageParts from "./agent/AgentMessageParts.js";
|
|
9
11
|
import ChatMessage_default from "./ChatMessage.js";
|
|
10
|
-
import { clsx } from "clsx";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
13
|
-
import { Duration } from "luxon";
|
|
14
14
|
//#region src/ai/components/ChatMessageList.tsx
|
|
15
15
|
function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessages, onRemoveQueued, canRemoveQueued, queueDelivery = "afterReply", editingMessageId, showAuthor, currentUsername, onNavigateBranch, onEditMessage, onSaveEdit, onCancelEdit, onRegenerateMessage, onRetryMessage, onOpenReasoning, onApprovalAnswer, inputElement, isStreaming: isStreamingProp, flush, label, footer, workingIndicator = true }) {
|
|
16
16
|
const { adapter, isStreaming: providerStreaming, isThinking, streamingReasoning, streamingParts, thinkingStartTime } = useChat();
|
|
17
17
|
const isStreaming = isStreamingProp ?? providerStreaming;
|
|
18
18
|
const { strings } = useChatConfig();
|
|
19
|
+
const { common } = useStrings();
|
|
19
20
|
const tThinking = strings.thinking;
|
|
20
21
|
const attachmentDownloadUrl = useMemo(() => {
|
|
21
22
|
const attachments = adapter.attachments;
|
|
@@ -38,7 +39,6 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
38
39
|
const messageCount = messages.length;
|
|
39
40
|
const streamingContent = streamingMessage?.content;
|
|
40
41
|
const streamingMessageParts = streamingMessage?.parts;
|
|
41
|
-
const [elapsedTime, setElapsedTime] = useState(0);
|
|
42
42
|
const [finalThinkingDuration, setFinalThinkingDuration] = useState(null);
|
|
43
43
|
const [reasoningOpen, setReasoningOpen] = useState(false);
|
|
44
44
|
const wasThinkingRef = useRef(false);
|
|
@@ -58,16 +58,6 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
58
58
|
setReasoningOpen(false);
|
|
59
59
|
}
|
|
60
60
|
}, [isStreaming]);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (!thinkingStartTime || !isThinking) {
|
|
63
|
-
setElapsedTime(0);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const interval = setInterval(() => {
|
|
67
|
-
setElapsedTime(Math.floor((Date.now() - thinkingStartTime) / 1e3));
|
|
68
|
-
}, 1e3);
|
|
69
|
-
return () => clearInterval(interval);
|
|
70
|
-
}, [thinkingStartTime, isThinking]);
|
|
71
61
|
useEffect(() => {
|
|
72
62
|
if (reasoningScrollRef.current && isThinking) reasoningScrollRef.current.scrollTop = reasoningScrollRef.current.scrollHeight;
|
|
73
63
|
}, [streamingReasoning, isThinking]);
|
|
@@ -151,7 +141,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
151
141
|
children: [
|
|
152
142
|
/* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
153
143
|
footer && /* @__PURE__ */ jsx("div", {
|
|
154
|
-
className:
|
|
144
|
+
className: cx("w-full max-w-[var(--chat-column,50rem)] mx-auto", !flush && "px-4"),
|
|
155
145
|
children: footer
|
|
156
146
|
}),
|
|
157
147
|
inputElement && /* @__PURE__ */ jsx("div", {
|
|
@@ -201,31 +191,37 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
201
191
|
}),
|
|
202
192
|
isStreaming && streamingReasoning && /* @__PURE__ */ jsx("div", {
|
|
203
193
|
className: "animate-chat-enter",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
className:
|
|
206
|
-
children:
|
|
207
|
-
|
|
194
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
195
|
+
className: cx("pt-3", !flush && "px-4"),
|
|
196
|
+
children: /* @__PURE__ */ jsx(Reasoning, {
|
|
197
|
+
label: /* @__PURE__ */ jsx(ThinkingLabel, {
|
|
198
|
+
startedAt: isThinking ? thinkingStartTime : void 0,
|
|
199
|
+
finalDuration: finalThinkingDuration
|
|
200
|
+
}),
|
|
208
201
|
shimmer: isThinking,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
children: streamingReasoning
|
|
202
|
+
open: reasoningOpen,
|
|
203
|
+
onOpenChange: setReasoningOpen,
|
|
204
|
+
onOpenPanel: onOpenReasoning && (() => onOpenReasoning(streamingReasoning, finalThinkingDuration)),
|
|
205
|
+
preview: isThinking && /* @__PURE__ */ jsx(ReasoningBody, {
|
|
206
|
+
className: "chat-reasoning-tail",
|
|
207
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
208
|
+
ref: reasoningScrollRef,
|
|
209
|
+
className: "max-h-20 overflow-y-hidden",
|
|
210
|
+
children: /* @__PURE__ */ jsx(Markdown, {
|
|
211
|
+
isStreaming: true,
|
|
212
|
+
children: streamingReasoning
|
|
213
|
+
})
|
|
222
214
|
})
|
|
215
|
+
}),
|
|
216
|
+
children: /* @__PURE__ */ jsx(Markdown, {
|
|
217
|
+
isStreaming: isThinking,
|
|
218
|
+
children: streamingReasoning
|
|
223
219
|
})
|
|
224
|
-
})
|
|
220
|
+
})
|
|
225
221
|
})
|
|
226
222
|
}, "thinking"),
|
|
227
223
|
isStreaming && streamingParts.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
228
|
-
className:
|
|
224
|
+
className: cx("animate-chat-enter py-1", !flush && "px-4"),
|
|
229
225
|
children: /* @__PURE__ */ jsx(AgentMessageParts, {
|
|
230
226
|
message: {
|
|
231
227
|
id: "streaming-parts",
|
|
@@ -238,7 +234,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
238
234
|
showWorkingIndicator && /* @__PURE__ */ jsx("div", {
|
|
239
235
|
className: "animate-chat-enter",
|
|
240
236
|
children: /* @__PURE__ */ jsx("div", {
|
|
241
|
-
className:
|
|
237
|
+
className: cx("py-3", !flush && "px-4"),
|
|
242
238
|
children: /* @__PURE__ */ jsx("div", {
|
|
243
239
|
className: "animate-shimmer text-shimmer text-sm",
|
|
244
240
|
children: tThinking.ellipsis
|
|
@@ -261,7 +257,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
261
257
|
const removable = canRemoveQueued?.(msg.id) ?? true;
|
|
262
258
|
const status = !removable ? strings.queue.handedOver : queueDelivery === "nextStep" ? strings.queue.waitingNextStep : strings.queue.waiting;
|
|
263
259
|
return /* @__PURE__ */ jsxs("div", {
|
|
264
|
-
className:
|
|
260
|
+
className: cx("animate-chat-enter", removable && "chat-queued"),
|
|
265
261
|
children: [/* @__PURE__ */ jsx(ChatMessage_default, {
|
|
266
262
|
message: msg,
|
|
267
263
|
allMessages,
|
|
@@ -270,9 +266,9 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
270
266
|
onOpenAttachment
|
|
271
267
|
}), /* @__PURE__ */ jsxs("div", {
|
|
272
268
|
"data-testid": "queued-status",
|
|
273
|
-
className:
|
|
269
|
+
className: cx("-mt-4 mb-2 flex items-center justify-end gap-2 text-xs theme-muted-text", !flush && "px-4"),
|
|
274
270
|
children: [
|
|
275
|
-
removable ? /* @__PURE__ */ jsx(
|
|
271
|
+
removable ? /* @__PURE__ */ jsx(ClockIcon, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(CheckIcon, { className: "h-3 w-3" }),
|
|
276
272
|
/* @__PURE__ */ jsx("span", { children: status }),
|
|
277
273
|
onRemoveQueued && removable && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
278
274
|
"aria-hidden": "true",
|
|
@@ -282,7 +278,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
282
278
|
"aria-label": strings.queue.remove,
|
|
283
279
|
onClick: () => onRemoveQueued(msg.id),
|
|
284
280
|
className: "rounded font-medium underline-offset-2 hover:theme-text hover:underline",
|
|
285
|
-
children:
|
|
281
|
+
children: common.remove
|
|
286
282
|
})] })
|
|
287
283
|
]
|
|
288
284
|
})]
|
|
@@ -311,5 +307,13 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
311
307
|
]
|
|
312
308
|
});
|
|
313
309
|
}
|
|
310
|
+
/** "Thinking (12s)" while it thinks, then how long it took. Its own component,
|
|
311
|
+
* so the clock re-renders only this label, not the list. */
|
|
312
|
+
function ThinkingLabel({ startedAt, finalDuration }) {
|
|
313
|
+
const t = useChatConfig().strings.thinking;
|
|
314
|
+
const elapsed = useElapsed(startedAt);
|
|
315
|
+
if (startedAt) return elapsed ? `${t.label} (${formatDuration(elapsed)})` : t.ellipsis;
|
|
316
|
+
return t.thoughtFor(formatDuration(finalDuration ?? 0));
|
|
317
|
+
}
|
|
314
318
|
//#endregion
|
|
315
319
|
export { ChatMessageList as default };
|