@viamrobotics/motion-tools 1.14.0 → 1.15.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/dist/FrameConfigUpdater.svelte.d.ts +2 -2
- package/dist/HoverUpdater.svelte.d.ts +1 -1
- package/dist/attribute.js +1 -1
- package/dist/buf/common/v1/common_pb.d.ts +45 -0
- package/dist/buf/common/v1/common_pb.js +65 -0
- package/dist/color.d.ts +1 -1
- package/dist/color.js +2 -2
- package/dist/components/App.svelte +27 -21
- package/dist/components/App.svelte.d.ts +1 -1
- package/dist/components/BatchedArrows.svelte +5 -3
- package/dist/components/Camera.svelte +1 -0
- package/dist/components/CameraControls.svelte +5 -3
- package/dist/components/Entities/Arrows/ArrowGroups.svelte +6 -3
- package/dist/components/Entities/Arrows/Arrows.svelte +6 -3
- package/dist/components/Entities/Entities.svelte +7 -5
- package/dist/components/Entities/Frame.svelte +8 -5
- package/dist/components/Entities/Frame.svelte.d.ts +2 -2
- package/dist/components/Entities/GLTF.svelte +8 -5
- package/dist/components/Entities/GLTF.svelte.d.ts +2 -2
- package/dist/components/Entities/Geometry.svelte +13 -6
- package/dist/components/Entities/Line.svelte +8 -5
- package/dist/components/Entities/Line.svelte.d.ts +1 -1
- package/dist/components/Entities/LineDots.svelte +1 -1
- package/dist/components/Entities/LineGeometry.svelte +1 -1
- package/dist/components/Entities/Mesh.svelte +8 -5
- package/dist/components/Entities/Points.svelte +9 -6
- package/dist/components/Entities/Points.svelte.d.ts +2 -2
- package/dist/components/Entities/Pose.svelte +4 -3
- package/dist/components/Entities/hooks/useEntityEvents.svelte.d.ts +1 -1
- package/dist/components/Entities/hooks/useEntityEvents.svelte.js +2 -2
- package/dist/components/FileDrop/FileDrop.svelte +10 -6
- package/dist/components/FileDrop/file-dropper.d.ts +1 -1
- package/dist/components/FileDrop/pcd-dropper.js +1 -1
- package/dist/components/FileDrop/ply-dropper.js +1 -1
- package/dist/components/FileDrop/snapshot-dropper.js +1 -1
- package/dist/components/Focus.svelte +4 -2
- package/dist/components/KeyboardControls.svelte +4 -2
- package/dist/components/Lasso/Debug.svelte +5 -2
- package/dist/components/Lasso/Lasso.svelte +9 -6
- package/dist/components/Lasso/Tool.svelte +10 -7
- package/dist/components/MeasureTool/MeasurePoint.svelte +2 -1
- package/dist/components/MeasureTool/MeasurePoint.svelte.d.ts +1 -1
- package/dist/components/MeasureTool/MeasureTool.svelte +7 -5
- package/dist/components/PCD.svelte +4 -3
- package/dist/components/PointerMissBox.svelte +3 -2
- package/dist/components/Scene.svelte +12 -9
- package/dist/components/SceneProviders.svelte +20 -18
- package/dist/components/Selected.svelte +6 -20
- package/dist/components/Snapshot.svelte +8 -5
- package/dist/components/StaticGeometries.svelte +10 -7
- package/dist/components/hover/HoveredEntities.svelte +2 -1
- package/dist/components/hover/HoveredEntity.svelte +2 -1
- package/dist/components/hover/HoveredEntityTooltip.svelte +1 -0
- package/dist/components/hover/LinkedHoveredEntity.svelte +7 -5
- package/dist/components/overlay/AddFrames.svelte +64 -0
- package/dist/components/overlay/AddFrames.svelte.d.ts +3 -0
- package/dist/components/overlay/AddRelationship.svelte +4 -2
- package/dist/components/overlay/Details.svelte +23 -21
- package/dist/components/overlay/FloatingPanel.svelte +47 -5
- package/dist/components/overlay/FloatingPanel.svelte.d.ts +1 -0
- package/dist/components/overlay/LiveUpdatesBanner.svelte +1 -0
- package/dist/components/overlay/Logs.svelte +4 -2
- package/dist/components/overlay/Popover.svelte +3 -2
- package/dist/components/overlay/RefreshRate.svelte +4 -2
- package/dist/components/overlay/dashboard/Button.svelte +2 -1
- package/dist/components/overlay/dashboard/Button.svelte.d.ts +1 -1
- package/dist/components/overlay/dashboard/Dashboard.svelte +3 -1
- package/dist/components/overlay/left-pane/Drawer.svelte +3 -2
- package/dist/components/overlay/left-pane/Tree.svelte +27 -38
- package/dist/components/overlay/left-pane/TreeContainer.svelte +17 -47
- package/dist/components/overlay/left-pane/TreeContainer.svelte.d.ts +1 -1
- package/dist/components/overlay/settings/Settings.svelte +37 -10
- package/dist/components/overlay/settings/Tabs.svelte +2 -1
- package/dist/components/overlay/widgets/ArmPositions.svelte +3 -2
- package/dist/components/overlay/widgets/Camera.svelte +6 -5
- package/dist/components/weblab/WeblabActive.svelte +2 -1
- package/dist/components/xr/ArmTeleop.svelte +7 -6
- package/dist/components/xr/BentPlaneGeometry.svelte +3 -2
- package/dist/components/xr/CameraFeed.svelte +2 -0
- package/dist/components/xr/Controllers.svelte +5 -3
- package/dist/components/xr/Draggable.svelte +4 -3
- package/dist/components/xr/HandCollider.svelte +2 -1
- package/dist/components/xr/JointLimitsWidget.svelte +1 -0
- package/dist/components/xr/OriginMarker.svelte +2 -1
- package/dist/components/xr/PointDistance.svelte +3 -2
- package/dist/components/xr/XR.svelte +8 -6
- package/dist/components/xr/XRConfigPanel.svelte +4 -3
- package/dist/components/xr/XRControllerSettings.svelte +2 -1
- package/dist/components/xr/XRToast.svelte +4 -3
- package/dist/ecs/traits.d.ts +1 -1
- package/dist/ecs/traits.js +1 -1
- package/dist/ecs/useQuery.svelte.js +1 -1
- package/dist/frame.js +1 -1
- package/dist/hooks/use3DModels.svelte.js +3 -3
- package/dist/hooks/useConfigFrames.svelte.js +3 -3
- package/dist/hooks/useDrawAPI.svelte.js +9 -9
- package/dist/hooks/useFramelessComponents.svelte.js +1 -1
- package/dist/hooks/useFrames.svelte.js +7 -7
- package/dist/hooks/useGeometries.svelte.js +8 -8
- package/dist/hooks/useMouseRaycaster.svelte.d.ts +1 -1
- package/dist/hooks/useMouseRaycaster.svelte.js +1 -1
- package/dist/hooks/usePartConfig.svelte.d.ts +1 -1
- package/dist/hooks/usePartConfig.svelte.js +3 -3
- package/dist/hooks/usePointcloudObjects.svelte.js +6 -6
- package/dist/hooks/usePointclouds.svelte.js +5 -5
- package/dist/hooks/usePose.svelte.js +7 -7
- package/dist/hooks/useSelection.svelte.d.ts +1 -1
- package/dist/hooks/useWeblabs.svelte.d.ts +1 -0
- package/dist/hooks/useWeblabs.svelte.js +15 -3
- package/dist/hooks/useWorldState.svelte.js +8 -8
- package/dist/plugins/bvh.svelte.js +2 -2
- package/dist/snapshot.d.ts +2 -2
- package/dist/snapshot.js +4 -4
- package/dist/three/BatchedArrow.d.ts +1 -1
- package/dist/three/BatchedArrow.js +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.d.ts +1 -1
- package/dist/three/InstancedArrows/InstancedArrows.js +3 -3
- package/dist/three/InstancedArrows/box.js +1 -1
- package/dist/three/InstancedArrows/geometry.js +1 -1
- package/dist/three/InstancedArrows/raycast.d.ts +1 -1
- package/dist/three/InstancedArrows/raycast.js +1 -1
- package/dist/three/OBBHelper.d.ts +2 -3
- package/dist/three/OBBHelper.js +64 -43
- package/dist/three/OrientationVector.js +1 -1
- package/dist/transform.js +1 -1
- package/package.json +7 -6
- package/dist/components/overlay/left-pane/AddFrames.svelte +0 -30
- package/dist/components/overlay/left-pane/AddFrames.svelte.d.ts +0 -18
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte +0 -41
- package/dist/hooks/__tests__/fixtures/ResizableTestWrapper.svelte.d.ts +0 -6
- package/dist/hooks/useResizable.svelte.d.ts +0 -12
- package/dist/hooks/useResizable.svelte.js +0 -46
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
module
|
|
3
3
|
lang="ts"
|
|
4
4
|
>
|
|
5
|
+
import { BufferAttribute, MathUtils, Quaternion, Vector3 } from 'three'
|
|
6
|
+
|
|
5
7
|
import { OrientationVector } from '../../three/OrientationVector'
|
|
6
|
-
import { Quaternion, Vector3, MathUtils, BufferAttribute } from 'three'
|
|
7
8
|
|
|
8
9
|
const vec3 = new Vector3()
|
|
9
10
|
const quaternion = new Quaternion()
|
|
@@ -12,24 +13,25 @@
|
|
|
12
13
|
|
|
13
14
|
<script lang="ts">
|
|
14
15
|
import { draggable } from '@neodrag/svelte'
|
|
16
|
+
import { isInstanceOf, useTask } from '@threlte/core'
|
|
17
|
+
import { Button, Icon, Input, Select, Tooltip } from '@viamrobotics/prime-core'
|
|
15
18
|
import { Check, Copy } from 'lucide-svelte'
|
|
16
|
-
|
|
17
|
-
import
|
|
19
|
+
|
|
20
|
+
import AddRelationship from './AddRelationship.svelte'
|
|
21
|
+
import { relations, traits, useTrait, useWorld } from '../../ecs'
|
|
22
|
+
import { FrameConfigUpdater } from '../../FrameConfigUpdater.svelte'
|
|
23
|
+
import { useConfigFrames } from '../../hooks/useConfigFrames.svelte'
|
|
24
|
+
import { useCameraControls } from '../../hooks/useControls.svelte'
|
|
25
|
+
import { useEnvironment } from '../../hooks/useEnvironment.svelte'
|
|
26
|
+
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
27
|
+
import { usePartConfig } from '../../hooks/usePartConfig.svelte'
|
|
28
|
+
import { useResourceByName } from '../../hooks/useResourceByName.svelte'
|
|
18
29
|
import {
|
|
19
|
-
useSelectedEntity,
|
|
20
30
|
useFocusedEntity,
|
|
21
31
|
useFocusedObject3d,
|
|
32
|
+
useSelectedEntity,
|
|
22
33
|
useSelectedObject3d,
|
|
23
34
|
} from '../../hooks/useSelection.svelte'
|
|
24
|
-
import { useConfigFrames } from '../../hooks/useConfigFrames.svelte'
|
|
25
|
-
import { usePartConfig } from '../../hooks/usePartConfig.svelte'
|
|
26
|
-
import { FrameConfigUpdater } from '../../FrameConfigUpdater.svelte'
|
|
27
|
-
import { useEnvironment } from '../../hooks/useEnvironment.svelte'
|
|
28
|
-
import { traits, useTrait, useWorld, relations } from '../../ecs'
|
|
29
|
-
import { useResourceByName } from '../../hooks/useResourceByName.svelte'
|
|
30
|
-
import { useCameraControls } from '../../hooks/useControls.svelte'
|
|
31
|
-
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
32
|
-
import AddRelationship from './AddRelationship.svelte'
|
|
33
35
|
import { createPose } from '../../transform'
|
|
34
36
|
|
|
35
37
|
const { ...rest } = $props()
|
|
@@ -259,18 +261,18 @@
|
|
|
259
261
|
id="details-panel"
|
|
260
262
|
class="border-medium bg-extralight absolute top-0 right-0 z-4 m-2 {showEditFrameOptions
|
|
261
263
|
? 'w-80'
|
|
262
|
-
: 'w-60'} border p-2 text-xs"
|
|
264
|
+
: 'w-60'} border p-2 text-xs dark:text-black"
|
|
263
265
|
use:draggable={{
|
|
264
266
|
bounds: 'body',
|
|
265
267
|
handle: dragElement,
|
|
266
268
|
}}
|
|
267
269
|
{...rest}
|
|
268
270
|
>
|
|
269
|
-
<div
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
<div
|
|
272
|
+
class="flex cursor-move items-center justify-between gap-2 pb-2"
|
|
273
|
+
bind:this={dragElement}
|
|
274
|
+
>
|
|
275
|
+
<div class="flex w-[90%] items-center gap-1">
|
|
274
276
|
<strong class="overflow-hidden text-nowrap text-ellipsis">{name.current}</strong>
|
|
275
277
|
<span class="text-subtle-2">{resourceName?.subtype}</span>
|
|
276
278
|
</div>
|
|
@@ -636,9 +638,9 @@
|
|
|
636
638
|
{/if}
|
|
637
639
|
</div>
|
|
638
640
|
|
|
639
|
-
<h3 class="text-subtle-2 pt-3 pb-2">Relationships</h3>
|
|
640
|
-
|
|
641
641
|
{#if linkedEntities.current.length > 0}
|
|
642
|
+
<h3 class="text-subtle-2 pt-3 pb-2">Relationships</h3>
|
|
643
|
+
|
|
642
644
|
<div>
|
|
643
645
|
<div class="mt-0.5 flex flex-col gap-1">
|
|
644
646
|
<strong class="font-semibold">Linked entities</strong>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
-
import { Icon } from '@viamrobotics/prime-core'
|
|
4
3
|
|
|
4
|
+
import { Icon } from '@viamrobotics/prime-core'
|
|
5
5
|
import * as floatingPanel from '@zag-js/floating-panel'
|
|
6
6
|
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
7
7
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
defaultSize?: { width: number; height: number }
|
|
11
11
|
defaultPosition?: { x: number; y: number }
|
|
12
12
|
exitable?: boolean
|
|
13
|
+
resizable?: boolean
|
|
13
14
|
persistRect?: boolean
|
|
14
15
|
strategy?: 'absolute' | 'fixed'
|
|
15
16
|
isOpen?: boolean
|
|
@@ -19,7 +20,12 @@
|
|
|
19
20
|
let {
|
|
20
21
|
title = '',
|
|
21
22
|
defaultSize = { width: 700, height: 500 },
|
|
23
|
+
defaultPosition = {
|
|
24
|
+
x: globalThis.innerWidth / 2 - defaultSize.width / 2,
|
|
25
|
+
y: globalThis.innerHeight / 2 - defaultSize.height / 2,
|
|
26
|
+
},
|
|
22
27
|
exitable = true,
|
|
28
|
+
resizable = false,
|
|
23
29
|
persistRect = true,
|
|
24
30
|
isOpen = $bindable(false),
|
|
25
31
|
children,
|
|
@@ -30,7 +36,8 @@
|
|
|
30
36
|
const floatingPanelService = useMachine(floatingPanel.machine, () => ({
|
|
31
37
|
id,
|
|
32
38
|
defaultSize,
|
|
33
|
-
|
|
39
|
+
defaultPosition,
|
|
40
|
+
resizable,
|
|
34
41
|
allowOverflow: false,
|
|
35
42
|
persistRect,
|
|
36
43
|
open: isOpen,
|
|
@@ -46,7 +53,7 @@
|
|
|
46
53
|
>
|
|
47
54
|
<div
|
|
48
55
|
{...api.getContentProps()}
|
|
49
|
-
class="border-medium border-1 bg-white"
|
|
56
|
+
class="border-medium border-1 bg-white dark:text-black"
|
|
50
57
|
>
|
|
51
58
|
<div
|
|
52
59
|
{...api.getDragTriggerProps()}
|
|
@@ -56,12 +63,12 @@
|
|
|
56
63
|
{...api.getHeaderProps()}
|
|
57
64
|
class="border-medium flex justify-between border-b p-2"
|
|
58
65
|
>
|
|
59
|
-
<
|
|
66
|
+
<h3
|
|
60
67
|
{...api.getTitleProps()}
|
|
61
68
|
class="text-gray-7 text-xs"
|
|
62
69
|
>
|
|
63
70
|
{title}
|
|
64
|
-
</
|
|
71
|
+
</h3>
|
|
65
72
|
|
|
66
73
|
{#if exitable}
|
|
67
74
|
<div
|
|
@@ -85,5 +92,40 @@
|
|
|
85
92
|
>
|
|
86
93
|
{@render children()}
|
|
87
94
|
</div>
|
|
95
|
+
|
|
96
|
+
{#if resizable}
|
|
97
|
+
<div
|
|
98
|
+
{...api.getResizeTriggerProps({ axis: 'n' })}
|
|
99
|
+
class="h-1.5 max-w-[90%]"
|
|
100
|
+
></div>
|
|
101
|
+
<div
|
|
102
|
+
{...api.getResizeTriggerProps({ axis: 'e' })}
|
|
103
|
+
class="max-h-[90%] w-1.5"
|
|
104
|
+
></div>
|
|
105
|
+
<div
|
|
106
|
+
{...api.getResizeTriggerProps({ axis: 'w' })}
|
|
107
|
+
class="max-h-[90%] w-1.5"
|
|
108
|
+
></div>
|
|
109
|
+
<div
|
|
110
|
+
{...api.getResizeTriggerProps({ axis: 's' })}
|
|
111
|
+
class="h-1.5 max-w-[90%]"
|
|
112
|
+
></div>
|
|
113
|
+
<div
|
|
114
|
+
{...api.getResizeTriggerProps({ axis: 'ne' })}
|
|
115
|
+
class="size-2.5"
|
|
116
|
+
></div>
|
|
117
|
+
<div
|
|
118
|
+
{...api.getResizeTriggerProps({ axis: 'se' })}
|
|
119
|
+
class="size-2.5"
|
|
120
|
+
></div>
|
|
121
|
+
<div
|
|
122
|
+
{...api.getResizeTriggerProps({ axis: 'sw' })}
|
|
123
|
+
class="size-2.5"
|
|
124
|
+
></div>
|
|
125
|
+
<div
|
|
126
|
+
{...api.getResizeTriggerProps({ axis: 'nw' })}
|
|
127
|
+
class="size-2.5"
|
|
128
|
+
></div>
|
|
129
|
+
{/if}
|
|
88
130
|
</div>
|
|
89
131
|
</div>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Portal } from '@threlte/extras'
|
|
3
|
+
import { PersistedState } from 'runed'
|
|
4
|
+
|
|
3
5
|
import { useLogs } from '../../hooks/useLogs.svelte'
|
|
4
|
-
|
|
6
|
+
|
|
5
7
|
import DashboardButton from './dashboard/Button.svelte'
|
|
6
|
-
import
|
|
8
|
+
import FloatingPanel from './FloatingPanel.svelte'
|
|
7
9
|
|
|
8
10
|
const logs = useLogs()
|
|
9
11
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as popover from '@zag-js/popover'
|
|
3
|
-
import { portal, useMachine, normalizeProps } from '@zag-js/svelte'
|
|
4
2
|
import type { Snippet } from 'svelte'
|
|
5
3
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
6
4
|
|
|
5
|
+
import * as popover from '@zag-js/popover'
|
|
6
|
+
import { normalizeProps, portal, useMachine } from '@zag-js/svelte'
|
|
7
|
+
|
|
7
8
|
interface Props {
|
|
8
9
|
trigger: Snippet<[HTMLButtonAttributes]>
|
|
9
10
|
children: Snippet
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<script lang="ts">
|
|
19
|
-
import { Select, IconButton } from '@viamrobotics/prime-core'
|
|
20
|
-
import { useMachineSettings } from '../../hooks/useMachineSettings.svelte'
|
|
21
19
|
import type { Snippet } from 'svelte'
|
|
22
20
|
|
|
21
|
+
import { IconButton, Select } from '@viamrobotics/prime-core'
|
|
22
|
+
|
|
23
|
+
import { useMachineSettings } from '../../hooks/useMachineSettings.svelte'
|
|
24
|
+
|
|
23
25
|
interface Props {
|
|
24
26
|
id: string
|
|
25
27
|
label: string
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { ClassValue, HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements'
|
|
3
|
+
|
|
2
4
|
import { Icon, type IconName, Tooltip } from '@viamrobotics/prime-core'
|
|
3
5
|
import { Ruler } from 'lucide-svelte'
|
|
4
|
-
import type { ClassValue, HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements'
|
|
5
6
|
|
|
6
7
|
interface Props extends HTMLButtonAttributes {
|
|
7
8
|
icon: IconName | 'ruler'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IconName } from '@viamrobotics/prime-core';
|
|
2
1
|
import type { ClassValue, HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements';
|
|
2
|
+
import { type IconName } from '@viamrobotics/prime-core';
|
|
3
3
|
interface Props extends HTMLButtonAttributes {
|
|
4
4
|
icon: IconName | 'ruler';
|
|
5
5
|
active?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
3
2
|
import { PortalTarget } from '@threlte/extras'
|
|
3
|
+
|
|
4
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
5
|
+
|
|
4
6
|
import Button from './Button.svelte'
|
|
5
7
|
|
|
6
8
|
let { dashboard, ...rest } = $props()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PersistedState } from 'runed'
|
|
3
|
-
import { Icon } from '@viamrobotics/prime-core'
|
|
4
2
|
import type { Snippet } from 'svelte'
|
|
5
3
|
|
|
4
|
+
import { Icon } from '@viamrobotics/prime-core'
|
|
5
|
+
import { PersistedState } from 'runed'
|
|
6
|
+
|
|
6
7
|
interface Props {
|
|
7
8
|
name: string
|
|
8
9
|
defaultOpen?: boolean
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
2
3
|
import * as tree from '@zag-js/tree-view'
|
|
3
|
-
import { useMachine, normalizeProps } from '@zag-js/svelte'
|
|
4
4
|
import { ChevronRight, Eye, EyeOff } from 'lucide-svelte'
|
|
5
|
-
import { useVisibility } from '../../../hooks/useVisibility.svelte'
|
|
6
|
-
import type { TreeNode } from './buildTree'
|
|
7
5
|
import { VirtualList } from 'svelte-virtuallists'
|
|
8
|
-
import {
|
|
6
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
7
|
+
|
|
9
8
|
import { traits } from '../../../ecs'
|
|
10
9
|
import { useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
11
|
-
import {
|
|
10
|
+
import { useVisibility } from '../../../hooks/useVisibility.svelte'
|
|
11
|
+
|
|
12
|
+
import type { TreeNode } from './buildTree'
|
|
12
13
|
|
|
13
14
|
const selected = useSelectedEntity()
|
|
14
15
|
const visibility = useVisibility()
|
|
@@ -175,39 +176,27 @@
|
|
|
175
176
|
{/if}
|
|
176
177
|
{/snippet}
|
|
177
178
|
|
|
178
|
-
<div
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
</VirtualList>
|
|
200
|
-
{:else}
|
|
201
|
-
<div
|
|
202
|
-
style="height:{Math.min(8, Math.max(rootChildren.length, 5)) * 32}px;"
|
|
203
|
-
class="overflow-auto"
|
|
204
|
-
>
|
|
205
|
-
{#each rootChildren as node, index (node.entity)}
|
|
206
|
-
{@render treeNode({ node, indexPath: [Number(index)], api })}
|
|
207
|
-
{/each}
|
|
208
|
-
</div>
|
|
209
|
-
{/if}
|
|
210
|
-
</div>
|
|
179
|
+
<div
|
|
180
|
+
{...api.getRootProps()}
|
|
181
|
+
class="h-full overflow-auto text-xs"
|
|
182
|
+
>
|
|
183
|
+
<div {...api.getTreeProps()}>
|
|
184
|
+
{#if rootChildren.length === 0}
|
|
185
|
+
<p class="text-subtle-2 px-2 py-4">No objects displayed</p>
|
|
186
|
+
{:else if rootChildren.length > 200}
|
|
187
|
+
<VirtualList
|
|
188
|
+
class="w-full"
|
|
189
|
+
items={rootChildren}
|
|
190
|
+
>
|
|
191
|
+
{#snippet vl_slot({ index, item })}
|
|
192
|
+
{@render treeNode({ node: item, indexPath: [Number(index)], api })}
|
|
193
|
+
{/snippet}
|
|
194
|
+
</VirtualList>
|
|
195
|
+
{:else}
|
|
196
|
+
{#each rootChildren as node, index (node.entity)}
|
|
197
|
+
{@render treeNode({ node, indexPath: [Number(index)], api })}
|
|
198
|
+
{/each}
|
|
199
|
+
{/if}
|
|
211
200
|
</div>
|
|
212
201
|
</div>
|
|
213
202
|
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
5
|
-
import { provideTreeExpandedContext } from './useExpanded.svelte'
|
|
6
|
-
import AddFrames from './AddFrames.svelte'
|
|
7
|
-
import { useEnvironment } from '../../../hooks/useEnvironment.svelte'
|
|
8
|
-
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
9
|
-
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
10
|
-
import { useFrames } from '../../../hooks/useFrames.svelte'
|
|
2
|
+
import { type Entity, IsExcluded } from 'koota'
|
|
3
|
+
|
|
11
4
|
import { traits, useQuery, useWorld } from '../../../ecs'
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { MIN_DIMENSIONS, useResizable } from '../../../hooks/useResizable.svelte'
|
|
5
|
+
import { useFrames } from '../../../hooks/useFrames.svelte'
|
|
6
|
+
import { useSelectedEntity } from '../../../hooks/useSelection.svelte'
|
|
15
7
|
|
|
16
|
-
|
|
8
|
+
import FloatingPanel from '../FloatingPanel.svelte'
|
|
9
|
+
import { buildTreeNodes, type TreeNode } from './buildTree'
|
|
10
|
+
import Tree from './Tree.svelte'
|
|
11
|
+
import { provideTreeExpandedContext } from './useExpanded.svelte'
|
|
17
12
|
|
|
18
13
|
provideTreeExpandedContext()
|
|
19
14
|
|
|
20
|
-
let container = $state.raw<HTMLDivElement>()
|
|
21
|
-
let dragElement = $state.raw<HTMLElement>()
|
|
22
|
-
|
|
23
|
-
const partID = usePartID()
|
|
24
15
|
const selectedEntity = useSelectedEntity()
|
|
25
|
-
|
|
26
|
-
() => 'treeview',
|
|
27
|
-
() => ({ width: 240, height: window.innerHeight - 20 })
|
|
28
|
-
)
|
|
29
|
-
const environment = useEnvironment()
|
|
30
|
-
const partConfig = usePartConfig()
|
|
16
|
+
|
|
31
17
|
const frames = useFrames()
|
|
32
18
|
const world = useWorld()
|
|
33
19
|
|
|
@@ -46,39 +32,23 @@
|
|
|
46
32
|
entity: worldEntity,
|
|
47
33
|
children: rootNodes,
|
|
48
34
|
})
|
|
49
|
-
|
|
50
|
-
$effect(() => {
|
|
51
|
-
if (container) {
|
|
52
|
-
resizable.observe(container)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
35
|
</script>
|
|
56
36
|
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
use:draggable={{
|
|
65
|
-
bounds: 'body',
|
|
66
|
-
handle: dragElement,
|
|
67
|
-
}}
|
|
68
|
-
{...rest}
|
|
37
|
+
<FloatingPanel
|
|
38
|
+
isOpen
|
|
39
|
+
defaultPosition={{ x: 10, y: 10 }}
|
|
40
|
+
defaultSize={{ width: 240, height: 400 }}
|
|
41
|
+
title="World"
|
|
42
|
+
exitable={false}
|
|
43
|
+
resizable
|
|
69
44
|
>
|
|
70
45
|
<Tree
|
|
71
46
|
{rootNode}
|
|
72
47
|
{nodeMap}
|
|
73
|
-
bind:dragElement
|
|
74
48
|
onSelectionChange={(event) => {
|
|
75
49
|
const value = event.selectedValue[0]
|
|
76
50
|
|
|
77
51
|
selectedEntity.set(value ? (Number(value) as Entity) : undefined)
|
|
78
52
|
}}
|
|
79
53
|
/>
|
|
80
|
-
|
|
81
|
-
{#if environment.current.isStandalone && partID.current && partConfig.hasEditPermissions}
|
|
82
|
-
<AddFrames />
|
|
83
|
-
{/if}
|
|
84
|
-
</div>
|
|
54
|
+
</FloatingPanel>
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { useThrelte } from '@threlte/core'
|
|
3
3
|
import { Portal } from '@threlte/extras'
|
|
4
|
-
import
|
|
5
|
-
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
4
|
+
import { Input, Switch } from '@viamrobotics/prime-core'
|
|
6
5
|
import { useResourceNames } from '@viamrobotics/svelte-sdk'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { PersistedState } from 'runed'
|
|
7
|
+
import { onMount } from 'svelte'
|
|
8
|
+
|
|
9
|
+
import DashboardButton from '../dashboard/Button.svelte'
|
|
10
|
+
import XRControllerSettings from '../../xr/XRControllerSettings.svelte'
|
|
9
11
|
import { useGeometries } from '../../../hooks/useGeometries.svelte'
|
|
12
|
+
import { RefreshRates, useMachineSettings } from '../../../hooks/useMachineSettings.svelte'
|
|
13
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
10
14
|
import { usePointClouds } from '../../../hooks/usePointclouds.svelte'
|
|
11
|
-
import { useThrelte } from '@threlte/core'
|
|
12
15
|
import { useRefetchPoses } from '../../../hooks/useRefetchPoses'
|
|
16
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
17
|
+
import { useWeblabs, WEBLABS_EXPERIMENTS } from '../../../hooks/useWeblabs.svelte'
|
|
18
|
+
|
|
13
19
|
import FloatingPanel from '../FloatingPanel.svelte'
|
|
14
|
-
import
|
|
15
|
-
import Tabs from './Tabs.svelte'
|
|
16
|
-
import { PersistedState } from 'runed'
|
|
20
|
+
import RefreshRate from '../RefreshRate.svelte'
|
|
17
21
|
import ToggleGroup from '../ToggleGroup.svelte'
|
|
18
|
-
import
|
|
22
|
+
import Tabs from './Tabs.svelte'
|
|
19
23
|
|
|
20
24
|
const { invalidate } = useThrelte()
|
|
21
25
|
const partID = usePartID()
|
|
@@ -26,6 +30,12 @@
|
|
|
26
30
|
const geometries = useGeometries()
|
|
27
31
|
const pointclouds = usePointClouds()
|
|
28
32
|
const { refetchPoses } = useRefetchPoses()
|
|
33
|
+
const weblabs = useWeblabs()
|
|
34
|
+
const knownWeblabs = Object.keys(WEBLABS_EXPERIMENTS)
|
|
35
|
+
|
|
36
|
+
onMount(() => {
|
|
37
|
+
weblabs.load(knownWeblabs)
|
|
38
|
+
})
|
|
29
39
|
|
|
30
40
|
// Invalidate the renderer for any settings change
|
|
31
41
|
$effect(() => {
|
|
@@ -269,6 +279,22 @@
|
|
|
269
279
|
</div>
|
|
270
280
|
{/snippet}
|
|
271
281
|
|
|
282
|
+
{#snippet Weblabs()}
|
|
283
|
+
<div class="flex flex-col gap-1 text-xs">
|
|
284
|
+
{#each knownWeblabs as experiment (experiment)}
|
|
285
|
+
<label class="flex items-center justify-between gap-2 py-0.5">
|
|
286
|
+
{experiment}
|
|
287
|
+
<Switch
|
|
288
|
+
on={weblabs.isActive(experiment)}
|
|
289
|
+
on:change={() => weblabs.toggle(experiment)}
|
|
290
|
+
/>
|
|
291
|
+
</label>
|
|
292
|
+
{:else}
|
|
293
|
+
No weblabs defined
|
|
294
|
+
{/each}
|
|
295
|
+
</div>
|
|
296
|
+
{/snippet}
|
|
297
|
+
|
|
272
298
|
{#snippet Widgets()}
|
|
273
299
|
<div class="text-gray-9 flex flex-col gap-1 text-xs">
|
|
274
300
|
<label class="flex items-center justify-between gap-2 py-1">
|
|
@@ -319,6 +345,7 @@
|
|
|
319
345
|
{ label: 'Vision', content: Vision },
|
|
320
346
|
{ label: 'Widgets', content: Widgets },
|
|
321
347
|
{ label: 'Stats', content: Stats },
|
|
348
|
+
{ label: 'Weblabs', content: Weblabs },
|
|
322
349
|
...('xr' in navigator ? [{ label: 'VR / AR', content: XR }] : []),
|
|
323
350
|
]}
|
|
324
351
|
onValueChange={(value) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte'
|
|
3
5
|
import * as tabs from '@zag-js/tabs'
|
|
4
|
-
import { useMachine, normalizeProps } from '@zag-js/svelte'
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
defaultTab?: string
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { draggable } from '@neodrag/svelte'
|
|
3
|
-
import {
|
|
3
|
+
import { Icon, Label, Select } from '@viamrobotics/prime-core'
|
|
4
|
+
|
|
4
5
|
import Table from '../Table.svelte'
|
|
6
|
+
import { formatNumeric } from '../../../format'
|
|
5
7
|
import { useArmClient } from '../../../hooks/useArmClient.svelte'
|
|
6
|
-
import { Icon, Label, Select } from '@viamrobotics/prime-core'
|
|
7
8
|
|
|
8
9
|
const { ...rest } = $props()
|
|
9
10
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { draggable } from '@neodrag/svelte'
|
|
3
3
|
import { Icon, Select } from '@viamrobotics/prime-core'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
4
|
+
import { MachineConnectionEvent, StreamClient } from '@viamrobotics/sdk'
|
|
5
|
+
import { CameraStream, useConnectionStatus, useRobotClient } from '@viamrobotics/svelte-sdk'
|
|
6
|
+
|
|
8
7
|
import { useEnvironment } from '../../../hooks/useEnvironment.svelte'
|
|
8
|
+
import { usePartID } from '../../../hooks/usePartID.svelte'
|
|
9
|
+
import { useSettings } from '../../../hooks/useSettings.svelte'
|
|
9
10
|
|
|
10
11
|
interface Resolution {
|
|
11
12
|
width: number
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
</script>
|
|
116
117
|
|
|
117
118
|
<div
|
|
118
|
-
class="bg-extralight border-medium absolute top-0 left-0 z-4 m-2 flex resize-x flex-col overflow-hidden border text-xs"
|
|
119
|
+
class="bg-extralight border-medium absolute top-0 left-0 z-4 m-2 flex resize-x flex-col overflow-hidden border text-xs dark:text-black"
|
|
119
120
|
style:width="320px"
|
|
120
121
|
style:height="auto !important"
|
|
121
122
|
use:draggable={{
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { T, useTask } from '@threlte/core'
|
|
3
3
|
import { useController, useXR, type XRController } from '@threlte/xr'
|
|
4
|
-
import { Vector3, Quaternion } from 'three'
|
|
5
|
-
import { createResourceClient } from '@viamrobotics/svelte-sdk'
|
|
6
4
|
import { ArmClient, GripperClient } from '@viamrobotics/sdk'
|
|
7
5
|
import * as VIAM from '@viamrobotics/sdk'
|
|
8
|
-
import {
|
|
6
|
+
import { createResourceClient } from '@viamrobotics/svelte-sdk'
|
|
7
|
+
import { Quaternion, Vector3 } from 'three'
|
|
8
|
+
|
|
9
9
|
import {
|
|
10
|
-
getFrameTransformationQuaternion,
|
|
11
10
|
calculatePositionTarget,
|
|
11
|
+
getFrameTransformationQuaternion,
|
|
12
12
|
} from './math'
|
|
13
|
-
import { OrientationVector } from '../../three/OrientationVector'
|
|
14
13
|
import { xrToast } from './toasts.svelte'
|
|
14
|
+
import { usePartID } from '../../hooks/usePartID.svelte'
|
|
15
|
+
import { OrientationVector } from '../../three/OrientationVector'
|
|
15
16
|
|
|
16
17
|
interface Props {
|
|
17
18
|
armName: string
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Vector2, PlaneGeometry } from 'three'
|
|
3
|
-
import { T } from '@threlte/core'
|
|
4
2
|
import type { BufferAttribute } from 'three'
|
|
5
3
|
|
|
4
|
+
import { T } from '@threlte/core'
|
|
5
|
+
import { PlaneGeometry, Vector2 } from 'three'
|
|
6
|
+
|
|
6
7
|
export let args: [
|
|
7
8
|
radius: number,
|
|
8
9
|
width?: number | undefined,
|