@opentui/react 0.8.0 → 0.8.2
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.
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
SelectRenderable,
|
|
14
14
|
TabSelectRenderable,
|
|
15
15
|
TextareaRenderable,
|
|
16
|
-
TextRenderable
|
|
16
|
+
TextRenderable,
|
|
17
|
+
VideoRenderable
|
|
17
18
|
} from "@opentui/core";
|
|
18
19
|
|
|
19
20
|
// src/components/text.ts
|
|
@@ -95,6 +96,7 @@ var baseComponents2 = {
|
|
|
95
96
|
"tab-select": TabSelectRenderable,
|
|
96
97
|
"line-number": LineNumberRenderable,
|
|
97
98
|
image: ImageRenderable,
|
|
99
|
+
video: VideoRenderable,
|
|
98
100
|
span: SpanRenderable,
|
|
99
101
|
br: LineBreakRenderable,
|
|
100
102
|
b: BoldSpanRenderable,
|
|
@@ -164,7 +166,7 @@ import { ImageRenderable as ImageRenderable2, TextNodeRenderable as TextNodeRend
|
|
|
164
166
|
// package.json
|
|
165
167
|
var package_default = {
|
|
166
168
|
name: "@opentui/react",
|
|
167
|
-
version: "0.8.
|
|
169
|
+
version: "0.8.2",
|
|
168
170
|
description: "React renderer for building terminal user interfaces using OpenTUI core",
|
|
169
171
|
license: "MIT",
|
|
170
172
|
repository: {
|
|
@@ -396,7 +398,8 @@ var hostConfig = {
|
|
|
396
398
|
}
|
|
397
399
|
return new components[type](rootContainerInstance.ctx, {
|
|
398
400
|
id,
|
|
399
|
-
...initialInstanceProps(type, props)
|
|
401
|
+
...initialInstanceProps(type, props),
|
|
402
|
+
..."crop" in props && { crop: undefined }
|
|
400
403
|
});
|
|
401
404
|
},
|
|
402
405
|
appendChild(parent, child) {
|
package/index.js
CHANGED
package/jsx-namespace.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
TabSelectProps,
|
|
19
19
|
TextareaProps,
|
|
20
20
|
TextProps,
|
|
21
|
+
VideoProps,
|
|
21
22
|
} from "./src/types/components.js"
|
|
22
23
|
|
|
23
24
|
export namespace JSX {
|
|
@@ -52,6 +53,7 @@ export namespace JSX {
|
|
|
52
53
|
"tab-select": TabSelectProps
|
|
53
54
|
"line-number": LineNumberProps
|
|
54
55
|
image: ImageProps
|
|
56
|
+
video: VideoProps
|
|
55
57
|
// Text modifiers
|
|
56
58
|
b: SpanProps
|
|
57
59
|
i: SpanProps
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.8.
|
|
7
|
+
"version": "0.8.2",
|
|
8
8
|
"description": "React renderer for building terminal user interfaces using OpenTUI core",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@opentui/core": "0.8.
|
|
55
|
+
"@opentui/core": "0.8.2",
|
|
56
56
|
"react-reconciler": "^0.33.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, DiffRenderable, ImageRenderable, InputRenderable, LineNumberRenderable, MarkdownRenderable, ScrollBoxRenderable, SelectRenderable, TabSelectRenderable, TextareaRenderable, TextRenderable } from "@opentui/core";
|
|
1
|
+
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, DiffRenderable, ImageRenderable, InputRenderable, LineNumberRenderable, MarkdownRenderable, ScrollBoxRenderable, SelectRenderable, TabSelectRenderable, TextareaRenderable, TextRenderable, VideoRenderable } from "@opentui/core";
|
|
2
2
|
import type { RenderableConstructor } from "../types/components.js";
|
|
3
3
|
import { BoldSpanRenderable, ItalicSpanRenderable, LineBreakRenderable, LinkRenderable, SpanRenderable, UnderlineSpanRenderable } from "./text.js";
|
|
4
4
|
export declare const baseComponents: {
|
|
@@ -15,6 +15,7 @@ export declare const baseComponents: {
|
|
|
15
15
|
"tab-select": typeof TabSelectRenderable;
|
|
16
16
|
"line-number": typeof LineNumberRenderable;
|
|
17
17
|
image: typeof ImageRenderable;
|
|
18
|
+
video: typeof VideoRenderable;
|
|
18
19
|
span: typeof SpanRenderable;
|
|
19
20
|
br: typeof LineBreakRenderable;
|
|
20
21
|
b: typeof BoldSpanRenderable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ASCIIFontOptions, ASCIIFontRenderable, BaseRenderable, BoxOptions, BoxRenderable, CodeOptions, CodeRenderable, DiffRenderable, DiffRenderableOptions, ImageRenderable, ImageRenderableOptions, InputRenderable, InputRenderableOptions, LineNumberOptions, LineNumberRenderable, MarkdownOptions, MarkdownRenderable, RenderableOptions, RenderContext, ScrollBoxOptions, ScrollBoxRenderable, SelectOption, SelectRenderable, SelectRenderableOptions, TabSelectOption, TabSelectRenderable, TabSelectRenderableOptions, TextareaOptions, TextareaRenderable, TextNodeOptions, TextNodeRenderable, TextOptions, TextRenderable, CursorChangeEvent, ContentChangeEvent, KeyEvent } from "@opentui/core";
|
|
1
|
+
import type { ASCIIFontOptions, ASCIIFontRenderable, BaseRenderable, BoxOptions, BoxRenderable, CodeOptions, CodeRenderable, DiffRenderable, DiffRenderableOptions, ImageRenderable, ImageRenderableOptions, InputRenderable, InputRenderableOptions, LineNumberOptions, LineNumberRenderable, MarkdownOptions, MarkdownRenderable, RenderableOptions, RenderContext, ScrollBoxOptions, ScrollBoxRenderable, SelectOption, SelectRenderable, SelectRenderableOptions, TabSelectOption, TabSelectRenderable, TabSelectRenderableOptions, TextareaOptions, TextareaRenderable, TextNodeOptions, TextNodeRenderable, TextOptions, TextRenderable, VideoRenderable, VideoRenderableOptions, CursorChangeEvent, ContentChangeEvent, KeyEvent } from "@opentui/core";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
/** Properties that should not be included in the style prop */
|
|
4
4
|
export type NonStyledProps = "id" | "buffered" | "live" | "enableLayout" | "selectable" | "renderAfter" | "renderBefore" | `on${string}`;
|
|
@@ -14,7 +14,7 @@ type ExtractRenderableOptions<TConstructor> = TConstructor extends new (ctx: Ren
|
|
|
14
14
|
/** Extract the renderable type from a constructor */
|
|
15
15
|
type ExtractRenderable<TConstructor> = TConstructor extends new (ctx: RenderContext, options: any) => infer TRenderable ? TRenderable : never;
|
|
16
16
|
/** Determine which properties should be excluded from styling for different renderable types */
|
|
17
|
-
export type GetNonStyledProperties<TConstructor> = TConstructor extends RenderableConstructor<TextRenderable> ? NonStyledProps | "content" : TConstructor extends RenderableConstructor<BoxRenderable> ? NonStyledProps | "title" | "bottomTitle" : TConstructor extends RenderableConstructor<ASCIIFontRenderable> ? NonStyledProps | "text" | "selectable" : TConstructor extends RenderableConstructor<InputRenderable> ? NonStyledProps | "placeholder" | "value" : TConstructor extends RenderableConstructor<TextareaRenderable> ? NonStyledProps | "placeholder" | "initialValue" : TConstructor extends RenderableConstructor<CodeRenderable> ? NonStyledProps | "content" | "filetype" | "syntaxStyle" | "treeSitterClient" | "conceal" | "drawUnstyledText" : TConstructor extends RenderableConstructor<MarkdownRenderable> ? NonStyledProps | "content" | "syntaxStyle" | "treeSitterClient" | "conceal" | "renderNode" : TConstructor extends RenderableConstructor<ImageRenderable> ? NonStyledProps | "source" : NonStyledProps;
|
|
17
|
+
export type GetNonStyledProperties<TConstructor> = TConstructor extends RenderableConstructor<TextRenderable> ? NonStyledProps | "content" : TConstructor extends RenderableConstructor<BoxRenderable> ? NonStyledProps | "title" | "bottomTitle" : TConstructor extends RenderableConstructor<ASCIIFontRenderable> ? NonStyledProps | "text" | "selectable" : TConstructor extends RenderableConstructor<InputRenderable> ? NonStyledProps | "placeholder" | "value" : TConstructor extends RenderableConstructor<TextareaRenderable> ? NonStyledProps | "placeholder" | "initialValue" : TConstructor extends RenderableConstructor<CodeRenderable> ? NonStyledProps | "content" | "filetype" | "syntaxStyle" | "treeSitterClient" | "conceal" | "drawUnstyledText" : TConstructor extends RenderableConstructor<MarkdownRenderable> ? NonStyledProps | "content" | "syntaxStyle" | "treeSitterClient" | "conceal" | "renderNode" : TConstructor extends RenderableConstructor<ImageRenderable> ? NonStyledProps | "source" : TConstructor extends RenderableConstructor<VideoRenderable> ? NonStyledProps | "source" | "autoplay" | "loop" | "audio" | "muted" | "volume" | "avSyncOffsetMs" | "maxFps" : NonStyledProps;
|
|
18
18
|
/** Base props for container components that accept children */
|
|
19
19
|
type ContainerProps<TOptions> = TOptions & {
|
|
20
20
|
children?: React.ReactNode;
|
|
@@ -53,6 +53,7 @@ export type TextareaProps = ComponentProps<TextareaOptions, TextareaRenderable>
|
|
|
53
53
|
};
|
|
54
54
|
export type CodeProps = ComponentProps<CodeOptions, CodeRenderable>;
|
|
55
55
|
export type ImageProps = ComponentProps<ImageRenderableOptions, ImageRenderable>;
|
|
56
|
+
export type VideoProps = ComponentProps<VideoRenderableOptions, VideoRenderable>;
|
|
56
57
|
export type MarkdownProps = ComponentProps<MarkdownOptions, MarkdownRenderable>;
|
|
57
58
|
export type DiffProps = ComponentProps<DiffRenderableOptions, DiffRenderable>;
|
|
58
59
|
export type SelectProps = ComponentProps<SelectRenderableOptions, SelectRenderable> & {
|