@mdxeditor/editor 3.3.6 → 3.4.0

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.
package/dist/MDXEditor.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useCellValue, useCellValues, usePublisher, useRealm } from "@mdxeditor/gurx";
2
2
  import React__default from "react";
3
3
  import { RealmWithPlugins } from "./RealmWithPlugins.js";
4
- import { corePlugin, rootEditor$, contentEditableClassName$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, editorRootElementRef$, viewMode$, markdownSourceEditorValue$, markdown$, setMarkdown$, insertMarkdown$ } from "./plugins/core/index.js";
4
+ import { corePlugin, rootEditor$, useTranslation, contentEditableClassName$, composerChildren$, topAreaChildren$, editorWrappers$, placeholder$, editorRootElementRef$, viewMode$, markdownSourceEditorValue$, markdown$, setMarkdown$, insertMarkdown$ } from "./plugins/core/index.js";
5
5
  import { ContentEditable } from "@lexical/react/LexicalContentEditable.js";
6
6
  import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary.js";
7
7
  import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin.js";
@@ -19,6 +19,7 @@ const LexicalProvider = ({ children }) => {
19
19
  return /* @__PURE__ */ React__default.createElement(LexicalComposerContext.Provider, { value: composerContextValue }, children);
20
20
  };
21
21
  const RichTextEditor = () => {
22
+ const t = useTranslation();
22
23
  const [contentEditableClassName, composerChildren, topAreaChildren, editorWrappers, placeholder] = useCellValues(
23
24
  contentEditableClassName$,
24
25
  composerChildren$,
@@ -29,7 +30,13 @@ const RichTextEditor = () => {
29
30
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, topAreaChildren.map((Child, index) => /* @__PURE__ */ React__default.createElement(Child, { key: index })), /* @__PURE__ */ React__default.createElement(RenderRecursiveWrappers, { wrappers: editorWrappers }, /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.rootContentEditableWrapper, "mdxeditor-root-contenteditable") }, /* @__PURE__ */ React__default.createElement(
30
31
  RichTextPlugin,
31
32
  {
32
- contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { className: classNames(styles.contentEditable, contentEditableClassName), ariaLabel: "editable markdown" }),
33
+ contentEditable: /* @__PURE__ */ React__default.createElement(
34
+ ContentEditable,
35
+ {
36
+ className: classNames(styles.contentEditable, contentEditableClassName),
37
+ ariaLabel: t("contentArea.editableMarkdown", "editable markdown")
38
+ }
39
+ ),
33
40
  placeholder: /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.contentEditable, styles.placeholder, contentEditableClassName) }, /* @__PURE__ */ React__default.createElement("p", null, placeholder)),
34
41
  ErrorBoundary: LexicalErrorBoundary
35
42
  }
@@ -5,7 +5,7 @@ import React__default from "react";
5
5
  import styles from "../../../styles/ui.module.css.js";
6
6
  import { TooltipWrap } from "./TooltipWrap.js";
7
7
  import { SelectButtonTrigger, SelectContent, SelectItem } from "./select.js";
8
- import { readOnly$, editorInFocus$ } from "../../core/index.js";
8
+ import { useTranslation, readOnly$, editorInFocus$ } from "../../core/index.js";
9
9
  import { useCellValue } from "@mdxeditor/gurx";
10
10
  function decorateWithRef(Component, decoratedProps) {
11
11
  return React__default.forwardRef((props, ref) => {
@@ -72,10 +72,11 @@ const SingleChoiceToggleGroup = ({
72
72
  className,
73
73
  items
74
74
  }) => {
75
+ const t = useTranslation();
75
76
  return /* @__PURE__ */ React__default.createElement("div", { className: styles.toolbarGroupOfGroups }, /* @__PURE__ */ React__default.createElement(
76
77
  RadixToolbar.ToggleGroup,
77
78
  {
78
- "aria-label": "toggle group",
79
+ "aria-label": t("toolbar.toggleGroup", "toggle group"),
79
80
  type: "single",
80
81
  className: classNames(styles.toolbarToggleSingleGroup, className),
81
82
  onValueChange: onChange,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.3.6",
14
+ "version": "3.4.0",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",