From 71ce23ef21d8282e57ea9b51494471e8a4e9dcc6 Mon Sep 17 00:00:00 2001 From: BiggerRain <15911122312@163.COM> Date: Mon, 19 May 2025 16:56:00 +0800 Subject: [PATCH] style: history component styles (#528) * style: history component styles * docs: update notes * build: build & publish web componet version 1.2.1 * build: build & publish web componet version 1.2.2 --- docs/content.en/docs/release-notes/_index.md | 1 + package.json | 3 +- .../images/ReadAloud}/back-dark.png | Bin .../images/ReadAloud}/back-light.png | Bin .../images/ReadAloud}/close-dark.png | Bin .../images/ReadAloud}/close-light.png | Bin .../images/ReadAloud}/forward-dark.png | Bin .../images/ReadAloud}/forward-light.png | Bin .../images/ReadAloud}/loading-dark.png | Bin .../images/ReadAloud}/loading-light.png | Bin .../images/ReadAloud}/pause-dark.png | Bin .../images/ReadAloud}/pause-light.png | Bin .../images/ReadAloud}/play-dark.png | Bin .../images/ReadAloud}/play-light.png | Bin src/components/Assistant/Chat.tsx | 2 +- src/components/Assistant/ChatContent.tsx | 6 ++-- src/components/Assistant/ChatHeader.tsx | 2 +- src/components/Assistant/ChatSidebar.tsx | 4 +-- .../{ReadAloud/index.tsx => ReadAloud.tsx} | 27 +++++++++--------- src/components/Assistant/Sidebar.tsx | 2 +- src/components/ChatMessage/CallTools.tsx | 2 +- src/components/ChatMessage/DeepRead.tsx | 2 +- src/components/ChatMessage/FetchSource.tsx | 2 +- src/components/ChatMessage/PickSource.tsx | 2 +- src/components/ChatMessage/QueryIntent.tsx | 2 +- src/components/ChatMessage/Think.tsx | 2 +- src/components/ChatMessage/index.tsx | 2 +- src/components/Common/HistoryList/index.tsx | 2 +- src/components/SearchChat/index.tsx | 2 +- src/hooks/useChatActions.ts | 2 +- src/hooks/useMessageChunkData.ts | 2 +- src/hooks/useMessageHandler.ts | 2 +- src/pages/chat/index.tsx | 2 +- .../Assistant/types.ts => types/chat.ts} | 0 tsup.config.ts | 2 +- 35 files changed, 39 insertions(+), 36 deletions(-) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/back-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/back-light.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/close-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/close-light.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/forward-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/forward-light.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/loading-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/loading-light.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/pause-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/pause-light.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/play-dark.png (100%) rename src/{components/Assistant/ReadAloud/imgs => assets/images/ReadAloud}/play-light.png (100%) rename src/components/Assistant/{ReadAloud/index.tsx => ReadAloud.tsx} (80%) rename src/{components/Assistant/types.ts => types/chat.ts} (100%) diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md index 544cbea4..22c422f5 100644 --- a/docs/content.en/docs/release-notes/_index.md +++ b/docs/content.en/docs/release-notes/_index.md @@ -61,6 +61,7 @@ Information about release notes of Coco Server is provided here. - refactor: refactoring icon component #514 - refactor: optimizing list styles in markdown content #520 - feat: add a component for text reading aloud #522 +- style: history component styles #528 ## 0.4.0 (2025-04-27) diff --git a/package.json b/package.json index a23fb404..5b2057f4 100644 --- a/package.json +++ b/package.json @@ -89,5 +89,6 @@ "tsx": "^4.19.4", "typescript": "^5.8.3", "vite": "^5.4.19" - } + }, + "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" } diff --git a/src/components/Assistant/ReadAloud/imgs/back-dark.png b/src/assets/images/ReadAloud/back-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/back-dark.png rename to src/assets/images/ReadAloud/back-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/back-light.png b/src/assets/images/ReadAloud/back-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/back-light.png rename to src/assets/images/ReadAloud/back-light.png diff --git a/src/components/Assistant/ReadAloud/imgs/close-dark.png b/src/assets/images/ReadAloud/close-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/close-dark.png rename to src/assets/images/ReadAloud/close-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/close-light.png b/src/assets/images/ReadAloud/close-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/close-light.png rename to src/assets/images/ReadAloud/close-light.png diff --git a/src/components/Assistant/ReadAloud/imgs/forward-dark.png b/src/assets/images/ReadAloud/forward-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/forward-dark.png rename to src/assets/images/ReadAloud/forward-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/forward-light.png b/src/assets/images/ReadAloud/forward-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/forward-light.png rename to src/assets/images/ReadAloud/forward-light.png diff --git a/src/components/Assistant/ReadAloud/imgs/loading-dark.png b/src/assets/images/ReadAloud/loading-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/loading-dark.png rename to src/assets/images/ReadAloud/loading-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/loading-light.png b/src/assets/images/ReadAloud/loading-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/loading-light.png rename to src/assets/images/ReadAloud/loading-light.png diff --git a/src/components/Assistant/ReadAloud/imgs/pause-dark.png b/src/assets/images/ReadAloud/pause-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/pause-dark.png rename to src/assets/images/ReadAloud/pause-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/pause-light.png b/src/assets/images/ReadAloud/pause-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/pause-light.png rename to src/assets/images/ReadAloud/pause-light.png diff --git a/src/components/Assistant/ReadAloud/imgs/play-dark.png b/src/assets/images/ReadAloud/play-dark.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/play-dark.png rename to src/assets/images/ReadAloud/play-dark.png diff --git a/src/components/Assistant/ReadAloud/imgs/play-light.png b/src/assets/images/ReadAloud/play-light.png similarity index 100% rename from src/components/Assistant/ReadAloud/imgs/play-light.png rename to src/assets/images/ReadAloud/play-light.png diff --git a/src/components/Assistant/Chat.tsx b/src/components/Assistant/Chat.tsx index c0c5022d..632e5240 100644 --- a/src/components/Assistant/Chat.tsx +++ b/src/components/Assistant/Chat.tsx @@ -19,7 +19,7 @@ import { ChatSidebar } from "./ChatSidebar"; import { ChatHeader } from "./ChatHeader"; import { ChatContent } from "./ChatContent"; import ConnectPrompt from "./ConnectPrompt"; -import type { Chat } from "./types"; +import type { Chat } from "@/types/chat"; import PrevSuggestion from "@/components/ChatMessage/PrevSuggestion"; import { useAppStore } from "@/stores/appStore"; // import ReadAloud from "./ReadAloud"; diff --git a/src/components/Assistant/ChatContent.tsx b/src/components/Assistant/ChatContent.tsx index db3c829e..e55b39af 100644 --- a/src/components/Assistant/ChatContent.tsx +++ b/src/components/Assistant/ChatContent.tsx @@ -1,18 +1,18 @@ import { useRef, useEffect, UIEvent, useState } from "react"; import { useTranslation } from "react-i18next"; +import { ArrowDown } from "lucide-react"; +import clsx from "clsx"; import { ChatMessage } from "@/components/ChatMessage"; import { Greetings } from "./Greetings"; import FileList from "@/components/Assistant/FileList"; import { useChatScroll } from "@/hooks/useChatScroll"; import { useChatStore } from "@/stores/chatStore"; -import type { Chat, IChunkData } from "./types"; +import type { Chat, IChunkData } from "@/types/chat"; // import SessionFile from "./SessionFile"; import { useConnectStore } from "@/stores/connectStore"; import SessionFile from "./SessionFile"; import Splash from "./Splash"; -import { ArrowDown } from "lucide-react"; -import clsx from "clsx"; interface ChatContentProps { activeChat?: Chat; diff --git a/src/components/Assistant/ChatHeader.tsx b/src/components/Assistant/ChatHeader.tsx index 93a7c037..54a7dd62 100644 --- a/src/components/Assistant/ChatHeader.tsx +++ b/src/components/Assistant/ChatHeader.tsx @@ -6,7 +6,7 @@ import PinOffIcon from "@/icons/PinOff"; import PinIcon from "@/icons/Pin"; import WindowsFullIcon from "@/icons/WindowsFull"; import { useAppStore, IServer } from "@/stores/appStore"; -import type { Chat } from "./types"; +import type { Chat } from "@/types/chat"; import platformAdapter from "@/utils/platformAdapter"; import VisibleKey from "../Common/VisibleKey"; import { useShortcutsStore } from "@/stores/shortcutsStore"; diff --git a/src/components/Assistant/ChatSidebar.tsx b/src/components/Assistant/ChatSidebar.tsx index 297da140..4aac6f7f 100644 --- a/src/components/Assistant/ChatSidebar.tsx +++ b/src/components/Assistant/ChatSidebar.tsx @@ -1,7 +1,7 @@ import React from "react"; // import { Sidebar } from "@/components/Assistant/Sidebar"; -import type { Chat } from "./types"; +import type { Chat } from "@/types/chat"; import HistoryList from "../Common/HistoryList"; import { HISTORY_PANEL_ID } from "@/constants"; @@ -32,7 +32,7 @@ export const ChatSidebar: React.FC = ({
(); diff --git a/src/hooks/useMessageHandler.ts b/src/hooks/useMessageHandler.ts index 17f43416..9b7891ff 100644 --- a/src/hooks/useMessageHandler.ts +++ b/src/hooks/useMessageHandler.ts @@ -1,6 +1,6 @@ import { useCallback, useRef } from "react"; -import type { IChunkData, Chat } from "@/components/Assistant/types"; +import type { IChunkData, Chat } from "@/types/chat"; import { useConnectStore } from "@/stores/connectStore"; export function useMessageHandler( diff --git a/src/pages/chat/index.tsx b/src/pages/chat/index.tsx index 4cafc2d0..d9883228 100644 --- a/src/pages/chat/index.tsx +++ b/src/pages/chat/index.tsx @@ -15,7 +15,7 @@ import { open } from "@tauri-apps/plugin-dialog"; import { metadata, icon } from "tauri-plugin-fs-pro-api"; import ChatAI, { ChatAIRef } from "@/components/Assistant/Chat"; -import type { Chat as typeChat } from "@/components/Assistant/types"; +import type { Chat as typeChat } from "@/types/chat"; import { useConnectStore } from "@/stores/connectStore"; import InputBox from "@/components/Search/InputBox"; import { diff --git a/src/components/Assistant/types.ts b/src/types/chat.ts similarity index 100% rename from src/components/Assistant/types.ts rename to src/types/chat.ts diff --git a/tsup.config.ts b/tsup.config.ts index 085ce4f4..657e3858 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -67,7 +67,7 @@ export default defineConfig({ const packageJson = { name: "@infinilabs/search-chat", - version: "1.2.0", + version: "1.2.2", main: "index.js", module: "index.js", type: "module",