@vunk/plus 1.10.3 → 1.11.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 (37) hide show
  1. package/components/agent-chat-provider/index.mjs +1 -1
  2. package/components/avatar/index.mjs +1 -1
  3. package/components/broadcasting-markdown/index.mjs +25 -16
  4. package/components/broadcasting-markdown/src/ctx.d.ts +7 -0
  5. package/components/broadcasting-markdown/src/index.vue.d.ts +84 -1
  6. package/components/bubble-list/index.mjs +3 -3
  7. package/components/bubble-templates/index.mjs +1 -1
  8. package/components/chat-independent/index.mjs +1 -1
  9. package/components/drawer/index.css +92 -92
  10. package/components/drawer/index.mjs +1 -1
  11. package/components/index2.mjs +54 -75
  12. package/components/lottie-animation/index.mjs +1 -1
  13. package/components/metahuman-broadcasting/index.mjs +28 -3062
  14. package/components/metahuman-broadcasting/src/ctx.d.ts +4 -0
  15. package/components/metahuman-broadcasting/src/index.vue.d.ts +102 -9
  16. package/components/monaco-editor/index.mjs +1 -1
  17. package/components/monaco-environment/index.mjs +1 -1
  18. package/components/pixi-frame/src/bitmap.vue.d.ts +4 -5
  19. package/components/pixi-frame/src/index.vue.d.ts +4 -5
  20. package/components/recorder-button/index.mjs +1 -1
  21. package/components/routes-menu-content/index.mjs +3 -3
  22. package/components/scrollbar/index.mjs +3 -3
  23. package/components/sender/index.mjs +2 -2
  24. package/components/speech-button/index.mjs +3 -3
  25. package/components/table-columns/index.mjs +1 -1
  26. package/components/tables-v1/index.mjs +1 -1
  27. package/components/tables-v1-checkbox/index.mjs +1 -1
  28. package/components/text/index.mjs +1 -1
  29. package/components/typing-markdown/index.mjs +1 -1
  30. package/components/vditor/index.mjs +3 -3
  31. package/components/xgplayer/index.mjs +2 -2
  32. package/icons/end/index.mjs +1 -1
  33. package/icons/keyboard/index.mjs +1 -1
  34. package/icons/start/index.mjs +1 -1
  35. package/icons/voice/index.mjs +1 -1
  36. package/index.css +92 -92
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { provide, inject, watchEffect, onBeforeUnmount, defineComponent, useId, ref, onMounted, renderSlot, watch, computed, nextTick, openBlock, createElementBlock, resolveComponent, createBlock, withCtx, createVNode } from 'vue';
1
+ import { provide, inject, watchEffect, onBeforeUnmount, defineComponent, useId, ref, onMounted, renderSlot, watch, computed, openBlock, createElementBlock, resolveComponent, createBlock, withCtx, createVNode } from 'vue';
2
2
  import { TickerStatus } from '@vunk/shared/enum';
3
3
  import { Deferred, sleep } from '@vunk/shared/promise';
4
4
  import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers.mjs';
@@ -25760,7 +25760,7 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
25760
25760
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
25761
25761
  return renderSlot(_ctx.$slots, "default");
25762
25762
  }
25763
- var ApngComp = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\apng.vue"]]);
25763
+ var ApngComp = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/apng.vue"]]);
25764
25764
 
25765
25765
  var _sfc_main$6 = /* @__PURE__ */ defineComponent({
25766
25766
  __name: "bitmap-generator",
@@ -25792,8 +25792,8 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
25792
25792
  resource: bitmap
25793
25793
  });
25794
25794
  texture.source = source;
25795
- resizeSprite();
25796
25795
  texture.update();
25796
+ resizeSprite();
25797
25797
  }
25798
25798
  emit("load", {
25799
25799
  application,
@@ -25822,13 +25822,16 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
25822
25822
  application.ticker.add(drawFrame);
25823
25823
  }
25824
25824
  function pause() {
25825
+ application.ticker.remove(drawFrame);
25825
25826
  emit("update:status", TickerStatus.paused);
25826
25827
  }
25827
25828
  function stop() {
25828
- emit("update:status", TickerStatus.stopped);
25829
25829
  application.ticker.remove(drawFrame);
25830
+ emit("update:status", TickerStatus.stopped);
25830
25831
  }
25831
25832
  onBeforeUnmount(() => {
25833
+ stop();
25834
+ texture.destroy();
25832
25835
  });
25833
25836
  const __returned__ = { props, emit, sprite, resizeSprite, application, texture, updateTextureFromBitmap, drawFrame, play, pause, stop };
25834
25837
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
@@ -25839,7 +25842,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
25839
25842
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
25840
25843
  return renderSlot(_ctx.$slots, "default");
25841
25844
  }
25842
- var bitmapGenerator = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\bitmap-generator.vue"]]);
25845
+ var bitmapGenerator = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/bitmap-generator.vue"]]);
25843
25846
 
25844
25847
  var _sfc_main$5 = /* @__PURE__ */ defineComponent({
25845
25848
  __name: "bitmap",
@@ -25865,42 +25868,20 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
25865
25868
  __expose();
25866
25869
  const props = __props;
25867
25870
  const emit = __emit;
25868
- const compId = useId();
25869
- const getAlias = (key) => `${compId}-${key}`;
25870
25871
  const { sprite, resizeSprite, application } = useSprite(props);
25871
- const textureMap = /* @__PURE__ */ new Map();
25872
- const completedIndex = ref(0);
25873
- const enabledData = computed(() => {
25874
- return props.data.slice(completedIndex.value);
25875
- });
25876
- watchEffect(() => {
25877
- for (const key in enabledData.value) {
25878
- const theKey = +key + completedIndex.value;
25879
- const alias = `${compId}-${theKey}`;
25880
- const image = enabledData.value[key];
25881
- if (!image) {
25882
- continue;
25883
- }
25884
- if (textureMap.has(alias)) {
25885
- continue;
25886
- }
25887
- const source = new ImageSource({
25888
- resource: image
25889
- });
25890
- const texture = new Texture({
25891
- source
25892
- });
25893
- textureMap.set(alias, void 0);
25894
- nextTick(() => {
25895
- texture._meta = enabledData.value[key];
25896
- textureMap.set(alias, texture);
25897
- if (props.prerender && theKey === 0) {
25898
- sprite.texture = texture;
25899
- resizeSprite();
25900
- }
25901
- });
25902
- }
25872
+ const texture = new Texture({
25873
+ dynamic: true
25903
25874
  });
25875
+ sprite.texture = texture;
25876
+ function updateTextureFromBitmap(bitmap) {
25877
+ texture.source?.destroy();
25878
+ const source = new ImageSource({
25879
+ resource: bitmap
25880
+ });
25881
+ texture.source = source;
25882
+ texture.update();
25883
+ resizeSprite();
25884
+ }
25904
25885
  emit("load", {
25905
25886
  application,
25906
25887
  sprite
@@ -25909,40 +25890,42 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
25909
25890
  default: 0,
25910
25891
  key: "frameIndex"
25911
25892
  }, props, emit);
25893
+ const lastScheduledClearIndex = ref(-1);
25894
+ function scheduleClearFrame(frameIndex) {
25895
+ if (frameIndex <= lastScheduledClearIndex.value)
25896
+ return;
25897
+ lastScheduledClearIndex.value = frameIndex;
25898
+ Promise.resolve(sleep(500)).then(() => {
25899
+ emit("setData", {
25900
+ k: frameIndex,
25901
+ v: null
25902
+ });
25903
+ });
25904
+ }
25912
25905
  function drawFrame() {
25913
25906
  if (props.data.length === 0 || props.status !== TickerStatus.playing) {
25914
25907
  return;
25915
25908
  }
25916
- const currentTexture = textureMap.get(
25917
- getAlias(index.value)
25918
- );
25919
- if (currentTexture) {
25920
- const originTexture = sprite.texture;
25909
+ const bitmap = props.data[index.value];
25910
+ if (bitmap) {
25921
25911
  const originIndex = index.value - 1;
25922
- if (originTexture && originIndex >= 0) {
25923
- Promise.resolve(sleep(500)).then(() => {
25924
- originTexture.destroy(true);
25925
- textureMap.set(
25926
- getAlias(originIndex),
25927
- void 0
25928
- );
25929
- emit("setData", {
25930
- k: originIndex,
25931
- v: null
25932
- });
25933
- completedIndex.value = originIndex;
25934
- });
25912
+ if (originIndex >= 0) {
25913
+ scheduleClearFrame(originIndex);
25935
25914
  }
25936
- sprite.texture = currentTexture;
25937
- resizeSprite();
25915
+ updateTextureFromBitmap(bitmap);
25938
25916
  index.value = index.value + 1;
25939
25917
  } else {
25940
25918
  console.warn(
25941
- `Texture for index ${index.value} not found. Ensure the texture is loaded.`
25919
+ `Bitmap for index ${index.value} not found. Ensure the data is loaded.`
25942
25920
  );
25943
25921
  emit("notFound", index.value);
25944
25922
  }
25945
25923
  }
25924
+ watchEffect(() => {
25925
+ if (props.prerender && index.value === 0 && props.data.length > 0 && props.data[0]) {
25926
+ updateTextureFromBitmap(props.data[0]);
25927
+ }
25928
+ });
25946
25929
  watch(() => props.status, (newStatus) => {
25947
25930
  newStatus === TickerStatus.play && play();
25948
25931
  newStatus === TickerStatus.pause && pause();
@@ -25959,25 +25942,21 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
25959
25942
  }
25960
25943
  }
25961
25944
  function pause() {
25945
+ application.ticker.remove(drawFrame);
25962
25946
  emit("update:status", TickerStatus.paused);
25963
25947
  }
25964
25948
  function stop() {
25965
- emit("update:status", TickerStatus.stopped);
25966
25949
  application.ticker.remove(drawFrame);
25950
+ emit("update:status", TickerStatus.stopped);
25967
25951
  emit("update:data", []);
25968
- textureMap.clear();
25969
25952
  index.value = 0;
25953
+ lastScheduledClearIndex.value = -1;
25970
25954
  }
25971
25955
  onBeforeUnmount(() => {
25972
- const entries = Array.from(textureMap.entries());
25973
- entries.forEach(([_, texture]) => {
25974
- if (texture) {
25975
- texture.destroy(true);
25976
- }
25977
- });
25978
25956
  stop();
25957
+ texture.destroy();
25979
25958
  });
25980
- const __returned__ = { props, emit, compId, getAlias, sprite, resizeSprite, application, textureMap, completedIndex, enabledData, index, drawFrame, play, pause, stop };
25959
+ const __returned__ = { props, emit, sprite, resizeSprite, application, texture, updateTextureFromBitmap, index, lastScheduledClearIndex, scheduleClearFrame, drawFrame, play, pause, stop };
25981
25960
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
25982
25961
  return __returned__;
25983
25962
  }
@@ -25986,7 +25965,7 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
25986
25965
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
25987
25966
  return renderSlot(_ctx.$slots, "default");
25988
25967
  }
25989
- var Bitmap = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\bitmap.vue"]]);
25968
+ var Bitmap = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/bitmap.vue"]]);
25990
25969
 
25991
25970
  var _sfc_main$4 = /* @__PURE__ */ defineComponent({
25992
25971
  __name: "core",
@@ -26164,7 +26143,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
26164
26143
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
26165
26144
  return renderSlot(_ctx.$slots, "default");
26166
26145
  }
26167
- var core = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\core.vue"]]);
26146
+ var core = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/core.vue"]]);
26168
26147
 
26169
26148
  var _sfc_main$3 = /* @__PURE__ */ defineComponent({
26170
26149
  __name: "provider",
@@ -26180,7 +26159,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
26180
26159
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
26181
26160
  return renderSlot(_ctx.$slots, "default");
26182
26161
  }
26183
- var ProviderComp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\provider.vue"]]);
26162
+ var ProviderComp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/provider.vue"]]);
26184
26163
 
26185
26164
  var _sfc_main$2 = /* @__PURE__ */ defineComponent({
26186
26165
  __name: "video",
@@ -26335,7 +26314,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
26335
26314
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
26336
26315
  return renderSlot(_ctx.$slots, "default");
26337
26316
  }
26338
- var VideoComp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\video.vue"]]);
26317
+ var VideoComp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/video.vue"]]);
26339
26318
 
26340
26319
  var _sfc_main$1 = /* @__PURE__ */ defineComponent({
26341
26320
  __name: "view",
@@ -26377,7 +26356,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
26377
26356
  /* NEED_PATCH */
26378
26357
  );
26379
26358
  }
26380
- var ViewComp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\view.vue"]]);
26359
+ var ViewComp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/view.vue"]]);
26381
26360
 
26382
26361
  var _sfc_main = defineComponent({
26383
26362
  name: "VkPixiFrame",
@@ -26445,7 +26424,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
26445
26424
  /* STABLE */
26446
26425
  });
26447
26426
  }
26448
- var VkPixiFrame = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\pixi-frame\\src\\index.vue"]]);
26427
+ var VkPixiFrame = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/index.vue"]]);
26449
26428
 
26450
26429
  var types = /*#__PURE__*/Object.freeze({
26451
26430
  __proto__: null
@@ -58,7 +58,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
58
58
  /* STABLE_FRAGMENT */
59
59
  );
60
60
  }
61
- var VkLottieAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\lottie-animation\\src\\index.vue"]]);
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
62
 
63
63
  var types = /*#__PURE__*/Object.freeze({
64
64
  __proto__: null