File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
packages/ui/src/components/MdxEditor Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const Mdxeditor = dynamic(
9
9
function MdxeditorComponent ( ) {
10
10
return (
11
11
< div className = "" >
12
- < Mdxeditor markdown = "" className = "prose max-w-none bg-slate-200 " />
12
+ < Mdxeditor markdown = "" className = "prose max-w-none" />
13
13
</ div >
14
14
) ;
15
15
}
Original file line number Diff line number Diff line change 1
1
import type { ForwardedRef } from "react" ;
2
2
import {
3
3
headingsPlugin ,
4
+ ListsToggle ,
4
5
listsPlugin ,
5
6
quotePlugin ,
6
7
thematicBreakPlugin ,
7
8
markdownShortcutPlugin ,
8
9
MDXEditor ,
10
+ toolbarPlugin ,
9
11
type MDXEditorMethods ,
10
12
type MDXEditorProps ,
13
+ UndoRedo ,
14
+ BoldItalicUnderlineToggles ,
15
+ BlockTypeSelect ,
16
+ directivesPlugin ,
17
+ AdmonitionDirectiveDescriptor ,
18
+ InsertAdmonition ,
11
19
} from "@mdxeditor/editor" ;
12
20
13
21
// Only import this to the next file
@@ -18,11 +26,28 @@ export default function InitializedMDXEditor({
18
26
return (
19
27
< MDXEditor
20
28
plugins = { [
29
+ directivesPlugin ( {
30
+ directiveDescriptors : [ AdmonitionDirectiveDescriptor ] ,
31
+ } ) ,
21
32
headingsPlugin ( ) ,
22
33
listsPlugin ( ) ,
23
34
quotePlugin ( ) ,
24
35
thematicBreakPlugin ( ) ,
25
36
markdownShortcutPlugin ( ) ,
37
+ toolbarPlugin ( {
38
+ toolbarContents ( ) {
39
+ return (
40
+ < >
41
+ { " " }
42
+ < UndoRedo />
43
+ < BoldItalicUnderlineToggles />
44
+ < BlockTypeSelect />
45
+ < InsertAdmonition />
46
+ < ListsToggle />
47
+ </ >
48
+ ) ;
49
+ } ,
50
+ } ) ,
26
51
] }
27
52
{ ...props }
28
53
ref = { editorRef }
You can’t perform that action at this time.
0 commit comments