vue-editify 0.1.19 → 0.1.20
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/README.md +3 -3
- package/examples/App.vue +62 -62
- package/examples/main.ts +4 -4
- package/lib/components/button/button.vue.d.ts +11 -11
- package/lib/components/checkbox/checkbox.vue.d.ts +8 -8
- package/lib/components/colors/colors.vue.d.ts +4 -4
- package/lib/components/icon/icon.vue.d.ts +1 -1
- package/lib/components/insertImage/insertImage.vue.d.ts +9 -9
- package/lib/components/insertLink/insertLink.vue.d.ts +2 -2
- package/lib/components/insertTable/insertTable.vue.d.ts +2 -2
- package/lib/components/insertVideo/insertVideo.vue.d.ts +9 -9
- package/lib/components/layer/layer.vue.d.ts +9 -9
- package/lib/components/menu/menu.vue.d.ts +4 -4
- package/lib/components/toolbar/toolbar.vue.d.ts +9 -9
- package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
- package/lib/components/triangle/triangle.vue.d.ts +4 -4
- package/lib/editify/editify.vue.d.ts +68 -68
- package/lib/editify.es.js +35 -24
- package/lib/editify.umd.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +45 -45
- package/src/components/button/button.less +145 -145
- package/src/components/button/button.vue +197 -197
- package/src/components/button/props.ts +95 -95
- package/src/components/checkbox/checkbox.less +84 -84
- package/src/components/checkbox/checkbox.vue +68 -68
- package/src/components/checkbox/props.ts +49 -49
- package/src/components/colors/colors.less +75 -75
- package/src/components/colors/colors.vue +36 -36
- package/src/components/colors/props.ts +29 -29
- package/src/components/icon/icon.less +14 -14
- package/src/components/icon/icon.vue +12 -12
- package/src/components/icon/props.ts +11 -11
- package/src/components/insertImage/insertImage.less +135 -135
- package/src/components/insertImage/insertImage.vue +146 -146
- package/src/components/insertImage/props.ts +43 -43
- package/src/components/insertLink/insertLink.less +64 -64
- package/src/components/insertLink/insertLink.vue +58 -58
- package/src/components/insertLink/props.ts +16 -16
- package/src/components/insertTable/insertTable.less +54 -54
- package/src/components/insertTable/insertTable.vue +85 -85
- package/src/components/insertTable/props.ts +27 -27
- package/src/components/insertVideo/insertVideo.less +135 -135
- package/src/components/insertVideo/insertVideo.vue +146 -146
- package/src/components/insertVideo/props.ts +43 -43
- package/src/components/layer/layer.less +49 -49
- package/src/components/layer/layer.vue +598 -598
- package/src/components/layer/props.ts +71 -71
- package/src/components/menu/menu.less +63 -63
- package/src/components/menu/menu.vue +1569 -1569
- package/src/components/menu/props.ts +17 -17
- package/src/components/toolbar/props.ts +35 -35
- package/src/components/toolbar/toolbar.less +89 -89
- package/src/components/toolbar/toolbar.vue +1101 -1101
- package/src/components/tooltip/props.ts +21 -21
- package/src/components/tooltip/tooltip.less +23 -23
- package/src/components/tooltip/tooltip.vue +37 -37
- package/src/components/triangle/props.ts +26 -26
- package/src/components/triangle/triangle.less +79 -79
- package/src/components/triangle/triangle.vue +65 -65
- package/src/core/function.ts +1150 -1144
- package/src/core/rule.ts +259 -259
- package/src/core/tool.ts +1137 -1137
- package/src/css/base.less +30 -30
- package/src/css/hljs.less +54 -54
- package/src/editify/editify.less +404 -404
- package/src/editify/editify.vue +810 -803
- package/src/editify/props.ts +156 -156
- package/src/hljs/index.ts +197 -197
- package/src/icon/iconfont.css +219 -219
- package/src/index.ts +32 -32
- package/src/locale/en_US.ts +88 -88
- package/src/locale/index.ts +12 -12
- package/src/locale/zh_CN.ts +88 -88
- package/tsconfig.json +27 -27
- package/tsconfig.node.json +11 -11
- package/vite-env.d.ts +1 -1
- package/vite.config.ts +42 -42
package/src/editify/props.ts
CHANGED
@@ -1,156 +1,156 @@
|
|
1
|
-
import { common as DapCommon } from 'dap-util'
|
2
|
-
import { ExtractPublicPropTypes, PropType } from 'vue'
|
3
|
-
import { MenuConfigType, ObjectType, ToolbarConfigType } from '../core/tool'
|
4
|
-
import { AlexElement } from 'alex-editor'
|
5
|
-
import { LocaleType } from '../locale'
|
6
|
-
|
7
|
-
export type EditifyTableColumnResizeParamsType = {
|
8
|
-
element: AlexElement | null
|
9
|
-
start: number
|
10
|
-
}
|
11
|
-
|
12
|
-
export type EditifyToolbarOptionsType = {
|
13
|
-
show: boolean
|
14
|
-
node: string | null
|
15
|
-
type: 'text' | 'link' | 'image' | 'video' | 'table' | 'codeBlock'
|
16
|
-
}
|
17
|
-
|
18
|
-
export const EditifyProps = {
|
19
|
-
//国际化语言类型
|
20
|
-
locale: {
|
21
|
-
type: String as PropType<LocaleType>,
|
22
|
-
default: 'zh_CN'
|
23
|
-
},
|
24
|
-
//编辑器内容
|
25
|
-
modelValue: {
|
26
|
-
type: String,
|
27
|
-
default: '<p><br></p>'
|
28
|
-
},
|
29
|
-
//占位符
|
30
|
-
placeholder: {
|
31
|
-
type: String,
|
32
|
-
default: ''
|
33
|
-
},
|
34
|
-
//是否自动获取焦点
|
35
|
-
autofocus: {
|
36
|
-
type: Boolean,
|
37
|
-
default: false
|
38
|
-
},
|
39
|
-
//是否禁用编辑器
|
40
|
-
disabled: {
|
41
|
-
type: Boolean,
|
42
|
-
default: false
|
43
|
-
},
|
44
|
-
//是否允许复制
|
45
|
-
allowCopy: {
|
46
|
-
type: Boolean,
|
47
|
-
default: true
|
48
|
-
},
|
49
|
-
//是否允许粘贴
|
50
|
-
allowPaste: {
|
51
|
-
type: Boolean,
|
52
|
-
default: true
|
53
|
-
},
|
54
|
-
//是否允许剪切
|
55
|
-
allowCut: {
|
56
|
-
type: Boolean,
|
57
|
-
default: true
|
58
|
-
},
|
59
|
-
//是否允许粘贴html
|
60
|
-
allowPasteHtml: {
|
61
|
-
type: Boolean,
|
62
|
-
default: false
|
63
|
-
},
|
64
|
-
//是否显示边框
|
65
|
-
border: {
|
66
|
-
type: Boolean,
|
67
|
-
default: false
|
68
|
-
},
|
69
|
-
//主题色
|
70
|
-
color: {
|
71
|
-
type: String,
|
72
|
-
default: '#03a8f3',
|
73
|
-
validator(value: any) {
|
74
|
-
return DapCommon.matchingText(value, 'hex')
|
75
|
-
}
|
76
|
-
},
|
77
|
-
//视频宽高比
|
78
|
-
videoRatio: {
|
79
|
-
type: Number,
|
80
|
-
default: 16 / 9
|
81
|
-
},
|
82
|
-
//工具条按钮设置
|
83
|
-
toolbar: {
|
84
|
-
type: Object as PropType<ToolbarConfigType>,
|
85
|
-
default: null
|
86
|
-
},
|
87
|
-
//是否显示字数统计
|
88
|
-
showWordLength: {
|
89
|
-
type: Boolean,
|
90
|
-
default: false
|
91
|
-
},
|
92
|
-
//自定义粘贴纯文字
|
93
|
-
customTextPaste: {
|
94
|
-
type: Function as PropType<(data: string) => void | Promise<void>>,
|
95
|
-
default: null
|
96
|
-
},
|
97
|
-
//自定义粘贴html
|
98
|
-
customHtmlPaste: {
|
99
|
-
type: Function as PropType<(elements: AlexElement[]) => void | Promise<void>>,
|
100
|
-
default: null
|
101
|
-
},
|
102
|
-
//自定义粘贴图片
|
103
|
-
customImagePaste: {
|
104
|
-
type: Function as PropType<(file: File) => void | Promise<void>>,
|
105
|
-
default: null
|
106
|
-
},
|
107
|
-
//自定义粘贴视频
|
108
|
-
customVideoPaste: {
|
109
|
-
type: Function as PropType<(file: File) => void | Promise<void>>,
|
110
|
-
default: null
|
111
|
-
},
|
112
|
-
//自定义粘贴文件
|
113
|
-
customFilePaste: {
|
114
|
-
type: Function as PropType<(file: File) => void | Promise<void>>,
|
115
|
-
default: null
|
116
|
-
},
|
117
|
-
//菜单栏配置
|
118
|
-
menu: {
|
119
|
-
type: Object as PropType<MenuConfigType>,
|
120
|
-
default: null
|
121
|
-
},
|
122
|
-
//粘贴html时额外保留的标记(全部元素生效)
|
123
|
-
pasteKeepMarks: {
|
124
|
-
type: Object as PropType<ObjectType>,
|
125
|
-
default: null
|
126
|
-
},
|
127
|
-
//粘贴html时额外保留的样式(仅在非文本元素生效)
|
128
|
-
pasteKeepStyles: {
|
129
|
-
type: Object as PropType<ObjectType>,
|
130
|
-
default: null
|
131
|
-
},
|
132
|
-
//自定义node转元素时的处理
|
133
|
-
customParseNode: {
|
134
|
-
type: Function as PropType<(el: AlexElement) => AlexElement>,
|
135
|
-
default: null
|
136
|
-
},
|
137
|
-
//自定义额外的渲染规范
|
138
|
-
renderRules: {
|
139
|
-
type: Array as PropType<((el: AlexElement) => void)[]>,
|
140
|
-
default: function () {
|
141
|
-
return []
|
142
|
-
}
|
143
|
-
},
|
144
|
-
//自适应高度
|
145
|
-
autoheight: {
|
146
|
-
type: Boolean,
|
147
|
-
default: false
|
148
|
-
},
|
149
|
-
//是否使用tab快捷键
|
150
|
-
tab: {
|
151
|
-
type: Boolean,
|
152
|
-
default: true
|
153
|
-
}
|
154
|
-
}
|
155
|
-
|
156
|
-
export type EditifyPropsType = ExtractPublicPropTypes<typeof EditifyProps>
|
1
|
+
import { common as DapCommon } from 'dap-util'
|
2
|
+
import { ExtractPublicPropTypes, PropType } from 'vue'
|
3
|
+
import { MenuConfigType, ObjectType, ToolbarConfigType } from '../core/tool'
|
4
|
+
import { AlexElement } from 'alex-editor'
|
5
|
+
import { LocaleType } from '../locale'
|
6
|
+
|
7
|
+
export type EditifyTableColumnResizeParamsType = {
|
8
|
+
element: AlexElement | null
|
9
|
+
start: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export type EditifyToolbarOptionsType = {
|
13
|
+
show: boolean
|
14
|
+
node: string | null
|
15
|
+
type: 'text' | 'link' | 'image' | 'video' | 'table' | 'codeBlock'
|
16
|
+
}
|
17
|
+
|
18
|
+
export const EditifyProps = {
|
19
|
+
//国际化语言类型
|
20
|
+
locale: {
|
21
|
+
type: String as PropType<LocaleType>,
|
22
|
+
default: 'zh_CN'
|
23
|
+
},
|
24
|
+
//编辑器内容
|
25
|
+
modelValue: {
|
26
|
+
type: String,
|
27
|
+
default: '<p><br></p>'
|
28
|
+
},
|
29
|
+
//占位符
|
30
|
+
placeholder: {
|
31
|
+
type: String,
|
32
|
+
default: ''
|
33
|
+
},
|
34
|
+
//是否自动获取焦点
|
35
|
+
autofocus: {
|
36
|
+
type: Boolean,
|
37
|
+
default: false
|
38
|
+
},
|
39
|
+
//是否禁用编辑器
|
40
|
+
disabled: {
|
41
|
+
type: Boolean,
|
42
|
+
default: false
|
43
|
+
},
|
44
|
+
//是否允许复制
|
45
|
+
allowCopy: {
|
46
|
+
type: Boolean,
|
47
|
+
default: true
|
48
|
+
},
|
49
|
+
//是否允许粘贴
|
50
|
+
allowPaste: {
|
51
|
+
type: Boolean,
|
52
|
+
default: true
|
53
|
+
},
|
54
|
+
//是否允许剪切
|
55
|
+
allowCut: {
|
56
|
+
type: Boolean,
|
57
|
+
default: true
|
58
|
+
},
|
59
|
+
//是否允许粘贴html
|
60
|
+
allowPasteHtml: {
|
61
|
+
type: Boolean,
|
62
|
+
default: false
|
63
|
+
},
|
64
|
+
//是否显示边框
|
65
|
+
border: {
|
66
|
+
type: Boolean,
|
67
|
+
default: false
|
68
|
+
},
|
69
|
+
//主题色
|
70
|
+
color: {
|
71
|
+
type: String,
|
72
|
+
default: '#03a8f3',
|
73
|
+
validator(value: any) {
|
74
|
+
return DapCommon.matchingText(value, 'hex')
|
75
|
+
}
|
76
|
+
},
|
77
|
+
//视频宽高比
|
78
|
+
videoRatio: {
|
79
|
+
type: Number,
|
80
|
+
default: 16 / 9
|
81
|
+
},
|
82
|
+
//工具条按钮设置
|
83
|
+
toolbar: {
|
84
|
+
type: Object as PropType<ToolbarConfigType>,
|
85
|
+
default: null
|
86
|
+
},
|
87
|
+
//是否显示字数统计
|
88
|
+
showWordLength: {
|
89
|
+
type: Boolean,
|
90
|
+
default: false
|
91
|
+
},
|
92
|
+
//自定义粘贴纯文字
|
93
|
+
customTextPaste: {
|
94
|
+
type: Function as PropType<(data: string) => void | Promise<void>>,
|
95
|
+
default: null
|
96
|
+
},
|
97
|
+
//自定义粘贴html
|
98
|
+
customHtmlPaste: {
|
99
|
+
type: Function as PropType<(elements: AlexElement[]) => void | Promise<void>>,
|
100
|
+
default: null
|
101
|
+
},
|
102
|
+
//自定义粘贴图片
|
103
|
+
customImagePaste: {
|
104
|
+
type: Function as PropType<(file: File) => void | Promise<void>>,
|
105
|
+
default: null
|
106
|
+
},
|
107
|
+
//自定义粘贴视频
|
108
|
+
customVideoPaste: {
|
109
|
+
type: Function as PropType<(file: File) => void | Promise<void>>,
|
110
|
+
default: null
|
111
|
+
},
|
112
|
+
//自定义粘贴文件
|
113
|
+
customFilePaste: {
|
114
|
+
type: Function as PropType<(file: File) => void | Promise<void>>,
|
115
|
+
default: null
|
116
|
+
},
|
117
|
+
//菜单栏配置
|
118
|
+
menu: {
|
119
|
+
type: Object as PropType<MenuConfigType>,
|
120
|
+
default: null
|
121
|
+
},
|
122
|
+
//粘贴html时额外保留的标记(全部元素生效)
|
123
|
+
pasteKeepMarks: {
|
124
|
+
type: Object as PropType<ObjectType>,
|
125
|
+
default: null
|
126
|
+
},
|
127
|
+
//粘贴html时额外保留的样式(仅在非文本元素生效)
|
128
|
+
pasteKeepStyles: {
|
129
|
+
type: Object as PropType<ObjectType>,
|
130
|
+
default: null
|
131
|
+
},
|
132
|
+
//自定义node转元素时的处理
|
133
|
+
customParseNode: {
|
134
|
+
type: Function as PropType<(el: AlexElement) => AlexElement>,
|
135
|
+
default: null
|
136
|
+
},
|
137
|
+
//自定义额外的渲染规范
|
138
|
+
renderRules: {
|
139
|
+
type: Array as PropType<((el: AlexElement) => void)[]>,
|
140
|
+
default: function () {
|
141
|
+
return []
|
142
|
+
}
|
143
|
+
},
|
144
|
+
//自适应高度
|
145
|
+
autoheight: {
|
146
|
+
type: Boolean,
|
147
|
+
default: false
|
148
|
+
},
|
149
|
+
//是否使用tab快捷键
|
150
|
+
tab: {
|
151
|
+
type: Boolean,
|
152
|
+
default: true
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
export type EditifyPropsType = ExtractPublicPropTypes<typeof EditifyProps>
|