@vunk/plus 1.12.2 → 1.13.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/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/components/agent-chat-provider/index.cjs +1 -0
- package/components/agent-chat-provider/index.mjs +113 -187
- package/components/agent-chat-provider/src/index.vue.d.ts +3 -2
- package/components/avatar/index.cjs +1 -0
- package/components/avatar/index.mjs +25 -31
- package/components/avatar/src/index.vue.d.ts +40 -39
- package/components/broadcasting-markdown/__tests__/const.test.d.ts +1 -0
- package/components/broadcasting-markdown/__tests__/utils.test.d.ts +1 -0
- package/components/broadcasting-markdown/index.cjs +5 -0
- package/components/broadcasting-markdown/index.mjs +346 -4376
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +18 -24
- package/components/broadcasting-markdown/src/index.vue.d.ts +101 -51
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +17 -29
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +2 -59
- package/components/bubble-list/index.cjs +1 -0
- package/components/bubble-list/index.mjs +220 -302
- package/components/bubble-list/src/core/index.vue.d.ts +40 -885
- package/components/bubble-list/src/core/loading.vue.d.ts +3 -0
- package/components/bubble-list/src/index.vue.d.ts +29 -1321
- package/components/bubble-templates/index.cjs +1 -0
- package/components/bubble-templates/index.mjs +34 -49
- package/components/bubble-templates/src/index.vue.d.ts +3 -224
- package/components/chat-independent/index.cjs +1 -0
- package/components/chat-independent/index.mjs +105 -212
- package/components/chat-independent/src/index.vue.d.ts +20 -2712
- package/components/components.css +1 -0
- package/components/drawer/index.cjs +1 -0
- package/components/drawer/index.mjs +53 -94
- package/components/drawer/src/ctx.d.ts +22 -22
- package/components/drawer/src/index.vue.d.ts +84 -557
- package/components/index.cjs +1 -0
- package/components/index.d.ts +1 -0
- package/components/lottie-animation/index.cjs +1 -0
- package/components/lottie-animation/index.mjs +36 -55
- package/components/lottie-animation/src/index.vue.d.ts +3 -2
- package/components/metahuman-broadcasting/index.cjs +1 -0
- package/components/metahuman-broadcasting/index.mjs +89 -140
- package/components/metahuman-broadcasting/src/index.vue.d.ts +16 -718
- package/components/monaco-editor/index.cjs +1 -0
- package/components/monaco-editor/index.mjs +68 -95
- package/components/monaco-editor/src/index.vue.d.ts +3 -2
- package/components/monaco-environment/index.cjs +1 -0
- package/components/monaco-environment/index.mjs +23 -38
- package/components/monaco-environment/src/index.vue.d.ts +2 -1
- package/components/pixi-frame/index.cjs +1 -0
- package/components/pixi-frame/index.mjs +501 -1978
- package/components/pixi-frame/src/apng.vue.d.ts +17 -73
- package/components/pixi-frame/src/bitmap-generator.vue.d.ts +24 -66
- package/components/pixi-frame/src/bitmap.vue.d.ts +28 -80
- package/components/pixi-frame/src/buffer-image.vue.d.ts +29 -97
- package/components/pixi-frame/src/core.vue.d.ts +20 -75
- package/components/pixi-frame/src/index.vue.d.ts +302 -237
- package/components/pixi-frame/src/provider.vue.d.ts +12 -1
- package/components/pixi-frame/src/video.vue.d.ts +17 -71
- package/components/pixi-frame/src/view.vue.d.ts +4 -16
- package/components/recorder-button/index.cjs +1 -0
- package/components/recorder-button/index.mjs +140 -269
- package/components/recorder-button/src/index.vue.d.ts +67 -66
- package/components/routes-menu-content/index.cjs +1 -0
- package/components/routes-menu-content/index.mjs +150 -229
- package/components/routes-menu-content/src/index.vue.d.ts +27 -26
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +27 -26
- package/components/routes-menu-content/src/item/index.vue.d.ts +27 -26
- package/components/scrollbar/index.cjs +1 -0
- package/components/scrollbar/index.mjs +288 -567
- package/components/scrollbar/src/bar.vue.d.ts +6 -133
- package/components/scrollbar/src/index.vue.d.ts +66 -337
- package/components/scrollbar/src/thumb.vue.d.ts +3 -80
- package/components/sender/index.cjs +1 -0
- package/components/sender/index.mjs +156 -285
- package/components/sender/src/SenderHeader.vue.d.ts +14 -221
- package/components/sender/src/index.vue.d.ts +16 -505
- package/components/speech-button/index.cjs +1 -0
- package/components/speech-button/index.mjs +98 -144
- package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -1
- package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -1
- package/components/speech-button/src/index.vue.d.ts +6 -5
- package/components/table-columns/index.cjs +1 -0
- package/components/table-columns/index.mjs +48 -78
- package/components/table-columns/src/ctx.d.ts +10 -10
- package/components/table-columns/src/el-ctx.d.ts +1 -1
- package/components/table-columns/src/index.vue.d.ts +24 -23
- package/components/tables-v1/index.cjs +1 -0
- package/components/tables-v1/index.mjs +99 -160
- package/components/tables-v1/src/ctx.d.ts +28 -28
- package/components/tables-v1/src/el-ctx.d.ts +2 -2
- package/components/tables-v1/src/index.vue.d.ts +88 -2243
- package/components/tables-v1-checkbox/index.cjs +1 -0
- package/components/tables-v1-checkbox/index.mjs +116 -4043
- package/components/tables-v1-checkbox/src/ctx.d.ts +26 -26
- package/components/tables-v1-checkbox/src/index.vue.d.ts +176 -2330
- package/components/text/index.cjs +1 -0
- package/components/text/index.mjs +70 -108
- package/components/text/src/ctx.d.ts +31 -31
- package/components/text/src/index.vue.d.ts +92 -1819
- package/components/thinking/index.cjs +1 -0
- package/components/thinking/index.mjs +127 -227
- package/components/thinking/src/index.vue.d.ts +22 -2044
- package/components/typing-markdown/index.cjs +1 -0
- package/components/typing-markdown/index.mjs +61 -201
- package/components/typing-markdown/src/index.vue.d.ts +3 -2
- package/components/vditor/index.cjs +1 -0
- package/components/vditor/index.mjs +121 -195
- package/components/vditor/src/ctx.d.ts +2 -2
- package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -2
- package/components/vditor/src/handle-value.vue.d.ts +3 -2
- package/components/vditor/src/index.vue.d.ts +5 -4
- package/components/xgplayer/index.cjs +1 -0
- package/components/xgplayer/index.mjs +49 -90
- package/components/xgplayer/src/core.vue.d.ts +13 -18
- package/components/xgplayer/src/index.vue.d.ts +13 -67
- package/composables/el-breakpoints/index.cjs +1 -0
- package/composables/el-breakpoints/index.d.ts +10 -10
- package/composables/el-breakpoints/index.mjs +10 -12
- package/composables/index.cjs +1 -0
- package/composables/index.d.ts +1 -0
- package/composables/recorder/index.cjs +1 -0
- package/composables/recorder/index.mjs +9172 -14803
- package/element/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/element/bubble/index.cjs +3 -0
- package/element/bubble/index.d.ts +1 -1
- package/element/bubble/index.mjs +1 -1
- package/element/bubble/src/index.vue.d.ts +22 -22
- package/element/index.css +1 -1
- package/element/thinking/index.cjs +1 -0
- package/element/thinking/index.d.ts +1 -1
- package/element/thinking/index.mjs +1 -1
- package/element/thinking/src/index.vue.d.ts +26 -26
- package/element/thinking/src/types.d.ts +10 -0
- package/icons/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/icons/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/icons/end/index.cjs +1 -0
- package/icons/end/index.mjs +21 -26
- package/icons/end/src/index.vue.d.ts +3 -0
- package/icons/keyboard/index.cjs +1 -0
- package/icons/keyboard/index.mjs +21 -26
- package/icons/keyboard/src/index.vue.d.ts +3 -0
- package/icons/start/index.cjs +1 -0
- package/icons/start/index.mjs +21 -26
- package/icons/start/src/index.vue.d.ts +3 -0
- package/icons/voice/index.cjs +1 -0
- package/icons/voice/index.mjs +26 -44
- package/icons/voice/src/index.vue.d.ts +2 -3
- package/index.css +2 -558
- package/index.d.ts +1 -0
- package/package.json +78 -87
- package/shared/data/index.cjs +1 -0
- package/shared/data/index.mjs +16 -22
- package/shared/types/index.cjs +1 -0
- package/shared/types/index.d.ts +1 -0
- package/components/LinkOutlined.mjs +0 -1321
- package/components/_commonjsHelpers.mjs +0 -7
- package/components/_plugin-vue_export-helper.mjs +0 -9
- package/components/bubble-list/index.css +0 -70
- package/components/bubble-templates/index.css +0 -4
- package/components/chat-independent/index.css +0 -47
- package/components/drawer/index.css +0 -124
- package/components/index2.mjs +0 -78
- package/components/lottie-animation/index.css +0 -4
- package/components/monaco-editor/index.css +0 -4
- package/components/pixi-frame/index.css +0 -4
- package/components/recorder-button/index.css +0 -69
- package/components/sender/index.css +0 -22
- package/components/speech-button/index.css +0 -10
- package/components/tables-v1/index.css +0 -7
- package/components/tables-v1-checkbox/index.css +0 -8
- package/components/thinking/index.css +0 -125
- package/components/typing-markdown/index.css +0 -31
- package/components/vditor/index.css +0 -12
- package/components/xgplayer/index.css +0 -1
- package/icons/_plugin-vue_export-helper.mjs +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@vueuse/core"),g=require("monaco-editor"),e=require("vue"),m=require("@vunk/core/shared/utils-vue"),h=require("../_plugin-vue_export-helper-BHFhmbuH.js"),u={modelValue:{type:String,default:""},defaultOptions:{type:Object,default:()=>({})},readOnly:{type:Boolean,default:!1},autoHeight:{type:Boolean,default:!1}},v=m.bindPropsFactory(u),c={"update:modelValue":null,load:o=>!0},b=m.onEmitsFactory(c),O=Object.freeze(Object.defineProperty({__proto__:null,createBindProps:v,createOnEmits:b,emits:c,props:u},Symbol.toStringTag,{value:"Module"})),V=e.defineComponent({name:"VkMonacoEditor",props:u,emits:c,setup(o,{emit:l}){const a=e.ref(),n=e.ref(""),s=e.computed(()=>{if(!(!o.autoHeight||!n.value))return{height:n.value}});return e.onMounted(()=>{const t=g.editor.create(a.value,o.defaultOptions);l("load",t);function d(){if(!o.autoHeight)return;const i=`${Math.ceil(t.getContentHeight())}px`;n.value!==i&&(n.value=i,e.nextTick(()=>{t.layout()}))}const f=y.watchPausable(()=>o.modelValue,i=>{t.setValue(i)},{immediate:!0});t.onDidChangeModelContent(()=>{f.pause(),l("update:modelValue",t.getValue()),e.nextTick(()=>{f.resume()})});const _=t.onDidContentSizeChange(d);e.watchEffect(d),e.watchEffect(()=>{t.updateOptions({readOnly:o.readOnly})});const p=new ResizeObserver(()=>{t.layout()});p.observe(a.value),e.onBeforeUnmount(()=>{_.dispose(),p.disconnect(),t.dispose()})}),{editorNode:a,editorStyle:s}}});function M(o,l,a,n,s,t){return e.openBlock(),e.createElementBlock("div",{ref:"editorNode",class:"vk-monaco-editor",style:e.normalizeStyle(o.editorStyle)},null,4)}const r=h._export_sfc(V,[["render",M]]),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));r.install=o=>{o.component(r.name||"VkMonacoEditor",r)};exports.VkMonacoEditor=r;exports._VkMonacoEditorCtx=O;exports.__VkMonacoEditor=E;exports.default=r;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { watchPausable } from
|
|
2
|
-
import { editor } from
|
|
3
|
-
import { defineComponent, ref, computed, onMounted, nextTick, watchEffect, onBeforeUnmount
|
|
4
|
-
import { bindPropsFactory, onEmitsFactory } from
|
|
5
|
-
import { _ as
|
|
6
|
-
|
|
7
|
-
const props = {
|
|
1
|
+
import { watchPausable as g } from "@vueuse/core";
|
|
2
|
+
import { editor as h } from "monaco-editor";
|
|
3
|
+
import { defineComponent as b, ref as p, computed as v, onMounted as O, nextTick as m, watchEffect as y, onBeforeUnmount as V, createElementBlock as M, openBlock as S, normalizeStyle as k } from "vue";
|
|
4
|
+
import { bindPropsFactory as E, onEmitsFactory as x } from "@vunk/core/shared/utils-vue";
|
|
5
|
+
import { _ as z } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
6
|
+
const i = {
|
|
8
7
|
modelValue: {
|
|
9
8
|
type: String,
|
|
10
9
|
default: ""
|
|
@@ -15,117 +14,91 @@ const props = {
|
|
|
15
14
|
},
|
|
16
15
|
readOnly: {
|
|
17
16
|
type: Boolean,
|
|
18
|
-
default:
|
|
17
|
+
default: !1
|
|
19
18
|
},
|
|
20
19
|
autoHeight: {
|
|
21
20
|
type: Boolean,
|
|
22
|
-
default:
|
|
21
|
+
default: !1
|
|
23
22
|
}
|
|
24
|
-
}
|
|
25
|
-
const createBindProps = bindPropsFactory(props);
|
|
26
|
-
const emits = {
|
|
23
|
+
}, C = E(i), c = {
|
|
27
24
|
"update:modelValue": null,
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
const createOnEmits = onEmitsFactory(emits);
|
|
31
|
-
|
|
32
|
-
var ctx = /*#__PURE__*/Object.freeze({
|
|
25
|
+
load: (t) => !0
|
|
26
|
+
}, H = x(c), F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
33
27
|
__proto__: null,
|
|
34
|
-
createBindProps:
|
|
35
|
-
createOnEmits:
|
|
36
|
-
emits:
|
|
37
|
-
props:
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
var _sfc_main = defineComponent({
|
|
28
|
+
createBindProps: C,
|
|
29
|
+
createOnEmits: H,
|
|
30
|
+
emits: c,
|
|
31
|
+
props: i
|
|
32
|
+
}, Symbol.toStringTag, { value: "Module" })), j = b({
|
|
41
33
|
name: "VkMonacoEditor",
|
|
42
|
-
props,
|
|
43
|
-
emits,
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
height: autoHeight.value
|
|
52
|
-
};
|
|
34
|
+
props: i,
|
|
35
|
+
emits: c,
|
|
36
|
+
setup(t, { emit: r }) {
|
|
37
|
+
const n = p(), o = p(""), s = v(() => {
|
|
38
|
+
if (!(!t.autoHeight || !o.value))
|
|
39
|
+
return {
|
|
40
|
+
height: o.value
|
|
41
|
+
};
|
|
53
42
|
});
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
function
|
|
58
|
-
if (!
|
|
59
|
-
return;
|
|
60
|
-
const nextHeight = `${Math.ceil(editor$1.getContentHeight())}px`;
|
|
61
|
-
if (autoHeight.value === nextHeight)
|
|
43
|
+
return O(() => {
|
|
44
|
+
const e = h.create(n.value, t.defaultOptions);
|
|
45
|
+
r("load", e);
|
|
46
|
+
function u() {
|
|
47
|
+
if (!t.autoHeight)
|
|
62
48
|
return;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
49
|
+
const a = `${Math.ceil(e.getContentHeight())}px`;
|
|
50
|
+
o.value !== a && (o.value = a, m(() => {
|
|
51
|
+
e.layout();
|
|
52
|
+
}));
|
|
67
53
|
}
|
|
68
|
-
const
|
|
69
|
-
() =>
|
|
70
|
-
(
|
|
71
|
-
|
|
54
|
+
const d = g(
|
|
55
|
+
() => t.modelValue,
|
|
56
|
+
(a) => {
|
|
57
|
+
e.setValue(a);
|
|
72
58
|
},
|
|
73
59
|
{
|
|
74
|
-
immediate:
|
|
60
|
+
immediate: !0
|
|
75
61
|
}
|
|
76
62
|
);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
nextTick(() => {
|
|
81
|
-
subjectModelValueWatcher.resume();
|
|
63
|
+
e.onDidChangeModelContent(() => {
|
|
64
|
+
d.pause(), r("update:modelValue", e.getValue()), m(() => {
|
|
65
|
+
d.resume();
|
|
82
66
|
});
|
|
83
67
|
});
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
readOnly: props2.readOnly
|
|
68
|
+
const _ = e.onDidContentSizeChange(u);
|
|
69
|
+
y(u), y(() => {
|
|
70
|
+
e.updateOptions({
|
|
71
|
+
readOnly: t.readOnly
|
|
89
72
|
});
|
|
90
73
|
});
|
|
91
|
-
const
|
|
92
|
-
|
|
74
|
+
const f = new ResizeObserver(() => {
|
|
75
|
+
e.layout();
|
|
93
76
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
contentSizeDisposable.dispose();
|
|
97
|
-
resizeObserver.disconnect();
|
|
98
|
-
editor$1.dispose();
|
|
77
|
+
f.observe(n.value), V(() => {
|
|
78
|
+
_.dispose(), f.disconnect(), e.dispose();
|
|
99
79
|
});
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
editorStyle
|
|
80
|
+
}), {
|
|
81
|
+
editorNode: n,
|
|
82
|
+
editorStyle: s
|
|
104
83
|
};
|
|
105
84
|
}
|
|
106
85
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
class: "vk-monaco-editor",
|
|
114
|
-
style: normalizeStyle(_ctx.editorStyle)
|
|
115
|
-
},
|
|
116
|
-
null,
|
|
117
|
-
4
|
|
118
|
-
/* STYLE */
|
|
119
|
-
);
|
|
86
|
+
function B(t, r, n, o, s, e) {
|
|
87
|
+
return S(), M("div", {
|
|
88
|
+
ref: "editorNode",
|
|
89
|
+
class: "vk-monaco-editor",
|
|
90
|
+
style: k(t.editorStyle)
|
|
91
|
+
}, null, 4);
|
|
120
92
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
93
|
+
const l = /* @__PURE__ */ z(j, [["render", B]]), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
124
94
|
__proto__: null
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
95
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
96
|
+
l.install = (t) => {
|
|
97
|
+
t.component(l.name || "VkMonacoEditor", l);
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
l as VkMonacoEditor,
|
|
101
|
+
F as _VkMonacoEditorCtx,
|
|
102
|
+
N as __VkMonacoEditor,
|
|
103
|
+
l as default
|
|
129
104
|
};
|
|
130
|
-
|
|
131
|
-
export { VkMonacoEditor, ctx as _VkMonacoEditorCtx, types as __VkMonacoEditor, VkMonacoEditor as default };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import { editor as mEditor } from 'monaco-editor';
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
6
|
modelValue: {
|
|
5
7
|
type: StringConstructor;
|
|
6
8
|
default: string;
|
|
@@ -51,4 +53,3 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
51
53
|
defaultOptions: mEditor.IStandaloneEditorConstructionOptions;
|
|
52
54
|
autoHeight: boolean;
|
|
53
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
|
-
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("monaco-editor/esm/vs/editor/editor.worker?worker"),s=require("monaco-editor/esm/vs/language/css/css.worker?worker"),i=require("monaco-editor/esm/vs/language/html/html.worker?worker"),c=require("monaco-editor/esm/vs/language/json/json.worker?worker"),u=require("monaco-editor/esm/vs/language/typescript/ts.worker?worker"),o=require("vue"),a=require("../_plugin-vue_export-helper-BHFhmbuH.js"),p=o.defineComponent({name:"VkMonacoEnvironment",setup(){return globalThis.MonacoEnvironment={getWorker(n,e){return e==="json"?new c:e==="css"||e==="scss"||e==="less"?new s:e==="html"||e==="handlebars"||e==="razor"?new i:["typescript","javascript"].includes(e)?new u:new t}},{}}});function _(n,e,m,f,k,l){return o.renderSlot(n.$slots,"default")}const r=a._export_sfc(p,[["render",_]]),d=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));r.install=n=>{n.component(r.name||"VkMonacoEnvironment",r)};exports.VkMonacoEnvironment=r;exports.__VkMonacoEnvironment=d;exports.default=r;
|
|
@@ -1,46 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { defineComponent, renderSlot } from
|
|
7
|
-
import { _ as
|
|
8
|
-
|
|
9
|
-
var _sfc_main = defineComponent({
|
|
1
|
+
import e from "monaco-editor/esm/vs/editor/editor.worker?worker";
|
|
2
|
+
import t from "monaco-editor/esm/vs/language/css/css.worker?worker";
|
|
3
|
+
import s from "monaco-editor/esm/vs/language/html/html.worker?worker";
|
|
4
|
+
import i from "monaco-editor/esm/vs/language/json/json.worker?worker";
|
|
5
|
+
import m from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
|
|
6
|
+
import { defineComponent as c, renderSlot as p } from "vue";
|
|
7
|
+
import { _ as f } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
|
+
const a = c({
|
|
10
9
|
name: "VkMonacoEnvironment",
|
|
11
10
|
setup() {
|
|
12
|
-
globalThis.MonacoEnvironment = {
|
|
13
|
-
getWorker(
|
|
14
|
-
|
|
15
|
-
return new JsonWorker();
|
|
16
|
-
}
|
|
17
|
-
if (label === "css" || label === "scss" || label === "less") {
|
|
18
|
-
return new CssWorker();
|
|
19
|
-
}
|
|
20
|
-
if (label === "html" || label === "handlebars" || label === "razor") {
|
|
21
|
-
return new HtmlWorker();
|
|
22
|
-
}
|
|
23
|
-
if (["typescript", "javascript"].includes(label)) {
|
|
24
|
-
return new TsWorker();
|
|
25
|
-
}
|
|
26
|
-
return new EditorWorker();
|
|
11
|
+
return globalThis.MonacoEnvironment = {
|
|
12
|
+
getWorker(o, r) {
|
|
13
|
+
return r === "json" ? new i() : r === "css" || r === "scss" || r === "less" ? new t() : r === "html" || r === "handlebars" || r === "razor" ? new s() : ["typescript", "javascript"].includes(r) ? new m() : new e();
|
|
27
14
|
}
|
|
28
|
-
};
|
|
29
|
-
return {};
|
|
15
|
+
}, {};
|
|
30
16
|
}
|
|
31
17
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return renderSlot(_ctx.$slots, "default");
|
|
18
|
+
function u(o, r, _, d, k, v) {
|
|
19
|
+
return p(o.$slots, "default");
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
21
|
+
const n = /* @__PURE__ */ f(a, [["render", u]]), j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
39
22
|
__proto__: null
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
23
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
24
|
+
n.install = (o) => {
|
|
25
|
+
o.component(n.name || "VkMonacoEnvironment", n);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
n as VkMonacoEnvironment,
|
|
29
|
+
j as __VkMonacoEnvironment,
|
|
30
|
+
n as default
|
|
44
31
|
};
|
|
45
|
-
|
|
46
|
-
export { VkMonacoEnvironment, types as __VkMonacoEnvironment, VkMonacoEnvironment as default };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
2
|
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),r=require("@vunk/shared/enum"),D=require("@vunk/shared/promise"),ee=require("apng-js"),x=require("pixi.js"),O=require("@vunk/shared/object"),z=require("@vunk/core/composables"),te=require("../_plugin-vue_export-helper-BHFhmbuH.js"),E={url:{type:String,requierd:!1},data:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1},status:{type:String,default:r.TickerStatus.pending},frameRate:{type:Number,default:25},label:{type:String,default:""},resize:{type:Function,default:void 0},prerender:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},$={"update:status":null,"update:data":null,setData:null},L=Symbol("appInjectKey");function ae(){const n=new x.Application,m=new D.Deferred,e={whenDef:m,when:()=>m.promise};return t.provide(L,{application:n,context:e}),{application:n,context:e}}function N(){const n=t.inject(L);if(!n)throw new Error("Pixi app not provided");return n}function I(n){const m=n.autoResize??!0,e=n.resize??v,{application:a,context:_}=N(),c=new x.Sprite;a.stage.addChild(c),t.watchEffect(()=>{c.visible=n.visible??!0}),t.watchEffect(()=>{n.label&&(c.label=n.label)}),m&&_.when().then(k=>{c.texture&&(h(),k.renderer.on("resize",h))});function h(){if(!a.renderer?.screen)return;const k=c.texture._meta;e({application:a,sprite:c,meta:k})}t.onBeforeUnmount(()=>{a.renderer.off("resize",h),a.stage.removeChild(c)});function v(){const k=a.screen.width/c.texture.width,s=a.screen.height/c.texture.height,T=Math.min(k,s);c.scale.set(T),c.x=(a.screen.width-c.width)/2,c.y=(a.screen.height-c.height)/2}return{sprite:c,resizeSprite:h,application:a}}const G=t.defineComponent({__name:"apng",props:{...E,url:{type:String,required:!0}},emits:$,setup(n,{emit:m}){const e=n,a=m,_=t.useId(),c=u=>`${_}-apng-frame-${u}`,{sprite:h,resizeSprite:v}=I(e),k=t.ref([]),s=t.ref(0),T=t.ref(!1),g=t.ref(""),l=new Map;let i=null,d=null,F=null;t.onMounted(()=>b(e.url));function C(u,w){return d||(d=document.createElement("canvas"),F=d.getContext("2d",{willReadFrequently:!0})),(d.width!==u||d.height!==w)&&(d.width=u,d.height=w),{canvas:d,ctx:F}}async function b(u){try{g.value="",T.value=!1,await S();const w=await fetch(u);if(!w.ok)throw new Error(`加载APNG失败: ${w.status}`);const A=await w.arrayBuffer(),P=ee(A);if(P instanceof Error)throw new TypeError(`APNG解析失败: ${P.message}`);const{canvas:B,ctx:q}=C(P.width,P.height),X=P.frames.map(async(M,U)=>{q.clearRect(0,0,B.width,B.height),await M.createImage();const J=M.imageElement;q.drawImage(J,M.left,M.top);const Q=q.getImageData(0,0,B.width,B.height),V=c(U);l.set(V,void 0),q.putImageData(Q,0,0);const Z=B.toDataURL();x.Assets.add({alias:V,src:Z});const j=await x.Assets.load(V);return l.set(V,j),U===0&&(h.texture=j,v()),V});k.value=await Promise.all(X),T.value=!0}catch(w){console.error("加载APNG失败:",w),g.value=w instanceof Error?w.message:"加载APNG失败",a("update:status",r.TickerStatus.stopped)}}function y(){i===null&&(i=window.setInterval(()=>{if(k.value.length===0||e.status!==r.TickerStatus.playing)return;const u=l.get(c(s.value));if(u){const w=s.value-1;w>=0&&!e.loop&&Promise.resolve().then(()=>D.sleep(500)).then(()=>{x.Assets.unload(c(w)),l.delete(c(w))}),h.texture=u,v(),s.value=e.loop?(s.value+1)%k.value.length:s.value+1}else e.loop||a("update:status",r.TickerStatus.paused)},1e3/e.frameRate))}function p(){!T.value||k.value.length<=1||(a("update:status",r.TickerStatus.playing),y())}function o(){i!==null&&(clearInterval(i),i=null),a("update:status",r.TickerStatus.paused)}function f(){i!==null&&(clearInterval(i),i=null),s.value=0;const u=l.get(c(0));u&&(h.texture=u,v()),a("update:status",r.TickerStatus.stopped)}async function S(){i!==null&&(clearInterval(i),i=null);const u=[];for(const[w,A]of l)A&&A!==x.Texture.EMPTY&&u.push(x.Assets.unload(w));await Promise.all(u),l.clear(),k.value=[],s.value=0,T.value=!1,g.value="",d&&(d.width=0,d.height=0)}return t.watchEffect(()=>{switch(e.status){case r.TickerStatus.play:p();break;case r.TickerStatus.pause:o();break;case r.TickerStatus.stop:f();break}}),t.onBeforeUnmount(async()=>{await S(),d=null,F=null}),(u,w)=>t.renderSlot(u.$slots,"default")}}),ne=t.defineComponent({__name:"bitmap-generator",props:{...O.pickObject(E,{excludes:["loop"]}),generator:{type:Object,required:!0}},emits:{"update:status":null,load:n=>n},setup(n,{emit:m}){const e=n,a=m,{sprite:_,resizeSprite:c,application:h}=I(e),v=new x.Texture({dynamic:!0});_.texture=v;function k(i){v.source.destroy();const d=new x.ImageSource({resource:i});v.source=d,v.update(),c()}a("load",{application:h,sprite:_}),t.watch(()=>e.status,i=>{i===r.TickerStatus.play&&T(),i===r.TickerStatus.pause&&g(),i===r.TickerStatus.stop&&l()},{immediate:!0});function s(){e.status===r.TickerStatus.playing&&e.generator.next().then(({value:i,done:d})=>{if(d)return a("update:status",r.TickerStatus.stopped);k(i)})}function T(){h.ticker.minFPS=e.frameRate,h.ticker.maxFPS=e.frameRate,a("update:status",r.TickerStatus.playing),h.ticker.add(s)}function g(){h.ticker.remove(s),a("update:status",r.TickerStatus.paused)}function l(){h.ticker.remove(s),a("update:status",r.TickerStatus.stopped)}return t.onBeforeUnmount(()=>{l(),v.destroy()}),(i,d)=>t.renderSlot(i.$slots,"default")}}),K=t.defineComponent({__name:"bitmap",props:{...O.pickObject(E,{excludes:["loop"]}),data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...$,load:n=>n,"update:frameIndex":null,notFound:n=>!0},setup(n,{emit:m}){const e=n,a=m,{sprite:_,resizeSprite:c,application:h}=I(e),v=new x.Texture({dynamic:!0});_.texture=v;function k(o){v.source?.resource?.close(),v.source?.destroy();const f=new x.ImageSource({resource:o});v.source=f,v.update(),c()}a("load",{application:h,sprite:_});const s=z.useModelComputed({default:0,key:"frameIndex"},e,a),T=t.ref(-1);function g(o){o<=T.value||(T.value=o,D.sleep(0).then(()=>{a("setData",{k:o,v:null})}))}let l=null,i=0,d=0,F=0;function C(){if(l!==null)return;i=performance.now(),F=i,d=0;function o(){const S=performance.now(),u=1e3/e.frameRate,w=S-i;if(w>=u){i=S-w%u,f(),d++;const A=S-F;if(A>=1e3){const P=Math.round(d*1e3/A);console.log(`[Bitmap] FPS: ${P}`),d=0,F=S}}e.status===r.TickerStatus.playing?l=requestAnimationFrame(o):l=null}function f(){if(e.data.length===0||e.status!==r.TickerStatus.playing)return;const S=e.data[s.value];if(S){const u=s.value-1;u>=0&&g(u),k(S),s.value=s.value+1}else console.warn(`Bitmap for index ${s.value} not found. Ensure the data is loaded.`),a("notFound",s.value)}l=requestAnimationFrame(o)}t.watchEffect(()=>{e.prerender&&s.value===0&&e.data.length>0&&e.data[0]&&k(e.data[0])}),t.watch(()=>e.status,o=>{o===r.TickerStatus.play&&b(),o===r.TickerStatus.pause&&y(),o===r.TickerStatus.stop&&p()},{immediate:!0});function b(){e.data.length>0?(a("update:status",r.TickerStatus.playing),C()):a("update:status",r.TickerStatus.stopped)}function y(){a("update:status",r.TickerStatus.paused)}function p(){a("update:status",r.TickerStatus.stopped),l!==null&&(cancelAnimationFrame(l),l=null),a("update:data",[]),s.value=0,T.value=-1}return t.onBeforeUnmount(()=>{p(),v.destroy()}),(o,f)=>t.renderSlot(o.$slots,"default")}}),re=t.defineComponent({__name:"buffer-image",props:{...O.pickObject(E,{excludes:["loop"]}),data:{type:Array,required:!0},format:{type:String,default:"rgba8unorm"},frameIndex:{type:Number},height:{type:Number,required:!0},width:{type:Number,required:!0}},emits:{...$,load:n=>n,"update:frameIndex":null,notFound:n=>!0},setup(n,{emit:m}){const e=n,a=m,{sprite:_,resizeSprite:c,application:h}=I(e),v=new x.Texture({dynamic:!0});_.texture=v;function k(o){v.source?.destroy();const f=new x.BufferImageSource({resource:o,height:e.height,width:e.width,format:e.format});v.source=f,v.update(),c()}a("load",{application:h,sprite:_});const s=z.useModelComputed({default:0,key:"frameIndex"},e,a),T=t.ref(-1);function g(o){o<=T.value||(T.value=o,D.sleep(0).then(()=>{a("setData",{k:o,v:null})}))}let l=null,i=0,d=0,F=0;function C(){if(l!==null)return;i=performance.now(),F=i,d=0;function o(){const S=performance.now(),u=1e3/e.frameRate,w=S-i;if(w>=u){i=S-w%u,f(),d++;const A=S-F;if(A>=1e3){const P=Math.round(d*1e3/A);console.log(`[Bitmap] FPS: ${P}`),d=0,F=S}}e.status===r.TickerStatus.playing?l=requestAnimationFrame(o):l=null}function f(){if(e.data.length===0||e.status!==r.TickerStatus.playing)return;const S=e.data[s.value];if(S){const u=s.value-1;u>=0&&g(u),k(S),s.value=s.value+1}else console.warn(`Bitmap for index ${s.value} not found. Ensure the data is loaded.`),a("notFound",s.value)}l=requestAnimationFrame(o)}t.watchEffect(()=>{e.prerender&&s.value===0&&e.data.length>0&&e.data[0]&&k(e.data[0])}),t.watch(()=>e.status,o=>{o===r.TickerStatus.play&&b(),o===r.TickerStatus.pause&&y(),o===r.TickerStatus.stop&&p()},{immediate:!0});function b(){e.data.length>0?(a("update:status",r.TickerStatus.playing),C()):a("update:status",r.TickerStatus.stopped)}function y(){a("update:status",r.TickerStatus.paused)}function p(){a("update:status",r.TickerStatus.stopped),l!==null&&(cancelAnimationFrame(l),l=null),a("update:data",[]),s.value=0,T.value=-1}return t.onBeforeUnmount(()=>{p(),v.destroy()}),(o,f)=>t.renderSlot(o.$slots,"default")}}),se=t.defineComponent({__name:"core",props:{...E,data:{type:void 0,required:!0},frameIndex:{type:Number}},emits:{...$,load:n=>n,"update:frameIndex":null,notFound:n=>!0},setup(n,{emit:m}){const e=n,a=m,_=t.useId(),c=p=>`${_}-${p}`,{sprite:h,resizeSprite:v,application:k}=I(e),s=new Map,T=t.ref(0),g=t.computed(()=>e.data.slice(T.value));t.watchEffect(()=>{for(const p in g.value){const o=+p+T.value,f=`${_}-${o}`,S=typeof g.value[p]=="string"?g.value[p]:g.value[p]?.src;S&&(s.has(f)||(x.Assets.add({alias:f,src:S,loadParser:"loadTextures"}),s.set(f,void 0),x.Assets.load(f).then(u=>{u._meta=g.value[p],s.set(f,u),e.prerender&&o===0&&(h.texture=u,v())})))}}),a("load",{application:k,sprite:h});const l=z.useModelComputed({default:0,key:"frameIndex"},e,a);let i=null,d=0;function F(){if(i!==null)return;d=performance.now();function p(){const f=performance.now(),S=1e3/e.frameRate,u=f-d;u>=S&&(d=f-u%S,o()),e.status===r.TickerStatus.playing?i=requestAnimationFrame(p):i=null}function o(){if(e.data.length===0||e.status!==r.TickerStatus.playing)return;const f=s.get(c(l.value));if(f){const S=h.texture,u=l.value-1;S&&u>=0&&!e.loop&&Promise.resolve(D.sleep(500)).then(()=>x.Assets.unload(c(u))).then(()=>{s.set(c(u),void 0),a("setData",{k:u,v:""}),T.value=u}),h.texture=f,v(),l.value=e.loop?(l.value+1)%e.data.length:l.value+1}else console.warn(`Texture for index ${l.value} not found. Ensure the texture is loaded.`),a("notFound",l.value),e.loop||a("update:status",r.TickerStatus.paused)}i=requestAnimationFrame(p)}t.watch(()=>e.status,p=>{p===r.TickerStatus.play&&C(),p===r.TickerStatus.pause&&b(),p===r.TickerStatus.stop&&y()},{immediate:!0});function C(){e.data.length>0?(a("update:status",r.TickerStatus.playing),F()):a("update:status",r.TickerStatus.stopped)}function b(){a("update:status",r.TickerStatus.paused)}function y(){a("update:status",r.TickerStatus.stopped),i!==null&&(cancelAnimationFrame(i),i=null),a("update:data",[]),s.clear(),l.value=0}return t.onBeforeUnmount(()=>{Array.from(s.entries()).forEach(([o,f])=>{f&&x.Assets.unload(o)}),y()}),(p,o)=>t.renderSlot(p.$slots,"default")}}),H=t.defineComponent({__name:"provider",setup(n){return ae(),(m,e)=>t.renderSlot(m.$slots,"default")}}),Y=t.defineComponent({__name:"video",props:{...E,url:{type:String,required:!0}},emits:$,setup(n,{emit:m}){const e=n,a=m,_=t.useId(),c=()=>`${_}-video`,{sprite:h,resizeSprite:v}=I(e),k=t.ref(),s=t.computed(()=>{if(k.value?.source&&k.value.source.resource){const y=k.value.source.resource;if(y instanceof HTMLVideoElement)return y}return null}),T=z.useDeferred(),g=t.ref("");T.promise.then(()=>{e.status===r.TickerStatus.play&&F()}),t.watchEffect(()=>{s.value&&(s.value.loop=e.loop)}),t.onMounted(()=>l(e.url));async function l(y){try{g.value="";const p=c();x.Assets.cache.has(p)&&await x.Assets.unload(p),x.Assets.add({alias:p,src:y});const o=await x.Assets.load(p);return k.value=o,h.texture=o,s.value&&(s.value.loop=e.loop,s.value.muted=!0,s.value.crossOrigin="anonymous",i(s.value),T.resolve()),v(),o}catch(p){return console.error("加载视频纹理失败:",p),g.value="视频加载失败",null}}function i(y){y.addEventListener("play",()=>{e.status!==r.TickerStatus.playing&&a("update:status",r.TickerStatus.playing)}),y.addEventListener("pause",()=>{e.status!==r.TickerStatus.paused&&a("update:status",r.TickerStatus.paused)}),y.addEventListener("ended",()=>{e.loop?(y.currentTime=0,y.play()):a("update:status",r.TickerStatus.stopped)}),y.addEventListener("error",p=>{const o=y.error;let f="视频播放失败";if(o)switch(o.code){case o.MEDIA_ERR_ABORTED:f="视频播放被中止";break;case o.MEDIA_ERR_NETWORK:f="网络错误导致视频播放失败";break;case o.MEDIA_ERR_DECODE:f="视频解码失败";break;case o.MEDIA_ERR_SRC_NOT_SUPPORTED:f="不支持的视频格式";break}console.error("视频播放错误:",f,p),g.value=f,a("update:status",r.TickerStatus.stopped)})}async function d(){if(k.value){const y=c();k.value.destroy(!0),k.value=void 0,x.Assets.cache.has(y)&&await x.Assets.unload(y)}g.value=""}t.watchEffect(()=>{e.status===r.TickerStatus.play&&F(),e.status===r.TickerStatus.pause&&C(),e.status===r.TickerStatus.stop&&b()}),t.onBeforeUnmount(()=>{d()});function F(){s.value&&s.value.play().catch(y=>{console.error("视频播放失败:",y),g.value="视频播放失败"})}function C(){s.value?.pause()}function b(){s.value&&(s.value.pause(),s.value.currentTime=0),a("update:status",r.TickerStatus.stopped)}return(y,p)=>t.renderSlot(y.$slots,"default")}}),W=t.defineComponent({__name:"view",props:{defaultOptions:{type:Object,default:()=>({})}},setup(n){const m=n,{application:e,context:a}=N(),_=t.ref();return t.onMounted(async()=>{await e.init({resizeTo:_.value,...m.defaultOptions}),a.whenDef.resolve(e),_.value.appendChild(e.canvas)}),(c,h)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"appRef",ref:_,class:"vk-pixi-frame"},null,512))}}),oe=t.defineComponent({name:"VkPixiFrame",components:{ApngComp:G,ProviderComp:H,ViewComp:W,VideoComp:Y,Bitmap:K},props:E,emits:$,setup(n){const m=t.computed(()=>{if(!n.url)return!1;const a=n.url.toLowerCase();return a.includes(".png")&&!a.includes(".mp4")&&!a.includes(".webm")}),e=t.computed(()=>{if(!n.url)return!1;const a=n.url.toLowerCase();return a.includes(".mp4")||a.includes(".webm")||a.includes(".mov")});return{isApng:m,isVideo:e}}});function ue(n,m,e,a,_,c){const h=t.resolveComponent("ViewComp"),v=t.resolveComponent("ApngComp"),k=t.resolveComponent("VideoComp"),s=t.resolveComponent("Bitmap"),T=t.resolveComponent("ProviderComp");return t.openBlock(),t.createBlock(T,null,{default:t.withCtx(()=>[t.createVNode(h),n.isApng&&n.url?(t.openBlock(),t.createBlock(v,{key:0,url:n.url,loop:n.loop,status:n.status,"onUpdate:status":m[0]||(m[0]=g=>n.$emit("update:status",g))},null,8,["url","loop","status"])):n.isVideo&&n.url?(t.openBlock(),t.createBlock(k,{key:1,url:n.url,loop:n.loop,status:n.status,"onUpdate:status":m[1]||(m[1]=g=>n.$emit("update:status",g))},null,8,["url","loop","status"])):(t.openBlock(),t.createBlock(s,{key:2,data:n.data,loop:n.loop,status:n.status,onSetData:m[2]||(m[2]=g=>n.$emit("setData",g)),"onUpdate:status":m[3]||(m[3]=g=>n.$emit("update:status",g))},null,8,["data","loop","status"]))]),_:1})}const R=te._export_sfc(oe,[["render",ue]]),ie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));R.install=n=>{n.component(R.name||"VkPixiFrame",R)};Object.defineProperty(exports,"TickerStatus",{enumerable:!0,get:()=>r.TickerStatus});exports.VkPixiFrame=R;exports.VkPixiFrameApng=G;exports.VkPixiFrameBitmap=K;exports.VkPixiFrameBitmapGenerator=ne;exports.VkPixiFrameBufferImage=re;exports.VkPixiFrameCore=se;exports.VkPixiFrameProvider=H;exports.VkPixiFrameVideo=Y;exports.VkPixiFrameView=W;exports.__VkPixiFrame=ie;exports.default=R;exports.usePixiApp=N;exports.useSprite=I;
|