@viamrobotics/motion-tools 0.3.2 → 0.3.3
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.
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
createPartIDContext(() => partID)
|
|
23
23
|
|
|
24
24
|
const enableXR = new PersistedState('enable-xr', false)
|
|
25
|
+
|
|
26
|
+
let root: HTMLElement
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
29
|
<svelte:window
|
|
@@ -34,7 +36,7 @@
|
|
|
34
36
|
|
|
35
37
|
<div
|
|
36
38
|
class="relative h-full w-full"
|
|
37
|
-
|
|
39
|
+
bind:this={root}
|
|
38
40
|
>
|
|
39
41
|
<Canvas renderMode="always">
|
|
40
42
|
<World>
|
|
@@ -48,12 +50,12 @@
|
|
|
48
50
|
{/if}
|
|
49
51
|
</Scene>
|
|
50
52
|
|
|
51
|
-
<DomPortal>
|
|
53
|
+
<DomPortal element={root}>
|
|
52
54
|
<Details />
|
|
53
55
|
</DomPortal>
|
|
54
56
|
|
|
55
57
|
{#if !focus}
|
|
56
|
-
<DomPortal>
|
|
58
|
+
<DomPortal element={root}>
|
|
57
59
|
<TreeContainer />
|
|
58
60
|
</DomPortal>
|
|
59
61
|
{/if}
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
|
|
5
|
+
element?: HTMLElement
|
|
6
6
|
children: Snippet
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
let { children,
|
|
9
|
+
let { children, element }: Props = $props()
|
|
10
10
|
|
|
11
11
|
let div: HTMLDivElement
|
|
12
12
|
|
|
13
13
|
$effect(() => {
|
|
14
|
-
document.
|
|
14
|
+
const parent = element ?? document.body
|
|
15
|
+
parent.append(div)
|
|
15
16
|
return () => {
|
|
16
17
|
// eslint-disable-next-line svelte/no-dom-manipulating
|
|
17
18
|
div.remove()
|