@vunk/plus 1.7.1 → 1.7.2
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/components/agent-chat-provider/index.d.ts +8 -0
- package/components/agent-chat-provider/index.mjs +1 -1
- package/components/agent-chat-provider/src/MessageView.d.ts +29 -0
- package/components/agent-chat-provider/src/api.d.ts +3 -0
- package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
- package/components/agent-chat-provider/src/const.d.ts +1 -0
- package/components/agent-chat-provider/src/index.vue.d.ts +22 -0
- package/components/agent-chat-provider/src/types.d.ts +56 -0
- package/components/agent-chat-provider/src/use.d.ts +6 -0
- package/components/avatar/index.d.ts +4 -0
- package/components/avatar/index.mjs +1 -1
- package/components/avatar/src/ctx.d.ts +6 -0
- package/components/avatar/src/index.vue.d.ts +261 -0
- package/components/avatar/src/types.d.ts +1 -0
- package/components/broadcasting-markdown/index.d.ts +7 -0
- package/components/broadcasting-markdown/index.mjs +4 -4
- package/components/broadcasting-markdown/src/const.d.ts +13 -0
- package/components/broadcasting-markdown/src/ctx.d.ts +129 -0
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +97 -0
- package/components/broadcasting-markdown/src/index.vue.d.ts +432 -0
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +79 -0
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +60 -0
- package/components/broadcasting-markdown/src/types.d.ts +26 -0
- package/components/broadcasting-markdown/src/use.d.ts +21 -0
- package/components/bubble-list/index.d.ts +5 -0
- package/components/bubble-list/src/ctx.d.ts +28 -0
- package/components/bubble-list/src/index.vue.d.ts +484 -0
- package/components/bubble-list/src/types.d.ts +4 -0
- package/components/bubble-templates/index.d.ts +5 -0
- package/components/bubble-templates/index.mjs +1 -1
- package/components/bubble-templates/src/core.d.ts +69 -0
- package/components/bubble-templates/src/index.vue.d.ts +242 -0
- package/components/bubble-templates/src/legacy.vue.d.ts +153 -0
- package/components/bubble-templates/src/types.d.ts +45 -0
- package/components/chat-independent/index.d.ts +4 -0
- package/components/chat-independent/index.mjs +1 -1
- package/components/chat-independent/src/const.d.ts +13 -0
- package/components/chat-independent/src/ctx.d.ts +21 -0
- package/components/chat-independent/src/index.vue.d.ts +2407 -0
- package/components/chat-independent/src/types.d.ts +13 -0
- package/components/index.d.ts +0 -0
- package/components/index2.mjs +7 -7
- package/components/index3.mjs +1 -1
- package/components/lottie-animation/index.d.ts +4 -0
- package/components/lottie-animation/index.mjs +1 -1
- package/components/lottie-animation/src/ctx.d.ts +10 -0
- package/components/lottie-animation/src/index.vue.d.ts +21 -0
- package/components/lottie-animation/src/types.d.ts +4 -0
- package/components/metahuman-broadcasting/index.d.ts +5 -0
- package/components/metahuman-broadcasting/index.mjs +1 -1
- package/components/metahuman-broadcasting/src/ctx.d.ts +57 -0
- package/components/metahuman-broadcasting/src/index.vue.d.ts +878 -0
- package/components/metahuman-broadcasting/src/types.d.ts +1 -0
- package/components/monaco-editor/index.d.ts +5 -0
- package/components/monaco-editor/index.mjs +1 -1
- package/components/monaco-editor/src/ctx.d.ts +23 -0
- package/components/monaco-editor/src/index.vue.d.ts +40 -0
- package/components/monaco-editor/src/types.d.ts +1 -0
- package/components/monaco-environment/index.d.ts +4 -0
- package/components/monaco-environment/index.mjs +1 -1
- package/components/monaco-environment/src/ctx.d.ts +8 -0
- package/components/monaco-environment/src/index.vue.d.ts +2 -0
- package/components/monaco-environment/src/types.d.ts +1 -0
- package/components/pixi-frame/index.d.ts +11 -0
- package/components/pixi-frame/src/apng.vue.d.ts +161 -0
- package/components/pixi-frame/src/bitmap.vue.d.ts +158 -0
- package/components/pixi-frame/src/core.vue.d.ts +173 -0
- package/components/pixi-frame/src/ctx.d.ts +55 -0
- package/components/pixi-frame/src/index.vue.d.ts +591 -0
- package/components/pixi-frame/src/provider.vue.d.ts +2 -0
- package/components/pixi-frame/src/types.d.ts +17 -0
- package/components/pixi-frame/src/use.d.ts +16 -0
- package/components/pixi-frame/src/useSprite.d.ts +12 -0
- package/components/pixi-frame/src/video.vue.d.ts +159 -0
- package/components/pixi-frame/src/view.vue.d.ts +29 -0
- package/components/recorder-button/index.d.ts +4 -0
- package/components/recorder-button/index.mjs +1 -1
- package/components/recorder-button/src/ctx.d.ts +41 -0
- package/components/recorder-button/src/index.vue.d.ts +489 -0
- package/components/recorder-button/src/speech-to-text.d.ts +1 -0
- package/components/recorder-button/src/types.d.ts +7 -0
- package/components/routes-menu-content/index.d.ts +4 -0
- package/components/routes-menu-content/index.mjs +3 -3
- package/components/routes-menu-content/src/ctx.d.ts +17 -0
- package/components/routes-menu-content/src/index.vue.d.ts +573 -0
- package/components/routes-menu-content/src/item/core/ctx.d.ts +18 -0
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +408 -0
- package/components/routes-menu-content/src/item/ctx.d.ts +14 -0
- package/components/routes-menu-content/src/item/index.vue.d.ts +539 -0
- package/components/routes-menu-content/src/types.d.ts +1 -0
- package/components/sender/index.d.ts +4 -0
- package/components/sender/index.mjs +2 -2
- package/components/sender/src/SenderHeader.vue.d.ts +256 -0
- package/components/sender/src/ctx.d.ts +64 -0
- package/components/sender/src/index.vue.d.ts +765 -0
- package/components/sender/src/types.d.ts +1 -0
- package/components/speech-button/index.d.ts +4 -0
- package/components/speech-button/index.mjs +3 -3
- package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/ctx.d.ts +10 -0
- package/components/speech-button/src/index.vue.d.ts +22 -0
- package/components/speech-button/src/types.d.ts +1 -0
- package/components/table-columns/index.d.ts +5 -0
- package/components/table-columns/index.mjs +4 -4
- package/components/table-columns/src/ctx.d.ts +59 -0
- package/components/table-columns/src/el-ctx.d.ts +57 -0
- package/components/table-columns/src/index.vue.d.ts +132 -0
- package/components/table-columns/src/types.d.ts +21 -0
- package/components/tables-v1/index.d.ts +5 -0
- package/components/tables-v1/index.mjs +42 -49
- package/components/tables-v1/src/ctx.d.ts +337 -0
- package/components/tables-v1/src/el-ctx.d.ts +262 -0
- package/components/tables-v1/src/index.vue.d.ts +2956 -0
- package/components/tables-v1/src/types.d.ts +3 -0
- package/components/tables-v1-checkbox/index.d.ts +5 -0
- package/components/tables-v1-checkbox/index.mjs +1 -1
- package/components/tables-v1-checkbox/src/ctx.d.ts +370 -0
- package/components/tables-v1-checkbox/src/index.vue.d.ts +3843 -0
- package/components/tables-v1-checkbox/src/types.d.ts +1 -0
- package/components/text/index.d.ts +4 -0
- package/components/text/index.mjs +1 -1
- package/components/text/src/ctx.d.ts +356 -0
- package/components/text/src/index.vue.d.ts +2335 -0
- package/components/text/src/types.d.ts +1 -0
- package/components/typing-markdown/index.d.ts +4 -0
- package/components/typing-markdown/index.mjs +1 -1
- package/components/typing-markdown/src/core.d.ts +2 -0
- package/components/typing-markdown/src/ctx.d.ts +41 -0
- package/components/typing-markdown/src/index.vue.d.ts +75 -0
- package/components/typing-markdown/src/types.d.ts +1 -0
- package/components/vditor/index.d.ts +5 -0
- package/components/vditor/index.mjs +3 -3
- package/components/vditor/src/ctx.d.ts +38 -0
- package/components/vditor/src/handle-fullscreen.vue.d.ts +18 -0
- package/components/vditor/src/handle-value.vue.d.ts +18 -0
- package/components/vditor/src/index.vue.d.ts +143 -0
- package/components/vditor/src/types.d.ts +9 -0
- package/components/vditor/src/use.d.ts +4 -0
- package/composables/el-breakpoints/index.d.ts +1 -1
- package/composables/el-breakpoints/index.mjs +2 -2
- package/icons/end/index.mjs +1 -1
- package/icons/keyboard/index.mjs +1 -1
- package/icons/start/index.mjs +1 -1
- package/icons/voice/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import VkAgentChatProvider from './src/index.vue';
|
|
2
|
+
export * from './src/const';
|
|
3
|
+
export * from './src/const-roles';
|
|
4
|
+
export { type MessageView, MessageViewManager } from './src/MessageView';
|
|
5
|
+
export * as __VkAgentChatProvider from './src/types';
|
|
6
|
+
export { useAgentChat } from './src/use';
|
|
7
|
+
export { VkAgentChatProvider, };
|
|
8
|
+
export default VkAgentChatProvider;
|
|
@@ -185,7 +185,7 @@ var _sfc_main = defineComponent({
|
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
var VkAgentChatProvider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "
|
|
188
|
+
var VkAgentChatProvider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\labCode\\vunk-plus\\packages\\components\\agent-chat-provider\\src\\index.vue"]]);
|
|
189
189
|
|
|
190
190
|
class MessageViewManager {
|
|
191
191
|
constructor() {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface MessageView {
|
|
2
|
+
content: string;
|
|
3
|
+
type: string;
|
|
4
|
+
updating: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class MessageViewManager {
|
|
7
|
+
private views;
|
|
8
|
+
getViews(): MessageView[];
|
|
9
|
+
createView(view: MessageView): void;
|
|
10
|
+
/**
|
|
11
|
+
* @description 创建或更新最后一个 view
|
|
12
|
+
*/
|
|
13
|
+
upsertView(data: MessageView, callbacks?: {
|
|
14
|
+
onCreate?: (view: MessageView) => void;
|
|
15
|
+
onUpdate?: (view: MessageView) => void;
|
|
16
|
+
}): MessageView;
|
|
17
|
+
/**
|
|
18
|
+
* @description 获取当前view 的上一个 view
|
|
19
|
+
*/
|
|
20
|
+
getPrevView(view: MessageView): MessageView | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* @description 获取最后一个正在更新的 view
|
|
23
|
+
*/
|
|
24
|
+
getLastUpdatingView(type: string): MessageView | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* @description 所有 view 更新结束
|
|
27
|
+
*/
|
|
28
|
+
allViewUpdated(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChatAgentInjectKey = "vk_agent_chat_inject_key";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AnyFunc } from '@vunk/shared';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
request: {
|
|
5
|
+
type: PropType<AnyFunc>;
|
|
6
|
+
};
|
|
7
|
+
parser: {
|
|
8
|
+
type: PropType<AnyFunc>;
|
|
9
|
+
};
|
|
10
|
+
}>, import("vue").Slot<any> | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
load: null;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
request: {
|
|
14
|
+
type: PropType<AnyFunc>;
|
|
15
|
+
};
|
|
16
|
+
parser: {
|
|
17
|
+
type: PropType<AnyFunc>;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{
|
|
20
|
+
onLoad?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { __VkBubbleTemplates } from '@vunk/plus/components/bubble-templates';
|
|
2
|
+
import type { MaybeArray, Media, NormalObject } from '@vunk/shared';
|
|
3
|
+
import type { RequestFn, SSEOutput, useXChat, XAgent, XRequestParams } from 'ant-design-x-vue';
|
|
4
|
+
import type { ComputedRef } from 'vue';
|
|
5
|
+
import type { BubbleListItemProps } from 'vue-element-plus-x/types/components/BubbleList/types';
|
|
6
|
+
import type { MessageView } from './MessageView';
|
|
7
|
+
export type RequestParams<Message> = Omit<XRequestParams, 'message'> & {
|
|
8
|
+
message: Message;
|
|
9
|
+
messages?: Message[];
|
|
10
|
+
} & NormalObject;
|
|
11
|
+
export interface AgentChatContext {
|
|
12
|
+
agent: ComputedRef<XAgent<AgentMessage>>;
|
|
13
|
+
chat: ReturnType<typeof useXChat<AgentMessage, BubbleMessage>>;
|
|
14
|
+
simplicity: {
|
|
15
|
+
onRequest: (message: string) => void;
|
|
16
|
+
items: ComputedRef<BubbleItem[]>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export type Request = RequestFn<AgentMessage, RequestParams<AgentMessage>, RequestOutput>;
|
|
20
|
+
export type Parser = (message: Partial<AgentMessage>) => MaybeArray<BubbleMessage>;
|
|
21
|
+
export type RequestOutput = AgentMessage & SSEOutput;
|
|
22
|
+
/**
|
|
23
|
+
* @description useXAgent request onSuccess 发送的数据
|
|
24
|
+
*/
|
|
25
|
+
export type AgentMessage = Partial<BubbleMessage> & {
|
|
26
|
+
seviceLoading?: boolean;
|
|
27
|
+
seviceEnd?: boolean;
|
|
28
|
+
views?: MessageView[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @description useXChat parser 解析数据
|
|
32
|
+
*/
|
|
33
|
+
export type BubbleMessage = Partial<BubbleListItemProps> & {
|
|
34
|
+
role: string;
|
|
35
|
+
content: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description 服务端请求是否完成
|
|
38
|
+
*/
|
|
39
|
+
seviceEnd?: boolean;
|
|
40
|
+
thinkingStatus?: 'start' | 'thinking' | 'end' | 'error';
|
|
41
|
+
thinkingContent?: string;
|
|
42
|
+
meta?: NormalObject;
|
|
43
|
+
abortController?: AbortController;
|
|
44
|
+
templateType?: string;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
};
|
|
47
|
+
export type BubbleItem = BubbleItemBasic & __VkBubbleTemplates.RenderItem;
|
|
48
|
+
export type RoleMedia = RoleMediaBasic & __VkBubbleTemplates.RenderItem;
|
|
49
|
+
export type BubbleItemModule = 'Thinking';
|
|
50
|
+
export interface BubbleItemBasic extends BubbleMessage {
|
|
51
|
+
key: string;
|
|
52
|
+
modules?: BubbleItemModule[];
|
|
53
|
+
}
|
|
54
|
+
export interface RoleMediaBasic extends Partial<BubbleItemBasic>, Media {
|
|
55
|
+
value: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SSEOutput } from 'ant-design-x-vue';
|
|
2
|
+
import type { AgentChatContext, AgentMessage, Parser, Request, RequestParams } from './types';
|
|
3
|
+
import { useXAgent } from 'ant-design-x-vue';
|
|
4
|
+
export declare function useAgent(request: Request): ReturnType<typeof useXAgent<AgentMessage, RequestParams<AgentMessage>, AgentMessage & SSEOutput>>;
|
|
5
|
+
export declare function initAgentChat(request: Request, parser: Parser): AgentChatContext;
|
|
6
|
+
export declare function useAgentChat(): AgentChatContext;
|
|
@@ -36,7 +36,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36
36
|
/* FORWARDED */
|
|
37
37
|
}, 8, ["style"]);
|
|
38
38
|
}
|
|
39
|
-
var VkAvatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
39
|
+
var VkAvatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\avatar\\src\\index.vue"]]);
|
|
40
40
|
|
|
41
41
|
var types = /*#__PURE__*/Object.freeze({
|
|
42
42
|
__proto__: null
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly size: {
|
|
3
|
+
readonly type: import("vue").PropType<number | "" | "small" | "default" | "large">;
|
|
4
|
+
readonly required: false;
|
|
5
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
6
|
+
__epPropKey: true;
|
|
7
|
+
} & {
|
|
8
|
+
readonly default: "";
|
|
9
|
+
};
|
|
10
|
+
readonly shape: {
|
|
11
|
+
readonly type: import("vue").PropType<"circle" | "square">;
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
|
+
__epPropKey: true;
|
|
15
|
+
} & {
|
|
16
|
+
readonly default: "circle";
|
|
17
|
+
};
|
|
18
|
+
readonly icon: {
|
|
19
|
+
readonly type: import("vue").PropType<string | import("vue").Component>;
|
|
20
|
+
readonly required: false;
|
|
21
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
22
|
+
__epPropKey: true;
|
|
23
|
+
};
|
|
24
|
+
readonly src: {
|
|
25
|
+
readonly type: import("vue").PropType<string>;
|
|
26
|
+
readonly required: false;
|
|
27
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
28
|
+
__epPropKey: true;
|
|
29
|
+
} & {
|
|
30
|
+
readonly default: "";
|
|
31
|
+
};
|
|
32
|
+
readonly alt: StringConstructor;
|
|
33
|
+
readonly srcSet: StringConstructor;
|
|
34
|
+
readonly fit: {
|
|
35
|
+
readonly type: import("vue").PropType<any>;
|
|
36
|
+
readonly required: false;
|
|
37
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
38
|
+
__epPropKey: true;
|
|
39
|
+
} & {
|
|
40
|
+
readonly default: "cover";
|
|
41
|
+
};
|
|
42
|
+
} & {
|
|
43
|
+
background: never;
|
|
44
|
+
color: never;
|
|
45
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
|
+
readonly size: {
|
|
47
|
+
readonly type: import("vue").PropType<number | "" | "small" | "default" | "large">;
|
|
48
|
+
readonly required: false;
|
|
49
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
50
|
+
__epPropKey: true;
|
|
51
|
+
} & {
|
|
52
|
+
readonly default: "";
|
|
53
|
+
};
|
|
54
|
+
readonly shape: {
|
|
55
|
+
readonly type: import("vue").PropType<"circle" | "square">;
|
|
56
|
+
readonly required: false;
|
|
57
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
58
|
+
__epPropKey: true;
|
|
59
|
+
} & {
|
|
60
|
+
readonly default: "circle";
|
|
61
|
+
};
|
|
62
|
+
readonly icon: {
|
|
63
|
+
readonly type: import("vue").PropType<string | import("vue").Component>;
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
66
|
+
__epPropKey: true;
|
|
67
|
+
};
|
|
68
|
+
readonly src: {
|
|
69
|
+
readonly type: import("vue").PropType<string>;
|
|
70
|
+
readonly required: false;
|
|
71
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
72
|
+
__epPropKey: true;
|
|
73
|
+
} & {
|
|
74
|
+
readonly default: "";
|
|
75
|
+
};
|
|
76
|
+
readonly alt: StringConstructor;
|
|
77
|
+
readonly srcSet: StringConstructor;
|
|
78
|
+
readonly fit: {
|
|
79
|
+
readonly type: import("vue").PropType<any>;
|
|
80
|
+
readonly required: false;
|
|
81
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
82
|
+
__epPropKey: true;
|
|
83
|
+
} & {
|
|
84
|
+
readonly default: "cover";
|
|
85
|
+
};
|
|
86
|
+
} & {
|
|
87
|
+
background: never;
|
|
88
|
+
color: never;
|
|
89
|
+
}>> & Readonly<{}>, {
|
|
90
|
+
readonly size: number | "" | "small" | "default" | "large";
|
|
91
|
+
readonly shape: "circle" | "square";
|
|
92
|
+
readonly src: string;
|
|
93
|
+
readonly fit: any;
|
|
94
|
+
}, {}, {
|
|
95
|
+
ElAvatar: {
|
|
96
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
97
|
+
readonly size: {
|
|
98
|
+
readonly type: import("vue").PropType<number | "" | "small" | "default" | "large">;
|
|
99
|
+
readonly required: false;
|
|
100
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
101
|
+
__epPropKey: true;
|
|
102
|
+
} & {
|
|
103
|
+
readonly default: "";
|
|
104
|
+
};
|
|
105
|
+
readonly shape: {
|
|
106
|
+
readonly type: import("vue").PropType<"circle" | "square">;
|
|
107
|
+
readonly required: false;
|
|
108
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
109
|
+
__epPropKey: true;
|
|
110
|
+
} & {
|
|
111
|
+
readonly default: "circle";
|
|
112
|
+
};
|
|
113
|
+
readonly icon: {
|
|
114
|
+
readonly type: import("vue").PropType<string | import("vue").Component>;
|
|
115
|
+
readonly required: false;
|
|
116
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
117
|
+
__epPropKey: true;
|
|
118
|
+
};
|
|
119
|
+
readonly src: {
|
|
120
|
+
readonly type: import("vue").PropType<string>;
|
|
121
|
+
readonly required: false;
|
|
122
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
123
|
+
__epPropKey: true;
|
|
124
|
+
} & {
|
|
125
|
+
readonly default: "";
|
|
126
|
+
};
|
|
127
|
+
readonly alt: StringConstructor;
|
|
128
|
+
readonly srcSet: StringConstructor;
|
|
129
|
+
readonly fit: {
|
|
130
|
+
readonly type: import("vue").PropType<any>;
|
|
131
|
+
readonly required: false;
|
|
132
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
133
|
+
__epPropKey: true;
|
|
134
|
+
} & {
|
|
135
|
+
readonly default: "cover";
|
|
136
|
+
};
|
|
137
|
+
}>> & {
|
|
138
|
+
onError?: ((evt: Event) => any) | undefined;
|
|
139
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
140
|
+
error: (evt: Event) => void;
|
|
141
|
+
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
|
142
|
+
readonly size: number | "" | "small" | "default" | "large";
|
|
143
|
+
readonly shape: "circle" | "square";
|
|
144
|
+
readonly src: string;
|
|
145
|
+
readonly fit: any;
|
|
146
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
147
|
+
P: {};
|
|
148
|
+
B: {};
|
|
149
|
+
D: {};
|
|
150
|
+
C: {};
|
|
151
|
+
M: {};
|
|
152
|
+
Defaults: {};
|
|
153
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
154
|
+
readonly size: {
|
|
155
|
+
readonly type: import("vue").PropType<number | "" | "small" | "default" | "large">;
|
|
156
|
+
readonly required: false;
|
|
157
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
158
|
+
__epPropKey: true;
|
|
159
|
+
} & {
|
|
160
|
+
readonly default: "";
|
|
161
|
+
};
|
|
162
|
+
readonly shape: {
|
|
163
|
+
readonly type: import("vue").PropType<"circle" | "square">;
|
|
164
|
+
readonly required: false;
|
|
165
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
166
|
+
__epPropKey: true;
|
|
167
|
+
} & {
|
|
168
|
+
readonly default: "circle";
|
|
169
|
+
};
|
|
170
|
+
readonly icon: {
|
|
171
|
+
readonly type: import("vue").PropType<string | import("vue").Component>;
|
|
172
|
+
readonly required: false;
|
|
173
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
174
|
+
__epPropKey: true;
|
|
175
|
+
};
|
|
176
|
+
readonly src: {
|
|
177
|
+
readonly type: import("vue").PropType<string>;
|
|
178
|
+
readonly required: false;
|
|
179
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
180
|
+
__epPropKey: true;
|
|
181
|
+
} & {
|
|
182
|
+
readonly default: "";
|
|
183
|
+
};
|
|
184
|
+
readonly alt: StringConstructor;
|
|
185
|
+
readonly srcSet: StringConstructor;
|
|
186
|
+
readonly fit: {
|
|
187
|
+
readonly type: import("vue").PropType<any>;
|
|
188
|
+
readonly required: false;
|
|
189
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
190
|
+
__epPropKey: true;
|
|
191
|
+
} & {
|
|
192
|
+
readonly default: "cover";
|
|
193
|
+
};
|
|
194
|
+
}>> & {
|
|
195
|
+
onError?: ((evt: Event) => any) | undefined;
|
|
196
|
+
}, {}, {}, {}, {}, {
|
|
197
|
+
readonly size: number | "" | "small" | "default" | "large";
|
|
198
|
+
readonly shape: "circle" | "square";
|
|
199
|
+
readonly src: string;
|
|
200
|
+
readonly fit: any;
|
|
201
|
+
}>;
|
|
202
|
+
__isFragment?: never;
|
|
203
|
+
__isTeleport?: never;
|
|
204
|
+
__isSuspense?: never;
|
|
205
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
206
|
+
readonly size: {
|
|
207
|
+
readonly type: import("vue").PropType<number | "" | "small" | "default" | "large">;
|
|
208
|
+
readonly required: false;
|
|
209
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
210
|
+
__epPropKey: true;
|
|
211
|
+
} & {
|
|
212
|
+
readonly default: "";
|
|
213
|
+
};
|
|
214
|
+
readonly shape: {
|
|
215
|
+
readonly type: import("vue").PropType<"circle" | "square">;
|
|
216
|
+
readonly required: false;
|
|
217
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
218
|
+
__epPropKey: true;
|
|
219
|
+
} & {
|
|
220
|
+
readonly default: "circle";
|
|
221
|
+
};
|
|
222
|
+
readonly icon: {
|
|
223
|
+
readonly type: import("vue").PropType<string | import("vue").Component>;
|
|
224
|
+
readonly required: false;
|
|
225
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
226
|
+
__epPropKey: true;
|
|
227
|
+
};
|
|
228
|
+
readonly src: {
|
|
229
|
+
readonly type: import("vue").PropType<string>;
|
|
230
|
+
readonly required: false;
|
|
231
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
232
|
+
__epPropKey: true;
|
|
233
|
+
} & {
|
|
234
|
+
readonly default: "";
|
|
235
|
+
};
|
|
236
|
+
readonly alt: StringConstructor;
|
|
237
|
+
readonly srcSet: StringConstructor;
|
|
238
|
+
readonly fit: {
|
|
239
|
+
readonly type: import("vue").PropType<any>;
|
|
240
|
+
readonly required: false;
|
|
241
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
242
|
+
__epPropKey: true;
|
|
243
|
+
} & {
|
|
244
|
+
readonly default: "cover";
|
|
245
|
+
};
|
|
246
|
+
}>> & {
|
|
247
|
+
onError?: ((evt: Event) => any) | undefined;
|
|
248
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
249
|
+
error: (evt: Event) => void;
|
|
250
|
+
}, string, {
|
|
251
|
+
readonly size: number | "" | "small" | "default" | "large";
|
|
252
|
+
readonly shape: "circle" | "square";
|
|
253
|
+
readonly src: string;
|
|
254
|
+
readonly fit: any;
|
|
255
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
256
|
+
$slots: {
|
|
257
|
+
default?(_: {}): any;
|
|
258
|
+
};
|
|
259
|
+
}) & import("vue").Plugin;
|
|
260
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
261
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import VkBroadcastingMarkdown from './src/index.vue';
|
|
2
|
+
export * from './src/const';
|
|
3
|
+
export * as _VkBroadcastingMarkdownCtx from './src/ctx';
|
|
4
|
+
export * as __VkBroadcastingMarkdown from './src/types';
|
|
5
|
+
export { useHowlerParagraph } from './src/use';
|
|
6
|
+
export { VkBroadcastingMarkdown, };
|
|
7
|
+
export default VkBroadcastingMarkdown;
|
|
@@ -195,7 +195,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
195
195
|
/* STABLE_FRAGMENT */
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
|
-
var SpeechError = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "
|
|
198
|
+
var SpeechError = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\broadcasting-markdown\\src\\speech-error.vue"]]);
|
|
199
199
|
|
|
200
200
|
var howler = {};
|
|
201
201
|
|
|
@@ -3569,7 +3569,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3569
3569
|
}
|
|
3570
3570
|
});
|
|
3571
3571
|
|
|
3572
|
-
var HowlerSpeechView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "
|
|
3572
|
+
var HowlerSpeechView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:\\labCode\\vunk-plus\\packages\\components\\broadcasting-markdown\\src\\howler-speech.vue"]]);
|
|
3573
3573
|
|
|
3574
3574
|
const LogLevels = {
|
|
3575
3575
|
silent: Number.NEGATIVE_INFINITY,
|
|
@@ -4124,7 +4124,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4124
4124
|
deferred: $setup.theDef
|
|
4125
4125
|
}) : createCommentVNode("v-if", true);
|
|
4126
4126
|
}
|
|
4127
|
-
var ParagraphView = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "
|
|
4127
|
+
var ParagraphView = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\broadcasting-markdown\\src\\paragraph.vue"]]);
|
|
4128
4128
|
|
|
4129
4129
|
var _sfc_main = defineComponent({
|
|
4130
4130
|
name: "VkBroadcastingMarkdown",
|
|
@@ -4425,7 +4425,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4425
4425
|
/* STABLE_FRAGMENT */
|
|
4426
4426
|
);
|
|
4427
4427
|
}
|
|
4428
|
-
var VkBroadcastingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
4428
|
+
var VkBroadcastingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\broadcasting-markdown\\src\\index.vue"]]);
|
|
4429
4429
|
|
|
4430
4430
|
var types = /*#__PURE__*/Object.freeze({
|
|
4431
4431
|
__proto__: null
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TickerStatus } from '@vunk/shared/enum';
|
|
2
|
+
export declare function defaultRender(mdText: string): string;
|
|
3
|
+
export declare enum ParagraphStatus {
|
|
4
|
+
initial = "initial",
|
|
5
|
+
/**
|
|
6
|
+
* @description 处理中, 通常用于需要对段落进行异步处理
|
|
7
|
+
*/
|
|
8
|
+
processing = "processing",
|
|
9
|
+
pending = "pending",
|
|
10
|
+
fulfilled = "fulfilled",
|
|
11
|
+
rejected = "rejected"
|
|
12
|
+
}
|
|
13
|
+
export declare const Broadcast: typeof TickerStatus;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { SetDataEvent } from '@vunk/core';
|
|
2
|
+
import type { Deferred } from '@vunk/shared/promise';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
import type { Paragraph, ParagraphLoadEvent, TextToSpeech } from './types';
|
|
5
|
+
import { TickerStatus } from '@vunk/shared/enum';
|
|
6
|
+
import { defaultRender } from './const';
|
|
7
|
+
export declare const props: {
|
|
8
|
+
/**
|
|
9
|
+
* @description md文本转纯文本的函数
|
|
10
|
+
*/
|
|
11
|
+
render: {
|
|
12
|
+
type: PropType<(text: string) => string>;
|
|
13
|
+
default: typeof defaultRender;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @description 段落详情
|
|
17
|
+
*/
|
|
18
|
+
data: {
|
|
19
|
+
type: {
|
|
20
|
+
(arrayLength: number): Paragraph[];
|
|
21
|
+
(...items: Paragraph[]): Paragraph[];
|
|
22
|
+
new (arrayLength: number): Paragraph[];
|
|
23
|
+
new (...items: Paragraph[]): Paragraph[];
|
|
24
|
+
isArray(arg: any): arg is any[];
|
|
25
|
+
readonly prototype: any[];
|
|
26
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
27
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
28
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
29
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
30
|
+
of<T>(...items: T[]): T[];
|
|
31
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
32
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
33
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
34
|
+
};
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @description md 文本
|
|
39
|
+
*/
|
|
40
|
+
source: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @description 游标阅读延迟
|
|
46
|
+
*/
|
|
47
|
+
delay: {
|
|
48
|
+
type: NumberConstructor;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @description 段落切割符号
|
|
53
|
+
*/
|
|
54
|
+
separators: {
|
|
55
|
+
type: {
|
|
56
|
+
(arrayLength: number): string[];
|
|
57
|
+
(...items: string[]): string[];
|
|
58
|
+
new (arrayLength: number): string[];
|
|
59
|
+
new (...items: string[]): string[];
|
|
60
|
+
isArray(arg: any): arg is any[];
|
|
61
|
+
readonly prototype: any[];
|
|
62
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
63
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
64
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
65
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
66
|
+
of<T>(...items: T[]): T[];
|
|
67
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
68
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
69
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
70
|
+
};
|
|
71
|
+
default: () => string[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @description 组件内会根据当前游标是否和 source 长度一致来判断,是否持续阅读, 当一致时,会关闭阅读状态。但若设置为 true,则会持续阅读, 这在动态接收数据时会有用
|
|
75
|
+
*/
|
|
76
|
+
keepRead: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @description 是否使用自定义语音合成
|
|
82
|
+
*/
|
|
83
|
+
textToSpeech: {
|
|
84
|
+
type: PropType<TextToSpeech>;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @description 段落处理函数
|
|
89
|
+
*/
|
|
90
|
+
processing: {
|
|
91
|
+
type: PropType<(paragraph: Paragraph) => void>;
|
|
92
|
+
default: import("@vunk/shared").AnyFunc;
|
|
93
|
+
};
|
|
94
|
+
status: {
|
|
95
|
+
type: PropType<TickerStatus>;
|
|
96
|
+
default: TickerStatus;
|
|
97
|
+
};
|
|
98
|
+
paragraphMinlength: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export declare const emits: {
|
|
104
|
+
setData: (e: SetDataEvent) => SetDataEvent;
|
|
105
|
+
interrupt: null;
|
|
106
|
+
'update:broadcasting': (_: boolean) => boolean;
|
|
107
|
+
'update:completed': (_: boolean) => boolean;
|
|
108
|
+
'update:error': (_: boolean) => boolean;
|
|
109
|
+
'update:status': (_: TickerStatus) => boolean;
|
|
110
|
+
paragraphLoad: (_: ParagraphLoadEvent) => boolean;
|
|
111
|
+
};
|
|
112
|
+
export declare const paragraphProps: {
|
|
113
|
+
data: {
|
|
114
|
+
type: PropType<Paragraph>;
|
|
115
|
+
default: () => {};
|
|
116
|
+
};
|
|
117
|
+
deferred: {
|
|
118
|
+
type: PropType<Deferred<any>>;
|
|
119
|
+
required: true;
|
|
120
|
+
};
|
|
121
|
+
render: {
|
|
122
|
+
type: PropType<(text: string) => string>;
|
|
123
|
+
default: typeof defaultRender;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export declare const paragraphEmits: {
|
|
127
|
+
setData: (e: SetDataEvent<keyof Paragraph>) => SetDataEvent<keyof Paragraph>;
|
|
128
|
+
load: (_: ParagraphLoadEvent) => boolean;
|
|
129
|
+
};
|