@rerun-io/web-viewer-react 0.15.1 → 0.16.0-rc.1
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/README.md +4 -4
- package/index.d.ts +4 -0
- package/index.js +6 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ $ npm i @rerun-io/web-viewer-react
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
ℹ️ Note:
|
|
24
|
-
The package version is equal to the supported
|
|
25
|
-
This means that `@rerun-io/web-viewer-react@0.10.0` can only connect to a data source (`.rrd` file, websocket connection, etc.) that originates from a
|
|
24
|
+
The package version is equal to the supported Rerun SDK version.
|
|
25
|
+
This means that `@rerun-io/web-viewer-react@0.10.0` can only connect to a data source (`.rrd` file, websocket connection, etc.) that originates from a Rerun SDK with version `0.10.0`!
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
@@ -35,10 +35,10 @@ export default function App() {
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
The `rrd` in the snippet above should be a URL pointing to either:
|
|
38
|
-
- A hosted `.rrd` file, such as <https://app.rerun.io/version/0.
|
|
38
|
+
- A hosted `.rrd` file, such as <https://app.rerun.io/version/0.16.0-rc.1/examples/dna.rrd>
|
|
39
39
|
- A WebSocket connection to the SDK opened via the [`serve`](https://www.rerun.io/docs/reference/sdk-operating-modes#serve) API
|
|
40
40
|
|
|
41
|
-
If `rrd` is not set, the
|
|
41
|
+
If `rrd` is not set, the Viewer will display the same welcome screen as <https://app.rerun.io>.
|
|
42
42
|
|
|
43
43
|
ℹ️ Note:
|
|
44
44
|
This package only targets recent versions of browsers.
|
package/index.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ declare module '@rerun-io/web-viewer-react' {
|
|
|
39
39
|
* CSS height of the viewer's parent div
|
|
40
40
|
*/
|
|
41
41
|
height?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to hide the welcome screen. Default is `false`.
|
|
44
|
+
*/
|
|
45
|
+
hide_welcome_screen?: boolean | undefined;
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
48
|
|
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as rerun from "@rerun-io/web-viewer";
|
|
|
8
8
|
* and close any URLs which are not present.
|
|
9
9
|
* @property {string} [width] CSS width of the viewer's parent div
|
|
10
10
|
* @property {string} [height] CSS height of the viewer's parent div
|
|
11
|
+
* @property {boolean} [hide_welcome_screen] Whether to hide the welcome screen. Default is `false`.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -27,17 +28,21 @@ export default class WebViewer extends React.Component {
|
|
|
27
28
|
/** @type {string[]} */
|
|
28
29
|
#recordings = [];
|
|
29
30
|
|
|
31
|
+
/** @type {boolean} */
|
|
32
|
+
#hide_welcome_screen = false;
|
|
33
|
+
|
|
30
34
|
/** @param {Props} props */
|
|
31
35
|
constructor(props) {
|
|
32
36
|
super(props);
|
|
33
37
|
|
|
34
38
|
this.#handle = new rerun.WebViewer();
|
|
35
39
|
this.#recordings = toArray(props.rrd);
|
|
40
|
+
this.#hide_welcome_screen = props.hide_welcome_screen ?? false;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
componentDidMount() {
|
|
39
44
|
const current = /** @type {HTMLDivElement} */ (this.#parent.current);
|
|
40
|
-
this.#handle.start(this.#recordings, current);
|
|
45
|
+
this.#handle.start(this.#recordings, current, this.#hide_welcome_screen);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
componentDidUpdate(/** @type {Props} */ prevProps) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rerun-io/web-viewer-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0-rc.1",
|
|
4
4
|
"description": "Embed the Rerun web viewer in your React app",
|
|
5
5
|
"licenses": [
|
|
6
6
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"tsconfig.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@rerun-io/web-viewer": "0.
|
|
42
|
+
"@rerun-io/web-viewer": "0.16.0-rc.1",
|
|
43
43
|
"@types/react": "^18.2.33",
|
|
44
44
|
"react": "^18.2.0"
|
|
45
45
|
},
|