@@ -79,12 +79,76 @@ class TuiEditor extends React.Component {
7979}
8080
8181
82+ TuiEditor . defaultProps = {
83+ height : '300px' ,
84+ minHeight : '300px' ,
85+ initialValue : '' ,
86+ previewStyle : '' ,
87+ initialEditType : 'wysiwyg' ,
88+ language : 'en-US' ,
89+ useCommandShortcut : true ,
90+ customHTMLSanitizer : null ,
91+ frontMatter : false ,
92+ hideModeSwitch : false ,
93+ referenceDefinition :false ,
94+ usageStatistics : false ,
95+ useDefaultHTMLSanitizer : true
96+ }
97+
8298TuiEditor . propTypes = {
83- onChange : PropTypes . func . isRequired ,
99+ className : PropTypes . string ,
100+ // Markdown editor's preview style (tab, vertical)
84101 previewStyle : PropTypes . string . isRequired ,
85- height : PropTypes . string . isRequired ,
86- initialEditType : PropTypes . string . isRequired ,
102+ // Editor's height style value. Height is applied as border-box ex) '300px', '100%', 'auto'
103+ height : PropTypes . string ,
104+ // Initial editor type (markdown, wysiwyg)
105+ initialEditType : PropTypes . string ,
106+ // Editor's initial value
87107 initialValue : PropTypes . string ,
108+ // Editor's min-height style value in pixel ex) '300px'
109+ minHeight : PropTypes . string ,
110+ // The placeholder text of the editable element.
111+ placeholder : PropTypes . string ,
112+ // hide mode switch tab bar
113+ hideModeSwitch : PropTypes . bool ,
114+ // language, 'en-US'
115+ language : PropTypes . string ,
116+ // whether use keyboard shortcuts to perform commands
117+ useCommandShortcut : PropTypes . bool ,
118+ // It would be emitted when editor fully load1
119+ onLoad : PropTypes . func ,
120+ // It would be emitted when content changed
121+ onChange : PropTypes . func ,
122+ // It would be emitted when format change by cursor position
123+ onStateChange : PropTypes . func ,
124+ // It would be emitted when editor get focus
125+ onFocus : PropTypes . func ,
126+ // It would be emitted when editor loose focus
127+ onBlur : PropTypes . func ,
128+ // hooks
129+ hooks : PropTypes . arrayOf ( PropTypes . object ) ,
130+ // send hostname to google analytics
131+ usageStatistics : PropTypes . bool ,
132+ // use default htmlSanitizer
133+ useDefaultHTMLSanitizer : PropTypes . bool ,
134+ // toolbar items.
135+ toolbarItems : PropTypes . arrayOf ( PropTypes . object ) ,
136+ // Array of plugins. A plugin can be either a function or an array in the form of [function, options].
137+ plugins : PropTypes . arrayOf ( PropTypes . object ) ,
138+ // Using extended Autolinks specified in GFM spec
139+ extendedAutolinks : PropTypes . object ,
140+ // convertor extention
141+ customConvertor : PropTypes . object ,
142+ // Attributes of anchor element that should be rel, target, contenteditable, hreflang, type
143+ linkAttribute : PropTypes . object ,
144+ // Object containing custom renderer functions correspond to markdown node
145+ customHTMLRenderer : PropTypes . object ,
146+ // whether use the specification of link reference definition
147+ referenceDefinition : PropTypes . bool ,
148+ // custom HTML sanitizer
149+ customHTMLSanitizer : PropTypes . func ,
150+ // whether use the front matter
151+ frontMatter : PropTypes . bool
88152}
89153
90154export default TuiEditor
0 commit comments