@editorcn/editor 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,314 @@
1
+ import * as react from 'react';
2
+ import react__default from 'react';
3
+ import { Editor } from '@tiptap/react';
4
+ import * as _tiptap_core from '@tiptap/core';
5
+ import { Node } from '@tiptap/core';
6
+ import * as _tiptap_extension_link from '@tiptap/extension-link';
7
+
8
+ interface RichTextEditorLabels {
9
+ boldControlLabel: string;
10
+ italicControlLabel: string;
11
+ underlineControlLabel: string;
12
+ strikeControlLabel: string;
13
+ clearFormattingControlLabel: string;
14
+ codeControlLabel: string;
15
+ codeBlockControlLabel: string;
16
+ h1ControlLabel: string;
17
+ h2ControlLabel: string;
18
+ h3ControlLabel: string;
19
+ h4ControlLabel: string;
20
+ h5ControlLabel: string;
21
+ h6ControlLabel: string;
22
+ bulletListControlLabel: string;
23
+ orderedListControlLabel: string;
24
+ blockquoteControlLabel: string;
25
+ hrControlLabel: string;
26
+ linkControlLabel: string;
27
+ unlinkControlLabel: string;
28
+ undoControlLabel: string;
29
+ redoControlLabel: string;
30
+ alignLeftControlLabel: string;
31
+ alignCenterControlLabel: string;
32
+ alignRightControlLabel: string;
33
+ alignJustifyControlLabel: string;
34
+ highlightControlLabel: string;
35
+ subscriptControlLabel: string;
36
+ superscriptControlLabel: string;
37
+ tasksControlLabel: string;
38
+ tasksSinkLabel: string;
39
+ tasksLiftLabel: string;
40
+ sourceCodeControlLabel: string;
41
+ linkEditorInputLabel: string;
42
+ linkEditorInputPlaceholder: string;
43
+ linkEditorExternalLink: string;
44
+ linkEditorInternalLink: string;
45
+ linkEditorSave: string;
46
+ }
47
+ declare const DEFAULT_LABELS: RichTextEditorLabels;
48
+
49
+ interface RichTextEditorIcons {
50
+ boldControlIcon: react__default.ReactNode;
51
+ italicControlIcon: react__default.ReactNode;
52
+ underlineControlIcon: react__default.ReactNode;
53
+ strikeControlIcon: react__default.ReactNode;
54
+ clearFormattingControlIcon: react__default.ReactNode;
55
+ codeControlIcon: react__default.ReactNode;
56
+ codeBlockControlIcon: react__default.ReactNode;
57
+ h1ControlIcon: react__default.ReactNode;
58
+ h2ControlIcon: react__default.ReactNode;
59
+ h3ControlIcon: react__default.ReactNode;
60
+ h4ControlIcon: react__default.ReactNode;
61
+ h5ControlIcon: react__default.ReactNode;
62
+ h6ControlIcon: react__default.ReactNode;
63
+ bulletListControlIcon: react__default.ReactNode;
64
+ orderedListControlIcon: react__default.ReactNode;
65
+ blockquoteControlIcon: react__default.ReactNode;
66
+ hrControlIcon: react__default.ReactNode;
67
+ linkControlIcon: react__default.ReactNode;
68
+ unlinkControlIcon: react__default.ReactNode;
69
+ undoControlIcon: react__default.ReactNode;
70
+ redoControlIcon: react__default.ReactNode;
71
+ alignLeftControlIcon: react__default.ReactNode;
72
+ alignCenterControlIcon: react__default.ReactNode;
73
+ alignRightControlIcon: react__default.ReactNode;
74
+ alignJustifyControlIcon: react__default.ReactNode;
75
+ highlightControlIcon: react__default.ReactNode;
76
+ subscriptControlIcon: react__default.ReactNode;
77
+ superscriptControlIcon: react__default.ReactNode;
78
+ }
79
+ declare const DEFAULT_ICONS: RichTextEditorIcons;
80
+
81
+ type RichTextEditorVariant = "default" | "subtle" | "compact";
82
+ interface RichTextEditorProps {
83
+ editor: Editor | null;
84
+ children: React.ReactNode;
85
+ className?: string;
86
+ labels?: Partial<RichTextEditorLabels>;
87
+ icons?: Partial<RichTextEditorIcons>;
88
+ variant?: RichTextEditorVariant;
89
+ editable?: boolean;
90
+ }
91
+ interface RichTextEditorToolbarProps {
92
+ children: React.ReactNode;
93
+ className?: string;
94
+ sticky?: boolean;
95
+ stickyOffset?: number | string;
96
+ }
97
+ interface RichTextEditorContentProps {
98
+ children?: React.ReactNode;
99
+ className?: string;
100
+ }
101
+ interface RichTextEditorControlsGroupProps {
102
+ children: React.ReactNode;
103
+ className?: string;
104
+ }
105
+ interface RichTextEditorControlProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
106
+ active?: boolean;
107
+ interactive?: boolean;
108
+ }
109
+
110
+ declare function Toolbar({ children, className, sticky, stickyOffset, }: RichTextEditorToolbarProps): react.JSX.Element | null;
111
+
112
+ declare function ControlsGroup({ children, className, }: RichTextEditorControlsGroupProps): react.JSX.Element;
113
+
114
+ declare function Content({ children, className }: RichTextEditorContentProps): react.JSX.Element;
115
+
116
+ declare function RichTextEditorControl({ active, interactive, className, children, onMouseDown, onClick, disabled, ...props }: RichTextEditorControlProps): react__default.JSX.Element;
117
+
118
+ declare function LinkControl(): react.JSX.Element;
119
+
120
+ declare const YouTubeEmbed: Node<any, any>;
121
+ declare function YouTubeEmbedControl({ className }: {
122
+ className?: string;
123
+ }): react.JSX.Element;
124
+
125
+ declare const TwitterEmbed: Node<any, any>;
126
+ declare function TwitterEmbedControl({ className }: {
127
+ className?: string;
128
+ }): react.JSX.Element;
129
+
130
+ declare function RichTextEditorRoot({ editor, children, className, labels, icons, variant, editable, }: RichTextEditorProps): react.JSX.Element;
131
+ declare const RichTextEditor: typeof RichTextEditorRoot & {
132
+ Toolbar: typeof Toolbar;
133
+ ControlsGroup: typeof ControlsGroup;
134
+ Content: typeof Content;
135
+ Control: typeof RichTextEditorControl;
136
+ Link: typeof LinkControl;
137
+ YouTubeEmbed: typeof YouTubeEmbedControl;
138
+ TwitterEmbed: typeof TwitterEmbedControl;
139
+ Bold: {
140
+ ({ className }: {
141
+ className?: string;
142
+ }): react.JSX.Element;
143
+ displayName: string;
144
+ };
145
+ Italic: {
146
+ ({ className }: {
147
+ className?: string;
148
+ }): react.JSX.Element;
149
+ displayName: string;
150
+ };
151
+ Underline: {
152
+ ({ className }: {
153
+ className?: string;
154
+ }): react.JSX.Element;
155
+ displayName: string;
156
+ };
157
+ Strikethrough: {
158
+ ({ className }: {
159
+ className?: string;
160
+ }): react.JSX.Element;
161
+ displayName: string;
162
+ };
163
+ ClearFormatting: {
164
+ ({ className }: {
165
+ className?: string;
166
+ }): react.JSX.Element;
167
+ displayName: string;
168
+ };
169
+ Code: {
170
+ ({ className }: {
171
+ className?: string;
172
+ }): react.JSX.Element;
173
+ displayName: string;
174
+ };
175
+ CodeBlock: {
176
+ ({ className }: {
177
+ className?: string;
178
+ }): react.JSX.Element;
179
+ displayName: string;
180
+ };
181
+ H1: {
182
+ ({ className }: {
183
+ className?: string;
184
+ }): react.JSX.Element;
185
+ displayName: string;
186
+ };
187
+ H2: {
188
+ ({ className }: {
189
+ className?: string;
190
+ }): react.JSX.Element;
191
+ displayName: string;
192
+ };
193
+ H3: {
194
+ ({ className }: {
195
+ className?: string;
196
+ }): react.JSX.Element;
197
+ displayName: string;
198
+ };
199
+ H4: {
200
+ ({ className }: {
201
+ className?: string;
202
+ }): react.JSX.Element;
203
+ displayName: string;
204
+ };
205
+ H5: {
206
+ ({ className }: {
207
+ className?: string;
208
+ }): react.JSX.Element;
209
+ displayName: string;
210
+ };
211
+ H6: {
212
+ ({ className }: {
213
+ className?: string;
214
+ }): react.JSX.Element;
215
+ displayName: string;
216
+ };
217
+ BulletList: {
218
+ ({ className }: {
219
+ className?: string;
220
+ }): react.JSX.Element;
221
+ displayName: string;
222
+ };
223
+ OrderedList: {
224
+ ({ className }: {
225
+ className?: string;
226
+ }): react.JSX.Element;
227
+ displayName: string;
228
+ };
229
+ Blockquote: {
230
+ ({ className }: {
231
+ className?: string;
232
+ }): react.JSX.Element;
233
+ displayName: string;
234
+ };
235
+ Hr: {
236
+ ({ className }: {
237
+ className?: string;
238
+ }): react.JSX.Element;
239
+ displayName: string;
240
+ };
241
+ Unlink: {
242
+ ({ className }: {
243
+ className?: string;
244
+ }): react.JSX.Element;
245
+ displayName: string;
246
+ };
247
+ Undo: {
248
+ ({ className }: {
249
+ className?: string;
250
+ }): react.JSX.Element;
251
+ displayName: string;
252
+ };
253
+ Redo: {
254
+ ({ className }: {
255
+ className?: string;
256
+ }): react.JSX.Element;
257
+ displayName: string;
258
+ };
259
+ AlignLeft: {
260
+ ({ className }: {
261
+ className?: string;
262
+ }): react.JSX.Element;
263
+ displayName: string;
264
+ };
265
+ AlignCenter: {
266
+ ({ className }: {
267
+ className?: string;
268
+ }): react.JSX.Element;
269
+ displayName: string;
270
+ };
271
+ AlignRight: {
272
+ ({ className }: {
273
+ className?: string;
274
+ }): react.JSX.Element;
275
+ displayName: string;
276
+ };
277
+ AlignJustify: {
278
+ ({ className }: {
279
+ className?: string;
280
+ }): react.JSX.Element;
281
+ displayName: string;
282
+ };
283
+ Highlight: {
284
+ ({ className }: {
285
+ className?: string;
286
+ }): react.JSX.Element;
287
+ displayName: string;
288
+ };
289
+ Subscript: {
290
+ ({ className }: {
291
+ className?: string;
292
+ }): react.JSX.Element;
293
+ displayName: string;
294
+ };
295
+ Superscript: {
296
+ ({ className }: {
297
+ className?: string;
298
+ }): react.JSX.Element;
299
+ displayName: string;
300
+ };
301
+ };
302
+
303
+ interface RichTextEditorContextValue {
304
+ editor: Editor | null;
305
+ labels: RichTextEditorLabels;
306
+ icons: RichTextEditorIcons;
307
+ variant: RichTextEditorVariant;
308
+ editable: boolean;
309
+ }
310
+ declare function useRichTextEditorContext(): RichTextEditorContextValue;
311
+
312
+ declare const Link: _tiptap_core.Mark<_tiptap_extension_link.LinkOptions, any>;
313
+
314
+ export { DEFAULT_ICONS, DEFAULT_LABELS, Link, RichTextEditor, type RichTextEditorIcons, type RichTextEditorLabels, type RichTextEditorProps, type RichTextEditorVariant, TwitterEmbed, YouTubeEmbed, useRichTextEditorContext };