@farris/x-ui 0.5.1 → 0.5.3

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.
@@ -1,7 +1,8 @@
1
1
  import { Plugin } from '../../vue';
2
2
  import { default as FXInputRecommend } from '../../src/input-recommend.component';
3
+ import { default as FXFollowupRecommendList } from '../../src/followup-recommend-list.component';
3
4
 
4
5
  export * from '../../src/types';
5
- export { FXInputRecommend };
6
+ export { FXInputRecommend, FXFollowupRecommendList };
6
7
  declare const _default: typeof FXInputRecommend & Plugin;
7
8
  export default _default;
@@ -0,0 +1,45 @@
1
+ import { PropType } from '../../../vue';
2
+ import { MessageContentInputRecommend } from '../../../types';
3
+
4
+ /**
5
+ * `agent/followup-suggestions` 归一化后的推荐问题列表。
6
+ * 与 {@link FXInputRecommend}(输入框上方芯片)同属 {@link MessageContentInputRecommend} 类型,
7
+ * 但以「助手回答工具栏下方列表」形态渲染,每条提供两种交互:
8
+ * - 点击左侧图标:把该问题追加到输入框(由外层 onAppend 处理);
9
+ * - 点击右侧文本:直接以该问题作为消息发送(由外层 onSend 处理)。
10
+ */
11
+ declare const _default: import('../../../vue').DefineComponent<import('../../../vue').ExtractPropTypes<{
12
+ content: {
13
+ type: PropType<MessageContentInputRecommend>;
14
+ required: true;
15
+ };
16
+ /** 点击文本直接发送(携带问题原文) */
17
+ onSend: {
18
+ type: PropType<(text: string) => void>;
19
+ default: undefined;
20
+ };
21
+ /** 点击图标追加到输入框(携带问题原文) */
22
+ onAppend: {
23
+ type: PropType<(text: string) => void>;
24
+ default: undefined;
25
+ };
26
+ }>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('../../../vue').ComponentOptionsMixin, import('../../../vue').ComponentOptionsMixin, {}, string, import('../../../vue').PublicProps, Readonly<import('../../../vue').ExtractPropTypes<{
27
+ content: {
28
+ type: PropType<MessageContentInputRecommend>;
29
+ required: true;
30
+ };
31
+ /** 点击文本直接发送(携带问题原文) */
32
+ onSend: {
33
+ type: PropType<(text: string) => void>;
34
+ default: undefined;
35
+ };
36
+ /** 点击图标追加到输入框(携带问题原文) */
37
+ onAppend: {
38
+ type: PropType<(text: string) => void>;
39
+ default: undefined;
40
+ };
41
+ }>> & Readonly<{}>, {
42
+ onSend: (text: string) => void;
43
+ onAppend: (text: string) => void;
44
+ }, {}, {}, {}, string, import('../../../vue').ComponentProvideOptions, true, {}, any>;
45
+ export default _default;
@@ -18,7 +18,7 @@ export interface InputRecommendPickAction {
18
18
  }
19
19
  export interface MessageContentInputRecommend {
20
20
  type: 'InputRecommend';
21
- standardType?: 'agent/suggestions' | 'agent/input-recommend' | string;
21
+ standardType?: 'agent/suggestions' | 'agent/input-recommend' | 'agent/followup-suggestions' | string;
22
22
  title?: string;
23
23
  suggestions: string[];
24
24
  /**
@@ -30,4 +30,12 @@ export interface MessageContentInputRecommend {
30
30
  * 整卡默认点击动作。网关也可只传 `pickAction`(与该项同义,由归一化层写入)。
31
31
  */
32
32
  pickActionDefault?: InputRecommendPickAction;
33
+ /**
34
+ * `agent/followup-suggestions` 专属:本次推荐批次唯一标识,点击回传作 `fromSuggestion` 埋点。
35
+ */
36
+ suggestionId?: string;
37
+ /**
38
+ * `agent/followup-suggestions` 专属:本条建议归属的回答消息 id。
39
+ */
40
+ replyToMessageId?: string;
33
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farris/x-ui",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "可复用的 AI 对话组件",
5
5
  "type": "module",
6
6
  "main": "./farris.x-ui.umd.cjs",
@@ -18,10 +18,12 @@ export interface UseHost {
18
18
  hostWidth: ComputedRef<number>;
19
19
  hostHeight: ComputedRef<number>;
20
20
  hostBottom: ComputedRef<number>;
21
+ refreshWindowSize: () => void;
21
22
  }
22
23
  export interface UsePopup {
23
24
  hidePopverOnClickBodyHandler: ($event: MouseEvent) => any;
24
25
  showPopover: Ref<boolean>;
26
+ hide: () => Promise<void>;
25
27
  }
26
28
  export interface UseResize {
27
29
  onResize: () => void;
@@ -2,4 +2,4 @@ import { Ref, SetupContext } from '../../../../vue';
2
2
  import { PopoverProps } from '../../../../../popover.props';
3
3
  import { UsePosition, UseResize } from '../../../../types';
4
4
 
5
- export declare function useResize(props: PopoverProps, context: SetupContext, reference: Ref<any>, shouldFitWidthToReference: Ref<boolean>, positionComposition: UsePosition, popoverRef: Ref<any>): UseResize;
5
+ export declare function useResize(props: PopoverProps, context: SetupContext, reference: Ref<any>, shouldFitWidthToReference: Ref<boolean>, positionComposition: UsePosition, popoverRef: Ref<any>, hide: () => void, refreshWindowSize: () => void): UseResize;
@@ -16,6 +16,7 @@ declare const _default: import('../../../vue').DefineComponent<{
16
16
  limitContentBySpace: boolean;
17
17
  enableDrag: boolean;
18
18
  renderWhenShown: boolean;
19
+ hideOnResize: boolean;
19
20
  title?: string | undefined;
20
21
  id?: string | undefined;
21
22
  host?: any;
@@ -41,6 +42,7 @@ declare const _default: import('../../../vue').DefineComponent<{
41
42
  limitContentBySpace: boolean;
42
43
  enableDrag: boolean;
43
44
  renderWhenShown: boolean;
45
+ hideOnResize: boolean;
44
46
  title?: string | undefined;
45
47
  id?: string | undefined;
46
48
  host?: any;
@@ -66,5 +68,6 @@ declare const _default: import('../../../vue').DefineComponent<{
66
68
  limitContentBySpace: boolean;
67
69
  enableDrag: boolean;
68
70
  renderWhenShown: boolean;
71
+ hideOnResize: boolean;
69
72
  }, {}, {}, {}, string, import('../../../vue').ComponentProvideOptions, true, {}, any>;
70
73
  export default _default;
@@ -124,5 +124,13 @@ export declare const popoverProps: {
124
124
  type: BooleanConstructor;
125
125
  default: boolean;
126
126
  };
127
+ /**
128
+ * 窗口尺寸变化(resize)时自动关闭 popover,避免定位偏移。
129
+ * 默认 false,保持原有跟随 reference 重新定位的行为。
130
+ */
131
+ hideOnResize: {
132
+ type: BooleanConstructor;
133
+ default: boolean;
134
+ };
127
135
  };
128
136
  export type PopoverProps = ExtractPropTypes<typeof popoverProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,9 +4,9 @@ import { IconStatus } from '../../../../type';
4
4
  type StatusIconVariant = 'todo' | 'thinking' | 'tool-use' | 'attachment' | '';
5
5
  /** 状态图标:
6
6
  *
7
- 'NotStart' :未开始,默认绿色圆圈 任务场景下,未开始是灰色圆圈。
8
- 'Working' :进行中,默认绿色转圈。任务场景下,进行中是灰色圆圈。
9
- 'Done':已完成,默认绿色空心对号。任务场景下,完成是绿色实心对号
7
+ 'NotStart' :未开始,默认绿色圆圈。任务场景下是灰色空心圆。
8
+ 'Working' :进行中,默认绿色转圈。任务场景下是蓝色空心圆。
9
+ 'Done':已完成,默认绿色空心对号。任务场景下是绿色实心对号。
10
10
  'Error ':失败,默认红色
11
11
  */
12
12
  export declare function StatusIcon({ status, variant }: {