11import { useCellValue , useCellValues , usePublisher , useRealm } from '@mdxeditor/gurx'
22import React from 'react'
3- import { RealmPlugin , RealmWithPlugins } from './RealmWithPlugins'
43import {
5- Translation ,
4+ AdditionalLexicalNode ,
5+ bottomAreaChildren$ ,
66 composerChildren$ ,
77 contentEditableClassName$ ,
8- spellCheck $,
8+ contentEditableRef $,
99 corePlugin ,
1010 editorRootElementRef$ ,
1111 editorWrappers$ ,
@@ -15,24 +15,25 @@ import {
1515 placeholder$ ,
1616 rootEditor$ ,
1717 setMarkdown$ ,
18+ spellCheck$ ,
1819 topAreaChildren$ ,
19- bottomAreaChildren$ ,
20+ Translation ,
2021 useTranslation ,
21- viewMode$ ,
22- contentEditableRef$
22+ viewMode$
2323} from './plugins/core'
24+ import { RealmPlugin , RealmWithPlugins } from './RealmWithPlugins'
2425
26+ import { createLexicalComposerContext , LexicalComposerContext , LexicalComposerContextType } from '@lexical/react/LexicalComposerContext'
2527import { ContentEditable } from '@lexical/react/LexicalContentEditable'
28+ import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'
2629import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
2730import classNames from 'classnames'
31+ import { EditorState , EditorThemeClasses , LexicalEditor } from 'lexical'
32+ import { defaultSvgIcons , IconKey } from './defaultSvgIcons'
2833import { ToMarkdownOptions } from './exportMarkdownFromLexical'
2934import { lexicalTheme } from './styles/lexicalTheme'
3035import styles from './styles/ui.module.css'
3136import { noop } from './utils/fp'
32- import { createLexicalComposerContext , LexicalComposerContext , LexicalComposerContextType } from '@lexical/react/LexicalComposerContext'
33- import { EditorState , EditorThemeClasses , LexicalEditor } from 'lexical'
34- import { IconKey , defaultSvgIcons } from './defaultSvgIcons'
35- import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'
3637
3738const LexicalProvider : React . FC < {
3839 children : JSX . Element | string | ( JSX . Element | string ) [ ]
@@ -327,6 +328,16 @@ export interface MDXEditorProps {
327328 * The initial state of the lexical editor. Pass null to disable any initiation.
328329 */
329330 editorState ?: EditorState | undefined | null
331+
332+ /**
333+ * Additional lexical nodes to include in the editor.
334+ */
335+ additionalLexicalNodes ?: AdditionalLexicalNode [ ]
336+
337+ /**
338+ * The lexical editor namespace.
339+ */
340+ lexicalEditorNamespace ?: string
330341}
331342
332343/**
@@ -354,7 +365,9 @@ export const MDXEditor = React.forwardRef<MDXEditorMethods, MDXEditorProps>((pro
354365 trim : props . trim ?? true ,
355366 lexicalTheme : props . lexicalTheme ,
356367 ...( 'editorState' in props ? { editorState : props . editorState } : { } ) ,
357- suppressSharedHistory : props . suppressSharedHistory ?? false
368+ suppressSharedHistory : props . suppressSharedHistory ?? false ,
369+ additionalLexicalNodes : props . additionalLexicalNodes ?? [ ] ,
370+ lexicalEditorNamespace : props . lexicalEditorNamespace ?? 'MDXEditor'
358371 } ) ,
359372 ...( props . plugins ?? [ ] )
360373 ] }
0 commit comments