@vuagent/ui 0.6.0 → 0.7.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.
@@ -0,0 +1,30 @@
1
+ import { TurnRailProps, TurnRailItem } from './types';
2
+ declare function measure(): void;
3
+ declare function scrollToAnchor(id: string): void;
4
+ declare const _default: import('vue').DefineComponent<TurnRailProps, {
5
+ /** 手动重算当前轮(宿主内容变化但未触发 scroll/resize 时调用) */
6
+ measure: typeof measure;
7
+ /** 跳到某轮(等价于点击该标记) */
8
+ scrollTo: typeof scrollToAnchor;
9
+ /** 当前轮次 id */
10
+ activeId: import('vue').ComputedRef<string>;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
+ select: (id: string, index: number) => any;
13
+ "update:activeId": (id: string) => any;
14
+ }, string, import('vue').PublicProps, Readonly<TurnRailProps> & Readonly<{
15
+ onSelect?: ((id: string, index: number) => any) | undefined;
16
+ "onUpdate:activeId"?: ((id: string) => any) | undefined;
17
+ }>, {
18
+ preview: boolean;
19
+ offset: number;
20
+ items: TurnRailItem[];
21
+ ariaLabel: string;
22
+ activeId: string;
23
+ floating: boolean;
24
+ container: HTMLElement | null;
25
+ anchorAttr: string;
26
+ minItems: number;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
28
+ rootRef: HTMLElement;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default as VaTurnRail } from './VaTurnRail.vue';
2
+ export type { TurnRailEvents, TurnRailItem, TurnRailProps } from './types';
@@ -0,0 +1,37 @@
1
+ /** 右侧轮次跳转轨上的一枚标记(一条 = 一个可跳转锚点) */
2
+ export interface TurnRailItem {
3
+ /** 轮次 id,需与滚动容器内锚点元素上的属性(默认 data-turn-id)取值一致 */
4
+ id: string;
5
+ /** 悬停/聚焦时预览卡里的文案(缺省回退为「第 N 轮」) */
6
+ label?: string;
7
+ /** 角色:user 实心点(提问) / assistant 空心点(回复),缺省 user */
8
+ role?: "user" | "assistant";
9
+ /** 状态:streaming 呼吸脉冲;error 危险色;done/缺省为常态 */
10
+ status?: "streaming" | "done" | "error";
11
+ }
12
+ export interface TurnRailProps {
13
+ /** 轮次标记(顺序即对话顺序,与容器内锚点从上到下一致) */
14
+ items: TurnRailItem[];
15
+ /** 滚动容器元素;传入才启用点击跳转与滚动跟随(SSR / 未挂载可省略) */
16
+ container?: HTMLElement | null;
17
+ /** 锚点属性名,默认 data-turn-id(取值须等于 item.id) */
18
+ anchorAttr?: string;
19
+ /** 跳转后锚点距容器顶部的留白(px),默认 16 */
20
+ offset?: number;
21
+ /** 轮次数 ≤ 该值时自动隐藏(0 = 始终显示),默认 1 */
22
+ minItems?: number;
23
+ /** 悬停/聚焦预览卡,默认开启 */
24
+ preview?: boolean;
25
+ /** 悬浮定位(absolute 靠右垂直居中,父级需 position: relative),默认开启 */
26
+ floating?: boolean;
27
+ /** 受控当前轮次 id(不传则由滚动位置自算) */
28
+ activeId?: string;
29
+ /** 无障碍名称 */
30
+ ariaLabel?: string;
31
+ }
32
+ export interface TurnRailEvents {
33
+ /** 点击/键盘选中某轮(父级一般无需处理,滚动定位已由组件完成) */
34
+ (e: "select", id: string, index: number): void;
35
+ /** 当前轮次变化(滚动跟随或点击都会触发) */
36
+ (e: "update:activeId", id: string): void;
37
+ }
@@ -188,3 +188,5 @@ export { VaAssistantTurn } from './components/assistant-turn';
188
188
  export type { AssistantTurnProps, AssistantTurnEvents, TurnBlockItem, ActionCardItem, } from './components/assistant-turn';
189
189
  export { VaTurnList } from './components/turn-list';
190
190
  export type { TurnListProps, TurnListEvents, TurnItem } from './components/turn-list';
191
+ export { VaTurnRail } from './components/turn-rail';
192
+ export type { TurnRailProps, TurnRailEvents, TurnRailItem } from './components/turn-rail';