@rstreamlabs/react 1.6.3 → 1.6.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useRstream
3
- } from "./chunk-2WDUPTYY.mjs";
3
+ } from "./chunk-KZOS6ZKQ.mjs";
4
4
 
5
5
  // src/providers/rstream.tsx
6
6
  import * as React from "react";
@@ -15,10 +15,10 @@ function useRstreamContext() {
15
15
  return ctx;
16
16
  }
17
17
  function RstreamProvider({ options, children }) {
18
- const { error, tunnels, clients } = useRstream(options);
18
+ const { state, error, tunnels, clients } = useRstream(options);
19
19
  const value = React.useMemo(
20
- () => ({ error, tunnels, clients }),
21
- [error, tunnels, clients]
20
+ () => ({ state, error, tunnels, clients }),
21
+ [state, error, tunnels, clients]
22
22
  );
23
23
  const content = isRenderProp(children) ? children(value) : children;
24
24
  return /* @__PURE__ */ jsx(RstreamContext.Provider, { value, children: content });
@@ -124,7 +124,7 @@ function useRstream(options) {
124
124
  setTunnels([]);
125
125
  }
126
126
  }, [options, state]);
127
- return { error, tunnels, clients };
127
+ return { state, error, tunnels, clients };
128
128
  }
129
129
 
130
130
  export {
@@ -30,6 +30,7 @@ interface UseRstreamOptions extends Partial<WatchConfig> {
30
30
  * @returns An object with the current error (if any), and arrays of tunnels and clients.
31
31
  */
32
32
  declare function useRstream(options?: UseRstreamOptions): {
33
+ state: "disconnected" | "connecting" | "connected";
33
34
  error: {
34
35
  message: string;
35
36
  type: "warning" | "danger";
@@ -30,6 +30,7 @@ interface UseRstreamOptions extends Partial<WatchConfig> {
30
30
  * @returns An object with the current error (if any), and arrays of tunnels and clients.
31
31
  */
32
32
  declare function useRstream(options?: UseRstreamOptions): {
33
+ state: "disconnected" | "connecting" | "connected";
33
34
  error: {
34
35
  message: string;
35
36
  type: "warning" | "danger";
@@ -160,7 +160,7 @@ function useRstream(options) {
160
160
  setTunnels([]);
161
161
  }
162
162
  }, [options, state]);
163
- return { error, tunnels, clients };
163
+ return { state, error, tunnels, clients };
164
164
  }
165
165
  // Annotate the CommonJS export names for ESM import in node:
166
166
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  import "../chunk-2JFL7TS5.mjs";
2
2
  import {
3
3
  useRstream
4
- } from "../chunk-2WDUPTYY.mjs";
4
+ } from "../chunk-KZOS6ZKQ.mjs";
5
5
  export {
6
6
  useRstream
7
7
  };
package/dist/index.js CHANGED
@@ -309,7 +309,7 @@ function useRstream(options) {
309
309
  setTunnels([]);
310
310
  }
311
311
  }, [options, state]);
312
- return { error, tunnels, clients };
312
+ return { state, error, tunnels, clients };
313
313
  }
314
314
 
315
315
  // src/providers/rstream.tsx
@@ -325,10 +325,10 @@ function useRstreamContext() {
325
325
  return ctx;
326
326
  }
327
327
  function RstreamProvider({ options, children }) {
328
- const { error, tunnels, clients } = useRstream(options);
328
+ const { state, error, tunnels, clients } = useRstream(options);
329
329
  const value = React3.useMemo(
330
- () => ({ error, tunnels, clients }),
331
- [error, tunnels, clients]
330
+ () => ({ state, error, tunnels, clients }),
331
+ [state, error, tunnels, clients]
332
332
  );
333
333
  const content = isRenderProp(children) ? children(value) : children;
334
334
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RstreamContext.Provider, { value, children: content });
package/dist/index.mjs CHANGED
@@ -5,10 +5,10 @@ import "./chunk-2JFL7TS5.mjs";
5
5
  import {
6
6
  RstreamProvider,
7
7
  useRstreamContext
8
- } from "./chunk-MJTSTB5H.mjs";
8
+ } from "./chunk-GFWVYPSE.mjs";
9
9
  import {
10
10
  useRstream
11
- } from "./chunk-2WDUPTYY.mjs";
11
+ } from "./chunk-KZOS6ZKQ.mjs";
12
12
  export {
13
13
  RstreamProvider,
14
14
  WebTTYTerminal,
@@ -5,6 +5,7 @@ import '@rstreamlabs/rstream';
5
5
 
6
6
  type RstreamContextValue = ReturnType<typeof useRstream>;
7
7
  declare function useRstreamContext(): {
8
+ state: "disconnected" | "connecting" | "connected";
8
9
  error: {
9
10
  message: string;
10
11
  type: "warning" | "danger";
@@ -5,6 +5,7 @@ import '@rstreamlabs/rstream';
5
5
 
6
6
  type RstreamContextValue = ReturnType<typeof useRstream>;
7
7
  declare function useRstreamContext(): {
8
+ state: "disconnected" | "connecting" | "connected";
8
9
  error: {
9
10
  message: string;
10
11
  type: "warning" | "danger";
@@ -161,7 +161,7 @@ function useRstream(options) {
161
161
  setTunnels([]);
162
162
  }
163
163
  }, [options, state]);
164
- return { error, tunnels, clients };
164
+ return { state, error, tunnels, clients };
165
165
  }
166
166
 
167
167
  // src/providers/rstream.tsx
@@ -177,10 +177,10 @@ function useRstreamContext() {
177
177
  return ctx;
178
178
  }
179
179
  function RstreamProvider({ options, children }) {
180
- const { error, tunnels, clients } = useRstream(options);
180
+ const { state, error, tunnels, clients } = useRstream(options);
181
181
  const value = React2.useMemo(
182
- () => ({ error, tunnels, clients }),
183
- [error, tunnels, clients]
182
+ () => ({ state, error, tunnels, clients }),
183
+ [state, error, tunnels, clients]
184
184
  );
185
185
  const content = isRenderProp(children) ? children(value) : children;
186
186
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RstreamContext.Provider, { value, children: content });
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RstreamProvider,
3
3
  useRstreamContext
4
- } from "../chunk-MJTSTB5H.mjs";
5
- import "../chunk-2WDUPTYY.mjs";
4
+ } from "../chunk-GFWVYPSE.mjs";
5
+ import "../chunk-KZOS6ZKQ.mjs";
6
6
  export {
7
7
  RstreamProvider,
8
8
  useRstreamContext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rstreamlabs/react",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "React hooks and components for building rstream-enabled UIs.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",