@blueking/ai-blueking 0.4.3 → 0.5.0-beta.1
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/ai-blueking-new.vue.d.ts +61 -0
- package/dist/ai-blueking.vue.d.ts +20 -12
- package/dist/components-new/ai-cite.vue.d.ts +21 -0
- package/dist/components-new/ai-header.vue.d.ts +21 -0
- package/dist/components-new/chat-input-box.vue.d.ts +33 -0
- package/dist/components-new/delete-confirm.vue.d.ts +21 -0
- package/dist/components-new/render-message.vue.d.ts +49 -0
- package/dist/components-new/render-popup.vue.d.ts +21 -0
- package/dist/components-new/shortcuts-bar.vue.d.ts +20 -0
- package/dist/components-new/text-editor.vue.d.ts +50 -0
- package/dist/composables/use-main-container.d.ts +12 -0
- package/dist/composables/use-nimbus.d.ts +21 -0
- package/dist/composables/use-select-pop.d.ts +1 -0
- package/dist/composables/use-textarea-height.d.ts +20 -0
- package/dist/composables/use-tippy.d.ts +25 -0
- package/dist/config/shortcuts.d.ts +2 -2
- package/dist/lang/index.d.ts +12 -0
- package/dist/types/index.d.ts +14 -47
- package/dist/utils/delete-confirm.d.ts +20 -0
- package/dist/utils/index.d.ts +43 -0
- package/dist/views/nimbus.vue.d.ts +21 -0
- package/dist/vue2/index.es.min.js +69399 -17438
- package/dist/vue2/index.iife.min.js +377 -143
- package/dist/vue2/index.umd.min.js +302 -72
- package/dist/vue2/style.css +1 -1
- package/dist/vue2.d.ts +0 -3
- package/dist/vue3/index.es.min.js +9799 -1667
- package/dist/vue3/index.iife.min.js +373 -143
- package/dist/vue3/index.umd.min.js +109 -46
- package/dist/vue3/style.css +1 -1
- package/dist/vue3.d.ts +2 -5
- package/package.json +7 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
2
|
+
import 'vue-draggable-resizable/style.css';
|
|
3
|
+
interface Props {
|
|
4
|
+
enablePopup?: boolean;
|
|
5
|
+
shortcuts?: ShortCut[];
|
|
6
|
+
url?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
9
|
+
enablePopup: boolean;
|
|
10
|
+
shortcuts: () => ShortCut[];
|
|
11
|
+
url: string;
|
|
12
|
+
}>, {
|
|
13
|
+
handleShow: () => void;
|
|
14
|
+
handleStop: () => void;
|
|
15
|
+
sendChat: (content: import("@blueking/ai-ui-sdk").BasicChatContent | import("@blueking/ai-ui-sdk").ShortcutChatContent, callback?: (() => void) | undefined) => void;
|
|
16
|
+
handleSendMessage: (message: string) => void;
|
|
17
|
+
handleShortcutClick: (shortcut: ShortCut) => void;
|
|
18
|
+
handleDelete: (index: number) => void;
|
|
19
|
+
handleRegenerate: (index: number) => void;
|
|
20
|
+
handleResend: (index: number, value: {
|
|
21
|
+
message: string;
|
|
22
|
+
cite: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
close: () => void;
|
|
26
|
+
"shortcut-click": (shortcut: ShortCut) => void;
|
|
27
|
+
stop: () => void;
|
|
28
|
+
show: () => void;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
30
|
+
enablePopup: boolean;
|
|
31
|
+
shortcuts: () => ShortCut[];
|
|
32
|
+
url: string;
|
|
33
|
+
}>>> & {
|
|
34
|
+
onShow?: (() => any) | undefined;
|
|
35
|
+
onClose?: (() => any) | undefined;
|
|
36
|
+
"onShortcut-click"?: ((shortcut: ShortCut) => any) | undefined;
|
|
37
|
+
onStop?: (() => any) | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
shortcuts: ShortCut[];
|
|
40
|
+
enablePopup: boolean;
|
|
41
|
+
url: string;
|
|
42
|
+
}, {}>;
|
|
43
|
+
export default _default;
|
|
44
|
+
|
|
45
|
+
type __VLS_WithDefaults<P, D> = {
|
|
46
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
47
|
+
default: D[K];
|
|
48
|
+
}> : P[K];
|
|
49
|
+
};
|
|
50
|
+
type __VLS_Prettify<T> = {
|
|
51
|
+
[K in keyof T]: T[K];
|
|
52
|
+
} & {};
|
|
53
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
54
|
+
type __VLS_TypePropsToOption<T> = {
|
|
55
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
56
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
57
|
+
} : {
|
|
58
|
+
type: import('vue').PropType<T[K]>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Alert } from 'bkui-vue';
|
|
2
|
-
import type { IMessage, IPrompt, IPositionLimit, ISize, IStartPosition, IModel,
|
|
2
|
+
import type { IMessage, IPrompt, IPositionLimit, ISize, IStartPosition, IModel, IShortCut } from './types';
|
|
3
3
|
interface IProps {
|
|
4
4
|
messages: IMessage[];
|
|
5
5
|
prompts?: IPrompt[];
|
|
@@ -25,16 +25,25 @@ interface IProps {
|
|
|
25
25
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<IProps>, {
|
|
26
26
|
enablePopup: boolean;
|
|
27
27
|
}>, {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
sendChat: ({ message, cite, shortcut }: {
|
|
29
|
+
message: string;
|
|
30
|
+
cite?: string | undefined;
|
|
31
|
+
shortcut?: import("@blueking/ai-ui-sdk/dist/types/type").ShortCut | undefined;
|
|
32
|
+
}) => void;
|
|
33
|
+
handleShow: () => void;
|
|
34
|
+
handleStop: () => void;
|
|
35
|
+
reGenerateChat: () => void;
|
|
36
|
+
reSendChat: () => void;
|
|
37
|
+
deleteChat: () => void;
|
|
38
|
+
currentSessionLoading: () => boolean;
|
|
30
39
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
40
|
send: (data: ISendData) => void;
|
|
32
41
|
close: () => void;
|
|
33
42
|
stop: () => void;
|
|
34
43
|
clear: () => void;
|
|
35
44
|
"scroll-load": () => void;
|
|
36
|
-
"change-prompt": (val: string) => void;
|
|
37
45
|
"ai-click": (val: string) => void;
|
|
46
|
+
"change-prompt": (val: string) => void;
|
|
38
47
|
"update:model": (val: string) => void;
|
|
39
48
|
"choose-prompt": (prompt: IPrompt) => void;
|
|
40
49
|
"update:isShow": (val: boolean) => void;
|
|
@@ -48,26 +57,25 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
48
57
|
enablePopup: boolean;
|
|
49
58
|
}>>> & {
|
|
50
59
|
onClose?: (() => any) | undefined;
|
|
51
|
-
"onChange-prompt"?: ((val: string) => any) | undefined;
|
|
52
|
-
"onChoose-prompt"?: ((prompt: IPrompt) => any) | undefined;
|
|
53
|
-
onClear?: (() => any) | undefined;
|
|
54
|
-
onStop?: (() => any) | undefined;
|
|
55
|
-
onSend?: ((data: ISendData) => any) | undefined;
|
|
56
|
-
"onAi-click"?: ((val: string) => any) | undefined;
|
|
57
|
-
"onScroll-load"?: (() => any) | undefined;
|
|
58
60
|
"onShortcut-click"?: ((data: {
|
|
59
61
|
type: string;
|
|
60
62
|
label: string;
|
|
61
63
|
cite: string;
|
|
62
64
|
prompt: string;
|
|
63
65
|
}) => any) | undefined;
|
|
66
|
+
onSend?: ((data: ISendData) => any) | undefined;
|
|
67
|
+
onStop?: (() => any) | undefined;
|
|
68
|
+
onClear?: (() => any) | undefined;
|
|
64
69
|
"onUpdate:model"?: ((val: string) => any) | undefined;
|
|
65
70
|
"onUpdate:isShow"?: ((val: boolean) => any) | undefined;
|
|
71
|
+
"onChoose-prompt"?: ((prompt: IPrompt) => any) | undefined;
|
|
72
|
+
"onScroll-load"?: (() => any) | undefined;
|
|
73
|
+
"onAi-click"?: ((val: string) => any) | undefined;
|
|
74
|
+
"onChange-prompt"?: ((val: string) => any) | undefined;
|
|
66
75
|
}, {
|
|
67
76
|
enablePopup: boolean;
|
|
68
77
|
}, {}>;
|
|
69
78
|
export default _default;
|
|
70
|
-
|
|
71
79
|
type __VLS_WithDefaults<P, D> = {
|
|
72
80
|
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
73
81
|
default: D[K];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
text: string;
|
|
3
|
+
showCloseIcon?: boolean | undefined;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
close: () => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
text: string;
|
|
8
|
+
showCloseIcon?: boolean | undefined;
|
|
9
|
+
}>>> & {
|
|
10
|
+
onClose?: (() => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
isCompressionHeight: boolean;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
close: () => void;
|
|
5
|
+
toggleCompression: () => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
isCompressionHeight: boolean;
|
|
8
|
+
}>>> & {
|
|
9
|
+
onClose?: (() => any) | undefined;
|
|
10
|
+
onToggleCompression?: (() => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
+
shortcuts: ShortCut[];
|
|
4
|
+
loading: boolean;
|
|
5
|
+
}>, {
|
|
6
|
+
focus: () => void | undefined;
|
|
7
|
+
clear: () => void;
|
|
8
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
send: (value: string) => void;
|
|
10
|
+
"update:modelValue": (value: string) => void;
|
|
11
|
+
stop: () => void;
|
|
12
|
+
"height-change": (height: number) => void;
|
|
13
|
+
"shortcut-click": (shortcut: ShortCut) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
15
|
+
shortcuts: ShortCut[];
|
|
16
|
+
loading: boolean;
|
|
17
|
+
}>>> & {
|
|
18
|
+
"onShortcut-click"?: ((shortcut: ShortCut) => any) | undefined;
|
|
19
|
+
onSend?: ((value: string) => any) | undefined;
|
|
20
|
+
onStop?: (() => any) | undefined;
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
|
+
"onHeight-change"?: ((height: number) => any) | undefined;
|
|
23
|
+
}, {}, {}>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToOption<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
onConfirm: () => void;
|
|
3
|
+
onCancel: () => void;
|
|
4
|
+
title?: string | undefined;
|
|
5
|
+
content?: string | undefined;
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
title?: string | undefined;
|
|
10
|
+
content?: string | undefined;
|
|
11
|
+
}>>>, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ISessionContent } from '@blueking/ai-ui-sdk';
|
|
2
|
+
interface Props {
|
|
3
|
+
message: ISessionContent;
|
|
4
|
+
userPhoto?: string;
|
|
5
|
+
showTime?: boolean;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
9
|
+
userPhoto: string;
|
|
10
|
+
showTime: boolean;
|
|
11
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
delete: (index: number) => void;
|
|
13
|
+
regenerate: (index: number) => void;
|
|
14
|
+
resend: (index: number, value: {
|
|
15
|
+
message: string;
|
|
16
|
+
cite: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
19
|
+
userPhoto: string;
|
|
20
|
+
showTime: boolean;
|
|
21
|
+
}>>> & {
|
|
22
|
+
onDelete?: ((index: number) => any) | undefined;
|
|
23
|
+
onRegenerate?: ((index: number) => any) | undefined;
|
|
24
|
+
onResend?: ((index: number, value: {
|
|
25
|
+
message: string;
|
|
26
|
+
cite: string;
|
|
27
|
+
}) => any) | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
userPhoto: string;
|
|
30
|
+
showTime: boolean;
|
|
31
|
+
}, {}>;
|
|
32
|
+
export default _default;
|
|
33
|
+
type __VLS_WithDefaults<P, D> = {
|
|
34
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
35
|
+
default: D[K];
|
|
36
|
+
}> : P[K];
|
|
37
|
+
};
|
|
38
|
+
type __VLS_Prettify<T> = {
|
|
39
|
+
[K in keyof T]: T[K];
|
|
40
|
+
} & {};
|
|
41
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
42
|
+
type __VLS_TypePropsToOption<T> = {
|
|
43
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
44
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
45
|
+
} : {
|
|
46
|
+
type: import('vue').PropType<T[K]>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
2
|
+
interface IProps {
|
|
3
|
+
shortcuts: ShortCut[];
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<IProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"shortcut-click": (...args: any[]) => void;
|
|
7
|
+
click: (...args: any[]) => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<IProps>>> & {
|
|
9
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
10
|
+
"onShortcut-click"?: ((...args: any[]) => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
|
+
shortcuts: ShortCut[];
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"shortcut-click": (args_0: ShortCut) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
shortcuts: ShortCut[];
|
|
8
|
+
}>>> & {
|
|
9
|
+
"onShortcut-click"?: ((args_0: ShortCut) => any) | undefined;
|
|
10
|
+
}, {}, {}>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToOption<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
2
|
+
modelValue?: string | undefined;
|
|
3
|
+
placeholder?: string | undefined;
|
|
4
|
+
autoFocus?: boolean | undefined;
|
|
5
|
+
}>, {
|
|
6
|
+
modelValue: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
autoFocus: boolean;
|
|
9
|
+
}>, {
|
|
10
|
+
focus: () => void;
|
|
11
|
+
clear: () => void;
|
|
12
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
submit: (value: string) => void;
|
|
14
|
+
"update:modelValue": (value: string) => void;
|
|
15
|
+
cancel: () => void;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
17
|
+
modelValue?: string | undefined;
|
|
18
|
+
placeholder?: string | undefined;
|
|
19
|
+
autoFocus?: boolean | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
modelValue: string;
|
|
22
|
+
placeholder: string;
|
|
23
|
+
autoFocus: boolean;
|
|
24
|
+
}>>> & {
|
|
25
|
+
onSubmit?: ((value: string) => any) | undefined;
|
|
26
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
27
|
+
onCancel?: (() => any) | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
placeholder: string;
|
|
30
|
+
modelValue: string;
|
|
31
|
+
autoFocus: boolean;
|
|
32
|
+
}, {}>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
42
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
43
|
+
type __VLS_TypePropsToOption<T> = {
|
|
44
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
45
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
46
|
+
} : {
|
|
47
|
+
type: import('vue').PropType<T[K]>;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function useMainContainer(): {
|
|
2
|
+
minWidth: number;
|
|
3
|
+
minHeight: number;
|
|
4
|
+
top: import("vue").Ref<number>;
|
|
5
|
+
left: import("vue").Ref<number>;
|
|
6
|
+
width: import("vue").Ref<number>;
|
|
7
|
+
height: import("vue").Ref<number>;
|
|
8
|
+
isCompressionHeight: import("vue").Ref<boolean>;
|
|
9
|
+
handleDragging: (x: number, y: number) => void;
|
|
10
|
+
handleResizing: (x: number, y: number, w: number, h: number) => void;
|
|
11
|
+
toggleCompression: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function useNimbus(emit: {
|
|
2
|
+
(e: 'click'): void;
|
|
3
|
+
(e: 'minimize', value: boolean): void;
|
|
4
|
+
}): {
|
|
5
|
+
nimbusWidth: number;
|
|
6
|
+
nimbusHeight: number;
|
|
7
|
+
nimbusLeft: import("vue").Ref<number>;
|
|
8
|
+
nimbusTop: import("vue").Ref<number>;
|
|
9
|
+
isMinimize: import("vue").Ref<boolean>;
|
|
10
|
+
isHovering: import("vue").Ref<boolean>;
|
|
11
|
+
isDragging: import("vue").Ref<boolean>;
|
|
12
|
+
handleNimbusDragging: (_x: number, y: number) => void;
|
|
13
|
+
handleNimbusMinimize: (isMinimize: boolean) => void;
|
|
14
|
+
handleClick: () => void;
|
|
15
|
+
handleMinimize: () => void;
|
|
16
|
+
handleDragging: (x: number, y: number) => void;
|
|
17
|
+
handleMouseEnter: () => void;
|
|
18
|
+
handleMouseLeave: () => void;
|
|
19
|
+
handleMouseDown: () => void;
|
|
20
|
+
handleMouseUp: () => void;
|
|
21
|
+
};
|
|
@@ -9,5 +9,6 @@ export declare function useSelect(enablePopup: boolean): {
|
|
|
9
9
|
clearSelection: () => void;
|
|
10
10
|
setSelection: (text: string) => void;
|
|
11
11
|
lockSelectedText: import("vue").Ref<boolean>;
|
|
12
|
+
currentSelected: import("vue").Ref<string>;
|
|
12
13
|
popupRef: import("vue").Ref<HTMLElement | null>;
|
|
13
14
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface TextareaHeightOptions {
|
|
2
|
+
minHeight?: number;
|
|
3
|
+
maxHeight?: number;
|
|
4
|
+
defaultHeight?: number;
|
|
5
|
+
debounceTime?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 文本区域高度自适应的组合式函数
|
|
9
|
+
*
|
|
10
|
+
* @param options 配置选项
|
|
11
|
+
* @returns 相关的状态和方法
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTextareaHeight(options?: TextareaHeightOptions): {
|
|
14
|
+
textareaHeight: import("vue").Ref<number>;
|
|
15
|
+
textareaRef: import("vue").Ref<HTMLTextAreaElement | undefined>;
|
|
16
|
+
updateHeight: () => void;
|
|
17
|
+
resetHeight: () => void;
|
|
18
|
+
bindTextarea: (textareaElement: HTMLTextAreaElement) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Instance, Props } from 'tippy.js';
|
|
3
|
+
import 'tippy.js/dist/tippy.css';
|
|
4
|
+
export type TooltipOptions = Partial<Props>;
|
|
5
|
+
export interface TooltipTarget {
|
|
6
|
+
element: Element | string;
|
|
7
|
+
content: string;
|
|
8
|
+
options?: TooltipOptions;
|
|
9
|
+
}
|
|
10
|
+
interface TooltipAPI {
|
|
11
|
+
instances: Ref<Instance[]>;
|
|
12
|
+
createTooltip: (element: Element | string, content: string, options?: TooltipOptions) => Instance | null;
|
|
13
|
+
createTooltipsForSelector: (selector: string, content: string, options?: TooltipOptions) => Instance[];
|
|
14
|
+
createMultipleTooltips: (targets: TooltipTarget[]) => Instance[];
|
|
15
|
+
destroyAll: () => void;
|
|
16
|
+
updateContent: (instance: Instance, content: string) => void;
|
|
17
|
+
destroyInstance: (instance: Instance) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Composable for managing tippy tooltips
|
|
21
|
+
* @param defaultOptions - Default options for all tooltips
|
|
22
|
+
* @returns Tooltip utility functions
|
|
23
|
+
*/
|
|
24
|
+
export declare function useTooltip(defaultOptions?: TooltipOptions): TooltipAPI;
|
|
25
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const DEFAULT_SHORTCUTS:
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
2
|
+
export declare const DEFAULT_SHORTCUTS: ShortCut[];
|
package/dist/lang/index.d.ts
CHANGED
|
@@ -31,6 +31,18 @@ export declare const langData: {
|
|
|
31
31
|
readonly 翻译: "translate";
|
|
32
32
|
readonly 解释: "explanation";
|
|
33
33
|
readonly 'AI\u5C0F\u9CB8\u6B63\u5728\u56DE\u590D\uFF0C\u8BF7\u7ED3\u675F\u540E\u518D\u6E05\u7A7A': "AI BK GPT is executing, please clear after completion";
|
|
34
|
+
readonly '\u8F93\u5165 "/" \u5524\u51FA Prompt\n\u901A\u8FC7 Shift + Enter \u8FDB\u884C\u6362\u884C\u8F93\u5165': "Input \"/\" to call out Prompt\nUse Shift + Enter to enter a new line";
|
|
35
|
+
readonly '\u4F60\u597D\uFF0C\u6211\u662F\u5C0F\u9CB8': "Hello, I am BK GPT";
|
|
36
|
+
readonly '\u8F93\u5165\u4F60\u7684\u95EE\u9898\uFF0C\u52A9\u4F60\u9AD8\u6548\u7684\u5B8C\u6210\u5DE5\u4F5C': "Input your question, help you complete work efficiently";
|
|
37
|
+
readonly 框选内容: "Selected content";
|
|
38
|
+
readonly '\u6700\u5C0F\u5316\uFF0C\u5C06\u7F29\u6210\u951A\u70B9': "Minimize, will shrink to a anchor";
|
|
39
|
+
readonly 复制失败: "Copy failed";
|
|
40
|
+
readonly 取消: "Cancel";
|
|
41
|
+
readonly 请输入内容: "Please input content";
|
|
42
|
+
readonly 删除: "Delete";
|
|
43
|
+
readonly 扩展高度: "Expand height";
|
|
44
|
+
readonly 缩小高度: "Shrink height";
|
|
45
|
+
readonly 恢复默认大小: "Restore default size";
|
|
34
46
|
};
|
|
35
47
|
export declare const zhLangData: {
|
|
36
48
|
translateShortcut: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,51 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IMessage extends IChatHistory {
|
|
3
|
-
status?: MessageStatus;
|
|
4
|
-
time?: number | string;
|
|
5
|
-
cite?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface IPrompt {
|
|
8
|
-
id: number | string;
|
|
9
|
-
content: string;
|
|
10
|
-
}
|
|
11
|
-
export interface IPositionLimit {
|
|
12
|
-
top: number;
|
|
13
|
-
bottom: number;
|
|
14
|
-
left: number;
|
|
15
|
-
right: number;
|
|
16
|
-
}
|
|
17
|
-
export interface ISize {
|
|
18
|
-
height: number;
|
|
19
|
-
width: number;
|
|
20
|
-
}
|
|
21
|
-
export interface IStartPosition {
|
|
22
|
-
top?: number;
|
|
23
|
-
bottom?: number;
|
|
24
|
-
left?: number;
|
|
25
|
-
right?: number;
|
|
26
|
-
}
|
|
27
|
-
export interface IChatHistory {
|
|
28
|
-
role: RoleType;
|
|
29
|
-
content: string;
|
|
30
|
-
}
|
|
31
|
-
export interface IModel {
|
|
32
|
-
id: string;
|
|
33
|
-
name: string;
|
|
34
|
-
}
|
|
35
|
-
export interface IShortCut {
|
|
36
|
-
label: string;
|
|
37
|
-
prompt: string;
|
|
38
|
-
key?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface ISendData {
|
|
41
|
-
content: string;
|
|
42
|
-
cite?: string;
|
|
43
|
-
prompt?: string;
|
|
44
|
-
}
|
|
1
|
+
import { type ShortCut } from '@blueking/ai-ui-sdk';
|
|
45
2
|
export interface AIBluekingExpose {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
3
|
+
sendChat: ({ message, cite, shortcut }: {
|
|
4
|
+
message: string;
|
|
5
|
+
cite?: string;
|
|
6
|
+
shortcut?: ShortCut;
|
|
7
|
+
}) => void;
|
|
8
|
+
handleShow: () => void;
|
|
9
|
+
handleStop: () => void;
|
|
10
|
+
reGenerateChat: () => void;
|
|
11
|
+
reSendChat: () => void;
|
|
12
|
+
deleteChat: () => void;
|
|
13
|
+
currentSessionLoading: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
export type { ShortCut };
|
|
49
16
|
export type IDocument = {
|
|
50
17
|
metadata: {
|
|
51
18
|
file_path: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Instance as TippyInstance, type Props as TippyProps } from 'tippy.js';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
/**
|
|
4
|
+
* 创建删除确认框
|
|
5
|
+
* @param target 目标元素
|
|
6
|
+
* @param options 配置选项
|
|
7
|
+
* @returns Tippy实例
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDeleteConfirm(target: Element | null | string, options: {
|
|
10
|
+
onConfirm: () => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
placement?: TippyProps['placement'];
|
|
13
|
+
title?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
appendTo?: TippyProps['appendTo'];
|
|
16
|
+
}): TippyInstance | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 关闭所有删除确认框
|
|
19
|
+
*/
|
|
20
|
+
export declare function closeAllDeleteConfirms(): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取 cookie
|
|
3
|
+
* @param {*} name cookie 的名称
|
|
4
|
+
*/
|
|
5
|
+
export declare const getCookieByName: (name: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* 判断是否是json字符串
|
|
8
|
+
* @param str
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const isJSON: (str: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 节流,每隔一段时间执行
|
|
14
|
+
* @param {*} fn 需要执行的函数
|
|
15
|
+
* @param {*} delay 延迟时间,默认200
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const throttle: <T>(fn: (t: T) => void, delay?: number) => (t: T) => false | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 防抖,延迟一段时间执行
|
|
21
|
+
* @param {*} fn 需要执行的函数
|
|
22
|
+
* @param {*} delay 延迟时间,默认200
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare const debounce: <T, R>(fn: (P?: T) => R, delay?: number) => (params?: T) => void;
|
|
26
|
+
/**
|
|
27
|
+
* 处理提示词模板,替换模板中的变量
|
|
28
|
+
* @param prompt 提示词模板
|
|
29
|
+
* @param selectedText 选中的文本
|
|
30
|
+
* @returns 处理后的提示词
|
|
31
|
+
*/
|
|
32
|
+
export declare const processPromptTemplate: (prompt: string, selectedText: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* 格式化时间
|
|
35
|
+
* @param val 时间
|
|
36
|
+
* @returns 格式化后的时间
|
|
37
|
+
*/
|
|
38
|
+
export declare function durationFormatter(val: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* 滚动到页面底部
|
|
41
|
+
* @param el 需要滚动的元素
|
|
42
|
+
*/
|
|
43
|
+
export declare const scrollToBottom: (el: HTMLElement) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
isPanelShow: boolean;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
click: () => void;
|
|
5
|
+
minimize: (value: boolean) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
isPanelShow: boolean;
|
|
8
|
+
}>>> & {
|
|
9
|
+
onClick?: (() => any) | undefined;
|
|
10
|
+
onMinimize?: ((value: boolean) => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|