@mdxeditor/editor 2.3.0 → 2.3.2

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.
@@ -473,7 +473,12 @@ const corePlugin = realmPlugin({
473
473
  LexicalLinebreakVisitor,
474
474
  LexicalGenericHTMLVisitor
475
475
  ],
476
- [addComposerChild$]: SharedHistoryPlugin
476
+ [addComposerChild$]: SharedHistoryPlugin,
477
+ [contentEditableClassName$]: params == null ? void 0 : params.contentEditableClassName,
478
+ [toMarkdownOptions$]: params == null ? void 0 : params.toMarkdownOptions,
479
+ [autoFocus$]: params == null ? void 0 : params.autoFocus,
480
+ [placeholder$]: params == null ? void 0 : params.placeholder,
481
+ [readOnly$]: params == null ? void 0 : params.readOnly
477
482
  });
478
483
  if (!(params == null ? void 0 : params.suppressHtmlProcessing)) {
479
484
  r.pubIn({
@@ -135,7 +135,11 @@ const imagePlugin = realmPlugin({
135
135
  [addImportVisitor$]: [MdastImageVisitor, MdastHtmlImageVisitor, MdastJsxImageVisitor],
136
136
  [addLexicalNode$]: ImageNode,
137
137
  [addExportVisitor$]: LexicalImageVisitor,
138
- [addComposerChild$]: (params == null ? void 0 : params.ImageDialog) || ImageDialog
138
+ [addComposerChild$]: (params == null ? void 0 : params.ImageDialog) || ImageDialog,
139
+ [imageUploadHandler$]: (params == null ? void 0 : params.imageUploadHandler) || null,
140
+ [imageAutocompleteSuggestions$]: (params == null ? void 0 : params.imageAutocompleteSuggestions) || [],
141
+ [disableImageResize$]: Boolean(params == null ? void 0 : params.disableImageResize),
142
+ [imagePreviewHandler$]: (params == null ? void 0 : params.imagePreviewHandler) || null
139
143
  });
140
144
  },
141
145
  update(realm, params) {
@@ -115,12 +115,12 @@ const TableEditor = ({ mdastNode, parentEditor, lexicalTable }) => {
115
115
  const rowIndex = tableCell.tagName === "TH" ? -1 : Array.from(tableRow.parentElement.children).indexOf(tableRow);
116
116
  setHighlightedCoordinates([colIndex, rowIndex]);
117
117
  }, []);
118
- return /* @__PURE__ */ React__default.createElement("table", { className: styles.tableEditor, onMouseOver: onTableMouseOver, onMouseLeave: () => setHighlightedCoordinates([-1, -1]) }, /* @__PURE__ */ React__default.createElement("colgroup", null, /* @__PURE__ */ React__default.createElement("col", null), Array.from({ length: mdastNode.children[0].children.length }, (_, colIndex) => {
118
+ return /* @__PURE__ */ React__default.createElement("table", { className: styles.tableEditor, onMouseOver: onTableMouseOver, onMouseLeave: () => setHighlightedCoordinates([-1, -1]) }, /* @__PURE__ */ React__default.createElement("colgroup", null, readOnly ? null : /* @__PURE__ */ React__default.createElement("col", null), Array.from({ length: mdastNode.children[0].children.length }, (_, colIndex) => {
119
119
  const align = mdastNode.align || [];
120
120
  const currentColumnAlign = align[colIndex] || "left";
121
121
  const className = AlignToTailwindClassMap[currentColumnAlign];
122
122
  return /* @__PURE__ */ React__default.createElement("col", { key: colIndex, className });
123
- }), /* @__PURE__ */ React__default.createElement("col", null)), readOnly || /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
123
+ }), readOnly ? null : /* @__PURE__ */ React__default.createElement("col", null)), readOnly || /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", { className: styles.tableToolsColumn, "data-tool-cell": true }, /* @__PURE__ */ React__default.createElement(
124
124
  "button",
125
125
  {
126
126
  className: styles.iconButton,
@@ -16,6 +16,9 @@ const toolbarPlugin = realmPlugin({
16
16
  return /* @__PURE__ */ React__default.createElement(Root, { readOnly }, toolbarContents());
17
17
  }
18
18
  });
19
+ },
20
+ update(realm, params) {
21
+ realm.pub(toolbarContents$, (params == null ? void 0 : params.toolbarContents) ?? DEFAULT_TOOLBAR_CONTENTS);
19
22
  }
20
23
  });
21
24
  export {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "2.3.0",
14
+ "version": "2.3.2",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",