@vunk/plus 1.4.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/components/WebGLRenderer.mjs +1 -0
  2. package/components/WebGPURenderer.mjs +1 -0
  3. package/components/broadcasting-markdown/index.mjs +82 -9
  4. package/components/browserAll.mjs +1 -0
  5. package/components/index2.mjs +1498 -62
  6. package/components/pixi-frame/index.mjs +2 -1
  7. package/components/text/index.mjs +106 -0
  8. package/components/typing-markdown/index.css +19 -0
  9. package/components/typing-markdown/index.mjs +17 -4
  10. package/components/webworkerAll.mjs +1 -0
  11. package/index.css +19 -0
  12. package/package.json +5 -1
  13. package/components/agent-chat-provider/index.d.ts +0 -7
  14. package/components/agent-chat-provider/src/api.d.ts +0 -3
  15. package/components/agent-chat-provider/src/const-roles.d.ts +0 -8
  16. package/components/agent-chat-provider/src/const.d.ts +0 -1
  17. package/components/agent-chat-provider/src/index.vue.d.ts +0 -47
  18. package/components/agent-chat-provider/src/types.d.ts +0 -43
  19. package/components/agent-chat-provider/src/use.d.ts +0 -29
  20. package/components/avatar/index.d.ts +0 -4
  21. package/components/avatar/src/ctx.d.ts +0 -18
  22. package/components/avatar/src/index.vue.d.ts +0 -121
  23. package/components/avatar/src/types.d.ts +0 -1
  24. package/components/broadcasting-markdown/index.d.ts +0 -7
  25. package/components/broadcasting-markdown/src/const.d.ts +0 -13
  26. package/components/broadcasting-markdown/src/ctx.d.ts +0 -115
  27. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +0 -97
  28. package/components/broadcasting-markdown/src/index.vue.d.ts +0 -383
  29. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +0 -79
  30. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +0 -60
  31. package/components/broadcasting-markdown/src/types.d.ts +0 -25
  32. package/components/broadcasting-markdown/src/use.d.ts +0 -21
  33. package/components/bubble-list/index.d.ts +0 -5
  34. package/components/bubble-list/src/ctx.d.ts +0 -30
  35. package/components/bubble-list/src/index.vue.d.ts +0 -867
  36. package/components/bubble-list/src/types.d.ts +0 -4
  37. package/components/bubble-templates/index.d.ts +0 -4
  38. package/components/bubble-templates/src/index.vue.d.ts +0 -539
  39. package/components/bubble-templates/src/types.d.ts +0 -40
  40. package/components/chat-independent/index.d.ts +0 -4
  41. package/components/chat-independent/src/const.d.ts +0 -13
  42. package/components/chat-independent/src/ctx.d.ts +0 -20
  43. package/components/chat-independent/src/index.vue.d.ts +0 -2345
  44. package/components/chat-independent/src/types.d.ts +0 -13
  45. package/components/index.d.ts +0 -0
  46. package/components/lottie-animation/index.d.ts +0 -4
  47. package/components/lottie-animation/src/ctx.d.ts +0 -10
  48. package/components/lottie-animation/src/index.vue.d.ts +0 -21
  49. package/components/lottie-animation/src/types.d.ts +0 -4
  50. package/components/monaco-editor/index.d.ts +0 -5
  51. package/components/monaco-editor/src/ctx.d.ts +0 -23
  52. package/components/monaco-editor/src/index.vue.d.ts +0 -40
  53. package/components/monaco-editor/src/types.d.ts +0 -1
  54. package/components/monaco-environment/index.d.ts +0 -4
  55. package/components/monaco-environment/src/ctx.d.ts +0 -8
  56. package/components/monaco-environment/src/index.vue.d.ts +0 -2
  57. package/components/monaco-environment/src/types.d.ts +0 -1
  58. package/components/pixi-frame/index.d.ts +0 -8
  59. package/components/pixi-frame/src/core.vue.d.ts +0 -131
  60. package/components/pixi-frame/src/ctx.d.ts +0 -44
  61. package/components/pixi-frame/src/index.vue.d.ts +0 -230
  62. package/components/pixi-frame/src/provider.vue.d.ts +0 -2
  63. package/components/pixi-frame/src/types.d.ts +0 -1
  64. package/components/pixi-frame/src/use.d.ts +0 -16
  65. package/components/pixi-frame/src/view.vue.d.ts +0 -29
  66. package/components/recorder-button/index.d.ts +0 -4
  67. package/components/recorder-button/src/ctx.d.ts +0 -41
  68. package/components/recorder-button/src/index.vue.d.ts +0 -300
  69. package/components/recorder-button/src/speech-to-text.d.ts +0 -1
  70. package/components/recorder-button/src/types.d.ts +0 -7
  71. package/components/routes-menu-content/index.d.ts +0 -4
  72. package/components/routes-menu-content/src/ctx.d.ts +0 -17
  73. package/components/routes-menu-content/src/index.vue.d.ts +0 -472
  74. package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
  75. package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -307
  76. package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
  77. package/components/routes-menu-content/src/item/index.vue.d.ts +0 -438
  78. package/components/routes-menu-content/src/types.d.ts +0 -1
  79. package/components/sender/index.d.ts +0 -4
  80. package/components/sender/src/SenderHeader.vue.d.ts +0 -256
  81. package/components/sender/src/ctx.d.ts +0 -62
  82. package/components/sender/src/index.vue.d.ts +0 -787
  83. package/components/sender/src/types.d.ts +0 -1
  84. package/components/speech-button/index.d.ts +0 -4
  85. package/components/speech-button/src/LoadingIcon.vue.d.ts +0 -2
  86. package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
  87. package/components/speech-button/src/ctx.d.ts +0 -10
  88. package/components/speech-button/src/index.vue.d.ts +0 -22
  89. package/components/speech-button/src/types.d.ts +0 -1
  90. package/components/table-columns/index.d.ts +0 -5
  91. package/components/table-columns/src/ctx.d.ts +0 -66
  92. package/components/table-columns/src/el-ctx.d.ts +0 -63
  93. package/components/table-columns/src/index.vue.d.ts +0 -282
  94. package/components/table-columns/src/types.d.ts +0 -21
  95. package/components/tables-v1/index.d.ts +0 -5
  96. package/components/tables-v1/src/ctx.d.ts +0 -288
  97. package/components/tables-v1/src/el-ctx.d.ts +0 -269
  98. package/components/tables-v1/src/index.vue.d.ts +0 -3106
  99. package/components/tables-v1/src/types.d.ts +0 -3
  100. package/components/tables-v1-checkbox/index.d.ts +0 -5
  101. package/components/tables-v1-checkbox/src/ctx.d.ts +0 -325
  102. package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3898
  103. package/components/tables-v1-checkbox/src/types.d.ts +0 -1
  104. package/components/typing-markdown/index.d.ts +0 -4
  105. package/components/typing-markdown/src/core.d.ts +0 -2
  106. package/components/typing-markdown/src/ctx.d.ts +0 -33
  107. package/components/typing-markdown/src/index.vue.d.ts +0 -57
  108. package/components/typing-markdown/src/types.d.ts +0 -1
  109. package/components/vditor/index.d.ts +0 -5
  110. package/components/vditor/src/ctx.d.ts +0 -37
  111. package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
  112. package/components/vditor/src/handle-value.vue.d.ts +0 -18
  113. package/components/vditor/src/index.vue.d.ts +0 -144
  114. package/components/vditor/src/types.d.ts +0 -9
  115. package/components/vditor/src/use.d.ts +0 -4
@@ -5,6 +5,7 @@ import 'vue';
5
5
  import '@vunk/shared/enum';
6
6
  import '@vunk/shared/promise';
7
7
  import './_commonjsHelpers.mjs';
8
+ import '@vunk/core/composables';
8
9
  import './_plugin-vue_export-helper.mjs';
9
10
 
10
11
  class GlBatchAdaptor {
@@ -5,6 +5,7 @@ import 'vue';
5
5
  import '@vunk/shared/enum';
6
6
  import '@vunk/shared/promise';
7
7
  import './_commonjsHelpers.mjs';
8
+ import '@vunk/core/composables';
8
9
  import './_plugin-vue_export-helper.mjs';
9
10
 
10
11
  const tempState = State.for2d();
@@ -1,8 +1,8 @@
1
1
  import { VkTypingMarkdown } from '@vunk/plus/components/typing-markdown';
2
2
  import { setData } from '@vunk/core';
3
3
  import { useDeferred, useDataComputed } from '@vunk/core/composables';
4
- import { defineComponent, createElementBlock, openBlock, createElementVNode, Fragment, createVNode, unref, withCtx, shallowRef, computed, watch, onBeforeUnmount, watchEffect, onMounted, nextTick, renderSlot, createCommentVNode, ref, resolveComponent, renderList, createBlock } from 'vue';
5
4
  import { TickerStatus } from '@vunk/shared/enum';
5
+ import { defineComponent, createElementBlock, openBlock, createElementVNode, Fragment, createVNode, unref, withCtx, shallowRef, computed, watch, onBeforeUnmount, watchEffect, onMounted, nextTick, renderSlot, createCommentVNode, ref, resolveComponent, createTextVNode, renderList, createBlock } from 'vue';
6
6
  import { noop } from '@vunk/shared/function';
7
7
  import { ElIcon } from 'element-plus';
8
8
  import { c as commonjsGlobal } from '../_commonjsHelpers.mjs';
@@ -81,6 +81,14 @@ const props = {
81
81
  processing: {
82
82
  type: Function,
83
83
  default: noop
84
+ },
85
+ status: {
86
+ type: String,
87
+ default: TickerStatus.pending
88
+ },
89
+ paragraphMinlength: {
90
+ type: Number,
91
+ default: 100
84
92
  }
85
93
  };
86
94
  const emits = {
@@ -89,6 +97,7 @@ const emits = {
89
97
  "update:broadcasting": (_) => true,
90
98
  "update:completed": (_) => true,
91
99
  "update:error": (_) => true,
100
+ "update:status": (_) => true,
92
101
  "paragraphLoad": (_) => true
93
102
  };
94
103
  const paragraphProps = {
@@ -3421,7 +3430,9 @@ const originalPlay = howler.Howl.prototype.play;
3421
3430
  howler.Howl.prototype.play = function(soundId) {
3422
3431
  const WeixinJSBridge = window.WeixinJSBridge;
3423
3432
  WeixinJSBridge && WeixinJSBridge.invoke("getNetworkType", {}, () => {
3424
- originalPlay.call(this, soundId);
3433
+ if (!this.playing(soundId)) {
3434
+ originalPlay.call(this, soundId);
3435
+ }
3425
3436
  }, false);
3426
3437
  return originalPlay.call(this, soundId);
3427
3438
  };
@@ -3448,6 +3459,7 @@ function useHowlerParagraph(props, emit) {
3448
3459
  k: "broadcast",
3449
3460
  v: Broadcast.paused
3450
3461
  });
3462
+ console.log("onpause", props.data);
3451
3463
  },
3452
3464
  onend: () => {
3453
3465
  emit("setData", {
@@ -3506,6 +3518,31 @@ function useHowlerParagraph(props, emit) {
3506
3518
  sound.value?.stop();
3507
3519
  }
3508
3520
  });
3521
+ const handleVisibilityChange = () => {
3522
+ if (document.hidden) {
3523
+ if (broadcast.value === Broadcast.playing) {
3524
+ emit("setData", {
3525
+ k: "broadcast",
3526
+ v: Broadcast.pause
3527
+ });
3528
+ }
3529
+ } else {
3530
+ setTimeout(() => {
3531
+ if (broadcast.value === Broadcast.paused) {
3532
+ emit("setData", {
3533
+ k: "broadcast",
3534
+ v: Broadcast.play
3535
+ });
3536
+ }
3537
+ }, 400);
3538
+ }
3539
+ };
3540
+ onMounted(() => {
3541
+ document.addEventListener("visibilitychange", handleVisibilityChange);
3542
+ });
3543
+ onBeforeUnmount(() => {
3544
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
3545
+ });
3509
3546
  return {
3510
3547
  url,
3511
3548
  broadcast,
@@ -4205,7 +4242,7 @@ var _sfc_main = defineComponent({
4205
4242
  },
4206
4243
  props,
4207
4244
  emits,
4208
- setup(props2, { emit, expose }) {
4245
+ setup(props2, { emit, expose, slots }) {
4209
4246
  const [theData, handleSetData] = useDataComputed({
4210
4247
  default: []
4211
4248
  }, props2, emit);
@@ -4283,7 +4320,7 @@ var _sfc_main = defineComponent({
4283
4320
  );
4284
4321
  lastParagraph.separator = separator;
4285
4322
  }
4286
- } else {
4323
+ } else if (value.length > props2.paragraphMinlength) {
4287
4324
  const paragraph = {
4288
4325
  start,
4289
4326
  separator,
@@ -4338,26 +4375,48 @@ var _sfc_main = defineComponent({
4338
4375
  });
4339
4376
  emit("interrupt");
4340
4377
  }
4378
+ const currentParagraph = computed(() => {
4379
+ return theData.value.find(
4380
+ (item) => item.status === ParagraphStatus.pending
4381
+ );
4382
+ });
4383
+ watchEffect(() => {
4384
+ if (!currentParagraph.value) {
4385
+ return;
4386
+ }
4387
+ if (currentParagraph.value.broadcast === props2.status) {
4388
+ return;
4389
+ }
4390
+ props2.status === TickerStatus.play && (currentParagraph.value.broadcast = TickerStatus.play);
4391
+ props2.status === TickerStatus.pause && (currentParagraph.value.broadcast = TickerStatus.pause);
4392
+ props2.status === TickerStatus.stop && (currentParagraph.value.broadcast = TickerStatus.stop);
4393
+ });
4341
4394
  const isPaused = computed(() => {
4342
4395
  return theData.value.some(
4343
4396
  (item) => item.status === ParagraphStatus.pending && item.broadcast === Broadcast.paused
4344
4397
  );
4345
4398
  });
4399
+ watchEffect(() => {
4400
+ isPaused.value && emit("update:status", TickerStatus.paused);
4401
+ });
4346
4402
  const isBroadcasting = computed(() => {
4347
4403
  return theData.value.some(
4348
4404
  (item) => item.broadcast === Broadcast.playing
4349
4405
  );
4350
4406
  });
4351
4407
  watchEffect(() => {
4352
- emit("update:broadcasting", isBroadcasting.value);
4408
+ isBroadcasting.value && emit("update:broadcasting", isBroadcasting.value);
4409
+ emit("update:status", TickerStatus.playing);
4353
4410
  });
4411
+ const isTypingFinished = ref(!!slots.paragraphs);
4354
4412
  const isCompleted = computed(() => {
4355
- return props2.keepRead === false && theData.value.every(
4413
+ return isTypingFinished.value && props2.keepRead === false && theData.value.every(
4356
4414
  (item) => item.status === ParagraphStatus.fulfilled
4357
4415
  );
4358
4416
  });
4359
4417
  watchEffect(() => {
4360
4418
  emit("update:completed", isCompleted.value);
4419
+ isCompleted.value && emit("update:status", TickerStatus.stopped);
4361
4420
  });
4362
4421
  const isError = computed(() => {
4363
4422
  return theData.value.some(
@@ -4389,13 +4448,16 @@ var _sfc_main = defineComponent({
4389
4448
  isInterrupted,
4390
4449
  setData,
4391
4450
  Broadcast,
4392
- isPaused
4451
+ isPaused,
4452
+ isTypingFinished,
4453
+ currentParagraph
4393
4454
  };
4394
4455
  }
4395
4456
  });
4396
4457
 
4397
4458
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
4398
4459
  const _component_VkTypingMarkdown = resolveComponent("VkTypingMarkdown");
4460
+ const _component_ElButton = resolveComponent("ElButton");
4399
4461
  const _component_HowlerSpeechView = resolveComponent("HowlerSpeechView");
4400
4462
  const _component_ParagraphView = resolveComponent("ParagraphView");
4401
4463
  return openBlock(), createElementBlock(
@@ -4404,10 +4466,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
4404
4466
  [
4405
4467
  renderSlot(_ctx.$slots, "default", { paragraphs: _ctx.theData }, () => [
4406
4468
  createVNode(_component_VkTypingMarkdown, {
4469
+ finished: _ctx.isTypingFinished,
4470
+ "onUpdate:finished": _cache[0] || (_cache[0] = ($event) => _ctx.isTypingFinished = $event),
4407
4471
  source: _ctx.fulfilledTextValue,
4408
4472
  delay: 120,
4409
4473
  pause: _ctx.isInterrupted || _ctx.isPaused
4410
- }, null, 8, ["source", "pause"])
4474
+ }, null, 8, ["finished", "source", "pause"]),
4475
+ createVNode(_component_ElButton, {
4476
+ onClick: _cache[1] || (_cache[1] = () => console.log(_ctx.currentParagraph))
4477
+ }, {
4478
+ default: withCtx(() => _cache[3] || (_cache[3] = [
4479
+ createTextVNode(" log2 ")
4480
+ ])),
4481
+ _: 1
4482
+ /* STABLE */
4483
+ })
4411
4484
  ]),
4412
4485
  (openBlock(true), createElementBlock(
4413
4486
  Fragment,
@@ -4430,7 +4503,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
4430
4503
  deferred,
4431
4504
  data: item,
4432
4505
  onSetData: ($event) => _ctx.setData(item, $event),
4433
- onLoad: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("paragraphLoad", $event))
4506
+ onLoad: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("paragraphLoad", $event))
4434
4507
  }, null, 8, ["render", "deferred", "data", "onSetData"])
4435
4508
  ])
4436
4509
  ]),
@@ -4,6 +4,7 @@ import 'vue';
4
4
  import '@vunk/shared/enum';
5
5
  import '@vunk/shared/promise';
6
6
  import './_commonjsHelpers.mjs';
7
+ import '@vunk/core/composables';
7
8
  import './_plugin-vue_export-helper.mjs';
8
9
  import './colorToUniform.mjs';
9
10