File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -288,8 +288,10 @@ export interface IMarkdownEditor extends ReactCodeMirrorProps {
288
288
toolbarsFilter? : (tool : Commands , idx : number ) => boolean ;
289
289
/** Toolbar on bottom */
290
290
toolbarBottom? : boolean ;
291
- /** Option to hide the tool bar. */
291
+ /** Option to hide the tool bar. @deprecated The next major version will be deprecated. Please use `showToolbar`. */
292
292
hideToolbar? : boolean ;
293
+ /** Option to hide the tool bar. */
294
+ showToolbar? : boolean ;
293
295
/** [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview#options-props) options */
294
296
previewProps? : MarkdownPreviewProps ;
295
297
/** replace the default `extensions` */
Original file line number Diff line number Diff line change @@ -45,8 +45,10 @@ export interface IMarkdownEditor extends ReactCodeMirrorProps {
45
45
toolbarsFilter ?: ( tool : Commands , idx : number ) => boolean ;
46
46
/** Toolbar on bottom */
47
47
toolbarBottom ?: boolean ;
48
- /** Option to hide the tool bar. */
48
+ /** Option to hide the tool bar. @deprecated The next major version will be deprecated. Please use `showToolbar`. */
49
49
hideToolbar ?: boolean ;
50
+ /** Option to hide the tool bar. */
51
+ showToolbar ?: boolean ;
50
52
/** [@uiw/react-markdown-preview](https://github.com/uiwjs/react-markdown-preview#options-props) options */
51
53
previewProps ?: MarkdownPreviewProps ;
52
54
/** replace the default `extensions` */
@@ -95,7 +97,8 @@ function MarkdownEditorInternal(
95
97
visible = true ,
96
98
renderPreview,
97
99
visibleEditor = true ,
98
- hideToolbar = true ,
100
+ hideToolbar,
101
+ showToolbar = true ,
99
102
toolbarBottom = false ,
100
103
enableScroll = true ,
101
104
enablePreview = true ,
@@ -222,7 +225,8 @@ function MarkdownEditorInternal(
222
225
223
226
const tools = toolbarsFilter ? toolbars . filter ( toolbarsFilter ) : toolbars ;
224
227
const toolsMode = toolbarsFilter ? toolbarsMode . filter ( toolbarsFilter ) : toolbarsMode ;
225
- const toolbarView = hideToolbar && (
228
+ const isShowToolbar = hideToolbar ?? showToolbar ;
229
+ const toolbarView = isShowToolbar && (
226
230
< div className = { clsToolbar } >
227
231
< ToolBar { ...toolBarProps } toolbars = { tools } />
228
232
< ToolBar { ...toolBarProps } toolbars = { toolsMode } mode />
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function ExampleDemo() {
23
23
height = "500px"
24
24
value = { mdstr }
25
25
enableScroll = { enableScroll }
26
- hideToolbar = { hideToolbar }
26
+ showToolbar = { hideToolbar }
27
27
toolbarBottom = { toolbarBottom }
28
28
/>
29
29
< div style = { { marginTop : 10 , display : 'flex' , gap : '10px' } } >
@@ -37,7 +37,7 @@ export function ExampleDemo() {
37
37
</ button >
38
38
< label >
39
39
< input type = "checkbox" checked = { hideToolbar } onChange = { ( evn ) => setHideToolbar ( evn . target . checked ) } />
40
- hideToolbar
40
+ showToolbar
41
41
</ label >
42
42
< label >
43
43
< input type = "checkbox" checked = { enableScroll } onChange = { ( evn ) => setEnableScroll ( evn . target . checked ) } />
You can’t perform that action at this time.
0 commit comments