1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

editor styling

This commit is contained in:
Martin McKeaveney 2021-05-10 12:06:31 +01:00
parent 1b1d45756b
commit a207137c92
4 changed files with 23 additions and 6 deletions

View file

@ -9,12 +9,16 @@
<p
class:noPadding
class="spectrum-Body spectrum-Body--size{size}"
class:spectrum-Body--serif={serif}
>
class:spectrum-Body--serif={serif}>
<slot />
</p>
<style>
p {
margin-top: 0.75em;
margin-bottom: 0.75em;
}
.noPadding {
padding: 0;
margin: 0;

View file

@ -117,7 +117,7 @@
readOnly,
autoCloseBrackets: true,
autoCloseTags: true,
theme: $themeStore.darkMode ? THEMES.DARK : THEMES.LIGHT,
theme: THEMES.DARK,
}
if (!tab)
@ -132,7 +132,7 @@
if (destroyed) return
CodeMirror.commands.autocomplete = function (cm) {
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.hint.javascript)
}

View file

@ -89,7 +89,7 @@
<MenuItem icon="LogOut" on:click={auth.logout}>Log out</MenuItem>
</ActionMenu>
</div>
<div>
<div class="content">
<slot />
</div>
</div>
@ -156,4 +156,9 @@
text-overflow: ellipsis;
font-weight: 500;
}
.content {
height: 100vh;
overflow-y: auto;
}
</style>

View file

@ -13,6 +13,7 @@
Select,
} from "@budibase/bbui"
import { onMount } from "svelte"
import Editor from "components/integration/QueryEditor.svelte"
import api from "builderStore/api"
const ConfigTypes = {
@ -156,7 +157,14 @@
<Button cta on:click={saveTemplate}>Save</Button>
</div>
{#if selectedTemplate}
<TextArea bind:value={selectedTemplate.contents} />
{#key templateIdx}
<Editor
mode="handlebars"
on:change={e => {
selectedTemplate.contents = e.detail.value
}}
value={selectedTemplate.contents} />
{/key}
{/if}
</div>
{/if}