From 2be257e5942c8a18d508b388090c5b48b06748dc Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 1 Oct 2023 00:18:44 +0200 Subject: [PATCH] add fullscreen for eval fields --- .../inputEditor/EvalV2InputEditor.svelte | 62 ++++++++++++++----- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte index b03e0aaa29..4c29f79502 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte @@ -6,6 +6,8 @@ import SimpleEditor from '$lib/components/SimpleEditor.svelte' import { buildExtraLib } from '$lib/components/apps/utils' import { inferDeps } from '../../appUtilsInfer' + import { Maximize2 } from 'lucide-svelte' + import { Drawer } from '$lib/components/common' export let componentInput: EvalV2AppInput | undefined export let id: string @@ -39,25 +41,55 @@ inferDeps(code, $worldStore.outputsById, componentInput, app) } } + + let fullscreen = false {#if componentInput?.type === 'evalv2'} -
- { - if (onchange) { - onchange() - } - inferDepsFromCode(e.detail.code) - }} - /> + {#if fullscreen} + (fullscreen = false)} open> + { + if (onchange) { + onchange() + } + inferDepsFromCode(e.detail.code) + }} + /> + + {/if} +
+ {#if !fullscreen} + { + if (onchange) { + onchange() + } + inferDepsFromCode(e.detail.code) + }} + /> + + {:else} +
{componentInput.expr}
+ {/if}
+ {#if componentInput?.expr && componentInput.expr != '' && componentInput.expr .trim() .startsWith('{')}