11import { isNull } from '../common/type'
22
3+ const fontFamilyConfig = [
4+ 'songti' ,
5+ 'yahei' ,
6+ 'kaiti' ,
7+ 'heiti' ,
8+ 'lishu' ,
9+ 'mono' ,
10+ 'arial' ,
11+ 'arialblack' ,
12+ 'comic' ,
13+ 'impact' ,
14+ 'times'
15+ ]
16+
17+ const fontSizeConfig = [
18+ '12px' ,
19+ '13px' ,
20+ '14px' ,
21+ '15px' ,
22+ '16px' ,
23+ '17px' ,
24+ '18px' ,
25+ '19px' ,
26+ '20px' ,
27+ '22px' ,
28+ '24px' ,
29+ '26px' ,
30+ '29px' ,
31+ '32px' ,
32+ '36px' ,
33+ '40px' ,
34+ '48px' ,
35+ '72px'
36+ ]
37+
38+ const lineHeightConfig = [ '1' , '1.2' , '1.5' , '2' , '2.5' , '3' , '4' , '5' ]
39+
340const betterTable = {
441 operationMenu : {
542 items : {
@@ -20,7 +57,7 @@ const betterTable = {
2057 }
2158}
2259
23- const toolbar = ( FluentEditor ) => {
60+ const toolbar = ( ) => {
2461 const underline = [ 'bold' , 'italic' , 'underline' , 'strike' ]
2562 const list = [ { list : 'ordered' } , { list : 'bullet' } ]
2663 const script = [ { script : 'sub' } , { script : 'super' } ]
@@ -29,9 +66,9 @@ const toolbar = (FluentEditor) => {
2966 container : [
3067 [ 'undo' , 'redo' , 'clean' ] ,
3168 [
32- { font : FluentEditor . imports [ 'formats/font' ] . whitelist } ,
33- { size : FluentEditor . imports [ 'formats/size' ] . whitelist } ,
34- { lineheight : FluentEditor . imports [ 'formats/lineheight' ] . whitelist } ,
69+ { font : fontFamilyConfig } ,
70+ { size : fontSizeConfig } ,
71+ { lineheight : lineHeightConfig } ,
3572 { header : [ 1 , 2 , 3 , 4 , 5 , 6 , false ] }
3673 ] ,
3774 underline ,
@@ -170,7 +207,7 @@ const defaultOption = ({ FluentEditor, state, mentionObj }) => {
170207 file : true , // 上传文件需开启
171208 image : FluentEditor . imports [ 'modules/image-spec' ] ,
172209 counter : false ,
173- toolbar : toolbar ( FluentEditor ) ,
210+ toolbar : toolbar ( ) ,
174211 'better-table' : betterTable ,
175212 mention : mention ( mentionObj ) ,
176213 keyboard : keyboard ( { FluentEditor, state } )
0 commit comments