Skip to content

v5.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 02 Jul 18:40
· 108 commits to master since this release

npm bundle size npm version

Documentation v5.0.0: https://raw.githack.com/uiwjs/react-markdown-editor/35380f4/index.html
Comparing Changes: v4.0.3...v5.0.0

npm i @uiw/react-markdown-editor@5.0.0
import MarkdownEditor from '@uiw/react-markdown-editor';

const code = 'console.log("hello world!");';

<MarkdownEditor
  value={code}
-  onChange={(editor, data, value) => setMarkdown(value)}
+  onChange={(value, viewUpdate) => setMarkdown(value)}
-  options={{ }}
+  extensions={[
+  ]}
/>
- export type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: {
-   preview?: HTMLDivElement | null,
-   container?: HTMLDivElement | null,
-   containerEditor?: HTMLDivElement | null;
-   editor?: Editor;
- }) => JSX.Element
+ export type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: ToolBarProps) => JSX.Element;

export type ICommand = {
  icon?: React.ReactElement;
  name?: string;
  keyCommand?: string;
  button?: ButtonHandle | React.ButtonHTMLAttributes<HTMLButtonElement>;
+  execute?: (editor: ReactCodeMirrorRef) => void;
-  execute?: (editor: Editor, selection: string, position: Position, opts: {
-    preview?: HTMLDivElement | null,
-    container?: HTMLDivElement | null,
-  }) => void;
}