Skip to content

Commit 22d887e

Browse files
authored
Merge pull request #22 from zeevenn/feat/codemirror
feat: migrate to codemirror
2 parents a674525 + 5bbb0c5 commit 22d887e

10 files changed

Lines changed: 534 additions & 139 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
99

10+
.pnpm-store
11+
1012
node_modules
1113
dist
1214
dist-ssr

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Diff Viewer</title>
8+
<script>
9+
(function() {
10+
const storageKey = 'tool-ui-theme';
11+
const theme = localStorage.getItem(storageKey) || 'system';
12+
const resolved = theme === 'system'
13+
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
14+
: theme;
15+
document.documentElement.classList.add(resolved);
16+
})();
17+
</script>
818
</head>
919
<body>
1020
<div id="root"></div>

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.0",
55
"private": true,
6-
"packageManager": "pnpm@10.15.1",
6+
"packageManager": "pnpm@10.30.3",
77
"description": "A simple real-time diff viewer including text and image",
88
"author": "Ziven <contact@ziven.me>",
99
"license": "MIT",
@@ -23,11 +23,19 @@
2323
"prepare": "simple-git-hooks"
2424
},
2525
"dependencies": {
26+
"@codemirror/commands": "catalog:",
27+
"@codemirror/lang-javascript": "catalog:",
28+
"@codemirror/lang-json": "catalog:",
29+
"@codemirror/language": "catalog:",
30+
"@codemirror/merge": "catalog:",
31+
"@codemirror/state": "catalog:",
32+
"@codemirror/theme-one-dark": "catalog:",
33+
"@codemirror/view": "catalog:",
2634
"@icons-pack/react-simple-icons": "catalog:",
27-
"@monaco-editor/react": "catalog:",
2835
"@tailwindcss/vite": "catalog:",
2936
"class-variance-authority": "catalog:",
3037
"clsx": "catalog:",
38+
"codemirror": "catalog:",
3139
"lucide-react": "catalog:",
3240
"radix-ui": "catalog:",
3341
"react": "catalog:",

0 commit comments

Comments
 (0)