@opentui/solid 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
@@ -7,6 +7,7 @@ import {
7
7
  ASCIIFontRenderable,
8
8
  BoxRenderable,
9
9
  InputRenderable,
10
+ ScrollBoxRenderable,
10
11
  SelectRenderable,
11
12
  TabSelectRenderable,
12
13
  TextRenderable
@@ -44,7 +45,7 @@ var useTerminalDimensions = () => {
44
45
  onResize(callback);
45
46
  return terminalDimensions;
46
47
  };
47
- var useKeyHandler = (callback) => {
48
+ var useKeyboard = (callback) => {
48
49
  const keyHandler = getKeyHandler();
49
50
  onMount(() => {
50
51
  keyHandler.on("keypress", callback);
@@ -53,6 +54,7 @@ var useKeyHandler = (callback) => {
53
54
  keyHandler.off("keypress", callback);
54
55
  });
55
56
  };
57
+ var useKeyHandler = useKeyboard;
56
58
  var useSelectionHandler = (callback) => {
57
59
  const renderer = useRenderer();
58
60
  onMount(() => {
@@ -99,7 +101,8 @@ var baseComponents = {
99
101
  input: InputRenderable,
100
102
  select: SelectRenderable,
101
103
  ascii_font: ASCIIFontRenderable,
102
- tab_select: TabSelectRenderable
104
+ tab_select: TabSelectRenderable,
105
+ scrollbox: ScrollBoxRenderable
103
106
  };
104
107
  var componentCatalogue = { ...baseComponents };
105
108
  function extend(objects) {
@@ -583,6 +586,7 @@ export {
583
586
  useTerminalDimensions,
584
587
  useSelectionHandler,
585
588
  useRenderer,
589
+ useKeyboard,
586
590
  useKeyHandler,
587
591
  use,
588
592
  spread,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.1.14",
7
+ "version": "0.1.15",
8
8
  "description": "SolidJS renderer for OpenTUI",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "./jsx-dev-runtime": "./jsx-runtime.d.ts"
26
26
  },
27
27
  "dependencies": {
28
- "@opentui/core": "0.1.14",
28
+ "@opentui/core": "0.1.15",
29
29
  "babel-plugin-module-resolver": "5.0.2",
30
30
  "@babel/core": "7.28.0",
31
31
  "@babel/preset-typescript": "7.27.1",
@@ -6,6 +6,10 @@ export declare const useTerminalDimensions: () => import("solid-js").Accessor<{
6
6
  width: number;
7
7
  height: number;
8
8
  }>;
9
+ export declare const useKeyboard: (callback: (key: ParsedKey) => void) => void;
10
+ /**
11
+ * @deprecated renamed to useKeyboard
12
+ */
9
13
  export declare const useKeyHandler: (callback: (key: ParsedKey) => void) => void;
10
14
  export declare const useSelectionHandler: (callback: (selection: Selection) => void) => void;
11
15
  export declare const createComponentTimeline: (options?: TimelineOptions) => Timeline;
@@ -1,4 +1,4 @@
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/elements";
3
3
  export * from "./hooks";
4
4
  export declare const baseComponents: {
@@ -8,6 +8,7 @@ export declare const baseComponents: {
8
8
  select: typeof SelectRenderable;
9
9
  ascii_font: typeof ASCIIFontRenderable;
10
10
  tab_select: typeof TabSelectRenderable;
11
+ scrollbox: typeof ScrollBoxRenderable;
11
12
  };
12
13
  type ComponentCatalogue = Record<string, RenderableConstructor>;
13
14
  export declare const componentCatalogue: ComponentCatalogue;
@@ -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 { JSX, Ref } from "solid-js";
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}`;
@@ -45,6 +45,9 @@ export type TabSelectProps = ComponentProps<TabSelectRenderableOptions, TabSelec
45
45
  onChange?: (index: number, option: TabSelectOption | null) => void;
46
46
  onSelect?: (index: number, option: TabSelectOption | null) => void;
47
47
  };
48
+ export type ScrollBoxProps = ComponentProps<ContainerProps<ScrollBoxOptions>, ScrollBoxRenderable> & {
49
+ focused?: boolean;
50
+ };
48
51
  /** Convert renderable constructor to component props with proper style exclusions */
49
52
  export type ExtendedComponentProps<TConstructor extends RenderableConstructor, TOptions = ExtractRenderableOptions<TConstructor>> = TOptions & {
50
53
  children?: JSX.Element;