1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import menusConfig, { EmotionsType, FontSizeConfType, IndentationType } from './menus'
|
7 | import eventsConfig from './events'
|
8 | import styleConfig from './style'
|
9 | import pasteConfig from './paste'
|
10 | import cmdConfig from './cmd'
|
11 | import imageConfig, { UploadImageHooksType } from './image'
|
12 | import textConfig from './text'
|
13 | import langConfig from './lang'
|
14 | import historyConfig from './history'
|
15 |
|
16 |
|
17 | export type DicType = {
|
18 | [key: string]: string
|
19 | }
|
20 |
|
21 |
|
22 | export type ConfigType = {
|
23 | height: number
|
24 | languageType: string[]
|
25 | languageTab: string
|
26 | menus: string[]
|
27 | fontNames: string[]
|
28 | lineHeights: string[]
|
29 | indentation: IndentationType
|
30 | fontSizes: FontSizeConfType
|
31 | colors: string[]
|
32 | emotions: EmotionsType[]
|
33 | zIndex: number
|
34 | onchange: Function
|
35 | onfocus: Function
|
36 | onblur: Function
|
37 | onchangeTimeout: number
|
38 | pasteFilterStyle: boolean
|
39 | pasteIgnoreImg: boolean
|
40 | pasteTextHandle: Function
|
41 | styleWithCSS: boolean
|
42 | linkImgCallback: Function
|
43 |
|
44 | placeholder: string
|
45 | zIndexFullScreen: number
|
46 | showFullScreen: boolean
|
47 | showLinkImg: boolean
|
48 | uploadImgServer: string
|
49 | uploadImgShowBase64: boolean
|
50 | uploadImgMaxSize: number
|
51 | uploadImgMaxLength: number
|
52 | uploadFileName: string
|
53 | uploadImgParams: DicType
|
54 | uploadImgParamsWithUrl: boolean
|
55 | uploadImgHeaders: DicType
|
56 | uploadImgHooks: UploadImageHooksType
|
57 | uploadImgTimeout: number
|
58 | withCredentials: boolean
|
59 | customUploadImg: Function | null
|
60 | customAlert: Function | null
|
61 |
|
62 | onCatalogChange: Function | null
|
63 |
|
64 | lang: string
|
65 | languages: typeof langConfig
|
66 |
|
67 | linkCheck: Function
|
68 | linkImgCheck: Function
|
69 | compatibleMode: () => boolean
|
70 | historyMaxSize: number
|
71 |
|
72 | focus: boolean
|
73 | }
|
74 |
|
75 | export type Resource = {
|
76 | [language: string]: ResourceLanguage
|
77 | }
|
78 |
|
79 | export type ResourceLanguage = {
|
80 | [namespace: string]: ResourceKey
|
81 | }
|
82 |
|
83 | export type ResourceKey =
|
84 | | string
|
85 | | {
|
86 | [key: string]: any
|
87 | }
|
88 |
|
89 |
|
90 | const defaultConfig = Object.assign(
|
91 | {},
|
92 | menusConfig,
|
93 | eventsConfig,
|
94 | styleConfig,
|
95 | cmdConfig,
|
96 | pasteConfig,
|
97 | imageConfig,
|
98 | textConfig,
|
99 | langConfig,
|
100 | historyConfig,
|
101 |
|
102 | {
|
103 | linkCheck: function (text: string, link: string): string | boolean {
|
104 | return true
|
105 | },
|
106 | },
|
107 |
|
108 | {
|
109 | linkImgCheck: function (src: string): string | boolean {
|
110 | return true
|
111 | },
|
112 | }
|
113 | )
|
114 |
|
115 | export default defaultConfig
|