@opentui/react 0.0.0-20260310-a34fbfd3 → 0.0.0-20260312-4e5c6783

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.
@@ -166,7 +166,7 @@ import { TextNodeRenderable as TextNodeRenderable2 } from "@opentui/core";
166
166
  // package.json
167
167
  var package_default = {
168
168
  name: "@opentui/react",
169
- version: "0.0.0-20260310-a34fbfd3",
169
+ version: "0.0.0-20260312-4e5c6783",
170
170
  description: "React renderer for building terminal user interfaces using OpenTUI core",
171
171
  license: "MIT",
172
172
  repository: {
@@ -187,6 +187,10 @@ var package_default = {
187
187
  import: "./src/test-utils.ts",
188
188
  types: "./src/test-utils.d.ts"
189
189
  },
190
+ "./runtime-plugin-support": {
191
+ import: "./scripts/runtime-plugin-support.ts",
192
+ types: "./scripts/runtime-plugin-support.ts"
193
+ },
190
194
  "./jsx-runtime": {
191
195
  import: "./jsx-runtime.js",
192
196
  types: "./jsx-runtime.d.ts"
@@ -198,6 +202,7 @@ var package_default = {
198
202
  },
199
203
  scripts: {
200
204
  build: "bun run scripts/build.ts",
205
+ "build:examples": "bun examples/build.ts",
201
206
  "build:dev": "bun run scripts/build.ts --dev",
202
207
  publish: "bun run scripts/publish.ts",
203
208
  test: "bun test"
package/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  getComponentCatalogue,
12
12
  jsxDEV,
13
13
  useAppContext
14
- } from "./chunk-hewmhgmm.js";
14
+ } from "./chunk-75rfz2d8.js";
15
15
  import"./chunk-2mx7fq49.js";
16
16
  // src/hooks/use-keyboard.ts
17
17
  import { useEffect } from "react";
@@ -17,7 +17,7 @@ import type {
17
17
  TabSelectProps,
18
18
  TextareaProps,
19
19
  TextProps,
20
- } from "./src/types/components"
20
+ } from "./src/types/components.js"
21
21
 
22
22
  export namespace JSX {
23
23
  type Element = React.ReactNode
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-20260310-a34fbfd3",
7
+ "version": "0.0.0-20260312-4e5c6783",
8
8
  "description": "React renderer for building terminal user interfaces using OpenTUI core",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -28,6 +28,10 @@
28
28
  "import": "./test-utils.js",
29
29
  "require": "./test-utils.js"
30
30
  },
31
+ "./runtime-plugin-support": {
32
+ "types": "./scripts/runtime-plugin-support.d.ts",
33
+ "import": "./scripts/runtime-plugin-support.ts"
34
+ },
31
35
  "./jsx-runtime": {
32
36
  "types": "./jsx-runtime.d.ts",
33
37
  "import": "./jsx-runtime.js",
@@ -40,7 +44,7 @@
40
44
  }
41
45
  },
42
46
  "dependencies": {
43
- "@opentui/core": "0.0.0-20260310-a34fbfd3",
47
+ "@opentui/core": "0.0.0-20260312-4e5c6783",
44
48
  "react-reconciler": "^0.32.0"
45
49
  },
46
50
  "devDependencies": {
@@ -0,0 +1 @@
1
+ export declare function ensureRuntimePluginSupport(): boolean;
@@ -0,0 +1,42 @@
1
+ import { plugin as registerBunPlugin } from "bun"
2
+ import * as coreRuntime from "@opentui/core"
3
+ import { createRuntimePlugin, type RuntimeModuleEntry } from "@opentui/core/runtime-plugin"
4
+ import * as reactRuntime from "react"
5
+ import * as reactJsxRuntime from "react/jsx-runtime"
6
+ import * as reactJsxDevRuntime from "react/jsx-dev-runtime"
7
+ import * as opentuiReactRuntime from "../src/index"
8
+
9
+ const runtimePluginSupportInstalledKey = "__opentuiReactRuntimePluginSupportInstalled__"
10
+
11
+ type RuntimePluginSupportState = typeof globalThis & {
12
+ [runtimePluginSupportInstalledKey]?: boolean
13
+ }
14
+
15
+ const additionalRuntimeModules: Record<string, RuntimeModuleEntry> = {
16
+ "@opentui/react": opentuiReactRuntime as Record<string, unknown>,
17
+ "@opentui/react/jsx-runtime": reactJsxRuntime as Record<string, unknown>,
18
+ "@opentui/react/jsx-dev-runtime": reactJsxDevRuntime as Record<string, unknown>,
19
+ react: reactRuntime as Record<string, unknown>,
20
+ "react/jsx-runtime": reactJsxRuntime as Record<string, unknown>,
21
+ "react/jsx-dev-runtime": reactJsxDevRuntime as Record<string, unknown>,
22
+ }
23
+
24
+ export function ensureRuntimePluginSupport(): boolean {
25
+ const state = globalThis as RuntimePluginSupportState
26
+
27
+ if (state[runtimePluginSupportInstalledKey]) {
28
+ return false
29
+ }
30
+
31
+ registerBunPlugin(
32
+ createRuntimePlugin({
33
+ core: coreRuntime as Record<string, unknown>,
34
+ additional: additionalRuntimeModules,
35
+ }),
36
+ )
37
+
38
+ state[runtimePluginSupportInstalledKey] = true
39
+ return true
40
+ }
41
+
42
+ ensureRuntimePluginSupport()
@@ -1,6 +1,6 @@
1
1
  import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, DiffRenderable, InputRenderable, LineNumberRenderable, MarkdownRenderable, ScrollBoxRenderable, SelectRenderable, TabSelectRenderable, TextareaRenderable, TextRenderable } from "@opentui/core";
2
- import type { RenderableConstructor } from "../types/components";
3
- import { BoldSpanRenderable, ItalicSpanRenderable, LineBreakRenderable, LinkRenderable, SpanRenderable, UnderlineSpanRenderable } from "./text";
2
+ import type { RenderableConstructor } from "../types/components.js";
3
+ import { BoldSpanRenderable, ItalicSpanRenderable, LineBreakRenderable, LinkRenderable, SpanRenderable, UnderlineSpanRenderable } from "./text.js";
4
4
  export declare const baseComponents: {
5
5
  box: typeof BoxRenderable;
6
6
  text: typeof TextRenderable;
@@ -39,4 +39,4 @@ export declare const componentCatalogue: ComponentCatalogue;
39
39
  */
40
40
  export declare function extend<T extends ComponentCatalogue>(objects: T): void;
41
41
  export declare function getComponentCatalogue(): ComponentCatalogue;
42
- export type { ExtendedComponentProps, ExtendedIntrinsicElements, RenderableConstructor } from "../types/components";
42
+ export type { ExtendedComponentProps, ExtendedIntrinsicElements, RenderableConstructor } from "../types/components.js";
@@ -1,5 +1,5 @@
1
- export * from "./use-keyboard";
2
- export * from "./use-renderer";
3
- export * from "./use-resize";
4
- export * from "./use-terminal-dimensions";
5
- export * from "./use-timeline";
1
+ export * from "./use-keyboard.js";
2
+ export * from "./use-renderer.js";
3
+ export * from "./use-resize.js";
4
+ export * from "./use-terminal-dimensions.js";
5
+ export * from "./use-timeline.js";
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./components";
2
- export * from "./components/app";
3
- export * from "./hooks";
4
- export * from "./plugins/slot";
5
- export * from "./reconciler/renderer";
6
- export * from "./time-to-first-draw";
7
- export * from "./types/components";
1
+ export * from "./components/index.js";
2
+ export * from "./components/app.js";
3
+ export * from "./hooks/index.js";
4
+ export * from "./plugins/slot.js";
5
+ export * from "./reconciler/renderer.js";
6
+ export * from "./time-to-first-draw.js";
7
+ export * from "./types/components.js";
8
8
  export { createElement } from "react";
@@ -1,5 +1,5 @@
1
1
  import type { HostConfig } from "react-reconciler";
2
- import type { Container, HostContext, Instance, Props, PublicInstance, TextInstance, Type } from "../types/host";
2
+ import type { Container, HostContext, Instance, Props, PublicInstance, TextInstance, Type } from "../types/host.js";
3
3
  export declare const hostConfig: HostConfig<Type, Props, Container, Instance, TextInstance, unknown, // SuspenseInstance
4
4
  unknown, // HydratableInstance
5
5
  unknown, // FormInstance
@@ -1,5 +1,5 @@
1
1
  import type { BaseRenderable, RootRenderable, TextNodeRenderable } from "@opentui/core";
2
- import { baseComponents } from "../components";
2
+ import { baseComponents } from "../components/index.js";
3
3
  export type Type = keyof typeof baseComponents;
4
4
  export type Props = Record<string, any>;
5
5
  export type Container = RootRenderable;
package/src/utils/id.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Type } from "../types/host";
1
+ import type { Type } from "../types/host.js";
2
2
  export declare function getNextId(type: Type): string;
@@ -1,3 +1,3 @@
1
- import type { Instance, Props, Type } from "../types/host";
1
+ import type { Instance, Props, Type } from "../types/host.js";
2
2
  export declare function setInitialProperties(instance: Instance, type: Type, props: Props): void;
3
3
  export declare function updateProperties(instance: Instance, type: Type, oldProps: Props, newProps: Props): void;
package/test-utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createRoot
4
- } from "./chunk-hewmhgmm.js";
4
+ } from "./chunk-75rfz2d8.js";
5
5
  import"./chunk-2mx7fq49.js";
6
6
 
7
7
  // src/test-utils.ts