@mdxeditor/editor 3.19.2 → 3.20.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.
@@ -231,7 +231,7 @@ function ImageEditor({ src, title, alt, nodeKey, width, height, rest }) {
231
231
  {
232
232
  className: styles.iconButton,
233
233
  type: "button",
234
- title: t("image.delete", "Delete image"),
234
+ title: t("imageEditor.deleteImage", "Delete image"),
235
235
  disabled: readOnly,
236
236
  onClick: (e) => {
237
237
  e.preventDefault();
@@ -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
  }
@@ -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.2",
14
+ "version": "3.20.0",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",