switch REPL orientation in tutorial, hide props editor

pull/2143/head
Rich Harris 7 years ago
parent f4748e23b0
commit 816f83f4b6

@ -19,6 +19,7 @@
export let runtimeError; export let runtimeError;
export let compileOptions; export let compileOptions;
export let embedded; export let embedded;
export let show_props;
// refs // refs
let viewer; let viewer;
@ -121,7 +122,7 @@
</div> </div>
{#if view === 'result'} {#if view === 'result'}
<SplitPane type="vertical" pos={67}> <SplitPane type="vertical" pos={67} fixed={!show_props} fixed_pos={100}>
<div slot="a"> <div slot="a">
{#if bundle} {#if bundle}
<Viewer <Viewer
@ -143,6 +144,7 @@
</div> </div>
<section slot="b"> <section slot="b">
{#if show_props}
<h3>Props editor</h3> <h3>Props editor</h3>
{#if props} {#if props}
@ -166,6 +168,7 @@
</div> </div>
{/if} {/if}
{/if} {/if}
{/if}
</section> </section>
</SplitPane> </SplitPane>
{:elseif embedded} {:elseif embedded}

@ -86,5 +86,4 @@ export default class ReplProxy {
fetchImports(bundle) { fetchImports(bundle) {
return this.iframeCommand("fetch_imports", { bundle }) return this.iframeCommand("fetch_imports", { bundle })
} }
} }

@ -11,6 +11,8 @@
export let version = 'beta'; // TODO change this to latest when the time comes export let version = 'beta'; // TODO change this to latest when the time comes
export let app; export let app;
export let embedded = false; export let embedded = false;
export let orientation = 'auto';
export let show_props = true;
export function toJSON() { export function toJSON() {
// TODO there's a bug here — Svelte hoists this function because // TODO there's a bug here — Svelte hoists this function because
@ -277,7 +279,12 @@
<div class="container" bind:clientWidth={width}> <div class="container" bind:clientWidth={width}>
<div class="repl-inner" class:offset="{show_output}"> <div class="repl-inner" class:offset="{show_output}">
<SplitPane type="horizontal" fixed="{600 > width}" pos={60} fixed_pos={50}> <SplitPane
type="{orientation === 'rows' ? 'vertical' : 'horizontal'}"
fixed="{600 > width}"
pos="{orientation === 'rows' ? 50 : 60}"
fixed_pos={50}
>
<section slot=a> <section slot=a>
<Input <Input
{component_store} {component_store}
@ -306,6 +313,7 @@
{sourceError} {sourceError}
{runtimeError} {runtimeError}
{embedded} {embedded}
{show_props}
/> />
</section> </section>
</SplitPane> </SplitPane>

@ -146,7 +146,7 @@
</div> </div>
<div class="tutorial-repl"> <div class="tutorial-repl">
<Repl {app}/> <Repl {app} orientation="rows" show_props={false}/>
</div> </div>
</div> </div>

Loading…
Cancel
Save