@vunk/plus 1.3.13 → 1.4.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.
Files changed (114) hide show
  1. package/components/WebGLRenderer.mjs +1 -1
  2. package/components/WebGPURenderer.mjs +1 -1
  3. package/components/agent-chat-provider/index.mjs +1 -5
  4. package/components/broadcasting-markdown/index.mjs +574 -1
  5. package/components/browserAll.mjs +1 -1
  6. package/components/index2.mjs +71 -20
  7. package/components/pixi-frame/index.mjs +2 -2
  8. package/components/sender/index.mjs +1 -1
  9. package/components/webworkerAll.mjs +1 -1
  10. package/package.json +1 -1
  11. package/components/agent-chat-provider/index.d.ts +0 -7
  12. package/components/agent-chat-provider/src/api.d.ts +0 -3
  13. package/components/agent-chat-provider/src/const-roles.d.ts +0 -8
  14. package/components/agent-chat-provider/src/const.d.ts +0 -1
  15. package/components/agent-chat-provider/src/index.vue.d.ts +0 -47
  16. package/components/agent-chat-provider/src/types.d.ts +0 -43
  17. package/components/agent-chat-provider/src/use.d.ts +0 -29
  18. package/components/avatar/index.d.ts +0 -4
  19. package/components/avatar/src/ctx.d.ts +0 -18
  20. package/components/avatar/src/index.vue.d.ts +0 -121
  21. package/components/avatar/src/types.d.ts +0 -1
  22. package/components/broadcasting-markdown/index.d.ts +0 -7
  23. package/components/broadcasting-markdown/src/const.d.ts +0 -13
  24. package/components/broadcasting-markdown/src/ctx.d.ts +0 -115
  25. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +0 -97
  26. package/components/broadcasting-markdown/src/index.vue.d.ts +0 -383
  27. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +0 -79
  28. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +0 -60
  29. package/components/broadcasting-markdown/src/types.d.ts +0 -25
  30. package/components/broadcasting-markdown/src/use.d.ts +0 -21
  31. package/components/browser.mjs +0 -575
  32. package/components/bubble-list/index.d.ts +0 -5
  33. package/components/bubble-list/src/ctx.d.ts +0 -30
  34. package/components/bubble-list/src/index.vue.d.ts +0 -867
  35. package/components/bubble-list/src/types.d.ts +0 -4
  36. package/components/bubble-templates/index.d.ts +0 -4
  37. package/components/bubble-templates/src/index.vue.d.ts +0 -539
  38. package/components/bubble-templates/src/types.d.ts +0 -40
  39. package/components/chat-independent/index.d.ts +0 -4
  40. package/components/chat-independent/src/const.d.ts +0 -13
  41. package/components/chat-independent/src/ctx.d.ts +0 -20
  42. package/components/chat-independent/src/index.vue.d.ts +0 -2343
  43. package/components/chat-independent/src/types.d.ts +0 -13
  44. package/components/index.d.ts +0 -0
  45. package/components/lottie-animation/index.d.ts +0 -4
  46. package/components/lottie-animation/src/ctx.d.ts +0 -10
  47. package/components/lottie-animation/src/index.vue.d.ts +0 -21
  48. package/components/lottie-animation/src/types.d.ts +0 -4
  49. package/components/monaco-editor/index.d.ts +0 -5
  50. package/components/monaco-editor/src/ctx.d.ts +0 -23
  51. package/components/monaco-editor/src/index.vue.d.ts +0 -40
  52. package/components/monaco-editor/src/types.d.ts +0 -1
  53. package/components/monaco-environment/index.d.ts +0 -4
  54. package/components/monaco-environment/src/ctx.d.ts +0 -8
  55. package/components/monaco-environment/src/index.vue.d.ts +0 -2
  56. package/components/monaco-environment/src/types.d.ts +0 -1
  57. package/components/pixi-frame/index.d.ts +0 -8
  58. package/components/pixi-frame/src/core.vue.d.ts +0 -122
  59. package/components/pixi-frame/src/ctx.d.ts +0 -40
  60. package/components/pixi-frame/src/index.vue.d.ts +0 -215
  61. package/components/pixi-frame/src/provider.vue.d.ts +0 -2
  62. package/components/pixi-frame/src/types.d.ts +0 -1
  63. package/components/pixi-frame/src/use.d.ts +0 -3
  64. package/components/pixi-frame/src/view.vue.d.ts +0 -25
  65. package/components/recorder-button/index.d.ts +0 -4
  66. package/components/recorder-button/src/ctx.d.ts +0 -41
  67. package/components/recorder-button/src/index.vue.d.ts +0 -300
  68. package/components/recorder-button/src/speech-to-text.d.ts +0 -1
  69. package/components/recorder-button/src/types.d.ts +0 -7
  70. package/components/routes-menu-content/index.d.ts +0 -4
  71. package/components/routes-menu-content/src/ctx.d.ts +0 -17
  72. package/components/routes-menu-content/src/index.vue.d.ts +0 -472
  73. package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
  74. package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -307
  75. package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
  76. package/components/routes-menu-content/src/item/index.vue.d.ts +0 -438
  77. package/components/routes-menu-content/src/types.d.ts +0 -1
  78. package/components/sender/index.d.ts +0 -4
  79. package/components/sender/src/SenderHeader.vue.d.ts +0 -256
  80. package/components/sender/src/ctx.d.ts +0 -62
  81. package/components/sender/src/index.vue.d.ts +0 -787
  82. package/components/sender/src/types.d.ts +0 -1
  83. package/components/speech-button/index.d.ts +0 -4
  84. package/components/speech-button/src/LoadingIcon.vue.d.ts +0 -2
  85. package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
  86. package/components/speech-button/src/ctx.d.ts +0 -10
  87. package/components/speech-button/src/index.vue.d.ts +0 -22
  88. package/components/speech-button/src/types.d.ts +0 -1
  89. package/components/table-columns/index.d.ts +0 -5
  90. package/components/table-columns/src/ctx.d.ts +0 -66
  91. package/components/table-columns/src/el-ctx.d.ts +0 -63
  92. package/components/table-columns/src/index.vue.d.ts +0 -282
  93. package/components/table-columns/src/types.d.ts +0 -21
  94. package/components/tables-v1/index.d.ts +0 -5
  95. package/components/tables-v1/src/ctx.d.ts +0 -281
  96. package/components/tables-v1/src/el-ctx.d.ts +0 -269
  97. package/components/tables-v1/src/index.vue.d.ts +0 -3014
  98. package/components/tables-v1/src/types.d.ts +0 -4
  99. package/components/tables-v1-checkbox/index.d.ts +0 -5
  100. package/components/tables-v1-checkbox/src/ctx.d.ts +0 -321
  101. package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3796
  102. package/components/tables-v1-checkbox/src/types.d.ts +0 -1
  103. package/components/typing-markdown/index.d.ts +0 -4
  104. package/components/typing-markdown/src/core.d.ts +0 -2
  105. package/components/typing-markdown/src/ctx.d.ts +0 -33
  106. package/components/typing-markdown/src/index.vue.d.ts +0 -57
  107. package/components/typing-markdown/src/types.d.ts +0 -1
  108. package/components/vditor/index.d.ts +0 -5
  109. package/components/vditor/src/ctx.d.ts +0 -37
  110. package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
  111. package/components/vditor/src/handle-value.vue.d.ts +0 -18
  112. package/components/vditor/src/index.vue.d.ts +0 -144
  113. package/components/vditor/src/types.d.ts +0 -9
  114. package/components/vditor/src/use.d.ts +0 -4
@@ -1,6 +1,6 @@
1
- import { inject, provide, defineComponent, watchEffect, ref, onBeforeUnmount, renderSlot, onMounted, createElementBlock, openBlock, resolveComponent, createBlock, withCtx, createVNode, mergeProps } from 'vue';
1
+ import { inject, provide, defineComponent, useId, watchEffect, ref, onBeforeUnmount, renderSlot, onMounted, createElementBlock, openBlock, resolveComponent, createBlock, withCtx, createVNode, mergeProps } from 'vue';
2
2
  import { TickerStatus } from '@vunk/shared/enum';
3
- import { c as consola } from './browser.mjs';
3
+ import { Deferred, sleep } from '@vunk/shared/promise';
4
4
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers.mjs';
5
5
  import { _ as _export_sfc } from './_plugin-vue_export-helper.mjs';
6
6
 
@@ -21007,6 +21007,9 @@ const props = {
21007
21007
  type: Boolean,
21008
21008
  default: false
21009
21009
  },
21010
+ /**
21011
+ * @description v-model:status 控制动画状态
21012
+ */
21010
21013
  status: {
21011
21014
  type: String,
21012
21015
  default: TickerStatus.pending
@@ -21018,21 +21021,30 @@ const props = {
21018
21021
  };
21019
21022
  const emits = {
21020
21023
  "update:status": null,
21021
- "update:data": null
21024
+ "update:data": null,
21025
+ "setData": null
21022
21026
  };
21023
21027
 
21024
21028
  const appInjectKey = Symbol("appInjectKey");
21025
21029
  function initPixiApp() {
21026
- const app = new Application();
21027
- provide(appInjectKey, app);
21028
- return app;
21030
+ const application = new Application();
21031
+ const whenDef = new Deferred();
21032
+ const context = {
21033
+ whenDef,
21034
+ when: () => whenDef.promise
21035
+ };
21036
+ provide(appInjectKey, {
21037
+ application,
21038
+ context
21039
+ });
21040
+ return { application, context };
21029
21041
  }
21030
21042
  function usePixiApp() {
21031
- const app = inject(appInjectKey);
21032
- if (!app) {
21043
+ const core = inject(appInjectKey);
21044
+ if (!core) {
21033
21045
  throw new Error("Pixi app not provided");
21034
21046
  }
21035
- return app;
21047
+ return core;
21036
21048
  }
21037
21049
 
21038
21050
  var _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -21042,10 +21054,25 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
21042
21054
  setup(__props, { emit: __emit }) {
21043
21055
  const props = __props;
21044
21056
  const emit = __emit;
21045
- const app = usePixiApp();
21057
+ const { application: app, context } = usePixiApp();
21058
+ const compId = useId();
21059
+ const getAlias = (key) => `${compId}-${key}`;
21046
21060
  const sprite = new Sprite();
21047
21061
  app.stage.addChild(sprite);
21062
+ context.when().then((app2) => {
21063
+ if (sprite.texture) {
21064
+ resizeSprite();
21065
+ app2.renderer.on(
21066
+ "resize",
21067
+ () => {
21068
+ resizeSprite();
21069
+ }
21070
+ );
21071
+ }
21072
+ });
21048
21073
  function resizeSprite() {
21074
+ if (!app.renderer?.screen)
21075
+ return;
21049
21076
  const scaleX = app.screen.width / sprite.texture.width;
21050
21077
  const scaleY = app.screen.height / sprite.texture.height;
21051
21078
  const scale = Math.min(scaleX, scaleY);
@@ -21056,12 +21083,18 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
21056
21083
  const textureMap = /* @__PURE__ */ new Map();
21057
21084
  watchEffect(() => {
21058
21085
  for (const key in props.data) {
21086
+ const alias = `${compId}-${key}`;
21059
21087
  const url = props.data[key];
21060
- if (textureMap.has(url)) {
21088
+ if (textureMap.has(alias)) {
21061
21089
  continue;
21062
21090
  }
21063
- Assets.load(url).then((res) => {
21064
- textureMap.set(url, res);
21091
+ Assets.add({
21092
+ alias,
21093
+ src: url
21094
+ });
21095
+ textureMap.set(alias, void 0);
21096
+ Assets.load(alias).then((res) => {
21097
+ textureMap.set(alias, res);
21065
21098
  if (key === "0") {
21066
21099
  sprite.texture = res;
21067
21100
  resizeSprite();
@@ -21078,14 +21111,32 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
21078
21111
  if (props.data.length === 0 || props.status !== TickerStatus.playing) {
21079
21112
  return;
21080
21113
  }
21081
- const currentTexture = textureMap.get(props.data[index.value]);
21082
- consola.info("Frame Index", index.value, currentTexture);
21114
+ const currentTexture = textureMap.get(
21115
+ getAlias(index.value)
21116
+ );
21083
21117
  if (currentTexture) {
21118
+ const originTexture = sprite.texture;
21119
+ const originIndex = index.value - 1;
21120
+ if (originTexture && originIndex >= 0 && !props.loop) {
21121
+ Promise.resolve(sleep(500)).then(() => Assets.unload(
21122
+ getAlias(originIndex)
21123
+ )).then(() => {
21124
+ textureMap.set(
21125
+ getAlias(originIndex),
21126
+ void 0
21127
+ );
21128
+ emit("setData", {
21129
+ k: originIndex,
21130
+ v: ""
21131
+ });
21132
+ });
21133
+ }
21084
21134
  sprite.texture = currentTexture;
21085
21135
  resizeSprite();
21086
- index.value = index.value + 1;
21136
+ index.value = props.loop ? (index.value + 1) % props.data.length : index.value + 1;
21087
21137
  } else {
21088
- emit("update:status", TickerStatus.paused);
21138
+ if (!props.loop)
21139
+ emit("update:status", TickerStatus.paused);
21089
21140
  }
21090
21141
  }, 1e3 / props.frameRate);
21091
21142
  }
@@ -21149,14 +21200,14 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
21149
21200
  },
21150
21201
  setup(__props) {
21151
21202
  const props = __props;
21152
- const app = usePixiApp();
21203
+ const { application: app, context } = usePixiApp();
21153
21204
  const appRef = ref();
21154
21205
  onMounted(async () => {
21155
21206
  await app.init({
21156
21207
  resizeTo: appRef.value,
21157
- background: "#1099bb",
21158
21208
  ...props.defaultOptions
21159
21209
  });
21210
+ context.whenDef.resolve(app);
21160
21211
  appRef.value.appendChild(app.canvas);
21161
21212
  });
21162
21213
  return (_ctx, _cache) => {
@@ -21217,4 +21268,4 @@ VkPixiFrame.install = (app) => {
21217
21268
  app.component(VkPixiFrame.name || "VkPixiFrame", VkPixiFrame);
21218
21269
  };
21219
21270
 
21220
- export { VERSION as $, AbstractRenderer as A, BufferUsage as B, Container as C, DOMAdapter as D, ExtensionType as E, Bounds as F, GpuProgram as G, TexturePool as H, FilterEffect as I, Sprite as J, getAttributeInfoFromFormat as K, unsafeEvalSupported as L, Matrix as M, uid as N, Rectangle as O, Point as P, SystemRunner as Q, RendererType as R, STENCIL_MODES as S, Ticker as T, UPDATE_PRIORITY as U, multiplyColors as V, UPDATE_VISIBLE as W, UPDATE_COLOR as X, UPDATE_BLEND as Y, Color as Z, getLocalBounds as _, EventEmitter as a, deprecation as a0, v8_0_0 as a1, RendererInitHook as a2, Geometry as a3, compileHighShaderGlProgram as a4, colorBitGl as a5, generateTextureBatchBitGl as a6, roundPixelsBitGl as a7, getBatchSamplersUniformGroup as a8, ViewContainer as a9, GraphicsContext as aa, TextStyle as ab, generateTextStyleKey as ac, BatchableGraphics as ad, getAdjustedBlendModeBlend as ae, ViewableBuffer as af, TextureStyle as ag, BitmapFontManager as ah, getBitmapTextLayout as ai, Cache as aj, updateQuadBounds as ak, CanvasTextMetrics as al, nextPow2 as am, fontStringFromTextStyle as an, getCanvasFillStyle as ao, GraphicsContextSystem as ap, _sfc_main$3 as aq, _sfc_main$2 as ar, _sfc_main$1 as as, VkPixiFrame as at, types as au, Buffer as b, BindGroup as c, createIdFromString as d, extensions as e, fastCopy as f, getTextureBatchBindGroup as g, CLEAR as h, CanvasSource as i, TextureSource as j, UniformGroup as k, CanvasPool as l, compileHighShaderGpuProgram as m, colorBit as n, generateTextureBatchBit as o, roundPixelsBit as p, getMaxTexturesPerBatch as q, removeItems as r, Shader as s, Texture as t, GlProgram as u, TextureMatrix as v, warn as w, DefaultBatcher as x, BigPool as y, getGlobalBounds as z };
21271
+ export { VERSION as $, AbstractRenderer as A, BufferUsage as B, Container as C, DOMAdapter as D, ExtensionType as E, Bounds as F, GpuProgram as G, TexturePool as H, FilterEffect as I, Sprite as J, getAttributeInfoFromFormat as K, unsafeEvalSupported as L, Matrix as M, uid as N, Rectangle as O, Point as P, SystemRunner as Q, RendererType as R, STENCIL_MODES as S, Ticker as T, UPDATE_PRIORITY as U, multiplyColors as V, UPDATE_VISIBLE as W, UPDATE_COLOR as X, UPDATE_BLEND as Y, Color as Z, getLocalBounds as _, EventEmitter as a, deprecation as a0, v8_0_0 as a1, RendererInitHook as a2, Geometry as a3, compileHighShaderGlProgram as a4, colorBitGl as a5, generateTextureBatchBitGl as a6, roundPixelsBitGl as a7, getBatchSamplersUniformGroup as a8, ViewContainer as a9, GraphicsContext as aa, TextStyle as ab, generateTextStyleKey as ac, BatchableGraphics as ad, getAdjustedBlendModeBlend as ae, ViewableBuffer as af, TextureStyle as ag, BitmapFontManager as ah, getBitmapTextLayout as ai, Cache as aj, updateQuadBounds as ak, CanvasTextMetrics as al, nextPow2 as am, fontStringFromTextStyle as an, getCanvasFillStyle as ao, GraphicsContextSystem as ap, VkPixiFrame as aq, _sfc_main$3 as ar, _sfc_main$2 as as, _sfc_main$1 as at, types as au, Buffer as b, BindGroup as c, createIdFromString as d, extensions as e, fastCopy as f, getTextureBatchBindGroup as g, CLEAR as h, CanvasSource as i, TextureSource as j, UniformGroup as k, CanvasPool as l, compileHighShaderGpuProgram as m, colorBit as n, generateTextureBatchBit as o, roundPixelsBit as p, getMaxTexturesPerBatch as q, removeItems as r, Shader as s, Texture as t, GlProgram as u, TextureMatrix as v, warn as w, DefaultBatcher as x, BigPool as y, getGlobalBounds as z };
@@ -1,6 +1,6 @@
1
- export { aq as VkPixiFrameCore, ar as VkPixiFrameProvider, as as VkPixiFrameView, au as __VkPixiFrame, at as default } from '../index2.mjs';
1
+ export { aq as VkPixiFrame, ar as VkPixiFrameCore, as as VkPixiFrameProvider, at as VkPixiFrameView, au as __VkPixiFrame, aq as default } from '../index2.mjs';
2
2
  export { TickerStatus } from '@vunk/shared/enum';
3
3
  import 'vue';
4
- import '../browser.mjs';
4
+ import '@vunk/shared/promise';
5
5
  import '../_commonjsHelpers.mjs';
6
6
  import '../_plugin-vue_export-helper.mjs';
@@ -37,7 +37,7 @@ const props = {
37
37
  default: void 0
38
38
  },
39
39
  /**
40
- * @description 模块
40
+ * @description 可选模块, 包含: Attachments 文件上传;
41
41
  */
42
42
  modules: {
43
43
  type: Array,
@@ -3,6 +3,6 @@ import './index2.mjs';
3
3
  import './colorToUniform.mjs';
4
4
  import 'vue';
5
5
  import '@vunk/shared/enum';
6
- import './browser.mjs';
6
+ import '@vunk/shared/promise';
7
7
  import './_commonjsHelpers.mjs';
8
8
  import './_plugin-vue_export-helper.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/plus",
3
- "version": "1.3.13",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -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,3 +0,0 @@
1
- import type { NormalObject } from '@vunk/shared';
2
- import type { RestFetchReaderOnmessage } from '@vunk/shared/fetch';
3
- export declare function agentRequest(onmessage: RestFetchReaderOnmessage, data: NormalObject): Promise<void>;
@@ -1,8 +0,0 @@
1
- import type { RoleMedia } from './types';
2
- export declare enum Role {
3
- User = "user",
4
- Assistant = "assistant",
5
- Broadcasting = "broadcasting"
6
- }
7
- export declare const roleOptions: RoleMedia[];
8
- export declare const roleMap: Record<Role, RoleMedia>;
@@ -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 { BubbleListItemProps } from 'vue-element-plus-x/types/components/BubbleList/types';
5
- import type { initAgentChat } from './use';
6
- export type AgentChatContext = ReturnType<typeof initAgentChat>;
7
- export type Request = RequestFn<AgentMessage>;
8
- export type Parser = (message: AgentMessage) => BubbleMessage | BubbleMessage[];
9
- /**
10
- * @description useXAgent request onSuccess 发送的数据
11
- */
12
- export type AgentMessage = BubbleMessage & {
13
- seviceLoading?: boolean;
14
- seviceEnd?: boolean;
15
- };
16
- /**
17
- * @description useXChat parser 解析数据
18
- */
19
- export type BubbleMessage = Partial<BubbleListItemProps> & {
20
- role: string;
21
- content: string;
22
- /**
23
- * @description 服务端请求是否完成
24
- */
25
- seviceEnd?: boolean;
26
- thinkingStatus?: 'start' | 'thinking' | 'end' | 'error';
27
- thinkingContent?: string;
28
- meta?: NormalObject;
29
- abortController?: AbortController;
30
- templateType?: string;
31
- [key: string]: any;
32
- };
33
- export type BubbleItem = BubbleItemBasic & __VkBubbleTemplates.RenderItem;
34
- export type RoleMedia = RoleMediaBasic & __VkBubbleTemplates.RenderItem;
35
- export type BubbleItemModule = 'Thinking';
36
- interface BubbleItemBasic extends BubbleMessage {
37
- key: string;
38
- modules?: BubbleItemModule[];
39
- }
40
- export interface RoleMediaBasic extends Partial<BubbleItemBasic>, Media {
41
- value: string;
42
- }
43
- export {};
@@ -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,4 +0,0 @@
1
- import VkAvatar from './src/index.vue';
2
- export * as __VkAvatar from './src/types';
3
- export { VkAvatar, };
4
- export default VkAvatar;
@@ -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;