diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 0312b760..00000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged \ No newline at end of file diff --git a/README.md b/README.md index 4d9c8465..83eac423 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FGan-Xing%2FChatGPT-Next-Web%2F&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web) - [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Yidadaa/ChatGPT-Next-Web) ![cover](./docs/images/cover.png) @@ -32,7 +31,7 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel. - New in v2: create, share and debug your chat tools with prompt templates (mask) - Awesome prompts powered by [awesome-chatgpt-prompts-zh](https://github.com/PlexPt/awesome-chatgpt-prompts-zh) and [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) - Automatically compresses chat history to support long conversations while also saving your tokens -- I18n: English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch +- I18n: English, 简体中文, 繁体中文, 日本語, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština ## Roadmap @@ -63,7 +62,7 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel. - 预制角色功能(面具),方便地创建、分享和调试你的个性化对话 - 海量的内置 prompt 列表,来自[中文](https://github.com/PlexPt/awesome-chatgpt-prompts-zh)和[英文](https://github.com/f/awesome-chatgpt-prompts) - 自动压缩上下文聊天记录,在节省 Token 的同时支持超长对话 -- 多国语言支持:English, 简体中文, 繁体中文, 日本語, Français, Español, Italiano, Türkçe, Deutsch +- 多国语言支持:English, 简体中文, 繁体中文, 日本語, Français, Español, Italiano, Türkçe, Deutsch, Tiếng Việt, Русский, Čeština - 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问 ## 开发计划 @@ -266,6 +265,7 @@ bash <(curl -s https://raw.githubusercontent.com/Yidadaa/ChatGPT-Next-Web/main/s [@jhansion](https://github.com/jhansion) [@Sha1rholder](https://github.com/Sha1rholder) [@AnsonHyq](https://github.com/AnsonHyq) +[@synwith](https://github.com/synwith) ### Contributor diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx index 02ea086b..c1365182 100644 --- a/app/components/chat-list.tsx +++ b/app/components/chat-list.tsx @@ -16,6 +16,7 @@ import { Link, useNavigate } from "react-router-dom"; import { Path } from "../constant"; import { MaskAvatar } from "./mask"; import { Mask } from "../store/mask"; +import { useRef, useEffect } from "react"; export function ChatItem(props: { onClick?: () => void; @@ -29,6 +30,14 @@ export function ChatItem(props: { narrow?: boolean; mask: Mask; }) { + const draggableRef = useRef(null); + useEffect(() => { + if (props.selected && draggableRef.current) { + draggableRef.current?.scrollIntoView({ + block: "center", + }); + } + }, [props.selected]); return ( {(provided) => ( @@ -37,7 +46,10 @@ export function ChatItem(props: { props.selected && styles["chat-item-selected"] }`} onClick={props.onClick} - ref={provided.innerRef} + ref={(ele) => { + draggableRef.current = ele; + provided.innerRef(ele); + }} {...provided.draggableProps} {...provided.dragHandleProps} title={`${props.title}\n${Locale.ChatItem.ChatItemCount( diff --git a/app/components/home.tsx b/app/components/home.tsx index 4c3d0a64..6b34a5a1 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -64,17 +64,17 @@ export function useSwitchTheme() { } const metaDescriptionDark = document.querySelector( - 'meta[name="theme-color"][media]', + 'meta[name="theme-color"][media*="dark"]', ); const metaDescriptionLight = document.querySelector( - 'meta[name="theme-color"]:not([media])', + 'meta[name="theme-color"][media*="light"]', ); if (config.theme === "auto") { metaDescriptionDark?.setAttribute("content", "#151515"); metaDescriptionLight?.setAttribute("content", "#fafafa"); } else { - const themeColor = getCSSVar("--themeColor"); + const themeColor = getCSSVar("--theme-color"); metaDescriptionDark?.setAttribute("content", themeColor); metaDescriptionLight?.setAttribute("content", themeColor); } diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 2e08c251..eb83d890 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -573,9 +573,9 @@ export function Settings() { { + updateConfig={(updater) => { const modelConfig = { ...config.modelConfig }; - upater(modelConfig); + updater(modelConfig); config.update((config) => (config.modelConfig = modelConfig)); }} /> diff --git a/app/layout.tsx b/app/layout.tsx index f2e765ae..d08f87e4 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,11 +9,19 @@ const buildConfig = getBuildConfig(); export const metadata = { title: "ChatGPT Next Web", description: "Your personal ChatGPT Chat Bot.", + viewport: { + width: "device-width", + initialScale: 1, + maximumScale: 1, + }, + themeColor: [ + { media: "(prefers-color-scheme: light)", color: "#fafafa" }, + { media: "(prefers-color-scheme: dark)", color: "#151515" }, + ], appleWebApp: { title: "ChatGPT Next Web", statusBarStyle: "default", }, - viewport: "width=device-width, initial-scale=1, maximum-scale=1", }; export default function RootLayout({ @@ -24,22 +32,12 @@ export default function RootLayout({ return ( - - diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e586708d..eb70007f 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -79,7 +79,7 @@ const cn = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/cs.ts b/app/locales/cs.ts index ca2c2304..4c00b626 100644 --- a/app/locales/cs.ts +++ b/app/locales/cs.ts @@ -81,7 +81,7 @@ const cs: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/de.ts b/app/locales/de.ts index dd888e7a..dcfee2b2 100644 --- a/app/locales/de.ts +++ b/app/locales/de.ts @@ -82,7 +82,7 @@ const de: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/en.ts b/app/locales/en.ts index ba138172..c7c9d196 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -81,7 +81,7 @@ const en: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/es.ts b/app/locales/es.ts index 9b6070f6..37eb7ccc 100644 --- a/app/locales/es.ts +++ b/app/locales/es.ts @@ -81,7 +81,7 @@ const es: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/it.ts b/app/locales/it.ts index 31334370..1e51a974 100644 --- a/app/locales/it.ts +++ b/app/locales/it.ts @@ -81,7 +81,7 @@ const it: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/jp.ts b/app/locales/jp.ts index a55734a6..9e3f50f9 100644 --- a/app/locales/jp.ts +++ b/app/locales/jp.ts @@ -81,7 +81,7 @@ const jp: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/ru.ts b/app/locales/ru.ts index 49079b74..e8549829 100644 --- a/app/locales/ru.ts +++ b/app/locales/ru.ts @@ -81,7 +81,7 @@ const ru: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/tr.ts b/app/locales/tr.ts index 88e76543..49e8f3a8 100644 --- a/app/locales/tr.ts +++ b/app/locales/tr.ts @@ -81,7 +81,7 @@ const tr: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/tw.ts b/app/locales/tw.ts index d1ab127a..35b1a84b 100644 --- a/app/locales/tw.ts +++ b/app/locales/tw.ts @@ -79,7 +79,7 @@ const tw: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/locales/vi.ts b/app/locales/vi.ts index f8b5bebc..ddf917b7 100644 --- a/app/locales/vi.ts +++ b/app/locales/vi.ts @@ -2,7 +2,7 @@ import { SubmitKey } from "../store/config"; import type { LocaleType } from "./index"; const vi: LocaleType = { - WIP: "Coming Soon...", + WIP: "Sắp ra mắt...", Error: { Unauthorized: "Truy cập chưa xác thực, vui lòng nhập mã truy cập trong trang cài đặt.", @@ -81,7 +81,7 @@ const vi: LocaleType = { tr: "Türkçe", jp: "日本語", de: "Deutsch", - vi: "Vietnamese", + vi: "Tiếng Việt", ru: "Русский", cs: "Čeština", }, diff --git a/app/masks/cn.ts b/app/masks/cn.ts index 757a35ee..86af414b 100644 --- a/app/masks/cn.ts +++ b/app/masks/cn.ts @@ -1,6 +1,38 @@ import { BuiltinMask } from "./typing"; -export const CN_MASKS: BuiltinMask[] = [ +export const CN_MASKS: BuiltinMask[] = [{ + avatar:"gpt-bot", + name:"文生图", + context: [ + {role:"system", + content:"You are a useful Assistant that won't refuse to draw picture, instead, you will output specific markdown code for picture description, but don't use code block.", + date:"", + }, + {role:"user", + content:"Can you draw some pictures for me?", + date:"", + }, + {role:"assistant", + content:"Sure, what do you want me to draw?", + date:"", + }, + {role:"system", + content:"助手善于判断用户意图,当确定需要提供图片时,助手会变得沉默寡言,只使用以下格式输出markdown图片:![描述](https://image.pollinations.ai/prompt/描述),因为这个语法可以自动按照提示生成并渲染图片。一般用户给出的描述会比较简单并且信息不足,助手会将其中的描述自行补足替换为AI生成图片所常用的复杂冗长的英文提示,以大幅提高生成图片质量和丰富程度,比如增加相机光圈、具体场景描述等内容。助手会避免用代码块或原始块包围markdown标记,因为那样只会渲染出代码块或原始块而不是图片。", + date:"", + }, + ], + modelConfig:{ + model:"gpt-3.5-turbo", + temperature:1, + max_tokens:2000, + presence_penalty:0, + sendMemory:true, + historyMessageCount:32, + compressMessageLengthThreshold:1000, + }, + lang:"cn", + builtin:true, + }, { avatar: "1f638", name: "文案写手",