From 27743986cc6f93648b15a95dbe0afb0990c100f7 Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Thu, 14 May 2026 10:27:04 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20UI/UX=20polish=20=E2=80=94=20Multi-targ?= =?UTF-8?q?et=20slogan,=20dynamic=20placeholders,=20social,=20reverse=20hi?= =?UTF-8?q?ghlight,=20mobile=20(#35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(i18n): dynamic placeholders + Multi-target slogan - Replace "Eight target formats" with "Multi-target formats" in app.description across en/vi/ja/zh-CN - Add input_placeholder_format and output_empty_format keys with {{ext}} interpolation - InputPanel and OutputPanel render extension-aware placeholders in reverse mode (e.g. "Paste your CSV here...", "Output will appear here once you provide valid YAML.") - Forward mode keeps the original JSON-specific copy Co-Authored-By: Claude Opus 4.7 (1M context) * feat(ui): social links in Footer + About Community section - Add SocialIcons component with 6 inline-SVG brand icons (Discord, X, Bluesky, Mastodon, Telegram, YouTube), since lucide-react has no brand icons - Footer now exposes Discord (dev community) / X / Bluesky as a centered icon row, sandwiched between app meta and the maintainer credit - About page gains a "Community" section between Donate and Third-party, listing all six platforms with icon + label - Add i18n keys: about.community.* (titled section) and social.* (aria-labels) across en/vi/ja/zh-CN - Curated based on username.txt: includes dev-relevant + maintainer's public socials; excludes Steam, Discord game server, email, and the Telegram bot (off-topic for the project) Co-Authored-By: Claude Opus 4.7 (1M context) * feat(editor): scroll polish + reverse highlight for md/sql/toml/jsonl Scroll fix - .cm-scroller switched from scrollbarWidth: 'none' to 'thin' and explicit overflow: 'auto'. Hiding the native scrollbar was making wheel scroll require a click-to-focus before it engaged on some Chromium builds. Thin themed scrollbar reads fine on both light and dark theme. Reverse-mode highlight - Add @codemirror/lang-markdown, @codemirror/lang-sql, @codemirror/legacy-modes - CodeEditor's EditorLanguage union now covers markdown, sql, and toml - InputPanel maps jsonl -> json, markdown -> markdown, sql -> sql, toml -> toml; csv/tsv stay plain (no good CodeMirror grammar) - All extensions go through the existing prismHighlightStyle, so colors stay consistent with forward JSON highlighting Bundle impact: the three new packs are routed into the existing 'codemirror' manualChunk; no initial-bundle regression. Co-Authored-By: Claude Opus 4.7 (1M context) * feat(ui): mobile responsiveness polish - Header: nav links Convert/About now always visible (previously hidden md:flex), brand mark + wordmark scale down on small screens, padding tightened to 12px so the 360px viewport fits brand + nav + lang + theme + GitHub icon - InputPanel/OutputPanel toolbar buttons: icon-only on mobile (label hidden below sm); aria-label and title now carry the text for a11y/tooltips - ConverterWorkspace panels: min-h-[40vh] on mobile so the stacked Input/Output each keep a usable height instead of collapsing - Home hero: stack the title and the drop-zone hint on mobile (flex-col), reduce outer padding - About page: reduce outer padding on mobile (px-4 py-10) to claw back horizontal space - FormatPicker chips: smaller padding + 11px font on mobile so the 12-format wrap stays compact Skipped hamburger menu by design — Header only has 2 nav links, the drawer pattern adds bundle and complexity without payoff. Co-Authored-By: Claude Opus 4.7 (1M context) * docs: refresh README EN + VI for Multi-target slogan, full format table, Community section - Replace "Eight target formats" tagline with "Multi-target formats" (EN) / "Đa định dạng đích" (VI), matching the in-app app.description copy - VI README format table now mirrors EN: includes BSON / CBOR / MessagePack (Phase 4) and the "Reverse (→ JSON)" column that the VI side was missing - Bump tech-stack line from Vite 6 to Vite 8 in both files (package.json has been on ^8.0.0 for a while; the About page already reflected this) - Add a Community section listing Discord (dev community), X, Bluesky, Mastodon, Telegram, and YouTube — same set as the in-app Community section, sourced from the maintainer's public socials Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Claude Opus 4.7 (1M context) --- README.md | 15 +- README.vi.md | 40 ++++-- package-lock.json | 129 ++++++++++++++++++ package.json | 3 + src/components/common/SocialIcons.tsx | 51 +++++++ src/components/converter/CodeEditor.tsx | 26 +++- .../converter/ConverterWorkspace.tsx | 4 +- src/components/converter/FormatPicker.tsx | 2 +- src/components/converter/InputPanel.tsx | 16 ++- src/components/converter/OutputPanel.tsx | 10 +- src/components/layout/Footer.tsx | 45 +++++- src/components/layout/Header.tsx | 12 +- src/i18n/locales/en.json | 22 ++- src/i18n/locales/ja.json | 22 ++- src/i18n/locales/vi.json | 22 ++- src/i18n/locales/zh-CN.json | 22 ++- src/pages/About.tsx | 82 ++++++++++- src/pages/Home.tsx | 4 +- 18 files changed, 485 insertions(+), 42 deletions(-) create mode 100644 src/components/common/SocialIcons.tsx diff --git a/README.md b/README.md index 4775313..ed5a9c6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Disperse JSON into many formats.** -One JSON input. Eight target formats. Fully in your browser. +One JSON input. Multi-target formats. Fully in your browser. [![CI](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml/badge.svg)](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml) [![Deploy](https://github.com/poli0981/jsonPrism/actions/workflows/deploy.yml/badge.svg)](https://github.com/poli0981/jsonPrism/actions/workflows/deploy.yml) @@ -47,7 +47,7 @@ JSONPrism is a refracting tool for developers. It takes a single JSON input and ## Tech stack -- **Vite 6** + **React 19** + **TypeScript 5.7** +- **Vite 8** + **React 19** + **TypeScript 5.7** - **Tailwind CSS v4** + **shadcn/ui** (New York style, neutral base) - **CodeMirror 6** for the input editor (Phase 1 polish) - **PapaParse**, **js-yaml**, **smol-toml**, **fast-xml-parser** for parsing/serialization @@ -205,6 +205,17 @@ For bug reports and feature requests, use [GitHub Issues](https://github.com/pol | [`docs/TAURI-NOTES.md`](docs/TAURI-NOTES.md) | Tauri build / process notes. | | [`docs/RESX-MIGRATION.md`](docs/RESX-MIGRATION.md) | i18next JSON → .NET RESX tutorial. | +## Community + +Hang out, ask questions, or follow updates: + +- [Discord — dev community](https://discord.gg/2aNR3aVt) +- [X (Twitter) — @SkullMute0011](https://twitter.com/SkullMute0011) +- [Bluesky — @skullmute0011.bsky.social](https://bsky.app/profile/skullmute0011.bsky.social) +- [Mastodon — @skullmute1122@mastodon.social](https://mastodon.social/@skullmute1122) +- [Telegram — @SkullMute0011](https://t.me/SkullMute0011) +- [YouTube — @SkullMute](https://youtube.com/@SkullMute) + ## Acknowledgements Substantial parts of JSONPrism's code, tests, translations, and docs diff --git a/README.vi.md b/README.vi.md index d9d679e..862d76f 100644 --- a/README.vi.md +++ b/README.vi.md @@ -4,7 +4,7 @@ **Tán sắc JSON ra nhiều định dạng.** -Một JSON đầu vào. Tám định dạng đích. Chạy hoàn toàn trong trình duyệt. +Một JSON đầu vào. Đa định dạng đích. Chạy hoàn toàn trong trình duyệt. [![CI](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml/badge.svg)](https://github.com/poli0981/jsonPrism/actions/workflows/ci.yml) [![Deploy](https://github.com/poli0981/jsonPrism/actions/workflows/deploy.yml/badge.svg)](https://github.com/poli0981/jsonPrism/actions/workflows/deploy.yml) @@ -20,17 +20,20 @@ JSONPrism là công cụ "tán sắc" cho developer. Nhận một JSON đầu v ## Định dạng hỗ trợ -| Định dạng | Phần mở rộng | Trạng thái | -| ----------------- | ------------ | -------------- | -| JSONL | `.jsonl` | ✅ Phase 1 | -| CSV | `.csv` | ✅ Phase 1 | -| TSV | `.tsv` | ✅ Phase 1 | -| YAML | `.yaml` | ✅ Phase 1 | -| XML | `.xml` | ✅ Phase 2 | -| TOML | `.toml` | ✅ Phase 2 | -| Bảng Markdown | `.md` | ✅ Phase 2 | -| SQL `INSERT` | `.sql` | ✅ Phase 2 | -| RESX (.NET) | `.resx` | ✅ Phase 3 | +| Định dạng | Phần mở rộng | Trạng thái | Đảo (→ JSON) | +| ----------------- | ------------ | -------------- | ------------ | +| JSONL | `.jsonl` | ✅ Phase 1 | ✅ | +| CSV | `.csv` | ✅ Phase 1 | ✅ | +| TSV | `.tsv` | ✅ Phase 1 | ✅ | +| YAML | `.yaml` | ✅ Phase 1 | ✅ | +| XML | `.xml` | ✅ Phase 2 | — | +| TOML | `.toml` | ✅ Phase 2 | ✅ | +| Bảng Markdown | `.md` | ✅ Phase 2 | — | +| SQL `INSERT` | `.sql` | ✅ Phase 2 | — | +| RESX (.NET) | `.resx` | ✅ Phase 3 | ✅ | +| BSON | `.bson` | ✅ Phase 4 | — | +| CBOR | `.cbor` | ✅ Phase 4 | — | +| MessagePack | `.msgpack` | ✅ Phase 4 | — | ## Tính năng @@ -44,7 +47,7 @@ JSONPrism là công cụ "tán sắc" cho developer. Nhận một JSON đầu v ## Tech stack -- **Vite 6** + **React 19** + **TypeScript 5.7** +- **Vite 8** + **React 19** + **TypeScript 5.7** - **Tailwind CSS v4** + **shadcn/ui** (style New York, base neutral) - **CodeMirror 6** cho editor đầu vào (Phase 1 polish) - **PapaParse**, **js-yaml**, **smol-toml**, **fast-xml-parser** để parse/serialize @@ -202,6 +205,17 @@ Báo bug hoặc đề xuất tính năng tại [GitHub Issues](https://github.co | [`docs/TAURI-NOTES.md`](docs/TAURI-NOTES.md) | Ghi chú Tauri build / process. | | [`docs/RESX-MIGRATION.md`](docs/RESX-MIGRATION.md) | Hướng dẫn i18next JSON → .NET RESX. | +## Cộng đồng + +Trò chuyện, hỏi đáp, hoặc theo dõi cập nhật: + +- [Discord — cộng đồng dev](https://discord.gg/2aNR3aVt) +- [X (Twitter) — @SkullMute0011](https://twitter.com/SkullMute0011) +- [Bluesky — @skullmute0011.bsky.social](https://bsky.app/profile/skullmute0011.bsky.social) +- [Mastodon — @skullmute1122@mastodon.social](https://mastodon.social/@skullmute1122) +- [Telegram — @SkullMute0011](https://t.me/SkullMute0011) +- [YouTube — @SkullMute](https://youtube.com/@SkullMute) + ## Ghi nhận Phần lớn code, test, bản dịch và tài liệu của JSONPrism được draft với diff --git a/package-lock.json b/package-lock.json index 8ac80a7..5dc9aa1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,12 @@ "license": "Apache-2.0", "dependencies": { "@codemirror/lang-json": "^6.0.0", + "@codemirror/lang-markdown": "^6.5.0", + "@codemirror/lang-sql": "^6.10.0", "@codemirror/lang-xml": "^6.1.0", "@codemirror/lang-yaml": "^6.1.3", "@codemirror/language": "^6.10.0", + "@codemirror/legacy-modes": "^6.5.2", "@codemirror/lint": "^6.8.0", "@codemirror/state": "^6.4.0", "@codemirror/view": "^6.34.0", @@ -337,6 +340,51 @@ "@lezer/common": "^1.1.0" } }, + "node_modules/@codemirror/lang-css": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz", + "integrity": "sha512-kr5fwBGiGtmz6l0LSJIbno9QrifNMUusivHbnA1H6Dmqy4HZFte3UAICix1VuKo0lMPKQr2rqB+0BkKi/S3Ejg==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@lezer/common": "^1.0.2", + "@lezer/css": "^1.1.7" + } + }, + "node_modules/@codemirror/lang-html": { + "version": "6.4.11", + "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.11.tgz", + "integrity": "sha512-9NsXp7Nwp891pQchI7gPdTwBuSuT3K65NGTHWHNJ55HjYcHLllr0rbIZNdOzas9ztc1EUVBlHou85FFZS4BNnw==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/lang-css": "^6.0.0", + "@codemirror/lang-javascript": "^6.0.0", + "@codemirror/language": "^6.4.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/css": "^1.1.0", + "@lezer/html": "^1.3.12" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.5.tgz", + "integrity": "sha512-zD4e5mS+50htS7F+TYjBPsiIFGanfVqg4HyUz6WNFikgOPf2BgKlx+TQedI1w6n/IqRBVBbBWmGFdLB/7uxO4A==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, "node_modules/@codemirror/lang-json": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.2.tgz", @@ -347,6 +395,35 @@ "@lezer/json": "^1.0.0" } }, + "node_modules/@codemirror/lang-markdown": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/lang-markdown/-/lang-markdown-6.5.0.tgz", + "integrity": "sha512-0K40bZ35jpHya6FriukbgaleaqzBLZfOh7HuzqbMxBXkbYMJDxfF39c23xOgxFezR+3G+tR2/Mup+Xk865OMvw==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.7.1", + "@codemirror/lang-html": "^6.0.0", + "@codemirror/language": "^6.3.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.2.1", + "@lezer/markdown": "^1.0.0" + } + }, + "node_modules/@codemirror/lang-sql": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.10.0.tgz", + "integrity": "sha512-6ayPkEd/yRw0XKBx5uAiToSgGECo/GY2NoJIHXIIQh1EVwLuKoU8BP/qK0qH5NLXAbtJRLuT73hx7P9X34iO4w==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0" + } + }, "node_modules/@codemirror/lang-xml": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@codemirror/lang-xml/-/lang-xml-6.1.0.tgz", @@ -390,6 +467,15 @@ "style-mod": "^4.0.0" } }, + "node_modules/@codemirror/legacy-modes": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.5.2.tgz", + "integrity": "sha512-/jJbwSTazlQEDOQw2FJ8LEEKVS72pU0lx6oM54kGpL8t/NJ2Jda3CZ4pcltiKTdqYSRk3ug1B3pil1gsjA6+8Q==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0" + } + }, "node_modules/@codemirror/lint": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.6.tgz", @@ -903,6 +989,17 @@ "integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==", "license": "MIT" }, + "node_modules/@lezer/css": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.3.3.tgz", + "integrity": "sha512-RzBo8r+/6QJeow7aPHIpGVIH59xTcJXp399820gZoMo9noQDRVpJLheIBUicYwKcsbOYoBRoLZlf2720dG/4Tg==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.3.0" + } + }, "node_modules/@lezer/highlight": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz", @@ -912,6 +1009,28 @@ "@lezer/common": "^1.3.0" } }, + "node_modules/@lezer/html": { + "version": "1.3.13", + "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.13.tgz", + "integrity": "sha512-oI7n6NJml729m7pjm9lvLvmXbdoMoi2f+1pwSDJkl9d68zGr7a9Btz8NdHTGQZtW2DA25ybeuv/SyDb9D5tseg==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.5.4.tgz", + "integrity": "sha512-vvYx3MhWqeZtGPwDStM2dwgljd5smolYD2lR2UyFcHfxbBQebqx8yjmFmxtJ/E6nN6u1D9srOiVWm3Rb4tmcUA==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, "node_modules/@lezer/json": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.3.tgz", @@ -932,6 +1051,16 @@ "@lezer/common": "^1.0.0" } }, + "node_modules/@lezer/markdown": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@lezer/markdown/-/markdown-1.6.3.tgz", + "integrity": "sha512-jpGm5Ps+XErS+xA4urw7ogEGkeZOahVQF21Z6oECF0sj+2liwZopd2+I8uH5I/vZsRuuze3OxBREIANLf6KKUw==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.5.0", + "@lezer/highlight": "^1.0.0" + } + }, "node_modules/@lezer/xml": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.6.tgz", diff --git a/package.json b/package.json index c0ccfc2..71e3180 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,12 @@ }, "dependencies": { "@codemirror/lang-json": "^6.0.0", + "@codemirror/lang-markdown": "^6.5.0", + "@codemirror/lang-sql": "^6.10.0", "@codemirror/lang-xml": "^6.1.0", "@codemirror/lang-yaml": "^6.1.3", "@codemirror/language": "^6.10.0", + "@codemirror/legacy-modes": "^6.5.2", "@codemirror/lint": "^6.8.0", "@codemirror/state": "^6.4.0", "@codemirror/view": "^6.34.0", diff --git a/src/components/common/SocialIcons.tsx b/src/components/common/SocialIcons.tsx new file mode 100644 index 0000000..0a8ec31 --- /dev/null +++ b/src/components/common/SocialIcons.tsx @@ -0,0 +1,51 @@ +interface IconProps { + className?: string; +} + +export function DiscordIcon({ className }: IconProps) { + return ( + + + + ); +} + +export function XIcon({ className }: IconProps) { + return ( + + + + ); +} + +export function BlueskyIcon({ className }: IconProps) { + return ( + + + + ); +} + +export function MastodonIcon({ className }: IconProps) { + return ( + + + + ); +} + +export function TelegramIcon({ className }: IconProps) { + return ( + + + + ); +} + +export function YoutubeIcon({ className }: IconProps) { + return ( + + + + ); +} diff --git a/src/components/converter/CodeEditor.tsx b/src/components/converter/CodeEditor.tsx index 8aba794..be7bb30 100644 --- a/src/components/converter/CodeEditor.tsx +++ b/src/components/converter/CodeEditor.tsx @@ -3,13 +3,16 @@ import CodeMirror, { type ReactCodeMirrorRef, EditorView } from '@uiw/react-code import { json, jsonParseLinter } from '@codemirror/lang-json'; import { yaml } from '@codemirror/lang-yaml'; import { xml } from '@codemirror/lang-xml'; -import { HighlightStyle, syntaxHighlighting } from '@codemirror/language'; +import { markdown } from '@codemirror/lang-markdown'; +import { sql } from '@codemirror/lang-sql'; +import { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language'; +import { toml } from '@codemirror/legacy-modes/mode/toml'; import { lintGutter, linter } from '@codemirror/lint'; import { tags as t } from '@lezer/highlight'; import { useTheme } from '@/lib/theme'; import { cn } from '@/lib/utils'; -export type EditorLanguage = 'json' | 'plain' | 'yaml' | 'xml'; +export type EditorLanguage = 'json' | 'plain' | 'yaml' | 'xml' | 'markdown' | 'sql' | 'toml'; interface CodeEditorProps { value: string; @@ -57,6 +60,12 @@ export function CodeEditor({ exts.push(yaml()); } else if (language === 'xml') { exts.push(xml()); + } else if (language === 'markdown') { + exts.push(markdown()); + } else if (language === 'sql') { + exts.push(sql()); + } else if (language === 'toml') { + exts.push(StreamLanguage.define(toml)); } exts.push(syntaxHighlighting(prismHighlightStyle)); exts.push(EditorView.lineWrapping); @@ -76,11 +85,18 @@ export function CodeEditor({ '.cm-scroller': { fontFamily: 'var(--font-mono)', lineHeight: '1.6', - // Hide native scrollbar while keeping wheel/keyboard scroll. - scrollbarWidth: 'none', + overflow: 'auto', + // Show a thin native scrollbar — `scrollbarWidth: 'none'` made wheel + // scroll require a click-to-focus first on some browsers. + scrollbarWidth: 'thin', }, '.cm-scroller::-webkit-scrollbar': { - display: 'none', + width: '8px', + height: '8px', + }, + '.cm-scroller::-webkit-scrollbar-thumb': { + backgroundColor: 'color-mix(in oklch, var(--muted-foreground) 30%, transparent)', + borderRadius: '4px', }, '.cm-content': { padding: '16px 0', diff --git a/src/components/converter/ConverterWorkspace.tsx b/src/components/converter/ConverterWorkspace.tsx index 71705b9..ed3589f 100644 --- a/src/components/converter/ConverterWorkspace.tsx +++ b/src/components/converter/ConverterWorkspace.tsx @@ -216,7 +216,7 @@ export function ConverterWorkspace() {
-
+
-
+
onChange(id)} disabled={!enabled} className={cn( - 'group relative inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium transition', + 'group relative inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-[11px] font-medium transition sm:px-2.5 sm:py-1 sm:text-xs', active ? 'border-primary/60 bg-primary/10 text-foreground' : 'border-border bg-card/40 text-muted-foreground hover:text-foreground hover:border-border', diff --git a/src/components/converter/InputPanel.tsx b/src/components/converter/InputPanel.tsx index 7ca0aee..f28a02f 100644 --- a/src/components/converter/InputPanel.tsx +++ b/src/components/converter/InputPanel.tsx @@ -65,6 +65,10 @@ export function InputPanel({ if (!isReverse) return 'json'; if (format === 'yaml') return 'yaml'; if (format === 'xml' || format === 'resx') return 'xml'; + if (format === 'jsonl') return 'json'; + if (format === 'markdown') return 'markdown'; + if (format === 'sql') return 'sql'; + if (format === 'toml') return 'toml'; return 'plain'; }, [isReverse, format]); @@ -218,7 +222,13 @@ export function InputPanel({ value={value} onChange={onChange} language={editorLanguage} - placeholder={t('home.input_placeholder')} + placeholder={ + isReverse + ? t('home.input_placeholder_format', { + ext: converter.meta.extension.toUpperCase(), + }) + : t('home.input_placeholder') + } /> {showOverlay && (
@@ -257,10 +267,12 @@ function ToolbarButton({ onClick, label, icon, disabled }: ToolbarButtonProps) { type="button" onClick={onClick} disabled={disabled} + aria-label={label} + title={label} className="text-muted-foreground hover:bg-muted hover:text-foreground inline-flex items-center gap-1.5 rounded px-2 py-1 text-xs transition disabled:cursor-not-allowed disabled:opacity-40" > {icon} - {label} + {label} ); } diff --git a/src/components/converter/OutputPanel.tsx b/src/components/converter/OutputPanel.tsx index d9d1fd3..6ea3d96 100644 --- a/src/components/converter/OutputPanel.tsx +++ b/src/components/converter/OutputPanel.tsx @@ -109,7 +109,11 @@ export function OutputPanel({ ) : (
- {t('home.output_empty')} + {isReverse + ? t('home.output_empty_format', { + ext: converter.meta.extension.toUpperCase(), + }) + : t('home.output_empty')}
)}
@@ -130,10 +134,12 @@ function ToolbarButton({ onClick, label, icon, disabled }: ToolbarButtonProps) { type="button" onClick={onClick} disabled={disabled} + aria-label={label} + title={label} className="text-muted-foreground hover:bg-muted hover:text-foreground inline-flex items-center gap-1.5 rounded px-2 py-1 text-xs transition disabled:cursor-not-allowed disabled:opacity-40" > {icon} - {label} + {label} ); } diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 8941745..712bcd6 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -1,10 +1,32 @@ +import { useTranslation } from 'react-i18next'; +import { BlueskyIcon, DiscordIcon, XIcon } from '@/components/common/SocialIcons'; + export function Footer() { + const { t } = useTranslation(); + return (