UNPKG

5.72 kBPlain TextView Raw
1/**
2 * @description 菜单配置
3 * @author wangfupeng
4 */
5
6const SINA_PATH1 = 'http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal'
7const SINA_PATH2 = 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal'
8
9// 表情菜单数据结构类型
10export type EmotionsContentType = {
11 alt: string
12 src: string
13}
14export type EmotionsType = {
15 title: string
16 type: string
17 content: Array<EmotionsContentType | string>
18}
19
20// font-size 类型
21export type FontSizeConfType = {
22 [key: string]: {
23 name: string
24 value: string
25 }
26}
27
28// indent
29export interface IndentationOptions {
30 value: number
31 unit: string
32}
33export type IndentationType = string | IndentationOptions
34
35/*表情菜单数据结构类型END*/
36export default {
37 menus: [
38 'head',
39 'bold',
40 'fontSize',
41 // 'customFontSize',
42 'fontName',
43 'italic',
44 'underline',
45 'strikeThrough',
46 'indent',
47 'lineHeight',
48 'foreColor',
49 'backColor',
50 'link',
51 'list',
52 'justify',
53 'quote',
54 'emoticon',
55 'image',
56 'video',
57 'table',
58 'code',
59 'splitLine',
60 'undo',
61 'redo',
62 ],
63
64 fontNames: [
65 '黑体',
66 '仿宋',
67 '楷体',
68 '标楷体',
69 '华文仿宋',
70 '华文楷体',
71 '宋体',
72 '微软雅黑',
73 'Arial',
74 'Tahoma',
75 'Verdana',
76 'Times New Roman',
77 'Courier New',
78 ],
79
80 fontSizes: {
81 'x-small': {
82 name: '10px',
83 value: '1',
84 },
85 small: {
86 name: '13px',
87 value: '2',
88 },
89 normal: {
90 name: '16px',
91 value: '3',
92 },
93 large: {
94 name: '18px',
95 value: '4',
96 },
97 'x-large': {
98 name: '24px',
99 value: '5',
100 },
101 'xx-large': {
102 name: '32px',
103 value: '6',
104 },
105 'xxx-large': {
106 name: '48px',
107 value: '7',
108 },
109 },
110
111 // customFontSize: [ // 该菜单暂时不用 - 王福朋 20200924
112 // { value: '9px', text: '9' },
113 // { value: '10px', text: '10' },
114 // { value: '12px', text: '12' },
115 // { value: '14px', text: '14' },
116 // { value: '16px', text: '16' },
117 // { value: '20px', text: '20' },
118 // { value: '42px', text: '42' },
119 // { value: '72px', text: '72' },
120 // ],
121
122 colors: [
123 '#000000',
124 '#eeece0',
125 '#1c487f',
126 '#4d80bf',
127 '#c24f4a',
128 '#8baa4a',
129 '#7b5ba1',
130 '#46acc8',
131 '#f9963b',
132 '#ffffff',
133 ],
134
135 //插入代码语言配置
136 languageType: [
137 'Bash',
138 'C',
139 'C#',
140 'C++',
141 'CSS',
142 'Java',
143 'JavaScript',
144 'JSON',
145 'TypeScript',
146 'Plain text',
147 'Html',
148 'XML',
149 'SQL',
150 'Go',
151 'Kotlin',
152 'Lua',
153 'Markdown',
154 'PHP',
155 'Python',
156 'Shell Session',
157 'Ruby',
158 ],
159
160 languageTab: '    ',
161 /**
162 * 表情配置菜单
163 * 如果为emoji表情直接作为元素插入
164 * emoticon:Array<EmotionsType>
165 */
166 emotions: [
167 {
168 // tab 的标题
169 title: '默认',
170 // type -> 'emoji' / 'image'
171 type: 'image',
172 // content -> 数组
173 content: [
174 {
175 alt: '[坏笑]',
176 src: `${SINA_PATH1}/50/pcmoren_huaixiao_org.png`,
177 },
178 {
179 alt: '[舔屏]',
180 src: `${SINA_PATH1}/40/pcmoren_tian_org.png`,
181 },
182 {
183 alt: '[污]',
184 src: `${SINA_PATH1}/3c/pcmoren_wu_org.png`,
185 },
186 ],
187 },
188 {
189 // tab 的标题
190 title: '新浪',
191 // type -> 'emoji' / 'image'
192 type: 'image',
193 // content -> 数组
194 content: [
195 {
196 src: `${SINA_PATH2}/7a/shenshou_thumb.gif`,
197 alt: '[草泥马]',
198 },
199 {
200 src: `${SINA_PATH2}/60/horse2_thumb.gif`,
201 alt: '[神马]',
202 },
203 {
204 src: `${SINA_PATH2}/bc/fuyun_thumb.gif`,
205 alt: '[浮云]',
206 },
207 ],
208 },
209 {
210 // tab 的标题
211 title: 'emoji',
212 // type -> 'emoji' / 'image'
213 type: 'emoji',
214 // content -> 数组
215 content: '😀 😃 😄 😁 😆 😅 😂 😊 😇 🙂 🙃 😉 😓 😪 😴 🙄 🤔 😬 🤐'.split(/\s/),
216 },
217 {
218 // tab 的标题
219 title: '手势',
220 // type -> 'emoji' / 'image'
221 type: 'emoji',
222 // content -> 数组
223 content: [
224 '🙌',
225 '👏',
226 '👋',
227 '👍',
228 '👎',
229 '👊',
230 '✊',
231 '️👌',
232 '✋',
233 '👐',
234 '💪',
235 '🙏',
236 '️👆',
237 '👇',
238 '👈',
239 '👉',
240 '🖕',
241 '🖐',
242 '🤘',
243 ],
244 },
245 ],
246
247 lineHeights: ['1', '1.15', '1.6', '2', '2.5', '3'],
248
249 undoLimit: 20,
250
251 indentation: '2em',
252}