@vunk/plus 1.12.2 → 1.13.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.
Files changed (173) hide show
  1. package/components/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  2. package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  3. package/components/agent-chat-provider/index.cjs +1 -0
  4. package/components/agent-chat-provider/index.mjs +113 -187
  5. package/components/agent-chat-provider/src/index.vue.d.ts +3 -2
  6. package/components/avatar/index.cjs +1 -0
  7. package/components/avatar/index.mjs +25 -31
  8. package/components/avatar/src/index.vue.d.ts +40 -39
  9. package/components/broadcasting-markdown/__tests__/const.test.d.ts +1 -0
  10. package/components/broadcasting-markdown/__tests__/utils.test.d.ts +1 -0
  11. package/components/broadcasting-markdown/index.cjs +5 -0
  12. package/components/broadcasting-markdown/index.mjs +346 -4376
  13. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +18 -24
  14. package/components/broadcasting-markdown/src/index.vue.d.ts +101 -51
  15. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +17 -29
  16. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +2 -59
  17. package/components/bubble-list/index.cjs +1 -0
  18. package/components/bubble-list/index.mjs +220 -302
  19. package/components/bubble-list/src/core/index.vue.d.ts +40 -885
  20. package/components/bubble-list/src/core/loading.vue.d.ts +3 -0
  21. package/components/bubble-list/src/index.vue.d.ts +29 -1321
  22. package/components/bubble-templates/index.cjs +1 -0
  23. package/components/bubble-templates/index.mjs +34 -49
  24. package/components/bubble-templates/src/index.vue.d.ts +3 -224
  25. package/components/chat-independent/index.cjs +1 -0
  26. package/components/chat-independent/index.mjs +105 -212
  27. package/components/chat-independent/src/index.vue.d.ts +20 -2712
  28. package/components/components.css +1 -0
  29. package/components/drawer/index.cjs +1 -0
  30. package/components/drawer/index.mjs +53 -94
  31. package/components/drawer/src/ctx.d.ts +22 -22
  32. package/components/drawer/src/index.vue.d.ts +84 -557
  33. package/components/index.cjs +1 -0
  34. package/components/index.d.ts +1 -0
  35. package/components/lottie-animation/index.cjs +1 -0
  36. package/components/lottie-animation/index.mjs +36 -55
  37. package/components/lottie-animation/src/index.vue.d.ts +3 -2
  38. package/components/metahuman-broadcasting/index.cjs +1 -0
  39. package/components/metahuman-broadcasting/index.mjs +89 -140
  40. package/components/metahuman-broadcasting/src/index.vue.d.ts +16 -718
  41. package/components/monaco-editor/index.cjs +1 -0
  42. package/components/monaco-editor/index.mjs +68 -95
  43. package/components/monaco-editor/src/index.vue.d.ts +3 -2
  44. package/components/monaco-environment/index.cjs +1 -0
  45. package/components/monaco-environment/index.mjs +23 -38
  46. package/components/monaco-environment/src/index.vue.d.ts +2 -1
  47. package/components/pixi-frame/index.cjs +1 -0
  48. package/components/pixi-frame/index.mjs +941 -1969
  49. package/components/pixi-frame/src/apng.vue.d.ts +17 -73
  50. package/components/pixi-frame/src/bitmap-generator.vue.d.ts +24 -66
  51. package/components/pixi-frame/src/bitmap.vue.d.ts +28 -80
  52. package/components/pixi-frame/src/buffer-image.vue.d.ts +29 -97
  53. package/components/pixi-frame/src/core.vue.d.ts +20 -75
  54. package/components/pixi-frame/src/index.vue.d.ts +302 -237
  55. package/components/pixi-frame/src/provider.vue.d.ts +12 -1
  56. package/components/pixi-frame/src/video.vue.d.ts +17 -71
  57. package/components/pixi-frame/src/view.vue.d.ts +4 -16
  58. package/components/recorder-button/index.cjs +1 -0
  59. package/components/recorder-button/index.mjs +140 -269
  60. package/components/recorder-button/src/index.vue.d.ts +67 -66
  61. package/components/routes-menu-content/index.cjs +1 -0
  62. package/components/routes-menu-content/index.mjs +150 -229
  63. package/components/routes-menu-content/src/index.vue.d.ts +27 -26
  64. package/components/routes-menu-content/src/item/core/index.vue.d.ts +27 -26
  65. package/components/routes-menu-content/src/item/index.vue.d.ts +27 -26
  66. package/components/scrollbar/index.cjs +1 -0
  67. package/components/scrollbar/index.mjs +288 -567
  68. package/components/scrollbar/src/bar.vue.d.ts +6 -133
  69. package/components/scrollbar/src/index.vue.d.ts +66 -337
  70. package/components/scrollbar/src/thumb.vue.d.ts +3 -80
  71. package/components/sender/index.cjs +1 -0
  72. package/components/sender/index.mjs +156 -285
  73. package/components/sender/src/SenderHeader.vue.d.ts +14 -221
  74. package/components/sender/src/index.vue.d.ts +16 -505
  75. package/components/speech-button/index.cjs +1 -0
  76. package/components/speech-button/index.mjs +98 -144
  77. package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -1
  78. package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -1
  79. package/components/speech-button/src/index.vue.d.ts +6 -5
  80. package/components/table-columns/index.cjs +1 -0
  81. package/components/table-columns/index.mjs +48 -78
  82. package/components/table-columns/src/ctx.d.ts +10 -10
  83. package/components/table-columns/src/el-ctx.d.ts +1 -1
  84. package/components/table-columns/src/index.vue.d.ts +24 -23
  85. package/components/tables-v1/index.cjs +1 -0
  86. package/components/tables-v1/index.mjs +99 -160
  87. package/components/tables-v1/src/ctx.d.ts +28 -28
  88. package/components/tables-v1/src/el-ctx.d.ts +2 -2
  89. package/components/tables-v1/src/index.vue.d.ts +88 -2243
  90. package/components/tables-v1-checkbox/index.cjs +98 -0
  91. package/components/tables-v1-checkbox/index.mjs +1594 -3735
  92. package/components/tables-v1-checkbox/src/ctx.d.ts +26 -26
  93. package/components/tables-v1-checkbox/src/index.vue.d.ts +176 -2330
  94. package/components/text/index.cjs +1 -0
  95. package/components/text/index.mjs +70 -108
  96. package/components/text/src/ctx.d.ts +31 -31
  97. package/components/text/src/index.vue.d.ts +92 -1819
  98. package/components/thinking/index.cjs +1 -0
  99. package/components/thinking/index.mjs +127 -227
  100. package/components/thinking/src/index.vue.d.ts +22 -2044
  101. package/components/typing-markdown/index.cjs +1 -0
  102. package/components/typing-markdown/index.mjs +61 -201
  103. package/components/typing-markdown/src/index.vue.d.ts +3 -2
  104. package/components/vditor/index.cjs +1 -0
  105. package/components/vditor/index.mjs +121 -195
  106. package/components/vditor/src/ctx.d.ts +2 -2
  107. package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -2
  108. package/components/vditor/src/handle-value.vue.d.ts +3 -2
  109. package/components/vditor/src/index.vue.d.ts +5 -4
  110. package/components/xgplayer/index.cjs +1 -0
  111. package/components/xgplayer/index.mjs +49 -90
  112. package/components/xgplayer/src/core.vue.d.ts +13 -18
  113. package/components/xgplayer/src/index.vue.d.ts +13 -67
  114. package/composables/el-breakpoints/index.cjs +1 -0
  115. package/composables/el-breakpoints/index.d.ts +10 -10
  116. package/composables/el-breakpoints/index.mjs +10 -12
  117. package/composables/index.cjs +1 -0
  118. package/composables/index.d.ts +1 -0
  119. package/composables/recorder/index.cjs +1 -0
  120. package/composables/recorder/index.mjs +9172 -14803
  121. package/element/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  122. package/element/bubble/index.cjs +3 -0
  123. package/element/bubble/index.d.ts +1 -1
  124. package/element/bubble/index.mjs +1 -1
  125. package/element/bubble/src/index.vue.d.ts +22 -22
  126. package/element/index.css +1 -1
  127. package/element/thinking/index.cjs +1 -0
  128. package/element/thinking/index.d.ts +1 -1
  129. package/element/thinking/index.mjs +1 -1
  130. package/element/thinking/src/index.vue.d.ts +26 -26
  131. package/element/thinking/src/types.d.ts +10 -0
  132. package/icons/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  133. package/icons/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  134. package/icons/end/index.cjs +1 -0
  135. package/icons/end/index.mjs +21 -26
  136. package/icons/end/src/index.vue.d.ts +3 -0
  137. package/icons/keyboard/index.cjs +1 -0
  138. package/icons/keyboard/index.mjs +21 -26
  139. package/icons/keyboard/src/index.vue.d.ts +3 -0
  140. package/icons/start/index.cjs +1 -0
  141. package/icons/start/index.mjs +21 -26
  142. package/icons/start/src/index.vue.d.ts +3 -0
  143. package/icons/voice/index.cjs +1 -0
  144. package/icons/voice/index.mjs +26 -44
  145. package/icons/voice/src/index.vue.d.ts +2 -3
  146. package/index.css +2 -558
  147. package/index.d.ts +1 -0
  148. package/package.json +78 -87
  149. package/shared/data/index.cjs +1 -0
  150. package/shared/data/index.mjs +16 -22
  151. package/shared/types/index.cjs +1 -0
  152. package/shared/types/index.d.ts +1 -0
  153. package/components/LinkOutlined.mjs +0 -1321
  154. package/components/_commonjsHelpers.mjs +0 -7
  155. package/components/_plugin-vue_export-helper.mjs +0 -9
  156. package/components/bubble-list/index.css +0 -70
  157. package/components/bubble-templates/index.css +0 -4
  158. package/components/chat-independent/index.css +0 -47
  159. package/components/drawer/index.css +0 -124
  160. package/components/index2.mjs +0 -78
  161. package/components/lottie-animation/index.css +0 -4
  162. package/components/monaco-editor/index.css +0 -4
  163. package/components/pixi-frame/index.css +0 -4
  164. package/components/recorder-button/index.css +0 -69
  165. package/components/sender/index.css +0 -22
  166. package/components/speech-button/index.css +0 -10
  167. package/components/tables-v1/index.css +0 -7
  168. package/components/tables-v1-checkbox/index.css +0 -8
  169. package/components/thinking/index.css +0 -125
  170. package/components/typing-markdown/index.css +0 -31
  171. package/components/vditor/index.css +0 -12
  172. package/components/xgplayer/index.css +0 -1
  173. package/icons/_plugin-vue_export-helper.mjs +0 -9
@@ -0,0 +1 @@
1
+ "use strict";const e=(t,o)=>{const c=t.__vccOpts||t;for(const[r,s]of o)c[r]=s;return c};exports._export_sfc=e;
@@ -0,0 +1,9 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),U=require("@vunk/shared/fetch"),C=require("ant-design-x-vue");async function O(e,t){return U.restFetch.reader({url:"/application/chat_message/69e23792-8162-11f0-8a7b-dee062287042",onmessage:e},{headers:{authorization:"application-8259214f7c6f2777658809d71bdfada3"},data:t})}var d=(e=>(e.User="user",e.Assistant="assistant",e.Broadcasting="broadcasting",e))(d||{});const M=[{label:"用户",value:"user",isMarkdown:!1,placement:"end",templateType:"VkMarkdown"},{label:"AI 助手",value:"assistant",isMarkdown:!0,placement:"start",typing:!0,templateType:"VkMarkdown"}],b=M.reduce((e,t)=>(e[t.value]=t,e),{}),_="vk_agent_chat_inject_key";function P(e){return C.useXAgent({request:e})}function L(e,t,s){const[n]=P(e),o=C.useXChat({agent:n.value,parser:t}),f=r=>{const v=s(r);o.onRequest(v)},h=p.computed(()=>o.parsedMessages.value.map(r=>({key:r.id,...b[r.message.role],...r.message}))),c={agent:n,chat:o,simplicity:{onRequest:f,items:h}};return p.provide(_,c),c}function x(){const e=p.inject(_,null);if(!e)throw new Error("useAgentChat must be used within a provider");return e}const g=p.defineComponent({name:"VkAgentChatProvider",props:{request:{type:Function},parser:{type:Function},formatSend:{type:Function}},emits:{load:null},setup(e,{slots:t,emit:s}){const n=(a,c)=>{const{message:r}=a,{onSuccess:v,onUpdate:S}=c,V=[];if(!r?.content)return;let k="";const q=d.Assistant;let w="",m="start",y=!0,A=!1;const u=()=>{const l={role:q,content:k,thinkingContent:w,thinkingStatus:m,seviceLoading:y,seviceEnd:A};S(l),V.push(l)},j=()=>{v(V)};u(),O(l=>{let i={content:"",reasoning_content:""};typeof l.data=="string"&&(i=JSON.parse(l.data)),i.reasoning_content&&(w+=i.reasoning_content,m="thinking",y=!1,u()),i.content&&(k+=i.content,y=!1,u()),w&&i.content&&(m="end",u()),i.is_end&&(A=!0,u(),j())},{message:r?.content})},o=a=>[{...a,role:a.role??d.User,content:a.content??"",loading:a.seviceLoading}],f=a=>({role:d.User,content:a}),h=L(e.request??n,e.parser??o,e.formatSend??f);return s("load",h),t.default}});class F{views=[];getViews(){return this.views}createView(t){this.views.push(t)}upsertView(t,s={}){let n=this.getLastUpdatingView(t.type);return n?(n.content+=t.content,n.updating=t.updating,s.onUpdate?.(n)):(n=t,this.createView(n),s.onCreate?.(n)),n}getPrevView(t){const s=this.views.indexOf(t);if(s>0)return this.views[s-1]}getLastUpdatingView(t){return this.views.findLast(s=>s.updating&&s.type===t)}allViewUpdated(){this.views.forEach(t=>{t.updating=!1})}}const T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));g.install=e=>{e.component(g.name||"VkAgentChatProvider",g)};exports.ChatAgentInjectKey=_;exports.MessageViewManager=F;exports.Role=d;exports.VkAgentChatProvider=g;exports.__VkAgentChatProvider=T;exports.default=g;exports.roleMap=b;exports.roleOptions=M;exports.useAgentChat=x;
@@ -1,96 +1,71 @@
1
- import { computed, provide, inject, defineComponent } from 'vue';
2
- import { restFetch } from '@vunk/shared/fetch';
3
- import { useXChat, useXAgent } from 'ant-design-x-vue';
4
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
5
-
6
- async function agentRequest(onmessage, data) {
7
- return restFetch.reader({
1
+ import { computed as b, provide as S, inject as U, defineComponent as j } from "vue";
2
+ import { restFetch as q } from "@vunk/shared/fetch";
3
+ import { useXChat as P, useXAgent as x } from "ant-design-x-vue";
4
+ async function L(e, t) {
5
+ return q.reader({
8
6
  url: "/application/chat_message/69e23792-8162-11f0-8a7b-dee062287042",
9
- onmessage
7
+ onmessage: e
10
8
  }, {
11
9
  headers: {
12
10
  authorization: "application-8259214f7c6f2777658809d71bdfada3"
13
11
  },
14
- data
12
+ data: t
15
13
  });
16
14
  }
17
-
18
- var Role = /* @__PURE__ */ ((Role2) => {
19
- Role2["User"] = "user";
20
- Role2["Assistant"] = "assistant";
21
- Role2["Broadcasting"] = "broadcasting";
22
- return Role2;
23
- })(Role || {});
24
- const roleOptions = [
15
+ var d = /* @__PURE__ */ ((e) => (e.User = "user", e.Assistant = "assistant", e.Broadcasting = "broadcasting", e))(d || {});
16
+ const O = [
25
17
  {
26
- label: "\u7528\u6237",
27
- value: "user" /* User */,
28
- isMarkdown: false,
18
+ label: "用户",
19
+ value: "user",
20
+ isMarkdown: !1,
29
21
  placement: "end",
30
22
  templateType: "VkMarkdown"
31
23
  },
32
24
  {
33
- label: "AI \u52A9\u624B",
34
- value: "assistant" /* Assistant */,
35
- isMarkdown: true,
25
+ label: "AI 助手",
26
+ value: "assistant",
27
+ isMarkdown: !0,
36
28
  placement: "start",
37
- typing: true,
29
+ typing: !0,
38
30
  templateType: "VkMarkdown"
39
31
  }
40
- ];
41
- const roleMap = roleOptions.reduce((acc, cur) => {
42
- acc[cur.value] = cur;
43
- return acc;
44
- }, {});
45
-
46
- const ChatAgentInjectKey = "vk_agent_chat_inject_key";
47
-
48
- function useAgent(request) {
49
- return useXAgent({
50
- request
32
+ ], F = O.reduce((e, t) => (e[t.value] = t, e), {}), V = "vk_agent_chat_inject_key";
33
+ function E(e) {
34
+ return x({
35
+ // @ts-expect-error ant-design-x-vue generic type mismatch
36
+ request: e
51
37
  });
52
38
  }
53
- function initAgentChat(request, parser, formatSend) {
54
- const [agent] = useAgent(request);
55
- const chat = useXChat({
56
- agent: agent.value,
39
+ function T(e, t, s) {
40
+ const [n] = E(e), o = P({
41
+ // @ts-expect-error ant-design-x-vue generic type mismatch
42
+ agent: n.value,
57
43
  // Convert AgentMessage to BubbleMessage
58
- parser
59
- });
60
- const onRequest = (message) => {
61
- const userMessage = formatSend(message);
62
- chat.onRequest(userMessage);
63
- };
64
- const items = computed(() => {
65
- return chat.parsedMessages.value.map((item) => {
66
- return {
67
- key: item.id,
68
- ...roleMap[item.message.role],
69
- ...item.message
70
- };
71
- });
72
- });
73
- const simplicity = {
74
- onRequest,
75
- items
76
- };
77
- const ctx = {
78
- agent,
79
- chat,
80
- simplicity
44
+ parser: t
45
+ }), p = (r) => {
46
+ const f = s(r);
47
+ o.onRequest(f);
48
+ }, g = b(() => o.parsedMessages.value.map((r) => ({
49
+ key: r.id,
50
+ ...F[r.message.role],
51
+ ...r.message
52
+ }))), c = {
53
+ agent: n,
54
+ chat: o,
55
+ simplicity: {
56
+ onRequest: p,
57
+ items: g
58
+ }
81
59
  };
82
- provide(ChatAgentInjectKey, ctx);
83
- return ctx;
60
+ return S(V, c), c;
84
61
  }
85
- function useAgentChat() {
86
- const ctx = inject(ChatAgentInjectKey, null);
87
- if (!ctx) {
62
+ function B() {
63
+ const e = U(V, null);
64
+ if (!e)
88
65
  throw new Error("useAgentChat must be used within a provider");
89
- }
90
- return ctx;
66
+ return e;
91
67
  }
92
-
93
- var _sfc_main = defineComponent({
68
+ const w = j({
94
69
  name: "VkAgentChatProvider",
95
70
  props: {
96
71
  request: {
@@ -106,153 +81,104 @@ var _sfc_main = defineComponent({
106
81
  emits: {
107
82
  load: null
108
83
  },
109
- setup(props, { slots, emit }) {
110
- const request = (info, event) => {
111
- const { message } = info;
112
- const { onSuccess, onUpdate } = event;
113
- const chunks = [];
114
- if (!message?.content) {
84
+ setup(e, { slots: t, emit: s }) {
85
+ const n = (a, c) => {
86
+ const { message: r } = a, { onSuccess: f, onUpdate: A } = c, y = [];
87
+ if (!r?.content)
115
88
  return;
116
- }
117
- let content = "";
118
- const role = Role.Assistant;
119
- let thinkingContent = "";
120
- let thinkingStatus = "start";
121
- let seviceLoading = true;
122
- let seviceEnd = false;
123
- const update = () => {
124
- const data = {
125
- role,
126
- content,
127
- thinkingContent,
128
- thinkingStatus,
129
- seviceLoading,
130
- seviceEnd
89
+ let _ = "";
90
+ const C = d.Assistant;
91
+ let h = "", m = "start", v = !0, k = !1;
92
+ const u = () => {
93
+ const l = {
94
+ role: C,
95
+ content: _,
96
+ thinkingContent: h,
97
+ thinkingStatus: m,
98
+ seviceLoading: v,
99
+ seviceEnd: k
131
100
  };
132
- onUpdate(data);
133
- chunks.push(data);
101
+ A(l), y.push(l);
102
+ }, M = () => {
103
+ f(y);
134
104
  };
135
- const success = () => {
136
- onSuccess(chunks);
137
- };
138
- update();
139
- agentRequest((e) => {
140
- let json = {
105
+ u(), L((l) => {
106
+ let i = {
141
107
  content: "",
142
108
  reasoning_content: ""
143
109
  };
144
- if (typeof e.data === "string") {
145
- json = JSON.parse(e.data);
146
- }
147
- if (json.reasoning_content) {
148
- thinkingContent += json.reasoning_content;
149
- thinkingStatus = "thinking";
150
- seviceLoading = false;
151
- update();
152
- }
153
- if (json.content) {
154
- content += json.content;
155
- seviceLoading = false;
156
- update();
157
- }
158
- if (thinkingContent && json.content) {
159
- thinkingStatus = "end";
160
- update();
161
- }
162
- if (json.is_end) {
163
- seviceEnd = true;
164
- update();
165
- success();
166
- }
167
- }, { message: message?.content });
168
- };
169
- const parser = (message) => {
170
- const list = [
171
- {
172
- ...message,
173
- role: message.role ?? Role.User,
174
- content: message.content ?? "",
175
- loading: message.seviceLoading
176
- }
177
- ];
178
- return list;
179
- };
180
- const formatSend = (message) => {
181
- return {
182
- role: Role.User,
183
- content: message
184
- };
185
- };
186
- const agentChat = initAgentChat(
187
- props.request ?? request,
188
- props.parser ?? parser,
189
- props.formatSend ?? formatSend
110
+ typeof l.data == "string" && (i = JSON.parse(l.data)), i.reasoning_content && (h += i.reasoning_content, m = "thinking", v = !1, u()), i.content && (_ += i.content, v = !1, u()), h && i.content && (m = "end", u()), i.is_end && (k = !0, u(), M());
111
+ }, { message: r?.content });
112
+ }, o = (a) => [
113
+ {
114
+ ...a,
115
+ role: a.role ?? d.User,
116
+ content: a.content ?? "",
117
+ loading: a.seviceLoading
118
+ }
119
+ ], p = (a) => ({
120
+ role: d.User,
121
+ content: a
122
+ }), g = T(
123
+ e.request ?? n,
124
+ e.parser ?? o,
125
+ e.formatSend ?? p
190
126
  );
191
- emit("load", agentChat);
192
- return slots.default;
127
+ return s("load", g), t.default;
193
128
  }
194
129
  });
195
-
196
- var VkAgentChatProvider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/agent-chat-provider/src/index.vue"]]);
197
-
198
- class MessageViewManager {
199
- constructor() {
200
- this.views = [];
201
- }
130
+ class J {
131
+ views = [];
202
132
  getViews() {
203
133
  return this.views;
204
134
  }
205
- createView(view) {
206
- this.views.push(view);
135
+ createView(t) {
136
+ this.views.push(t);
207
137
  }
208
138
  /**
209
139
  * @description 创建或更新最后一个 view
210
140
  */
211
- upsertView(data, callbacks = {}) {
212
- let lastView = this.getLastUpdatingView(data.type);
213
- if (lastView) {
214
- lastView.content += data.content;
215
- lastView.updating = data.updating;
216
- callbacks.onUpdate?.(lastView);
217
- } else {
218
- lastView = data;
219
- this.createView(lastView);
220
- callbacks.onCreate?.(lastView);
221
- }
222
- return lastView;
141
+ upsertView(t, s = {}) {
142
+ let n = this.getLastUpdatingView(t.type);
143
+ return n ? (n.content += t.content, n.updating = t.updating, s.onUpdate?.(n)) : (n = t, this.createView(n), s.onCreate?.(n)), n;
223
144
  }
224
145
  /**
225
146
  * @description 获取当前view 的上一个 view
226
147
  */
227
- getPrevView(view) {
228
- const index = this.views.indexOf(view);
229
- if (index > 0) {
230
- return this.views[index - 1];
231
- }
232
- return void 0;
148
+ getPrevView(t) {
149
+ const s = this.views.indexOf(t);
150
+ if (s > 0)
151
+ return this.views[s - 1];
233
152
  }
234
153
  /**
235
154
  * @description 获取最后一个正在更新的 view
236
155
  */
237
- getLastUpdatingView(type) {
238
- return this.views.findLast((v) => v.updating && v.type === type);
156
+ getLastUpdatingView(t) {
157
+ return this.views.findLast((s) => s.updating && s.type === t);
239
158
  }
240
159
  /**
241
160
  * @description 所有 view 更新结束
242
161
  */
243
162
  allViewUpdated() {
244
- this.views.forEach((v) => {
245
- v.updating = false;
163
+ this.views.forEach((t) => {
164
+ t.updating = !1;
246
165
  });
247
166
  }
248
167
  }
249
-
250
- var types = /*#__PURE__*/Object.freeze({
168
+ const K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
251
169
  __proto__: null
252
- });
253
-
254
- VkAgentChatProvider.install = (app) => {
255
- app.component(VkAgentChatProvider.name || "VkAgentChatProvider", VkAgentChatProvider);
170
+ }, Symbol.toStringTag, { value: "Module" }));
171
+ w.install = (e) => {
172
+ e.component(w.name || "VkAgentChatProvider", w);
173
+ };
174
+ export {
175
+ V as ChatAgentInjectKey,
176
+ J as MessageViewManager,
177
+ d as Role,
178
+ w as VkAgentChatProvider,
179
+ K as __VkAgentChatProvider,
180
+ w as default,
181
+ F as roleMap,
182
+ O as roleOptions,
183
+ B as useAgentChat
256
184
  };
257
-
258
- export { ChatAgentInjectKey, MessageViewManager, Role, VkAgentChatProvider, types as __VkAgentChatProvider, VkAgentChatProvider as default, roleMap, roleOptions, useAgentChat };
@@ -1,6 +1,8 @@
1
1
  import type { AnyFunc } from '@vunk/shared';
2
2
  import type { PropType } from 'vue';
3
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
6
  request: {
5
7
  type: PropType<AnyFunc>;
6
8
  };
@@ -25,4 +27,3 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
25
27
  }>> & Readonly<{
26
28
  onLoad?: ((...args: any[]) => any) | undefined;
27
29
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
28
- export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("element-plus"),e=require("vue"),a=require("../_plugin-vue_export-helper-BHFhmbuH.js"),l={background:{default:"transparent"},color:{default:"currentColor"}},s={},c=e.defineComponent({name:"VkAvatar",components:{ElAvatar:n.ElAvatar},props:l,emits:s});function u(t,d,i,_,v,f){const r=e.resolveComponent("ElAvatar");return e.openBlock(),e.createBlock(r,{style:e.normalizeStyle({background:t.background,color:t.color})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["style"])}const o=a._export_sfc(c,[["render",u]]),p=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));o.install=t=>{t.component(o.name||"VkAvatar",o)};exports.VkAvatar=o;exports.__VkAvatar=p;exports.default=o;
@@ -1,49 +1,43 @@
1
- import { ElAvatar } from 'element-plus';
2
- import { defineComponent, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, renderSlot } from 'vue';
3
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
4
-
5
- const props = {
1
+ import { ElAvatar as r } from "element-plus";
2
+ import { defineComponent as n, resolveComponent as a, createBlock as l, openBlock as s, normalizeStyle as c, withCtx as p, renderSlot as m } from "vue";
3
+ import { _ as d } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
4
+ const f = {
6
5
  background: {
7
6
  default: "transparent"
8
7
  },
9
8
  color: {
10
9
  default: "currentColor"
11
10
  }
12
- };
13
- const emits = {};
14
-
15
- var _sfc_main = defineComponent({
11
+ }, u = {}, _ = n({
16
12
  name: "VkAvatar",
17
13
  components: {
18
- ElAvatar
14
+ ElAvatar: r
19
15
  },
20
- props,
21
- emits
16
+ props: f,
17
+ emits: u
22
18
  });
23
-
24
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
25
- const _component_ElAvatar = resolveComponent("ElAvatar");
26
- return openBlock(), createBlock(_component_ElAvatar, {
27
- style: normalizeStyle({
28
- background: _ctx.background,
29
- color: _ctx.color
19
+ function i(o, k, v, A, b, y) {
20
+ const e = a("ElAvatar");
21
+ return s(), l(e, {
22
+ style: c({
23
+ background: o.background,
24
+ color: o.color
30
25
  })
31
26
  }, {
32
- default: withCtx(() => [
33
- renderSlot(_ctx.$slots, "default")
27
+ default: p(() => [
28
+ m(o.$slots, "default")
34
29
  ]),
35
30
  _: 3
36
- /* FORWARDED */
37
31
  }, 8, ["style"]);
38
32
  }
39
- var VkAvatar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/avatar/src/index.vue"]]);
40
-
41
- var types = /*#__PURE__*/Object.freeze({
33
+ const t = /* @__PURE__ */ d(_, [["render", i]]), S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42
34
  __proto__: null
43
- });
44
-
45
- VkAvatar.install = (app) => {
46
- app.component(VkAvatar.name || "VkAvatar", VkAvatar);
35
+ }, Symbol.toStringTag, { value: "Module" }));
36
+ t.install = (o) => {
37
+ o.component(t.name || "VkAvatar", t);
38
+ };
39
+ export {
40
+ t as VkAvatar,
41
+ S as __VkAvatar,
42
+ t as default
47
43
  };
48
-
49
- export { VkAvatar, types as __VkAvatar, VkAvatar as default };