@opentui/solid 0.0.0-20251128-0889a764 → 0.0.0-20251201-fe4cc80e

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/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@ export function useTerminalDimensions(): import("solid-js").Accessor<{
6
6
  export function useSelectionHandler(callback: any): void;
7
7
  export function useRenderer(): any;
8
8
  export function usePaste(callback: any): void;
9
- export function useKeyboard(callback: any): void;
10
- export function useKeyHandler(callback: any): void;
9
+ export function useKeyboard(callback: any, options: any): void;
10
+ export function useKeyHandler(callback: any, options: any): void;
11
11
  export function use(fn: any, element: any, arg: any): any;
12
12
  export var textNodeKeys: string[];
13
13
  export function testRender(node: any, renderConfig?: {}): Promise<{
package/index.js CHANGED
@@ -52,14 +52,20 @@ var useTerminalDimensions = () => {
52
52
  onResize(callback);
53
53
  return terminalDimensions;
54
54
  };
55
- var useKeyboard = (callback) => {
55
+ var useKeyboard = (callback, options) => {
56
56
  const renderer = useRenderer();
57
57
  const keyHandler = renderer.keyInput;
58
58
  onMount(() => {
59
59
  keyHandler.on("keypress", callback);
60
+ if (options?.release) {
61
+ keyHandler.on("keyrelease", callback);
62
+ }
60
63
  });
61
64
  onCleanup(() => {
62
65
  keyHandler.off("keypress", callback);
66
+ if (options?.release) {
67
+ keyHandler.off("keyrelease", callback);
68
+ }
63
69
  });
64
70
  };
65
71
  var usePaste = (callback) => {
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.0.0-20251128-0889a764",
7
+ "version": "0.0.0-20251201-fe4cc80e",
8
8
  "description": "SolidJS renderer for OpenTUI",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -21,13 +21,17 @@
21
21
  "./preload": {
22
22
  "import": "./scripts/preload.ts"
23
23
  },
24
+ "./bun-plugin": {
25
+ "types": "./scripts/solid-plugin.d.ts",
26
+ "import": "./scripts/solid-plugin.ts"
27
+ },
24
28
  "./jsx-runtime": "./jsx-runtime.d.ts",
25
29
  "./jsx-dev-runtime": "./jsx-runtime.d.ts"
26
30
  },
27
31
  "dependencies": {
28
32
  "@babel/core": "7.28.0",
29
33
  "@babel/preset-typescript": "7.27.1",
30
- "@opentui/core": "0.0.0-20251128-0889a764",
34
+ "@opentui/core": "0.0.0-20251201-fe4cc80e",
31
35
  "babel-plugin-module-resolver": "5.0.2",
32
36
  "babel-preset-solid": "1.9.9",
33
37
  "s-js": "^0.4.9"
@@ -0,0 +1,3 @@
1
+ import { type BunPlugin } from "bun";
2
+ declare const solidTransformPlugin: BunPlugin;
3
+ export default solidTransformPlugin;
@@ -6,11 +6,31 @@ 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: KeyEvent) => void) => void;
9
+ export interface UseKeyboardOptions {
10
+ /** Include release events - callback receives events with eventType: "release" */
11
+ release?: boolean;
12
+ }
13
+ /**
14
+ * Subscribe to keyboard events.
15
+ *
16
+ * By default, only receives press events (including key repeats with `repeated: true`).
17
+ * Use `options.release` to also receive release events.
18
+ *
19
+ * @example
20
+ * // Basic press handling (includes repeats)
21
+ * useKeyboard((e) => console.log(e.name, e.repeated ? "(repeat)" : ""))
22
+ *
23
+ * // With release events
24
+ * useKeyboard((e) => {
25
+ * if (e.eventType === "release") keys.delete(e.name)
26
+ * else keys.add(e.name)
27
+ * }, { release: true })
28
+ */
29
+ export declare const useKeyboard: (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => void;
10
30
  export declare const usePaste: (callback: (event: PasteEvent) => void) => void;
11
31
  /**
12
32
  * @deprecated renamed to useKeyboard
13
33
  */
14
- export declare const useKeyHandler: (callback: (key: KeyEvent) => void) => void;
34
+ export declare const useKeyHandler: (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => void;
15
35
  export declare const useSelectionHandler: (callback: (selection: Selection) => void) => void;
16
36
  export declare const useTimeline: (options?: TimelineOptions) => Timeline;