@mdxeditor/editor 3.29.0 → 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: state.type !== "inactive",
29
+ open: true,
28
30
  onOpenChange: (open) => {
29
31
  if (!open) {
30
32
  closeImageDialog();
@@ -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: linkDialogState.type !== "inactive" }, /* @__PURE__ */ React__default.createElement(
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: `${(theRect == null ? void 0 : theRect.top) ?? 0}px`,
114
- left: `${(theRect == null ? void 0 : theRect.left) ?? 0}px`,
115
- width: `${(theRect == null ? void 0 : theRect.width) ?? 0}px`,
116
- height: `${(theRect == null ? void 0 : theRect.height) ?? 0}px`
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(
@@ -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.2",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",