Skip to content

Commit 9e27fe3

Browse files
committed
Add CodeEditor and Terminal components (v0.12.80)
- CodeEditor: syntax-highlighted code editing built on CodeMirror - 12 languages: JS, TS, JSX, TSX, Python, HTML, CSS, JSON, Markdown, SQL, XML - Line numbers, code folding, bracket matching, autocompletion - DaisyUI theme integration, size variants, read-only mode - Terminal: terminal emulation built on xterm.js - Documentation for both components - Updated component counts to 105
1 parent 59aeb31 commit 9e27fe3

18 files changed

Lines changed: 1768 additions & 8 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function App() {
138138

139139
## Components
140140

141-
103 components including forms, data display, navigation, feedback, and layout. See the full list at [asterui.com/components](https://asterui.com/components).
141+
105 components including forms, data display, navigation, feedback, and layout. See the full list at [asterui.com/components](https://asterui.com/components).
142142

143143
## Optional Components
144144

@@ -156,13 +156,17 @@ import { QRCode } from 'asterui/qrcode'
156156
# For VirtualList component
157157
npm install @tanstack/react-virtual
158158
import { VirtualList } from 'asterui/virtuallist'
159+
160+
# For CodeEditor component
161+
npm install @codemirror/autocomplete @codemirror/commands @codemirror/language @codemirror/lint @codemirror/search @codemirror/state @codemirror/view @codemirror/lang-javascript @codemirror/lang-python @codemirror/lang-html @codemirror/lang-css @codemirror/lang-json @codemirror/lang-markdown @codemirror/lang-sql @codemirror/lang-xml
162+
import { CodeEditor } from 'asterui/codeeditor'
159163
```
160164
161165
## Development
162166
163167
This is a pnpm monorepo with the following packages:
164168
165-
- `packages/asterui` - The component library (103 components)
169+
- `packages/asterui` - The component library (105 components)
166170
- `packages/create-asterui` - Project scaffolding CLI
167171
- `packages/docs` - Documentation website (asterui.com)
168172
- `packages/examples` - Example apps for testing components

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"build": "pnpm -r build",
88
"dev": "pnpm --filter docs dev",
9+
"preview": "pnpm --filter docs build && pnpm --filter docs preview",
910
"test": "pnpm -r test",
1011
"publish": "pnpm --filter asterui publish --access public",
1112
"publish:create": "pnpm --filter create-asterui publish --access public",

packages/asterui/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ description: All notable changes to AsterUI
77

88
All notable changes to AsterUI are documented here.
99

10+
## v0.12.80 (2025-01-21)
11+
12+
### Components
13+
14+
- **CodeEditor**: New optional component for syntax-highlighted code editing built on CodeMirror
15+
- Supports 12 languages: JavaScript, TypeScript, JSX, TSX, Python, HTML, CSS, JSON, Markdown, SQL, XML, plaintext
16+
- Features: line numbers, code folding, bracket matching, auto-closing brackets, autocompletion, active line highlighting
17+
- Size variants (xs/sm/md/lg/xl), read-only mode, controlled value support
18+
- DaisyUI theme integration
19+
- Custom CodeMirror extensions via `extensions` prop
20+
- Import: `import { CodeEditor } from 'asterui/codeeditor'`
21+
22+
- **Terminal**: New optional component for terminal emulation built on xterm.js
23+
- Import: `import { Terminal } from 'asterui/terminal'`
24+
25+
### Documentation
26+
27+
- Added CodeEditor documentation page with 10 interactive examples
28+
- Added CodeEditor to Data Entry category in sidebar
29+
1030
## v0.12.79 (2025-12-28)
1131

1232
### Internal

packages/asterui/package.json

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asterui",
3-
"version": "0.12.79",
3+
"version": "0.12.80",
44
"description": "React UI component library with DaisyUI",
55
"homepage": "https://asterui.com",
66
"repository": {
@@ -38,6 +38,10 @@
3838
"./terminal": {
3939
"import": "./dist/terminal.js",
4040
"types": "./dist/terminal.d.ts"
41+
},
42+
"./codeeditor": {
43+
"import": "./dist/codeeditor.js",
44+
"types": "./dist/codeeditor.d.ts"
4145
}
4246
},
4347
"files": [
@@ -64,7 +68,22 @@
6468
"apexcharts": "^5.3.6",
6569
"qrcode": "^1.5.4",
6670
"react": "^18.0.0 || ^19.0.0",
67-
"react-dom": "^18.0.0 || ^19.0.0"
71+
"react-dom": "^18.0.0 || ^19.0.0",
72+
"@codemirror/autocomplete": "^6.0.0",
73+
"@codemirror/commands": "^6.0.0",
74+
"@codemirror/lang-css": "^6.0.0",
75+
"@codemirror/lang-html": "^6.0.0",
76+
"@codemirror/lang-javascript": "^6.0.0",
77+
"@codemirror/lang-json": "^6.0.0",
78+
"@codemirror/lang-markdown": "^6.0.0",
79+
"@codemirror/lang-python": "^6.0.0",
80+
"@codemirror/lang-sql": "^6.0.0",
81+
"@codemirror/lang-xml": "^6.0.0",
82+
"@codemirror/language": "^6.0.0",
83+
"@codemirror/lint": "^6.0.0",
84+
"@codemirror/search": "^6.0.0",
85+
"@codemirror/state": "^6.0.0",
86+
"@codemirror/view": "^6.0.0"
6887
},
6988
"peerDependenciesMeta": {
7089
"@xterm/xterm": {
@@ -96,9 +115,69 @@
96115
},
97116
"qrcode": {
98117
"optional": true
118+
},
119+
"@codemirror/autocomplete": {
120+
"optional": true
121+
},
122+
"@codemirror/commands": {
123+
"optional": true
124+
},
125+
"@codemirror/lang-css": {
126+
"optional": true
127+
},
128+
"@codemirror/lang-html": {
129+
"optional": true
130+
},
131+
"@codemirror/lang-javascript": {
132+
"optional": true
133+
},
134+
"@codemirror/lang-json": {
135+
"optional": true
136+
},
137+
"@codemirror/lang-markdown": {
138+
"optional": true
139+
},
140+
"@codemirror/lang-python": {
141+
"optional": true
142+
},
143+
"@codemirror/lang-sql": {
144+
"optional": true
145+
},
146+
"@codemirror/lang-xml": {
147+
"optional": true
148+
},
149+
"@codemirror/language": {
150+
"optional": true
151+
},
152+
"@codemirror/lint": {
153+
"optional": true
154+
},
155+
"@codemirror/search": {
156+
"optional": true
157+
},
158+
"@codemirror/state": {
159+
"optional": true
160+
},
161+
"@codemirror/view": {
162+
"optional": true
99163
}
100164
},
101165
"devDependencies": {
166+
"@codemirror/autocomplete": "^6.18.6",
167+
"@codemirror/commands": "^6.8.1",
168+
"@codemirror/lang-css": "^6.3.1",
169+
"@codemirror/lang-html": "^6.4.9",
170+
"@codemirror/lang-javascript": "^6.2.3",
171+
"@codemirror/lang-json": "^6.0.1",
172+
"@codemirror/lang-markdown": "^6.3.2",
173+
"@codemirror/lang-python": "^6.1.7",
174+
"@codemirror/lang-sql": "^6.8.0",
175+
"@codemirror/lang-xml": "^6.1.0",
176+
"@codemirror/language": "^6.11.0",
177+
"@codemirror/lint": "^6.8.5",
178+
"@codemirror/search": "^6.5.10",
179+
"@codemirror/state": "^6.5.2",
180+
"@codemirror/view": "^6.36.5",
102181
"@tailwindcss/vite": "^4.1.18",
103182
"@tanstack/react-virtual": "^3.13.13",
104183
"@xterm/xterm": "^5.5.0",

packages/asterui/src/codeeditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { CodeEditor, type CodeEditorProps, type CodeEditorLanguage } from './components/CodeEditor'

0 commit comments

Comments
 (0)