@mdxeditor/editor 3.54.0 → 3.54.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.
|
@@ -12,6 +12,7 @@ const InsertImage = React__default.forwardRef((_, forwardedRef) => {
|
|
|
12
12
|
return /* @__PURE__ */ React__default.createElement(
|
|
13
13
|
RadixToolbar.Button,
|
|
14
14
|
{
|
|
15
|
+
"aria-label": t("toolbar.image", "Insert image"),
|
|
15
16
|
className: styles.toolbarButton,
|
|
16
17
|
ref: forwardedRef,
|
|
17
18
|
disabled: readOnly,
|
|
@@ -3,7 +3,7 @@ import * as RadixToolbar from "@radix-ui/react-toolbar";
|
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { useCombobox } from "downshift";
|
|
6
|
-
import { editorRootElementRef$, readOnly$, iconComponentFor
|
|
6
|
+
import { editorRootElementRef$, readOnly$, iconComponentFor$, useTranslation } from "../../core/index.js";
|
|
7
7
|
import styles from "../../../styles/ui.module.css.js";
|
|
8
8
|
import { TooltipWrap } from "./TooltipWrap.js";
|
|
9
9
|
import { useCellValues, useCellValue } from "@mdxeditor/gurx";
|
|
@@ -18,7 +18,7 @@ const DialogButton = React__default.forwardRef(({ autocompleteSuggestions = [],
|
|
|
18
18
|
},
|
|
19
19
|
[onSubmit]
|
|
20
20
|
);
|
|
21
|
-
return /* @__PURE__ */ React__default.createElement(Dialog.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(Dialog.Trigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { className: styles.toolbarButton, ref: forwardedRef, disabled: readOnly }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title: tooltipTitle }, buttonContent))), /* @__PURE__ */ React__default.createElement(Dialog.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Dialog.Overlay, { className: styles.dialogOverlay }), /* @__PURE__ */ React__default.createElement(Dialog.Content, { className: styles.dialogContent }, /* @__PURE__ */ React__default.createElement(
|
|
21
|
+
return /* @__PURE__ */ React__default.createElement(Dialog.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(Dialog.Trigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { "aria-label": tooltipTitle, className: styles.toolbarButton, ref: forwardedRef, disabled: readOnly }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title: tooltipTitle }, buttonContent))), /* @__PURE__ */ React__default.createElement(Dialog.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Dialog.Overlay, { className: styles.dialogOverlay }), /* @__PURE__ */ React__default.createElement(Dialog.Content, { className: styles.dialogContent }, /* @__PURE__ */ React__default.createElement(
|
|
22
22
|
DialogForm,
|
|
23
23
|
{
|
|
24
24
|
submitButtonTitle,
|
|
@@ -31,6 +31,7 @@ const DialogButton = React__default.forwardRef(({ autocompleteSuggestions = [],
|
|
|
31
31
|
const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlaceholder, submitButtonTitle }) => {
|
|
32
32
|
const [items, setItems] = React__default.useState(autocompleteSuggestions.slice(0, MAX_SUGGESTIONS));
|
|
33
33
|
const iconComponentFor = useCellValue(iconComponentFor$);
|
|
34
|
+
const t = useTranslation();
|
|
34
35
|
const enableAutoComplete = autocompleteSuggestions.length > 0;
|
|
35
36
|
const { isOpen, getToggleButtonProps, getMenuProps, getInputProps, highlightedIndex, getItemProps, selectedItem } = useCombobox({
|
|
36
37
|
initialInputValue: "",
|
|
@@ -106,7 +107,7 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
|
|
|
106
107
|
className: classNames(styles.actionButton, styles.primaryActionButton)
|
|
107
108
|
},
|
|
108
109
|
iconComponentFor("check")
|
|
109
|
-
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { className: styles.actionButton }, iconComponentFor("close")));
|
|
110
|
+
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { "aria-label": t("dialog.close", "Close dialog"), className: styles.actionButton }, iconComponentFor("close")));
|
|
110
111
|
};
|
|
111
112
|
export {
|
|
112
113
|
DialogButton
|
|
@@ -47,7 +47,7 @@ const SelectButtonTrigger = ({
|
|
|
47
47
|
className
|
|
48
48
|
}) => {
|
|
49
49
|
const [readOnly, iconComponentFor] = useCellValues(readOnly$, iconComponentFor$);
|
|
50
|
-
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))));
|
|
50
|
+
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { "aria-label": title, className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))));
|
|
51
51
|
};
|
|
52
52
|
const Select = (props) => {
|
|
53
53
|
return /* @__PURE__ */ React__default.createElement(RadixSelect.Root, { value: props.value || "", onValueChange: props.onChange, disabled: props.disabled }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { title: props.triggerTitle, placeholder: props.placeholder }), /* @__PURE__ */ React__default.createElement(SelectContent, null, props.items.map((item, index) => {
|
|
@@ -15,7 +15,7 @@ function decorateWithRef(Component, decoratedProps) {
|
|
|
15
15
|
}
|
|
16
16
|
function addTooltipToChildren(Component) {
|
|
17
17
|
return ({ title, children, ...props }) => {
|
|
18
|
-
return /* @__PURE__ */ React__default.createElement(Component, { ...props }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, children));
|
|
18
|
+
return /* @__PURE__ */ React__default.createElement(Component, { "aria-label": title, ...props }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, children));
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
const Root = ({ readOnly, children, className }) => {
|