From a2c83c7909488435b90e8616115f3e85225da6d5 Mon Sep 17 00:00:00 2001 From: tunny17 Date: Sun, 24 Sep 2023 07:08:37 +0000 Subject: [PATCH] CLASSROOMIO-T-141: Reusable AI trigger all around the app CLASSROOM-T-141: Dark mode improvements CLASSROOMIO-T-141: Add ai widget to landing page settings CLASSROOMIO-T-141: Enable AI button to text area in the landingpage settings CLASSROOMIO-T-141: Complete AI flow Merge branch 'main' into CLASSROOMIO-T-141 CLASSROOMIO-T-141: AI Button test Co-authored-by: Rotimi Best Co-authored-by: Tunji Adeyemi Merge-request: CLASSROOMIO-MR-74 Merged-by: Best Admin --- .../AI/AIButton/CustomPromptBtn.svelte | 135 ++++++ .../components/Lesson/AddLessonModal.svelte | 2 +- .../components/Lesson/Materials/index.svelte | 3 +- .../components/Editor/DescriptionForm.svelte | 13 +- .../components/Editor/GoalsForm.svelte | 13 +- .../components/Editor/RequirementForm.svelte | 15 +- .../components/Editor/ReviewFormEditor.svelte | 3 + .../components/Editor/index.svelte | 80 +++- .../components/PricingSection.svelte | 6 +- .../components/CourseLandingPage/index.svelte | 6 +- .../components/NewCourseModal/index.svelte | 24 +- src/lib/components/Form/TextArea.svelte | 39 +- .../Org/Settings/LandingpageSettings.svelte | 7 + src/lib/components/TextEditor/index.svelte | 2 +- src/lib/utils/types/index.ts | 8 +- .../api/completion/customprompt/+server.js | 37 ++ src/routes/courses/[id]/lessons/+page.svelte | 403 +++++++++--------- 17 files changed, 525 insertions(+), 271 deletions(-) create mode 100644 src/lib/components/AI/AIButton/CustomPromptBtn.svelte create mode 100644 src/routes/api/completion/customprompt/+server.js diff --git a/src/lib/components/AI/AIButton/CustomPromptBtn.svelte b/src/lib/components/AI/AIButton/CustomPromptBtn.svelte new file mode 100644 index 00000000..6f06f722 --- /dev/null +++ b/src/lib/components/AI/AIButton/CustomPromptBtn.svelte @@ -0,0 +1,135 @@ + + +
+ (openPopover = !openPopover)} + > + + + + + {#if !$isLoading} + + {/if} +
+ + {:else} +
+

Help me write

+