@mdxeditor/editor 1.14.3 → 2.0.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.
Files changed (202) hide show
  1. package/dist/MDXEditor.js +19 -25
  2. package/dist/RealmWithPlugins.js +36 -0
  3. package/dist/directive-editors/GenericDirectiveEditor.js +7 -4
  4. package/dist/index.d.ts +2590 -62
  5. package/dist/index.js +138 -66
  6. package/dist/jsx-editors/GenericJsxEditor.js +12 -9
  7. package/dist/plugins/codeblock/CodeBlockNode.js +5 -5
  8. package/dist/plugins/codeblock/index.js +37 -63
  9. package/dist/plugins/codemirror/CodeMirrorEditor.js +3 -2
  10. package/dist/plugins/codemirror/index.js +28 -45
  11. package/dist/plugins/core/GenericHTMLNode.js +9 -1
  12. package/dist/plugins/core/MdastHTMLNode.js +0 -1
  13. package/dist/plugins/core/NestedLexicalEditor.js +11 -10
  14. package/dist/plugins/core/PropertyPopover.js +3 -2
  15. package/dist/plugins/core/SharedHistoryPlugin.js +3 -3
  16. package/dist/plugins/core/index.js +426 -385
  17. package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
  18. package/dist/plugins/core/ui/PopoverUtils.js +3 -2
  19. package/dist/plugins/diff-source/DiffSourceWrapper.js +3 -4
  20. package/dist/plugins/diff-source/DiffViewer.js +7 -7
  21. package/dist/plugins/diff-source/SourceEditor.js +6 -6
  22. package/dist/plugins/diff-source/index.js +17 -52
  23. package/dist/plugins/directives/DirectiveNode.js +28 -5
  24. package/dist/plugins/directives/index.js +36 -43
  25. package/dist/plugins/frontmatter/FrontmatterEditor.js +20 -16
  26. package/dist/plugins/frontmatter/index.js +51 -62
  27. package/dist/plugins/headings/index.js +43 -49
  28. package/dist/plugins/image/ImageDialog.js +11 -7
  29. package/dist/plugins/image/ImageEditor.js +10 -7
  30. package/dist/plugins/image/ImageNode.js +27 -5
  31. package/dist/plugins/image/index.js +65 -72
  32. package/dist/plugins/jsx/LexicalJsxNode.js +3 -2
  33. package/dist/plugins/jsx/index.js +48 -60
  34. package/dist/plugins/link/index.js +15 -20
  35. package/dist/plugins/link-dialog/LinkDialog.js +17 -16
  36. package/dist/plugins/link-dialog/index.js +194 -216
  37. package/dist/plugins/lists/index.js +50 -65
  38. package/dist/plugins/markdown-shortcut/index.js +12 -15
  39. package/dist/plugins/quote/index.js +11 -19
  40. package/dist/plugins/sandpack/SandpackEditor.js +3 -2
  41. package/dist/plugins/sandpack/index.js +34 -50
  42. package/dist/plugins/sandpack/useCodeMirrorRef.js +7 -6
  43. package/dist/plugins/table/TableEditor.js +12 -13
  44. package/dist/plugins/table/TableNode.js +28 -0
  45. package/dist/plugins/table/index.js +32 -39
  46. package/dist/plugins/thematic-break/index.js +19 -32
  47. package/dist/plugins/toolbar/components/BlockTypeSelect.js +9 -8
  48. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -4
  49. package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +3 -2
  50. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.js +5 -5
  51. package/dist/plugins/toolbar/components/CodeToggle.js +4 -3
  52. package/dist/plugins/toolbar/components/CreateLink.js +6 -4
  53. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +5 -5
  54. package/dist/plugins/toolbar/components/InsertAdmonition.js +5 -3
  55. package/dist/plugins/toolbar/components/InsertCodeBlock.js +5 -3
  56. package/dist/plugins/toolbar/components/InsertFrontmatter.js +6 -5
  57. package/dist/plugins/toolbar/components/InsertImage.js +6 -5
  58. package/dist/plugins/toolbar/components/InsertSandpack.js +5 -4
  59. package/dist/plugins/toolbar/components/InsertTable.js +5 -3
  60. package/dist/plugins/toolbar/components/InsertThematicBreak.js +6 -4
  61. package/dist/plugins/toolbar/components/ListsToggle.js +5 -4
  62. package/dist/plugins/toolbar/components/ShowSandpackInfo.js +9 -4
  63. package/dist/plugins/toolbar/components/UndoRedo.js +3 -3
  64. package/dist/plugins/toolbar/index.js +15 -31
  65. package/dist/plugins/toolbar/primitives/DialogButton.js +23 -24
  66. package/dist/plugins/toolbar/primitives/TooltipWrap.js +3 -2
  67. package/dist/plugins/toolbar/primitives/select.js +5 -4
  68. package/dist/plugins/toolbar/primitives/toolbar.js +10 -4
  69. package/dist/style.css +935 -571
  70. package/dist/styles/globals.css.js +1 -4
  71. package/dist/styles/lexical-theme.module.css.js +25 -19
  72. package/dist/styles/ui.module.css.js +103 -103
  73. package/package.json +64 -317
  74. package/dist/FormatConstants.d.ts +0 -9
  75. package/dist/MDXEditor.d.ts +0 -103
  76. package/dist/directive-editors/AdmonitionDirectiveDescriptor.d.ts +0 -17
  77. package/dist/directive-editors/GenericDirectiveEditor.d.ts +0 -8
  78. package/dist/exportMarkdownFromLexical.d.ts +0 -138
  79. package/dist/gurx/index.d.ts +0 -3
  80. package/dist/gurx/react.d.ts +0 -152
  81. package/dist/gurx/react.js +0 -206
  82. package/dist/gurx/realm.d.ts +0 -148
  83. package/dist/gurx/realm.js +0 -489
  84. package/dist/gurx/realmFactory.d.ts +0 -79
  85. package/dist/gurx/realmFactory.js +0 -32
  86. package/dist/importMarkdownToLexical.d.ts +0 -101
  87. package/dist/jsx-editors/GenericJsxEditor.d.ts +0 -8
  88. package/dist/plugins/codeblock/CodeBlockNode.d.ts +0 -100
  89. package/dist/plugins/codeblock/CodeBlockVisitor.d.ts +0 -4
  90. package/dist/plugins/codeblock/MdastCodeVisitor.d.ts +0 -3
  91. package/dist/plugins/codeblock/index.d.ts +0 -787
  92. package/dist/plugins/codemirror/CodeMirrorEditor.d.ts +0 -3
  93. package/dist/plugins/codemirror/index.d.ts +0 -1038
  94. package/dist/plugins/core/GenericHTMLNode.d.ts +0 -38
  95. package/dist/plugins/core/Icon.d.ts +0 -6
  96. package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +0 -4
  97. package/dist/plugins/core/LexicalLinebreakVisitor.d.ts +0 -4
  98. package/dist/plugins/core/LexicalParagraphVisitor.d.ts +0 -4
  99. package/dist/plugins/core/LexicalRootVisitor.d.ts +0 -4
  100. package/dist/plugins/core/LexicalTextVisitor.d.ts +0 -5
  101. package/dist/plugins/core/MdastBreakVisitor.d.ts +0 -3
  102. package/dist/plugins/core/MdastFormattingVisitor.d.ts +0 -4
  103. package/dist/plugins/core/MdastHTMLNode.d.ts +0 -13
  104. package/dist/plugins/core/MdastHTMLVisitor.d.ts +0 -3
  105. package/dist/plugins/core/MdastInlineCodeVisitor.d.ts +0 -3
  106. package/dist/plugins/core/MdastParagraphVisitor.d.ts +0 -3
  107. package/dist/plugins/core/MdastRootVisitor.d.ts +0 -3
  108. package/dist/plugins/core/MdastTextVisitor.d.ts +0 -3
  109. package/dist/plugins/core/NestedLexicalEditor.d.ts +0 -92
  110. package/dist/plugins/core/PropertyPopover.d.ts +0 -23
  111. package/dist/plugins/core/SharedHistoryPlugin.d.ts +0 -2
  112. package/dist/plugins/core/index.d.ts +0 -583
  113. package/dist/plugins/core/ui/DownshiftAutoComplete.d.ts +0 -15
  114. package/dist/plugins/core/ui/PopoverUtils.d.ts +0 -4
  115. package/dist/plugins/diff-source/DiffSourceWrapper.d.ts +0 -4
  116. package/dist/plugins/diff-source/DiffViewer.d.ts +0 -2
  117. package/dist/plugins/diff-source/SourceEditor.d.ts +0 -4
  118. package/dist/plugins/diff-source/index.d.ts +0 -725
  119. package/dist/plugins/directives/DirectiveNode.d.ts +0 -51
  120. package/dist/plugins/directives/DirectiveVisitor.d.ts +0 -4
  121. package/dist/plugins/directives/MdastDirectiveVisitor.d.ts +0 -3
  122. package/dist/plugins/directives/index.d.ts +0 -773
  123. package/dist/plugins/frontmatter/FrontmatterEditor.d.ts +0 -6
  124. package/dist/plugins/frontmatter/FrontmatterNode.d.ts +0 -35
  125. package/dist/plugins/frontmatter/LexicalFrontmatterVisitor.d.ts +0 -4
  126. package/dist/plugins/frontmatter/MdastFrontmatterVisitor.d.ts +0 -3
  127. package/dist/plugins/frontmatter/index.d.ts +0 -717
  128. package/dist/plugins/headings/LexicalHeadingVisitor.d.ts +0 -4
  129. package/dist/plugins/headings/MdastHeadingVisitor.d.ts +0 -3
  130. package/dist/plugins/headings/index.d.ts +0 -707
  131. package/dist/plugins/image/ImageDialog.d.ts +0 -2
  132. package/dist/plugins/image/ImageEditor.d.ts +0 -10
  133. package/dist/plugins/image/ImageNode.d.ts +0 -65
  134. package/dist/plugins/image/ImageResizer.d.ts +0 -18
  135. package/dist/plugins/image/LexicalImageVisitor.d.ts +0 -4
  136. package/dist/plugins/image/MdastImageVisitor.d.ts +0 -6
  137. package/dist/plugins/image/index.d.ts +0 -804
  138. package/dist/plugins/jsx/LexicalJsxNode.d.ts +0 -54
  139. package/dist/plugins/jsx/LexicalJsxVisitor.d.ts +0 -4
  140. package/dist/plugins/jsx/MdastMdxJsEsmVisitor.d.ts +0 -3
  141. package/dist/plugins/jsx/MdastMdxJsxElementVisitor.d.ts +0 -3
  142. package/dist/plugins/jsx/index.d.ts +0 -779
  143. package/dist/plugins/link/AutoLinkPlugin.d.ts +0 -9
  144. package/dist/plugins/link/LexicalLinkVisitor.d.ts +0 -4
  145. package/dist/plugins/link/MdastLinkVisitor.d.ts +0 -3
  146. package/dist/plugins/link/index.d.ts +0 -101
  147. package/dist/plugins/link-dialog/LinkDialog.d.ts +0 -16
  148. package/dist/plugins/link-dialog/index.d.ts +0 -670
  149. package/dist/plugins/lists/LexicalListItemVisitor.d.ts +0 -4
  150. package/dist/plugins/lists/LexicalListVisitor.d.ts +0 -4
  151. package/dist/plugins/lists/MdastListItemVisitor.d.ts +0 -3
  152. package/dist/plugins/lists/MdastListVisitor.d.ts +0 -3
  153. package/dist/plugins/lists/index.d.ts +0 -703
  154. package/dist/plugins/markdown-shortcut/index.d.ts +0 -80
  155. package/dist/plugins/quote/LexicalQuoteVisitor.d.ts +0 -4
  156. package/dist/plugins/quote/MdastBlockQuoteVisitor.d.ts +0 -3
  157. package/dist/plugins/quote/index.d.ts +0 -480
  158. package/dist/plugins/sandpack/SandpackEditor.d.ts +0 -7
  159. package/dist/plugins/sandpack/index.d.ts +0 -1077
  160. package/dist/plugins/sandpack/useCodeMirrorRef.d.ts +0 -4
  161. package/dist/plugins/table/LexicalTableVisitor.d.ts +0 -4
  162. package/dist/plugins/table/MdastTableVisitor.d.ts +0 -3
  163. package/dist/plugins/table/TableEditor.d.ts +0 -21
  164. package/dist/plugins/table/TableNode.d.ts +0 -52
  165. package/dist/plugins/table/index.d.ts +0 -704
  166. package/dist/plugins/thematic-break/LexicalThematicBreakVisitor.d.ts +0 -4
  167. package/dist/plugins/thematic-break/MdastThematicBreakVisitor.d.ts +0 -3
  168. package/dist/plugins/thematic-break/index.d.ts +0 -693
  169. package/dist/plugins/toolbar/components/BlockTypeSelect.d.ts +0 -6
  170. package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.d.ts +0 -5
  171. package/dist/plugins/toolbar/components/ChangeAdmonitionType.d.ts +0 -6
  172. package/dist/plugins/toolbar/components/ChangeCodeMirrorLanguage.d.ts +0 -7
  173. package/dist/plugins/toolbar/components/CodeToggle.d.ts +0 -6
  174. package/dist/plugins/toolbar/components/CreateLink.d.ts +0 -6
  175. package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.d.ts +0 -18
  176. package/dist/plugins/toolbar/components/InsertAdmonition.d.ts +0 -6
  177. package/dist/plugins/toolbar/components/InsertCodeBlock.d.ts +0 -7
  178. package/dist/plugins/toolbar/components/InsertFrontmatter.d.ts +0 -6
  179. package/dist/plugins/toolbar/components/InsertImage.d.ts +0 -6
  180. package/dist/plugins/toolbar/components/InsertSandpack.d.ts +0 -6
  181. package/dist/plugins/toolbar/components/InsertTable.d.ts +0 -6
  182. package/dist/plugins/toolbar/components/InsertThematicBreak.d.ts +0 -6
  183. package/dist/plugins/toolbar/components/KitchenSinkToolbar.d.ts +0 -7
  184. package/dist/plugins/toolbar/components/ListsToggle.d.ts +0 -7
  185. package/dist/plugins/toolbar/components/ShowSandpackInfo.d.ts +0 -7
  186. package/dist/plugins/toolbar/components/UndoRedo.d.ts +0 -5
  187. package/dist/plugins/toolbar/index.d.ts +0 -564
  188. package/dist/plugins/toolbar/primitives/DialogButton.d.ts +0 -40
  189. package/dist/plugins/toolbar/primitives/TooltipWrap.d.ts +0 -8
  190. package/dist/plugins/toolbar/primitives/select.d.ts +0 -50
  191. package/dist/plugins/toolbar/primitives/toolbar.d.ts +0 -163
  192. package/dist/styles/lexicalTheme.d.ts +0 -2
  193. package/dist/utils/detectMac.d.ts +0 -3
  194. package/dist/utils/fp.d.ts +0 -47
  195. package/dist/utils/isPartOftheEditorUI.d.ts +0 -1
  196. package/dist/utils/lexicalHelpers.d.ts +0 -11
  197. package/dist/utils/makeHslTransparent.d.ts +0 -1
  198. package/dist/utils/mergeStyleAttributes.d.ts +0 -1
  199. package/dist/utils/uuid4.d.ts +0 -1
  200. package/dist/utils/voidEmitter.d.ts +0 -14
  201. package/dist/utils/whitespaceConversion.d.ts +0 -2
  202. package/dist/utils/whitespaceConversion.js +0 -9
package/dist/index.d.ts CHANGED
@@ -1,62 +1,2590 @@
1
- /**
2
- * The `@mdxeditor/editor` package exports the MDXEditor React component and a set of plugins and pre-made components for custom editing/editor chrome.
3
- * @packageDocumentation
4
- */
5
- export * from './MDXEditor';
6
- export * from './importMarkdownToLexical';
7
- export * from './exportMarkdownFromLexical';
8
- export * from './plugins/core';
9
- export * from './plugins/headings';
10
- export * from './plugins/thematic-break';
11
- export * from './plugins/lists';
12
- export * from './plugins/table';
13
- export * from './plugins/link';
14
- export * from './plugins/image';
15
- export * from './plugins/frontmatter';
16
- export * from './plugins/quote';
17
- export * from './plugins/jsx';
18
- export * from './jsx-editors/GenericJsxEditor';
19
- export * from './plugins/sandpack';
20
- export * from './plugins/codemirror';
21
- export * from './plugins/codemirror/CodeMirrorEditor';
22
- export * from './plugins/codeblock';
23
- export * from './plugins/directives';
24
- export * from './directive-editors/AdmonitionDirectiveDescriptor';
25
- export * from './directive-editors/GenericDirectiveEditor';
26
- export * from './plugins/link-dialog';
27
- export * from './plugins/toolbar';
28
- export * from './plugins/diff-source';
29
- export * from './plugins/markdown-shortcut';
30
- export * from './plugins/toolbar/components/BlockTypeSelect';
31
- export * from './plugins/toolbar/components/BoldItalicUnderlineToggles';
32
- export * from './plugins/toolbar/components/ChangeAdmonitionType';
33
- export * from './plugins/toolbar/components/ChangeCodeMirrorLanguage';
34
- export * from './plugins/toolbar/components/CodeToggle';
35
- export * from './plugins/toolbar/components/CreateLink';
36
- export * from './plugins/toolbar/components/DiffSourceToggleWrapper';
37
- export * from './plugins/toolbar/components/InsertAdmonition';
38
- export * from './plugins/toolbar/components/InsertCodeBlock';
39
- export * from './plugins/toolbar/components/InsertFrontmatter';
40
- export * from './plugins/toolbar/components/InsertImage';
41
- export * from './plugins/toolbar/components/InsertSandpack';
42
- export * from './plugins/toolbar/components/InsertTable';
43
- export * from './plugins/toolbar/components/InsertThematicBreak';
44
- export * from './plugins/toolbar/components/ListsToggle';
45
- export * from './plugins/toolbar/components/ShowSandpackInfo';
46
- export * from './plugins/toolbar/components/UndoRedo';
47
- export * from './plugins/toolbar/components/KitchenSinkToolbar';
48
- export * from './plugins/toolbar/primitives/toolbar';
49
- export * from './plugins/toolbar/primitives/DialogButton';
50
- export * from './plugins/toolbar/primitives/TooltipWrap';
51
- export * from './plugins/toolbar/primitives/select';
52
- export * from './plugins/core/NestedLexicalEditor';
53
- export * from './plugins/core/PropertyPopover';
54
- export * from './utils/detectMac';
55
- export * from './utils/fp';
56
- export * from './utils/isPartOftheEditorUI';
57
- export * from './utils/lexicalHelpers';
58
- export * from './utils/makeHslTransparent';
59
- export * from './utils/uuid4';
60
- export * from './utils/voidEmitter';
61
- export * from './utils/whitespaceConversion';
62
- export * from './gurx';
1
+ /**
2
+ * The `@mdxeditor/editor` package exports the MDXEditor React component and a set of plugins and
3
+ * pre-made components for editing/editor UI.
4
+ *
5
+ * The API Reference is organized around the various features of the editor. Usually, each feature is implemented as a plugin.
6
+ *
7
+ * Several note-worthy types of exports are available:
8
+ *
9
+ * **dollar-suffixed variables** (e.g. `markdown$`, `applyBlockType$`, etc.). These are [reactive Gurx primitives (Cells and Signals)](https://mdx-editor.github.io/gurx/)
10
+ * which let you interact with the editor state and extend it with your own custom logic.
11
+ *
12
+ * The MDXEditor package re-exports Gurx's React hooks, so you can use them like this for example:
13
+ * ```tsx
14
+ * // use the markdown$ cell to get the current markdown value,
15
+ * // and the rootEditor$ cell to get the Lexical editor instance.
16
+ * const [markdown, rootEditor] = useCellValues([markdown$, rootEditor$])
17
+ * // use the applyBlockType$ signal to apply a block type to the current selection
18
+ * const applyBlockType = usePublisher(applyBlockType$)
19
+ * ```
20
+ *
21
+ * **dollar-prefixed functions** (e.g. `$isCodeBlockNode`, etc.). These are following the conventions of the Lexical API, and are usually usable within the Lexical editor read/update cycles.
22
+ *
23
+ * **`plugin` functions** - these are functions that return a plugin object that can be passed to the `plugins` prop of the MDXEditor component. They usually accept a set of configuration options specific to the features they provide.
24
+ *
25
+ * **MDAST Nodes, Lexical Nodes and Import/Export visitors** - these are part of the bi-directional Markdown to/from Lexical state conversion API.
26
+ *
27
+ * **Toolbar plugins and primitives** - React components that can be used in the Editor toolbar. The primitives are meant to be used to build your own toolbar items.
28
+ *
29
+ * @packageDocumentation
30
+ */
31
+
32
+ /// <reference types="react" />
33
+
34
+ import { Config } from 'mdast-util-from-markdown/lib';
35
+ import { DecoratorNode } from 'lexical';
36
+ import { Directives } from 'mdast-util-directive';
37
+ import { DOMConversionMap } from 'lexical';
38
+ import { DOMExportOutput } from 'lexical';
39
+ import { EditorConfig } from 'lexical';
40
+ import { ElementNode } from 'lexical';
41
+ import { Extension } from 'micromark-util-types';
42
+ import { Extension as Extension_2 } from '@codemirror/state';
43
+ import { HeadingTagType } from '@lexical/rich-text';
44
+ import { HistoryState } from '@lexical/history';
45
+ import { InitialEditorStateType } from '@lexical/react/LexicalComposer.js';
46
+ import { Klass } from 'lexical';
47
+ import { LexicalCommand } from 'lexical';
48
+ import { LexicalEditor } from 'lexical';
49
+ import { LexicalNode } from 'lexical';
50
+ import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin.js';
51
+ import { ListType } from '@lexical/list';
52
+ import * as Mdast from 'mdast';
53
+ import { MdxJsxAttribute } from 'mdast-util-mdx-jsx';
54
+ import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
55
+ import { MdxJsxTextElement } from 'mdast-util-mdx-jsx';
56
+ import { Node as Node_2 } from 'unist';
57
+ import { NodeKey } from 'lexical';
58
+ import { NodeRef } from '@mdxeditor/gurx';
59
+ import { Options } from 'mdast-util-from-markdown';
60
+ import { Options as Options_2 } from 'mdast-util-to-markdown/lib/types';
61
+ import { ParseOptions } from 'micromark-util-types';
62
+ import * as RadixToolbar from '@radix-ui/react-toolbar';
63
+ import { RangeSelection } from 'lexical';
64
+ import { default as React_2 } from 'react';
65
+ import { ReactNode } from 'react';
66
+ import { Realm } from '@mdxeditor/gurx';
67
+ import { RootNode } from 'lexical';
68
+ import { SandpackProvider } from '@codesandbox/sandpack-react';
69
+ import { SerializedElementNode } from 'lexical';
70
+ import { SerializedLexicalNode } from 'lexical';
71
+ import { Spread } from 'lexical';
72
+ import { TextFormatType } from 'lexical';
73
+ import { TextNode } from 'lexical';
74
+ import { Options as ToMarkdownOptions } from 'mdast-util-to-markdown';
75
+
76
+ /**
77
+ * Creates a {@link CodeBlockNode}.
78
+ * @param options - The code contents, the language (i.e. js, jsx, etc.), and the additional meta data of the block.
79
+ * @group Code Block
80
+ */
81
+ export declare function $createCodeBlockNode(options: Partial<CreateCodeBlockNodeOptions>): CodeBlockNode;
82
+
83
+ /**
84
+ * Creates an {@link DirectiveNode}. Use this instead of the constructor to follow the Lexical conventions.
85
+ * @group Directive
86
+ */
87
+ export declare function $createDirectiveNode(mdastNode: Directives, key?: NodeKey): DirectiveNode;
88
+
89
+ /**
90
+ * Creates a new {@link GenericHTMLNode} with the specified MDAST HTML node as the object to edit.
91
+ * @group HTML
92
+ */
93
+ export declare function $createGenericHTMLNode(tag: KnownHTMLTagType, type: MdxNodeType, attributes: MdxJsxAttribute[]): GenericHTMLNode;
94
+
95
+ /**
96
+ * Creates an {@link ImageNode}.
97
+ * @param params - The image attributes.
98
+ * @group Image
99
+ */
100
+ export declare function $createImageNode(params: CreateImageNodeParameters): ImageNode;
101
+
102
+ /**
103
+ * Creates a {@link TableNode}. Use this instead of the constructor to follow the Lexical conventions.
104
+ * @param mdastNode - The mdast node to create the {@link TableNode} from.
105
+ * @group Table
106
+ */
107
+ export declare function $createTableNode(mdastNode: Mdast.Table): TableNode;
108
+
109
+ /**
110
+ * Returns true if the given node is a {@link CodeBlockNode}.
111
+ * @group Code Block
112
+ */
113
+ export declare function $isCodeBlockNode(node: LexicalNode | null | undefined): node is CodeBlockNode;
114
+
115
+ /**
116
+ * Retruns true if the node is an {@link DirectiveNode}.
117
+ * @group Directive
118
+ */
119
+ export declare function $isDirectiveNode(node: LexicalNode | null | undefined): node is DirectiveNode;
120
+
121
+ /**
122
+ * Determines if the specified node is a {@link GenericHTMLNode}.
123
+ * @group HTML
124
+ */
125
+ export declare function $isGenericHTMLNode(node: LexicalNode | null | undefined): node is GenericHTMLNode;
126
+
127
+ /**
128
+ * Retruns true if the node is an {@link ImageNode}.
129
+ * @group Image
130
+ */
131
+ export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
132
+
133
+ /**
134
+ * Retruns true if the given node is a {@link TableNode}.
135
+ * @group Table
136
+ */
137
+ export declare function $isTableNode(node: LexicalNode | null | undefined): node is TableNode;
138
+
139
+ /**
140
+ * Holds a reference to the current Lexical editor instance - can be the root editor or a nested editor.
141
+ * @group Core
142
+ */
143
+ export declare const activeEditor$: NodeRef<LexicalEditor | null>;
144
+
145
+ /* Excluded from this release type: activeEditorSubscriptions$ */
146
+
147
+ /**
148
+ * The names of the plugins that are currently active.
149
+ * @group Core
150
+ */
151
+ export declare const activePlugins$: NodeRef<string[]>;
152
+
153
+ /**
154
+ * Add a plugin name to the list of active plugins.
155
+ * @group Core
156
+ */
157
+ export declare const addActivePlugin$: NodeRef<string | string[]>;
158
+
159
+ /**
160
+ * Lets you add React components to the {@link https://lexical.dev/docs/react/plugins | Lexical Composer} element.
161
+ * @group Core
162
+ */
163
+ export declare const addComposerChild$: NodeRef<React_2.ComponentType<{}> | React_2.ComponentType<{}>[]>;
164
+
165
+ /**
166
+ * Lets you add React components as wrappers around the editor.
167
+ * @group Core
168
+ */
169
+ export declare const addEditorWrapper$: NodeRef<React_2.ComponentType<{
170
+ children: React_2.ReactNode;
171
+ }> | React_2.ComponentType<{
172
+ children: React_2.ReactNode;
173
+ }>[]>;
174
+
175
+ /**
176
+ * Adds an export visitor to be used when exporting markdown from the Lexical tree.
177
+ * @group Markdown Processing
178
+ */
179
+ export declare const addExportVisitor$: NodeRef<LexicalVisitor | LexicalVisitor[]>;
180
+
181
+ /**
182
+ * Registers a visitor to be used when importing markdown.
183
+ * @group Markdown Processing
184
+ */
185
+ export declare const addImportVisitor$: NodeRef<MdastImportVisitor<Mdast.RootContent> | MdastImportVisitor<Mdast.RootContent>[]>;
186
+
187
+ /**
188
+ * Registers a lexical node to be used in the editor.
189
+ * @group Core
190
+ */
191
+ export declare const addLexicalNode$: NodeRef<Klass<LexicalNode> | Klass<LexicalNode>[]>;
192
+
193
+ /**
194
+ * Adds a mdast extension to the markdown parser.
195
+ * @group Markdown Processing
196
+ */
197
+ export declare const addMdastExtension$: NodeRef<Partial<Config> | Partial<Config>[] | (Partial<Config> | Partial<Config>[])[]>;
198
+
199
+ /**
200
+ * Lets you add React components as children of any registered nested editor (useful for Lexical plugins).
201
+ * @group Core
202
+ */
203
+ export declare const addNestedEditorChild$: NodeRef<React_2.ComponentType<{}> | React_2.ComponentType<{}>[]>;
204
+
205
+ /**
206
+ * Adds a syntax extension to the markdown parser.
207
+ * @group Markdown Processing
208
+ */
209
+ export declare const addSyntaxExtension$: NodeRef<Extension | Extension[]>;
210
+
211
+ /**
212
+ * Adds a markdown to string extension to be used when exporting markdown from the Lexical tree.
213
+ * @group Markdown Processing
214
+ */
215
+ export declare const addToMarkdownExtension$: NodeRef<Options_2 | Options_2[]>;
216
+
217
+ /**
218
+ * Lets you add React components on top of the editor (like the toolbar).
219
+ * @group Core
220
+ */
221
+ export declare const addTopAreaChild$: NodeRef<React_2.ComponentType<{}> | React_2.ComponentType<{}>[]>;
222
+
223
+ /* Excluded from this release type: ADMONITION_TYPES */
224
+
225
+ /**
226
+ * Pass this descriptor to the `directivesPlugin` `directiveDescriptors` parameter to enable {@link https://docusaurus.io/docs/markdown-features/admonitions | markdown admonitions}.
227
+ *
228
+ * @example
229
+ * ```tsx
230
+ * <MDXEditor
231
+ * plugins={[
232
+ * directivesPlugin({ directiveDescriptors: [ AdmonitionDirectiveDescriptor] }),
233
+ * ]} />
234
+ * ```
235
+ * @group Directive
236
+ */
237
+ export declare const AdmonitionDirectiveDescriptor: DirectiveDescriptor;
238
+
239
+ /* Excluded from this release type: AdmonitionKind */
240
+
241
+ /**
242
+ * @group Headings
243
+ */
244
+ export declare const ALL_HEADING_LEVELS: readonly [1, 2, 3, 4, 5, 6];
245
+
246
+ /**
247
+ * Holds the allowed heading levels.
248
+ * @group Headings
249
+ */
250
+ export declare const allowedHeadingLevels$: NodeRef<readonly HEADING_LEVEL[]>;
251
+
252
+ /**
253
+ * returns a function which when called always returns the passed value
254
+ * @group Utils
255
+ */
256
+ export declare function always<T>(value: T): () => T;
257
+
258
+ /**
259
+ * A signal that appends a code block editor descriptor to the list of descriptors.
260
+ * @group Code Block
261
+ */
262
+ export declare const appendCodeBlockEditorDescriptor$: NodeRef<CodeBlockEditorDescriptor | CodeBlockEditorDescriptor[]>;
263
+
264
+ /* Excluded from this release type: Appender */
265
+
266
+ /**
267
+ * Allows you to change the block type of the current selection.
268
+ * @group Core
269
+ */
270
+ export declare const applyBlockType$: NodeRef<BlockType>;
271
+
272
+ /**
273
+ * Applies the published format to the current selection.
274
+ * @group Core
275
+ */
276
+ export declare const applyFormat$: NodeRef<TextFormatType>;
277
+
278
+ /**
279
+ * A signal that confirms the updated values of the current link.
280
+ * @group Link Dialog
281
+ */
282
+ export declare const applyLinkChanges$: NodeRef<void>;
283
+
284
+ /**
285
+ * Converts the current selection to the specified list type.
286
+ * @group Lists
287
+ */
288
+ export declare const applyListType$: NodeRef<"" | ListType>;
289
+
290
+ /* Excluded from this release type: autoFocus$ */
291
+
292
+ /**
293
+ * The type of the block that the current selection is in.
294
+ * @group Core
295
+ */
296
+ export declare type BlockType = 'paragraph' | 'quote' | HeadingTagType | '';
297
+
298
+ /**
299
+ * A toolbar component that allows the user to change the block type of the current selection.
300
+ * Supports paragraphs, headings and block quotes.
301
+ * @group Toolbar Components
302
+ */
303
+ export declare const BlockTypeSelect: () => React_2.JSX.Element | null;
304
+
305
+ /**
306
+ * A toolbar component that lets the user toggle bold, italic and underline formatting.
307
+ * @group Toolbar Components
308
+ */
309
+ export declare const BoldItalicUnderlineToggles: React_2.FC;
310
+
311
+ /**
312
+ * A toolbar button primitive.
313
+ * @group Toolbar Primitives
314
+ */
315
+ export declare const Button: React_2.ForwardRefExoticComponent<Omit<RadixToolbar.ToolbarButtonProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<object>>;
316
+
317
+ /**
318
+ * Use this primitive to create a toolbar button that can be either a button or a dropdown, depending on the number of items passed.
319
+ * @group Toolbar Primitives
320
+ */
321
+ export declare const ButtonOrDropdownButton: <T extends string>(props: {
322
+ /**
323
+ * The contents of the button - usually an icon.
324
+ */
325
+ children: React_2.ReactNode;
326
+ /**
327
+ * The title used for the tooltip.
328
+ */
329
+ title: string;
330
+ /**
331
+ * The function to execute when the button is clicked or an item is chosen from the dropdown.
332
+ * If there is only one item in the dropdown, the value will be an empty string.
333
+ */
334
+ onChoose: (value: T) => void;
335
+ /**
336
+ * The items to show in the dropdown.
337
+ */
338
+ items: {
339
+ /**
340
+ * The value to pass to the `onChoose` function when this item is chosen.
341
+ */
342
+ value: T;
343
+ /**
344
+ * The label to show in the dropdown.
345
+ */
346
+ label: string | JSX.Element;
347
+ }[];
348
+ }) => React_2.JSX.Element;
349
+
350
+ /**
351
+ * A toolbar button with tooltip primitive.
352
+ * @group Toolbar Primitives
353
+ */
354
+ export declare const ButtonWithTooltip: ({ title, children, ...props }: Omit<RadixToolbar.ToolbarButtonProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<object> & {
355
+ title: string;
356
+ }) => React_2.JSX.Element;
357
+
358
+ /**
359
+ * Calls the passed function.
360
+ * @group Utils
361
+ */
362
+ export declare function call(proc: () => unknown): void;
363
+
364
+ /* Excluded from this release type: CAN_USE_DOM */
365
+
366
+ /**
367
+ * An action that cancel the edit of the current link.
368
+ * @group Link Dialog
369
+ */
370
+ export declare const cancelLinkEdit$: NodeRef<void>;
371
+
372
+ /**
373
+ * A component that allows the user to change the admonition type of the current selection.
374
+ * For this component to work, you must pass the {@link AdmonitionDirectiveDescriptor} to the `directivesPlugin` `directiveDescriptors` parameter.
375
+ * @group Toolbar Components
376
+ */
377
+ export declare const ChangeAdmonitionType: () => React_2.JSX.Element;
378
+
379
+ /**
380
+ * A component that allows the user to change the code block language of the current selection.
381
+ * For this component to work, you must enable the `codeMirrorPlugin` for the editor.
382
+ * See {@link ConditionalContents} for an example on how to display the dropdown only when a code block is in focus.
383
+ * @group Toolbar Components
384
+ */
385
+ export declare const ChangeCodeMirrorLanguage: () => React_2.JSX.Element;
386
+
387
+ /**
388
+ * Close the image dialog.
389
+ * @group Image
390
+ */
391
+ export declare const closeImageDialog$: NodeRef<void>;
392
+
393
+ /* Excluded from this release type: cmExtensions$ */
394
+
395
+ /**
396
+ * A set of functions that modify the underlying code block node.
397
+ * Access this with the {@link useCodeBlockEditorContext} hook in your custom code editor components.
398
+ * @group Code Block
399
+ */
400
+ export declare interface CodeBlockEditorContextValue {
401
+ /**
402
+ * Updates the code contents of the code block.
403
+ */
404
+ setCode: (code: string) => void;
405
+ /**
406
+ * Updates the language of the code block. See {@link https://www.markdownguide.org/extended-syntax/#syntax-highlighting} for language examples.
407
+ *
408
+ */
409
+ setLanguage: (language: string) => void;
410
+ /**
411
+ * Updates the meta of the code block. The meta is the additional string that comes after the code block language.
412
+ */
413
+ setMeta: (meta: string) => void;
414
+ /**
415
+ * The Lexical node that's being edited.
416
+ */
417
+ lexicalNode: CodeBlockNode;
418
+ }
419
+
420
+ /**
421
+ * Implement this interface to create a custom code block editor.
422
+ * Pass the object in the {@link codeBlockPlugin} parameters.
423
+ * @group Code Block
424
+ */
425
+ export declare interface CodeBlockEditorDescriptor {
426
+ /**
427
+ * The priority of the descriptor when descriptors are matched against a given code block. Lower number means lower priority.
428
+ * This allows you to implement a catch-all generic editor and a more specific editor for a given language / meta.
429
+ */
430
+ priority: number;
431
+ /**
432
+ * A function that returns true if the descriptor's editor should be used for the given code block.
433
+ * @param language - The language of the code block.
434
+ * @param meta - The meta of the code block.
435
+ */
436
+ match: (language: string, meta: string) => boolean;
437
+ /**
438
+ * The React component to be used. See {@link CodeBlockEditorProps} for the props passed to the component.
439
+ */
440
+ Editor: React.ComponentType<CodeBlockEditorProps>;
441
+ }
442
+
443
+ /**
444
+ * Contains the currently registered code block descriptors.
445
+ * @group Code Block
446
+ */
447
+ export declare const codeBlockEditorDescriptors$: NodeRef<CodeBlockEditorDescriptor[]>;
448
+
449
+ /**
450
+ * The properties passed to the {@link CodeBlockEditorDescriptor.Editor} component.
451
+ * @group Code Block
452
+ */
453
+ export declare interface CodeBlockEditorProps {
454
+ /**
455
+ * The code to edit.
456
+ */
457
+ code: string;
458
+ /**
459
+ * The language of the fenced code block.
460
+ */
461
+ language: string;
462
+ /**
463
+ * The meta of the fenced code block.
464
+ */
465
+ meta: string;
466
+ /**
467
+ * The key of the Lexical node - use this if you are dealing with the Lexical APIs.
468
+ */
469
+ nodeKey: string;
470
+ /**
471
+ * An emitter that will execute its subscription when the editor should be focused.
472
+ * Note: you don't need to unsubscribe, the emiter has a single subscription model.
473
+ */
474
+ focusEmitter: VoidEmitter;
475
+ }
476
+
477
+ /**
478
+ * The codemirror code block languages.
479
+ * @group CodeMirror
480
+ */
481
+ export declare const codeBlockLanguages$: NodeRef<{
482
+ js: string;
483
+ ts: string;
484
+ tsx: string;
485
+ jsx: string;
486
+ css: string;
487
+ }>;
488
+
489
+ /**
490
+ * A lexical node that represents a fenced code block. Use {@link "$createCodeBlockNode"} to construct one.
491
+ * @group Code Block
492
+ */
493
+ export declare class CodeBlockNode extends DecoratorNode<JSX.Element> {
494
+ __code: string;
495
+ __meta: string;
496
+ __language: string;
497
+ __focusEmitter: {
498
+ publish: () => void;
499
+ subscribe: (cb: () => void) => void;
500
+ };
501
+ static getType(): string;
502
+ static clone(node: CodeBlockNode): CodeBlockNode;
503
+ static importJSON(serializedNode: SerializedCodeBlockNode): CodeBlockNode;
504
+ constructor(code: string, language: string, meta: string, key?: NodeKey);
505
+ exportJSON(): SerializedCodeBlockNode;
506
+ createDOM(_config: EditorConfig): HTMLDivElement;
507
+ updateDOM(): false;
508
+ getCode(): string;
509
+ getMeta(): string;
510
+ getLanguage(): string;
511
+ setCode: (code: string) => void;
512
+ setMeta: (meta: string) => void;
513
+ setLanguage: (language: string) => void;
514
+ select: () => void;
515
+ decorate(editor: LexicalEditor): JSX.Element;
516
+ isInline(): boolean;
517
+ }
518
+
519
+ /**
520
+ * A plugin that adds support for code blocks and custom code block editors.
521
+ * @group Code Block
522
+ */
523
+ export declare const codeBlockPlugin: (params?: {
524
+ /**
525
+ * Pass an array of {@link CodeBlockEditorDescriptor} to register custom code block editors.
526
+ */
527
+ codeBlockEditorDescriptors?: CodeBlockEditorDescriptor[] | undefined;
528
+ /**
529
+ * The default language to use when creating a new code block if no language is passed.
530
+ */
531
+ defaultCodeBlockLanguage?: string | undefined;
532
+ } | undefined) => RealmPlugin;
533
+
534
+ /* Excluded from this release type: CodeMirrorEditor */
535
+
536
+ /**
537
+ * A plugin that adds lets users editor code blocks with CodeMirror.
538
+ * @group CodeMirror
539
+ */
540
+ export declare const codeMirrorPlugin: (params?: {
541
+ codeBlockLanguages: Record<string, string>;
542
+ } | undefined) => RealmPlugin;
543
+
544
+ /**
545
+ * A toolbar component that lets the user toggle code formatting.
546
+ * Use for inline `code` elements (like variables, methods, etc).
547
+ * @group Toolbar Components
548
+ */
549
+ export declare const CodeToggle: React_2.FC;
550
+
551
+ /**
552
+ * Performs left to right composition of two functions.
553
+ * @group Utils
554
+ */
555
+ export declare function compose<I, A, R>(a: (arg: A) => R, b: (arg: I) => A): (arg: I) => R;
556
+
557
+ /* Excluded from this release type: composerChildren$ */
558
+
559
+ /**
560
+ * A toolbar primitive that allows you to show different contents based on the editor that is in focus.
561
+ * Useful for code editors that have different features and don't support rich text formatting.
562
+ * @example
563
+ * ```tsx
564
+ * <ConditionalContents
565
+ * options={[
566
+ * { when: (editor) => editor?.editorType === 'codeblock', contents: () => <ChangeCodeMirrorLanguage /> },
567
+ * { when: (editor) => editor?.editorType === 'sandpack', contents: () => <ShowSandpackInfo /> },
568
+ * {
569
+ * fallback: () => (
570
+ * <>
571
+ * <UndoRedo />
572
+ * <BoldItalicUnderlineToggles />
573
+ * <InsertCodeBlock />
574
+ * </>
575
+ * )
576
+ * }
577
+ * ]}
578
+ * />
579
+ * ```
580
+ * @group Toolbar Primitives
581
+ */
582
+ export declare const ConditionalContents: React_2.FC<{
583
+ /**
584
+ * A set of options that define the contents to show based on the editor that is in focus.
585
+ * Can be either a {@link ConditionalContentsOption} or a {@link FallbackOption}.
586
+ * See the {@link ConditionalContents} documentation for an example.
587
+ */
588
+ options: (ConditionalContentsOption | FallbackOption)[];
589
+ }>;
590
+
591
+ /**
592
+ * An object that describes a possible option to be displayed in the {@link ConditionalContents} component.
593
+ * @group Toolbar Primitives
594
+ */
595
+ export declare type ConditionalContentsOption = {
596
+ /**
597
+ * A function that returns `true` if the option should be displayed for the current editor in focus.
598
+ */
599
+ when: (rootNode: EditorInFocus | null) => boolean;
600
+ /**
601
+ * The contents to display if the `when` function returns `true`.
602
+ */
603
+ contents: () => React_2.ReactNode;
604
+ };
605
+
606
+ /**
607
+ * Holds the CSS class name of the content editable element.
608
+ * @group Core
609
+ */
610
+ export declare const contentEditableClassName$: NodeRef<string>;
611
+
612
+ /**
613
+ * Returns true if the user is pressing the control key on Windows or the meta key on Mac.
614
+ * @group Utils
615
+ */
616
+ export declare function controlOrMeta(metaKey: boolean, ctrlKey: boolean): boolean;
617
+
618
+ /**
619
+ * Converts the current selection to a node created by the published factory.
620
+ * @group Core
621
+ */
622
+ export declare const convertSelectionToNode$: NodeRef<() => ElementNode>;
623
+
624
+ declare type CoordinatesSubscription = (coords: [colIndex: number, rowIndex: number]) => void;
625
+
626
+ /* Excluded from this release type: corePlugin */
627
+
628
+ /**
629
+ * An input signal that lets you register a new {@link EditorSubscription} for the active editor.
630
+ * The subscriptions are automatically cleaned up and re-bound when the active editor changes.
631
+ * @example
632
+ * ```tsx
633
+ * realm.pub(createActiveEditorSubscription$, (theEditor) => {
634
+ * return theEditor.registerUpdateListener(() => { ... })
635
+ * // or a command
636
+ * // return theEditor.registerCommand('my-command', () => { ... })
637
+ * })
638
+ * ```
639
+ * @group Core
640
+ */
641
+ export declare const createActiveEditorSubscription$: NodeRef<EditorSubscription | EditorSubscription[]>;
642
+
643
+ /**
644
+ * The options necessary to construct a new code block node.
645
+ * @group Code Block
646
+ */
647
+ export declare interface CreateCodeBlockNodeOptions {
648
+ /**
649
+ * The code contents of the block.
650
+ */
651
+ code: string;
652
+ /**
653
+ * The language of the code block (i.e. `js`, `jsx`, etc.). This is used for syntax highlighting.
654
+ */
655
+ language: string;
656
+ /**
657
+ * The additional meta data of the block.
658
+ */
659
+ meta: string;
660
+ }
661
+
662
+ /**
663
+ * The parameters used to create an {@link ImageNode} through {@link $createImageNode}.
664
+ * @group Image
665
+ */
666
+ export declare interface CreateImageNodeParameters {
667
+ altText: string;
668
+ width?: number;
669
+ height?: number;
670
+ title?: string;
671
+ key?: NodeKey;
672
+ src: string;
673
+ }
674
+
675
+ /**
676
+ * A toolbar component that opens the link edit dialog.
677
+ * For this component to work, you must include the `linkDialogPlugin`.
678
+ * @group Toolbar Components
679
+ */
680
+ export declare const CreateLink: () => React_2.JSX.Element;
681
+
682
+ /**
683
+ * An input signal that lets you register a new {@link EditorSubscription} for the root editor.
684
+ * @example
685
+ * ```tsx
686
+ * realm.pub(createRootEditorSubscription$, (theEditor) => {
687
+ * return theEditor.registerUpdateListener(() => { ... })
688
+ * // or a command
689
+ * // return theEditor.registerCommand('my-command', () => { ... })
690
+ * })
691
+ * ```
692
+ * @group Core
693
+ */
694
+ export declare const createRootEditorSubscription$: NodeRef<EditorSubscription | EditorSubscription[]>;
695
+
696
+ /**
697
+ * Holds the current block type of the selection (i.e. Heading, Paragraph, etc).
698
+ * @group Core
699
+ */
700
+ export declare const currentBlockType$: NodeRef<BlockType>;
701
+
702
+ /**
703
+ * Holds the current format of the selection.
704
+ * @group Core
705
+ */
706
+ export declare const currentFormat$: NodeRef<number>;
707
+
708
+ /**
709
+ * The current list type in the editor.
710
+ * @group Lists
711
+ */
712
+ export declare const currentListType$: NodeRef<"" | ListType>;
713
+
714
+ /**
715
+ * Holds the current selection.
716
+ * @group Core
717
+ */
718
+ export declare const currentSelection$: NodeRef<RangeSelection | null>;
719
+
720
+ /**
721
+ * Takes a 1 argument function and returns a function which when called, executes it with the provided argument.
722
+ * @group Utils
723
+ */
724
+ export declare function curry1to0<T, R>(proc: (arg: T) => R, arg: T): () => R;
725
+
726
+ /**
727
+ * Takes a 2 argument function and partially applies the first argument.
728
+ * @group Utils
729
+ */
730
+ export declare function curry2to1<T, K, R>(proc: (arg1: T, arg2: K) => R, arg1: T): (arg2: K) => R;
731
+
732
+ /**
733
+ * Contains the default language to use when creating a new code block if no language is passed.
734
+ * @group Code Block
735
+ */
736
+ export declare const defaultCodeBlockLanguage$: NodeRef<string>;
737
+
738
+ /**
739
+ * Use this primitive to create a toolbar button that opens a dialog with a text input, autocomplete suggestions, and a submit button.
740
+ * @group Toolbar Primitives
741
+ */
742
+ export declare const DialogButton: React_2.ForwardRefExoticComponent<{
743
+ /**
744
+ * The autocomplete suggestions to show in the dialog input.
745
+ */
746
+ autocompleteSuggestions?: string[] | undefined;
747
+ /**
748
+ * The callback to call when the dialog is submitted. The callback receives the value of the text input as a parameter.
749
+ */
750
+ onSubmit: (value: string) => void;
751
+ /**
752
+ * The title to show in the tooltip of the toolbar button.
753
+ */
754
+ tooltipTitle: string;
755
+ /**
756
+ * The contents of the button. Usually an icon.
757
+ * @example
758
+ * ```tsx
759
+ * <DialogButton buttonContent={<CustomIcon />} />
760
+ * ```
761
+ */
762
+ buttonContent?: React_2.ReactNode;
763
+ /**
764
+ * The placeholder text to show in the dialog input.
765
+ */
766
+ dialogInputPlaceholder: string;
767
+ /**
768
+ * The title of the submit button.
769
+ */
770
+ submitButtonTitle: string;
771
+ } & React_2.RefAttributes<HTMLButtonElement>>;
772
+
773
+ /* Excluded from this release type: diffMarkdown$ */
774
+
775
+ /**
776
+ * @group Diff/Source
777
+ */
778
+ export declare const diffSourcePlugin: (params?: {
779
+ /**
780
+ * The initial view mode of the editor.
781
+ * @default 'rich-text'
782
+ */
783
+ viewMode?: ViewMode | undefined;
784
+ /**
785
+ * The markdown to show in the diff editor.
786
+ * @default ''
787
+ */
788
+ diffMarkdown?: string | undefined;
789
+ /**
790
+ * Optional, additional CodeMirror extensions to load in the diff/source mode.
791
+ */
792
+ codeMirrorExtensions?: Extension_2[] | undefined;
793
+ } | undefined) => RealmPlugin;
794
+
795
+ /**
796
+ * A wrapper element for the toolbar contents that lets the user toggle between rich text, diff and source mode.
797
+ * Put the rich text toolbar contents as children of this component.
798
+ * For this component to work, you must include the `diffSourcePlugin`.
799
+ *
800
+ * @example
801
+ * ```tsx
802
+ * <MDXEditor markdown='Hello world'
803
+ * plugins={[toolbarPlugin({
804
+ * toolbarContents: () => ( <> <DiffSourceToggleWrapper><UndoRedo /><BoldItalicUnderlineToggles /></DiffSourceToggleWrapper></>)
805
+ * }), diffSourcePlugin()]}
806
+ * />
807
+ * ```
808
+ *
809
+ * @group Toolbar Components
810
+ */
811
+ export declare const DiffSourceToggleWrapper: React_2.FC<{
812
+ children: React_2.ReactNode;
813
+ }>;
814
+
815
+ /**
816
+ * Implement this interface to create a custom editor for markdown directives.
817
+ * Pass the object in the `directivesPlugin` parameters.
818
+ * @group Directive
819
+ */
820
+ export declare interface DirectiveDescriptor<T extends Directives = Directives> {
821
+ /**
822
+ * Whether the descriptor's Editor should be used for the given node.
823
+ * @param node - The directive mdast node. You can code your logic against the node's name, type, attributes, children, etc.
824
+ */
825
+ testNode(node: Directives): boolean;
826
+ /**
827
+ * The name of the descriptor - use this if you're building UI for the user to select a directive.
828
+ */
829
+ name: string;
830
+ /**
831
+ * The attributes that the directive has. This can be used when building the UI for the user to configure a directive. The {@link GenericDirectiveEditor} uses those to display a property form.
832
+ */
833
+ attributes: string[];
834
+ /**
835
+ * Whether or not the directive has inner markdown content as children. Used by the {@link GenericDirectiveEditor} to determine whether to show the inner markdown editor.
836
+ */
837
+ hasChildren: boolean;
838
+ /**
839
+ * The type of the supported directive. Can be one of: 'leafDirective' | 'containerDirective' | 'textDirective'.
840
+ */
841
+ type?: 'leafDirective' | 'containerDirective' | 'textDirective';
842
+ /**
843
+ * The React component to be used as an Editor. See {@link DirectiveEditorProps} for the props passed to the component.
844
+ */
845
+ Editor: React.ComponentType<DirectiveEditorProps<T>>;
846
+ }
847
+
848
+ /**
849
+ * Contains the currently registered directive descriptors.
850
+ * @group Directive
851
+ */
852
+ export declare const directiveDescriptors$: NodeRef<DirectiveDescriptor<any>[]>;
853
+
854
+ /**
855
+ * The properties passed to the {@link DirectiveDescriptor.Editor} component.
856
+ * @group Directive
857
+ */
858
+ export declare interface DirectiveEditorProps<T extends Directives = Directives> {
859
+ /**
860
+ * The mdast directive node.
861
+ */
862
+ mdastNode: T;
863
+ /**
864
+ * The parent lexical editor - use this if you are dealing with the Lexical APIs.
865
+ */
866
+ parentEditor: LexicalEditor;
867
+ /**
868
+ * The Lexical directive node.
869
+ */
870
+ lexicalNode: DirectiveNode;
871
+ /**
872
+ * The descriptor that activated the editor
873
+ */
874
+ descriptor: DirectiveDescriptor;
875
+ }
876
+
877
+ /**
878
+ * A lexical node that represents an image. Use {@link "$createDirectiveNode"} to construct one.
879
+ * @group Directive
880
+ */
881
+ export declare class DirectiveNode extends DecoratorNode<React_2.JSX.Element> {
882
+ /* Excluded from this release type: __mdastNode */
883
+ /* Excluded from this release type: __focusEmitter */
884
+ /* Excluded from this release type: getType */
885
+ /* Excluded from this release type: clone */
886
+ /* Excluded from this release type: importJSON */
887
+ /**
888
+ * Constructs a new {@link DirectiveNode} with the specified MDAST directive node as the object to edit.
889
+ */
890
+ constructor(mdastNode: Directives, key?: NodeKey);
891
+ /**
892
+ * Returns the MDAST node that is being edited.
893
+ */
894
+ getMdastNode(): Directives;
895
+ /* Excluded from this release type: exportJSON */
896
+ /* Excluded from this release type: createDOM */
897
+ /* Excluded from this release type: updateDOM */
898
+ /**
899
+ * Sets a new MDAST node to edit.
900
+ */
901
+ setMdastNode(mdastNode: Directives): void;
902
+ /**
903
+ * Focuses the direcitive editor.
904
+ */
905
+ select: () => void;
906
+ /* Excluded from this release type: decorate */
907
+ /* Excluded from this release type: isInline */
908
+ /* Excluded from this release type: isKeyboardSelectable */
909
+ }
910
+
911
+ /**
912
+ * A plugin that adds support for markdown directives.
913
+ * @group Directive
914
+ */
915
+ export declare const directivesPlugin: (params?: {
916
+ /**
917
+ * Use this to register your custom directive editors. You can also use the built-in {@link GenericDirectiveEditor}.
918
+ */
919
+ directiveDescriptors: DirectiveDescriptor<any>[];
920
+ } | undefined) => RealmPlugin;
921
+
922
+ /**
923
+ * Holds whether the auto-linking of URLs and email addresses is disabled.
924
+ * @group Links
925
+ */
926
+ export declare const disableAutoLink$: NodeRef<boolean>;
927
+
928
+ /**
929
+ * Holds the disable image resize configuration flag.
930
+ * @group Image
931
+ */
932
+ export declare const disableImageResize$: NodeRef<boolean>;
933
+
934
+ /**
935
+ * The state of the image dialog when it is in editing an existing node.
936
+ * @group Image
937
+ */
938
+ export declare type EditingImageDialogState = {
939
+ type: 'editing';
940
+ nodeKey: string;
941
+ initialValues: Omit<InsertImageParameters, 'file'>;
942
+ };
943
+
944
+ /**
945
+ * The state of the link dialog when it is in edit mode.
946
+ * @group Link Dialog
947
+ */
948
+ export declare interface EditLinkDialog {
949
+ type: 'edit';
950
+ initialUrl: string;
951
+ initialTitle?: string;
952
+ url: string;
953
+ title: string;
954
+ linkNodeKey: string;
955
+ rectangle: RectData;
956
+ }
957
+
958
+ /**
959
+ * The currently focused editor
960
+ * @group Core
961
+ */
962
+ export declare const editorInFocus$: NodeRef<EditorInFocus | null>;
963
+
964
+ /**
965
+ * The type of the editor being edited currently. Custom editors can override this, so that the toolbar can change its contents.
966
+ * @group Core
967
+ */
968
+ export declare interface EditorInFocus {
969
+ editorType: string;
970
+ rootNode: LexicalNode | null;
971
+ }
972
+
973
+ /**
974
+ * A reference to a DOM element. used for the various popups, dialogs, and tooltips
975
+ * @group Core
976
+ */
977
+ export declare const editorRootElementRef$: NodeRef<React_2.RefObject<HTMLDivElement> | null>;
978
+
979
+ /**
980
+ * A function that subscribes to Lexical editor updates or events, and retursns an unsubscribe function.
981
+ * @group Core
982
+ */
983
+ export declare type EditorSubscription = (activeEditor: LexicalEditor) => () => void;
984
+
985
+ /* Excluded from this release type: editorWrappers$ */
986
+
987
+ /* Excluded from this release type: ExportLexicalTreeOptions */
988
+
989
+ /* Excluded from this release type: exportLexicalTreeToMdast */
990
+
991
+ /* Excluded from this release type: exportMarkdownFromLexical */
992
+
993
+ /* Excluded from this release type: ExportMarkdownFromLexicalOptions */
994
+
995
+ /* Excluded from this release type: exportVisitors$ */
996
+
997
+ /**
998
+ * A default option to be displayed in the {@link ConditionalContents} component if none of the other options match.
999
+ * @group Toolbar Primitives
1000
+ */
1001
+ export declare type FallbackOption = {
1002
+ /**
1003
+ * The contents to display
1004
+ */
1005
+ fallback: () => React_2.ReactNode;
1006
+ };
1007
+
1008
+ /**
1009
+ * Fetches a value from the Lexical editor read cycle.
1010
+ * @group Utils
1011
+ */
1012
+ export declare function fromWithinEditorRead<T>(editor: LexicalEditor, fn: () => T): T;
1013
+
1014
+ /**
1015
+ * Whether the frontmatter dialog is open.
1016
+ * @group Frontmatter
1017
+ */
1018
+ export declare const frontmatterDialogOpen$: NodeRef<boolean>;
1019
+
1020
+ /**
1021
+ * A plugin that adds support for frontmatter.
1022
+ * @group Frontmatter
1023
+ */
1024
+ export declare const frontmatterPlugin: (params?: unknown) => RealmPlugin;
1025
+
1026
+ /**
1027
+ * A generic editor that can be used as an universal UI for any directive.
1028
+ * Allows editing of the directive content and properties.
1029
+ * Use this editor for the {@link DirectiveDescriptor} Editor option.
1030
+ * @group Directive
1031
+ */
1032
+ export declare const GenericDirectiveEditor: React_2.FC<DirectiveEditorProps>;
1033
+
1034
+ /**
1035
+ * A Lexical node that represents a generic HTML element. Use {@link $createGenericHTMLNode} to construct one.
1036
+ * The generic HTML node is used as a "fallback" for HTML elements that are not explicitly supported by the editor.
1037
+ * @group HTML
1038
+ */
1039
+ export declare class GenericHTMLNode extends ElementNode {
1040
+ /* Excluded from this release type: __tag */
1041
+ /* Excluded from this release type: __nodeType */
1042
+ /* Excluded from this release type: __attributes */
1043
+ /* Excluded from this release type: getType */
1044
+ /* Excluded from this release type: clone */
1045
+ /**
1046
+ * Constructs a new {@link GenericHTMLNode} with the specified MDAST HTML node as the object to edit.
1047
+ */
1048
+ constructor(tag: KnownHTMLTagType, type: MdxNodeType, attributes: MdxJsxAttribute[], key?: NodeKey);
1049
+ getTag(): KnownHTMLTagType;
1050
+ getNodeType(): MdxNodeType;
1051
+ getAttributes(): MdxJsxAttribute[];
1052
+ updateAttributes(attributes: MdxJsxAttribute[]): void;
1053
+ getStyle(): string;
1054
+ createDOM(): HTMLElement;
1055
+ updateDOM(): boolean;
1056
+ static importDOM(): DOMConversionMap | null;
1057
+ exportDOM(editor: LexicalEditor): DOMExportOutput;
1058
+ static importJSON(serializedNode: SerializedGenericHTMLNode): GenericHTMLNode;
1059
+ exportJSON(): SerializedGenericHTMLNode;
1060
+ extractWithChild(): boolean;
1061
+ isInline(): boolean;
1062
+ }
1063
+
1064
+ /**
1065
+ * A generic editor that can be used as an universal UI for any JSX element.
1066
+ * Allows editing of the element content and properties.
1067
+ * Use this editor for the {@link JsxComponentDescriptor} Editor option.
1068
+ * @group JSX
1069
+ */
1070
+ export declare const GenericJsxEditor: React_2.FC<JsxEditorProps>;
1071
+
1072
+ /**
1073
+ * Gets the selected node from the Lexical editor.
1074
+ * @group Utils
1075
+ */
1076
+ export declare function getSelectedNode(selection: RangeSelection): TextNode | ElementNode | null;
1077
+
1078
+ /**
1079
+ * Gets the coordinates of the selection in the Lexical editor.
1080
+ * @group Utils
1081
+ */
1082
+ export declare function getSelectionRectangle(editor: LexicalEditor): {
1083
+ top: number;
1084
+ left: number;
1085
+ width: number;
1086
+ height: number;
1087
+ } | null;
1088
+
1089
+ /* Excluded from this release type: getStateAsMarkdown */
1090
+
1091
+ /**
1092
+ * Whether the markdown document has a frontmatter node.
1093
+ * @group Frontmatter
1094
+ */
1095
+ export declare const hasFrontmatter$: NodeRef<boolean>;
1096
+
1097
+ /**
1098
+ * @group Headings
1099
+ */
1100
+ export declare type HEADING_LEVEL = 1 | 2 | 3 | 4 | 5 | 6;
1101
+
1102
+ /**
1103
+ * A plugin that adds support for markdown headings.
1104
+ * @group Headings
1105
+ */
1106
+ export declare const headingsPlugin: (params?: {
1107
+ /**
1108
+ * Allows you to limit the headings used in the editor. Affects the block type dropdown and the keyboard shortcuts.
1109
+ * @default [1, 2, 3, 4, 5, 6]
1110
+ */
1111
+ allowedHeadingLevels?: readonly HEADING_LEVEL[] | undefined;
1112
+ } | undefined) => RealmPlugin;
1113
+
1114
+ /* Excluded from this release type: historyState$ */
1115
+
1116
+ /**
1117
+ * All the HTML tags supported by the generic html node.
1118
+ * @group HTML
1119
+ */
1120
+ export declare const htmlTags: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
1121
+
1122
+ /**
1123
+ * A callback that returns the icon component for the given name.
1124
+ * @group Core
1125
+ */
1126
+ export declare const iconComponentFor$: NodeRef<(name: IconKey) => React_2.ReactNode>;
1127
+
1128
+ /**
1129
+ * A type that represents the possible icon names that can be used with the {@link iconComponentFor$} cell.
1130
+ * @group Core
1131
+ */
1132
+ export declare type IconKey = 'add_column' | 'add_photo' | 'add_row' | 'arrow_drop_down' | 'check' | 'check_small' | 'close' | 'code' | 'content_copy' | 'delete_big' | 'delete_small' | 'sandpack' | 'difference' | 'edit' | 'admonition' | 'extension' | 'format_align_center' | 'format_align_left' | 'format_align_right' | 'format_bold' | 'format_italic' | 'format_list_bulleted' | 'format_list_checked' | 'format_list_numbered' | 'format_underlined' | 'frame_source' | 'frontmatter' | 'horizontal_rule' | 'insert_col_left' | 'insert_col_right' | 'insert_row_above' | 'insert_row_below' | 'link' | 'link_off' | 'markdown' | 'more_horiz' | 'more_vert' | 'open_in_new' | 'redo' | 'rich_text' | 'settings' | 'table' | 'undo';
1133
+
1134
+ /**
1135
+ * Holds the autocomplete suggestions for image sources.
1136
+ * @group Image
1137
+ */
1138
+ export declare const imageAutocompleteSuggestions$: NodeRef<string[]>;
1139
+
1140
+ /**
1141
+ * Holds the current state of the image dialog.
1142
+ * @group Image
1143
+ */
1144
+ export declare const imageDialogState$: NodeRef<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
1145
+
1146
+ /**
1147
+ * A lexical node that represents an image. Use {@link "$createImageNode"} to construct one.
1148
+ * @group Image
1149
+ */
1150
+ export declare class ImageNode extends DecoratorNode<JSX.Element> {
1151
+ /* Excluded from this release type: __src */
1152
+ /* Excluded from this release type: __altText */
1153
+ /* Excluded from this release type: __title */
1154
+ /* Excluded from this release type: __width */
1155
+ /* Excluded from this release type: __height */
1156
+ /* Excluded from this release type: getType */
1157
+ /* Excluded from this release type: clone */
1158
+ /* Excluded from this release type: importJSON */
1159
+ /* Excluded from this release type: exportDOM */
1160
+ /* Excluded from this release type: importDOM */
1161
+ /**
1162
+ * Constructs a new {@link ImageNode} with the specified image parameters.
1163
+ * Use {@link $createImageNode} to construct one.
1164
+ */
1165
+ constructor(src: string, altText: string, title: string | undefined, width?: 'inherit' | number, height?: 'inherit' | number, key?: NodeKey);
1166
+ /* Excluded from this release type: exportJSON */
1167
+ /**
1168
+ * Sets the image dimensions
1169
+ */
1170
+ setWidthAndHeight(width: 'inherit' | number, height: 'inherit' | number): void;
1171
+ /* Excluded from this release type: createDOM */
1172
+ /* Excluded from this release type: updateDOM */
1173
+ getSrc(): string;
1174
+ getAltText(): string;
1175
+ getTitle(): string | undefined;
1176
+ getHeight(): 'inherit' | number;
1177
+ getWidth(): 'inherit' | number;
1178
+ setTitle(title: string | undefined): void;
1179
+ setSrc(src: string): void;
1180
+ setAltText(altText: string | undefined): void;
1181
+ /* Excluded from this release type: hasExplicitDimensions */
1182
+ /* Excluded from this release type: decorate */
1183
+ }
1184
+
1185
+ /**
1186
+ * A plugin that adds support for images.
1187
+ * @group Image
1188
+ */
1189
+ export declare const imagePlugin: (params?: {
1190
+ imageUploadHandler?: ImageUploadHandler | undefined;
1191
+ imageAutocompleteSuggestions?: string[] | undefined;
1192
+ disableImageResize?: boolean | undefined;
1193
+ imagePreviewHandler?: ImagePreviewHandler | undefined;
1194
+ } | undefined) => RealmPlugin;
1195
+
1196
+ /**
1197
+ * Holds the image preview handler callback.
1198
+ * @group Image
1199
+ */
1200
+ export declare const imagePreviewHandler$: NodeRef<ImagePreviewHandler>;
1201
+
1202
+ /**
1203
+ * @group Image
1204
+ */
1205
+ export declare type ImagePreviewHandler = ((imageSource: string) => Promise<string>) | null;
1206
+
1207
+ /**
1208
+ * Holds the image upload handler callback.
1209
+ * @group Image
1210
+ */
1211
+ export declare const imageUploadHandler$: NodeRef<ImageUploadHandler>;
1212
+
1213
+ /**
1214
+ * @group Image
1215
+ */
1216
+ export declare type ImageUploadHandler = ((image: File) => Promise<string>) | null;
1217
+
1218
+ /* Excluded from this release type: importMarkdownToLexical */
1219
+
1220
+ /* Excluded from this release type: importMdastTreeToLexical */
1221
+
1222
+ /* Excluded from this release type: importVisitors$ */
1223
+
1224
+ /**
1225
+ * The state of the image dialog when it is inactive.
1226
+ * @group Image
1227
+ */
1228
+ export declare type InactiveImageDialogState = {
1229
+ type: 'inactive';
1230
+ };
1231
+
1232
+ /**
1233
+ * The state of the link dialog when it is inactive.
1234
+ * @group Link Dialog
1235
+ */
1236
+ export declare interface InactiveLinkDialog {
1237
+ type: 'inactive';
1238
+ rectangle?: undefined;
1239
+ linkNodeKey?: undefined;
1240
+ }
1241
+
1242
+ /**
1243
+ * Holds whether the editor is in focus or not.
1244
+ * @group Core
1245
+ */
1246
+ export declare const inFocus$: NodeRef<boolean>;
1247
+
1248
+ /* Excluded from this release type: initialMarkdown$ */
1249
+
1250
+ /* Excluded from this release type: initialRootEditorState$ */
1251
+
1252
+ /* Excluded from this release type: INSERT_IMAGE_COMMAND */
1253
+
1254
+ /**
1255
+ * A toolbar dropdown button that allows the user to insert admonitions.
1256
+ * For this to work, you need to have the `directives` plugin enabled with the {@link AdmonitionDirectiveDescriptor} configured.
1257
+ *
1258
+ * @group Toolbar Components
1259
+ */
1260
+ export declare const InsertAdmonition: () => React_2.JSX.Element;
1261
+
1262
+ /**
1263
+ * A signal that inserts a new code block into the editor with the published options.
1264
+ * @group Code Block
1265
+ */
1266
+ export declare const insertCodeBlock$: NodeRef<Partial<CreateCodeBlockNodeOptions>>;
1267
+
1268
+ /**
1269
+ * A toolbar button that allows the user to insert a fenced code block.
1270
+ * Once the code block is focused, you can construct a special code block toolbar for it, using the {@link ConditionalContents} primitive.
1271
+ * See the {@link ConditionalContents} documentation for an example.
1272
+ *
1273
+ * @group Toolbar Components
1274
+ */
1275
+ export declare const InsertCodeBlock: React_2.FC;
1276
+
1277
+ /**
1278
+ * Inserts a new code mirror code block with the specified parameters.
1279
+ * @group CodeMirror
1280
+ */
1281
+ export declare const insertCodeMirror$: NodeRef<{
1282
+ language: string;
1283
+ code: string;
1284
+ }>;
1285
+
1286
+ /**
1287
+ * Inserts a decorator node (constructed by the published factory) at the current selection.
1288
+ * @group Core
1289
+ */
1290
+ export declare const insertDecoratorNode$: NodeRef<() => DecoratorNode<unknown>>;
1291
+
1292
+ /**
1293
+ * A signal that inserts a new directive node with the published payload.
1294
+ * @group Directive
1295
+ */
1296
+ export declare const insertDirective$: NodeRef<{
1297
+ type: Directives['type'];
1298
+ name: string;
1299
+ attributes?: Directives['attributes'];
1300
+ }>;
1301
+
1302
+ /**
1303
+ * Inserts a frontmatter node at the beginning of the markdown document.
1304
+ * @group Frontmatter
1305
+ */
1306
+ export declare const insertFrontmatter$: NodeRef<void>;
1307
+
1308
+ /**
1309
+ * A toolbar button that allows the user to insert a {@link https://jekyllrb.com/docs/front-matter/ | front-matter} editor (if one is not already present).
1310
+ * For this to work, you need to have the `frontmatterPlugin` plugin enabled.
1311
+ * @group Toolbar Components
1312
+ */
1313
+ export declare const InsertFrontmatter: React_2.FC;
1314
+
1315
+ /**
1316
+ * A signal that inserts a new image node with the published payload.
1317
+ * @group Image
1318
+ */
1319
+ export declare const insertImage$: NodeRef<InsertImageParameters>;
1320
+
1321
+ /**
1322
+ * A toolbar button that allows the user to insert an image from an URL.
1323
+ * For the button to work, you need to have the `imagePlugin` plugin enabled.
1324
+ * @group Toolbar Components
1325
+ */
1326
+ export declare const InsertImage: React_2.ForwardRefExoticComponent<Omit<Record<string, never>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
1327
+
1328
+ /**
1329
+ * @group Image
1330
+ */
1331
+ export declare interface InsertImageParameters {
1332
+ src?: string;
1333
+ altText?: string;
1334
+ title?: string;
1335
+ file: FileList;
1336
+ }
1337
+
1338
+ /* Excluded from this release type: InsertImagePayload */
1339
+
1340
+ /**
1341
+ * A signal that inserts a new JSX node with the published payload.
1342
+ * @group JSX
1343
+ */
1344
+ export declare const insertJsx$: NodeRef<{
1345
+ kind: 'text';
1346
+ name: string;
1347
+ props: Record<string, string>;
1348
+ children?: Mdast.PhrasingContent[] | undefined;
1349
+ } | {
1350
+ kind: 'flow';
1351
+ name: string;
1352
+ props: Record<string, string>;
1353
+ children?: (Mdast.BlockContent | Mdast.DefinitionContent)[] | undefined;
1354
+ }>;
1355
+
1356
+ /**
1357
+ * A signal that inserts a new sandpack code block with the specified name from the {@link SandpackConfig}.
1358
+ * If no name is specified, the default preset will be used.
1359
+ * @group Sandpack
1360
+ */
1361
+ export declare const insertSandpack$: NodeRef<string>;
1362
+
1363
+ /**
1364
+ * A dropdown button that allows the user to insert a live code block into the editor. The dropdown offers a list of presets that are defined in the sandpack plugin config.
1365
+ * For this to work, you need to have the `sandpackPlugin` installed.
1366
+ * @group Toolbar Components
1367
+ */
1368
+ export declare const InsertSandpack: () => React_2.JSX.Element;
1369
+
1370
+ /**
1371
+ * A signal that will insert a table with the published amount of rows and columns into the active editor.
1372
+ * @example
1373
+ * ```tsx
1374
+ * const insertTable = usePublisher(insertTable$)
1375
+ * // ...
1376
+ * insertTable({ rows: 3, columns: 4 })
1377
+ * ```
1378
+ *
1379
+ * @group Table
1380
+ */
1381
+ export declare const insertTable$: NodeRef<{
1382
+ /**
1383
+ * The nunber of rows of the table.
1384
+ */
1385
+ rows?: number | undefined;
1386
+ /**
1387
+ * The nunber of columns of the table.
1388
+ */
1389
+ columns?: number | undefined;
1390
+ }>;
1391
+
1392
+ /**
1393
+ * A toolbar button that allows the user to insert a table.
1394
+ * For this button to work, you need to have the `tablePlugin` plugin enabled.
1395
+ * @group Toolbar Components
1396
+ */
1397
+ export declare const InsertTable: React_2.FC;
1398
+
1399
+ /**
1400
+ * Inserts a thematic break at the current selection.
1401
+ * @group Thematic Break
1402
+ */
1403
+ export declare const insertThematicBreak$: NodeRef<void>;
1404
+
1405
+ /**
1406
+ * A toolbar button that allows the user to insert a thematic break (rendered as an HR HTML element).
1407
+ * For this button to work, you need to have the `thematicBreakPlugin` plugin enabled.
1408
+ * @group Toolbar Components
1409
+ */
1410
+ export declare const InsertThematicBreak: React_2.FC;
1411
+
1412
+ /**
1413
+ * Used to detect if the current platform is Apple based, mostly for keyboard shortcuts.
1414
+ * @group Utils
1415
+ */
1416
+ export declare const IS_APPLE: boolean;
1417
+
1418
+ declare const IS_BOLD: 1;
1419
+
1420
+ declare const IS_CODE: 16;
1421
+
1422
+ declare const IS_ITALIC: 2;
1423
+
1424
+ declare const IS_UNDERLINE: 8;
1425
+
1426
+ /**
1427
+ * Determines if the given node is a HTML MDAST node.
1428
+ * @group HTML
1429
+ */
1430
+ export declare function isMdastHTMLNode(node: Mdast.Parent | Mdast.Content | Mdast.Root): node is MdastHTMLNode;
1431
+
1432
+ /**
1433
+ * Determines wether the given node is a JSX node.
1434
+ * @group JSX
1435
+ */
1436
+ export declare function isMdastJsxNode(node: Mdast.Content | Mdast.Parent | Mdast.Root): node is MdastJsx;
1437
+
1438
+ /* Excluded from this release type: isPartOftheEditorUI */
1439
+
1440
+ /**
1441
+ * returns a function which calls all passed functions in the passed order.
1442
+ * joinProc does not pass arguments or collect return values.
1443
+ * @group Utils
1444
+ */
1445
+ export declare function joinProc(...procs: Array<() => unknown>): () => void;
1446
+
1447
+ /**
1448
+ * Defines the structure of a JSX component that can be used within the markdown document.
1449
+ * @group JSX
1450
+ */
1451
+ export declare interface JsxComponentDescriptor {
1452
+ /**
1453
+ * The tag name
1454
+ */
1455
+ name: string;
1456
+ /**
1457
+ * Wether the component is a flow or text component (inline or block)
1458
+ */
1459
+ kind: 'flow' | 'text';
1460
+ /**
1461
+ * The module path from which the component can be imported
1462
+ * Omit to skip injecting an import statement
1463
+ */
1464
+ source?: string;
1465
+ /**
1466
+ * Wether the component is the default export of the module
1467
+ */
1468
+ defaultExport?: boolean;
1469
+ /**
1470
+ * The properties that can be applied to the component
1471
+ */
1472
+ props: JsxPropertyDescriptor[];
1473
+ /**
1474
+ * Wether or not the component has children
1475
+ */
1476
+ hasChildren?: boolean;
1477
+ /**
1478
+ * The editor to use for editing the component
1479
+ */
1480
+ Editor: React_2.ComponentType<JsxEditorProps>;
1481
+ }
1482
+
1483
+ /* Excluded from this release type: jsxComponentDescriptors$ */
1484
+
1485
+ /**
1486
+ * The properties passed to a custom JSX Editor component.
1487
+ * @group JSX
1488
+ */
1489
+ export declare interface JsxEditorProps {
1490
+ /** The MDAST node to edit */
1491
+ mdastNode: MdastJsx;
1492
+ /** The descriptor that activated the editor */
1493
+ descriptor: JsxComponentDescriptor;
1494
+ }
1495
+
1496
+ /* Excluded from this release type: jsxIsAvailable$ */
1497
+
1498
+ /**
1499
+ * a plugin that adds support for JSX elements (MDX).
1500
+ * @group JSX
1501
+ */
1502
+ export declare const jsxPlugin: (params?: {
1503
+ /**
1504
+ * A set of descriptors that document the JSX elements used in the document.
1505
+ */
1506
+ jsxComponentDescriptors: JsxComponentDescriptor[];
1507
+ } | undefined) => RealmPlugin;
1508
+
1509
+ /**
1510
+ * Defines the structure of a JSX component property.
1511
+ * @group JSX
1512
+ */
1513
+ export declare interface JsxPropertyDescriptor {
1514
+ /**
1515
+ * The name of the property
1516
+ */
1517
+ name: string;
1518
+ /**
1519
+ * The type of the property
1520
+ */
1521
+ type: 'string' | 'number';
1522
+ /**
1523
+ * Wether the property is required
1524
+ */
1525
+ required?: boolean;
1526
+ }
1527
+
1528
+ /**
1529
+ * A toolbar component that includes all toolbar components.
1530
+ * Notice that some of the buttons will work only if you have the corresponding plugin enabled, so you should use it only for testing purposes.
1531
+ * You'll probably want to create your own toolbar component that includes only the buttons that you need.
1532
+ * @group Toolbar Components
1533
+ */
1534
+ export declare const KitchenSinkToolbar: React_2.FC;
1535
+
1536
+ /**
1537
+ * All recognized HTML tags.
1538
+ * @group HTML
1539
+ */
1540
+ export declare type KnownHTMLTagType = (typeof htmlTags)[number];
1541
+
1542
+ /**
1543
+ * Configures how the lexical tree is converted to a mdast tree and then to markdown.
1544
+ * @group Markdown Processing
1545
+ */
1546
+ export declare interface LexicalConvertOptions {
1547
+ /**
1548
+ * The visitors to use when processing the lexical tree
1549
+ */
1550
+ visitors?: LexicalVisitor[];
1551
+ /**
1552
+ * the markdown extensions to use
1553
+ */
1554
+ toMarkdownExtensions?: ToMarkdownExtension[];
1555
+ /**
1556
+ * The options to pass to `toMarkdown`
1557
+ */
1558
+ toMarkdownOptions?: ToMarkdownOptions;
1559
+ }
1560
+
1561
+ /**
1562
+ * Implement this interface in order to process mdast node(s) into a lexical tree.
1563
+ * This is part of the process that converts the editor contents to markdown.
1564
+ * @group Markdown Processing
1565
+ */
1566
+ export declare interface LexicalExportVisitor<LN extends LexicalNode, UN extends Mdast.Content> {
1567
+ /**
1568
+ * Return true if the given node is of the type that this visitor can process.
1569
+ * You can safely use the node type guard functions (as in $isParagraphNode, $isLinkNode, etc.) here.
1570
+ */
1571
+ testLexicalNode?(lexicalNode: LexicalNode): lexicalNode is LN;
1572
+ /**
1573
+ * Process the given node and manipulate the mdast tree accordingly.
1574
+ */
1575
+ visitLexicalNode?(params: {
1576
+ /**
1577
+ * The lexical node that is being visited.
1578
+ */
1579
+ lexicalNode: LN;
1580
+ /**
1581
+ * The mdast parent node that the result of the lexical node conversion should be appended to.
1582
+ */
1583
+ mdastParent: Mdast.Parent;
1584
+ /**
1585
+ * A set of actions that can be used to manipulate the mdast tree.
1586
+ * These are "convenience" utilities that avoid the repetitive boilerplate of creating mdast nodes.
1587
+ */
1588
+ actions: {
1589
+ /**
1590
+ * Iterate over the immediate children of a lexical node with the given mdast node as a parent.
1591
+ */
1592
+ visitChildren(node: LN, mdastParent: Mdast.Parent): void;
1593
+ /**
1594
+ * Create a new mdast node with the given type, and props.
1595
+ * Iterate over the immediate children of the current lexical node with the new mdast node as a parent.
1596
+ * @param hasChildren - true by default. Pass false to skip iterating over the lexical node children.
1597
+ */
1598
+ addAndStepInto(type: string, props?: Record<string, unknown>, hasChildren?: boolean): void;
1599
+ /**
1600
+ * Append a new mdast node to a parent node.
1601
+ * @param parentNode - the mdast parent node to append the new node to.
1602
+ * @param node - the mdast node to append.
1603
+ */
1604
+ appendToParent<T extends Mdast.Parent>(parentNode: T, node: T['children'][number]): T['children'][number] | Mdast.Root;
1605
+ /**
1606
+ * Used when processing JSX nodes so that later, the correct import statement can be added to the document.
1607
+ * @param componentName - the name of the component that has to be imported.
1608
+ * @see {@link JsxComponentDescriptor}
1609
+ */
1610
+ registerReferredComponent(componentName: string): void;
1611
+ };
1612
+ }): void;
1613
+ /**
1614
+ * Return true if the current node should be joined with the previous node.
1615
+ * This is necessary due to some inconsistencies between the lexical tree and the mdast tree when it comes to formatting.
1616
+ */
1617
+ shouldJoin?(prevNode: Mdast.Content, currentNode: UN): boolean;
1618
+ /**
1619
+ * Join the current node with the previous node, returning the resulting new node
1620
+ * For this to be called by the tree walk, shouldJoin must return true.
1621
+ */
1622
+ join?<T extends Mdast.Content>(prevNode: T, currentNode: T): T;
1623
+ /**
1624
+ * Default 0, optional, sets the priority of the visitor. The higher the number, the earlier it will be called.
1625
+ */
1626
+ priority?: number;
1627
+ }
1628
+
1629
+ /**
1630
+ * A generic visitor that can be used to process any lexical node.
1631
+ * @group Markdown Processing
1632
+ */
1633
+ export declare type LexicalVisitor = LexicalExportVisitor<LexicalNode, Mdast.Content>;
1634
+
1635
+ /* Excluded from this release type: linkAutocompleteSuggestions$ */
1636
+
1637
+ /**
1638
+ * @group Link Dialog
1639
+ */
1640
+ export declare const linkDialogPlugin: (params?: {
1641
+ LinkDialog?: (() => JSX.Element) | undefined;
1642
+ linkAutocompleteSuggestions?: string[] | undefined;
1643
+ } | undefined) => RealmPlugin;
1644
+
1645
+ /**
1646
+ * The current state of the link dialog.
1647
+ * @group Link Dialog
1648
+ */
1649
+ export declare const linkDialogState$: NodeRef<InactiveLinkDialog | PreviewLinkDialog | EditLinkDialog>;
1650
+
1651
+ /**
1652
+ * A plugin that adds support for links in the editor.
1653
+ * @group Links
1654
+ */
1655
+ export declare const linkPlugin: (params?: {
1656
+ /**
1657
+ * An optional function to validate the URL of a link.
1658
+ * By default, no validation is performed.
1659
+ */
1660
+ validateUrl?: React_2.ComponentProps<typeof LinkPlugin>['validateUrl'];
1661
+ /**
1662
+ * Whether to disable the auto-linking of URLs and email addresses.
1663
+ * @default false
1664
+ */
1665
+ disableAutoLink?: boolean | undefined;
1666
+ } | undefined) => RealmPlugin;
1667
+
1668
+ /**
1669
+ * A plugin that adds support for markdown lists.
1670
+ * @group Lists
1671
+ */
1672
+ export declare const listsPlugin: (params?: unknown) => RealmPlugin;
1673
+
1674
+ /**
1675
+ * A toolbar toggle that allows the user to toggle between bulleted and numbered lists.
1676
+ * Pressing the selected button will convert the current list to the other type. Pressing it again will remove the list.
1677
+ * For this button to work, you need to have the `listsPlugin` plugin enabled.
1678
+ * @group Toolbar Components
1679
+ */
1680
+ export declare const ListsToggle: React_2.FC;
1681
+
1682
+ /* Excluded from this release type: makeHslTransparent */
1683
+
1684
+ /**
1685
+ * Holds the current markdown value.
1686
+ * @group Core
1687
+ */
1688
+ export declare const markdown$: NodeRef<string>;
1689
+
1690
+ /* Excluded from this release type: markdownErrorSignal$ */
1691
+
1692
+ /**
1693
+ * An error that gets thrown when the Markdown parsing fails due to a syntax error.
1694
+ * @group Markdown Processing
1695
+ */
1696
+ export declare class MarkdownParseError extends Error {
1697
+ constructor(message: string, cause: unknown);
1698
+ }
1699
+
1700
+ /* Excluded from this release type: MarkdownParseOptions */
1701
+
1702
+ /* Excluded from this release type: markdownProcessingError$ */
1703
+
1704
+ /**
1705
+ * A plugin that adds markdown shortcuts to the editor.
1706
+ * @group Markdown Shortcuts
1707
+ */
1708
+ export declare const markdownShortcutPlugin: (params?: unknown) => RealmPlugin;
1709
+
1710
+ /**
1711
+ * The current value of the source/diff editors.
1712
+ * @group Diff/Source
1713
+ */
1714
+ export declare const markdownSourceEditorValue$: NodeRef<string>;
1715
+
1716
+ /**
1717
+ * A block-level HTML node.
1718
+ * @group HTML
1719
+ */
1720
+ export declare interface MdastBlockHTMLNode extends MdxJsxFlowElement {
1721
+ /**
1722
+ * the tag name of the node
1723
+ */
1724
+ name: (typeof htmlTags)[number];
1725
+ }
1726
+
1727
+ /* Excluded from this release type: MdastExtension */
1728
+
1729
+ /* Excluded from this release type: mdastExtensions$ */
1730
+
1731
+ /* Excluded from this release type: MdastExtensions */
1732
+
1733
+ /**
1734
+ * A HTML MDAST node.
1735
+ * @group HTML
1736
+ */
1737
+ export declare type MdastHTMLNode = MdastBlockHTMLNode | MdastInlineHTMLNode;
1738
+
1739
+ /**
1740
+ * Implement this interface to convert certian mdast nodes into lexical nodes.
1741
+ * @typeParam UN - The type of the mdast node that is being visited.
1742
+ * @group Markdown Processing
1743
+ */
1744
+ export declare interface MdastImportVisitor<UN extends Mdast.Content> {
1745
+ /**
1746
+ * The test function that determines if this visitor should be used for the given node.
1747
+ * As a convenience, you can also pass a string here, which will be compared to the node's type.
1748
+ */
1749
+ testNode: ((mdastNode: Mdast.Content | Mdast.Root) => boolean) | string;
1750
+ visitNode(params: {
1751
+ /**
1752
+ * The node that is currently being visited.
1753
+ */
1754
+ mdastNode: UN;
1755
+ /**
1756
+ * The MDAST parent of the node that is currently being visited.
1757
+ */
1758
+ mdastParent: Mdast.Parent | null;
1759
+ /**
1760
+ * The parent lexical node to which the results of the processing should be added.
1761
+ */
1762
+ lexicalParent: LexicalNode;
1763
+ /**
1764
+ * A set of convenience utilities that can be used to add nodes to the lexical tree.
1765
+ */
1766
+ actions: {
1767
+ /**
1768
+ * Iterate the children of the node with the lexical node as the parent.
1769
+ */
1770
+ visitChildren(node: Mdast.Parent, lexicalParent: LexicalNode): void;
1771
+ /**
1772
+ * Add the given node to the lexical tree, and iterate the current mdast node's children with the newly created lexical node as a parent.
1773
+ */
1774
+ addAndStepInto(lexicalNode: LexicalNode): void;
1775
+ /**
1776
+ * Adds formatting as a context for the current node and its children.
1777
+ * This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
1778
+ */
1779
+ addFormatting(format: typeof IS_BOLD | typeof IS_ITALIC | typeof IS_UNDERLINE | typeof IS_CODE, node?: Mdast.Content): void;
1780
+ /**
1781
+ * Removes formatting as a context for the current node and its children.
1782
+ * This is necessary due to mdast treating formatting as a node, while lexical considering it an attribute of a node.
1783
+ */
1784
+ removeFormatting(format: typeof IS_BOLD | typeof IS_ITALIC | typeof IS_UNDERLINE | typeof IS_CODE, node?: Mdast.Content): void;
1785
+ /**
1786
+ * Access the current formatting context.
1787
+ */
1788
+ getParentFormatting(): number;
1789
+ };
1790
+ }): void;
1791
+ /**
1792
+ * Default 0, optional, sets the priority of the visitor. The higher the number, the earlier it will be called.
1793
+ */
1794
+ priority?: number;
1795
+ }
1796
+
1797
+ /**
1798
+ * An inline HTML node.
1799
+ * @group HTML
1800
+ */
1801
+ export declare interface MdastInlineHTMLNode extends MdxJsxTextElement {
1802
+ /**
1803
+ * the tag name of the node
1804
+ */
1805
+ name: (typeof htmlTags)[number];
1806
+ }
1807
+
1808
+ /**
1809
+ * An MDX JSX MDAST node.
1810
+ * @group JSX
1811
+ */
1812
+ export declare type MdastJsx = MdxJsxTextElement | MdxJsxFlowElement;
1813
+
1814
+ /* Excluded from this release type: MdastTreeImportOptions */
1815
+
1816
+ /**
1817
+ * The MDXEditor React component.
1818
+ * @group MDXEditor
1819
+ */
1820
+ export declare const MDXEditor: React_2.ForwardRefExoticComponent<MDXEditorProps & React_2.RefAttributes<MDXEditorMethods>>;
1821
+
1822
+ /**
1823
+ * The interface for the {@link MDXEditor} object reference.
1824
+ *
1825
+ * @example
1826
+ * ```tsx
1827
+ * const mdxEditorRef = React.useRef<MDXEditorMethods>(null)
1828
+ * <MDXEditor ref={mdxEditorRef} />
1829
+ * ```
1830
+ * @group MDXEditor
1831
+ */
1832
+ export declare interface MDXEditorMethods {
1833
+ /**
1834
+ * Gets the current markdown value.
1835
+ */
1836
+ getMarkdown: () => string;
1837
+ /**
1838
+ * Updates the markdown value of the editor.
1839
+ */
1840
+ setMarkdown: (value: string) => void;
1841
+ /**
1842
+ * Sets focus on input
1843
+ */
1844
+ focus: (callbackFn?: (() => void) | undefined, opts?: {
1845
+ defaultSelection?: 'rootStart' | 'rootEnd';
1846
+ preventScroll?: boolean;
1847
+ }) => void;
1848
+ }
1849
+
1850
+ /**
1851
+ * The props for the {@link MDXEditor} React component.
1852
+ * @group MDXEditor
1853
+ */
1854
+ export declare interface MDXEditorProps {
1855
+ /**
1856
+ * the CSS class to apply to the content editable element of the editor.
1857
+ * Use this to style the various content elements like lists and blockquotes.
1858
+ */
1859
+ contentEditableClassName?: string;
1860
+ /**
1861
+ * The markdown to edit. Notice that this is read only when the component is mounted.
1862
+ * To change the component content dynamically, use the `MDXEditorMethods.setMarkdown` method.
1863
+ */
1864
+ markdown: string;
1865
+ /**
1866
+ * Triggered when the editor value changes. The callback is not throttled, you can use any throttling mechanism
1867
+ * if you intend to do auto-saving.
1868
+ */
1869
+ onChange?: (markdown: string) => void;
1870
+ /**
1871
+ * Triggered when the markdown parser encounters an error. The payload includes the invalid source and the error message.
1872
+ */
1873
+ onError?: (payload: {
1874
+ error: string;
1875
+ source: string;
1876
+ }) => void;
1877
+ /**
1878
+ * The markdown options used to generate the resulting markdown.
1879
+ * See {@link https://github.com/syntax-tree/mdast-util-to-markdown#options | the mdast-util-to-markdown docs} for the full list of options.
1880
+ */
1881
+ toMarkdownOptions?: ToMarkdownOptions;
1882
+ /**
1883
+ * The plugins to use in the editor.
1884
+ */
1885
+ plugins?: RealmPlugin[];
1886
+ /**
1887
+ * The class name to apply to the root component element. Use this if you want to change the editor dimensions, maximum height, etc.
1888
+ * For a content-specific styling, Use `contentEditableClassName` property.
1889
+ */
1890
+ className?: string;
1891
+ /**
1892
+ * pass if you would like to have the editor automatically focused when mounted.
1893
+ */
1894
+ autoFocus?: boolean | {
1895
+ defaultSelection?: 'rootStart' | 'rootEnd';
1896
+ preventScroll?: boolean;
1897
+ };
1898
+ /**
1899
+ * Triggered when focus leaves the editor
1900
+ */
1901
+ onBlur?: (e: FocusEvent) => void;
1902
+ /**
1903
+ * The placeholder contents, displayed when the editor is empty.
1904
+ */
1905
+ placeholder?: React_2.ReactNode;
1906
+ /**
1907
+ * pass if you would like to have the editor in read-only mode.
1908
+ * Note: Don't use this mode to render content for consumption - render the markdown using a library of your choice instead.
1909
+ */
1910
+ readOnly?: boolean;
1911
+ /**
1912
+ * Use this prop to customize the icons used across the editor. Pass a function that returns an icon (JSX) for a given icon key.
1913
+ */
1914
+ iconComponentFor?: (name: IconKey) => JSX.Element;
1915
+ /**
1916
+ * Set to false if you want to suppress the processing of HTML tags.
1917
+ */
1918
+ suppressHtmlProcessing?: boolean;
1919
+ }
1920
+
1921
+ /**
1922
+ * The MDAST jsx distinction value used to differentiate inline and block level elements.
1923
+ * @group HTML
1924
+ */
1925
+ export declare type MdxNodeType = MdastHTMLNode['type'];
1926
+
1927
+ /**
1928
+ * A toolbar primitive that allows you to build an UI with multiple non-exclusive toggle groups, like the bold/italic/underline toggle.
1929
+ * @group Toolbar Primitives
1930
+ */
1931
+ export declare const MultipleChoiceToggleGroup: React_2.FC<{
1932
+ items: {
1933
+ title: string;
1934
+ contents: React_2.ReactNode;
1935
+ active: boolean;
1936
+ onChange: (active: boolean) => void;
1937
+ disabled?: boolean;
1938
+ }[];
1939
+ }>;
1940
+
1941
+ /* Excluded from this release type: NESTED_EDITOR_UPDATED_COMMAND */
1942
+
1943
+ /* Excluded from this release type: nestedEditorChildren$ */
1944
+
1945
+ /**
1946
+ * Use this context to provide the necessary values to the {@link NestedLexicalEditor} React component.
1947
+ * Place it as a wrapper in your custom lexical node decorators.
1948
+ * @group Custom Editor Primitives
1949
+ */
1950
+ export declare const NestedEditorsContext: React_2.Context<NestedEditorsContextValue<Node_2> | undefined>;
1951
+
1952
+ /**
1953
+ * The value of the {@link NestedEditorsContext} React context.
1954
+ * @group Custom Editor Primitives
1955
+ */
1956
+ export declare interface NestedEditorsContextValue<T extends Node_2> {
1957
+ /**
1958
+ * The parent lexical editor
1959
+ */
1960
+ parentEditor: LexicalEditor;
1961
+ /**
1962
+ * The parent editor config
1963
+ */
1964
+ config: EditorConfig;
1965
+ /**
1966
+ * The mdast node that is being edited
1967
+ */
1968
+ mdastNode: T;
1969
+ /**
1970
+ * The lexical node that is being edited
1971
+ */
1972
+ lexicalNode: DecoratorNode<any> & {
1973
+ /**
1974
+ * Use this method to update the mdast node. This will also update the mdast tree of the parent editor.
1975
+ */
1976
+ setMdastNode: (mdastNode: any) => void;
1977
+ };
1978
+ /**
1979
+ * Subscribe to the emitter and implement the logic to focus the custom editor.
1980
+ */
1981
+ focusEmitter: VoidEmitter;
1982
+ }
1983
+
1984
+ /**
1985
+ * A nested editor React component that allows editing of the contents of complex markdown nodes that have nested markdown content (for example, custom directives or JSX elements).
1986
+ *
1987
+ * @example
1988
+ * You can use a type param to specify the type of the mdast node
1989
+ *
1990
+ * ```tsx
1991
+ *
1992
+ * interface CalloutDirectiveNode extends LeafDirective {
1993
+ * name: 'callout'
1994
+ * children: Mdast.PhrasingContent[]
1995
+ * }
1996
+ *
1997
+ * return <NestedLexicalEditor<CalloutDirectiveNode> getContent={node => node.children} getUpdatedMdastNode={(node, children) => ({ ...node, children })} />
1998
+ * ```
1999
+ * @group Custom Editor Primitives
2000
+ */
2001
+ export declare const NestedLexicalEditor: <T extends Mdast.RootContent>(props: {
2002
+ /**
2003
+ * A function that returns the phrasing content of the mdast node. In most cases, this will be the `children` property of the mdast node, but you can also have multiple nested nodes with their own children.
2004
+ */
2005
+ getContent: (mdastNode: T) => Mdast.Content[];
2006
+ /**
2007
+ * A function that should return the updated mdast node based on the original mdast node and the new content (serialized as mdast tree) produced by the editor.
2008
+ */
2009
+ getUpdatedMdastNode: (mdastNode: T, children: Mdast.Content[]) => T;
2010
+ /**
2011
+ * Props passed to the {@link https://github.com/facebook/lexical/blob/main/packages/lexical-react/src/LexicalContentEditable.tsx | ContentEditable} component.
2012
+ */
2013
+ contentEditableProps?: ({
2014
+ ariaActiveDescendant?: string | undefined;
2015
+ ariaAutoComplete?: "list" | "none" | "inline" | "both" | undefined;
2016
+ ariaControls?: string | undefined;
2017
+ ariaDescribedBy?: string | undefined;
2018
+ ariaExpanded?: (boolean | "true" | "false") | undefined;
2019
+ ariaLabel?: string | undefined;
2020
+ ariaLabelledBy?: string | undefined;
2021
+ ariaMultiline?: (boolean | "true" | "false") | undefined;
2022
+ ariaOwns?: string | undefined;
2023
+ ariaRequired?: (boolean | "true" | "false") | undefined;
2024
+ autoCapitalize?: string | undefined;
2025
+ 'data-testid'?: string | null | undefined;
2026
+ } & React_2.AllHTMLAttributes<HTMLDivElement>) | undefined;
2027
+ /**
2028
+ * Whether or not the editor edits blocks (multiple paragraphs)
2029
+ */
2030
+ block?: boolean | undefined;
2031
+ }) => React_2.JSX.Element;
2032
+
2033
+ /**
2034
+ * The state of the image dialog when it is in new mode.
2035
+ * @group Image
2036
+ */
2037
+ export declare type NewImageDialogState = {
2038
+ type: 'new';
2039
+ };
2040
+
2041
+ /**
2042
+ * an empty function
2043
+ * @group Utils
2044
+ */
2045
+ export declare function noop(): void;
2046
+
2047
+ /**
2048
+ * Emits when the editor loses focus
2049
+ * @group Core
2050
+ */
2051
+ export declare const onBlur$: NodeRef<FocusEvent>;
2052
+
2053
+ /**
2054
+ * Emits when the window is resized.
2055
+ * @group Utils
2056
+ */
2057
+ export declare const onWindowChange$: NodeRef<true>;
2058
+
2059
+ /**
2060
+ * Opens the edit image dialog with the published parameters.
2061
+ * @group Image
2062
+ */
2063
+ export declare const openEditImageDialog$: NodeRef<Omit<EditingImageDialogState, "type">>;
2064
+
2065
+ /**
2066
+ * An action that opens the link dialog.
2067
+ * @group Link Dialog
2068
+ */
2069
+ export declare const openLinkEditDialog$: NodeRef<void>;
2070
+
2071
+ /**
2072
+ * Opens the new image dialog.
2073
+ * @group Image
2074
+ */
2075
+ export declare const openNewImageDialog$: NodeRef<void>;
2076
+
2077
+ /* Excluded from this release type: placeholder$ */
2078
+
2079
+ /**
2080
+ * The state of the link dialog when it is in preview mode.
2081
+ * @group Link Dialog
2082
+ */
2083
+ export declare interface PreviewLinkDialog {
2084
+ type: 'preview';
2085
+ title: string;
2086
+ url: string;
2087
+ linkNodeKey: string;
2088
+ rectangle: RectData;
2089
+ }
2090
+
2091
+ /**
2092
+ * Returns a function which extracts the property from from the passed object.
2093
+ * @group Utils
2094
+ */
2095
+ export declare function prop<T extends Record<string, unknown>>(property: keyof T): (object: T) => T[keyof T];
2096
+
2097
+ /**
2098
+ * A React component that can be used in custom editors to edit the properties of the node.
2099
+ * Displays a simple, static key/value editing UI in a popover.
2100
+ * @group Custom Editor Primitives
2101
+ */
2102
+ export declare const PropertyPopover: React_2.FC<{
2103
+ /**
2104
+ * The properties to edit. The key is the name of the property, and the value is the initial value.
2105
+ */
2106
+ properties: Record<string, string>;
2107
+ /**
2108
+ * Triggered when the user edits the property values.
2109
+ */
2110
+ onChange: (values: Record<string, string>) => void;
2111
+ /**
2112
+ * The title to display in the popover.
2113
+ */
2114
+ title: string;
2115
+ }>;
2116
+
2117
+ /**
2118
+ * A plugin that adds support for block quotes to the editor.
2119
+ * @group Quote
2120
+ */
2121
+ export declare const quotePlugin: (params?: unknown) => RealmPlugin;
2122
+
2123
+ /**
2124
+ * Holds the readOnly state of the editor.
2125
+ * @group Core
2126
+ */
2127
+ export declare const readOnly$: NodeRef<boolean>;
2128
+
2129
+ /**
2130
+ * A plugin for the editor.
2131
+ * @group Core
2132
+ */
2133
+ export declare interface RealmPlugin {
2134
+ init?: (realm: Realm) => void;
2135
+ update?: (realm: Realm) => void;
2136
+ }
2137
+
2138
+ /**
2139
+ * A function that creates an editor plugin.
2140
+ * @typeParam Params - The parameters for the plugin.
2141
+ * @group Core
2142
+ */
2143
+ export declare function realmPlugin<Params>(plugin: {
2144
+ /**
2145
+ * Called when the MDXEditor component is mounted and the plugin is initialized.
2146
+ */
2147
+ init?: (realm: Realm, params?: Params) => void;
2148
+ /**
2149
+ * Called on each re-render. Use this to update the realm with updated property values.
2150
+ */
2151
+ update?: (realm: Realm, params?: Params) => void;
2152
+ }): (params?: Params) => RealmPlugin;
2153
+
2154
+ /* Excluded from this release type: RealmWithPlugins */
2155
+
2156
+ /**
2157
+ * Describes the boundaries of the current selection so that the link dialog can position itself accordingly.
2158
+ * @group Link Dialog
2159
+ */
2160
+ export declare type RectData = Pick<DOMRect, 'height' | 'width' | 'top' | 'left'>;
2161
+
2162
+ /**
2163
+ * Removes the frontmatter node from the markdown document.
2164
+ * @group Frontmatter
2165
+ */
2166
+ export declare const removeFrontmatter$: NodeRef<void>;
2167
+
2168
+ /**
2169
+ * A signal that removes the current link.
2170
+ * @group Link Dialog
2171
+ */
2172
+ export declare const removeLink$: NodeRef<void>;
2173
+
2174
+ /* Excluded from this release type: Root */
2175
+
2176
+ /**
2177
+ * Holds a reference to the root Lexical editor instance.
2178
+ * @group Core
2179
+ */
2180
+ export declare const rootEditor$: NodeRef<LexicalEditor | null>;
2181
+
2182
+ /* Excluded from this release type: rootEditorSubscriptions$ */
2183
+
2184
+ /**
2185
+ * Holds the current sandpack configuration.
2186
+ * @group Sandpack
2187
+ */
2188
+ export declare const sandpackConfig$: NodeRef<SandpackConfig>;
2189
+
2190
+ /**
2191
+ * The configuration for the available sandpack presets.
2192
+ * @group Sandpack
2193
+ */
2194
+ export declare interface SandpackConfig {
2195
+ /**
2196
+ * The name of the default preset that will be used if no meta (other than live) is set.
2197
+ */
2198
+ defaultPreset: string;
2199
+ /**
2200
+ * The list of sandpack presets that can be used.
2201
+ */
2202
+ presets: SandpackPreset[];
2203
+ }
2204
+
2205
+ /**
2206
+ * A plugin that adds support for sandpack code blocks in the editor.
2207
+ * @group Sandpack
2208
+ */
2209
+ export declare const sandpackPlugin: (params?: {
2210
+ sandpackConfig: SandpackConfig;
2211
+ } | undefined) => RealmPlugin;
2212
+
2213
+ /**
2214
+ * Defines a single preset that can be used to create a Sandpack sandbox.
2215
+ * @group Sandpack
2216
+ */
2217
+ export declare interface SandpackPreset {
2218
+ /**
2219
+ * The name of the preset - use this to reference the preset from the defaultPreset field.
2220
+ */
2221
+ name: string;
2222
+ /**
2223
+ * The label of the preset, displayed in the sandpack button dropdown.
2224
+ */
2225
+ label: string | JSX.Element;
2226
+ /**
2227
+ * The meta string that will be used to identify the preset from the fenced code block. e.g. "live react"
2228
+ */
2229
+ meta: string;
2230
+ /**
2231
+ * The sandpack template that will be used to create the sandbox. e.g. "react", "react-ts", "vanilla".
2232
+ */
2233
+ sandpackTemplate: SandpackProviderProps['template'];
2234
+ /**
2235
+ * The sandpack theme that will be used to create the sandbox. e.g. "light", "dark".
2236
+ */
2237
+ sandpackTheme: SandpackProviderProps['theme'];
2238
+ /**
2239
+ * The name of the file that will be created in the sandbox. e.g. "/App.js".
2240
+ */
2241
+ snippetFileName: string;
2242
+ /**
2243
+ * The dependencies that will be added to the sandbox, just like in package.json.
2244
+ */
2245
+ dependencies?: Record<string, string>;
2246
+ /**
2247
+ * The files that will be added to the sandbox (read-only).
2248
+ * The key is the name of the file, and the value is the contents of the file.
2249
+ */
2250
+ files?: Record<string, string>;
2251
+ /**
2252
+ * The language used in the editable snippet. e.g. "jsx", "tsx", etc.
2253
+ */
2254
+ snippetLanguage?: string;
2255
+ /**
2256
+ * The initial content of the editable snippet.
2257
+ */
2258
+ initialSnippetContent?: string;
2259
+ }
2260
+
2261
+ declare type SandpackProviderProps = React_2.ComponentProps<typeof SandpackProvider>;
2262
+
2263
+ /**
2264
+ * Saves the data from the image dialog
2265
+ * @group Image
2266
+ */
2267
+ export declare const saveImage$: NodeRef<InsertImageParameters>;
2268
+
2269
+ /**
2270
+ * A toolbar primitive you can use to build dropdowns, such as the block type select.
2271
+ * @group Toolbar Primitives
2272
+ */
2273
+ export declare const Select: <T extends string>(props: {
2274
+ value: T;
2275
+ onChange: (value: T) => void;
2276
+ triggerTitle: string;
2277
+ placeholder: string;
2278
+ items: ("separator" | {
2279
+ label: string | JSX.Element;
2280
+ value: T;
2281
+ })[];
2282
+ }) => React_2.JSX.Element;
2283
+
2284
+ /* Excluded from this release type: SelectButtonTrigger */
2285
+
2286
+ /* Excluded from this release type: SelectContent */
2287
+
2288
+ /* Excluded from this release type: SelectItem */
2289
+
2290
+ /* Excluded from this release type: SelectTrigger */
2291
+
2292
+ /**
2293
+ * A toolbar primitive that allows you to show a separator between toolbar items.
2294
+ * By default, the separator is styled as vertical line.
2295
+ * @group Toolbar Primitives
2296
+ */
2297
+ export declare const Separator: React_2.ForwardRefExoticComponent<RadixToolbar.ToolbarSeparatorProps & React_2.RefAttributes<HTMLDivElement>>;
2298
+
2299
+ /**
2300
+ * A serialized representation of an {@link CodeBlockNode}.
2301
+ * @group Code Block
2302
+ */
2303
+ export declare type SerializedCodeBlockNode = Spread<CreateCodeBlockNodeOptions & {
2304
+ type: 'codeblock';
2305
+ version: 1;
2306
+ }, SerializedLexicalNode>;
2307
+
2308
+ /**
2309
+ * A serialized representation of an {@link DirectiveNode}.
2310
+ * @group Directive
2311
+ */
2312
+ export declare type SerializedDirectiveNode = Spread<{
2313
+ mdastNode: Directives;
2314
+ type: 'directive';
2315
+ version: 1;
2316
+ }, SerializedLexicalNode>;
2317
+
2318
+ /**
2319
+ * A serialized representation of a {@link GenericHTMLNode}.
2320
+ * @group HTML
2321
+ */
2322
+ export declare type SerializedGenericHTMLNode = Spread<{
2323
+ tag: KnownHTMLTagType;
2324
+ type: 'generic-html';
2325
+ mdxType: MdxNodeType;
2326
+ attributes: MdxJsxAttribute[];
2327
+ version: 1;
2328
+ }, SerializedElementNode>;
2329
+
2330
+ /**
2331
+ * A serialized representation of an {@link ImageNode}.
2332
+ * @group Image
2333
+ */
2334
+ export declare type SerializedImageNode = Spread<{
2335
+ altText: string;
2336
+ title?: string;
2337
+ width?: number;
2338
+ height?: number;
2339
+ src: string;
2340
+ type: 'image';
2341
+ version: 1;
2342
+ }, SerializedLexicalNode>;
2343
+
2344
+ /**
2345
+ * A serialized representation of a {@link TableNode}.
2346
+ * @group Table
2347
+ */
2348
+ export declare type SerializedTableNode = Spread<{
2349
+ mdastNode: Mdast.Table;
2350
+ }, SerializedLexicalNode>;
2351
+
2352
+ /**
2353
+ * Sets a new markdown value for the editor, replacing the current one.
2354
+ * @group Core
2355
+ */
2356
+ export declare const setMarkdown$: NodeRef<string>;
2357
+
2358
+ /**
2359
+ * A component that displays the focused live code block's name.
2360
+ * For this component to work, you must enable the `sandpackPlugin` for the editor.
2361
+ * See {@link ConditionalContents} for an example on how to display the dropdown only when a sandpack editor is in focus.
2362
+ * @group Toolbar Components
2363
+ */
2364
+ export declare const ShowSandpackInfo: () => React_2.JSX.Element;
2365
+
2366
+ /**
2367
+ * A toolbar primitive that allows you to build an UI with multiple exclusive toggle groups, like the list type toggle.
2368
+ * @group Toolbar Primitives
2369
+ */
2370
+ export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChange, className, items }: {
2371
+ items: {
2372
+ title: string;
2373
+ value: T;
2374
+ contents: React_2.ReactNode;
2375
+ }[];
2376
+ onChange: (value: T) => void;
2377
+ value: T;
2378
+ className?: string | undefined;
2379
+ }) => React_2.JSX.Element;
2380
+
2381
+ /* Excluded from this release type: SingleToggleGroup */
2382
+
2383
+ /**
2384
+ * An action that switches the link dialog from preview mode to edit mode.
2385
+ * @group Link Dialog
2386
+ */
2387
+ export declare const switchFromPreviewToLinkEdit$: NodeRef<void>;
2388
+
2389
+ /* Excluded from this release type: SyntaxExtension */
2390
+
2391
+ /* Excluded from this release type: syntaxExtensions$ */
2392
+
2393
+ /**
2394
+ * A Lexical node that represents a markdown table.
2395
+ * Use {@link "$createTableNode"} to construct one.
2396
+ * @group Table
2397
+ */
2398
+ export declare class TableNode extends DecoratorNode<JSX.Element> {
2399
+ /* Excluded from this release type: __mdastNode */
2400
+ /* Excluded from this release type: focusEmitter */
2401
+ /* Excluded from this release type: getType */
2402
+ /* Excluded from this release type: clone */
2403
+ /* Excluded from this release type: importJSON */
2404
+ /* Excluded from this release type: exportJSON */
2405
+ /**
2406
+ * Returns the mdast node that this node is constructed from.
2407
+ */
2408
+ getMdastNode(): Mdast.Table;
2409
+ /**
2410
+ * Returns the number of rows in the table.
2411
+ */
2412
+ getRowCount(): number;
2413
+ /**
2414
+ * Returns the number of columns in the table.
2415
+ */
2416
+ getColCount(): number;
2417
+ /**
2418
+ * Constructs a new {@link TableNode} with the specified MDAST table node as the object to edit.
2419
+ * See {@link https://github.com/micromark/micromark-extension-gfm-table | micromark/micromark-extension-gfm-table} for more information on the MDAST table node.
2420
+ */
2421
+ constructor(mdastNode?: Mdast.Table, key?: NodeKey);
2422
+ /* Excluded from this release type: createDOM */
2423
+ /* Excluded from this release type: updateDOM */
2424
+ /* Excluded from this release type: updateCellContents */
2425
+ insertColumnAt(colIndex: number): void;
2426
+ deleteColumnAt(colIndex: number): void;
2427
+ insertRowAt(y: number): void;
2428
+ deleteRowAt(rowIndex: number): void;
2429
+ addRowToBottom(): void;
2430
+ addColumnToRight(): void;
2431
+ setColumnAlign(colIndex: number, align: Mdast.AlignType): void;
2432
+ /* Excluded from this release type: decorate */
2433
+ /**
2434
+ * Focuses the table cell at the specified coordinates.
2435
+ * Pass `undefined` to remove the focus.
2436
+ */
2437
+ select(coords?: [colIndex: number, rowIndex: number]): void;
2438
+ /* Excluded from this release type: isInline */
2439
+ }
2440
+
2441
+ /**
2442
+ * A plugin that adds support for tables to the editor.
2443
+ * @group Table
2444
+ */
2445
+ export declare const tablePlugin: (params?: unknown) => RealmPlugin;
2446
+
2447
+ /**
2448
+ * Calls callback with the first argument, and returns it.
2449
+ * @group Utils
2450
+ */
2451
+ export declare function tap<T>(arg: T, proc: (arg: T) => unknown): T;
2452
+
2453
+ /**
2454
+ * A plugin that adds support for thematic breaks.
2455
+ * @group Thematic Break
2456
+ */
2457
+ export declare const thematicBreakPlugin: (params?: unknown) => RealmPlugin;
2458
+
2459
+ /**
2460
+ * Takes a value and applies a function to it.
2461
+ * @group Utils
2462
+ */
2463
+ export declare function thrush<I, K>(arg: I, proc: (arg: I) => K): K;
2464
+
2465
+ /* Excluded from this release type: ToggleSingleGroupWithItem */
2466
+
2467
+ /* Excluded from this release type: ToMarkdownExtension */
2468
+
2469
+ /* Excluded from this release type: toMarkdownExtensions$ */
2470
+
2471
+ /* Excluded from this release type: toMarkdownOptions$ */
2472
+ export { ToMarkdownOptions }
2473
+
2474
+ /**
2475
+ * The factory function that returns the contents of the toolbar.
2476
+ * @group Toolbar
2477
+ */
2478
+ export declare const toolbarContents$: NodeRef<() => React_2.ReactNode>;
2479
+
2480
+ /**
2481
+ * A plugin that adds a toolbar to the editor.
2482
+ * @group Toolbar
2483
+ */
2484
+ export declare const toolbarPlugin: (params?: {
2485
+ toolbarContents: () => React_2.ReactNode;
2486
+ } | undefined) => RealmPlugin;
2487
+
2488
+ /* Excluded from this release type: ToolbarToggleItem */
2489
+
2490
+ /**
2491
+ * A styled wrapper around the radix-ui tooltip, that lets you display an instant tooltip on hover.
2492
+ * @group Toolbar Primitives
2493
+ */
2494
+ export declare const TooltipWrap: React_2.ForwardRefExoticComponent<{
2495
+ title: string;
2496
+ children: ReactNode;
2497
+ } & React_2.RefAttributes<HTMLButtonElement>>;
2498
+
2499
+ /* Excluded from this release type: topAreaChildren$ */
2500
+
2501
+ /* Excluded from this release type: TYPE_NAME */
2502
+
2503
+ /**
2504
+ * A toolbar component that lets the user undo and redo changes in the editor.
2505
+ * @group Toolbar Components
2506
+ */
2507
+ export declare const UndoRedo: React_2.FC;
2508
+
2509
+ /**
2510
+ * An error that gets thrown when the Markdown parsing encounters an node that has no corresponding {@link MdastImportVisitor}.
2511
+ * @group Markdown Processing
2512
+ */
2513
+ export declare class UnrecognizedMarkdownConstructError extends Error {
2514
+ constructor(message: string);
2515
+ }
2516
+
2517
+ /**
2518
+ * A signal that updates the current link with the published payload.
2519
+ * @group Link Dialog
2520
+ */
2521
+ export declare const updateLink$: NodeRef<{
2522
+ url: string;
2523
+ title: string;
2524
+ }>;
2525
+
2526
+ /**
2527
+ * Use this hook in your custom code block editors to modify the underlying node code, language, and meta.
2528
+ * @group Code Block
2529
+ */
2530
+ export declare function useCodeBlockEditorContext(): CodeBlockEditorContextValue;
2531
+
2532
+ /* Excluded from this release type: usedLexicalNodes$ */
2533
+
2534
+ /**
2535
+ * A hook that returns a function that removes the lexical node from the editor.
2536
+ * @group Custom Editor Primitives
2537
+ */
2538
+ export declare function useLexicalNodeRemove(): () => void;
2539
+
2540
+ /**
2541
+ * A hook that returns a function that can be used to update the mdast node. Use this in your custom editor components.
2542
+ * @group Custom Editor Primitives
2543
+ */
2544
+ export declare function useMdastNodeUpdater<T extends Mdast.Content>(): (node: Partial<T>) => void;
2545
+
2546
+ /**
2547
+ * A hook to get the current {@link NestedEditorsContext} value. Use this in your custom editor components.
2548
+ * @group Custom Editor Primitives
2549
+ */
2550
+ export declare function useNestedEditorContext<T extends Mdast.Content>(): NestedEditorsContextValue<T>;
2551
+
2552
+ /* Excluded from this release type: uuidv4 */
2553
+
2554
+ /**
2555
+ * The current view mode of the editor when using the {@link diffSourcePlugin}.
2556
+ * @group Diff/Source
2557
+ */
2558
+ export declare const viewMode$: NodeRef<ViewMode>;
2559
+
2560
+ /**
2561
+ * The possible view modes of the editor when using the {@link diffSourcePlugin}.
2562
+ * @group Diff/Source
2563
+ */
2564
+ export declare type ViewMode = 'rich-text' | 'source' | 'diff';
2565
+
2566
+ /**
2567
+ * An emitter object that has a single subscription that will be executed.
2568
+ * The construct is used so that the lexical nodes can focus their React component editors.
2569
+ * @group Utils
2570
+ */
2571
+ export declare type VoidEmitter = {
2572
+ /**
2573
+ * Subscribes to the emitter event
2574
+ */
2575
+ subscribe: (cb: () => void) => void;
2576
+ };
2577
+
2578
+ /**
2579
+ * Creates a void emitter.
2580
+ * @group Utils
2581
+ */
2582
+ export declare function voidEmitter(): {
2583
+ publish: () => void;
2584
+ subscribe: (cb: () => void) => void;
2585
+ };
2586
+
2587
+
2588
+ export * from "@mdxeditor/gurx";
2589
+
2590
+ export { }