@opentui/react 0.1.14 → 0.1.15

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/index.js CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  ASCIIFontRenderable,
5
5
  BoxRenderable,
6
6
  InputRenderable,
7
+ ScrollBoxRenderable,
7
8
  SelectRenderable,
8
9
  TabSelectRenderable,
9
10
  TextRenderable
@@ -13,6 +14,7 @@ var baseComponents = {
13
14
  text: TextRenderable,
14
15
  input: InputRenderable,
15
16
  select: SelectRenderable,
17
+ scrollbox: ScrollBoxRenderable,
16
18
  "ascii-font": ASCIIFontRenderable,
17
19
  "tab-select": TabSelectRenderable
18
20
  };
@@ -282,7 +284,10 @@ var hostConfig = {
282
284
  if (!components[type]) {
283
285
  throw new Error(`[Reconciler] Unknown component type: ${type}`);
284
286
  }
285
- return new components[type](rootContainerInstance.ctx, {});
287
+ return new components[type](rootContainerInstance.ctx, {
288
+ id,
289
+ ...props
290
+ });
286
291
  },
287
292
  appendChild(parent, child) {
288
293
  parent.add(child);
@@ -2,12 +2,14 @@ import type * as React from "react"
2
2
  import type {
3
3
  AsciiFontProps,
4
4
  BoxProps,
5
+ ExtendedIntrinsicElements,
5
6
  InputProps,
7
+ OpenTUIComponents,
8
+ ScrollBoxProps,
6
9
  SelectProps,
7
10
  TabSelectProps,
8
11
  TextProps,
9
12
  } from "./src/types/components"
10
- import type { ExtendedIntrinsicElements, OpenTUIComponents } from "./src/types/components"
11
13
 
12
14
  export namespace JSX {
13
15
  type Element = React.ReactNode
@@ -29,6 +31,7 @@ export namespace JSX {
29
31
  text: TextProps
30
32
  input: InputProps
31
33
  select: SelectProps
34
+ scrollbox: ScrollBoxProps
32
35
  "ascii-font": AsciiFontProps
33
36
  "tab-select": TabSelectProps
34
37
  }
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.1.14",
7
+ "version": "0.1.15",
8
8
  "description": "React renderer for building terminal user interfaces using OpenTUI core",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -35,7 +35,7 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@opentui/core": "0.1.14",
38
+ "@opentui/core": "0.1.15",
39
39
  "react-reconciler": "^0.32.0"
40
40
  },
41
41
  "devDependencies": {
@@ -1,10 +1,11 @@
1
- import { ASCIIFontRenderable, BoxRenderable, InputRenderable, SelectRenderable, TabSelectRenderable, TextRenderable } from "@opentui/core";
1
+ import { ASCIIFontRenderable, BoxRenderable, InputRenderable, ScrollBoxRenderable, SelectRenderable, TabSelectRenderable, TextRenderable } from "@opentui/core";
2
2
  import type { RenderableConstructor } from "../types/components";
3
3
  export declare const baseComponents: {
4
4
  box: typeof BoxRenderable;
5
5
  text: typeof TextRenderable;
6
6
  input: typeof InputRenderable;
7
7
  select: typeof SelectRenderable;
8
+ scrollbox: typeof ScrollBoxRenderable;
8
9
  "ascii-font": typeof ASCIIFontRenderable;
9
10
  "tab-select": typeof TabSelectRenderable;
10
11
  };
@@ -23,6 +23,7 @@ import {
23
23
  ASCIIFontRenderable,
24
24
  BoxRenderable,
25
25
  InputRenderable,
26
+ ScrollBoxRenderable,
26
27
  SelectRenderable,
27
28
  TabSelectRenderable,
28
29
  TextRenderable
@@ -32,6 +33,7 @@ var baseComponents = {
32
33
  text: TextRenderable,
33
34
  input: InputRenderable,
34
35
  select: SelectRenderable,
36
+ scrollbox: ScrollBoxRenderable,
35
37
  "ascii-font": ASCIIFontRenderable,
36
38
  "tab-select": TabSelectRenderable
37
39
  };
@@ -217,7 +219,10 @@ var hostConfig = {
217
219
  if (!components[type]) {
218
220
  throw new Error(`[Reconciler] Unknown component type: ${type}`);
219
221
  }
220
- return new components[type](rootContainerInstance.ctx, {});
222
+ return new components[type](rootContainerInstance.ctx, {
223
+ id,
224
+ ...props
225
+ });
221
226
  },
222
227
  appendChild(parent, child) {
223
228
  parent.add(child);
@@ -1,4 +1,4 @@
1
- import type { ASCIIFontOptions, ASCIIFontRenderable, BoxOptions, BoxRenderable, InputRenderable, InputRenderableOptions, Renderable, RenderableOptions, RenderContext, SelectOption, SelectRenderable, SelectRenderableOptions, StyledText, TabSelectOption, TabSelectRenderable, TabSelectRenderableOptions, TextChunk, TextOptions, TextRenderable } from "@opentui/core";
1
+ import type { ASCIIFontOptions, ASCIIFontRenderable, BoxOptions, BoxRenderable, InputRenderable, InputRenderableOptions, Renderable, RenderableOptions, RenderContext, ScrollBoxOptions, ScrollBoxRenderable, SelectOption, SelectRenderable, SelectRenderableOptions, StyledText, TabSelectOption, TabSelectRenderable, TabSelectRenderableOptions, TextChunk, TextOptions, TextRenderable } from "@opentui/core";
2
2
  import type React from "react";
3
3
  /** Properties that should not be included in the style prop */
4
4
  export type NonStyledProps = "id" | "buffered" | "live" | "enableLayout" | "selectable" | "renderAfter" | "renderBefore" | `on${string}`;
@@ -40,6 +40,9 @@ export type SelectProps = ComponentProps<SelectRenderableOptions, SelectRenderab
40
40
  onChange?: (index: number, option: SelectOption | null) => void;
41
41
  onSelect?: (index: number, option: SelectOption | null) => void;
42
42
  };
43
+ export type ScrollBoxProps = ComponentProps<ContainerProps<ScrollBoxOptions>, ScrollBoxRenderable> & {
44
+ focused?: boolean;
45
+ };
43
46
  export type AsciiFontProps = ComponentProps<ASCIIFontOptions, ASCIIFontRenderable>;
44
47
  export type TabSelectProps = ComponentProps<TabSelectRenderableOptions, TabSelectRenderable> & {
45
48
  focused?: boolean;