From 3f7913b36f024333c82645c9a3729110604d2f71 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 9 Jun 2024 17:17:35 -0700 Subject: [PATCH] feat: knowledge selector --- .../workspace/Models/Knowledge.svelte | 92 +++++++++++-- .../Models/Knowledge/Selector.svelte | 126 ++++++++++++++++++ 2 files changed, 206 insertions(+), 12 deletions(-) create mode 100644 src/lib/components/workspace/Models/Knowledge/Selector.svelte diff --git a/src/lib/components/workspace/Models/Knowledge.svelte b/src/lib/components/workspace/Models/Knowledge.svelte index 94653b9b9..f853925cc 100644 --- a/src/lib/components/workspace/Models/Knowledge.svelte +++ b/src/lib/components/workspace/Models/Knowledge.svelte @@ -1,5 +1,6 @@ + + { + if (e.detail === false) { + onClose(); + } + }} +> + + +
+ +
+ {#each items as item} + { + if (!knowledge.find((k) => k.name === item.name)) { + knowledge = [...knowledge, item]; + } + }} + > +
+ {#if (item?.type ?? 'doc') === 'doc'} + + + + + {:else if item.type === 'collection'} + + + + + {/if} +
+ +
+
+
+ {item?.type ?? 'Document'} +
+ +
+ {item.name} +
+
+
+
+ {/each} +
+
+
+