Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/reduce_aila_impor…
Browse files Browse the repository at this point in the history
…t_size
  • Loading branch information
stefl committed Oct 29, 2024
2 parents 1b61227 + 8553fb0 commit e3c3e41
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Box, Flex, Text } from "@radix-ui/themes";
import type {
AnswerAndDistractor,
OptionWithPrompt,
} from "ai-apps/comparative-judgement/state/types";
import type { OptionWithPrompt } from "ai-apps/comparative-judgement/state/types";

import { sortAlphabetically } from "@/utils/alphabetiseArray";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Dispatch, useCallback } from "react";
import type { Dispatch } from "react";
import { useCallback } from "react";

import * as Sentry from "@sentry/nextjs";
import {
QuizAppAction,
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import { QuizAppState } from "ai-apps/quiz-designer/state/types";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type { QuizAppState } from "ai-apps/quiz-designer/state/types";

import { trpc } from "@/utils/trpc";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Dispatch, useState } from "react";
import type { Dispatch } from "react";
import { useState } from "react";

import { Flex, Text } from "@radix-ui/themes";
import {
QuizAppAction,
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import { PotentialQuestionsType } from "hooks/useSuggestedQuestions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type { PotentialQuestionsType } from "hooks/useSuggestedQuestions";

import { Icon } from "@/components/Icon";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Dispatch } from "react";
import type { Dispatch } from "react";

import { Box, Flex, Grid, Text } from "@radix-ui/themes";
import { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { UseGenerationError } from "hooks/useGeneration";
import { PotentialQuestionsType } from "hooks/useSuggestedQuestions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import type { UseGenerationError } from "hooks/useGeneration";
import type { PotentialQuestionsType } from "hooks/useSuggestedQuestions";

import LoadingWheel from "@/components/LoadingWheel";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useState } from "react";

import { GenerationPart } from "@oakai/core/src/types";
import type { GenerationPart } from "@oakai/core/src/types";
import { Box } from "@radix-ui/themes";

import GenerationFeedbackDialog, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import { Box } from "@radix-ui/themes";
import Link from "next/link";

import useAnalytics from "@/lib/analytics/useAnalytics";
import { trackDownload } from "@/utils/trackDownload";
import { trpc } from "@/utils/trpc";

import {
ExportsType,
getExportsConfig,
} from "../../ExportsDialogs/exports.helpers";
import type { ExportsType } from "../../ExportsDialogs/exports.helpers";
import { getExportsConfig } from "../../ExportsDialogs/exports.helpers";
import { Icon } from "../../Icon";
import LoadingWheel from "../../LoadingWheel";
import LessonIcon from "../../SVGParts/LessonIcon";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import AiIcon from "@/components/SVGParts/AiIcon";

import { ProgressSections } from "../Chat/Chat/hooks/useProgressForDownloads";
import type { ProgressSections } from "../Chat/Chat/hooks/useProgressForDownloads";

const SectionsNotCompleteDownloadNotice = ({
sections,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import type { PropsWithChildren} from "react";
import type { PropsWithChildren } from "react";
import { useEffect } from "react";

import { useAuth, useUser } from "@clerk/nextjs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from "react";

import { aiLogger } from "@oakai/logger";
import { Flex } from "@radix-ui/themes";
import { Message } from "ai";
import type { Message } from "ai";
import { usePosthogFeedbackSurvey } from "hooks/surveys/usePosthogFeedbackSurvey";

import ChatButton from "@/components/AppComponents/Chat/ui/chat-button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useCallback } from "react";

import { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import { Flex } from "@radix-ui/themes";
import * as Sentry from "@sentry/react";

import { DialogTypes } from "@/components/AppComponents/Chat/Chat/types";
import type { DialogTypes } from "@/components/AppComponents/Chat/Chat/types";
import ChatButton from "@/components/AppComponents/Chat/ui/chat-button";
import LoadingWheel from "@/components/LoadingWheel";
import { getLessonTrackingProps } from "@/lib/analytics/helpers";
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/src/components/DialogControl/DialogContents.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import * as Dialog from "@radix-ui/react-dialog";
import { Box, Flex } from "@radix-ui/themes";
import { Message } from "ai";
import type { Message } from "ai";

import { useDialog } from "../AppComponents/DialogContext";
import { Icon } from "../Icon";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ResourceTypeValueType } from "@/lib/avo/Avo";
import type { ResourceTypeValueType } from "@/lib/avo/Avo";

export type ExportsType =
| "lessonSlides"
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/components/ExportsDialogs/exports.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LessonDeepPartial } from "@oakai/exports";
import type { LessonDeepPartial } from "@oakai/exports";

export type ExportsHookProps<T = unknown> = T & {
onStart: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useCallback, useEffect, useMemo, useState } from "react";

import { exportDocLessonPlanSchema } from "@oakai/exports/browser";
import { LessonPlanDocInputData } from "@oakai/exports/src/schema/input.schema";
import type { LessonPlanDocInputData } from "@oakai/exports/src/schema/input.schema";
import * as Sentry from "@sentry/nextjs";
import { useDebounce } from "@uidotdev/usehooks";
import { ZodError } from "zod";
import type { ZodError } from "zod";

import { trpc } from "@/utils/trpc";

import { ExportsHookProps } from "./exports.types";
import type { ExportsHookProps } from "./exports.types";
import { useExportsExistenceCheck } from "./useExportsExistenceCheck";

export function useExportLessonPlanDoc({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useCallback, useEffect, useMemo, useState } from "react";

import { exportSlidesFullLessonSchema } from "@oakai/exports/browser";
import { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema";
import type { LessonSlidesInputData } from "@oakai/exports/src/schema/input.schema";
import * as Sentry from "@sentry/nextjs";
import { useDebounce } from "@uidotdev/usehooks";
import { ZodError } from "zod";
import type { ZodError } from "zod";

import { trpc } from "@/utils/trpc";

import { ExportsHookProps } from "./exports.types";
import type { ExportsHookProps } from "./exports.types";
import { useExportsExistenceCheck } from "./useExportsExistenceCheck";

export function useExportLessonSlides({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { useEffect, useState } from "react";

import {
ExportableQuizAppState,
exportableQuizAppStateSchema,
} from "@oakai/exports/src/schema/input.schema";
import type { ExportableQuizAppState } from "@oakai/exports/src/schema/input.schema";
import { exportableQuizAppStateSchema } from "@oakai/exports/src/schema/input.schema";
import { aiLogger } from "@oakai/logger";
import * as Sentry from "@sentry/nextjs";
import { useDebounce } from "@uidotdev/usehooks";
import { ZodError } from "zod";
import type { ZodError } from "zod";

import { trpc } from "@/utils/trpc";

Expand Down
6 changes: 3 additions & 3 deletions apps/nextjs/src/components/ExportsDialogs/useExportQuizDoc.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useCallback, useEffect, useMemo, useState } from "react";

import { exportDocQuizSchema } from "@oakai/exports/browser";
import { QuizDocInputData } from "@oakai/exports/src/schema/input.schema";
import type { QuizDocInputData } from "@oakai/exports/src/schema/input.schema";
import * as Sentry from "@sentry/nextjs";
import { useDebounce } from "@uidotdev/usehooks";
import { ZodError } from "zod";
import type { ZodError } from "zod";

import { trpc } from "@/utils/trpc";

import { ExportsHookProps } from "./exports.types";
import type { ExportsHookProps } from "./exports.types";
import { useExportsExistenceCheck } from "./useExportsExistenceCheck";

export function useExportQuizDoc({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useCallback, useEffect, useMemo, useState } from "react";

import { exportSlidesWorksheetSchema } from "@oakai/exports/browser";
import { WorksheetSlidesInputData } from "@oakai/exports/src/schema/input.schema";
import type { WorksheetSlidesInputData } from "@oakai/exports/src/schema/input.schema";
import * as Sentry from "@sentry/nextjs";
import { useDebounce } from "@uidotdev/usehooks";
import { ZodError } from "zod";
import type { ZodError } from "zod";

import { trpc } from "@/utils/trpc";

import { ExportsHookProps } from "./exports.types";
import type { ExportsHookProps } from "./exports.types";
import { useExportsExistenceCheck } from "./useExportsExistenceCheck";

export function useExportWorksheetSlides({
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/components/Icon/svgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import reload from "@/assets/svg/reload.svg";
import uploadWhite from "@/assets/svg/upload-white.svg";
import upload from "@/assets/svg/upload.svg";

import { IconName } from "./types";
import type { IconName } from "./types";

export const svgs: Record<IconName, string> = {
"arrow-left": arrowLeft,
Expand Down
7 changes: 2 additions & 5 deletions apps/nextjs/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
type ClerkMiddlewareAuth,
clerkMiddleware,
createRouteMatcher,
} from "@clerk/nextjs/server";
import type { ClerkMiddlewareAuth } from "@clerk/nextjs/server";
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
import { aiLogger } from "@oakai/logger";
import type { NextFetchEvent, NextRequest } from "next/server";
import { NextResponse } from "next/server";
Expand Down

0 comments on commit e3c3e41

Please sign in to comment.