From 6bd9abc422283da48ba2028ade8d0110bf1387bc Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 03:40:36 +0000 Subject: [PATCH 01/45] add accordion item for creating custom source items --- app/src/lib/components/AddCustomSource.svelte | 23 +++++++++++ app/src/lib/components/CustomSources.svelte | 29 +++++++++++++ .../lib/components/RenderAudioSource.svelte | 41 ++++++++++++++++--- .../ui/accordion/accordion-trigger.svelte | 16 ++++---- app/src/lib/components/ui/accordion/index.ts | 10 ++--- 5 files changed, 102 insertions(+), 17 deletions(-) create mode 100644 app/src/lib/components/AddCustomSource.svelte create mode 100644 app/src/lib/components/CustomSources.svelte diff --git a/app/src/lib/components/AddCustomSource.svelte b/app/src/lib/components/AddCustomSource.svelte new file mode 100644 index 0000000..8b4431b --- /dev/null +++ b/app/src/lib/components/AddCustomSource.svelte @@ -0,0 +1,23 @@ + + +
+
Add Custom Source
+
+ + diff --git a/app/src/lib/components/CustomSources.svelte b/app/src/lib/components/CustomSources.svelte new file mode 100644 index 0000000..dc427e3 --- /dev/null +++ b/app/src/lib/components/CustomSources.svelte @@ -0,0 +1,29 @@ + + +{#each customSources as source (source.id)} + + {source.title} + +
+ {source.content} +
+
+
+{/each} diff --git a/app/src/lib/components/RenderAudioSource.svelte b/app/src/lib/components/RenderAudioSource.svelte index 94d2f11..1fceab9 100644 --- a/app/src/lib/components/RenderAudioSource.svelte +++ b/app/src/lib/components/RenderAudioSource.svelte @@ -1,7 +1,11 @@ svg]:rotate-180", + 'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180', className )} {...$$restProps} on:click > - + + + diff --git a/app/src/lib/components/ui/accordion/index.ts b/app/src/lib/components/ui/accordion/index.ts index ed49213..0734d4e 100644 --- a/app/src/lib/components/ui/accordion/index.ts +++ b/app/src/lib/components/ui/accordion/index.ts @@ -1,7 +1,7 @@ -import { Accordion as AccordionPrimitive } from "bits-ui"; -import Content from "./accordion-content.svelte"; -import Item from "./accordion-item.svelte"; -import Trigger from "./accordion-trigger.svelte"; +import { Accordion as AccordionPrimitive } from 'bits-ui'; +import Content from './accordion-content.svelte'; +import Item from './accordion-item.svelte'; +import Trigger from './accordion-trigger.svelte'; const Root = AccordionPrimitive.Root; export { @@ -13,5 +13,5 @@ export { Root as Accordion, Content as AccordionContent, Item as AccordionItem, - Trigger as AccordionTrigger, + Trigger as AccordionTrigger }; From ac8a25667524448dbfea4a23296cfc17ff533ef4 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 14:42:15 +0000 Subject: [PATCH 02/45] add shadcn-card component --- .../components/ui/card/card-content.svelte | 13 ++++++++++ .../ui/card/card-description.svelte | 13 ++++++++++ .../lib/components/ui/card/card-footer.svelte | 13 ++++++++++ .../lib/components/ui/card/card-header.svelte | 13 ++++++++++ .../lib/components/ui/card/card-title.svelte | 21 ++++++++++++++++ app/src/lib/components/ui/card/card.svelte | 16 +++++++++++++ app/src/lib/components/ui/card/index.ts | 24 +++++++++++++++++++ 7 files changed, 113 insertions(+) create mode 100644 app/src/lib/components/ui/card/card-content.svelte create mode 100644 app/src/lib/components/ui/card/card-description.svelte create mode 100644 app/src/lib/components/ui/card/card-footer.svelte create mode 100644 app/src/lib/components/ui/card/card-header.svelte create mode 100644 app/src/lib/components/ui/card/card-title.svelte create mode 100644 app/src/lib/components/ui/card/card.svelte create mode 100644 app/src/lib/components/ui/card/index.ts diff --git a/app/src/lib/components/ui/card/card-content.svelte b/app/src/lib/components/ui/card/card-content.svelte new file mode 100644 index 0000000..3e2d651 --- /dev/null +++ b/app/src/lib/components/ui/card/card-content.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/app/src/lib/components/ui/card/card-description.svelte b/app/src/lib/components/ui/card/card-description.svelte new file mode 100644 index 0000000..53aed74 --- /dev/null +++ b/app/src/lib/components/ui/card/card-description.svelte @@ -0,0 +1,13 @@ + + +

+ +

diff --git a/app/src/lib/components/ui/card/card-footer.svelte b/app/src/lib/components/ui/card/card-footer.svelte new file mode 100644 index 0000000..77f8356 --- /dev/null +++ b/app/src/lib/components/ui/card/card-footer.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/app/src/lib/components/ui/card/card-header.svelte b/app/src/lib/components/ui/card/card-header.svelte new file mode 100644 index 0000000..2fcfbc0 --- /dev/null +++ b/app/src/lib/components/ui/card/card-header.svelte @@ -0,0 +1,13 @@ + + +
+ +
diff --git a/app/src/lib/components/ui/card/card-title.svelte b/app/src/lib/components/ui/card/card-title.svelte new file mode 100644 index 0000000..68018e2 --- /dev/null +++ b/app/src/lib/components/ui/card/card-title.svelte @@ -0,0 +1,21 @@ + + + + + diff --git a/app/src/lib/components/ui/card/card.svelte b/app/src/lib/components/ui/card/card.svelte new file mode 100644 index 0000000..db600ca --- /dev/null +++ b/app/src/lib/components/ui/card/card.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/app/src/lib/components/ui/card/index.ts b/app/src/lib/components/ui/card/index.ts new file mode 100644 index 0000000..bcc031d --- /dev/null +++ b/app/src/lib/components/ui/card/index.ts @@ -0,0 +1,24 @@ +import Root from "./card.svelte"; +import Content from "./card-content.svelte"; +import Description from "./card-description.svelte"; +import Footer from "./card-footer.svelte"; +import Header from "./card-header.svelte"; +import Title from "./card-title.svelte"; + +export { + Root, + Content, + Description, + Footer, + Header, + Title, + // + Root as Card, + Content as CardContent, + Description as CardDescription, + Footer as CardFooter, + Header as CardHeader, + Title as CardTitle, +}; + +export type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; From dfbdc906685d0df5dec72c720f243f0f4e400c78 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 14:42:59 +0000 Subject: [PATCH 03/45] wip: add form for custom user source --- .../lib/components/ChatListActionItems.svelte | 2 +- .../AddCustomSource.svelte | 1 - .../custom-source/AddCustomSourceForm.svelte | 92 +++++++++++++++++++ .../{ => custom-source}/CustomSources.svelte | 2 +- .../RenderAudioSource.svelte | 34 +++++-- 5 files changed, 118 insertions(+), 13 deletions(-) rename app/src/lib/components/{ => custom-source}/AddCustomSource.svelte (90%) create mode 100644 app/src/lib/components/custom-source/AddCustomSourceForm.svelte rename app/src/lib/components/{ => custom-source}/CustomSources.svelte (93%) rename app/src/lib/components/{ => custom-source}/RenderAudioSource.svelte (70%) diff --git a/app/src/lib/components/ChatListActionItems.svelte b/app/src/lib/components/ChatListActionItems.svelte index d47d753..1b4fe4f 100644 --- a/app/src/lib/components/ChatListActionItems.svelte +++ b/app/src/lib/components/ChatListActionItems.svelte @@ -11,7 +11,7 @@ import { toast } from 'svelte-sonner'; import { Button } from './ui/button'; import { getSessionContext } from '@/stores/sessionContext.svelte'; - import RenderAudioSource from '@/components/RenderAudioSource.svelte'; + import RenderAudioSource from '@/components/custom-source/RenderAudioSource.svelte'; import { streamingResponse } from '@/utils/streamingResponse'; import { Share2Icon } from 'lucide-svelte'; import ShareModal from './share/ShareModal.svelte'; diff --git a/app/src/lib/components/AddCustomSource.svelte b/app/src/lib/components/custom-source/AddCustomSource.svelte similarity index 90% rename from app/src/lib/components/AddCustomSource.svelte rename to app/src/lib/components/custom-source/AddCustomSource.svelte index 8b4431b..943eafe 100644 --- a/app/src/lib/components/AddCustomSource.svelte +++ b/app/src/lib/components/custom-source/AddCustomSource.svelte @@ -1,5 +1,4 @@ diff --git a/app/src/lib/components/custom-source/AddCustomSourceForm.svelte b/app/src/lib/components/custom-source/AddCustomSourceForm.svelte new file mode 100644 index 0000000..8d04f3d --- /dev/null +++ b/app/src/lib/components/custom-source/AddCustomSourceForm.svelte @@ -0,0 +1,92 @@ + + +
+ + + Custom source + + Let's base Audiora's responses on the information that matters most to you. (E.g., marketing + plans, research notes, meeting transcripts, etc.) + + + + + +
+ + + +
+
+
+
diff --git a/app/src/lib/components/CustomSources.svelte b/app/src/lib/components/custom-source/CustomSources.svelte similarity index 93% rename from app/src/lib/components/CustomSources.svelte rename to app/src/lib/components/custom-source/CustomSources.svelte index dc427e3..ae07934 100644 --- a/app/src/lib/components/CustomSources.svelte +++ b/app/src/lib/components/custom-source/CustomSources.svelte @@ -1,5 +1,5 @@ @@ -26,17 +32,18 @@ Audiocast Source + > + Audiocast Source
- - + + Add custom source @@ -45,8 +52,8 @@ /> - - + + @@ -70,3 +77,10 @@ + + From 2b2f5f123828532cddfcd3133fa8525befd5c11d Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 14:51:30 +0000 Subject: [PATCH 04/45] cleanup custom source componentn --- .../custom-source/AddCustomSource.svelte | 106 +++++++++++++++--- .../custom-source/AddCustomSourceForm.svelte | 92 --------------- .../custom-source/RenderAudioSource.svelte | 4 +- 3 files changed, 91 insertions(+), 111 deletions(-) delete mode 100644 app/src/lib/components/custom-source/AddCustomSourceForm.svelte diff --git a/app/src/lib/components/custom-source/AddCustomSource.svelte b/app/src/lib/components/custom-source/AddCustomSource.svelte index 943eafe..fc59dab 100644 --- a/app/src/lib/components/custom-source/AddCustomSource.svelte +++ b/app/src/lib/components/custom-source/AddCustomSource.svelte @@ -1,22 +1,94 @@ - + + +
+ + + Custom source + + Let's base Audiora's responses on the information that matters most to you. (E.g., marketing + plans, research notes, meeting transcripts, etc.) + + + + + +
+ + + +
+
+
+
diff --git a/app/src/lib/components/custom-source/AddCustomSourceForm.svelte b/app/src/lib/components/custom-source/AddCustomSourceForm.svelte deleted file mode 100644 index 8d04f3d..0000000 --- a/app/src/lib/components/custom-source/AddCustomSourceForm.svelte +++ /dev/null @@ -1,92 +0,0 @@ - - -
- - - Custom source - - Let's base Audiora's responses on the information that matters most to you. (E.g., marketing - plans, research notes, meeting transcripts, etc.) - - - - - -
- - - -
-
-
-
diff --git a/app/src/lib/components/custom-source/RenderAudioSource.svelte b/app/src/lib/components/custom-source/RenderAudioSource.svelte index 10c55d9..e6bcd0a 100644 --- a/app/src/lib/components/custom-source/RenderAudioSource.svelte +++ b/app/src/lib/components/custom-source/RenderAudioSource.svelte @@ -5,7 +5,7 @@ import { parse } from 'marked'; import { PlusIcon } from 'lucide-svelte'; import CustomSources from './CustomSources.svelte'; - import AddCustomSourceForm from './AddCustomSourceForm.svelte'; + import AddCustomSource from './AddCustomSource.svelte'; export let audioSource: string; @@ -53,7 +53,7 @@ - +
From f1b8ab29e488980002fe444e82a012052b7e23a6 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 15:32:59 +0000 Subject: [PATCH 05/45] add shadcn input component --- app/src/lib/components/ui/input/index.ts | 29 ++++++++++++++ app/src/lib/components/ui/input/input.svelte | 42 ++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 app/src/lib/components/ui/input/index.ts create mode 100644 app/src/lib/components/ui/input/input.svelte diff --git a/app/src/lib/components/ui/input/index.ts b/app/src/lib/components/ui/input/index.ts new file mode 100644 index 0000000..75e3bc2 --- /dev/null +++ b/app/src/lib/components/ui/input/index.ts @@ -0,0 +1,29 @@ +import Root from "./input.svelte"; + +export type FormInputEvent = T & { + currentTarget: EventTarget & HTMLInputElement; +}; +export type InputEvents = { + blur: FormInputEvent; + change: FormInputEvent; + click: FormInputEvent; + focus: FormInputEvent; + focusin: FormInputEvent; + focusout: FormInputEvent; + keydown: FormInputEvent; + keypress: FormInputEvent; + keyup: FormInputEvent; + mouseover: FormInputEvent; + mouseenter: FormInputEvent; + mouseleave: FormInputEvent; + mousemove: FormInputEvent; + paste: FormInputEvent; + input: FormInputEvent; + wheel: FormInputEvent; +}; + +export { + Root, + // + Root as Input, +}; diff --git a/app/src/lib/components/ui/input/input.svelte b/app/src/lib/components/ui/input/input.svelte new file mode 100644 index 0000000..446230b --- /dev/null +++ b/app/src/lib/components/ui/input/input.svelte @@ -0,0 +1,42 @@ + + + From 1bf978ca6285972704edc6ccd302acfdf8d24a93 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Wed, 20 Nov 2024 15:33:43 +0000 Subject: [PATCH 06/45] add components to get custom source by website url and copy/paste --- .../custom-source/AddCustomSource.svelte | 103 +++--------------- .../custom-source/AddCustomSourceForm.svelte | 100 +++++++++++++++++ .../custom-source/CopyPasteSource.svelte | 65 +++++++++++ .../custom-source/WebsiteURLSource.svelte | 62 +++++++++++ 4 files changed, 242 insertions(+), 88 deletions(-) create mode 100644 app/src/lib/components/custom-source/AddCustomSourceForm.svelte create mode 100644 app/src/lib/components/custom-source/CopyPasteSource.svelte create mode 100644 app/src/lib/components/custom-source/WebsiteURLSource.svelte diff --git a/app/src/lib/components/custom-source/AddCustomSource.svelte b/app/src/lib/components/custom-source/AddCustomSource.svelte index fc59dab..bf899d4 100644 --- a/app/src/lib/components/custom-source/AddCustomSource.svelte +++ b/app/src/lib/components/custom-source/AddCustomSource.svelte @@ -1,94 +1,21 @@
- - - Custom source - - Let's base Audiora's responses on the information that matters most to you. (E.g., marketing - plans, research notes, meeting transcripts, etc.) - - - - - -
- - - -
-
-
+ {#if !showWebsiteURLForm && !showCopyPasteForm} + (showWebsiteURLForm = true)} + on:useCopyPaste={() => (showCopyPasteForm = true)} + /> + {:else if showWebsiteURLForm} + (showWebsiteURLForm = false)} /> + {:else if showCopyPasteForm} + (showCopyPasteForm = false)} /> + {/if}
diff --git a/app/src/lib/components/custom-source/AddCustomSourceForm.svelte b/app/src/lib/components/custom-source/AddCustomSourceForm.svelte new file mode 100644 index 0000000..4d1e0db --- /dev/null +++ b/app/src/lib/components/custom-source/AddCustomSourceForm.svelte @@ -0,0 +1,100 @@ + + + + + Custom source + + Let's base Audiora's responses on the information that matters most to you. (E.g., marketing + plans, research notes, meeting transcripts, etc.) + + + + + +
+ + + +
+
+
diff --git a/app/src/lib/components/custom-source/CopyPasteSource.svelte b/app/src/lib/components/custom-source/CopyPasteSource.svelte new file mode 100644 index 0000000..34fe5e6 --- /dev/null +++ b/app/src/lib/components/custom-source/CopyPasteSource.svelte @@ -0,0 +1,65 @@ + + + + +
+
+ +

Paste copied text

+
+ +
+ +

Paste your copied text below to upload as a source

+
+ + +
+ + +
+