13 Commits
Author SHA1 Message Date
poli0981andClaude Opus 4.7 5659c67f4b chore(release): v1.4.0 (#39)
Bumps package.json, src-tauri/Cargo.toml, and src-tauri/tauri.conf.json to 1.4.0 and adds the CHANGELOG entry for the UI/UX polish round (#35, #37):
- Dynamic input/output placeholders in reverse mode
- "Multi-target formats" slogan
- Reverse-mode highlight expanded to Markdown / SQL / TOML / JSONL
- Social links UI: Footer icons + About Community section
- Mobile responsiveness polish
- Mousewheel scroll on input editor no longer requires click-to-focus
- README EN + VI refreshed

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:37:47 +07:00
poli0981andClaude Opus 4.7 8cecb8019a style: prettier-format SocialIcons.tsx (#37)
The BlueskyIcon's `<path>` was a single long line exceeding the print
width, which slipped through local lint/build but failed CI's
`format:check`. Wraps the d/transform attributes across lines —
identical output, no SVG change.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:29:56 +07:00
poli0981andClaude Opus 4.7 27743986cc feat: UI/UX polish — Multi-target slogan, dynamic placeholders, social, reverse highlight, mobile (#35)
* 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) <noreply@anthropic.com>

* 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) <noreply@anthropic.com>

* 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) <noreply@anthropic.com>

* 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) <noreply@anthropic.com>

* 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) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 10:27:04 +07:00
poli0981andClaude Opus 4.7 2d8c416975 docs(changelog): clarify v1.3.2 misdiagnosis, translate v1.3.3 to English, add verified env (#33)
- Translate the v1.3.3 entry to English to match the rest of CHANGELOG.
- Annotate v1.3.2 as a misdiagnosis: the fix is correct on its own
  (the Tauri callback really did miss the extension filter) but it is
  not the bug the user reported. The actual user-visible bug was
  batch dedup, which v1.3.3 addresses.
- Add a "Verified" section under v1.3.3 listing the manual smoke
  environments: Windows Sandbox and Ubuntu 22.04 (Hyper-V VM).

No code changes. Tests / lint / typecheck unaffected.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 21:50:13 +07:00
dependabot[bot] 194050eb7b build(deps): Bump actions/upload-artifact from 4 to 7 (#6)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-13 21:05:40 +07:00
dependabot[bot] 018151711c build(deps): Bump actions/deploy-pages from 4 to 5 (#5)
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-13 21:05:23 +07:00
dependabot[bot] 2fbf4cb463 build(deps): Bump actions/configure-pages from 5 to 6 (#4)
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 5 to 6.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/configure-pages
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-13 21:05:00 +07:00
dependabot[bot] 5fae62e122 build(deps): Bump actions/upload-pages-artifact from 3 to 5 (#3)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-13 21:03:10 +07:00
poli0981andClaude Opus 4.7 8a27c5c969 fix(tauri): set File.lastModified from stat() so batch dedup works (v1.3.3) (#27)
`fileFromNativePath` was calling `new File([text], name, { type })`
without `lastModified`. The File API defaults `lastModified` to
`Date.now()` at construction time, so reading the same path twice
produced two File objects with different timestamps — and `batchStore`
dedups on `(name, size, lastModified)`, so dropping the same file
twice through Tauri native drag-drop / native picker added both
copies to the queue with no `duplicate` toast. Web wasn't affected
because `<input type="file">` and `react-dropzone` build File objects
from the OS mtime.

Fix: call `stat()` from `@tauri-apps/plugin-fs` and pass
`mtime.getTime()` into the File constructor. Fall back to an FNV-1a
hash of the path if stat throws (capability missing, file vanished
between read and stat) so repeat drops still dedup.

Also infer `type` from the extension instead of hard-coding
`application/json`. Add `fs:allow-stat` to the default capability.

3 new unit tests for `pathHashAsMillis`. Total: 193.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 20:33:12 +07:00
poli0981andClaude Opus 4.7 58ef7e739a fix(tauri): port batch extension filter to native drag-drop (v1.3.2) (#24)
The v1.3.0/v1.3.1 desktop bundles accepted any file dropped from File
Explorer / Finder / Nautilus into the workspace, because
`ConverterWorkspace.handleMultiFileDrop` (called by `useTauriDragDrop`
on `tauri://drag-drop` events) ran `batchStore.addFiles` directly and
skipped the `direction × format` extension whitelist that the
`react-dropzone` path in `BatchPanel` / `InputPanel` enforced. Files
like `.cs` / `.py` leaked into the queue with no `wrong_format` toast.

Extract `src/lib/file-filter.ts` exposing `getAllowedExtensions`,
`extOf`, and `filterByExtension` so all three drop entry points share
one implementation. The web `react-dropzone` paths keep their previous
behavior; the Tauri callback now filters + toasts before calling
`addFiles`.

Bump package / Cargo / Tauri version to 1.3.2.

7 new unit tests cover the helper. Total: 190.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 20:05:44 +07:00
poli0981andClaude Opus 4.7 4bf239e089 fix(workflow): announce-discussion unbound var + literal $VAR text (#21)
Two bugs in `.github/workflows/announce-discussion.yml` surfaced when
v1.3.1 published:

1. `DEPLOY_URL: unbound variable` when triggered by `release` event.
   `${{ github.event.workflow_run.* }}` evaluates to null on a release
   event, and the resulting env-var assignment leaves the variable
   unset (not empty), which `set -u` then trips on. Guard every
   dynamic value with `|| ''` so each env var is always at least an
   empty string.

2. Body strings used `$'...'` ANSI-C quoting (which expands backslash
   escapes but NOT variables), so the discussion body would have
   contained literal `$RELEASE_TAG` text. Rewrite to plain double-quoted
   strings, using `$'\n'` only for embedded newlines.

Also pass dynamic values (REPO_ID / CAT_ID / TITLE / BODY) into the
Create Discussion step through env vars instead of literal `${{ ... }}`
substitution — protects against titles/bodies containing quotes or
other shell-special characters that would otherwise break the command
line.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 18:32:59 +07:00
poli0981andClaude Opus 4.7 6b9cc64331 chore(release): v1.3.1 (#19)
Same feature set as v1.3.0 (Đợt 2 + 3 + 4) plus two fixes:

- GitHub Pages 404 — Vite base / React Router basename / all repo URLs
  rebased from `/jsonprism/` to `/jsonPrism/` to match the existing
  repo name case.
- Release workflow — macOS Intel runner replaced with a universal2
  build on macos-14, since macos-13 runners no longer pick up jobs.

v1.3.0 was drafted but never published.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 17:38:24 +07:00
poli0981andClaude Opus 4.7 50521881f0 fix(release): GH Pages 404 + macOS Intel runner unavailable (#18)
GitHub Pages serves at /jsonPrism/ (case-sensitive, mirrors the repo
name `poli0981/jsonPrism`). Our Vite `base` was set to `/jsonprism/`
(lowercase), so index.html referenced `/jsonprism/assets/*.js` and
every asset 404'd — the deployed page rendered blank. Rebase all
GitHub URLs / Vite base / React Router basename to match the existing
repo case `jsonPrism`. Renaming the repo to all-lowercase is the
cleaner long-term fix, but that's a user-side action.

GitHub Actions `macos-13` runners no longer pick up jobs (the macOS
Intel build sat queued for >18 min, then was cancelled). Replace the
two-entry matrix (macos-14 ARM + macos-13 Intel) with a single
universal2 build on `macos-14` using `--target universal-apple-darwin`.
The resulting `.app` / `.dmg` runs on both Apple Silicon and Intel.

Storage keys, package name, Tauri identifier remain lowercase
(`jsonprism`) — unaffected.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 17:26:20 +07:00
44 changed files with 833 additions and 136 deletions

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ What actually happened. Include the error message and target format.
- Browser: [e.g. Chrome 130, Firefox 132, Safari 18]
- OS: [e.g. Windows 11, macOS 15, Ubuntu 24.04]
- JSONPrism version: [e.g. 0.1.0 — check the footer]
- Is this on the hosted version (poli0981.github.io/jsonprism/) or local dev?
- Is this on the hosted version (poli0981.github.io/jsonPrism/) or local dev?
## Screenshots
+3 -3
View File
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Questions & general discussion
url: https://github.com/poli0981/jsonprism/discussions
url: https://github.com/poli0981/jsonPrism/discussions
about: Ask about usage, share workflows, or propose ideas before opening an issue.
- name: Security vulnerability
url: https://github.com/poli0981/jsonprism/security/advisories/new
url: https://github.com/poli0981/jsonPrism/security/advisories/new
about: Report security issues privately via GitHub Security Advisory (not in public issues).
- name: Live demo
url: https://poli0981.github.io/jsonprism/
url: https://poli0981.github.io/jsonPrism/
about: Try the latest deployed build in your browser before filing a bug.
+31 -16
View File
@@ -76,30 +76,38 @@ jobs:
id: msg
env:
EVENT: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_URL: ${{ github.event.release.html_url }}
RELEASE_BODY: ${{ github.event.release.body }}
DEPLOY_SHA: ${{ github.event.workflow_run.head_sha }}
DEPLOY_URL: ${{ github.event.workflow_run.html_url }}
DISPATCH_MSG: ${{ inputs.message }}
# `|| ''` guards each value so the env var is always set to an
# empty string (not unset) when the source field is missing for
# the active event type. Without this, `set -u` blows up below.
RELEASE_TAG: ${{ github.event.release.tag_name || '' }}
RELEASE_URL: ${{ github.event.release.html_url || '' }}
RELEASE_BODY: ${{ github.event.release.body || '' }}
DEPLOY_SHA: ${{ github.event.workflow_run.head_sha || '' }}
DEPLOY_URL: ${{ github.event.workflow_run.html_url || '' }}
DISPATCH_MSG: ${{ inputs.message || '' }}
run: |
set -euo pipefail
# NL is a literal newline used to assemble multi-line bodies
# without breaking the YAML literal-block-scalar indentation.
# Concatenating "$VAR""$NL""$NL""$OTHER" gives both interpolation
# AND embedded blank lines.
NL=$'\n'
case "$EVENT" in
release)
title="Release $RELEASE_TAG"
body=$'## $RELEASE_TAG\n\n$RELEASE_BODY\n\n[View release →]($RELEASE_URL)'
title="Release ${RELEASE_TAG}"
body="## ${RELEASE_TAG}${NL}${NL}${RELEASE_BODY}${NL}${NL}[View release →](${RELEASE_URL})"
;;
workflow_run)
short_sha="${DEPLOY_SHA:0:7}"
title="Deploy succeeded — $short_sha"
body=$'Latest commit deployed to GitHub Pages.\n\n[Deploy run →]($DEPLOY_URL)'
title="Deploy succeeded — ${short_sha}"
body="Latest commit deployed to GitHub Pages.${NL}${NL}[Deploy run →](${DEPLOY_URL})"
;;
workflow_dispatch)
title="Announcement"
body="$DISPATCH_MSG"
body="${DISPATCH_MSG}"
;;
*)
echo "::error::Unsupported event: $EVENT"
echo "::error::Unsupported event: ${EVENT}"
exit 1
;;
esac
@@ -115,6 +123,13 @@ jobs:
- name: Create Discussion
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pass dynamic values through env vars (not literal `${{ ... }}`
# substitution) so a title/body containing quotes, backticks, or
# other shell-special characters doesn't break the command line.
REPO_ID: ${{ steps.ids.outputs.repo_id }}
CAT_ID: ${{ steps.ids.outputs.cat_id }}
TITLE: ${{ steps.msg.outputs.title }}
BODY: ${{ steps.msg.outputs.body }}
run: |
set -euo pipefail
MUTATION='mutation($repo: ID!, $cat: ID!, $title: String!, $body: String!) {
@@ -124,8 +139,8 @@ jobs:
}'
gh api graphql \
-f query="$MUTATION" \
-F repo="${{ steps.ids.outputs.repo_id }}" \
-F cat="${{ steps.ids.outputs.cat_id }}" \
-F title="${{ steps.msg.outputs.title }}" \
-F body="${{ steps.msg.outputs.body }}" \
-F repo="$REPO_ID" \
-F cat="$CAT_ID" \
-F title="$TITLE" \
-F body="$BODY" \
--jq '.data.createDiscussion.discussion.url'
+1 -1
View File
@@ -52,7 +52,7 @@ jobs:
run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: dist
path: dist
+3 -3
View File
@@ -41,10 +41,10 @@ jobs:
run: cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v5
uses: actions/configure-pages@v6
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: dist
@@ -58,4 +58,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
+5 -7
View File
@@ -22,12 +22,9 @@ jobs:
- name: Windows
runner: windows-latest
args: ''
- name: macOS (Apple Silicon)
- name: macOS (universal)
runner: macos-14
args: '--target aarch64-apple-darwin'
- name: macOS (Intel)
runner: macos-13
args: '--target x86_64-apple-darwin'
args: '--target universal-apple-darwin'
- name: Linux
runner: ubuntu-22.04
args: ''
@@ -57,7 +54,8 @@ jobs:
- name: Setup Rust (stable)
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.runner == 'macos-14' && 'aarch64-apple-darwin' || matrix.platform.runner == 'macos-13' && 'x86_64-apple-darwin' || '' }}
# macOS universal2 build needs both aarch64 + x86_64 targets installed.
targets: ${{ matrix.platform.runner == 'macos-14' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Cache Cargo build artifacts
uses: swatinem/rust-cache@v2
@@ -86,7 +84,7 @@ jobs:
releaseBody: |
Native desktop builds for Windows, macOS, and Linux.
See the [CHANGELOG](https://github.com/poli0981/jsonprism/blob/main/CHANGELOG.md) for what's new.
See the [CHANGELOG](https://github.com/poli0981/jsonPrism/blob/main/CHANGELOG.md) for what's new.
releaseDraft: true
prerelease: false
args: ${{ matrix.platform.args }}
+66
View File
@@ -8,6 +8,72 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
No unreleased changes at this time. Future work tracked in `docs/ROADMAP.md` under "Beyond Phase 3".
## [1.4.0] — 2026-05-14
### Added — Đợt UI/UX polish: dynamic placeholders, social, reverse highlight expansion, mobile
- **Dynamic input/output placeholders** in reverse mode. `Paste your JSON here…` and `Output will appear here once you provide valid JSON.` now interpolate the source/target extension: e.g. `Paste your CSV here…`, `Output will appear here once you provide valid YAML.` New i18n keys `home.input_placeholder_format` and `home.output_empty_format` carry `{{ext}}`; the panels resolve `converter.meta.extension.toUpperCase()`. Forward mode keeps the JSON-specific copy.
- **"Multi-target formats" slogan** replaces "Eight target formats" in `app.description` across en/vi/ja/zh-CN — copy no longer hard-codes a stale count as new formats land.
- **Reverse-mode syntax highlight** widened: Markdown, SQL, TOML, and JSONL now render with proper tokens in the input editor (previously plain text). Adds `@codemirror/lang-markdown`, `@codemirror/lang-sql`, and `@codemirror/legacy-modes` (the latter for TOML via `StreamLanguage.define`). CSV/TSV stay plain — no fitting CodeMirror grammar. All new packs flow into the existing `codemirror` manualChunk; no initial-bundle regression.
- **Social links UI**. New `src/components/common/SocialIcons.tsx` houses six inline-SVG brand icons (Discord, X, Bluesky, Mastodon, Telegram, YouTube) since `lucide-react` has no brand glyphs. Footer surfaces the three dev-relevant ones (Discord dev community, X, Bluesky) between app meta and the maintainer credit. About page gains a `Community` section between Donate and Third-party listing all six. New i18n keys `about.community.*` and `social.*` across en/vi/ja/zh-CN.
- **Mobile responsiveness polish**. Header's Convert/About nav links no longer hidden below `md:` — always visible, with tighter padding and a smaller brand wordmark on small viewports. Toolbar buttons in `InputPanel` / `OutputPanel` collapse to icon-only on mobile (label moves to `aria-label` / `title`). Workspace input/output panels keep a `min-h-[40vh]` floor on mobile so the stacked layout stays usable. `Home` hero stacks on mobile; `About` page shrinks outer padding; `FormatPicker` chips compact down. No hamburger menu — only two nav links, the drawer pattern wasn't worth its bundle cost.
### Fixed
- **Input editor mousewheel scroll requiring a click-to-focus**. `.cm-scroller` was set to `scrollbarWidth: 'none'` plus `::-webkit-scrollbar { display: none }`. On at least some Chromium builds, this disengaged the scroll target until the editor was focused — keyboard PageDown also did nothing without focus. Switched to `scrollbarWidth: 'thin'`, an explicit `overflow: 'auto'`, and a themed `::-webkit-scrollbar` thumb. Wheel and PageDown both work without a prior click.
### Changed
- **README EN + VI refreshed**. Sync slogan with the in-app copy ("Multi-target formats" / "Đa định dạng đích"). VI README format table catches up with EN: includes BSON / CBOR / MessagePack (Phase 4) and the `Reverse (→ JSON)` column. Tech-stack line bumped from `Vite 6` to `Vite 8` in both files (package.json has been on `^8.0.0`; the About page already reflected this). Both READMEs gain a `Community` section mirroring the in-app links.
### Dependencies
- Added `@codemirror/lang-markdown`, `@codemirror/lang-sql`, and `@codemirror/legacy-modes` (all MIT, all `@codemirror/*` so they auto-route into the `codemirror` manualChunk via `vite.config.ts`).
### Tests
- No new tests for this UI-polish round. The 193 existing unit tests still pass; the new behaviour is editor/CSS/i18n surface that's better verified manually (DevTools mobile viewport, wheel-scroll without click, per-format placeholder, reverse-mode highlight). Total tests: **193**.
## [1.3.3] — 2026-05-13
### Fixed
- **Tauri native drag-drop / file picker bypassed batch dedup**. v1.3.0–v1.3.2 desktop bundles let users drop the same file into the queue repeatedly without surfacing the `duplicate` toast. Root cause: `fileFromNativePath` constructed `new File([text], name, { type })` without `lastModified`, so the File API defaulted to `Date.now()` on every call; `batchStore`'s dedup key (`name|size|lastModified`) differed across re-drops of the same on-disk file. Fix: stat the file via `@tauri-apps/plugin-fs` and use the real `mtime`, falling back to an FNV-1a hash of the path if `stat()` throws. Bonus: infer `type` from the file extension instead of hard-coding `application/json`. Added the `fs:allow-stat` permission to the default capability.
### Tests
- 3 new unit tests for `pathHashAsMillis` in `src/lib/__tests__/tauri.test.ts`. Total tests: **193**.
### Verified
- Windows Sandbox (Windows 11): manual smoke test passed — re-dropping the same `.json` file surfaces the `duplicate` toast and keeps the queue at one entry.
- Ubuntu 22.04 LTS on a Hyper-V VM: full smoke test passed at 100% (drag-drop dedup, extension filter, batch processing).
## [1.3.2] — 2026-05-13
### Fixed
- **Tauri native drag-drop bypassed the batch extension filter** *(misdiagnosis — see note below)*. v1.3.0/v1.3.1 desktop bundles accepted any file dropped from File Explorer / Finder / Nautilus into the workspace, because `ConverterWorkspace.handleMultiFileDrop` called `batchStore.addFiles` directly — skipping the `direction × format` extension whitelist that the web `react-dropzone` path enforced. Files like `.cs`/`.py` leaked into the queue with no warning. Extracted `src/lib/file-filter.ts` (`getAllowedExtensions` + `extOf` + `filterByExtension`) and routed the Tauri callback, `BatchPanel`, and `InputPanel` through it so the wrong-format toast surfaces in all three entry points.
### Note on root cause
This release shipped on a misdiagnosis. The user-visible bug they were investigating turned out to be **batch dedup not working under Tauri** (fixed in v1.3.3), not the missing extension filter on the native drag-drop path. The fix in this release is still correct on its own — the Tauri code path *was* missing the wrong-format filter — but it did not change the behaviour the user was actually seeing. Treat v1.3.2 as a defensive hardening that closes a real-but-cosmetic gap; functional impact for end users is negligible.
### Tests
- 7 new unit tests for `getAllowedExtensions`, `extOf`, and `filterByExtension` in `src/lib/__tests__/file-filter.test.ts`. Total tests: **190**.
## [1.3.1] — 2026-05-13
### Fixed
- **GitHub Pages deploy 404**. The deployed page rendered blank because every asset URL 404'd. Root cause: GitHub Pages serves at `https://poli0981.github.io/jsonPrism/` (case-sensitive, mirrors the repo name), but Vite `base` was `/jsonprism/` (lowercase), so `index.html` referenced `/jsonprism/assets/*.js`. Rebased Vite `base`, React Router basename, and all GitHub URLs in code/docs to match the existing repo case `jsonPrism`. Storage keys / package name / Tauri identifier remain lowercase.
- **Release workflow macOS Intel build cancelled**. GitHub Actions `macos-13` runners no longer pick up jobs (jobs queue indefinitely then auto-cancel after timeout). Replaced the two-entry macOS matrix (Apple Silicon + Intel) with a single `macos-14` build using `--target universal-apple-darwin`. The resulting `.dmg` / `.app` runs on both Apple Silicon and Intel via the universal2 binary.
### Note on v1.3.0
The v1.3.0 tag was published with a draft GitHub Release containing partial bundles (Windows + macOS Apple Silicon + Linux; macOS Intel missing). It was never un-drafted because of the two bugs above. v1.3.1 carries the same feature set plus the fixes — please use v1.3.1.
## [1.3.0] — 2026-05-13
### Added — Đợt sửa lỗi 4: editor UX, batch hygiene, workspace persistence, TERMS
+1 -1
View File
@@ -12,7 +12,7 @@ In short:
The maintainer ([@poli0981](https://github.com/poli0981)) is responsible
for enforcement. Reports of misconduct can be sent through:
- A [private Discussion](https://github.com/poli0981/jsonprism/discussions) addressed to the maintainer, or
- A [private Discussion](https://github.com/poli0981/jsonPrism/discussions) addressed to the maintainer, or
- Email via the address on the GitHub profile.
Reports are handled confidentially. Possible outcomes include: a warning,
+4 -4
View File
@@ -5,7 +5,7 @@ Thanks for considering a contribution! JSONPrism is an open-source project under
## Quick start
```bash
git clone https://github.com/poli0981/jsonprism.git
git clone https://github.com/poli0981/jsonPrism.git
cd jsonprism
npm install
npm run dev
@@ -36,7 +36,7 @@ Open <http://localhost:5173>.
### 🐛 Bug reports
Use the [Bug Report](https://github.com/poli0981/jsonprism/issues/new?template=bug_report.md) template. Include:
Use the [Bug Report](https://github.com/poli0981/jsonPrism/issues/new?template=bug_report.md) template. Include:
- Browser + OS
- Steps to reproduce
@@ -45,7 +45,7 @@ Use the [Bug Report](https://github.com/poli0981/jsonprism/issues/new?template=b
### 💡 Feature requests
Use the [Feature Request](https://github.com/poli0981/jsonprism/issues/new?template=feature_request.md) template. We prioritize features that:
Use the [Feature Request](https://github.com/poli0981/jsonPrism/issues/new?template=feature_request.md) template. We prioritize features that:
- Fit the "one JSON → many formats" core mission
- Don't require server-side processing (we're client-only by design)
@@ -123,7 +123,7 @@ This project adopts the [Contributor Covenant v2.1](CODE_OF_CONDUCT.md).
Be kind. Assume good faith. Disagreements about technical choices are
fine; personal attacks and harassment are not.
Reports to the maintainer via the [private Security Advisory flow](https://github.com/poli0981/jsonprism/security/advisories/new) for sensitive matters, or a private GitHub Discussion otherwise.
Reports to the maintainer via the [private Security Advisory flow](https://github.com/poli0981/jsonPrism/security/advisories/new) for sensitive matters, or a private GitHub Discussion otherwise.
## License
+3 -3
View File
@@ -32,7 +32,7 @@ This project openly uses AI tools during development:
and reviewing PRs.
- All AI-generated code is reviewed by the maintainer before being
merged. Errors that slip through are bugs — please report them via
[GitHub Issues](https://github.com/poli0981/jsonprism/issues).
[GitHub Issues](https://github.com/poli0981/jsonPrism/issues).
### Translations
@@ -57,6 +57,6 @@ key — it surfaces this disclaimer to users at runtime.
## Reporting concerns
- Bugs: [GitHub Issues](https://github.com/poli0981/jsonprism/issues)
- Security: [Private Security Advisory](https://github.com/poli0981/jsonprism/security/advisories/new)
- Bugs: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
- Security: [Private Security Advisory](https://github.com/poli0981/jsonPrism/security/advisories/new)
- Translation accuracy: GitHub Discussions
+3 -3
View File
@@ -10,9 +10,9 @@ merged PR.
## Contact
- Bug reports & feature requests: [GitHub Issues](https://github.com/poli0981/jsonprism/issues)
- Discussion / Q&A: [GitHub Discussions](https://github.com/poli0981/jsonprism/discussions)
- Security: [Private Security Advisory](https://github.com/poli0981/jsonprism/security/advisories/new)
- Bug reports & feature requests: [GitHub Issues](https://github.com/poli0981/jsonPrism/issues)
- Discussion / Q&A: [GitHub Discussions](https://github.com/poli0981/jsonPrism/discussions)
- Security: [Private Security Advisory](https://github.com/poli0981/jsonPrism/security/advisories/new)
## Becoming a maintainer
+2 -2
View File
@@ -67,5 +67,5 @@ The Tauri build inlines these fonts and never makes the request.
## Questions
Open a [GitHub Discussion](https://github.com/poli0981/jsonprism/discussions) if anything here is unclear.
For security-relevant reports, use the [private Security Advisory flow](https://github.com/poli0981/jsonprism/security/advisories/new).
Open a [GitHub Discussion](https://github.com/poli0981/jsonPrism/discussions) if anything here is unclear.
For security-relevant reports, use the [private Security Advisory flow](https://github.com/poli0981/jsonPrism/security/advisories/new).
+18 -7
View File
@@ -4,13 +4,13 @@
**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)
[![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)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[Live demo](https://poli0981.github.io/jsonprism/) · [Tiếng Việt](README.vi.md) · [Roadmap](docs/ROADMAP.md)
[Live demo](https://poli0981.github.io/jsonPrism/) · [Tiếng Việt](README.vi.md) · [Roadmap](docs/ROADMAP.md)
</div>
@@ -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
@@ -59,7 +59,7 @@ JSONPrism is a refracting tool for developers. It takes a single JSON input and
**Requirements**: Node.js **22 LTS** or newer.
```bash
git clone https://github.com/poli0981/jsonprism.git
git clone https://github.com/poli0981/jsonPrism.git
cd jsonprism
npm install
npm run dev # http://localhost:5173
@@ -187,7 +187,7 @@ See [`docs/ROADMAP.md`](docs/ROADMAP.md) for the full phase plan.
Pull requests welcome — please read [`CONTRIBUTING.md`](CONTRIBUTING.md) first. PRs that match the **auto-ignored** patterns described there (suspicious code, off-topic preamble, no description, etc.) get closed without review.
For bug reports and feature requests, use [GitHub Issues](https://github.com/poli0981/jsonprism/issues). For security vulnerabilities, use the [private Security Advisory flow](https://github.com/poli0981/jsonprism/security/advisories/new).
For bug reports and feature requests, use [GitHub Issues](https://github.com/poli0981/jsonPrism/issues). For security vulnerabilities, use the [private Security Advisory flow](https://github.com/poli0981/jsonPrism/security/advisories/new).
## Project docs
@@ -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
+32 -18
View File
@@ -4,13 +4,13 @@
**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)
[![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)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[Bản demo](https://poli0981.github.io/jsonprism/) · [English](README.md) · [Lộ trình](docs/ROADMAP.md)
[Bản demo](https://poli0981.github.io/jsonPrism/) · [English](README.md) · [Lộ trình](docs/ROADMAP.md)
</div>
@@ -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
@@ -56,7 +59,7 @@ JSONPrism là công cụ "tán sắc" cho developer. Nhận một JSON đầu v
**Yêu cầu**: Node.js **22 LTS** trở lên.
```bash
git clone https://github.com/poli0981/jsonprism.git
git clone https://github.com/poli0981/jsonPrism.git
cd jsonprism
npm install
npm run dev # http://localhost:5173
@@ -184,7 +187,7 @@ Xem [`docs/ROADMAP.md`](docs/ROADMAP.md) để biết kế hoạch phase đầy
Welcome pull request — vui lòng đọc [`CONTRIBUTING.md`](CONTRIBUTING.md) trước. PR thuộc nhóm **auto-ignored** (code đáng ngờ, lan man không vào vấn đề, không mô tả…) sẽ bị đóng không review.
Báo bug hoặc đề xuất tính năng tại [GitHub Issues](https://github.com/poli0981/jsonprism/issues). Vấn đề bảo mật vui lòng dùng [Security Advisory riêng tư](https://github.com/poli0981/jsonprism/security/advisories/new).
Báo bug hoặc đề xuất tính năng tại [GitHub Issues](https://github.com/poli0981/jsonPrism/issues). Vấn đề bảo mật vui lòng dùng [Security Advisory riêng tư](https://github.com/poli0981/jsonPrism/security/advisories/new).
## Tài liệu project
@@ -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
+1 -1
View File
@@ -16,7 +16,7 @@ latest minor of the current major receives security fixes.
Use GitHub's private vulnerability reporting:
→ <https://github.com/poli0981/jsonprism/security/advisories/new>
→ <https://github.com/poli0981/jsonPrism/security/advisories/new>
This routes the report directly to the maintainer through a private
channel. You can include a proof-of-concept, suggested fix, and your
+1 -1
View File
@@ -15,7 +15,7 @@ not agree, stop using it.
## 1. Acceptance
Accessing the web app at <https://poli0981.github.io/jsonprism/>,
Accessing the web app at <https://poli0981.github.io/jsonPrism/>,
running the Tauri desktop bundle, cloning or downloading the repository,
or otherwise interacting with the project constitutes acceptance of
these terms.
+1 -1
View File
@@ -39,7 +39,7 @@ the broader dev environment knows what's around:
```bash
# One-time
git clone https://github.com/poli0981/jsonprism.git
git clone https://github.com/poli0981/jsonPrism.git
cd jsonprism
npm install
+1 -1
View File
@@ -39,7 +39,7 @@ trường tương đương:
```bash
# Một lần
git clone https://github.com/poli0981/jsonprism.git
git clone https://github.com/poli0981/jsonPrism.git
cd jsonprism
npm install
+131 -2
View File
@@ -1,18 +1,21 @@
{
"name": "jsonprism",
"version": "1.3.0",
"version": "1.4.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jsonprism",
"version": "1.3.0",
"version": "1.4.0",
"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",
+6 -3
View File
@@ -1,15 +1,15 @@
{
"name": "jsonprism",
"private": true,
"version": "1.3.0",
"version": "1.4.0",
"type": "module",
"description": "Disperse JSON into many formats — JSONL, CSV, YAML, XML, TOML, RESX, Markdown, SQL — fully client-side.",
"author": "poli0981 <https://github.com/poli0981>",
"license": "Apache-2.0",
"homepage": "https://poli0981.github.io/jsonprism/",
"homepage": "https://poli0981.github.io/jsonPrism/",
"repository": {
"type": "git",
"url": "https://github.com/poli0981/jsonprism.git"
"url": "https://github.com/poli0981/jsonPrism.git"
},
"engines": {
"node": ">=22.11.0"
@@ -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",
+2 -2
View File
@@ -1,10 +1,10 @@
[package]
name = "jsonprism"
version = "1.3.0"
version = "1.4.0"
description = "Disperse JSON into many formats."
authors = ["poli0981 <https://github.com/poli0981>"]
license = "Apache-2.0"
repository = "https://github.com/poli0981/jsonprism"
repository = "https://github.com/poli0981/jsonPrism"
edition = "2021"
rust-version = "1.77"
+1
View File
@@ -20,6 +20,7 @@
"fs:allow-read-text-file",
"fs:allow-write-text-file",
"fs:allow-write-file",
"fs:allow-stat",
{
"identifier": "fs:scope",
"allow": ["$HOME/**", "$DOCUMENT/**", "$DOWNLOAD/**", "$DESKTOP/**"]
+2 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "JSONPrism",
"version": "1.3.0",
"version": "1.4.0",
"identifier": "com.poli0981.jsonprism",
"build": {
"beforeDevCommand": "npm run dev",
@@ -44,7 +44,7 @@
"longDescription": "JSONPrism is a refracting tool for developers. It takes a single JSON input and disperses it into many target formats — JSONL, CSV/TSV, YAML, XML, TOML, Markdown, SQL INSERT — fully on your machine.",
"copyright": "Copyright (c) 2026 poli0981",
"publisher": "poli0981",
"homepage": "https://github.com/poli0981/jsonprism",
"homepage": "https://github.com/poli0981/jsonPrism",
"windows": {
"wix": {
"language": "en-US"
+54
View File
@@ -0,0 +1,54 @@
interface IconProps {
className?: string;
}
export function DiscordIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path d="M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.074.074 0 0 0-.079.037c-.34.6-.719 1.385-.984 2.001a18.27 18.27 0 0 0-5.487 0 12.5 12.5 0 0 0-.997-2.001.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 5.18 4.369a.07.07 0 0 0-.032.027C2.39 8.523 1.64 12.572 2.005 16.573a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.077.077 0 0 0 .084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.371-.291a.074.074 0 0 1 .078-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .079.009c.12.099.245.198.372.292a.077.077 0 0 1-.006.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.106c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.029 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.79-.838-8.806-3.548-12.179a.061.061 0 0 0-.031-.028zM8.02 14.331c-1.182 0-2.157-1.085-2.157-2.42 0-1.333.956-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.419 0 1.334-.956 2.42-2.157 2.42zm7.974 0c-1.182 0-2.157-1.085-2.157-2.42 0-1.333.955-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.419 0 1.334-.946 2.42-2.157 2.42z" />
</svg>
);
}
export function XIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
</svg>
);
}
export function BlueskyIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path
d="M5.918 4.55C8.93 6.84 12.171 11.482 13.36 13.97c1.187-2.488 4.43-7.13 7.44-9.42 2.173-1.652 5.696-2.93 5.696 1.116 0 .808-.46 6.788-.732 7.76-.94 3.379-4.358 4.24-7.4 3.717 5.318.918 6.671 3.94 3.748 6.96-5.55 5.74-7.974-1.44-8.596-3.281-.114-.337-.167-.495-.167-.361 0-.134-.053.024-.167.361-.621 1.841-3.046 9.022-8.595 3.281-2.923-3.02-1.571-6.042 3.748-6.96-3.043.523-6.46-.338-7.4-3.717C.265 12.454-.196 6.474-.196 5.666c0-4.046 3.523-2.768 5.696-1.116l.418.001-.001.001z"
transform="translate(0.196 0)"
/>
</svg>
);
}
export function MastodonIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.673-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z" />
</svg>
);
}
export function TelegramIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" />
</svg>
);
}
export function YoutubeIcon({ className }: IconProps) {
return (
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden>
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" />
</svg>
);
}
+6 -10
View File
@@ -13,6 +13,7 @@ import {
import { toast } from '@/components/ui/sonner';
import { useBatchStore, BATCH_MAX_FILES, type BatchItem } from '@/stores/batchStore';
import { processBatch, zipOutputs, downloadBlob } from '@/lib/batch-processor';
import { filterByExtension, getAllowedExtensions } from '@/lib/file-filter';
import { isTauri, nativeOpenFiles, nativeSaveBlob, fileFromNativePath } from '@/lib/tauri';
import { getConverter } from '@/converters/registry';
import type { FormatId } from '@/converters/types';
@@ -68,19 +69,14 @@ export function BatchPanel({ format, direction, options, open, onOpenChange }: B
// Whitelist of file extensions that match the current direction × format.
// The browser's native `<input accept>` is only a hint, so we re-validate
// in JS to reject files chosen via "Browse" with "All files" filter.
const allowedExtensions = useMemo(() => {
return isReverse ? [converter.meta.extension.toLowerCase(), 'txt'] : ['json', 'txt'];
}, [isReverse, converter.meta.extension]);
const allowedExtensions = useMemo(
() => getAllowedExtensions(isReverse ? 'reverse' : 'forward', converter.meta.extension),
[isReverse, converter.meta.extension],
);
const handleAddFiles = useCallback(
(files: File[]) => {
const valid: File[] = [];
let wrongFormat = 0;
for (const f of files) {
const ext = (f.name.split('.').pop() ?? '').toLowerCase();
if (allowedExtensions.includes(ext)) valid.push(f);
else wrongFormat += 1;
}
const { valid, wrongFormat } = filterByExtension(files, allowedExtensions);
if (wrongFormat > 0) {
toast.warning(t('batch.toast.wrong_format', { count: wrongFormat }));
}
+21 -5
View File
@@ -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',
@@ -4,6 +4,7 @@ import { toast } from '@/components/ui/sonner';
import { getConverter } from '@/converters/registry';
import type { FormatId } from '@/converters/types';
import { parseJsonInput } from '@/lib/detect';
import { filterByExtension, getAllowedExtensions } from '@/lib/file-filter';
import { useKeyboardShortcuts } from '@/hooks/useKeyboardShortcuts';
import { useTauriDragDrop } from '@/hooks/useTauriDragDrop';
import { useBatchStore } from '@/stores/batchStore';
@@ -39,7 +40,16 @@ export function ConverterWorkspace() {
const handleMultiFileDrop = useCallback(
(files: File[]) => {
const result = addBatchFiles(files);
const allowed = getAllowedExtensions(
direction === 'reverse' ? 'reverse' : 'forward',
getConverter(format).meta.extension,
);
const { valid, wrongFormat } = filterByExtension(files, allowed);
if (wrongFormat > 0) {
toast.warning(t('batch.toast.wrong_format', { count: wrongFormat }));
}
if (valid.length === 0) return;
const result = addBatchFiles(valid);
if (result.added > 0) {
toast.success(t('batch.toast.added', { count: result.added }));
setBatchOpen(true);
@@ -52,7 +62,7 @@ export function ConverterWorkspace() {
}
}
},
[addBatchFiles, t],
[addBatchFiles, direction, format, t],
);
// Native OS drag-drop bridge (no-op outside Tauri).
@@ -206,7 +216,7 @@ export function ConverterWorkspace() {
<div className="border-border bg-card/40 flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border">
<div className="grid min-h-0 flex-1 md:grid-cols-2">
<div className="md:border-border/60 min-h-0 border-b md:border-r md:border-b-0">
<div className="md:border-border/60 min-h-[40vh] border-b md:min-h-0 md:border-r md:border-b-0">
<InputPanel
value={input}
onChange={setInput}
@@ -216,7 +226,7 @@ export function ConverterWorkspace() {
onMultiFileDrop={handleMultiFileDrop}
/>
</div>
<div className="min-h-0">
<div className="min-h-[40vh] md:min-h-0">
<OutputPanel
format={format}
content={output}
+1 -1
View File
@@ -35,7 +35,7 @@ export function FormatPicker({ value, onChange, shape, direction = 'forward' }:
onClick={() => 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',
+17 -7
View File
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import { useDropzone } from 'react-dropzone';
import { Eraser, FileText, FolderOpen } from 'lucide-react';
import { toast } from '@/components/ui/sonner';
import { extOf, getAllowedExtensions } from '@/lib/file-filter';
import { SAMPLE_JSON } from '@/lib/sample';
import { isTauri, nativeOpenFiles, fileFromNativePath } from '@/lib/tauri';
import { getConverter } from '@/converters/registry';
@@ -64,21 +65,22 @@ 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]);
// Allowed extensions for the single-file "Open" / drag-drop path.
// `<input accept>` is only a hint to the OS picker — re-validate in JS.
const allowedExtensions = useMemo(
() => (isReverse ? [converter.meta.extension.toLowerCase(), 'txt'] : ['json', 'txt']),
() => getAllowedExtensions(isReverse ? 'reverse' : 'forward', converter.meta.extension),
[isReverse, converter.meta.extension],
);
const hasAllowedExt = useCallback(
(name: string) => {
const ext = (name.split('.').pop() ?? '').toLowerCase();
return allowedExtensions.includes(ext);
},
(name: string) => allowedExtensions.includes(extOf(name)),
[allowedExtensions],
);
@@ -220,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 && (
<div className="bg-background/80 pointer-events-none absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm">
@@ -259,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}
<span>{label}</span>
<span className="hidden sm:inline">{label}</span>
</button>
);
}
+8 -2
View File
@@ -109,7 +109,11 @@ export function OutputPanel({
</pre>
) : (
<div className="text-muted-foreground/60 p-4 text-sm italic">
{t('home.output_empty')}
{isReverse
? t('home.output_empty_format', {
ext: converter.meta.extension.toUpperCase(),
})
: t('home.output_empty')}
</div>
)}
</div>
@@ -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}
<span>{label}</span>
<span className="hidden sm:inline">{label}</span>
</button>
);
}
+44 -1
View File
@@ -1,10 +1,32 @@
import { useTranslation } from 'react-i18next';
import { BlueskyIcon, DiscordIcon, XIcon } from '@/components/common/SocialIcons';
export function Footer() {
const { t } = useTranslation();
return (
<footer className="border-border/60 text-muted-foreground border-t px-6 py-6 text-xs">
<div className="mx-auto flex max-w-screen-2xl flex-col items-center justify-between gap-2 sm:flex-row">
<div className="mx-auto flex max-w-screen-2xl flex-col items-center justify-between gap-3 sm:flex-row sm:gap-2">
<div>
<span className="font-mono">JSONPrism</span> · v{__APP_VERSION__} · Apache-2.0
</div>
<div className="flex items-center gap-2">
<SocialLink
href="https://discord.gg/2aNR3aVt"
label={t('social.discord')}
icon={<DiscordIcon className="h-3.5 w-3.5" />}
/>
<SocialLink
href="https://twitter.com/SkullMute0011"
label={t('social.x')}
icon={<XIcon className="h-3.5 w-3.5" />}
/>
<SocialLink
href="https://bsky.app/profile/skullmute0011.bsky.social"
label={t('social.bluesky')}
icon={<BlueskyIcon className="h-3.5 w-3.5" />}
/>
</div>
<div className="flex items-center gap-1.5">
<span>Built by</span>
<a
@@ -20,3 +42,24 @@ export function Footer() {
</footer>
);
}
interface SocialLinkProps {
href: string;
label: string;
icon: React.ReactNode;
}
function SocialLink({ href, label, icon }: SocialLinkProps) {
return (
<a
href={href}
target="_blank"
rel="noreferrer"
aria-label={label}
title={label}
className="hover:text-foreground inline-flex h-7 w-7 items-center justify-center rounded transition"
>
{icon}
</a>
);
}
+7 -7
View File
@@ -10,15 +10,15 @@ export function Header() {
return (
<header className="border-border/60 bg-background/80 sticky top-0 z-40 border-b backdrop-blur-md">
<div className="mx-auto flex h-14 max-w-screen-2xl items-center gap-6 px-6">
<Link to="/" className="group flex items-center gap-2.5">
<BrandMark className="h-7 w-7" />
<span className="font-display text-xl leading-none tracking-tight">
<div className="mx-auto flex h-14 max-w-screen-2xl items-center gap-2 px-3 sm:gap-6 sm:px-6">
<Link to="/" className="group flex items-center gap-2 sm:gap-2.5">
<BrandMark className="h-6 w-6 sm:h-7 sm:w-7" />
<span className="font-display text-base leading-none tracking-tight sm:text-xl">
JSON<span className="text-spectrum italic">Prism</span>
</span>
</Link>
<nav className="ml-6 hidden gap-1 md:flex">
<nav className="flex gap-0.5 md:ml-6 md:gap-1">
<NavItem to="/" end>
{t('nav.home')}
</NavItem>
@@ -29,7 +29,7 @@ export function Header() {
<LanguageSwitcher />
<ThemeToggle />
<a
href="https://github.com/poli0981/jsonprism"
href="https://github.com/poli0981/jsonPrism"
target="_blank"
rel="noreferrer"
className="text-muted-foreground hover:bg-muted hover:text-foreground inline-flex h-9 w-9 items-center justify-center rounded-md transition"
@@ -56,7 +56,7 @@ function NavItem({ to, end, children }: NavItemProps) {
{...(end !== undefined ? { end } : {})}
className={({ isActive }) =>
cn(
'inline-flex h-9 items-center rounded-md px-3 text-sm font-medium transition',
'inline-flex h-9 items-center rounded-md px-2 text-sm font-medium transition sm:px-3',
isActive
? 'text-foreground bg-muted/60'
: 'text-muted-foreground hover:text-foreground hover:bg-muted/40',
+21 -1
View File
@@ -2,7 +2,7 @@
"app": {
"name": "JSONPrism",
"tagline": "Disperse JSON into many formats",
"description": "One JSON input. Eight target formats. Fully in your browser."
"description": "One JSON input. Multi-target formats. Fully in your browser."
},
"nav": {
"home": "Convert",
@@ -13,8 +13,10 @@
"input_label": "Input JSON",
"input_label_format": "Input {{format}}",
"input_placeholder": "Paste your JSON here, drop files, or load a sample…",
"input_placeholder_format": "Paste your {{ext}} here, drop files, or load a sample…",
"output_label": "Output",
"output_empty": "Output will appear here once you provide valid JSON.",
"output_empty_format": "Output will appear here once you provide valid {{ext}}.",
"drop_zone": "Drop JSON files here",
"drop_zone_active": "Drop to load",
"drop_zone_hint": "Up to 500 files. Everything runs in your browser — nothing leaves your device.",
@@ -244,6 +246,16 @@
"patreon": "Patreon",
"paypal": "PayPal"
},
"community": {
"title": "Community & maintainer",
"lead": "Follow Kokone or join the JSONPrism dev community:",
"discord": "Discord (dev community)",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
},
"third_party": {
"title": "Built on open source",
"lead": "JSONPrism stands on the shoulders of many great projects:",
@@ -281,5 +293,13 @@
},
"disclaimer": {
"translation": "Non-English translations are AI-generated. Accuracy is not guaranteed."
},
"social": {
"discord": "Discord",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
}
}
+21 -1
View File
@@ -2,7 +2,7 @@
"app": {
"name": "JSONPrism",
"tagline": "JSON を様々な形式に分散",
"description": "JSON 入力ひとつ。ターゲット形式は 8 種類以上。ブラウザ内で完結。"
"description": "JSON 入力ひとつ。マルチターゲット形式。ブラウザ内で完結。"
},
"nav": {
"home": "変換",
@@ -13,8 +13,10 @@
"input_label": "JSON 入力",
"input_label_format": "{{format}} 入力",
"input_placeholder": "ここに JSON を貼り付け、ファイルをドロップ、またはサンプルを読み込み…",
"input_placeholder_format": "ここに {{ext}} を貼り付け、ファイルをドロップ、またはサンプルを読み込み…",
"output_label": "出力",
"output_empty": "有効な JSON を入力すると、ここに出力が表示されます。",
"output_empty_format": "有効な {{ext}} を入力すると、ここに出力が表示されます。",
"drop_zone": "JSON ファイルをここにドロップ",
"drop_zone_active": "ドロップして読み込み",
"drop_zone_hint": "最大 500 ファイル。すべてブラウザ内で処理 — データは端末から外に出ません。",
@@ -244,6 +246,16 @@
"patreon": "Patreon",
"paypal": "PayPal"
},
"community": {
"title": "コミュニティ & メンテナー",
"lead": "Kokone をフォローするか、JSONPrism の開発者コミュニティに参加:",
"discord": "Discord (開発者コミュニティ)",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
},
"third_party": {
"title": "オープンソースの上に構築",
"lead": "JSONPrism は多くの優れたプロジェクトの上に成り立っています:",
@@ -281,5 +293,13 @@
},
"disclaimer": {
"translation": "このページの翻訳は AI 生成です。100% の正確性は保証されません。"
},
"social": {
"discord": "Discord",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
}
}
+21 -1
View File
@@ -2,7 +2,7 @@
"app": {
"name": "JSONPrism",
"tagline": "Tán sắc JSON ra nhiều định dạng",
"description": "Một JSON đầu vào. Tám định dạng đích. Chạy hoàn toàn trong trình duyệt."
"description": "Một JSON đầu vào. Đa định dạng đích. Chạy hoàn toàn trong trình duyệt."
},
"nav": {
"home": "Chuyển đổi",
@@ -13,8 +13,10 @@
"input_label": "JSON đầu vào",
"input_label_format": "Đầu vào {{format}}",
"input_placeholder": "Dán JSON vào đây, thả file, hoặc nạp mẫu…",
"input_placeholder_format": "Dán {{ext}} vào đây, thả file, hoặc nạp mẫu…",
"output_label": "Kết quả",
"output_empty": "Kết quả sẽ hiện ở đây khi bạn cung cấp JSON hợp lệ.",
"output_empty_format": "Kết quả sẽ hiện ở đây khi bạn cung cấp {{ext}} hợp lệ.",
"drop_zone": "Thả file JSON vào đây",
"drop_zone_active": "Thả ra để nạp",
"drop_zone_hint": "Tối đa 500 file. Mọi thứ chạy trong trình duyệt — không có dữ liệu nào rời khỏi máy của bạn.",
@@ -244,6 +246,16 @@
"patreon": "Patreon",
"paypal": "PayPal"
},
"community": {
"title": "Cộng đồng & maintainer",
"lead": "Theo dõi Kokone hoặc tham gia cộng đồng dev JSONPrism:",
"discord": "Discord (cộng đồng dev)",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
},
"third_party": {
"title": "Đứng trên vai open source",
"lead": "JSONPrism được xây dựng trên nhiều project tuyệt vời:",
@@ -281,5 +293,13 @@
},
"disclaimer": {
"translation": "Các bản dịch không phải tiếng Anh do AI tạo, không đảm bảo chính xác 100%."
},
"social": {
"discord": "Discord",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
}
}
+21 -1
View File
@@ -2,7 +2,7 @@
"app": {
"name": "JSONPrism",
"tagline": "将 JSON 分散为多种格式",
"description": "一份 JSON 输入,八种以上目标格式,全程在浏览器中完成。"
"description": "一份 JSON 输入,多目标格式,全程在浏览器中完成。"
},
"nav": {
"home": "转换",
@@ -13,8 +13,10 @@
"input_label": "JSON 输入",
"input_label_format": "{{format}} 输入",
"input_placeholder": "在此处粘贴 JSON、拖入文件或加载示例…",
"input_placeholder_format": "在此处粘贴 {{ext}}、拖入文件或加载示例…",
"output_label": "输出",
"output_empty": "提供有效的 JSON 后,输出将显示在此处。",
"output_empty_format": "提供有效的 {{ext}} 后,输出将显示在此处。",
"drop_zone": "将 JSON 文件拖到此处",
"drop_zone_active": "释放即可加载",
"drop_zone_hint": "最多 500 个文件。全部在浏览器中运行 — 数据不会离开你的设备。",
@@ -244,6 +246,16 @@
"patreon": "Patreon",
"paypal": "PayPal"
},
"community": {
"title": "社区与维护者",
"lead": "关注 Kokone 或加入 JSONPrism 开发者社区:",
"discord": "Discord(开发者社区)",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
},
"third_party": {
"title": "构建于开源之上",
"lead": "JSONPrism 站在众多优秀项目的肩膀上:",
@@ -281,5 +293,13 @@
},
"disclaimer": {
"translation": "本页面译文由 AI 生成,不保证 100% 准确。"
},
"social": {
"discord": "Discord",
"x": "X (Twitter)",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"telegram": "Telegram",
"youtube": "YouTube"
}
}
+54
View File
@@ -0,0 +1,54 @@
import { describe, expect, it } from 'vitest';
import { extOf, filterByExtension, getAllowedExtensions } from '../file-filter';
function f(name: string): File {
return new File(['x'], name);
}
describe('getAllowedExtensions', () => {
it('returns json + txt for forward direction regardless of format', () => {
expect(getAllowedExtensions('forward', 'yaml')).toEqual(['json', 'txt']);
expect(getAllowedExtensions('forward', 'resx')).toEqual(['json', 'txt']);
});
it('returns format extension + txt for reverse direction, lowercased', () => {
expect(getAllowedExtensions('reverse', 'yaml')).toEqual(['yaml', 'txt']);
expect(getAllowedExtensions('reverse', 'RESX')).toEqual(['resx', 'txt']);
expect(getAllowedExtensions('reverse', 'toml')).toEqual(['toml', 'txt']);
});
});
describe('extOf', () => {
it('lowercases the trailing extension', () => {
expect(extOf('foo.JSON')).toBe('json');
expect(extOf('a.b.cs')).toBe('cs');
});
it('returns empty string for names with no extension', () => {
expect(extOf('noext')).toBe('');
expect(extOf('trailing.')).toBe('');
expect(extOf('.hidden')).toBe('hidden');
});
});
describe('filterByExtension', () => {
it('partitions by extension whitelist (case-insensitive)', () => {
const cs = f('a.cs');
const json = f('b.json');
const yaml = f('c.yaml');
const result = filterByExtension([cs, json, yaml], ['json', 'txt']);
expect(result.valid).toEqual([json]);
expect(result.wrongFormat).toBe(2);
});
it('accepts uppercase extensions because whitelist comparison is lowercased', () => {
const upper = f('FOO.JSON');
const result = filterByExtension([upper], ['json', 'txt']);
expect(result.valid).toEqual([upper]);
expect(result.wrongFormat).toBe(0);
});
it('returns empty result for empty input', () => {
expect(filterByExtension([], ['json'])).toEqual({ valid: [], wrongFormat: 0 });
});
});
+22
View File
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest';
import { pathHashAsMillis } from '../tauri';
describe('pathHashAsMillis', () => {
it('is deterministic for the same input', () => {
const a = pathHashAsMillis('C:/Users/me/data.json');
const b = pathHashAsMillis('C:/Users/me/data.json');
expect(a).toBe(b);
});
it('produces different hashes for different paths', () => {
expect(pathHashAsMillis('/a/foo.json')).not.toBe(pathHashAsMillis('/a/bar.json'));
expect(pathHashAsMillis('/a/foo.json')).not.toBe(pathHashAsMillis('/b/foo.json'));
});
it('returns a non-negative integer (unsigned 32-bit) even for empty input', () => {
const h = pathHashAsMillis('');
expect(Number.isInteger(h)).toBe(true);
expect(h).toBeGreaterThanOrEqual(0);
expect(h).toBeLessThanOrEqual(0xffffffff);
});
});
+41
View File
@@ -0,0 +1,41 @@
export type FileFilterDirection = 'forward' | 'reverse';
/**
* Allowed file extensions for a given direction × format combo.
* Forward: JSON-only input. Reverse: the format's native extension.
* `.txt` is always accepted as a freeform escape hatch.
*
* Returned extensions are lowercase, without the leading dot.
*/
export function getAllowedExtensions(
direction: FileFilterDirection,
formatExtension: string,
): string[] {
if (direction === 'reverse') {
return [formatExtension.toLowerCase(), 'txt'];
}
return ['json', 'txt'];
}
/** Lowercase extension of a filename, empty string if there's no dot. */
export function extOf(name: string): string {
const idx = name.lastIndexOf('.');
if (idx < 0 || idx === name.length - 1) return '';
return name.slice(idx + 1).toLowerCase();
}
export interface FilterByExtensionResult {
valid: File[];
wrongFormat: number;
}
/** Split files into (accepted, wrong-format count) by extension whitelist. */
export function filterByExtension(files: File[], allowed: string[]): FilterByExtensionResult {
const valid: File[] = [];
let wrongFormat = 0;
for (const f of files) {
if (allowed.includes(extOf(f.name))) valid.push(f);
else wrongFormat += 1;
}
return { valid, wrongFormat };
}
+49 -1
View File
@@ -70,14 +70,62 @@ export async function nativeReadText(path: string): Promise<string> {
return readTextFile(path);
}
// MIME type per extension. Used so File objects created from native paths
// carry a sensible `type` instead of being hard-coded to `application/json`.
const TYPE_BY_EXT: Record<string, string> = {
json: 'application/json',
yaml: 'application/x-yaml',
yml: 'application/x-yaml',
toml: 'application/toml',
xml: 'application/xml',
csv: 'text/csv',
tsv: 'text/tab-separated-values',
resx: 'application/xml',
txt: 'text/plain',
};
/**
* FNV-1a 32-bit hash of a path, returned as an unsigned 32-bit integer.
* Used as a stable `lastModified` for File objects when `stat()` is
* unavailable — `batchStore` dedups on `(name, size, lastModified)`,
* so the value must be deterministic across repeated drops of the same path.
*/
export function pathHashAsMillis(path: string): number {
let h = 0x811c9dc5;
for (let i = 0; i < path.length; i += 1) {
h ^= path.charCodeAt(i);
h = Math.imul(h, 0x01000193);
}
return h >>> 0;
}
/**
* Convert a native file path to a browser-style File so the
* existing batch store and editor flows can consume it unchanged.
*
* `lastModified` is read from the file's real mtime via `stat()` so that
* re-dropping the same file dedups correctly (batchStore keys on
* name|size|lastModified). Falling back to `Date.now()` would break dedup
* because every drop produces a fresh timestamp.
*/
export async function fileFromNativePath(path: string): Promise<File> {
const text = await nativeReadText(path);
const name = path.replace(/^.*[\\/]/, ''); // basename
return new File([text], name, { type: 'application/json' });
const ext = (name.split('.').pop() ?? '').toLowerCase();
const type = TYPE_BY_EXT[ext] ?? 'application/octet-stream';
let lastModified: number;
try {
const { stat } = await import('@tauri-apps/plugin-fs');
const info = await stat(path);
lastModified = info.mtime ? info.mtime.getTime() : pathHashAsMillis(path);
} catch {
// Capability missing or file vanished between read + stat — fall back
// to a deterministic hash so repeat drops still dedup.
lastModified = pathHashAsMillis(path);
}
return new File([text], name, { type, lastModified });
}
/**
+5 -4
View File
@@ -11,10 +11,11 @@ if (!rootEl) {
}
// Tauri serves the bundle from `tauri://localhost/` regardless of the web
// deploy path. Web prod ships at `/jsonprism/` on GitHub Pages. The split
// is build-time, so use a Vite `define` flag instead of `isTauri()` runtime
// (which is false at module load before Tauri injects __TAURI__).
const basename = __IS_TAURI_BUILD__ ? '/' : import.meta.env.PROD ? '/jsonprism' : '/';
// deploy path. Web prod ships at `/jsonPrism/` on GitHub Pages (path mirrors
// the repo name case). The split is build-time, so use a Vite `define`
// flag instead of `isTauri()` runtime (which is false at module load before
// Tauri injects __TAURI__).
const basename = __IS_TAURI_BUILD__ ? '/' : import.meta.env.PROD ? '/jsonPrism' : '/';
createRoot(rootEl).render(
<StrictMode>
+82 -4
View File
@@ -1,8 +1,55 @@
import { useTranslation } from 'react-i18next';
import { ExternalLink, Heart } from 'lucide-react';
import { ExternalLink, Heart, Users } from 'lucide-react';
import {
BlueskyIcon,
DiscordIcon,
MastodonIcon,
TelegramIcon,
XIcon,
YoutubeIcon,
} from '@/components/common/SocialIcons';
import { cn } from '@/lib/utils';
const REPO_URL = 'https://github.com/poli0981/jsonprism';
const REPO_URL = 'https://github.com/poli0981/jsonPrism';
interface CommunityPlatform {
key: 'discord' | 'x' | 'bluesky' | 'mastodon' | 'telegram' | 'youtube';
url: string;
icon: React.ReactNode;
}
const COMMUNITY: CommunityPlatform[] = [
{
key: 'discord',
url: 'https://discord.gg/2aNR3aVt',
icon: <DiscordIcon className="h-4 w-4" />,
},
{
key: 'x',
url: 'https://twitter.com/SkullMute0011',
icon: <XIcon className="h-4 w-4" />,
},
{
key: 'bluesky',
url: 'https://bsky.app/profile/skullmute0011.bsky.social',
icon: <BlueskyIcon className="h-4 w-4" />,
},
{
key: 'mastodon',
url: 'https://mastodon.social/@skullmute1122',
icon: <MastodonIcon className="h-4 w-4" />,
},
{
key: 'telegram',
url: 'https://t.me/SkullMute0011',
icon: <TelegramIcon className="h-4 w-4" />,
},
{
key: 'youtube',
url: 'https://youtube.com/@SkullMute',
icon: <YoutubeIcon className="h-4 w-4" />,
},
];
interface DonatePlatform {
key: 'github' | 'ko_fi' | 'buy_me_a_coffee' | 'patreon' | 'paypal';
@@ -94,7 +141,7 @@ export function About() {
// About page has many sections, so it needs its own scroll container —
// otherwise content overflows past the Footer at the bottom.
<div className="scrollbar-hide min-h-0 flex-1 overflow-y-auto">
<div className="mx-auto max-w-3xl px-6 py-16">
<div className="mx-auto max-w-3xl px-4 py-10 sm:px-6 sm:py-16">
<h1 className="font-display text-spectrum mb-4 text-5xl tracking-tight italic">
{t('about.title')}
</h1>
@@ -132,6 +179,37 @@ export function About() {
</ul>
</section>
{/* Community */}
<section className="mt-14">
<h2 className="font-display mb-1 text-2xl tracking-tight">
<Users className="text-primary mr-2 inline-block h-5 w-5" />
{t('about.community.title')}
</h2>
<p className="text-muted-foreground mb-4 text-sm">{t('about.community.lead')}</p>
<ul className="grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3">
{COMMUNITY.map((platform) => (
<li key={platform.key}>
<a
href={platform.url}
target="_blank"
rel="noreferrer"
className={cn(
'border-border/60 bg-card/40 hover:border-primary/40 hover:bg-card/80 inline-flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm transition',
)}
>
<span className="text-muted-foreground inline-flex items-center gap-2">
{platform.icon}
<span className="text-foreground font-medium">
{t(`about.community.${platform.key}`)}
</span>
</span>
<ExternalLink className="text-muted-foreground h-3.5 w-3.5" />
</a>
</li>
))}
</ul>
</section>
{/* Third-party */}
<section className="mt-14">
<h2 className="font-display mb-1 text-2xl tracking-tight">
@@ -202,7 +280,7 @@ export function About() {
<LinkRow href={REPO_URL} label={t('about.links.repo')} />
<LinkRow href={`${REPO_URL}/issues`} label={t('about.links.issues')} />
<LinkRow href={`${REPO_URL}/discussions`} label={t('about.links.discussions')} />
<LinkRow href="https://poli0981.github.io/jsonprism/" label={t('about.links.demo')} />
<LinkRow href="https://poli0981.github.io/jsonPrism/" label={t('about.links.demo')} />
<LinkRow href={`${REPO_URL}/blob/main/LICENSE`} label={t('about.links.license')} />
</ul>
</section>
+2 -2
View File
@@ -5,8 +5,8 @@ export function Home() {
const { t } = useTranslation();
return (
<div className="mx-auto flex min-h-0 w-full max-w-screen-2xl flex-1 flex-col gap-6 px-6 py-6">
<header className="flex items-end justify-between gap-6">
<div className="mx-auto flex min-h-0 w-full max-w-screen-2xl flex-1 flex-col gap-4 px-4 py-4 sm:gap-6 sm:px-6 sm:py-6">
<header className="flex flex-col gap-2 md:flex-row md:items-end md:justify-between md:gap-6">
<div>
<h1 className="font-display text-4xl leading-none tracking-tight md:text-5xl">
<span className="text-spectrum italic">Disperse</span> JSON.
+3 -2
View File
@@ -25,8 +25,9 @@ const appBuildDate = new Date().toISOString().slice(0, 10);
// https://vite.dev/config/
export default defineConfig(({ mode }) => ({
// Web prod build deploys to /jsonprism/. Tauri bundles serve from '/'.
base: isTauriContext ? '/' : mode === 'production' ? '/jsonprism/' : '/',
// Web prod build deploys to /jsonPrism/ (GH Pages mirrors the repo name
// case). Tauri bundles serve from '/'.
base: isTauriContext ? '/' : mode === 'production' ? '/jsonPrism/' : '/',
define: {
__APP_VERSION__: JSON.stringify(pkg.version),