@mdxeditor/editor 3.29.0 → 3.29.1

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.
@@ -1,6 +1,6 @@
1
1
  import { createLinkMatcherWithRegExp, AutoLinkPlugin } from "@lexical/react/LexicalAutoLinkPlugin";
2
2
  import React__default from "react";
3
- const URL_REGEX = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
3
+ const URL_REGEX = /(?:(?:https?|ftp):\/\/)?(?:[\w-]+(?::[\w-]+)?@)?(?:(?:[\w-]+(?:\.[\w-]+)*(?:\.[a-zA-Z]{2,}))|(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}))(?::[0-9]{1,5})?(?:\/[^\s]*)?/;
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) => {
@@ -21,17 +21,23 @@ const DiffSourceToggleWrapper = ({
21
21
  if (options.includes("source")) {
22
22
  toggleGroupItems.push({ title: t("toolbar.source", "Source mode"), contents: iconComponentFor("markdown"), value: "source" });
23
23
  }
24
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.diffMode", "Diff mode")) : SourceToolbar ?? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.source", "Source mode")), /* @__PURE__ */ React__default.createElement("div", { style: { marginLeft: "auto", pointerEvents: "auto", opacity: 1 } }, /* @__PURE__ */ React__default.createElement(
25
- SingleChoiceToggleGroup,
24
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.diffMode", "Diff mode")) : SourceToolbar ?? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, t("toolbar.source", "Source mode")), /* @__PURE__ */ React__default.createElement(
25
+ "div",
26
26
  {
27
- className: styles.diffSourceToggle,
28
- value: viewMode,
29
- items: toggleGroupItems,
30
- onChange: (value) => {
31
- changeViewMode(value === "" ? "rich-text" : value);
27
+ style: { marginLeft: "auto", pointerEvents: "auto", opacity: 1, position: "sticky", right: 0, backgroundColor: "var(--baseBase)" }
28
+ },
29
+ /* @__PURE__ */ React__default.createElement(
30
+ SingleChoiceToggleGroup,
31
+ {
32
+ className: styles.diffSourceToggle,
33
+ value: viewMode,
34
+ items: toggleGroupItems,
35
+ onChange: (value) => {
36
+ changeViewMode(value === "" ? "rich-text" : value);
37
+ }
32
38
  }
33
- }
34
- )));
39
+ )
40
+ ));
35
41
  };
36
42
  export {
37
43
  DiffSourceToggleWrapper
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.29.0",
14
+ "version": "3.29.1",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",