@@ -26,34 +26,114 @@ export type InitOptions = Omit<OmitStringIndexSignature<EditorOptions>, OmittedI
26
26
export type Version = `${'4' | '5' | '6' | '7' } ${'' | '-dev' | '-testing' | `.${number } ` | `.${number } .${number } `} `;
27
27
28
28
export interface IProps {
29
+ /**
30
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#apikey React Tech Ref - apiKey }
31
+ * @description TinyMCE API key for deployments using Tiny Cloud.
32
+ */
29
33
apiKey : string ;
34
+ /**
35
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#id React Tech Ref - id }
36
+ * @description The ID of the element to render the editor into.
37
+ */
30
38
id : string ;
39
+ /**
40
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#inline React Tech Ref - inline }
41
+ * @description Whether the editor should be rendered inline. Equivalent to the `inline` option in TinyMCE.
42
+ */
31
43
inline : boolean ;
44
+ /**
45
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#initialvalue React Tech Ref - initialValue }
46
+ * @description The initial HTML content of the editor.
47
+ *
48
+ * IMPORTANT: Ensure that this is **not** updated by `onEditorChange` or the editor will be unusable.
49
+ */
32
50
initialValue : string ;
51
+ /**
52
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#oneditorchange React Tech Ref - onEditorChange }
53
+ * @description Used to store the state of the editor outside the component. Typically used for controlled components.
54
+ * @param a The current HTML content of the editor.
55
+ * @param editor The TinyMCE editor instance.
56
+ * @returns void
57
+ */
33
58
onEditorChange : ( a : string , editor : TinyMCEEditor ) => void ;
59
+ /**
60
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#value React Tech Ref - value }
61
+ * @description The current HTML content of the editor. Typically used for controlled components.
62
+ */
34
63
value : string ;
64
+ /**
65
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#init React Tech Ref - init }
66
+ * @description Additional settings passed to `tinymce.init()` when initializing the editor.
67
+ */
35
68
init : InitOptions ;
69
+ /**
70
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tagname React Tech Ref - tagName }
71
+ * @description The tag name of the element to render the editor into. Only valid when `inline` is `true`.
72
+ */
36
73
tagName : string ;
74
+ /**
75
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tabIndex React Tech Ref - tabIndex }
76
+ * @description The tab index of the element that the editor wraps.
77
+ */
37
78
tabIndex : number ;
79
+ /**
80
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#cloudchannel React Tech Ref - cloudChannel }
81
+ * @description The TinyMCE build to use when loading from Tiny Cloud.
82
+ */
38
83
cloudChannel : Version ;
84
+ /**
85
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#plugins React Tech Ref - plugins }
86
+ * @description The plugins to load into the editor. Equivalent to the `plugins` option in TinyMCE.
87
+ */
39
88
plugins : NonNullable < EditorOptions [ 'plugins' ] > ;
89
+ /**
90
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#toolbar React Tech Ref - toolbar }
91
+ * @description The toolbar to load into the editor. Equivalent to the `toolbar` option in TinyMCE.
92
+ */
40
93
toolbar : NonNullable < EditorOptions [ 'toolbar' ] > ;
94
+ /**
95
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#disabled React Tech Ref - disabled }
96
+ * @description Whether the editor should be "disabled" (read-only).
97
+ */
41
98
disabled : boolean ;
99
+ /**
100
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#textareaname React Tech Ref - textareaName }
101
+ * @description Set the `name` attribute of the `textarea` element used for the editor in forms. Only valid in iframe mode.
102
+ */
42
103
textareaName : string ;
104
+ /**
105
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#tinymcescriptsrc React Tech Ref - tinymceScriptSrc }
106
+ * @description The URL of the TinyMCE script to lazy load.
107
+ */
43
108
tinymceScriptSrc : string | string [ ] | ScriptItem [ ] ;
109
+ /**
110
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#rollback React Tech Ref - rollback }
111
+ * @description The number of milliseconds to wait before reverting to the previous value when the editor's content changes.
112
+ */
44
113
rollback : number | false ;
114
+ /**
115
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#scriptloading React Tech Ref - scriptLoading }
116
+ * @description Options for how the TinyMCE script should be loaded.
117
+ * @property async Whether the script should be loaded with the `async` attribute.
118
+ * @property defer Whether the script should be loaded with the `defer` attribute.
119
+ * @property delay The number of milliseconds to wait before loading the script.
120
+ */
45
121
scriptLoading : {
46
122
async ?: boolean ;
47
123
defer ?: boolean ;
48
124
delay ?: number ;
49
125
} ;
126
+ /**
127
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/#licenseKey React Tech Ref - licenseKey }
128
+ * @description Tiny Cloud License Key for when self-hosting TinyMCE.
129
+ */
50
130
licenseKey : string ;
51
131
}
52
132
53
133
export interface IAllProps extends Partial < IProps > , Partial < IEvents > { }
54
134
55
135
/**
56
- * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/ } for the TinyMCE React Technical Reference
136
+ * @see {@link https://www.tiny.cloud/docs/tinymce/7/react-ref/ TinyMCE React Technical Reference }
57
137
*/
58
138
export class Editor extends React . Component < IAllProps > {
59
139
public static propTypes : IEditorPropTypes = EditorPropTypes ;
0 commit comments