@blokhaus/core 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.
- package/README.md +191 -0
- package/dist/index.cjs +11541 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +834 -0
- package/dist/index.d.ts +834 -0
- package/dist/index.js +11725 -0
- package/dist/index.js.map +1 -0
- package/package.json +91 -0
- package/src/styles/tokens.css +183 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,834 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
export { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
|
+
import * as lexical from 'lexical';
|
|
5
|
+
import { TextNode, LexicalEditor, LexicalNode, NodeKey, DecoratorNode, EditorConfig, DOMExportOutput, DOMConversionMap, Spread, SerializedLexicalNode, ElementNode, ElementDOMSlot, SerializedElementNode, RangeSelection } from 'lexical';
|
|
6
|
+
export { $getSelection, $isRangeSelection, LexicalEditor, TextNode } from 'lexical';
|
|
7
|
+
|
|
8
|
+
interface EditorRootProps {
|
|
9
|
+
/** Unique namespace — required for multi-editor isolation. See Section 8. */
|
|
10
|
+
namespace: string;
|
|
11
|
+
/** Initial serialized Lexical JSON state. Pass null for a blank editor. */
|
|
12
|
+
initialState?: string | null;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Document-level text direction. Omit for per-paragraph auto-detection (default). */
|
|
16
|
+
dir?: "ltr" | "rtl" | "auto";
|
|
17
|
+
/** Customizable placeholder text. Default: "Start writing..." */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Read-only mode. Default: true (editable). */
|
|
20
|
+
editable?: boolean;
|
|
21
|
+
/** Whether the editor auto-focuses on mount. Default: true. */
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/** Custom error handler for Lexical errors. Default: console.error + throw. */
|
|
24
|
+
onError?: (error: Error) => void;
|
|
25
|
+
}
|
|
26
|
+
declare function EditorRoot({ namespace, initialState, children, className, dir, placeholder, editable, autoFocus, onError, }: EditorRootProps): react.JSX.Element;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Color palette types and default palette for text color & background highlighting.
|
|
30
|
+
*
|
|
31
|
+
* Colors are stored as CSS variable references (e.g., "var(--blokhaus-text-red)")
|
|
32
|
+
* so developers can override them via tokens.css to rebrand.
|
|
33
|
+
*/
|
|
34
|
+
interface ColorEntry {
|
|
35
|
+
/** Human-readable label shown in the picker */
|
|
36
|
+
label: string;
|
|
37
|
+
/** CSS value to apply — should be a var() reference */
|
|
38
|
+
value: string;
|
|
39
|
+
/** Preview swatch color (raw hex/hsl for rendering the dot in the picker) */
|
|
40
|
+
swatch: string;
|
|
41
|
+
}
|
|
42
|
+
interface ColorPalette {
|
|
43
|
+
text: ColorEntry[];
|
|
44
|
+
highlight: ColorEntry[];
|
|
45
|
+
}
|
|
46
|
+
declare const DEFAULT_COLOR_PALETTE: ColorPalette;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Font family entries for the FontPicker dropdown.
|
|
50
|
+
*
|
|
51
|
+
* Values use CSS variable references so apps can swap the actual
|
|
52
|
+
* Google Font (or any other font) without touching the library.
|
|
53
|
+
*/
|
|
54
|
+
interface FontFamilyEntry {
|
|
55
|
+
/** Human-readable label shown in the picker */
|
|
56
|
+
label: string;
|
|
57
|
+
/** CSS font-family value to apply. Empty string = remove / default. */
|
|
58
|
+
value: string;
|
|
59
|
+
/** Font stack used to render the preview text in the picker dropdown */
|
|
60
|
+
preview: string;
|
|
61
|
+
}
|
|
62
|
+
declare const DEFAULT_FONT_FAMILIES: FontFamilyEntry[];
|
|
63
|
+
|
|
64
|
+
interface FloatingToolbarProps {
|
|
65
|
+
colorPalette?: ColorPalette;
|
|
66
|
+
fontFamilies?: FontFamilyEntry[];
|
|
67
|
+
}
|
|
68
|
+
declare function FloatingToolbar({ colorPalette, fontFamilies }?: FloatingToolbarProps): react.ReactPortal | null;
|
|
69
|
+
|
|
70
|
+
interface SlashMenuItem {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
description: string;
|
|
74
|
+
icon: React.ComponentType<{
|
|
75
|
+
size?: number;
|
|
76
|
+
}>;
|
|
77
|
+
onSelect: () => void;
|
|
78
|
+
/** Extra search terms (e.g. "h1" for "Heading 1") */
|
|
79
|
+
keywords?: string[];
|
|
80
|
+
}
|
|
81
|
+
interface SlashMenuProps {
|
|
82
|
+
items?: SlashMenuItem[];
|
|
83
|
+
}
|
|
84
|
+
declare function SlashMenu({ items: externalItems }: SlashMenuProps): react.ReactPortal | null;
|
|
85
|
+
|
|
86
|
+
interface OverlayPortalProps {
|
|
87
|
+
namespace: string;
|
|
88
|
+
}
|
|
89
|
+
declare function OverlayPortal({ namespace }: OverlayPortalProps): react.JSX.Element | null;
|
|
90
|
+
|
|
91
|
+
interface EmojiItem {
|
|
92
|
+
emoji: string;
|
|
93
|
+
name: string;
|
|
94
|
+
keywords: string[];
|
|
95
|
+
}
|
|
96
|
+
declare const DEFAULT_EMOJIS: EmojiItem[];
|
|
97
|
+
|
|
98
|
+
interface EmojiPickerPluginProps {
|
|
99
|
+
/** Override the built-in emoji list. */
|
|
100
|
+
emojis?: EmojiItem[];
|
|
101
|
+
/** Max results shown in dropdown (default: 8). */
|
|
102
|
+
maxResults?: number;
|
|
103
|
+
/** Custom render function for each emoji row. */
|
|
104
|
+
renderItem?: (item: EmojiItem, isSelected: boolean) => React.ReactNode;
|
|
105
|
+
/** Custom render function for the dropdown container. */
|
|
106
|
+
renderDropdown?: (props: {
|
|
107
|
+
children: React.ReactNode;
|
|
108
|
+
position: {
|
|
109
|
+
top: number;
|
|
110
|
+
left: number;
|
|
111
|
+
};
|
|
112
|
+
}) => React.ReactNode;
|
|
113
|
+
}
|
|
114
|
+
declare function EmojiPickerPlugin({ emojis, maxResults, renderItem, renderDropdown, }?: EmojiPickerPluginProps): react.ReactPortal | null;
|
|
115
|
+
|
|
116
|
+
interface LinkInputRenderProps {
|
|
117
|
+
initialUrl: string;
|
|
118
|
+
onSubmit: (url: string) => void;
|
|
119
|
+
onRemove: () => void;
|
|
120
|
+
onClose: () => void;
|
|
121
|
+
position: {
|
|
122
|
+
top: number;
|
|
123
|
+
left: number;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface LinkPreviewRenderProps {
|
|
127
|
+
url: string;
|
|
128
|
+
onEdit: () => void;
|
|
129
|
+
onRemove: () => void;
|
|
130
|
+
onClose: () => void;
|
|
131
|
+
position: {
|
|
132
|
+
top: number;
|
|
133
|
+
left: number;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
interface LinkPluginConfig {
|
|
137
|
+
/** Custom render for the link input popover. */
|
|
138
|
+
renderLinkInput?: (props: LinkInputRenderProps) => React.ReactNode;
|
|
139
|
+
/** Custom render for the link preview popover. */
|
|
140
|
+
renderLinkPreview?: (props: LinkPreviewRenderProps) => React.ReactNode;
|
|
141
|
+
/** Validate URL before applying (default: basic URL validation). */
|
|
142
|
+
validateUrl?: (url: string) => boolean;
|
|
143
|
+
/** Link target behavior (default: "_blank"). */
|
|
144
|
+
target?: string;
|
|
145
|
+
/** Link rel attribute (default: "noopener noreferrer"). */
|
|
146
|
+
rel?: string;
|
|
147
|
+
}
|
|
148
|
+
declare function LinkPlugin({ config }?: {
|
|
149
|
+
config?: LinkPluginConfig;
|
|
150
|
+
}): react.JSX.Element | null;
|
|
151
|
+
|
|
152
|
+
type UploadHandler = (file: File) => Promise<string>;
|
|
153
|
+
/** Model-level configuration passed to the provider's generate() call. */
|
|
154
|
+
interface AIGenerateConfig {
|
|
155
|
+
/** Sampling temperature (0–2). Lower = more deterministic. Provider-specific. */
|
|
156
|
+
temperature?: number;
|
|
157
|
+
/** Maximum tokens to generate. Provider-specific. */
|
|
158
|
+
maxTokens?: number;
|
|
159
|
+
/** System prompt / persona for the model. */
|
|
160
|
+
systemPrompt?: string;
|
|
161
|
+
}
|
|
162
|
+
/** Parameters passed to AIProvider.generate(). */
|
|
163
|
+
interface AIGenerateParams {
|
|
164
|
+
/** The user's prompt text. */
|
|
165
|
+
prompt: string;
|
|
166
|
+
/** Surrounding editor content serialized as Markdown. */
|
|
167
|
+
context: string;
|
|
168
|
+
/** Optional model-level configuration. */
|
|
169
|
+
config?: AIGenerateConfig;
|
|
170
|
+
}
|
|
171
|
+
interface AIProvider {
|
|
172
|
+
/** Human-readable name (e.g., "Mistral", "Ollama") */
|
|
173
|
+
name: string;
|
|
174
|
+
/**
|
|
175
|
+
* Called with a prompt, surrounding editor context, and optional model config.
|
|
176
|
+
* Must return a ReadableStream of text chunks.
|
|
177
|
+
* The library consumes this stream — it does not care about the underlying provider.
|
|
178
|
+
*/
|
|
179
|
+
generate: (params: AIGenerateParams) => Promise<ReadableStream<string>>;
|
|
180
|
+
}
|
|
181
|
+
/** Labels for the AIPreviewNode buttons and header. All optional with sensible defaults. */
|
|
182
|
+
interface AIPreviewLabels {
|
|
183
|
+
/** Header label (default: "AI") */
|
|
184
|
+
header?: string;
|
|
185
|
+
/** Streaming status text (default: "generating...") */
|
|
186
|
+
streaming?: string;
|
|
187
|
+
/** Accept button label (default: "Accept") */
|
|
188
|
+
accept?: string;
|
|
189
|
+
/** Discard button label (default: "Discard") */
|
|
190
|
+
discard?: string;
|
|
191
|
+
/** Retry button label (default: "Retry") */
|
|
192
|
+
retry?: string;
|
|
193
|
+
/** Dismiss button label for error state (default: "Dismiss") */
|
|
194
|
+
dismiss?: string;
|
|
195
|
+
/** Default error message when no specific message is available (default: "An error occurred") */
|
|
196
|
+
defaultError?: string;
|
|
197
|
+
}
|
|
198
|
+
/** Retry configuration for the AIPreviewNode. */
|
|
199
|
+
interface AIRetryConfig {
|
|
200
|
+
/** Maximum number of retries allowed. Set to 0 to disable retry. Default: Infinity */
|
|
201
|
+
maxRetries?: number;
|
|
202
|
+
}
|
|
203
|
+
/** Props for a custom AI prompt input component. */
|
|
204
|
+
interface AIPromptInputRenderProps {
|
|
205
|
+
/** Current position for fixed positioning */
|
|
206
|
+
position: {
|
|
207
|
+
top: number;
|
|
208
|
+
left: number;
|
|
209
|
+
};
|
|
210
|
+
/** Call with the prompt text to submit */
|
|
211
|
+
onSubmit: (prompt: string) => void;
|
|
212
|
+
/** Call to close/cancel the prompt */
|
|
213
|
+
onClose: () => void;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Full configuration for the AI integration.
|
|
217
|
+
* Pass to AIPlugin to customize every aspect of the AI experience.
|
|
218
|
+
*/
|
|
219
|
+
interface AIPluginConfig {
|
|
220
|
+
/** Model-level configuration (temperature, maxTokens, systemPrompt) */
|
|
221
|
+
generate?: AIGenerateConfig;
|
|
222
|
+
/** Custom labels for the preview node UI */
|
|
223
|
+
labels?: AIPreviewLabels;
|
|
224
|
+
/** Retry configuration */
|
|
225
|
+
retry?: AIRetryConfig;
|
|
226
|
+
/** Number of preceding blocks to include as context. Default: 3 */
|
|
227
|
+
contextWindowSize?: number;
|
|
228
|
+
/** Called when the AI stream encounters an error. Useful for logging/telemetry. */
|
|
229
|
+
onError?: (error: Error) => void;
|
|
230
|
+
/** Called when the user accepts generated content. Useful for analytics. */
|
|
231
|
+
onAccept?: (content: string) => void;
|
|
232
|
+
/** Called when the user discards generated content. */
|
|
233
|
+
onDiscard?: () => void;
|
|
234
|
+
/**
|
|
235
|
+
* Custom prompt input component. When provided, replaces the built-in prompt input.
|
|
236
|
+
* Receives position, onSubmit, and onClose as props.
|
|
237
|
+
*/
|
|
238
|
+
renderPrompt?: (props: AIPromptInputRenderProps) => React.ReactElement;
|
|
239
|
+
}
|
|
240
|
+
interface InputRule {
|
|
241
|
+
/** The trigger pattern. Must include a trailing space or newline to fire. */
|
|
242
|
+
pattern: RegExp;
|
|
243
|
+
/** The node type this rule produces. */
|
|
244
|
+
type: 'heading' | 'quote' | 'code' | 'divider' | 'custom';
|
|
245
|
+
/**
|
|
246
|
+
* Called when the pattern matches. Receives the matched text and the
|
|
247
|
+
* current TextNode. Must perform its mutation inside an editor.update() call.
|
|
248
|
+
* The engine handles deleting the trigger text before calling this.
|
|
249
|
+
*/
|
|
250
|
+
onMatch: (match: RegExpMatchArray, node: TextNode, editor: LexicalEditor) => void;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
interface MentionItem {
|
|
254
|
+
id: string;
|
|
255
|
+
label: string;
|
|
256
|
+
/** Optional: rendered inside the dropdown item */
|
|
257
|
+
meta?: string;
|
|
258
|
+
/** Optional: URL to an avatar or icon */
|
|
259
|
+
icon?: string;
|
|
260
|
+
}
|
|
261
|
+
interface MentionProvider {
|
|
262
|
+
/** The character that triggers this provider (e.g., '@', '#') */
|
|
263
|
+
trigger: string;
|
|
264
|
+
/**
|
|
265
|
+
* Called when the user types after the trigger. Return a promise that
|
|
266
|
+
* resolves to matching items. Return an empty array for no results.
|
|
267
|
+
*/
|
|
268
|
+
onSearch: (query: string) => Promise<MentionItem[]>;
|
|
269
|
+
/**
|
|
270
|
+
* Renders a single item in the Radix dropdown.
|
|
271
|
+
* Keep it lightweight — this renders on every keystroke.
|
|
272
|
+
*/
|
|
273
|
+
renderItem: (item: MentionItem) => React.ReactNode;
|
|
274
|
+
/**
|
|
275
|
+
* Called when the user selects an item. Return the Lexical node to insert.
|
|
276
|
+
* The engine handles replacing the trigger + query text with this node.
|
|
277
|
+
*/
|
|
278
|
+
onSelect: (item: MentionItem) => LexicalNode;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
interface InputRulePluginProps {
|
|
282
|
+
rules?: InputRule[];
|
|
283
|
+
}
|
|
284
|
+
declare function InputRulePlugin({ rules }: InputRulePluginProps): null;
|
|
285
|
+
|
|
286
|
+
interface ImagePluginProps {
|
|
287
|
+
uploadHandler: UploadHandler;
|
|
288
|
+
/** Maximum file size in bytes. Default: 10MB. */
|
|
289
|
+
maxFileSize?: number;
|
|
290
|
+
/** Allowed MIME types. Default: jpeg, png, gif, webp, svg+xml. */
|
|
291
|
+
allowedFormats?: string[];
|
|
292
|
+
/** Called when a file is rejected (too large or wrong format). */
|
|
293
|
+
onFileRejected?: (file: File, reason: "size" | "format") => void;
|
|
294
|
+
/** Called when an upload fails. */
|
|
295
|
+
onUploadError?: (file: File, error: unknown) => void;
|
|
296
|
+
}
|
|
297
|
+
declare function ImagePlugin({ uploadHandler, maxFileSize, allowedFormats, onFileRejected, onUploadError, }: ImagePluginProps): null;
|
|
298
|
+
|
|
299
|
+
interface AIPluginProps {
|
|
300
|
+
/** The AI provider that supplies streaming text generation. */
|
|
301
|
+
provider: AIProvider;
|
|
302
|
+
/**
|
|
303
|
+
* Optional configuration for the AI integration.
|
|
304
|
+
* Controls model parameters, UI labels, retry behaviour, context window,
|
|
305
|
+
* error handling, analytics callbacks, and custom prompt input rendering.
|
|
306
|
+
*/
|
|
307
|
+
config?: AIPluginConfig;
|
|
308
|
+
}
|
|
309
|
+
declare function AIPlugin({ provider, config }: AIPluginProps): react.JSX.Element | null;
|
|
310
|
+
|
|
311
|
+
interface MentionPluginProps {
|
|
312
|
+
/** One or more mention providers, each with their own trigger character. */
|
|
313
|
+
providers: MentionProvider[];
|
|
314
|
+
}
|
|
315
|
+
declare function MentionPlugin({ providers }: MentionPluginProps): react.ReactPortal | null;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* PastePlugin — intercepts paste events, sanitises incoming HTML,
|
|
319
|
+
* and inserts clean Lexical nodes into the AST.
|
|
320
|
+
*
|
|
321
|
+
* See CLAUDE.md Section 13 for the full specification.
|
|
322
|
+
*/
|
|
323
|
+
declare function PastePlugin(): null;
|
|
324
|
+
|
|
325
|
+
interface UseEditorStateOptions {
|
|
326
|
+
/**
|
|
327
|
+
* Debounce delay in milliseconds. Do not set below 200ms.
|
|
328
|
+
* High-frequency editor.update() calls on every keystroke will
|
|
329
|
+
* degrade performance on large documents.
|
|
330
|
+
*/
|
|
331
|
+
debounceMs?: number;
|
|
332
|
+
onChange?: (serializedState: string) => void;
|
|
333
|
+
}
|
|
334
|
+
declare function useEditorState({ debounceMs, onChange, }?: UseEditorStateOptions): {
|
|
335
|
+
serializedState: string;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
interface WordCountResult {
|
|
339
|
+
words: number;
|
|
340
|
+
characters: number;
|
|
341
|
+
}
|
|
342
|
+
declare function useWordCount(debounceMs?: number): WordCountResult;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* MobileToolbar — bottom-anchored formatting toolbar for touch devices.
|
|
346
|
+
*
|
|
347
|
+
* Renders a fixed toolbar at the bottom of the viewport when the user
|
|
348
|
+
* has selected text inside the editor. Completely hidden on non-touch devices.
|
|
349
|
+
*
|
|
350
|
+
* See CLAUDE.md Section 14 for the specification.
|
|
351
|
+
*/
|
|
352
|
+
declare function MobileToolbar(): react.ReactPortal | null;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Paste sanitisation pipeline.
|
|
356
|
+
*
|
|
357
|
+
* Takes a raw HTML string (typically from clipboard) and returns clean,
|
|
358
|
+
* semantic HTML safe for conversion into Lexical nodes.
|
|
359
|
+
*
|
|
360
|
+
* See CLAUDE.md Section 13.2 for the full specification.
|
|
361
|
+
*/
|
|
362
|
+
/**
|
|
363
|
+
* Sanitises pasted HTML for safe insertion into the Lexical AST.
|
|
364
|
+
*
|
|
365
|
+
* This is a pure function: it takes an HTML string and returns a sanitised
|
|
366
|
+
* HTML string. It uses `DOMParser` (browser API) to parse and manipulate
|
|
367
|
+
* the HTML.
|
|
368
|
+
*
|
|
369
|
+
* @param html - Raw HTML string from the clipboard
|
|
370
|
+
* @returns Sanitised HTML string safe for `$generateNodesFromDOM`
|
|
371
|
+
*/
|
|
372
|
+
declare function sanitizePastedHTML(html: string): string;
|
|
373
|
+
|
|
374
|
+
declare function ColorPlugin(): null;
|
|
375
|
+
|
|
376
|
+
interface ColorPickerProps {
|
|
377
|
+
palette?: ColorPalette;
|
|
378
|
+
activeTextColor: string | null;
|
|
379
|
+
activeHighlightColor: string | null;
|
|
380
|
+
onClose: () => void;
|
|
381
|
+
}
|
|
382
|
+
declare function ColorPicker({ palette, activeTextColor, activeHighlightColor, onClose, }: ColorPickerProps): react.JSX.Element;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Registers @lexical/list behaviour: Enter on an empty list item exits the list,
|
|
386
|
+
* Tab/Shift-Tab for indent/outdent, and other list integrity transforms.
|
|
387
|
+
* Also registers check list behaviour: click/spacebar to toggle checkbox state.
|
|
388
|
+
*/
|
|
389
|
+
declare function ListPlugin(): null;
|
|
390
|
+
|
|
391
|
+
interface TablePluginProps {
|
|
392
|
+
hasCellMerge?: boolean;
|
|
393
|
+
hasCellBackgroundColor?: boolean;
|
|
394
|
+
hasTabHandler?: boolean;
|
|
395
|
+
}
|
|
396
|
+
declare function TablePlugin({ hasCellMerge, hasTabHandler, }: TablePluginProps): null;
|
|
397
|
+
|
|
398
|
+
declare function TableActionMenu(): react.ReactPortal | null;
|
|
399
|
+
|
|
400
|
+
declare function TableHoverActions(): react.ReactPortal | null;
|
|
401
|
+
|
|
402
|
+
declare const OPEN_SLASH_MENU_COMMAND: lexical.LexicalCommand<void>;
|
|
403
|
+
declare const INSERT_IMAGE_COMMAND: lexical.LexicalCommand<File>;
|
|
404
|
+
declare const OPEN_AI_PROMPT_COMMAND: lexical.LexicalCommand<void>;
|
|
405
|
+
declare const INSERT_AI_PREVIEW_COMMAND: lexical.LexicalCommand<{
|
|
406
|
+
prompt: string;
|
|
407
|
+
}>;
|
|
408
|
+
declare const OPEN_EMOJI_PICKER_COMMAND: lexical.LexicalCommand<void>;
|
|
409
|
+
declare const OPEN_LINK_INPUT_COMMAND: lexical.LexicalCommand<void>;
|
|
410
|
+
declare const SET_TEXT_COLOR_COMMAND: lexical.LexicalCommand<string>;
|
|
411
|
+
declare const SET_HIGHLIGHT_COLOR_COMMAND: lexical.LexicalCommand<string>;
|
|
412
|
+
declare const INSERT_TABLE_COMMAND_BLOKHAUS: lexical.LexicalCommand<{
|
|
413
|
+
rows: number;
|
|
414
|
+
columns: number;
|
|
415
|
+
}>;
|
|
416
|
+
declare const INSERT_CALLOUT_COMMAND: lexical.LexicalCommand<{
|
|
417
|
+
emoji?: string;
|
|
418
|
+
colorPreset?: string;
|
|
419
|
+
}>;
|
|
420
|
+
declare const INSERT_VIDEO_COMMAND: lexical.LexicalCommand<{
|
|
421
|
+
file: File;
|
|
422
|
+
} | {
|
|
423
|
+
url: string;
|
|
424
|
+
}>;
|
|
425
|
+
declare const OPEN_VIDEO_INPUT_COMMAND: lexical.LexicalCommand<void>;
|
|
426
|
+
declare const INSERT_TOGGLE_COMMAND: lexical.LexicalCommand<{
|
|
427
|
+
isOpen?: boolean;
|
|
428
|
+
} | undefined>;
|
|
429
|
+
declare const SET_FONT_FAMILY_COMMAND: lexical.LexicalCommand<string>;
|
|
430
|
+
declare const SET_BLOCK_DIRECTION_COMMAND: lexical.LexicalCommand<"ltr" | "rtl">;
|
|
431
|
+
|
|
432
|
+
declare const DirectionPlugin: () => null;
|
|
433
|
+
|
|
434
|
+
interface FontPickerProps {
|
|
435
|
+
fonts?: FontFamilyEntry[];
|
|
436
|
+
activeFont: string | null;
|
|
437
|
+
onClose: () => void;
|
|
438
|
+
}
|
|
439
|
+
declare function FontPicker({ fonts, activeFont, onClose, }: FontPickerProps): react.JSX.Element;
|
|
440
|
+
|
|
441
|
+
interface ImagePayload {
|
|
442
|
+
src: string;
|
|
443
|
+
altText: string;
|
|
444
|
+
width?: number;
|
|
445
|
+
height?: number;
|
|
446
|
+
key?: NodeKey;
|
|
447
|
+
}
|
|
448
|
+
type SerializedImageNode = Spread<{
|
|
449
|
+
src: string;
|
|
450
|
+
altText: string;
|
|
451
|
+
width?: number;
|
|
452
|
+
height?: number;
|
|
453
|
+
}, SerializedLexicalNode>;
|
|
454
|
+
declare class ImageNode extends DecoratorNode<ReactElement> {
|
|
455
|
+
__src: string;
|
|
456
|
+
__altText: string;
|
|
457
|
+
__width: number | undefined;
|
|
458
|
+
__height: number | undefined;
|
|
459
|
+
static getType(): string;
|
|
460
|
+
static clone(node: ImageNode): ImageNode;
|
|
461
|
+
constructor(src: string, altText: string, width?: number, height?: number, key?: NodeKey);
|
|
462
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
463
|
+
updateDOM(): false;
|
|
464
|
+
exportDOM(): DOMExportOutput;
|
|
465
|
+
static importDOM(): DOMConversionMap | null;
|
|
466
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
467
|
+
exportJSON(): SerializedImageNode;
|
|
468
|
+
getSrc(): string;
|
|
469
|
+
getAltText(): string;
|
|
470
|
+
decorate(): ReactElement;
|
|
471
|
+
}
|
|
472
|
+
declare function $createImageNode(payload: ImagePayload): ImageNode;
|
|
473
|
+
declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|
|
474
|
+
|
|
475
|
+
type SerializedLoadingImageNode = Spread<{
|
|
476
|
+
objectURL: string;
|
|
477
|
+
}, SerializedLexicalNode>;
|
|
478
|
+
declare class LoadingImageNode extends DecoratorNode<ReactElement> {
|
|
479
|
+
__objectURL: string;
|
|
480
|
+
static getType(): string;
|
|
481
|
+
static clone(node: LoadingImageNode): LoadingImageNode;
|
|
482
|
+
constructor(objectURL: string, key?: NodeKey);
|
|
483
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
484
|
+
updateDOM(): false;
|
|
485
|
+
exportDOM(): DOMExportOutput;
|
|
486
|
+
static importDOM(): DOMConversionMap | null;
|
|
487
|
+
static importJSON(serializedNode: SerializedLoadingImageNode): LoadingImageNode;
|
|
488
|
+
exportJSON(): SerializedLoadingImageNode;
|
|
489
|
+
getObjectURL(): string;
|
|
490
|
+
decorate(): ReactElement;
|
|
491
|
+
}
|
|
492
|
+
declare function $createLoadingImageNode(objectURL: string): LoadingImageNode;
|
|
493
|
+
declare function $isLoadingImageNode(node: LexicalNode | null | undefined): node is LoadingImageNode;
|
|
494
|
+
|
|
495
|
+
interface AIPreviewPayload {
|
|
496
|
+
prompt: string;
|
|
497
|
+
context: string;
|
|
498
|
+
key?: NodeKey;
|
|
499
|
+
}
|
|
500
|
+
type SerializedAIPreviewNode = Spread<{
|
|
501
|
+
prompt: string;
|
|
502
|
+
context: string;
|
|
503
|
+
}, SerializedLexicalNode>;
|
|
504
|
+
declare class AIPreviewNode extends DecoratorNode<ReactElement> {
|
|
505
|
+
__prompt: string;
|
|
506
|
+
__context: string;
|
|
507
|
+
static getType(): string;
|
|
508
|
+
static clone(node: AIPreviewNode): AIPreviewNode;
|
|
509
|
+
constructor(prompt: string, context: string, key?: NodeKey);
|
|
510
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
511
|
+
updateDOM(): false;
|
|
512
|
+
exportDOM(): DOMExportOutput;
|
|
513
|
+
static importDOM(): DOMConversionMap | null;
|
|
514
|
+
static importJSON(serialized: SerializedAIPreviewNode): AIPreviewNode;
|
|
515
|
+
exportJSON(): SerializedAIPreviewNode;
|
|
516
|
+
decorate(): ReactElement;
|
|
517
|
+
}
|
|
518
|
+
declare function $createAIPreviewNode(payload: AIPreviewPayload): AIPreviewNode;
|
|
519
|
+
declare function $isAIPreviewNode(node: LexicalNode | null | undefined): node is AIPreviewNode;
|
|
520
|
+
|
|
521
|
+
interface MentionPayload {
|
|
522
|
+
id: string;
|
|
523
|
+
label: string;
|
|
524
|
+
trigger: string;
|
|
525
|
+
key?: NodeKey;
|
|
526
|
+
}
|
|
527
|
+
type SerializedMentionNode = Spread<{
|
|
528
|
+
mentionId: string;
|
|
529
|
+
label: string;
|
|
530
|
+
trigger: string;
|
|
531
|
+
}, SerializedLexicalNode>;
|
|
532
|
+
declare class MentionNode extends DecoratorNode<ReactElement> {
|
|
533
|
+
__mentionId: string;
|
|
534
|
+
__label: string;
|
|
535
|
+
__trigger: string;
|
|
536
|
+
static getType(): string;
|
|
537
|
+
static clone(node: MentionNode): MentionNode;
|
|
538
|
+
constructor(mentionId: string, label: string, trigger: string, key?: NodeKey);
|
|
539
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
540
|
+
updateDOM(): false;
|
|
541
|
+
exportDOM(): DOMExportOutput;
|
|
542
|
+
static importDOM(): DOMConversionMap | null;
|
|
543
|
+
static importJSON(serialized: SerializedMentionNode): MentionNode;
|
|
544
|
+
exportJSON(): SerializedMentionNode;
|
|
545
|
+
isInline(): true;
|
|
546
|
+
getTextContent(): string;
|
|
547
|
+
decorate(): ReactElement;
|
|
548
|
+
}
|
|
549
|
+
declare function $createMentionNode(payload: MentionPayload): MentionNode;
|
|
550
|
+
declare function $isMentionNode(node: LexicalNode | null | undefined): node is MentionNode;
|
|
551
|
+
|
|
552
|
+
interface CodeBlockPayload {
|
|
553
|
+
code: string;
|
|
554
|
+
language: string;
|
|
555
|
+
key?: NodeKey;
|
|
556
|
+
autoFocus?: boolean;
|
|
557
|
+
}
|
|
558
|
+
type SerializedCodeBlockNode = Spread<{
|
|
559
|
+
code: string;
|
|
560
|
+
language: string;
|
|
561
|
+
}, SerializedLexicalNode>;
|
|
562
|
+
declare class CodeBlockNode extends DecoratorNode<ReactElement> {
|
|
563
|
+
__code: string;
|
|
564
|
+
__language: string;
|
|
565
|
+
__autoFocus: boolean;
|
|
566
|
+
static getType(): string;
|
|
567
|
+
static clone(node: CodeBlockNode): CodeBlockNode;
|
|
568
|
+
constructor(code: string, language: string, key?: NodeKey);
|
|
569
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
570
|
+
updateDOM(): false;
|
|
571
|
+
exportDOM(): DOMExportOutput;
|
|
572
|
+
static importDOM(): DOMConversionMap | null;
|
|
573
|
+
static importJSON(serialized: SerializedCodeBlockNode): CodeBlockNode;
|
|
574
|
+
exportJSON(): SerializedCodeBlockNode;
|
|
575
|
+
getCode(): string;
|
|
576
|
+
getLanguage(): string;
|
|
577
|
+
decorate(): ReactElement;
|
|
578
|
+
}
|
|
579
|
+
declare function $createCodeBlockNode(payload: CodeBlockPayload): CodeBlockNode;
|
|
580
|
+
declare function $isCodeBlockNode(node: LexicalNode | null | undefined): node is CodeBlockNode;
|
|
581
|
+
|
|
582
|
+
interface CalloutPayload {
|
|
583
|
+
emoji?: string;
|
|
584
|
+
colorPreset?: string;
|
|
585
|
+
key?: NodeKey;
|
|
586
|
+
}
|
|
587
|
+
type SerializedCalloutNode = Spread<{
|
|
588
|
+
emoji: string;
|
|
589
|
+
colorPreset: string;
|
|
590
|
+
}, SerializedElementNode>;
|
|
591
|
+
declare class CalloutNode extends ElementNode {
|
|
592
|
+
__emoji: string;
|
|
593
|
+
__colorPreset: string;
|
|
594
|
+
static getType(): string;
|
|
595
|
+
static clone(node: CalloutNode): CalloutNode;
|
|
596
|
+
constructor(emoji?: string, colorPreset?: string, key?: NodeKey);
|
|
597
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
598
|
+
/**
|
|
599
|
+
* Tell Lexical's reconciler to insert children after the emoji span.
|
|
600
|
+
* This is the correct API (Lexical 0.40+) for nodes whose createDOM()
|
|
601
|
+
* includes accessory elements that aren't Lexical children.
|
|
602
|
+
*/
|
|
603
|
+
getDOMSlot(element: HTMLElement): ElementDOMSlot;
|
|
604
|
+
updateDOM(prevNode: CalloutNode, dom: HTMLElement): boolean;
|
|
605
|
+
exportDOM(): DOMExportOutput;
|
|
606
|
+
static importDOM(): DOMConversionMap | null;
|
|
607
|
+
static importJSON(serialized: SerializedCalloutNode): CalloutNode;
|
|
608
|
+
exportJSON(): SerializedCalloutNode;
|
|
609
|
+
getEmoji(): string;
|
|
610
|
+
setEmoji(emoji: string): this;
|
|
611
|
+
getColorPreset(): string;
|
|
612
|
+
setColorPreset(preset: string): this;
|
|
613
|
+
}
|
|
614
|
+
declare function $createCalloutNode(payload?: CalloutPayload): CalloutNode;
|
|
615
|
+
declare function $isCalloutNode(node: LexicalNode | null | undefined): node is CalloutNode;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Callout color preset definitions.
|
|
619
|
+
*
|
|
620
|
+
* Each preset maps to CSS variables defined in tokens.css:
|
|
621
|
+
* --blokhaus-callout-{id}-bg (background)
|
|
622
|
+
* --blokhaus-callout-{id}-border (left border accent)
|
|
623
|
+
*
|
|
624
|
+
* Developers can override presets via the `presets` prop on `<CalloutPlugin>`.
|
|
625
|
+
*/
|
|
626
|
+
interface CalloutPreset {
|
|
627
|
+
/** Unique identifier used in CSS class names and serialization */
|
|
628
|
+
id: string;
|
|
629
|
+
/** Human-readable label shown in UI */
|
|
630
|
+
label: string;
|
|
631
|
+
/** Default emoji for this preset */
|
|
632
|
+
emoji: string;
|
|
633
|
+
/** Raw background color for rendering the picker dot */
|
|
634
|
+
bgSwatch: string;
|
|
635
|
+
/** Raw border color for rendering the picker dot */
|
|
636
|
+
borderSwatch: string;
|
|
637
|
+
}
|
|
638
|
+
declare const DEFAULT_CALLOUT_PRESETS: CalloutPreset[];
|
|
639
|
+
|
|
640
|
+
interface CalloutPluginProps {
|
|
641
|
+
/** Override the default color presets */
|
|
642
|
+
presets?: CalloutPreset[];
|
|
643
|
+
/** Default emoji for newly created callouts */
|
|
644
|
+
defaultEmoji?: string;
|
|
645
|
+
/** Default color preset for newly created callouts */
|
|
646
|
+
defaultPreset?: string;
|
|
647
|
+
}
|
|
648
|
+
declare function CalloutPlugin({ presets, defaultEmoji, defaultPreset, }?: CalloutPluginProps): react.ReactPortal | null;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Serializes an array of Lexical nodes to Markdown.
|
|
652
|
+
* Pure function — call inside editor.read().
|
|
653
|
+
*/
|
|
654
|
+
declare function serializeNodesToMarkdown(nodes: LexicalNode[]): string;
|
|
655
|
+
/**
|
|
656
|
+
* Parses a Markdown string into Lexical nodes.
|
|
657
|
+
* Must be called inside editor.update() — creates Lexical nodes that require
|
|
658
|
+
* an active editor context.
|
|
659
|
+
*/
|
|
660
|
+
declare function $parseMarkdownToLexicalNodes(markdown: string): LexicalNode[];
|
|
661
|
+
|
|
662
|
+
interface VideoEmbedRenderProps {
|
|
663
|
+
src: string;
|
|
664
|
+
provider: string;
|
|
665
|
+
title: string;
|
|
666
|
+
}
|
|
667
|
+
interface VideoFileRenderProps {
|
|
668
|
+
src: string;
|
|
669
|
+
title: string;
|
|
670
|
+
}
|
|
671
|
+
interface VideoPluginProps {
|
|
672
|
+
/** Handler for uploading video files. Same interface as ImagePlugin. Omit to disable file uploads. */
|
|
673
|
+
uploadHandler?: UploadHandler;
|
|
674
|
+
/** Maximum file size in bytes. Default: 50MB. */
|
|
675
|
+
maxFileSize?: number;
|
|
676
|
+
/** Allowed MIME types for upload. Default: mp4, webm, quicktime. */
|
|
677
|
+
allowedFormats?: string[];
|
|
678
|
+
/** Called when a file is rejected (too large or wrong format). */
|
|
679
|
+
onFileRejected?: (file: File, reason: "size" | "format") => void;
|
|
680
|
+
}
|
|
681
|
+
declare function VideoPlugin({ uploadHandler, maxFileSize, allowedFormats, onFileRejected, }?: VideoPluginProps): react.JSX.Element | null;
|
|
682
|
+
|
|
683
|
+
interface VideoPayload {
|
|
684
|
+
src: string;
|
|
685
|
+
videoType: "embed" | "file";
|
|
686
|
+
provider: string;
|
|
687
|
+
title?: string;
|
|
688
|
+
key?: NodeKey;
|
|
689
|
+
}
|
|
690
|
+
type SerializedVideoNode = Spread<{
|
|
691
|
+
src: string;
|
|
692
|
+
videoType: "embed" | "file";
|
|
693
|
+
provider: string;
|
|
694
|
+
title: string;
|
|
695
|
+
}, SerializedLexicalNode>;
|
|
696
|
+
declare class VideoNode extends DecoratorNode<ReactElement> {
|
|
697
|
+
__src: string;
|
|
698
|
+
__videoType: "embed" | "file";
|
|
699
|
+
__provider: string;
|
|
700
|
+
__title: string;
|
|
701
|
+
static getType(): string;
|
|
702
|
+
static clone(node: VideoNode): VideoNode;
|
|
703
|
+
constructor(src: string, videoType: "embed" | "file", provider: string, title?: string, key?: NodeKey);
|
|
704
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
705
|
+
updateDOM(): false;
|
|
706
|
+
exportDOM(): DOMExportOutput;
|
|
707
|
+
static importDOM(): DOMConversionMap | null;
|
|
708
|
+
static importJSON(serializedNode: SerializedVideoNode): VideoNode;
|
|
709
|
+
exportJSON(): SerializedVideoNode;
|
|
710
|
+
getSrc(): string;
|
|
711
|
+
getVideoType(): "embed" | "file";
|
|
712
|
+
getProvider(): string;
|
|
713
|
+
getTitle(): string;
|
|
714
|
+
decorate(): ReactElement;
|
|
715
|
+
}
|
|
716
|
+
declare function $createVideoNode(payload: VideoPayload): VideoNode;
|
|
717
|
+
declare function $isVideoNode(node: LexicalNode | null | undefined): node is VideoNode;
|
|
718
|
+
|
|
719
|
+
declare class HorizontalRuleNode extends DecoratorNode<ReactElement> {
|
|
720
|
+
static getType(): string;
|
|
721
|
+
static clone(node: HorizontalRuleNode): HorizontalRuleNode;
|
|
722
|
+
constructor(key?: NodeKey);
|
|
723
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
724
|
+
updateDOM(): false;
|
|
725
|
+
exportDOM(): DOMExportOutput;
|
|
726
|
+
static importDOM(): DOMConversionMap | null;
|
|
727
|
+
static importJSON(_serializedNode: SerializedLexicalNode): HorizontalRuleNode;
|
|
728
|
+
exportJSON(): SerializedLexicalNode;
|
|
729
|
+
decorate(): ReactElement;
|
|
730
|
+
}
|
|
731
|
+
declare function $createHorizontalRuleNode(): HorizontalRuleNode;
|
|
732
|
+
declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
|
|
733
|
+
|
|
734
|
+
type SerializedLoadingVideoNode = Spread<{
|
|
735
|
+
objectURL: string;
|
|
736
|
+
fileName: string;
|
|
737
|
+
}, SerializedLexicalNode>;
|
|
738
|
+
declare class LoadingVideoNode extends DecoratorNode<ReactElement> {
|
|
739
|
+
__objectURL: string;
|
|
740
|
+
__fileName: string;
|
|
741
|
+
static getType(): string;
|
|
742
|
+
static clone(node: LoadingVideoNode): LoadingVideoNode;
|
|
743
|
+
constructor(objectURL: string, fileName: string, key?: NodeKey);
|
|
744
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
745
|
+
updateDOM(): false;
|
|
746
|
+
exportDOM(): DOMExportOutput;
|
|
747
|
+
static importDOM(): DOMConversionMap | null;
|
|
748
|
+
static importJSON(serializedNode: SerializedLoadingVideoNode): LoadingVideoNode;
|
|
749
|
+
exportJSON(): SerializedLoadingVideoNode;
|
|
750
|
+
getObjectURL(): string;
|
|
751
|
+
getFileName(): string;
|
|
752
|
+
decorate(): ReactElement;
|
|
753
|
+
}
|
|
754
|
+
declare function $createLoadingVideoNode(objectURL: string, fileName: string): LoadingVideoNode;
|
|
755
|
+
declare function $isLoadingVideoNode(node: LexicalNode | null | undefined): node is LoadingVideoNode;
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Video embed URL parser.
|
|
759
|
+
* Extracts provider-specific embed URLs from user-pasted video links.
|
|
760
|
+
* Pure function — no React, no side effects.
|
|
761
|
+
*/
|
|
762
|
+
interface VideoEmbedInfo {
|
|
763
|
+
provider: "youtube" | "vimeo" | "loom" | "generic";
|
|
764
|
+
embedUrl: string;
|
|
765
|
+
/** Thumbnail URL when available (YouTube, Vimeo). */
|
|
766
|
+
thumbnailUrl?: string;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Parse a URL string and return embed info for known video providers.
|
|
770
|
+
* Returns `null` for non-URL strings. Returns `{ provider: "generic" }` for
|
|
771
|
+
* unrecognized but valid URLs, so any iframe-compatible link works.
|
|
772
|
+
*/
|
|
773
|
+
declare function parseVideoEmbed(url: string): VideoEmbedInfo | null;
|
|
774
|
+
|
|
775
|
+
interface ToggleContainerPayload {
|
|
776
|
+
open?: boolean;
|
|
777
|
+
key?: NodeKey;
|
|
778
|
+
}
|
|
779
|
+
type SerializedToggleContainerNode = Spread<{
|
|
780
|
+
open: boolean;
|
|
781
|
+
}, SerializedElementNode>;
|
|
782
|
+
declare class ToggleContainerNode extends ElementNode {
|
|
783
|
+
__open: boolean;
|
|
784
|
+
static getType(): string;
|
|
785
|
+
static clone(node: ToggleContainerNode): ToggleContainerNode;
|
|
786
|
+
constructor(open?: boolean, key?: NodeKey);
|
|
787
|
+
isShadowRoot(): boolean;
|
|
788
|
+
createDOM(config: EditorConfig, editor: LexicalEditor): HTMLElement;
|
|
789
|
+
updateDOM(prevNode: ToggleContainerNode, dom: HTMLElement): boolean;
|
|
790
|
+
collapseAtStart(_selection: RangeSelection): boolean;
|
|
791
|
+
static importDOM(): DOMConversionMap | null;
|
|
792
|
+
exportDOM(): DOMExportOutput;
|
|
793
|
+
static importJSON(serialized: SerializedToggleContainerNode): ToggleContainerNode;
|
|
794
|
+
exportJSON(): SerializedToggleContainerNode;
|
|
795
|
+
getOpen(): boolean;
|
|
796
|
+
setOpen(open: boolean): void;
|
|
797
|
+
toggleOpen(): void;
|
|
798
|
+
}
|
|
799
|
+
declare function $createToggleContainerNode(payload?: ToggleContainerPayload): ToggleContainerNode;
|
|
800
|
+
declare function $isToggleContainerNode(node: LexicalNode | null | undefined): node is ToggleContainerNode;
|
|
801
|
+
|
|
802
|
+
declare class ToggleTitleNode extends ElementNode {
|
|
803
|
+
static getType(): string;
|
|
804
|
+
static clone(node: ToggleTitleNode): ToggleTitleNode;
|
|
805
|
+
createDOM(config: EditorConfig, editor: LexicalEditor): HTMLElement;
|
|
806
|
+
updateDOM(): boolean;
|
|
807
|
+
insertNewAfter(_selection: RangeSelection, restoreSelection?: boolean): ElementNode | null;
|
|
808
|
+
collapseAtStart(_selection: RangeSelection): boolean;
|
|
809
|
+
static importDOM(): DOMConversionMap | null;
|
|
810
|
+
static importJSON(_serialized: SerializedElementNode): ToggleTitleNode;
|
|
811
|
+
exportJSON(): SerializedElementNode;
|
|
812
|
+
}
|
|
813
|
+
declare function $createToggleTitleNode(): ToggleTitleNode;
|
|
814
|
+
declare function $isToggleTitleNode(node: LexicalNode | null | undefined): node is ToggleTitleNode;
|
|
815
|
+
|
|
816
|
+
declare class ToggleContentNode extends ElementNode {
|
|
817
|
+
static getType(): string;
|
|
818
|
+
static clone(node: ToggleContentNode): ToggleContentNode;
|
|
819
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
820
|
+
updateDOM(): boolean;
|
|
821
|
+
isShadowRoot(): boolean;
|
|
822
|
+
static importDOM(): DOMConversionMap | null;
|
|
823
|
+
exportDOM(): DOMExportOutput;
|
|
824
|
+
static importJSON(_serialized: SerializedElementNode): ToggleContentNode;
|
|
825
|
+
exportJSON(): SerializedElementNode;
|
|
826
|
+
}
|
|
827
|
+
declare function $createToggleContentNode(): ToggleContentNode;
|
|
828
|
+
declare function $isToggleContentNode(node: LexicalNode | null | undefined): node is ToggleContentNode;
|
|
829
|
+
|
|
830
|
+
declare function TogglePlugin(): null;
|
|
831
|
+
|
|
832
|
+
declare function BlockSelectionPlugin(): react.ReactPortal | null;
|
|
833
|
+
|
|
834
|
+
export { $createAIPreviewNode, $createCalloutNode, $createCodeBlockNode, $createHorizontalRuleNode, $createImageNode, $createLoadingImageNode, $createLoadingVideoNode, $createMentionNode, $createToggleContainerNode, $createToggleContentNode, $createToggleTitleNode, $createVideoNode, $isAIPreviewNode, $isCalloutNode, $isCodeBlockNode, $isHorizontalRuleNode, $isImageNode, $isLoadingImageNode, $isLoadingVideoNode, $isMentionNode, $isToggleContainerNode, $isToggleContentNode, $isToggleTitleNode, $isVideoNode, $parseMarkdownToLexicalNodes, type AIGenerateConfig, type AIGenerateParams, AIPlugin, type AIPluginConfig, type AIPreviewLabels, AIPreviewNode, type AIPreviewPayload, type AIPromptInputRenderProps, type AIProvider, type AIRetryConfig, BlockSelectionPlugin, CalloutNode, type CalloutPayload, CalloutPlugin, type CalloutPreset, CodeBlockNode, type CodeBlockPayload, type ColorEntry, type ColorPalette, ColorPicker, ColorPlugin, DEFAULT_CALLOUT_PRESETS, DEFAULT_COLOR_PALETTE, DEFAULT_EMOJIS, DEFAULT_FONT_FAMILIES, DirectionPlugin, EditorRoot, type EmojiItem, EmojiPickerPlugin, type EmojiPickerPluginProps, FloatingToolbar, type FontFamilyEntry, FontPicker, HorizontalRuleNode, INSERT_AI_PREVIEW_COMMAND, INSERT_CALLOUT_COMMAND, INSERT_IMAGE_COMMAND, INSERT_TABLE_COMMAND_BLOKHAUS, INSERT_TOGGLE_COMMAND, INSERT_VIDEO_COMMAND, ImageNode, type ImagePayload, ImagePlugin, type InputRule, InputRulePlugin, type LinkInputRenderProps, LinkPlugin, type LinkPluginConfig, type LinkPreviewRenderProps, ListPlugin, LoadingImageNode, LoadingVideoNode, type MentionItem, MentionNode, type MentionPayload, MentionPlugin, type MentionProvider, MobileToolbar, OPEN_AI_PROMPT_COMMAND, OPEN_EMOJI_PICKER_COMMAND, OPEN_LINK_INPUT_COMMAND, OPEN_SLASH_MENU_COMMAND, OPEN_VIDEO_INPUT_COMMAND, OverlayPortal, PastePlugin, SET_BLOCK_DIRECTION_COMMAND, SET_FONT_FAMILY_COMMAND, SET_HIGHLIGHT_COLOR_COMMAND, SET_TEXT_COLOR_COMMAND, SlashMenu, type SlashMenuItem, TableActionMenu, TableHoverActions, TablePlugin, ToggleContainerNode, type ToggleContainerPayload, ToggleContentNode, TogglePlugin, ToggleTitleNode, type UploadHandler, type VideoEmbedInfo, type VideoEmbedRenderProps, type VideoFileRenderProps, VideoNode, type VideoPayload, VideoPlugin, parseVideoEmbed, sanitizePastedHTML, serializeNodesToMarkdown, useEditorState, useWordCount };
|