-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathEditorOptionsPlugin.ts
More file actions
89 lines (85 loc) · 2.45 KB
/
EditorOptionsPlugin.ts
File metadata and controls
89 lines (85 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { emojiReplacements } from './getReplacements';
import { ExperimentalFeature } from 'roosterjs-content-model-types';
import { OptionPaneProps, OptionState, UrlPlaceholder } from './OptionState';
import { OptionsPane } from './OptionsPane';
import { SidePaneElementProps } from '../SidePaneElement';
import { SidePanePluginImpl } from '../SidePanePluginImpl';
const initialState: OptionState = {
pluginList: {
autoFormat: true,
edit: true,
paste: true,
shortcut: true,
tableEdit: true,
contextMenu: true,
watermark: true,
emoji: true,
pasteOption: true,
sampleEntity: true,
markdown: true,
imageEditPlugin: true,
hyperlink: true,
customReplace: true,
hintText: true,
hiddenProperty: true,
},
defaultFormat: {
fontFamily: 'Calibri',
fontSize: '11pt',
textColor: '#000000',
},
linkTitle: 'Ctrl+Click to follow the link:' + UrlPlaceholder,
watermarkText: 'Type content here ...',
forcePreserveRatio: false,
isRtl: false,
disableCache: false,
tableFeaturesContainerSelector: '#' + 'EditorContainer',
allowExcelNoBorderTable: false,
imageMenu: true,
tableMenu: true,
listMenu: true,
autoFormatOptions: {
autoBullet: true,
autoLink: true,
autoNumbering: true,
autoUnlink: false,
autoHyphen: true,
autoFraction: true,
autoOrdinals: true,
autoMailto: true,
autoTel: true,
removeListMargins: false,
autoHorizontalLine: true,
},
markdownOptions: {
bold: true,
italic: true,
strikethrough: true,
codeFormat: {},
},
editPluginOptions: {
handleTabKey: true,
},
customReplacements: emojiReplacements,
experimentalFeatures: new Set<ExperimentalFeature>([
'PersistCache',
'HandleEnterKey',
'CustomCopyCut',
]),
};
export class EditorOptionsPlugin extends SidePanePluginImpl<OptionsPane, OptionPaneProps> {
constructor() {
super(OptionsPane, 'options', 'Editor Options');
}
getBuildInPluginState(): OptionState {
let result: OptionState;
this.getComponent(component => (result = component.getState()));
return result || initialState;
}
getComponentProps(base: SidePaneElementProps) {
return {
...initialState,
...base,
};
}
}