@parallelworks/ui 0.40.1 → 0.42.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 +25 -0
- package/dist/ai/adapter/memoryStore.js +7 -0
- package/dist/ai/adapter/mock/mockAdapter.js +52 -17
- package/dist/ai/adapter/openai/createOpenAIStream.js +1 -1
- package/dist/ai/adapter/openai/index.d.ts +1 -1
- package/dist/ai/adapter/openai/sse.d.ts +8 -2
- package/dist/ai/adapter/openai/sse.js +40 -4
- package/dist/ai/adapter/openai/wire.d.ts +6 -0
- package/dist/ai/components/AllocationSelector.d.ts +3 -4
- package/dist/ai/components/AllocationSelector.js +37 -33
- package/dist/ai/components/AttachmentManager.js +7 -7
- package/dist/ai/components/AttachmentUpload.js +5 -5
- package/dist/ai/components/BranchNavigator.js +1 -1
- package/dist/ai/components/ChatEmptyState.js +2 -2
- package/dist/ai/components/ChatInput.js +10 -8
- package/dist/ai/components/ChatLayout.js +4 -5
- package/dist/ai/components/ChatMessage.js +12 -12
- package/dist/ai/components/ChatMessageList.js +9 -9
- package/dist/ai/components/ChatSidebar.js +8 -9
- package/dist/ai/components/ChatThread.js +4 -4
- package/dist/ai/components/ComposerChrome.d.ts +2 -2
- package/dist/ai/components/ComposerChrome.js +3 -6
- package/dist/ai/components/DragOverlay.js +2 -2
- package/dist/ai/components/ModelSelector.d.ts +5 -3
- package/dist/ai/components/ModelSelector.js +102 -339
- package/dist/ai/components/PastedText.js +11 -11
- package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
- package/dist/ai/components/ProviderIssueBanner.js +34 -16
- package/dist/ai/components/Reasoning.js +4 -4
- package/dist/ai/components/ShareDialog.js +43 -35
- package/dist/ai/components/SlashMenu.d.ts +12 -2
- package/dist/ai/components/SlashMenu.js +29 -13
- package/dist/ai/components/agent/ActivityLine.js +3 -3
- package/dist/ai/components/agent/AgentMessageParts.js +20 -20
- package/dist/ai/components/agent/PermissionPicker.js +13 -11
- package/dist/ai/components/conversationActions.d.ts +4 -6
- package/dist/ai/components/conversationActions.js +9 -13
- package/dist/ai/core/ChatProvider.js +4 -4
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/core/parts.d.ts +5 -0
- package/dist/ai/core/parts.js +28 -1
- package/dist/ai/core/providerIssues.d.ts +7 -0
- package/dist/ai/core/providerIssues.js +9 -1
- package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
- package/dist/ai/core/useKeyboardShortcuts.js +8 -2
- package/dist/ai/index.d.ts +0 -1
- package/dist/ai/index.js +1 -2
- package/dist/ai/strings.d.ts +19 -0
- package/dist/ai/strings.js +18 -1
- package/dist/ai/ui/Avatar.js +5 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
- package/dist/ai/ui/ConversationSidebar.js +6 -7
- package/dist/ai/ui/Markdown.js +3 -3
- package/dist/ai/ui/Notice.js +6 -6
- package/dist/ai/ui/chip.d.ts +4 -0
- package/dist/ai/ui/chip.js +8 -0
- package/dist/ai/ui/sidebar.d.ts +6 -5
- package/dist/ai/ui/sidebar.js +39 -43
- package/dist/components/ActionMenu.d.ts +13 -0
- package/dist/components/ActionMenu.js +30 -0
- package/dist/components/Avatar.js +6 -6
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Button.js +10 -10
- package/dist/components/Callout.js +2 -2
- package/dist/components/Card.js +3 -3
- package/dist/components/Combobox.d.ts +66 -0
- package/dist/components/Combobox.js +393 -0
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +23 -0
- package/dist/components/ContextMenu.js +89 -0
- package/dist/components/CopyToClipboard.js +2 -2
- package/dist/components/CreateModal.d.ts +17 -36
- package/dist/components/CreateModal.js +97 -259
- package/dist/components/DescriptionList.js +8 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/FilterPill.js +2 -2
- package/dist/components/HoverCard.d.ts +14 -0
- package/dist/components/HoverCard.js +33 -0
- package/dist/components/IconButton.d.ts +5 -5
- package/dist/components/IconButton.js +18 -22
- package/dist/components/InfoTip.d.ts +15 -0
- package/dist/components/InfoTip.js +60 -0
- package/dist/components/Input.js +5 -5
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.js +3 -3
- package/dist/components/Markdown.js +1 -1
- package/dist/components/MarkdownImpl.js +2 -2
- package/dist/components/Menu.d.ts +33 -0
- package/dist/components/Menu.js +86 -0
- package/dist/components/MenuEntries.d.ts +56 -0
- package/dist/components/MenuEntries.js +123 -0
- package/dist/components/Modal.d.ts +29 -0
- package/dist/components/Modal.js +47 -0
- package/dist/components/Overview.js +11 -10
- package/dist/components/PageHeader.d.ts +10 -16
- package/dist/components/PageHeader.js +69 -95
- package/dist/components/Pagination.js +5 -5
- package/dist/components/Provider.d.ts +5 -11
- package/dist/components/Provider.js +11 -14
- package/dist/components/Radio.d.ts +8 -0
- package/dist/components/Radio.js +16 -0
- package/dist/components/SectionHeader.js +2 -2
- package/dist/components/SegmentedControl.d.ts +6 -5
- package/dist/components/SegmentedControl.js +34 -30
- package/dist/components/Select.d.ts +27 -0
- package/dist/components/Select.js +78 -0
- package/dist/components/SettingModeOption.d.ts +5 -8
- package/dist/components/SettingModeOption.js +10 -12
- package/dist/components/SettingRow.js +4 -4
- package/dist/components/SettingsCard.js +4 -4
- package/dist/components/SettingsGroup.js +2 -2
- package/dist/components/Sort.js +1 -1
- package/dist/components/StatusBadge.js +7 -7
- package/dist/components/StatusIcons.js +4 -4
- package/dist/components/Switch.d.ts +22 -0
- package/dist/components/Switch.js +28 -0
- package/dist/components/Table.js +11 -11
- package/dist/components/Tooltip.d.ts +24 -20
- package/dist/components/Tooltip.js +58 -76
- package/dist/components/floating.d.ts +14 -0
- package/dist/components/floating.js +21 -0
- package/dist/components/search.d.ts +2 -0
- package/dist/components/search.js +14 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.js +16 -21
- package/dist/editor/FormCodePanel.js +19 -19
- package/dist/editor/Monaco.js +3 -3
- package/dist/file-explorer/FileExplorer.js +77 -81
- package/dist/file-explorer/FileExplorerContext.js +2 -2
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
- package/dist/file-explorer/FilePreview/Inline.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
- package/dist/file-explorer/FilePreview/Viewer.js +8 -8
- package/dist/file-explorer/FilePreview/index.d.ts +1 -1
- package/dist/file-explorer/FilePreview/index.js +49 -83
- package/dist/file-explorer/FileRow.d.ts +4 -3
- package/dist/file-explorer/FileRow.js +32 -38
- package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
- package/dist/file-explorer/FileRowsWindow.js +4 -4
- package/dist/file-explorer/FileTable.d.ts +3 -2
- package/dist/file-explorer/FileTable.js +3 -3
- package/dist/file-explorer/LoadMoreRow.js +1 -1
- package/dist/file-explorer/TreeView.js +11 -16
- package/dist/file-explorer/helpers.js +11 -12
- package/dist/file-explorer/toasts.js +11 -11
- package/dist/form/FieldGroup.d.ts +11 -0
- package/dist/form/FieldGroup.js +36 -0
- package/dist/form/FieldWrapper.js +4 -4
- package/dist/form/Fields/BooleanField.js +23 -33
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +9 -13
- package/dist/form/Fields/ColorField.d.ts +1 -2
- package/dist/form/Fields/ColorField.js +6 -11
- package/dist/form/Fields/DropdownField.d.ts +3 -13
- package/dist/form/Fields/DropdownField.js +40 -27
- package/dist/form/Fields/DurationField.d.ts +1 -2
- package/dist/form/Fields/DurationField.js +25 -32
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
- package/dist/form/Fields/MultiDropdownField.js +31 -22
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +65 -35
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +12 -43
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +30 -41
- package/dist/form/Fields/RangeField.d.ts +1 -2
- package/dist/form/Fields/RangeField.js +23 -16
- package/dist/form/Fields/StringField.d.ts +1 -2
- package/dist/form/Fields/StringField.js +58 -26
- package/dist/form/Fields/TextAreaField.js +12 -10
- package/dist/form/Form.d.ts +30 -48
- package/dist/form/Form.js +306 -412
- package/dist/form/FormLayout.js +9 -9
- package/dist/form/Wizard/WizardContainer.d.ts +1 -4
- package/dist/form/Wizard/WizardContainer.js +40 -56
- package/dist/form/Wizard/WizardNavigation.js +1 -1
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
- package/dist/form/Wizard/WizardStepContent.js +11 -16
- package/dist/form/Wizard/WizardStepIndicator.js +6 -6
- package/dist/form/Wizard/types.d.ts +0 -14
- package/dist/form/fieldRegistry.d.ts +1 -1
- package/dist/form/fieldRegistry.js +6 -6
- package/dist/form/formEditing.js +1 -1
- package/dist/form/index.d.ts +5 -4
- package/dist/form/index.js +6 -7
- package/dist/form/types/fieldComponentTypes.d.ts +8 -10
- package/dist/form/useChoiceField.d.ts +20 -0
- package/dist/form/useChoiceField.js +49 -0
- package/dist/form/useFieldValue.d.ts +7 -0
- package/dist/form/useFieldValue.js +20 -0
- package/dist/form/useParsedOpts.d.ts +3 -1
- package/dist/form/useParsedOpts.js +12 -17
- package/dist/form/utils/dependentOptions.d.ts +8 -4
- package/dist/form/utils/dependentOptions.js +25 -17
- package/dist/form/utils/fieldItems.d.ts +10 -0
- package/dist/form/utils/fieldItems.js +11 -0
- package/dist/form/utils/fieldPath.d.ts +10 -0
- package/dist/form/utils/fieldPath.js +20 -0
- package/dist/form/utils/shareEqual.d.ts +6 -0
- package/dist/form/utils/shareEqual.js +38 -0
- package/dist/graph/AnnotationBanner.js +8 -8
- package/dist/graph/Collapse.d.ts +1 -0
- package/dist/graph/Collapse.js +6 -27
- package/dist/graph/Connectors.js +5 -5
- package/dist/graph/DependencyGraph.js +20 -19
- package/dist/graph/GraphEditor.js +30 -41
- package/dist/graph/GraphEditorDialogs.js +17 -17
- package/dist/graph/GraphNode.js +1 -1
- package/dist/graph/InputDialog.js +19 -22
- package/dist/graph/InputsEditor.js +58 -66
- package/dist/graph/JobSummary.js +42 -39
- package/dist/graph/MatrixGroup.js +1 -1
- package/dist/graph/ProblemsButton.js +18 -19
- package/dist/graph/Reveal.js +1 -1
- package/dist/graph/ShortcutsButton.js +15 -18
- package/dist/graph/SuggestionInput.d.ts +5 -10
- package/dist/graph/SuggestionInput.js +14 -18
- package/dist/graph/ToolbarPopover.d.ts +11 -6
- package/dist/graph/ToolbarPopover.js +35 -67
- package/dist/graph/TreeView.js +24 -37
- package/dist/graph/WorkflowSettingsDialog.js +4 -4
- package/dist/graph/editorChrome.js +13 -12
- package/dist/graph/editorFields.js +29 -29
- package/dist/graph/editorPrimitives.d.ts +1 -1
- package/dist/graph/editorPrimitives.js +10 -7
- package/dist/graph/editorRows.js +103 -97
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -3
- package/dist/graph/inputRefs.js +9 -9
- package/dist/graph/settingsViews.js +6 -7
- package/dist/graph/stepWith.js +6 -6
- package/dist/index.d.ts +14 -15
- package/dist/index.js +15 -14
- package/dist/list/ActionToolbar.d.ts +6 -14
- package/dist/list/ActionToolbar.js +48 -96
- package/dist/list/ListPage.d.ts +6 -12
- package/dist/list/ListPage.js +46 -29
- package/dist/list/ListPager.js +4 -4
- package/dist/list/ListTable.js +5 -5
- package/dist/list/ListViewControls.d.ts +5 -4
- package/dist/list/ListViewControls.js +177 -267
- package/dist/list/UserHoverCard.d.ts +3 -17
- package/dist/list/UserHoverCard.js +21 -45
- package/dist/list/index.d.ts +3 -4
- package/dist/list/index.js +3 -4
- package/dist/list/listSearch.js +12 -11
- package/dist/list/rowMenu.d.ts +63 -0
- package/dist/list/rowMenu.js +134 -0
- package/dist/logviewer/LogViewer.js +26 -26
- package/dist/styles.css +1 -1
- package/package.json +7 -13
- package/dist/ai/ui/Dropdown.d.ts +0 -31
- package/dist/ai/ui/Dropdown.js +0 -110
- package/dist/components/AddMenu.d.ts +0 -18
- package/dist/components/AddMenu.js +0 -46
- package/dist/components/BareModal.d.ts +0 -17
- package/dist/components/BareModal.js +0 -77
- package/dist/components/CollapsiblePanel.d.ts +0 -27
- package/dist/components/CollapsiblePanel.js +0 -77
- package/dist/components/Dropdown.d.ts +0 -28
- package/dist/components/Dropdown.js +0 -355
- package/dist/components/Listbox.d.ts +0 -21
- package/dist/components/Listbox.js +0 -119
- package/dist/components/MultiSelect.d.ts +0 -22
- package/dist/components/MultiSelect.js +0 -168
- package/dist/components/SwitchToggle.d.ts +0 -15
- package/dist/components/SwitchToggle.js +0 -57
- package/dist/components/SwitchToggleSmall.d.ts +0 -6
- package/dist/components/SwitchToggleSmall.js +0 -14
- package/dist/components/Toggle.d.ts +0 -6
- package/dist/components/Toggle.js +0 -20
- package/dist/components/dropdownUtils.d.ts +0 -37
- package/dist/components/dropdownUtils.js +0 -99
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
- package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
- package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
- package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
- package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
- package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
- package/dist/form/SpecialTypes/index.d.ts +0 -3
- package/dist/list/HoverCard.d.ts +0 -24
- package/dist/list/HoverCard.js +0 -73
- package/dist/list/RowContextMenu.d.ts +0 -127
- package/dist/list/RowContextMenu.js +0 -515
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { safeUrl } from "../../safeUrl.js";
|
|
2
1
|
import { BiError } from "../../icons/bi/BiError.js";
|
|
3
2
|
import { FaCheck } from "../../icons/fa/FaCheck.js";
|
|
4
3
|
import { FaEdit } from "../../icons/fa/FaEdit.js";
|
|
@@ -7,6 +6,7 @@ import { FiCopy } from "../../icons/fi/FiCopy.js";
|
|
|
7
6
|
import { FiDownload } from "../../icons/fi/FiDownload.js";
|
|
8
7
|
import { FiFile } from "../../icons/fi/FiFile.js";
|
|
9
8
|
import { MdRefresh } from "../../icons/md/MdRefresh.js";
|
|
9
|
+
import { safeUrl } from "../../safeUrl.js";
|
|
10
10
|
import { durationToAbsHumanDuration } from "../../duration.js";
|
|
11
11
|
import { useChatConfig } from "../core/config.js";
|
|
12
12
|
import { formatFileSize } from "../utils.js";
|
|
@@ -17,9 +17,9 @@ import AgentMessageParts from "./agent/AgentMessageParts.js";
|
|
|
17
17
|
import BranchNavigator from "./BranchNavigator.js";
|
|
18
18
|
import { UserMessageText } from "./PastedText.js";
|
|
19
19
|
import { Avatar } from "../ui/Avatar.js";
|
|
20
|
-
import
|
|
21
|
-
import { memo, useEffect, useRef, useState } from "react";
|
|
20
|
+
import { clsx } from "clsx";
|
|
22
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { memo, useEffect, useRef, useState } from "react";
|
|
23
23
|
import { DateTime, Duration } from "luxon";
|
|
24
24
|
//#region src/ai/components/ChatMessage.tsx
|
|
25
25
|
function formatDuration(ms) {
|
|
@@ -102,7 +102,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
102
102
|
};
|
|
103
103
|
const hasParts = !!message.parts?.length;
|
|
104
104
|
if (hasParts && !message.content) return /* @__PURE__ */ jsx("div", {
|
|
105
|
-
className:
|
|
105
|
+
className: clsx("group py-3 w-full", !flush && "px-4"),
|
|
106
106
|
children: /* @__PURE__ */ jsx(AgentMessageParts, {
|
|
107
107
|
message,
|
|
108
108
|
isStreaming,
|
|
@@ -123,7 +123,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
123
123
|
};
|
|
124
124
|
return /* @__PURE__ */ jsx("div", {
|
|
125
125
|
role: "none",
|
|
126
|
-
className:
|
|
126
|
+
className: clsx("group w-full", isUser ? "pt-8 pb-5" : "py-3", !flush && "px-4"),
|
|
127
127
|
onMouseEnter: () => setShowActions(true),
|
|
128
128
|
onMouseLeave: () => setShowActions(false),
|
|
129
129
|
onFocus: () => setShowActions(true),
|
|
@@ -153,9 +153,9 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
153
153
|
})]
|
|
154
154
|
})]
|
|
155
155
|
}) : /* @__PURE__ */ jsx("div", {
|
|
156
|
-
className:
|
|
156
|
+
className: clsx("flex gap-3 w-full", isRightAligned ? "flex-row-reverse" : "flex-row"),
|
|
157
157
|
children: /* @__PURE__ */ jsxs("div", {
|
|
158
|
-
className:
|
|
158
|
+
className: clsx("flex-1 min-w-0 space-y-1", isRightAligned && "relative flex flex-col items-end"),
|
|
159
159
|
children: [
|
|
160
160
|
showReasoningButton && /* @__PURE__ */ jsxs("div", {
|
|
161
161
|
className: "mb-2",
|
|
@@ -191,21 +191,21 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
191
191
|
name: otherAuthor.name || otherAuthor.username,
|
|
192
192
|
className: "flex-shrink-0 mb-0.5"
|
|
193
193
|
}), /* @__PURE__ */ jsx("div", {
|
|
194
|
-
className:
|
|
194
|
+
className: clsx("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
195
|
children: /* @__PURE__ */ jsx(UserMessageText, {
|
|
196
196
|
content: message.content,
|
|
197
197
|
pastes: message.pastes
|
|
198
198
|
})
|
|
199
199
|
})]
|
|
200
200
|
}) : isUser ? /* @__PURE__ */ jsx("div", {
|
|
201
|
-
className:
|
|
201
|
+
className: clsx("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
202
|
children: /* @__PURE__ */ jsx(UserMessageText, {
|
|
203
203
|
content: message.content,
|
|
204
204
|
pastes: message.pastes
|
|
205
205
|
})
|
|
206
206
|
}) : /* @__PURE__ */ jsx("div", {
|
|
207
207
|
ref: contentRef,
|
|
208
|
-
className:
|
|
208
|
+
className: clsx(chatProseClasses, collapsed && "chat-message-clamp"),
|
|
209
209
|
children: /* @__PURE__ */ jsx(Markdown, {
|
|
210
210
|
isStreaming,
|
|
211
211
|
children: message.content
|
|
@@ -303,7 +303,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
303
303
|
})
|
|
304
304
|
}),
|
|
305
305
|
!isStreaming && !isEditing && /* @__PURE__ */ jsxs("div", {
|
|
306
|
-
className:
|
|
306
|
+
className: clsx("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
307
|
children: [
|
|
308
308
|
/* @__PURE__ */ jsx("button", {
|
|
309
309
|
type: "button",
|
|
@@ -332,7 +332,7 @@ function ChatMessage({ message, allMessages, isStreaming = false, latest = false
|
|
|
332
332
|
onNavigate: onNavigateBranch
|
|
333
333
|
}),
|
|
334
334
|
(timestamp || !isUser && (message.model || totalTokens)) && /* @__PURE__ */ jsxs("span", {
|
|
335
|
-
className:
|
|
335
|
+
className: clsx("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
336
|
children: [
|
|
337
337
|
timestamp && /* @__PURE__ */ jsx("span", {
|
|
338
338
|
title: timestamp.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS),
|
|
@@ -7,9 +7,9 @@ import Markdown from "../ui/Markdown.js";
|
|
|
7
7
|
import { ReasoningBody, ReasoningToggle } from "./Reasoning.js";
|
|
8
8
|
import AgentMessageParts from "./agent/AgentMessageParts.js";
|
|
9
9
|
import ChatMessage_default from "./ChatMessage.js";
|
|
10
|
-
import
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
12
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
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 }) {
|
|
@@ -151,7 +151,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
151
151
|
children: [
|
|
152
152
|
/* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
153
153
|
footer && /* @__PURE__ */ jsx("div", {
|
|
154
|
-
className:
|
|
154
|
+
className: clsx("w-full max-w-[var(--chat-column,50rem)] mx-auto", !flush && "px-4"),
|
|
155
155
|
children: footer
|
|
156
156
|
}),
|
|
157
157
|
inputElement && /* @__PURE__ */ jsx("div", {
|
|
@@ -202,7 +202,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
202
202
|
isStreaming && streamingReasoning && /* @__PURE__ */ jsx("div", {
|
|
203
203
|
className: "animate-chat-enter",
|
|
204
204
|
children: /* @__PURE__ */ jsxs("div", {
|
|
205
|
-
className:
|
|
205
|
+
className: clsx("pt-3", !flush && "px-4"),
|
|
206
206
|
children: [/* @__PURE__ */ jsx(ReasoningToggle, {
|
|
207
207
|
open: reasoningOpen,
|
|
208
208
|
shimmer: isThinking,
|
|
@@ -225,7 +225,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
225
225
|
})
|
|
226
226
|
}, "thinking"),
|
|
227
227
|
isStreaming && streamingParts.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
228
|
-
className:
|
|
228
|
+
className: clsx("animate-chat-enter py-1", !flush && "px-4"),
|
|
229
229
|
children: /* @__PURE__ */ jsx(AgentMessageParts, {
|
|
230
230
|
message: {
|
|
231
231
|
id: "streaming-parts",
|
|
@@ -238,7 +238,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
238
238
|
showWorkingIndicator && /* @__PURE__ */ jsx("div", {
|
|
239
239
|
className: "animate-chat-enter",
|
|
240
240
|
children: /* @__PURE__ */ jsx("div", {
|
|
241
|
-
className:
|
|
241
|
+
className: clsx("py-3", !flush && "px-4"),
|
|
242
242
|
children: /* @__PURE__ */ jsx("div", {
|
|
243
243
|
className: "animate-shimmer text-shimmer text-sm",
|
|
244
244
|
children: tThinking.ellipsis
|
|
@@ -261,7 +261,7 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
261
261
|
const removable = canRemoveQueued?.(msg.id) ?? true;
|
|
262
262
|
const status = !removable ? strings.queue.handedOver : queueDelivery === "nextStep" ? strings.queue.waitingNextStep : strings.queue.waiting;
|
|
263
263
|
return /* @__PURE__ */ jsxs("div", {
|
|
264
|
-
className:
|
|
264
|
+
className: clsx("animate-chat-enter", removable && "chat-queued"),
|
|
265
265
|
children: [/* @__PURE__ */ jsx(ChatMessage_default, {
|
|
266
266
|
message: msg,
|
|
267
267
|
allMessages,
|
|
@@ -270,11 +270,11 @@ function ChatMessageList({ messages, allMessages, streamingMessage, queuedMessag
|
|
|
270
270
|
onOpenAttachment
|
|
271
271
|
}), /* @__PURE__ */ jsxs("div", {
|
|
272
272
|
"data-testid": "queued-status",
|
|
273
|
-
className:
|
|
273
|
+
className: clsx("-mt-4 mb-2 flex items-center justify-end gap-2 text-xs theme-muted-text", !flush && "px-4"),
|
|
274
274
|
children: [
|
|
275
275
|
removable ? /* @__PURE__ */ jsx(FiClock, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(FaCheck, { className: "h-3 w-3" }),
|
|
276
276
|
/* @__PURE__ */ jsx("span", { children: status }),
|
|
277
|
-
onRemoveQueued && removable && /* @__PURE__ */ jsxs(Fragment
|
|
277
|
+
onRemoveQueued && removable && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
278
278
|
"aria-hidden": "true",
|
|
279
279
|
children: "·"
|
|
280
280
|
}), /* @__PURE__ */ jsx("button", {
|
|
@@ -10,9 +10,9 @@ import { FOCUS_SIDEBAR_SEARCH_EVENT } from "../core/events.js";
|
|
|
10
10
|
import { SidebarPlaceholder, SidebarRow, SidebarRowTitle } from "../ui/sidebar.js";
|
|
11
11
|
import { ConversationSidebar } from "../ui/ConversationSidebar.js";
|
|
12
12
|
import { groupConversationsByDate, useConversationActions } from "./conversationActions.js";
|
|
13
|
-
import
|
|
13
|
+
import { clsx } from "clsx";
|
|
14
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
15
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
//#region src/ai/components/ChatSidebar.tsx
|
|
17
17
|
function ConversationRow({ conv, isCurrent, updated, menuItems, openMenu, onOpen }) {
|
|
18
18
|
const { LinkComponent, strings } = useChatConfig();
|
|
@@ -91,8 +91,7 @@ function ChatSidebar({ actions = true, top }) {
|
|
|
91
91
|
drawer: drawer ? {
|
|
92
92
|
open: drawerOpen,
|
|
93
93
|
onClose: closeDrawer,
|
|
94
|
-
label: tSidebar.drawerLabel
|
|
95
|
-
closeLabel: tSidebar.closeSidebar
|
|
94
|
+
label: tSidebar.drawerLabel
|
|
96
95
|
} : void 0,
|
|
97
96
|
onToggle: toggleSidebar,
|
|
98
97
|
toggleLabels: {
|
|
@@ -119,15 +118,15 @@ function ChatSidebar({ actions = true, top }) {
|
|
|
119
118
|
current: filteredConversations.find((conv) => conv.id === activeConversationId),
|
|
120
119
|
onSelect: (conv) => navigation.toConversation(conv.id)
|
|
121
120
|
},
|
|
122
|
-
top: (top || actions) && /* @__PURE__ */ jsxs(Fragment
|
|
121
|
+
top: (top || actions) && /* @__PURE__ */ jsxs(Fragment, { children: [top?.({ collapsed: sidebarCollapsed }), actions && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
123
122
|
className: "flex flex-col gap-0.5 px-2 pt-2 pb-1",
|
|
124
123
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
125
124
|
type: "button",
|
|
126
125
|
onClick: handleNewChat,
|
|
127
126
|
className: "flex items-center h-9 px-2 gap-3 rounded-lg font-medium transition-colors hover:chat-tint",
|
|
128
127
|
title: tSidebar.newChat,
|
|
129
|
-
children: [/* @__PURE__ */ jsx(TbEdit, { className:
|
|
130
|
-
className:
|
|
128
|
+
children: [/* @__PURE__ */ jsx(TbEdit, { className: clsx("flex-shrink-0", "w-4 h-4") }), /* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: clsx("text-sm transition-opacity duration-200", sidebarCollapsed ? "opacity-0 w-0 overflow-hidden" : "opacity-100"),
|
|
131
130
|
children: tSidebar.newChat
|
|
132
131
|
})]
|
|
133
132
|
}), attachmentsAvailable && /* @__PURE__ */ jsxs(LinkComponent, {
|
|
@@ -136,7 +135,7 @@ function ChatSidebar({ actions = true, top }) {
|
|
|
136
135
|
title: tSidebar.attachments,
|
|
137
136
|
onClick: closeDrawer,
|
|
138
137
|
children: [/* @__PURE__ */ jsx(FaRegFileImage, { className: "flex-shrink-0 w-4 h-4" }), /* @__PURE__ */ jsx("span", {
|
|
139
|
-
className:
|
|
138
|
+
className: clsx("text-sm transition-opacity duration-200", sidebarCollapsed ? "opacity-0 w-0 overflow-hidden" : "opacity-100"),
|
|
140
139
|
children: tSidebar.attachments
|
|
141
140
|
})]
|
|
142
141
|
})]
|
|
@@ -163,7 +162,7 @@ function ChatSidebar({ actions = true, top }) {
|
|
|
163
162
|
})] })] }),
|
|
164
163
|
footer: /* @__PURE__ */ jsx(ManageProvidersLink, {})
|
|
165
164
|
});
|
|
166
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
165
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [(drawer || sidebar !== "hidden") && list, overlays] });
|
|
167
166
|
}
|
|
168
167
|
//#endregion
|
|
169
168
|
export { ChatSidebar as default };
|
|
@@ -8,8 +8,8 @@ import ChatInput from "./ChatInput.js";
|
|
|
8
8
|
import ProviderIssueBanner from "./ProviderIssueBanner.js";
|
|
9
9
|
import { ShareButton } from "./ShareDialog.js";
|
|
10
10
|
import ChatMessageList from "./ChatMessageList.js";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/ai/components/ChatThread.tsx
|
|
14
14
|
function ChatThread({ conversationId }) {
|
|
15
15
|
const chatInputRef = useRef(null);
|
|
@@ -92,7 +92,7 @@ function ChatThread({ conversationId }) {
|
|
|
92
92
|
disabled: true,
|
|
93
93
|
conversationId,
|
|
94
94
|
settingsLeft: /* @__PURE__ */ jsx(ConnectToolsLink, {}),
|
|
95
|
-
settingsRight: /* @__PURE__ */ jsxs(Fragment
|
|
95
|
+
settingsRight: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ComposerUsage, { children: slots.composerUsage }), /* @__PURE__ */ jsx(ComposerControls, {})] })
|
|
96
96
|
})]
|
|
97
97
|
});
|
|
98
98
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -126,8 +126,8 @@ function ChatThread({ conversationId }) {
|
|
|
126
126
|
placeholder: currentConversation?.canCollaborate === false ? strings.thread.viewOnly : void 0,
|
|
127
127
|
conversationId,
|
|
128
128
|
onEditLastMessage: handleEditLastMessage,
|
|
129
|
-
settingsLeft: /* @__PURE__ */ jsxs(Fragment
|
|
130
|
-
settingsRight: /* @__PURE__ */ jsxs(Fragment
|
|
129
|
+
settingsLeft: /* @__PURE__ */ jsxs(Fragment, { children: [currentConversation?.isOwner !== false && /* @__PURE__ */ jsx(ShareButton, { conversationId }), /* @__PURE__ */ jsx(ConnectToolsLink, {})] }),
|
|
130
|
+
settingsRight: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ComposerUsage, { children: slots.composerUsage }), /* @__PURE__ */ jsx(ComposerControls, {})] })
|
|
131
131
|
})
|
|
132
132
|
})
|
|
133
133
|
]
|
|
@@ -17,8 +17,8 @@ export declare function ComposerSettings({ left, children }: {
|
|
|
17
17
|
export declare function ComposerUsage({ children }: {
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
}): import("react").JSX.Element | null;
|
|
20
|
-
/** The two selectors every surface carries,
|
|
21
|
-
*
|
|
20
|
+
/** The two selectors every surface carries, reading as text beside whatever
|
|
21
|
+
* the surface puts next to them. */
|
|
22
22
|
export declare function ComposerControls({ targetSession }: {
|
|
23
23
|
targetSession?: string | null | undefined;
|
|
24
24
|
}): import("react").JSX.Element;
|
|
@@ -38,13 +38,10 @@ function ComposerUsage({ children }) {
|
|
|
38
38
|
children
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
/** The two selectors every surface carries,
|
|
42
|
-
*
|
|
41
|
+
/** The two selectors every surface carries, reading as text beside whatever
|
|
42
|
+
* the surface puts next to them. */
|
|
43
43
|
function ComposerControls({ targetSession }) {
|
|
44
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ModelSelector, {
|
|
45
|
-
variant: "bare",
|
|
46
|
-
targetSession
|
|
47
|
-
}), /* @__PURE__ */ jsx(AllocationSelector, { variant: "bare" })] });
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ModelSelector, { targetSession }), /* @__PURE__ */ jsx(AllocationSelector, {})] });
|
|
48
45
|
}
|
|
49
46
|
/** Where the reader manages the providers behind the model picker, at the
|
|
50
47
|
* foot of a conversation list. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/ai/components/DragOverlay.tsx
|
|
4
4
|
function DragOverlay({ className }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
|
-
className:
|
|
6
|
+
className: clsx("absolute inset-0 z-50 flex items-center justify-center bg-blue-500/10 border-2 border-dashed border-blue-500 backdrop-blur-sm pointer-events-none", className),
|
|
7
7
|
children: /* @__PURE__ */ jsxs("div", {
|
|
8
8
|
className: "text-center",
|
|
9
9
|
children: [/* @__PURE__ */ jsx("p", {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare function getProviderKeyFromModelId(modelId: string): string;
|
|
2
|
-
|
|
2
|
+
/** Picks the model a conversation runs on, grouped by provider. Sessions that
|
|
3
|
+
* are still connecting or not responding show as headings with their status,
|
|
4
|
+
* so the reader sees why their models are missing. */
|
|
5
|
+
export default function ModelSelector({ targetSession, }: {
|
|
6
|
+
/** A session, as "owner:name", whose models the reader is waiting for. */
|
|
3
7
|
targetSession?: string | null | undefined;
|
|
4
|
-
/** 'bare' drops the border and the icon, for a toolbar that reads as text. */
|
|
5
|
-
variant?: 'default' | 'bare';
|
|
6
8
|
}): import("react").JSX.Element;
|