@opentui/react 0.0.0-20261004-7dad729e → 0.0.0-20261025-82f27220
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 +30 -27
- package/{chunk-8994r46h.js → chunk-98kz1xye.js} +26 -19
- package/index.js +1 -1
- package/package.json +2 -2
- package/scripts/runtime-plugin-support-configure.d.ts +2 -1
- package/scripts/runtime-plugin-support-configure.js +12 -0
- package/scripts/runtime-plugin-support-configure.js.map +1 -1
- package/src/components/error-boundary.d.ts +11 -11
- package/src/reconciler/reconciler.d.ts +1 -2
- package/test-utils.js +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @opentui/react
|
|
2
2
|
|
|
3
|
-
A React renderer for
|
|
3
|
+
A React renderer for [OpenTUI Core](https://github.com/anomalyco/opentui). Build terminal user interfaces with React components, hooks, and state.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ createRoot(renderer).render(<App />)
|
|
|
32
32
|
|
|
33
33
|
## TypeScript Configuration
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Configure your `tsconfig.json`:
|
|
36
36
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
|
@@ -56,7 +56,7 @@ For optimal TypeScript support, configure your `tsconfig.json`:
|
|
|
56
56
|
- [Styling](#styling)
|
|
57
57
|
- [API Reference](#api-reference)
|
|
58
58
|
- [createRoot(renderer)](#createrootrenderer)
|
|
59
|
-
- [render(element, config?)](#renderelement-config-
|
|
59
|
+
- [render(element, config?)](#renderelement-config-removed)
|
|
60
60
|
- [Hooks](#hooks)
|
|
61
61
|
- [useRenderer()](#userenderer)
|
|
62
62
|
- [useKeyboard(handler, options?)](#usekeyboardhandler-options)
|
|
@@ -93,7 +93,7 @@ For optimal TypeScript support, configure your `tsconfig.json`:
|
|
|
93
93
|
|
|
94
94
|
### Components
|
|
95
95
|
|
|
96
|
-
OpenTUI React
|
|
96
|
+
OpenTUI React includes these built-in components. Each component maps to an OpenTUI Core renderable:
|
|
97
97
|
|
|
98
98
|
**Layout & Display:**
|
|
99
99
|
|
|
@@ -102,13 +102,13 @@ OpenTUI React provides several built-in components that map to OpenTUI core rend
|
|
|
102
102
|
- **`<scrollbox>`** - A scrollable box
|
|
103
103
|
- **`<ascii-font>`** - Display ASCII art text with different font styles
|
|
104
104
|
|
|
105
|
-
QR
|
|
105
|
+
For QR codes, call `registerQRCode()` from `@opentui/qrcode/react`. It registers the `<qr-code>` element.
|
|
106
106
|
|
|
107
107
|
**Input Components:**
|
|
108
108
|
|
|
109
109
|
- **`<input>`** - Text input field
|
|
110
110
|
- **`<textarea>`** - Multi-line text input field
|
|
111
|
-
- **`<select>`** -
|
|
111
|
+
- **`<select>`** - Vertical list of options
|
|
112
112
|
- **`<tab-select>`** - Tab-based selection
|
|
113
113
|
|
|
114
114
|
**Code & Diff Components:**
|
|
@@ -119,11 +119,11 @@ QR code support is available from `@opentui/qrcode/react` and must be registered
|
|
|
119
119
|
|
|
120
120
|
**Helpers:**
|
|
121
121
|
|
|
122
|
-
- **`<span>`, `<strong>`, `<em>`, `<u>`, `<b>`, `<i>`, `<br>`** - Text modifiers (
|
|
122
|
+
- **`<span>`, `<strong>`, `<em>`, `<u>`, `<b>`, `<i>`, `<br>`, `<a>`** - Text modifiers (_use them only inside a `<text>` component_)
|
|
123
123
|
|
|
124
124
|
### Styling
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
Style a component with props or with the `style` prop:
|
|
127
127
|
|
|
128
128
|
```tsx
|
|
129
129
|
// Direct props
|
|
@@ -158,13 +158,12 @@ createRoot(renderer).render(<App />)
|
|
|
158
158
|
|
|
159
159
|
- `renderer`: A `CliRenderer` instance (typically created with `createCliRenderer()`)
|
|
160
160
|
|
|
161
|
-
**Returns:**
|
|
161
|
+
**Returns:** A root with a `render(node)` method and an `unmount()` method. `render(node)` accepts a React element.
|
|
162
|
+
`unmount()` removes the React tree and keeps the renderer active. `renderer.destroy()` also unmounts the root.
|
|
162
163
|
|
|
163
|
-
### `render(element, config?)` (
|
|
164
|
+
### `render(element, config?)` (Removed)
|
|
164
165
|
|
|
165
|
-
> **
|
|
166
|
-
|
|
167
|
-
Renders a React element to the terminal. This function is deprecated in favor of `createRoot`.
|
|
166
|
+
> **Removed:** `@opentui/react` does not export `render()`. Use `createRoot(renderer).render(node)` instead.
|
|
168
167
|
|
|
169
168
|
### Hooks
|
|
170
169
|
|
|
@@ -174,6 +173,7 @@ Access the OpenTUI renderer instance.
|
|
|
174
173
|
|
|
175
174
|
```tsx
|
|
176
175
|
import { useRenderer } from "@opentui/react"
|
|
176
|
+
import { useEffect } from "react"
|
|
177
177
|
|
|
178
178
|
function App() {
|
|
179
179
|
const renderer = useRenderer()
|
|
@@ -211,7 +211,7 @@ function App() {
|
|
|
211
211
|
- `options?`: Optional configuration object:
|
|
212
212
|
- `release?`: Boolean to include key release events (default: `false`)
|
|
213
213
|
|
|
214
|
-
By default,
|
|
214
|
+
By default, the handler gets press events only. Press events include key repeats with `repeated: true`. Set `options.release` to `true` to also get release events.
|
|
215
215
|
|
|
216
216
|
**Example with release events:**
|
|
217
217
|
|
|
@@ -269,7 +269,7 @@ function App() {
|
|
|
269
269
|
|
|
270
270
|
#### `useFocus(handler)`
|
|
271
271
|
|
|
272
|
-
Subscribe to terminal window focus events.
|
|
272
|
+
Subscribe to terminal window focus events. The handler runs when the terminal window gains focus.
|
|
273
273
|
|
|
274
274
|
```tsx
|
|
275
275
|
import { useFocus } from "@opentui/react"
|
|
@@ -289,7 +289,7 @@ function App() {
|
|
|
289
289
|
|
|
290
290
|
#### `useBlur(handler)`
|
|
291
291
|
|
|
292
|
-
Subscribe to terminal window blur events.
|
|
292
|
+
Subscribe to terminal window blur events. The handler runs when the terminal window loses focus.
|
|
293
293
|
|
|
294
294
|
```tsx
|
|
295
295
|
import { useBlur } from "@opentui/react"
|
|
@@ -309,7 +309,7 @@ function App() {
|
|
|
309
309
|
|
|
310
310
|
#### `useSelectionHandler(handler)`
|
|
311
311
|
|
|
312
|
-
Handle text selection events
|
|
312
|
+
Handle text selection events, such as a mouse drag selection.
|
|
313
313
|
|
|
314
314
|
```tsx
|
|
315
315
|
import { useSelectionHandler } from "@opentui/react"
|
|
@@ -353,7 +353,7 @@ function App() {
|
|
|
353
353
|
|
|
354
354
|
#### `useTerminalDimensions()`
|
|
355
355
|
|
|
356
|
-
Get current terminal dimensions
|
|
356
|
+
Get the current terminal dimensions. The hook updates them when the terminal resizes.
|
|
357
357
|
|
|
358
358
|
```tsx
|
|
359
359
|
import { useTerminalDimensions } from "@opentui/react"
|
|
@@ -378,7 +378,7 @@ function App() {
|
|
|
378
378
|
|
|
379
379
|
#### `useTimeline(options?)`
|
|
380
380
|
|
|
381
|
-
Create
|
|
381
|
+
Create one `Timeline` for animations. The hook registers the timeline with the animation engine after mount. It pauses and unregisters the timeline during React effect cleanup.
|
|
382
382
|
|
|
383
383
|
```tsx
|
|
384
384
|
import { useTimeline } from "@opentui/react"
|
|
@@ -418,8 +418,8 @@ function App() {
|
|
|
418
418
|
- `duration?`: Animation duration in milliseconds (default: 1000)
|
|
419
419
|
- `loop?`: Whether the timeline should loop (default: false)
|
|
420
420
|
- `autoplay?`: Whether to automatically start the timeline (default: true)
|
|
421
|
-
- `onComplete?`: Callback when timeline completes
|
|
422
|
-
- `onPause?`: Callback when timeline
|
|
421
|
+
- `onComplete?`: Callback when the timeline completes
|
|
422
|
+
- `onPause?`: Callback when the timeline pauses
|
|
423
423
|
|
|
424
424
|
**Returns:** A `Timeline` instance with methods:
|
|
425
425
|
|
|
@@ -649,7 +649,7 @@ function App() {
|
|
|
649
649
|
|
|
650
650
|
#### Select Component
|
|
651
651
|
|
|
652
|
-
|
|
652
|
+
Choose one option from a vertical list.
|
|
653
653
|
|
|
654
654
|
```tsx
|
|
655
655
|
import type { SelectOption } from "@opentui/core"
|
|
@@ -684,7 +684,7 @@ function App() {
|
|
|
684
684
|
|
|
685
685
|
#### Code Component
|
|
686
686
|
|
|
687
|
-
Create a theme once for its renderer, not during a component render. Release it after its consumers
|
|
687
|
+
Create a theme once for its renderer, not during a component render. Release it after you destroy its consumers.
|
|
688
688
|
|
|
689
689
|
```tsx
|
|
690
690
|
import { createCliRenderer, RGBA, SyntaxStyle } from "@opentui/core"
|
|
@@ -799,7 +799,7 @@ For a more complete example with interactive diff highlights and diagnostics, se
|
|
|
799
799
|
|
|
800
800
|
#### Diff Component
|
|
801
801
|
|
|
802
|
-
Display unified or split
|
|
802
|
+
Display a unified or split diff with syntax highlighting, line numbers, word wrapping, and custom colors.
|
|
803
803
|
|
|
804
804
|
For a complete interactive example with theme switching and keybindings, see [`examples/diff.tsx`](examples/diff.tsx).
|
|
805
805
|
|
|
@@ -1020,7 +1020,10 @@ createRoot(renderer).render(<App />)
|
|
|
1020
1020
|
|
|
1021
1021
|
## Component Extension
|
|
1022
1022
|
|
|
1023
|
-
|
|
1023
|
+
To create a custom component, extend an OpenTUI Core renderable class and register it with `extend()`.
|
|
1024
|
+
React calls the constructor with `{ id, ...props }`. After construction, React assigns the props to the instance again.
|
|
1025
|
+
This example overrides the `renderSelf()` [paint hook](https://opentui.com/docs/extend/custom-renderables#use-paint-hooks). The hook uses screen cell coordinates, so it places the label
|
|
1026
|
+
relative to `this.x` and `this.y`:
|
|
1024
1027
|
|
|
1025
1028
|
```tsx
|
|
1026
1029
|
import {
|
|
@@ -1111,8 +1114,8 @@ npx react-devtools@7
|
|
|
1111
1114
|
DEV=true bun run your-app.ts
|
|
1112
1115
|
```
|
|
1113
1116
|
|
|
1114
|
-
After the app starts,
|
|
1117
|
+
After the app starts, React DevTools shows the component tree. You can inspect and change props while the app runs. The terminal UI shows each change.
|
|
1115
1118
|
|
|
1116
1119
|
### Process Exit with DevTools
|
|
1117
1120
|
|
|
1118
|
-
When DevTools is connected, the WebSocket connection
|
|
1121
|
+
When DevTools is connected, the WebSocket connection can keep your process from exiting on its own.
|
|
@@ -134,15 +134,15 @@ import { Fragment, jsxDEV } from "react/jsx-dev-runtime";
|
|
|
134
134
|
|
|
135
135
|
// src/components/error-boundary.tsx
|
|
136
136
|
class ErrorBoundary extends React.Component {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
state = { error: null };
|
|
138
|
+
static getDerivedStateFromProps(props, state) {
|
|
139
|
+
return props.resetKey === state.resetKey ? null : { error: null, resetKey: props.resetKey };
|
|
140
140
|
}
|
|
141
141
|
static getDerivedStateFromError(error) {
|
|
142
|
-
return {
|
|
142
|
+
return { error };
|
|
143
143
|
}
|
|
144
144
|
render() {
|
|
145
|
-
if (this.state.
|
|
145
|
+
if (this.state.error) {
|
|
146
146
|
return /* @__PURE__ */ jsxDEV("box", {
|
|
147
147
|
style: { flexDirection: "column", padding: 2 },
|
|
148
148
|
children: /* @__PURE__ */ jsxDEV("text", {
|
|
@@ -164,7 +164,7 @@ import { ImageRenderable as ImageRenderable2, TextNodeRenderable as TextNodeRend
|
|
|
164
164
|
// package.json
|
|
165
165
|
var package_default = {
|
|
166
166
|
name: "@opentui/react",
|
|
167
|
-
version: "0.0.0-
|
|
167
|
+
version: "0.0.0-20261025-82f27220",
|
|
168
168
|
description: "React renderer for building terminal user interfaces using OpenTUI core",
|
|
169
169
|
license: "MIT",
|
|
170
170
|
repository: {
|
|
@@ -565,10 +565,8 @@ $ bun add react-devtools-core@7 -d
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
reconciler.injectIntoDevTools();
|
|
568
|
-
function
|
|
569
|
-
|
|
570
|
-
reconciler.updateContainer(element, container, null, () => {});
|
|
571
|
-
return container;
|
|
568
|
+
function createContainer(root) {
|
|
569
|
+
return reconciler.createContainer(root, ConcurrentRoot, null, false, null, "", console.error, console.error, console.error, () => {});
|
|
572
570
|
}
|
|
573
571
|
|
|
574
572
|
// src/reconciler/renderer.ts
|
|
@@ -577,19 +575,28 @@ var flushSync2 = _r.flushSyncFromReconciler ?? _r.flushSync;
|
|
|
577
575
|
var { createPortal: createPortal2 } = reconciler;
|
|
578
576
|
function createRoot2(renderer) {
|
|
579
577
|
let container = null;
|
|
578
|
+
let renderVersion = 0;
|
|
579
|
+
const appContext = { keyHandler: renderer.keyInput, renderer };
|
|
580
580
|
const cleanup = () => {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
581
|
+
const current = container;
|
|
582
|
+
if (!current)
|
|
583
|
+
return;
|
|
584
|
+
container = null;
|
|
585
|
+
renderer.off(CliRenderEvents.DESTROY, cleanup);
|
|
586
|
+
reconciler.updateContainerSync(null, current, null, () => {});
|
|
587
|
+
reconciler.flushSyncWork();
|
|
586
588
|
};
|
|
587
|
-
renderer.once(CliRenderEvents.DESTROY, cleanup);
|
|
588
589
|
return {
|
|
589
590
|
render: (node) => {
|
|
590
|
-
if (
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
if (renderer.isDestroyed)
|
|
592
|
+
return;
|
|
593
|
+
engine.attach(renderer);
|
|
594
|
+
if (!container) {
|
|
595
|
+
container = createContainer(renderer.root);
|
|
596
|
+
renderer.once(CliRenderEvents.DESTROY, cleanup);
|
|
597
|
+
}
|
|
598
|
+
const element = React2.createElement(AppContext2.Provider, { value: appContext }, React2.createElement(ErrorBoundary, { resetKey: ++renderVersion, children: node }));
|
|
599
|
+
reconciler.updateContainer(element, container, null, () => {});
|
|
593
600
|
},
|
|
594
601
|
unmount: cleanup
|
|
595
602
|
};
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.0.0-
|
|
7
|
+
"version": "0.0.0-20261025-82f27220",
|
|
8
8
|
"description": "React renderer for building terminal user interfaces using OpenTUI core",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@opentui/core": "0.0.0-
|
|
55
|
+
"@opentui/core": "0.0.0-20261025-82f27220",
|
|
56
56
|
"react-reconciler": "^0.33.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type RuntimeModuleEntry, type RuntimePluginRewriteOptions } from "@opentui/core/runtime-plugin";
|
|
1
|
+
import { type RuntimeModuleEntry, type RuntimePluginRewriteOptions, type RuntimeSpecifierPreserve } from "@opentui/core/runtime-plugin";
|
|
2
2
|
export interface ReactRuntimePluginSupportOptions {
|
|
3
3
|
additional?: Record<string, RuntimeModuleEntry>;
|
|
4
4
|
core?: RuntimeModuleEntry;
|
|
5
|
+
preserve?: RuntimeSpecifierPreserve;
|
|
5
6
|
rewrite?: RuntimePluginRewriteOptions;
|
|
6
7
|
}
|
|
7
8
|
export declare function ensureRuntimePluginSupport(options?: ReactRuntimePluginSupportOptions): boolean;
|
|
@@ -17,6 +17,13 @@ const defaultRuntimeModules = {
|
|
|
17
17
|
function normalizeRewriteKey(rewrite) {
|
|
18
18
|
return `${rewrite?.nodeModulesRuntimeSpecifiers ?? true}:${rewrite?.nodeModulesBareSpecifiers ?? false}`;
|
|
19
19
|
}
|
|
20
|
+
function normalizePreserveKey(preserve) {
|
|
21
|
+
if (preserve === undefined || typeof preserve === "function") {
|
|
22
|
+
return preserve;
|
|
23
|
+
}
|
|
24
|
+
const specifiers = [...new Set(preserve)].sort();
|
|
25
|
+
return specifiers.length > 0 ? JSON.stringify(specifiers) : undefined;
|
|
26
|
+
}
|
|
20
27
|
function createRuntimeModules(options) {
|
|
21
28
|
return {
|
|
22
29
|
...defaultRuntimeModules,
|
|
@@ -32,6 +39,9 @@ function assertCompatibleInstall(install, modules, options) {
|
|
|
32
39
|
if (options?.core && options.core !== install.core) {
|
|
33
40
|
throw new Error("OpenTUI React runtime plugin support is already installed with a different core runtime module.");
|
|
34
41
|
}
|
|
42
|
+
if (options?.preserve && normalizePreserveKey(options.preserve) !== install.preserveKey) {
|
|
43
|
+
throw new Error("OpenTUI React runtime plugin support is already installed with different preserve options.");
|
|
44
|
+
}
|
|
35
45
|
if (options?.rewrite && normalizeRewriteKey(options.rewrite) !== install.rewriteKey) {
|
|
36
46
|
throw new Error("OpenTUI React runtime plugin support is already installed with different rewrite options.");
|
|
37
47
|
}
|
|
@@ -49,11 +59,13 @@ export function ensureRuntimePluginSupport(options = {}) {
|
|
|
49
59
|
registerBunPlugin(createRuntimePlugin({
|
|
50
60
|
core,
|
|
51
61
|
additional: modules,
|
|
62
|
+
preserve: options.preserve,
|
|
52
63
|
rewrite: options.rewrite,
|
|
53
64
|
}));
|
|
54
65
|
state[runtimePluginSupportInstalledKey] = {
|
|
55
66
|
specifiers: new Set(Object.keys(modules)),
|
|
56
67
|
core,
|
|
68
|
+
preserveKey: normalizePreserveKey(options.preserve),
|
|
57
69
|
rewriteKey,
|
|
58
70
|
};
|
|
59
71
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-plugin-support-configure.js","sourceRoot":"","sources":["runtime-plugin-support-configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,KAAK,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"runtime-plugin-support-configure.js","sourceRoot":"","sources":["runtime-plugin-support-configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,KAAK,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,EACL,mBAAmB,GAIpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,YAAY,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,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,CAAC,GAAG;QACxC,UAAU,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI;QACJ,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnD,UAAU;KACX,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
type ErrorBoundaryProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
resetKey: number;
|
|
5
|
+
};
|
|
6
|
+
type ErrorBoundaryState = {
|
|
6
7
|
error: Error | null;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
error: Error;
|
|
14
|
-
};
|
|
8
|
+
resetKey?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
11
|
+
state: ErrorBoundaryState;
|
|
12
|
+
static getDerivedStateFromProps(props: ErrorBoundaryProps, state: ErrorBoundaryState): ErrorBoundaryState | null;
|
|
13
|
+
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
15
14
|
render(): any;
|
|
16
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { RootRenderable } from "@opentui/core";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import ReactReconciler from "react-reconciler";
|
|
4
3
|
export declare const reconciler: ReactReconciler.Reconciler<RootRenderable, import("@opentui/core").BaseRenderable, import("@opentui/core").TextNodeRenderable, unknown, unknown, import("@opentui/core").BaseRenderable>;
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function createContainer(root: RootRenderable): any;
|