@mdxeditor/editor 3.46.1 → 3.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MDXEditor.js +5 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/plugins/core/index.js +2 -0
- package/package.json +1 -1
package/dist/MDXEditor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { usePublisher, useCellValue, useCellValues, useRealm } from "@mdxeditor/gurx";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
import { corePlugin, editorRootElementRef$, rootEditor$, useTranslation, contentEditableRef$, contentEditableClassName$, spellCheck$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, bottomAreaChildren$, insertMarkdown$, setMarkdown$, viewMode$, markdownSourceEditorValue$, markdown$ } from "./plugins/core/index.js";
|
|
3
|
+
import { corePlugin, editorRootElementRef$, rootEditor$, useTranslation, contentEditableRef$, contentEditableWrapperElement$, contentEditableClassName$, spellCheck$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, bottomAreaChildren$, insertMarkdown$, setMarkdown$, viewMode$, markdownSourceEditorValue$, markdown$ } from "./plugins/core/index.js";
|
|
4
4
|
import { RealmWithPlugins } from "./RealmWithPlugins.js";
|
|
5
5
|
import { createLexicalComposerContext, LexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
@@ -21,8 +21,10 @@ const LexicalProvider = ({ children }) => {
|
|
|
21
21
|
const RichTextEditor = () => {
|
|
22
22
|
const t = useTranslation();
|
|
23
23
|
const setContentEditableRef = usePublisher(contentEditableRef$);
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const setEditorRootWrapperElement = usePublisher(contentEditableWrapperElement$);
|
|
25
|
+
const onRef = (el) => {
|
|
26
|
+
setEditorRootWrapperElement(el);
|
|
27
|
+
setContentEditableRef({ current: el });
|
|
26
28
|
};
|
|
27
29
|
const [contentEditableClassName, spellCheck, composerChildren, topAreaChildren, editorWrappers, placeholder, bottomAreaChildren] = useCellValues(
|
|
28
30
|
contentEditableClassName$,
|
package/dist/index.d.ts
CHANGED
|
@@ -689,6 +689,8 @@ export declare const contentEditableClassName$: NodeRef<string>;
|
|
|
689
689
|
*/
|
|
690
690
|
export declare const contentEditableRef$: NodeRef<default_2.RefObject<HTMLDivElement> | null>;
|
|
691
691
|
|
|
692
|
+
export declare const contentEditableWrapperElement$: NodeRef<HTMLDivElement | null>;
|
|
693
|
+
|
|
692
694
|
/**
|
|
693
695
|
* Returns true if the user is pressing the control key on Windows or the meta key on Mac.
|
|
694
696
|
* @group Utils
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { MDXEditor } from "./MDXEditor.js";
|
|
|
4
4
|
import { defaultSvgIcons } from "./defaultSvgIcons.js";
|
|
5
5
|
import { MarkdownParseError, UnrecognizedMarkdownConstructError, importMarkdownToLexical, importMdastTreeToLexical } from "./importMarkdownToLexical.js";
|
|
6
6
|
import { exportLexicalTreeToMdast, exportMarkdownFromLexical } from "./exportMarkdownFromLexical.js";
|
|
7
|
-
import { Appender, NESTED_EDITOR_UPDATED_COMMAND, activeEditor$, activeEditorSubscriptions$, activePlugins$, addActivePlugin$, addBottomAreaChild$, addComposerChild$, addEditorWrapper$, addExportVisitor$, addImportVisitor$, addLexicalNode$, addMdastExtension$, addNestedEditorChild$, addSyntaxExtension$, addToMarkdownExtension$, addTopAreaChild$, applyBlockType$, applyFormat$, autoFocus$, bottomAreaChildren$, codeBlockEditorDescriptors$, composerChildren$, contentEditableClassName$, contentEditableRef$, convertSelectionToNode$, corePlugin, createActiveEditorSubscription$, createRootEditorSubscription$, currentBlockType$, currentFormat$, currentSelection$, directiveDescriptors$, editorInFocus$, editorRootElementRef$, editorWrappers$, exportVisitors$, historyState$, iconComponentFor$, importVisitors$, inFocus$, initialMarkdown$, initialMarkdownNormalize$, insertDecoratorNode$, insertMarkdown$, jsxComponentDescriptors$, jsxIsAvailable$, lexicalTheme$, markdown$, markdownErrorSignal$, markdownProcessingError$, markdownSourceEditorValue$, mdastExtensions$, muteChange$, nestedEditorChildren$, onBlur$, placeholder$, readOnly$, rootEditor$, rootEditorSubscriptions$, setMarkdown$, spellCheck$, syntaxExtensions$, toMarkdownExtensions$, toMarkdownOptions$, topAreaChildren$, translation$, useTranslation, usedLexicalNodes$, viewMode$ } from "./plugins/core/index.js";
|
|
7
|
+
import { Appender, NESTED_EDITOR_UPDATED_COMMAND, activeEditor$, activeEditorSubscriptions$, activePlugins$, addActivePlugin$, addBottomAreaChild$, addComposerChild$, addEditorWrapper$, addExportVisitor$, addImportVisitor$, addLexicalNode$, addMdastExtension$, addNestedEditorChild$, addSyntaxExtension$, addToMarkdownExtension$, addTopAreaChild$, applyBlockType$, applyFormat$, autoFocus$, bottomAreaChildren$, codeBlockEditorDescriptors$, composerChildren$, contentEditableClassName$, contentEditableRef$, contentEditableWrapperElement$, convertSelectionToNode$, corePlugin, createActiveEditorSubscription$, createRootEditorSubscription$, currentBlockType$, currentFormat$, currentSelection$, directiveDescriptors$, editorInFocus$, editorRootElementRef$, editorWrappers$, exportVisitors$, historyState$, iconComponentFor$, importVisitors$, inFocus$, initialMarkdown$, initialMarkdownNormalize$, insertDecoratorNode$, insertMarkdown$, jsxComponentDescriptors$, jsxIsAvailable$, lexicalTheme$, markdown$, markdownErrorSignal$, markdownProcessingError$, markdownSourceEditorValue$, mdastExtensions$, muteChange$, nestedEditorChildren$, onBlur$, placeholder$, readOnly$, rootEditor$, rootEditorSubscriptions$, setMarkdown$, spellCheck$, syntaxExtensions$, toMarkdownExtensions$, toMarkdownOptions$, topAreaChildren$, translation$, useTranslation, usedLexicalNodes$, viewMode$ } from "./plugins/core/index.js";
|
|
8
8
|
import { ALL_HEADING_LEVELS, allowedHeadingLevels$, headingsPlugin } from "./plugins/headings/index.js";
|
|
9
9
|
import { insertThematicBreak$, thematicBreakPlugin } from "./plugins/thematic-break/index.js";
|
|
10
10
|
import { applyListType$, currentListType$, listsPlugin } from "./plugins/lists/index.js";
|
|
@@ -206,6 +206,7 @@ export {
|
|
|
206
206
|
composerChildren$,
|
|
207
207
|
contentEditableClassName$,
|
|
208
208
|
contentEditableRef$,
|
|
209
|
+
contentEditableWrapperElement$,
|
|
209
210
|
controlOrMeta,
|
|
210
211
|
convertSelectionToNode$,
|
|
211
212
|
corePlugin,
|
|
@@ -190,6 +190,7 @@ function rebind() {
|
|
|
190
190
|
return activeEditorValue ? subs.map((s) => s(activeEditorValue)) : [];
|
|
191
191
|
}, []);
|
|
192
192
|
}
|
|
193
|
+
const contentEditableWrapperElement$ = Cell(null);
|
|
193
194
|
const activeEditorSubscriptions$ = Cell([], (r) => {
|
|
194
195
|
r.pipe(r.combine(activeEditorSubscriptions$, activeEditor$), rebind());
|
|
195
196
|
});
|
|
@@ -624,6 +625,7 @@ export {
|
|
|
624
625
|
composerChildren$,
|
|
625
626
|
contentEditableClassName$,
|
|
626
627
|
contentEditableRef$,
|
|
628
|
+
contentEditableWrapperElement$,
|
|
627
629
|
convertSelectionToNode$,
|
|
628
630
|
corePlugin,
|
|
629
631
|
createActiveEditorSubscription$,
|