vue-editify 0.1.13 → 0.1.16
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/examples/App.vue +11 -11
- package/lib/components/toolbar/toolbar.vue.d.ts +3 -3
- package/lib/editify/editify.vue.d.ts +16 -7
- package/lib/editify/props.d.ts +6 -2
- package/lib/editify.es.js +291 -144
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +3 -3
- package/src/components/menu/menu.less +0 -1
- package/src/components/menu/menu.vue +1 -2
- package/src/components/toolbar/toolbar.vue +2 -2
- package/src/components/tooltip/tooltip.vue +1 -1
- package/src/core/rule.ts +9 -0
- package/src/css/base.less +1 -1
- package/src/editify/editify.less +0 -1
- package/src/editify/editify.vue +4 -17
- package/src/editify/props.ts +7 -2
- package/src/index.ts +1 -1
- package/vite.config.ts +3 -0
package/examples/App.vue
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
<template>
|
2
|
-
<div style="padding: 10px; height: 100%; box-sizing: border-box">
|
3
|
-
<
|
4
|
-
<Editify ref="editify" border v-model="val" :menu="menuConfig" style="height: 400px"></Editify>
|
2
|
+
<div style="padding: 80px 10px 10px 10px; height: 100%; box-sizing: border-box">
|
3
|
+
<Editify ref="editify" border v-model="val" :menu="menuConfig" style="height: 100%" placeholder="Please Enter Text..." locale="zh_CN" :custom-image-paste="customImagePaste"></Editify>
|
5
4
|
</div>
|
6
5
|
</template>
|
7
6
|
<script setup lang="ts">
|
8
7
|
import { ref } from 'vue'
|
9
|
-
import {
|
10
|
-
import { MenuConfigType } from '../src/
|
8
|
+
import { Editify, insertImage, insertVideo } from '../src/index'
|
9
|
+
import { MenuConfigType } from '../src/index'
|
11
10
|
const val = ref<string>('<p><br></p>')
|
12
11
|
const editify = ref<InstanceType<typeof Editify> | null>(null)
|
13
12
|
const menuConfig = ref<MenuConfigType>({
|
14
13
|
use: true,
|
15
|
-
mode: '
|
14
|
+
mode: 'fixed',
|
16
15
|
image: {
|
17
16
|
accept: ['jpg'],
|
18
17
|
handleError: (error, file) => {
|
19
18
|
console.log(error, file)
|
20
19
|
}
|
20
|
+
},
|
21
|
+
fullScreen: {
|
22
|
+
show: true
|
21
23
|
}
|
22
24
|
})
|
23
|
-
const
|
24
|
-
|
25
|
-
editify.value!.editor
|
26
|
-
editify.value!.editor!.domRender()
|
27
|
-
editify.value!.editor!.rangeRender()
|
25
|
+
const customImagePaste = url => {
|
26
|
+
console.log(url)
|
27
|
+
insertImage(editify.value!.editor!, url)
|
28
28
|
}
|
29
29
|
</script>
|
30
30
|
<style lang="less">
|
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
13
13
|
validator(value: any): boolean;
|
14
14
|
};
|
15
15
|
config: {
|
16
|
-
type: import("vue").PropType<import("
|
16
|
+
type: import("vue").PropType<import("../../core/tool").ToolbarConfigType>;
|
17
17
|
default: null;
|
18
18
|
};
|
19
19
|
color: {
|
@@ -37,7 +37,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
37
37
|
validator(value: any): boolean;
|
38
38
|
};
|
39
39
|
config: {
|
40
|
-
type: import("vue").PropType<import("
|
40
|
+
type: import("vue").PropType<import("../../core/tool").ToolbarConfigType>;
|
41
41
|
default: null;
|
42
42
|
};
|
43
43
|
color: {
|
@@ -51,6 +51,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
51
51
|
type: "link" | "text" | "image" | "video" | "table" | "codeBlock";
|
52
52
|
modelValue: boolean;
|
53
53
|
node: string | HTMLElement;
|
54
|
-
config: import("
|
54
|
+
config: import("../../core/tool").ToolbarConfigType;
|
55
55
|
}, {}>;
|
56
56
|
export default _default;
|
@@ -60,11 +60,15 @@ declare const _default: import('vue').DefineComponent<{
|
|
60
60
|
default: boolean;
|
61
61
|
};
|
62
62
|
customImagePaste: {
|
63
|
-
type: import("vue").PropType<(url: string) =>
|
63
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
64
64
|
default: null;
|
65
65
|
};
|
66
66
|
customVideoPaste: {
|
67
|
-
type: import("vue").PropType<(url: string) =>
|
67
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
68
|
+
default: null;
|
69
|
+
};
|
70
|
+
customFilePaste: {
|
71
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
68
72
|
default: null;
|
69
73
|
};
|
70
74
|
menu: {
|
@@ -109,6 +113,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
109
113
|
customHtmlPaste: ((AlexElements: AlexElement[], html: string) => void | Promise<void>) | null;
|
110
114
|
customImagePaste: ((url: string) => void | Promise<void>) | null;
|
111
115
|
customVideoPaste: ((url: string) => void | Promise<void>) | null;
|
116
|
+
customFilePaste: ((url: string) => void | Promise<void>) | null;
|
112
117
|
customMerge: ((mergeElement: AlexElement, targetElement: AlexElement) => void | Promise<void>) | null;
|
113
118
|
customParseNode: ((el: AlexElement) => AlexElement) | null;
|
114
119
|
useClipboard: boolean;
|
@@ -410,7 +415,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
410
415
|
text: string;
|
411
416
|
html: string;
|
412
417
|
} | undefined>;
|
413
|
-
paste: () => Promise<void>;
|
414
418
|
delete: () => void;
|
415
419
|
insertText: (data: string) => void;
|
416
420
|
insertParagraph: () => void;
|
@@ -604,11 +608,15 @@ declare const _default: import('vue').DefineComponent<{
|
|
604
608
|
default: boolean;
|
605
609
|
};
|
606
610
|
customImagePaste: {
|
607
|
-
type: import("vue").PropType<(url: string) =>
|
611
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
608
612
|
default: null;
|
609
613
|
};
|
610
614
|
customVideoPaste: {
|
611
|
-
type: import("vue").PropType<(url: string) =>
|
615
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
616
|
+
default: null;
|
617
|
+
};
|
618
|
+
customFilePaste: {
|
619
|
+
type: import("vue").PropType<(url: string) => void | Promise<void>>;
|
612
620
|
default: null;
|
613
621
|
};
|
614
622
|
menu: {
|
@@ -665,8 +673,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
665
673
|
allowPasteHtml: boolean;
|
666
674
|
videoRatio: number;
|
667
675
|
showWordLength: boolean;
|
668
|
-
customImagePaste: (url: string) =>
|
669
|
-
customVideoPaste: (url: string) =>
|
676
|
+
customImagePaste: (url: string) => void | Promise<void>;
|
677
|
+
customVideoPaste: (url: string) => void | Promise<void>;
|
678
|
+
customFilePaste: (url: string) => void | Promise<void>;
|
670
679
|
pasteKeepMarks: ObjectType;
|
671
680
|
pasteKeepStyles: ObjectType;
|
672
681
|
customParseNode: (el: AlexElement) => AlexElement;
|
package/lib/editify/props.d.ts
CHANGED
@@ -71,11 +71,15 @@ export declare const EditifyProps: {
|
|
71
71
|
default: boolean;
|
72
72
|
};
|
73
73
|
customImagePaste: {
|
74
|
-
type: PropType<(url: string) =>
|
74
|
+
type: PropType<(url: string) => void | Promise<void>>;
|
75
75
|
default: null;
|
76
76
|
};
|
77
77
|
customVideoPaste: {
|
78
|
-
type: PropType<(url: string) =>
|
78
|
+
type: PropType<(url: string) => void | Promise<void>>;
|
79
|
+
default: null;
|
80
|
+
};
|
81
|
+
customFilePaste: {
|
82
|
+
type: PropType<(url: string) => void | Promise<void>>;
|
79
83
|
default: null;
|
80
84
|
};
|
81
85
|
menu: {
|