@opentiny/tiny-robot 0.3.1-alpha.6 → 0.3.1-alpha.8
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/index.js +8 -8
- package/dist/attachments/index.js +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +11 -4014
- package/dist/container/index.js +7 -7
- package/dist/drag-overlay/index.js +6 -6
- package/dist/dropdown-menu/index.js +7 -7
- package/dist/feedback/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +16 -16
- package/dist/history/index.js +1 -1
- package/dist/icon-button/index.js +1 -1
- package/dist/index.d.ts +942 -673
- package/dist/index.js +108 -104
- package/dist/index2.js +90 -90
- package/dist/index3.js +155 -150
- package/dist/index4.js +319 -295
- package/dist/index5.js +507 -279
- package/dist/index6.js +286 -146
- package/dist/index7.js +161 -0
- package/dist/mcp-add-form/index.js +6 -6
- package/dist/mcp-server-picker/index.js +58 -57
- package/dist/prompts/index.js +3 -3
- package/dist/sender/index.js +3261 -6
- package/dist/sender-compat/index.js +105 -109
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +13 -13
- package/dist/suggestion-popover/index.js +181 -182
- package/dist/theme-provider/index.js +7 -7
- package/dist/welcome/index.js +4 -4
- package/package.json +8 -5
- package/dist/chat-input/index.js +0 -3151
- package/dist/loading.js +0 -4
- /package/dist/{chat-input-actions → sender-actions}/index.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { ComponentOptionsMixin } from 'vue';
|
|
|
9
9
|
import { ComponentProvideOptions } from 'vue';
|
|
10
10
|
import { ComponentPublicInstance } from 'vue';
|
|
11
11
|
import { ComputedRef } from 'vue';
|
|
12
|
-
import { Config } from 'dompurify';
|
|
13
12
|
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
14
13
|
import { CSSProperties } from 'vue';
|
|
15
14
|
import { DebuggerEvent } from 'vue';
|
|
@@ -20,14 +19,13 @@ import { Editor as Editor_2 } from '@tiptap/core';
|
|
|
20
19
|
import { Extension } from '@tiptap/core';
|
|
21
20
|
import { GlobalComponents } from 'vue';
|
|
22
21
|
import { GlobalDirectives } from 'vue';
|
|
22
|
+
import { MaybeComputedElementRef } from '@vueuse/core';
|
|
23
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
23
24
|
import { nextTick } from 'vue';
|
|
24
25
|
import { Node as Node_2 } from '@tiptap/core';
|
|
25
26
|
import { OnCleanup } from '@vue/reactivity';
|
|
26
|
-
import { Options } from 'markdown-it';
|
|
27
27
|
import { PublicProps } from 'vue';
|
|
28
28
|
import { Ref } from 'vue';
|
|
29
|
-
import { RendererElement } from 'vue';
|
|
30
|
-
import { RendererNode } from 'vue';
|
|
31
29
|
import { ShallowUnwrapRef } from 'vue';
|
|
32
30
|
import { Slot } from 'vue';
|
|
33
31
|
import { TransitionProps } from 'vue';
|
|
@@ -37,14 +35,47 @@ import { VNodeProps } from 'vue';
|
|
|
37
35
|
import { WatchOptions } from 'vue';
|
|
38
36
|
import { WatchStopHandle } from 'vue';
|
|
39
37
|
|
|
40
|
-
declare const __VLS_component: DefineComponent<BubbleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}
|
|
41
|
-
|
|
38
|
+
declare const __VLS_component: DefineComponent<BubbleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
39
|
+
"state-change": (payload: {
|
|
40
|
+
key: string;
|
|
41
|
+
value: unknown;
|
|
42
|
+
messageIndex: number;
|
|
43
|
+
contentIndex?: number;
|
|
44
|
+
}) => any;
|
|
45
|
+
}, string, PublicProps, Readonly<BubbleProps> & Readonly<{
|
|
46
|
+
"onState-change"?: ((payload: {
|
|
47
|
+
key: string;
|
|
48
|
+
value: unknown;
|
|
49
|
+
messageIndex: number;
|
|
50
|
+
contentIndex?: number;
|
|
51
|
+
}) => any) | undefined;
|
|
52
|
+
}>, {
|
|
42
53
|
placement: "start" | "end";
|
|
43
|
-
shape: "rounded" | "
|
|
44
|
-
|
|
54
|
+
shape: "corner" | "rounded" | "none";
|
|
55
|
+
contentRenderMode: "single" | "split";
|
|
45
56
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
46
57
|
|
|
47
|
-
declare const __VLS_component_10: DefineComponent<
|
|
58
|
+
declare const __VLS_component_10: DefineComponent<__VLS_PublicProps_3, {
|
|
59
|
+
children: ComputedRef<(HTMLElement | SVGElement)[]>;
|
|
60
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
61
|
+
"update:showAll": (value: boolean | undefined) => any;
|
|
62
|
+
} & {
|
|
63
|
+
"click-outside": (event: MouseEvent) => any;
|
|
64
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
65
|
+
"onClick-outside"?: ((event: MouseEvent) => any) | undefined;
|
|
66
|
+
"onUpdate:showAll"?: ((value: boolean | undefined) => any) | undefined;
|
|
67
|
+
}>, {
|
|
68
|
+
showAllButtonOn: "hover" | "always";
|
|
69
|
+
overflowMode: "expand" | "scroll";
|
|
70
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
71
|
+
containerWrapperRef: HTMLDivElement;
|
|
72
|
+
containerRef: HTMLDivElement;
|
|
73
|
+
staticMaybeItemRefs: unknown[];
|
|
74
|
+
floatingItemsRef: HTMLDivElement;
|
|
75
|
+
floatingMaybeItemRefs: unknown[];
|
|
76
|
+
}, HTMLDivElement>;
|
|
77
|
+
|
|
78
|
+
declare const __VLS_component_11: DefineComponent<__VLS_PublicProps_4, {
|
|
48
79
|
update: () => void;
|
|
49
80
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
50
81
|
"update:selectedGroup": (value: string) => any;
|
|
@@ -180,7 +211,7 @@ show?: TooltipContentProps["show"];
|
|
|
180
211
|
}>, {}, {}, {}, {}, {}> | null;
|
|
181
212
|
}, any>;
|
|
182
213
|
|
|
183
|
-
declare const
|
|
214
|
+
declare const __VLS_component_12: DefineComponent<__VLS_PublicProps_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
184
215
|
"update:theme": (value: string) => any;
|
|
185
216
|
"update:colorMode": (value: ColorMode) => any;
|
|
186
217
|
}, string, PublicProps, Readonly<__VLS_PublicProps_5> & Readonly<{
|
|
@@ -191,18 +222,68 @@ targetElement: string;
|
|
|
191
222
|
storageKey: string;
|
|
192
223
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
193
224
|
|
|
194
|
-
declare const
|
|
225
|
+
declare const __VLS_component_13: DefineComponent<WelcomeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WelcomeProps> & Readonly<{}>, {
|
|
195
226
|
align: "left" | "center" | "right" | string;
|
|
196
227
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
197
228
|
|
|
198
|
-
declare const
|
|
199
|
-
|
|
229
|
+
declare const __VLS_component_14: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
230
|
+
"update:visible": (value: boolean) => any;
|
|
231
|
+
} & {
|
|
232
|
+
refresh: (tab: "installed" | "market") => any;
|
|
233
|
+
"update:visible": (visible: boolean) => any;
|
|
234
|
+
"market-category-change": (category: string) => any;
|
|
235
|
+
"tab-change": (activeTab: "installed" | "market") => any;
|
|
236
|
+
"plugin-toggle": (plugin: PluginInfo, enabled: boolean) => any;
|
|
237
|
+
"plugin-delete": (plugin: PluginInfo) => any;
|
|
238
|
+
"plugin-add": (plugin: PluginInfo) => any;
|
|
239
|
+
"plugin-create": (type: "code" | "form", data: PluginCreationData) => any;
|
|
240
|
+
"tool-toggle": (plugin: PluginInfo, toolId: string, enabled: boolean) => any;
|
|
241
|
+
"update:activeCount": (count: number) => any;
|
|
242
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps_6> & Readonly<{
|
|
243
|
+
onRefresh?: ((tab: "installed" | "market") => any) | undefined;
|
|
244
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
245
|
+
"onMarket-category-change"?: ((category: string) => any) | undefined;
|
|
246
|
+
"onTab-change"?: ((activeTab: "installed" | "market") => any) | undefined;
|
|
247
|
+
"onPlugin-toggle"?: ((plugin: PluginInfo, enabled: boolean) => any) | undefined;
|
|
248
|
+
"onPlugin-delete"?: ((plugin: PluginInfo) => any) | undefined;
|
|
249
|
+
"onPlugin-add"?: ((plugin: PluginInfo) => any) | undefined;
|
|
250
|
+
"onPlugin-create"?: ((type: "code" | "form", data: PluginCreationData) => any) | undefined;
|
|
251
|
+
"onTool-toggle"?: ((plugin: PluginInfo, toolId: string, enabled: boolean) => any) | undefined;
|
|
252
|
+
"onUpdate:activeCount"?: ((count: number) => any) | undefined;
|
|
253
|
+
}>, {
|
|
254
|
+
title: string;
|
|
255
|
+
loading: boolean;
|
|
256
|
+
installedPlugins: PluginInfo[];
|
|
257
|
+
marketPlugins: PluginInfo[];
|
|
258
|
+
searchPlaceholder: string;
|
|
259
|
+
enableSearch: boolean;
|
|
260
|
+
installedSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
261
|
+
marketSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
262
|
+
marketCategoryOptions: MarketCategoryOption[];
|
|
263
|
+
marketCategoryPlaceholder: string;
|
|
264
|
+
enableMarketCategoryFilter: boolean;
|
|
265
|
+
defaultActiveTab: "installed" | "market";
|
|
266
|
+
showInstalledTab: boolean;
|
|
267
|
+
showMarketTab: boolean;
|
|
268
|
+
popupConfig: PopupConfig;
|
|
269
|
+
installedTabTitle: string;
|
|
270
|
+
marketTabTitle: string;
|
|
271
|
+
showCustomAddButton: boolean;
|
|
272
|
+
customAddButtonText: string;
|
|
273
|
+
allowPluginToggle: boolean;
|
|
274
|
+
allowToolToggle: boolean;
|
|
275
|
+
allowPluginDelete: boolean;
|
|
276
|
+
allowPluginAdd: boolean;
|
|
277
|
+
marketLoading: boolean;
|
|
278
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
279
|
+
|
|
280
|
+
declare const __VLS_component_15: DefineComponent<ActionButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ActionButtonProps> & Readonly<{}>, {
|
|
200
281
|
disabled: boolean;
|
|
201
282
|
active: boolean;
|
|
202
283
|
tooltipPlacement: TooltipPlacement;
|
|
203
284
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
204
285
|
|
|
205
|
-
declare const
|
|
286
|
+
declare const __VLS_component_16: DefineComponent<VoiceButtonProps, {
|
|
206
287
|
start: () => void;
|
|
207
288
|
stop: () => void;
|
|
208
289
|
speechState: SpeechState;
|
|
@@ -223,11 +304,33 @@ tooltipPlacement: TooltipPlacement;
|
|
|
223
304
|
autoInsert: boolean;
|
|
224
305
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
225
306
|
|
|
226
|
-
declare const __VLS_component_2: DefineComponent<
|
|
227
|
-
|
|
228
|
-
}, {}, {}, {},
|
|
307
|
+
declare const __VLS_component_2: DefineComponent<BubbleListProps, {
|
|
308
|
+
scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
|
|
309
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
310
|
+
"state-change": (payload: {
|
|
311
|
+
key: string;
|
|
312
|
+
value: unknown;
|
|
313
|
+
messageIndex: number;
|
|
314
|
+
contentIndex?: number;
|
|
315
|
+
}) => any;
|
|
316
|
+
}, string, PublicProps, Readonly<BubbleListProps> & Readonly<{
|
|
317
|
+
"onState-change"?: ((payload: {
|
|
318
|
+
key: string;
|
|
319
|
+
value: unknown;
|
|
320
|
+
messageIndex: number;
|
|
321
|
+
contentIndex?: number;
|
|
322
|
+
}) => any) | undefined;
|
|
323
|
+
}>, {
|
|
324
|
+
groupStrategy: "consecutive" | "divider" | ((messages: BubbleMessage[], dividerRole?: string) => BubbleMessageGroup[]);
|
|
325
|
+
dividerRole: string;
|
|
326
|
+
fallbackRole: string;
|
|
327
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
328
|
+
listRef: HTMLDivElement;
|
|
329
|
+
}, HTMLDivElement>;
|
|
229
330
|
|
|
230
|
-
declare const __VLS_component_3: DefineComponent<
|
|
331
|
+
declare const __VLS_component_3: DefineComponent<BubbleProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
332
|
+
|
|
333
|
+
declare const __VLS_component_4: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
231
334
|
"update:show": (value: boolean) => any;
|
|
232
335
|
"update:fullscreen": (value: boolean | undefined) => any;
|
|
233
336
|
} & {
|
|
@@ -240,9 +343,9 @@ onClose?: (() => any) | undefined;
|
|
|
240
343
|
title: string;
|
|
241
344
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
242
345
|
|
|
243
|
-
declare const
|
|
346
|
+
declare const __VLS_component_5: DefineComponent<DragOverlayProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DragOverlayProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
244
347
|
|
|
245
|
-
declare const
|
|
348
|
+
declare const __VLS_component_6: DefineComponent<__VLS_PublicProps_2, {
|
|
246
349
|
update: () => void;
|
|
247
350
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
248
351
|
"update:show": (value: boolean) => any;
|
|
@@ -350,13 +453,13 @@ content?: () => VNode[];
|
|
|
350
453
|
}) | null;
|
|
351
454
|
}, any>;
|
|
352
455
|
|
|
353
|
-
declare const
|
|
456
|
+
declare const __VLS_component_7: DefineComponent<PromptsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
354
457
|
"item-click": (ev: MouseEvent, item: PromptProps) => any;
|
|
355
458
|
}, string, PublicProps, Readonly<PromptsProps> & Readonly<{
|
|
356
459
|
"onItem-click"?: ((ev: MouseEvent, item: PromptProps) => any) | undefined;
|
|
357
460
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
358
461
|
|
|
359
|
-
declare const
|
|
462
|
+
declare const __VLS_component_8: DefineComponent<SenderProps_2, {
|
|
360
463
|
focus: () => void;
|
|
361
464
|
blur: () => void;
|
|
362
465
|
clear: () => void;
|
|
@@ -398,10 +501,10 @@ onSubmit?: ((value: string) => any) | undefined;
|
|
|
398
501
|
"onFiles-selected"?: ((files: File[]) => any) | undefined;
|
|
399
502
|
}>, {
|
|
400
503
|
placeholder: string;
|
|
401
|
-
mode:
|
|
402
|
-
submitType:
|
|
504
|
+
mode: InputMode;
|
|
505
|
+
submitType: SubmitTrigger;
|
|
403
506
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
404
|
-
|
|
507
|
+
senderRef: ({
|
|
405
508
|
$: ComponentInternalInstance;
|
|
406
509
|
$data: {};
|
|
407
510
|
$props: {
|
|
@@ -526,7 +629,7 @@ header?(_: {}): any;
|
|
|
526
629
|
prefix?(_: {}): any;
|
|
527
630
|
prefix?(_: {}): any;
|
|
528
631
|
content?(_: {
|
|
529
|
-
editor:
|
|
632
|
+
editor: Editor | undefined;
|
|
530
633
|
}): any;
|
|
531
634
|
content?(_: {
|
|
532
635
|
editor: Ref<Editor | undefined, Editor | undefined>;
|
|
@@ -541,6 +644,7 @@ $: ComponentInternalInstance;
|
|
|
541
644
|
$data: {};
|
|
542
645
|
$props: {
|
|
543
646
|
readonly icon?: (VNode | Component) | undefined;
|
|
647
|
+
readonly recordingIcon?: (VNode | Component) | undefined;
|
|
544
648
|
readonly disabled?: boolean | undefined;
|
|
545
649
|
readonly size?: "small" | "normal" | undefined;
|
|
546
650
|
readonly tooltip?: TooltipContent | undefined;
|
|
@@ -622,6 +726,9 @@ stop: () => void;
|
|
|
622
726
|
speechState: SpeechState;
|
|
623
727
|
}> & {} & ComponentCustomProperties & {} & {
|
|
624
728
|
$slots: {
|
|
729
|
+
icon?(_: {
|
|
730
|
+
isRecording: boolean;
|
|
731
|
+
}): any;
|
|
625
732
|
'recording-overlay'?(_: {
|
|
626
733
|
isRecording: boolean;
|
|
627
734
|
stop: () => void;
|
|
@@ -630,73 +737,49 @@ stop: () => void;
|
|
|
630
737
|
}) | null;
|
|
631
738
|
}, HTMLDivElement>;
|
|
632
739
|
|
|
633
|
-
declare const
|
|
634
|
-
|
|
635
|
-
declare const __VLS_component_9: DefineComponent<__VLS_PublicProps_3, {
|
|
636
|
-
children: ComputedRef<(HTMLElement | SVGElement)[]>;
|
|
637
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
638
|
-
"update:showAll": (value: boolean | undefined) => any;
|
|
639
|
-
} & {
|
|
640
|
-
"click-outside": (event: MouseEvent) => any;
|
|
641
|
-
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
642
|
-
"onClick-outside"?: ((event: MouseEvent) => any) | undefined;
|
|
643
|
-
"onUpdate:showAll"?: ((value: boolean | undefined) => any) | undefined;
|
|
644
|
-
}>, {
|
|
645
|
-
showAllButtonOn: "hover" | "always";
|
|
646
|
-
overflowMode: "expand" | "scroll";
|
|
647
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
648
|
-
containerWrapperRef: HTMLDivElement;
|
|
649
|
-
containerRef: HTMLDivElement;
|
|
650
|
-
staticMaybeItemRefs: unknown[];
|
|
651
|
-
floatingItemsRef: HTMLDivElement;
|
|
652
|
-
floatingMaybeItemRefs: unknown[];
|
|
653
|
-
}, HTMLDivElement>;
|
|
740
|
+
declare const __VLS_component_9: DefineComponent<SuggestionPillButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SuggestionPillButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
654
741
|
|
|
655
742
|
declare type __VLS_PrettifyLocal<T> = {
|
|
656
743
|
[K in keyof T]: T[K];
|
|
657
744
|
} & {};
|
|
658
745
|
|
|
659
|
-
declare type __VLS_Props =
|
|
660
|
-
contentRenderers?: Record<string, BubbleContentRenderer>;
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
declare type __VLS_Props_2 = ContainerProps;
|
|
746
|
+
declare type __VLS_Props = ContainerProps;
|
|
664
747
|
|
|
665
|
-
declare type
|
|
748
|
+
declare type __VLS_Props_2 = DropdownMenuProps;
|
|
666
749
|
|
|
667
|
-
declare type
|
|
750
|
+
declare type __VLS_Props_3 = SuggestionPillsProps;
|
|
668
751
|
|
|
669
|
-
declare type
|
|
752
|
+
declare type __VLS_Props_4 = SuggestionPopoverProps;
|
|
670
753
|
|
|
671
|
-
declare type
|
|
754
|
+
declare type __VLS_Props_5 = ThemeProviderProps;
|
|
672
755
|
|
|
673
|
-
declare type
|
|
756
|
+
declare type __VLS_Props_6 = McpServerPickerProps;
|
|
674
757
|
|
|
675
758
|
declare type __VLS_PublicProps = {
|
|
676
759
|
'show': ContainerProps['show'];
|
|
677
760
|
'fullscreen'?: ContainerProps['fullscreen'];
|
|
678
|
-
} &
|
|
761
|
+
} & __VLS_Props;
|
|
679
762
|
|
|
680
763
|
declare type __VLS_PublicProps_2 = {
|
|
681
764
|
'show'?: boolean;
|
|
682
|
-
} &
|
|
765
|
+
} & __VLS_Props_2;
|
|
683
766
|
|
|
684
767
|
declare type __VLS_PublicProps_3 = {
|
|
685
768
|
'showAll'?: SuggestionPillsProps['showAll'];
|
|
686
|
-
} &
|
|
769
|
+
} & __VLS_Props_3;
|
|
687
770
|
|
|
688
771
|
declare type __VLS_PublicProps_4 = {
|
|
689
772
|
'selectedGroup'?: string;
|
|
690
|
-
} &
|
|
773
|
+
} & __VLS_Props_4;
|
|
691
774
|
|
|
692
775
|
declare type __VLS_PublicProps_5 = {
|
|
693
776
|
'theme'?: string;
|
|
694
777
|
'colorMode'?: ColorMode;
|
|
695
|
-
} &
|
|
778
|
+
} & __VLS_Props_5;
|
|
696
779
|
|
|
697
780
|
declare type __VLS_PublicProps_6 = {
|
|
698
781
|
'visible': boolean;
|
|
699
|
-
} &
|
|
782
|
+
} & __VLS_Props_6;
|
|
700
783
|
|
|
701
784
|
declare function __VLS_template(): {
|
|
702
785
|
attrs: Partial<{}>;
|
|
@@ -706,6 +789,19 @@ declare function __VLS_template(): {
|
|
|
706
789
|
};
|
|
707
790
|
|
|
708
791
|
declare function __VLS_template_10(): {
|
|
792
|
+
attrs: Partial<{}>;
|
|
793
|
+
slots: Readonly<SuggestionPillsSlots> & SuggestionPillsSlots;
|
|
794
|
+
refs: {
|
|
795
|
+
containerWrapperRef: HTMLDivElement;
|
|
796
|
+
containerRef: HTMLDivElement;
|
|
797
|
+
staticMaybeItemRefs: unknown[];
|
|
798
|
+
floatingItemsRef: HTMLDivElement;
|
|
799
|
+
floatingMaybeItemRefs: unknown[];
|
|
800
|
+
};
|
|
801
|
+
rootEl: HTMLDivElement;
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
declare function __VLS_template_11(): {
|
|
709
805
|
attrs: Partial<{}>;
|
|
710
806
|
slots: Readonly<SuggestionPopoverSlots> & SuggestionPopoverSlots;
|
|
711
807
|
refs: {
|
|
@@ -824,7 +920,7 @@ declare function __VLS_template_10(): {
|
|
|
824
920
|
rootEl: any;
|
|
825
921
|
};
|
|
826
922
|
|
|
827
|
-
declare function
|
|
923
|
+
declare function __VLS_template_12(): {
|
|
828
924
|
attrs: Partial<{}>;
|
|
829
925
|
slots: {
|
|
830
926
|
default?(_: {}): any;
|
|
@@ -833,14 +929,23 @@ declare function __VLS_template_11(): {
|
|
|
833
929
|
rootEl: any;
|
|
834
930
|
};
|
|
835
931
|
|
|
836
|
-
declare function
|
|
932
|
+
declare function __VLS_template_13(): {
|
|
837
933
|
attrs: Partial<{}>;
|
|
838
934
|
slots: Readonly<WelcomeSlots> & WelcomeSlots;
|
|
839
935
|
refs: {};
|
|
840
936
|
rootEl: HTMLDivElement;
|
|
841
937
|
};
|
|
842
938
|
|
|
843
|
-
declare function
|
|
939
|
+
declare function __VLS_template_14(): {
|
|
940
|
+
attrs: Partial<{}>;
|
|
941
|
+
slots: {
|
|
942
|
+
'header-actions'?(_: {}): any;
|
|
943
|
+
};
|
|
944
|
+
refs: {};
|
|
945
|
+
rootEl: any;
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
declare function __VLS_template_15(): {
|
|
844
949
|
attrs: Partial<{}>;
|
|
845
950
|
slots: {
|
|
846
951
|
icon?(_: {}): any;
|
|
@@ -850,9 +955,12 @@ declare function __VLS_template_13(): {
|
|
|
850
955
|
rootEl: any;
|
|
851
956
|
};
|
|
852
957
|
|
|
853
|
-
declare function
|
|
958
|
+
declare function __VLS_template_16(): {
|
|
854
959
|
attrs: Partial<{}>;
|
|
855
960
|
slots: {
|
|
961
|
+
icon?(_: {
|
|
962
|
+
isRecording: boolean;
|
|
963
|
+
}): any;
|
|
856
964
|
'recording-overlay'?(_: {
|
|
857
965
|
isRecording: boolean;
|
|
858
966
|
stop: () => void;
|
|
@@ -863,6 +971,15 @@ declare function __VLS_template_14(): {
|
|
|
863
971
|
};
|
|
864
972
|
|
|
865
973
|
declare function __VLS_template_2(): {
|
|
974
|
+
attrs: Partial<{}>;
|
|
975
|
+
slots: Readonly<BubbleListSlots> & BubbleListSlots;
|
|
976
|
+
refs: {
|
|
977
|
+
listRef: HTMLDivElement;
|
|
978
|
+
};
|
|
979
|
+
rootEl: HTMLDivElement;
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
declare function __VLS_template_3(): {
|
|
866
983
|
attrs: Partial<{}>;
|
|
867
984
|
slots: {
|
|
868
985
|
default?(_: {}): any;
|
|
@@ -871,14 +988,14 @@ declare function __VLS_template_2(): {
|
|
|
871
988
|
rootEl: any;
|
|
872
989
|
};
|
|
873
990
|
|
|
874
|
-
declare function
|
|
991
|
+
declare function __VLS_template_4(): {
|
|
875
992
|
attrs: Partial<{}>;
|
|
876
993
|
slots: Readonly<ContainerSlots> & ContainerSlots;
|
|
877
994
|
refs: {};
|
|
878
995
|
rootEl: HTMLDivElement;
|
|
879
996
|
};
|
|
880
997
|
|
|
881
|
-
declare function
|
|
998
|
+
declare function __VLS_template_5(): {
|
|
882
999
|
attrs: Partial<{}>;
|
|
883
1000
|
slots: {
|
|
884
1001
|
overlay?(_: {
|
|
@@ -889,7 +1006,7 @@ declare function __VLS_template_4(): {
|
|
|
889
1006
|
rootEl: any;
|
|
890
1007
|
};
|
|
891
1008
|
|
|
892
|
-
declare function
|
|
1009
|
+
declare function __VLS_template_6(): {
|
|
893
1010
|
attrs: Partial<{}>;
|
|
894
1011
|
slots: {
|
|
895
1012
|
trigger?(_: {}): any;
|
|
@@ -991,14 +1108,14 @@ declare function __VLS_template_5(): {
|
|
|
991
1108
|
rootEl: any;
|
|
992
1109
|
};
|
|
993
1110
|
|
|
994
|
-
declare function
|
|
1111
|
+
declare function __VLS_template_7(): {
|
|
995
1112
|
attrs: Partial<{}>;
|
|
996
1113
|
slots: Readonly<PromptsSlots> & PromptsSlots;
|
|
997
1114
|
refs: {};
|
|
998
1115
|
rootEl: HTMLDivElement;
|
|
999
1116
|
};
|
|
1000
1117
|
|
|
1001
|
-
declare function
|
|
1118
|
+
declare function __VLS_template_8(): {
|
|
1002
1119
|
attrs: Partial<{}>;
|
|
1003
1120
|
slots: {
|
|
1004
1121
|
header?(_: {}): any;
|
|
@@ -1012,7 +1129,7 @@ declare function __VLS_template_7(): {
|
|
|
1012
1129
|
'footer-right'?(_: {}): any;
|
|
1013
1130
|
};
|
|
1014
1131
|
refs: {
|
|
1015
|
-
|
|
1132
|
+
senderRef: ({
|
|
1016
1133
|
$: ComponentInternalInstance;
|
|
1017
1134
|
$data: {};
|
|
1018
1135
|
$props: {
|
|
@@ -1137,7 +1254,7 @@ declare function __VLS_template_7(): {
|
|
|
1137
1254
|
prefix?(_: {}): any;
|
|
1138
1255
|
prefix?(_: {}): any;
|
|
1139
1256
|
content?(_: {
|
|
1140
|
-
editor:
|
|
1257
|
+
editor: Editor | undefined;
|
|
1141
1258
|
}): any;
|
|
1142
1259
|
content?(_: {
|
|
1143
1260
|
editor: Ref<Editor | undefined, Editor | undefined>;
|
|
@@ -1152,6 +1269,7 @@ declare function __VLS_template_7(): {
|
|
|
1152
1269
|
$data: {};
|
|
1153
1270
|
$props: {
|
|
1154
1271
|
readonly icon?: (VNode | Component) | undefined;
|
|
1272
|
+
readonly recordingIcon?: (VNode | Component) | undefined;
|
|
1155
1273
|
readonly disabled?: boolean | undefined;
|
|
1156
1274
|
readonly size?: "small" | "normal" | undefined;
|
|
1157
1275
|
readonly tooltip?: TooltipContent | undefined;
|
|
@@ -1233,6 +1351,9 @@ declare function __VLS_template_7(): {
|
|
|
1233
1351
|
speechState: SpeechState;
|
|
1234
1352
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1235
1353
|
$slots: {
|
|
1354
|
+
icon?(_: {
|
|
1355
|
+
isRecording: boolean;
|
|
1356
|
+
}): any;
|
|
1236
1357
|
'recording-overlay'?(_: {
|
|
1237
1358
|
isRecording: boolean;
|
|
1238
1359
|
stop: () => void;
|
|
@@ -1243,26 +1364,13 @@ declare function __VLS_template_7(): {
|
|
|
1243
1364
|
rootEl: HTMLDivElement;
|
|
1244
1365
|
};
|
|
1245
1366
|
|
|
1246
|
-
declare function
|
|
1367
|
+
declare function __VLS_template_9(): {
|
|
1247
1368
|
attrs: Partial<{}>;
|
|
1248
1369
|
slots: Readonly<SuggestionPillButtonSlots> & SuggestionPillButtonSlots;
|
|
1249
1370
|
refs: {};
|
|
1250
1371
|
rootEl: HTMLButtonElement;
|
|
1251
1372
|
};
|
|
1252
1373
|
|
|
1253
|
-
declare function __VLS_template_9(): {
|
|
1254
|
-
attrs: Partial<{}>;
|
|
1255
|
-
slots: Readonly<SuggestionPillsSlots> & SuggestionPillsSlots;
|
|
1256
|
-
refs: {
|
|
1257
|
-
containerWrapperRef: HTMLDivElement;
|
|
1258
|
-
containerRef: HTMLDivElement;
|
|
1259
|
-
staticMaybeItemRefs: unknown[];
|
|
1260
|
-
floatingItemsRef: HTMLDivElement;
|
|
1261
|
-
floatingMaybeItemRefs: unknown[];
|
|
1262
|
-
};
|
|
1263
|
-
rootEl: HTMLDivElement;
|
|
1264
|
-
};
|
|
1265
|
-
|
|
1266
1374
|
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
1267
1375
|
|
|
1268
1376
|
declare type __VLS_TemplateResult_10 = ReturnType<typeof __VLS_template_10>;
|
|
@@ -1275,6 +1383,10 @@ declare type __VLS_TemplateResult_13 = ReturnType<typeof __VLS_template_13>;
|
|
|
1275
1383
|
|
|
1276
1384
|
declare type __VLS_TemplateResult_14 = ReturnType<typeof __VLS_template_14>;
|
|
1277
1385
|
|
|
1386
|
+
declare type __VLS_TemplateResult_15 = ReturnType<typeof __VLS_template_15>;
|
|
1387
|
+
|
|
1388
|
+
declare type __VLS_TemplateResult_16 = ReturnType<typeof __VLS_template_16>;
|
|
1389
|
+
|
|
1278
1390
|
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
|
|
1279
1391
|
|
|
1280
1392
|
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
|
|
@@ -1327,6 +1439,18 @@ declare type __VLS_WithTemplateSlots_14<T, S> = T & {
|
|
|
1327
1439
|
};
|
|
1328
1440
|
};
|
|
1329
1441
|
|
|
1442
|
+
declare type __VLS_WithTemplateSlots_15<T, S> = T & {
|
|
1443
|
+
new (): {
|
|
1444
|
+
$slots: S;
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
declare type __VLS_WithTemplateSlots_16<T, S> = T & {
|
|
1449
|
+
new (): {
|
|
1450
|
+
$slots: S;
|
|
1451
|
+
};
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1330
1454
|
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
|
|
1331
1455
|
new (): {
|
|
1332
1456
|
$slots: S;
|
|
@@ -1447,11 +1571,6 @@ export declare type AutoSize = boolean | {
|
|
|
1447
1571
|
maxRows: number;
|
|
1448
1572
|
};
|
|
1449
1573
|
|
|
1450
|
-
declare type AutoSize_2 = boolean | {
|
|
1451
|
-
minRows: number;
|
|
1452
|
-
maxRows: number;
|
|
1453
|
-
};
|
|
1454
|
-
|
|
1455
1574
|
export declare interface BaseAttachment {
|
|
1456
1575
|
id?: string;
|
|
1457
1576
|
name?: string;
|
|
@@ -1470,58 +1589,32 @@ declare const Bubble: typeof _default_25 & {
|
|
|
1470
1589
|
export { Bubble }
|
|
1471
1590
|
export { Bubble as TrBubble }
|
|
1472
1591
|
|
|
1473
|
-
export declare
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
* 气泡头像
|
|
1480
|
-
*/
|
|
1481
|
-
avatar?: VNode;
|
|
1482
|
-
/**
|
|
1483
|
-
* 气泡形状,默认 'corner'
|
|
1484
|
-
*/
|
|
1485
|
-
shape?: 'rounded' | 'corner';
|
|
1486
|
-
/**
|
|
1487
|
-
* 气泡内容渲染器。
|
|
1488
|
-
* 如果 Bubble 中的 content 是长度大于 0 的数组,则 contentRenderer 无效。将会使用 BubbleProvider 中注册的渲染器
|
|
1489
|
-
*/
|
|
1490
|
-
contentRenderer?: BubbleContentRenderer;
|
|
1491
|
-
/**
|
|
1492
|
-
* 自定义气泡内容字段。比如 customContentField 设置为 'my-content',则 Bubble 优先渲染 my-content 属性到气泡内容
|
|
1493
|
-
*/
|
|
1494
|
-
customContentField?: string;
|
|
1495
|
-
/**
|
|
1496
|
-
* 气泡中止文本
|
|
1497
|
-
*/
|
|
1498
|
-
abortedText?: string;
|
|
1499
|
-
/**
|
|
1500
|
-
* 气泡最大宽度
|
|
1501
|
-
*/
|
|
1502
|
-
maxWidth?: string | number;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
export declare abstract class BubbleContentClassRenderer {
|
|
1506
|
-
abstract render(options: {
|
|
1507
|
-
[key: string]: any;
|
|
1508
|
-
}): VNode;
|
|
1509
|
-
}
|
|
1592
|
+
export declare type BubbleBoxRendererMatch = {
|
|
1593
|
+
find: (messages: BubbleMessage[], contentIndex?: number) => boolean;
|
|
1594
|
+
renderer: Component<BubbleBoxRendererProps>;
|
|
1595
|
+
priority?: number;
|
|
1596
|
+
attributes?: Record<string, string>;
|
|
1597
|
+
};
|
|
1510
1598
|
|
|
1511
|
-
export declare type
|
|
1512
|
-
[key: string]: any;
|
|
1513
|
-
}) => VNode;
|
|
1599
|
+
export declare type BubbleBoxRendererProps = Pick<BubbleProps, 'placement' | 'shape'>;
|
|
1514
1600
|
|
|
1515
|
-
export declare
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1601
|
+
export declare type BubbleContentRendererMatch = {
|
|
1602
|
+
find: (message: BubbleMessage, contentIndex?: number) => boolean;
|
|
1603
|
+
renderer: Component<BubbleContentRendererProps>;
|
|
1604
|
+
priority?: number;
|
|
1605
|
+
attributes?: Record<string, string>;
|
|
1606
|
+
};
|
|
1519
1607
|
|
|
1520
|
-
export declare type
|
|
1521
|
-
|
|
1522
|
-
|
|
1608
|
+
export declare type BubbleContentRendererProps<T extends ChatMessageContent = ChatMessageContent, S extends Record<string, unknown> = Record<string, unknown>> = {
|
|
1609
|
+
message: BubbleMessage<T, S>;
|
|
1610
|
+
contentIndex?: number;
|
|
1523
1611
|
};
|
|
1524
1612
|
|
|
1613
|
+
/**
|
|
1614
|
+
* 自定义分组函数类型
|
|
1615
|
+
*/
|
|
1616
|
+
declare type BubbleGroupFunction = (messages: BubbleMessage[], dividerRole?: string) => BubbleMessageGroup[];
|
|
1617
|
+
|
|
1525
1618
|
declare const bubbleInstall: (app: App) => void;
|
|
1526
1619
|
|
|
1527
1620
|
declare const BubbleList: typeof _default_26 & {
|
|
@@ -1533,56 +1626,79 @@ export { BubbleList as TrBubbleList }
|
|
|
1533
1626
|
declare const bubbleListInstall: (app: App) => void;
|
|
1534
1627
|
|
|
1535
1628
|
export declare interface BubbleListProps {
|
|
1536
|
-
|
|
1537
|
-
slots?: BubbleSlots;
|
|
1538
|
-
})[];
|
|
1629
|
+
messages: BubbleMessage[];
|
|
1539
1630
|
/**
|
|
1540
|
-
*
|
|
1631
|
+
* 分组策略:
|
|
1632
|
+
* - 'consecutive': 连续相同角色的消息合并为一组
|
|
1633
|
+
* - 'divider': 按分割角色分组(连续的分割角色在一组,其他消息在另一组)
|
|
1634
|
+
* - 自定义函数: (messages, dividerRole) => BubbleMessageGroup[]
|
|
1635
|
+
*
|
|
1636
|
+
* 特殊情况:
|
|
1637
|
+
* - 当 message 的 content 为数组时,该 message 会被单独作为一个独立分组
|
|
1638
|
+
* - 该独立分组会被"密封",后续的消息(即使角色相同)也不会被添加到这个分组中
|
|
1541
1639
|
*/
|
|
1542
|
-
|
|
1640
|
+
groupStrategy?: 'consecutive' | 'divider' | BubbleGroupFunction;
|
|
1543
1641
|
/**
|
|
1544
|
-
*
|
|
1642
|
+
* 'divider' 策略的分割角色
|
|
1643
|
+
* 具有此角色的消息将作为分割线
|
|
1644
|
+
* @default 'user'
|
|
1545
1645
|
*/
|
|
1546
|
-
|
|
1646
|
+
dividerRole?: string;
|
|
1647
|
+
/**
|
|
1648
|
+
* 当消息没有角色或角色为空时,使用此角色
|
|
1649
|
+
* @default 'assistant'
|
|
1650
|
+
*/
|
|
1651
|
+
fallbackRole?: string;
|
|
1547
1652
|
/**
|
|
1548
|
-
*
|
|
1653
|
+
* 角色配置(头像、位置、形状)
|
|
1654
|
+
*/
|
|
1655
|
+
roleConfigs?: Record<string, BubbleRoleConfig>;
|
|
1656
|
+
contentRenderMode?: BubbleProps['contentRenderMode'];
|
|
1657
|
+
/**
|
|
1658
|
+
* 是否自动滚动到底部。需要满足以下条件:
|
|
1659
|
+
* - BubbleList 是可滚动容器(需要 scrollHeight > clientHeight)
|
|
1660
|
+
* - 滚动容器接近底部
|
|
1661
|
+
*
|
|
1662
|
+
* @default false
|
|
1549
1663
|
*/
|
|
1550
|
-
loadingRole?: string;
|
|
1551
1664
|
autoScroll?: boolean;
|
|
1552
1665
|
}
|
|
1553
1666
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
readonly sanitizeDisabled: boolean;
|
|
1558
|
-
readonly defaultAttrs: Record<string, unknown>;
|
|
1559
|
-
private md;
|
|
1560
|
-
constructor(options?: BubbleMarkdownRendererOptions);
|
|
1561
|
-
render(options: {
|
|
1562
|
-
content?: string;
|
|
1563
|
-
[key: string]: unknown;
|
|
1564
|
-
}): VNode<RendererNode, RendererElement, {
|
|
1565
|
-
[key: string]: any;
|
|
1566
|
-
}>;
|
|
1567
|
-
}
|
|
1667
|
+
declare type BubbleListSlotProps = BubbleSlotProps & {
|
|
1668
|
+
messageIndexes: number[];
|
|
1669
|
+
};
|
|
1568
1670
|
|
|
1569
|
-
declare interface
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1671
|
+
export declare interface BubbleListSlots {
|
|
1672
|
+
prefix?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
|
|
1673
|
+
suffix?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
|
|
1674
|
+
after?: (slotProps: BubbleListSlotProps) => VNode | VNode[];
|
|
1675
|
+
'content-footer'?: (slotProps: BubbleListSlotProps & {
|
|
1676
|
+
contentIndex?: number;
|
|
1677
|
+
}) => VNode | VNode[];
|
|
1574
1678
|
}
|
|
1575
1679
|
|
|
1576
|
-
export declare
|
|
1577
|
-
|
|
1578
|
-
* 气泡内容
|
|
1579
|
-
*/
|
|
1580
|
-
content?: string | BubbleContentItem[];
|
|
1581
|
-
id?: string | number | symbol;
|
|
1582
|
-
role?: string;
|
|
1680
|
+
export declare type BubbleMessage<T extends ChatMessageContent = ChatMessageContent, S extends Record<string, unknown> = Record<string, unknown>> = ChatMessageWithOptionalRole<T> & {
|
|
1681
|
+
id?: string;
|
|
1583
1682
|
loading?: boolean;
|
|
1584
|
-
|
|
1585
|
-
}
|
|
1683
|
+
state?: S;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
export declare type BubbleMessageGroup = {
|
|
1687
|
+
role: string;
|
|
1688
|
+
messages: BubbleMessage[];
|
|
1689
|
+
messageIndexes: number[];
|
|
1690
|
+
startIndex: number;
|
|
1691
|
+
};
|
|
1692
|
+
|
|
1693
|
+
export declare type BubbleProps = BubbleMessage & {
|
|
1694
|
+
hidden?: boolean;
|
|
1695
|
+
avatar?: VNode | Component;
|
|
1696
|
+
placement?: 'start' | 'end';
|
|
1697
|
+
shape?: 'corner' | 'rounded' | 'none';
|
|
1698
|
+
contentRenderMode?: 'single' | 'split';
|
|
1699
|
+
fallbackBoxRenderer?: Component<BubbleBoxRendererProps>;
|
|
1700
|
+
fallbackContentRenderer?: Component<BubbleContentRendererProps>;
|
|
1701
|
+
};
|
|
1586
1702
|
|
|
1587
1703
|
declare const BubbleProvider: typeof _default_27 & {
|
|
1588
1704
|
install: typeof bubbleProviderInstall;
|
|
@@ -1592,28 +1708,76 @@ export { BubbleProvider as TrBubbleProvider }
|
|
|
1592
1708
|
|
|
1593
1709
|
declare const bubbleProviderInstall: (app: App) => void;
|
|
1594
1710
|
|
|
1595
|
-
export declare
|
|
1596
|
-
|
|
1597
|
-
|
|
1711
|
+
export declare interface BubbleProviderProps {
|
|
1712
|
+
boxRendererMatches?: BubbleBoxRendererMatch[];
|
|
1713
|
+
contentRendererMatches?: BubbleContentRendererMatch[];
|
|
1714
|
+
fallbackBoxRenderer?: Component<BubbleBoxRendererProps>;
|
|
1715
|
+
fallbackContentRenderer?: Component<BubbleContentRendererProps>;
|
|
1716
|
+
store?: Record<string, unknown>;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
/**
|
|
1720
|
+
* 气泡渲染器匹配优先级常量
|
|
1721
|
+
*
|
|
1722
|
+
* 用于定义不同类型渲染器的匹配优先级,数值越小优先级越高
|
|
1723
|
+
*
|
|
1724
|
+
* - LOADING: 通常基于 message.loading 判断。比如: `{ loading: true }`
|
|
1725
|
+
* - NORMAL: 普通渲染器的默认优先级
|
|
1726
|
+
* - CONTENT: 通常基于 message.content 判断。比如: `{ content: [{ type: 'image_url', image_url: 'xxx' }] }`
|
|
1727
|
+
* - ROLE: 通常基于 message.role 判断。比如: `{ role: 'tool' }`
|
|
1728
|
+
*/
|
|
1729
|
+
export declare const BubbleRendererMatchPriority: {
|
|
1730
|
+
readonly LOADING: -1;
|
|
1731
|
+
readonly NORMAL: 0;
|
|
1732
|
+
readonly CONTENT: 10;
|
|
1733
|
+
readonly ROLE: 20;
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
export declare const BubbleRenderers: {
|
|
1737
|
+
Box: {
|
|
1738
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
1739
|
+
P: {};
|
|
1740
|
+
B: {};
|
|
1741
|
+
D: {};
|
|
1742
|
+
C: {};
|
|
1743
|
+
M: {};
|
|
1744
|
+
Defaults: {};
|
|
1745
|
+
}, Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
1746
|
+
__isFragment?: never;
|
|
1747
|
+
__isTeleport?: never;
|
|
1748
|
+
__isSuspense?: never;
|
|
1749
|
+
} & ComponentOptionsBase<Readonly<BubbleBoxRendererProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1750
|
+
$slots: {
|
|
1751
|
+
default?(_: {}): any;
|
|
1752
|
+
};
|
|
1753
|
+
});
|
|
1754
|
+
Text: DefineComponent< {
|
|
1755
|
+
message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
|
|
1756
|
+
contentIndex?: number;
|
|
1757
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1758
|
+
message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
|
|
1759
|
+
contentIndex?: number;
|
|
1760
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* 角色配置
|
|
1765
|
+
* 用于配置不同角色的气泡样式
|
|
1766
|
+
*/
|
|
1767
|
+
export declare type BubbleRoleConfig = Pick<BubbleProps, 'avatar' | 'placement' | 'shape' | 'hidden' | 'fallbackBoxRenderer' | 'fallbackContentRenderer'>;
|
|
1768
|
+
|
|
1769
|
+
declare type BubbleSlotProps = {
|
|
1770
|
+
messages: BubbleMessage[];
|
|
1771
|
+
role?: string;
|
|
1598
1772
|
};
|
|
1599
1773
|
|
|
1600
1774
|
export declare interface BubbleSlots {
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
index?: number;
|
|
1608
|
-
}) => unknown;
|
|
1609
|
-
loading?: (slotProps: {
|
|
1610
|
-
bubbleProps: BubbleProps;
|
|
1611
|
-
index?: number;
|
|
1612
|
-
}) => unknown;
|
|
1613
|
-
trailer?: (slotProps: {
|
|
1614
|
-
bubbleProps: BubbleProps;
|
|
1615
|
-
index?: number;
|
|
1616
|
-
}) => unknown;
|
|
1775
|
+
prefix?: (slotProps: BubbleSlotProps) => VNode | VNode[];
|
|
1776
|
+
suffix?: (slotProps: BubbleSlotProps) => VNode | VNode[];
|
|
1777
|
+
after?: (slotProps: BubbleSlotProps) => VNode | VNode[];
|
|
1778
|
+
'content-footer'?: (slotProps: BubbleSlotProps & {
|
|
1779
|
+
contentIndex?: number;
|
|
1780
|
+
}) => VNode | VNode[];
|
|
1617
1781
|
}
|
|
1618
1782
|
|
|
1619
1783
|
declare interface ButtonGroupConfig {
|
|
@@ -1622,201 +1786,43 @@ declare interface ButtonGroupConfig {
|
|
|
1622
1786
|
voice?: VoiceButtonConfig;
|
|
1623
1787
|
}
|
|
1624
1788
|
|
|
1625
|
-
declare const ChatInput: {
|
|
1626
|
-
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<SenderProps> & Readonly<{
|
|
1627
|
-
onClear?: (() => any) | undefined;
|
|
1628
|
-
onInput?: ((value: string) => any) | undefined;
|
|
1629
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
1630
|
-
onCancel?: (() => any) | undefined;
|
|
1631
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
1632
|
-
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
1633
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
1634
|
-
}>, {
|
|
1635
|
-
submit: () => void;
|
|
1636
|
-
clear: () => void;
|
|
1637
|
-
cancel: () => void;
|
|
1638
|
-
focus: () => void;
|
|
1639
|
-
blur: () => void;
|
|
1640
|
-
setContent: (content: string) => void;
|
|
1641
|
-
getContent: () => string;
|
|
1642
|
-
editor: SenderContext["editor"];
|
|
1643
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1644
|
-
clear: () => any;
|
|
1645
|
-
input: (value: string) => any;
|
|
1646
|
-
blur: (event: FocusEvent) => any;
|
|
1647
|
-
cancel: () => any;
|
|
1648
|
-
focus: (event: FocusEvent) => any;
|
|
1649
|
-
submit: (textContent: string, structuredData?: StructuredData | undefined) => any;
|
|
1650
|
-
"update:modelValue": (value: string) => any;
|
|
1651
|
-
}, PublicProps, {
|
|
1652
|
-
size: "normal" | "small";
|
|
1653
|
-
placeholder: string;
|
|
1654
|
-
mode: InputMode;
|
|
1655
|
-
autoSize: AutoSize;
|
|
1656
|
-
extensions: Extension[] | any[];
|
|
1657
|
-
submitType: SubmitTrigger;
|
|
1658
|
-
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
1659
|
-
P: {};
|
|
1660
|
-
B: {};
|
|
1661
|
-
D: {};
|
|
1662
|
-
C: {};
|
|
1663
|
-
M: {};
|
|
1664
|
-
Defaults: {};
|
|
1665
|
-
}, Readonly<SenderProps> & Readonly<{
|
|
1666
|
-
onClear?: (() => any) | undefined;
|
|
1667
|
-
onInput?: ((value: string) => any) | undefined;
|
|
1668
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
1669
|
-
onCancel?: (() => any) | undefined;
|
|
1670
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
1671
|
-
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
1672
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
1673
|
-
}>, {
|
|
1674
|
-
submit: () => void;
|
|
1675
|
-
clear: () => void;
|
|
1676
|
-
cancel: () => void;
|
|
1677
|
-
focus: () => void;
|
|
1678
|
-
blur: () => void;
|
|
1679
|
-
setContent: (content: string) => void;
|
|
1680
|
-
getContent: () => string;
|
|
1681
|
-
editor: SenderContext["editor"];
|
|
1682
|
-
}, {}, {}, {}, {
|
|
1683
|
-
size: "normal" | "small";
|
|
1684
|
-
placeholder: string;
|
|
1685
|
-
mode: InputMode;
|
|
1686
|
-
autoSize: AutoSize;
|
|
1687
|
-
extensions: Extension[] | any[];
|
|
1688
|
-
submitType: SubmitTrigger;
|
|
1689
|
-
}>;
|
|
1690
|
-
__isFragment?: never;
|
|
1691
|
-
__isTeleport?: never;
|
|
1692
|
-
__isSuspense?: never;
|
|
1693
|
-
} & ComponentOptionsBase<Readonly<SenderProps> & Readonly<{
|
|
1694
|
-
onClear?: (() => any) | undefined;
|
|
1695
|
-
onInput?: ((value: string) => any) | undefined;
|
|
1696
|
-
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
1697
|
-
onCancel?: (() => any) | undefined;
|
|
1698
|
-
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
1699
|
-
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
1700
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
1701
|
-
}>, {
|
|
1702
|
-
submit: () => void;
|
|
1703
|
-
clear: () => void;
|
|
1704
|
-
cancel: () => void;
|
|
1705
|
-
focus: () => void;
|
|
1706
|
-
blur: () => void;
|
|
1707
|
-
setContent: (content: string) => void;
|
|
1708
|
-
getContent: () => string;
|
|
1709
|
-
editor: SenderContext["editor"];
|
|
1710
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1711
|
-
clear: () => any;
|
|
1712
|
-
input: (value: string) => any;
|
|
1713
|
-
blur: (event: FocusEvent) => any;
|
|
1714
|
-
cancel: () => any;
|
|
1715
|
-
focus: (event: FocusEvent) => any;
|
|
1716
|
-
submit: (textContent: string, structuredData?: StructuredData | undefined) => any;
|
|
1717
|
-
"update:modelValue": (value: string) => any;
|
|
1718
|
-
}, string, {
|
|
1719
|
-
size: "normal" | "small";
|
|
1720
|
-
placeholder: string;
|
|
1721
|
-
mode: InputMode;
|
|
1722
|
-
autoSize: AutoSize;
|
|
1723
|
-
extensions: Extension[] | any[];
|
|
1724
|
-
submitType: SubmitTrigger;
|
|
1725
|
-
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
1726
|
-
$slots: {
|
|
1727
|
-
header?(_: {}): any;
|
|
1728
|
-
header?(_: {}): any;
|
|
1729
|
-
prefix?(_: {}): any;
|
|
1730
|
-
prefix?(_: {}): any;
|
|
1731
|
-
content?(_: {
|
|
1732
|
-
editor: Ref<Editor | undefined, Editor | undefined>;
|
|
1733
|
-
}): any;
|
|
1734
|
-
content?(_: {
|
|
1735
|
-
editor: Ref<Editor | undefined, Editor | undefined>;
|
|
1736
|
-
}): any;
|
|
1737
|
-
'actions-inline'?(_: {}): any;
|
|
1738
|
-
footer?(_: {}): any;
|
|
1739
|
-
'footer-right'?(_: {}): any;
|
|
1740
|
-
};
|
|
1741
|
-
}) & {
|
|
1742
|
-
install: <T>(app: App<T>) => void;
|
|
1743
|
-
Mention: Node_2<MentionOptions, any>;
|
|
1744
|
-
Suggestion: Extension<SuggestionOptions, any>;
|
|
1745
|
-
Template: Extension<TemplateOptions, any>;
|
|
1746
|
-
mention: typeof mention;
|
|
1747
|
-
suggestion: typeof suggestion;
|
|
1748
|
-
template: typeof template;
|
|
1749
|
-
};
|
|
1750
|
-
|
|
1751
1789
|
/**
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
* 通过插槽作用域暴露给外部组件的状态和方法
|
|
1755
|
-
* 主要为增强按钮(Upload、Voice 等)提供便捷的操作方法
|
|
1790
|
+
* 聊天消息接口(支持 OpenAI 格式)
|
|
1756
1791
|
*/
|
|
1757
|
-
declare interface
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
* 聚焦编辑器
|
|
1765
|
-
*/
|
|
1766
|
-
focus: () => void;
|
|
1767
|
-
/**
|
|
1768
|
-
* 失焦编辑器
|
|
1769
|
-
*/
|
|
1770
|
-
blur: () => void;
|
|
1771
|
-
/**
|
|
1772
|
-
* 插入内容到当前光标位置
|
|
1773
|
-
*
|
|
1774
|
-
* 适用场景:语音输入、快捷短语插入
|
|
1775
|
-
*
|
|
1776
|
-
* @param content - 要插入的内容
|
|
1777
|
-
* @example
|
|
1778
|
-
* ```vue
|
|
1779
|
-
* <template #actions-inline="{ insert }">
|
|
1780
|
-
* <VoiceButton @speech-final="insert" />
|
|
1781
|
-
* </template>
|
|
1782
|
-
* ```
|
|
1783
|
-
*/
|
|
1784
|
-
insert: (content: string) => void;
|
|
1785
|
-
/**
|
|
1786
|
-
* 追加内容到编辑器末尾
|
|
1787
|
-
*
|
|
1788
|
-
* 适用场景:连续语音输入、批量添加内容
|
|
1789
|
-
*
|
|
1790
|
-
* @param content - 要追加的内容
|
|
1791
|
-
*/
|
|
1792
|
-
append: (content: string) => void;
|
|
1793
|
-
/**
|
|
1794
|
-
* 替换编辑器全部内容
|
|
1795
|
-
*
|
|
1796
|
-
* 适用场景:模板填充、内容重置
|
|
1797
|
-
*
|
|
1798
|
-
* @param content - 新内容
|
|
1799
|
-
*/
|
|
1800
|
-
replace: (content: string) => void;
|
|
1801
|
-
/**
|
|
1802
|
-
* 是否禁用
|
|
1803
|
-
* 用于控制自定义按钮状态
|
|
1804
|
-
*/
|
|
1805
|
-
disabled: boolean;
|
|
1806
|
-
/**
|
|
1807
|
-
* 是否加载中
|
|
1808
|
-
* 用于控制按钮加载状态和禁用
|
|
1809
|
-
*/
|
|
1810
|
-
loading: boolean;
|
|
1811
|
-
/**
|
|
1812
|
-
* 是否有内容
|
|
1813
|
-
* 用于控制按钮显示/隐藏
|
|
1814
|
-
*/
|
|
1815
|
-
hasContent: boolean;
|
|
1792
|
+
declare interface ChatMessage<T extends ChatMessageContent = ChatMessageContent> {
|
|
1793
|
+
role: string;
|
|
1794
|
+
content?: T;
|
|
1795
|
+
reasoning_content?: string;
|
|
1796
|
+
tool_calls?: ToolCall[];
|
|
1797
|
+
tool_call_id?: string;
|
|
1798
|
+
name?: string;
|
|
1816
1799
|
}
|
|
1817
1800
|
|
|
1801
|
+
export declare type ChatMessageContent = string | ChatMessageContentItem[];
|
|
1802
|
+
|
|
1803
|
+
export declare type ChatMessageContentItem = {
|
|
1804
|
+
type: string;
|
|
1805
|
+
[key: string]: any;
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
declare type ChatMessageWithOptionalRole<T extends ChatMessageContent = ChatMessageContent> = Omit<ChatMessage<T>, 'role'> & {
|
|
1809
|
+
role?: string;
|
|
1810
|
+
};
|
|
1811
|
+
|
|
1818
1812
|
export declare type ColorMode = 'light' | 'dark' | 'auto';
|
|
1819
1813
|
|
|
1814
|
+
declare interface CompatTemplateItem {
|
|
1815
|
+
id: string;
|
|
1816
|
+
type: 'template' | 'block';
|
|
1817
|
+
content: string;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
declare interface CompatTextItem {
|
|
1821
|
+
id: string;
|
|
1822
|
+
type: 'text';
|
|
1823
|
+
content: string;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1820
1826
|
export declare interface ContainerEmits {
|
|
1821
1827
|
(e: 'close'): void;
|
|
1822
1828
|
}
|
|
@@ -1893,7 +1899,7 @@ declare const _default_16: typeof _default_44 & {
|
|
|
1893
1899
|
export { _default_16 as McpAddForm }
|
|
1894
1900
|
export { _default_16 as TrMcpAddForm }
|
|
1895
1901
|
|
|
1896
|
-
declare const _default_17:
|
|
1902
|
+
declare const _default_17: __VLS_WithTemplateSlots_15<typeof __VLS_component_15, __VLS_TemplateResult_15["slots"]>;
|
|
1897
1903
|
export { _default_17 as ActionButton }
|
|
1898
1904
|
export { _default_17 as TrActionButton }
|
|
1899
1905
|
|
|
@@ -1914,10 +1920,10 @@ export { _default_2 as TrAttachments }
|
|
|
1914
1920
|
declare const _default_20: DefineComponent<UploadButtonProps, {
|
|
1915
1921
|
open: (localOptions?: Partial<UseFileDialogOptions>) => void;
|
|
1916
1922
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1917
|
-
error: (error: Error,
|
|
1923
|
+
error: (error: Error, files?: File[] | undefined) => any;
|
|
1918
1924
|
select: (files: File[]) => any;
|
|
1919
1925
|
}, string, PublicProps, Readonly<UploadButtonProps> & Readonly<{
|
|
1920
|
-
onError?: ((error: Error,
|
|
1926
|
+
onError?: ((error: Error, files?: File[] | undefined) => any) | undefined;
|
|
1921
1927
|
onSelect?: ((files: File[]) => any) | undefined;
|
|
1922
1928
|
}>, {
|
|
1923
1929
|
reset: boolean;
|
|
@@ -1928,7 +1934,7 @@ accept: string;
|
|
|
1928
1934
|
export { _default_20 as TrUploadButton }
|
|
1929
1935
|
export { _default_20 as UploadButton }
|
|
1930
1936
|
|
|
1931
|
-
declare const _default_21:
|
|
1937
|
+
declare const _default_21: __VLS_WithTemplateSlots_16<typeof __VLS_component_16, __VLS_TemplateResult_16["slots"]>;
|
|
1932
1938
|
export { _default_21 as TrVoiceButton }
|
|
1933
1939
|
export { _default_21 as VoiceButton }
|
|
1934
1940
|
|
|
@@ -1968,13 +1974,11 @@ variant: DisplayVariant;
|
|
|
1968
1974
|
|
|
1969
1975
|
declare const _default_25: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
1970
1976
|
|
|
1971
|
-
declare const _default_26:
|
|
1972
|
-
scrollContainerRef: HTMLDivElement;
|
|
1973
|
-
}, HTMLDivElement>;
|
|
1977
|
+
declare const _default_26: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
|
|
1974
1978
|
|
|
1975
|
-
declare const _default_27:
|
|
1979
|
+
declare const _default_27: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
1976
1980
|
|
|
1977
|
-
declare const _default_28:
|
|
1981
|
+
declare const _default_28: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
1978
1982
|
|
|
1979
1983
|
declare const _default_29: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1980
1984
|
|
|
@@ -1984,9 +1988,9 @@ declare const _default_3: typeof _default_28 & {
|
|
|
1984
1988
|
export { _default_3 as Container }
|
|
1985
1989
|
export { _default_3 as TrContainer }
|
|
1986
1990
|
|
|
1987
|
-
declare const _default_30:
|
|
1991
|
+
declare const _default_30: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
1988
1992
|
|
|
1989
|
-
declare const _default_31:
|
|
1993
|
+
declare const _default_31: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
|
|
1990
1994
|
|
|
1991
1995
|
declare const _default_32: DefineComponent<FeedbackProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1992
1996
|
action: (name: string) => any;
|
|
@@ -2023,13 +2027,13 @@ declare const _default_35: DefineComponent<PromptProps, {}, {}, {}, {}, Componen
|
|
|
2023
2027
|
size: "small" | "medium" | "large";
|
|
2024
2028
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
2025
2029
|
|
|
2026
|
-
declare const _default_36:
|
|
2030
|
+
declare const _default_36: __VLS_WithTemplateSlots_7<typeof __VLS_component_7, __VLS_TemplateResult_7["slots"]>;
|
|
2027
2031
|
|
|
2028
|
-
declare const _default_37:
|
|
2032
|
+
declare const _default_37: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
|
|
2029
2033
|
|
|
2030
|
-
declare const _default_38:
|
|
2034
|
+
declare const _default_38: __VLS_WithTemplateSlots_9<typeof __VLS_component_9, __VLS_TemplateResult_9["slots"]>;
|
|
2031
2035
|
|
|
2032
|
-
declare const _default_39:
|
|
2036
|
+
declare const _default_39: __VLS_WithTemplateSlots_10<typeof __VLS_component_10, __VLS_TemplateResult_10["slots"]>;
|
|
2033
2037
|
|
|
2034
2038
|
declare const _default_4: typeof _default_29 & {
|
|
2035
2039
|
install: typeof install_3;
|
|
@@ -2037,62 +2041,13 @@ declare const _default_4: typeof _default_29 & {
|
|
|
2037
2041
|
export { _default_4 as Conversations }
|
|
2038
2042
|
export { _default_4 as TrConversations }
|
|
2039
2043
|
|
|
2040
|
-
declare const _default_40:
|
|
2044
|
+
declare const _default_40: __VLS_WithTemplateSlots_11<typeof __VLS_component_11, __VLS_TemplateResult_11["slots"]>;
|
|
2041
2045
|
|
|
2042
|
-
declare const _default_41:
|
|
2046
|
+
declare const _default_41: __VLS_WithTemplateSlots_12<typeof __VLS_component_12, __VLS_TemplateResult_12["slots"]>;
|
|
2043
2047
|
|
|
2044
|
-
declare const _default_42:
|
|
2048
|
+
declare const _default_42: __VLS_WithTemplateSlots_13<typeof __VLS_component_13, __VLS_TemplateResult_13["slots"]>;
|
|
2045
2049
|
|
|
2046
|
-
declare const _default_43:
|
|
2047
|
-
"update:visible": (value: boolean) => any;
|
|
2048
|
-
} & {
|
|
2049
|
-
refresh: (tab: "installed" | "market") => any;
|
|
2050
|
-
"update:visible": (visible: boolean) => any;
|
|
2051
|
-
"market-category-change": (category: string) => any;
|
|
2052
|
-
"tab-change": (activeTab: "installed" | "market") => any;
|
|
2053
|
-
"plugin-toggle": (plugin: PluginInfo, enabled: boolean) => any;
|
|
2054
|
-
"plugin-delete": (plugin: PluginInfo) => any;
|
|
2055
|
-
"plugin-add": (plugin: PluginInfo) => any;
|
|
2056
|
-
"plugin-create": (type: "code" | "form", data: PluginCreationData) => any;
|
|
2057
|
-
"tool-toggle": (plugin: PluginInfo, toolId: string, enabled: boolean) => any;
|
|
2058
|
-
"update:activeCount": (count: number) => any;
|
|
2059
|
-
}, string, PublicProps, Readonly<__VLS_PublicProps_6> & Readonly<{
|
|
2060
|
-
onRefresh?: ((tab: "installed" | "market") => any) | undefined;
|
|
2061
|
-
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
2062
|
-
"onMarket-category-change"?: ((category: string) => any) | undefined;
|
|
2063
|
-
"onTab-change"?: ((activeTab: "installed" | "market") => any) | undefined;
|
|
2064
|
-
"onPlugin-toggle"?: ((plugin: PluginInfo, enabled: boolean) => any) | undefined;
|
|
2065
|
-
"onPlugin-delete"?: ((plugin: PluginInfo) => any) | undefined;
|
|
2066
|
-
"onPlugin-add"?: ((plugin: PluginInfo) => any) | undefined;
|
|
2067
|
-
"onPlugin-create"?: ((type: "code" | "form", data: PluginCreationData) => any) | undefined;
|
|
2068
|
-
"onTool-toggle"?: ((plugin: PluginInfo, toolId: string, enabled: boolean) => any) | undefined;
|
|
2069
|
-
"onUpdate:activeCount"?: ((count: number) => any) | undefined;
|
|
2070
|
-
}>, {
|
|
2071
|
-
title: string;
|
|
2072
|
-
loading: boolean;
|
|
2073
|
-
installedPlugins: PluginInfo[];
|
|
2074
|
-
marketPlugins: PluginInfo[];
|
|
2075
|
-
searchPlaceholder: string;
|
|
2076
|
-
enableSearch: boolean;
|
|
2077
|
-
installedSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
2078
|
-
marketSearchFn: (query: string, item: PluginInfo) => boolean;
|
|
2079
|
-
marketCategoryOptions: MarketCategoryOption[];
|
|
2080
|
-
marketCategoryPlaceholder: string;
|
|
2081
|
-
enableMarketCategoryFilter: boolean;
|
|
2082
|
-
defaultActiveTab: "installed" | "market";
|
|
2083
|
-
showInstalledTab: boolean;
|
|
2084
|
-
showMarketTab: boolean;
|
|
2085
|
-
popupConfig: PopupConfig;
|
|
2086
|
-
installedTabTitle: string;
|
|
2087
|
-
marketTabTitle: string;
|
|
2088
|
-
showCustomAddButton: boolean;
|
|
2089
|
-
customAddButtonText: string;
|
|
2090
|
-
allowPluginToggle: boolean;
|
|
2091
|
-
allowToolToggle: boolean;
|
|
2092
|
-
allowPluginDelete: boolean;
|
|
2093
|
-
allowPluginAdd: boolean;
|
|
2094
|
-
marketLoading: boolean;
|
|
2095
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
2050
|
+
declare const _default_43: __VLS_WithTemplateSlots_14<typeof __VLS_component_14, __VLS_TemplateResult_14["slots"]>;
|
|
2096
2051
|
|
|
2097
2052
|
declare const _default_44: DefineComponent<McpAddFormProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2098
2053
|
cancel: () => any;
|
|
@@ -2139,7 +2094,7 @@ export { _default_9 as TrIconButton }
|
|
|
2139
2094
|
/**
|
|
2140
2095
|
* 默认操作按钮配置
|
|
2141
2096
|
*
|
|
2142
|
-
* 用于统一配置
|
|
2097
|
+
* 用于统一配置 Sender 的默认按钮(Clear、Submit)
|
|
2143
2098
|
*
|
|
2144
2099
|
* @example
|
|
2145
2100
|
* ```typescript
|
|
@@ -2488,8 +2443,6 @@ export declare interface IconButtonProps {
|
|
|
2488
2443
|
*/
|
|
2489
2444
|
export declare type InputMode = 'single' | 'multiple';
|
|
2490
2445
|
|
|
2491
|
-
declare type InputMode_2 = 'single' | 'multiple';
|
|
2492
|
-
|
|
2493
2446
|
declare const install: <T>(app: App<T>) => void;
|
|
2494
2447
|
|
|
2495
2448
|
declare const install_10: <T>(app: App<T>) => void;
|
|
@@ -2531,6 +2484,15 @@ declare interface ISuggestionItem {
|
|
|
2531
2484
|
highlights?: string[] | HighlightFunction_2;
|
|
2532
2485
|
}
|
|
2533
2486
|
|
|
2487
|
+
/**
|
|
2488
|
+
* 键盘处理器接口
|
|
2489
|
+
*/
|
|
2490
|
+
export declare interface KeyboardHandlers {
|
|
2491
|
+
checkSubmitShortcut: (event: KeyboardEvent) => boolean;
|
|
2492
|
+
checkNewlineShortcut: (event: KeyboardEvent) => boolean;
|
|
2493
|
+
submit: () => void;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2534
2496
|
export declare interface MarketCategoryOption {
|
|
2535
2497
|
value: string;
|
|
2536
2498
|
label: string;
|
|
@@ -2615,28 +2577,6 @@ export declare interface McpServerPickerProps {
|
|
|
2615
2577
|
*/
|
|
2616
2578
|
declare function mention(items: MentionItem[] | Ref<MentionItem[]>, char?: string, options?: Partial<Omit<MentionOptions, 'items' | 'char'>>): Node_2<MentionOptions, any>;
|
|
2617
2579
|
|
|
2618
|
-
/**
|
|
2619
|
-
* Mention 节点属性(内部使用)
|
|
2620
|
-
*
|
|
2621
|
-
* ProseMirror 节点的属性,id 必填(由插件保证)
|
|
2622
|
-
*/
|
|
2623
|
-
export declare interface MentionAttrs {
|
|
2624
|
-
/**
|
|
2625
|
-
* 唯一标识(必填)
|
|
2626
|
-
*
|
|
2627
|
-
* 由插件自动生成或使用用户提供的值
|
|
2628
|
-
*/
|
|
2629
|
-
id: string;
|
|
2630
|
-
/**
|
|
2631
|
-
* 显示名称
|
|
2632
|
-
*/
|
|
2633
|
-
label: string;
|
|
2634
|
-
/**
|
|
2635
|
-
* 关联值(可选)
|
|
2636
|
-
*/
|
|
2637
|
-
value?: string;
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
2580
|
/**
|
|
2641
2581
|
* 提及项数据结构(用户侧)
|
|
2642
2582
|
*
|
|
@@ -2668,7 +2608,7 @@ export declare interface MentionItem {
|
|
|
2668
2608
|
/**
|
|
2669
2609
|
* Mention 配置选项
|
|
2670
2610
|
*/
|
|
2671
|
-
|
|
2611
|
+
declare interface MentionOptions {
|
|
2672
2612
|
/**
|
|
2673
2613
|
* 提及项列表
|
|
2674
2614
|
*/
|
|
@@ -2692,7 +2632,7 @@ export declare interface MentionOptions {
|
|
|
2692
2632
|
*
|
|
2693
2633
|
* 用于表示文本和 mention 的混合结构
|
|
2694
2634
|
*/
|
|
2695
|
-
|
|
2635
|
+
declare type MentionStructuredItem = {
|
|
2696
2636
|
type: 'text';
|
|
2697
2637
|
content: string;
|
|
2698
2638
|
} | {
|
|
@@ -2872,30 +2812,143 @@ export declare interface SelectOption {
|
|
|
2872
2812
|
data?: string;
|
|
2873
2813
|
}
|
|
2874
2814
|
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2815
|
+
declare const Sender: {
|
|
2816
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<SenderProps> & Readonly<{
|
|
2817
|
+
onClear?: (() => any) | undefined;
|
|
2818
|
+
onInput?: ((value: string) => any) | undefined;
|
|
2819
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
2820
|
+
onCancel?: (() => any) | undefined;
|
|
2821
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
2822
|
+
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
2823
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
2824
|
+
}>, {
|
|
2825
|
+
submit: () => void;
|
|
2826
|
+
clear: () => void;
|
|
2827
|
+
cancel: () => void;
|
|
2828
|
+
focus: () => void;
|
|
2829
|
+
blur: () => void;
|
|
2830
|
+
setContent: (content: string) => void;
|
|
2831
|
+
getContent: () => string;
|
|
2832
|
+
editor: SenderContext["editor"];
|
|
2833
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2834
|
+
clear: () => any;
|
|
2835
|
+
input: (value: string) => any;
|
|
2836
|
+
blur: (event: FocusEvent) => any;
|
|
2837
|
+
cancel: () => any;
|
|
2838
|
+
focus: (event: FocusEvent) => any;
|
|
2839
|
+
submit: (textContent: string, structuredData?: StructuredData | undefined) => any;
|
|
2840
|
+
"update:modelValue": (value: string) => any;
|
|
2841
|
+
}, PublicProps, {
|
|
2842
|
+
size: "normal" | "small";
|
|
2843
|
+
placeholder: string;
|
|
2844
|
+
mode: InputMode;
|
|
2845
|
+
autoSize: AutoSize;
|
|
2846
|
+
extensions: Extension[] | any[];
|
|
2847
|
+
submitType: SubmitTrigger;
|
|
2848
|
+
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
2849
|
+
P: {};
|
|
2850
|
+
B: {};
|
|
2851
|
+
D: {};
|
|
2852
|
+
C: {};
|
|
2853
|
+
M: {};
|
|
2854
|
+
Defaults: {};
|
|
2855
|
+
}, Readonly<SenderProps> & Readonly<{
|
|
2856
|
+
onClear?: (() => any) | undefined;
|
|
2857
|
+
onInput?: ((value: string) => any) | undefined;
|
|
2858
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
2859
|
+
onCancel?: (() => any) | undefined;
|
|
2860
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
2861
|
+
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
2862
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
2863
|
+
}>, {
|
|
2864
|
+
submit: () => void;
|
|
2865
|
+
clear: () => void;
|
|
2866
|
+
cancel: () => void;
|
|
2867
|
+
focus: () => void;
|
|
2868
|
+
blur: () => void;
|
|
2869
|
+
setContent: (content: string) => void;
|
|
2870
|
+
getContent: () => string;
|
|
2871
|
+
editor: SenderContext["editor"];
|
|
2872
|
+
}, {}, {}, {}, {
|
|
2873
|
+
size: "normal" | "small";
|
|
2874
|
+
placeholder: string;
|
|
2875
|
+
mode: InputMode;
|
|
2876
|
+
autoSize: AutoSize;
|
|
2877
|
+
extensions: Extension[] | any[];
|
|
2878
|
+
submitType: SubmitTrigger;
|
|
2879
|
+
}>;
|
|
2880
|
+
__isFragment?: never;
|
|
2881
|
+
__isTeleport?: never;
|
|
2882
|
+
__isSuspense?: never;
|
|
2883
|
+
} & ComponentOptionsBase<Readonly<SenderProps> & Readonly<{
|
|
2884
|
+
onClear?: (() => any) | undefined;
|
|
2885
|
+
onInput?: ((value: string) => any) | undefined;
|
|
2886
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
2887
|
+
onCancel?: (() => any) | undefined;
|
|
2888
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
2889
|
+
onSubmit?: ((textContent: string, structuredData?: StructuredData | undefined) => any) | undefined;
|
|
2890
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
2891
|
+
}>, {
|
|
2892
|
+
submit: () => void;
|
|
2893
|
+
clear: () => void;
|
|
2894
|
+
cancel: () => void;
|
|
2895
|
+
focus: () => void;
|
|
2896
|
+
blur: () => void;
|
|
2897
|
+
setContent: (content: string) => void;
|
|
2898
|
+
getContent: () => string;
|
|
2899
|
+
editor: SenderContext["editor"];
|
|
2900
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
2901
|
+
clear: () => any;
|
|
2902
|
+
input: (value: string) => any;
|
|
2903
|
+
blur: (event: FocusEvent) => any;
|
|
2904
|
+
cancel: () => any;
|
|
2905
|
+
focus: (event: FocusEvent) => any;
|
|
2906
|
+
submit: (textContent: string, structuredData?: StructuredData | undefined) => any;
|
|
2907
|
+
"update:modelValue": (value: string) => any;
|
|
2908
|
+
}, string, {
|
|
2909
|
+
size: "normal" | "small";
|
|
2910
|
+
placeholder: string;
|
|
2911
|
+
mode: InputMode;
|
|
2912
|
+
autoSize: AutoSize;
|
|
2913
|
+
extensions: Extension[] | any[];
|
|
2914
|
+
submitType: SubmitTrigger;
|
|
2915
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
2916
|
+
$slots: {
|
|
2917
|
+
header?(_: {}): any;
|
|
2918
|
+
header?(_: {}): any;
|
|
2919
|
+
prefix?(_: {}): any;
|
|
2920
|
+
prefix?(_: {}): any;
|
|
2921
|
+
content?(_: {
|
|
2922
|
+
editor: Editor | undefined;
|
|
2923
|
+
}): any;
|
|
2924
|
+
content?(_: {
|
|
2925
|
+
editor: Ref<Editor | undefined, Editor | undefined>;
|
|
2926
|
+
}): any;
|
|
2927
|
+
'actions-inline'?(_: {}): any;
|
|
2928
|
+
footer?(_: {}): any;
|
|
2929
|
+
'footer-right'?(_: {}): any;
|
|
2930
|
+
};
|
|
2931
|
+
}) & {
|
|
2932
|
+
install: <T>(app: App<T>) => void;
|
|
2933
|
+
Mention: Node_2<MentionOptions, any>;
|
|
2934
|
+
Suggestion: Extension<SuggestionOptions, any>;
|
|
2935
|
+
Template: Extension<TemplateOptions, any>;
|
|
2936
|
+
mention: typeof mention;
|
|
2937
|
+
suggestion: typeof suggestion;
|
|
2938
|
+
template: typeof template;
|
|
2939
|
+
};
|
|
2894
2940
|
export { Sender }
|
|
2895
2941
|
export { Sender as TrSender }
|
|
2896
2942
|
|
|
2897
2943
|
/**
|
|
2898
|
-
*
|
|
2944
|
+
* Context Key
|
|
2945
|
+
*
|
|
2946
|
+
* 用于 provide/inject 的 key
|
|
2947
|
+
*/
|
|
2948
|
+
export declare const SENDER_CONTEXT_KEY: unique symbol;
|
|
2949
|
+
|
|
2950
|
+
/**
|
|
2951
|
+
* Sender Context
|
|
2899
2952
|
*
|
|
2900
2953
|
* 通过 provide/inject 在组件树中共享的状态和方法
|
|
2901
2954
|
* 所有子组件都可以通过 inject 获取
|
|
@@ -3015,7 +3068,7 @@ export declare interface SenderContext {
|
|
|
3015
3068
|
}
|
|
3016
3069
|
|
|
3017
3070
|
/**
|
|
3018
|
-
*
|
|
3071
|
+
* Sender 组件 Emits
|
|
3019
3072
|
*/
|
|
3020
3073
|
export declare interface SenderEmits {
|
|
3021
3074
|
/**
|
|
@@ -3089,7 +3142,7 @@ export declare interface SenderEmits {
|
|
|
3089
3142
|
}
|
|
3090
3143
|
|
|
3091
3144
|
/**
|
|
3092
|
-
*
|
|
3145
|
+
* Sender 组件 Props
|
|
3093
3146
|
*/
|
|
3094
3147
|
export declare interface SenderProps {
|
|
3095
3148
|
/**
|
|
@@ -3178,14 +3231,14 @@ export declare interface SenderProps {
|
|
|
3178
3231
|
*
|
|
3179
3232
|
* @example 基础使用
|
|
3180
3233
|
* ```typescript
|
|
3181
|
-
* import { Template } from '@tiny-robot/components/
|
|
3234
|
+
* import { Template } from '@tiny-robot/components/sender/extensions'
|
|
3182
3235
|
*
|
|
3183
|
-
* <
|
|
3236
|
+
* <Sender :extensions="[Template]" />
|
|
3184
3237
|
* ```
|
|
3185
3238
|
*
|
|
3186
3239
|
* @example 带配置的扩展(响应式推荐)
|
|
3187
3240
|
* ```typescript
|
|
3188
|
-
* import { Mention, Suggestion } from '@tiny-robot/components/
|
|
3241
|
+
* import { Mention, Suggestion } from '@tiny-robot/components/sender/extensions'
|
|
3189
3242
|
*
|
|
3190
3243
|
* const mentions = ref([...])
|
|
3191
3244
|
* const suggestions = ref([...])
|
|
@@ -3195,7 +3248,7 @@ export declare interface SenderProps {
|
|
|
3195
3248
|
* Suggestion.configure({ items: suggestions })
|
|
3196
3249
|
* ]
|
|
3197
3250
|
*
|
|
3198
|
-
* <
|
|
3251
|
+
* <Sender :extensions="extensions" />
|
|
3199
3252
|
* ```
|
|
3200
3253
|
*/
|
|
3201
3254
|
extensions?: Extension[] | any[];
|
|
@@ -3221,7 +3274,7 @@ export declare interface SenderProps {
|
|
|
3221
3274
|
*
|
|
3222
3275
|
* @example 基础使用
|
|
3223
3276
|
* ```vue
|
|
3224
|
-
* <
|
|
3277
|
+
* <Sender
|
|
3225
3278
|
* :actions-config="{
|
|
3226
3279
|
* submit: { disabled: !isValid, tooltip: '请完善表单' }
|
|
3227
3280
|
* }"
|
|
@@ -3241,7 +3294,7 @@ export declare interface SenderProps {
|
|
|
3241
3294
|
* </script>
|
|
3242
3295
|
*
|
|
3243
3296
|
* <template>
|
|
3244
|
-
* <
|
|
3297
|
+
* <Sender :actions-config="defaultActions" />
|
|
3245
3298
|
* </template>
|
|
3246
3299
|
* ```
|
|
3247
3300
|
*
|
|
@@ -3258,7 +3311,7 @@ export declare interface SenderProps {
|
|
|
3258
3311
|
|
|
3259
3312
|
declare interface SenderProps_2 {
|
|
3260
3313
|
autofocus?: boolean;
|
|
3261
|
-
autoSize?:
|
|
3314
|
+
autoSize?: AutoSize;
|
|
3262
3315
|
allowSpeech?: boolean;
|
|
3263
3316
|
allowFiles?: boolean;
|
|
3264
3317
|
clearable?: boolean;
|
|
@@ -3266,11 +3319,11 @@ declare interface SenderProps_2 {
|
|
|
3266
3319
|
defaultValue?: string | null;
|
|
3267
3320
|
loading?: boolean;
|
|
3268
3321
|
modelValue?: string;
|
|
3269
|
-
mode?:
|
|
3322
|
+
mode?: InputMode;
|
|
3270
3323
|
maxLength?: number;
|
|
3271
3324
|
buttonGroup?: ButtonGroupConfig;
|
|
3272
|
-
submitType?:
|
|
3273
|
-
speech?: boolean |
|
|
3325
|
+
submitType?: SubmitTrigger;
|
|
3326
|
+
speech?: boolean | SpeechConfig;
|
|
3274
3327
|
placeholder?: string;
|
|
3275
3328
|
showWordLimit?: boolean;
|
|
3276
3329
|
suggestions?: ISuggestionItem[];
|
|
@@ -3282,7 +3335,7 @@ declare interface SenderProps_2 {
|
|
|
3282
3335
|
}
|
|
3283
3336
|
|
|
3284
3337
|
/**
|
|
3285
|
-
*
|
|
3338
|
+
* Sender 组件 Slots
|
|
3286
3339
|
*/
|
|
3287
3340
|
export declare interface SenderSlots {
|
|
3288
3341
|
/**
|
|
@@ -3292,38 +3345,105 @@ export declare interface SenderSlots {
|
|
|
3292
3345
|
/**
|
|
3293
3346
|
* 前缀插槽
|
|
3294
3347
|
*/
|
|
3295
|
-
prefix?: () => unknown;
|
|
3348
|
+
prefix?: () => unknown;
|
|
3349
|
+
/**
|
|
3350
|
+
* 内容插槽
|
|
3351
|
+
*
|
|
3352
|
+
* @param props - 插槽属性
|
|
3353
|
+
* @param props.editor - 编辑器实例
|
|
3354
|
+
*/
|
|
3355
|
+
content?: (props: {
|
|
3356
|
+
editor: unknown;
|
|
3357
|
+
}) => unknown;
|
|
3358
|
+
/**
|
|
3359
|
+
* 单行模式内联操作按钮插槽
|
|
3360
|
+
*
|
|
3361
|
+
* @example
|
|
3362
|
+
* ```vue
|
|
3363
|
+
* <sender>
|
|
3364
|
+
* <template #actions-inline="{ insert, focus, disabled }">
|
|
3365
|
+
* <voice-input @result="insert" :disabled="disabled" />
|
|
3366
|
+
* <file-upload @select="handleFiles" />
|
|
3367
|
+
* </template>
|
|
3368
|
+
* </sender>
|
|
3369
|
+
* ```
|
|
3370
|
+
*/
|
|
3371
|
+
'actions-inline'?: (scope: SenderSlotScope) => unknown;
|
|
3372
|
+
/**
|
|
3373
|
+
* 底部插槽(多行模式)
|
|
3374
|
+
*/
|
|
3375
|
+
footer?: (scope: SenderSlotScope) => unknown;
|
|
3376
|
+
/**
|
|
3377
|
+
* 底部右侧插槽(多行模式)
|
|
3378
|
+
*/
|
|
3379
|
+
'footer-right'?: (scope: SenderSlotScope) => unknown;
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3382
|
+
/**
|
|
3383
|
+
* Sender 插槽作用域
|
|
3384
|
+
*
|
|
3385
|
+
* 通过插槽作用域暴露给外部组件的状态和方法
|
|
3386
|
+
* 主要为增强按钮(Upload、Voice 等)提供便捷的操作方法
|
|
3387
|
+
*/
|
|
3388
|
+
export declare interface SenderSlotScope {
|
|
3389
|
+
/**
|
|
3390
|
+
* Tiptap 编辑器实例
|
|
3391
|
+
* 用于高级操作
|
|
3392
|
+
*/
|
|
3393
|
+
editor: Editor_2 | undefined;
|
|
3394
|
+
/**
|
|
3395
|
+
* 聚焦编辑器
|
|
3396
|
+
*/
|
|
3397
|
+
focus: () => void;
|
|
3398
|
+
/**
|
|
3399
|
+
* 失焦编辑器
|
|
3400
|
+
*/
|
|
3401
|
+
blur: () => void;
|
|
3402
|
+
/**
|
|
3403
|
+
* 插入内容到当前光标位置
|
|
3404
|
+
*
|
|
3405
|
+
* 适用场景:语音输入、快捷短语插入
|
|
3406
|
+
*
|
|
3407
|
+
* @param content - 要插入的内容
|
|
3408
|
+
* @example
|
|
3409
|
+
* ```vue
|
|
3410
|
+
* <template #actions-inline="{ insert }">
|
|
3411
|
+
* <VoiceButton @speech-final="insert" />
|
|
3412
|
+
* </template>
|
|
3413
|
+
* ```
|
|
3414
|
+
*/
|
|
3415
|
+
insert: (content: string) => void;
|
|
3416
|
+
/**
|
|
3417
|
+
* 追加内容到编辑器末尾
|
|
3418
|
+
*
|
|
3419
|
+
* 适用场景:连续语音输入、批量添加内容
|
|
3420
|
+
*
|
|
3421
|
+
* @param content - 要追加的内容
|
|
3422
|
+
*/
|
|
3423
|
+
append: (content: string) => void;
|
|
3296
3424
|
/**
|
|
3297
|
-
*
|
|
3425
|
+
* 替换编辑器全部内容
|
|
3298
3426
|
*
|
|
3299
|
-
*
|
|
3300
|
-
*
|
|
3427
|
+
* 适用场景:模板填充、内容重置
|
|
3428
|
+
*
|
|
3429
|
+
* @param content - 新内容
|
|
3301
3430
|
*/
|
|
3302
|
-
|
|
3303
|
-
editor: unknown;
|
|
3304
|
-
}) => unknown;
|
|
3431
|
+
replace: (content: string) => void;
|
|
3305
3432
|
/**
|
|
3306
|
-
*
|
|
3307
|
-
*
|
|
3308
|
-
* @example
|
|
3309
|
-
* ```vue
|
|
3310
|
-
* <chat-input>
|
|
3311
|
-
* <template #actions-inline="{ insert, focus, disabled }">
|
|
3312
|
-
* <voice-input @result="insert" :disabled="disabled" />
|
|
3313
|
-
* <file-upload @select="handleFiles" />
|
|
3314
|
-
* </template>
|
|
3315
|
-
* </chat-input>
|
|
3316
|
-
* ```
|
|
3433
|
+
* 是否禁用
|
|
3434
|
+
* 用于控制自定义按钮状态
|
|
3317
3435
|
*/
|
|
3318
|
-
|
|
3436
|
+
disabled: boolean;
|
|
3319
3437
|
/**
|
|
3320
|
-
*
|
|
3438
|
+
* 是否加载中
|
|
3439
|
+
* 用于控制按钮加载状态和禁用
|
|
3321
3440
|
*/
|
|
3322
|
-
|
|
3441
|
+
loading: boolean;
|
|
3323
3442
|
/**
|
|
3324
|
-
*
|
|
3443
|
+
* 是否有内容
|
|
3444
|
+
* 用于控制按钮显示/隐藏
|
|
3325
3445
|
*/
|
|
3326
|
-
|
|
3446
|
+
hasContent: boolean;
|
|
3327
3447
|
}
|
|
3328
3448
|
|
|
3329
3449
|
/**
|
|
@@ -3388,14 +3508,6 @@ export declare interface SpeechCallbacks {
|
|
|
3388
3508
|
onError: (error: Error) => void;
|
|
3389
3509
|
}
|
|
3390
3510
|
|
|
3391
|
-
declare interface SpeechCallbacks_2 {
|
|
3392
|
-
onStart: () => void;
|
|
3393
|
-
onInterim: (transcript: string) => void;
|
|
3394
|
-
onFinal: (transcript: string) => void;
|
|
3395
|
-
onEnd: (transcript?: string) => void;
|
|
3396
|
-
onError: (error: Error) => void;
|
|
3397
|
-
}
|
|
3398
|
-
|
|
3399
3511
|
export declare interface SpeechConfig {
|
|
3400
3512
|
customHandler?: SpeechHandler;
|
|
3401
3513
|
lang?: string;
|
|
@@ -3405,27 +3517,12 @@ export declare interface SpeechConfig {
|
|
|
3405
3517
|
onVoiceButtonClick?: (isRecording: boolean, preventDefault: () => void) => void | Promise<void>;
|
|
3406
3518
|
}
|
|
3407
3519
|
|
|
3408
|
-
declare interface SpeechConfig_2 {
|
|
3409
|
-
customHandler?: SpeechHandler_2;
|
|
3410
|
-
lang?: string;
|
|
3411
|
-
continuous?: boolean;
|
|
3412
|
-
interimResults?: boolean;
|
|
3413
|
-
autoReplace?: boolean;
|
|
3414
|
-
onVoiceButtonClick?: (isRecording: boolean, preventDefault: () => void) => void | Promise<void>;
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
3520
|
export declare interface SpeechHandler {
|
|
3418
3521
|
start: (callbacks: SpeechCallbacks) => Promise<void> | void;
|
|
3419
3522
|
stop: () => Promise<void> | void;
|
|
3420
3523
|
isSupported: () => boolean;
|
|
3421
3524
|
}
|
|
3422
3525
|
|
|
3423
|
-
declare interface SpeechHandler_2 {
|
|
3424
|
-
start: (callbacks: SpeechCallbacks_2) => Promise<void> | void;
|
|
3425
|
-
stop: () => Promise<void> | void;
|
|
3426
|
-
isSupported: () => boolean;
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
3526
|
export declare interface SpeechHandlerResult {
|
|
3430
3527
|
speechState: SpeechState;
|
|
3431
3528
|
start: () => void;
|
|
@@ -3465,13 +3562,20 @@ export declare interface SpeechState {
|
|
|
3465
3562
|
* // text: "帮我分析 的周报"
|
|
3466
3563
|
* // data: [
|
|
3467
3564
|
* // { type: 'text', content: '帮我分析 ' },
|
|
3468
|
-
* // { type: '
|
|
3565
|
+
* // { type: 'block', content: '张三' },
|
|
3469
3566
|
* // { type: 'text', content: ' 的周报' }
|
|
3470
3567
|
* // ]
|
|
3471
3568
|
*
|
|
3472
|
-
*
|
|
3473
|
-
*
|
|
3474
|
-
*
|
|
3569
|
+
* // 提取模板块(可编辑部分)
|
|
3570
|
+
* if (data && data.some(item => item.type === 'block')) {
|
|
3571
|
+
* const blocks = data.filter(item => item.type === 'block')
|
|
3572
|
+
* console.log('模板块:', blocks)
|
|
3573
|
+
* }
|
|
3574
|
+
*
|
|
3575
|
+
* // 提取选择器
|
|
3576
|
+
* if (data && data.some(item => item.type === 'select')) {
|
|
3577
|
+
* const selects = data.filter(item => item.type === 'select')
|
|
3578
|
+
* console.log('选择器:', selects)
|
|
3475
3579
|
* }
|
|
3476
3580
|
* }
|
|
3477
3581
|
* ```
|
|
@@ -3490,8 +3594,8 @@ export declare interface SpeechState {
|
|
|
3490
3594
|
* const allContent = data?.map(item => item.content).join('')
|
|
3491
3595
|
* console.log('完整内容:', allContent)
|
|
3492
3596
|
*
|
|
3493
|
-
* // 提取 mention
|
|
3494
|
-
* if (data && data
|
|
3597
|
+
* // 提取 mention(正确的类型守卫)
|
|
3598
|
+
* if (data && data.some(item => item.type === 'mention')) {
|
|
3495
3599
|
* const mentions = data.filter(item => item.type === 'mention')
|
|
3496
3600
|
* console.log('提及的人:', mentions.map(m => m.content))
|
|
3497
3601
|
* console.log('关联值:', mentions.map(m => m.value))
|
|
@@ -3509,8 +3613,6 @@ export declare type StructuredData = TemplateItem[] | MentionStructuredItem[];
|
|
|
3509
3613
|
*/
|
|
3510
3614
|
export declare type SubmitTrigger = 'enter' | 'ctrlEnter' | 'shiftEnter';
|
|
3511
3615
|
|
|
3512
|
-
declare type SubmitTrigger_2 = 'enter' | 'ctrlEnter' | 'shiftEnter';
|
|
3513
|
-
|
|
3514
3616
|
/**
|
|
3515
3617
|
* 创建 Suggestion 扩展的便捷函数
|
|
3516
3618
|
*
|
|
@@ -3541,12 +3643,68 @@ export declare interface SuggestionGroup<T = Record<string, unknown>> {
|
|
|
3541
3643
|
|
|
3542
3644
|
export declare type SuggestionItem<T = Record<string, unknown>> = SuggestionBaseItem & T;
|
|
3543
3645
|
|
|
3646
|
+
/**
|
|
3647
|
+
* SuggestionList Emits
|
|
3648
|
+
*/
|
|
3649
|
+
export declare interface SuggestionListEmits {
|
|
3650
|
+
/**
|
|
3651
|
+
* 选择建议
|
|
3652
|
+
*
|
|
3653
|
+
* @param suggestion - 建议内容
|
|
3654
|
+
*/
|
|
3655
|
+
(e: 'select', suggestion: string): void;
|
|
3656
|
+
/**
|
|
3657
|
+
* 鼠标进入
|
|
3658
|
+
*
|
|
3659
|
+
* @param index - 索引
|
|
3660
|
+
*/
|
|
3661
|
+
(e: 'mouse-enter', index: number): void;
|
|
3662
|
+
/**
|
|
3663
|
+
* 鼠标离开
|
|
3664
|
+
*/
|
|
3665
|
+
(e: 'mouse-leave'): void;
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
/**
|
|
3669
|
+
* SuggestionList Props
|
|
3670
|
+
*/
|
|
3671
|
+
export declare interface SuggestionListProps {
|
|
3672
|
+
/**
|
|
3673
|
+
* 是否显示
|
|
3674
|
+
*/
|
|
3675
|
+
show: boolean;
|
|
3676
|
+
/**
|
|
3677
|
+
* 建议列表
|
|
3678
|
+
*/
|
|
3679
|
+
suggestions: SenderSuggestionItem[];
|
|
3680
|
+
/**
|
|
3681
|
+
* 键盘激活索引
|
|
3682
|
+
*/
|
|
3683
|
+
activeKeyboardIndex: number;
|
|
3684
|
+
/**
|
|
3685
|
+
* 鼠标激活索引
|
|
3686
|
+
*/
|
|
3687
|
+
activeMouseIndex: number;
|
|
3688
|
+
/**
|
|
3689
|
+
* 输入值
|
|
3690
|
+
*/
|
|
3691
|
+
inputValue: string;
|
|
3692
|
+
/**
|
|
3693
|
+
* 弹窗样式
|
|
3694
|
+
*/
|
|
3695
|
+
popupStyle?: Record<string, string | number>;
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3544
3698
|
/**
|
|
3545
3699
|
* 插件配置选项
|
|
3546
3700
|
*/
|
|
3547
3701
|
export declare interface SuggestionOptions {
|
|
3548
3702
|
/**
|
|
3549
|
-
*
|
|
3703
|
+
* 建议项列表(可选)
|
|
3704
|
+
*
|
|
3705
|
+
* 不传或传空数组时,建议功能不会显示
|
|
3706
|
+
*
|
|
3707
|
+
* @default []
|
|
3550
3708
|
*
|
|
3551
3709
|
* @example
|
|
3552
3710
|
* ```typescript
|
|
@@ -3622,7 +3780,7 @@ export declare interface SuggestionOptions {
|
|
|
3622
3780
|
/**
|
|
3623
3781
|
* 选中建议项的回调
|
|
3624
3782
|
*
|
|
3625
|
-
* @param item - 选中的建议项(包含完整的
|
|
3783
|
+
* @param item - 选中的建议项(包含完整的 SenderSuggestionItem 信息)
|
|
3626
3784
|
* @returns 返回 false 可阻止默认回填行为
|
|
3627
3785
|
*
|
|
3628
3786
|
* @example 默认行为(自动回填)
|
|
@@ -3864,20 +4022,6 @@ declare interface SuggestionTextPart_2 {
|
|
|
3864
4022
|
*/
|
|
3865
4023
|
declare function template(items: TemplateItem[] | Ref<TemplateItem[]>, options?: Partial<Omit<TemplateOptions, 'items'>>): Extension<TemplateOptions, any>;
|
|
3866
4024
|
|
|
3867
|
-
/**
|
|
3868
|
-
* Template 节点属性
|
|
3869
|
-
*/
|
|
3870
|
-
export declare interface TemplateAttrs {
|
|
3871
|
-
/**
|
|
3872
|
-
* 模板块 ID
|
|
3873
|
-
*/
|
|
3874
|
-
id: string;
|
|
3875
|
-
/**
|
|
3876
|
-
* 模板块内容
|
|
3877
|
-
*/
|
|
3878
|
-
content: string;
|
|
3879
|
-
}
|
|
3880
|
-
|
|
3881
4025
|
/**
|
|
3882
4026
|
* 模板项(用户侧)
|
|
3883
4027
|
*
|
|
@@ -3940,16 +4084,10 @@ export declare type TemplateItem = {
|
|
|
3940
4084
|
value?: string;
|
|
3941
4085
|
};
|
|
3942
4086
|
|
|
3943
|
-
declare interface TemplateItem_2 {
|
|
3944
|
-
id: string;
|
|
3945
|
-
type: 'template' | 'block';
|
|
3946
|
-
content: string;
|
|
3947
|
-
}
|
|
3948
|
-
|
|
3949
4087
|
/**
|
|
3950
4088
|
* Template 配置选项
|
|
3951
4089
|
*/
|
|
3952
|
-
|
|
4090
|
+
declare interface TemplateOptions {
|
|
3953
4091
|
/**
|
|
3954
4092
|
* 模板数据列表(推荐使用 ref 实现响应式)
|
|
3955
4093
|
*
|
|
@@ -3976,41 +4114,13 @@ export declare interface TemplateOptions {
|
|
|
3976
4114
|
* })
|
|
3977
4115
|
* ```
|
|
3978
4116
|
*/
|
|
3979
|
-
items?: TemplateItem[] | Ref<TemplateItem[]
|
|
4117
|
+
items?: TemplateItem[] | Ref<TemplateItem[]>;
|
|
3980
4118
|
/**
|
|
3981
4119
|
* HTML 属性
|
|
3982
4120
|
*/
|
|
3983
4121
|
HTMLAttributes?: Record<string, unknown>;
|
|
3984
4122
|
}
|
|
3985
4123
|
|
|
3986
|
-
/**
|
|
3987
|
-
* TemplateSelect 节点属性
|
|
3988
|
-
*/
|
|
3989
|
-
export declare interface TemplateSelectAttrs {
|
|
3990
|
-
/**
|
|
3991
|
-
* 唯一标识
|
|
3992
|
-
*/
|
|
3993
|
-
id: string;
|
|
3994
|
-
/**
|
|
3995
|
-
* 占位文字(未选择时显示)
|
|
3996
|
-
*/
|
|
3997
|
-
placeholder: string;
|
|
3998
|
-
/**
|
|
3999
|
-
* 选项列表
|
|
4000
|
-
*/
|
|
4001
|
-
options: SelectOption_2[];
|
|
4002
|
-
/**
|
|
4003
|
-
* 当前选中的值(可选)
|
|
4004
|
-
*/
|
|
4005
|
-
value?: string;
|
|
4006
|
-
}
|
|
4007
|
-
|
|
4008
|
-
declare interface TextItem {
|
|
4009
|
-
id: string;
|
|
4010
|
-
type: 'text';
|
|
4011
|
-
content: string;
|
|
4012
|
-
}
|
|
4013
|
-
|
|
4014
4124
|
export declare interface ThemeProviderProps {
|
|
4015
4125
|
/**
|
|
4016
4126
|
* 颜色模式(v-model:colorMode),可选值:light、dark、auto,默认值:auto
|
|
@@ -4032,6 +4142,19 @@ export declare type ThemeStorage = Pick<Storage, 'getItem' | 'setItem'>;
|
|
|
4032
4142
|
|
|
4033
4143
|
declare type ThemeType = 'light' | 'dark';
|
|
4034
4144
|
|
|
4145
|
+
/**
|
|
4146
|
+
* 工具调用接口(支持 OpenAI 格式)
|
|
4147
|
+
*/
|
|
4148
|
+
declare interface ToolCall {
|
|
4149
|
+
id: string;
|
|
4150
|
+
type: 'function' | string;
|
|
4151
|
+
function: {
|
|
4152
|
+
name: string;
|
|
4153
|
+
arguments: string;
|
|
4154
|
+
};
|
|
4155
|
+
[x: string]: any;
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4035
4158
|
/**
|
|
4036
4159
|
* Tooltip 内容类型
|
|
4037
4160
|
* - string: 简单文本
|
|
@@ -4066,7 +4189,7 @@ export declare interface UploadButtonEmits {
|
|
|
4066
4189
|
/**
|
|
4067
4190
|
* 文件验证失败
|
|
4068
4191
|
*/
|
|
4069
|
-
(e: 'error', error: Error,
|
|
4192
|
+
(e: 'error', error: Error, files?: File[]): void;
|
|
4070
4193
|
}
|
|
4071
4194
|
|
|
4072
4195
|
export declare interface UploadButtonProps {
|
|
@@ -4121,30 +4244,180 @@ export declare interface UrlAttachment extends BaseAttachment {
|
|
|
4121
4244
|
rawFile?: File;
|
|
4122
4245
|
}
|
|
4123
4246
|
|
|
4247
|
+
/**
|
|
4248
|
+
* 当目标滚动容器 `target` 接近底部时,且源数据 `source` 变化,自动滚动到底部
|
|
4249
|
+
* @param target 目标滚动容器的元素引用
|
|
4250
|
+
* @param source 监听的源数据,当该数据变化时会触发自动滚动
|
|
4251
|
+
* @param options 配置选项
|
|
4252
|
+
* @param options.scrollOnMount 是否在组件挂载时滚动到底部,默认为 true
|
|
4253
|
+
* @param options.bottomThreshold 判断接近底部的阈值(像素),默认为 20
|
|
4254
|
+
* @returns scrollToBottom 手动滚动到底部的方法
|
|
4255
|
+
*/
|
|
4256
|
+
export declare function useAutoScroll(target: MaybeComputedElementRef, source: MaybeRefOrGetter<any>, options?: {
|
|
4257
|
+
scrollOnMount?: boolean;
|
|
4258
|
+
scrollThrottle?: number;
|
|
4259
|
+
bottomThreshold?: number;
|
|
4260
|
+
}): {
|
|
4261
|
+
scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
|
|
4262
|
+
};
|
|
4263
|
+
|
|
4264
|
+
export declare function useBubbleBoxRenderer(messages: MaybeRefOrGetter<BubbleMessage[]>, contentIndex?: number): ComputedRef<{
|
|
4265
|
+
renderer: Component;
|
|
4266
|
+
attributes?: Record<string, string>;
|
|
4267
|
+
}>;
|
|
4268
|
+
|
|
4269
|
+
export declare function useBubbleContentRenderer(message: MaybeRefOrGetter<BubbleMessage>, contentIndex?: number): ComputedRef<Component>;
|
|
4270
|
+
|
|
4271
|
+
export declare function useBubbleStateChangeFn(): (key: string, _value: unknown) => void;
|
|
4272
|
+
|
|
4273
|
+
/**
|
|
4274
|
+
* useEditor 返回类型
|
|
4275
|
+
*/
|
|
4276
|
+
export declare interface UseEditorReturn {
|
|
4277
|
+
/**
|
|
4278
|
+
* 编辑器实例
|
|
4279
|
+
* 注意:Tiptap 的 useEditor 返回 ShallowRef<Editor | undefined>
|
|
4280
|
+
*/
|
|
4281
|
+
editor: Ref<Editor | undefined>;
|
|
4282
|
+
/**
|
|
4283
|
+
* 编辑器 DOM 引用
|
|
4284
|
+
*/
|
|
4285
|
+
editorRef: Ref<HTMLElement | null>;
|
|
4286
|
+
}
|
|
4287
|
+
|
|
4288
|
+
/**
|
|
4289
|
+
* useKeyboardShortcuts Hook 参数
|
|
4290
|
+
*/
|
|
4291
|
+
export declare interface UseKeyboardShortcutsParams {
|
|
4292
|
+
submitType: Ref<SubmitTrigger>;
|
|
4293
|
+
canSubmit: Ref<boolean>;
|
|
4294
|
+
mode: Ref<InputMode>;
|
|
4295
|
+
submit: () => void;
|
|
4296
|
+
setMode: (mode: InputMode) => void;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
/**
|
|
4300
|
+
* useKeyboardShortcuts Hook 返回值
|
|
4301
|
+
*/
|
|
4302
|
+
export declare interface UseKeyboardShortcutsReturn {
|
|
4303
|
+
checkSubmitShortcut: (event: KeyboardEvent) => boolean;
|
|
4304
|
+
checkNewlineShortcut: (event: KeyboardEvent) => boolean;
|
|
4305
|
+
}
|
|
4306
|
+
|
|
4307
|
+
export declare const useMessageContent: <T = string | ChatMessageContentItem | undefined>(message: MaybeRefOrGetter<BubbleMessage>, contentIndex?: number) => ComputedRef<T>;
|
|
4308
|
+
|
|
4309
|
+
/**
|
|
4310
|
+
* useModeSwitch 返回类型
|
|
4311
|
+
*/
|
|
4312
|
+
export declare interface UseModeSwitchReturn {
|
|
4313
|
+
/**
|
|
4314
|
+
* 当前模式
|
|
4315
|
+
*/
|
|
4316
|
+
currentMode: Ref<InputMode>;
|
|
4317
|
+
/**
|
|
4318
|
+
* 是否正在自动切换
|
|
4319
|
+
*/
|
|
4320
|
+
isAutoSwitching: Ref<boolean>;
|
|
4321
|
+
/**
|
|
4322
|
+
* 设置模式
|
|
4323
|
+
*
|
|
4324
|
+
* @param mode - 输入模式
|
|
4325
|
+
*/
|
|
4326
|
+
setMode: (mode: InputMode) => void;
|
|
4327
|
+
/**
|
|
4328
|
+
* 检查内容溢出
|
|
4329
|
+
*
|
|
4330
|
+
* 用于自动切换模式
|
|
4331
|
+
*/
|
|
4332
|
+
checkOverflow: () => void;
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4335
|
+
/**
|
|
4336
|
+
* Omit specified fields from message and return computed props
|
|
4337
|
+
* @param props - The original props containing the message
|
|
4338
|
+
* @param fields - Array of field names to omit from the message
|
|
4339
|
+
* @returns An object containing restMessage and restProps computed refs
|
|
4340
|
+
*/
|
|
4341
|
+
export declare function useOmitMessageFields<P extends BubbleContentRendererProps, K extends keyof BubbleMessage>(props: P, fields: K[]): {
|
|
4342
|
+
restMessage: ComputedRef<Omit<BubbleMessage, K>>;
|
|
4343
|
+
restProps: ComputedRef<P>;
|
|
4344
|
+
};
|
|
4345
|
+
|
|
4124
4346
|
declare type UserItem = UserTextItem | UserTemplateItem;
|
|
4125
4347
|
|
|
4126
|
-
declare type UserTemplateItem = Omit<Pick<
|
|
4127
|
-
id?:
|
|
4348
|
+
declare type UserTemplateItem = Omit<Pick<CompatTemplateItem, 'type' | 'content'>, 'id'> & {
|
|
4349
|
+
id?: CompatTemplateItem['id'];
|
|
4128
4350
|
};
|
|
4129
4351
|
|
|
4130
|
-
declare type UserTextItem = Omit<
|
|
4131
|
-
id?:
|
|
4352
|
+
declare type UserTextItem = Omit<CompatTextItem, 'id'> & {
|
|
4353
|
+
id?: CompatTextItem['id'];
|
|
4132
4354
|
};
|
|
4133
4355
|
|
|
4134
4356
|
/**
|
|
4135
|
-
* 获取
|
|
4357
|
+
* 获取 Sender Context
|
|
4136
4358
|
*/
|
|
4137
4359
|
export declare function useSenderContext(): SenderContext;
|
|
4138
4360
|
|
|
4139
4361
|
/**
|
|
4140
|
-
*
|
|
4141
|
-
* 支持内置 Web Speech API 和自定义语音处理器
|
|
4142
|
-
* 通过 customHandler 参数切换实现,默认使用内置的 Web Speech API
|
|
4143
|
-
*
|
|
4144
|
-
* @param options 语音识别配置
|
|
4145
|
-
* @returns 语音识别控制器
|
|
4362
|
+
* useSenderContext 返回类型
|
|
4146
4363
|
*/
|
|
4147
|
-
export declare
|
|
4364
|
+
export declare type UseSenderContextReturn = SenderContext;
|
|
4365
|
+
|
|
4366
|
+
/**
|
|
4367
|
+
* useSuggestion 返回类型
|
|
4368
|
+
*/
|
|
4369
|
+
export declare interface UseSuggestionReturn {
|
|
4370
|
+
/**
|
|
4371
|
+
* 弹窗是否可见
|
|
4372
|
+
*/
|
|
4373
|
+
isPopupVisible: Ref<boolean>;
|
|
4374
|
+
/**
|
|
4375
|
+
* 当前激活的建议
|
|
4376
|
+
*/
|
|
4377
|
+
activeSuggestion: Ref<string>;
|
|
4378
|
+
/**
|
|
4379
|
+
* 键盘导航的激活索引
|
|
4380
|
+
*/
|
|
4381
|
+
activeKeyboardIndex: Ref<number>;
|
|
4382
|
+
/**
|
|
4383
|
+
* 鼠标悬停的激活索引
|
|
4384
|
+
*/
|
|
4385
|
+
activeMouseIndex: Ref<number>;
|
|
4386
|
+
/**
|
|
4387
|
+
* 自动补全文本
|
|
4388
|
+
*/
|
|
4389
|
+
autoCompleteText: Ref<string>;
|
|
4390
|
+
/**
|
|
4391
|
+
* 是否显示 Tab 提示器
|
|
4392
|
+
*/
|
|
4393
|
+
showTabIndicator: Ref<boolean>;
|
|
4394
|
+
/**
|
|
4395
|
+
* 应用建议
|
|
4396
|
+
*
|
|
4397
|
+
* @param suggestion - 建议内容
|
|
4398
|
+
*/
|
|
4399
|
+
applySuggestion: (suggestion: string) => void;
|
|
4400
|
+
/**
|
|
4401
|
+
* 键盘导航
|
|
4402
|
+
*
|
|
4403
|
+
* @param direction - 方向(上/下)
|
|
4404
|
+
*/
|
|
4405
|
+
navigateWithKeyboard: (direction: 'up' | 'down') => void;
|
|
4406
|
+
/**
|
|
4407
|
+
* 鼠标进入
|
|
4408
|
+
*
|
|
4409
|
+
* @param index - 建议项索引
|
|
4410
|
+
*/
|
|
4411
|
+
handleMouseEnter: (index: number) => void;
|
|
4412
|
+
/**
|
|
4413
|
+
* 鼠标离开
|
|
4414
|
+
*/
|
|
4415
|
+
handleMouseLeave: () => void;
|
|
4416
|
+
/**
|
|
4417
|
+
* 关闭弹窗
|
|
4418
|
+
*/
|
|
4419
|
+
closePopup: () => void;
|
|
4420
|
+
}
|
|
4148
4421
|
|
|
4149
4422
|
export declare const useTheme: () => {
|
|
4150
4423
|
theme: Ref<string, string> | undefined;
|
|
@@ -4187,9 +4460,27 @@ export declare interface VoiceButtonEmits {
|
|
|
4187
4460
|
*/
|
|
4188
4461
|
export declare interface VoiceButtonProps {
|
|
4189
4462
|
/**
|
|
4190
|
-
*
|
|
4463
|
+
* 自定义未录音状态的图标
|
|
4464
|
+
*
|
|
4465
|
+
* @default IconVoice
|
|
4466
|
+
*
|
|
4467
|
+
* @example 基础使用
|
|
4468
|
+
* ```vue
|
|
4469
|
+
* <VoiceButton :icon="IconMicrophone" />
|
|
4470
|
+
* ```
|
|
4191
4471
|
*/
|
|
4192
4472
|
icon?: VNode | Component;
|
|
4473
|
+
/**
|
|
4474
|
+
* 自定义录音中状态的图标
|
|
4475
|
+
*
|
|
4476
|
+
* @default IconRecordingWave
|
|
4477
|
+
*
|
|
4478
|
+
* @example 自定义录音中图标
|
|
4479
|
+
* ```vue
|
|
4480
|
+
* <VoiceButton :recording-icon="MyRecordingIcon" />
|
|
4481
|
+
* ```
|
|
4482
|
+
*/
|
|
4483
|
+
recordingIcon?: VNode | Component;
|
|
4193
4484
|
/**
|
|
4194
4485
|
* 是否禁用(会与 Context 的 disabled 合并)
|
|
4195
4486
|
*/
|
|
@@ -4221,46 +4512,6 @@ export declare interface VoiceButtonProps {
|
|
|
4221
4512
|
onButtonClick?: (isRecording: boolean, preventDefault: () => void) => void | Promise<void>;
|
|
4222
4513
|
}
|
|
4223
4514
|
|
|
4224
|
-
/**
|
|
4225
|
-
* 内置 Web Speech API 处理器
|
|
4226
|
-
* 基于浏览器原生 Web Speech API 实现的语音识别
|
|
4227
|
-
*/
|
|
4228
|
-
export declare class WebSpeechHandler implements SpeechHandler {
|
|
4229
|
-
private recognition?;
|
|
4230
|
-
private options;
|
|
4231
|
-
/**
|
|
4232
|
-
* 初始化语音识别实例
|
|
4233
|
-
*/
|
|
4234
|
-
private initialize;
|
|
4235
|
-
constructor(options: SpeechConfig);
|
|
4236
|
-
/**
|
|
4237
|
-
* 检查浏览器是否支持 Web Speech API
|
|
4238
|
-
*/
|
|
4239
|
-
static isSupported(): boolean;
|
|
4240
|
-
/**
|
|
4241
|
-
* 检查浏览器是否支持 Web Speech API(实例方法)
|
|
4242
|
-
*/
|
|
4243
|
-
isSupported(): boolean;
|
|
4244
|
-
/**
|
|
4245
|
-
* 设置语音识别事件处理器
|
|
4246
|
-
* @param callbacks 语音识别回调函数集合
|
|
4247
|
-
*/
|
|
4248
|
-
private setupEventHandlers;
|
|
4249
|
-
/**
|
|
4250
|
-
* 清理事件监听器
|
|
4251
|
-
*/
|
|
4252
|
-
private cleanup;
|
|
4253
|
-
/**
|
|
4254
|
-
* 开始语音识别
|
|
4255
|
-
* @param callbacks 语音识别回调函数集合
|
|
4256
|
-
*/
|
|
4257
|
-
start(callbacks: SpeechCallbacks): void;
|
|
4258
|
-
/**
|
|
4259
|
-
* 停止语音识别并清理资源
|
|
4260
|
-
*/
|
|
4261
|
-
stop(): void;
|
|
4262
|
-
}
|
|
4263
|
-
|
|
4264
4515
|
export declare interface WelcomeProps {
|
|
4265
4516
|
title: string;
|
|
4266
4517
|
description: string;
|
|
@@ -4272,6 +4523,24 @@ export declare interface WelcomeSlots {
|
|
|
4272
4523
|
footer: () => unknown;
|
|
4273
4524
|
}
|
|
4274
4525
|
|
|
4526
|
+
/**
|
|
4527
|
+
* WordCounter Props
|
|
4528
|
+
*/
|
|
4529
|
+
export declare interface WordCounterProps {
|
|
4530
|
+
/**
|
|
4531
|
+
* 当前字符数
|
|
4532
|
+
*/
|
|
4533
|
+
current: number;
|
|
4534
|
+
/**
|
|
4535
|
+
* 最大字符数
|
|
4536
|
+
*/
|
|
4537
|
+
max: number;
|
|
4538
|
+
/**
|
|
4539
|
+
* 是否超出限制
|
|
4540
|
+
*/
|
|
4541
|
+
isOverLimit: boolean;
|
|
4542
|
+
}
|
|
4543
|
+
|
|
4275
4544
|
export { }
|
|
4276
4545
|
|
|
4277
4546
|
|