@mdxeditor/editor 3.22.0 → 3.22.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.
package/dist/index.d.ts CHANGED
@@ -2516,6 +2516,7 @@ export declare const Select: <T extends string>(props: {
2516
2516
  onChange: (value: T) => void;
2517
2517
  triggerTitle: string;
2518
2518
  placeholder: string;
2519
+ disabled?: boolean;
2519
2520
  items: ({
2520
2521
  label: string | JSX.Element;
2521
2522
  value: T;
@@ -83,6 +83,7 @@ const CodeMirrorEditor = ({ language, nodeKey, code, focusEmitter }) => {
83
83
  /* @__PURE__ */ React__default.createElement("div", { className: styles.codeMirrorToolbar }, /* @__PURE__ */ React__default.createElement(
84
84
  Select,
85
85
  {
86
+ disabled: readOnly,
86
87
  value: language,
87
88
  onChange: (language2) => {
88
89
  parentEditor.update(() => {
@@ -103,6 +104,7 @@ const CodeMirrorEditor = ({ language, nodeKey, code, focusEmitter }) => {
103
104
  {
104
105
  className: styles.iconButton,
105
106
  type: "button",
107
+ disabled: readOnly,
106
108
  title: t("codeblock.delete", "Delete code block"),
107
109
  onClick: (e) => {
108
110
  e.preventDefault();
@@ -1,5 +1,5 @@
1
1
  import { $isListItemNode, $isListNode } from "@lexical/list";
2
- import { $isTextNode, $isElementNode } from "lexical";
2
+ import { $isTextNode, $isElementNode, $isDecoratorNode } from "lexical";
3
3
  const LexicalListItemVisitor = {
4
4
  testLexicalNode: $isListItemNode,
5
5
  visitLexicalNode: ({ lexicalNode, mdastParent, actions }) => {
@@ -22,7 +22,7 @@ const LexicalListItemVisitor = {
22
22
  });
23
23
  let surroundingParagraph = null;
24
24
  for (const child of lexicalNode.getChildren()) {
25
- if ($isTextNode(child) || $isElementNode(child) && child.isInline()) {
25
+ if ($isTextNode(child) || $isElementNode(child) && child.isInline() || $isDecoratorNode(child) && child.isInline()) {
26
26
  if (!surroundingParagraph) {
27
27
  surroundingParagraph = actions.appendToParent(listItem, {
28
28
  type: "paragraph",
@@ -21,6 +21,7 @@ const SandpackEditor = ({ nodeKey, code, focusEmitter, preset }) => {
21
21
  {
22
22
  className: styles.iconButton,
23
23
  type: "button",
24
+ disabled: readOnly,
24
25
  title: t("codeblock.delete", "Delete code block"),
25
26
  onClick: (e) => {
26
27
  e.preventDefault();
@@ -50,7 +50,7 @@ const SelectButtonTrigger = ({
50
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"))));
51
51
  };
52
52
  const Select = (props) => {
53
- return /* @__PURE__ */ React__default.createElement(RadixSelect.Root, { value: props.value || void 0, onValueChange: props.onChange }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { title: props.triggerTitle, placeholder: props.placeholder }), /* @__PURE__ */ React__default.createElement(SelectContent, null, props.items.map((item, index) => {
53
+ return /* @__PURE__ */ React__default.createElement(RadixSelect.Root, { value: props.value || void 0, 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) => {
54
54
  if (item === "separator") {
55
55
  return /* @__PURE__ */ React__default.createElement(RadixSelect.Separator, { key: index });
56
56
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.22.0",
14
+ "version": "3.22.2",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",