@opentui/solid 0.1.51 → 0.1.53

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
@@ -60,18 +60,12 @@ var useKeyboard = (callback, options) => {
60
60
  if (options?.release) {
61
61
  keyHandler.on("keyrelease", callback);
62
62
  }
63
- if (options?.repeat) {
64
- keyHandler.on("keyrepeat", callback);
65
- }
66
63
  });
67
64
  onCleanup(() => {
68
65
  keyHandler.off("keypress", callback);
69
66
  if (options?.release) {
70
67
  keyHandler.off("keyrelease", callback);
71
68
  }
72
- if (options?.repeat) {
73
- keyHandler.off("keyrepeat", callback);
74
- }
75
69
  });
76
70
  };
77
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.1.51",
7
+ "version": "0.1.53",
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.1.51",
34
+ "@opentui/core": "0.1.53",
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;
@@ -9,9 +9,23 @@ export declare const useTerminalDimensions: () => import("solid-js").Accessor<{
9
9
  export interface UseKeyboardOptions {
10
10
  /** Include release events - callback receives events with eventType: "release" */
11
11
  release?: boolean;
12
- /** Include repeat events - callback receives events with eventType: "repeat" */
13
- repeat?: boolean;
14
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
+ */
15
29
  export declare const useKeyboard: (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => void;
16
30
  export declare const usePaste: (callback: (event: PasteEvent) => void) => void;
17
31
  /**