@vunk/plus 1.4.7 → 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.
- package/components/WebGLRenderer.mjs +1 -0
- package/components/WebGPURenderer.mjs +1 -0
- package/components/broadcasting-markdown/index.mjs +60 -12
- package/components/browserAll.mjs +1 -0
- package/components/index2.mjs +1498 -62
- package/components/pixi-frame/index.mjs +2 -1
- package/components/text/index.mjs +106 -0
- package/components/typing-markdown/index.css +19 -0
- package/components/typing-markdown/index.mjs +17 -4
- package/components/webworkerAll.mjs +1 -0
- package/index.css +19 -0
- package/package.json +5 -1
- package/components/agent-chat-provider/index.d.ts +0 -7
- package/components/agent-chat-provider/src/api.d.ts +0 -3
- package/components/agent-chat-provider/src/const-roles.d.ts +0 -8
- package/components/agent-chat-provider/src/const.d.ts +0 -1
- package/components/agent-chat-provider/src/index.vue.d.ts +0 -47
- package/components/agent-chat-provider/src/types.d.ts +0 -43
- package/components/agent-chat-provider/src/use.d.ts +0 -29
- package/components/avatar/index.d.ts +0 -4
- package/components/avatar/src/ctx.d.ts +0 -18
- package/components/avatar/src/index.vue.d.ts +0 -121
- package/components/avatar/src/types.d.ts +0 -1
- package/components/broadcasting-markdown/index.d.ts +0 -7
- package/components/broadcasting-markdown/src/const.d.ts +0 -13
- package/components/broadcasting-markdown/src/ctx.d.ts +0 -115
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +0 -97
- package/components/broadcasting-markdown/src/index.vue.d.ts +0 -383
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +0 -79
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +0 -60
- package/components/broadcasting-markdown/src/types.d.ts +0 -25
- package/components/broadcasting-markdown/src/use.d.ts +0 -21
- package/components/bubble-list/index.d.ts +0 -5
- package/components/bubble-list/src/ctx.d.ts +0 -30
- package/components/bubble-list/src/index.vue.d.ts +0 -867
- package/components/bubble-list/src/types.d.ts +0 -4
- package/components/bubble-templates/index.d.ts +0 -4
- package/components/bubble-templates/src/index.vue.d.ts +0 -539
- package/components/bubble-templates/src/types.d.ts +0 -40
- package/components/chat-independent/index.d.ts +0 -4
- package/components/chat-independent/src/const.d.ts +0 -13
- package/components/chat-independent/src/ctx.d.ts +0 -20
- package/components/chat-independent/src/index.vue.d.ts +0 -2345
- package/components/chat-independent/src/types.d.ts +0 -13
- package/components/index.d.ts +0 -0
- package/components/lottie-animation/index.d.ts +0 -4
- package/components/lottie-animation/src/ctx.d.ts +0 -10
- package/components/lottie-animation/src/index.vue.d.ts +0 -21
- package/components/lottie-animation/src/types.d.ts +0 -4
- package/components/monaco-editor/index.d.ts +0 -5
- package/components/monaco-editor/src/ctx.d.ts +0 -23
- package/components/monaco-editor/src/index.vue.d.ts +0 -40
- package/components/monaco-editor/src/types.d.ts +0 -1
- package/components/monaco-environment/index.d.ts +0 -4
- package/components/monaco-environment/src/ctx.d.ts +0 -8
- package/components/monaco-environment/src/index.vue.d.ts +0 -2
- package/components/monaco-environment/src/types.d.ts +0 -1
- package/components/pixi-frame/index.d.ts +0 -8
- package/components/pixi-frame/src/core.vue.d.ts +0 -131
- package/components/pixi-frame/src/ctx.d.ts +0 -44
- package/components/pixi-frame/src/index.vue.d.ts +0 -230
- package/components/pixi-frame/src/provider.vue.d.ts +0 -2
- package/components/pixi-frame/src/types.d.ts +0 -1
- package/components/pixi-frame/src/use.d.ts +0 -16
- package/components/pixi-frame/src/view.vue.d.ts +0 -29
- package/components/recorder-button/index.d.ts +0 -4
- package/components/recorder-button/src/ctx.d.ts +0 -41
- package/components/recorder-button/src/index.vue.d.ts +0 -300
- package/components/recorder-button/src/speech-to-text.d.ts +0 -1
- package/components/recorder-button/src/types.d.ts +0 -7
- package/components/routes-menu-content/index.d.ts +0 -4
- package/components/routes-menu-content/src/ctx.d.ts +0 -17
- package/components/routes-menu-content/src/index.vue.d.ts +0 -472
- package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -307
- package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
- package/components/routes-menu-content/src/item/index.vue.d.ts +0 -438
- package/components/routes-menu-content/src/types.d.ts +0 -1
- package/components/sender/index.d.ts +0 -4
- package/components/sender/src/SenderHeader.vue.d.ts +0 -256
- package/components/sender/src/ctx.d.ts +0 -62
- package/components/sender/src/index.vue.d.ts +0 -787
- package/components/sender/src/types.d.ts +0 -1
- package/components/speech-button/index.d.ts +0 -4
- package/components/speech-button/src/LoadingIcon.vue.d.ts +0 -2
- package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
- package/components/speech-button/src/ctx.d.ts +0 -10
- package/components/speech-button/src/index.vue.d.ts +0 -22
- package/components/speech-button/src/types.d.ts +0 -1
- package/components/table-columns/index.d.ts +0 -5
- package/components/table-columns/src/ctx.d.ts +0 -66
- package/components/table-columns/src/el-ctx.d.ts +0 -63
- package/components/table-columns/src/index.vue.d.ts +0 -282
- package/components/table-columns/src/types.d.ts +0 -21
- package/components/tables-v1/index.d.ts +0 -5
- package/components/tables-v1/src/ctx.d.ts +0 -288
- package/components/tables-v1/src/el-ctx.d.ts +0 -269
- package/components/tables-v1/src/index.vue.d.ts +0 -3106
- package/components/tables-v1/src/types.d.ts +0 -3
- package/components/tables-v1-checkbox/index.d.ts +0 -5
- package/components/tables-v1-checkbox/src/ctx.d.ts +0 -325
- package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3898
- package/components/tables-v1-checkbox/src/types.d.ts +0 -1
- package/components/typing-markdown/index.d.ts +0 -4
- package/components/typing-markdown/src/core.d.ts +0 -2
- package/components/typing-markdown/src/ctx.d.ts +0 -33
- package/components/typing-markdown/src/index.vue.d.ts +0 -57
- package/components/typing-markdown/src/types.d.ts +0 -1
- package/components/vditor/index.d.ts +0 -5
- package/components/vditor/src/ctx.d.ts +0 -37
- package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
- package/components/vditor/src/handle-value.vue.d.ts +0 -18
- package/components/vditor/src/index.vue.d.ts +0 -144
- package/components/vditor/src/types.d.ts +0 -9
- package/components/vditor/src/use.d.ts +0 -4
|
@@ -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 = {
|
|
@@ -3450,6 +3459,7 @@ function useHowlerParagraph(props, emit) {
|
|
|
3450
3459
|
k: "broadcast",
|
|
3451
3460
|
v: Broadcast.paused
|
|
3452
3461
|
});
|
|
3462
|
+
console.log("onpause", props.data);
|
|
3453
3463
|
},
|
|
3454
3464
|
onend: () => {
|
|
3455
3465
|
emit("setData", {
|
|
@@ -3510,10 +3520,12 @@ function useHowlerParagraph(props, emit) {
|
|
|
3510
3520
|
});
|
|
3511
3521
|
const handleVisibilityChange = () => {
|
|
3512
3522
|
if (document.hidden) {
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3523
|
+
if (broadcast.value === Broadcast.playing) {
|
|
3524
|
+
emit("setData", {
|
|
3525
|
+
k: "broadcast",
|
|
3526
|
+
v: Broadcast.pause
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3517
3529
|
} else {
|
|
3518
3530
|
setTimeout(() => {
|
|
3519
3531
|
if (broadcast.value === Broadcast.paused) {
|
|
@@ -4230,7 +4242,7 @@ var _sfc_main = defineComponent({
|
|
|
4230
4242
|
},
|
|
4231
4243
|
props,
|
|
4232
4244
|
emits,
|
|
4233
|
-
setup(props2, { emit, expose }) {
|
|
4245
|
+
setup(props2, { emit, expose, slots }) {
|
|
4234
4246
|
const [theData, handleSetData] = useDataComputed({
|
|
4235
4247
|
default: []
|
|
4236
4248
|
}, props2, emit);
|
|
@@ -4308,7 +4320,7 @@ var _sfc_main = defineComponent({
|
|
|
4308
4320
|
);
|
|
4309
4321
|
lastParagraph.separator = separator;
|
|
4310
4322
|
}
|
|
4311
|
-
} else {
|
|
4323
|
+
} else if (value.length > props2.paragraphMinlength) {
|
|
4312
4324
|
const paragraph = {
|
|
4313
4325
|
start,
|
|
4314
4326
|
separator,
|
|
@@ -4363,26 +4375,48 @@ var _sfc_main = defineComponent({
|
|
|
4363
4375
|
});
|
|
4364
4376
|
emit("interrupt");
|
|
4365
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
|
+
});
|
|
4366
4394
|
const isPaused = computed(() => {
|
|
4367
4395
|
return theData.value.some(
|
|
4368
4396
|
(item) => item.status === ParagraphStatus.pending && item.broadcast === Broadcast.paused
|
|
4369
4397
|
);
|
|
4370
4398
|
});
|
|
4399
|
+
watchEffect(() => {
|
|
4400
|
+
isPaused.value && emit("update:status", TickerStatus.paused);
|
|
4401
|
+
});
|
|
4371
4402
|
const isBroadcasting = computed(() => {
|
|
4372
4403
|
return theData.value.some(
|
|
4373
4404
|
(item) => item.broadcast === Broadcast.playing
|
|
4374
4405
|
);
|
|
4375
4406
|
});
|
|
4376
4407
|
watchEffect(() => {
|
|
4377
|
-
emit("update:broadcasting", isBroadcasting.value);
|
|
4408
|
+
isBroadcasting.value && emit("update:broadcasting", isBroadcasting.value);
|
|
4409
|
+
emit("update:status", TickerStatus.playing);
|
|
4378
4410
|
});
|
|
4411
|
+
const isTypingFinished = ref(!!slots.paragraphs);
|
|
4379
4412
|
const isCompleted = computed(() => {
|
|
4380
|
-
return props2.keepRead === false && theData.value.every(
|
|
4413
|
+
return isTypingFinished.value && props2.keepRead === false && theData.value.every(
|
|
4381
4414
|
(item) => item.status === ParagraphStatus.fulfilled
|
|
4382
4415
|
);
|
|
4383
4416
|
});
|
|
4384
4417
|
watchEffect(() => {
|
|
4385
4418
|
emit("update:completed", isCompleted.value);
|
|
4419
|
+
isCompleted.value && emit("update:status", TickerStatus.stopped);
|
|
4386
4420
|
});
|
|
4387
4421
|
const isError = computed(() => {
|
|
4388
4422
|
return theData.value.some(
|
|
@@ -4414,13 +4448,16 @@ var _sfc_main = defineComponent({
|
|
|
4414
4448
|
isInterrupted,
|
|
4415
4449
|
setData,
|
|
4416
4450
|
Broadcast,
|
|
4417
|
-
isPaused
|
|
4451
|
+
isPaused,
|
|
4452
|
+
isTypingFinished,
|
|
4453
|
+
currentParagraph
|
|
4418
4454
|
};
|
|
4419
4455
|
}
|
|
4420
4456
|
});
|
|
4421
4457
|
|
|
4422
4458
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4423
4459
|
const _component_VkTypingMarkdown = resolveComponent("VkTypingMarkdown");
|
|
4460
|
+
const _component_ElButton = resolveComponent("ElButton");
|
|
4424
4461
|
const _component_HowlerSpeechView = resolveComponent("HowlerSpeechView");
|
|
4425
4462
|
const _component_ParagraphView = resolveComponent("ParagraphView");
|
|
4426
4463
|
return openBlock(), createElementBlock(
|
|
@@ -4429,10 +4466,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4429
4466
|
[
|
|
4430
4467
|
renderSlot(_ctx.$slots, "default", { paragraphs: _ctx.theData }, () => [
|
|
4431
4468
|
createVNode(_component_VkTypingMarkdown, {
|
|
4469
|
+
finished: _ctx.isTypingFinished,
|
|
4470
|
+
"onUpdate:finished": _cache[0] || (_cache[0] = ($event) => _ctx.isTypingFinished = $event),
|
|
4432
4471
|
source: _ctx.fulfilledTextValue,
|
|
4433
4472
|
delay: 120,
|
|
4434
4473
|
pause: _ctx.isInterrupted || _ctx.isPaused
|
|
4435
|
-
}, 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
|
+
})
|
|
4436
4484
|
]),
|
|
4437
4485
|
(openBlock(true), createElementBlock(
|
|
4438
4486
|
Fragment,
|
|
@@ -4455,7 +4503,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4455
4503
|
deferred,
|
|
4456
4504
|
data: item,
|
|
4457
4505
|
onSetData: ($event) => _ctx.setData(item, $event),
|
|
4458
|
-
onLoad: _cache[
|
|
4506
|
+
onLoad: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("paragraphLoad", $event))
|
|
4459
4507
|
}, null, 8, ["render", "deferred", "data", "onSetData"])
|
|
4460
4508
|
])
|
|
4461
4509
|
]),
|