@openviking/react 0.1.2 → 0.1.4
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/LICENSE.arco-design +21 -0
- package/README.md +25 -15
- package/dist/0~0.js +19 -0
- package/dist/2~0.js +2360 -0
- package/dist/2~0.js.LICENSE.txt +23 -0
- package/dist/3c~0.js +2206 -0
- package/dist/3~0.js +1205 -1982
- package/dist/4~0.js +18 -0
- package/dist/9~0.js +43 -0
- package/dist/ae~0.js +487 -0
- package/dist/ark-message-list-view~0.js +530 -119
- package/dist/a~0.js +1289 -10
- package/dist/c7~0.js +38 -2
- package/dist/ck~0.js +23 -0
- package/dist/client/index.d.ts +2 -1
- package/dist/client/paths.d.ts +64 -0
- package/dist/client/provider.d.ts +5 -3
- package/dist/client/response.d.ts +31 -0
- package/dist/client/sse.d.ts +39 -0
- package/dist/client/stream.d.ts +26 -0
- package/dist/client/types.d.ts +109 -5
- package/dist/client.js +2 -239
- package/dist/components/agent-connect/agent-connect-copy.d.ts +19 -33
- package/dist/components/agent-connect/agent-connect-design.d.ts +1935 -167
- package/dist/components/agent-connect/agent-connect-instructions.d.ts +135 -0
- package/dist/components/agent-connect/locales/en-US.d.ts +20 -0
- package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
- package/dist/components/agent-connect/style.css +14 -2
- package/dist/components/agent-connect/types.d.ts +2 -1
- package/dist/components/directory-tour/directory-tour.d.ts +3 -0
- package/dist/components/directory-tour/index.d.ts +3 -0
- package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
- package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
- package/dist/components/directory-tour/steps.d.ts +5 -0
- package/dist/components/directory-tour/style.css +237 -0
- package/dist/components/directory-tour/style.js +0 -0
- package/dist/components/directory-tour/types.d.ts +42 -0
- package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
- package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
- package/dist/components/directory-tour.js +40 -0
- package/dist/components/file-browser-entries/file-browser-entries-icons.d.ts +18 -0
- package/dist/components/file-browser-entries/file-browser-entries.d.ts +14 -0
- package/dist/components/file-browser-entries/index.d.ts +1 -0
- package/dist/components/file-browser-entries/labels.d.ts +3 -0
- package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
- package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
- package/dist/components/file-browser-entries/style.css +905 -0
- package/dist/components/file-browser-entries/style.js +0 -0
- package/dist/components/file-browser-entries/types.d.ts +63 -0
- package/dist/components/file-browser-entries.js +1 -0
- package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-body.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
- package/dist/components/file-preview/file-preview-directory.d.ts +33 -0
- package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-header.d.ts +25 -3
- package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
- package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
- package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
- package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
- package/dist/components/file-preview/file-preview-panels.d.ts +44 -0
- package/dist/components/file-preview/file-preview-state.d.ts +10 -3
- package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
- package/dist/components/file-preview/file-preview.d.ts +1 -1
- package/dist/components/file-preview/index.d.ts +2 -1
- package/dist/components/file-preview/level-selection.d.ts +25 -0
- package/dist/components/file-preview/locales/en-US.d.ts +16 -0
- package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
- package/dist/components/file-preview/style.css +234 -3
- package/dist/components/file-preview/types.d.ts +134 -11
- package/dist/components/file-preview/use-directory-level.d.ts +30 -0
- package/dist/components/file-preview/use-file-preview-actions-context.d.ts +6 -2
- package/dist/components/file-preview/use-file-preview-actions.d.ts +1 -1
- package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
- package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
- package/dist/components/file-preview.js +1 -1
- package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
- package/dist/components/file-tree/file-tree-info-tooltip.d.ts +7 -7
- package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
- package/dist/components/file-tree/file-tree-row-context.d.ts +0 -5
- package/dist/components/file-tree/file-tree-row-shared.d.ts +1 -4
- package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
- package/dist/components/file-tree/file-tree-tooltip-surface.d.ts +8 -8
- package/dist/components/file-tree/locales/en-US.d.ts +69 -0
- package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
- package/dist/components/file-tree/style.css +207 -42
- package/dist/components/file-tree/types.d.ts +58 -10
- package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
- package/dist/components/scope-switcher/labels.d.ts +3 -0
- package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
- package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
- package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
- package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
- package/dist/components/scope-switcher/style.css +14 -2
- package/dist/components/scope-switcher/types.d.ts +11 -5
- package/dist/components/style.css +10144 -6840
- package/dist/components/tui/locales/en-US.d.ts +35 -0
- package/dist/components/tui/locales/zh-CN.d.ts +35 -0
- package/dist/components/tui/style.css +310 -18
- package/dist/components/tui/tui-copy-button.d.ts +1 -1
- package/dist/components/tui/tui-empty.d.ts +25 -0
- package/dist/components/tui/tui-labels.d.ts +2 -2
- package/dist/components/tui/tui.d.ts +1 -1
- package/dist/components/tui/types.d.ts +35 -12
- package/dist/components/tui.js +1 -1
- package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
- package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
- package/dist/components/viking-bot/ark-message-list-view.d.ts +1 -1
- package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
- package/dist/components/viking-bot/bot-popover.d.ts +9 -0
- package/dist/components/viking-bot/capabilities.d.ts +49 -0
- package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
- package/dist/components/viking-bot/composer-controls.d.ts +10 -0
- package/dist/components/viking-bot/composer-footer.d.ts +17 -0
- package/dist/components/viking-bot/composer-references.d.ts +20 -0
- package/dist/components/viking-bot/composer-text.d.ts +10 -0
- package/dist/components/viking-bot/index.d.ts +3 -1
- package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
- package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
- package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
- package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
- package/dist/components/viking-bot/interaction/types.d.ts +8 -3
- package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
- package/dist/components/viking-bot/labels.d.ts +2 -0
- package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
- package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
- package/dist/components/viking-bot/markdown-links.d.ts +27 -0
- package/dist/components/viking-bot/message-activity.d.ts +7 -0
- package/dist/components/viking-bot/message-code-block.d.ts +8 -0
- package/dist/components/viking-bot/message-footer.d.ts +8 -0
- package/dist/components/viking-bot/message-markdown.d.ts +9 -0
- package/dist/components/viking-bot/model.d.ts +37 -3
- package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
- package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
- package/dist/components/viking-bot/reference-picker.d.ts +16 -0
- package/dist/components/viking-bot/session-actions.d.ts +11 -0
- package/dist/components/viking-bot/style.css +1486 -48
- package/dist/components/viking-bot/tool-activity.d.ts +9 -0
- package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
- package/dist/components/viking-bot/types.d.ts +21 -9
- package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
- package/dist/components/viking-bot/viking-bot.d.ts +1 -6
- package/dist/components/viking-bot/welcome.d.ts +8 -0
- package/dist/components/viking-bot.js +1 -1
- package/dist/c~0.js +533 -66
- package/dist/e~0.js +333 -0
- package/dist/file-preview-viewer~0.js +90 -8
- package/dist/f~0.js +39 -47
- package/dist/h~0.js +5 -1
- package/dist/icons/console-icons.d.ts +12 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/viking-bot-icons.d.ts +6 -0
- package/dist/icons.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/dist/k~0.js +1 -0
- package/dist/lg~0.js +155 -0
- package/dist/lk~0.js +37 -8
- package/dist/l~0.js +1447 -25
- package/dist/modules/console/command-messages.d.ts +19 -0
- package/dist/modules/console/command-parser.d.ts +15 -0
- package/dist/modules/console/command-specs.d.ts +15 -0
- package/dist/modules/console/commands.d.ts +6 -0
- package/dist/modules/console/console-history.d.ts +10 -0
- package/dist/modules/console/console-toolbar.d.ts +18 -0
- package/dist/modules/console/console.d.ts +1 -3
- package/dist/modules/console/controller.d.ts +17 -0
- package/dist/modules/console/index.d.ts +2 -0
- package/dist/modules/console/labels.d.ts +61 -0
- package/dist/modules/console/locales/en-US.d.ts +49 -0
- package/dist/modules/console/locales/zh-CN.d.ts +3 -0
- package/dist/modules/console/localize-records.d.ts +11 -0
- package/dist/modules/console/results.d.ts +2 -0
- package/dist/modules/console/style.css +10905 -15
- package/dist/modules/console/types.d.ts +59 -80
- package/dist/modules/console/use-console.d.ts +3 -0
- package/dist/modules/console.js +1 -1
- package/dist/modules/file-browser/file-browser-detail-icons.d.ts +10 -0
- package/dist/modules/file-browser/file-browser-detail.d.ts +34 -0
- package/dist/modules/file-browser/file-browser-empty.d.ts +3 -0
- package/dist/modules/file-browser/file-browser-failure.d.ts +22 -0
- package/dist/modules/file-browser/file-browser-icons.d.ts +18 -0
- package/dist/modules/file-browser/file-browser-labels.d.ts +27 -0
- package/dist/modules/file-browser/file-browser-layout.d.ts +27 -0
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +17 -0
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +32 -0
- package/dist/modules/file-browser/file-browser.d.ts +14 -5
- package/dist/modules/file-browser/find-result.d.ts +24 -0
- package/dist/modules/file-browser/fs-directories.d.ts +33 -0
- package/dist/modules/file-browser/fs-file-kind.d.ts +19 -0
- package/dist/modules/file-browser/fs-icon.d.ts +17 -0
- package/dist/modules/file-browser/fs-model.d.ts +106 -0
- package/dist/modules/file-browser/fs-page.d.ts +16 -0
- package/dist/modules/file-browser/fs-path.d.ts +16 -0
- package/dist/modules/file-browser/fs-read-directory.d.ts +16 -0
- package/dist/modules/file-browser/fs-scope.d.ts +22 -0
- package/dist/modules/file-browser/fs-stat.d.ts +25 -0
- package/dist/modules/file-browser/index.d.ts +3 -1
- package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
- package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
- package/dist/modules/file-browser/style.css +6388 -41
- package/dist/modules/file-browser/types.d.ts +206 -52
- package/dist/modules/file-browser/use-container-width.d.ts +17 -0
- package/dist/modules/file-browser/use-file-browser.d.ts +54 -0
- package/dist/modules/file-browser/use-fs-preview.d.ts +65 -0
- package/dist/modules/file-browser/use-fs-search.d.ts +35 -0
- package/dist/modules/file-browser/use-fs-tree.d.ts +43 -0
- package/dist/modules/file-browser/use-request-scope.d.ts +39 -0
- package/dist/modules/file-browser.js +1 -1
- package/dist/modules/scope-cascade/labels.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
- package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
- package/dist/modules/scope-cascade/style.css +14 -2
- package/dist/modules/scope-cascade/types.d.ts +3 -0
- package/dist/modules/style.css +17338 -77
- package/dist/nx~0.js +15 -0
- package/dist/n~0.js +403 -144
- package/dist/o~0.js +106 -0
- package/dist/p~0.js +27 -0
- package/dist/rslib-runtime~0.js +42 -0
- package/dist/r~0.js +152 -0
- package/dist/shared/components/divider/divider.d.ts +18 -0
- package/dist/shared/components/divider/index.d.ts +1 -0
- package/dist/shared/components/divider/types.d.ts +35 -0
- package/dist/shared/components/drawer/drawer.d.ts +13 -0
- package/dist/shared/components/drawer/index.d.ts +1 -0
- package/dist/shared/components/overlay/types.d.ts +7 -0
- package/dist/shared/components/{tooltip/use-tooltip-position.d.ts → overlay/use-overlay-position.d.ts} +6 -6
- package/dist/shared/components/popover/index.d.ts +1 -0
- package/dist/shared/components/popover/popover.d.ts +23 -0
- package/dist/shared/components/popover/types.d.ts +50 -0
- package/dist/shared/components/resizable/clamp.d.ts +13 -0
- package/dist/shared/components/resizable/index.d.ts +2 -0
- package/dist/shared/components/resizable/resizable-handle.d.ts +25 -0
- package/dist/shared/components/resizable/types.d.ts +48 -0
- package/dist/shared/components/tooltip/types.d.ts +5 -5
- package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
- package/dist/shared/locale.d.ts +6 -0
- package/dist/style.css +27753 -7176
- package/dist/u~0.js +75 -58
- package/dist/viking-bot-composer~0.js +434 -77
- package/dist/viking-bot-interaction~0.js +11 -11
- package/package.json +18 -4
- package/dist/components/file-tree/file-tree-tooltip.d.ts +0 -17
- package/dist/components/tui/tui-labels-zh.d.ts +0 -2
- package/dist/g~0.js +0 -1207
- package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +0 -10
package/dist/c~0.js
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense, forwardRef, lazy } from "react";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, createContext, forwardRef, lazy, useContext, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { resolveLocale } from "./nx~0.js";
|
|
5
|
+
import { useOverlayPosition } from "./o~0.js";
|
|
6
|
+
import { Tooltip } from "./r~0.js";
|
|
7
|
+
import { VikingBotIcon } from "./lg~0.js";
|
|
3
8
|
import { VikingBotInteraction } from "./w~0.js";
|
|
4
|
-
const
|
|
9
|
+
const en_US_messages = {
|
|
10
|
+
activityRunning: 'Running',
|
|
11
|
+
activityCompleted: 'Completed',
|
|
12
|
+
toolInput: 'Input',
|
|
13
|
+
toolOutput: 'Output',
|
|
14
|
+
similarity: 'Similarity',
|
|
15
|
+
sessionHistory: 'Session history',
|
|
16
|
+
newSession: 'New session',
|
|
17
|
+
emptySessions: 'No sessions yet',
|
|
18
|
+
loading: 'Loading…',
|
|
19
|
+
loadMore: 'Load more',
|
|
20
|
+
reference: 'Reference a file or directory',
|
|
21
|
+
searchReferences: 'Search files and directories',
|
|
22
|
+
emptyReferences: 'No matching files or directories',
|
|
23
|
+
removeReference: 'Remove reference',
|
|
24
|
+
expandReference: 'Expand {name}',
|
|
25
|
+
collapseReference: 'Collapse {name}',
|
|
26
|
+
welcomeTitle: 'Welcome to VikingBot',
|
|
27
|
+
welcomeDescription: 'Connect your resources, memories and context to turn your data into usable knowledge.',
|
|
5
28
|
placeholder: 'Ask VikingBot anything',
|
|
6
29
|
send: 'Send',
|
|
7
30
|
stop: 'Stop',
|
|
@@ -18,11 +41,402 @@ const DEFAULT_LABELS = {
|
|
|
18
41
|
toolError: 'Failed',
|
|
19
42
|
context: 'Context',
|
|
20
43
|
empty: 'Start a conversation',
|
|
21
|
-
newSession: 'New chat',
|
|
22
44
|
retry: 'Retry',
|
|
23
45
|
scrollToLatest: 'Scroll to latest',
|
|
24
46
|
unavailable: 'VikingBot is unavailable'
|
|
25
47
|
};
|
|
48
|
+
const en_US = en_US_messages;
|
|
49
|
+
const zh_CN_messages = {
|
|
50
|
+
activityRunning: '执行中',
|
|
51
|
+
activityCompleted: '已执行',
|
|
52
|
+
toolInput: '输入',
|
|
53
|
+
toolOutput: '输出',
|
|
54
|
+
similarity: '相似度',
|
|
55
|
+
sessionHistory: '历史会话',
|
|
56
|
+
newSession: '新建会话',
|
|
57
|
+
emptySessions: '暂无历史会话',
|
|
58
|
+
loading: '加载中…',
|
|
59
|
+
loadMore: '加载更多',
|
|
60
|
+
reference: '引用文件或目录',
|
|
61
|
+
searchReferences: '搜索文件或目录',
|
|
62
|
+
emptyReferences: '暂无匹配的文件或目录',
|
|
63
|
+
removeReference: '移除引用',
|
|
64
|
+
expandReference: '展开 {name}',
|
|
65
|
+
collapseReference: '收起 {name}',
|
|
66
|
+
welcomeTitle: '欢迎使用 VikingBot',
|
|
67
|
+
welcomeDescription: '连接你的资料、记忆与上下文,让每一份数据都成为可用的知识。',
|
|
68
|
+
placeholder: '向 VikingBot 提问',
|
|
69
|
+
send: '发送',
|
|
70
|
+
stop: '停止',
|
|
71
|
+
attach: '添加资源',
|
|
72
|
+
removeAttachment: '移除附件',
|
|
73
|
+
copy: '复制',
|
|
74
|
+
copied: '已复制',
|
|
75
|
+
reasoning: '推理',
|
|
76
|
+
thinking: '思考中',
|
|
77
|
+
tool: '工具调用',
|
|
78
|
+
toolPending: '等待中',
|
|
79
|
+
toolRunning: '正在调用',
|
|
80
|
+
toolCompleted: '已调用',
|
|
81
|
+
toolError: '调用失败',
|
|
82
|
+
context: '上下文',
|
|
83
|
+
empty: '开始对话',
|
|
84
|
+
retry: '重试',
|
|
85
|
+
scrollToLatest: '滚动到最新消息',
|
|
86
|
+
unavailable: 'VikingBot 暂不可用'
|
|
87
|
+
};
|
|
88
|
+
const zh_CN = zh_CN_messages;
|
|
89
|
+
const LOCALES = {
|
|
90
|
+
'en-US': en_US,
|
|
91
|
+
'zh-CN': zh_CN
|
|
92
|
+
};
|
|
93
|
+
const DEFAULT_LABELS = en_US;
|
|
94
|
+
function resolveVikingBotLabels(locale, labels) {
|
|
95
|
+
return resolveLocale(LOCALES, locale, labels);
|
|
96
|
+
}
|
|
97
|
+
const subscribe = ()=>()=>{};
|
|
98
|
+
function BotPopover({ label, trigger: renderTrigger, children, placement = 'bottom', onOpen }) {
|
|
99
|
+
const mounted = useSyncExternalStore(subscribe, ()=>true, ()=>false);
|
|
100
|
+
const native = mounted && 'popover' in HTMLElement.prototype;
|
|
101
|
+
const [open, setOpen] = useState(false);
|
|
102
|
+
const [surface, setSurface] = useState(null);
|
|
103
|
+
const anchor = useRef(null);
|
|
104
|
+
const id = useId();
|
|
105
|
+
const position = useOverlayPosition(open, anchor, surface, placement, 'end');
|
|
106
|
+
const close = ()=>{
|
|
107
|
+
if (native) surface?.hidePopover();
|
|
108
|
+
else setOpen(false);
|
|
109
|
+
anchor.current?.querySelector('button')?.focus();
|
|
110
|
+
};
|
|
111
|
+
useEffect(()=>{
|
|
112
|
+
if (!surface) return;
|
|
113
|
+
const toggle = ()=>{
|
|
114
|
+
const expanded = surface.matches(':popover-open');
|
|
115
|
+
setOpen(expanded);
|
|
116
|
+
if (expanded) onOpen?.();
|
|
117
|
+
};
|
|
118
|
+
if (native) surface.addEventListener('toggle', toggle);
|
|
119
|
+
return ()=>surface.removeEventListener('toggle', toggle);
|
|
120
|
+
}, [
|
|
121
|
+
native,
|
|
122
|
+
surface,
|
|
123
|
+
onOpen
|
|
124
|
+
]);
|
|
125
|
+
useEffect(()=>{
|
|
126
|
+
if (!open) return;
|
|
127
|
+
(surface?.querySelector('input, button') ?? surface)?.focus();
|
|
128
|
+
}, [
|
|
129
|
+
open,
|
|
130
|
+
surface
|
|
131
|
+
]);
|
|
132
|
+
useEffect(()=>{
|
|
133
|
+
if (native || !open) return;
|
|
134
|
+
const outside = (event)=>{
|
|
135
|
+
const node = event.target;
|
|
136
|
+
if (!anchor.current?.contains(node) && !surface?.contains(node)) setOpen(false);
|
|
137
|
+
};
|
|
138
|
+
const escape = (event)=>{
|
|
139
|
+
if ('Escape' !== event.key) return;
|
|
140
|
+
setOpen(false);
|
|
141
|
+
anchor.current?.querySelector('button')?.focus();
|
|
142
|
+
};
|
|
143
|
+
document.addEventListener('mousedown', outside);
|
|
144
|
+
document.addEventListener('keydown', escape);
|
|
145
|
+
return ()=>{
|
|
146
|
+
document.removeEventListener('mousedown', outside);
|
|
147
|
+
document.removeEventListener('keydown', escape);
|
|
148
|
+
};
|
|
149
|
+
}, [
|
|
150
|
+
native,
|
|
151
|
+
open,
|
|
152
|
+
surface
|
|
153
|
+
]);
|
|
154
|
+
const invoker = native ? {
|
|
155
|
+
popovertarget: id
|
|
156
|
+
} : {};
|
|
157
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
158
|
+
className: "ov-viking-bot__popover-anchor",
|
|
159
|
+
ref: anchor,
|
|
160
|
+
children: [
|
|
161
|
+
renderTrigger({
|
|
162
|
+
...invoker,
|
|
163
|
+
'aria-haspopup': 'dialog',
|
|
164
|
+
'aria-controls': id,
|
|
165
|
+
'aria-expanded': open,
|
|
166
|
+
onClick: native ? void 0 : ()=>{
|
|
167
|
+
setOpen(!open);
|
|
168
|
+
if (!open) onOpen?.();
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
mounted ? /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx("div", {
|
|
172
|
+
ref: setSurface,
|
|
173
|
+
id: id,
|
|
174
|
+
popover: "auto",
|
|
175
|
+
role: "dialog",
|
|
176
|
+
tabIndex: -1,
|
|
177
|
+
"aria-label": label,
|
|
178
|
+
hidden: !native && !open,
|
|
179
|
+
className: `ov-viking-bot__popover ov-viking-bot__popover--${placement}`,
|
|
180
|
+
style: {
|
|
181
|
+
top: position.top,
|
|
182
|
+
left: position.left
|
|
183
|
+
},
|
|
184
|
+
children: open ? children(close) : null
|
|
185
|
+
}), document.body) : null
|
|
186
|
+
]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function VikingBotSessionActions({ sessions, extra, labels: overrides, locale }) {
|
|
190
|
+
const labels = resolveVikingBotLabels(locale, overrides);
|
|
191
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
192
|
+
className: "ov-viking-bot__session-actions",
|
|
193
|
+
children: [
|
|
194
|
+
extra,
|
|
195
|
+
sessions ? /*#__PURE__*/ jsxs(Fragment, {
|
|
196
|
+
children: [
|
|
197
|
+
/*#__PURE__*/ jsx(BotPopover, {
|
|
198
|
+
label: labels.sessionHistory,
|
|
199
|
+
onOpen: sessions.onOpenHistory,
|
|
200
|
+
trigger: (props)=>/*#__PURE__*/ jsx(Tooltip, {
|
|
201
|
+
content: labels.sessionHistory,
|
|
202
|
+
disabled: true === props['aria-expanded'],
|
|
203
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
204
|
+
...props,
|
|
205
|
+
type: "button",
|
|
206
|
+
className: "ov-viking-bot__header-action",
|
|
207
|
+
"aria-label": labels.sessionHistory,
|
|
208
|
+
children: /*#__PURE__*/ jsx(VikingBotIcon, {
|
|
209
|
+
name: "history"
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
}),
|
|
213
|
+
children: (close)=>/*#__PURE__*/ jsxs("div", {
|
|
214
|
+
className: "ov-viking-bot__session-history",
|
|
215
|
+
"aria-busy": sessions.isLoading,
|
|
216
|
+
children: [
|
|
217
|
+
sessions.isLoading ? /*#__PURE__*/ jsx("p", {
|
|
218
|
+
role: "status",
|
|
219
|
+
children: labels.loading
|
|
220
|
+
}) : null,
|
|
221
|
+
sessions.error ? /*#__PURE__*/ jsx("p", {
|
|
222
|
+
role: "alert",
|
|
223
|
+
children: sessions.error
|
|
224
|
+
}) : null,
|
|
225
|
+
sessions.isLoading || sessions.error || sessions.items.length ? null : /*#__PURE__*/ jsx("p", {
|
|
226
|
+
className: "ov-viking-bot__empty-history",
|
|
227
|
+
children: labels.emptySessions
|
|
228
|
+
}),
|
|
229
|
+
/*#__PURE__*/ jsx("ul", {
|
|
230
|
+
children: sessions.items.map((item)=>{
|
|
231
|
+
const date = new Date(item.updatedAt ?? '');
|
|
232
|
+
const validDate = Number.isFinite(date.getTime());
|
|
233
|
+
return /*#__PURE__*/ jsx("li", {
|
|
234
|
+
children: /*#__PURE__*/ jsxs("button", {
|
|
235
|
+
type: "button",
|
|
236
|
+
"aria-current": sessions.currentId === item.id || void 0,
|
|
237
|
+
onClick: ()=>{
|
|
238
|
+
close();
|
|
239
|
+
sessions.onSelect(item.id);
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/*#__PURE__*/ jsx("span", {
|
|
243
|
+
children: item.title
|
|
244
|
+
}),
|
|
245
|
+
validDate ? /*#__PURE__*/ jsx("time", {
|
|
246
|
+
dateTime: item.updatedAt,
|
|
247
|
+
children: new Intl.DateTimeFormat(locale, {
|
|
248
|
+
dateStyle: 'short',
|
|
249
|
+
timeStyle: 'short'
|
|
250
|
+
}).format(date)
|
|
251
|
+
}) : null
|
|
252
|
+
]
|
|
253
|
+
})
|
|
254
|
+
}, item.id);
|
|
255
|
+
})
|
|
256
|
+
}),
|
|
257
|
+
sessions.hasMore && sessions.onLoadMore ? /*#__PURE__*/ jsx("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
disabled: sessions.isLoading,
|
|
260
|
+
onClick: sessions.onLoadMore,
|
|
261
|
+
children: labels.loadMore
|
|
262
|
+
}) : null
|
|
263
|
+
]
|
|
264
|
+
})
|
|
265
|
+
}),
|
|
266
|
+
/*#__PURE__*/ jsx(Tooltip, {
|
|
267
|
+
content: labels.newSession,
|
|
268
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
269
|
+
type: "button",
|
|
270
|
+
className: "ov-viking-bot__header-action",
|
|
271
|
+
"aria-label": labels.newSession,
|
|
272
|
+
onClick: sessions.onNew,
|
|
273
|
+
children: /*#__PURE__*/ jsx(VikingBotIcon, {
|
|
274
|
+
name: "newSession"
|
|
275
|
+
})
|
|
276
|
+
})
|
|
277
|
+
})
|
|
278
|
+
]
|
|
279
|
+
}) : null
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function QuickInputs({ items, onSelect, disabled }) {
|
|
284
|
+
if (!items?.length) return null;
|
|
285
|
+
return /*#__PURE__*/ jsx("div", {
|
|
286
|
+
className: "ov-viking-bot__quick-inputs",
|
|
287
|
+
children: items.map((item)=>/*#__PURE__*/ jsxs("button", {
|
|
288
|
+
type: "button",
|
|
289
|
+
disabled: disabled,
|
|
290
|
+
onClick: ()=>onSelect(item),
|
|
291
|
+
children: [
|
|
292
|
+
item.icon,
|
|
293
|
+
item.label
|
|
294
|
+
]
|
|
295
|
+
}, item.id))
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function VikingBotWelcome({ labels, quickInputs, onSelect, disabled }) {
|
|
299
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
300
|
+
className: "ov-viking-bot__home",
|
|
301
|
+
children: [
|
|
302
|
+
/*#__PURE__*/ jsxs("div", {
|
|
303
|
+
className: "ov-viking-bot__home-intro",
|
|
304
|
+
children: [
|
|
305
|
+
/*#__PURE__*/ jsxs("div", {
|
|
306
|
+
className: "ov-viking-bot__home-illustration",
|
|
307
|
+
"aria-hidden": "true",
|
|
308
|
+
children: [
|
|
309
|
+
/*#__PURE__*/ jsx("span", {
|
|
310
|
+
className: "ov-viking-bot__home-bulb",
|
|
311
|
+
children: /*#__PURE__*/ jsx(VikingBotIcon, {
|
|
312
|
+
name: "bulb",
|
|
313
|
+
width: 24,
|
|
314
|
+
height: 24,
|
|
315
|
+
fill: "none"
|
|
316
|
+
})
|
|
317
|
+
}),
|
|
318
|
+
/*#__PURE__*/ jsx("span", {
|
|
319
|
+
className: "ov-viking-bot__home-book",
|
|
320
|
+
children: /*#__PURE__*/ jsx(VikingBotIcon, {
|
|
321
|
+
name: "book",
|
|
322
|
+
width: 24,
|
|
323
|
+
height: 24,
|
|
324
|
+
viewBox: "-2.833333 -3.5 20 19.2"
|
|
325
|
+
})
|
|
326
|
+
}),
|
|
327
|
+
/*#__PURE__*/ jsx("span", {
|
|
328
|
+
className: "ov-viking-bot__home-video",
|
|
329
|
+
children: /*#__PURE__*/ jsx(VikingBotIcon, {
|
|
330
|
+
name: "video",
|
|
331
|
+
width: 24,
|
|
332
|
+
height: 24
|
|
333
|
+
})
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
}),
|
|
337
|
+
/*#__PURE__*/ jsxs("div", {
|
|
338
|
+
className: "ov-viking-bot__home-text",
|
|
339
|
+
children: [
|
|
340
|
+
/*#__PURE__*/ jsx("h2", {
|
|
341
|
+
children: labels.welcomeTitle
|
|
342
|
+
}),
|
|
343
|
+
/*#__PURE__*/ jsx("p", {
|
|
344
|
+
children: labels.welcomeDescription
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}),
|
|
350
|
+
/*#__PURE__*/ jsx(QuickInputs, {
|
|
351
|
+
items: quickInputs,
|
|
352
|
+
onSelect: onSelect,
|
|
353
|
+
disabled: disabled
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
function editRange(before, after, caret) {
|
|
359
|
+
let prefix = 0;
|
|
360
|
+
while(prefix < before.length && prefix < after.length && before[prefix] === after[prefix])prefix++;
|
|
361
|
+
let suffix = 0;
|
|
362
|
+
while(suffix < before.length && suffix < after.length && before[before.length - 1 - suffix] === after[after.length - 1 - suffix])suffix++;
|
|
363
|
+
const delta = after.length - before.length;
|
|
364
|
+
if (prefix + suffix <= Math.min(before.length, after.length)) return {
|
|
365
|
+
from: prefix,
|
|
366
|
+
to: before.length - suffix,
|
|
367
|
+
delta
|
|
368
|
+
};
|
|
369
|
+
if (void 0 !== caret) {
|
|
370
|
+
const oldEnd = caret - delta;
|
|
371
|
+
if (oldEnd >= 0 && oldEnd <= before.length && caret >= 0 && caret <= after.length && before.slice(oldEnd) === after.slice(caret)) return {
|
|
372
|
+
from: Math.min(prefix, oldEnd, caret),
|
|
373
|
+
to: oldEnd,
|
|
374
|
+
delta
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function createQuickInputTracker(initial, previous) {
|
|
379
|
+
let text = previous?.text ?? initial;
|
|
380
|
+
let range = previous?.range ? {
|
|
381
|
+
...previous.range
|
|
382
|
+
} : void 0;
|
|
383
|
+
const edit = (next, caret)=>{
|
|
384
|
+
if (text === next) return;
|
|
385
|
+
const change = editRange(text, next, caret);
|
|
386
|
+
if (range) if (change) {
|
|
387
|
+
if (change.to <= range.from) range = {
|
|
388
|
+
from: range.from + change.delta,
|
|
389
|
+
to: range.to + change.delta
|
|
390
|
+
};
|
|
391
|
+
else if (change.from < range.to) range = void 0;
|
|
392
|
+
} else range = void 0;
|
|
393
|
+
text = next;
|
|
394
|
+
};
|
|
395
|
+
edit(initial);
|
|
396
|
+
return {
|
|
397
|
+
snapshot: ()=>({
|
|
398
|
+
text,
|
|
399
|
+
range
|
|
400
|
+
}),
|
|
401
|
+
edit,
|
|
402
|
+
release () {
|
|
403
|
+
range = void 0;
|
|
404
|
+
},
|
|
405
|
+
insert (value, prompt) {
|
|
406
|
+
edit(value);
|
|
407
|
+
const prefix = range ? text.slice(0, range.from) : text.trim() ? `${text}\n` : '';
|
|
408
|
+
const suffix = range ? text.slice(range.to) : '';
|
|
409
|
+
text = prefix + prompt + suffix;
|
|
410
|
+
range = {
|
|
411
|
+
from: prefix.length,
|
|
412
|
+
to: prefix.length + prompt.length
|
|
413
|
+
};
|
|
414
|
+
return text;
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
const QuickInputScope = createContext(null);
|
|
419
|
+
function useQuickInput(value, onChange, onSelect, ownsScope = false) {
|
|
420
|
+
const inherited = useContext(QuickInputScope);
|
|
421
|
+
const [local, setLocal] = useState(()=>({
|
|
422
|
+
value,
|
|
423
|
+
tracker: createQuickInputTracker(value)
|
|
424
|
+
}));
|
|
425
|
+
if (local.value !== value) setLocal({
|
|
426
|
+
value,
|
|
427
|
+
tracker: createQuickInputTracker(value, local.tracker.snapshot())
|
|
428
|
+
});
|
|
429
|
+
const tracker = ownsScope ? local.tracker : inherited ?? local.tracker;
|
|
430
|
+
return {
|
|
431
|
+
tracker,
|
|
432
|
+
select (input) {
|
|
433
|
+
if (onSelect) {
|
|
434
|
+
if (tracker === local.tracker) tracker.release();
|
|
435
|
+
onSelect(input);
|
|
436
|
+
} else onChange(tracker.insert(value, input.prompt));
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
26
440
|
const View = /*#__PURE__*/ lazy(async ()=>{
|
|
27
441
|
const { VikingBotComposerView } = await import("./viking-bot-composer~0.js");
|
|
28
442
|
return {
|
|
@@ -49,7 +463,9 @@ const toReasoningItem = (part, index)=>({
|
|
|
49
463
|
part.text
|
|
50
464
|
] : [],
|
|
51
465
|
visibility: 'contentAllowed',
|
|
52
|
-
durationMs: part.durationMs
|
|
466
|
+
durationMs: part.durationMs,
|
|
467
|
+
startedAt: void 0 === part.startedAt ? void 0 : new Date(part.startedAt).getTime(),
|
|
468
|
+
completedAt: void 0 === part.completedAt ? void 0 : new Date(part.completedAt).getTime()
|
|
53
469
|
});
|
|
54
470
|
const toToolItem = (part)=>({
|
|
55
471
|
id: part.id,
|
|
@@ -59,9 +475,33 @@ const toToolItem = (part)=>({
|
|
|
59
475
|
tool: part.name,
|
|
60
476
|
arguments: part.input,
|
|
61
477
|
resultPreview: part.output,
|
|
62
|
-
|
|
478
|
+
error: 'error' === part.status ? part.output : void 0,
|
|
479
|
+
durationMs: part.durationMs,
|
|
480
|
+
startedAt: void 0 === part.startedAt ? void 0 : new Date(part.startedAt).getTime(),
|
|
481
|
+
completedAt: void 0 === part.completedAt ? void 0 : new Date(part.completedAt).getTime()
|
|
63
482
|
});
|
|
64
483
|
const isActivityPart = (part)=>'reasoning' === part.type || 'tool' === part.type;
|
|
484
|
+
function mergeToolResults(parts) {
|
|
485
|
+
const results = new Map(parts.flatMap((part)=>'tool_result' === part.type ? [
|
|
486
|
+
[
|
|
487
|
+
part.id,
|
|
488
|
+
part
|
|
489
|
+
]
|
|
490
|
+
] : []));
|
|
491
|
+
const calls = new Set(parts.flatMap((part)=>'tool' === part.type ? [
|
|
492
|
+
part.id
|
|
493
|
+
] : []));
|
|
494
|
+
return parts.filter((part)=>'tool_result' !== part.type || !calls.has(part.id)).map((part)=>{
|
|
495
|
+
if ('tool' !== part.type) return part;
|
|
496
|
+
const result = results.get(part.id);
|
|
497
|
+
return result ? {
|
|
498
|
+
...part,
|
|
499
|
+
output: result.output,
|
|
500
|
+
results: result.results ?? part.results,
|
|
501
|
+
status: result.isError ? 'error' : 'completed'
|
|
502
|
+
} : part;
|
|
503
|
+
});
|
|
504
|
+
}
|
|
65
505
|
function groupActivityParts(parts) {
|
|
66
506
|
const groups = new Map();
|
|
67
507
|
const order = [];
|
|
@@ -115,10 +555,7 @@ function ListSkeleton() {
|
|
|
115
555
|
});
|
|
116
556
|
}
|
|
117
557
|
function VikingBotMessageList(props) {
|
|
118
|
-
const labels =
|
|
119
|
-
...DEFAULT_LABELS,
|
|
120
|
-
...props.labels
|
|
121
|
-
};
|
|
558
|
+
const labels = resolveVikingBotLabels(props.locale, props.labels);
|
|
122
559
|
const items = toRenderItems(props.messages, props.streaming);
|
|
123
560
|
if (0 === items.length) return /*#__PURE__*/ jsx("div", {
|
|
124
561
|
className: "ov-viking-bot__empty",
|
|
@@ -131,12 +568,25 @@ function VikingBotMessageList(props) {
|
|
|
131
568
|
})
|
|
132
569
|
});
|
|
133
570
|
}
|
|
134
|
-
function VikingBot({ messages, className, streaming, draft, attachments, isSending, isAvailable = true, unavailableMessage, emptyState, header, footer, children, messageList, composer, interaction, interactionSlot, listKey, composerRef, onDraftChange, onFilesAdded, onAttachmentRemove, onSend, onCancel, onOpenUri, onCopy, onMessageAction, labels: overrides, ...rest }) {
|
|
135
|
-
const labels =
|
|
136
|
-
...DEFAULT_LABELS,
|
|
137
|
-
...overrides
|
|
138
|
-
};
|
|
571
|
+
function VikingBot({ messages, className, streaming, draft, attachments, isSending, isAvailable = true, unavailableMessage, emptyState, header, sessions, headerActions, locale, quickInputs, onQuickInputSelect, references, footer, children, messageList, composer, interaction, interactionSlot, listKey, composerRef, onDraftChange, onFilesAdded, onAttachmentRemove, onSend, onCancel, onOpenUri, onCopy, onMessageAction, labels: overrides, ...rest }) {
|
|
572
|
+
const labels = resolveVikingBotLabels(locale, overrides);
|
|
139
573
|
const hasMessages = messages.length > 0;
|
|
574
|
+
const localComposer = useRef(null);
|
|
575
|
+
const inputRef = composerRef ?? localComposer;
|
|
576
|
+
const shortcuts = useQuickInput(draft ?? '', (next)=>{
|
|
577
|
+
if (inputRef.current) inputRef.current.setText(next);
|
|
578
|
+
else onDraftChange?.(next);
|
|
579
|
+
}, onQuickInputSelect, true);
|
|
580
|
+
const selectQuickInput = (item)=>{
|
|
581
|
+
shortcuts.select(item);
|
|
582
|
+
inputRef.current?.focus();
|
|
583
|
+
};
|
|
584
|
+
const renderedHeader = void 0 !== header ? header : sessions || headerActions ? /*#__PURE__*/ jsx(VikingBotSessionActions, {
|
|
585
|
+
sessions: sessions,
|
|
586
|
+
extra: headerActions,
|
|
587
|
+
labels: labels,
|
|
588
|
+
locale: locale
|
|
589
|
+
}) : null;
|
|
140
590
|
if (children) return /*#__PURE__*/ jsx("div", {
|
|
141
591
|
className: [
|
|
142
592
|
'ov-viking-bot',
|
|
@@ -145,57 +595,74 @@ function VikingBot({ messages, className, streaming, draft, attachments, isSendi
|
|
|
145
595
|
...rest,
|
|
146
596
|
children: children
|
|
147
597
|
});
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
className
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
className: "ov-viking-
|
|
168
|
-
children:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
598
|
+
return /*#__PURE__*/ jsx(QuickInputScope.Provider, {
|
|
599
|
+
value: shortcuts.tracker,
|
|
600
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
601
|
+
className: [
|
|
602
|
+
'ov-viking-bot',
|
|
603
|
+
className
|
|
604
|
+
].filter(Boolean).join(' '),
|
|
605
|
+
...rest,
|
|
606
|
+
children: [
|
|
607
|
+
renderedHeader ? /*#__PURE__*/ jsx("div", {
|
|
608
|
+
className: "ov-viking-bot__header",
|
|
609
|
+
children: renderedHeader
|
|
610
|
+
}) : null,
|
|
611
|
+
isAvailable ? null : /*#__PURE__*/ jsx("p", {
|
|
612
|
+
className: "ov-viking-bot__unavailable",
|
|
613
|
+
role: "status",
|
|
614
|
+
children: unavailableMessage ?? labels.unavailable
|
|
615
|
+
}),
|
|
616
|
+
/*#__PURE__*/ jsx("div", {
|
|
617
|
+
className: "ov-viking-bot__body",
|
|
618
|
+
children: void 0 !== messageList ? messageList : hasMessages || streaming ? /*#__PURE__*/ jsx(VikingBotMessageList, {
|
|
619
|
+
locale: locale,
|
|
620
|
+
messages: messages,
|
|
621
|
+
streaming: streaming,
|
|
622
|
+
listKey: listKey,
|
|
623
|
+
onOpenUri: onOpenUri,
|
|
624
|
+
onCopy: onCopy,
|
|
625
|
+
onMessageAction: onMessageAction,
|
|
626
|
+
labels: overrides
|
|
627
|
+
}) : /*#__PURE__*/ jsx("div", {
|
|
628
|
+
className: `ov-viking-bot__empty${void 0 === emptyState ? ' ov-viking-bot__empty--welcome' : ''}`,
|
|
629
|
+
children: void 0 === emptyState ? /*#__PURE__*/ jsx(VikingBotWelcome, {
|
|
630
|
+
labels: labels,
|
|
631
|
+
quickInputs: quickInputs,
|
|
632
|
+
onSelect: selectQuickInput,
|
|
633
|
+
disabled: isSending || !isAvailable || !onDraftChange && !onQuickInputSelect
|
|
634
|
+
}) : emptyState
|
|
635
|
+
})
|
|
636
|
+
}),
|
|
637
|
+
footer ? /*#__PURE__*/ jsx("div", {
|
|
638
|
+
className: "ov-viking-bot__footer",
|
|
639
|
+
children: footer
|
|
640
|
+
}) : null,
|
|
641
|
+
interaction ? interactionSlot ?? /*#__PURE__*/ jsx(VikingBotInteraction, {
|
|
642
|
+
...interaction,
|
|
643
|
+
locale: locale
|
|
644
|
+
}) : composer ?? (void 0 !== draft ? /*#__PURE__*/ jsx(lazy_composer_VikingBotComposer, {
|
|
645
|
+
locale: locale,
|
|
646
|
+
ref: inputRef,
|
|
647
|
+
value: draft,
|
|
648
|
+
attachments: attachments,
|
|
649
|
+
disabled: !isAvailable,
|
|
650
|
+
isSending: isSending,
|
|
651
|
+
references: references,
|
|
652
|
+
quickInputs: hasMessages || streaming || void 0 !== emptyState ? quickInputs : void 0,
|
|
653
|
+
onQuickInputSelect: selectQuickInput,
|
|
654
|
+
onValueChange: onDraftChange ? (next)=>{
|
|
655
|
+
shortcuts.tracker.edit(next);
|
|
656
|
+
onDraftChange(next);
|
|
657
|
+
} : void 0,
|
|
658
|
+
onFilesAdded: onFilesAdded,
|
|
659
|
+
onAttachmentRemove: onAttachmentRemove,
|
|
660
|
+
onSend: onSend,
|
|
661
|
+
onCancel: onCancel,
|
|
176
662
|
labels: overrides
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
className: "ov-viking-bot__footer",
|
|
181
|
-
children: footer
|
|
182
|
-
}) : null,
|
|
183
|
-
interaction ? interactionSlot ?? /*#__PURE__*/ jsx(VikingBotInteraction, {
|
|
184
|
-
...interaction
|
|
185
|
-
}) : composer ?? (void 0 !== draft ? /*#__PURE__*/ jsx(lazy_composer_VikingBotComposer, {
|
|
186
|
-
ref: composerRef,
|
|
187
|
-
value: draft,
|
|
188
|
-
attachments: attachments,
|
|
189
|
-
disabled: !isAvailable,
|
|
190
|
-
isSending: isSending,
|
|
191
|
-
onValueChange: onDraftChange,
|
|
192
|
-
onFilesAdded: onFilesAdded,
|
|
193
|
-
onAttachmentRemove: onAttachmentRemove,
|
|
194
|
-
onSend: onSend,
|
|
195
|
-
onCancel: onCancel,
|
|
196
|
-
labels: overrides
|
|
197
|
-
}) : null)
|
|
198
|
-
]
|
|
663
|
+
}) : null)
|
|
664
|
+
]
|
|
665
|
+
})
|
|
199
666
|
});
|
|
200
667
|
}
|
|
201
|
-
export { DEFAULT_LABELS, VikingBot, VikingBotMessageList, groupActivityParts, lazy_composer_VikingBotComposer as VikingBotComposer, toRenderItems };
|
|
668
|
+
export { BotPopover, DEFAULT_LABELS, QuickInputs, VikingBot, VikingBotMessageList, VikingBotSessionActions, groupActivityParts, lazy_composer_VikingBotComposer as VikingBotComposer, mergeToolResults, resolveVikingBotLabels, toRenderItems, useQuickInput };
|