@opentiny/tiny-robot 0.4.2-alpha.4 → 0.4.2-alpha.6
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/dist/action-group/ActionGroup.vue.d.ts +26 -0
- package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
- package/dist/action-group/index.d.ts +12 -0
- package/dist/action-group/index.type.d.ts +17 -0
- package/dist/anchor/components/AnchorItem.vue.d.ts +24 -0
- package/dist/anchor/components/AnchorList.vue.d.ts +20 -0
- package/dist/anchor/components/AnchorOverlay.vue.d.ts +33 -0
- package/dist/anchor/components/AnchorSearch.vue.d.ts +7 -0
- package/dist/anchor/composables/index.d.ts +5 -0
- package/dist/anchor/composables/useActiveSync.d.ts +10 -0
- package/dist/anchor/composables/useFloatingOffset.d.ts +6 -0
- package/dist/anchor/composables/useNavController.d.ts +12 -0
- package/dist/anchor/composables/useOverlayInteractions.d.ts +6 -0
- package/dist/anchor/composables/useTargetFeedback.d.ts +5 -0
- package/dist/anchor/defaults.d.ts +16 -0
- package/dist/anchor/index.d.ts +7 -0
- package/dist/anchor/index.type.d.ts +60 -0
- package/dist/anchor/index.vue.d.ts +159 -0
- package/dist/anchor/internal.type.d.ts +103 -0
- package/dist/anchor/utils/scroll.d.ts +7 -0
- package/dist/anchor/utils/target.d.ts +6 -0
- package/dist/attachments/components/FileCard.vue.d.ts +18 -0
- package/dist/attachments/components/ImagePreview.vue.d.ts +17 -0
- package/dist/attachments/components/index.d.ts +2 -0
- package/dist/attachments/composables/index.d.ts +5 -0
- package/dist/attachments/composables/useFileCard.d.ts +15 -0
- package/dist/attachments/composables/useFileType.d.ts +20 -0
- package/dist/attachments/composables/useImagePreview.d.ts +18 -0
- package/dist/attachments/composables/useListType.d.ts +11 -0
- package/dist/attachments/index.d.ts +7 -0
- package/dist/attachments/index.js +2 -2
- package/dist/attachments/index.type.d.ts +70 -0
- package/dist/attachments/index.vue.d.ts +27 -0
- package/dist/attachments/utils.d.ts +3 -0
- package/dist/base-popper/components/Popper.vue.d.ts +28 -0
- package/dist/base-popper/index.d.ts +2 -0
- package/dist/base-popper/index.vue.d.ts +41 -0
- package/dist/bubble/Bubble.vue.d.ts +39 -0
- package/dist/bubble/BubbleBoxWrapper.vue.d.ts +22 -0
- package/dist/bubble/BubbleContentWrapper.vue.d.ts +16 -0
- package/dist/bubble/BubbleItem.vue.d.ts +36 -0
- package/dist/bubble/BubbleList.vue.d.ts +41 -0
- package/dist/bubble/BubbleProvider.vue.d.ts +18 -0
- package/dist/bubble/composables/index.d.ts +10 -0
- package/dist/bubble/composables/useBubbleBoxRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleContentRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleStateChange.d.ts +2 -0
- package/dist/bubble/composables/useBubbleStore.d.ts +16 -0
- package/dist/bubble/composables/useContentResolver.d.ts +5 -0
- package/dist/bubble/composables/useCopyCleanup.d.ts +6 -0
- package/dist/bubble/composables/useMessageContent.d.ts +5 -0
- package/dist/bubble/composables/useMessageGroup.d.ts +4 -0
- package/dist/bubble/composables/useOmitMessageFields.d.ts +12 -0
- package/dist/bubble/composables/useToolCall.d.ts +25 -0
- package/dist/bubble/constants.d.ts +42 -0
- package/dist/bubble/index.d.ts +19 -0
- package/dist/bubble/index.type.d.ts +171 -0
- package/dist/bubble/renderers/Box.vue.d.ts +18 -0
- package/dist/bubble/renderers/Image.vue.d.ts +4 -0
- package/dist/bubble/renderers/Loading.vue.d.ts +4 -0
- package/dist/bubble/renderers/Markdown.vue.d.ts +4 -0
- package/dist/bubble/renderers/Reasoning.vue.d.ts +9 -0
- package/dist/bubble/renderers/Text.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tool.vue.d.ts +14 -0
- package/dist/bubble/renderers/ToolRole.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tools.vue.d.ts +4 -0
- package/dist/bubble/renderers/allRenderers.d.ts +93 -0
- package/dist/bubble/renderers/defaultRenderers.d.ts +27 -0
- package/dist/bubble/utils.d.ts +7 -0
- package/dist/chat/components/ChatConversation.vue.d.ts +267 -0
- package/dist/chat/components/ChatLauncherButton.vue.d.ts +12 -0
- package/dist/chat/components/ChatMcpTrigger.vue.d.ts +30 -0
- package/dist/chat/components/ChatThemeToggleButton.vue.d.ts +6 -0
- package/dist/chat/components/ChatWelcome.vue.d.ts +14 -0
- package/dist/chat/components/icons/IconModelAliyunBailian.vue.d.ts +7 -0
- package/dist/chat/components/icons/IconModelDeepseek.vue.d.ts +7 -0
- package/dist/chat/components/icons/index.d.ts +5 -0
- package/dist/chat/composables/useChatConversation.d.ts +37 -0
- package/dist/chat/composables/useChatMcp.d.ts +29 -0
- package/dist/chat/composables/useChatModel.d.ts +27 -0
- package/dist/chat/index.d.ts +9 -0
- package/dist/chat/index.js +13902 -0
- package/dist/chat/index.type.d.ts +92 -0
- package/dist/chat/index.vue.d.ts +51 -0
- package/dist/chat/locale.d.ts +12 -0
- package/dist/chat/mcpServers.d.ts +3 -0
- package/dist/container/index.d.ts +7 -0
- package/dist/container/index.type.d.ts +20 -0
- package/dist/container/index.vue.d.ts +32 -0
- package/dist/conversations/index.d.ts +7 -0
- package/dist/conversations/index.vue.d.ts +2 -0
- package/dist/drag-overlay/constants.d.ts +17 -0
- package/dist/drag-overlay/directives/vDropzone.d.ts +14 -0
- package/dist/drag-overlay/index.d.ts +7 -0
- package/dist/drag-overlay/index.type.d.ts +105 -0
- package/dist/drag-overlay/index.vue.d.ts +20 -0
- package/dist/dropdown-menu/composables/usePopperHover.d.ts +6 -0
- package/dist/dropdown-menu/index.d.ts +7 -0
- package/dist/dropdown-menu/index.js +17 -17
- package/dist/dropdown-menu/index.type.d.ts +42 -0
- package/dist/dropdown-menu/index.vue.d.ts +217 -0
- package/dist/feedback/components/SourceList.vue.d.ts +11 -0
- package/dist/feedback/components/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +7 -0
- package/dist/feedback/index.type.d.ts +25 -0
- package/dist/feedback/index.vue.d.ts +13 -0
- package/dist/flow-layout-buttons/index.d.ts +7 -0
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/flow-layout-buttons/index.type.d.ts +35 -0
- package/dist/flow-layout-buttons/index.vue.d.ts +22 -0
- package/dist/history/components/Empty.vue.d.ts +7 -0
- package/dist/history/components/MenuList.vue.d.ts +24 -0
- package/dist/history/composables/useRenameEditor.d.ts +22 -0
- package/dist/history/constants.d.ts +1 -0
- package/dist/history/index.d.ts +7 -0
- package/dist/history/index.type.d.ts +33 -0
- package/dist/history/index.vue.d.ts +18 -0
- package/dist/icon-button/index.d.ts +7 -0
- package/dist/icon-button/index.type.d.ts +7 -0
- package/dist/icon-button/index.vue.d.ts +6 -0
- package/dist/index.d.ts +49 -5018
- package/dist/index.js +1 -1
- package/dist/mcp-add-form/components/CodeEditor.vue.d.ts +9 -0
- package/dist/mcp-add-form/components/FormEditor.vue.d.ts +10 -0
- package/dist/mcp-add-form/components/index.d.ts +2 -0
- package/dist/mcp-add-form/index.d.ts +7 -0
- package/dist/mcp-add-form/index.type.d.ts +19 -0
- package/dist/mcp-add-form/index.vue.d.ts +13 -0
- package/dist/mcp-server-picker/components/NoData.vue.d.ts +7 -0
- package/dist/mcp-server-picker/components/PluginCard.vue.d.ts +40 -0
- package/dist/mcp-server-picker/components/PluginModal.vue.d.ts +15 -0
- package/dist/mcp-server-picker/components/index.d.ts +3 -0
- package/dist/mcp-server-picker/index.d.ts +7 -0
- package/dist/mcp-server-picker/index.js +83 -80
- package/dist/mcp-server-picker/index.type.d.ts +99 -0
- package/dist/mcp-server-picker/index.vue.d.ts +71 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.type.d.ts +59 -0
- package/dist/prompts/prompt.vue.d.ts +5 -0
- package/dist/prompts/prompts.vue.d.ts +20 -0
- package/dist/sender/components/editor-content/index.vue.d.ts +4 -0
- package/dist/sender/components/footer/index.vue.d.ts +38 -0
- package/dist/sender/components/layouts/MultiLineLayout.vue.d.ts +43 -0
- package/dist/sender/components/layouts/SingleLineLayout.vue.d.ts +32 -0
- package/dist/sender/composables/index.d.ts +7 -0
- package/dist/sender/composables/useAutoSize.d.ts +5 -0
- package/dist/sender/composables/useEditor.d.ts +13 -0
- package/dist/sender/composables/useKeyboardShortcuts.d.ts +7 -0
- package/dist/sender/composables/useModeSwitch.d.ts +4 -0
- package/dist/sender/composables/useSenderCore.d.ts +31 -0
- package/dist/sender/composables/useSlotScope.d.ts +10 -0
- package/dist/sender/context/index.d.ts +6 -0
- package/dist/sender/context/types.d.ts +7 -0
- package/dist/sender/extensions/constants.d.ts +94 -0
- package/dist/sender/extensions/index.d.ts +12 -0
- package/dist/sender/extensions/mention/commands.d.ts +20 -0
- package/dist/sender/extensions/mention/components/mention-list.vue.d.ts +18 -0
- package/dist/sender/extensions/mention/components/mention-view.vue.d.ts +19 -0
- package/dist/sender/extensions/mention/extension.d.ts +6 -0
- package/dist/sender/extensions/mention/index.d.ts +22 -0
- package/dist/sender/extensions/mention/plugin.d.ts +16 -0
- package/dist/sender/extensions/mention/types.d.ts +126 -0
- package/dist/sender/extensions/mention/utils.d.ts +34 -0
- package/dist/sender/extensions/suggestion/extension.d.ts +8 -0
- package/dist/sender/extensions/suggestion/index.d.ts +20 -0
- package/dist/sender/extensions/suggestion/plugin.d.ts +21 -0
- package/dist/sender/extensions/suggestion/suggestion-list.vue.d.ts +46 -0
- package/dist/sender/extensions/suggestion/types.d.ts +254 -0
- package/dist/sender/extensions/suggestion/utils/filter.d.ts +29 -0
- package/dist/sender/extensions/suggestion/utils/highlight.d.ts +73 -0
- package/dist/sender/extensions/template/block/extension.d.ts +6 -0
- package/dist/sender/extensions/template/block/plugins.d.ts +13 -0
- package/dist/sender/extensions/template/block/template-block-view.vue.d.ts +14 -0
- package/dist/sender/extensions/template/commands.d.ts +31 -0
- package/dist/sender/extensions/template/extension.d.ts +6 -0
- package/dist/sender/extensions/template/index.d.ts +21 -0
- package/dist/sender/extensions/template/select/dropdown-manager.d.ts +23 -0
- package/dist/sender/extensions/template/select/extension.d.ts +5 -0
- package/dist/sender/extensions/template/select/plugins.d.ts +34 -0
- package/dist/sender/extensions/template/select/template-select-view.vue.d.ts +20 -0
- package/dist/sender/extensions/template/types.d.ts +100 -0
- package/dist/sender/extensions/template/utils.d.ts +20 -0
- package/dist/sender/extensions/utils/id-generator.d.ts +16 -0
- package/dist/sender/extensions/utils/index.d.ts +7 -0
- package/dist/sender/extensions/utils/keyboard.d.ts +49 -0
- package/dist/sender/extensions/utils/position.d.ts +25 -0
- package/dist/sender/index.d.ts +136 -0
- package/dist/sender/index.type.d.ts +302 -0
- package/dist/sender/index.vue.d.ts +90 -0
- package/dist/sender/types/base.d.ts +239 -0
- package/dist/sender/types/components.d.ts +68 -0
- package/dist/sender/types/composables.d.ts +122 -0
- package/dist/sender/types/context.d.ts +132 -0
- package/dist/sender/types/slots.d.ts +67 -0
- package/dist/sender/utils/countGraphemes.d.ts +1 -0
- package/dist/sender-actions/action-button/index.vue.d.ts +23 -0
- package/dist/sender-actions/clear-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/clear-button/useClearButtonState.d.ts +6 -0
- package/dist/sender-actions/default-actions/index.vue.d.ts +17 -0
- package/dist/sender-actions/index.d.ts +21 -0
- package/dist/sender-actions/index.type.d.ts +7 -0
- package/dist/sender-actions/submit-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/types/common.d.ts +40 -0
- package/dist/sender-actions/types/index.d.ts +5 -0
- package/dist/sender-actions/types/tooltip.d.ts +7 -0
- package/dist/sender-actions/upload-button/index.type.d.ts +57 -0
- package/dist/sender-actions/upload-button/index.vue.d.ts +16 -0
- package/dist/sender-actions/utils/tooltip.d.ts +8 -0
- package/dist/sender-actions/voice-button/index.type.d.ts +78 -0
- package/dist/sender-actions/voice-button/index.vue.d.ts +43 -0
- package/dist/sender-actions/voice-button/speech.types.d.ts +40 -0
- package/dist/sender-actions/voice-button/useSpeechHandler.d.ts +10 -0
- package/dist/sender-actions/voice-button/webSpeechHandler.d.ts +40 -0
- package/dist/sender-actions/word-counter/index.vue.d.ts +2 -0
- package/dist/sender-compat/index.d.ts +7 -0
- package/dist/sender-compat/index.type.d.ts +91 -0
- package/dist/sender-compat/index.vue.d.ts +532 -0
- package/dist/shared/composables/createTeleport.d.ts +2 -0
- package/dist/shared/composables/index.d.ts +5 -0
- package/dist/shared/composables/useAutoScroll.d.ts +25 -0
- package/dist/shared/composables/useSlotRefs.d.ts +12 -0
- package/dist/shared/composables/useTeleportTarget.d.ts +11 -0
- package/dist/shared/composables/useTouchDevice.d.ts +3 -0
- package/dist/shared/utils.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/components/PillButton.vue.d.ts +16 -0
- package/dist/suggestion-pills/components/index.d.ts +1 -0
- package/dist/suggestion-pills/index.d.ts +13 -0
- package/dist/suggestion-pills/index.js +12 -12
- package/dist/suggestion-pills/index.type.d.ts +45 -0
- package/dist/suggestion-pills/index.vue.d.ts +44 -0
- package/dist/suggestion-popover/components/Backdrop.vue.d.ts +5 -0
- package/dist/suggestion-popover/components/Header.vue.d.ts +4 -0
- package/dist/suggestion-popover/components/Loading.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/NoData.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/Tooltip.vue.d.ts +19 -0
- package/dist/suggestion-popover/index.d.ts +7 -0
- package/dist/suggestion-popover/index.js +35 -35
- package/dist/suggestion-popover/index.type.d.ts +80 -0
- package/dist/suggestion-popover/index.vue.d.ts +262 -0
- package/dist/theme-provider/constants.d.ts +6 -0
- package/dist/theme-provider/index.d.ts +9 -0
- package/dist/theme-provider/index.js +32 -41
- package/dist/theme-provider/index.type.d.ts +18 -0
- package/dist/theme-provider/index.vue.d.ts +32 -0
- package/dist/theme-provider/useTheme.d.ts +11 -0
- package/dist/useTheme.js +22 -0
- package/dist/welcome/index.d.ts +7 -0
- package/dist/welcome/index.type.d.ts +10 -0
- package/dist/welcome/index.vue.d.ts +18 -0
- package/package.json +22 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionButton, FileCardProps, FileCardEmits } from '../index.type';
|
|
2
|
+
/**
|
|
3
|
+
* 管理文件卡片交互逻辑
|
|
4
|
+
* @param props 组件属性
|
|
5
|
+
* @param emit 组件事件触发器
|
|
6
|
+
* @returns 交互处理器
|
|
7
|
+
*/
|
|
8
|
+
export declare function useFileCard(props: FileCardProps, emit: FileCardEmits): {
|
|
9
|
+
isImage: import('vue').ComputedRef<boolean>;
|
|
10
|
+
handlePreview: (event: MouseEvent) => void;
|
|
11
|
+
downloadFile: (event: MouseEvent) => void;
|
|
12
|
+
handleRemove: () => void;
|
|
13
|
+
handleRetry: () => void;
|
|
14
|
+
handleCustomAction: (action: ActionButton, event: MouseEvent) => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, ComputedRef } from 'vue';
|
|
2
|
+
import { FileType, FileTypeMatcher, Attachment } from '../index.type';
|
|
3
|
+
interface UseFileTypeOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 自定义图标
|
|
6
|
+
*/
|
|
7
|
+
customIcons?: Record<string, Component>;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义文件类型匹配器
|
|
10
|
+
*/
|
|
11
|
+
fileMatchers?: FileTypeMatcher[];
|
|
12
|
+
}
|
|
13
|
+
export declare function useFileType(options?: UseFileTypeOptions): {
|
|
14
|
+
detectFileType: (file: File | string) => FileType;
|
|
15
|
+
generateID: () => string;
|
|
16
|
+
formatFileSize: (size: number) => string;
|
|
17
|
+
normalizeAttachments: (items: (Attachment | Partial<Attachment>)[]) => Attachment[];
|
|
18
|
+
getIconComponent: (fileType?: FileType) => ComputedRef<Component>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Attachment, AttachmentListEmits } from '../index.type';
|
|
3
|
+
export interface ImagePreviewOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 是否启用下载功能
|
|
6
|
+
*/
|
|
7
|
+
enableDownload?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义下载处理函数
|
|
10
|
+
*/
|
|
11
|
+
onDownload?: (event: MouseEvent, file: Attachment) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useImagePreview(fileList: Ref<Attachment[]>, emit: AttachmentListEmits, options?: ImagePreviewOptions): {
|
|
14
|
+
handlePreview: (event: MouseEvent, file: Attachment) => void;
|
|
15
|
+
renderPreview: () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | null;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Attachment, DisplayVariant } from '../index.type';
|
|
3
|
+
/**
|
|
4
|
+
* 处理listType自动检测的组合函数
|
|
5
|
+
* @param fileList 文件列表的响应式引用
|
|
6
|
+
* @param specifiedListType 用户指定的listType
|
|
7
|
+
* @returns 实际使用的listType
|
|
8
|
+
*/
|
|
9
|
+
export declare function useListType(fileList: Ref<Attachment[]>, specifiedListType?: DisplayVariant): {
|
|
10
|
+
actualListType: import('vue').ComputedRef<"picture" | "card">;
|
|
11
|
+
};
|
|
@@ -500,7 +500,7 @@ const Ee = ["data-file-type"], Se = {
|
|
|
500
500
|
], 10, Ee);
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
|
-
}), at = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-
|
|
503
|
+
}), at = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-1772c0c6"]]), st = { class: "tr-attachments" }, it = /* @__PURE__ */ z({
|
|
504
504
|
__name: "index",
|
|
505
505
|
props: {
|
|
506
506
|
items: {},
|
|
@@ -572,7 +572,7 @@ const Ee = ["data-file-type"], Se = {
|
|
|
572
572
|
(o(), M(Y(m(I)())))
|
|
573
573
|
]));
|
|
574
574
|
}
|
|
575
|
-
}), A = /* @__PURE__ */ V(it, [["__scopeId", "data-v-
|
|
575
|
+
}), A = /* @__PURE__ */ V(it, [["__scopeId", "data-v-935ed86d"]]);
|
|
576
576
|
A.name = "TrAttachments";
|
|
577
577
|
const ot = function(e) {
|
|
578
578
|
e.component(A.name, A);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export type BaseFileType = 'image' | 'pdf' | 'word' | 'excel' | 'ppt' | 'folder' | 'other';
|
|
3
|
+
export type FileType = BaseFileType | string;
|
|
4
|
+
export type FileStatus = 'uploading' | 'success' | 'error';
|
|
5
|
+
export type DisplayVariant = 'picture' | 'card' | 'auto';
|
|
6
|
+
export interface FileTypeMatcher {
|
|
7
|
+
type: string;
|
|
8
|
+
matcher: (file: File | string) => boolean;
|
|
9
|
+
icon?: Component;
|
|
10
|
+
}
|
|
11
|
+
export interface BaseAttachment {
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
status?: FileStatus;
|
|
15
|
+
fileType?: FileType;
|
|
16
|
+
message?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UrlAttachment extends BaseAttachment {
|
|
19
|
+
url: string;
|
|
20
|
+
size?: number;
|
|
21
|
+
rawFile?: File;
|
|
22
|
+
}
|
|
23
|
+
export interface RawFileAttachment extends BaseAttachment {
|
|
24
|
+
rawFile: File;
|
|
25
|
+
url?: string;
|
|
26
|
+
size?: number;
|
|
27
|
+
}
|
|
28
|
+
export type Attachment = UrlAttachment | RawFileAttachment;
|
|
29
|
+
export interface ActionButton {
|
|
30
|
+
type: string;
|
|
31
|
+
label: string;
|
|
32
|
+
handler?: (file: Attachment) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface AttachmentListProps {
|
|
35
|
+
items?: Attachment[];
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
wrap?: boolean;
|
|
38
|
+
fileIcons?: Record<string, Component>;
|
|
39
|
+
actions?: ActionButton[];
|
|
40
|
+
variant?: DisplayVariant;
|
|
41
|
+
fileMatchers?: FileTypeMatcher[];
|
|
42
|
+
}
|
|
43
|
+
export interface AttachmentListEmits {
|
|
44
|
+
(e: 'update:items', items: Attachment[]): void;
|
|
45
|
+
(e: 'remove', file: Attachment): void;
|
|
46
|
+
(e: 'download', event: MouseEvent, file: Attachment): void;
|
|
47
|
+
(e: 'retry', file: Attachment): void;
|
|
48
|
+
(e: 'preview', event: MouseEvent, file: Attachment): void;
|
|
49
|
+
(e: 'action', payload: {
|
|
50
|
+
action: ActionButton;
|
|
51
|
+
file: Attachment;
|
|
52
|
+
}): void;
|
|
53
|
+
}
|
|
54
|
+
type BaseCardProps = Pick<AttachmentListProps, 'fileIcons' | 'disabled' | 'actions' | 'fileMatchers'>;
|
|
55
|
+
export interface FileCardProps extends BaseCardProps {
|
|
56
|
+
file: Attachment;
|
|
57
|
+
variant: 'picture' | 'card';
|
|
58
|
+
showStatus?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface FileCardEmits {
|
|
61
|
+
(e: 'remove', file: Attachment): void;
|
|
62
|
+
(e: 'preview', event: MouseEvent, file: Attachment): void;
|
|
63
|
+
(e: 'download', event: MouseEvent, file: Attachment): void;
|
|
64
|
+
(e: 'retry', file: Attachment): void;
|
|
65
|
+
(e: 'action', payload: {
|
|
66
|
+
action: ActionButton;
|
|
67
|
+
file: Attachment;
|
|
68
|
+
}): void;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AttachmentListProps, Attachment, ActionButton } from './index.type';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<AttachmentListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
"update:items": (items: Attachment[]) => any;
|
|
4
|
+
remove: (file: Attachment) => any;
|
|
5
|
+
download: (event: MouseEvent, file: Attachment) => any;
|
|
6
|
+
retry: (file: Attachment) => any;
|
|
7
|
+
preview: (event: MouseEvent, file: Attachment) => any;
|
|
8
|
+
action: (payload: {
|
|
9
|
+
action: ActionButton;
|
|
10
|
+
file: Attachment;
|
|
11
|
+
}) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<AttachmentListProps> & Readonly<{
|
|
13
|
+
"onUpdate:items"?: ((items: Attachment[]) => any) | undefined;
|
|
14
|
+
onRemove?: ((file: Attachment) => any) | undefined;
|
|
15
|
+
onDownload?: ((event: MouseEvent, file: Attachment) => any) | undefined;
|
|
16
|
+
onRetry?: ((file: Attachment) => any) | undefined;
|
|
17
|
+
onPreview?: ((event: MouseEvent, file: Attachment) => any) | undefined;
|
|
18
|
+
onAction?: ((payload: {
|
|
19
|
+
action: ActionButton;
|
|
20
|
+
file: Attachment;
|
|
21
|
+
}) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
actions: ActionButton[];
|
|
24
|
+
fileMatchers: import('./index.type').FileTypeMatcher[];
|
|
25
|
+
variant: import('./index.type').DisplayVariant;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TransitionProps } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
show: boolean;
|
|
4
|
+
transitionProps?: TransitionProps;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {
|
|
12
|
+
popperRef: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
18
|
+
popperRef: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
20
|
+
popperRef: HTMLDivElement;
|
|
21
|
+
}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TransitionProps, VNode } from 'vue';
|
|
2
|
+
type TriggerEvents = Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
appendTo?: string | HTMLElement;
|
|
5
|
+
offset?: number | {
|
|
6
|
+
mainAxis?: number;
|
|
7
|
+
crossAxis?: number;
|
|
8
|
+
};
|
|
9
|
+
placement?: 'top-center' | 'bottom-center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
10
|
+
preventOverflow?: boolean;
|
|
11
|
+
show?: boolean;
|
|
12
|
+
transitionProps?: TransitionProps;
|
|
13
|
+
triggerEvents?: TriggerEvents;
|
|
14
|
+
};
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: Readonly<{
|
|
18
|
+
trigger?: () => VNode[];
|
|
19
|
+
content?: () => VNode[];
|
|
20
|
+
}> & {
|
|
21
|
+
trigger?: () => VNode[];
|
|
22
|
+
content?: () => VNode[];
|
|
23
|
+
};
|
|
24
|
+
refs: {};
|
|
25
|
+
rootEl: any;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
28
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
29
|
+
triggerRef: import('vue').ComputedRef<HTMLElement | SVGElement | null | undefined>;
|
|
30
|
+
popperRef: import('vue').ComputedRef<HTMLDivElement | null>;
|
|
31
|
+
update: () => void;
|
|
32
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
33
|
+
placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
34
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BubbleMessage, BubbleProps, BubbleSlots } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<BubbleSlots> & BubbleSlots;
|
|
5
|
+
refs: {
|
|
6
|
+
bubbleRef: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<BubbleProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
+
"state-change": (payload: {
|
|
13
|
+
key: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
messageIndex: number;
|
|
16
|
+
contentIndex: number;
|
|
17
|
+
}) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<BubbleProps> & Readonly<{
|
|
19
|
+
"onState-change"?: ((payload: {
|
|
20
|
+
key: string;
|
|
21
|
+
value: unknown;
|
|
22
|
+
messageIndex: number;
|
|
23
|
+
contentIndex: number;
|
|
24
|
+
}) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
placement: "start" | "end";
|
|
27
|
+
shape: "corner" | "rounded" | "none";
|
|
28
|
+
contentRenderMode: "single" | "split";
|
|
29
|
+
contentResolver: (message: BubbleMessage) => import('./index.type').ChatMessageContent | undefined;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
31
|
+
bubbleRef: HTMLDivElement;
|
|
32
|
+
}, HTMLDivElement>;
|
|
33
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BubbleMessage, BubbleProps } from './index.type';
|
|
2
|
+
type __VLS_Props = Pick<BubbleProps, 'role' | 'placement' | 'shape'> & {
|
|
3
|
+
messages: BubbleMessage[];
|
|
4
|
+
contentIndex?: number;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BubbleContentRendererProps } from './index.type';
|
|
2
|
+
type __VLS_Props = BubbleContentRendererProps;
|
|
3
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
4
|
+
"state-change": (payload: {
|
|
5
|
+
key: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
contentIndex: number;
|
|
8
|
+
}) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onState-change"?: ((payload: {
|
|
11
|
+
key: string;
|
|
12
|
+
value: unknown;
|
|
13
|
+
contentIndex: number;
|
|
14
|
+
}) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BubbleMessageGroup, BubbleProps, BubbleRoleConfig, BubbleSlots } from './index.type';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
messageGroup: BubbleMessageGroup;
|
|
4
|
+
roleConfig?: BubbleRoleConfig;
|
|
5
|
+
contentRenderMode?: BubbleProps['contentRenderMode'];
|
|
6
|
+
contentResolver?: BubbleProps['contentResolver'];
|
|
7
|
+
};
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: Readonly<BubbleSlots> & BubbleSlots;
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
16
|
+
"state-change": (payload: {
|
|
17
|
+
key: string;
|
|
18
|
+
value: unknown;
|
|
19
|
+
messageIndex: number;
|
|
20
|
+
contentIndex: number;
|
|
21
|
+
}) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
"onState-change"?: ((payload: {
|
|
24
|
+
key: string;
|
|
25
|
+
value: unknown;
|
|
26
|
+
messageIndex: number;
|
|
27
|
+
contentIndex: number;
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BubbleListProps, BubbleListSlots, BubbleMessage, BubbleMessageGroup } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<BubbleListSlots> & BubbleListSlots;
|
|
5
|
+
refs: {
|
|
6
|
+
listRef: HTMLDivElement;
|
|
7
|
+
};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<BubbleListProps, {
|
|
12
|
+
scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
|
|
13
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
14
|
+
"state-change": (payload: {
|
|
15
|
+
key: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
messageIndex: number;
|
|
18
|
+
contentIndex: number;
|
|
19
|
+
}) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<BubbleListProps> & Readonly<{
|
|
21
|
+
"onState-change"?: ((payload: {
|
|
22
|
+
key: string;
|
|
23
|
+
value: unknown;
|
|
24
|
+
messageIndex: number;
|
|
25
|
+
contentIndex: number;
|
|
26
|
+
}) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
contentResolver: (message: BubbleMessage) => import('./index.type').ChatMessageContent | undefined;
|
|
29
|
+
groupStrategy: "consecutive" | "divider" | ((messages: BubbleMessage[], dividerRole?: string) => BubbleMessageGroup[]);
|
|
30
|
+
dividerRole: string;
|
|
31
|
+
fallbackRole: string;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
33
|
+
listRef: HTMLDivElement;
|
|
34
|
+
}, HTMLDivElement>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BubbleProviderProps } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<BubbleProviderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BubbleProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './useBubbleBoxRenderer';
|
|
2
|
+
export * from './useBubbleContentRenderer';
|
|
3
|
+
export * from './useBubbleStateChange';
|
|
4
|
+
export * from './useBubbleStore';
|
|
5
|
+
export * from './useContentResolver';
|
|
6
|
+
export * from './useCopyCleanup';
|
|
7
|
+
export * from './useMessageContent';
|
|
8
|
+
export * from './useMessageGroup';
|
|
9
|
+
export * from './useOmitMessageFields';
|
|
10
|
+
export * from './useToolCall';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { BubbleAttributes, BubbleBoxAttributesConfig, BubbleBoxRendererMatch, BubbleMessage } from '../index.type';
|
|
3
|
+
export declare function setupBubbleBoxRenderer(renderers: {
|
|
4
|
+
boxRendererMatches?: MaybeRefOrGetter<Array<BubbleBoxRendererMatch>>;
|
|
5
|
+
boxAttributes?: MaybeRefOrGetter<BubbleBoxAttributesConfig | undefined>;
|
|
6
|
+
fallbackBoxRenderer?: MaybeRefOrGetter<Component>;
|
|
7
|
+
}): void;
|
|
8
|
+
/**
|
|
9
|
+
* Setup prop-level fallback box renderer
|
|
10
|
+
* Used in Bubble component to provide prop-level configuration that won't override parent provider
|
|
11
|
+
*/
|
|
12
|
+
export declare function setupBubblePropBoxRenderer(renderers: {
|
|
13
|
+
fallbackBoxRenderer?: MaybeRefOrGetter<Component | undefined>;
|
|
14
|
+
}): void;
|
|
15
|
+
export declare function useBubbleBoxRenderer(messages: MaybeRefOrGetter<BubbleMessage[]>, contentIndex?: number): ComputedRef<{
|
|
16
|
+
renderer: Component;
|
|
17
|
+
attributes?: BubbleAttributes;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { BubbleAttributes, BubbleContentAttributesConfig, BubbleContentRendererMatch, BubbleMessage } from '../index.type';
|
|
3
|
+
export declare function setupBubbleContentRenderer(renderers: {
|
|
4
|
+
contentRendererMatches?: MaybeRefOrGetter<Array<BubbleContentRendererMatch>>;
|
|
5
|
+
contentAttributes?: MaybeRefOrGetter<BubbleContentAttributesConfig | undefined>;
|
|
6
|
+
fallbackContentRenderer?: MaybeRefOrGetter<Component>;
|
|
7
|
+
}): void;
|
|
8
|
+
/**
|
|
9
|
+
* Setup prop-level fallback content renderer
|
|
10
|
+
* Used in Bubble component to provide prop-level configuration that won't override parent provider
|
|
11
|
+
*/
|
|
12
|
+
export declare function setupBubblePropContentRenderer(renderers: {
|
|
13
|
+
fallbackContentRenderer?: MaybeRefOrGetter<Component | undefined>;
|
|
14
|
+
}): void;
|
|
15
|
+
export declare function useBubbleContentRenderer(message: MaybeRefOrGetter<BubbleMessage>, contentIndex: number): ComputedRef<{
|
|
16
|
+
renderer: Component;
|
|
17
|
+
attributes?: BubbleAttributes;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup bubble store
|
|
3
|
+
* Call this function in BubbleList or Bubble component to provide a global store
|
|
4
|
+
* If a store already exists, it will return the existing store without creating a new one
|
|
5
|
+
*
|
|
6
|
+
* @param initialData - Initial data for the store (only used if store doesn't exist)
|
|
7
|
+
* @returns The reactive store object
|
|
8
|
+
*/
|
|
9
|
+
export declare function setupBubbleStore<T extends Record<string, unknown>>(initialData?: T): T;
|
|
10
|
+
/**
|
|
11
|
+
* Use bubble store
|
|
12
|
+
* Call this function in child components to access the global store
|
|
13
|
+
*
|
|
14
|
+
* @returns The reactive store object, or undefined if not provided
|
|
15
|
+
*/
|
|
16
|
+
export declare function useBubbleStore<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { BubbleMessage, BubbleProps } from '../index.type';
|
|
3
|
+
type Resolver = BubbleProps['contentResolver'];
|
|
4
|
+
export declare const useContentResolver: (contentResolver?: MaybeRefOrGetter<Resolver>) => (message: BubbleMessage) => import('../index.type').ChatMessageContent | undefined;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BubbleContentRendererProps, ChatMessageContent, ChatMessageContentItem } from '../index.type';
|
|
2
|
+
export declare const useMessageContent: <T extends ChatMessageContent = ChatMessageContent>(props: Readonly<BubbleContentRendererProps<T>>) => {
|
|
3
|
+
content: import('vue').ComputedRef<ChatMessageContentItem>;
|
|
4
|
+
contentText: import('vue').ComputedRef<string>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { BubbleMessageGroup } from '../index.type';
|
|
3
|
+
export declare function setupBubbleMessageGroup(messageGroup: MaybeRefOrGetter<BubbleMessageGroup | undefined>): void;
|
|
4
|
+
export declare function useBubbleMessageGroup(): MaybeRefOrGetter<BubbleMessageGroup | undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { BubbleContentRendererProps, BubbleMessage } from '../index.type';
|
|
3
|
+
/**
|
|
4
|
+
* Omit specified fields from message and return computed props
|
|
5
|
+
* @param props - The original props containing the message
|
|
6
|
+
* @param fields - Array of field names to omit from the message
|
|
7
|
+
* @returns An object containing restMessage and restProps computed refs
|
|
8
|
+
*/
|
|
9
|
+
export declare function useOmitMessageFields<P extends BubbleContentRendererProps, K extends keyof BubbleMessage>(props: P, fields: K[]): {
|
|
10
|
+
restMessage: ComputedRef<Omit<BubbleMessage, K>>;
|
|
11
|
+
restProps: ComputedRef<P>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BubbleContentRendererProps, ChatMessageContent } from '../index.type';
|
|
2
|
+
declare const toolCallStatus: readonly ["running", "success", "failed", "cancelled"];
|
|
3
|
+
export type ToolCallStatus = (typeof toolCallStatus)[number];
|
|
4
|
+
export declare const useToolCall: (props: BubbleContentRendererProps<ChatMessageContent, {
|
|
5
|
+
toolCall?: Record<string, {
|
|
6
|
+
status?: ToolCallStatus;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
}> & {
|
|
10
|
+
toolCallIndex: number;
|
|
11
|
+
}) => {
|
|
12
|
+
toolCall: import('vue').ComputedRef<import('../index.type').ToolCall | undefined>;
|
|
13
|
+
toolCallWithResult: Readonly<import('vue').Ref<{
|
|
14
|
+
readonly arguments?: any;
|
|
15
|
+
readonly result?: any;
|
|
16
|
+
}, {
|
|
17
|
+
readonly arguments?: any;
|
|
18
|
+
readonly result?: any;
|
|
19
|
+
}>>;
|
|
20
|
+
state: import('vue').ComputedRef<{
|
|
21
|
+
status: "success" | "running" | "failed" | "cancelled" | undefined;
|
|
22
|
+
open: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Component, InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { BubbleBoxAttributesConfig, BubbleBoxRendererMatch, BubbleContentAttributesConfig, BubbleContentRendererMatch, BubbleMessageGroup } from './index.type';
|
|
3
|
+
/**
|
|
4
|
+
* Injection key for bubble message group
|
|
5
|
+
* Used to provide/inject message group between BubbleItem and Bubble components
|
|
6
|
+
*/
|
|
7
|
+
export declare const BUBBLE_MESSAGE_GROUP_KEY: InjectionKey<MaybeRefOrGetter<BubbleMessageGroup | undefined>>;
|
|
8
|
+
export declare const BUBBLE_BOX_RENDERER_MATCHES_KEY: InjectionKey<MaybeRefOrGetter<Array<BubbleBoxRendererMatch>>>;
|
|
9
|
+
export declare const BUBBLE_BOX_FALLBACK_RENDERER_KEY: InjectionKey<MaybeRefOrGetter<Component>>;
|
|
10
|
+
export declare const BUBBLE_BOX_ATTRIBUTES_KEY: InjectionKey<MaybeRefOrGetter<BubbleBoxAttributesConfig | undefined>>;
|
|
11
|
+
export declare const BUBBLE_BOX_PROP_FALLBACK_RENDERER_KEY: InjectionKey<MaybeRefOrGetter<Component | undefined>>;
|
|
12
|
+
export declare const BUBBLE_CONTENT_RENDERER_MATCHES_KEY: InjectionKey<MaybeRefOrGetter<Array<BubbleContentRendererMatch>>>;
|
|
13
|
+
export declare const BUBBLE_CONTENT_FALLBACK_RENDERER_KEY: InjectionKey<MaybeRefOrGetter<Component>>;
|
|
14
|
+
export declare const BUBBLE_CONTENT_ATTRIBUTES_KEY: InjectionKey<MaybeRefOrGetter<BubbleContentAttributesConfig | undefined>>;
|
|
15
|
+
export declare const BUBBLE_CONTENT_PROP_FALLBACK_RENDERER_KEY: InjectionKey<MaybeRefOrGetter<Component | undefined>>;
|
|
16
|
+
/**
|
|
17
|
+
* Injection key for bubble store
|
|
18
|
+
* Used to provide/inject a global store for sharing data between BubbleList and Bubble components
|
|
19
|
+
*/
|
|
20
|
+
export declare const BUBBLE_STORE_KEY: InjectionKey<Record<string, unknown>>;
|
|
21
|
+
export declare const BUBBLE_STATE_CHANGE_FN_KEY: InjectionKey<(key: string, value: unknown) => void>;
|
|
22
|
+
/**
|
|
23
|
+
* Bubble list 上下文的注入键
|
|
24
|
+
* 用于标识 Bubble 组件是否在 BubbleList 下
|
|
25
|
+
*/
|
|
26
|
+
export declare const BUBBLE_LIST_CONTEXT_KEY: InjectionKey<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* 气泡渲染器匹配优先级常量
|
|
29
|
+
*
|
|
30
|
+
* 用于定义不同类型渲染器的匹配优先级,数值越小优先级越高
|
|
31
|
+
*
|
|
32
|
+
* - LOADING: 通常基于 message.loading 判断。比如: `{ loading: true }`
|
|
33
|
+
* - NORMAL: 普通渲染器的默认优先级
|
|
34
|
+
* - CONTENT: 通常基于 message.content 判断。比如: `{ content: [{ type: 'image_url', image_url: 'xxx' }] }`
|
|
35
|
+
* - ROLE: 通常基于 message.role 判断。比如: `{ role: 'tool' }`
|
|
36
|
+
*/
|
|
37
|
+
export declare const BubbleRendererMatchPriority: {
|
|
38
|
+
readonly LOADING: -1;
|
|
39
|
+
readonly NORMAL: 0;
|
|
40
|
+
readonly CONTENT: 10;
|
|
41
|
+
readonly ROLE: 20;
|
|
42
|
+
};
|