@mdxeditor/editor
Advanced tools
Comparing version 3.9.0 to 3.9.1
@@ -7,10 +7,11 @@ import * as Dialog from "@radix-ui/react-dialog"; | ||
import { editorRootElementRef$, useTranslation } from "../core/index.js"; | ||
import { imageAutocompleteSuggestions$, imageDialogState$, saveImage$, closeImageDialog$ } from "./index.js"; | ||
import { imageAutocompleteSuggestions$, imageDialogState$, imageUploadHandler$, saveImage$, closeImageDialog$ } from "./index.js"; | ||
import { DownshiftAutoComplete } from "../core/ui/DownshiftAutoComplete.js"; | ||
import { useCellValues, usePublisher } from "@mdxeditor/gurx"; | ||
const ImageDialog = () => { | ||
const [imageAutocompleteSuggestions, state, editorRootElementRef] = useCellValues( | ||
const [imageAutocompleteSuggestions, state, editorRootElementRef, imageUploadHandler] = useCellValues( | ||
imageAutocompleteSuggestions$, | ||
imageDialogState$, | ||
editorRootElementRef$ | ||
editorRootElementRef$, | ||
imageUploadHandler$ | ||
); | ||
@@ -54,4 +55,4 @@ const saveImage = usePublisher(saveImage$); | ||
}, | ||
/* @__PURE__ */ React__default.createElement("div", { className: styles.formField }, /* @__PURE__ */ React__default.createElement("label", { htmlFor: "file" }, t("uploadImage.uploadInstructions", "Upload an image from your device:")), /* @__PURE__ */ React__default.createElement("input", { type: "file", accept: "image/*", ...register("file") })), | ||
/* @__PURE__ */ React__default.createElement("div", { className: styles.formField }, /* @__PURE__ */ React__default.createElement("label", { htmlFor: "src" }, t("uploadImage.addViaUrlInstructions", "Or add an image from an URL:")), /* @__PURE__ */ React__default.createElement( | ||
imageUploadHandler !== null && /* @__PURE__ */ React__default.createElement("div", { className: styles.formField }, /* @__PURE__ */ React__default.createElement("label", { htmlFor: "file" }, t("uploadImage.uploadInstructions", "Upload an image from your device:")), /* @__PURE__ */ React__default.createElement("input", { type: "file", accept: "image/*", ...register("file") })), | ||
/* @__PURE__ */ React__default.createElement("div", { className: styles.formField }, /* @__PURE__ */ React__default.createElement("label", { htmlFor: "src" }, imageUploadHandler !== null ? t("uploadImage.addViaUrlInstructions", "Or add an image from an URL:") : t("uploadImage.addViaUrlInstructionsNoUpload", "Add an image from an URL:")), /* @__PURE__ */ React__default.createElement( | ||
DownshiftAutoComplete, | ||
@@ -58,0 +59,0 @@ { |
@@ -86,2 +86,5 @@ import { $wrapNodeInElement, mergeRegister } from "@lexical/utils"; | ||
(event) => { | ||
if (!theUploadHandler) { | ||
return false; | ||
} | ||
return onDragStart(event); | ||
@@ -88,0 +91,0 @@ }, |
@@ -14,3 +14,3 @@ { | ||
"type": "module", | ||
"version": "3.9.0", | ||
"version": "3.9.1", | ||
"description": "React component for rich text markdown editing", | ||
@@ -17,0 +17,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
529180
13865