@mdxeditor/editor 3.29.1 → 3.29.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.
|
@@ -21,10 +21,12 @@ const ImageDialog = () => {
|
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
22
22
|
values: state.type === "editing" ? state.initialValues : {}
|
|
23
23
|
});
|
|
24
|
+
if (state.type === "inactive")
|
|
25
|
+
return null;
|
|
24
26
|
return /* @__PURE__ */ React__default.createElement(
|
|
25
27
|
Dialog.Root,
|
|
26
28
|
{
|
|
27
|
-
open:
|
|
29
|
+
open: true,
|
|
28
30
|
onOpenChange: (open) => {
|
|
29
31
|
if (!open) {
|
|
30
32
|
closeImageDialog();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLinkMatcherWithRegExp, AutoLinkPlugin } from "@lexical/react/LexicalAutoLinkPlugin";
|
|
2
2
|
import React__default from "react";
|
|
3
|
-
const URL_REGEX = /(
|
|
3
|
+
const URL_REGEX = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
4
4
|
const EMAIL_REGEX = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
5
5
|
const MATCHERS = [
|
|
6
6
|
createLinkMatcherWithRegExp(URL_REGEX, (text) => {
|
|
@@ -102,18 +102,20 @@ const LinkDialog = () => {
|
|
|
102
102
|
}, [activeEditor, publishWindowChange]);
|
|
103
103
|
const [copyUrlTooltipOpen, setCopyUrlTooltipOpen] = React__default.useState(false);
|
|
104
104
|
const t = useTranslation();
|
|
105
|
+
if (linkDialogState.type === "inactive")
|
|
106
|
+
return null;
|
|
105
107
|
const theRect = linkDialogState.rectangle;
|
|
106
108
|
const urlIsExternal = linkDialogState.type === "preview" && linkDialogState.url.startsWith("http");
|
|
107
|
-
return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open:
|
|
109
|
+
return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open: true }, /* @__PURE__ */ React__default.createElement(
|
|
108
110
|
RadixPopover.Anchor,
|
|
109
111
|
{
|
|
110
112
|
"data-visible": linkDialogState.type === "edit",
|
|
111
113
|
className: styles.linkDialogAnchor,
|
|
112
114
|
style: {
|
|
113
|
-
top: `${
|
|
114
|
-
left: `${
|
|
115
|
-
width: `${
|
|
116
|
-
height: `${
|
|
115
|
+
top: `${theRect.top}px`,
|
|
116
|
+
left: `${theRect.left}px`,
|
|
117
|
+
width: `${theRect.width}px`,
|
|
118
|
+
height: `${theRect.height}px`
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
), /* @__PURE__ */ React__default.createElement(RadixPopover.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(
|