@viamrobotics/motion-tools 1.14.0 → 1.15.0
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/color.d.ts +1 -1
- package/dist/color.js +2 -2
- package/dist/components/App.svelte +25 -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 +8 -5
- 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 +5 -3
- 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/AddRelationship.svelte +4 -2
- package/dist/components/overlay/Details.svelte +21 -19
- package/dist/components/overlay/FloatingPanel.svelte +40 -3
- 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/AddFrames.svelte +4 -2
- package/dist/components/overlay/left-pane/Drawer.svelte +3 -2
- package/dist/components/overlay/left-pane/Tree.svelte +6 -12
- package/dist/components/overlay/left-pane/TreeContainer.svelte +33 -50
- 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 +1 -1
- package/dist/three/OBBHelper.js +1 -1
- package/dist/three/OrientationVector.js +1 -1
- package/dist/transform.js +1 -1
- package/package.json +3 -2
- 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
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { BufferGeometry } from 'three'
|
|
3
|
+
|
|
4
|
+
import { useThrelte } from '@threlte/core'
|
|
2
5
|
import { Portal } from '@threlte/extras'
|
|
3
6
|
import { Button } from '@viamrobotics/prime-core'
|
|
4
|
-
import
|
|
7
|
+
import { ElementRect } from 'runed'
|
|
8
|
+
import { BufferGeometryUtils } from 'three/examples/jsm/Addons.js'
|
|
9
|
+
|
|
5
10
|
import DashboardButton from '../overlay/dashboard/Button.svelte'
|
|
11
|
+
import { traits, useWorld } from '../../ecs'
|
|
6
12
|
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
13
|
+
import { createBinaryPCD } from '../../pcd'
|
|
14
|
+
|
|
7
15
|
import FloatingPanel from '../overlay/FloatingPanel.svelte'
|
|
8
|
-
import
|
|
16
|
+
import Lasso from './Lasso.svelte'
|
|
9
17
|
import * as lassoTraits from './traits'
|
|
10
|
-
import { BufferGeometryUtils } from 'three/examples/jsm/Addons.js'
|
|
11
|
-
import { createBinaryPCD } from '../../pcd'
|
|
12
|
-
import type { BufferGeometry } from 'three'
|
|
13
|
-
import { useThrelte } from '@threlte/core'
|
|
14
|
-
import { ElementRect } from 'runed'
|
|
15
18
|
|
|
16
19
|
interface Props {
|
|
17
20
|
/** Whether to auto-enable lasso mode when the component mounts */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { Group, Vector3Tuple } from 'three'
|
|
3
|
+
|
|
2
4
|
import { T, type Props as ThrelteProps } from '@threlte/core'
|
|
3
|
-
import type { Vector3Tuple, Group } from 'three'
|
|
4
5
|
import { HTML } from '@threlte/extras'
|
|
5
6
|
|
|
6
7
|
interface Props extends ThrelteProps<typeof Group> {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { untrack } from 'svelte'
|
|
3
|
-
import { Vector3, type Intersection } from 'three'
|
|
4
2
|
import { T } from '@threlte/core'
|
|
5
3
|
import { HTML, MeshLineGeometry, MeshLineMaterial, Portal } from '@threlte/extras'
|
|
6
|
-
import {
|
|
4
|
+
import { untrack } from 'svelte'
|
|
5
|
+
import { type Intersection, Vector3 } from 'three'
|
|
6
|
+
|
|
7
7
|
import Button from '../overlay/dashboard/Button.svelte'
|
|
8
|
-
import MeasurePoint from './MeasurePoint.svelte'
|
|
9
8
|
import { useMouseRaycaster } from '../../hooks/useMouseRaycaster.svelte'
|
|
10
9
|
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
11
|
-
import
|
|
10
|
+
import { useSettings } from '../../hooks/useSettings.svelte'
|
|
11
|
+
|
|
12
12
|
import Popover from '../overlay/Popover.svelte'
|
|
13
|
+
import ToggleGroup from '../overlay/ToggleGroup.svelte'
|
|
14
|
+
import MeasurePoint from './MeasurePoint.svelte'
|
|
13
15
|
|
|
14
16
|
const focusedEntity = useFocusedEntity()
|
|
15
17
|
const settings = useSettings()
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { parsePcdInWorker } from '../lib'
|
|
3
|
-
import { traits, useWorld } from '../ecs'
|
|
4
|
-
import { createBufferGeometry } from '../attribute'
|
|
5
2
|
import type { ConfigurableTrait, Entity } from 'koota'
|
|
6
3
|
|
|
4
|
+
import { createBufferGeometry } from '../attribute'
|
|
5
|
+
import { traits, useWorld } from '../ecs'
|
|
6
|
+
import { parsePcdInWorker } from '../lib'
|
|
7
|
+
|
|
7
8
|
interface Props {
|
|
8
9
|
data: Uint8Array
|
|
9
10
|
name?: string
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { BackSide, Mesh, Vector3 } from 'three'
|
|
3
2
|
import { T, useThrelte } from '@threlte/core'
|
|
4
3
|
import { MeshDiscardMaterial } from '@threlte/extras'
|
|
5
|
-
import {
|
|
4
|
+
import { BackSide, Mesh, Vector3 } from 'three'
|
|
5
|
+
|
|
6
6
|
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
7
|
+
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
7
8
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
8
9
|
|
|
9
10
|
const { camera } = useThrelte()
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
3
4
|
import { T } from '@threlte/core'
|
|
4
5
|
import { Environment, Grid, interactivity, PerfMonitor, PortalTarget } from '@threlte/extras'
|
|
6
|
+
import { useXR } from '@threlte/xr'
|
|
7
|
+
import { ShaderMaterial, Vector3 } from 'three'
|
|
8
|
+
|
|
9
|
+
import Camera from './Camera.svelte'
|
|
5
10
|
import Entities from './Entities/Entities.svelte'
|
|
6
|
-
import Selected from './Selected.svelte'
|
|
7
11
|
import Focus from './Focus.svelte'
|
|
12
|
+
import Selected from './Selected.svelte'
|
|
8
13
|
import StaticGeometries from './StaticGeometries.svelte'
|
|
9
|
-
import Camera from './Camera.svelte'
|
|
10
14
|
import { useFocusedObject3d } from '../hooks/useSelection.svelte'
|
|
11
|
-
import type { Snippet } from 'svelte'
|
|
12
|
-
import { useXR } from '@threlte/xr'
|
|
13
|
-
import { bvh } from '../plugins/bvh.svelte'
|
|
14
|
-
import { useOrigin } from './xr/useOrigin.svelte'
|
|
15
15
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
16
|
+
import { bvh } from '../plugins/bvh.svelte'
|
|
17
|
+
|
|
18
|
+
import hdrImage from '../assets/ferndale_studio_11_1k.hdr'
|
|
19
|
+
import BatchedArrows from './BatchedArrows.svelte'
|
|
16
20
|
import CameraControls from './CameraControls.svelte'
|
|
17
21
|
import MeasureTool from './MeasureTool/MeasureTool.svelte'
|
|
18
22
|
import PointerMissBox from './PointerMissBox.svelte'
|
|
19
|
-
import
|
|
20
|
-
import hdrImage from '../assets/ferndale_studio_11_1k.hdr'
|
|
23
|
+
import { useOrigin } from './xr/useOrigin.svelte'
|
|
21
24
|
|
|
22
25
|
interface Props {
|
|
23
26
|
children?: Snippet
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { provideVisibility } from '../hooks/useVisibility.svelte'
|
|
9
|
-
import { provideDrawAPI } from '../hooks/useDrawAPI.svelte'
|
|
10
|
-
import { provideMachineSettings } from '../hooks/useMachineSettings.svelte'
|
|
3
|
+
|
|
4
|
+
import { provide3DModels } from '../hooks/use3DModels.svelte'
|
|
5
|
+
import { provideArmClient } from '../hooks/useArmClient.svelte'
|
|
6
|
+
import { provideArmKinematics } from '../hooks/useArmKinematics.svelte'
|
|
7
|
+
import { provideConfigFrames } from '../hooks/useConfigFrames.svelte'
|
|
11
8
|
import {
|
|
9
|
+
type CameraPose,
|
|
12
10
|
provideCameraControls,
|
|
13
11
|
provideTransformControls,
|
|
14
|
-
type CameraPose,
|
|
15
12
|
} from '../hooks/useControls.svelte'
|
|
16
|
-
import {
|
|
17
|
-
import { provideOrigin } from './xr/useOrigin.svelte'
|
|
18
|
-
import { provideWorldStates } from '../hooks/useWorldState.svelte'
|
|
19
|
-
import { provideArmClient } from '../hooks/useArmClient.svelte'
|
|
20
|
-
import { provideArmKinematics } from '../hooks/useArmKinematics.svelte'
|
|
13
|
+
import { provideDrawAPI } from '../hooks/useDrawAPI.svelte'
|
|
21
14
|
import { provideFramelessComponents } from '../hooks/useFramelessComponents.svelte'
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { providePointcloudObjects } from '../hooks/usePointcloudObjects.svelte'
|
|
15
|
+
import { provideFrames } from '../hooks/useFrames.svelte'
|
|
16
|
+
import { provideGeometries } from '../hooks/useGeometries.svelte'
|
|
25
17
|
import { provideLinkedEntities } from '../hooks/useLinked.svelte'
|
|
26
|
-
import {
|
|
18
|
+
import { provideLogs } from '../hooks/useLogs.svelte'
|
|
19
|
+
import { provideMachineSettings } from '../hooks/useMachineSettings.svelte'
|
|
20
|
+
import { usePartID } from '../hooks/usePartID.svelte'
|
|
21
|
+
import { providePointcloudObjects } from '../hooks/usePointcloudObjects.svelte'
|
|
22
|
+
import { providePointclouds } from '../hooks/usePointclouds.svelte'
|
|
23
|
+
import { provideResourceByName } from '../hooks/useResourceByName.svelte'
|
|
24
|
+
import { provideSelection } from '../hooks/useSelection.svelte'
|
|
25
|
+
import { provideVisibility } from '../hooks/useVisibility.svelte'
|
|
26
|
+
import { provideWorldStates } from '../hooks/useWorldState.svelte'
|
|
27
|
+
|
|
28
|
+
import { provideOrigin } from './xr/useOrigin.svelte'
|
|
27
29
|
|
|
28
30
|
interface Props {
|
|
29
31
|
cameraPose?: CameraPose
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { isInstanceOf, T, useTask, useThrelte } from '@threlte/core'
|
|
3
|
-
import { useSelectedEntity, useSelectedObject3d } from '../hooks/useSelection.svelte'
|
|
4
|
-
import { OBBHelper } from '../three/OBBHelper'
|
|
5
|
-
import { OBB } from 'three/addons/math/OBB.js'
|
|
6
3
|
import { BatchedMesh, Box3 } from 'three'
|
|
4
|
+
import { OBB } from 'three/addons/math/OBB.js'
|
|
5
|
+
|
|
7
6
|
import type { InstancedArrows } from '../three/InstancedArrows/InstancedArrows'
|
|
8
7
|
|
|
8
|
+
import { useSelectedEntity, useSelectedObject3d } from '../hooks/useSelection.svelte'
|
|
9
|
+
import { OBBHelper } from '../three/OBBHelper'
|
|
10
|
+
|
|
9
11
|
const box3 = new Box3()
|
|
10
12
|
const obb = new OBB()
|
|
11
13
|
const obbHelper = new OBBHelper()
|
|
@@ -14,15 +14,18 @@ Renders a Snapshot protobuf by spawning its transforms and drawings as entities
|
|
|
14
14
|
```
|
|
15
15
|
-->
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import type { Snapshot as SnapshotProto } from '../buf/draw/v1/snapshot_pb'
|
|
18
|
-
import { useWorld } from '../ecs'
|
|
19
|
-
import { useSettings } from '../hooks/useSettings.svelte'
|
|
20
|
-
import { spawnSnapshotEntities, destroyEntities, applySceneMetadata } from '../snapshot'
|
|
21
|
-
import { useCameraControls } from '../hooks/useControls.svelte'
|
|
22
17
|
import type { Entity } from 'koota'
|
|
18
|
+
|
|
23
19
|
import { untrack } from 'svelte'
|
|
24
20
|
import { onDestroy } from 'svelte'
|
|
25
21
|
|
|
22
|
+
import type { Snapshot as SnapshotProto } from '../buf/draw/v1/snapshot_pb'
|
|
23
|
+
|
|
24
|
+
import { useWorld } from '../ecs'
|
|
25
|
+
import { useCameraControls } from '../hooks/useControls.svelte'
|
|
26
|
+
import { useSettings } from '../hooks/useSettings.svelte'
|
|
27
|
+
import { applySceneMetadata, destroyEntities, spawnSnapshotEntities } from '../snapshot'
|
|
28
|
+
|
|
26
29
|
interface Props {
|
|
27
30
|
snapshot: SnapshotProto
|
|
28
31
|
}
|
|
@@ -6,17 +6,20 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
+
import type { Entity } from 'koota'
|
|
10
|
+
|
|
9
11
|
import { TransformControls } from '@threlte/extras'
|
|
10
|
-
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
11
|
-
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
12
12
|
import { PressedKeys } from 'runed'
|
|
13
|
-
import {
|
|
13
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
14
14
|
import { Quaternion, Vector3 } from 'three'
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
import { traits, useWorld } from '../ecs'
|
|
17
|
+
import { useTransformControls } from '../hooks/useControls.svelte'
|
|
18
|
+
import { useSelectedEntity } from '../hooks/useSelection.svelte'
|
|
16
19
|
import { useSettings } from '../hooks/useSettings.svelte'
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
+
import { quaternionToPose, vector3ToPose } from '../transform'
|
|
21
|
+
|
|
22
|
+
import Frame from './Entities/Frame.svelte'
|
|
20
23
|
|
|
21
24
|
const world = useWorld()
|
|
22
25
|
const settings = useSettings()
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { traits, useTrait } from '../../ecs'
|
|
3
|
+
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
3
4
|
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
4
5
|
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
6
|
+
|
|
5
7
|
import HoveredEntity from './HoveredEntity.svelte'
|
|
6
8
|
import LinkedHoveredEntity from './LinkedHoveredEntity.svelte'
|
|
7
|
-
import { useLinkedEntities } from '../../hooks/useLinked.svelte'
|
|
8
9
|
|
|
9
10
|
const selectedEntity = useSelectedEntity()
|
|
10
11
|
const focusedEntity = useFocusedEntity()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { traits, useTrait } from '../../ecs'
|
|
3
|
-
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
4
3
|
import { useFocusedEntity, useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
5
4
|
|
|
5
|
+
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
6
|
+
|
|
6
7
|
const selectedEntity = useSelectedEntity()
|
|
7
8
|
const focusedEntity = useFocusedEntity()
|
|
8
9
|
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { relations, traits } from '../../ecs'
|
|
12
11
|
import type { Entity } from 'koota'
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
16
|
-
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
12
|
+
|
|
13
|
+
import { relations, traits } from '../../ecs'
|
|
17
14
|
import { useTrait } from '../../ecs'
|
|
18
15
|
import { SubEntityLinkType } from '../../ecs/relations'
|
|
16
|
+
import { useSelectedEntity } from '../../hooks/useSelection.svelte'
|
|
17
|
+
import { useFocusedEntity } from '../../hooks/useSelection.svelte'
|
|
18
|
+
import { getLinkedHoverInfo, type HoverInfo } from '../../HoverUpdater.svelte'
|
|
19
|
+
|
|
20
|
+
import HoveredEntityTooltip from './HoveredEntityTooltip.svelte'
|
|
19
21
|
|
|
20
22
|
interface Props {
|
|
21
23
|
linkedEntity: Entity
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Entity } from 'koota'
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
|
|
4
|
+
import { Button, Input, Select } from '@viamrobotics/prime-core'
|
|
5
|
+
|
|
6
|
+
import { relations, traits, useQuery, useTrait } from '../../ecs'
|
|
5
7
|
import { SubEntityLinkType } from '../../ecs/relations'
|
|
6
8
|
|
|
7
9
|
interface Props {
|
|
@@ -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>
|
|
@@ -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
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
title = '',
|
|
21
22
|
defaultSize = { width: 700, height: 500 },
|
|
22
23
|
exitable = true,
|
|
24
|
+
resizable = false,
|
|
23
25
|
persistRect = true,
|
|
24
26
|
isOpen = $bindable(false),
|
|
25
27
|
children,
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
const floatingPanelService = useMachine(floatingPanel.machine, () => ({
|
|
31
33
|
id,
|
|
32
34
|
defaultSize,
|
|
33
|
-
resizable
|
|
35
|
+
resizable,
|
|
34
36
|
allowOverflow: false,
|
|
35
37
|
persistRect,
|
|
36
38
|
open: isOpen,
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
>
|
|
47
49
|
<div
|
|
48
50
|
{...api.getContentProps()}
|
|
49
|
-
class="border-medium border-1 bg-white"
|
|
51
|
+
class="border-medium border-1 bg-white dark:text-black"
|
|
50
52
|
>
|
|
51
53
|
<div
|
|
52
54
|
{...api.getDragTriggerProps()}
|
|
@@ -85,5 +87,40 @@
|
|
|
85
87
|
>
|
|
86
88
|
{@render children()}
|
|
87
89
|
</div>
|
|
90
|
+
|
|
91
|
+
{#if resizable}
|
|
92
|
+
<div
|
|
93
|
+
{...api.getResizeTriggerProps({ axis: 'n' })}
|
|
94
|
+
class="h-1.5 max-w-[90%]"
|
|
95
|
+
></div>
|
|
96
|
+
<div
|
|
97
|
+
{...api.getResizeTriggerProps({ axis: 'e' })}
|
|
98
|
+
class="max-h-[90%] w-1.5"
|
|
99
|
+
></div>
|
|
100
|
+
<div
|
|
101
|
+
{...api.getResizeTriggerProps({ axis: 'w' })}
|
|
102
|
+
class="max-h-[90%] w-1.5"
|
|
103
|
+
></div>
|
|
104
|
+
<div
|
|
105
|
+
{...api.getResizeTriggerProps({ axis: 's' })}
|
|
106
|
+
class="h-1.5 max-w-[90%]"
|
|
107
|
+
></div>
|
|
108
|
+
<div
|
|
109
|
+
{...api.getResizeTriggerProps({ axis: 'ne' })}
|
|
110
|
+
class="size-2.5"
|
|
111
|
+
></div>
|
|
112
|
+
<div
|
|
113
|
+
{...api.getResizeTriggerProps({ axis: 'se' })}
|
|
114
|
+
class="size-2.5"
|
|
115
|
+
></div>
|
|
116
|
+
<div
|
|
117
|
+
{...api.getResizeTriggerProps({ axis: 'sw' })}
|
|
118
|
+
class="size-2.5"
|
|
119
|
+
></div>
|
|
120
|
+
<div
|
|
121
|
+
{...api.getResizeTriggerProps({ axis: 'nw' })}
|
|
122
|
+
class="size-2.5"
|
|
123
|
+
></div>
|
|
124
|
+
{/if}
|
|
88
125
|
</div>
|
|
89
126
|
</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,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { IconButton } from '@viamrobotics/prime-core'
|
|
3
|
-
|
|
4
|
-
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
3
|
+
|
|
5
4
|
import { useFramelessComponents } from '../../../hooks/useFramelessComponents.svelte'
|
|
5
|
+
import { usePartConfig } from '../../../hooks/usePartConfig.svelte'
|
|
6
|
+
|
|
7
|
+
import Drawer from './Drawer.svelte'
|
|
6
8
|
|
|
7
9
|
const framelessComponents = useFramelessComponents()
|
|
8
10
|
const partConfig = usePartConfig()
|
|
@@ -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()
|
|
@@ -177,13 +178,6 @@
|
|
|
177
178
|
|
|
178
179
|
<div class="root-node">
|
|
179
180
|
<div {...api.getRootProps() as object}>
|
|
180
|
-
<div class="border-medium flex items-center gap-1 border-b p-2">
|
|
181
|
-
<button bind:this={dragElement}>
|
|
182
|
-
<Icon name="drag" />
|
|
183
|
-
</button>
|
|
184
|
-
<h3 {...api.getLabelProps() as object}>{rootNode.entity.get(traits.Name)}</h3>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
181
|
<div {...api.getTreeProps()}>
|
|
188
182
|
{#if rootChildren.length === 0}
|
|
189
183
|
<p class="text-subtle-2 px-2 py-4">No objects displayed</p>
|