@mdxeditor/editor 2.13.1 → 2.14.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
|
@@ -965,6 +965,8 @@ export declare const disableAutoLink$: NodeRef<boolean>;
|
|
|
965
965
|
*/
|
|
966
966
|
export declare const disableImageResize$: NodeRef<boolean>;
|
|
967
967
|
|
|
968
|
+
export declare const disableImageSettingsButton$: NodeRef<boolean>;
|
|
969
|
+
|
|
968
970
|
/**
|
|
969
971
|
* The state of the image dialog when it is in editing an existing node.
|
|
970
972
|
* @group Image
|
|
@@ -1229,6 +1231,7 @@ export declare const imagePlugin: (params?: {
|
|
|
1229
1231
|
imageUploadHandler?: ImageUploadHandler | undefined;
|
|
1230
1232
|
imageAutocompleteSuggestions?: string[] | undefined;
|
|
1231
1233
|
disableImageResize?: boolean | undefined;
|
|
1234
|
+
disableImageSettingsButton?: boolean | undefined;
|
|
1232
1235
|
imagePreviewHandler?: ImagePreviewHandler | undefined;
|
|
1233
1236
|
ImageDialog?: FC<{}> | (() => JSX.Element) | undefined;
|
|
1234
1237
|
} | undefined) => RealmPlugin;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { insertThematicBreak$, thematicBreakPlugin } from "./plugins/thematic-br
|
|
|
9
9
|
import { applyListType$, currentListType$, listsPlugin } from "./plugins/lists/index.js";
|
|
10
10
|
import { insertTable$, tablePlugin } from "./plugins/table/index.js";
|
|
11
11
|
import { disableAutoLink$, linkPlugin } from "./plugins/link/index.js";
|
|
12
|
-
import { INSERT_IMAGE_COMMAND, closeImageDialog$, disableImageResize$, imageAutocompleteSuggestions$, imageDialogState$, imagePlugin, imagePreviewHandler$, imageUploadHandler$, insertImage$, openEditImageDialog$, openNewImageDialog$, saveImage$ } from "./plugins/image/index.js";
|
|
12
|
+
import { INSERT_IMAGE_COMMAND, closeImageDialog$, disableImageResize$, disableImageSettingsButton$, imageAutocompleteSuggestions$, imageDialogState$, imagePlugin, imagePreviewHandler$, imageUploadHandler$, insertImage$, openEditImageDialog$, openNewImageDialog$, saveImage$ } from "./plugins/image/index.js";
|
|
13
13
|
import { frontmatterDialogOpen$, frontmatterPlugin, hasFrontmatter$, insertFrontmatter$, removeFrontmatter$ } from "./plugins/frontmatter/index.js";
|
|
14
14
|
import { quotePlugin } from "./plugins/quote/index.js";
|
|
15
15
|
import { maxLengthPlugin } from "./plugins/maxlength/index.js";
|
|
@@ -188,6 +188,7 @@ export {
|
|
|
188
188
|
directivesPlugin,
|
|
189
189
|
disableAutoLink$,
|
|
190
190
|
disableImageResize$,
|
|
191
|
+
disableImageSettingsButton$,
|
|
191
192
|
editorInFocus$,
|
|
192
193
|
editorRootElementRef$,
|
|
193
194
|
editorWrappers$,
|
|
@@ -5,6 +5,7 @@ import { ContentEditable } from "@lexical/react/LexicalContentEditable.js";
|
|
|
5
5
|
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary.js";
|
|
6
6
|
import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer.js";
|
|
7
7
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
8
|
+
import classNames from "classnames";
|
|
8
9
|
import { lexicalTheme } from "../../styles/lexicalTheme.js";
|
|
9
10
|
import { exportLexicalTreeToMdast } from "../../exportMarkdownFromLexical.js";
|
|
10
11
|
import { importMdastTreeToLexical } from "../../importMarkdownToLexical.js";
|
|
@@ -186,7 +187,7 @@ const NestedLexicalEditor = function(props) {
|
|
|
186
187
|
return /* @__PURE__ */ React__default.createElement(LexicalNestedComposer, { initialEditor: editor }, /* @__PURE__ */ React__default.createElement(
|
|
187
188
|
RichTextPlugin,
|
|
188
189
|
{
|
|
189
|
-
contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { ...contentEditableProps, className: styles.nestedEditor }),
|
|
190
|
+
contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { ...contentEditableProps, className: classNames(styles.nestedEditor, contentEditableProps == null ? void 0 : contentEditableProps.className) }),
|
|
190
191
|
placeholder: null,
|
|
191
192
|
ErrorBoundary: LexicalErrorBoundary
|
|
192
193
|
}
|
|
@@ -4,7 +4,7 @@ import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection.
|
|
|
4
4
|
import { mergeRegister } from "@lexical/utils";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { $isNodeSelection, $getSelection, $getNodeByKey, $setSelection, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_LOW, CLICK_COMMAND, DRAGSTART_COMMAND, KEY_DELETE_COMMAND, KEY_BACKSPACE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND } from "lexical";
|
|
7
|
-
import { disableImageResize$, imagePreviewHandler$, openEditImageDialog$ } from "./index.js";
|
|
7
|
+
import { disableImageResize$, disableImageSettingsButton$, imagePreviewHandler$, openEditImageDialog$ } from "./index.js";
|
|
8
8
|
import styles from "../../styles/ui.module.css.js";
|
|
9
9
|
import { iconComponentFor$, readOnly$, useTranslation } from "../core/index.js";
|
|
10
10
|
import { $isImageNode } from "./ImageNode.js";
|
|
@@ -48,8 +48,9 @@ function LazyImage({
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
function ImageEditor({ src, title, alt, nodeKey, width, height }) {
|
|
51
|
-
const [disableImageResize, imagePreviewHandler, iconComponentFor, readOnly] = useCellValues(
|
|
51
|
+
const [disableImageResize, disableImageSettingsButton, imagePreviewHandler, iconComponentFor, readOnly] = useCellValues(
|
|
52
52
|
disableImageResize$,
|
|
53
|
+
disableImageSettingsButton$,
|
|
53
54
|
imagePreviewHandler$,
|
|
54
55
|
iconComponentFor$,
|
|
55
56
|
readOnly$
|
|
@@ -210,7 +211,7 @@ function ImageEditor({ src, title, alt, nodeKey, width, height }) {
|
|
|
210
211
|
alt: alt || "",
|
|
211
212
|
imageRef
|
|
212
213
|
}
|
|
213
|
-
)), draggable && isFocused && !disableImageResize && /* @__PURE__ */ React__default.createElement(ImageResizer, { editor, imageRef, onResizeStart, onResizeEnd }), /* @__PURE__ */ React__default.createElement(
|
|
214
|
+
)), draggable && isFocused && !disableImageResize && /* @__PURE__ */ React__default.createElement(ImageResizer, { editor, imageRef, onResizeStart, onResizeEnd }), !disableImageSettingsButton && /* @__PURE__ */ React__default.createElement(
|
|
214
215
|
"button",
|
|
215
216
|
{
|
|
216
217
|
type: "button",
|
|
@@ -128,6 +128,7 @@ const openEditImageDialog$ = Signal((r) => {
|
|
|
128
128
|
const closeImageDialog$ = Action((r) => {
|
|
129
129
|
r.link(r.pipe(closeImageDialog$, mapTo({ type: "inactive" })), imageDialogState$);
|
|
130
130
|
});
|
|
131
|
+
const disableImageSettingsButton$ = Cell(false);
|
|
131
132
|
const saveImage$ = Signal();
|
|
132
133
|
const imagePlugin = realmPlugin({
|
|
133
134
|
init(realm, params) {
|
|
@@ -139,6 +140,7 @@ const imagePlugin = realmPlugin({
|
|
|
139
140
|
[imageUploadHandler$]: (params == null ? void 0 : params.imageUploadHandler) || null,
|
|
140
141
|
[imageAutocompleteSuggestions$]: (params == null ? void 0 : params.imageAutocompleteSuggestions) || [],
|
|
141
142
|
[disableImageResize$]: Boolean(params == null ? void 0 : params.disableImageResize),
|
|
143
|
+
[disableImageSettingsButton$]: Boolean(params == null ? void 0 : params.disableImageSettingsButton),
|
|
142
144
|
[imagePreviewHandler$]: (params == null ? void 0 : params.imagePreviewHandler) || null
|
|
143
145
|
});
|
|
144
146
|
},
|
|
@@ -286,6 +288,7 @@ export {
|
|
|
286
288
|
ImageNode,
|
|
287
289
|
closeImageDialog$,
|
|
288
290
|
disableImageResize$,
|
|
291
|
+
disableImageSettingsButton$,
|
|
289
292
|
imageAutocompleteSuggestions$,
|
|
290
293
|
imageDialogState$,
|
|
291
294
|
imagePlugin,
|