@rerun-io/web-viewer-react 0.0.5 → 0.0.7

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/index.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ declare module '@rerun-io/web-viewer-react' {
2
+ /**
3
+ * Wrapper for `WebViewer` from the `@rerun-io/web-viewer`.
4
+ *
5
+ * This component creates and manages the web viewer's `canvas` element.
6
+ *
7
+ * The web viewer is restarted each time `rrd` changes.
8
+ * Starting the web viewer is an expensive operation, so be careful with changing it too often!
9
+ *
10
+ * */
11
+ export default function WebViewer(props: Props): React.DetailedReactHTMLElement<{
12
+ className: string;
13
+ style: {
14
+ width: string;
15
+ height: string;
16
+ position: "relative";
17
+ };
18
+ ref: React.RefObject<HTMLDivElement>;
19
+ }, HTMLDivElement>;
20
+ export type React = typeof React;
21
+ export type Props = {
22
+ /**
23
+ * URL of the `.rrd` file to load
24
+ */
25
+ rrd: string;
26
+ /**
27
+ * CSS width of the viewer's parent div
28
+ */
29
+ width?: string | undefined;
30
+ /**
31
+ * CSS height of the viewer's parent div
32
+ */
33
+ height?: string | undefined;
34
+ };
35
+ }
36
+
37
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": 3,
3
+ "file": "index.d.ts",
4
+ "names": [],
5
+ "sources": [],
6
+ "sourcesContent": [],
7
+ "mappings": ""
8
+ }
package/index.js CHANGED
@@ -39,7 +39,7 @@ export default function WebViewer(props) {
39
39
  if (parent.current) {
40
40
  // Start the web viewer when the parent div is mounted to the DOM.
41
41
  const w = new rerun.WebViewer();
42
- w.start(rrd);
42
+ w.start(rrd, parent.current);
43
43
  viewer.current = w;
44
44
  return () => {
45
45
  // Stop the web viewer when the component is unmounted.
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@rerun-io/web-viewer-react",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Embed the Rerun web viewer in your React app",
5
5
  "private": false,
6
- "scripts": {},
6
+ "scripts": {
7
+ "build:types": "dts-buddy",
8
+ "prepublishOnly": "dts-buddy"
9
+ },
7
10
  "repository": {
8
11
  "type": "git",
9
12
  "url": "git+https://github.com/rerun-io/rerun.git"