@mdxeditor/editor 0.22.0 → 0.22.1

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.
@@ -0,0 +1,3 @@
1
+ import * as Mdast from 'mdast';
2
+ import { MdastImportVisitor } from '../../importMarkdownToLexical';
3
+ export declare const MdastBreakVisitor: MdastImportVisitor<Mdast.Paragraph>;
@@ -0,0 +1,10 @@
1
+ import { $createLineBreakNode } from "lexical";
2
+ const MdastBreakVisitor = {
3
+ testNode: "break",
4
+ visitNode: function({ lexicalParent }) {
5
+ lexicalParent.append($createLineBreakNode());
6
+ }
7
+ };
8
+ export {
9
+ MdastBreakVisitor
10
+ };
@@ -17,6 +17,7 @@ import { MdastTextVisitor } from "./MdastTextVisitor.js";
17
17
  import { SharedHistoryPlugin } from "./SharedHistoryPlugin.js";
18
18
  import { noop } from "../../utils/fp.js";
19
19
  import { controlOrMeta } from "../../utils/detectMac.js";
20
+ import { MdastBreakVisitor } from "./MdastBreakVisitor.js";
20
21
  import { system } from "../../gurx/realmFactory.js";
21
22
  import { realmPlugin } from "../../gurx/react.js";
22
23
  const NESTED_EDITOR_UPDATED_COMMAND = createCommand("NESTED_EDITOR_UPDATED_COMMAND");
@@ -384,6 +385,7 @@ const [
384
385
  realm.pubKey("addImportVisitor", MdastTextVisitor);
385
386
  realm.pubKey("addImportVisitor", MdastFormattingVisitor);
386
387
  realm.pubKey("addImportVisitor", MdastInlineCodeVisitor);
388
+ realm.pubKey("addImportVisitor", MdastBreakVisitor);
387
389
  realm.pubKey("addLexicalNode", ParagraphNode);
388
390
  realm.pubKey("addLexicalNode", TextNode);
389
391
  realm.pubKey("addExportVisitor", LexicalRootVisitor);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "private": false,
10
10
  "sideEffects": false,
11
11
  "type": "module",
12
- "version": "0.22.0",
12
+ "version": "0.22.1",
13
13
  "description": "React component for rich text markdown editing",
14
14
  "scripts": {
15
15
  "build": "vite build",