Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sparkle] internal: use new sparkle packaging - take 2 #6091

Merged
merged 10 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { CitationType } from "@dust-tt/sparkle/dist/cjs/components/Citation";
import type { Citation } from "@dust-tt/sparkle";
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: CitationType;
type: Exclude<React.ComponentProps<typeof Citation>["type"], undefined>;
}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seen IRL, we will find a way to improve the type situation afterward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll add a proper exports for types, removing all direct imports for now


interface WebsearchResultCitation {
Expand Down
5 changes: 1 addition & 4 deletions front/components/assistant/conversation/ContentFragment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
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 @@ -15,9 +14,7 @@ export function ContentFragment({ message }: { message: ContentFragmentType }) {
);
}

const citationType: CitationType = ["dust-application/slack"].includes(
message.contentType
)
const 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 { Emoji, EmojiMartData } from "@emoji-mart/data";
import type { 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: Emoji) => {
onEmojiSelect={(emojiData) => {
const reaction = reactions.find((r) => r.emoji === emojiData.id);
const hasReacted =
(reaction &&
Expand Down
3 changes: 1 addition & 2 deletions front/components/assistant_builder/InstructionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ 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 @@ -661,7 +660,7 @@ function AnimatedSuggestion({
afterEnter,
}: {
suggestion: string;
variant?: ContentMessageProps["variant"];
variant?: React.ComponentProps<typeof ContentMessage>["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]">
<LogoHorizontalColorLogoLayer1 className="h-[24px] w-[96px]" />
<LogoHorizontalColorLayer1Logo className="h-[24px] w-[96px]" />
</Div3D>
<Div3D depth={25} className="absolute top-0">
<LogoHorizontalColorLogoLayer2 className="h-[24px] w-[96px]" />
<LogoHorizontalColorLayer2Logo className="h-[24px] w-[96px]" />
</Div3D>
</Hover3D>
</Link>
Expand Down
7 changes: 7 additions & 0 deletions front/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ 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
Loading