Skip to content

Commit 712ed88

Browse files
committed
load async monaco in app
1 parent 4b3e967 commit 712ed88

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

frontend/src/lib/components/Editor.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@
14211421
marginLeft="51px"
14221422
{code}
14231423
fontSize={!small ? 14 : 12}
1424-
className="dark:bg-[#272D38] h-full"
1424+
className="dark:bg-[#272D38] h-full leading-[20px]"
14251425
/>
14261426
</div>
14271427
{/if}

frontend/src/lib/components/FakeMonacoPlaceHolder.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<div
15-
class={'relative w-full pr-14 z-9 mt-[-1px] mb-[1px] leading-[20px] dark:bg-[#272D38] overflow-y-clip overflow-x-auto mycontainer ' +
15+
class={'relative w-full pr-14 py-0 z-9 mt-[-1px] mb-[1px] dark:bg-[#272D38] overflow-y-clip overflow-x-auto mycontainer ' +
1616
className}
1717
style="padding-left: {marginLeft};"
1818
>
@@ -21,7 +21,7 @@
2121
style="margin-left: {marginLeft};"
2222
></div>
2323
<code
24-
class="text-nowrap whitespace-pre-wrap overflow-clip text-tertiary/50"
24+
class="text-nowrap whitespace-pre overflow-clip text-tertiary/50"
2525
style="font-size: {fontSize}px;"
2626
>
2727
{code}

frontend/src/lib/components/InputTransformForm.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@
494494
<!-- {inputCat}
495495
{propertyType} -->
496496
<div class="relative flex flex-row items-top gap-2 justify-between">
497-
<div class="min-w-0 grow">
497+
<div class="min-w-0 grow leading-[20px]">
498498
{#if isStaticTemplate(inputCat) && propertyType == 'static' && !noDynamicToggle}
499499
{#if argName && schema?.properties?.[argName]?.description}
500500
<div class="text-xs italic pb-1 text-secondary">

frontend/src/lib/components/JsonEditor.svelte

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export let error = ''
1010
export let editor: SimpleEditor | undefined = undefined
1111
export let small = false
12+
export let loadAsync = false
1213
1314
$: tooBig = code && code?.length > 1000000
1415
@@ -38,6 +39,7 @@
3839
<div class="flex flex-col w-full">
3940
<div class="border w-full">
4041
<SimpleEditor
42+
{loadAsync}
4143
{small}
4244
on:focus
4345
on:blur

frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte

+6-4
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@
7171
offset={zIndexes.monacoEditor}
7272
>
7373
<Splitpanes horizontal class="h-full">
74-
<Pane size={50}>
74+
<Pane size={50} class="leading-[16px]">
7575
<SimpleEditor
76+
loadAsync
7677
class="h-full w-full"
7778
bind:this={editor}
7879
lang="javascript"
79-
bind:code={componentInput.expr}
80+
bind:code={() => componentInput.expr ?? '', (e) => (componentInput.expr = e)}
8081
shouldBindKey={false}
8182
fixedOverflowWidgets={false}
8283
{extraLib}
@@ -102,13 +103,14 @@
102103
</Splitpanes>
103104
</Drawer>
104105
{/if}
105-
<div class="border relative">
106+
<div class="border relative leading-[16px]">
106107
{#if !fullscreen}
107108
<SimpleEditor
109+
loadAsync
108110
small
109111
bind:this={editor}
110112
lang="javascript"
111-
bind:code={componentInput.expr}
113+
bind:code={() => componentInput.expr ?? '', (e) => (componentInput.expr = e)}
112114
shouldBindKey={false}
113115
{extraLib}
114116
autoHeight

frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/StaticInputEditor.svelte

+2-1
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@
233233
placeholder="Label"
234234
/>
235235
{:else}
236-
<div class="flex w-full flex-col">
236+
<div class="flex w-full flex-col leading-[16px]">
237237
<JsonEditor
238+
loadAsync
238239
small
239240
bind:value={componentInput.value}
240241
code={JSON.stringify(componentInput.value, null, 2)}

0 commit comments

Comments
 (0)