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