@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";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("lottie-web"),l=require("../_plugin-vue_export-helper-BHFhmbuH.js"),s={path:{type:String,default:""}},u={load:t=>t},c=e.defineComponent({name:"VkLottieAnimation",props:s,emits:u,setup(t,{emit:r}){const n=e.ref();return e.onMounted(()=>{const i=a.loadAnimation({container:n.value,renderer:"svg",loop:!0,autoplay:!0,path:t.path});i.addEventListener("complete",()=>{r("load",{animation:i})})}),{lottieNode:n}}}),d={ref:"lottieNode",class:"vk-lottie-animation"};function p(t,r,n,i,_,f){return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",d,null,512),e.renderSlot(t.$slots,"default")],64)}const o=l._export_sfc(c,[["render",p]]),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));o.install=t=>{t.component(o.name||"VkLottieAnimation",o)};exports.VkLottieAnimation=o;exports.__VkLottieAnimation=m;exports.default=o;
@@ -1,71 +1,52 @@
1
- import { defineComponent, ref, onMounted, openBlock, createElementBlock, Fragment, createElementVNode, renderSlot } from 'vue';
2
- import lottie from 'lottie-web';
3
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
4
-
5
- const props = {
1
+ import { defineComponent as i, ref as r, onMounted as l, createElementBlock as s, openBlock as p, Fragment as c, createElementVNode as m, renderSlot as d } from "vue";
2
+ import u from "lottie-web";
3
+ import { _ } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
4
+ const f = {
6
5
  path: {
7
6
  type: String,
8
7
  default: ""
9
8
  }
10
- };
11
- const emits = {
12
- load: (e) => e
13
- };
14
-
15
- var _sfc_main = defineComponent({
9
+ }, k = {
10
+ load: (t) => t
11
+ }, v = i({
16
12
  name: "VkLottieAnimation",
17
- props,
18
- emits,
19
- setup(props2, { emit }) {
20
- const lottieNode = ref();
21
- onMounted(() => {
22
- const animation = lottie.loadAnimation({
23
- container: lottieNode.value,
13
+ props: f,
14
+ emits: k,
15
+ setup(t, { emit: a }) {
16
+ const e = r();
17
+ return l(() => {
18
+ const o = u.loadAnimation({
19
+ container: e.value,
24
20
  renderer: "svg",
25
- loop: true,
26
- autoplay: true,
27
- path: props2.path
21
+ loop: !0,
22
+ autoplay: !0,
23
+ path: t.path
28
24
  });
29
- animation.addEventListener("complete", () => {
30
- emit("load", { animation });
25
+ o.addEventListener("complete", () => {
26
+ a("load", { animation: o });
31
27
  });
32
- });
33
- return {
34
- lottieNode
28
+ }), {
29
+ lottieNode: e
35
30
  };
36
31
  }
37
- });
38
-
39
- const _hoisted_1 = {
32
+ }), g = {
40
33
  ref: "lottieNode",
41
34
  class: "vk-lottie-animation"
42
35
  };
43
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
44
- return openBlock(), createElementBlock(
45
- Fragment,
46
- null,
47
- [
48
- createElementVNode(
49
- "div",
50
- _hoisted_1,
51
- null,
52
- 512
53
- /* NEED_PATCH */
54
- ),
55
- renderSlot(_ctx.$slots, "default")
56
- ],
57
- 64
58
- /* STABLE_FRAGMENT */
59
- );
36
+ function h(t, a, e, o, y, A) {
37
+ return p(), s(c, null, [
38
+ m("div", g, null, 512),
39
+ d(t.$slots, "default")
40
+ ], 64);
60
41
  }
61
- var VkLottieAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/lottie-animation/src/index.vue"]]);
62
-
63
- var types = /*#__PURE__*/Object.freeze({
42
+ const n = /* @__PURE__ */ _(v, [["render", h]]), S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
64
43
  __proto__: null
65
- });
66
-
67
- VkLottieAnimation.install = (app) => {
68
- app.component(VkLottieAnimation.name || "VkLottieAnimation", VkLottieAnimation);
44
+ }, Symbol.toStringTag, { value: "Module" }));
45
+ n.install = (t) => {
46
+ t.component(n.name || "VkLottieAnimation", n);
47
+ };
48
+ export {
49
+ n as VkLottieAnimation,
50
+ S as __VkLottieAnimation,
51
+ n as default
69
52
  };
70
-
71
- export { VkLottieAnimation, types as __VkLottieAnimation, VkLottieAnimation as default };
@@ -1,5 +1,7 @@
1
1
  import { Ref } from 'vue';
2
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
5
  path: {
4
6
  type: StringConstructor;
5
7
  default: string;
@@ -18,4 +20,3 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
18
20
  }>, {
19
21
  path: string;
20
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
21
- export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("@vunk/plus/components/broadcasting-markdown"),m=require("@vunk/plus/components/pixi-frame"),M=require("@vunk/plus/shared/data"),T=require("@vunk/core/composables"),g=require("@vunk/core/shared"),o=require("@vunk/shared/enum"),f=require("sophontalk-services"),U={source:{type:String,default:""},textToSpeech:{type:Function,required:!0},modelUrl:{type:String,required:!0},datasetUrl:{type:String,required:!0},sourceUrl:{type:String,required:!0},status:{type:String,default:void 0},playAfterCache:{type:Number,default:100},disabled:{type:Boolean,default:!1}},V={"update:status":null},i=e.defineComponent({name:"VkMetahumanBroadcasting",inheritAttrs:!1,__name:"index",props:U,emits:V,setup(d,{emit:S}){const s=d,y=S,c=e.ref([]),v=new f.FeatureExtractor,u=new f.InferenceEngine({onFrame:q,onError(t){console.error("Inference engine error:",t)},onProgress:B}),b=u.createSilentFrameGenerator(),p=e.ref(o.TickerStatus.pending),l=e.ref([]),n=T.useModelComputed({default:o.TickerStatus.pending,key:"status"},s,y);e.onMounted(async()=>{const{dataset:t,zipBuffer:r}=await f.loadDataset({jsonUrl:s.datasetUrl,zipUrl:s.sourceUrl});u.init({modelPath:s.modelUrl,dataset:t,zipBuffer:r}),await u.when(),p.value=o.TickerStatus.play});async function h(t){if(t.blob)try{const r=await M.blobToAudioBuffer(t.blob),{dimensions:a,features:w}=await v.process(r);await u.when(),u.run({audioFeatures:w,audioDimensions:a,reset:!1})}catch(r){console.error("Error processing paragraph:",r)}}function k(){c.value.length&&(n.value=o.TickerStatus.stop,l.value.length=0)}function B(t,r){(r<s.playAfterCache&&t===r||t===s.playAfterCache)&&(n.value=o.TickerStatus.play)}function q(t){l.value.push(t)}return(t,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(F.VkBroadcastingMarkdown),e.mergeProps(t.$attrs,{status:e.unref(n),data:c.value,"text-to-speech":t.textToSpeech,source:t.source,processing:h,disabled:t.disabled,onSetData:r[0]||(r[0]=a=>e.unref(g.setData)(c.value,a)),onComplete:k}),{default:e.withCtx(({paragraphs:a})=>[e.renderSlot(t.$slots,"default",{paragraphs:a})]),_:3},16,["status","data","text-to-speech","source","disabled"]),e.createVNode(e.unref(m.VkPixiFrameBitmap),{status:e.unref(n),"onUpdate:status":r[1]||(r[1]=a=>e.isRef(n)?n.value=a:null),data:l.value,onSetData:r[2]||(r[2]=a=>e.unref(g.setData)(l.value,a))},null,8,["status","data"]),e.createVNode(e.unref(m.VkPixiFrameBitmapGenerator),{status:p.value,"onUpdate:status":r[3]||(r[3]=a=>p.value=a),generator:e.unref(b),visible:e.unref(n)!==e.unref(o.TickerStatus).playing},null,8,["status","generator","visible"])],64))}}),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));i.install=d=>{d.component(i.name||"VkMetahumanBroadcasting",i)};exports.VkMetahumanBroadcasting=i;exports.__VkMetahumanBroadcasting=P;exports.default=i;
@@ -1,14 +1,12 @@
1
- import { defineComponent, ref, onMounted, openBlock, createElementBlock, Fragment, createVNode, mergeProps, withCtx, renderSlot } from 'vue';
2
- import { VkBroadcastingMarkdown } from '@vunk/plus/components/broadcasting-markdown';
3
- import { VkPixiFrameBitmap, VkPixiFrameBitmapGenerator } from '@vunk/plus/components/pixi-frame';
4
- import { blobToAudioBuffer } from '@vunk/plus/shared/data';
5
- import { useModelComputed } from '@vunk/core/composables';
6
- import { setData } from '@vunk/core/shared';
7
- import { TickerStatus } from '@vunk/shared/enum';
8
- import { FeatureExtractor, InferenceEngine, loadDataset } from 'sophontalk-services';
9
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
10
-
11
- const props = {
1
+ import { defineComponent as U, ref as m, onMounted as C, createElementBlock as M, openBlock as P, Fragment as V, createVNode as f, unref as r, mergeProps as x, withCtx as D, renderSlot as A, isRef as E } from "vue";
2
+ import { VkBroadcastingMarkdown as T } from "@vunk/plus/components/broadcasting-markdown";
3
+ import { VkPixiFrameBitmap as q, VkPixiFrameBitmapGenerator as j } from "@vunk/plus/components/pixi-frame";
4
+ import { blobToAudioBuffer as z } from "@vunk/plus/shared/data";
5
+ import { useModelComputed as G } from "@vunk/core/composables";
6
+ import { setData as g } from "@vunk/core/shared";
7
+ import { TickerStatus as s } from "@vunk/shared/enum";
8
+ import { FeatureExtractor as I, InferenceEngine as N, loadDataset as O } from "sophontalk-services";
9
+ const $ = {
12
10
  /**
13
11
  * @description 传入文本
14
12
  */
@@ -21,28 +19,28 @@ const props = {
21
19
  */
22
20
  textToSpeech: {
23
21
  type: Function,
24
- required: true
22
+ required: !0
25
23
  },
26
24
  /**
27
25
  * @description 模型地址
28
26
  */
29
27
  modelUrl: {
30
28
  type: String,
31
- required: true
29
+ required: !0
32
30
  },
33
31
  /**
34
32
  * @description 数据集地址
35
33
  */
36
34
  datasetUrl: {
37
35
  type: String,
38
- required: true
36
+ required: !0
39
37
  },
40
38
  /**
41
39
  * @description zip 资源包地址
42
40
  */
43
41
  sourceUrl: {
44
42
  type: String,
45
- required: true
43
+ required: !0
46
44
  },
47
45
  /**
48
46
  * @description 播报状态
@@ -61,147 +59,98 @@ const props = {
61
59
  },
62
60
  disabled: {
63
61
  type: Boolean,
64
- default: false
62
+ default: !1
65
63
  }
66
- };
67
- const emits = {
64
+ }, R = {
68
65
  "update:status": null
69
- };
70
-
71
- var _sfc_main = /* @__PURE__ */ defineComponent({
72
- ...{
73
- name: "VkMetahumanBroadcasting",
74
- inheritAttrs: false
75
- },
66
+ }, c = /* @__PURE__ */ U({
67
+ name: "VkMetahumanBroadcasting",
68
+ inheritAttrs: !1,
76
69
  __name: "index",
77
- props: props,
78
- emits,
79
- setup(__props, { expose: __expose, emit: __emit }) {
80
- __expose();
81
- const props = __props;
82
- const emit = __emit;
83
- const paragraphData = ref([]);
84
- const extractor = new FeatureExtractor();
85
- const engine = new InferenceEngine({
86
- onFrame,
87
- onError(error) {
88
- console.error("Inference engine error:", error);
70
+ props: $,
71
+ emits: R,
72
+ setup(l, { emit: y }) {
73
+ const n = l, h = y, p = m([]), v = new I(), u = new N({
74
+ onFrame: w,
75
+ onError(e) {
76
+ console.error("Inference engine error:", e);
89
77
  },
90
- onProgress
91
- });
92
- const silentFrameGenerator = engine.createSilentFrameGenerator();
93
- const slientFrameStatus = ref(TickerStatus.pending);
94
- const frames = ref([]);
95
- const frameStatus = useModelComputed({
96
- default: TickerStatus.pending,
78
+ onProgress: k
79
+ }), b = u.createSilentFrameGenerator(), d = m(s.pending), i = m([]), o = G({
80
+ default: s.pending,
97
81
  key: "status"
98
- }, props, emit);
99
- onMounted(async () => {
100
- const { dataset, zipBuffer } = await loadDataset({
101
- jsonUrl: props.datasetUrl,
102
- zipUrl: props.sourceUrl
82
+ }, n, h);
83
+ C(async () => {
84
+ const { dataset: e, zipBuffer: t } = await O({
85
+ jsonUrl: n.datasetUrl,
86
+ zipUrl: n.sourceUrl
103
87
  });
104
- engine.init({
105
- modelPath: props.modelUrl,
106
- dataset,
107
- zipBuffer
108
- });
109
- await engine.when();
110
- slientFrameStatus.value = TickerStatus.play;
88
+ u.init({
89
+ modelPath: n.modelUrl,
90
+ dataset: e,
91
+ zipBuffer: t
92
+ }), await u.when(), d.value = s.play;
111
93
  });
112
- async function processingParagraph(item) {
113
- if (!item.blob) {
114
- return;
115
- }
116
- try {
117
- const audioBuffer = await blobToAudioBuffer(item.blob);
118
- const { dimensions, features } = await extractor.process(audioBuffer);
119
- await engine.when();
120
- engine.run({
121
- audioFeatures: features,
122
- audioDimensions: dimensions,
123
- reset: false
124
- });
125
- } catch (error) {
126
- console.error("Error processing paragraph:", error);
127
- }
94
+ async function S(e) {
95
+ if (e.blob)
96
+ try {
97
+ const t = await z(e.blob), { dimensions: a, features: F } = await v.process(t);
98
+ await u.when(), u.run({
99
+ audioFeatures: F,
100
+ audioDimensions: a,
101
+ reset: !1
102
+ });
103
+ } catch (t) {
104
+ console.error("Error processing paragraph:", t);
105
+ }
128
106
  }
129
- function allParagraphCompleted() {
130
- if (paragraphData.value.length) {
131
- frameStatus.value = TickerStatus.stop;
132
- frames.value.length = 0;
133
- }
107
+ function B() {
108
+ p.value.length && (o.value = s.stop, i.value.length = 0);
134
109
  }
135
- function onProgress(processed, total) {
136
- if (total < props.playAfterCache && processed === total || processed === props.playAfterCache) {
137
- frameStatus.value = TickerStatus.play;
138
- }
110
+ function k(e, t) {
111
+ (t < n.playAfterCache && e === t || e === n.playAfterCache) && (o.value = s.play);
139
112
  }
140
- function onFrame(frame) {
141
- frames.value.push(frame);
113
+ function w(e) {
114
+ i.value.push(e);
142
115
  }
143
- const __returned__ = { props, emit, paragraphData, extractor, engine, silentFrameGenerator, slientFrameStatus, frames, frameStatus, processingParagraph, allParagraphCompleted, onProgress, onFrame, get VkBroadcastingMarkdown() {
144
- return VkBroadcastingMarkdown;
145
- }, get VkPixiFrameBitmap() {
146
- return VkPixiFrameBitmap;
147
- }, get VkPixiFrameBitmapGenerator() {
148
- return VkPixiFrameBitmapGenerator;
149
- }, get setData() {
150
- return setData;
151
- }, get TickerStatus() {
152
- return TickerStatus;
153
- } };
154
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
155
- return __returned__;
156
- }
157
- });
158
-
159
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
160
- return openBlock(), createElementBlock(
161
- Fragment,
162
- null,
163
- [
164
- createVNode($setup["VkBroadcastingMarkdown"], mergeProps(_ctx.$attrs, {
165
- status: $setup.frameStatus,
166
- data: $setup.paragraphData,
167
- "text-to-speech": _ctx.textToSpeech,
168
- source: _ctx.source,
169
- processing: $setup.processingParagraph,
170
- disabled: _ctx.disabled,
171
- onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.paragraphData, $event)),
172
- onComplete: $setup.allParagraphCompleted
116
+ return (e, t) => (P(), M(V, null, [
117
+ f(r(T), x(e.$attrs, {
118
+ status: r(o),
119
+ data: p.value,
120
+ "text-to-speech": e.textToSpeech,
121
+ source: e.source,
122
+ processing: S,
123
+ disabled: e.disabled,
124
+ onSetData: t[0] || (t[0] = (a) => r(g)(p.value, a)),
125
+ onComplete: B
173
126
  }), {
174
- default: withCtx(({ paragraphs }) => [
175
- renderSlot(_ctx.$slots, "default", { paragraphs })
127
+ default: D(({ paragraphs: a }) => [
128
+ A(e.$slots, "default", { paragraphs: a })
176
129
  ]),
177
130
  _: 3
178
- /* FORWARDED */
179
131
  }, 16, ["status", "data", "text-to-speech", "source", "disabled"]),
180
- createVNode($setup["VkPixiFrameBitmap"], {
181
- status: $setup.frameStatus,
182
- "onUpdate:status": _cache[1] || (_cache[1] = ($event) => $setup.frameStatus = $event),
183
- data: $setup.frames,
184
- onSetData: _cache[2] || (_cache[2] = ($event) => $setup.setData($setup.frames, $event))
132
+ f(r(q), {
133
+ status: r(o),
134
+ "onUpdate:status": t[1] || (t[1] = (a) => E(o) ? o.value = a : null),
135
+ data: i.value,
136
+ onSetData: t[2] || (t[2] = (a) => r(g)(i.value, a))
185
137
  }, null, 8, ["status", "data"]),
186
- createVNode($setup["VkPixiFrameBitmapGenerator"], {
187
- status: $setup.slientFrameStatus,
188
- "onUpdate:status": _cache[3] || (_cache[3] = ($event) => $setup.slientFrameStatus = $event),
189
- generator: $setup.silentFrameGenerator,
190
- visible: $setup.frameStatus !== $setup.TickerStatus.playing
138
+ f(r(j), {
139
+ status: d.value,
140
+ "onUpdate:status": t[3] || (t[3] = (a) => d.value = a),
141
+ generator: r(b),
142
+ visible: r(o) !== r(s).playing
191
143
  }, null, 8, ["status", "generator", "visible"])
192
- ],
193
- 64
194
- /* STABLE_FRAGMENT */
195
- );
196
- }
197
- var VkMetahumanBroadcasting = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/metahuman-broadcasting/src/index.vue"]]);
198
-
199
- var types = /*#__PURE__*/Object.freeze({
144
+ ], 64));
145
+ }
146
+ }), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
200
147
  __proto__: null
201
- });
202
-
203
- VkMetahumanBroadcasting.install = (app) => {
204
- app.component(VkMetahumanBroadcasting.name || "VkMetahumanBroadcasting", VkMetahumanBroadcasting);
148
+ }, Symbol.toStringTag, { value: "Module" }));
149
+ c.install = (l) => {
150
+ l.component(c.name || "VkMetahumanBroadcasting", c);
151
+ };
152
+ export {
153
+ c as VkMetahumanBroadcasting,
154
+ Z as __VkMetahumanBroadcasting,
155
+ c as default
205
156
  };
206
-
207
- export { VkMetahumanBroadcasting, types as __VkMetahumanBroadcasting, VkMetahumanBroadcasting as default };