@viamrobotics/motion-tools 0.3.0 → 0.3.2

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.
@@ -32,31 +32,36 @@
32
32
  }}
33
33
  />
34
34
 
35
- <Canvas renderMode="always">
36
- <World>
37
- <SceneProviders>
38
- {#snippet children({ focus })}
39
- <Scene>
40
- {@render appChildren?.()}
41
-
42
- {#if enableXR.current}
43
- <XR />
44
- {/if}
45
- </Scene>
35
+ <div
36
+ class="relative h-full w-full"
37
+ id="motion-tools-root"
38
+ >
39
+ <Canvas renderMode="always">
40
+ <World>
41
+ <SceneProviders>
42
+ {#snippet children({ focus })}
43
+ <Scene>
44
+ {@render appChildren?.()}
46
45
 
47
- <DomPortal>
48
- <Details />
49
- </DomPortal>
46
+ {#if enableXR.current}
47
+ <XR />
48
+ {/if}
49
+ </Scene>
50
50
 
51
- {#if !focus}
52
51
  <DomPortal>
53
- <TreeContainer />
52
+ <Details />
54
53
  </DomPortal>
55
- {/if}
56
- {/snippet}
57
- </SceneProviders>
58
- </World>
59
- </Canvas>
54
+
55
+ {#if !focus}
56
+ <DomPortal>
57
+ <TreeContainer />
58
+ </DomPortal>
59
+ {/if}
60
+ {/snippet}
61
+ </SceneProviders>
62
+ </World>
63
+ </Canvas>
64
+ </div>
60
65
 
61
66
  {#if enableXR.current}
62
67
  <XRButton mode="immersive-ar" />
@@ -13,7 +13,7 @@
13
13
 
14
14
  {#if object}
15
15
  {@const { geometry, pose } = object}
16
- <div class="border-medium bg-extralight fixed top-0 right-0 z-10 m-2 w-60 border p-2 text-xs">
16
+ <div class="border-medium bg-extralight absolute top-0 right-0 z-10 m-2 w-60 border p-2 text-xs">
17
17
  <div class="flex items-center justify-between gap-2 pb-2">
18
18
  <div class="flex items-center gap-1">
19
19
  <button>
@@ -1,10 +1,17 @@
1
1
  <script lang="ts">
2
- let { children } = $props()
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface Props {
5
+ selector?: string
6
+ children: Snippet
7
+ }
8
+
9
+ let { children, selector = 'body' }: Props = $props()
3
10
 
4
11
  let div: HTMLDivElement
5
12
 
6
13
  $effect(() => {
7
- document.body.append(div)
14
+ document.querySelector(selector)?.append(div)
8
15
  return () => {
9
16
  // eslint-disable-next-line svelte/no-dom-manipulating
10
17
  div.remove()
@@ -1,5 +1,8 @@
1
- declare const DomPortal: import("svelte").Component<{
2
- children: any;
3
- }, {}, "">;
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ selector?: string;
4
+ children: Snippet;
5
+ }
6
+ declare const DomPortal: import("svelte").Component<Props, {}, "">;
4
7
  type DomPortal = ReturnType<typeof DomPortal>;
5
8
  export default DomPortal;
@@ -44,7 +44,7 @@
44
44
  />
45
45
 
46
46
  <button
47
- class="fixed top-2 left-2 p-2"
47
+ class="absolute top-2 left-2 p-2"
48
48
  onclick={() => (showTreeview.current = !showTreeview.current)}
49
49
  >
50
50
  <ListTree />
@@ -52,7 +52,7 @@
52
52
 
53
53
  {#if showTreeview.current}
54
54
  <div
55
- class="bg-extralight border-medium fixed top-0 left-0 m-2 overflow-y-auto border text-xs"
55
+ class="bg-extralight border-medium absolute top-0 left-0 m-2 overflow-y-auto border text-xs"
56
56
  in:fly={{ duration: 250, x: -100 }}
57
57
  out:fly={{ duration: 250, x: -100 }}
58
58
  >
@@ -20,7 +20,6 @@ export const providePointclouds = (partID) => {
20
20
  const options = $derived(clients.map((cameraClient) => {
21
21
  const name = cameraClient.current?.name ?? '';
22
22
  const interval = refreshRates.get('Pointclouds');
23
- console.log(interval);
24
23
  return queryOptions({
25
24
  enabled: interval !== -1 && cameraClient.current !== undefined,
26
25
  refetchInterval: interval === 0 ? false : interval,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",