From dd423f43de095174ab900606959ec1a7c369df37 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 10 Jun 2024 16:35:42 -0700 Subject: [PATCH] feat: default tools template --- src/lib/components/common/CodeEditor.svelte | 3 +- src/lib/components/workspace/Tools.svelte | 34 ++++++++++++++ .../workspace/Tools/CodeEditor.svelte | 44 +++++++++++++++++++ src/routes/(app)/workspace/+layout.svelte | 6 ++- src/routes/(app)/workspace/tools/+page.svelte | 4 +- 5 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 src/lib/components/workspace/Tools.svelte create mode 100644 src/lib/components/workspace/Tools/CodeEditor.svelte diff --git a/src/lib/components/common/CodeEditor.svelte b/src/lib/components/common/CodeEditor.svelte index 4eef9f59e..f25b3c736 100644 --- a/src/lib/components/common/CodeEditor.svelte +++ b/src/lib/components/common/CodeEditor.svelte @@ -11,6 +11,7 @@ import { onMount } from 'svelte'; + export let boilerplate = ''; export let value = ''; let codeEditor; @@ -38,7 +39,7 @@ // python code editor, highlight python code codeEditor = new EditorView({ state: EditorState.create({ - doc: '', + doc: boilerplate, extensions: extensions }), parent: document.getElementById('code-textarea') diff --git a/src/lib/components/workspace/Tools.svelte b/src/lib/components/workspace/Tools.svelte new file mode 100644 index 000000000..074e03b0b --- /dev/null +++ b/src/lib/components/workspace/Tools.svelte @@ -0,0 +1,34 @@ + + +
+
+
+ +
+ +
+
+
+
diff --git a/src/lib/components/workspace/Tools/CodeEditor.svelte b/src/lib/components/workspace/Tools/CodeEditor.svelte new file mode 100644 index 000000000..1696e4bf8 --- /dev/null +++ b/src/lib/components/workspace/Tools/CodeEditor.svelte @@ -0,0 +1,44 @@ + + + diff --git a/src/routes/(app)/workspace/+layout.svelte b/src/routes/(app)/workspace/+layout.svelte index 1f0b56b1b..bb891d010 100644 --- a/src/routes/(app)/workspace/+layout.svelte +++ b/src/routes/(app)/workspace/+layout.svelte @@ -14,7 +14,11 @@ -
+
diff --git a/src/routes/(app)/workspace/tools/+page.svelte b/src/routes/(app)/workspace/tools/+page.svelte index 99cecddb9..e745cfa80 100644 --- a/src/routes/(app)/workspace/tools/+page.svelte +++ b/src/routes/(app)/workspace/tools/+page.svelte @@ -1,5 +1,5 @@ - +