Skip to content

Commit

Permalink
Revert "[sparkle] internal: use new sparkle packaging - take 2 (#6091)…
Browse files Browse the repository at this point in the history
…" (#7097)

This reverts commit fc1ceca.
  • Loading branch information
tdraier authored Sep 4, 2024
1 parent e6fa89e commit de10202
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 164 deletions.
4 changes: 2 additions & 2 deletions front/components/actions/retrieval/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Citation } from "@dust-tt/sparkle";
import type { CitationType } from "@dust-tt/sparkle/dist/cjs/components/Citation";
import type { RetrievalDocumentType } from "@dust-tt/types";
import {
getProviderFromRetrievedDocument,
Expand All @@ -22,7 +22,7 @@ export function makeLinkForRetrievedDocument(
interface RetrievedDocumentCitation {
href: string;
title: string;
type: Exclude<React.ComponentProps<typeof Citation>["type"], undefined>;
type: CitationType;
}

export function makeDocumentCitations(
Expand Down
4 changes: 2 additions & 2 deletions front/components/actions/websearch/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Citation } from "@dust-tt/sparkle";
import type { CitationType } from "@dust-tt/sparkle/dist/cjs/components/Citation";
import type { WebsearchActionType } from "@dust-tt/types";

interface WebsearchResultCitation {
href: string;
title: string;
type: Exclude<React.ComponentProps<typeof Citation>["type"], undefined>;
type: CitationType;
}

export function makeWebsearchResultsCitations(
Expand Down
5 changes: 4 additions & 1 deletion front/components/assistant/conversation/ContentFragment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Citation, ZoomableImageCitationWrapper } from "@dust-tt/sparkle";
import type { CitationType } from "@dust-tt/sparkle/dist/cjs/components/Citation";
import type { ContentFragmentType } from "@dust-tt/types";
import { isSupportedImageContentType } from "@dust-tt/types";

Expand All @@ -14,7 +15,9 @@ export function ContentFragment({ message }: { message: ContentFragmentType }) {
);
}

const citationType = ["dust-application/slack"].includes(message.contentType)
const citationType: CitationType = ["dust-application/slack"].includes(
message.contentType
)
? "slack"
: "document";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
WorkspaceType,
} from "@dust-tt/types";
// TODO(2024-04-24 flav) Remove emoji-mart dependency from front.
import type { EmojiMartData } from "@emoji-mart/data";
import type { Emoji, EmojiMartData } from "@emoji-mart/data";
import type { ComponentType, MouseEventHandler } from "react";
import { useEffect, useRef, useState } from "react";
import { useSWRConfig } from "swr";
Expand Down Expand Up @@ -247,7 +247,7 @@ function EmojiSelector({
theme="light"
previewPosition="none"
data={emojiData ?? undefined}
onEmojiSelect={(emojiData) => {
onEmojiSelect={(emojiData: Emoji) => {
const reaction = reactions.find((r) => r.emoji === emojiData.id);
const hasReacted =
(reaction &&
Expand Down
3 changes: 2 additions & 1 deletion front/components/assistant_builder/InstructionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Page,
Spinner,
} from "@dust-tt/sparkle";
import type { ContentMessageProps } from "@dust-tt/sparkle/dist/cjs/components/ContentMessage";
import type {
APIError,
AssistantCreativityLevel,
Expand Down Expand Up @@ -660,7 +661,7 @@ function AnimatedSuggestion({
afterEnter,
}: {
suggestion: string;
variant?: React.ComponentProps<typeof ContentMessage>["variant"];
variant?: ContentMessageProps["variant"];
afterEnter?: () => void;
}) {
return (
Expand Down
8 changes: 4 additions & 4 deletions front/components/home/LandingLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
Div3D,
Hover3D,
LoginIcon,
LogoHorizontalColorLayer1Logo,
LogoHorizontalColorLayer2Logo,
LogoHorizontalColorLogo,
LogoHorizontalColorLogoLayer1,
LogoHorizontalColorLogoLayer2,
} from "@dust-tt/sparkle";
import { Transition } from "@headlessui/react";
import Head from "next/head";
Expand Down Expand Up @@ -99,10 +99,10 @@ export default function LandingLayout({
<Link href="/">
<Hover3D className="relative h-[24px] w-[96px]">
<Div3D depth={0} className="h-[24px] w-[96px]">
<LogoHorizontalColorLayer1Logo className="h-[24px] w-[96px]" />
<LogoHorizontalColorLogoLayer1 className="h-[24px] w-[96px]" />
</Div3D>
<Div3D depth={25} className="absolute top-0">
<LogoHorizontalColorLayer2Logo className="h-[24px] w-[96px]" />
<LogoHorizontalColorLogoLayer2 className="h-[24px] w-[96px]" />
</Div3D>
</Hover3D>
</Link>
Expand Down
7 changes: 0 additions & 7 deletions front/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ module.exports = {
tls: false,
dgram: false,
};
// Use source-map-loader for transitively include source maps of dependencies.
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
include: [path.resolve(__dirname, "node_modules/@dust-tt/sparkle")],
});
return config;
},
};
Loading

0 comments on commit de10202

Please sign in to comment.