@opentui/solid 0.0.0-20250912-12c969f4 → 0.0.0-20250915-7be4d9eb

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
@@ -8,6 +8,7 @@ export function useRenderer(): any;
8
8
  export function useKeyboard(callback: any): void;
9
9
  export function useKeyHandler(callback: any): void;
10
10
  export var use: <A, T>(fn: (element: any, arg: A) => T, element: any, arg: A) => T;
11
+ export var textNodeKeys: string[];
11
12
  export var spread: <T>(node: any, accessor: (() => T) | T, skipChildren?: boolean) => void;
12
13
  export var setProp: <T>(node: any, name: string, value: T, prev?: T | undefined) => T;
13
14
  export function render(node: any, renderConfig?: {}): Promise<void>;
@@ -25,6 +26,12 @@ export function getComponentCatalogue(): {
25
26
  tab_select: typeof TabSelectRenderable;
26
27
  scrollbox: typeof ScrollBoxRenderable;
27
28
  span: typeof SpanRenderable;
29
+ strong: typeof BoldSpanRenderable;
30
+ b: typeof BoldSpanRenderable;
31
+ em: typeof ItalicSpanRenderable;
32
+ i: typeof ItalicSpanRenderable;
33
+ u: typeof UnderlineSpanRenderable;
34
+ br: typeof LineBreakRenderable;
28
35
  };
29
36
  export function extend(objects: any): void;
30
37
  export var effect: <T>(fn: (prev?: T) => T, init?: T) => void;
@@ -41,10 +48,28 @@ export namespace componentCatalogue {
41
48
  export { TabSelectRenderable as tab_select };
42
49
  export { ScrollBoxRenderable as scrollbox };
43
50
  export { SpanRenderable as span };
51
+ export { BoldSpanRenderable as strong };
52
+ export { BoldSpanRenderable as b };
53
+ export { ItalicSpanRenderable as em };
54
+ export { ItalicSpanRenderable as i };
55
+ export { UnderlineSpanRenderable as u };
56
+ export { LineBreakRenderable as br };
44
57
  }
45
58
  export namespace baseComponents { }
46
59
  export var _render: (code: () => any, node: any) => () => void;
60
+ export class UnderlineSpanRenderable extends TextModifierRenderable {
61
+ constructor(options: any);
62
+ }
47
63
  export var RendererContext: import("solid-js").Context<any>;
64
+ export class LineBreakRenderable extends SpanRenderable {
65
+ add(): number;
66
+ }
67
+ export class ItalicSpanRenderable extends TextModifierRenderable {
68
+ constructor(options: any);
69
+ }
70
+ export class BoldSpanRenderable extends TextModifierRenderable {
71
+ constructor(options: any);
72
+ }
48
73
  import { BoxRenderable } from "@opentui/core";
49
74
  import { TextRenderable } from "@opentui/core";
50
75
  import { InputRenderable } from "@opentui/core";
@@ -57,5 +82,7 @@ declare class SpanRenderable extends TextNodeRenderable {
57
82
  _ctx: any;
58
83
  }
59
84
  import { Timeline } from "@opentui/core";
85
+ declare class TextModifierRenderable extends SpanRenderable {
86
+ }
60
87
  import { TextNodeRenderable } from "@opentui/core";
61
88
  export {};
package/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  ScrollBoxRenderable,
11
11
  SelectRenderable,
12
12
  TabSelectRenderable,
13
+ TextAttributes,
13
14
  TextNodeRenderable,
14
15
  TextRenderable
15
16
  } from "@opentui/core";
@@ -103,6 +104,49 @@ class SpanRenderable extends TextNodeRenderable {
103
104
  this._ctx = _ctx;
104
105
  }
105
106
  }
107
+ var textNodeKeys = ["span", "b", "strong", "i", "em", "u"];
108
+
109
+ class TextModifierRenderable extends SpanRenderable {
110
+ constructor(options, modifier) {
111
+ super(null, options);
112
+ if (modifier === "b" || modifier === "strong") {
113
+ this.attributes = (this.attributes || 0) | TextAttributes.BOLD;
114
+ } else if (modifier === "i" || modifier === "em") {
115
+ this.attributes = (this.attributes || 0) | TextAttributes.ITALIC;
116
+ } else if (modifier === "u") {
117
+ this.attributes = (this.attributes || 0) | TextAttributes.UNDERLINE;
118
+ }
119
+ }
120
+ }
121
+
122
+ class BoldSpanRenderable extends TextModifierRenderable {
123
+ constructor(options) {
124
+ super(options, "b");
125
+ }
126
+ }
127
+
128
+ class ItalicSpanRenderable extends TextModifierRenderable {
129
+ constructor(options) {
130
+ super(options, "i");
131
+ }
132
+ }
133
+
134
+ class UnderlineSpanRenderable extends TextModifierRenderable {
135
+ constructor(options) {
136
+ super(options, "u");
137
+ }
138
+ }
139
+
140
+ class LineBreakRenderable extends SpanRenderable {
141
+ constructor(_ctx, options) {
142
+ super(null, options);
143
+ this.add();
144
+ }
145
+ add() {
146
+ return super.add(`
147
+ `);
148
+ }
149
+ }
106
150
  var baseComponents = {
107
151
  box: BoxRenderable,
108
152
  text: TextRenderable,
@@ -111,7 +155,13 @@ var baseComponents = {
111
155
  ascii_font: ASCIIFontRenderable,
112
156
  tab_select: TabSelectRenderable,
113
157
  scrollbox: ScrollBoxRenderable,
114
- span: SpanRenderable
158
+ span: SpanRenderable,
159
+ strong: BoldSpanRenderable,
160
+ b: BoldSpanRenderable,
161
+ em: ItalicSpanRenderable,
162
+ i: ItalicSpanRenderable,
163
+ u: UnderlineSpanRenderable,
164
+ br: LineBreakRenderable
115
165
  };
116
166
  var componentCatalogue = { ...baseComponents };
117
167
  function extend(objects) {
@@ -426,6 +476,7 @@ export {
426
476
  useKeyboard,
427
477
  useKeyHandler,
428
478
  use,
479
+ textNodeKeys,
429
480
  spread,
430
481
  setProp,
431
482
  render,
@@ -444,5 +495,9 @@ export {
444
495
  componentCatalogue,
445
496
  baseComponents,
446
497
  _render,
447
- RendererContext
498
+ UnderlineSpanRenderable,
499
+ RendererContext,
500
+ LineBreakRenderable,
501
+ ItalicSpanRenderable,
502
+ BoldSpanRenderable
448
503
  };
package/jsx-runtime.d.ts CHANGED
@@ -28,6 +28,13 @@ declare namespace JSX {
28
28
  ascii_font: AsciiFontProps
29
29
  tab_select: TabSelectProps
30
30
  scrollbox: ScrollBoxProps
31
+
32
+ b: SpanProps
33
+ strong: SpanProps
34
+ i: SpanProps
35
+ em: SpanProps
36
+ u: SpanProps
37
+ br: {}
31
38
  }
32
39
 
33
40
  interface ElementChildrenAttribute {
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-20250912-12c969f4",
7
+ "version": "0.0.0-20250915-7be4d9eb",
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.0.0-20250912-12c969f4",
28
+ "@opentui/core": "0.0.0-20250915-7be4d9eb",
29
29
  "babel-plugin-module-resolver": "5.0.2",
30
30
  "@babel/core": "7.28.0",
31
31
  "@babel/preset-typescript": "7.27.1",
@@ -3,7 +3,25 @@ import type { RenderableConstructor } from "../types/elements";
3
3
  export * from "./hooks";
4
4
  declare class SpanRenderable extends TextNodeRenderable {
5
5
  private readonly _ctx;
6
- constructor(_ctx: RenderContext, options: TextNodeOptions);
6
+ constructor(_ctx: RenderContext | null, options: TextNodeOptions);
7
+ }
8
+ export declare const textNodeKeys: readonly ["span", "b", "strong", "i", "em", "u"];
9
+ export type TextNodeKey = (typeof textNodeKeys)[number];
10
+ declare class TextModifierRenderable extends SpanRenderable {
11
+ constructor(options: any, modifier?: TextNodeKey);
12
+ }
13
+ export declare class BoldSpanRenderable extends TextModifierRenderable {
14
+ constructor(options: any);
15
+ }
16
+ export declare class ItalicSpanRenderable extends TextModifierRenderable {
17
+ constructor(options: any);
18
+ }
19
+ export declare class UnderlineSpanRenderable extends TextModifierRenderable {
20
+ constructor(options: any);
21
+ }
22
+ export declare class LineBreakRenderable extends SpanRenderable {
23
+ constructor(_ctx: RenderContext | null, options: TextNodeOptions);
24
+ add(): number;
7
25
  }
8
26
  export declare const baseComponents: {
9
27
  box: typeof BoxRenderable;
@@ -14,6 +32,12 @@ export declare const baseComponents: {
14
32
  tab_select: typeof TabSelectRenderable;
15
33
  scrollbox: typeof ScrollBoxRenderable;
16
34
  span: typeof SpanRenderable;
35
+ strong: typeof BoldSpanRenderable;
36
+ b: typeof BoldSpanRenderable;
37
+ em: typeof ItalicSpanRenderable;
38
+ i: typeof ItalicSpanRenderable;
39
+ u: typeof UnderlineSpanRenderable;
40
+ br: typeof LineBreakRenderable;
17
41
  };
18
42
  type ComponentCatalogue = Record<string, RenderableConstructor>;
19
43
  export declare const componentCatalogue: ComponentCatalogue;