Skip to content

Commit

Permalink
move i18n, fix build things
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 7, 2025
1 parent 52b94f1 commit 1a61e5b
Show file tree
Hide file tree
Showing 28 changed files with 21 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-readme-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
"content_path": "README.md"
}
],
save_path: "i18n/readme/README_${{ matrix.language.code }}.md",
save_path: "packages/docs/packages/docs/i18n/readme/README_${{ matrix.language.code }}.md",
"model": "gpt-4o"
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## 🌍 README Translations

[中文说明](i18n/readme/README_CN.md) | [日本語の説明](i18n/readme/README_JA.md) | [한국어 설명](i18n/readme/README_KOR.md) | [Persian](i18n/readme/README_FA.md) | [Français](i18n/readme/README_FR.md) | [Português](i18n/readme/README_PTBR.md) | [Türkçe](i18n/readme/README_TR.md) | [Русский](i18n/readme/README_RU.md) | [Español](i18n/readme/README_ES.md) | [Italiano](i18n/readme/README_IT.md) | [ไทย](i18n/readme/README_TH.md) | [Deutsch](i18n/readme/README_DE.md) | [Tiếng Việt](i18n/readme/README_VI.md) | [עִברִית](i18n/readme/README_HE.md) | [Tagalog](i18n/readme/README_TG.md) | [Polski](i18n/readme/README_PL.md) | [Arabic](i18n/readme/README_AR.md) | [Hungarian](i18n/readme/README_HU.md) | [Srpski](i18n/readme/README_RS.md) | [Română](i18n/readme/README_RO.md) | [Nederlands](i18n/readme/README_NL.md) | [Ελληνικά](i18n/readme/README_GR.md)
[中文说明](packages/docs/i18n/readme/README_CN.md) | [日本語の説明](packages/docs/i18n/readme/README_JA.md) | [한국어 설명](packages/docs/i18n/readme/README_KOR.md) | [Persian](packages/docs/i18n/readme/README_FA.md) | [Français](packages/docs/i18n/readme/README_FR.md) | [Português](packages/docs/i18n/readme/README_PTBR.md) | [Türkçe](packages/docs/i18n/readme/README_TR.md) | [Русский](packages/docs/i18n/readme/README_RU.md) | [Español](packages/docs/i18n/readme/README_ES.md) | [Italiano](packages/docs/i18n/readme/README_IT.md) | [ไทย](packages/docs/i18n/readme/README_TH.md) | [Deutsch](packages/docs/i18n/readme/README_DE.md) | [Tiếng Việt](packages/docs/i18n/readme/README_VI.md) | [עִברִית](packages/docs/i18n/readme/README_HE.md) | [Tagalog](packages/docs/i18n/readme/README_TG.md) | [Polski](packages/docs/i18n/readme/README_PL.md) | [Arabic](packages/docs/i18n/readme/README_AR.md) | [Hungarian](packages/docs/i18n/readme/README_HU.md) | [Srpski](packages/docs/i18n/readme/README_RS.md) | [Română](packages/docs/i18n/readme/README_RO.md) | [Nederlands](packages/docs/i18n/readme/README_NL.md) | [Ελληνικά](packages/docs/i18n/readme/README_GR.md)

## 🚩 Overview

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function AppSidebar() {
<div>
{Array.from({ length: 5 }).map(
(_, _index) => (
<SidebarMenuItem key={"skeleton-item"}>
<SidebarMenuItem key={"skeleton-item-"+_index}>
<SidebarMenuSkeleton />
</SidebarMenuItem>
)
Expand Down
50 changes: 16 additions & 34 deletions packages/client/src/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ import {
} from "@/components/ui/chat/chat-bubble";
import { ChatInput } from "@/components/ui/chat/chat-input";
import { ChatMessageList } from "@/components/ui/chat/chat-message-list";
import { useTransition, animated, type AnimatedProps } from "@react-spring/web";
import { Paperclip, Send, X } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import type { Content, UUID } from "@elizaos/core";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useToast } from "@/hooks/use-toast";
import { apiClient } from "@/lib/api";
import { cn, moment } from "@/lib/utils";
import { Avatar, AvatarImage } from "./ui/avatar";
import CopyButton from "./copy-button";
import ChatTtsButton from "./ui/chat/chat-tts-button";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
import { useToast } from "@/hooks/use-toast";
import AIWriter from "react-aiwriter";
import type { IAttachment } from "@/types";
import type { Content, UUID } from "@elizaos/core";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { Paperclip, Send, X } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import AIWriter from "react-aiwriter";
import { AudioRecorder } from "./audio-recorder";
import CopyButton from "./copy-button";
import { Avatar, AvatarImage } from "./ui/avatar";
import { Badge } from "./ui/badge";
import ChatTtsButton from "./ui/chat/chat-tts-button";
import { useAutoScroll } from "./ui/chat/hooks/useAutoScroll";
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";

type ExtraContentFields = {
user: string;
Expand All @@ -32,19 +31,17 @@ type ExtraContentFields = {

type ContentWithUser = Content & ExtraContentFields;

type AnimatedDivProps = AnimatedProps<{ style: React.CSSProperties }> & {
children?: React.ReactNode;
};

export default function Page({ agentId }: { agentId: UUID }) {
const { toast } = useToast();
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [input, setInput] = useState("");
const inputRef = useRef<HTMLTextAreaElement>(null);
const fileInputRef = useRef<HTMLInputElement>(null);
const formRef = useRef<HTMLFormElement>(null);

const queryClient = useQueryClient();
const messages =
queryClient.getQueryData<ContentWithUser[]>(["messages", agentId]) ||
[];

const getMessageVariant = (role: string) =>
role !== "user" ? "received" : "sent";
Expand Down Expand Up @@ -156,20 +153,6 @@ export default function Page({ agentId }: { agentId: UUID }) {
}
};

const messages =
queryClient.getQueryData<ContentWithUser[]>(["messages", agentId]) ||
[];

const transitions = useTransition(messages, {
keys: (message) =>
`${message.createdAt}-${message.user}-${message.text}`,
from: { opacity: 0, transform: "translateY(50px)" },
enter: { opacity: 1, transform: "translateY(0px)" },
leave: { opacity: 0, transform: "translateY(10px)" },
});

const CustomAnimatedDiv = animated.div as React.FC<AnimatedDivProps>;

return (
<div className="flex flex-col w-full h-[calc(100dvh)] p-4">
<div className="flex-1 overflow-y-auto">
Expand All @@ -179,12 +162,11 @@ export default function Page({ agentId }: { agentId: UUID }) {
scrollToBottom={scrollToBottom}
disableAutoScroll={disableAutoScroll}
>
{transitions((style, message: ContentWithUser) => {
{messages.map((message: ContentWithUser) => {
const variant = getMessageVariant(message?.user);
return (
<CustomAnimatedDiv
<div
style={{
...style,
display: "flex",
flexDirection: "column",
gap: "0.5rem",
Expand Down Expand Up @@ -277,7 +259,7 @@ export default function Page({ agentId }: { agentId: UUID }) {
</div>
</div>
</ChatBubble>
</CustomAnimatedDiv>
</div>
);
})}
</ChatMessageList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ChatMessageListProps extends React.HTMLAttributes<HTMLDivElement> {
}

const ChatMessageList = React.forwardRef<HTMLDivElement, ChatMessageListProps>(
({ className, children, scrollRef, isAtBottom, scrollToBottom, disableAutoScroll, ...props }) => {
({ className, children, scrollRef, isAtBottom, scrollToBottom, disableAutoScroll, ...props }, _ref) => {
return (
<div className="relative w-full h-full">
<div
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const SidebarProvider = React.forwardRef<
setOpen,
isMobile,
openMobile,
setOpenMobile,
toggleSidebar,
]
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

</div>

## 🌍 README Traductions

[中文说明](i18n/readme/README_CN.md) | [日本語の説明](i18n/readme/README_JA.md) | [한국어 설명](i18n/readme/README_KOR.md) | [Persian](i18n/readme/README_FA.md) | [Français](i18n/readme/README_FR.md) | [Português](i18n/readme/README_PTBR.md) | [Türkçe](i18n/readme/README_TR.md) | [Русский](i18n/readme/README_RU.md) | [Español](i18n/readme/README_ES.md) | [Italiano](i18n/readme/README_IT.md) | [ไทย](i18n/readme/README_TH.md) | [Deutsch](i18n/readme/README_DE.md) | [Tiếng Việt](i18n/readme/README_VI.md) | [עִברִית](i18n/readme/README_HE.md) | [Tagalog](i18n/readme/README_TG.md) | [Polski](i18n/readme/README_PL.md) | [Arabic](i18n/readme/README_AR.md) | [Hungarian](i18n/readme/README_HU.md) | [Srpski](i18n/readme/README_RS.md) | [Română](i18n/readme/README_RO.md) | [Nederlands](i18n/readme/README_NL.md) | [Ελληνικά](i18n/readme/README_GR.md)

## 🚩 Vue d'ensemble

<div align="center">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1a61e5b

Please sign in to comment.