From f85aad18e431767f3e9736b3edc7bc9ab561e897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=BC=A6=E8=AF=AD?= Date: Sat, 4 Oct 2025 21:28:31 +0800 Subject: [PATCH 1/2] feat(playground): optimize dark mode --- playground/package.json | 3 +- playground/src/App.tsx | 14 +- playground/src/assets/react.svg | 1 - playground/src/assets/search.svg | 4 +- playground/src/assets/setting.svg | 4 +- playground/src/assets/theme.svg | 2 +- playground/src/communicate.tsx | 13 +- playground/src/history.tsx | 12 +- playground/src/language.tsx | 2 +- playground/src/locales/en.json | 2 +- playground/src/settings.tsx | 4 +- playground/src/theme.tsx | 4 +- playground/src/vite-env.d.ts | 1 + playground/vite.config.ts | 3 +- pnpm-lock.yaml | 217 ++++++++++++++++++++++++++++-- 15 files changed, 248 insertions(+), 38 deletions(-) delete mode 100644 playground/src/assets/react.svg diff --git a/playground/package.json b/playground/package.json index f97f32e..3de658c 100644 --- a/playground/package.json +++ b/playground/package.json @@ -31,6 +31,7 @@ "react": "^19.1.1", "react-dom": "^19.1.1", "typescript": "~5.8.3", - "vite": "npm:rolldown-vite@^7.1.14" + "vite": "npm:rolldown-vite@^7.1.14", + "vite-plugin-svgr": "^4.5.0" } } diff --git a/playground/src/App.tsx b/playground/src/App.tsx index d15a5aa..b0bca25 100644 --- a/playground/src/App.tsx +++ b/playground/src/App.tsx @@ -30,7 +30,7 @@ function App() { className={clsx( "min-h-screen bg-gradient-to-b", "from-blue-300 via-pink-100 via-10% to-violet-300", - "dark:from-[#a77693] dark:via-[#174871] dark:via-80% dark:to-[#0f2d4d]", + "dark:from-[#865f77] dark:via-[#133b5c] dark:via-80% dark:to-[#091e35]", )} >
@@ -38,16 +38,16 @@ function App() {
MateChat logo - MateChat + MateChat
-
+
Chat icon - {t("chat")} + {t("chat")}
@@ -61,6 +61,7 @@ function App() { className={clsx( "w-1/4 p-3 rounded-l-xl min-w-[240px] max-w-[380px]", "bg-gradient-to-b from-gray-100/80 from-10% to-violet-100/80", + "dark:bg-none dark:bg-slate-900/40", )} > @@ -69,6 +70,7 @@ function App() { className={clsx( "flex-1 rounded-r-xl", "bg-gradient-to-b from-[#fffffff2] to-[#f8fafff2]", + "dark:bg-none dark:bg-black/35", )} > @@ -79,4 +81,4 @@ function App() { ); } -export default App; +export default App; \ No newline at end of file diff --git a/playground/src/assets/react.svg b/playground/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/playground/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/playground/src/assets/search.svg b/playground/src/assets/search.svg index 6779954..32e5e37 100644 --- a/playground/src/assets/search.svg +++ b/playground/src/assets/search.svg @@ -1,6 +1,6 @@ 搜索 - - + + \ No newline at end of file diff --git a/playground/src/assets/setting.svg b/playground/src/assets/setting.svg index 1fe4852..8bd430b 100644 --- a/playground/src/assets/setting.svg +++ b/playground/src/assets/setting.svg @@ -4,11 +4,11 @@ - + 设置 - + \ No newline at end of file diff --git a/playground/src/assets/theme.svg b/playground/src/assets/theme.svg index 6c55279..71bce33 100644 --- a/playground/src/assets/theme.svg +++ b/playground/src/assets/theme.svg @@ -2,7 +2,7 @@ icon icon-theme - + diff --git a/playground/src/communicate.tsx b/playground/src/communicate.tsx index 0f26006..c104b20 100644 --- a/playground/src/communicate.tsx +++ b/playground/src/communicate.tsx @@ -4,6 +4,7 @@ import { useChat, useMateChat } from "@matechat/react/utils/index"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import mcLogo from "./assets/logo.svg"; +import clsx from "clsx"; function Communicate() { const { t } = useTranslation(); @@ -31,14 +32,18 @@ function Communicate() {
MateChat logo - MateChat + MateChat
- {t("tip")} + {t("tip")}
)}
{t("attention")} -
+
{t("privacy")} diff --git a/playground/src/history.tsx b/playground/src/history.tsx index 329f90c..3dbdf48 100644 --- a/playground/src/history.tsx +++ b/playground/src/history.tsx @@ -1,19 +1,19 @@ import { useTranslation } from "react-i18next"; import historyImg from "./assets/history.png"; -import searchIcon from "./assets/search.svg"; +import SearchIcon from "./assets/search.svg?react"; function History() { const { t } = useTranslation(); return (
- {t("history")} -
- search + {t("history")} +
+ + className="focus:outline-none mx-2 text-sm text-gray-800 dark:text-gray-200" + />
history diff --git a/playground/src/language.tsx b/playground/src/language.tsx index 10d9641..ad658e3 100644 --- a/playground/src/language.tsx +++ b/playground/src/language.tsx @@ -13,7 +13,7 @@ function Language() { onClick={toggleLanguage} className="px-2 py-1.5 bg-transparent hover:bg-white/23 rounded-lg cursor-pointer" > - + {i18n.language === "zh" ? "EN" : "CN"} diff --git a/playground/src/locales/en.json b/playground/src/locales/en.json index c55cc74..58afadc 100644 --- a/playground/src/locales/en.json +++ b/playground/src/locales/en.json @@ -6,6 +6,6 @@ "attention": "Content generated by AI, reference only", "privacy": "Privacy Statement", "tip": "Welcome to the MateChat, please enter your API key in Settings", - "search": "Search" + "search": "Search Chat" } } diff --git a/playground/src/settings.tsx b/playground/src/settings.tsx index ffbd552..38a23bd 100644 --- a/playground/src/settings.tsx +++ b/playground/src/settings.tsx @@ -2,7 +2,7 @@ import { createOpenAIBackend } from "@matechat/react/utils/backend"; import { agent } from "@matechat/react/utils/core"; import clsx from "clsx"; import { useState } from "react"; -import settingIcon from "./assets/setting.svg"; +import SettingIcon from "./assets/setting.svg?react"; function Settings() { const [isOpen, setOpen] = useState(false); @@ -37,7 +37,7 @@ function Settings() { onClick={openModal} className="p-2 bg-transparent hover:bg-white/23 rounded-lg cursor-pointer" > - setting icon + {isOpen && (
diff --git a/playground/src/theme.tsx b/playground/src/theme.tsx index 37aa35a..c99a900 100644 --- a/playground/src/theme.tsx +++ b/playground/src/theme.tsx @@ -1,7 +1,7 @@ import clsx from "clsx"; import type React from "react"; import { useCallback } from "react"; -import themeIcon from "./assets/theme.svg"; +import ThemeIcon from "./assets/theme.svg?react"; function ThemeToggle({ className, @@ -26,7 +26,7 @@ function ThemeToggle({ onClick={toggleTheme} {...props} > - theme icon + ); } diff --git a/playground/src/vite-env.d.ts b/playground/src/vite-env.d.ts index 11f02fe..b1f45c7 100644 --- a/playground/src/vite-env.d.ts +++ b/playground/src/vite-env.d.ts @@ -1 +1,2 @@ /// +/// diff --git a/playground/vite.config.ts b/playground/vite.config.ts index 43f36fa..20a2800 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -2,6 +2,7 @@ import path from "node:path"; import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; import { createLogger, defineConfig } from "vite"; +import svgr from "vite-plugin-svgr"; // Suppress warnings from Rolldown Vite // This is due to compatibility issues with Vite and Rolldown Vite. @@ -9,7 +10,7 @@ const logger = createLogger(); logger.warn = () => {}; export default defineConfig({ - plugins: [react(), tailwindcss()], + plugins: [react(), tailwindcss(), svgr()], customLogger: logger, resolve: { alias: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7fb71b..584d349 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -188,6 +188,9 @@ importers: vite: specifier: npm:rolldown-vite@^7.1.14 version: rolldown-vite@7.1.14(@types/node@24.6.1)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0) + vite-plugin-svgr: + specifier: ^4.5.0 + version: 4.5.0(rolldown-vite@7.1.14(@types/node@24.6.1)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0))(rollup@4.52.3)(typescript@5.8.3) packages: @@ -1380,6 +1383,74 @@ packages: '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} + '@svgr/babel-plugin-add-jsx-attribute@8.0.0': + resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-remove-jsx-attribute@8.0.0': + resolution: {integrity: sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0': + resolution: {integrity: sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0': + resolution: {integrity: sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-svg-dynamic-title@8.0.0': + resolution: {integrity: sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-svg-em-dimensions@8.0.0': + resolution: {integrity: sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-transform-react-native-svg@8.1.0': + resolution: {integrity: sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-plugin-transform-svg-component@8.0.0': + resolution: {integrity: sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw==} + engines: {node: '>=12'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/babel-preset@8.1.0': + resolution: {integrity: sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug==} + engines: {node: '>=14'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@svgr/core@8.1.0': + resolution: {integrity: sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==} + engines: {node: '>=14'} + + '@svgr/hast-util-to-babel-ast@8.0.0': + resolution: {integrity: sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q==} + engines: {node: '>=14'} + + '@svgr/plugin-jsx@8.1.0': + resolution: {integrity: sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA==} + engines: {node: '>=14'} + peerDependencies: + '@svgr/core': '*' + '@swc/core-darwin-arm64@1.13.5': resolution: {integrity: sha512-lKNv7SujeXvKn16gvQqUQI5DdyY8v7xcoO3k06/FJbHJS90zEwZdQiMNRiqpYw/orU543tPaWgz7cIYWhbopiQ==} engines: {node: '>=10'} @@ -1740,9 +1811,6 @@ packages: '@types/node@18.19.113': resolution: {integrity: sha512-TmSTE9vyebJ9vSEiU+P+0Sp4F5tMgjiEOZaQUW6wA3ODvi6uBgkHQ+EsIu0pbiKvf9QHEvyRCiaz03rV0b+IaA==} - '@types/node@18.19.129': - resolution: {integrity: sha512-hrmi5jWt2w60ayox3iIXwpMEnfUvOLJCRtrOPbHtH15nTjvO7uhnelvrdAs0dO0/zl5DZ3ZbahiaXEVb54ca/A==} - '@types/node@20.19.19': resolution: {integrity: sha512-pb1Uqj5WJP7wrcbLU7Ru4QtA0+3kAXrkutGiD26wUKzSMgNNaPARTUDQmElUXp64kh3cWdou3Q0C7qwwxqSFmg==} @@ -2210,6 +2278,10 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + caniuse-lite@1.0.30001726: resolution: {integrity: sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==} @@ -2484,6 +2556,9 @@ packages: domutils@3.2.2: resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==} + dot-case@3.0.4: + resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} + dts-resolver@2.1.2: resolution: {integrity: sha512-xeXHBQkn2ISSXxbJWD828PFjtyg+/UrMDo7W4Ffcs7+YWCquxU8YjV1KoxuiL+eJ5pg3ll+bC6flVv61L3LKZg==} engines: {node: '>=20.18.0'} @@ -3410,6 +3485,9 @@ packages: loupe@3.2.1: resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + lower-case@2.0.2: + resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} + lowlight@1.20.0: resolution: {integrity: sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==} @@ -3888,6 +3966,9 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + no-case@3.0.4: + resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} + node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -4666,6 +4747,9 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + snake-case@3.0.4: + resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} + solid-js@1.9.7: resolution: {integrity: sha512-/saTKi8iWEM233n5OSi1YHCCuh66ZIQ7aK2hsToPe4tqGm7qAejU1SwNuTPivbWAYq7SjuHVVYxxuZQNRbICiw==} @@ -4819,6 +4903,9 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + svg-parser@2.0.4: + resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} + sync-child-process@1.0.2: resolution: {integrity: sha512-8lD+t2KrrScJ/7KXCSyfhT3/hRq78rC0wBFqNJXv3mZyn6hW2ypM05JmlSvtqRbeq6jqA94oHbxAr2vYsJ8vDA==} engines: {node: '>=16.0.0'} @@ -5177,6 +5264,11 @@ packages: peerDependencies: vite: '*' + vite-plugin-svgr@4.5.0: + resolution: {integrity: sha512-W+uoSpmVkSmNOGPSsDCWVW/DDAyv+9fap9AZXBvWiQqrboJ08j2vh0tFxTD/LjwqwAd3yYSVJgm54S/1GhbdnA==} + peerDependencies: + vite: '>=2.6.0' + vite@7.1.7: resolution: {integrity: sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -6652,6 +6744,76 @@ snapshots: domhandler: 5.0.3 selderee: 0.11.0 + '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-remove-jsx-attribute@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-svg-dynamic-title@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-svg-em-dimensions@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-transform-react-native-svg@8.1.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-plugin-transform-svg-component@8.0.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + + '@svgr/babel-preset@8.1.0(@babel/core@7.28.4)': + dependencies: + '@babel/core': 7.28.4 + '@svgr/babel-plugin-add-jsx-attribute': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-remove-jsx-attribute': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-remove-jsx-empty-expression': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-replace-jsx-attribute-value': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-svg-dynamic-title': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-svg-em-dimensions': 8.0.0(@babel/core@7.28.4) + '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.28.4) + '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.28.4) + + '@svgr/core@8.1.0(typescript@5.8.3)': + dependencies: + '@babel/core': 7.28.4 + '@svgr/babel-preset': 8.1.0(@babel/core@7.28.4) + camelcase: 6.3.0 + cosmiconfig: 8.3.6(typescript@5.8.3) + snake-case: 3.0.4 + transitivePeerDependencies: + - supports-color + - typescript + + '@svgr/hast-util-to-babel-ast@8.0.0': + dependencies: + '@babel/types': 7.28.4 + entities: 4.5.0 + + '@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.8.3))': + dependencies: + '@babel/core': 7.28.4 + '@svgr/babel-preset': 8.1.0(@babel/core@7.28.4) + '@svgr/core': 8.1.0(typescript@5.8.3) + '@svgr/hast-util-to-babel-ast': 8.0.0 + svg-parser: 2.0.4 + transitivePeerDependencies: + - supports-color + '@swc/core-darwin-arm64@1.13.5': optional: true @@ -6981,10 +7143,6 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/node@18.19.129': - dependencies: - undici-types: 5.26.5 - '@types/node@20.19.19': dependencies: undici-types: 6.21.0 @@ -7501,6 +7659,8 @@ snapshots: callsites@3.1.0: {} + camelcase@6.3.0: {} + caniuse-lite@1.0.30001726: {} caniuse-lite@1.0.30001746: {} @@ -7629,6 +7789,15 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 + cosmiconfig@8.3.6(typescript@5.8.3): + dependencies: + import-fresh: 3.3.1 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + optionalDependencies: + typescript: 5.8.3 + cosmiconfig@8.3.6(typescript@5.9.3): dependencies: import-fresh: 3.3.1 @@ -7773,6 +7942,11 @@ snapshots: domelementtype: 2.3.0 domhandler: 5.0.3 + dot-case@3.0.4: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + dts-resolver@2.1.2: {} dunder-proto@1.0.1: @@ -8534,7 +8708,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 18.19.129 + '@types/node': 24.6.1 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -8731,6 +8905,10 @@ snapshots: loupe@3.2.1: {} + lower-case@2.0.2: + dependencies: + tslib: 2.8.1 + lowlight@1.20.0: dependencies: fault: 1.0.4 @@ -9683,6 +9861,11 @@ snapshots: neo-async@2.6.2: {} + no-case@3.0.4: + dependencies: + lower-case: 2.0.2 + tslib: 2.8.1 + node-domexception@1.0.0: {} node-fetch@3.3.2: @@ -10611,6 +10794,11 @@ snapshots: sisteransi@1.0.5: {} + snake-case@3.0.4: + dependencies: + dot-case: 3.0.4 + tslib: 2.8.1 + solid-js@1.9.7: dependencies: csstype: 3.1.3 @@ -10754,6 +10942,8 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + svg-parser@2.0.4: {} + sync-child-process@1.0.2: dependencies: sync-message-port: 1.1.3 @@ -11166,6 +11356,17 @@ snapshots: picocolors: 1.1.1 vite: rolldown-vite@7.1.14(@types/node@24.6.1)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0) + vite-plugin-svgr@4.5.0(rolldown-vite@7.1.14(@types/node@24.6.1)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0))(rollup@4.52.3)(typescript@5.8.3): + dependencies: + '@rollup/pluginutils': 5.3.0(rollup@4.52.3) + '@svgr/core': 8.1.0(typescript@5.8.3) + '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.8.3)) + vite: rolldown-vite@7.1.14(@types/node@24.6.1)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0) + transitivePeerDependencies: + - rollup + - supports-color + - typescript + vite@7.1.7(@types/node@24.6.1)(jiti@2.6.1)(lightningcss@1.30.2)(sass-embedded@1.89.0)(terser@5.44.0)(tsx@4.20.6)(yaml@2.8.0): dependencies: esbuild: 0.25.10 From 2d689172d3941c03480e15933a9623dd06908a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=BC=A6=E8=AF=AD?= Date: Sat, 4 Oct 2025 21:30:55 +0800 Subject: [PATCH 2/2] fix: lint --- playground/src/App.tsx | 6 ++++-- playground/src/communicate.tsx | 12 ++++++++---- playground/src/history.tsx | 6 ++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/playground/src/App.tsx b/playground/src/App.tsx index b0bca25..15cb768 100644 --- a/playground/src/App.tsx +++ b/playground/src/App.tsx @@ -38,7 +38,9 @@ function App() {
MateChat logo - MateChat + + MateChat +

@@ -81,4 +83,4 @@ function App() { ); } -export default App; \ No newline at end of file +export default App; diff --git a/playground/src/communicate.tsx b/playground/src/communicate.tsx index c104b20..63e4da7 100644 --- a/playground/src/communicate.tsx +++ b/playground/src/communicate.tsx @@ -1,10 +1,10 @@ import { BubbleList, FileUpload } from "@matechat/react"; import { InputCount, Sender } from "@matechat/react/sender"; import { useChat, useMateChat } from "@matechat/react/utils/index"; +import clsx from "clsx"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import mcLogo from "./assets/logo.svg"; -import clsx from "clsx"; function Communicate() { const { t } = useTranslation(); @@ -32,9 +32,13 @@ function Communicate() {
MateChat logo - MateChat + + MateChat +
- {t("tip")} + + {t("tip")} +
)}
@@ -42,7 +46,7 @@ function Communicate() { className={clsx( "w-full", "focus-within:border-[#a18dc2] focus-within:ring-2 focus-within:ring-[#a694c2]", - "dark:focus-within:border-[#7a6994] dark:focus-within:ring-2 dark:focus-within:ring-[#706385]" + "dark:focus-within:border-[#7a6994] dark:focus-within:ring-2 dark:focus-within:ring-[#706385]", )} placeholder={t("placeholder")} input={input} diff --git a/playground/src/history.tsx b/playground/src/history.tsx index 3dbdf48..f0573e2 100644 --- a/playground/src/history.tsx +++ b/playground/src/history.tsx @@ -7,13 +7,15 @@ function History() { return (
- {t("history")} + + {t("history")} +
+ />
history