vue-editify 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/examples/App.vue +62 -61
- 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 +17 -17
- 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 +1144 -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 -403
- package/src/editify/editify.vue +803 -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/hljs/index.ts
CHANGED
@@ -1,197 +1,197 @@
|
|
1
|
-
//引入核心库
|
2
|
-
import hljs from 'highlight.js/lib/core'
|
3
|
-
//引入语言支持
|
4
|
-
import plaintext from 'highlight.js/lib/languages/plaintext'
|
5
|
-
import json from 'highlight.js/lib/languages/json'
|
6
|
-
import javascript from 'highlight.js/lib/languages/javascript'
|
7
|
-
import java from 'highlight.js/lib/languages/java'
|
8
|
-
import typescript from 'highlight.js/lib/languages/typescript'
|
9
|
-
import python from 'highlight.js/lib/languages/python'
|
10
|
-
import php from 'highlight.js/lib/languages/php'
|
11
|
-
import css from 'highlight.js/lib/languages/css'
|
12
|
-
import less from 'highlight.js/lib/languages/less'
|
13
|
-
import scss from 'highlight.js/lib/languages/scss'
|
14
|
-
import html from 'highlight.js/lib/languages/xml'
|
15
|
-
import markdown from 'highlight.js/lib/languages/markdown'
|
16
|
-
import objectivec from 'highlight.js/lib/languages/objectivec'
|
17
|
-
import swift from 'highlight.js/lib/languages/swift'
|
18
|
-
import dart from 'highlight.js/lib/languages/dart'
|
19
|
-
import nginx from 'highlight.js/lib/languages/nginx'
|
20
|
-
import go from 'highlight.js/lib/languages/go'
|
21
|
-
import http from 'highlight.js/lib/languages/http'
|
22
|
-
import ruby from 'highlight.js/lib/languages/ruby'
|
23
|
-
import c from 'highlight.js/lib/languages/c'
|
24
|
-
import cpp from 'highlight.js/lib/languages/cpp'
|
25
|
-
import csharp from 'highlight.js/lib/languages/csharp'
|
26
|
-
import sql from 'highlight.js/lib/languages/sql'
|
27
|
-
import shell from 'highlight.js/lib/languages/shell'
|
28
|
-
import r from 'highlight.js/lib/languages/r'
|
29
|
-
import kotlin from 'highlight.js/lib/languages/kotlin'
|
30
|
-
import rust from 'highlight.js/lib/languages/rust'
|
31
|
-
//注册语言
|
32
|
-
hljs.registerLanguage('plaintext', plaintext)
|
33
|
-
hljs.registerLanguage('json', json)
|
34
|
-
hljs.registerLanguage('javascript', javascript)
|
35
|
-
hljs.registerLanguage('java', java)
|
36
|
-
hljs.registerLanguage('typescript', typescript)
|
37
|
-
hljs.registerLanguage('python', python)
|
38
|
-
hljs.registerLanguage('php', php)
|
39
|
-
hljs.registerLanguage('css', css)
|
40
|
-
hljs.registerLanguage('less', less)
|
41
|
-
hljs.registerLanguage('scss', scss)
|
42
|
-
hljs.registerLanguage('html', html)
|
43
|
-
hljs.registerLanguage('markdown', markdown)
|
44
|
-
hljs.registerLanguage('objectivec', objectivec)
|
45
|
-
hljs.registerLanguage('swift', swift)
|
46
|
-
hljs.registerLanguage('dart', dart)
|
47
|
-
hljs.registerLanguage('nginx', nginx)
|
48
|
-
hljs.registerLanguage('go', go)
|
49
|
-
hljs.registerLanguage('http', http)
|
50
|
-
hljs.registerLanguage('ruby', ruby)
|
51
|
-
hljs.registerLanguage('c', c)
|
52
|
-
hljs.registerLanguage('cpp', cpp)
|
53
|
-
hljs.registerLanguage('csharp', csharp)
|
54
|
-
hljs.registerLanguage('sql', sql)
|
55
|
-
hljs.registerLanguage('shell', shell)
|
56
|
-
hljs.registerLanguage('r', r)
|
57
|
-
hljs.registerLanguage('kotlin', kotlin)
|
58
|
-
hljs.registerLanguage('rust', rust)
|
59
|
-
//引入css样式主题
|
60
|
-
import '../css/hljs.less'
|
61
|
-
//import 'highlight.js/styles/github.css'
|
62
|
-
//import 'highlight.js/styles/atom-one-light.css'
|
63
|
-
//import 'highlight.js/styles/lightfair.css'
|
64
|
-
//import 'highlight.js/styles/color-brewer.css'
|
65
|
-
//全局设置
|
66
|
-
hljs.configure({
|
67
|
-
cssSelector: 'pre',
|
68
|
-
classPrefix: 'editify-hljs-',
|
69
|
-
ignoreUnescapedHTML: true
|
70
|
-
})
|
71
|
-
|
72
|
-
export type LanguagesItemType = {
|
73
|
-
label?: string
|
74
|
-
value?: string
|
75
|
-
}
|
76
|
-
|
77
|
-
//获取经过hljs处理的html元素
|
78
|
-
export const getHljsHtml = function (code: string, language: string) {
|
79
|
-
if (language) {
|
80
|
-
return hljs.highlight(code, {
|
81
|
-
language: language,
|
82
|
-
ignoreIllegals: true
|
83
|
-
}).value
|
84
|
-
}
|
85
|
-
return hljs.highlightAuto(code).value
|
86
|
-
}
|
87
|
-
//可选择语言列表
|
88
|
-
export const languages: LanguagesItemType[] = [
|
89
|
-
{
|
90
|
-
label: 'Plain Text',
|
91
|
-
value: 'plaintext'
|
92
|
-
},
|
93
|
-
{
|
94
|
-
label: 'JSON',
|
95
|
-
value: 'json'
|
96
|
-
},
|
97
|
-
{
|
98
|
-
label: 'JavaScript',
|
99
|
-
value: 'javascript'
|
100
|
-
},
|
101
|
-
{
|
102
|
-
label: 'Java',
|
103
|
-
value: 'java'
|
104
|
-
},
|
105
|
-
{
|
106
|
-
label: 'TypeScript',
|
107
|
-
value: 'typescript'
|
108
|
-
},
|
109
|
-
{
|
110
|
-
label: 'Python',
|
111
|
-
value: 'python'
|
112
|
-
},
|
113
|
-
{
|
114
|
-
label: 'PHP',
|
115
|
-
value: 'php'
|
116
|
-
},
|
117
|
-
{
|
118
|
-
label: 'CSS',
|
119
|
-
value: 'css'
|
120
|
-
},
|
121
|
-
{
|
122
|
-
label: 'Less',
|
123
|
-
value: 'less'
|
124
|
-
},
|
125
|
-
{
|
126
|
-
label: 'Scss',
|
127
|
-
value: 'scss'
|
128
|
-
},
|
129
|
-
{
|
130
|
-
label: 'HTML',
|
131
|
-
value: 'html'
|
132
|
-
},
|
133
|
-
{
|
134
|
-
label: 'Markdown',
|
135
|
-
value: 'markdown'
|
136
|
-
},
|
137
|
-
{
|
138
|
-
label: 'Objective-C',
|
139
|
-
value: 'objectivec'
|
140
|
-
},
|
141
|
-
{
|
142
|
-
label: 'Swift',
|
143
|
-
value: 'swift'
|
144
|
-
},
|
145
|
-
{
|
146
|
-
label: 'Dart',
|
147
|
-
value: 'dart'
|
148
|
-
},
|
149
|
-
{
|
150
|
-
label: 'Nginx',
|
151
|
-
value: 'nginx'
|
152
|
-
},
|
153
|
-
{
|
154
|
-
label: 'HTTP',
|
155
|
-
value: 'http'
|
156
|
-
},
|
157
|
-
{
|
158
|
-
label: 'Go',
|
159
|
-
value: 'go'
|
160
|
-
},
|
161
|
-
{
|
162
|
-
label: 'Ruby',
|
163
|
-
value: 'ruby'
|
164
|
-
},
|
165
|
-
{
|
166
|
-
label: 'C',
|
167
|
-
value: 'c'
|
168
|
-
},
|
169
|
-
{
|
170
|
-
label: 'C++',
|
171
|
-
value: 'cpp'
|
172
|
-
},
|
173
|
-
{
|
174
|
-
label: 'C#',
|
175
|
-
value: 'csharp'
|
176
|
-
},
|
177
|
-
{
|
178
|
-
label: 'SQL',
|
179
|
-
value: 'sql'
|
180
|
-
},
|
181
|
-
{
|
182
|
-
label: 'Shell',
|
183
|
-
value: 'shell'
|
184
|
-
},
|
185
|
-
{
|
186
|
-
label: 'R',
|
187
|
-
value: 'r'
|
188
|
-
},
|
189
|
-
{
|
190
|
-
label: 'Kotlin',
|
191
|
-
value: 'kotlin'
|
192
|
-
},
|
193
|
-
{
|
194
|
-
label: 'Rust',
|
195
|
-
value: 'rust'
|
196
|
-
}
|
197
|
-
]
|
1
|
+
//引入核心库
|
2
|
+
import hljs from 'highlight.js/lib/core'
|
3
|
+
//引入语言支持
|
4
|
+
import plaintext from 'highlight.js/lib/languages/plaintext'
|
5
|
+
import json from 'highlight.js/lib/languages/json'
|
6
|
+
import javascript from 'highlight.js/lib/languages/javascript'
|
7
|
+
import java from 'highlight.js/lib/languages/java'
|
8
|
+
import typescript from 'highlight.js/lib/languages/typescript'
|
9
|
+
import python from 'highlight.js/lib/languages/python'
|
10
|
+
import php from 'highlight.js/lib/languages/php'
|
11
|
+
import css from 'highlight.js/lib/languages/css'
|
12
|
+
import less from 'highlight.js/lib/languages/less'
|
13
|
+
import scss from 'highlight.js/lib/languages/scss'
|
14
|
+
import html from 'highlight.js/lib/languages/xml'
|
15
|
+
import markdown from 'highlight.js/lib/languages/markdown'
|
16
|
+
import objectivec from 'highlight.js/lib/languages/objectivec'
|
17
|
+
import swift from 'highlight.js/lib/languages/swift'
|
18
|
+
import dart from 'highlight.js/lib/languages/dart'
|
19
|
+
import nginx from 'highlight.js/lib/languages/nginx'
|
20
|
+
import go from 'highlight.js/lib/languages/go'
|
21
|
+
import http from 'highlight.js/lib/languages/http'
|
22
|
+
import ruby from 'highlight.js/lib/languages/ruby'
|
23
|
+
import c from 'highlight.js/lib/languages/c'
|
24
|
+
import cpp from 'highlight.js/lib/languages/cpp'
|
25
|
+
import csharp from 'highlight.js/lib/languages/csharp'
|
26
|
+
import sql from 'highlight.js/lib/languages/sql'
|
27
|
+
import shell from 'highlight.js/lib/languages/shell'
|
28
|
+
import r from 'highlight.js/lib/languages/r'
|
29
|
+
import kotlin from 'highlight.js/lib/languages/kotlin'
|
30
|
+
import rust from 'highlight.js/lib/languages/rust'
|
31
|
+
//注册语言
|
32
|
+
hljs.registerLanguage('plaintext', plaintext)
|
33
|
+
hljs.registerLanguage('json', json)
|
34
|
+
hljs.registerLanguage('javascript', javascript)
|
35
|
+
hljs.registerLanguage('java', java)
|
36
|
+
hljs.registerLanguage('typescript', typescript)
|
37
|
+
hljs.registerLanguage('python', python)
|
38
|
+
hljs.registerLanguage('php', php)
|
39
|
+
hljs.registerLanguage('css', css)
|
40
|
+
hljs.registerLanguage('less', less)
|
41
|
+
hljs.registerLanguage('scss', scss)
|
42
|
+
hljs.registerLanguage('html', html)
|
43
|
+
hljs.registerLanguage('markdown', markdown)
|
44
|
+
hljs.registerLanguage('objectivec', objectivec)
|
45
|
+
hljs.registerLanguage('swift', swift)
|
46
|
+
hljs.registerLanguage('dart', dart)
|
47
|
+
hljs.registerLanguage('nginx', nginx)
|
48
|
+
hljs.registerLanguage('go', go)
|
49
|
+
hljs.registerLanguage('http', http)
|
50
|
+
hljs.registerLanguage('ruby', ruby)
|
51
|
+
hljs.registerLanguage('c', c)
|
52
|
+
hljs.registerLanguage('cpp', cpp)
|
53
|
+
hljs.registerLanguage('csharp', csharp)
|
54
|
+
hljs.registerLanguage('sql', sql)
|
55
|
+
hljs.registerLanguage('shell', shell)
|
56
|
+
hljs.registerLanguage('r', r)
|
57
|
+
hljs.registerLanguage('kotlin', kotlin)
|
58
|
+
hljs.registerLanguage('rust', rust)
|
59
|
+
//引入css样式主题
|
60
|
+
import '../css/hljs.less'
|
61
|
+
//import 'highlight.js/styles/github.css'
|
62
|
+
//import 'highlight.js/styles/atom-one-light.css'
|
63
|
+
//import 'highlight.js/styles/lightfair.css'
|
64
|
+
//import 'highlight.js/styles/color-brewer.css'
|
65
|
+
//全局设置
|
66
|
+
hljs.configure({
|
67
|
+
cssSelector: 'pre',
|
68
|
+
classPrefix: 'editify-hljs-',
|
69
|
+
ignoreUnescapedHTML: true
|
70
|
+
})
|
71
|
+
|
72
|
+
export type LanguagesItemType = {
|
73
|
+
label?: string
|
74
|
+
value?: string
|
75
|
+
}
|
76
|
+
|
77
|
+
//获取经过hljs处理的html元素
|
78
|
+
export const getHljsHtml = function (code: string, language: string) {
|
79
|
+
if (language) {
|
80
|
+
return hljs.highlight(code, {
|
81
|
+
language: language,
|
82
|
+
ignoreIllegals: true
|
83
|
+
}).value
|
84
|
+
}
|
85
|
+
return hljs.highlightAuto(code).value
|
86
|
+
}
|
87
|
+
//可选择语言列表
|
88
|
+
export const languages: LanguagesItemType[] = [
|
89
|
+
{
|
90
|
+
label: 'Plain Text',
|
91
|
+
value: 'plaintext'
|
92
|
+
},
|
93
|
+
{
|
94
|
+
label: 'JSON',
|
95
|
+
value: 'json'
|
96
|
+
},
|
97
|
+
{
|
98
|
+
label: 'JavaScript',
|
99
|
+
value: 'javascript'
|
100
|
+
},
|
101
|
+
{
|
102
|
+
label: 'Java',
|
103
|
+
value: 'java'
|
104
|
+
},
|
105
|
+
{
|
106
|
+
label: 'TypeScript',
|
107
|
+
value: 'typescript'
|
108
|
+
},
|
109
|
+
{
|
110
|
+
label: 'Python',
|
111
|
+
value: 'python'
|
112
|
+
},
|
113
|
+
{
|
114
|
+
label: 'PHP',
|
115
|
+
value: 'php'
|
116
|
+
},
|
117
|
+
{
|
118
|
+
label: 'CSS',
|
119
|
+
value: 'css'
|
120
|
+
},
|
121
|
+
{
|
122
|
+
label: 'Less',
|
123
|
+
value: 'less'
|
124
|
+
},
|
125
|
+
{
|
126
|
+
label: 'Scss',
|
127
|
+
value: 'scss'
|
128
|
+
},
|
129
|
+
{
|
130
|
+
label: 'HTML',
|
131
|
+
value: 'html'
|
132
|
+
},
|
133
|
+
{
|
134
|
+
label: 'Markdown',
|
135
|
+
value: 'markdown'
|
136
|
+
},
|
137
|
+
{
|
138
|
+
label: 'Objective-C',
|
139
|
+
value: 'objectivec'
|
140
|
+
},
|
141
|
+
{
|
142
|
+
label: 'Swift',
|
143
|
+
value: 'swift'
|
144
|
+
},
|
145
|
+
{
|
146
|
+
label: 'Dart',
|
147
|
+
value: 'dart'
|
148
|
+
},
|
149
|
+
{
|
150
|
+
label: 'Nginx',
|
151
|
+
value: 'nginx'
|
152
|
+
},
|
153
|
+
{
|
154
|
+
label: 'HTTP',
|
155
|
+
value: 'http'
|
156
|
+
},
|
157
|
+
{
|
158
|
+
label: 'Go',
|
159
|
+
value: 'go'
|
160
|
+
},
|
161
|
+
{
|
162
|
+
label: 'Ruby',
|
163
|
+
value: 'ruby'
|
164
|
+
},
|
165
|
+
{
|
166
|
+
label: 'C',
|
167
|
+
value: 'c'
|
168
|
+
},
|
169
|
+
{
|
170
|
+
label: 'C++',
|
171
|
+
value: 'cpp'
|
172
|
+
},
|
173
|
+
{
|
174
|
+
label: 'C#',
|
175
|
+
value: 'csharp'
|
176
|
+
},
|
177
|
+
{
|
178
|
+
label: 'SQL',
|
179
|
+
value: 'sql'
|
180
|
+
},
|
181
|
+
{
|
182
|
+
label: 'Shell',
|
183
|
+
value: 'shell'
|
184
|
+
},
|
185
|
+
{
|
186
|
+
label: 'R',
|
187
|
+
value: 'r'
|
188
|
+
},
|
189
|
+
{
|
190
|
+
label: 'Kotlin',
|
191
|
+
value: 'kotlin'
|
192
|
+
},
|
193
|
+
{
|
194
|
+
label: 'Rust',
|
195
|
+
value: 'rust'
|
196
|
+
}
|
197
|
+
]
|