vue-editify 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,30 @@
1
+ //三角图标大小
2
+ @triangle-size: 6px;
3
+ //编辑器内的默认字体大小
4
+ @font-size: 14px;
5
+ //字体颜色
6
+ @font-color: #555;
7
+ //较浅的字体颜色(副文本颜色)
8
+ @font-color-light: #888;
9
+ //更浅的字体颜色(placeholder和禁用字体颜色)
10
+ @font-color-disabled: #ccc;
11
+ //较深的字体颜色(编辑器内容区域字体颜色)
12
+ @font-color-dark: #333;
13
+ //链接字体颜色
14
+ @font-color-link: #079457;
15
+ //链接字体悬浮色
16
+ @font-color-link-dark: #05683d;
17
+ //边框颜色
18
+ @border-color: #dfdfdf;
19
+ //默认背景色
20
+ @background: #fff;
21
+ //较深的背景色
22
+ @background-dark: #f7f8fa;
23
+ //更深的背景色
24
+ @background-darker: #ebedf0;
25
+ //代码块背景色
26
+ @pre-background: #f2f6fb;
27
+ //反色调字体颜色
28
+ @reverse-color: #fff;
29
+ //反色调背景色
30
+ @reverse-background: #000;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * 这里是对highlight的主题样式的自定义设置
3
+ */
4
+
5
+ .editify-hljs-addition,
6
+ .editify-hljs-meta,
7
+ .editify-hljs-string,
8
+ .editify-hljs-symbol,
9
+ .editify-hljs-template-tag,
10
+ .editify-hljs-template-variable,
11
+ .editify-hljs-deletion,
12
+ .editify-hljs-variable {
13
+ color: #54489b;
14
+ }
15
+ .editify-hljs-comment,
16
+ .editify-hljs-quote {
17
+ color: #bbb;
18
+ }
19
+ .editify-hljs-bullet,
20
+ .editify-hljs-link,
21
+ .editify-hljs-number,
22
+ .editify-hljs-regexp,
23
+ .editify-hljs-attr,
24
+ .editify-hljs-attribute {
25
+ color: #0e9a56;
26
+ }
27
+
28
+ .editify-hljs-built_in,
29
+ .editify-hljs-doctag,
30
+ .editify-hljs-keyword,
31
+ .editify-hljs-name,
32
+ .editify-hljs-section,
33
+ .editify-hljs-strong,
34
+ .editify-hljs-tag,
35
+ .editify-hljs-literal,
36
+ .editify-hljs-type {
37
+ color: #092d5d;
38
+ }
39
+
40
+ .editify-hljs-title {
41
+ color: #c45d08;
42
+ }
43
+
44
+ .editify-hljs-selector-tag {
45
+ color: #920606;
46
+ }
47
+
48
+ .editify-hljs-selector-class {
49
+ color: #c45d08;
50
+ }
51
+
52
+ .editify-hljs-selector-id {
53
+ color: #0d658d;
54
+ }
@@ -0,0 +1,60 @@
1
+ //引入核心库
2
+ import hljs from 'highlight.js/lib/core'
3
+ //引入语言支持
4
+ import plaintext from 'highlight.js/lib/languages/plaintext'
5
+ import javascript from 'highlight.js/lib/languages/javascript'
6
+ import java from 'highlight.js/lib/languages/java'
7
+ import typescript from 'highlight.js/lib/languages/typescript'
8
+ import html from 'highlight.js/lib/languages/xml'
9
+ import markdown from 'highlight.js/lib/languages/markdown'
10
+ import css from 'highlight.js/lib/languages/css'
11
+ import less from 'highlight.js/lib/languages/less'
12
+ import scss from 'highlight.js/lib/languages/scss'
13
+ import objectivec from 'highlight.js/lib/languages/objectivec'
14
+ import swift from 'highlight.js/lib/languages/swift'
15
+ import dart from 'highlight.js/lib/languages/dart'
16
+ import nginx from 'highlight.js/lib/languages/nginx'
17
+ import php from 'highlight.js/lib/languages/php'
18
+ import python from 'highlight.js/lib/languages/python'
19
+ //注册语言
20
+ hljs.registerLanguage('plaintext', plaintext)
21
+ hljs.registerLanguage('javascript', javascript)
22
+ hljs.registerLanguage('java', java)
23
+ hljs.registerLanguage('typescript', typescript)
24
+ hljs.registerLanguage('html', html)
25
+ hljs.registerLanguage('markdown', markdown)
26
+ hljs.registerLanguage('css', css)
27
+ hljs.registerLanguage('less', less)
28
+ hljs.registerLanguage('scss', scss)
29
+ hljs.registerLanguage('objectivec', objectivec)
30
+ hljs.registerLanguage('swift', swift)
31
+ hljs.registerLanguage('dart', dart)
32
+ hljs.registerLanguage('nginx', nginx)
33
+ hljs.registerLanguage('php', php)
34
+ hljs.registerLanguage('python', python)
35
+ //引入css样式主题
36
+ import '../css/hljs.less'
37
+ //import 'highlight.js/styles/github.css'
38
+ //import 'highlight.js/styles/atom-one-light.css'
39
+ //import 'highlight.js/styles/lightfair.css'
40
+ //import 'highlight.js/styles/color-brewer.css'
41
+ //全局设置
42
+ hljs.configure({
43
+ cssSelector: 'pre',
44
+ classPrefix: 'editify-hljs-',
45
+ ignoreUnescapedHTML: true
46
+ })
47
+
48
+ //获取经过hljs处理的html元素
49
+ const getHljsHtml = function (code, language) {
50
+ if (language) {
51
+ return hljs.highlight(code, {
52
+ language: language,
53
+ ignoreIllegals: true
54
+ }).value
55
+ }
56
+ return hljs.highlightAuto(code).value
57
+ }
58
+ const languages = ['plaintext', 'javascript', 'html', 'css', 'less', 'scss', 'java', 'markdown', 'swift', 'objectivec', 'typescript', 'dart', 'nginx', 'php', 'python']
59
+
60
+ export { getHljsHtml, languages }
@@ -0,0 +1,211 @@
1
+ .editify-icon-task:before {
2
+ content: '\e605';
3
+ }
4
+
5
+ .editify-icon-source-view:before {
6
+ content: '\e6a1';
7
+ }
8
+
9
+ .editify-icon-upload:before {
10
+ content: '\e637';
11
+ }
12
+
13
+ .editify-icon-remove:before {
14
+ content: '\e852';
15
+ }
16
+
17
+ .editify-icon-code:before {
18
+ content: '\e6a0';
19
+ }
20
+
21
+ .editify-icon-stop:before {
22
+ content: '\e67c';
23
+ }
24
+
25
+ .editify-icon-loop:before {
26
+ content: '\e621';
27
+ }
28
+
29
+ .editify-icon-autoplay:before {
30
+ content: '\e618';
31
+ }
32
+
33
+ .editify-icon-muted:before {
34
+ content: '\ea0f';
35
+ }
36
+
37
+ .editify-icon-unmuted:before {
38
+ content: '\ea11';
39
+ }
40
+
41
+ .editify-icon-controls:before {
42
+ content: '\e627';
43
+ }
44
+
45
+ .editify-icon-video:before {
46
+ content: '\e622';
47
+ }
48
+
49
+ .editify-icon-single:before {
50
+ content: '\e63e';
51
+ }
52
+
53
+ .editify-icon-rotate:before {
54
+ content: '\e652';
55
+ }
56
+
57
+ .editify-icon-delete:before {
58
+ content: '\e60f';
59
+ }
60
+
61
+ .editify-icon-image:before {
62
+ content: '\e6ed';
63
+ }
64
+
65
+ .editify-icon-brush:before {
66
+ content: '\e71c';
67
+ }
68
+
69
+ .editify-icon-check:before {
70
+ content: '\e6cc';
71
+ }
72
+
73
+ .editify-icon-italic:before {
74
+ content: '\e69f';
75
+ }
76
+
77
+ .editify-icon-redo:before {
78
+ content: '\e6df';
79
+ }
80
+
81
+ .editify-icon-undo:before {
82
+ content: '\e713';
83
+ }
84
+
85
+ .editify-icon-code-block:before {
86
+ content: '\e620';
87
+ }
88
+
89
+ .editify-icon-width:before {
90
+ content: '\e674';
91
+ }
92
+
93
+ .editify-icon-edit:before {
94
+ content: '\e817';
95
+ }
96
+
97
+ .editify-icon-table:before {
98
+ content: '\e6c4';
99
+ }
100
+
101
+ .editify-icon-delete-table:before {
102
+ content: '\e7a2';
103
+ }
104
+
105
+ .editify-icon-align-center:before {
106
+ content: '\e783';
107
+ }
108
+
109
+ .editify-icon-align-justify:before {
110
+ content: '\e786';
111
+ }
112
+
113
+ .editify-icon-align-left:before {
114
+ content: '\e787';
115
+ }
116
+
117
+ .editify-icon-bold:before {
118
+ content: '\e78d';
119
+ }
120
+
121
+ .editify-icon-align-right:before {
122
+ content: '\e78f';
123
+ }
124
+
125
+ .editify-icon-font-color:before {
126
+ content: '\e792';
127
+ }
128
+
129
+ .editify-icon-format-clear:before {
130
+ content: '\e793';
131
+ }
132
+
133
+ .editify-icon-indent-increase:before {
134
+ content: '\e798';
135
+ }
136
+
137
+ .editify-icon-quote:before {
138
+ content: '\e79b';
139
+ }
140
+
141
+ .editify-icon-indent-decrease:before {
142
+ content: '\e79c';
143
+ }
144
+
145
+ .editify-icon-list-ordered:before {
146
+ content: '\e79f';
147
+ }
148
+
149
+ .editify-icon-list-unordered:before {
150
+ content: '\e7a0';
151
+ }
152
+
153
+ .editify-icon-link:before {
154
+ content: '\e7a1';
155
+ }
156
+
157
+ .editify-icon-paragraph:before {
158
+ content: '\e7a3';
159
+ }
160
+
161
+ .editify-icon-separator:before {
162
+ content: '\e7a4';
163
+ }
164
+
165
+ .editify-icon-subscript:before {
166
+ content: '\e7a5';
167
+ }
168
+
169
+ .editify-icon-superscript:before {
170
+ content: '\e7a6';
171
+ }
172
+
173
+ .editify-icon-strikethrough:before {
174
+ content: '\e7a7';
175
+ }
176
+
177
+ .editify-icon-underline:before {
178
+ content: '\e7a8';
179
+ }
180
+
181
+ .editify-icon-text-wrap:before {
182
+ content: '\e7a9';
183
+ }
184
+
185
+ .editify-icon-caret-down:before {
186
+ content: '\e78c';
187
+ }
188
+
189
+ .editify-icon-delete-column:before {
190
+ content: '\e784';
191
+ }
192
+
193
+ .editify-icon-delete-row:before {
194
+ content: '\e785';
195
+ }
196
+
197
+ .editify-icon-insert-column-left:before {
198
+ content: '\e788';
199
+ }
200
+
201
+ .editify-icon-insert-column-right:before {
202
+ content: '\e789';
203
+ }
204
+
205
+ .editify-icon-insert-row-bottom:before {
206
+ content: '\e78a';
207
+ }
208
+
209
+ .editify-icon-insert-row-top:before {
210
+ content: '\e78b';
211
+ }
Binary file
Binary file
package/src/index.js ADDED
@@ -0,0 +1,22 @@
1
+ //引入组件
2
+ import Editify from './Editify'
3
+ //引入图标样式
4
+ import './icon/iconfont.css'
5
+ //引入国际化
6
+ import i18n from './locale'
7
+ //版本号
8
+ const version = '0.0.1'
9
+ //安装函数
10
+ const install = (app, props) => {
11
+ const locale = (props ? props.locale : 'zh_CN') || 'zh_CN'
12
+ app.provide('$editTrans', i18n(locale))
13
+ app.provide('$editLocale', locale)
14
+ app.component(Editify.name, Editify)
15
+ }
16
+
17
+ const stdin_default = {
18
+ install,
19
+ version
20
+ }
21
+
22
+ export { stdin_default as default, install, version }
@@ -0,0 +1,84 @@
1
+ export default {
2
+ textWrapUp: 'Up feed',
3
+ textWrapDown: 'Down feed',
4
+ insertRowTop: 'Insert row forward',
5
+ insertRowBottom: 'Insert row backward',
6
+ insertColumnLeft: 'Insert column forward',
7
+ insertColumnRight: 'Insert column backward',
8
+ deleteRow: 'Delete rows',
9
+ deleteColumn: 'Delete column',
10
+ deleteTable: 'Delete table',
11
+ selectLanguages: 'Select language',
12
+ autoRecognize: 'Auto',
13
+ linkAddress: 'Link address',
14
+ newWindowOpen: 'Open in new window',
15
+ removeLink: 'Remove',
16
+ viewLink: 'View',
17
+ linkUrlEnterPlaceholder: 'Please enter the link address',
18
+ linkTextEnterPlaceholder: 'Please enter the link text',
19
+ width30: 'Set the width to 30%',
20
+ width50: 'Set the width to 50%',
21
+ width100: 'Set the width to 100%',
22
+ deleteImage: 'Delete image',
23
+ autoplay: 'Autoplay',
24
+ disabledAutoplay: 'Turn off autoplay',
25
+ loop: 'Loop',
26
+ disabledLoop: 'Close loop',
27
+ muted: 'Mute',
28
+ unmuted: 'Unmute',
29
+ controls: 'Play control',
30
+ deleteVideo: 'Delete video',
31
+ heading: 'Heading',
32
+ bold: 'Bold',
33
+ h1: 'Heading 1',
34
+ h2: 'Heading 2',
35
+ h3: 'Heading 3',
36
+ h4: 'Heading 4',
37
+ h5: 'Heading 5',
38
+ h6: 'Heading 6',
39
+ text: 'Paragraph',
40
+ italic: 'Italic',
41
+ orderList: 'Ordered list',
42
+ unorderList: 'Unordered list',
43
+ strikethrough: 'Strikethrough',
44
+ underline: 'Underline',
45
+ code: 'Inline code',
46
+ superscript: 'Superscript',
47
+ subscript: 'Subscript',
48
+ fontSize: 'Font size',
49
+ fontFamily: 'Font family',
50
+ defaultFontFamily: 'Default',
51
+ foreColor: 'Forecolor',
52
+ defaultColor: 'Default color',
53
+ backColor: 'Backcolor',
54
+ formatClear: 'Clear format',
55
+ defaultSize: 'Default',
56
+ totalWordCount: 'Total word count: ',
57
+ align: 'Alignment mode',
58
+ undo: 'Undo',
59
+ redo: 'Redo',
60
+ quote: 'Quote',
61
+ lineHeight: 'Line height',
62
+ indent: 'Indent',
63
+ insertLink: 'Insert',
64
+ insertImage: 'Insert',
65
+ remoteImage: 'Remote',
66
+ uploadImage: 'Upload',
67
+ imageUrlPlaceholder: 'Please enter the image address',
68
+ insert: 'Insert',
69
+ insertVideo: 'Insert',
70
+ remoteVideo: 'Remote',
71
+ uploadVideo: 'Upload',
72
+ videoUrlPlaceholder: 'Please enter the video address',
73
+ insertTable: 'Insert table',
74
+ inserCodeBlock: 'Insert code block',
75
+ sourceView: 'Code view',
76
+ task: 'Task',
77
+ indentIncrease: 'Increase indent',
78
+ indentDecrease: 'Reduce indent',
79
+ alignLeft: 'Align left',
80
+ alignCenter: 'Align center',
81
+ alignRight: 'Align right',
82
+ alignJustify: 'Align justify',
83
+ defaultLineHeight: 'Default'
84
+ }
@@ -0,0 +1,14 @@
1
+ import en_US from './en_US'
2
+ import zh_CN from './zh_CN'
3
+
4
+ //翻译词组
5
+ const translations = {
6
+ zh_CN,
7
+ en_US
8
+ }
9
+
10
+ export default locale => {
11
+ return key => {
12
+ return translations[locale][key]
13
+ }
14
+ }
@@ -0,0 +1,84 @@
1
+ export default {
2
+ textWrapUp: '向上换行',
3
+ textWrapDown: '向下换行',
4
+ insertRowTop: '向前插入行',
5
+ insertRowBottom: '向后插入行',
6
+ insertColumnLeft: '向前插入列',
7
+ insertColumnRight: '向后插入列',
8
+ deleteRow: '删除行',
9
+ deleteColumn: '删除列',
10
+ deleteTable: '删除表格',
11
+ selectLanguages: '选择语言',
12
+ autoRecognize: '自动识别',
13
+ linkAddress: '链接地址',
14
+ newWindowOpen: '新窗口打开',
15
+ removeLink: '移除链接',
16
+ viewLink: '查看链接',
17
+ linkUrlEnterPlaceholder: '请输入链接地址',
18
+ linkTextEnterPlaceholder: '请输入链接文本',
19
+ width30: '30%宽度',
20
+ width50: '50%宽度',
21
+ width100: '100%宽度',
22
+ deleteImage: '删除图片',
23
+ autoplay: '自动播放',
24
+ disabledAutoplay: '关闭自动播放',
25
+ loop: '循环播放',
26
+ disabledLoop: '关闭循环播放',
27
+ muted: '静音',
28
+ unmuted: '播放声音',
29
+ controls: '播放控制',
30
+ deleteVideo: '删除视频',
31
+ heading: '标题',
32
+ bold: '粗体',
33
+ h1: '一级标题',
34
+ h2: '二级标题',
35
+ h3: '三级标题',
36
+ h4: '四级标题',
37
+ h5: '五级标题',
38
+ h6: '六级标题',
39
+ text: '正文',
40
+ italic: '斜体',
41
+ orderList: '有序列表',
42
+ unorderList: '无序列表',
43
+ strikethrough: '删除线',
44
+ underline: '下划线',
45
+ code: '行内代码',
46
+ superscript: '上标',
47
+ subscript: '下标',
48
+ fontSize: '字号',
49
+ fontFamily: '字体',
50
+ defaultFontFamily: '默认字体',
51
+ foreColor: '前景色',
52
+ defaultColor: '默认颜色',
53
+ backColor: '背景色',
54
+ formatClear: '清除格式',
55
+ defaultSize: '默认字号',
56
+ totalWordCount: '总字数:',
57
+ align: '对齐方式',
58
+ undo: '撤销',
59
+ redo: '重做',
60
+ quote: '引用',
61
+ lineHeight: '行高',
62
+ indent: '缩进',
63
+ insertLink: '插入链接',
64
+ insertImage: '插入图片',
65
+ remoteImage: '网络图片',
66
+ uploadImage: '上传图片',
67
+ imageUrlPlaceholder: '请输入图片地址',
68
+ insert: '插入',
69
+ insertVideo: '插入视频',
70
+ remoteVideo: '网络视频',
71
+ uploadVideo: '上传视频',
72
+ videoUrlPlaceholder: '请输入视频地址',
73
+ insertTable: '插入表格',
74
+ inserCodeBlock: '插入代码块',
75
+ sourceView: '代码视图',
76
+ task: '待办',
77
+ indentIncrease: '增加缩进',
78
+ indentDecrease: '减少缩进',
79
+ alignLeft: '左对齐',
80
+ alignCenter: '居中对齐',
81
+ alignRight: '右对齐',
82
+ alignJustify: '两端对齐',
83
+ defaultLineHeight: '默认行高'
84
+ }