Skip to content

Commit

Permalink
Merge pull request #153 from invopop/hide_console_bar
Browse files Browse the repository at this point in the history
Add prop to force hiding the console error bar in Code view
  • Loading branch information
beliolfa authored Sep 18, 2024
2 parents 88c38d0 + c6ecf53 commit b786e57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/EnvelopeEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
// If autocorrect is set to false the envelope is not updated automatically. Event `corrected` is always fired with the result
export let autocorrect = true;
// If hideConsoleBar is true will force to hide the error suggestions in Code View
export let hideConsoleBar = false;
let editorForm: EditorForm | null = null;
let initialEditorData = "";
Expand Down Expand Up @@ -322,7 +325,7 @@
<div class="h-full absolute inset-0 flex flex-col">
<div class="flex-1 overflow-auto">
{#if editorView === "code"}
<EditorCode {jsonSchemaURL} {forceReadOnly} />
<EditorCode {hideConsoleBar} {jsonSchemaURL} {forceReadOnly} />
{:else}
<EditorForm
bind:this={editorForm}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/editor/code/EditorCode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
export let jsonSchemaURL: string;
export let forceReadOnly = false;
export let hideConsoleBar = false;
let editorEl: HTMLElement;
let monacoEditor: Monaco.editor.IStandaloneCodeEditor;
Expand Down Expand Up @@ -50,7 +51,7 @@
$: forceReadOnly, setEditorReadOnly();
$: showErrorConsole = !forceReadOnly && !$envelope?.sigs;
$: showErrorConsole = !hideConsoleBar && !forceReadOnly && !$envelope?.sigs;
function setSchemaURI(uri: string) {
if (!monaco) {
Expand Down

0 comments on commit b786e57

Please sign in to comment.