mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 12:20:44 +00:00
Replace the hand-rolled textarea+Prism overlay in CodeEditor with CodeMirror 6. The overlay hid the textarea selection with `selection:bg-transparent` and `WebkitTextFillColor: transparent` as a workaround for wrap drift between the highlight layer and the textarea, which left Ctrl+A / drag-select / Ctrl+C with no visible result. CodeMirror handles selection, copy, undo, and wrap natively. Custom themes match the previous prism-react-renderer github (light) and nightOwl (dark) palettes; background is transparent so the surrounding bg-muted/30 still shows; font, font-size, line-height, padding, and gutter-less layout are preserved. Public CodeEditor props are unchanged (value, onChange, language, readonly, exactText, className, minHeight, heightMode) so all seven call sites keep working. The sensitive-key blur is reimplemented as a CodeMirror Decoration and stays gated behind the existing Eye toggle. Test setup gets a Range.getClientRects polyfill so CM mounts cleanly in JSDOM, and shared-page.test.tsx checks .cm-content text directly. Closes #1247
99 lines
3.1 KiB
JSON
99 lines
3.1 KiB
JSON
{
|
|
"name": "ui",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc -b && vite build",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint .",
|
|
"lint:fix": "eslint . --fix",
|
|
"format": "prettier --write src/ tests/",
|
|
"format:check": "prettier --check src/ tests/",
|
|
"validate": "bun run typecheck && bun run lint:fix && bun run format:check",
|
|
"preview": "vite preview",
|
|
"test": "vitest",
|
|
"test:run": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"test:ui": "vitest --ui"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/lang-json": "^6.0.2",
|
|
"@codemirror/lang-yaml": "^6.1.3",
|
|
"@codemirror/legacy-modes": "^6.5.3",
|
|
"@hookform/resolvers": "^5.2.2",
|
|
"@nivo/core": "^0.99.0",
|
|
"@nivo/sankey": "^0.99.0",
|
|
"@phosphor-icons/react": "^2.1.10",
|
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-label": "^2.1.8",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
"@radix-ui/react-select": "^2.2.6",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"@radix-ui/react-switch": "^1.2.6",
|
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@tanstack/react-query": "^5.90.12",
|
|
"@tanstack/react-table": "^8.21.3",
|
|
"@uiw/codemirror-themes": "^4.25.9",
|
|
"@uiw/react-codemirror": "^4.25.9",
|
|
"chokidar": "^5.0.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"date-fns": "^4.1.0",
|
|
"framer-motion": "^12.38.0",
|
|
"i18next": "^25.8.13",
|
|
"lucide-react": "^0.556.0",
|
|
"prism-react-renderer": "^2.4.1",
|
|
"prismjs": "^1.30.0",
|
|
"react": "^19.2.0",
|
|
"react-day-picker": "^9.12.0",
|
|
"react-dom": "^19.2.0",
|
|
"react-hook-form": "^7.68.0",
|
|
"react-i18next": "^16.5.4",
|
|
"react-resizable-panels": "^3.0.6",
|
|
"react-router-dom": "^7.10.1",
|
|
"react-simple-code-editor": "^0.14.1",
|
|
"react-virtuoso": "^4.17.0",
|
|
"recharts": "^2.12.0",
|
|
"smol-toml": "^1.6.1",
|
|
"sonner": "^2.0.7",
|
|
"tailwind-merge": "^3.4.0",
|
|
"yaml": "^2.8.2",
|
|
"zod": "^4.1.13"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^9.39.1",
|
|
"@tailwindcss/vite": "^4.1.17",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.1",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@types/node": "^24.10.1",
|
|
"@types/react": "^19.2.5",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@types/recharts": "^1.8.29",
|
|
"@vitejs/plugin-react": "^5.1.1",
|
|
"@vitest/coverage-v8": "^4.0.16",
|
|
"eslint": "^9.39.1",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
"globals": "^16.5.0",
|
|
"jsdom": "^27.3.0",
|
|
"msw": "^2.12.4",
|
|
"prettier": "^3.6.2",
|
|
"tailwindcss": "^4.1.17",
|
|
"typescript": "~5.9.3",
|
|
"typescript-eslint": "^8.46.4",
|
|
"vite": "^7.2.4",
|
|
"vitest": "^4.0.16"
|
|
}
|
|
}
|