diff --git a/app/page.tsx b/app/page.tsx index 5ce26d2..c422de0 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -50,9 +50,6 @@ export default function Home() { }} /> -
loadDiagram(xml)} diff --git a/components/assistant-ui/markdown-text.tsx b/components/assistant-ui/markdown-text.tsx deleted file mode 100644 index 4dbdce1..0000000 --- a/components/assistant-ui/markdown-text.tsx +++ /dev/null @@ -1,132 +0,0 @@ -"use client"; - -import "@assistant-ui/react-markdown/styles/dot.css"; - -import { - CodeHeaderProps, - MarkdownTextPrimitive, - unstable_memoizeMarkdownComponents as memoizeMarkdownComponents, - useIsMarkdownCodeBlock, -} from "@assistant-ui/react-markdown"; -import remarkGfm from "remark-gfm"; -import { FC, memo, useState } from "react"; -import { CheckIcon, CopyIcon } from "lucide-react"; - -import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button"; -import { cn } from "@/lib/utils"; - -const MarkdownTextImpl = () => { - return ( - - ); -}; - -export const MarkdownText = memo(MarkdownTextImpl); - -const CodeHeader: FC = ({ language, code }) => { - const { isCopied, copyToClipboard } = useCopyToClipboard(); - const onCopy = () => { - if (!code || isCopied) return; - copyToClipboard(code); - }; - - return ( -
- {language} - - {!isCopied && } - {isCopied && } - -
- ); -}; - -const useCopyToClipboard = ({ - copiedDuration = 3000, -}: { - copiedDuration?: number; -} = {}) => { - const [isCopied, setIsCopied] = useState(false); - - const copyToClipboard = (value: string) => { - if (!value) return; - - navigator.clipboard.writeText(value).then(() => { - setIsCopied(true); - setTimeout(() => setIsCopied(false), copiedDuration); - }); - }; - - return { isCopied, copyToClipboard }; -}; - -const defaultComponents = memoizeMarkdownComponents({ - h1: ({ className, ...props }) => ( -

- ), - h2: ({ className, ...props }) => ( -

- ), - h3: ({ className, ...props }) => ( -

- ), - h4: ({ className, ...props }) => ( -

- ), - h5: ({ className, ...props }) => ( -

- ), - h6: ({ className, ...props }) => ( -
- ), - p: ({ className, ...props }) => ( -

- ), - a: ({ className, ...props }) => ( - - ), - blockquote: ({ className, ...props }) => ( -

- ), - ul: ({ className, ...props }) => ( -
    li]:mt-2", className)} {...props} /> - ), - ol: ({ className, ...props }) => ( -
      li]:mt-2", className)} {...props} /> - ), - hr: ({ className, ...props }) => ( -
      - ), - table: ({ className, ...props }) => ( - - ), - th: ({ className, ...props }) => ( - td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg", className)} {...props} /> - ), - sup: ({ className, ...props }) => ( - a]:text-xs [&>a]:no-underline", className)} {...props} /> - ), - pre: ({ className, ...props }) => ( -
      -  ),
      -  code: function Code({ className, ...props }) {
      -    const isCodeBlock = useIsMarkdownCodeBlock();
      -    return (
      -      
      -    );
      -  },
      -  CodeHeader,
      -});
      diff --git a/components/assistant-ui/thread-list.tsx b/components/assistant-ui/thread-list.tsx
      deleted file mode 100644
      index 3a8f738..0000000
      --- a/components/assistant-ui/thread-list.tsx
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -import type { FC } from "react";
      -import {
      -  ThreadListItemPrimitive,
      -  ThreadListPrimitive,
      -} from "@assistant-ui/react";
      -import { ArchiveIcon, PlusIcon } from "lucide-react";
      -
      -import { Button } from "@/components/ui/button";
      -import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
      -
      -export const ThreadList: FC = () => {
      -  return (
      -    
      -      
      -      
      -    
      -  );
      -};
      -
      -const ThreadListNew: FC = () => {
      -  return (
      -    
      -      
      -    
      -  );
      -};
      -
      -const ThreadListItems: FC = () => {
      -  return ;
      -};
      -
      -const ThreadListItem: FC = () => {
      -  return (
      -    
      -      
      -        
      -      
      -      
      -    
      -  );
      -};
      -
      -const ThreadListItemTitle: FC = () => {
      -  return (
      -    

      - -

      - ); -}; - -const ThreadListItemArchive: FC = () => { - return ( - - - - - - ); -}; diff --git a/components/assistant-ui/thread.tsx b/components/assistant-ui/thread.tsx deleted file mode 100644 index cd1d0ce..0000000 --- a/components/assistant-ui/thread.tsx +++ /dev/null @@ -1,287 +0,0 @@ -import { - ActionBarPrimitive, - BranchPickerPrimitive, - ComposerPrimitive, - MessagePrimitive, - ThreadPrimitive, -} from "@assistant-ui/react"; -import type { FC } from "react"; -import { - ArrowDownIcon, - CheckIcon, - ChevronLeftIcon, - ChevronRightIcon, - CopyIcon, - PencilIcon, - RefreshCwIcon, - SendHorizontalIcon, -} from "lucide-react"; -import { cn } from "@/lib/utils"; - -import { Button } from "@/components/ui/button"; -import { MarkdownText } from "@/components/assistant-ui/markdown-text"; -import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button"; - -export const Thread: FC = () => { - return ( - - - - - - - -
      - - -
      - - -
      - - - ); -}; - -const ThreadScrollToBottom: FC = () => { - return ( - - - - - - ); -}; - -const ThreadWelcome: FC = () => { - return ( - -
      -
      -

      - How can I help you today? -

      -
      - {/* */} -
      -
      - ); -}; - -const ThreadWelcomeSuggestions: FC = () => { - return ( -
      - - - What is the weather in Tokyo? - - - - - What is assistant-ui? - - -
      - ); -}; - -const Composer: FC = () => { - return ( - - - - - ); -}; - -const ComposerAction: FC = () => { - return ( - <> - - - - - - - - - - - - - - - - ); -}; - -const UserMessage: FC = () => { - return ( - - - -
      - -
      - - -
      - ); -}; - -const UserActionBar: FC = () => { - return ( - - - - - - - - ); -}; - -const EditComposer: FC = () => { - return ( - - - -
      - - - - - - -
      -
      - ); -}; - -const AssistantMessage: FC = () => { - return ( - -
      - -
      - - - - -
      - ); -}; - -const AssistantActionBar: FC = () => { - return ( - - - - - - - - - - - - - - - - - - ); -}; - -const BranchPicker: FC = ({ - className, - ...rest -}) => { - return ( - - - - - - - - /{" "} - - - - - - - - - ); -}; - -const CircleStopIcon = () => { - return ( - - - - ); -}; diff --git a/components/assistant-ui/tooltip-icon-button.tsx b/components/assistant-ui/tooltip-icon-button.tsx deleted file mode 100644 index b30f876..0000000 --- a/components/assistant-ui/tooltip-icon-button.tsx +++ /dev/null @@ -1,44 +0,0 @@ -"use client"; - -import { ComponentPropsWithoutRef, forwardRef } from "react"; - -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; -import { Button } from "@/components/ui/button"; -import { cn } from "@/lib/utils"; - -export type TooltipIconButtonProps = ComponentPropsWithoutRef & { - tooltip: string; - side?: "top" | "bottom" | "left" | "right"; -}; - -export const TooltipIconButton = forwardRef< - HTMLButtonElement, - TooltipIconButtonProps ->(({ children, tooltip, side = "bottom", className, ...rest }, ref) => { - return ( - - - - - - {tooltip} - - - ); -}); - -TooltipIconButton.displayName = "TooltipIconButton"; diff --git a/components/chatPanel.tsx b/components/chatPanel.tsx index ca80f60..4a28dda 100644 --- a/components/chatPanel.tsx +++ b/components/chatPanel.tsx @@ -9,7 +9,6 @@ import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/componen import { ScrollArea } from "@/components/ui/scroll-area" import { Loader2, Send } from "lucide-react" import { useChat } from '@ai-sdk/react'; -import { ToolInvocation } from 'ai'; interface ChatPanelProps { onDisplayChart: (xml: string) => void; @@ -112,7 +111,7 @@ export default function ChatPanel({ onDisplayChart, onFetchChart }: ChatPanelPro }; return ( - + Chat with Diagram Generator diff --git a/docs/drawio-xml-schema-guide.md b/docs/drawio-xml-schema-guide.md deleted file mode 100644 index e69de29..0000000
      - ), - td: ({ className, ...props }) => ( - - ), - tr: ({ className, ...props }) => ( -