@vunk/plus 0.0.0-alpha.2
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/api/index.d.ts +0 -0
- package/api/index.mjs +1 -0
- package/api/user/index.d.ts +3 -0
- package/api/user/index.mjs +18 -0
- package/api/user/types.d.ts +5 -0
- package/components/_plugin-vue_export-helper.mjs +9 -0
- package/components/lottie-animation/index.css +4 -0
- package/components/lottie-animation/index.d.ts +4 -0
- package/components/lottie-animation/index.mjs +72 -0
- 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/monaco-editor/index.css +4 -0
- package/components/monaco-editor/index.d.ts +4 -0
- package/components/monaco-editor/index.mjs +83 -0
- package/components/monaco-editor/src/ctx.d.ts +19 -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 +46 -0
- 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/typing-markdown/index.css +12 -0
- package/components/typing-markdown/index.d.ts +4 -0
- package/components/typing-markdown/index.mjs +135 -0
- package/components/typing-markdown/src/core.d.ts +2 -0
- package/components/typing-markdown/src/ctx.d.ts +24 -0
- package/components/typing-markdown/src/index.vue.d.ts +48 -0
- package/components/typing-markdown/src/types.d.ts +1 -0
- package/composables/index.d.ts +0 -0
- package/composables/index.mjs +1 -0
- package/index.css +22 -0
- package/index.esm.js +1 -0
- package/package.json +95 -0
- package/shared/chatgpt/index.d.ts +1 -0
- package/shared/chatgpt/index.mjs +3 -0
- package/shared/chatgpt/response/enum.d.ts +6 -0
- package/shared/chatgpt/response/index.d.ts +6 -0
- package/shared/chatgpt/response/index.mjs +16 -0
- package/shared/chatgpt/response/sse/index.d.ts +2 -0
- package/shared/chatgpt/response/sse/index.mjs +1 -0
- package/shared/chatgpt/response/sse/message/index.d.ts +4 -0
- package/shared/chatgpt/response/sse/message/index.mjs +8 -0
- package/shared/chatgpt/response/sse/message/types.d.ts +15 -0
- package/shared/chatgpt/response/sse/types.d.ts +6 -0
- package/shared/fetch/base/index.d.ts +9 -0
- package/shared/fetch/base/index.mjs +17 -0
- package/shared/fetch/ssr/index.d.ts +3 -0
- package/shared/fetch/ssr/index.mjs +11 -0
- package/shared/index.d.ts +0 -0
- package/shared/index.mjs +1 -0
- package/stores/index.d.ts +0 -0
- package/stores/index.mjs +1 -0
- package/theme/index.d.ts +0 -0
- package/theme/index.mjs +1 -0
package/api/index.d.ts
ADDED
|
File without changes
|
package/api/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, openBlock, createElementBlock, Fragment, createElementVNode, renderSlot } from 'vue';
|
|
2
|
+
import lottie from 'lottie-web';
|
|
3
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const props = {
|
|
6
|
+
path: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const emits = {
|
|
12
|
+
load: (e) => e
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _sfc_main = defineComponent({
|
|
16
|
+
name: "VkLottieAnimation",
|
|
17
|
+
props,
|
|
18
|
+
emits,
|
|
19
|
+
setup(props2, { emit }) {
|
|
20
|
+
const lottieNode = ref();
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
const animation = lottie.loadAnimation({
|
|
23
|
+
container: lottieNode.value,
|
|
24
|
+
renderer: "svg",
|
|
25
|
+
loop: false,
|
|
26
|
+
autoplay: false,
|
|
27
|
+
path: props2.path
|
|
28
|
+
});
|
|
29
|
+
animation.addEventListener("complete", () => {
|
|
30
|
+
emit("load", { animation });
|
|
31
|
+
});
|
|
32
|
+
animation.goToAndPlay(50 * animation.totalFrames / 100);
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
lottieNode
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const _hoisted_1 = {
|
|
41
|
+
ref: "lottieNode",
|
|
42
|
+
class: "vk-lottie-animation"
|
|
43
|
+
};
|
|
44
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
|
+
return openBlock(), createElementBlock(
|
|
46
|
+
Fragment,
|
|
47
|
+
null,
|
|
48
|
+
[
|
|
49
|
+
createElementVNode(
|
|
50
|
+
"div",
|
|
51
|
+
_hoisted_1,
|
|
52
|
+
null,
|
|
53
|
+
512
|
|
54
|
+
/* NEED_PATCH */
|
|
55
|
+
),
|
|
56
|
+
renderSlot(_ctx.$slots, "default")
|
|
57
|
+
],
|
|
58
|
+
64
|
|
59
|
+
/* STABLE_FRAGMENT */
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
var VkLottieAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\lottie-animation\\src\\index.vue"]]);
|
|
63
|
+
|
|
64
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
65
|
+
__proto__: null
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
VkLottieAnimation.install = (app) => {
|
|
69
|
+
app.component(VkLottieAnimation.name || "VkLottieAnimation", VkLottieAnimation);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { VkLottieAnimation, types as __VkLottieAnimation, VkLottieAnimation as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
path: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
lottieNode: Ref<HTMLDivElement>;
|
|
9
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
load: (e: import("./types").LoadEvent) => import("./types").LoadEvent;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
path: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>> & {
|
|
17
|
+
onLoad?: (e: import("./types").LoadEvent) => any;
|
|
18
|
+
}, {
|
|
19
|
+
path: string;
|
|
20
|
+
}, {}>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, nextTick, watchEffect, openBlock, createElementBlock } from 'vue';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
import { watchPausable } from '@vueuse/core';
|
|
4
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
defaultOptions: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => ({})
|
|
14
|
+
},
|
|
15
|
+
readOnly: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const emits = {
|
|
21
|
+
"update:modelValue": null
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _sfc_main = defineComponent({
|
|
25
|
+
name: "VkMonacoEditor",
|
|
26
|
+
props,
|
|
27
|
+
emits,
|
|
28
|
+
setup(props2, { emit }) {
|
|
29
|
+
const editorNode = ref();
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
const editor$1 = editor.create(editorNode.value, props2.defaultOptions);
|
|
32
|
+
const subjectModelValueWatcher = watchPausable(
|
|
33
|
+
() => props2.modelValue,
|
|
34
|
+
(v) => {
|
|
35
|
+
editor$1.setValue(v);
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
immediate: true
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
editor$1.onDidChangeModelContent(() => {
|
|
42
|
+
subjectModelValueWatcher.pause();
|
|
43
|
+
emit("update:modelValue", editor$1.getValue());
|
|
44
|
+
nextTick(() => {
|
|
45
|
+
subjectModelValueWatcher.resume();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
watchEffect(() => {
|
|
49
|
+
editor$1.updateOptions({
|
|
50
|
+
readOnly: props2.readOnly
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
editorNode
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const _hoisted_1 = {
|
|
61
|
+
ref: "editorNode",
|
|
62
|
+
class: "vk-monaco-editor"
|
|
63
|
+
};
|
|
64
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
65
|
+
return openBlock(), createElementBlock(
|
|
66
|
+
"div",
|
|
67
|
+
_hoisted_1,
|
|
68
|
+
null,
|
|
69
|
+
512
|
|
70
|
+
/* NEED_PATCH */
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
var VkMonacoEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\monaco-editor\\src\\index.vue"]]);
|
|
74
|
+
|
|
75
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
76
|
+
__proto__: null
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
VkMonacoEditor.install = (app) => {
|
|
80
|
+
app.component(VkMonacoEditor.name || "VkMonacoEditor", VkMonacoEditor);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { VkMonacoEditor, types as __VkMonacoEditor, VkMonacoEditor as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
export declare const props: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
type: PropType<editor.IStandaloneEditorConstructionOptions>;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
readOnly: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const emits: {
|
|
18
|
+
'update:modelValue': any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { editor as mEditor } from 'monaco-editor';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
type: import("vue").PropType<mEditor.IStandaloneEditorConstructionOptions>;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
readOnly: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
editorNode: Ref<HTMLDivElement>;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
'update:modelValue': any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
defaultOptions: {
|
|
26
|
+
type: import("vue").PropType<mEditor.IStandaloneEditorConstructionOptions>;
|
|
27
|
+
default: () => {};
|
|
28
|
+
};
|
|
29
|
+
readOnly: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
}>> & {
|
|
34
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
35
|
+
}, {
|
|
36
|
+
modelValue: string;
|
|
37
|
+
defaultOptions: {};
|
|
38
|
+
readOnly: boolean;
|
|
39
|
+
}, {}>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, renderSlot } from 'vue';
|
|
2
|
+
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
3
|
+
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
|
|
4
|
+
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
|
|
5
|
+
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
6
|
+
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
7
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
8
|
+
|
|
9
|
+
var _sfc_main = defineComponent({
|
|
10
|
+
name: "VkMonacoEnvironment",
|
|
11
|
+
setup() {
|
|
12
|
+
self.MonacoEnvironment = {
|
|
13
|
+
getWorker(_, label) {
|
|
14
|
+
if (label === "json") {
|
|
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();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
34
|
+
return renderSlot(_ctx.$slots, "default");
|
|
35
|
+
}
|
|
36
|
+
var VkMonacoEnvironment = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\monaco-environment\\src\\index.vue"]]);
|
|
37
|
+
|
|
38
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
39
|
+
__proto__: null
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
VkMonacoEnvironment.install = (app) => {
|
|
43
|
+
app.component(VkMonacoEnvironment.name || "VkMonacoEnvironment", VkMonacoEnvironment);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { VkMonacoEnvironment, types as __VkMonacoEnvironment, VkMonacoEnvironment as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass } from 'vue';
|
|
2
|
+
import { noop, computedAsync, debouncedRef } from '@vueuse/core';
|
|
3
|
+
import MarkdownIt from 'markdown-it';
|
|
4
|
+
import { highlight } from '@vunk/shared/markdown/shiki';
|
|
5
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
source: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
delay: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 60
|
|
15
|
+
},
|
|
16
|
+
// 暂停
|
|
17
|
+
pause: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* 禁用typing
|
|
23
|
+
*/
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const emits = {
|
|
30
|
+
typing: null
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const createMarkdownIt = async () => {
|
|
34
|
+
const md = new MarkdownIt({
|
|
35
|
+
highlight: await highlight({
|
|
36
|
+
dark: "github-dark",
|
|
37
|
+
light: "github-light"
|
|
38
|
+
}, {}, {
|
|
39
|
+
warn: noop
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
md.core.ruler.after("inline", "add-is-last-class", (state) => {
|
|
43
|
+
const tokens = state.tokens;
|
|
44
|
+
let lastTagIndex = -1;
|
|
45
|
+
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
46
|
+
const token = tokens[i];
|
|
47
|
+
if (token.nesting === 1 && !token.hidden) {
|
|
48
|
+
lastTagIndex = i;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (lastTagIndex !== -1) {
|
|
53
|
+
tokens[lastTagIndex].attrSet("class", "is-last");
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return md;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var _sfc_main = defineComponent({
|
|
60
|
+
name: "VkTypingMarkdown",
|
|
61
|
+
props,
|
|
62
|
+
emits,
|
|
63
|
+
setup(props2, { emit }) {
|
|
64
|
+
const currentIndex = ref(0);
|
|
65
|
+
const currentText = computed(() => {
|
|
66
|
+
if (props2.disabled) {
|
|
67
|
+
return props2.source;
|
|
68
|
+
}
|
|
69
|
+
return props2.source.substring(0, currentIndex.value);
|
|
70
|
+
});
|
|
71
|
+
const markdownItPromise = createMarkdownIt();
|
|
72
|
+
const htmlText = computedAsync(async () => {
|
|
73
|
+
currentText.value;
|
|
74
|
+
const md = await markdownItPromise;
|
|
75
|
+
return md.render(currentText.value);
|
|
76
|
+
}, "");
|
|
77
|
+
const isTyping = computed(() => {
|
|
78
|
+
return !props2.pause && !props2.disabled && currentIndex.value !== props2.source.length;
|
|
79
|
+
});
|
|
80
|
+
const isDebouncedTyping = debouncedRef(isTyping, 100);
|
|
81
|
+
const isFinished = ref(false);
|
|
82
|
+
function typeWriter() {
|
|
83
|
+
if (props2.pause || props2.disabled) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (currentIndex.value < props2.source.length) {
|
|
87
|
+
currentIndex.value++;
|
|
88
|
+
emit("typing");
|
|
89
|
+
setTimeout(typeWriter, props2.delay);
|
|
90
|
+
} else {
|
|
91
|
+
isFinished.value = true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
watch(() => props2.pause || props2.disabled, (v) => {
|
|
95
|
+
if (!v) {
|
|
96
|
+
typeWriter();
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
flush: "post",
|
|
100
|
+
immediate: true
|
|
101
|
+
});
|
|
102
|
+
watch(
|
|
103
|
+
() => isFinished.value && currentIndex.value < props2.source.length,
|
|
104
|
+
() => {
|
|
105
|
+
isFinished.value = false;
|
|
106
|
+
typeWriter();
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
return {
|
|
110
|
+
htmlText,
|
|
111
|
+
isDebouncedTyping
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const _hoisted_1 = ["innerHTML"];
|
|
117
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
118
|
+
return openBlock(), createElementBlock("div", {
|
|
119
|
+
class: normalizeClass(["vk-typing-markdown", {
|
|
120
|
+
"is-typing": _ctx.isDebouncedTyping
|
|
121
|
+
}]),
|
|
122
|
+
innerHTML: _ctx.htmlText
|
|
123
|
+
}, null, 10, _hoisted_1);
|
|
124
|
+
}
|
|
125
|
+
var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-plus\\packages\\components\\typing-markdown\\src\\index.vue"]]);
|
|
126
|
+
|
|
127
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
128
|
+
__proto__: null
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
VkTypingMarkdown.install = (app) => {
|
|
132
|
+
app.component(VkTypingMarkdown.name || "VkTypingMarkdown", VkTypingMarkdown);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export { VkTypingMarkdown, types as __VkTypingMarkdown, VkTypingMarkdown as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const props: {
|
|
2
|
+
source: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
delay: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
pause: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 禁用typing
|
|
16
|
+
*/
|
|
17
|
+
disabled: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const emits: {
|
|
23
|
+
typing: any;
|
|
24
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
source: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
delay: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
pause: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
htmlText: import("vue").Ref<string>;
|
|
20
|
+
isDebouncedTyping: Readonly<import("vue").Ref<boolean>>;
|
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
typing: any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
source: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
delay: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
pause: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
}>> & {
|
|
41
|
+
onTyping?: (...args: any[] | unknown[]) => any;
|
|
42
|
+
}, {
|
|
43
|
+
source: string;
|
|
44
|
+
delay: number;
|
|
45
|
+
pause: boolean;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
}, {}>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/index.css
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.vk-lottie-animation {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.vk-monaco-editor {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.vk-typing-markdown.is-typing .is-last::after{
|
|
12
|
+
animation: blink 0.7s infinite;
|
|
13
|
+
content: '|';
|
|
14
|
+
}
|
|
15
|
+
@keyframes blink {
|
|
16
|
+
0%, 100% {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
50% {
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/index.esm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@vunk/plus/shared';
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vunk/plus",
|
|
3
|
+
"version": "0.0.0-alpha.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.esm.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "gulp -f gulpfile.ts"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"module": "index.esm.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./index.esm.js",
|
|
16
|
+
"types": "./index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./theme": {
|
|
19
|
+
"import": "./theme/index.mjs",
|
|
20
|
+
"types": "./theme/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./stores": {
|
|
23
|
+
"import": "./stores/index.mjs",
|
|
24
|
+
"types": "./stores/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./shared": {
|
|
27
|
+
"import": "./shared/index.mjs",
|
|
28
|
+
"types": "./shared/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./shared/fetch/ssr": {
|
|
31
|
+
"import": "./shared/fetch/ssr/index.mjs",
|
|
32
|
+
"types": "./shared/fetch/ssr/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./shared/fetch/base": {
|
|
35
|
+
"import": "./shared/fetch/base/index.mjs",
|
|
36
|
+
"types": "./shared/fetch/base/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./shared/chatgpt": {
|
|
39
|
+
"import": "./shared/chatgpt/index.mjs",
|
|
40
|
+
"types": "./shared/chatgpt/index.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./shared/chatgpt/response": {
|
|
43
|
+
"import": "./shared/chatgpt/response/index.mjs",
|
|
44
|
+
"types": "./shared/chatgpt/response/index.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./shared/chatgpt/response/sse": {
|
|
47
|
+
"import": "./shared/chatgpt/response/sse/index.mjs",
|
|
48
|
+
"types": "./shared/chatgpt/response/sse/index.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./shared/chatgpt/response/sse/message": {
|
|
51
|
+
"import": "./shared/chatgpt/response/sse/message/index.mjs",
|
|
52
|
+
"types": "./shared/chatgpt/response/sse/message/index.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./composables": {
|
|
55
|
+
"import": "./composables/index.mjs",
|
|
56
|
+
"types": "./composables/index.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./components/typing-markdown": {
|
|
59
|
+
"import": "./components/typing-markdown/index.mjs",
|
|
60
|
+
"types": "./components/typing-markdown/index.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./components/monaco-environment": {
|
|
63
|
+
"import": "./components/monaco-environment/index.mjs",
|
|
64
|
+
"types": "./components/monaco-environment/index.d.ts"
|
|
65
|
+
},
|
|
66
|
+
"./components/monaco-editor": {
|
|
67
|
+
"import": "./components/monaco-editor/index.mjs",
|
|
68
|
+
"types": "./components/monaco-editor/index.d.ts"
|
|
69
|
+
},
|
|
70
|
+
"./components/lottie-animation": {
|
|
71
|
+
"import": "./components/lottie-animation/index.mjs",
|
|
72
|
+
"types": "./components/lottie-animation/index.d.ts"
|
|
73
|
+
},
|
|
74
|
+
"./api": {
|
|
75
|
+
"import": "./api/index.mjs",
|
|
76
|
+
"types": "./api/index.d.ts"
|
|
77
|
+
},
|
|
78
|
+
"./api/user": {
|
|
79
|
+
"import": "./api/user/index.mjs",
|
|
80
|
+
"types": "./api/user/index.d.ts"
|
|
81
|
+
},
|
|
82
|
+
"./index.css": {
|
|
83
|
+
"import": "./index.css"
|
|
84
|
+
},
|
|
85
|
+
"./components/typing-markdown/index.css": {
|
|
86
|
+
"import": "./components/typing-markdown/index.css"
|
|
87
|
+
},
|
|
88
|
+
"./components/monaco-editor/index.css": {
|
|
89
|
+
"import": "./components/monaco-editor/index.css"
|
|
90
|
+
},
|
|
91
|
+
"./components/lottie-animation/index.css": {
|
|
92
|
+
"import": "./components/lottie-animation/index.css"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './response';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ChatgptSSEResponse } from './sse';
|
|
2
|
+
import { SpecialResponse } from './enum';
|
|
3
|
+
export * from './sse';
|
|
4
|
+
export * from './enum';
|
|
5
|
+
export declare const isChatgptSSEResponse: (data: any) => data is ChatgptSSEResponse;
|
|
6
|
+
export declare const isDoneResponse: (data: any) => data is SpecialResponse;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isPlainObject } from '@vunk/shared/object';
|
|
2
|
+
export { isContentMessage, isConversationDetailMetadataMessage } from './sse/message/index.mjs';
|
|
3
|
+
|
|
4
|
+
var SpecialResponse = /* @__PURE__ */ ((SpecialResponse2) => {
|
|
5
|
+
SpecialResponse2["done"] = "[DONE]";
|
|
6
|
+
return SpecialResponse2;
|
|
7
|
+
})(SpecialResponse || {});
|
|
8
|
+
|
|
9
|
+
const isChatgptSSEResponse = (data) => {
|
|
10
|
+
return isPlainObject(data) && !!data.conversation_id;
|
|
11
|
+
};
|
|
12
|
+
const isDoneResponse = (data) => {
|
|
13
|
+
return data === SpecialResponse.done;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { SpecialResponse, isChatgptSSEResponse, isDoneResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isContentMessage, isConversationDetailMetadataMessage } from './message/index.mjs';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChatgptContentMessage, ChatgptConversationDetailMetadataMessage } from './types';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export declare const isContentMessage: (message: any) => message is ChatgptContentMessage;
|
|
4
|
+
export declare const isConversationDetailMetadataMessage: (message: any) => message is ChatgptConversationDetailMetadataMessage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const isContentMessage = (message) => {
|
|
2
|
+
return message?.id && message?.content;
|
|
3
|
+
};
|
|
4
|
+
const isConversationDetailMetadataMessage = (message) => {
|
|
5
|
+
return message?.type === "conversation_detail_metadata";
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { isContentMessage, isConversationDetailMetadataMessage };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ChatgptConversationDetailMetadataMessage {
|
|
2
|
+
type: 'conversation_detail_metadata';
|
|
3
|
+
blocked_features: string[];
|
|
4
|
+
model_limits: string[];
|
|
5
|
+
default_model_slug: string;
|
|
6
|
+
conversation_id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChatgptContentMessage {
|
|
9
|
+
id: string;
|
|
10
|
+
content: ChatgptContent;
|
|
11
|
+
}
|
|
12
|
+
export interface ChatgptContent {
|
|
13
|
+
content_type: 'text';
|
|
14
|
+
parts: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RestFetch } from '@vunk/skzz/shared/utils-fetch';
|
|
2
|
+
export declare const restFetch: RestFetch;
|
|
3
|
+
interface R<T> {
|
|
4
|
+
data: T;
|
|
5
|
+
code: number;
|
|
6
|
+
msg: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const request: <T>(options: import("@vunk/skzz/shared").BaseFetchRequestOptions, initOptions?: import("@vunk/skzz/shared").RequestInitOptions, init?: RequestInit) => Promise<R<T>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RestFetch } from '@vunk/skzz/shared/utils-fetch';
|
|
2
|
+
|
|
3
|
+
const restFetch = new RestFetch({
|
|
4
|
+
baseURL: "",
|
|
5
|
+
DEV: true,
|
|
6
|
+
customOk(res) {
|
|
7
|
+
return res.code === 0;
|
|
8
|
+
},
|
|
9
|
+
onerror() {
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const request = (...args) => {
|
|
13
|
+
const p = restFetch.request(...args);
|
|
14
|
+
return p;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { request, restFetch };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
2
|
+
export declare const restFetch: RestFetch;
|
|
3
|
+
export declare const request: <T>(options: import("@vunk/skzz/shared").BaseFetchRequestOptions, initOptions?: import("@vunk/skzz/shared").RequestInitOptions, init?: RequestInit) => Promise<T>;
|
|
File without changes
|
package/shared/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
File without changes
|
package/stores/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/theme/index.d.ts
ADDED
|
File without changes
|
package/theme/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|