@opengeni/react 7.5.0-canary.36927100590001 → 7.5.0
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/{chunk-NBOHNRLJ.js → chunk-FNWQBQOK.js} +9 -14
- package/dist/chunk-FNWQBQOK.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/session-ui.js +1 -1
- package/dist/timeline/genie-loading.d.ts +1 -3
- package/package.json +3 -3
- package/src/timeline/activity-rail.tsx +3 -5
- package/src/timeline/genie-loading.tsx +6 -16
- package/dist/chunk-NBOHNRLJ.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/session-ui.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
export type GenieLoadingRenderProps = {
|
|
3
3
|
startedAt: string;
|
|
4
|
-
phase: "preparing" | "waiting";
|
|
5
4
|
detailsOpen: boolean;
|
|
6
5
|
onShowDetails: () => void;
|
|
7
6
|
};
|
|
@@ -26,9 +25,8 @@ export type GenieLoadingOptions = {
|
|
|
26
25
|
};
|
|
27
26
|
export declare const GenieLoadingOptionsContext: import("react").Context<GenieLoadingOptions | undefined>;
|
|
28
27
|
/** Decorative copy never substitutes for a failure or claims measurable progress. */
|
|
29
|
-
export declare function GenieLoading({ startedAt,
|
|
28
|
+
export declare function GenieLoading({ startedAt, onShowDetails, detailsOpen, }: {
|
|
30
29
|
startedAt: string;
|
|
31
|
-
phase?: GenieLoadingRenderProps["phase"];
|
|
32
30
|
onShowDetails: () => void;
|
|
33
31
|
detailsOpen?: boolean;
|
|
34
32
|
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/react",
|
|
3
|
-
"version": "7.5.0
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "React hooks and styled components for OpenGeni: live session streaming, chat composer, message timeline, session status, and fleet views — token-themed (CSS variables), dark-first, built on Tailwind v4 + Radix + Motion.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"@dnd-kit/utilities": "3.2.2",
|
|
154
154
|
"@fontsource-variable/noto-sans-arabic": "5.2.10",
|
|
155
155
|
"@fontsource-variable/noto-sans-jp": "5.2.10",
|
|
156
|
-
"@opengeni/connect": "^0.3.1
|
|
157
|
-
"@opengeni/sdk": "^7.5.0
|
|
156
|
+
"@opengeni/connect": "^0.3.1",
|
|
157
|
+
"@opengeni/sdk": "^7.5.0",
|
|
158
158
|
"clsx": "^2.1.1",
|
|
159
159
|
"dequal": "2.0.3",
|
|
160
160
|
"lucide-react": "^1.8.0",
|
|
@@ -105,8 +105,7 @@ export function ActivityRail({
|
|
|
105
105
|
const providerResponded = phases.some(
|
|
106
106
|
(item) => item.phase === "provider_first_byte" && item.status === "complete",
|
|
107
107
|
);
|
|
108
|
-
const
|
|
109
|
-
const loading =
|
|
108
|
+
const preparing =
|
|
110
109
|
!hasWork &&
|
|
111
110
|
!interrupted &&
|
|
112
111
|
(startupActive ?? (!providerResponded && phases.some((item) => item.status === "running")));
|
|
@@ -165,7 +164,7 @@ export function ActivityRail({
|
|
|
165
164
|
)}
|
|
166
165
|
>
|
|
167
166
|
<AnimatePresence initial={false}>
|
|
168
|
-
{
|
|
167
|
+
{preparing && !debug ? (
|
|
169
168
|
<motion.div
|
|
170
169
|
key="startup"
|
|
171
170
|
initial={{ opacity: 0 }}
|
|
@@ -183,14 +182,13 @@ export function ActivityRail({
|
|
|
183
182
|
>
|
|
184
183
|
<GenieLoading
|
|
185
184
|
startedAt={startedAt}
|
|
186
|
-
phase={responsePending ? "waiting" : "preparing"}
|
|
187
185
|
detailsOpen={detailsOpen}
|
|
188
186
|
onShowDetails={() => setDetailsOpen((open) => !open)}
|
|
189
187
|
/>
|
|
190
188
|
</motion.div>
|
|
191
189
|
) : null}
|
|
192
190
|
</AnimatePresence>
|
|
193
|
-
{detailsOpen && !debug && !
|
|
191
|
+
{detailsOpen && !debug && !preparing ? (
|
|
194
192
|
<button
|
|
195
193
|
type="button"
|
|
196
194
|
className="og-genie-details self-start"
|
|
@@ -4,7 +4,6 @@ import { createContext, useContext, useEffect, useState, type ReactNode } from "
|
|
|
4
4
|
|
|
5
5
|
export type GenieLoadingRenderProps = {
|
|
6
6
|
startedAt: string;
|
|
7
|
-
phase: "preparing" | "waiting";
|
|
8
7
|
detailsOpen: boolean;
|
|
9
8
|
onShowDetails: () => void;
|
|
10
9
|
};
|
|
@@ -56,23 +55,19 @@ const PHRASES = [
|
|
|
56
55
|
"Putting a wish into motion…",
|
|
57
56
|
"A little hocus. A little pocus…",
|
|
58
57
|
];
|
|
59
|
-
const WAITING_PHRASES = ["Waiting for a response…"];
|
|
60
58
|
|
|
61
59
|
/** Decorative copy never substitutes for a failure or claims measurable progress. */
|
|
62
60
|
export function GenieLoading({
|
|
63
61
|
startedAt,
|
|
64
|
-
phase = "preparing",
|
|
65
62
|
onShowDetails,
|
|
66
63
|
detailsOpen = false,
|
|
67
64
|
}: {
|
|
68
65
|
startedAt: string;
|
|
69
|
-
phase?: GenieLoadingRenderProps["phase"];
|
|
70
66
|
onShowDetails: () => void;
|
|
71
67
|
detailsOpen?: boolean;
|
|
72
68
|
}) {
|
|
73
69
|
const options = useContext(GenieLoadingOptionsContext);
|
|
74
|
-
const
|
|
75
|
-
const phrases = options?.phrases?.length ? options.phrases : waiting ? WAITING_PHRASES : PHRASES;
|
|
70
|
+
const phrases = options?.phrases?.length ? options.phrases : PHRASES;
|
|
76
71
|
const theme = useThemeType(undefined);
|
|
77
72
|
const [phrase, setPhrase] = useState(0);
|
|
78
73
|
const [showDetails, setShowDetails] = useState(false);
|
|
@@ -87,7 +82,7 @@ export function GenieLoading({
|
|
|
87
82
|
const timer = window.setInterval(update, 5_000);
|
|
88
83
|
return () => window.clearInterval(timer);
|
|
89
84
|
}, [startedAt, phrases]);
|
|
90
|
-
if (options?.render) return options.render({ startedAt,
|
|
85
|
+
if (options?.render) return options.render({ startedAt, detailsOpen, onShowDetails });
|
|
91
86
|
return (
|
|
92
87
|
<div className="og-genie-loading">
|
|
93
88
|
<div
|
|
@@ -104,17 +99,12 @@ export function GenieLoading({
|
|
|
104
99
|
<div className="og-genie-copy">
|
|
105
100
|
<span className="sr-only" role="status">
|
|
106
101
|
{slow
|
|
107
|
-
? (options?.messages?.slowStatus ??
|
|
108
|
-
|
|
109
|
-
? "Waiting for a response. Taking longer than usual."
|
|
110
|
-
: "Preparing your task. Taking longer than usual."))
|
|
111
|
-
: (options?.messages?.status ??
|
|
112
|
-
(waiting ? "Waiting for a response." : "Preparing your task."))}
|
|
102
|
+
? (options?.messages?.slowStatus ?? "Preparing your task. Taking longer than usual.")
|
|
103
|
+
: (options?.messages?.status ?? "Preparing your task.")}
|
|
113
104
|
</span>
|
|
114
105
|
<span key={slow ? "slow" : phrase} className="og-genie-phrase" aria-hidden="true">
|
|
115
106
|
{slow
|
|
116
|
-
? (options?.messages?.slowText ??
|
|
117
|
-
(waiting ? "Still waiting for a response…" : "A little longer than usual…"))
|
|
107
|
+
? (options?.messages?.slowText ?? "A little longer than usual…")
|
|
118
108
|
: phrases[phrase % phrases.length]}
|
|
119
109
|
</span>
|
|
120
110
|
{showDetails || detailsOpen ? (
|
|
@@ -126,7 +116,7 @@ export function GenieLoading({
|
|
|
126
116
|
>
|
|
127
117
|
{detailsOpen
|
|
128
118
|
? (options?.messages?.hideDetails ?? "Hide details")
|
|
129
|
-
: (options?.messages?.showDetails ??
|
|
119
|
+
: (options?.messages?.showDetails ?? "Behind the magic")}
|
|
130
120
|
<span aria-hidden="true"> ↗</span>
|
|
131
121
|
</button>
|
|
132
122
|
) : null}
|