@opentui/core 0.1.62 → 0.1.64

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.
@@ -54,6 +54,7 @@ export declare const reverse: (input: StylableInput) => TextChunk;
54
54
  export declare const blink: (input: StylableInput) => TextChunk;
55
55
  export declare const fg: (color: Color) => (input: StylableInput) => TextChunk;
56
56
  export declare const bg: (color: Color) => (input: StylableInput) => TextChunk;
57
+ export declare const link: (url: string) => (input: StylableInput) => TextChunk;
57
58
  /**
58
59
  * Template literal handler for styled text (non-cached version).
59
60
  * Returns a StyledText object containing chunks of text with optional styles.
@@ -15,6 +15,7 @@ export type PositionTypeString = "static" | "relative" | "absolute";
15
15
  export type UnitString = "undefined" | "point" | "percent" | "auto";
16
16
  export type WrapString = "no-wrap" | "wrap" | "wrap-reverse";
17
17
  export declare function parseAlign(value: string | null | undefined): Align;
18
+ export declare function parseAlignItems(value: string | null | undefined): Align;
18
19
  export declare function parseBoxSizing(value: string): BoxSizing;
19
20
  export declare function parseDimension(value: string): Dimension;
20
21
  export declare function parseDirection(value: string): Direction;
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.62",
7
+ "version": "0.1.64",
8
8
  "description": "OpenTUI is a TypeScript library for building terminal user interfaces (TUIs)",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -56,11 +56,11 @@
56
56
  "bun-webgpu": "0.1.4",
57
57
  "planck": "^1.4.2",
58
58
  "three": "0.177.0",
59
- "@opentui/core-darwin-x64": "0.1.62",
60
- "@opentui/core-darwin-arm64": "0.1.62",
61
- "@opentui/core-linux-x64": "0.1.62",
62
- "@opentui/core-linux-arm64": "0.1.62",
63
- "@opentui/core-win32-x64": "0.1.62",
64
- "@opentui/core-win32-arm64": "0.1.62"
59
+ "@opentui/core-darwin-x64": "0.1.64",
60
+ "@opentui/core-darwin-arm64": "0.1.64",
61
+ "@opentui/core-linux-x64": "0.1.64",
62
+ "@opentui/core-linux-arm64": "0.1.64",
63
+ "@opentui/core-win32-x64": "0.1.64",
64
+ "@opentui/core-win32-arm64": "0.1.64"
65
65
  }
66
66
  }
@@ -8,6 +8,9 @@ export interface TextNodeOptions extends BaseRenderableOptions {
8
8
  fg?: string | RGBA;
9
9
  bg?: string | RGBA;
10
10
  attributes?: number;
11
+ link?: {
12
+ url: string;
13
+ };
11
14
  }
12
15
  declare const BrandedTextNodeRenderable: unique symbol;
13
16
  export declare function isTextNodeRenderable(obj: any): obj is TextNodeRenderable;
@@ -16,6 +19,7 @@ export declare class TextNodeRenderable extends BaseRenderable {
16
19
  private _fg?;
17
20
  private _bg?;
18
21
  private _attributes;
22
+ private _link?;
19
23
  private _children;
20
24
  parent: TextNodeRenderable | null;
21
25
  constructor(options: TextNodeOptions);
@@ -31,15 +35,24 @@ export declare class TextNodeRenderable extends BaseRenderable {
31
35
  fg?: RGBA;
32
36
  bg?: RGBA;
33
37
  attributes: number;
38
+ link?: {
39
+ url: string;
40
+ };
34
41
  }): {
35
42
  fg?: RGBA;
36
43
  bg?: RGBA;
37
44
  attributes: number;
45
+ link?: {
46
+ url: string;
47
+ };
38
48
  };
39
49
  gatherWithInheritedStyle(parentStyle?: {
40
50
  fg?: RGBA;
41
51
  bg?: RGBA;
42
52
  attributes: number;
53
+ link?: {
54
+ url: string;
55
+ };
43
56
  }): TextChunk[];
44
57
  static fromString(text: string, options?: Partial<TextNodeOptions>): TextNodeRenderable;
45
58
  static fromNodes(nodes: TextNodeRenderable[], options?: Partial<TextNodeOptions>): TextNodeRenderable;
@@ -47,6 +60,9 @@ export declare class TextNodeRenderable extends BaseRenderable {
47
60
  fg?: RGBA;
48
61
  bg?: RGBA;
49
62
  attributes: number;
63
+ link?: {
64
+ url: string;
65
+ };
50
66
  }): TextChunk[];
51
67
  getChildren(): BaseRenderable[];
52
68
  getChildrenCount(): number;
@@ -58,6 +74,12 @@ export declare class TextNodeRenderable extends BaseRenderable {
58
74
  get bg(): RGBA | undefined;
59
75
  set attributes(attributes: number);
60
76
  get attributes(): number;
77
+ set link(link: {
78
+ url: string;
79
+ } | undefined);
80
+ get link(): {
81
+ url: string;
82
+ } | undefined;
61
83
  findDescendantById(id: string): BaseRenderable | undefined;
62
84
  }
63
85
  export declare class RootTextNodeRenderable extends TextNodeRenderable {
package/renderer.d.ts CHANGED
@@ -29,9 +29,7 @@ export interface CliRendererConfig {
29
29
  useAlternateScreen?: boolean;
30
30
  useConsole?: boolean;
31
31
  experimental_splitHeight?: number;
32
- useKittyKeyboard?: {
33
- events?: boolean;
34
- } | null;
32
+ useKittyKeyboard?: KittyKeyboardOptions | null;
35
33
  backgroundColor?: ColorInput;
36
34
  openConsoleOnError?: boolean;
37
35
  prependInputHandlers?: ((sequence: string) => boolean)[];
@@ -41,15 +39,29 @@ export type PixelResolution = {
41
39
  width: number;
42
40
  height: number;
43
41
  };
42
+ /**
43
+ * Kitty Keyboard Protocol configuration options
44
+ * See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
45
+ */
46
+ export interface KittyKeyboardOptions {
47
+ /** Disambiguate escape codes (fixes ESC timing, alt+key ambiguity, ctrl+c as event). Default: true */
48
+ disambiguate?: boolean;
49
+ /** Report alternate keys (numpad, shifted, base layout) for cross-keyboard shortcuts. Default: true */
50
+ alternateKeys?: boolean;
51
+ /** Report event types (press/repeat/release). Default: false */
52
+ events?: boolean;
53
+ /** Report all keys as escape codes. Default: false */
54
+ allKeysAsEscapes?: boolean;
55
+ /** Report text associated with key events. Default: false */
56
+ reportText?: boolean;
57
+ }
44
58
  /**
45
59
  * Build kitty keyboard protocol flags based on configuration
46
60
  * @param config Kitty keyboard configuration object (null/undefined = disabled)
47
61
  * @returns The combined flags value (0 = disabled, >0 = enabled)
48
62
  * @internal Exported for testing
49
63
  */
50
- export declare function buildKittyKeyboardFlags(config: {
51
- events?: boolean;
52
- } | null | undefined): number;
64
+ export declare function buildKittyKeyboardFlags(config: KittyKeyboardOptions | null | undefined): number;
53
65
  export declare class MouseEvent {
54
66
  readonly type: MouseEventType;
55
67
  readonly button: number;
package/testing.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  CliRenderer,
5
5
  TreeSitterClient,
6
6
  resolveRenderLib
7
- } from "./index-mrwvcpzb.js";
7
+ } from "./index-h33hh1n5.js";
8
8
 
9
9
  // src/testing/test-renderer.ts
10
10
  import { Readable } from "stream";
package/text-buffer.d.ts CHANGED
@@ -10,6 +10,9 @@ export interface TextChunk {
10
10
  fg?: RGBA;
11
11
  bg?: RGBA;
12
12
  attributes?: number;
13
+ link?: {
14
+ url: string;
15
+ };
13
16
  }
14
17
  export declare class TextBuffer {
15
18
  private lib;
package/types.d.ts CHANGED
@@ -14,6 +14,13 @@ export declare const TextAttributes: {
14
14
  HIDDEN: number;
15
15
  STRIKETHROUGH: number;
16
16
  };
17
+ export declare const ATTRIBUTE_BASE_BITS = 8;
18
+ export declare const ATTRIBUTE_BASE_MASK = 255;
19
+ /**
20
+ * Extract the base 8 bits of attributes from a u32 attribute value.
21
+ * Currently we only use the first 8 bits for standard text attributes.
22
+ */
23
+ export declare function getBaseAttributes(attr: number): number;
17
24
  export type CursorStyle = "block" | "line" | "underline";
18
25
  export interface CursorStyleOptions {
19
26
  style: CursorStyle;
package/utils.d.ts CHANGED
@@ -9,4 +9,6 @@ export declare function createTextAttributes({ bold, italic, underline, dim, bli
9
9
  hidden?: boolean;
10
10
  strikethrough?: boolean;
11
11
  }): number;
12
+ export declare function attributesWithLink(baseAttributes: number, linkId: number): number;
13
+ export declare function getLinkId(attributes: number): number;
12
14
  export declare function visualizeRenderableTree(renderable: Renderable, maxDepth?: number): void;
package/zig-structs.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare const StyledChunkStruct: import("bun-ffi-structs").DefineStructRe
10
10
  readonly optional: true;
11
11
  readonly packTransform: (rgba?: RGBA) => Pointer | null;
12
12
  readonly unpackTransform: (ptr?: Pointer) => RGBA | undefined;
13
- }], readonly ["attributes", "u8", {
13
+ }], readonly ["attributes", "u32", {
14
14
  readonly optional: true;
15
15
  }]], {}>;
16
16
  export declare const HighlightStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["start", "u32"], readonly ["end", "u32"], readonly ["styleId", "u32"], readonly ["priority", "u8", {
package/zig.d.ts CHANGED
@@ -104,6 +104,9 @@ export interface RenderLib {
104
104
  fg?: RGBA | null;
105
105
  bg?: RGBA | null;
106
106
  attributes?: number;
107
+ link?: {
108
+ url: string;
109
+ };
107
110
  }>) => void;
108
111
  textBufferSetDefaultFg: (buffer: Pointer, fg: RGBA | null) => void;
109
112
  textBufferSetDefaultBg: (buffer: Pointer, bg: RGBA | null) => void;