@vunk/plus 0.0.0-alpha.4 → 0.0.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/components/lottie-animation/index.mjs +3 -4
- package/components/lottie-animation/src/index.vue.d.ts +7 -7
- package/components/monaco-editor/index.mjs +1 -1
- package/components/monaco-editor/src/index.vue.d.ts +8 -8
- package/components/monaco-environment/index.mjs +1 -1
- package/components/monaco-environment/src/index.vue.d.ts +1 -1
- package/components/typing-markdown/index.mjs +9 -7
- package/components/typing-markdown/src/index.vue.d.ts +8 -8
- package/components/vditor/index.css +12 -0
- package/components/vditor/index.d.ts +4 -0
- package/components/vditor/index.mjs +279 -0
- package/components/vditor/src/ctx.d.ts +30 -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 +144 -0
- package/components/vditor/src/types.d.ts +9 -0
- package/components/vditor/src/use.d.ts +4 -0
- package/index.css +13 -0
- package/package.json +8 -1
|
@@ -22,14 +22,13 @@ var _sfc_main = defineComponent({
|
|
|
22
22
|
const animation = lottie.loadAnimation({
|
|
23
23
|
container: lottieNode.value,
|
|
24
24
|
renderer: "svg",
|
|
25
|
-
loop:
|
|
26
|
-
autoplay:
|
|
25
|
+
loop: true,
|
|
26
|
+
autoplay: true,
|
|
27
27
|
path: props2.path
|
|
28
28
|
});
|
|
29
29
|
animation.addEventListener("complete", () => {
|
|
30
30
|
emit("load", { animation });
|
|
31
31
|
});
|
|
32
|
-
animation.goToAndPlay(50 * animation.totalFrames / 100);
|
|
33
32
|
});
|
|
34
33
|
return {
|
|
35
34
|
lottieNode
|
|
@@ -59,7 +58,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
59
58
|
/* STABLE_FRAGMENT */
|
|
60
59
|
);
|
|
61
60
|
}
|
|
62
|
-
var VkLottieAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
61
|
+
var VkLottieAnimation = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/lottie-animation/src/index.vue"]]);
|
|
63
62
|
|
|
64
63
|
var types = /*#__PURE__*/Object.freeze({
|
|
65
64
|
__proto__: null
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
3
|
path: {
|
|
4
4
|
type: StringConstructor;
|
|
5
5
|
default: string;
|
|
6
6
|
};
|
|
7
|
-
}
|
|
8
|
-
lottieNode: Ref<HTMLDivElement>;
|
|
9
|
-
},
|
|
7
|
+
}>, {
|
|
8
|
+
lottieNode: Ref<HTMLDivElement, HTMLDivElement>;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
load: (e: import("./types").LoadEvent) => import("./types").LoadEvent;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
12
|
path: {
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
}>> & {
|
|
16
|
+
}>> & Readonly<{
|
|
17
17
|
onLoad?: (e: import("./types").LoadEvent) => any;
|
|
18
|
-
}
|
|
18
|
+
}>, {
|
|
19
19
|
path: string;
|
|
20
|
-
}, {}>;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
21
21
|
export default _default;
|
|
@@ -70,7 +70,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
70
70
|
/* NEED_PATCH */
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
var VkMonacoEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
73
|
+
var VkMonacoEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/monaco-editor/src/index.vue"]]);
|
|
74
74
|
|
|
75
75
|
var types = /*#__PURE__*/Object.freeze({
|
|
76
76
|
__proto__: null
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { editor as mEditor } from 'monaco-editor';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
type: StringConstructor;
|
|
6
6
|
default: string;
|
|
@@ -13,9 +13,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
type: BooleanConstructor;
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
|
-
}
|
|
17
|
-
editorNode: Ref<HTMLDivElement>;
|
|
18
|
-
},
|
|
16
|
+
}>, {
|
|
17
|
+
editorNode: Ref<HTMLDivElement, HTMLDivElement>;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
'update:modelValue': any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
21
|
modelValue: {
|
|
@@ -30,11 +30,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
type: BooleanConstructor;
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
|
-
}>> & {
|
|
33
|
+
}>> & Readonly<{
|
|
34
34
|
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
35
|
-
}
|
|
35
|
+
}>, {
|
|
36
36
|
modelValue: string;
|
|
37
|
-
defaultOptions:
|
|
37
|
+
defaultOptions: mEditor.IStandaloneEditorConstructionOptions;
|
|
38
38
|
readOnly: boolean;
|
|
39
|
-
}, {}>;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
40
|
export default _default;
|
|
@@ -33,7 +33,7 @@ var _sfc_main = defineComponent({
|
|
|
33
33
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
34
34
|
return renderSlot(_ctx.$slots, "default");
|
|
35
35
|
}
|
|
36
|
-
var VkMonacoEnvironment = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
36
|
+
var VkMonacoEnvironment = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/monaco-environment/src/index.vue"]]);
|
|
37
37
|
|
|
38
38
|
var types = /*#__PURE__*/Object.freeze({
|
|
39
39
|
__proto__: null
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -30,14 +30,16 @@ const emits = {
|
|
|
30
30
|
typing: null
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const highlightPromise = highlight({
|
|
34
|
+
dark: "github-dark",
|
|
35
|
+
light: "github-light"
|
|
36
|
+
}, {}, {
|
|
37
|
+
warn: noop
|
|
38
|
+
});
|
|
33
39
|
const createMarkdownIt = async () => {
|
|
40
|
+
const highlight2 = await highlightPromise;
|
|
34
41
|
const md = new MarkdownIt({
|
|
35
|
-
highlight:
|
|
36
|
-
dark: "github-dark",
|
|
37
|
-
light: "github-light"
|
|
38
|
-
}, {}, {
|
|
39
|
-
warn: noop
|
|
40
|
-
})
|
|
42
|
+
highlight: highlight2
|
|
41
43
|
});
|
|
42
44
|
md.core.ruler.after("inline", "add-is-last-class", (state) => {
|
|
43
45
|
const tokens = state.tokens;
|
|
@@ -122,7 +124,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
122
124
|
innerHTML: _ctx.htmlText
|
|
123
125
|
}, null, 10, _hoisted_1);
|
|
124
126
|
}
|
|
125
|
-
var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
127
|
+
var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/typing-markdown/src/index.vue"]]);
|
|
126
128
|
|
|
127
129
|
var types = /*#__PURE__*/Object.freeze({
|
|
128
130
|
__proto__: null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
2
|
source: {
|
|
3
3
|
type: StringConstructor;
|
|
4
4
|
default: string;
|
|
@@ -15,10 +15,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
type: BooleanConstructor;
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
|
-
}
|
|
19
|
-
htmlText: import("vue").Ref<string>;
|
|
20
|
-
isDebouncedTyping: Readonly<import("vue").Ref<boolean>>;
|
|
21
|
-
},
|
|
18
|
+
}>, {
|
|
19
|
+
htmlText: import("vue").Ref<string, string>;
|
|
20
|
+
isDebouncedTyping: Readonly<import("vue").Ref<boolean, boolean>>;
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
22
|
typing: any;
|
|
23
23
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
24
|
source: {
|
|
@@ -37,12 +37,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
37
|
type: BooleanConstructor;
|
|
38
38
|
default: boolean;
|
|
39
39
|
};
|
|
40
|
-
}>> & {
|
|
40
|
+
}>> & Readonly<{
|
|
41
41
|
onTyping?: (...args: any[] | unknown[]) => any;
|
|
42
|
-
}
|
|
42
|
+
}>, {
|
|
43
43
|
source: string;
|
|
44
44
|
delay: number;
|
|
45
45
|
pause: boolean;
|
|
46
46
|
disabled: boolean;
|
|
47
|
-
}, {}>;
|
|
47
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
48
48
|
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.vkf-vditor ul li {
|
|
2
|
+
list-style: initial;
|
|
3
|
+
}
|
|
4
|
+
.vkf-vditor ol li {
|
|
5
|
+
list-style: decimal;
|
|
6
|
+
}
|
|
7
|
+
.vkf-vditor.vditor{
|
|
8
|
+
--textarea-background-color: var(--el-fill-color-extra-light);
|
|
9
|
+
}
|
|
10
|
+
.vkf-vditor-footer.is-textarea-focus{
|
|
11
|
+
background-color: var(--textarea-background-color);
|
|
12
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import Vditor from 'vditor';
|
|
2
|
+
import { inject, unref, defineComponent, nextTick, ref, watch, shallowRef, provide, onMounted, resolveComponent, openBlock, createElementBlock, Fragment, createElementVNode, createBlock, withCtx, normalizeClass, renderSlot, createCommentVNode } from 'vue';
|
|
3
|
+
import { watchPausable, useMutationObserver } from '@vueuse/core';
|
|
4
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
5
|
+
import { VkAsyncTeleport } from '@vunk/core';
|
|
6
|
+
|
|
7
|
+
const defaultToolbar = [
|
|
8
|
+
"headings",
|
|
9
|
+
"bold",
|
|
10
|
+
"italic",
|
|
11
|
+
"strike",
|
|
12
|
+
"link",
|
|
13
|
+
"|",
|
|
14
|
+
"list",
|
|
15
|
+
"ordered-list",
|
|
16
|
+
"outdent",
|
|
17
|
+
"indent",
|
|
18
|
+
"|",
|
|
19
|
+
"line",
|
|
20
|
+
"code",
|
|
21
|
+
"inline-code",
|
|
22
|
+
"insert-before",
|
|
23
|
+
"insert-after",
|
|
24
|
+
"|",
|
|
25
|
+
"table",
|
|
26
|
+
"|",
|
|
27
|
+
"undo",
|
|
28
|
+
"redo",
|
|
29
|
+
"|",
|
|
30
|
+
"fullscreen",
|
|
31
|
+
"outline",
|
|
32
|
+
"export",
|
|
33
|
+
"|"
|
|
34
|
+
];
|
|
35
|
+
const props = {
|
|
36
|
+
modelValue: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
defaultOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({})
|
|
43
|
+
},
|
|
44
|
+
placeholder: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "Crtl + Enter \u53D1\u9001; Enter \u6362\u884C"
|
|
47
|
+
},
|
|
48
|
+
toolbar: {
|
|
49
|
+
type: Array,
|
|
50
|
+
default: () => defaultToolbar
|
|
51
|
+
},
|
|
52
|
+
fullscreen: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const emits = {
|
|
58
|
+
load: (e) => e,
|
|
59
|
+
"update:modelValue": (e) => e,
|
|
60
|
+
ctrlEnter: (e) => e,
|
|
61
|
+
"update:fullscreen": (e) => e
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e);});}}}
|
|
65
|
+
|
|
66
|
+
const useVditor = () => {
|
|
67
|
+
const core = inject("vkVditorRef", null);
|
|
68
|
+
if (!core) {
|
|
69
|
+
throw new Error("useVditor must be used after VditorProvider");
|
|
70
|
+
}
|
|
71
|
+
return unref(core);
|
|
72
|
+
};
|
|
73
|
+
const useVditorMitter = () => {
|
|
74
|
+
const core = inject("vkVditorMitter", null);
|
|
75
|
+
if (!core) {
|
|
76
|
+
throw new Error("useVditorMitter must be used after VditorProvider");
|
|
77
|
+
}
|
|
78
|
+
return core;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var _sfc_main$2 = defineComponent({
|
|
82
|
+
props: {
|
|
83
|
+
modelValue: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: ""
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: {
|
|
89
|
+
"update:modelValue": null
|
|
90
|
+
},
|
|
91
|
+
setup(props, { emit }) {
|
|
92
|
+
const vditor = useVditor();
|
|
93
|
+
const mitter = useVditorMitter();
|
|
94
|
+
if (props.modelValue) {
|
|
95
|
+
vditor.setValue(props.modelValue, true);
|
|
96
|
+
}
|
|
97
|
+
const { pause, resume } = watchPausable(() => props.modelValue, (value) => {
|
|
98
|
+
vditor.setValue(value, true);
|
|
99
|
+
});
|
|
100
|
+
mitter.on("input", (value) => {
|
|
101
|
+
pause();
|
|
102
|
+
emit("update:modelValue", value);
|
|
103
|
+
nextTick(resume);
|
|
104
|
+
});
|
|
105
|
+
return () => null;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
var HandleValue = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/vditor/src/handle-value.vue"]]);
|
|
110
|
+
|
|
111
|
+
var _sfc_main$1 = defineComponent({
|
|
112
|
+
props: {
|
|
113
|
+
fullscreen: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
emits: {
|
|
119
|
+
"update:fullscreen": null
|
|
120
|
+
},
|
|
121
|
+
setup(props, { emit }) {
|
|
122
|
+
const vditor = useVditor();
|
|
123
|
+
const el = vditor.vditor.element;
|
|
124
|
+
const domFullscreen = ref(false);
|
|
125
|
+
useMutationObserver(el, () => {
|
|
126
|
+
if (el.classList.contains("vditor--fullscreen")) {
|
|
127
|
+
domFullscreen.value = true;
|
|
128
|
+
} else {
|
|
129
|
+
domFullscreen.value = false;
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
attributes: true
|
|
133
|
+
});
|
|
134
|
+
watch(() => props.fullscreen, (value) => {
|
|
135
|
+
if (value !== domFullscreen.value) {
|
|
136
|
+
const ir = vditor.vditor.ir?.element;
|
|
137
|
+
if (!ir) return;
|
|
138
|
+
ir.dispatchEvent(new KeyboardEvent("keydown", {
|
|
139
|
+
key: "'",
|
|
140
|
+
ctrlKey: true
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
}, { immediate: true });
|
|
144
|
+
watch(() => domFullscreen.value, (value) => {
|
|
145
|
+
emit("update:fullscreen", value);
|
|
146
|
+
});
|
|
147
|
+
return () => null;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
var HandleFullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/vditor/src/handle-fullscreen.vue"]]);
|
|
152
|
+
|
|
153
|
+
var _sfc_main = defineComponent({
|
|
154
|
+
name: "VkVditor",
|
|
155
|
+
components: {
|
|
156
|
+
HandleValue,
|
|
157
|
+
HandleFullscreen,
|
|
158
|
+
VkAsyncTeleport
|
|
159
|
+
},
|
|
160
|
+
props,
|
|
161
|
+
emits,
|
|
162
|
+
setup(props2, { emit }) {
|
|
163
|
+
const vditorNode = ref();
|
|
164
|
+
const ready = ref(false);
|
|
165
|
+
const mitter = mitt();
|
|
166
|
+
const vditorRef = shallowRef();
|
|
167
|
+
const isTextareaFocus = ref(false);
|
|
168
|
+
provide("vkVditorMitter", mitter);
|
|
169
|
+
provide("vkVditorRef", vditorRef);
|
|
170
|
+
onMounted(() => {
|
|
171
|
+
const vditor = new Vditor(vditorNode.value, {
|
|
172
|
+
...props2.defaultOptions,
|
|
173
|
+
placeholder: props2.placeholder,
|
|
174
|
+
cache: {
|
|
175
|
+
enable: true,
|
|
176
|
+
id: "VkVditorCache",
|
|
177
|
+
...props2.defaultOptions.cache || {}
|
|
178
|
+
},
|
|
179
|
+
after() {
|
|
180
|
+
vditorRef.value = vditor;
|
|
181
|
+
ready.value = true;
|
|
182
|
+
emit("load", vditor);
|
|
183
|
+
props2.defaultOptions.after?.();
|
|
184
|
+
},
|
|
185
|
+
input(value) {
|
|
186
|
+
mitter.emit("input", value);
|
|
187
|
+
props2.defaultOptions.input?.(value);
|
|
188
|
+
},
|
|
189
|
+
ctrlEnter(value) {
|
|
190
|
+
emit("update:modelValue", value);
|
|
191
|
+
emit("ctrlEnter", value);
|
|
192
|
+
},
|
|
193
|
+
focus(v) {
|
|
194
|
+
isTextareaFocus.value = true;
|
|
195
|
+
props2.defaultOptions.focus?.(v);
|
|
196
|
+
},
|
|
197
|
+
blur(v) {
|
|
198
|
+
isTextareaFocus.value = false;
|
|
199
|
+
props2.defaultOptions.blur?.(v);
|
|
200
|
+
},
|
|
201
|
+
toolbar: props2.toolbar
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
vditorNode,
|
|
206
|
+
isTextareaFocus,
|
|
207
|
+
ready
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
const _hoisted_1 = {
|
|
213
|
+
ref: "vditorNode",
|
|
214
|
+
class: "vkf-vditor"
|
|
215
|
+
};
|
|
216
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
217
|
+
const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
|
|
218
|
+
const _component_HandleValue = resolveComponent("HandleValue");
|
|
219
|
+
const _component_HandleFullscreen = resolveComponent("HandleFullscreen");
|
|
220
|
+
return openBlock(), createElementBlock(
|
|
221
|
+
Fragment,
|
|
222
|
+
null,
|
|
223
|
+
[
|
|
224
|
+
createElementVNode(
|
|
225
|
+
"div",
|
|
226
|
+
_hoisted_1,
|
|
227
|
+
null,
|
|
228
|
+
512
|
|
229
|
+
/* NEED_PATCH */
|
|
230
|
+
),
|
|
231
|
+
_ctx.ready ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
|
|
232
|
+
key: 0,
|
|
233
|
+
to: _ctx.vditorNode
|
|
234
|
+
}, {
|
|
235
|
+
default: withCtx(() => [
|
|
236
|
+
createElementVNode(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
class: normalizeClass(["vkf-vditor-footer", {
|
|
240
|
+
"is-textarea-focus": _ctx.isTextareaFocus
|
|
241
|
+
}])
|
|
242
|
+
},
|
|
243
|
+
[
|
|
244
|
+
renderSlot(_ctx.$slots, "footer")
|
|
245
|
+
],
|
|
246
|
+
2
|
|
247
|
+
/* CLASS */
|
|
248
|
+
)
|
|
249
|
+
]),
|
|
250
|
+
_: 3
|
|
251
|
+
/* FORWARDED */
|
|
252
|
+
}, 8, ["to"])) : createCommentVNode("v-if", true),
|
|
253
|
+
_ctx.ready ? (openBlock(), createBlock(_component_HandleValue, {
|
|
254
|
+
key: 1,
|
|
255
|
+
"model-value": _ctx.modelValue,
|
|
256
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event))
|
|
257
|
+
}, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
|
|
258
|
+
_ctx.ready ? (openBlock(), createBlock(_component_HandleFullscreen, {
|
|
259
|
+
key: 2,
|
|
260
|
+
fullscreen: _ctx.fullscreen,
|
|
261
|
+
"onUpdate:fullscreen": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:fullscreen", $event))
|
|
262
|
+
}, null, 8, ["fullscreen"])) : createCommentVNode("v-if", true),
|
|
263
|
+
_ctx.ready ? renderSlot(_ctx.$slots, "default", { key: 3 }) : createCommentVNode("v-if", true)
|
|
264
|
+
],
|
|
265
|
+
64
|
|
266
|
+
/* STABLE_FRAGMENT */
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
var VkVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/vditor/src/index.vue"]]);
|
|
270
|
+
|
|
271
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
272
|
+
__proto__: null
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
VkVditor.install = (app) => {
|
|
276
|
+
app.component(VkVditor.name || "VkVditor", VkVditor);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export { VkVditor, types as __VkVditor, VkVditor as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import Vditor from 'vditor';
|
|
3
|
+
export declare const props: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
defaultOptions: {
|
|
9
|
+
type: PropType<IOptions>;
|
|
10
|
+
default: () => IOptions;
|
|
11
|
+
};
|
|
12
|
+
placeholder: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
toolbar: {
|
|
17
|
+
type: PropType<string[]>;
|
|
18
|
+
default: () => string[];
|
|
19
|
+
};
|
|
20
|
+
fullscreen: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const emits: {
|
|
26
|
+
load: (e: Vditor) => Vditor;
|
|
27
|
+
'update:modelValue': (e: string) => string;
|
|
28
|
+
ctrlEnter: (e: string) => string;
|
|
29
|
+
'update:fullscreen': (e: boolean) => boolean;
|
|
30
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
fullscreen: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
'update:fullscreen': any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
fullscreen: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{
|
|
14
|
+
"onUpdate:fullscreen"?: (...args: any[] | unknown[]) => any;
|
|
15
|
+
}>, {
|
|
16
|
+
fullscreen: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
'update:modelValue': any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
15
|
+
}>, {
|
|
16
|
+
modelValue: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/// <reference types="./types" />
|
|
2
|
+
import Vditor from 'vditor';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
defaultOptions: {
|
|
10
|
+
type: import("vue").PropType<IOptions>;
|
|
11
|
+
default: () => IOptions;
|
|
12
|
+
};
|
|
13
|
+
placeholder: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
toolbar: {
|
|
18
|
+
type: import("vue").PropType<string[]>;
|
|
19
|
+
default: () => string[];
|
|
20
|
+
};
|
|
21
|
+
fullscreen: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
}>, {
|
|
26
|
+
vditorNode: Ref<HTMLDivElement, HTMLDivElement>;
|
|
27
|
+
isTextareaFocus: Ref<boolean, boolean>;
|
|
28
|
+
ready: Ref<boolean, boolean>;
|
|
29
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
load: (e: Vditor) => Vditor;
|
|
31
|
+
'update:modelValue': (e: string) => string;
|
|
32
|
+
ctrlEnter: (e: string) => string;
|
|
33
|
+
'update:fullscreen': (e: boolean) => boolean;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
modelValue: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
defaultOptions: {
|
|
40
|
+
type: import("vue").PropType<IOptions>;
|
|
41
|
+
default: () => IOptions;
|
|
42
|
+
};
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
toolbar: {
|
|
48
|
+
type: import("vue").PropType<string[]>;
|
|
49
|
+
default: () => string[];
|
|
50
|
+
};
|
|
51
|
+
fullscreen: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
}>> & Readonly<{
|
|
56
|
+
onLoad?: (e: Vditor) => any;
|
|
57
|
+
"onUpdate:modelValue"?: (e: string) => any;
|
|
58
|
+
"onUpdate:fullscreen"?: (e: boolean) => any;
|
|
59
|
+
onCtrlEnter?: (e: string) => any;
|
|
60
|
+
}>, {
|
|
61
|
+
modelValue: string;
|
|
62
|
+
defaultOptions: IOptions;
|
|
63
|
+
placeholder: string;
|
|
64
|
+
toolbar: string[];
|
|
65
|
+
fullscreen: boolean;
|
|
66
|
+
}, {}, {
|
|
67
|
+
HandleValue: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
68
|
+
modelValue: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
|
+
'update:modelValue': any;
|
|
74
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
+
modelValue: {
|
|
76
|
+
type: StringConstructor;
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
}>> & Readonly<{
|
|
80
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
81
|
+
}>, {
|
|
82
|
+
modelValue: string;
|
|
83
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
HandleFullscreen: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
85
|
+
fullscreen: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
default: boolean;
|
|
88
|
+
};
|
|
89
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
90
|
+
'update:fullscreen': any;
|
|
91
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
92
|
+
fullscreen: {
|
|
93
|
+
type: BooleanConstructor;
|
|
94
|
+
default: boolean;
|
|
95
|
+
};
|
|
96
|
+
}>> & Readonly<{
|
|
97
|
+
"onUpdate:fullscreen"?: (...args: any[] | unknown[]) => any;
|
|
98
|
+
}>, {
|
|
99
|
+
fullscreen: boolean;
|
|
100
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
101
|
+
VkAsyncTeleport: import("vue").DefineComponent<{
|
|
102
|
+
to: {
|
|
103
|
+
type: import("vue").PropType<string | import("vue").RendererElement>;
|
|
104
|
+
default: any;
|
|
105
|
+
};
|
|
106
|
+
sleep: {
|
|
107
|
+
type: NumberConstructor;
|
|
108
|
+
default: number;
|
|
109
|
+
};
|
|
110
|
+
await: {
|
|
111
|
+
type: PromiseConstructor;
|
|
112
|
+
default: any;
|
|
113
|
+
};
|
|
114
|
+
teleport: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
ready: Ref<boolean, boolean>;
|
|
120
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
121
|
+
to: {
|
|
122
|
+
type: import("vue").PropType<string | import("vue").RendererElement>;
|
|
123
|
+
default: any;
|
|
124
|
+
};
|
|
125
|
+
sleep: {
|
|
126
|
+
type: NumberConstructor;
|
|
127
|
+
default: number;
|
|
128
|
+
};
|
|
129
|
+
await: {
|
|
130
|
+
type: PromiseConstructor;
|
|
131
|
+
default: any;
|
|
132
|
+
};
|
|
133
|
+
teleport: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: boolean;
|
|
136
|
+
};
|
|
137
|
+
}>>, {
|
|
138
|
+
to: any;
|
|
139
|
+
sleep: number;
|
|
140
|
+
await: Promise<unknown>;
|
|
141
|
+
teleport: boolean;
|
|
142
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
143
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
144
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NonVoidable } from '@vunk/core';
|
|
2
|
+
import Vditor from 'vditor';
|
|
3
|
+
import { Emitter } from 'mitt';
|
|
4
|
+
export type DefaultOptions = NonVoidable<ConstructorParameters<typeof Vditor>[1]>;
|
|
5
|
+
export type Toolbar = DefaultOptions['toolbar'];
|
|
6
|
+
export type Mitter = Emitter<{
|
|
7
|
+
input: string;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
package/index.css
CHANGED
|
@@ -20,3 +20,16 @@
|
|
|
20
20
|
opacity: 0;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
.vkf-vditor ul li {
|
|
25
|
+
list-style: initial;
|
|
26
|
+
}
|
|
27
|
+
.vkf-vditor ol li {
|
|
28
|
+
list-style: decimal;
|
|
29
|
+
}
|
|
30
|
+
.vkf-vditor.vditor{
|
|
31
|
+
--textarea-background-color: var(--el-fill-color-extra-light);
|
|
32
|
+
}
|
|
33
|
+
.vkf-vditor-footer.is-textarea-focus{
|
|
34
|
+
background-color: var(--textarea-background-color);
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vunk/plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.esm.js",
|
|
6
6
|
"scripts": {
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"import": "./composables/index.mjs",
|
|
56
56
|
"types": "./composables/index.d.ts"
|
|
57
57
|
},
|
|
58
|
+
"./components/vditor": {
|
|
59
|
+
"import": "./components/vditor/index.mjs",
|
|
60
|
+
"types": "./components/vditor/index.d.ts"
|
|
61
|
+
},
|
|
58
62
|
"./components/typing-markdown": {
|
|
59
63
|
"import": "./components/typing-markdown/index.mjs",
|
|
60
64
|
"types": "./components/typing-markdown/index.d.ts"
|
|
@@ -82,6 +86,9 @@
|
|
|
82
86
|
"./index.css": {
|
|
83
87
|
"import": "./index.css"
|
|
84
88
|
},
|
|
89
|
+
"./components/vditor/index.css": {
|
|
90
|
+
"import": "./components/vditor/index.css"
|
|
91
|
+
},
|
|
85
92
|
"./components/typing-markdown/index.css": {
|
|
86
93
|
"import": "./components/typing-markdown/index.css"
|
|
87
94
|
},
|