@mdxeditor/editor 3.19.3 → 3.21.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/index.d.ts CHANGED
@@ -29,6 +29,7 @@ import { NodeKey } from 'lexical';
29
29
  import { NodeRef } from '@mdxeditor/gurx';
30
30
  import { Options } from 'mdast-util-from-markdown';
31
31
  import { Options as Options_2 } from 'mdast-util-to-markdown/lib/types';
32
+ import { Options as Options_3 } from 'mdast-util-gfm-table';
32
33
  import { ParseOptions } from 'micromark-util-types';
33
34
  import * as RadixToolbar from '@radix-ui/react-toolbar';
34
35
  import { RangeSelection } from 'lexical';
@@ -2707,7 +2708,7 @@ export declare class TableNode extends DecoratorNode<JSX.Element> {
2707
2708
  * A plugin that adds support for tables to the editor.
2708
2709
  * @group Table
2709
2710
  */
2710
- export declare const tablePlugin: (params?: unknown) => RealmPlugin;
2711
+ export declare const tablePlugin: (params?: Options_3 | undefined) => RealmPlugin;
2711
2712
 
2712
2713
  /**
2713
2714
  * Calls callback with the first argument, and returns it.
@@ -113,8 +113,10 @@ const imageDialogState$ = Cell(
113
113
  }
114
114
  return false;
115
115
  }
116
- let cbPayload = Array.from(((_b = event.clipboardData) == null ? void 0 : _b.items) ?? []);
117
- cbPayload = cbPayload.filter((i) => i.type.includes("image"));
116
+ const cbPayload = Array.from(((_b = event.clipboardData) == null ? void 0 : _b.items) ?? []);
117
+ const isMixedPayload = cbPayload.some((item) => !item.type.includes("image"));
118
+ if (isMixedPayload)
119
+ return false;
118
120
  if (!cbPayload.length || cbPayload.length === 0) {
119
121
  return false;
120
122
  }
@@ -17,9 +17,9 @@ const LexicalListItemVisitor = {
17
17
  type: "listItem",
18
18
  checked: parentList.getListType() === "check" ? Boolean(lexicalNode.getChecked()) : void 0,
19
19
  spread: false,
20
- children: [{ type: "paragraph", children: [] }]
20
+ children: []
21
21
  });
22
- actions.visitChildren(lexicalNode, listItem.children[0]);
22
+ actions.visitChildren(lexicalNode, listItem);
23
23
  }
24
24
  }
25
25
  };
@@ -1,8 +1,8 @@
1
- import { realmPlugin } from "../../RealmWithPlugins.js";
2
1
  import { QUOTE, LINK, ORDERED_LIST, UNORDERED_LIST, CHECK_LIST, CODE, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE } from "@lexical/markdown";
3
2
  import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin.js";
4
3
  import { HeadingNode, $isHeadingNode, $createHeadingNode } from "@lexical/rich-text";
5
4
  import React__default from "react";
5
+ import { realmPlugin } from "../../RealmWithPlugins.js";
6
6
  import { CodeBlockNode, $createCodeBlockNode } from "../codeblock/CodeBlockNode.js";
7
7
  import { activePlugins$, addComposerChild$, addNestedEditorChild$ } from "../core/index.js";
8
8
  import { allowedHeadingLevels$ } from "../headings/index.js";
@@ -40,7 +40,7 @@ const insertTable$ = Signal((r) => {
40
40
  );
41
41
  });
42
42
  const tablePlugin = realmPlugin({
43
- init(realm) {
43
+ init(realm, params) {
44
44
  realm.pubIn({
45
45
  // import
46
46
  [addMdastExtension$]: gfmTableFromMarkdown(),
@@ -49,7 +49,10 @@ const tablePlugin = realmPlugin({
49
49
  // export
50
50
  [addLexicalNode$]: TableNode,
51
51
  [addExportVisitor$]: LexicalTableVisitor,
52
- [addToMarkdownExtension$]: gfmTableToMarkdown({ tableCellPadding: true, tablePipeAlign: true })
52
+ [addToMarkdownExtension$]: gfmTableToMarkdown({
53
+ tableCellPadding: (params == null ? void 0 : params.tableCellPadding) ?? true,
54
+ tablePipeAlign: (params == null ? void 0 : params.tablePipeAlign) ?? true
55
+ })
53
56
  });
54
57
  }
55
58
  });
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.19.3",
14
+ "version": "3.21.0",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",
@@ -43,15 +43,15 @@
43
43
  "@codemirror/state": "^6.4.0",
44
44
  "@codemirror/view": "^6.23.0",
45
45
  "@codesandbox/sandpack-react": "^2.10.0",
46
- "@lexical/clipboard": "^0.17.1",
47
- "@lexical/link": "^0.17.1",
48
- "@lexical/list": "^0.17.1",
49
- "@lexical/markdown": "^0.17.1",
50
- "@lexical/plain-text": "^0.17.1",
51
- "@lexical/react": "^0.17.1",
52
- "@lexical/rich-text": "^0.17.1",
53
- "@lexical/selection": "^0.17.1",
54
- "@lexical/utils": "^0.17.1",
46
+ "@lexical/clipboard": "^0.23.1",
47
+ "@lexical/link": "^0.23.1",
48
+ "@lexical/list": "^0.23.1",
49
+ "@lexical/markdown": "^0.23.1",
50
+ "@lexical/plain-text": "^0.23.1",
51
+ "@lexical/react": "^0.23.1",
52
+ "@lexical/rich-text": "^0.23.1",
53
+ "@lexical/selection": "^0.23.1",
54
+ "@lexical/utils": "^0.23.1",
55
55
  "@mdxeditor/gurx": "^1.1.4",
56
56
  "@radix-ui/colors": "^3.0.0",
57
57
  "@radix-ui/react-dialog": "^1.0.5",
@@ -66,7 +66,7 @@
66
66
  "codemirror": "^6.0.1",
67
67
  "downshift": "^7.6.0",
68
68
  "js-yaml": "4.1.0",
69
- "lexical": "^0.17.1",
69
+ "lexical": "^0.23.1",
70
70
  "mdast-util-directive": "^3.0.0",
71
71
  "mdast-util-from-markdown": "^2.0.0",
72
72
  "mdast-util-frontmatter": "^2.0.1",