@openviking/react 0.1.8-beta.10.1.g8e5299efeb0a → 0.1.8-beta.11.1.gc6def608a25e

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.
@@ -2,9 +2,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ChatMessageList } from "@ark-design/ui/message-list";
3
3
  import { Bubble, BubbleTools } from "@ark-design/ui/bubble";
4
4
  import { ErrorCard } from "@ark-design/ui/error-card";
5
- import { useEffect, useMemo, useState } from "react";
5
+ import { Fragment as external_react_Fragment, useEffect, useMemo, useState } from "react";
6
6
  import { ActivityTimeline } from "@ark-design/ui/activity-timeline";
7
7
  import { MDRenderer } from "@ark-design/ui/markdown-renderer";
8
+ import { UserMessageFileList } from "@ark-design/ui/user-message-file-list";
8
9
  import { DocumentIcon } from "./k~0.js";
9
10
  import { VikingBotIcon } from "./lg~0.js";
10
11
  import { groupActivityParts, mergeToolResults, resolveVikingBotLabels, toRenderItems } from "./c~0.js";
@@ -553,6 +554,49 @@ function MessageFooter({ message, showTime, labels, locale, onCopy }) {
553
554
  ]
554
555
  });
555
556
  }
557
+ function UserMessageGroup({ message, labels, footer, onOpenUri }) {
558
+ const attachments = message.parts.filter((part)=>'attachment' === part.type);
559
+ const parts = message.parts.filter((part)=>'attachment' !== part.type);
560
+ const hasContent = parts.some((part)=>'text' !== part.type || Boolean(part.text));
561
+ if (!hasContent && 0 === attachments.length) return null;
562
+ return /*#__PURE__*/ jsxs("div", {
563
+ className: "ov-viking-bot__user-message-group",
564
+ children: [
565
+ attachments.length > 0 ? /*#__PURE__*/ jsx(UserMessageFileList, {
566
+ className: "ov-viking-bot__user-message-attachments",
567
+ items: attachments.map((part, index)=>({
568
+ id: part.uri ?? String(index),
569
+ title: part.name,
570
+ previewEnabled: false
571
+ })),
572
+ renderItem: (_item, index)=>/*#__PURE__*/ jsx(external_react_Fragment, {
573
+ children: renderPart(attachments[index], {
574
+ labels,
575
+ onOpenUri
576
+ })
577
+ }, index)
578
+ }) : null,
579
+ hasContent ? /*#__PURE__*/ jsx(Bubble, {
580
+ className: "ov-viking-bot__user-bubble",
581
+ placement: "end",
582
+ variant: "filled",
583
+ maxHeight: "9999px",
584
+ footer: footer,
585
+ children: /*#__PURE__*/ jsx("div", {
586
+ className: "ov-viking-bot__user-message-content",
587
+ children: /*#__PURE__*/ jsx(MessageBody, {
588
+ message: {
589
+ ...message,
590
+ parts
591
+ },
592
+ labels: labels,
593
+ onOpenUri: onOpenUri
594
+ })
595
+ })
596
+ }) : footer
597
+ ]
598
+ });
599
+ }
556
600
  function MessageActions({ message, onMessageAction }) {
557
601
  const actions = message.actions ?? (message.action ? [
558
602
  {
@@ -599,13 +643,11 @@ function VikingBotMessageRow({ message, labels, onOpenUri, onCopy, onMessageActi
599
643
  return /*#__PURE__*/ jsxs("article", {
600
644
  className: `ov-viking-bot__message ov-viking-bot__message--${message.role}`,
601
645
  children: [
602
- 'user' === message.role ? /*#__PURE__*/ jsx(Bubble, {
603
- className: "ov-viking-bot__user-bubble",
604
- placement: "end",
605
- variant: "filled",
606
- maxHeight: "9999px",
607
- footer: footer,
608
- children: body
646
+ 'user' === message.role ? /*#__PURE__*/ jsx(UserMessageGroup, {
647
+ message: message,
648
+ labels: labels,
649
+ onOpenUri: onOpenUri,
650
+ footer: footer
609
651
  }) : message.streaming && 0 === message.parts.length ? /*#__PURE__*/ jsx(Bubble, {
610
652
  loading: true,
611
653
  placement: "start",
@@ -11701,7 +11701,6 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
11701
11701
  border: 1px solid var(--ov-viking-bot-border);
11702
11702
  border-radius: var(--ov-viking-bot-radius);
11703
11703
  max-width: 100%;
11704
- color: var(--ov-viking-bot-accent);
11705
11704
  font: inherit;
11706
11705
  overflow-wrap: anywhere;
11707
11706
  cursor: pointer;
@@ -11711,6 +11710,14 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
11711
11710
  font-size: 12px;
11712
11711
  }
11713
11712
 
11713
+ .ov-viking-bot__context {
11714
+ color: var(--ov-viking-bot-accent);
11715
+ }
11716
+
11717
+ .ov-viking-bot__attachment {
11718
+ color: var(--ov-ui-color-text-2, var(--ov-ui-text-2-default));
11719
+ }
11720
+
11714
11721
  .ov-viking-bot__context:hover, .ov-viking-bot__attachment:hover {
11715
11722
  background: var(--ov-viking-bot-surface-hover);
11716
11723
  }
@@ -13487,6 +13494,23 @@ textarea.ov-viking-bot__interaction-input {
13487
13494
  }
13488
13495
  }
13489
13496
 
13497
+ /*!
13498
+ * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
13499
+ * SPDX-License-Identifier: MIT
13500
+ */
13501
+ /*!
13502
+ * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
13503
+ * SPDX-License-Identifier: MIT
13504
+ */
13505
+ .ark-agentic-user-message-file-list-user-message-file-list-1 {
13506
+ justify-content: flex-end;
13507
+ align-items: flex-start;
13508
+ gap: .5rem;
13509
+ width: 100%;
13510
+ display: flex;
13511
+ overflow: auto hidden;
13512
+ }
13513
+
13490
13514
  /*!
13491
13515
  * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
13492
13516
  * SPDX-License-Identifier: MIT
@@ -20060,54 +20084,134 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
20060
20084
  outline: none;
20061
20085
  }
20062
20086
 
20063
- .ov-viking-bot__reference-tags {
20064
- flex-wrap: wrap;
20087
+ .ov-viking-bot__quick-inputs button:not(.ov-button):focus-visible, .ov-viking-bot__session-history button:not(.ov-button):focus-visible {
20088
+ outline: 2px solid var(--ov-ui-color-focus, var(--ov-ui-focus-default));
20089
+ outline-offset: 2px;
20090
+ }
20091
+
20092
+ .ov-viking-bot__quick-inputs button:not(.ov-button):disabled {
20093
+ opacity: .5;
20094
+ cursor: not-allowed;
20095
+ }
20096
+
20097
+ .ov-viking-bot__attach > svg {
20098
+ width: 10.208px;
20099
+ height: 10.208px;
20100
+ }
20101
+
20102
+ .ov-viking-bot__reference-tags, .ov-viking-bot__reference-overflow {
20103
+ flex-direction: column;
20104
+ align-items: flex-start;
20065
20105
  gap: 6px;
20066
- margin: 0 0 8px;
20067
- padding: 0;
20068
- list-style: none;
20106
+ min-width: 0;
20069
20107
  display: flex;
20070
20108
  }
20071
20109
 
20072
- .ov-viking-bot__reference-tags li {
20073
- background: var(--ov-ui-color-bg-5, var(--ov-ui-bg-5-default));
20074
- border-radius: 6px;
20110
+ .ov-viking-bot__reference-tags {
20111
+ margin-bottom: 10px;
20112
+ }
20113
+
20114
+ .ov-viking-bot__reference-row {
20075
20115
  align-items: center;
20076
20116
  gap: 4px;
20077
20117
  min-width: 0;
20078
20118
  max-width: 100%;
20079
- padding: 4px 6px;
20119
+ display: flex;
20120
+ }
20121
+
20122
+ .ov-viking-bot__reference-tag, .ov-viking-bot__reference-more {
20123
+ box-sizing: border-box;
20124
+ background: var(--ov-ui-color-bg-3, var(--ov-ui-bg-3-default));
20125
+ max-width: 100%;
20126
+ height: 26px;
20127
+ color: var(--ov-ui-color-text-2, var(--ov-ui-text-2-default));
20128
+ letter-spacing: .036px;
20129
+ border: 0;
20130
+ border-radius: 6px;
20131
+ align-items: center;
20132
+ gap: 4px;
20133
+ padding: 3px 8px;
20134
+ font-family: Roboto, PingFang SC, sans-serif;
20135
+ font-size: 12px;
20136
+ font-weight: 400;
20137
+ line-height: 20px;
20080
20138
  display: inline-flex;
20081
20139
  }
20082
20140
 
20083
- .ov-viking-bot__reference-tags li > span {
20141
+ .ov-viking-bot__reference-tag {
20142
+ min-width: 0;
20143
+ }
20144
+
20145
+ .ov-viking-bot__reference-tag > svg {
20146
+ flex-shrink: 0;
20147
+ }
20148
+
20149
+ .ov-viking-bot__reference-icon {
20150
+ color: var(--ov-ui-viking-bot-reference-icon-light);
20151
+ }
20152
+
20153
+ .dark .ov-viking-bot__reference-icon {
20154
+ color: var(--ov-ui-viking-bot-reference-icon-dark);
20155
+ }
20156
+
20157
+ .ov-viking-bot__reference-path {
20084
20158
  text-overflow: ellipsis;
20085
20159
  white-space: nowrap;
20086
20160
  min-width: 0;
20087
20161
  overflow: hidden;
20088
20162
  }
20089
20163
 
20090
- .ov-viking-bot__reference-tags button:not(.ov-button) {
20164
+ .ov-viking-bot__reference-open {
20165
+ min-width: 0;
20091
20166
  color: inherit;
20167
+ font: inherit;
20168
+ text-align: start;
20092
20169
  cursor: pointer;
20093
20170
  background: none;
20094
20171
  border: 0;
20095
- padding: 0 2px;
20172
+ padding: 0;
20173
+ display: inline-flex;
20174
+ overflow: hidden;
20175
+ }
20176
+
20177
+ .ov-viking-bot__reference-open:hover {
20178
+ color: var(--ov-ui-color-primary, var(--ov-ui-primary-default));
20179
+ }
20180
+
20181
+ .ov-viking-bot__reference-remove {
20182
+ width: 14px;
20183
+ height: 14px;
20184
+ color: var(--ov-ui-color-text-3, var(--ov-ui-text-3-default));
20185
+ cursor: pointer;
20186
+ background: none;
20187
+ border: 0;
20188
+ border-radius: 2px;
20189
+ flex-shrink: 0;
20190
+ justify-content: center;
20191
+ align-items: center;
20192
+ padding: 0;
20193
+ display: inline-flex;
20194
+ }
20195
+
20196
+ .ov-viking-bot__reference-more {
20197
+ cursor: pointer;
20198
+ flex-shrink: 0;
20096
20199
  }
20097
20200
 
20098
- .ov-viking-bot__quick-inputs button:not(.ov-button):focus-visible, .ov-viking-bot__session-history button:not(.ov-button):focus-visible, .ov-viking-bot__reference-tags button:not(.ov-button):focus-visible {
20201
+ .ov-viking-bot__reference-open:focus-visible, .ov-viking-bot__reference-more:focus-visible, .ov-viking-bot__reference-remove:focus-visible {
20099
20202
  outline: 2px solid var(--ov-ui-color-focus, var(--ov-ui-focus-default));
20100
20203
  outline-offset: 2px;
20101
20204
  }
20102
20205
 
20103
- .ov-viking-bot__quick-inputs button:not(.ov-button):disabled {
20104
- opacity: .5;
20206
+ .ov-viking-bot__reference-remove:disabled {
20105
20207
  cursor: not-allowed;
20208
+ opacity: .5;
20106
20209
  }
20107
20210
 
20108
- .ov-viking-bot__attach > svg {
20109
- width: 10.208px;
20110
- height: 10.208px;
20211
+ .ov-viking-bot__reference-overflow {
20212
+ max-width: min(440px, 100vw - 48px);
20213
+ max-height: min(360px, 50vh);
20214
+ overflow-y: auto;
20111
20215
  }
20112
20216
 
20113
20217
  .ov-viking-bot__list {
@@ -20128,6 +20232,15 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
20128
20232
  padding-left: 32px;
20129
20233
  }
20130
20234
 
20235
+ .ov-viking-bot__user-message-group {
20236
+ flex-direction: column;
20237
+ align-items: flex-end;
20238
+ gap: 6px;
20239
+ width: min(88%, 960px);
20240
+ max-width: 100%;
20241
+ display: flex;
20242
+ }
20243
+
20131
20244
  .ov-viking-bot__user-bubble {
20132
20245
  --agentic-bubble-content-max-width: 100%;
20133
20246
  --agentic-bubble-content-filled-bg: var(--ov-ui-color-bg-3, var(--ov-ui-bg-3-default));
@@ -20136,10 +20249,30 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
20136
20249
  --agentic-bubble-content-radius-default: 16px;
20137
20250
  --agentic-bubble-content-font-size: 14px;
20138
20251
  --agentic-bubble-content-line-height: 22px;
20139
- width: min(88%, 960px);
20140
20252
  max-width: 100%;
20141
20253
  }
20142
20254
 
20255
+ .ov-viking-bot__user-message-content {
20256
+ flex-direction: column;
20257
+ align-items: flex-start;
20258
+ gap: 6px;
20259
+ width: max-content;
20260
+ max-width: 100%;
20261
+ display: flex;
20262
+ }
20263
+
20264
+ .ov-viking-bot__user-message-attachments {
20265
+ flex-wrap: wrap;
20266
+ justify-content: flex-end;
20267
+ align-self: flex-end;
20268
+ align-items: center;
20269
+ gap: 8px;
20270
+ width: 100%;
20271
+ max-width: 100%;
20272
+ display: flex;
20273
+ overflow: visible;
20274
+ }
20275
+
20143
20276
  .ov-viking-bot__user-bubble .ark-agentic-bubble__content {
20144
20277
  inline-size: max-content;
20145
20278
  max-inline-size: 100%;
@@ -20185,7 +20318,7 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
20185
20318
  display: inline-flex;
20186
20319
  }
20187
20320
 
20188
- .ov-viking-bot__message:hover .ov-viking-bot__message-footer, .ov-viking-bot__message:focus-within .ov-viking-bot__message-footer {
20321
+ .ov-viking-bot__message:not(.ov-viking-bot__message--user):hover .ov-viking-bot__message-footer, .ov-viking-bot__message:not(.ov-viking-bot__message--user):focus-within .ov-viking-bot__message-footer, .ov-viking-bot__user-message-group:hover .ov-viking-bot__message-footer, .ov-viking-bot__user-message-group:focus-within .ov-viking-bot__message-footer {
20189
20322
  opacity: 1;
20190
20323
  pointer-events: auto;
20191
20324
  }
@@ -1,9 +1,10 @@
1
1
  import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
2
  /** Private non-modal popover shared by history and the reference toolbar. */
3
- export declare function BotPopover({ label, trigger: renderTrigger, children, placement, onOpen, }: {
3
+ export declare function BotPopover({ label, trigger: renderTrigger, children, placement, onOpen, hover, }: {
4
4
  label: string;
5
5
  trigger: (props: ButtonHTMLAttributes<HTMLButtonElement>) => ReactNode;
6
6
  children: (close: () => void) => ReactNode;
7
7
  placement?: 'top' | 'bottom';
8
8
  onOpen?: () => void;
9
+ hover?: boolean;
9
10
  }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { VikingBotReferences } from './capabilities.js';
2
+ import type { VikingBotLabels } from './model.js';
3
+ export declare function ReferenceTags({ config, labels, disabled, onOpenUri, }: {
4
+ config?: VikingBotReferences;
5
+ labels: Required<VikingBotLabels>;
6
+ disabled?: boolean;
7
+ onOpenUri?: (uri: string) => void;
8
+ }): import("react").JSX.Element | null;
@@ -13,8 +13,3 @@ export declare function ReferenceButton({ locale, config, disabled, labels, send
13
13
  locale: Locale;
14
14
  senderRef: RefObject<SenderInstance | null>;
15
15
  }): import("react").JSX.Element;
16
- export declare function ReferenceTags({ config, labels, disabled, }: {
17
- config?: VikingBotReferences;
18
- labels: Required<VikingBotLabels>;
19
- disabled?: boolean;
20
- }): import("react").JSX.Element | null;
@@ -13,6 +13,7 @@ declare const messages: {
13
13
  searchReferences: string;
14
14
  emptyReferences: string;
15
15
  removeReference: string;
16
+ openReference: string;
16
17
  expandReference: string;
17
18
  collapseReference: string;
18
19
  welcomeTitle: string;
@@ -13,6 +13,7 @@ declare const messages: {
13
13
  searchReferences: string;
14
14
  emptyReferences: string;
15
15
  removeReference: string;
16
+ openReference: string;
16
17
  expandReference: string;
17
18
  collapseReference: string;
18
19
  welcomeTitle: string;
@@ -237,6 +237,7 @@ export interface VikingBotLabels {
237
237
  searchReferences?: string;
238
238
  emptyReferences?: string;
239
239
  removeReference?: string;
240
+ openReference?: string;
240
241
  expandReference?: string;
241
242
  collapseReference?: string;
242
243
  /** 欢迎标题。Welcome heading. */
@@ -0,0 +1,3 @@
1
+ import type { KeyboardEvent } from 'react';
2
+ /** Match the native popover's logical Tab order across the portal boundary. */
3
+ export declare function navigatePopoverTab(event: KeyboardEvent<HTMLElement>, anchor: HTMLElement | null, surface: HTMLElement | null, close: () => void): void;
@@ -703,7 +703,6 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
703
703
  border: 1px solid var(--ov-viking-bot-border);
704
704
  border-radius: var(--ov-viking-bot-radius);
705
705
  max-width: 100%;
706
- color: var(--ov-viking-bot-accent);
707
706
  font: inherit;
708
707
  overflow-wrap: anywhere;
709
708
  cursor: pointer;
@@ -713,6 +712,14 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
713
712
  font-size: 12px;
714
713
  }
715
714
 
715
+ .ov-viking-bot__context {
716
+ color: var(--ov-viking-bot-accent);
717
+ }
718
+
719
+ .ov-viking-bot__attachment {
720
+ color: var(--ov-ui-color-text-2, var(--ov-ui-text-2-default));
721
+ }
722
+
716
723
  .ov-viking-bot__context:hover, .ov-viking-bot__attachment:hover {
717
724
  background: var(--ov-viking-bot-surface-hover);
718
725
  }
@@ -2489,6 +2496,23 @@ textarea.ov-viking-bot__interaction-input {
2489
2496
  }
2490
2497
  }
2491
2498
 
2499
+ /*!
2500
+ * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
2501
+ * SPDX-License-Identifier: MIT
2502
+ */
2503
+ /*!
2504
+ * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
2505
+ * SPDX-License-Identifier: MIT
2506
+ */
2507
+ .ark-agentic-user-message-file-list-user-message-file-list-1 {
2508
+ justify-content: flex-end;
2509
+ align-items: flex-start;
2510
+ gap: .5rem;
2511
+ width: 100%;
2512
+ display: flex;
2513
+ overflow: auto hidden;
2514
+ }
2515
+
2492
2516
  /*!
2493
2517
  * Copyright (c) 2026 Bytedance, Inc. and its affiliates.
2494
2518
  * SPDX-License-Identifier: MIT
@@ -9062,54 +9086,134 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
9062
9086
  outline: none;
9063
9087
  }
9064
9088
 
9065
- .ov-viking-bot__reference-tags {
9066
- flex-wrap: wrap;
9089
+ .ov-viking-bot__quick-inputs button:not(.ov-button):focus-visible, .ov-viking-bot__session-history button:not(.ov-button):focus-visible {
9090
+ outline: 2px solid var(--ov-ui-color-focus, var(--ov-ui-focus-default));
9091
+ outline-offset: 2px;
9092
+ }
9093
+
9094
+ .ov-viking-bot__quick-inputs button:not(.ov-button):disabled {
9095
+ opacity: .5;
9096
+ cursor: not-allowed;
9097
+ }
9098
+
9099
+ .ov-viking-bot__attach > svg {
9100
+ width: 10.208px;
9101
+ height: 10.208px;
9102
+ }
9103
+
9104
+ .ov-viking-bot__reference-tags, .ov-viking-bot__reference-overflow {
9105
+ flex-direction: column;
9106
+ align-items: flex-start;
9067
9107
  gap: 6px;
9068
- margin: 0 0 8px;
9069
- padding: 0;
9070
- list-style: none;
9108
+ min-width: 0;
9071
9109
  display: flex;
9072
9110
  }
9073
9111
 
9074
- .ov-viking-bot__reference-tags li {
9075
- background: var(--ov-ui-color-bg-5, var(--ov-ui-bg-5-default));
9076
- border-radius: 6px;
9112
+ .ov-viking-bot__reference-tags {
9113
+ margin-bottom: 10px;
9114
+ }
9115
+
9116
+ .ov-viking-bot__reference-row {
9077
9117
  align-items: center;
9078
9118
  gap: 4px;
9079
9119
  min-width: 0;
9080
9120
  max-width: 100%;
9081
- padding: 4px 6px;
9121
+ display: flex;
9122
+ }
9123
+
9124
+ .ov-viking-bot__reference-tag, .ov-viking-bot__reference-more {
9125
+ box-sizing: border-box;
9126
+ background: var(--ov-ui-color-bg-3, var(--ov-ui-bg-3-default));
9127
+ max-width: 100%;
9128
+ height: 26px;
9129
+ color: var(--ov-ui-color-text-2, var(--ov-ui-text-2-default));
9130
+ letter-spacing: .036px;
9131
+ border: 0;
9132
+ border-radius: 6px;
9133
+ align-items: center;
9134
+ gap: 4px;
9135
+ padding: 3px 8px;
9136
+ font-family: Roboto, PingFang SC, sans-serif;
9137
+ font-size: 12px;
9138
+ font-weight: 400;
9139
+ line-height: 20px;
9082
9140
  display: inline-flex;
9083
9141
  }
9084
9142
 
9085
- .ov-viking-bot__reference-tags li > span {
9143
+ .ov-viking-bot__reference-tag {
9144
+ min-width: 0;
9145
+ }
9146
+
9147
+ .ov-viking-bot__reference-tag > svg {
9148
+ flex-shrink: 0;
9149
+ }
9150
+
9151
+ .ov-viking-bot__reference-icon {
9152
+ color: var(--ov-ui-viking-bot-reference-icon-light);
9153
+ }
9154
+
9155
+ .dark .ov-viking-bot__reference-icon {
9156
+ color: var(--ov-ui-viking-bot-reference-icon-dark);
9157
+ }
9158
+
9159
+ .ov-viking-bot__reference-path {
9086
9160
  text-overflow: ellipsis;
9087
9161
  white-space: nowrap;
9088
9162
  min-width: 0;
9089
9163
  overflow: hidden;
9090
9164
  }
9091
9165
 
9092
- .ov-viking-bot__reference-tags button:not(.ov-button) {
9166
+ .ov-viking-bot__reference-open {
9167
+ min-width: 0;
9093
9168
  color: inherit;
9169
+ font: inherit;
9170
+ text-align: start;
9094
9171
  cursor: pointer;
9095
9172
  background: none;
9096
9173
  border: 0;
9097
- padding: 0 2px;
9174
+ padding: 0;
9175
+ display: inline-flex;
9176
+ overflow: hidden;
9098
9177
  }
9099
9178
 
9100
- .ov-viking-bot__quick-inputs button:not(.ov-button):focus-visible, .ov-viking-bot__session-history button:not(.ov-button):focus-visible, .ov-viking-bot__reference-tags button:not(.ov-button):focus-visible {
9179
+ .ov-viking-bot__reference-open:hover {
9180
+ color: var(--ov-ui-color-primary, var(--ov-ui-primary-default));
9181
+ }
9182
+
9183
+ .ov-viking-bot__reference-remove {
9184
+ width: 14px;
9185
+ height: 14px;
9186
+ color: var(--ov-ui-color-text-3, var(--ov-ui-text-3-default));
9187
+ cursor: pointer;
9188
+ background: none;
9189
+ border: 0;
9190
+ border-radius: 2px;
9191
+ flex-shrink: 0;
9192
+ justify-content: center;
9193
+ align-items: center;
9194
+ padding: 0;
9195
+ display: inline-flex;
9196
+ }
9197
+
9198
+ .ov-viking-bot__reference-more {
9199
+ cursor: pointer;
9200
+ flex-shrink: 0;
9201
+ }
9202
+
9203
+ .ov-viking-bot__reference-open:focus-visible, .ov-viking-bot__reference-more:focus-visible, .ov-viking-bot__reference-remove:focus-visible {
9101
9204
  outline: 2px solid var(--ov-ui-color-focus, var(--ov-ui-focus-default));
9102
9205
  outline-offset: 2px;
9103
9206
  }
9104
9207
 
9105
- .ov-viking-bot__quick-inputs button:not(.ov-button):disabled {
9106
- opacity: .5;
9208
+ .ov-viking-bot__reference-remove:disabled {
9107
9209
  cursor: not-allowed;
9210
+ opacity: .5;
9108
9211
  }
9109
9212
 
9110
- .ov-viking-bot__attach > svg {
9111
- width: 10.208px;
9112
- height: 10.208px;
9213
+ .ov-viking-bot__reference-overflow {
9214
+ max-width: min(440px, 100vw - 48px);
9215
+ max-height: min(360px, 50vh);
9216
+ overflow-y: auto;
9113
9217
  }
9114
9218
 
9115
9219
  .ov-viking-bot__list {
@@ -9130,6 +9234,15 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
9130
9234
  padding-left: 32px;
9131
9235
  }
9132
9236
 
9237
+ .ov-viking-bot__user-message-group {
9238
+ flex-direction: column;
9239
+ align-items: flex-end;
9240
+ gap: 6px;
9241
+ width: min(88%, 960px);
9242
+ max-width: 100%;
9243
+ display: flex;
9244
+ }
9245
+
9133
9246
  .ov-viking-bot__user-bubble {
9134
9247
  --agentic-bubble-content-max-width: 100%;
9135
9248
  --agentic-bubble-content-filled-bg: var(--ov-ui-color-bg-3, var(--ov-ui-bg-3-default));
@@ -9138,10 +9251,30 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
9138
9251
  --agentic-bubble-content-radius-default: 16px;
9139
9252
  --agentic-bubble-content-font-size: 14px;
9140
9253
  --agentic-bubble-content-line-height: 22px;
9141
- width: min(88%, 960px);
9142
9254
  max-width: 100%;
9143
9255
  }
9144
9256
 
9257
+ .ov-viking-bot__user-message-content {
9258
+ flex-direction: column;
9259
+ align-items: flex-start;
9260
+ gap: 6px;
9261
+ width: max-content;
9262
+ max-width: 100%;
9263
+ display: flex;
9264
+ }
9265
+
9266
+ .ov-viking-bot__user-message-attachments {
9267
+ flex-wrap: wrap;
9268
+ justify-content: flex-end;
9269
+ align-self: flex-end;
9270
+ align-items: center;
9271
+ gap: 8px;
9272
+ width: 100%;
9273
+ max-width: 100%;
9274
+ display: flex;
9275
+ overflow: visible;
9276
+ }
9277
+
9145
9278
  .ov-viking-bot__user-bubble .ark-agentic-bubble__content {
9146
9279
  inline-size: max-content;
9147
9280
  max-inline-size: 100%;
@@ -9187,7 +9320,7 @@ html.dark .ov-wiki-dashboard, html.dark .ov-experience-dashboard, html.dark .ov-
9187
9320
  display: inline-flex;
9188
9321
  }
9189
9322
 
9190
- .ov-viking-bot__message:hover .ov-viking-bot__message-footer, .ov-viking-bot__message:focus-within .ov-viking-bot__message-footer {
9323
+ .ov-viking-bot__message:not(.ov-viking-bot__message--user):hover .ov-viking-bot__message-footer, .ov-viking-bot__message:not(.ov-viking-bot__message--user):focus-within .ov-viking-bot__message-footer, .ov-viking-bot__user-message-group:hover .ov-viking-bot__message-footer, .ov-viking-bot__user-message-group:focus-within .ov-viking-bot__message-footer {
9191
9324
  opacity: 1;
9192
9325
  pointer-events: auto;
9193
9326
  }
@@ -73,6 +73,8 @@ export interface VikingBotComposerProps extends VikingBotInputFeatures {
73
73
  onFilesAdded?: (files: readonly File[]) => void;
74
74
  /** 移除一个附件。Removes an attachment. */
75
75
  onAttachmentRemove?: (attachment: VikingBotAttachment) => void;
76
+ /** 打开已选中的文件或目录引用。Opens a selected file or directory reference. */
77
+ onOpenUri?: (uri: string) => void;
76
78
  /** 上报发送意图;由宿主发送并清空草稿。省略时不能发送。Reports the send intent. */
77
79
  onSend?: (draft: VikingBotDraft) => void;
78
80
  /** 停止正在进行的回复。省略时不展示停止动作。Stops the streaming reply. */
@@ -141,7 +143,7 @@ export interface VikingBotProps extends VikingBotInputFeatures, Omit<HTMLAttribu
141
143
  onSend?: (draft: VikingBotDraft) => void;
142
144
  /** 停止正在进行的回复。Stops the streaming reply. */
143
145
  onCancel?: () => void;
144
- /** 打开消息中引用的资源。Opens a resource referenced by a message. */
146
+ /** 打开消息资源或输入区引用。Opens a message resource or composer reference. */
145
147
  onOpenUri?: (uri: string) => void;
146
148
  /** 复制由宿主执行,组件只上报意图。The host copies; the component reports intent. */
147
149
  onCopy?: (text: string) => void;
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { VikingBotMessage } from './model.js';
3
+ import type { VikingBotMessageListProps } from './types.js';
4
+ export declare function UserMessageGroup({ message, labels, footer, onOpenUri, }: {
5
+ message: VikingBotMessage;
6
+ labels: NonNullable<VikingBotMessageListProps['labels']>;
7
+ footer: ReactNode;
8
+ onOpenUri?: (uri: string) => void;
9
+ }): import("react").JSX.Element | null;