@vunk/plus 1.4.6 → 1.5.0
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/WebGLRenderer.mjs +1 -0
- package/components/WebGPURenderer.mjs +1 -0
- package/components/broadcasting-markdown/index.mjs +82 -9
- package/components/browserAll.mjs +1 -0
- package/components/index2.mjs +1498 -62
- package/components/pixi-frame/index.mjs +2 -1
- package/components/text/index.mjs +106 -0
- package/components/typing-markdown/index.css +19 -0
- package/components/typing-markdown/index.mjs +17 -4
- package/components/webworkerAll.mjs +1 -0
- package/index.css +19 -0
- package/package.json +5 -1
- package/components/agent-chat-provider/index.d.ts +0 -7
- package/components/agent-chat-provider/src/api.d.ts +0 -3
- package/components/agent-chat-provider/src/const-roles.d.ts +0 -8
- package/components/agent-chat-provider/src/const.d.ts +0 -1
- package/components/agent-chat-provider/src/index.vue.d.ts +0 -47
- package/components/agent-chat-provider/src/types.d.ts +0 -43
- package/components/agent-chat-provider/src/use.d.ts +0 -29
- package/components/avatar/index.d.ts +0 -4
- package/components/avatar/src/ctx.d.ts +0 -18
- package/components/avatar/src/index.vue.d.ts +0 -121
- package/components/avatar/src/types.d.ts +0 -1
- package/components/broadcasting-markdown/index.d.ts +0 -7
- package/components/broadcasting-markdown/src/const.d.ts +0 -13
- package/components/broadcasting-markdown/src/ctx.d.ts +0 -115
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +0 -97
- package/components/broadcasting-markdown/src/index.vue.d.ts +0 -383
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +0 -79
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +0 -60
- package/components/broadcasting-markdown/src/types.d.ts +0 -25
- package/components/broadcasting-markdown/src/use.d.ts +0 -21
- package/components/bubble-list/index.d.ts +0 -5
- package/components/bubble-list/src/ctx.d.ts +0 -30
- package/components/bubble-list/src/index.vue.d.ts +0 -867
- package/components/bubble-list/src/types.d.ts +0 -4
- package/components/bubble-templates/index.d.ts +0 -4
- package/components/bubble-templates/src/index.vue.d.ts +0 -539
- package/components/bubble-templates/src/types.d.ts +0 -40
- package/components/chat-independent/index.d.ts +0 -4
- package/components/chat-independent/src/const.d.ts +0 -13
- package/components/chat-independent/src/ctx.d.ts +0 -20
- package/components/chat-independent/src/index.vue.d.ts +0 -2345
- package/components/chat-independent/src/types.d.ts +0 -13
- package/components/index.d.ts +0 -0
- package/components/lottie-animation/index.d.ts +0 -4
- package/components/lottie-animation/src/ctx.d.ts +0 -10
- package/components/lottie-animation/src/index.vue.d.ts +0 -21
- package/components/lottie-animation/src/types.d.ts +0 -4
- package/components/monaco-editor/index.d.ts +0 -5
- package/components/monaco-editor/src/ctx.d.ts +0 -23
- package/components/monaco-editor/src/index.vue.d.ts +0 -40
- package/components/monaco-editor/src/types.d.ts +0 -1
- package/components/monaco-environment/index.d.ts +0 -4
- package/components/monaco-environment/src/ctx.d.ts +0 -8
- package/components/monaco-environment/src/index.vue.d.ts +0 -2
- package/components/monaco-environment/src/types.d.ts +0 -1
- package/components/pixi-frame/index.d.ts +0 -8
- package/components/pixi-frame/src/core.vue.d.ts +0 -131
- package/components/pixi-frame/src/ctx.d.ts +0 -44
- package/components/pixi-frame/src/index.vue.d.ts +0 -230
- package/components/pixi-frame/src/provider.vue.d.ts +0 -2
- package/components/pixi-frame/src/types.d.ts +0 -1
- package/components/pixi-frame/src/use.d.ts +0 -16
- package/components/pixi-frame/src/view.vue.d.ts +0 -29
- package/components/recorder-button/index.d.ts +0 -4
- package/components/recorder-button/src/ctx.d.ts +0 -41
- package/components/recorder-button/src/index.vue.d.ts +0 -300
- package/components/recorder-button/src/speech-to-text.d.ts +0 -1
- package/components/recorder-button/src/types.d.ts +0 -7
- package/components/routes-menu-content/index.d.ts +0 -4
- package/components/routes-menu-content/src/ctx.d.ts +0 -17
- package/components/routes-menu-content/src/index.vue.d.ts +0 -472
- package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -307
- package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
- package/components/routes-menu-content/src/item/index.vue.d.ts +0 -438
- package/components/routes-menu-content/src/types.d.ts +0 -1
- package/components/sender/index.d.ts +0 -4
- package/components/sender/src/SenderHeader.vue.d.ts +0 -256
- package/components/sender/src/ctx.d.ts +0 -62
- package/components/sender/src/index.vue.d.ts +0 -787
- package/components/sender/src/types.d.ts +0 -1
- package/components/speech-button/index.d.ts +0 -4
- package/components/speech-button/src/LoadingIcon.vue.d.ts +0 -2
- package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
- package/components/speech-button/src/ctx.d.ts +0 -10
- package/components/speech-button/src/index.vue.d.ts +0 -22
- package/components/speech-button/src/types.d.ts +0 -1
- package/components/table-columns/index.d.ts +0 -5
- package/components/table-columns/src/ctx.d.ts +0 -66
- package/components/table-columns/src/el-ctx.d.ts +0 -63
- package/components/table-columns/src/index.vue.d.ts +0 -282
- package/components/table-columns/src/types.d.ts +0 -21
- package/components/tables-v1/index.d.ts +0 -5
- package/components/tables-v1/src/ctx.d.ts +0 -288
- package/components/tables-v1/src/el-ctx.d.ts +0 -269
- package/components/tables-v1/src/index.vue.d.ts +0 -3106
- package/components/tables-v1/src/types.d.ts +0 -3
- package/components/tables-v1-checkbox/index.d.ts +0 -5
- package/components/tables-v1-checkbox/src/ctx.d.ts +0 -325
- package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3898
- package/components/tables-v1-checkbox/src/types.d.ts +0 -1
- package/components/typing-markdown/index.d.ts +0 -4
- package/components/typing-markdown/src/core.d.ts +0 -2
- package/components/typing-markdown/src/ctx.d.ts +0 -33
- package/components/typing-markdown/src/index.vue.d.ts +0 -57
- package/components/typing-markdown/src/types.d.ts +0 -1
- package/components/vditor/index.d.ts +0 -5
- package/components/vditor/src/ctx.d.ts +0 -37
- package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
- package/components/vditor/src/handle-value.vue.d.ts +0 -18
- package/components/vditor/src/index.vue.d.ts +0 -144
- package/components/vditor/src/types.d.ts +0 -9
- package/components/vditor/src/use.d.ts +0 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { aq as VkPixiFrame, ar as
|
|
1
|
+
export { aq as VkPixiFrame, ar as VkPixiFrameApng, as as VkPixiFrameCore, at as VkPixiFrameProvider, au as VkPixiFrameVideo, av as VkPixiFrameView, aw as __VkPixiFrame, aq as default } from '../index2.mjs';
|
|
2
2
|
export { TickerStatus } from '@vunk/shared/enum';
|
|
3
3
|
import 'vue';
|
|
4
4
|
import '@vunk/shared/promise';
|
|
5
5
|
import '../_commonjsHelpers.mjs';
|
|
6
|
+
import '@vunk/core/composables';
|
|
6
7
|
import '../_plugin-vue_export-helper.mjs';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, onUpdated, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, resolveDynamicComponent, renderSlot, useAttrs } from 'vue';
|
|
2
|
+
import { VkWrapper } from '@vunk/core/components/wrapper';
|
|
3
|
+
import { textProps, useTooltipProps, useFormSize, useNamespace, ElTooltip } from 'element-plus';
|
|
4
|
+
import { bindPropsFactory } from '@vunk/core/shared/utils-vue';
|
|
5
|
+
|
|
6
|
+
const createTextBindProps = bindPropsFactory(textProps);
|
|
7
|
+
const createTooltipBindProps = bindPropsFactory(useTooltipProps);
|
|
8
|
+
const props = {
|
|
9
|
+
...textProps,
|
|
10
|
+
...useTooltipProps
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
...{
|
|
15
|
+
name: "ElText",
|
|
16
|
+
inheritAttrs: false
|
|
17
|
+
},
|
|
18
|
+
__name: "index",
|
|
19
|
+
props: props,
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const textProps = createTextBindProps(props);
|
|
23
|
+
const tooltipProps = createTooltipBindProps(props, ["content"]);
|
|
24
|
+
const isUndefined = (val) => val === void 0;
|
|
25
|
+
const textRef = ref();
|
|
26
|
+
const textSize = useFormSize();
|
|
27
|
+
const ns = useNamespace("text");
|
|
28
|
+
const hasTitle = ref(false);
|
|
29
|
+
const textKls = computed(() => [
|
|
30
|
+
ns.b(),
|
|
31
|
+
ns.m(props.type),
|
|
32
|
+
ns.m(textSize.value),
|
|
33
|
+
ns.is("truncated", props.truncated),
|
|
34
|
+
ns.is("line-clamp", !isUndefined(props.lineClamp))
|
|
35
|
+
]);
|
|
36
|
+
function bindTitle() {
|
|
37
|
+
const inheritTitle = useAttrs().title;
|
|
38
|
+
if (inheritTitle)
|
|
39
|
+
return;
|
|
40
|
+
let shouldAddTitle = false;
|
|
41
|
+
if (props.truncated) {
|
|
42
|
+
const width = textRef.value?.offsetWidth;
|
|
43
|
+
const scrollWidth = textRef.value?.scrollWidth;
|
|
44
|
+
if (width && scrollWidth && scrollWidth > width) {
|
|
45
|
+
shouldAddTitle = true;
|
|
46
|
+
}
|
|
47
|
+
} else if (!isUndefined(props.lineClamp)) {
|
|
48
|
+
const height = textRef.value?.offsetHeight;
|
|
49
|
+
const scrollHeight = textRef.value?.scrollHeight;
|
|
50
|
+
if (height && scrollHeight && scrollHeight > height) {
|
|
51
|
+
shouldAddTitle = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
hasTitle.value = shouldAddTitle;
|
|
55
|
+
}
|
|
56
|
+
onMounted(bindTitle);
|
|
57
|
+
onUpdated(bindTitle);
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return openBlock(), createBlock(unref(VkWrapper), mergeProps({
|
|
60
|
+
is: unref(ElTooltip),
|
|
61
|
+
show: hasTitle.value,
|
|
62
|
+
content: textRef.value?.textContent
|
|
63
|
+
}, unref(tooltipProps)), createSlots({
|
|
64
|
+
default: withCtx(() => [
|
|
65
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
|
|
66
|
+
ref_key: "textRef",
|
|
67
|
+
ref: textRef,
|
|
68
|
+
class: textKls.value,
|
|
69
|
+
style: { "-webkit-line-clamp": _ctx.lineClamp }
|
|
70
|
+
}, {
|
|
71
|
+
...unref(textProps),
|
|
72
|
+
..._ctx.$attrs
|
|
73
|
+
}), {
|
|
74
|
+
default: withCtx(() => [
|
|
75
|
+
renderSlot(_ctx.$slots, "default")
|
|
76
|
+
]),
|
|
77
|
+
_: 3
|
|
78
|
+
/* FORWARDED */
|
|
79
|
+
}, 16, ["class", "style"]))
|
|
80
|
+
]),
|
|
81
|
+
_: 2
|
|
82
|
+
/* DYNAMIC */
|
|
83
|
+
}, [
|
|
84
|
+
_ctx.$slots.content ? {
|
|
85
|
+
name: "content",
|
|
86
|
+
fn: withCtx(() => [
|
|
87
|
+
renderSlot(_ctx.$slots, "content", {
|
|
88
|
+
content: textRef.value?.textContent
|
|
89
|
+
})
|
|
90
|
+
]),
|
|
91
|
+
key: "0"
|
|
92
|
+
} : void 0
|
|
93
|
+
]), 1040, ["is", "show", "content"]);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
99
|
+
__proto__: null
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
_sfc_main.install = (app) => {
|
|
103
|
+
app.component(_sfc_main.name || "VkText", _sfc_main);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export { _sfc_main as VkText, types as __VkText, _sfc_main as default };
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
animation: blink 0.7s infinite;
|
|
3
3
|
content: '|';
|
|
4
4
|
}
|
|
5
|
+
.vk-typing-markdown.is-loading:not(.is-typing) .is-last::after {
|
|
6
|
+
content: '';
|
|
7
|
+
display: inline-block;
|
|
8
|
+
width: 1em;
|
|
9
|
+
text-align: left;
|
|
10
|
+
animation: dotTyping 1.2s steps(4, end) infinite;
|
|
11
|
+
}
|
|
12
|
+
@keyframes dotTyping {
|
|
13
|
+
0% { content: '';
|
|
14
|
+
}
|
|
15
|
+
25% { content: '.';
|
|
16
|
+
}
|
|
17
|
+
50% { content: '..';
|
|
18
|
+
}
|
|
19
|
+
75% { content: '...';
|
|
20
|
+
}
|
|
21
|
+
100% { content: '';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
5
24
|
@keyframes blink {
|
|
6
25
|
0%, 100% {
|
|
7
26
|
opacity: 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { noop, computedAsync, debouncedRef } from '@vueuse/core';
|
|
2
|
+
import { useModelComputed } from '@vunk/core/composables';
|
|
2
3
|
import { noop as noop$1 } from '@vunk/shared/function';
|
|
3
4
|
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, normalizeClass } from 'vue';
|
|
4
5
|
import { highlight } from '@vunk/shared/markdown/shiki';
|
|
@@ -155,10 +156,18 @@ const props = {
|
|
|
155
156
|
markdownItSetup: {
|
|
156
157
|
type: Function,
|
|
157
158
|
default: null
|
|
159
|
+
},
|
|
160
|
+
finished: {
|
|
161
|
+
type: Boolean
|
|
162
|
+
},
|
|
163
|
+
loading: {
|
|
164
|
+
type: Boolean,
|
|
165
|
+
default: false
|
|
158
166
|
}
|
|
159
167
|
};
|
|
160
168
|
const emits = {
|
|
161
|
-
typing: null
|
|
169
|
+
"typing": null,
|
|
170
|
+
"update:finished": null
|
|
162
171
|
};
|
|
163
172
|
|
|
164
173
|
var _sfc_main = defineComponent({
|
|
@@ -186,9 +195,12 @@ var _sfc_main = defineComponent({
|
|
|
186
195
|
return !props2.pause && !props2.disabled && currentIndex.value !== props2.source.length;
|
|
187
196
|
});
|
|
188
197
|
const isDebouncedTyping = debouncedRef(isTyping, 100);
|
|
189
|
-
const isFinished =
|
|
198
|
+
const isFinished = useModelComputed({
|
|
199
|
+
default: false,
|
|
200
|
+
key: "finished"
|
|
201
|
+
}, props2, emit);
|
|
190
202
|
function typeWriter() {
|
|
191
|
-
if (props2.pause || props2.disabled) {
|
|
203
|
+
if (props2.pause || props2.disabled || props2.source.length === 0) {
|
|
192
204
|
return;
|
|
193
205
|
}
|
|
194
206
|
if (currentIndex.value < props2.source.length) {
|
|
@@ -225,7 +237,8 @@ const _hoisted_1 = ["innerHTML"];
|
|
|
225
237
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
226
238
|
return openBlock(), createElementBlock("div", {
|
|
227
239
|
class: normalizeClass(["vk-typing-markdown", {
|
|
228
|
-
"is-typing": _ctx.isDebouncedTyping
|
|
240
|
+
"is-typing": _ctx.isDebouncedTyping,
|
|
241
|
+
"is-loading": _ctx.loading
|
|
229
242
|
}]),
|
|
230
243
|
innerHTML: _ctx.htmlText
|
|
231
244
|
}, null, 10, _hoisted_1);
|
package/index.css
CHANGED
|
@@ -194,6 +194,25 @@
|
|
|
194
194
|
animation: blink 0.7s infinite;
|
|
195
195
|
content: '|';
|
|
196
196
|
}
|
|
197
|
+
.vk-typing-markdown.is-loading:not(.is-typing) .is-last::after {
|
|
198
|
+
content: '';
|
|
199
|
+
display: inline-block;
|
|
200
|
+
width: 1em;
|
|
201
|
+
text-align: left;
|
|
202
|
+
animation: dotTyping 1.2s steps(4, end) infinite;
|
|
203
|
+
}
|
|
204
|
+
@keyframes dotTyping {
|
|
205
|
+
0% { content: '';
|
|
206
|
+
}
|
|
207
|
+
25% { content: '.';
|
|
208
|
+
}
|
|
209
|
+
50% { content: '..';
|
|
210
|
+
}
|
|
211
|
+
75% { content: '...';
|
|
212
|
+
}
|
|
213
|
+
100% { content: '';
|
|
214
|
+
}
|
|
215
|
+
}
|
|
197
216
|
@keyframes blink {
|
|
198
217
|
0%, 100% {
|
|
199
218
|
opacity: 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vunk/plus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"import": "./components/typing-markdown/index.mjs",
|
|
60
60
|
"types": "./components/typing-markdown/index.d.ts"
|
|
61
61
|
},
|
|
62
|
+
"./components/text": {
|
|
63
|
+
"import": "./components/text/index.mjs",
|
|
64
|
+
"types": "./components/text/index.d.ts"
|
|
65
|
+
},
|
|
62
66
|
"./components/tables-v1-checkbox": {
|
|
63
67
|
"import": "./components/tables-v1-checkbox/index.mjs",
|
|
64
68
|
"types": "./components/tables-v1-checkbox/index.d.ts"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import VkAgentChatProvider from './src/index.vue';
|
|
2
|
-
export * from './src/const';
|
|
3
|
-
export * from './src/const-roles';
|
|
4
|
-
export * as __VkAgentChatProvider from './src/types';
|
|
5
|
-
export { useAgentChat } from './src/use';
|
|
6
|
-
export { VkAgentChatProvider, };
|
|
7
|
-
export default VkAgentChatProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ChatAgentInjectKey = "vk_agent_chat_inject_key";
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { AnyFunc } from '@vunk/shared';
|
|
2
|
-
import type { PropType } from 'vue';
|
|
3
|
-
import type { AgentChatContext, AgentMessage } from './types';
|
|
4
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
-
request: {
|
|
6
|
-
type: PropType<AnyFunc>;
|
|
7
|
-
};
|
|
8
|
-
parser: {
|
|
9
|
-
type: PropType<AnyFunc>;
|
|
10
|
-
};
|
|
11
|
-
}>, import("vue").Slot<any> | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
load: (e: AgentChatContext) => {
|
|
13
|
-
agent: import("vue").ComputedRef<import("ant-design-x-vue").XAgent<AgentMessage>>;
|
|
14
|
-
chat: {
|
|
15
|
-
readonly onRequest: (value: AgentMessage) => void;
|
|
16
|
-
readonly messages: import("vue").Ref<import("ant-design-x-vue").MessageInfo<AgentMessage>[], import("ant-design-x-vue").MessageInfo<AgentMessage>[]>;
|
|
17
|
-
readonly parsedMessages: import("vue").ComputedRef<import("ant-design-x-vue").MessageInfo<import("./types").BubbleMessage>[]>;
|
|
18
|
-
readonly setMessages: (updater: import("ant-design-x-vue").MessageInfo<AgentMessage>[] | ((prev: import("ant-design-x-vue").MessageInfo<AgentMessage>[]) => import("ant-design-x-vue").MessageInfo<AgentMessage>[])) => void;
|
|
19
|
-
};
|
|
20
|
-
simplicity: {
|
|
21
|
-
onRequest: (message: string) => void;
|
|
22
|
-
items: import("vue").ComputedRef<import("./types").BubbleItem[]>;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
-
request: {
|
|
27
|
-
type: PropType<AnyFunc>;
|
|
28
|
-
};
|
|
29
|
-
parser: {
|
|
30
|
-
type: PropType<AnyFunc>;
|
|
31
|
-
};
|
|
32
|
-
}>> & Readonly<{
|
|
33
|
-
onLoad?: ((e: {
|
|
34
|
-
agent: import("vue").ComputedRef<import("ant-design-x-vue").XAgent<AgentMessage>>;
|
|
35
|
-
chat: {
|
|
36
|
-
readonly onRequest: (value: AgentMessage) => void;
|
|
37
|
-
readonly messages: import("vue").Ref<import("ant-design-x-vue").MessageInfo<AgentMessage>[], import("ant-design-x-vue").MessageInfo<AgentMessage>[]>;
|
|
38
|
-
readonly parsedMessages: import("vue").ComputedRef<import("ant-design-x-vue").MessageInfo<import("./types").BubbleMessage>[]>;
|
|
39
|
-
readonly setMessages: (updater: import("ant-design-x-vue").MessageInfo<AgentMessage>[] | ((prev: import("ant-design-x-vue").MessageInfo<AgentMessage>[]) => import("ant-design-x-vue").MessageInfo<AgentMessage>[])) => void;
|
|
40
|
-
};
|
|
41
|
-
simplicity: {
|
|
42
|
-
onRequest: (message: string) => void;
|
|
43
|
-
items: import("vue").ComputedRef<import("./types").BubbleItem[]>;
|
|
44
|
-
};
|
|
45
|
-
}) => any) | undefined;
|
|
46
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
-
export default _default;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { __VkBubbleTemplates } from '@vunk/plus/components/bubble-templates';
|
|
2
|
-
import type { Media, NormalObject } from '@vunk/shared';
|
|
3
|
-
import type { RequestFn } from 'ant-design-x-vue';
|
|
4
|
-
import type { MaybeArray } from 'naive-ui/es/_utils';
|
|
5
|
-
import type { BubbleListItemProps } from 'vue-element-plus-x/types/components/BubbleList/types';
|
|
6
|
-
import type { initAgentChat } from './use';
|
|
7
|
-
export type AgentChatContext = ReturnType<typeof initAgentChat>;
|
|
8
|
-
export type Request = RequestFn<AgentMessage>;
|
|
9
|
-
export type Parser = (message: AgentMessage) => MaybeArray<BubbleMessage>;
|
|
10
|
-
/**
|
|
11
|
-
* @description useXAgent request onSuccess 发送的数据
|
|
12
|
-
*/
|
|
13
|
-
export type AgentMessage = BubbleMessage & {
|
|
14
|
-
seviceLoading?: boolean;
|
|
15
|
-
seviceEnd?: boolean;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* @description useXChat parser 解析数据
|
|
19
|
-
*/
|
|
20
|
-
export type BubbleMessage = Partial<BubbleListItemProps> & {
|
|
21
|
-
role: string;
|
|
22
|
-
content: string;
|
|
23
|
-
/**
|
|
24
|
-
* @description 服务端请求是否完成
|
|
25
|
-
*/
|
|
26
|
-
seviceEnd?: boolean;
|
|
27
|
-
thinkingStatus?: 'start' | 'thinking' | 'end' | 'error';
|
|
28
|
-
thinkingContent?: string;
|
|
29
|
-
meta?: NormalObject;
|
|
30
|
-
abortController?: AbortController;
|
|
31
|
-
templateType?: string;
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
};
|
|
34
|
-
export type BubbleItem = BubbleItemBasic & __VkBubbleTemplates.RenderItem;
|
|
35
|
-
export type RoleMedia = RoleMediaBasic & __VkBubbleTemplates.RenderItem;
|
|
36
|
-
export type BubbleItemModule = 'Thinking';
|
|
37
|
-
export interface BubbleItemBasic extends BubbleMessage {
|
|
38
|
-
key: string;
|
|
39
|
-
modules?: BubbleItemModule[];
|
|
40
|
-
}
|
|
41
|
-
export interface RoleMediaBasic extends Partial<BubbleItemBasic>, Media {
|
|
42
|
-
value: string;
|
|
43
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { RequestFn } from 'ant-design-x-vue';
|
|
2
|
-
import type { AgentMessage, BubbleItem, BubbleMessage, Parser } from './types';
|
|
3
|
-
export declare function useAgent(request: RequestFn<AgentMessage>): import("vue").ComputedRef<import("ant-design-x-vue").XAgent<AgentMessage>>[];
|
|
4
|
-
export declare function initAgentChat(request: RequestFn<AgentMessage>, parser: Parser): {
|
|
5
|
-
agent: import("vue").ComputedRef<import("ant-design-x-vue").XAgent<AgentMessage>>;
|
|
6
|
-
chat: {
|
|
7
|
-
readonly onRequest: (value: AgentMessage) => void;
|
|
8
|
-
readonly messages: import("vue").Ref<import("ant-design-x-vue").MessageInfo<AgentMessage>[], import("ant-design-x-vue").MessageInfo<AgentMessage>[]>;
|
|
9
|
-
readonly parsedMessages: import("vue").ComputedRef<import("ant-design-x-vue").MessageInfo<BubbleMessage>[]>;
|
|
10
|
-
readonly setMessages: (updater: import("ant-design-x-vue").MessageInfo<AgentMessage>[] | ((prev: import("ant-design-x-vue").MessageInfo<AgentMessage>[]) => import("ant-design-x-vue").MessageInfo<AgentMessage>[])) => void;
|
|
11
|
-
};
|
|
12
|
-
simplicity: {
|
|
13
|
-
onRequest: (message: string) => void;
|
|
14
|
-
items: import("vue").ComputedRef<BubbleItem[]>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare function useAgentChat(): {
|
|
18
|
-
agent: import("vue").ComputedRef<import("ant-design-x-vue").XAgent<AgentMessage>>;
|
|
19
|
-
chat: {
|
|
20
|
-
readonly onRequest: (value: AgentMessage) => void;
|
|
21
|
-
readonly messages: import("vue").Ref<import("ant-design-x-vue").MessageInfo<AgentMessage>[], import("ant-design-x-vue").MessageInfo<AgentMessage>[]>;
|
|
22
|
-
readonly parsedMessages: import("vue").ComputedRef<import("ant-design-x-vue").MessageInfo<BubbleMessage>[]>;
|
|
23
|
-
readonly setMessages: (updater: import("ant-design-x-vue").MessageInfo<AgentMessage>[] | ((prev: import("ant-design-x-vue").MessageInfo<AgentMessage>[]) => import("ant-design-x-vue").MessageInfo<AgentMessage>[])) => void;
|
|
24
|
-
};
|
|
25
|
-
simplicity: {
|
|
26
|
-
onRequest: (message: string) => void;
|
|
27
|
-
items: import("vue").ComputedRef<BubbleItem[]>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const props: {
|
|
2
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
3
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
4
|
-
readonly icon: {
|
|
5
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
6
|
-
readonly required: false;
|
|
7
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
|
-
__epPropKey: true;
|
|
9
|
-
};
|
|
10
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
11
|
-
readonly alt: StringConstructor;
|
|
12
|
-
readonly srcSet: StringConstructor;
|
|
13
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
|
|
14
|
-
} & {
|
|
15
|
-
background: never;
|
|
16
|
-
color: never;
|
|
17
|
-
};
|
|
18
|
-
export declare const emits: {};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
3
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
4
|
-
readonly icon: {
|
|
5
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
6
|
-
readonly required: false;
|
|
7
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
|
-
__epPropKey: true;
|
|
9
|
-
};
|
|
10
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
11
|
-
readonly alt: StringConstructor;
|
|
12
|
-
readonly srcSet: StringConstructor;
|
|
13
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
|
|
14
|
-
} & {
|
|
15
|
-
background: never;
|
|
16
|
-
color: never;
|
|
17
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
19
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
20
|
-
readonly icon: {
|
|
21
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
22
|
-
readonly required: false;
|
|
23
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
24
|
-
__epPropKey: true;
|
|
25
|
-
};
|
|
26
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
27
|
-
readonly alt: StringConstructor;
|
|
28
|
-
readonly srcSet: StringConstructor;
|
|
29
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
|
|
30
|
-
} & {
|
|
31
|
-
background: never;
|
|
32
|
-
color: never;
|
|
33
|
-
}>> & Readonly<{}>, {
|
|
34
|
-
readonly size: import("element-plus").ButtonType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
|
|
35
|
-
readonly shape: import("element-plus").ButtonType<StringConstructor, "circle" | "square", unknown>;
|
|
36
|
-
readonly src: string;
|
|
37
|
-
readonly fit: any;
|
|
38
|
-
}, {}, {
|
|
39
|
-
ElAvatar: import("element-plus/es/utils").SFCWithInstall<{
|
|
40
|
-
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
41
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
42
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
43
|
-
readonly icon: {
|
|
44
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
45
|
-
readonly required: false;
|
|
46
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
47
|
-
__epPropKey: true;
|
|
48
|
-
};
|
|
49
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
50
|
-
readonly alt: StringConstructor;
|
|
51
|
-
readonly srcSet: StringConstructor;
|
|
52
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any))[], unknown, unknown, "cover", boolean>;
|
|
53
|
-
}>> & {
|
|
54
|
-
onError?: ((evt: Event) => any) | undefined;
|
|
55
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
56
|
-
error: (evt: Event) => void;
|
|
57
|
-
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
|
58
|
-
readonly size: import("element-plus").ButtonType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
|
|
59
|
-
readonly shape: import("element-plus").ButtonType<StringConstructor, "circle" | "square", unknown>;
|
|
60
|
-
readonly src: string;
|
|
61
|
-
readonly fit: any;
|
|
62
|
-
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
63
|
-
P: {};
|
|
64
|
-
B: {};
|
|
65
|
-
D: {};
|
|
66
|
-
C: {};
|
|
67
|
-
M: {};
|
|
68
|
-
Defaults: {};
|
|
69
|
-
}, Readonly<import("vue").ExtractPropTypes<{
|
|
70
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
71
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
72
|
-
readonly icon: {
|
|
73
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
74
|
-
readonly required: false;
|
|
75
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
76
|
-
__epPropKey: true;
|
|
77
|
-
};
|
|
78
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
79
|
-
readonly alt: StringConstructor;
|
|
80
|
-
readonly srcSet: StringConstructor;
|
|
81
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any))[], unknown, unknown, "cover", boolean>;
|
|
82
|
-
}>> & {
|
|
83
|
-
onError?: ((evt: Event) => any) | undefined;
|
|
84
|
-
}, {}, {}, {}, {}, {
|
|
85
|
-
readonly size: import("element-plus").ButtonType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
|
|
86
|
-
readonly shape: import("element-plus").ButtonType<StringConstructor, "circle" | "square", unknown>;
|
|
87
|
-
readonly src: string;
|
|
88
|
-
readonly fit: any;
|
|
89
|
-
}>;
|
|
90
|
-
__isFragment?: undefined;
|
|
91
|
-
__isTeleport?: undefined;
|
|
92
|
-
__isSuspense?: undefined;
|
|
93
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
94
|
-
readonly size: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
|
|
95
|
-
readonly shape: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
|
|
96
|
-
readonly icon: {
|
|
97
|
-
readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
|
|
98
|
-
readonly required: false;
|
|
99
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
100
|
-
__epPropKey: true;
|
|
101
|
-
};
|
|
102
|
-
readonly src: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
103
|
-
readonly alt: StringConstructor;
|
|
104
|
-
readonly srcSet: StringConstructor;
|
|
105
|
-
readonly fit: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any) | ((new (...args: any[]) => "initial" | "fill" | "cover" | "contain" | "none" | "scale-down" | "-moz-initial" | "inherit" | "revert" | "unset") | (() => any))[], unknown, unknown, "cover", boolean>;
|
|
106
|
-
}>> & {
|
|
107
|
-
onError?: ((evt: Event) => any) | undefined;
|
|
108
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
109
|
-
error: (evt: Event) => void;
|
|
110
|
-
}, string, {
|
|
111
|
-
readonly size: import("element-plus").ButtonType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
|
|
112
|
-
readonly shape: import("element-plus").ButtonType<StringConstructor, "circle" | "square", unknown>;
|
|
113
|
-
readonly src: string;
|
|
114
|
-
readonly fit: any;
|
|
115
|
-
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
116
|
-
$slots: {
|
|
117
|
-
default?(_: {}): any;
|
|
118
|
-
};
|
|
119
|
-
})>;
|
|
120
|
-
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
121
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|