@opentui/core 0.0.0-20260820-e69cf0cc → 0.0.0-20260829-75ab7375
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -37
- package/{chunk-bun-da1keqyp.js → chunk-bun-dtzj3rve.js} +264 -100
- package/chunk-bun-dtzj3rve.js.map +32 -0
- package/{chunk-bun-9335djz2.js → chunk-bun-kqp2x3qy.js} +178 -66
- package/{chunk-bun-9335djz2.js.map → chunk-bun-kqp2x3qy.js.map} +9 -9
- package/{chunk-node-2h23nsbj.js → chunk-node-0dbc1ecb.js} +178 -66
- package/{chunk-node-2h23nsbj.js.map → chunk-node-0dbc1ecb.js.map} +9 -9
- package/{chunk-node-ks0581vk.js → chunk-node-hj5m6mm7.js} +264 -100
- package/chunk-node-hj5m6mm7.js.map +32 -0
- package/edit-buffer.d.ts +2 -0
- package/editor-view.d.ts +9 -2
- package/image.d.ts +25 -1
- package/index.bun.js +121 -9
- package/index.bun.js.map +6 -6
- package/index.node.js +121 -9
- package/index.node.js.map +6 -6
- package/lib/selection.d.ts +4 -2
- package/package.json +9 -9
- package/post/effects.d.ts +2 -0
- package/renderables/EditBufferRenderable.d.ts +5 -1
- package/renderer.d.ts +23 -4
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/text-buffer-view.d.ts +5 -2
- package/text-buffer.d.ts +0 -1
- package/types.d.ts +11 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig-structs.d.ts +1 -0
- package/zig.d.ts +25 -6
- package/chunk-bun-da1keqyp.js.map +0 -32
- package/chunk-node-ks0581vk.js.map +0 -32
package/README.md
CHANGED
|
@@ -1,63 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Keep the project introduction aligned with the repository README and opentui.com. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://opentui.com">
|
|
5
|
+
<img alt="OpenTUI logo" src="https://opentui.com/opentui-logo-auto.svg" width="270" />
|
|
6
|
+
</a>
|
|
7
|
+
</p>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<div align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@opentui/core"><img alt="npm version" src="https://img.shields.io/npm/v/@opentui/core?style=flat-square" /></a>
|
|
11
|
+
<a href="https://github.com/anomalyco/opentui/actions/workflows/build-core.yml"><img alt="Core build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opentui/build-core.yml?style=flat-square&branch=main" /></a>
|
|
12
|
+
</div>
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
- [Development Guide](docs/development.md) - Building, testing, and contributing
|
|
9
|
-
- [Tree-Sitter](https://opentui.com/docs/reference/tree-sitter) - Syntax highlighting integration
|
|
10
|
-
- [Renderables](https://opentui.com/docs/core-concepts/renderables) - Understanding the component model
|
|
11
|
-
- [Environment Variables](https://opentui.com/docs/reference/env-vars) - Configuration options
|
|
14
|
+
OpenTUI is a library to build terminal user interfaces.
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
- It is written in Zig.
|
|
17
|
+
- You write TypeScript directly or through React and Solid.
|
|
18
|
+
- You arrange boxes and text with flexbox.
|
|
19
|
+
- You add selects, inputs, and scroll boxes with keyboard and mouse controls.
|
|
20
|
+
- You can play sounds, show images, and render 3D graphics.
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
bun install @opentui/core
|
|
17
|
-
```
|
|
22
|
+
OpenCode uses OpenTUI in production for millions of users.
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
[Website](https://opentui.com) | [Documentation](https://opentui.com/docs) | [Packages](https://opentui.com/packages)
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
bun run build
|
|
23
|
-
```
|
|
26
|
+
## OpenTUI Core
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
`@opentui/core` supplies the renderer and TypeScript API. You use imperative renderables and events directly. The
|
|
29
|
+
TypeScript packages call native Zig through an internal foreign function interface (FFI) boundary.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
```typescript
|
|
32
|
+
import { TextRenderable, createCliRenderer } from "@opentui/core"
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
bun run dev
|
|
34
|
+
const renderer = await createCliRenderer({ exitOnCtrlC: true })
|
|
35
|
+
|
|
36
|
+
renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
`exitOnCtrlC: true` calls `renderer.destroy()` when the user presses Ctrl+C. The code that creates the renderer must
|
|
40
|
+
call `renderer.destroy()` on every other shutdown path.
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
Install the package:
|
|
38
43
|
|
|
39
44
|
```bash
|
|
40
|
-
bun
|
|
45
|
+
bun add @opentui/core
|
|
41
46
|
```
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
Then build your first app with the [quickstart](https://opentui.com/docs/getting-started/quickstart).
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
## Runtime and platform support
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
`@opentui/core` runs on Bun 1.3.0 or later, or on Node.js 26.4.0 or later with ECMAScript modules (ESM) and
|
|
53
|
+
`--experimental-ffi`.
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
The native ABI and the generated platform packages, such as `@opentui/core-linux-x64`, are internal distribution
|
|
56
|
+
surfaces, not application APIs.
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
## AI agent skill
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
Install the OpenTUI documentation as a skill for your AI coding assistant with [`npx skills`](https://skills.sh):
|
|
54
61
|
|
|
55
|
-
```
|
|
56
|
-
|
|
62
|
+
```bash
|
|
63
|
+
npx skills add anomalyco/opentui --skill opentui
|
|
64
|
+
```
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
Add `-g` to install the skill globally.
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
## License
|
|
61
69
|
|
|
62
|
-
|
|
63
|
-
```
|
|
70
|
+
OpenTUI is licensed under the [MIT License](https://github.com/anomalyco/opentui/blob/main/LICENSE).
|