@opentui/react 0.5.2 → 0.5.4
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/{chunk-6ew4m133.js → chunk-sxh319c2.js} +1 -1
- package/index.js +8 -7
- package/package.json +2 -2
- package/test-utils.js +1 -1
|
@@ -168,7 +168,7 @@ import { ImageRenderable as ImageRenderable2, TextNodeRenderable as TextNodeRend
|
|
|
168
168
|
// package.json
|
|
169
169
|
var package_default = {
|
|
170
170
|
name: "@opentui/react",
|
|
171
|
-
version: "0.5.
|
|
171
|
+
version: "0.5.4",
|
|
172
172
|
description: "React renderer for building terminal user interfaces using OpenTUI core",
|
|
173
173
|
license: "MIT",
|
|
174
174
|
repository: {
|
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getComponentCatalogue,
|
|
12
12
|
jsxDEV,
|
|
13
13
|
useAppContext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-sxh319c2.js";
|
|
15
15
|
import"./chunk-2mx7fq49.js";
|
|
16
16
|
// src/hooks/use-blur.ts
|
|
17
17
|
import { useEffect } from "react";
|
|
@@ -132,11 +132,12 @@ var useTerminalDimensions = () => {
|
|
|
132
132
|
};
|
|
133
133
|
// src/hooks/use-timeline.ts
|
|
134
134
|
import { engine, Timeline } from "@opentui/core";
|
|
135
|
-
import { useEffect as useEffect7 } from "react";
|
|
135
|
+
import { useEffect as useEffect7, useState as useState2 } from "react";
|
|
136
136
|
var useTimeline = (options = {}) => {
|
|
137
|
-
const timeline = new Timeline(options);
|
|
137
|
+
const [timeline] = useState2(() => new Timeline(options));
|
|
138
|
+
const [autoplay] = useState2(options.autoplay !== false);
|
|
138
139
|
useEffect7(() => {
|
|
139
|
-
if (
|
|
140
|
+
if (autoplay) {
|
|
140
141
|
timeline.play();
|
|
141
142
|
}
|
|
142
143
|
engine.register(timeline);
|
|
@@ -144,14 +145,14 @@ var useTimeline = (options = {}) => {
|
|
|
144
145
|
timeline.pause();
|
|
145
146
|
engine.unregister(timeline);
|
|
146
147
|
};
|
|
147
|
-
}, []);
|
|
148
|
+
}, [autoplay, timeline]);
|
|
148
149
|
return timeline;
|
|
149
150
|
};
|
|
150
151
|
// src/plugins/slot.tsx
|
|
151
152
|
import {
|
|
152
153
|
createSlotRegistry
|
|
153
154
|
} from "@opentui/core";
|
|
154
|
-
import React, { Fragment as Fragment2, useEffect as useEffect8, useMemo, useRef as useRef2, useState as
|
|
155
|
+
import React, { Fragment as Fragment2, useEffect as useEffect8, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
155
156
|
function createReactSlotRegistry(renderer, context, options = {}) {
|
|
156
157
|
return createSlotRegistry(renderer, "react:slot-registry", context, options);
|
|
157
158
|
}
|
|
@@ -225,7 +226,7 @@ function createSlot(registry, options = {}) {
|
|
|
225
226
|
};
|
|
226
227
|
}
|
|
227
228
|
function Slot(props) {
|
|
228
|
-
const [version, setVersion] =
|
|
229
|
+
const [version, setVersion] = useState3(0);
|
|
229
230
|
const registry = props.registry;
|
|
230
231
|
const slotName = String(props.name);
|
|
231
232
|
const renderFailuresByPluginRef = useRef2(new Map);
|
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.5.
|
|
7
|
+
"version": "0.5.4",
|
|
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.5.
|
|
55
|
+
"@opentui/core": "0.5.4",
|
|
56
56
|
"react-reconciler": "^0.33.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|