@mdxeditor/editor 3.1.0 → 3.2.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.
@@ -1,3 +1,4 @@
1
+ const DEFAULT_FORMAT = 0;
1
2
  const IS_BOLD = 1;
2
3
  const IS_ITALIC = 2;
3
4
  const IS_STRIKETHROUGH = 4;
@@ -5,9 +6,12 @@ const IS_UNDERLINE = 8;
5
6
  const IS_CODE = 16;
6
7
  const IS_SUBSCRIPT = 32;
7
8
  const IS_SUPERSCRIPT = 64;
9
+ const IS_HIGHLIGHT = 128;
8
10
  export {
11
+ DEFAULT_FORMAT,
9
12
  IS_BOLD,
10
13
  IS_CODE,
14
+ IS_HIGHLIGHT,
11
15
  IS_ITALIC,
12
16
  IS_STRIKETHROUGH,
13
17
  IS_SUBSCRIPT,
package/dist/MDXEditor.js CHANGED
@@ -28,7 +28,7 @@ const RichTextEditor = () => {
28
28
  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(
29
29
  RichTextPlugin,
30
30
  {
31
- contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { className: classNames(styles.contentEditable, contentEditableClassName) }),
31
+ contentEditable: /* @__PURE__ */ React__default.createElement(ContentEditable, { className: classNames(styles.contentEditable, contentEditableClassName), ariaLabel: "editable markdown" }),
32
32
  placeholder: /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.contentEditable, styles.placeholder, contentEditableClassName) }, /* @__PURE__ */ React__default.createElement("p", null, placeholder)),
33
33
  ErrorBoundary: LexicalErrorBoundary
34
34
  }
package/dist/index.d.ts CHANGED
@@ -731,7 +731,7 @@ export declare function curry1to0<T, R>(proc: (arg: T) => R, arg: T): () => R;
731
731
  */
732
732
  export declare function curry2to1<T, K, R>(proc: (arg1: T, arg2: K) => R, arg1: T): (arg2: K) => R;
733
733
 
734
- declare const DEFAULT_FORMAT: 0;
734
+ export declare const DEFAULT_FORMAT: 0;
735
735
 
736
736
  /**
737
737
  * Contains the default language to use when creating a new code block if no language is passed.
@@ -1015,7 +1015,10 @@ export declare type EditorSubscription = (activeEditor: LexicalEditor) => () =>
1015
1015
 
1016
1016
  /* Excluded from this release type: exportVisitors$ */
1017
1017
 
1018
- declare interface ExpressionValue {
1018
+ /**
1019
+ * @group JSX
1020
+ */
1021
+ export declare interface ExpressionValue {
1019
1022
  type: 'expression';
1020
1023
  value: string;
1021
1024
  }
@@ -1031,11 +1034,14 @@ export declare interface FallbackOption {
1031
1034
  fallback: () => default_2.ReactNode;
1032
1035
  }
1033
1036
 
1034
- declare interface FileImageParameters extends BaseImageParameters {
1037
+ /**
1038
+ * @group Image
1039
+ */
1040
+ export declare interface FileImageParameters extends BaseImageParameters {
1035
1041
  file: File;
1036
1042
  }
1037
1043
 
1038
- declare type FORMAT = typeof DEFAULT_FORMAT | typeof IS_BOLD | typeof IS_ITALIC | typeof IS_STRIKETHROUGH | typeof IS_UNDERLINE | typeof IS_CODE | typeof IS_SUBSCRIPT | typeof IS_SUPERSCRIPT | typeof IS_HIGHLIGHT;
1044
+ export declare type FORMAT = typeof DEFAULT_FORMAT | typeof IS_BOLD | typeof IS_ITALIC | typeof IS_STRIKETHROUGH | typeof IS_UNDERLINE | typeof IS_CODE | typeof IS_SUBSCRIPT | typeof IS_SUPERSCRIPT | typeof IS_HIGHLIGHT;
1039
1045
 
1040
1046
  /**
1041
1047
  * Fetches a value from the Lexical editor read cycle.
@@ -1453,21 +1459,21 @@ export declare const InsertThematicBreak: default_2.FC;
1453
1459
  */
1454
1460
  export declare const IS_APPLE: boolean;
1455
1461
 
1456
- declare const IS_BOLD: 1;
1462
+ export declare const IS_BOLD: 1;
1457
1463
 
1458
- declare const IS_CODE: 16;
1464
+ export declare const IS_CODE: 16;
1459
1465
 
1460
- declare const IS_HIGHLIGHT: 128;
1466
+ export declare const IS_HIGHLIGHT: 128;
1461
1467
 
1462
- declare const IS_ITALIC: 2;
1468
+ export declare const IS_ITALIC: 2;
1463
1469
 
1464
- declare const IS_STRIKETHROUGH: 4;
1470
+ export declare const IS_STRIKETHROUGH: 4;
1465
1471
 
1466
- declare const IS_SUBSCRIPT: 32;
1472
+ export declare const IS_SUBSCRIPT: 32;
1467
1473
 
1468
- declare const IS_SUPERSCRIPT: 64;
1474
+ export declare const IS_SUPERSCRIPT: 64;
1469
1475
 
1470
- declare const IS_UNDERLINE: 8;
1476
+ export declare const IS_UNDERLINE: 8;
1471
1477
 
1472
1478
  /**
1473
1479
  * Determines if the given node is a HTML MDAST node.
@@ -1556,7 +1562,10 @@ export declare const jsxIsAvailable$: NodeRef<boolean>;
1556
1562
  */
1557
1563
  export declare const jsxPlugin: (params?: JsxPluginParams | undefined) => RealmPlugin;
1558
1564
 
1559
- declare interface JsxPluginParams {
1565
+ /**
1566
+ * @group JSX
1567
+ */
1568
+ export declare interface JsxPluginParams {
1560
1569
  /**
1561
1570
  * A set of descriptors that document the JSX elements used in the document.
1562
1571
  */
@@ -1567,7 +1576,7 @@ declare interface JsxPluginParams {
1567
1576
  allowFragment?: boolean;
1568
1577
  }
1569
1578
 
1570
- declare type JsxProperties = Record<string, string | ExpressionValue>;
1579
+ export declare type JsxProperties = Record<string, string | ExpressionValue>;
1571
1580
 
1572
1581
  /**
1573
1582
  * Defines the structure of a JSX component property.
@@ -2476,13 +2485,16 @@ export declare const SingleChoiceToggleGroup: <T extends string>({ value, onChan
2476
2485
  contents: default_2.ReactNode;
2477
2486
  }[];
2478
2487
  onChange: (value: T | '') => void;
2479
- value: T;
2488
+ value: T | '';
2480
2489
  className?: string;
2481
2490
  }) => default_2.JSX.Element;
2482
2491
 
2483
2492
  /* Excluded from this release type: SingleToggleGroup */
2484
2493
 
2485
- declare interface SrcImageParameters extends BaseImageParameters {
2494
+ /**
2495
+ * @group Image
2496
+ */
2497
+ export declare interface SrcImageParameters extends BaseImageParameters {
2486
2498
  src: string;
2487
2499
  }
2488
2500
 
package/dist/index.js CHANGED
@@ -58,6 +58,7 @@ import { makeHslTransparent } from "./utils/makeHslTransparent.js";
58
58
  import { uuidv4 } from "./utils/uuid4.js";
59
59
  import { voidEmitter } from "./utils/voidEmitter.js";
60
60
  import { RealmWithPlugins, realmPlugin } from "./RealmWithPlugins.js";
61
+ import { DEFAULT_FORMAT, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE } from "./FormatConstants.js";
61
62
  import { htmlTags, isMdastHTMLNode } from "./plugins/core/MdastHTMLNode.js";
62
63
  import { $createGenericHTMLNode, $isGenericHTMLNode, GenericHTMLNode, TYPE_NAME } from "./plugins/core/GenericHTMLNode.js";
63
64
  import { $createTableNode, $isTableNode, TableNode } from "./plugins/table/TableNode.js";
@@ -93,6 +94,7 @@ export {
93
94
  CodeToggle,
94
95
  ConditionalContents,
95
96
  CreateLink,
97
+ DEFAULT_FORMAT,
96
98
  DialogButton,
97
99
  DiffSourceToggleWrapper,
98
100
  DirectiveNode,
@@ -101,6 +103,14 @@ export {
101
103
  GenericJsxEditor,
102
104
  INSERT_IMAGE_COMMAND,
103
105
  IS_APPLE,
106
+ IS_BOLD,
107
+ IS_CODE,
108
+ IS_HIGHLIGHT,
109
+ IS_ITALIC,
110
+ IS_STRIKETHROUGH,
111
+ IS_SUBSCRIPT,
112
+ IS_SUPERSCRIPT,
113
+ IS_UNDERLINE,
104
114
  ImageNode,
105
115
  InsertAdmonition,
106
116
  InsertCodeBlock,
@@ -75,6 +75,7 @@ const SingleChoiceToggleGroup = ({
75
75
  return /* @__PURE__ */ React__default.createElement("div", { className: styles.toolbarGroupOfGroups }, /* @__PURE__ */ React__default.createElement(
76
76
  RadixToolbar.ToggleGroup,
77
77
  {
78
+ "aria-label": "toggle group",
78
79
  type: "single",
79
80
  className: classNames(styles.toolbarToggleSingleGroup, className),
80
81
  onValueChange: onChange,
@@ -83,7 +84,7 @@ const SingleChoiceToggleGroup = ({
83
84
  e.preventDefault();
84
85
  }
85
86
  },
86
- items.map((item, index) => /* @__PURE__ */ React__default.createElement(ToolbarToggleItem, { key: index, value: item.value }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title: item.title }, item.contents)))
87
+ items.map((item, index) => /* @__PURE__ */ React__default.createElement(ToolbarToggleItem, { key: index, "aria-label": item.title, value: item.value }, /* @__PURE__ */ React__default.createElement(TooltipWrap, { title: item.title }, item.contents)))
87
88
  ));
88
89
  };
89
90
  const ButtonOrDropdownButton = (props) => {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.1.0",
14
+ "version": "3.2.0",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",