@opentui/solid 0.0.0-20260604-34bc02bf → 0.0.0-20260604-5b641b77

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.
Files changed (41) hide show
  1. package/chunk-7fkmdv3h.js +110 -0
  2. package/components.js +4 -106
  3. package/dist/chunk-7fkmdv3h.d.ts +81 -0
  4. package/dist/index.d.ts +118 -0
  5. package/index.d.ts +1 -1
  6. package/index.js +72 -146
  7. package/jsx-runtime.d.ts +3 -9
  8. package/package.json +9 -27
  9. package/scripts/preload.ts +3 -0
  10. package/scripts/runtime-plugin-support-configure.ts +109 -0
  11. package/scripts/runtime-plugin-support.ts +6 -0
  12. package/scripts/solid-plugin.d.ts +1 -1
  13. package/scripts/solid-plugin.ts +148 -0
  14. package/src/elements/extras.d.ts +1 -1
  15. package/src/time-to-first-draw.d.ts +1 -1
  16. package/src/types/elements.d.ts +1 -1
  17. package/components.js.map +0 -10
  18. package/index.bun.js +0 -1609
  19. package/index.bun.js.map +0 -22
  20. package/index.js.map +0 -22
  21. package/jsx-dev-runtime.d.ts +0 -1
  22. package/jsx-dev-runtime.js +0 -2
  23. package/jsx-dev-runtime.js.map +0 -1
  24. package/jsx-runtime.js +0 -31
  25. package/jsx-runtime.js.map +0 -1
  26. package/scripts/preload.js +0 -3
  27. package/scripts/preload.js.map +0 -1
  28. package/scripts/preload.node.js +0 -9
  29. package/scripts/runtime-plugin-support-configure.js +0 -67
  30. package/scripts/runtime-plugin-support-configure.js.map +0 -1
  31. package/scripts/runtime-plugin-support-configure.node.js +0 -11
  32. package/scripts/runtime-plugin-support.js +0 -4
  33. package/scripts/runtime-plugin-support.js.map +0 -1
  34. package/scripts/runtime-plugin-support.node.js +0 -11
  35. package/scripts/solid-plugin.js +0 -76
  36. package/scripts/solid-plugin.js.map +0 -1
  37. package/scripts/solid-plugin.node.js +0 -21
  38. package/scripts/solid-transform.d.ts +0 -10
  39. package/scripts/solid-transform.js +0 -66
  40. package/scripts/solid-transform.js.map +0 -1
  41. package/src/testing/bun-test-node.d.ts +0 -12
@@ -0,0 +1,110 @@
1
+ // @bun
2
+ // src/elements/catalogue.ts
3
+ import {
4
+ ASCIIFontRenderable,
5
+ BoxRenderable,
6
+ CodeRenderable,
7
+ DiffRenderable,
8
+ InputRenderable,
9
+ LineNumberRenderable,
10
+ MarkdownRenderable,
11
+ ScrollBoxRenderable,
12
+ SelectRenderable,
13
+ TabSelectRenderable,
14
+ TextareaRenderable,
15
+ TextAttributes,
16
+ TextNodeRenderable,
17
+ TextRenderable
18
+ } from "@opentui/core";
19
+
20
+ class SpanRenderable extends TextNodeRenderable {
21
+ _ctx;
22
+ constructor(_ctx, options) {
23
+ super(options);
24
+ this._ctx = _ctx;
25
+ }
26
+ }
27
+ var textNodeKeys = ["span", "b", "strong", "i", "em", "u", "a"];
28
+
29
+ class TextModifierRenderable extends SpanRenderable {
30
+ constructor(options, modifier) {
31
+ super(null, options);
32
+ if (modifier === "b" || modifier === "strong") {
33
+ this.attributes = (this.attributes || 0) | TextAttributes.BOLD;
34
+ } else if (modifier === "i" || modifier === "em") {
35
+ this.attributes = (this.attributes || 0) | TextAttributes.ITALIC;
36
+ } else if (modifier === "u") {
37
+ this.attributes = (this.attributes || 0) | TextAttributes.UNDERLINE;
38
+ }
39
+ }
40
+ }
41
+
42
+ class BoldSpanRenderable extends TextModifierRenderable {
43
+ constructor(options) {
44
+ super(options, "b");
45
+ }
46
+ }
47
+
48
+ class ItalicSpanRenderable extends TextModifierRenderable {
49
+ constructor(options) {
50
+ super(options, "i");
51
+ }
52
+ }
53
+
54
+ class UnderlineSpanRenderable extends TextModifierRenderable {
55
+ constructor(options) {
56
+ super(options, "u");
57
+ }
58
+ }
59
+
60
+ class LineBreakRenderable extends SpanRenderable {
61
+ constructor(_ctx, options) {
62
+ super(null, options);
63
+ this.add();
64
+ }
65
+ add() {
66
+ return super.add(`
67
+ `);
68
+ }
69
+ }
70
+
71
+ class LinkRenderable extends SpanRenderable {
72
+ constructor(_ctx, options) {
73
+ const linkOptions = {
74
+ ...options,
75
+ link: { url: options.href }
76
+ };
77
+ super(null, linkOptions);
78
+ }
79
+ }
80
+ var baseComponents = {
81
+ box: BoxRenderable,
82
+ text: TextRenderable,
83
+ input: InputRenderable,
84
+ select: SelectRenderable,
85
+ textarea: TextareaRenderable,
86
+ ascii_font: ASCIIFontRenderable,
87
+ tab_select: TabSelectRenderable,
88
+ scrollbox: ScrollBoxRenderable,
89
+ code: CodeRenderable,
90
+ diff: DiffRenderable,
91
+ line_number: LineNumberRenderable,
92
+ markdown: MarkdownRenderable,
93
+ span: SpanRenderable,
94
+ strong: BoldSpanRenderable,
95
+ b: BoldSpanRenderable,
96
+ em: ItalicSpanRenderable,
97
+ i: ItalicSpanRenderable,
98
+ u: UnderlineSpanRenderable,
99
+ br: LineBreakRenderable,
100
+ a: LinkRenderable
101
+ };
102
+ var componentCatalogue = { ...baseComponents };
103
+ function extend(objects) {
104
+ Object.assign(componentCatalogue, objects);
105
+ }
106
+ function getComponentCatalogue() {
107
+ return componentCatalogue;
108
+ }
109
+
110
+ export { textNodeKeys, BoldSpanRenderable, ItalicSpanRenderable, UnderlineSpanRenderable, LineBreakRenderable, LinkRenderable, baseComponents, componentCatalogue, extend, getComponentCatalogue };
package/components.js CHANGED
@@ -1,111 +1,9 @@
1
- // src/elements/catalogue.ts
1
+ // @bun
2
2
  import {
3
- ASCIIFontRenderable,
4
- BoxRenderable,
5
- CodeRenderable,
6
- DiffRenderable,
7
- InputRenderable,
8
- LineNumberRenderable,
9
- MarkdownRenderable,
10
- ScrollBoxRenderable,
11
- SelectRenderable,
12
- TabSelectRenderable,
13
- TextareaRenderable,
14
- TextAttributes,
15
- TextNodeRenderable,
16
- TextRenderable
17
- } from "@opentui/core";
18
-
19
- class SpanRenderable extends TextNodeRenderable {
20
- _ctx;
21
- constructor(_ctx, options) {
22
- super(options);
23
- this._ctx = _ctx;
24
- }
25
- }
26
- class TextModifierRenderable extends SpanRenderable {
27
- constructor(options, modifier) {
28
- super(null, options);
29
- if (modifier === "b" || modifier === "strong") {
30
- this.attributes = (this.attributes || 0) | TextAttributes.BOLD;
31
- } else if (modifier === "i" || modifier === "em") {
32
- this.attributes = (this.attributes || 0) | TextAttributes.ITALIC;
33
- } else if (modifier === "u") {
34
- this.attributes = (this.attributes || 0) | TextAttributes.UNDERLINE;
35
- }
36
- }
37
- }
38
-
39
- class BoldSpanRenderable extends TextModifierRenderable {
40
- constructor(options) {
41
- super(options, "b");
42
- }
43
- }
44
-
45
- class ItalicSpanRenderable extends TextModifierRenderable {
46
- constructor(options) {
47
- super(options, "i");
48
- }
49
- }
50
-
51
- class UnderlineSpanRenderable extends TextModifierRenderable {
52
- constructor(options) {
53
- super(options, "u");
54
- }
55
- }
56
-
57
- class LineBreakRenderable extends SpanRenderable {
58
- constructor(_ctx, options) {
59
- super(null, options);
60
- this.add();
61
- }
62
- add() {
63
- return super.add(`
64
- `);
65
- }
66
- }
67
-
68
- class LinkRenderable extends SpanRenderable {
69
- constructor(_ctx, options) {
70
- const linkOptions = {
71
- ...options,
72
- link: { url: options.href }
73
- };
74
- super(null, linkOptions);
75
- }
76
- }
77
- var baseComponents = {
78
- box: BoxRenderable,
79
- text: TextRenderable,
80
- input: InputRenderable,
81
- select: SelectRenderable,
82
- textarea: TextareaRenderable,
83
- ascii_font: ASCIIFontRenderable,
84
- tab_select: TabSelectRenderable,
85
- scrollbox: ScrollBoxRenderable,
86
- code: CodeRenderable,
87
- diff: DiffRenderable,
88
- line_number: LineNumberRenderable,
89
- markdown: MarkdownRenderable,
90
- span: SpanRenderable,
91
- strong: BoldSpanRenderable,
92
- b: BoldSpanRenderable,
93
- em: ItalicSpanRenderable,
94
- i: ItalicSpanRenderable,
95
- u: UnderlineSpanRenderable,
96
- br: LineBreakRenderable,
97
- a: LinkRenderable
98
- };
99
- var componentCatalogue = { ...baseComponents };
100
- function extend(objects) {
101
- Object.assign(componentCatalogue, objects);
102
- }
103
- function getComponentCatalogue() {
104
- return componentCatalogue;
105
- }
3
+ extend,
4
+ getComponentCatalogue
5
+ } from "./chunk-7fkmdv3h.js";
106
6
  export {
107
7
  getComponentCatalogue,
108
8
  extend
109
9
  };
110
-
111
- //# debugId=4D3EF7806518248664756E2164756E21
@@ -0,0 +1,81 @@
1
+ export var textNodeKeys: string[];
2
+ export class BoldSpanRenderable extends TextModifierRenderable {
3
+ constructor(options: any);
4
+ }
5
+ export class ItalicSpanRenderable extends TextModifierRenderable {
6
+ constructor(options: any);
7
+ }
8
+ export class UnderlineSpanRenderable extends TextModifierRenderable {
9
+ constructor(options: any);
10
+ }
11
+ export class LineBreakRenderable extends SpanRenderable {
12
+ add(): number;
13
+ }
14
+ export class LinkRenderable extends SpanRenderable {
15
+ }
16
+ export namespace baseComponents {
17
+ export { BoxRenderable as box };
18
+ export { TextRenderable as text };
19
+ export { InputRenderable as input };
20
+ export { SelectRenderable as select };
21
+ export { TextareaRenderable as textarea };
22
+ export { ASCIIFontRenderable as ascii_font };
23
+ export { TabSelectRenderable as tab_select };
24
+ export { ScrollBoxRenderable as scrollbox };
25
+ export { CodeRenderable as code };
26
+ export { DiffRenderable as diff };
27
+ export { LineNumberRenderable as line_number };
28
+ export { MarkdownRenderable as markdown };
29
+ export { SpanRenderable as span };
30
+ export { BoldSpanRenderable as strong };
31
+ export { BoldSpanRenderable as b };
32
+ export { ItalicSpanRenderable as em };
33
+ export { ItalicSpanRenderable as i };
34
+ export { UnderlineSpanRenderable as u };
35
+ export { LineBreakRenderable as br };
36
+ export { LinkRenderable as a };
37
+ }
38
+ export namespace componentCatalogue { }
39
+ export function extend(objects: any): void;
40
+ export function getComponentCatalogue(): {
41
+ box: typeof BoxRenderable;
42
+ text: typeof TextRenderable;
43
+ input: typeof InputRenderable;
44
+ select: typeof SelectRenderable;
45
+ textarea: typeof TextareaRenderable;
46
+ ascii_font: typeof ASCIIFontRenderable;
47
+ tab_select: typeof TabSelectRenderable;
48
+ scrollbox: typeof ScrollBoxRenderable;
49
+ code: typeof CodeRenderable;
50
+ diff: typeof DiffRenderable;
51
+ line_number: typeof LineNumberRenderable;
52
+ markdown: typeof MarkdownRenderable;
53
+ span: typeof SpanRenderable;
54
+ strong: typeof BoldSpanRenderable;
55
+ b: typeof BoldSpanRenderable;
56
+ em: typeof ItalicSpanRenderable;
57
+ i: typeof ItalicSpanRenderable;
58
+ u: typeof UnderlineSpanRenderable;
59
+ br: typeof LineBreakRenderable;
60
+ a: typeof LinkRenderable;
61
+ };
62
+ declare class TextModifierRenderable extends SpanRenderable {
63
+ }
64
+ declare class SpanRenderable extends TextNodeRenderable {
65
+ constructor(_ctx: any, options: any);
66
+ _ctx: any;
67
+ }
68
+ import { BoxRenderable } from "@opentui/core";
69
+ import { TextRenderable } from "@opentui/core";
70
+ import { InputRenderable } from "@opentui/core";
71
+ import { SelectRenderable } from "@opentui/core";
72
+ import { TextareaRenderable } from "@opentui/core";
73
+ import { ASCIIFontRenderable } from "@opentui/core";
74
+ import { TabSelectRenderable } from "@opentui/core";
75
+ import { ScrollBoxRenderable } from "@opentui/core";
76
+ import { CodeRenderable } from "@opentui/core";
77
+ import { DiffRenderable } from "@opentui/core";
78
+ import { LineNumberRenderable } from "@opentui/core";
79
+ import { MarkdownRenderable } from "@opentui/core";
80
+ import { TextNodeRenderable } from "@opentui/core";
81
+ export {};
@@ -0,0 +1,118 @@
1
+ export function writeSolidToScrollback(renderer: any, node: any, options?: {}): void;
2
+ export function useTimeline(options?: {}): Timeline;
3
+ export function useTerminalDimensions(): import("solid-js").Accessor<{
4
+ width: any;
5
+ height: any;
6
+ }>;
7
+ export function useSelectionHandler(callback: any): void;
8
+ export function useRenderer(): any;
9
+ export function usePaste(callback: any): void;
10
+ export function useKeyboard(callback: any, options: any): void;
11
+ export function useKeyHandler(callback: any, options: any): void;
12
+ export function use(fn: any, element: any, arg: any): any;
13
+ import { textNodeKeys } from "./chunk-7fkmdv3h.js";
14
+ export function testRender(node: any, renderConfig?: {}): Promise<import("@opentui/core/testing").TestRendererSetup>;
15
+ export function spread(node: any, accessor: any, skipChildren: any): void;
16
+ export function setProp(node: any, name: any, value: any, prev: any): any;
17
+ export function render(node: any, rendererOrConfig?: {}): Promise<void>;
18
+ export function onResize(callback: any): void;
19
+ export function onFocus(callback: any): void;
20
+ export function onBlur(callback: any): void;
21
+ declare var mergeProps3: typeof mergeProps;
22
+ declare function memo2(fn: any): import("solid-js").Accessor<any>;
23
+ export var insertNode: any;
24
+ export function insert(parent: any, accessor: any, marker: any, initial: any): any;
25
+ import { getComponentCatalogue } from "./chunk-7fkmdv3h.js";
26
+ import { extend } from "./chunk-7fkmdv3h.js";
27
+ export var effect: typeof createRenderEffect;
28
+ export var createTextNode: any;
29
+ export function createSolidSlotRegistry(renderer: any, context: any, options?: {}): import("@opentui/core").SlotRegistry<any, object, any>;
30
+ export function createSlotNode(): SlotRenderable;
31
+ export function createSlot(registry: any, options?: {}): (props: any) => any;
32
+ export function createScrollbackWriter(node: any, options?: {}): (ctx: any) => {
33
+ root: BoxRenderable;
34
+ width: number;
35
+ height: number;
36
+ rowColumns: any;
37
+ startOnNewLine: any;
38
+ trailingNewline: any;
39
+ teardown: () => void;
40
+ };
41
+ export var createElement: any;
42
+ export function createDynamic(component: any, props: any): import("solid-js").Accessor<any>;
43
+ declare var createComponent2: typeof createComponent;
44
+ import { componentCatalogue } from "./chunk-7fkmdv3h.js";
45
+ import { baseComponents } from "./chunk-7fkmdv3h.js";
46
+ export function _render(code: any, element: any): undefined;
47
+ import { UnderlineSpanRenderable } from "./chunk-7fkmdv3h.js";
48
+ export function TimeToFirstDraw(props: any): any;
49
+ export class TextSlotRenderable extends TextNodeRenderable {
50
+ constructor(id: any, parent: any);
51
+ slotParent: any;
52
+ destroyed: boolean;
53
+ detachFromSlot(): void;
54
+ disposeWithoutSlotCascade(): void;
55
+ }
56
+ export class SlotRenderable extends SlotBaseRenderable {
57
+ destroyed: boolean;
58
+ layoutNodesByParent: Map<any, any>;
59
+ textNodesByParent: Map<any, any>;
60
+ layoutNodeCount: number;
61
+ textNodeCount: number;
62
+ get layoutNode(): any;
63
+ get textNode(): any;
64
+ isTextSlotParent(parent: any): parent is TextRenderable | TextNodeRenderable;
65
+ getCurrentSlotChild(nodesByParent: any): any;
66
+ getTextNodeForParent(parent: any): any;
67
+ getLayoutNodeForParent(parent: any): any;
68
+ takeReusableTextNode(parent: any): any;
69
+ takeReusableLayoutNode(parent: any): any;
70
+ disposeDetachedTextNodes(): void;
71
+ disposeDetachedIncompatibleLayoutNodes(parent: any): void;
72
+ getAttachedSlotParent(excludedNode: any): any;
73
+ hasOtherAttachedSlotChildren(excludedNode: any): boolean;
74
+ getSlotChild(parent: any): any;
75
+ getSlotChildForRemoval(parent: any): any;
76
+ didRemoveSlotChild(parent: any, child: any): void;
77
+ }
78
+ export function Slot(props: any): import("solid-js").Accessor<any>;
79
+ export var RendererContext: import("solid-js").Context<any>;
80
+ export function Portal(props: any): SlotRenderable;
81
+ import { LinkRenderable } from "./chunk-7fkmdv3h.js";
82
+ import { LineBreakRenderable } from "./chunk-7fkmdv3h.js";
83
+ export class LayoutSlotRenderable extends SlotBaseRenderable {
84
+ constructor(id: any, parent: any, layoutParent: any);
85
+ yogaNode: any;
86
+ slotParent: any;
87
+ destroyed: boolean;
88
+ yogaNodeConstructor: any;
89
+ yogaNodeFreed: boolean;
90
+ getLayoutNode(): any;
91
+ updateFromLayout(): void;
92
+ updateLayout(): void;
93
+ onRemove(): void;
94
+ isCompatibleWith(layoutParent: any): boolean;
95
+ detachFromSlot(): void;
96
+ freeYogaNode(): void;
97
+ disposeWithoutSlotCascade(): void;
98
+ }
99
+ import { ItalicSpanRenderable } from "./chunk-7fkmdv3h.js";
100
+ export function Dynamic(props: any): import("solid-js").Accessor<any>;
101
+ import { BoldSpanRenderable } from "./chunk-7fkmdv3h.js";
102
+ import { Timeline } from "@opentui/core";
103
+ import { mergeProps } from "solid-js";
104
+ import { createRenderEffect } from "solid-js";
105
+ import { BoxRenderable } from "@opentui/core";
106
+ import { createComponent } from "solid-js";
107
+ import { TextNodeRenderable } from "@opentui/core";
108
+ declare class SlotBaseRenderable extends BaseRenderable {
109
+ constructor(id: any);
110
+ add(obj: any, index: any): void;
111
+ remove(id: any): void;
112
+ insertBefore(obj: any, anchor: any): void;
113
+ getRenderable(id: any): void;
114
+ findDescendantById(id: any): void;
115
+ }
116
+ import { TextRenderable } from "@opentui/core";
117
+ import { BaseRenderable } from "@opentui/core";
118
+ export { textNodeKeys, mergeProps3 as mergeProps, memo2 as memo, getComponentCatalogue, extend, createComponent2 as createComponent, componentCatalogue, baseComponents, UnderlineSpanRenderable, LinkRenderable, LineBreakRenderable, ItalicSpanRenderable, BoldSpanRenderable };
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CliRenderer, type CliRendererConfig } from "@opentui/core";
2
2
  import { type TestRendererOptions } from "@opentui/core/testing";
3
- import type { JSX } from "./jsx-runtime.js";
3
+ import type { JSX } from "./jsx-runtime";
4
4
  export declare const render: (node: () => JSX.Element, rendererOrConfig?: CliRenderer | CliRendererConfig) => Promise<void>;
5
5
  export declare const testRender: (node: () => JSX.Element, renderConfig?: TestRendererOptions) => Promise<import("@opentui/core/testing").TestRendererSetup>;
6
6
  export * from "./src/reconciler.js";