Skip to content

Commit a33685a

Browse files
committed
feat: toolbar visibility
1 parent 7330957 commit a33685a

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

packages/bytemd/src/editor.svelte

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
export let plugins = [];
1111
export let mode = 'split';
1212
export let editorConfig;
13+
export let toolbar = true;
1314
export let toolbarItems = [];
1415
export let debounceMs = 300;
1516
@@ -78,13 +79,15 @@
7879
</style>
7980

8081
<div class="bytemd" style={containerStyle}>
81-
<Toolbar
82-
{cm}
83-
{fileHandler}
84-
{toolbarItems}
85-
{mode}
86-
{activeTab}
87-
on:tab={setActiveTab} />
82+
{#if toolbar}
83+
<Toolbar
84+
{cm}
85+
{fileHandler}
86+
{toolbarItems}
87+
{mode}
88+
{activeTab}
89+
on:tab={setActiveTab} />
90+
{/if}
8891
<div class="bytemd-body">
8992
<div class="bytemd-editor" class:hidden={mode === 'tab' && activeTab === 1}>
9093
<textarea bind:this={textarea} />

packages/bytemd/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface EditorProps {
2222
fileHandler?: (file: File) => Promise<string>;
2323
plugins?: BytemdPlugin[];
2424
editorConfig?: Omit<EditorConfiguration, 'value'>;
25+
toolbar?: boolean;
2526
/**
2627
* Components which should be added to toolbar
2728
*/

packages/bytemd/vue/src/editor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
'fileHandler',
1414
'plugins',
1515
'editorConfig',
16+
'toolbar',
1617
'toolbarItems',
1718
'debounceMs',
1819
],

0 commit comments

Comments
 (0)