@vunk/plus 1.6.7 → 1.6.9
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/SendOutlined.mjs +8 -6
- package/components/SharedSystems.mjs +290 -72
- package/components/WebGLRenderer.mjs +32 -20
- package/components/WebGPURenderer.mjs +48 -10
- package/components/agent-chat-provider/index.d.ts +7 -0
- package/components/agent-chat-provider/index.mjs +7 -4
- package/components/agent-chat-provider/src/api.d.ts +3 -0
- package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
- package/components/agent-chat-provider/src/const.d.ts +1 -0
- package/components/agent-chat-provider/src/index.vue.d.ts +22 -0
- package/components/agent-chat-provider/src/types.d.ts +50 -0
- package/components/agent-chat-provider/src/use.d.ts +5 -0
- package/components/avatar/index.d.ts +4 -0
- package/components/avatar/index.mjs +2 -2
- package/components/avatar/src/ctx.d.ts +6 -0
- package/components/avatar/src/index.vue.d.ts +180 -0
- package/components/avatar/src/types.d.ts +1 -0
- package/components/broadcasting-markdown/index.d.ts +7 -0
- package/components/broadcasting-markdown/index.mjs +78 -158
- package/components/broadcasting-markdown/src/const.d.ts +13 -0
- package/components/broadcasting-markdown/src/ctx.d.ts +129 -0
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +104 -0
- package/components/broadcasting-markdown/src/index.vue.d.ts +439 -0
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +79 -0
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +67 -0
- package/components/broadcasting-markdown/src/types.d.ts +26 -0
- package/components/broadcasting-markdown/src/use.d.ts +21 -0
- package/components/browserAll.mjs +333 -562
- package/components/bubble-list/index.d.ts +5 -0
- package/components/bubble-list/index.mjs +91 -72
- package/components/bubble-list/src/ctx.d.ts +32 -0
- package/components/bubble-list/src/index.vue.d.ts +810 -0
- package/components/bubble-list/src/types.d.ts +4 -0
- package/components/bubble-templates/index.d.ts +4 -0
- package/components/bubble-templates/index.mjs +83 -68
- package/components/bubble-templates/src/index.vue.d.ts +595 -0
- package/components/bubble-templates/src/types.d.ts +40 -0
- package/components/chat-independent/index.d.ts +4 -0
- package/components/chat-independent/index.mjs +136 -115
- package/components/chat-independent/src/const.d.ts +13 -0
- package/components/chat-independent/src/ctx.d.ts +21 -0
- package/components/chat-independent/src/index.vue.d.ts +2429 -0
- package/components/chat-independent/src/types.d.ts +13 -0
- package/components/colorToUniform.mjs +2 -0
- package/components/index.d.ts +0 -0
- package/components/index2.mjs +11896 -8381
- package/components/init.mjs +1724 -998
- package/components/lottie-animation/index.d.ts +4 -0
- package/components/lottie-animation/index.mjs +2 -2
- package/components/lottie-animation/src/ctx.d.ts +10 -0
- package/components/lottie-animation/src/index.vue.d.ts +21 -0
- package/components/lottie-animation/src/types.d.ts +4 -0
- package/components/metahuman-broadcasting/index.d.ts +5 -0
- package/components/metahuman-broadcasting/index.mjs +57 -40
- package/components/metahuman-broadcasting/src/ctx.d.ts +57 -0
- package/components/metahuman-broadcasting/src/index.vue.d.ts +885 -0
- package/components/metahuman-broadcasting/src/types.d.ts +1 -0
- package/components/monaco-editor/index.d.ts +5 -0
- package/components/monaco-editor/index.mjs +2 -2
- package/components/monaco-editor/src/ctx.d.ts +23 -0
- package/components/monaco-editor/src/index.vue.d.ts +40 -0
- package/components/monaco-editor/src/types.d.ts +1 -0
- package/components/monaco-environment/index.d.ts +4 -0
- package/components/monaco-environment/index.mjs +1 -1
- package/components/monaco-environment/src/ctx.d.ts +8 -0
- package/components/monaco-environment/src/index.vue.d.ts +2 -0
- package/components/monaco-environment/src/types.d.ts +1 -0
- package/components/pixi-frame/index.d.ts +11 -0
- package/components/pixi-frame/index.mjs +2 -2
- package/components/pixi-frame/src/apng.vue.d.ts +161 -0
- package/components/pixi-frame/src/bitmap.vue.d.ts +158 -0
- package/components/pixi-frame/src/core.vue.d.ts +173 -0
- package/components/pixi-frame/src/ctx.d.ts +55 -0
- package/components/pixi-frame/src/index.vue.d.ts +591 -0
- package/components/pixi-frame/src/provider.vue.d.ts +2 -0
- package/components/pixi-frame/src/types.d.ts +17 -0
- package/components/pixi-frame/src/use.d.ts +16 -0
- package/components/pixi-frame/src/useSprite.d.ts +12 -0
- package/components/pixi-frame/src/video.vue.d.ts +159 -0
- package/components/pixi-frame/src/view.vue.d.ts +29 -0
- package/components/recorder-button/index.d.ts +4 -0
- package/components/recorder-button/index.mjs +2 -2
- package/components/recorder-button/src/ctx.d.ts +41 -0
- package/components/recorder-button/src/index.vue.d.ts +333 -0
- package/components/recorder-button/src/speech-to-text.d.ts +1 -0
- package/components/recorder-button/src/types.d.ts +7 -0
- package/components/routes-menu-content/index.d.ts +4 -0
- package/components/routes-menu-content/index.mjs +5 -5
- package/components/routes-menu-content/src/ctx.d.ts +17 -0
- package/components/routes-menu-content/src/index.vue.d.ts +350 -0
- package/components/routes-menu-content/src/item/core/ctx.d.ts +18 -0
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +185 -0
- package/components/routes-menu-content/src/item/ctx.d.ts +14 -0
- package/components/routes-menu-content/src/item/index.vue.d.ts +316 -0
- package/components/routes-menu-content/src/types.d.ts +1 -0
- package/components/sender/index.css +0 -8
- package/components/sender/index.d.ts +4 -0
- package/components/sender/index.mjs +101 -69
- package/components/sender/src/SenderHeader.vue.d.ts +270 -0
- package/components/sender/src/ctx.d.ts +64 -0
- package/components/sender/src/index.vue.d.ts +779 -0
- package/components/sender/src/types.d.ts +1 -0
- package/components/speech-button/index.d.ts +4 -0
- package/components/speech-button/index.mjs +14 -7
- package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -0
- package/components/speech-button/src/ctx.d.ts +10 -0
- package/components/speech-button/src/index.vue.d.ts +22 -0
- package/components/speech-button/src/types.d.ts +1 -0
- package/components/table-columns/index.d.ts +5 -0
- package/components/table-columns/index.mjs +6 -3
- package/components/table-columns/src/ctx.d.ts +59 -0
- package/components/table-columns/src/el-ctx.d.ts +57 -0
- package/components/table-columns/src/index.vue.d.ts +266 -0
- package/components/table-columns/src/types.d.ts +21 -0
- package/components/tables-v1/index.d.ts +5 -0
- package/components/tables-v1/index.mjs +3 -3
- package/components/tables-v1/src/ctx.d.ts +280 -0
- package/components/tables-v1/src/el-ctx.d.ts +262 -0
- package/components/tables-v1/src/index.vue.d.ts +3054 -0
- package/components/tables-v1/src/types.d.ts +3 -0
- package/components/tables-v1-checkbox/index.d.ts +5 -0
- package/components/tables-v1-checkbox/index.mjs +33 -269
- package/components/tables-v1-checkbox/src/ctx.d.ts +313 -0
- package/components/tables-v1-checkbox/src/index.vue.d.ts +3831 -0
- package/components/tables-v1-checkbox/src/types.d.ts +1 -0
- package/components/text/index.d.ts +4 -0
- package/components/text/index.mjs +52 -42
- package/components/text/src/ctx.d.ts +341 -0
- package/components/text/src/index.vue.d.ts +4593 -0
- package/components/text/src/types.d.ts +1 -0
- package/components/typing-markdown/index.d.ts +4 -0
- package/components/typing-markdown/index.mjs +2 -2
- package/components/typing-markdown/src/core.d.ts +2 -0
- package/components/typing-markdown/src/ctx.d.ts +41 -0
- package/components/typing-markdown/src/index.vue.d.ts +75 -0
- package/components/typing-markdown/src/types.d.ts +1 -0
- package/components/vditor/index.d.ts +5 -0
- package/components/vditor/index.mjs +9 -5
- package/components/vditor/src/ctx.d.ts +38 -0
- package/components/vditor/src/handle-fullscreen.vue.d.ts +18 -0
- package/components/vditor/src/handle-value.vue.d.ts +18 -0
- package/components/vditor/src/index.vue.d.ts +143 -0
- package/components/vditor/src/types.d.ts +9 -0
- package/components/vditor/src/use.d.ts +4 -0
- package/components/webworkerAll.mjs +1 -1
- package/composables/el-breakpoints/index.d.ts +5 -5
- package/composables/recorder/index.mjs +191 -288
- package/icons/end/index.mjs +3 -3
- package/icons/end/src/avatar.d.ts +2 -11
- package/icons/end/src/icon.d.ts +2 -56
- package/icons/keyboard/index.mjs +3 -3
- package/icons/keyboard/src/avatar.d.ts +2 -11
- package/icons/keyboard/src/icon.d.ts +2 -56
- package/icons/start/index.mjs +3 -3
- package/icons/start/src/avatar.d.ts +2 -11
- package/icons/start/src/icon.d.ts +2 -56
- package/icons/voice/index.mjs +2 -2
- package/icons/voice/src/avatar.d.ts +2 -11
- package/icons/voice/src/icon.d.ts +2 -56
- package/index.css +0 -8
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -3,12 +3,12 @@ import { setData } from '@vunk/core';
|
|
|
3
3
|
import { useDeferred, useDataComputed } from '@vunk/core/composables';
|
|
4
4
|
import { blobToDataURL } from '@vunk/shared/data/blob';
|
|
5
5
|
import { TickerStatus } from '@vunk/shared/enum';
|
|
6
|
-
import { defineComponent,
|
|
6
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, Fragment, createVNode, withCtx, shallowRef, computed, watch, onBeforeUnmount, watchEffect, onMounted, nextTick, renderSlot, createCommentVNode, ref, resolveComponent, renderList, createBlock } from 'vue';
|
|
7
7
|
import { noop } from '@vunk/shared/function';
|
|
8
8
|
import { ElIcon } from 'element-plus';
|
|
9
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
9
10
|
import { c as commonjsGlobal } from '../_commonjsHelpers.mjs';
|
|
10
11
|
import { Deferred } from '@vunk/shared/promise';
|
|
11
|
-
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
12
12
|
|
|
13
13
|
function markdownToPlainText(md) {
|
|
14
14
|
return md.replace(/!\[.*?\]\(.*?\)/g, "").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^#{1,6}\s+/gm, "").replace(/\*\*(.*?)\*\*/g, "$1").replace(/__(.*?)__/g, "$1").replace(/\*(.*?)\*/g, "$1").replace(/_(.*?)_/g, "$1").replace(/`(.*?)`/g, "$1").replace(/```[\s\S]*?```/g, "").replace(/\n{2,}/g, "\n").replace(/-{3,}/g, "").replace(/^\s*-\s+/gm, "").replace(/\|/g, "").trim();
|
|
@@ -151,42 +151,52 @@ var close_bold_default = close_bold_vue_vue_type_script_setup_true_lang_default;
|
|
|
151
151
|
|
|
152
152
|
var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
153
153
|
__name: "speech-error",
|
|
154
|
-
setup(__props) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
style: {
|
|
164
|
-
verticalAlign: "text-bottom"
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [
|
|
168
|
-
createVNode(unref(close_bold_default))
|
|
169
|
-
]),
|
|
170
|
-
_: 1
|
|
171
|
-
/* STABLE */
|
|
172
|
-
}),
|
|
173
|
-
_cache[0] || (_cache[0] = createElementVNode(
|
|
174
|
-
"span",
|
|
175
|
-
{ style: {
|
|
176
|
-
color: "var(--el-color-danger)"
|
|
177
|
-
} },
|
|
178
|
-
" \u64AD\u62A5\u5931\u8D25 ",
|
|
179
|
-
-1
|
|
180
|
-
/* HOISTED */
|
|
181
|
-
))
|
|
182
|
-
],
|
|
183
|
-
64
|
|
184
|
-
/* STABLE_FRAGMENT */
|
|
185
|
-
);
|
|
186
|
-
};
|
|
154
|
+
setup(__props, { expose: __expose }) {
|
|
155
|
+
__expose();
|
|
156
|
+
const __returned__ = { get CloseBold() {
|
|
157
|
+
return close_bold_default;
|
|
158
|
+
}, get ElIcon() {
|
|
159
|
+
return ElIcon;
|
|
160
|
+
} };
|
|
161
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
162
|
+
return __returned__;
|
|
187
163
|
}
|
|
188
164
|
});
|
|
189
165
|
|
|
166
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
167
|
+
return openBlock(), createElementBlock(
|
|
168
|
+
Fragment,
|
|
169
|
+
null,
|
|
170
|
+
[
|
|
171
|
+
createVNode($setup["ElIcon"], {
|
|
172
|
+
color: "var(--el-color-danger)",
|
|
173
|
+
size: "1.5em",
|
|
174
|
+
style: {
|
|
175
|
+
verticalAlign: "text-bottom"
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
default: withCtx(() => [
|
|
179
|
+
createVNode($setup["CloseBold"])
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
/* STABLE */
|
|
183
|
+
}),
|
|
184
|
+
_cache[0] || (_cache[0] = createElementVNode(
|
|
185
|
+
"span",
|
|
186
|
+
{ style: {
|
|
187
|
+
color: "var(--el-color-danger)"
|
|
188
|
+
} },
|
|
189
|
+
" \u64AD\u62A5\u5931\u8D25 ",
|
|
190
|
+
-1
|
|
191
|
+
/* HOISTED */
|
|
192
|
+
))
|
|
193
|
+
],
|
|
194
|
+
64
|
|
195
|
+
/* STABLE_FRAGMENT */
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
var SpeechError = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/broadcasting-markdown/src/speech-error.vue"]]);
|
|
199
|
+
|
|
190
200
|
var howler = {};
|
|
191
201
|
|
|
192
202
|
/*!
|
|
@@ -3531,7 +3541,7 @@ function useHowlerParagraph(props, emit) {
|
|
|
3531
3541
|
|
|
3532
3542
|
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3533
3543
|
components: {
|
|
3534
|
-
SpeechError
|
|
3544
|
+
SpeechError
|
|
3535
3545
|
},
|
|
3536
3546
|
props: paragraphProps,
|
|
3537
3547
|
emits: paragraphEmits,
|
|
@@ -3555,11 +3565,14 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3555
3565
|
deferred: props.deferred
|
|
3556
3566
|
});
|
|
3557
3567
|
});
|
|
3558
|
-
return () => createVNode(Fragment, null, [theData.value.status === ParagraphStatus.rejected && createVNode(
|
|
3568
|
+
return () => createVNode(Fragment, null, [theData.value.status === ParagraphStatus.rejected && createVNode(SpeechError, null, null)]);
|
|
3559
3569
|
}
|
|
3560
3570
|
});
|
|
3561
3571
|
|
|
3572
|
+
var HowlerSpeechView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/broadcasting-markdown/src/howler-speech.vue"]]);
|
|
3573
|
+
|
|
3562
3574
|
const LogLevels = {
|
|
3575
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
3563
3576
|
fatal: 0,
|
|
3564
3577
|
error: 0,
|
|
3565
3578
|
warn: 1,
|
|
@@ -3567,6 +3580,9 @@ const LogLevels = {
|
|
|
3567
3580
|
info: 3,
|
|
3568
3581
|
success: 3,
|
|
3569
3582
|
fail: 3,
|
|
3583
|
+
ready: 3,
|
|
3584
|
+
start: 3,
|
|
3585
|
+
box: 3,
|
|
3570
3586
|
debug: 4,
|
|
3571
3587
|
trace: 5,
|
|
3572
3588
|
verbose: Number.POSITIVE_INFINITY
|
|
@@ -3624,25 +3640,11 @@ const LogTypes = {
|
|
|
3624
3640
|
}
|
|
3625
3641
|
};
|
|
3626
3642
|
|
|
3627
|
-
function
|
|
3628
|
-
|
|
3629
|
-
return false;
|
|
3630
|
-
}
|
|
3631
|
-
const prototype = Object.getPrototypeOf(value);
|
|
3632
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
3633
|
-
return false;
|
|
3634
|
-
}
|
|
3635
|
-
if (Symbol.iterator in value) {
|
|
3636
|
-
return false;
|
|
3637
|
-
}
|
|
3638
|
-
if (Symbol.toStringTag in value) {
|
|
3639
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
3640
|
-
}
|
|
3641
|
-
return true;
|
|
3643
|
+
function isObject(value) {
|
|
3644
|
+
return value !== null && typeof value === "object";
|
|
3642
3645
|
}
|
|
3643
|
-
|
|
3644
3646
|
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
3645
|
-
if (!
|
|
3647
|
+
if (!isObject(defaults)) {
|
|
3646
3648
|
return _defu(baseObject, {}, namespace);
|
|
3647
3649
|
}
|
|
3648
3650
|
const object = Object.assign({}, defaults);
|
|
@@ -3656,7 +3658,7 @@ function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
|
3656
3658
|
}
|
|
3657
3659
|
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
3658
3660
|
object[key] = [...value, ...object[key]];
|
|
3659
|
-
} else if (
|
|
3661
|
+
} else if (isObject(value) && isObject(object[key])) {
|
|
3660
3662
|
object[key] = _defu(
|
|
3661
3663
|
value,
|
|
3662
3664
|
object[key],
|
|
@@ -3694,14 +3696,6 @@ function isLogObj(arg) {
|
|
|
3694
3696
|
let paused = false;
|
|
3695
3697
|
const queue = [];
|
|
3696
3698
|
class Consola {
|
|
3697
|
-
options;
|
|
3698
|
-
_lastLog;
|
|
3699
|
-
_mockFn;
|
|
3700
|
-
/**
|
|
3701
|
-
* Creates an instance of Consola with specified options or defaults.
|
|
3702
|
-
*
|
|
3703
|
-
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
3704
|
-
*/
|
|
3705
3699
|
constructor(options = {}) {
|
|
3706
3700
|
const types = options.types || LogTypes;
|
|
3707
3701
|
this.options = defu(
|
|
@@ -3739,19 +3733,9 @@ class Consola {
|
|
|
3739
3733
|
}
|
|
3740
3734
|
this._lastLog = {};
|
|
3741
3735
|
}
|
|
3742
|
-
/**
|
|
3743
|
-
* Gets the current log level of the Consola instance.
|
|
3744
|
-
*
|
|
3745
|
-
* @returns {number} The current log level.
|
|
3746
|
-
*/
|
|
3747
3736
|
get level() {
|
|
3748
3737
|
return this.options.level;
|
|
3749
3738
|
}
|
|
3750
|
-
/**
|
|
3751
|
-
* Sets the minimum log level that will be output by the instance.
|
|
3752
|
-
*
|
|
3753
|
-
* @param {number} level - The new log level to set.
|
|
3754
|
-
*/
|
|
3755
3739
|
set level(level) {
|
|
3756
3740
|
this.options.level = _normalizeLogLevel(
|
|
3757
3741
|
level,
|
|
@@ -3759,27 +3743,12 @@ class Consola {
|
|
|
3759
3743
|
this.options.level
|
|
3760
3744
|
);
|
|
3761
3745
|
}
|
|
3762
|
-
/**
|
|
3763
|
-
* Displays a prompt to the user and returns the response.
|
|
3764
|
-
* Throw an error if `prompt` is not supported by the current configuration.
|
|
3765
|
-
*
|
|
3766
|
-
* @template T
|
|
3767
|
-
* @param {string} message - The message to display in the prompt.
|
|
3768
|
-
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
3769
|
-
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
3770
|
-
*/
|
|
3771
3746
|
prompt(message, opts) {
|
|
3772
3747
|
if (!this.options.prompt) {
|
|
3773
3748
|
throw new Error("prompt is not supported!");
|
|
3774
3749
|
}
|
|
3775
3750
|
return this.options.prompt(message, opts);
|
|
3776
3751
|
}
|
|
3777
|
-
/**
|
|
3778
|
-
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
3779
|
-
*
|
|
3780
|
-
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
3781
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
3782
|
-
*/
|
|
3783
3752
|
create(options) {
|
|
3784
3753
|
const instance = new Consola({
|
|
3785
3754
|
...this.options,
|
|
@@ -3790,12 +3759,6 @@ class Consola {
|
|
|
3790
3759
|
}
|
|
3791
3760
|
return instance;
|
|
3792
3761
|
}
|
|
3793
|
-
/**
|
|
3794
|
-
* Creates a new Consola instance with the specified default log object properties.
|
|
3795
|
-
*
|
|
3796
|
-
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
3797
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
3798
|
-
*/
|
|
3799
3762
|
withDefaults(defaults) {
|
|
3800
3763
|
return this.create({
|
|
3801
3764
|
...this.options,
|
|
@@ -3805,39 +3768,19 @@ class Consola {
|
|
|
3805
3768
|
}
|
|
3806
3769
|
});
|
|
3807
3770
|
}
|
|
3808
|
-
/**
|
|
3809
|
-
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
3810
|
-
*
|
|
3811
|
-
* @param {string} tag - The tag to include in each log of the new instance.
|
|
3812
|
-
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
3813
|
-
*/
|
|
3814
3771
|
withTag(tag) {
|
|
3815
3772
|
return this.withDefaults({
|
|
3816
3773
|
tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
|
|
3817
3774
|
});
|
|
3818
3775
|
}
|
|
3819
|
-
/**
|
|
3820
|
-
* Adds a custom reporter to the Consola instance.
|
|
3821
|
-
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
3822
|
-
*
|
|
3823
|
-
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
3824
|
-
* @returns {Consola} The current Consola instance.
|
|
3825
|
-
*/
|
|
3826
3776
|
addReporter(reporter) {
|
|
3827
3777
|
this.options.reporters.push(reporter);
|
|
3828
3778
|
return this;
|
|
3829
3779
|
}
|
|
3830
|
-
/**
|
|
3831
|
-
* Removes a custom reporter from the Consola instance.
|
|
3832
|
-
* If no reporter is specified, all reporters will be removed.
|
|
3833
|
-
*
|
|
3834
|
-
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
3835
|
-
* @returns {Consola} The current Consola instance.
|
|
3836
|
-
*/
|
|
3837
3780
|
removeReporter(reporter) {
|
|
3838
3781
|
if (reporter) {
|
|
3839
3782
|
const i = this.options.reporters.indexOf(reporter);
|
|
3840
|
-
if (i
|
|
3783
|
+
if (i >= 0) {
|
|
3841
3784
|
return this.options.reporters.splice(i, 1);
|
|
3842
3785
|
}
|
|
3843
3786
|
} else {
|
|
@@ -3845,12 +3788,6 @@ class Consola {
|
|
|
3845
3788
|
}
|
|
3846
3789
|
return this;
|
|
3847
3790
|
}
|
|
3848
|
-
/**
|
|
3849
|
-
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
3850
|
-
*
|
|
3851
|
-
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
3852
|
-
* @returns {Consola} The current Consola instance.
|
|
3853
|
-
*/
|
|
3854
3791
|
setReporters(reporters) {
|
|
3855
3792
|
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
3856
3793
|
return this;
|
|
@@ -3863,9 +3800,6 @@ class Consola {
|
|
|
3863
3800
|
this.restoreConsole();
|
|
3864
3801
|
this.restoreStd();
|
|
3865
3802
|
}
|
|
3866
|
-
/**
|
|
3867
|
-
* Overrides console methods with Consola logging methods for consistent logging.
|
|
3868
|
-
*/
|
|
3869
3803
|
wrapConsole() {
|
|
3870
3804
|
for (const type in this.options.types) {
|
|
3871
3805
|
if (!console["__" + type]) {
|
|
@@ -3874,9 +3808,6 @@ class Consola {
|
|
|
3874
3808
|
console[type] = this[type].raw;
|
|
3875
3809
|
}
|
|
3876
3810
|
}
|
|
3877
|
-
/**
|
|
3878
|
-
* Restores the original console methods, removing Consola overrides.
|
|
3879
|
-
*/
|
|
3880
3811
|
restoreConsole() {
|
|
3881
3812
|
for (const type in this.options.types) {
|
|
3882
3813
|
if (console["__" + type]) {
|
|
@@ -3885,9 +3816,6 @@ class Consola {
|
|
|
3885
3816
|
}
|
|
3886
3817
|
}
|
|
3887
3818
|
}
|
|
3888
|
-
/**
|
|
3889
|
-
* Overrides standard output and error streams to redirect them through Consola.
|
|
3890
|
-
*/
|
|
3891
3819
|
wrapStd() {
|
|
3892
3820
|
this._wrapStream(this.options.stdout, "log");
|
|
3893
3821
|
this._wrapStream(this.options.stderr, "log");
|
|
@@ -3903,9 +3831,6 @@ class Consola {
|
|
|
3903
3831
|
this[type].raw(String(data).trim());
|
|
3904
3832
|
};
|
|
3905
3833
|
}
|
|
3906
|
-
/**
|
|
3907
|
-
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
3908
|
-
*/
|
|
3909
3834
|
restoreStd() {
|
|
3910
3835
|
this._restoreStream(this.options.stdout);
|
|
3911
3836
|
this._restoreStream(this.options.stderr);
|
|
@@ -3919,15 +3844,9 @@ class Consola {
|
|
|
3919
3844
|
delete stream.__write;
|
|
3920
3845
|
}
|
|
3921
3846
|
}
|
|
3922
|
-
/**
|
|
3923
|
-
* Pauses logging, queues incoming logs until resumed.
|
|
3924
|
-
*/
|
|
3925
3847
|
pauseLogs() {
|
|
3926
3848
|
paused = true;
|
|
3927
3849
|
}
|
|
3928
|
-
/**
|
|
3929
|
-
* Resumes logging, processing any queued logs.
|
|
3930
|
-
*/
|
|
3931
3850
|
resumeLogs() {
|
|
3932
3851
|
paused = false;
|
|
3933
3852
|
const _queue = queue.splice(0);
|
|
@@ -3935,11 +3854,6 @@ class Consola {
|
|
|
3935
3854
|
item[0]._logFn(item[1], item[2]);
|
|
3936
3855
|
}
|
|
3937
3856
|
}
|
|
3938
|
-
/**
|
|
3939
|
-
* Replaces logging methods with mocks if a mock function is provided.
|
|
3940
|
-
*
|
|
3941
|
-
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
3942
|
-
*/
|
|
3943
3857
|
mockTypes(mockFn) {
|
|
3944
3858
|
const _mockFn = mockFn || this.options.mockFn;
|
|
3945
3859
|
this._mockFn = _mockFn;
|
|
@@ -4062,10 +3976,6 @@ function createConsola$1(options = {}) {
|
|
|
4062
3976
|
}
|
|
4063
3977
|
|
|
4064
3978
|
class BrowserReporter {
|
|
4065
|
-
options;
|
|
4066
|
-
defaultColor;
|
|
4067
|
-
levelColorMap;
|
|
4068
|
-
typeColorMap;
|
|
4069
3979
|
constructor(options) {
|
|
4070
3980
|
this.options = { ...options };
|
|
4071
3981
|
this.defaultColor = "#7f8c8d";
|
|
@@ -4154,7 +4064,8 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4154
4064
|
}
|
|
4155
4065
|
},
|
|
4156
4066
|
emits: ["update:status"],
|
|
4157
|
-
setup(__props, { emit: __emit }) {
|
|
4067
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
4068
|
+
__expose();
|
|
4158
4069
|
const props = __props;
|
|
4159
4070
|
const emit = __emit;
|
|
4160
4071
|
const theDef = shallowRef();
|
|
@@ -4197,21 +4108,30 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4197
4108
|
theDef.value = deferred;
|
|
4198
4109
|
});
|
|
4199
4110
|
}
|
|
4200
|
-
|
|
4201
|
-
return
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
};
|
|
4111
|
+
const __returned__ = { props, emit, theDef, get retryTimes() {
|
|
4112
|
+
return retryTimes;
|
|
4113
|
+
}, set retryTimes(v) {
|
|
4114
|
+
retryTimes = v;
|
|
4115
|
+
}, processingDef, init };
|
|
4116
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
4117
|
+
return __returned__;
|
|
4206
4118
|
}
|
|
4207
4119
|
});
|
|
4208
4120
|
|
|
4121
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4122
|
+
return $props.enable && $setup.theDef ? renderSlot(_ctx.$slots, "default", {
|
|
4123
|
+
key: 0,
|
|
4124
|
+
deferred: $setup.theDef
|
|
4125
|
+
}) : createCommentVNode("v-if", true);
|
|
4126
|
+
}
|
|
4127
|
+
var ParagraphView = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/broadcasting-markdown/src/paragraph.vue"]]);
|
|
4128
|
+
|
|
4209
4129
|
var _sfc_main = defineComponent({
|
|
4210
4130
|
name: "VkBroadcastingMarkdown",
|
|
4211
4131
|
components: {
|
|
4212
|
-
ParagraphView
|
|
4132
|
+
ParagraphView,
|
|
4213
4133
|
VkTypingMarkdown,
|
|
4214
|
-
HowlerSpeechView
|
|
4134
|
+
HowlerSpeechView
|
|
4215
4135
|
},
|
|
4216
4136
|
props,
|
|
4217
4137
|
emits,
|
|
@@ -4505,7 +4425,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4505
4425
|
/* STABLE_FRAGMENT */
|
|
4506
4426
|
);
|
|
4507
4427
|
}
|
|
4508
|
-
var VkBroadcastingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
4428
|
+
var VkBroadcastingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/broadcasting-markdown/src/index.vue"]]);
|
|
4509
4429
|
|
|
4510
4430
|
var types = /*#__PURE__*/Object.freeze({
|
|
4511
4431
|
__proto__: null
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { SetDataEvent } from '@vunk/core';
|
|
2
|
+
import type { Deferred } from '@vunk/shared/promise';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
import type { Paragraph, ParagraphLoadEvent, TextToSpeech } from './types';
|
|
5
|
+
import { TickerStatus } from '@vunk/shared/enum';
|
|
6
|
+
import { defaultRender } from './const';
|
|
7
|
+
export declare const props: {
|
|
8
|
+
/**
|
|
9
|
+
* @description md文本转纯文本的函数
|
|
10
|
+
*/
|
|
11
|
+
render: {
|
|
12
|
+
type: PropType<(text: string) => string>;
|
|
13
|
+
default: typeof defaultRender;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @description 段落详情
|
|
17
|
+
*/
|
|
18
|
+
data: {
|
|
19
|
+
type: {
|
|
20
|
+
(arrayLength: number): Paragraph[];
|
|
21
|
+
(...items: Paragraph[]): Paragraph[];
|
|
22
|
+
new (arrayLength: number): Paragraph[];
|
|
23
|
+
new (...items: Paragraph[]): Paragraph[];
|
|
24
|
+
isArray(arg: any): arg is any[];
|
|
25
|
+
readonly prototype: any[];
|
|
26
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
27
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
28
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
29
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
30
|
+
of<T>(...items: T[]): T[];
|
|
31
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
32
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
33
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
34
|
+
};
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @description md 文本
|
|
39
|
+
*/
|
|
40
|
+
source: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @description 游标阅读延迟
|
|
46
|
+
*/
|
|
47
|
+
delay: {
|
|
48
|
+
type: NumberConstructor;
|
|
49
|
+
default: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @description 段落切割符号
|
|
53
|
+
*/
|
|
54
|
+
separators: {
|
|
55
|
+
type: {
|
|
56
|
+
(arrayLength: number): string[];
|
|
57
|
+
(...items: string[]): string[];
|
|
58
|
+
new (arrayLength: number): string[];
|
|
59
|
+
new (...items: string[]): string[];
|
|
60
|
+
isArray(arg: any): arg is any[];
|
|
61
|
+
readonly prototype: any[];
|
|
62
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
63
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
64
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
65
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
66
|
+
of<T>(...items: T[]): T[];
|
|
67
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
68
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
69
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
70
|
+
};
|
|
71
|
+
default: () => string[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @description 组件内会根据当前游标是否和 source 长度一致来判断,是否持续阅读, 当一致时,会关闭阅读状态。但若设置为 true,则会持续阅读, 这在动态接收数据时会有用
|
|
75
|
+
*/
|
|
76
|
+
keepRead: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @description 是否使用自定义语音合成
|
|
82
|
+
*/
|
|
83
|
+
textToSpeech: {
|
|
84
|
+
type: PropType<TextToSpeech>;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @description 段落处理函数
|
|
89
|
+
*/
|
|
90
|
+
processing: {
|
|
91
|
+
type: PropType<(paragraph: Paragraph) => void>;
|
|
92
|
+
default: import("@vunk/shared").AnyFunc;
|
|
93
|
+
};
|
|
94
|
+
status: {
|
|
95
|
+
type: PropType<TickerStatus>;
|
|
96
|
+
default: TickerStatus;
|
|
97
|
+
};
|
|
98
|
+
paragraphMinlength: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export declare const emits: {
|
|
104
|
+
setData: (e: SetDataEvent) => SetDataEvent;
|
|
105
|
+
interrupt: null;
|
|
106
|
+
'update:broadcasting': (_: boolean) => boolean;
|
|
107
|
+
'update:completed': (_: boolean) => boolean;
|
|
108
|
+
'update:error': (_: boolean) => boolean;
|
|
109
|
+
'update:status': (_: TickerStatus) => boolean;
|
|
110
|
+
paragraphLoad: (_: ParagraphLoadEvent) => boolean;
|
|
111
|
+
};
|
|
112
|
+
export declare const paragraphProps: {
|
|
113
|
+
data: {
|
|
114
|
+
type: PropType<Paragraph>;
|
|
115
|
+
default: () => {};
|
|
116
|
+
};
|
|
117
|
+
deferred: {
|
|
118
|
+
type: PropType<Deferred<any>>;
|
|
119
|
+
required: true;
|
|
120
|
+
};
|
|
121
|
+
render: {
|
|
122
|
+
type: PropType<(text: string) => string>;
|
|
123
|
+
default: typeof defaultRender;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export declare const paragraphEmits: {
|
|
127
|
+
setData: (e: SetDataEvent<keyof Paragraph>) => SetDataEvent<keyof Paragraph>;
|
|
128
|
+
load: (_: ParagraphLoadEvent) => boolean;
|
|
129
|
+
};
|