@uiw/react-md-editor 3.24.1 → 3.25.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.
Files changed (55) hide show
  1. package/README.md +47 -2
  2. package/dist/mdeditor.js +1828 -1806
  3. package/dist/mdeditor.min.js +1 -1
  4. package/esm/Context.d.ts +1 -1
  5. package/esm/Editor.d.ts +4 -149
  6. package/esm/Editor.js +0 -1
  7. package/esm/Editor.nohighlight.d.ts +12 -0
  8. package/esm/Editor.nohighlight.js +255 -0
  9. package/esm/Types.d.ts +148 -0
  10. package/esm/Types.js +1 -0
  11. package/esm/components/DragBar/index.d.ts +1 -1
  12. package/esm/components/TextArea/Markdown.d.ts +1 -1
  13. package/esm/components/TextArea/Textarea.d.ts +1 -1
  14. package/esm/components/TextArea/index.d.ts +1 -1
  15. package/esm/components/TextArea/index.nohighlight.d.ts +27 -0
  16. package/esm/components/TextArea/index.nohighlight.js +93 -0
  17. package/esm/components/Toolbar/Child.d.ts +1 -1
  18. package/esm/components/Toolbar/index.d.ts +1 -1
  19. package/esm/index.d.ts +2 -0
  20. package/esm/index.js +2 -0
  21. package/esm/index.nohighlight.d.ts +13 -0
  22. package/esm/index.nohighlight.js +13 -0
  23. package/lib/Context.d.ts +1 -1
  24. package/lib/Editor.d.ts +4 -149
  25. package/lib/Editor.nohighlight.d.ts +12 -0
  26. package/lib/Editor.nohighlight.js +317 -0
  27. package/lib/Types.d.ts +148 -0
  28. package/lib/Types.js +1 -0
  29. package/lib/components/DragBar/index.d.ts +1 -1
  30. package/lib/components/TextArea/Markdown.d.ts +1 -1
  31. package/lib/components/TextArea/Textarea.d.ts +1 -1
  32. package/lib/components/TextArea/index.d.ts +1 -1
  33. package/lib/components/TextArea/index.nohighlight.d.ts +27 -0
  34. package/lib/components/TextArea/index.nohighlight.js +98 -0
  35. package/lib/components/Toolbar/Child.d.ts +1 -1
  36. package/lib/components/Toolbar/index.d.ts +1 -1
  37. package/lib/index.d.ts +2 -0
  38. package/lib/index.js +12 -0
  39. package/lib/index.nohighlight.d.ts +13 -0
  40. package/lib/index.nohighlight.js +98 -0
  41. package/nohighlight.d.ts +13 -0
  42. package/package.json +17 -2
  43. package/src/Context.tsx +1 -1
  44. package/src/Editor.nohighlight.tsx +264 -0
  45. package/src/Editor.tsx +5 -151
  46. package/src/Types.ts +151 -0
  47. package/src/components/DragBar/index.tsx +1 -1
  48. package/src/components/TextArea/Markdown.tsx +2 -2
  49. package/src/components/TextArea/Textarea.tsx +1 -1
  50. package/src/components/TextArea/index.nohighlight.tsx +109 -0
  51. package/src/components/TextArea/index.tsx +1 -1
  52. package/src/components/Toolbar/Child.tsx +1 -1
  53. package/src/components/Toolbar/index.tsx +1 -1
  54. package/src/index.nohighlight.tsx +16 -0
  55. package/src/index.tsx +2 -0
package/lib/Types.d.ts ADDED
@@ -0,0 +1,148 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { MarkdownPreviewProps } from '@uiw/react-markdown-preview/nohighlight';
3
+ import type { ITextAreaProps } from './components/TextArea/index.nohighlight';
4
+ import type { ICommand, TextState } from './commands';
5
+ import type { ContextStore, PreviewType } from './Context';
6
+ export interface IProps {
7
+ prefixCls?: string;
8
+ className?: string;
9
+ }
10
+ export interface Statistics extends TextState {
11
+ /** total length of the document */
12
+ length: number;
13
+ /** Get the number of lines in the editor. */
14
+ lineCount: number;
15
+ }
16
+ export interface MDEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, IProps {
17
+ /**
18
+ * The Markdown value.
19
+ */
20
+ value?: string;
21
+ /**
22
+ * Event handler for the `onChange` event.
23
+ */
24
+ onChange?: (value?: string, event?: React.ChangeEvent<HTMLTextAreaElement>, state?: ContextStore) => void;
25
+ /**
26
+ * editor height change listener
27
+ */
28
+ onHeightChange?: (value?: CSSProperties['height'], oldValue?: CSSProperties['height'], state?: ContextStore) => void;
29
+ /** Some data on the statistics editor. */
30
+ onStatistics?: (data: Statistics) => void;
31
+ /**
32
+ * Can be used to make `Markdown Editor` focus itself on initialization. Defaults to on.
33
+ * it will be set to true when either the source `textarea` is focused,
34
+ * or it has an `autofocus` attribute and no other element is focused.
35
+ */
36
+ autoFocus?: ITextAreaProps['autoFocus'];
37
+ /**
38
+ * The height of the editor.
39
+ * ⚠️ `Dragbar` is invalid when **`height`** parameter percentage.
40
+ */
41
+ height?: CSSProperties['height'];
42
+ /**
43
+ * Custom toolbar heigth
44
+ * @default 29px
45
+ *
46
+ * @deprecated toolbar height adaptive: https://github.com/uiwjs/react-md-editor/issues/427
47
+ *
48
+ */
49
+ toolbarHeight?: number;
50
+ /**
51
+ * Show drag and drop tool. Set the height of the editor.
52
+ */
53
+ visibleDragbar?: boolean;
54
+ /**
55
+ * @deprecated use `visibleDragbar`
56
+ */
57
+ visiableDragbar?: boolean;
58
+ /**
59
+ * Show markdown preview.
60
+ */
61
+ preview?: PreviewType;
62
+ /**
63
+ * Full screen display editor.
64
+ */
65
+ fullscreen?: boolean;
66
+ /**
67
+ * Disable `fullscreen` setting body styles
68
+ */
69
+ overflow?: boolean;
70
+ /**
71
+ * Maximum drag height. `visibleDragbar=true`
72
+ */
73
+ maxHeight?: number;
74
+ /**
75
+ * Minimum drag height. `visibleDragbar=true`
76
+ */
77
+ minHeight?: number;
78
+ /**
79
+ * This is reset [react-markdown](https://github.com/rexxars/react-markdown) settings.
80
+ */
81
+ previewOptions?: Omit<MarkdownPreviewProps, 'source'>;
82
+ /**
83
+ * Set the `textarea` related props.
84
+ */
85
+ textareaProps?: ITextAreaProps;
86
+ /**
87
+ * Use div to replace TextArea or re-render TextArea
88
+ * @deprecated Please use ~~`renderTextarea`~~ -> `components`
89
+ */
90
+ renderTextarea?: ITextAreaProps['renderTextarea'];
91
+ /**
92
+ * re-render element
93
+ */
94
+ components?: {
95
+ /** Use div to replace TextArea or re-render TextArea */
96
+ textarea?: ITextAreaProps['renderTextarea'];
97
+ /**
98
+ * Override the default command element
99
+ * _`toolbar`_ < _`command[].render`_
100
+ */
101
+ toolbar?: ICommand['render'];
102
+ /** Custom markdown preview */
103
+ preview?: (source: string, state: ContextStore, dispath: React.Dispatch<ContextStore>) => JSX.Element;
104
+ };
105
+ /** Theme configuration */
106
+ 'data-color-mode'?: 'light' | 'dark';
107
+ /**
108
+ * Disable editing area code highlighting. The value is `false`, which increases the editing speed.
109
+ * @default true
110
+ */
111
+ highlightEnable?: boolean;
112
+ /**
113
+ * The number of characters to insert when pressing tab key.
114
+ * Default `2` spaces.
115
+ */
116
+ tabSize?: number;
117
+ /**
118
+ * If `false`, the `tab` key inserts a tab character into the textarea. If `true`, the `tab` key executes default behavior e.g. focus shifts to next element.
119
+ */
120
+ defaultTabEnable?: boolean;
121
+ /**
122
+ * You can create your own commands or reuse existing commands.
123
+ */
124
+ commands?: ICommand[];
125
+ /**
126
+ * Filter or modify your commands.
127
+ * https://github.com/uiwjs/react-md-editor/issues/296
128
+ */
129
+ commandsFilter?: (command: ICommand, isExtra: boolean) => false | ICommand;
130
+ /**
131
+ * You can create your own commands or reuse existing commands.
132
+ */
133
+ extraCommands?: ICommand[];
134
+ /**
135
+ * Hide the tool bar
136
+ */
137
+ hideToolbar?: boolean;
138
+ /** Whether to enable scrolling */
139
+ enableScroll?: boolean;
140
+ /** Toolbar on bottom */
141
+ toolbarBottom?: boolean;
142
+ /**
143
+ * The **`direction`** property sets the direction of text, table columns, and horizontal overflow. Use `rtl` for languages written from right to left (like Hebrew or Arabic), and `ltr` for those written from left to right (like English and most other languages).
144
+ *
145
+ * https://github.com/uiwjs/react-md-editor/issues/462
146
+ */
147
+ direction?: CSSProperties['direction'];
148
+ }
package/lib/Types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IProps } from '../../Editor';
2
+ import { IProps } from '../../Types';
3
3
  import './index.less';
4
4
  export interface IDragBarProps extends IProps {
5
5
  height: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IProps } from '../../Editor';
2
+ import { IProps } from '../../Types';
3
3
  export interface MarkdownProps extends IProps, React.HTMLAttributes<HTMLPreElement> {
4
4
  }
5
5
  export default function Markdown(props: MarkdownProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IProps } from '../../Editor';
2
+ import { IProps } from '../../Types';
3
3
  import './index.less';
4
4
  export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value'>, IProps {
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ContextStore, ExecuteCommandState } from '../../Context';
3
3
  import { TextAreaProps } from './Textarea';
4
- import { IProps } from '../../Editor';
4
+ import { IProps } from '../../Types';
5
5
  import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
6
6
  import './index.less';
7
7
  type RenderTextareaHandle = {
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { ContextStore, ExecuteCommandState } from '../../Context';
3
+ import { TextAreaProps } from './Textarea';
4
+ import { IProps } from '../../Types';
5
+ import { TextAreaCommandOrchestrator, ICommand } from '../../commands';
6
+ import './index.less';
7
+ type RenderTextareaHandle = {
8
+ dispatch: ContextStore['dispatch'];
9
+ onChange?: TextAreaProps['onChange'];
10
+ useContext?: {
11
+ commands: ContextStore['commands'];
12
+ extraCommands: ContextStore['extraCommands'];
13
+ commandOrchestrator?: TextAreaCommandOrchestrator;
14
+ };
15
+ shortcuts?: (e: KeyboardEvent | React.KeyboardEvent<HTMLTextAreaElement>, commands: ICommand[], commandOrchestrator?: TextAreaCommandOrchestrator, dispatch?: React.Dispatch<ContextStore>, state?: ExecuteCommandState) => void;
16
+ };
17
+ export interface ITextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onScroll'>, IProps {
18
+ value?: string;
19
+ onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
20
+ renderTextarea?: (props: React.TextareaHTMLAttributes<HTMLTextAreaElement> | React.HTMLAttributes<HTMLDivElement>, opts: RenderTextareaHandle) => JSX.Element;
21
+ }
22
+ export type TextAreaRef = {
23
+ text?: HTMLTextAreaElement;
24
+ warp?: HTMLDivElement;
25
+ };
26
+ export default function TextArea(props: ITextAreaProps): import("react/jsx-runtime").JSX.Element;
27
+ export {};
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = TextArea;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _Context = require("../../Context");
13
+ var _shortcuts = _interopRequireDefault(require("./shortcuts"));
14
+ var _Textarea = _interopRequireDefault(require("./Textarea"));
15
+ var _commands = require("../../commands");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ var _excluded = ["prefixCls", "className", "onScroll", "renderTextarea"];
18
+ function TextArea(props) {
19
+ var _ref = props || {},
20
+ prefixCls = _ref.prefixCls,
21
+ className = _ref.className,
22
+ onScroll = _ref.onScroll,
23
+ renderTextarea = _ref.renderTextarea,
24
+ otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
25
+ var _useContext = (0, _react.useContext)(_Context.EditorContext),
26
+ markdown = _useContext.markdown,
27
+ scrollTop = _useContext.scrollTop,
28
+ commands = _useContext.commands,
29
+ extraCommands = _useContext.extraCommands,
30
+ dispatch = _useContext.dispatch;
31
+ var textRef = _react["default"].useRef(null);
32
+ var executeRef = _react["default"].useRef();
33
+ var warp = /*#__PURE__*/_react["default"].createRef();
34
+ (0, _react.useEffect)(function () {
35
+ var state = {};
36
+ if (warp.current) {
37
+ state.textareaWarp = warp.current || undefined;
38
+ warp.current.scrollTop = scrollTop || 0;
39
+ }
40
+ if (dispatch) {
41
+ dispatch((0, _objectSpread2["default"])({}, state));
42
+ }
43
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44
+ }, []);
45
+ (0, _react.useEffect)(function () {
46
+ if (textRef.current && dispatch) {
47
+ var _commandOrchestrator = new _commands.TextAreaCommandOrchestrator(textRef.current);
48
+ executeRef.current = _commandOrchestrator;
49
+ dispatch({
50
+ textarea: textRef.current,
51
+ commandOrchestrator: _commandOrchestrator
52
+ });
53
+ }
54
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ }, []);
56
+ var textStyle = {
57
+ WebkitTextFillColor: 'initial',
58
+ overflow: 'auto'
59
+ };
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
61
+ ref: warp,
62
+ className: "".concat(prefixCls, "-area ").concat(className || ''),
63
+ onScroll: onScroll,
64
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
+ className: "".concat(prefixCls, "-text"),
66
+ children: renderTextarea ? /*#__PURE__*/_react["default"].cloneElement(renderTextarea((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, otherProps), {}, {
67
+ value: markdown,
68
+ autoComplete: 'off',
69
+ autoCorrect: 'off',
70
+ spellCheck: 'false',
71
+ autoCapitalize: 'off',
72
+ className: "".concat(prefixCls, "-text-input"),
73
+ style: {
74
+ WebkitTextFillColor: 'inherit',
75
+ overflow: 'auto'
76
+ }
77
+ }), {
78
+ dispatch: dispatch,
79
+ onChange: otherProps.onChange,
80
+ shortcuts: _shortcuts["default"],
81
+ useContext: {
82
+ commands: commands,
83
+ extraCommands: extraCommands,
84
+ commandOrchestrator: executeRef.current
85
+ }
86
+ }), {
87
+ ref: textRef
88
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
89
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Textarea["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
90
+ prefixCls: prefixCls
91
+ }, otherProps), {}, {
92
+ style: textStyle
93
+ }))
94
+ })
95
+ })
96
+ });
97
+ }
98
+ module.exports = exports.default;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import './Child.less';
3
- import { IToolbarProps } from './';
3
+ import { type IToolbarProps } from './';
4
4
  export type ChildProps = IToolbarProps & {
5
5
  children?: JSX.Element;
6
6
  groupName?: string;
@@ -1,4 +1,4 @@
1
- import { IProps } from '../../Editor';
1
+ import { IProps } from '../../Types';
2
2
  import { ICommand } from '../../commands';
3
3
  import './index.less';
4
4
  export interface IToolbarProps extends IProps {
package/lib/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import MDEditor from './Editor';
2
2
  import * as commands from './commands';
3
3
  import * as MarkdownUtil from './utils/markdownUtils';
4
+ import './index.less';
4
5
  export * from './commands';
5
6
  export * from './commands/group';
6
7
  export * from './utils/markdownUtils';
7
8
  export * from './utils/InsertTextAtPosition';
8
9
  export * from './Editor';
9
10
  export * from './Context';
11
+ export * from './Types';
10
12
  export { MarkdownUtil, commands };
11
13
  export default MDEditor;
package/lib/index.js CHANGED
@@ -83,4 +83,16 @@ Object.keys(_Context).forEach(function (key) {
83
83
  }
84
84
  });
85
85
  });
86
+ var _Types = require("./Types");
87
+ Object.keys(_Types).forEach(function (key) {
88
+ if (key === "default" || key === "__esModule") return;
89
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
90
+ if (key in exports && exports[key] === _Types[key]) return;
91
+ Object.defineProperty(exports, key, {
92
+ enumerable: true,
93
+ get: function get() {
94
+ return _Types[key];
95
+ }
96
+ });
97
+ });
86
98
  var _default = exports["default"] = _Editor["default"];
@@ -0,0 +1,13 @@
1
+ import MDEditor from './Editor.nohighlight';
2
+ import * as commands from './commands';
3
+ import * as MarkdownUtil from './utils/markdownUtils';
4
+ import './index.less';
5
+ export * from './commands';
6
+ export * from './commands/group';
7
+ export * from './utils/markdownUtils';
8
+ export * from './utils/InsertTextAtPosition';
9
+ export * from './Editor.nohighlight';
10
+ export * from './Context';
11
+ export * from './Types';
12
+ export { MarkdownUtil, commands };
13
+ export default MDEditor;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ var _exportNames = {
8
+ commands: true,
9
+ MarkdownUtil: true
10
+ };
11
+ exports["default"] = exports.commands = exports.MarkdownUtil = void 0;
12
+ var _Editor = _interopRequireWildcard(require("./Editor.nohighlight"));
13
+ Object.keys(_Editor).forEach(function (key) {
14
+ if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
+ if (key in exports && exports[key] === _Editor[key]) return;
17
+ Object.defineProperty(exports, key, {
18
+ enumerable: true,
19
+ get: function get() {
20
+ return _Editor[key];
21
+ }
22
+ });
23
+ });
24
+ var commands = _interopRequireWildcard(require("./commands"));
25
+ exports.commands = commands;
26
+ Object.keys(commands).forEach(function (key) {
27
+ if (key === "default" || key === "__esModule") return;
28
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
29
+ if (key in exports && exports[key] === commands[key]) return;
30
+ Object.defineProperty(exports, key, {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return commands[key];
34
+ }
35
+ });
36
+ });
37
+ var MarkdownUtil = _interopRequireWildcard(require("./utils/markdownUtils"));
38
+ exports.MarkdownUtil = MarkdownUtil;
39
+ Object.keys(MarkdownUtil).forEach(function (key) {
40
+ if (key === "default" || key === "__esModule") return;
41
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
42
+ if (key in exports && exports[key] === MarkdownUtil[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return MarkdownUtil[key];
47
+ }
48
+ });
49
+ });
50
+ var _group = require("./commands/group");
51
+ Object.keys(_group).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
54
+ if (key in exports && exports[key] === _group[key]) return;
55
+ Object.defineProperty(exports, key, {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _group[key];
59
+ }
60
+ });
61
+ });
62
+ var _InsertTextAtPosition = require("./utils/InsertTextAtPosition");
63
+ Object.keys(_InsertTextAtPosition).forEach(function (key) {
64
+ if (key === "default" || key === "__esModule") return;
65
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
66
+ if (key in exports && exports[key] === _InsertTextAtPosition[key]) return;
67
+ Object.defineProperty(exports, key, {
68
+ enumerable: true,
69
+ get: function get() {
70
+ return _InsertTextAtPosition[key];
71
+ }
72
+ });
73
+ });
74
+ var _Context = require("./Context");
75
+ Object.keys(_Context).forEach(function (key) {
76
+ if (key === "default" || key === "__esModule") return;
77
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
78
+ if (key in exports && exports[key] === _Context[key]) return;
79
+ Object.defineProperty(exports, key, {
80
+ enumerable: true,
81
+ get: function get() {
82
+ return _Context[key];
83
+ }
84
+ });
85
+ });
86
+ var _Types = require("./Types");
87
+ Object.keys(_Types).forEach(function (key) {
88
+ if (key === "default" || key === "__esModule") return;
89
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
90
+ if (key in exports && exports[key] === _Types[key]) return;
91
+ Object.defineProperty(exports, key, {
92
+ enumerable: true,
93
+ get: function get() {
94
+ return _Types[key];
95
+ }
96
+ });
97
+ });
98
+ var _default = exports["default"] = _Editor["default"];
@@ -0,0 +1,13 @@
1
+ declare module '@uiw/react-md-editor/nohighlight' {
2
+ import MDEditor from '@uiw/react-md-editor/esm/Editor.nohighlight';
3
+ import * as commands from '@uiw/react-md-editor/esm/commands';
4
+ import * as MarkdownUtil from '@uiw/react-md-editor/esm/utils/markdownUtils';
5
+ export * from '@uiw/react-md-editor/esm/commands';
6
+ export * from '@uiw/react-md-editor/esm/commands/group';
7
+ export * from '@uiw/react-md-editor/esm/utils/markdownUtils';
8
+ export * from '@uiw/react-md-editor/esm/utils/InsertTextAtPosition';
9
+ export * from '@uiw/react-md-editor/esm/Editor.nohighlight';
10
+ export * from '@uiw/react-md-editor/esm/Context';
11
+ export { MarkdownUtil, commands };
12
+ export default MDEditor;
13
+ }
package/package.json CHANGED
@@ -1,11 +1,25 @@
1
1
  {
2
2
  "name": "@uiw/react-md-editor",
3
- "version": "3.24.1",
3
+ "version": "3.25.1",
4
4
  "description": "A markdown editor with preview, implemented with React.js and TypeScript.",
5
5
  "homepage": "https://uiwjs.github.io/react-md-editor/",
6
6
  "author": "kenny wang <wowohoo@qq.com>",
7
7
  "main": "lib/index.js",
8
8
  "module": "esm/index.js",
9
+ "exports": {
10
+ "./README.md": "./README.md",
11
+ "./package.json": "./package.json",
12
+ ".": {
13
+ "import": "./esm/index.js",
14
+ "types": "./lib/index.d.ts",
15
+ "require": "./lib/index.js"
16
+ },
17
+ "./nohighlight": {
18
+ "import": "./esm/index.nohighlight.js",
19
+ "types": "./lib/index.nohighlight.d.ts",
20
+ "require": "./lib/index.nohighlight.js"
21
+ }
22
+ },
9
23
  "repository": {
10
24
  "type": "git",
11
25
  "url": "https://github.com/uiwjs/react-md-editor"
@@ -15,6 +29,7 @@
15
29
  },
16
30
  "files": [
17
31
  "markdown-editor.css",
32
+ "nohighlight.d.ts",
18
33
  "lib",
19
34
  "dist",
20
35
  "esm",
@@ -27,7 +42,7 @@
27
42
  },
28
43
  "dependencies": {
29
44
  "@babel/runtime": "^7.14.6",
30
- "@uiw/react-markdown-preview": "^4.1.14",
45
+ "@uiw/react-markdown-preview": "^4.2.1",
31
46
  "rehype": "~12.0.1",
32
47
  "rehype-prism-plus": "~1.6.1"
33
48
  },
package/src/Context.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ICommand, TextAreaCommandOrchestrator } from './commands';
3
- import { MDEditorProps } from './Editor';
3
+ import { MDEditorProps } from './Types';
4
4
 
5
5
  export type PreviewType = 'live' | 'edit' | 'preview';
6
6