@surrealdb/ui 1.0.73 → 1.0.74
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/dist/ui.css +1 -1
- package/dist/ui.d.ts +211 -479
- package/dist/ui.js +9151 -9701
- package/dist/ui.js.map +1 -1
- package/package.json +25 -13
package/dist/ui.d.ts
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
1
|
import { ActionIconProps } from '@mantine/core';
|
|
2
2
|
import { AlertProps } from '@mantine/core';
|
|
3
|
+
import { AnchorProps } from '@mantine/core';
|
|
3
4
|
import { BadgeProps } from '@mantine/core';
|
|
5
|
+
import { BlockquoteElement } from '@yoopta/blockquote';
|
|
4
6
|
import { BoxProps } from '@mantine/core';
|
|
5
7
|
import { ButtonProps } from '@mantine/core';
|
|
8
|
+
import { CalloutElementMap } from '@yoopta/callout/dist/types';
|
|
6
9
|
import { CodeProps } from '@mantine/core';
|
|
7
10
|
import { Command } from '@codemirror/view';
|
|
8
|
-
import {
|
|
11
|
+
import { DividerElementMap } from '@yoopta/divider/dist/types';
|
|
9
12
|
import { EditorSelection } from '@codemirror/state';
|
|
10
|
-
import { EditorState } from 'prosemirror-state';
|
|
11
13
|
import { EditorView } from '@codemirror/view';
|
|
12
|
-
import { EditorView as EditorView_2 } from 'prosemirror-view';
|
|
13
14
|
import { ElementProps } from '@mantine/core';
|
|
14
15
|
import { Extension } from '@codemirror/state';
|
|
15
16
|
import { FC } from 'react';
|
|
16
|
-
import { Fragment } from 'prosemirror-model';
|
|
17
17
|
import { GroupProps } from '@mantine/core';
|
|
18
18
|
import { Highlighter } from '@lezer/highlight';
|
|
19
19
|
import { HighlightStyle } from '@codemirror/language';
|
|
20
20
|
import { HTMLAttributes } from 'react';
|
|
21
21
|
import { ImageProps } from '@mantine/core';
|
|
22
|
-
import { InputRule } from 'prosemirror-inputrules';
|
|
23
22
|
import { KeyBinding } from '@codemirror/view';
|
|
23
|
+
import { ListElementMap } from '@yoopta/lists/dist/types';
|
|
24
24
|
import { MantineColor } from '@mantine/core';
|
|
25
25
|
import { MantineColorScheme } from '@mantine/core';
|
|
26
26
|
import { MantineFontSize } from '@mantine/core';
|
|
27
|
+
import { MantineSize } from '@mantine/core';
|
|
27
28
|
import { MantineThemeOverride } from '@mantine/core';
|
|
28
|
-
import { MarkSpec } from 'prosemirror-model';
|
|
29
|
-
import { MarkType } from 'prosemirror-model';
|
|
30
|
-
import { Node as Node_2 } from 'prosemirror-model';
|
|
31
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
32
|
-
import { NodeViewConstructor } from 'prosemirror-view';
|
|
33
29
|
import { PaperProps } from '@mantine/core';
|
|
34
|
-
import { PluginKey } from 'prosemirror-state';
|
|
35
30
|
import type * as React_2 from 'react';
|
|
36
31
|
import { ReactNode } from 'react';
|
|
37
|
-
import { Ref } from 'react';
|
|
38
32
|
import { RefObject } from 'react';
|
|
39
|
-
import {
|
|
40
|
-
import { Schema } from 'prosemirror-model';
|
|
33
|
+
import { SlateElement } from '@yoopta/editor';
|
|
41
34
|
import { StackProps } from '@mantine/core';
|
|
42
35
|
import { StateField } from '@codemirror/state';
|
|
43
36
|
import { TabsProps as TabsProps_2 } from '@mantine/core';
|
|
37
|
+
import { VideoHTMLAttributes } from 'react';
|
|
38
|
+
import { YooEditor } from '@yoopta/editor';
|
|
39
|
+
import { YooptaContentValue } from '@yoopta/editor';
|
|
40
|
+
import { YooptaMark } from '@yoopta/editor';
|
|
41
|
+
import { YooptaOnChangeOptions } from '@yoopta/editor';
|
|
42
|
+
import { YooptaPlugin } from '@yoopta/editor';
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* A keybind used to accept a completion
|
|
@@ -64,6 +63,8 @@ export declare const addCursorVerticallyKeymap: readonly KeyBinding[];
|
|
|
64
63
|
|
|
65
64
|
declare type AnyFn = (...rest: any[]) => any;
|
|
66
65
|
|
|
66
|
+
declare type AnyLanguage = Language | (string & {});
|
|
67
|
+
|
|
67
68
|
export declare type AnyNode = BlockNode | InlineNode | SummaryNode | ListItemNode | TableRowNode | TableCellNode | TabItemNode;
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -73,82 +74,27 @@ export declare type AnyNode = BlockNode | InlineNode | SummaryNode | ListItemNod
|
|
|
73
74
|
*/
|
|
74
75
|
export declare function applyAutoFolding(view: EditorView, autoCollapseDepth: number): void;
|
|
75
76
|
|
|
76
|
-
/**
|
|
77
|
-
* A block in the editor document. Blocks have a stable `id`,
|
|
78
|
-
* a `type` determining their behavior, `props` for type-specific
|
|
79
|
-
* attributes, optional inline `content`, and optional nested
|
|
80
|
-
* `children` blocks.
|
|
81
|
-
*/
|
|
82
|
-
export declare interface Block {
|
|
83
|
-
id: string;
|
|
84
|
-
type: BlockType;
|
|
85
|
-
props: Record<string, unknown>;
|
|
86
|
-
content?: InlineContent[];
|
|
87
|
-
children?: Block[];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
77
|
export declare const BlockEditor: FC<BlockEditorProps>;
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
* Created by the `useBlockEditor` hook and passed to the `BlockEditor`
|
|
95
|
-
* component.
|
|
96
|
-
*/
|
|
97
|
-
export declare interface BlockEditorController {
|
|
98
|
-
/** Ref to attach to the editor's mount point DOM element (RefObject or callback ref). */
|
|
99
|
-
ref: Ref<HTMLDivElement | null>;
|
|
100
|
-
/** Whether the ProseMirror EditorView has been mounted. */
|
|
101
|
-
mounted: boolean;
|
|
102
|
-
/** Access the underlying ProseMirror EditorView. Throws if not mounted. */
|
|
103
|
-
getEditor: () => EditorView_2;
|
|
104
|
-
/** Convert the current document to a Block[] JSON model. */
|
|
105
|
-
getBlocks: () => Block[];
|
|
106
|
-
/** Find a block by ID, searching recursively through children. */
|
|
107
|
-
getBlock: (id: string) => Block | undefined;
|
|
108
|
-
/** Find the sibling block before the block with the given ID. */
|
|
109
|
-
getPreviousBlock: (id: string) => Block | undefined;
|
|
110
|
-
/** Find the sibling block after the block with the given ID. */
|
|
111
|
-
getNextBlock: (id: string) => Block | undefined;
|
|
112
|
-
/** Append blocks to the end of the document. IDs are generated automatically. */
|
|
113
|
-
appendBlocks: (...blocks: BlockInput[]) => void;
|
|
114
|
-
/** Insert blocks after the block with the given reference ID. IDs are generated automatically. */
|
|
115
|
-
insertBlocks: (referenceId: string, ...blocks: BlockInput[]) => void;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export declare interface BlockEditorOptions {
|
|
119
|
-
initialBlocks?: Block[];
|
|
120
|
-
readOnly?: boolean;
|
|
79
|
+
export declare interface BlockEditorProps {
|
|
80
|
+
editor: YooEditor;
|
|
121
81
|
placeholder?: string;
|
|
122
|
-
registry?: BlockTypeRegistry;
|
|
123
|
-
customBlocks?: BlockTypeDefinition[];
|
|
124
|
-
exclude?: string[];
|
|
125
|
-
onChangeBlocks?: (blocks: Block[]) => void;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export declare interface BlockEditorProps extends BoxProps {
|
|
129
|
-
controller: BlockEditorController & {
|
|
130
|
-
portalManager: PortalManager;
|
|
131
|
-
};
|
|
132
82
|
autoFocus?: boolean;
|
|
133
83
|
readOnly?: boolean;
|
|
134
|
-
|
|
84
|
+
className?: string;
|
|
85
|
+
onChange?: (value: YooptaContentValue, options: YooptaOnChangeOptions) => void;
|
|
86
|
+
children?: ReactNode;
|
|
135
87
|
}
|
|
136
88
|
|
|
137
|
-
export declare
|
|
138
|
-
|
|
139
|
-
declare interface BlockHandleState {
|
|
140
|
-
hoveredBlockPos: number | null;
|
|
141
|
-
hoveredBlockNode: Node_2 | null;
|
|
142
|
-
dropIndicatorPos: number | null;
|
|
143
|
-
}
|
|
89
|
+
export declare type BlockNode = HeadingNode | ParagraphNode | CodeNode | BlockquoteNode | ListNode | TableNode | ThematicBreakNode | DivNode | DetailsNode | ImageNode | CheckNode | RailroadDiagramNode | SurrealistMiniNode | VersionNode | SinceNode | LabelNode | TabsNode;
|
|
144
90
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
*/
|
|
149
|
-
export declare type BlockInput = Omit<Block, "id">;
|
|
91
|
+
export declare type BlockOptionsComponent = FC<{
|
|
92
|
+
blockId: string;
|
|
93
|
+
}>;
|
|
150
94
|
|
|
151
|
-
|
|
95
|
+
declare type BlockquoteElementMap = {
|
|
96
|
+
blockquote: BlockquoteElement;
|
|
97
|
+
};
|
|
152
98
|
|
|
153
99
|
export declare interface BlockquoteNode {
|
|
154
100
|
type: "blockquote";
|
|
@@ -160,128 +106,14 @@ export declare interface BlockquoteNode {
|
|
|
160
106
|
noteTitle?: string;
|
|
161
107
|
}
|
|
162
108
|
|
|
163
|
-
export declare const
|
|
109
|
+
export declare const BlockRenderer: FC<BlockRendererProps>;
|
|
164
110
|
|
|
165
|
-
/** SSR-compatible read-only renderer for Block[] data. */
|
|
166
|
-
export declare const BlockRenderer: FC<BlockRendererComponentProps>;
|
|
167
|
-
|
|
168
|
-
export declare interface BlockRendererComponentProps {
|
|
169
|
-
/** The blocks to render. */
|
|
170
|
-
blocks: Block[];
|
|
171
|
-
/** Registry providing block type definitions with readOnlyRender components. */
|
|
172
|
-
registry?: BlockTypeRegistry;
|
|
173
|
-
/** Root container class name. */
|
|
174
|
-
className?: string;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/** Props for custom block renderers used with BlockRenderer. */
|
|
178
111
|
export declare interface BlockRendererProps {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/** Props for read-only block rendering. */
|
|
185
|
-
declare interface BlockRendererProps_2 {
|
|
186
|
-
block: Block;
|
|
187
|
-
inlineContent?: ReactNode;
|
|
188
|
-
children?: ReactNode;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/** Configuration for creating a block type definition without raw ProseMirror NodeSpec. */
|
|
192
|
-
export declare interface BlockSpecConfig {
|
|
193
|
-
/** Unique block type identifier (hyphenated, e.g. "callout"). */
|
|
194
|
-
type: string;
|
|
195
|
-
/** Map of prop names to their defaults. Generates NodeSpec attrs automatically. */
|
|
196
|
-
propSchema?: Record<string, PropDefault>;
|
|
197
|
-
/** Content model shorthand: "inline" for text, "blocks" for nested blocks, "none" for atoms. */
|
|
198
|
-
content?: "inline" | "blocks" | "none";
|
|
199
|
-
/** React component for rendering this block in the editor. */
|
|
200
|
-
render?: FC<ReactNodeViewProps>;
|
|
201
|
-
/** Slash menu entry for inserting this block. */
|
|
202
|
-
slashMenuItem?: Omit<SlashMenuItem, "type">;
|
|
203
|
-
/** Raw NodeSpec overrides for advanced use cases. Merged after generated spec. */
|
|
204
|
-
nodeSpecOverrides?: Partial<NodeSpec>;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/** Convert a Block[] JSON model to a ProseMirror document node. */
|
|
208
|
-
export declare function blocksToDoc(blocks: Block[], schema: Schema): Node_2;
|
|
209
|
-
|
|
210
|
-
/** Convert a single Block to a ProseMirror blockContainer node. */
|
|
211
|
-
export declare function blockToNode(block: Block, schema: Schema): Node_2;
|
|
212
|
-
|
|
213
|
-
/** Identifies the type of a block in the editor document. Extensible via string. */
|
|
214
|
-
export declare type BlockType = "text" | "list-item" | "checklist-item" | "blockquote" | "table" | "table-row" | "table-cell" | "columns" | "column" | "divider" | "collapsible-item" | "code-block" | (string & {});
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Defines a block type that can be registered with a BlockTypeRegistry.
|
|
218
|
-
* Includes the ProseMirror NodeSpec, optional React component for
|
|
219
|
-
* rendering, slash menu entry, input rule, and behavior declarations.
|
|
220
|
-
*/
|
|
221
|
-
export declare interface BlockTypeDefinition {
|
|
222
|
-
type: string;
|
|
223
|
-
/** ProseMirror node name. Defaults to `type` if not specified. */
|
|
224
|
-
nodeName?: string;
|
|
225
|
-
nodeSpec: NodeSpec;
|
|
226
|
-
/** React component for rendering this block via NodeView. */
|
|
227
|
-
component?: FC<ReactNodeViewProps>;
|
|
228
|
-
/** Whether the NodeView should be non-editable (atom). */
|
|
229
|
-
atom?: boolean;
|
|
230
|
-
/** Slash menu entries for inserting this block. */
|
|
231
|
-
slashMenuItems?: SlashMenuItem[];
|
|
232
|
-
/** Input rules for markdown-style shortcuts. */
|
|
233
|
-
inputRules?: InputRule[];
|
|
234
|
-
/**
|
|
235
|
-
* Factory to create ProseMirror node(s) when this block is inserted
|
|
236
|
-
* via the slash menu. Returns a blockContainer node.
|
|
237
|
-
*/
|
|
238
|
-
createNode?: (schema: Schema) => Node_2;
|
|
239
|
-
/** Declares list-like enter/backspace behavior. */
|
|
240
|
-
listBehavior?: ListBehavior;
|
|
241
|
-
/** When true, the Enter key is not handled (falls through to ProseMirror default). */
|
|
242
|
-
enterPassthrough?: boolean;
|
|
243
|
-
/** Extract Block.props from a ProseMirror node (doc -> JSON conversion). */
|
|
244
|
-
toBlockProps?: (node: Node_2) => Record<string, unknown>;
|
|
245
|
-
/** Convert Block.props to ProseMirror node attrs (JSON -> doc conversion). */
|
|
246
|
-
fromBlockProps?: (props: Record<string, unknown>) => Record<string, unknown>;
|
|
247
|
-
/** Custom logic for converting a Block to a ProseMirror inner node. */
|
|
248
|
-
createInnerNode?: (block: Block, schema: Schema) => Node_2;
|
|
249
|
-
/** Whether this block has inline text content. Auto-detected from nodeSpec if not set. */
|
|
250
|
-
hasInlineContent?: boolean;
|
|
251
|
-
/** Whether this block renders children inside itself (e.g. blockquote, table, columns). */
|
|
252
|
-
isContainerBlock?: boolean;
|
|
253
|
-
/** Label shown in the toolbar's block type dropdown. */
|
|
254
|
-
toolbarLabel?: string | ((node: Node_2) => string);
|
|
255
|
-
/** Options for the toolbar's block type conversion dropdown. */
|
|
256
|
-
toolbarOptions?: {
|
|
257
|
-
label: string;
|
|
258
|
-
attrs?: Record<string, unknown>;
|
|
259
|
-
}[];
|
|
260
|
-
/** React component for rendering this block in read-only mode. */
|
|
261
|
-
readOnlyRender?: FC<BlockRendererProps_2>;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Registry for block types. Register definitions before
|
|
266
|
-
* passing to `useBlockEditor` so the schema, slash menu, and
|
|
267
|
-
* node views are extended automatically.
|
|
268
|
-
*/
|
|
269
|
-
export declare class BlockTypeRegistry {
|
|
270
|
-
private definitions;
|
|
271
|
-
/** Register a block type definition. */
|
|
272
|
-
register(definition: BlockTypeDefinition): void;
|
|
273
|
-
/** Look up a registered definition by block type name. */
|
|
274
|
-
get(type: string): BlockTypeDefinition | undefined;
|
|
275
|
-
/** Look up a registered definition by ProseMirror node name. */
|
|
276
|
-
getByNodeName(nodeName: string): BlockTypeDefinition | undefined;
|
|
277
|
-
/** Return all registered definitions. */
|
|
278
|
-
getAll(): BlockTypeDefinition[];
|
|
279
|
-
/** Collect ProseMirror NodeSpecs from all registered definitions. */
|
|
280
|
-
getNodeSpecs(): Record<string, NodeSpec>;
|
|
281
|
-
/** Collect slash menu items from all registered definitions. */
|
|
282
|
-
getSlashMenuItems(): SlashMenuItem[];
|
|
283
|
-
/** Collect input rules from all registered definitions. */
|
|
284
|
-
getInputRules(): InputRule[];
|
|
112
|
+
value: YooptaContentValue;
|
|
113
|
+
marks?: YooptaMark<any>[];
|
|
114
|
+
plugins?: YooptaPlugin<Record<string, SlateElement>, Record<string, unknown>>[];
|
|
115
|
+
withHeadingLinks?: boolean;
|
|
116
|
+
className?: string;
|
|
285
117
|
}
|
|
286
118
|
|
|
287
119
|
export declare interface BooleanHandle {
|
|
@@ -405,6 +237,41 @@ export declare const brandRuby: string;
|
|
|
405
237
|
|
|
406
238
|
export declare const brandRust: string;
|
|
407
239
|
|
|
240
|
+
export declare const BRANDSAFE_BASE = "https://cdn.brandsafe.io";
|
|
241
|
+
|
|
242
|
+
export declare const BrandsafeImage: YooptaPlugin<BrandsafeImageElementMap>;
|
|
243
|
+
|
|
244
|
+
export declare type BrandsafeImageElement = SlateElement<"brandsafe-image", BrandsafeImageProps>;
|
|
245
|
+
|
|
246
|
+
export declare type BrandsafeImageElementMap = {
|
|
247
|
+
"brandsafe-image": BrandsafeImageElement;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export declare interface BrandsafeImageProps {
|
|
251
|
+
nodeType: "void";
|
|
252
|
+
code: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export declare const BrandsafeVideo: YooptaPlugin<BrandsafeVideoElementMap>;
|
|
256
|
+
|
|
257
|
+
export declare type BrandsafeVideoElement = SlateElement<"brandsafe-video", BrandsafeVideoProps>;
|
|
258
|
+
|
|
259
|
+
export declare type BrandsafeVideoElementMap = {
|
|
260
|
+
"brandsafe-video": BrandsafeVideoElement;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export declare type BrandsafeVideoFormat = "mp4" | "webm" | "mov";
|
|
264
|
+
|
|
265
|
+
export declare interface BrandsafeVideoProps {
|
|
266
|
+
nodeType: "void";
|
|
267
|
+
code: string;
|
|
268
|
+
format: BrandsafeVideoFormat;
|
|
269
|
+
loop: boolean;
|
|
270
|
+
autoplay: boolean;
|
|
271
|
+
muted: boolean;
|
|
272
|
+
controls: boolean;
|
|
273
|
+
}
|
|
274
|
+
|
|
408
275
|
export declare const brandSamsung: string;
|
|
409
276
|
|
|
410
277
|
export declare const brandSiteForge: string;
|
|
@@ -452,19 +319,8 @@ export declare interface BreakNode {
|
|
|
452
319
|
style?: string;
|
|
453
320
|
}
|
|
454
321
|
|
|
455
|
-
/**
|
|
456
|
-
* Build a ProseMirror Schema from the registry's block type definitions.
|
|
457
|
-
* The registry must already have all desired block types registered.
|
|
458
|
-
* Use `customMarks` to add custom mark specs alongside the built-in ones.
|
|
459
|
-
*/
|
|
460
|
-
export declare function buildSchema(registry?: BlockTypeRegistry, _exclude?: string[], customMarks?: Record<string, MarkSpec>): Schema;
|
|
461
|
-
|
|
462
|
-
export declare const builtInMarks: Record<string, MarkSpec>;
|
|
463
|
-
|
|
464
322
|
export declare function Check({ children, ...props }: CheckProps): ReactNode;
|
|
465
323
|
|
|
466
|
-
export declare const checklistItemSpec: NodeSpec;
|
|
467
|
-
|
|
468
324
|
export declare interface CheckNode {
|
|
469
325
|
type: "check";
|
|
470
326
|
children: InlineNode[];
|
|
@@ -499,8 +355,6 @@ export declare interface CodeBlockProps extends Omit<PaperProps, "children" | "s
|
|
|
499
355
|
withLineNumbers?: boolean;
|
|
500
356
|
}
|
|
501
357
|
|
|
502
|
-
export declare const codeBlockSpec: NodeSpec;
|
|
503
|
-
|
|
504
358
|
export declare const CodeEditor: FC<CodeEditorProps>;
|
|
505
359
|
|
|
506
360
|
export declare interface CodeEditorProps extends BoxProps {
|
|
@@ -522,16 +376,12 @@ export declare interface CodeNode {
|
|
|
522
376
|
style?: string;
|
|
523
377
|
}
|
|
524
378
|
|
|
525
|
-
export declare const
|
|
379
|
+
export declare const COLOR_OPTIONS: OptionItem[];
|
|
526
380
|
|
|
527
381
|
export declare type ColorScheme = keyof ThemeConfig;
|
|
528
382
|
|
|
529
383
|
declare type ColorScheme_2 = keyof ThemeConfig_2;
|
|
530
384
|
|
|
531
|
-
export declare const columnSpec: NodeSpec;
|
|
532
|
-
|
|
533
|
-
export declare const columnsSpec: NodeSpec;
|
|
534
|
-
|
|
535
385
|
declare interface CommentNode {
|
|
536
386
|
type: "Comment";
|
|
537
387
|
text: string;
|
|
@@ -555,57 +405,11 @@ declare type ComponentMap = {
|
|
|
555
405
|
[T in AnyNode["type"]]: ComponentFunction<T>;
|
|
556
406
|
};
|
|
557
407
|
|
|
558
|
-
/**
|
|
559
|
-
* Factory function to create a BlockEditorController from refs.
|
|
560
|
-
* Used internally by `useBlockEditor`.
|
|
561
|
-
*/
|
|
562
|
-
export declare function createBlockEditorController(ref: Ref<HTMLDivElement | null>, editorViewRef: RefObject<EditorView_2 | null>, mountedRef: {
|
|
563
|
-
current: boolean;
|
|
564
|
-
}): BlockEditorController;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Create a BlockTypeDefinition from a simplified config.
|
|
568
|
-
* Generates `nodeSpec` (including `parseDOM`/`toDOM`) automatically from `propSchema`.
|
|
569
|
-
* The raw `nodeSpec` field on `BlockTypeDefinition` remains available via `nodeSpecOverrides`.
|
|
570
|
-
*/
|
|
571
|
-
export declare function createBlockSpec(config: BlockSpecConfig): BlockTypeDefinition;
|
|
572
|
-
|
|
573
408
|
/**
|
|
574
409
|
* Create a style highlighter for the given color scheme and syntax theme
|
|
575
410
|
*/
|
|
576
411
|
export declare function createHighlighter(colorScheme: MantineColorScheme): Highlighter;
|
|
577
412
|
|
|
578
|
-
/**
|
|
579
|
-
* Create an InlineContentDefinition from a simplified config.
|
|
580
|
-
* Generates a ProseMirror inline node spec with appropriate attrs and DOM serialization.
|
|
581
|
-
*/
|
|
582
|
-
export declare function createInlineContentSpec(config: InlineContentSpecConfig): InlineContentDefinition;
|
|
583
|
-
|
|
584
|
-
export declare function createMarkKeymap(schema: Schema): Record<string, Command_2>;
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Create a ProseMirror NodeViewConstructor that renders a React
|
|
588
|
-
* component via the PortalManager. The component receives
|
|
589
|
-
* `ReactNodeViewProps` and can use `contentRef` to mark its
|
|
590
|
-
* editable content area.
|
|
591
|
-
*
|
|
592
|
-
* **Focus resolution:** When a new NodeView is created and the
|
|
593
|
-
* ProseMirror selection falls inside it, `contentDOM` is already
|
|
594
|
-
* in the DOM tree so ProseMirror can sync its cursor. After React
|
|
595
|
-
* renders the portal, `contentRef` re-parents `contentDOM` and
|
|
596
|
-
* re-syncs the DOM selection automatically.
|
|
597
|
-
*
|
|
598
|
-
* **`data-focus` convention:** For blocks that need custom focus
|
|
599
|
-
* behavior (e.g. atom blocks wrapping a `<CodeEditor>`), add a
|
|
600
|
-
* `data-focus` attribute to the element that should receive DOM
|
|
601
|
-
* focus. After React renders, the NodeView will call `.focus()`
|
|
602
|
-
* on the first `[data-focus]` element if the ProseMirror selection
|
|
603
|
-
* is inside this block.
|
|
604
|
-
*/
|
|
605
|
-
export declare function createReactNodeView(Component: FC<ReactNodeViewProps>, options?: {
|
|
606
|
-
contentEditable?: boolean;
|
|
607
|
-
}): NodeViewConstructor;
|
|
608
|
-
|
|
609
413
|
/**
|
|
610
414
|
* Create a new serialized editor state from a document string.
|
|
611
415
|
*
|
|
@@ -619,12 +423,32 @@ export declare function createSerializedState(doc: string): EditorStateSnapshot;
|
|
|
619
423
|
*/
|
|
620
424
|
export declare function createStyleHighlighter(theme: ThemeConfig_2, colorScheme: ColorScheme_2): Highlighter;
|
|
621
425
|
|
|
426
|
+
export declare const CUSTOM_BLOCKS: Set<string>;
|
|
427
|
+
|
|
622
428
|
/**
|
|
623
429
|
* A custom variant of the history keymap that uses
|
|
624
430
|
* the Mod key instead of the Ctrl key
|
|
625
431
|
*/
|
|
626
432
|
export declare const customHistoryKeymap: readonly KeyBinding[];
|
|
627
433
|
|
|
434
|
+
export declare const DEFAULT_BLOCK_MARKS: YooptaMark<any>[];
|
|
435
|
+
|
|
436
|
+
export declare const DEFAULT_BLOCK_PLUGINS: YooptaPlugin<Record<string, SlateElement>, Record<string, unknown>>[];
|
|
437
|
+
|
|
438
|
+
export declare const DEFAULT_BUTTON_PROPS: MantineButtonProps;
|
|
439
|
+
|
|
440
|
+
export declare const DEFAULT_CODEBLOCK_PROPS: SurrealCodeBlockProps;
|
|
441
|
+
|
|
442
|
+
export declare const DEFAULT_IMAGE_PROPS: BrandsafeImageProps;
|
|
443
|
+
|
|
444
|
+
export declare const DEFAULT_LINK_PROPS: SurrealLinkProps;
|
|
445
|
+
|
|
446
|
+
export declare const DEFAULT_TABLE_PROPS: MantineTableProps;
|
|
447
|
+
|
|
448
|
+
export declare const DEFAULT_VIDEO_EMBED_PROPS: VideoEmbedProps;
|
|
449
|
+
|
|
450
|
+
export declare const DEFAULT_VIDEO_PROPS: BrandsafeVideoProps;
|
|
451
|
+
|
|
628
452
|
export declare type DefaultSort = {
|
|
629
453
|
[key: string]: unknown;
|
|
630
454
|
};
|
|
@@ -655,8 +479,6 @@ export declare interface DiagramNode {
|
|
|
655
479
|
children: RailroadNode[];
|
|
656
480
|
}
|
|
657
481
|
|
|
658
|
-
export declare const dividerSpec: NodeSpec;
|
|
659
|
-
|
|
660
482
|
export declare interface DivNode {
|
|
661
483
|
type: "div";
|
|
662
484
|
children: BlockNode[];
|
|
@@ -665,9 +487,6 @@ export declare interface DivNode {
|
|
|
665
487
|
style?: string;
|
|
666
488
|
}
|
|
667
489
|
|
|
668
|
-
/** Convert a ProseMirror document node to a Block[] JSON model. */
|
|
669
|
-
export declare function docToBlocks(doc: Node_2): Block[];
|
|
670
|
-
|
|
671
490
|
export declare interface EditorController {
|
|
672
491
|
ref: RefObject<HTMLDivElement | null>;
|
|
673
492
|
mounted: boolean;
|
|
@@ -715,8 +534,6 @@ export declare interface EmphasisNode {
|
|
|
715
534
|
*/
|
|
716
535
|
export declare function enterNode(state: ParserState, nodeType: string, node: BlockNode | SummaryNode): void;
|
|
717
536
|
|
|
718
|
-
export declare function executeSlashCommand(view: EditorView_2, schema: Schema, menuState: SlashMenuState, item: SlashMenuItem): void;
|
|
719
|
-
|
|
720
537
|
/**
|
|
721
538
|
* Exit a node (pop from stack and validate)
|
|
722
539
|
*/
|
|
@@ -733,35 +550,6 @@ export declare interface ExtractedCode {
|
|
|
733
550
|
*/
|
|
734
551
|
export declare function extractTest(input: string): ExtractedCode;
|
|
735
552
|
|
|
736
|
-
export declare function filterItems(items: SlashMenuItem[], query: string): SlashMenuItem[];
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Walk up from a resolved position to find the nearest ancestor
|
|
740
|
-
* node matching the given type name.
|
|
741
|
-
*
|
|
742
|
-
* @returns The ancestor's absolute position, depth, and node, or null if not found.
|
|
743
|
-
*/
|
|
744
|
-
export declare function findAncestor($pos: ResolvedPos, typeName: string): {
|
|
745
|
-
pos: number;
|
|
746
|
-
depth: number;
|
|
747
|
-
node: Node_2;
|
|
748
|
-
} | null;
|
|
749
|
-
|
|
750
|
-
/** Find the position and node of a blockContainer by its ID attribute. */
|
|
751
|
-
export declare function findBlockPos(doc: Node_2, id: string): {
|
|
752
|
-
pos: number;
|
|
753
|
-
node: Node_2;
|
|
754
|
-
} | undefined;
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* Find the nearest blockContainer ancestor's position from a
|
|
758
|
-
* resolved position.
|
|
759
|
-
*/
|
|
760
|
-
export declare function findContainerPos($pos: ResolvedPos): number | null;
|
|
761
|
-
|
|
762
|
-
/** Convert a ProseMirror inline Fragment to an InlineContent[] array. */
|
|
763
|
-
export declare function fragmentToInline(fragment: Fragment): InlineContent[];
|
|
764
|
-
|
|
765
553
|
/**
|
|
766
554
|
* Generate a 24-character hex string suitable for use as a
|
|
767
555
|
* stable block identifier. Uses `crypto.getRandomValues` for
|
|
@@ -769,6 +557,14 @@ export declare function fragmentToInline(fragment: Fragment): InlineContent[];
|
|
|
769
557
|
*/
|
|
770
558
|
export declare function generateRandomId(): string;
|
|
771
559
|
|
|
560
|
+
export declare function getBlockOptionsComponent(blockType: string): BlockOptionsComponent | undefined;
|
|
561
|
+
|
|
562
|
+
export declare function getBrandsafeImageURL(imageId: string | undefined, width?: number, quality?: number): string | undefined;
|
|
563
|
+
|
|
564
|
+
export declare function getBrandsafeVideoURL(videoId: string | undefined, format?: "mp4" | "webm" | "mov", controls?: boolean): string | undefined;
|
|
565
|
+
|
|
566
|
+
export declare const HeadingLinksProvider: React.Provider<boolean>;
|
|
567
|
+
|
|
772
568
|
export declare interface HeadingNode {
|
|
773
569
|
type: "heading";
|
|
774
570
|
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -1156,52 +952,8 @@ export declare interface InlineCodeNode {
|
|
|
1156
952
|
style?: string;
|
|
1157
953
|
}
|
|
1158
954
|
|
|
1159
|
-
/** A piece of inline content within a block, either styled text, a link, or custom inline content. */
|
|
1160
|
-
export declare type InlineContent = {
|
|
1161
|
-
type: "text";
|
|
1162
|
-
text: string;
|
|
1163
|
-
styles?: TextStyles;
|
|
1164
|
-
} | {
|
|
1165
|
-
type: "link";
|
|
1166
|
-
href: string;
|
|
1167
|
-
content: InlineContent[];
|
|
1168
|
-
} | {
|
|
1169
|
-
type: string;
|
|
1170
|
-
props: Record<string, unknown>;
|
|
1171
|
-
};
|
|
1172
|
-
|
|
1173
|
-
/** Definition of a custom inline content type. */
|
|
1174
|
-
export declare interface InlineContentDefinition {
|
|
1175
|
-
type: string;
|
|
1176
|
-
nodeSpec: NodeSpec;
|
|
1177
|
-
component: FC<ReactNodeViewProps>;
|
|
1178
|
-
triggerCharacter?: string;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
/** Configuration for creating a custom inline content type. */
|
|
1182
|
-
export declare interface InlineContentSpecConfig {
|
|
1183
|
-
/** Unique type identifier for this inline content. */
|
|
1184
|
-
type: string;
|
|
1185
|
-
/** Map of prop names to their defaults. */
|
|
1186
|
-
propSchema?: Record<string, InlinePropDefault>;
|
|
1187
|
-
/** Whether this inline content contains styled text ("styled") or not ("none"). */
|
|
1188
|
-
content?: "styled" | "none";
|
|
1189
|
-
/** React component for rendering this inline content. */
|
|
1190
|
-
render: FC<ReactNodeViewProps>;
|
|
1191
|
-
/** Character that triggers a suggestion menu for inserting this inline content (e.g. "@"). */
|
|
1192
|
-
triggerCharacter?: string;
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
955
|
export declare type InlineNode = TextNode | LinkNode | InlineCodeNode | StrongNode | EmphasisNode | BreakNode | ImageNode;
|
|
1196
956
|
|
|
1197
|
-
/** Schema for a single inline content prop with a default value. */
|
|
1198
|
-
export declare interface InlinePropDefault {
|
|
1199
|
-
default: string | number | boolean;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
/** Convert an InlineContent[] array to a ProseMirror inline Fragment. */
|
|
1203
|
-
export declare function inlineToFragment(content: InlineContent[], schema: Schema): Fragment;
|
|
1204
|
-
|
|
1205
957
|
/**
|
|
1206
958
|
* Check if a code point is an emoji
|
|
1207
959
|
* Simplified ranges - merged consecutive ranges
|
|
@@ -1239,14 +991,6 @@ export declare interface LinkNode {
|
|
|
1239
991
|
style?: string;
|
|
1240
992
|
}
|
|
1241
993
|
|
|
1242
|
-
/** Declares list-like enter/backspace behavior for a block type. */
|
|
1243
|
-
export declare interface ListBehavior {
|
|
1244
|
-
/** Create a new sibling node when Enter is pressed. */
|
|
1245
|
-
createSibling: (schema: Schema) => Node_2;
|
|
1246
|
-
/** Text prefix to insert when backspacing an empty item back to text. */
|
|
1247
|
-
backspacePrefix?: string;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
994
|
export declare interface ListItemNode {
|
|
1251
995
|
type: "listItem";
|
|
1252
996
|
checked?: boolean;
|
|
@@ -1257,8 +1001,6 @@ export declare interface ListItemNode {
|
|
|
1257
1001
|
style?: string;
|
|
1258
1002
|
}
|
|
1259
1003
|
|
|
1260
|
-
export declare const listItemSpec: NodeSpec;
|
|
1261
|
-
|
|
1262
1004
|
export declare interface ListNode {
|
|
1263
1005
|
type: "list";
|
|
1264
1006
|
variant?: "ordered" | "unordered" | "checklist";
|
|
@@ -1275,7 +1017,49 @@ export declare interface ListNode {
|
|
|
1275
1017
|
*/
|
|
1276
1018
|
export declare const MANTINE_THEME: MantineThemeOverride;
|
|
1277
1019
|
|
|
1278
|
-
export declare
|
|
1020
|
+
export declare const MantineBlockquote: YooptaPlugin<BlockquoteElementMap, Record<string, unknown>>;
|
|
1021
|
+
|
|
1022
|
+
export declare const MantineButton: YooptaPlugin<MantineButtonElementMap>;
|
|
1023
|
+
|
|
1024
|
+
export declare type MantineButtonElement = SlateElement<"mantine-button", MantineButtonProps>;
|
|
1025
|
+
|
|
1026
|
+
export declare type MantineButtonElementMap = {
|
|
1027
|
+
"mantine-button": MantineButtonElement;
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
export declare interface MantineButtonProps {
|
|
1031
|
+
nodeType: "void";
|
|
1032
|
+
label: string;
|
|
1033
|
+
url: string;
|
|
1034
|
+
variant: ButtonProps["variant"];
|
|
1035
|
+
color: MantineColor;
|
|
1036
|
+
size: MantineSize;
|
|
1037
|
+
radius: MantineSize;
|
|
1038
|
+
fullWidth: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
export declare const MantineCallout: YooptaPlugin<CalloutElementMap, Record<string, unknown>>;
|
|
1042
|
+
|
|
1043
|
+
export declare const MantineChecklist: YooptaPlugin<Pick<ListElementMap, "todo-list">, Record<string, unknown>>;
|
|
1044
|
+
|
|
1045
|
+
export declare const MantineDivider: YooptaPlugin<DividerElementMap, Record<string, unknown>>;
|
|
1046
|
+
|
|
1047
|
+
export declare const MantineTable: YooptaPlugin<MantineTableElementMap>;
|
|
1048
|
+
|
|
1049
|
+
export declare type MantineTableElement = SlateElement<"mantine-table", MantineTableProps>;
|
|
1050
|
+
|
|
1051
|
+
export declare type MantineTableElementMap = {
|
|
1052
|
+
"mantine-table": MantineTableElement;
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
export declare interface MantineTableProps {
|
|
1056
|
+
nodeType: "void";
|
|
1057
|
+
rows: string[][];
|
|
1058
|
+
withHeaderRow: boolean;
|
|
1059
|
+
striped: boolean;
|
|
1060
|
+
highlightOnHover: boolean;
|
|
1061
|
+
caption: string;
|
|
1062
|
+
}
|
|
1279
1063
|
|
|
1280
1064
|
/**
|
|
1281
1065
|
* Main Markdown component that parses markdown and renders it
|
|
@@ -1352,6 +1136,8 @@ declare type NodeOfType<T extends AnyNode["type"]> = Extract<AnyNode, {
|
|
|
1352
1136
|
type: T;
|
|
1353
1137
|
}>;
|
|
1354
1138
|
|
|
1139
|
+
export declare const NON_TEXT_BLOCKS: Set<string>;
|
|
1140
|
+
|
|
1355
1141
|
declare interface NonTerminalNode {
|
|
1356
1142
|
type: "NonTerminal";
|
|
1357
1143
|
text: string;
|
|
@@ -1384,6 +1170,11 @@ declare interface OptionalNode {
|
|
|
1384
1170
|
child: RailroadNode;
|
|
1385
1171
|
}
|
|
1386
1172
|
|
|
1173
|
+
declare type OptionItem = {
|
|
1174
|
+
label: string;
|
|
1175
|
+
value: string;
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1387
1178
|
export declare interface ParagraphNode {
|
|
1388
1179
|
type: "paragraph";
|
|
1389
1180
|
children: InlineNode[];
|
|
@@ -1947,40 +1738,6 @@ export declare const pictoZed: string;
|
|
|
1947
1738
|
|
|
1948
1739
|
export declare const pictoZoomIn: string;
|
|
1949
1740
|
|
|
1950
|
-
declare interface PortalEntry {
|
|
1951
|
-
key: string;
|
|
1952
|
-
component: ReactNode;
|
|
1953
|
-
container: HTMLElement;
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
declare type PortalListener = () => void;
|
|
1957
|
-
|
|
1958
|
-
/**
|
|
1959
|
-
* Manages React portals for ProseMirror NodeViews. Coordinates
|
|
1960
|
-
* between ProseMirror's synchronous DOM lifecycle and React's
|
|
1961
|
-
* async rendering via a portal registry and subscription model.
|
|
1962
|
-
*/
|
|
1963
|
-
export declare class PortalManager {
|
|
1964
|
-
private portals;
|
|
1965
|
-
private listeners;
|
|
1966
|
-
private cachedEntries;
|
|
1967
|
-
register(entry: PortalEntry): void;
|
|
1968
|
-
update(key: string, component: ReactNode): void;
|
|
1969
|
-
remove(key: string): void;
|
|
1970
|
-
getEntries(): PortalEntry[];
|
|
1971
|
-
subscribe(listener: PortalListener): () => void;
|
|
1972
|
-
private invalidate;
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1975
|
-
export declare function PortalOutlet({ manager }: {
|
|
1976
|
-
manager: PortalManager;
|
|
1977
|
-
}): ReactNode;
|
|
1978
|
-
|
|
1979
|
-
export declare function PortalProvider({ manager, children, }: {
|
|
1980
|
-
manager: PortalManager;
|
|
1981
|
-
children: ReactNode;
|
|
1982
|
-
}): ReactNode;
|
|
1983
|
-
|
|
1984
1741
|
/**
|
|
1985
1742
|
* Process highlight regions in code
|
|
1986
1743
|
*/
|
|
@@ -1989,11 +1746,6 @@ export declare function processHighlightRegions(code: string): {
|
|
|
1989
1746
|
processedCode: string;
|
|
1990
1747
|
};
|
|
1991
1748
|
|
|
1992
|
-
/** Schema for a single block prop with a default value. */
|
|
1993
|
-
export declare interface PropDefault {
|
|
1994
|
-
default: string | number | boolean;
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
1749
|
/**
|
|
1998
1750
|
* Validate and process code attributes
|
|
1999
1751
|
*/
|
|
@@ -2032,16 +1784,6 @@ export declare interface RailroadDiagramProps extends BoxProps {
|
|
|
2032
1784
|
|
|
2033
1785
|
export declare type RailroadNode = DiagramNode | SequenceNode | TerminalNode | NonTerminalNode | OptionalNode | ChoiceNode | OneOrMoreNode | ZeroOrMoreNode | CommentNode;
|
|
2034
1786
|
|
|
2035
|
-
/** Props passed to React components rendered inside ProseMirror NodeViews. */
|
|
2036
|
-
export declare interface ReactNodeViewProps {
|
|
2037
|
-
node: Node_2;
|
|
2038
|
-
view: EditorView_2;
|
|
2039
|
-
getPos: () => number | undefined;
|
|
2040
|
-
contentRef: (element: HTMLElement | null) => void;
|
|
2041
|
-
selected: boolean;
|
|
2042
|
-
updateAttrs: (attrs: Record<string, unknown>) => void;
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
1787
|
/**
|
|
2046
1788
|
* Read tag name from HTML tag starting at index
|
|
2047
1789
|
* Returns tag name and end index
|
|
@@ -2051,16 +1793,7 @@ export declare function readTagName(text: string, startIndex: number): {
|
|
|
2051
1793
|
endIndex: number;
|
|
2052
1794
|
};
|
|
2053
1795
|
|
|
2054
|
-
|
|
2055
|
-
* Register all built-in block type definitions with the registry and
|
|
2056
|
-
* return the fully-built ProseMirror Schema.
|
|
2057
|
-
*
|
|
2058
|
-
* Performs a two-phase bootstrap:
|
|
2059
|
-
* 1. Registers nodeSpecs using a minimal stub schema (no input rules)
|
|
2060
|
-
* 2. Builds the real schema from the registry, then re-registers
|
|
2061
|
-
* definitions with proper input rules that reference real node types.
|
|
2062
|
-
*/
|
|
2063
|
-
export declare function registerBuiltInBlocks(registry: BlockTypeRegistry, exclude?: string[]): Schema;
|
|
1796
|
+
export declare function registerBlockOptions(blockType: string, component: BlockOptionsComponent): void;
|
|
2064
1797
|
|
|
2065
1798
|
/**
|
|
2066
1799
|
* Render parsed markdown AST to React elements
|
|
@@ -2080,8 +1813,6 @@ export declare interface RenderMarkdownProps extends StackProps {
|
|
|
2080
1813
|
componentProps?: MarkdownComponentProps;
|
|
2081
1814
|
}
|
|
2082
1815
|
|
|
2083
|
-
export declare function resolveDropPosition(view: EditorView_2, clientY: number): number | null;
|
|
2084
|
-
|
|
2085
1816
|
export declare interface Root {
|
|
2086
1817
|
type: "root";
|
|
2087
1818
|
children: BlockNode[];
|
|
@@ -2116,27 +1847,7 @@ export declare interface SinceProps extends Omit<BadgeProps, "children"> {
|
|
|
2116
1847
|
prefix?: string;
|
|
2117
1848
|
}
|
|
2118
1849
|
|
|
2119
|
-
|
|
2120
|
-
export declare interface SlashMenuItem {
|
|
2121
|
-
type: string;
|
|
2122
|
-
label: string;
|
|
2123
|
-
description?: string;
|
|
2124
|
-
icon?: ReactNode;
|
|
2125
|
-
shortcut?: string;
|
|
2126
|
-
/** Create a ProseMirror blockContainer node for this menu item. */
|
|
2127
|
-
createNode?: (schema: Schema, id: string) => Node_2;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
export declare const slashMenuPluginKey: PluginKey<SlashMenuState>;
|
|
2131
|
-
|
|
2132
|
-
declare interface SlashMenuState {
|
|
2133
|
-
open: boolean;
|
|
2134
|
-
blockPos: number | null;
|
|
2135
|
-
triggerPos: number;
|
|
2136
|
-
query: string;
|
|
2137
|
-
selectedIndex: number;
|
|
2138
|
-
items: SlashMenuItem[];
|
|
2139
|
-
}
|
|
1850
|
+
export declare const SIZE_OPTIONS: OptionItem[];
|
|
2140
1851
|
|
|
2141
1852
|
export declare type SortDirection = "asc" | "desc" | undefined;
|
|
2142
1853
|
|
|
@@ -2182,6 +1893,22 @@ export declare interface SummaryProps extends Omit<BoxProps, "component" | "chil
|
|
|
2182
1893
|
children: ReactNode;
|
|
2183
1894
|
}
|
|
2184
1895
|
|
|
1896
|
+
export declare const SurrealCodeBlock: YooptaPlugin<SurrealCodeBlockElementMap>;
|
|
1897
|
+
|
|
1898
|
+
export declare type SurrealCodeBlockElement = SlateElement<"surreal-codeblock", SurrealCodeBlockProps>;
|
|
1899
|
+
|
|
1900
|
+
export declare type SurrealCodeBlockElementMap = {
|
|
1901
|
+
"surreal-codeblock": SurrealCodeBlockElement;
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
export declare interface SurrealCodeBlockProps {
|
|
1905
|
+
nodeType: "void";
|
|
1906
|
+
code: string;
|
|
1907
|
+
language: AnyLanguage;
|
|
1908
|
+
title: string;
|
|
1909
|
+
withLineNumbers: boolean;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
2185
1912
|
export declare function SurrealistMini({ config, frameRef, ...props }: SurrealistMiniProps): ReactNode;
|
|
2186
1913
|
|
|
2187
1914
|
export declare interface SurrealistMiniNode {
|
|
@@ -2206,6 +1933,22 @@ export declare interface SurrealistMiniProps extends BoxProps {
|
|
|
2206
1933
|
frameRef?: RefObject<HTMLIFrameElement | null>;
|
|
2207
1934
|
}
|
|
2208
1935
|
|
|
1936
|
+
export declare const SurrealLink: YooptaPlugin<SurrealLinkElementMap>;
|
|
1937
|
+
|
|
1938
|
+
export declare type SurrealLinkElement = SlateElement<"surreal-link", SurrealLinkProps>;
|
|
1939
|
+
|
|
1940
|
+
export declare type SurrealLinkElementMap = {
|
|
1941
|
+
"surreal-link": SurrealLinkElement;
|
|
1942
|
+
};
|
|
1943
|
+
|
|
1944
|
+
export declare interface SurrealLinkProps {
|
|
1945
|
+
nodeType: "inline";
|
|
1946
|
+
url: string;
|
|
1947
|
+
variant?: AnchorProps["variant"];
|
|
1948
|
+
target?: string;
|
|
1949
|
+
rel?: string;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
2209
1952
|
export declare const SYNTAX_THEME_CONFIG: ThemeConfig;
|
|
2210
1953
|
|
|
2211
1954
|
export declare interface TabItem {
|
|
@@ -2233,8 +1976,6 @@ export declare interface TableCellNode {
|
|
|
2233
1976
|
isHeader: boolean;
|
|
2234
1977
|
}
|
|
2235
1978
|
|
|
2236
|
-
export declare const tableCellSpec: NodeSpec;
|
|
2237
|
-
|
|
2238
1979
|
export declare interface TableNode {
|
|
2239
1980
|
type: "table";
|
|
2240
1981
|
align?: Array<"left" | "right" | "center" | null>;
|
|
@@ -2252,10 +1993,6 @@ export declare interface TableRowNode {
|
|
|
2252
1993
|
style?: string;
|
|
2253
1994
|
}
|
|
2254
1995
|
|
|
2255
|
-
export declare const tableRowSpec: NodeSpec;
|
|
2256
|
-
|
|
2257
|
-
export declare const tableSpec: NodeSpec;
|
|
2258
|
-
|
|
2259
1996
|
export declare function Tabs({ items, syncKey, ...props }: TabsProps): ReactNode;
|
|
2260
1997
|
|
|
2261
1998
|
export declare interface TabsNode {
|
|
@@ -2277,8 +2014,6 @@ declare interface TerminalNode {
|
|
|
2277
2014
|
text: string;
|
|
2278
2015
|
}
|
|
2279
2016
|
|
|
2280
|
-
export declare const textBlockSpec: NodeSpec;
|
|
2281
|
-
|
|
2282
2017
|
export declare interface TextNode {
|
|
2283
2018
|
type: "text";
|
|
2284
2019
|
value: string;
|
|
@@ -2287,15 +2022,6 @@ export declare interface TextNode {
|
|
|
2287
2022
|
style?: string;
|
|
2288
2023
|
}
|
|
2289
2024
|
|
|
2290
|
-
/** Rich text style flags applied to inline text content. */
|
|
2291
|
-
export declare interface TextStyles {
|
|
2292
|
-
bold?: boolean;
|
|
2293
|
-
italic?: boolean;
|
|
2294
|
-
underline?: boolean;
|
|
2295
|
-
strikethrough?: boolean;
|
|
2296
|
-
code?: boolean;
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
2025
|
export declare interface ThematicBreakNode {
|
|
2300
2026
|
type: "thematicBreak";
|
|
2301
2027
|
className?: string;
|
|
@@ -2328,35 +2054,11 @@ export declare interface ThemedImageProps extends ImageProps {
|
|
|
2328
2054
|
colorScheme?: "light" | "dark";
|
|
2329
2055
|
}
|
|
2330
2056
|
|
|
2331
|
-
/** Map a camelCase ProseMirror node name to the hyphenated BlockType string. */
|
|
2332
|
-
export declare function toBlockType(nodeName: string): string;
|
|
2333
|
-
|
|
2334
|
-
/** Map a hyphenated BlockType string to the camelCase ProseMirror node name. */
|
|
2335
|
-
export declare function toNodeName(blockType: string): string;
|
|
2336
|
-
|
|
2337
|
-
export declare const toolbarPluginKey: PluginKey<ToolbarState>;
|
|
2338
|
-
|
|
2339
|
-
declare interface ToolbarState {
|
|
2340
|
-
show: boolean;
|
|
2341
|
-
from: number;
|
|
2342
|
-
to: number;
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
2057
|
/**
|
|
2346
2058
|
* Type-specific visitor function
|
|
2347
2059
|
*/
|
|
2348
2060
|
export declare type TypeVisitor<T extends AnyNode> = (node: T, index: number | undefined, parent: AnyNode | Root | null) => undefined | boolean | void;
|
|
2349
2061
|
|
|
2350
|
-
export declare function useBlockEditor(options?: BlockEditorOptions): BlockEditorController & {
|
|
2351
|
-
portalManager: PortalManager;
|
|
2352
|
-
};
|
|
2353
|
-
|
|
2354
|
-
/**
|
|
2355
|
-
* Create a memoized BlockTypeRegistry from an array of block type definitions.
|
|
2356
|
-
* Definitions should be module-level constants for stable references.
|
|
2357
|
-
*/
|
|
2358
|
-
export declare function useBlockRegistry(definitions: BlockTypeDefinition[]): BlockTypeRegistry;
|
|
2359
|
-
|
|
2360
2062
|
export declare function useEditor(options?: EditorOptions): EditorController;
|
|
2361
2063
|
|
|
2362
2064
|
/**
|
|
@@ -2393,6 +2095,8 @@ export declare function useSwitch(initialState?: boolean, callbacks?: {
|
|
|
2393
2095
|
onClose?: () => void;
|
|
2394
2096
|
}): readonly [boolean, BooleanHandle];
|
|
2395
2097
|
|
|
2098
|
+
export declare const VARIANT_OPTIONS: OptionItem[];
|
|
2099
|
+
|
|
2396
2100
|
export declare function Version({ version, ...props }: VersionProps): ReactNode;
|
|
2397
2101
|
|
|
2398
2102
|
export declare interface VersionNode {
|
|
@@ -2407,6 +2111,34 @@ export declare interface VersionProps extends CodeProps {
|
|
|
2407
2111
|
version: string;
|
|
2408
2112
|
}
|
|
2409
2113
|
|
|
2114
|
+
export declare type VideoControlsPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
2115
|
+
|
|
2116
|
+
export declare const VideoEmbed: YooptaPlugin<VideoEmbedElementMap>;
|
|
2117
|
+
|
|
2118
|
+
export declare type VideoEmbedElement = SlateElement<"video-embed", VideoEmbedProps>;
|
|
2119
|
+
|
|
2120
|
+
export declare type VideoEmbedElementMap = {
|
|
2121
|
+
"video-embed": VideoEmbedElement;
|
|
2122
|
+
};
|
|
2123
|
+
|
|
2124
|
+
export declare interface VideoEmbedProps {
|
|
2125
|
+
nodeType: "void";
|
|
2126
|
+
url: string;
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
export declare const VideoPlayer: FC<VideoPlayerProps>;
|
|
2130
|
+
|
|
2131
|
+
export declare interface VideoPlayerProps extends BoxProps {
|
|
2132
|
+
src: string;
|
|
2133
|
+
thumbnail?: string;
|
|
2134
|
+
poster?: string;
|
|
2135
|
+
autoPlay?: boolean;
|
|
2136
|
+
loop?: boolean;
|
|
2137
|
+
initialMuted?: boolean;
|
|
2138
|
+
controlsPosition?: VideoControlsPosition;
|
|
2139
|
+
videoProps?: Omit<VideoHTMLAttributes<HTMLVideoElement>, "autoPlay" | "loop" | "poster" | "controls" | "src" | "muted">;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2410
2142
|
/**
|
|
2411
2143
|
* Visit all nodes in the tree
|
|
2412
2144
|
*/
|