@viamrobotics/test-widgets 0.9.0 → 0.9.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.
@@ -1,7 +1,5 @@
1
- import { ViamObject3D } from '@viamrobotics/three';
2
1
  export const createGeometry = (type, size = 5, rotation = 0) => {
3
- const pose = new ViamObject3D();
4
- pose.orientationVector.th = rotation;
2
+ const pose = { orientationVector: { th: rotation } };
5
3
  switch (type) {
6
4
  case 'box': {
7
5
  return {
@@ -1,7 +1,13 @@
1
- import type { ViamObject3D } from '@viamrobotics/three';
2
1
  import type { LngLat } from 'maplibre-gl';
2
+ /** Client-side pose for a navigation-map geometry. Rotation only; never serialized. */
3
+ export interface GeometryPose {
4
+ /** Orientation vector; only the theta rotation (radians) is used on the map. */
5
+ orientationVector: {
6
+ th: number;
7
+ };
8
+ }
3
9
  interface BaseGeometry {
4
- pose: ViamObject3D;
10
+ pose: GeometryPose;
5
11
  }
6
12
  export declare const NavigationTab: {
7
13
  readonly Waypoints: "Waypoints";
@@ -4,11 +4,11 @@
4
4
  interface Props {
5
5
  value: string
6
6
  options: string[]
7
- label?: string
7
+ label: string
8
8
  onChange: (value: string) => void
9
9
  }
10
10
 
11
- const { value, options, label = 'Component', onChange }: Props = $props()
11
+ const { value, options, label, onChange }: Props = $props()
12
12
  </script>
13
13
 
14
14
  <Label>
@@ -21,7 +21,7 @@
21
21
  onChange((event.target as HTMLSelectElement).value)
22
22
  }}
23
23
  >
24
- <option value="">Select a component…</option>
24
+ <option value="">Select a frame…</option>
25
25
  {#each options as name (name)}
26
26
  <option value={name}>{name}</option>
27
27
  {/each}
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ value: string;
3
+ options: string[];
4
+ label: string;
5
+ onChange: (value: string) => void;
6
+ }
7
+ declare const FrameSelect: import("svelte").Component<Props, {}, "">;
8
+ type FrameSelect = ReturnType<typeof FrameSelect>;
9
+ export default FrameSelect;
@@ -17,12 +17,21 @@ export interface FrameConfigEntry {
17
17
  */
18
18
  export declare const movableFrameNames: (config: FrameConfigEntry[] | undefined) => string[];
19
19
  /**
20
- * The parent frame a component is attached to in the machine's frame system.
21
- * A frame's parent is the reference frame of the pose that positions it (its
20
+ * The parent frame a frame is attached to in the machine's frame system. A
21
+ * frame's parent is the reference frame of the pose that positions it (its
22
22
  * observer frame), so `getPose` and `Move` can be expressed relative to it.
23
23
  *
24
24
  * @param config - The machine's frame system config, or `undefined` while loading.
25
- * @param componentName - The component (frame) whose parent to look up.
25
+ * @param frameName - The frame whose parent to look up.
26
26
  * @returns The parent frame name, or `'world'` when there is no configured parent.
27
27
  */
28
- export declare const parentFrame: (config: FrameConfigEntry[] | undefined, componentName: string) => string;
28
+ export declare const parentFrame: (config: FrameConfigEntry[] | undefined, frameName: string) => string;
29
+ /**
30
+ * The reference frames a destination pose can be expressed in: the root
31
+ * `'world'` frame first, then every frame in the machine's frame system
32
+ * (already sorted alphabetically by `movableFrameNames`).
33
+ *
34
+ * @param config - The machine's frame system config, or `undefined` while loading.
35
+ * @returns The selectable reference frame names, always led by `'world'`.
36
+ */
37
+ export declare const referenceFrameNames: (config: FrameConfigEntry[] | undefined) => string[];
@@ -16,15 +16,27 @@ export const movableFrameNames = (config) => {
16
16
  .toSorted((a, b) => a.localeCompare(b));
17
17
  };
18
18
  /**
19
- * The parent frame a component is attached to in the machine's frame system.
20
- * A frame's parent is the reference frame of the pose that positions it (its
19
+ * The parent frame a frame is attached to in the machine's frame system. A
20
+ * frame's parent is the reference frame of the pose that positions it (its
21
21
  * observer frame), so `getPose` and `Move` can be expressed relative to it.
22
22
  *
23
23
  * @param config - The machine's frame system config, or `undefined` while loading.
24
- * @param componentName - The component (frame) whose parent to look up.
24
+ * @param frameName - The frame whose parent to look up.
25
25
  * @returns The parent frame name, or `'world'` when there is no configured parent.
26
26
  */
27
- export const parentFrame = (config, componentName) => {
28
- const entry = config?.find((item) => item.frame?.referenceFrame === componentName);
27
+ export const parentFrame = (config, frameName) => {
28
+ const entry = config?.find((item) => item.frame?.referenceFrame === frameName);
29
29
  return entry?.frame?.poseInObserverFrame?.referenceFrame || 'world';
30
30
  };
31
+ /**
32
+ * The reference frames a destination pose can be expressed in: the root
33
+ * `'world'` frame first, then every frame in the machine's frame system
34
+ * (already sorted alphabetically by `movableFrameNames`).
35
+ *
36
+ * @param config - The machine's frame system config, or `undefined` while loading.
37
+ * @returns The selectable reference frame names, always led by `'world'`.
38
+ */
39
+ export const referenceFrameNames = (config) => {
40
+ const frames = movableFrameNames(config).filter((name) => name !== 'world');
41
+ return ['world', ...frames];
42
+ };
@@ -1,7 +1,11 @@
1
1
  <script lang="ts">
2
+ import { createRobotQuery, useRobotClient } from '@viamrobotics/svelte-sdk'
3
+
2
4
  import ApiSection from '../../api-section.svelte'
3
5
  import ConnectionStatus from '../../connection-status.svelte'
4
6
 
7
+ import FrameSelect from './frame-select.svelte'
8
+ import { movableFrameNames, parentFrame, referenceFrameNames } from './frame-system-config'
5
9
  import MoveWidget from './move-widget.svelte'
6
10
 
7
11
  interface Props {
@@ -10,6 +14,20 @@
10
14
  }
11
15
 
12
16
  const { partID, resourceName }: Props = $props()
17
+
18
+ const robotClient = useRobotClient(() => partID)
19
+ const frameSystem = createRobotQuery(robotClient, 'frameSystemConfig', () => ({
20
+ refetchInterval: 5000,
21
+ }))
22
+
23
+ const frameNames = $derived(movableFrameNames(frameSystem.data))
24
+ const destinationOptions = $derived(referenceFrameNames(frameSystem.data))
25
+
26
+ let selectedFrame = $state<string>()
27
+ const frameName = $derived(selectedFrame ?? frameNames[0] ?? '')
28
+
29
+ let selectedDestination = $state<string>()
30
+ const destination = $derived(selectedDestination ?? parentFrame(frameSystem.data, frameName))
13
31
  </script>
14
32
 
15
33
  <ConnectionStatus {partID}>
@@ -18,10 +36,30 @@
18
36
  title="Move"
19
37
  api="rdk:service:motion"
20
38
  >
21
- <MoveWidget
22
- {partID}
23
- {resourceName}
24
- />
39
+ <div class="flex min-w-0 flex-col gap-4">
40
+ <FrameSelect
41
+ label="Component"
42
+ value={frameName}
43
+ options={frameNames}
44
+ onChange={(value) => {
45
+ selectedFrame = value
46
+ }}
47
+ />
48
+ <FrameSelect
49
+ label="Destination frame"
50
+ value={destination}
51
+ options={destinationOptions}
52
+ onChange={(value) => {
53
+ selectedDestination = value
54
+ }}
55
+ />
56
+ <MoveWidget
57
+ {partID}
58
+ {resourceName}
59
+ {frameName}
60
+ {destination}
61
+ />
62
+ </div>
25
63
  </ApiSection>
26
64
  {/snippet}
27
65
  </ConnectionStatus>
@@ -7,17 +7,19 @@
7
7
  useRobotClient,
8
8
  } from '@viamrobotics/svelte-sdk'
9
9
 
10
- import ComponentNameSelect from './component-name-select.svelte'
11
- import { movableFrameNames, parentFrame } from './frame-system-config'
12
10
  import Move from './move.svelte'
13
11
  import { type MoveInput, parseMoveArgs } from './parse-move-args'
14
12
 
15
13
  interface Props {
16
14
  partID: string
17
15
  resourceName: string
16
+ /** The frame to move — a frame from the machine's frame system. */
17
+ frameName: string
18
+ /** The reference frame the destination pose is expressed in. */
19
+ destination: string
18
20
  }
19
21
 
20
- const { partID, resourceName }: Props = $props()
22
+ const { partID, resourceName, frameName, destination }: Props = $props()
21
23
 
22
24
  const robotClient = useRobotClient(() => partID)
23
25
  const client = createResourceClient(
@@ -27,26 +29,14 @@
27
29
  )
28
30
 
29
31
  const move = createResourceMutation(client, 'move')
30
- const frameSystem = createRobotQuery(robotClient, 'frameSystemConfig', () => ({
31
- refetchInterval: 5000,
32
- }))
33
- const frameNames = $derived(movableFrameNames(frameSystem.data))
34
-
35
- let selectedName = $state<string>()
36
- const componentName = $derived(selectedName ?? frameNames[0] ?? '')
37
-
38
- const destinationFrame = $derived(parentFrame(frameSystem.data, componentName))
39
- const poseArgs = $derived<Parameters<RobotClient['getPose']>>([
40
- componentName,
41
- destinationFrame,
42
- [],
43
- ])
44
32
 
33
+ // Pre-fill the editor with the frame's current pose in the destination frame.
34
+ const poseArgs = $derived<Parameters<RobotClient['getPose']>>([frameName, destination, []])
45
35
  const poseQuery = createRobotQuery(
46
36
  robotClient,
47
37
  'getPose',
48
38
  () => poseArgs,
49
- () => ({ enabled: componentName !== '' })
39
+ () => ({ enabled: frameName !== '' })
50
40
  )
51
41
 
52
42
  const currentPose = $derived(poseQuery.data?.pose)
@@ -57,28 +47,19 @@
57
47
  const executeMove = (input: MoveInput) => {
58
48
  try {
59
49
  parseError = undefined
60
- move.mutate(parseMoveArgs(componentName, input), {})
50
+ move.mutate(parseMoveArgs(frameName, input), {})
61
51
  } catch (error) {
62
52
  parseError = error instanceof Error ? error : new Error(String(error))
63
53
  }
64
54
  }
65
55
  </script>
66
56
 
67
- <div class="flex flex-col gap-4">
68
- <ComponentNameSelect
69
- value={componentName}
70
- options={frameNames}
71
- onChange={(value) => {
72
- selectedName = value
73
- }}
74
- />
75
- <Move
76
- {componentName}
77
- {currentPose}
78
- currentReferenceFrame={destinationFrame}
79
- isPending={move.isPending}
80
- lastError={parseError ?? move.error ?? poseError}
81
- storageKey={`${partID}/${resourceName}/motion-move`}
82
- onExecute={executeMove}
83
- />
84
- </div>
57
+ <Move
58
+ {frameName}
59
+ {destination}
60
+ {currentPose}
61
+ isPending={move.isPending}
62
+ lastError={parseError ?? move.error ?? poseError}
63
+ storageKey={`${partID}/${resourceName}/motion-move`}
64
+ onExecute={executeMove}
65
+ />
@@ -1,6 +1,10 @@
1
1
  interface Props {
2
2
  partID: string;
3
3
  resourceName: string;
4
+ /** The frame to move — a frame from the machine's frame system. */
5
+ frameName: string;
6
+ /** The reference frame the destination pose is expressed in. */
7
+ destination: string;
4
8
  }
5
9
  declare const MoveWidget: import("svelte").Component<Props, {}, "">;
6
10
  type MoveWidget = ReturnType<typeof MoveWidget>;
@@ -9,12 +9,14 @@
9
9
 
10
10
  import type { MoveInput } from './parse-move-args'
11
11
 
12
- import PoseInFrameInput from './pose-in-frame-input.svelte'
12
+ import PoseInput from './pose-input.svelte'
13
13
 
14
14
  interface Props {
15
- componentName: string
15
+ /** The frame being moved. Gates execution and re-seeds the editor on change. */
16
+ frameName: string
17
+ /** The reference frame the destination pose is expressed in. */
18
+ destination: string
16
19
  currentPose?: Pose
17
- currentReferenceFrame?: string
18
20
  isPending: boolean
19
21
  lastError: Error | null
20
22
  storageKey: string
@@ -22,9 +24,9 @@
22
24
  }
23
25
 
24
26
  const {
25
- componentName,
27
+ frameName,
28
+ destination,
26
29
  currentPose,
27
- currentReferenceFrame,
28
30
  isPending,
29
31
  lastError,
30
32
  storageKey,
@@ -33,25 +35,19 @@
33
35
 
34
36
  const zeroPose: Pose = { x: 0, y: 0, z: 0, oX: 0, oY: 0, oZ: 1, theta: 0 }
35
37
 
36
- let edit = $state<{ component: string; referenceFrame: string; pose: Pose }>()
37
- const isEdited = $derived(edit?.component === componentName)
38
- const referenceFrame = $derived(
39
- isEdited && edit ? edit.referenceFrame : (currentReferenceFrame ?? 'world')
40
- )
41
-
38
+ const editKey = $derived(JSON.stringify([frameName, destination]))
39
+ let edit = $state<{ key: string; pose: Pose }>()
40
+ const isEdited = $derived(edit?.key === editKey)
42
41
  const pose = $derived(isEdited && edit ? edit.pose : (currentPose ?? zeroPose))
43
42
 
44
- // PersistedState is created inside $derived so Svelte can track the storageKey
45
- // dependency. The localStorage read on construction is benign and idempotent.
46
- // storageKey is stable for the lifetime of this component.
47
43
  const worldState = $derived(new PersistedState(`${storageKey}/world-state`, ''))
48
44
  const constraints = $derived(new PersistedState(`${storageKey}/constraints`, ''))
49
45
 
50
- const disabled = $derived(componentName === '' || isPending)
46
+ const disabled = $derived(frameName === '' || isPending)
51
47
 
52
48
  const execute = () => {
53
49
  onExecute({
54
- referenceFrame,
50
+ referenceFrame: destination,
55
51
  pose,
56
52
  worldStateJson: worldState.current,
57
53
  constraintsJson: constraints.current,
@@ -60,14 +56,10 @@
60
56
  </script>
61
57
 
62
58
  <div class="flex min-w-0 flex-col gap-4">
63
- <PoseInFrameInput
64
- {referenceFrame}
59
+ <PoseInput
65
60
  {pose}
66
- onReferenceFrameChange={(frame) => {
67
- edit = { component: componentName, referenceFrame: frame, pose }
68
- }}
69
61
  onPoseChange={(next) => {
70
- edit = { component: componentName, referenceFrame, pose: next }
62
+ edit = { key: editKey, pose: next }
71
63
  }}
72
64
  />
73
65
 
@@ -1,9 +1,11 @@
1
1
  import type { Pose } from '@viamrobotics/sdk';
2
2
  import type { MoveInput } from './parse-move-args';
3
3
  interface Props {
4
- componentName: string;
4
+ /** The frame being moved. Gates execution and re-seeds the editor on change. */
5
+ frameName: string;
6
+ /** The reference frame the destination pose is expressed in. */
7
+ destination: string;
5
8
  currentPose?: Pose;
6
- currentReferenceFrame?: string;
7
9
  isPending: boolean;
8
10
  lastError: Error | null;
9
11
  storageKey: string;
@@ -17,8 +17,8 @@ export type MoveArgs = [PoseInFrame, string, WorldState | undefined, Constraints
17
17
  * Non-empty JSON is parsed with the generated message classes and throws on
18
18
  * invalid input — callers should catch and surface the error.
19
19
  *
20
- * @param componentName - Name of the component to move.
20
+ * @param frameName - The frame to move.
21
21
  * @param input - The pose, reference frame, and optional world-state/constraints JSON.
22
- * @returns The `[destination, componentName, worldState?, constraints?]` tuple.
22
+ * @returns The `[destination, frameName, worldState?, constraints?]` tuple.
23
23
  */
24
- export declare const parseMoveArgs: (componentName: string, input: MoveInput) => MoveArgs;
24
+ export declare const parseMoveArgs: (frameName: string, input: MoveInput) => MoveArgs;
@@ -6,11 +6,11 @@ import { Constraints, WorldState } from '@viamrobotics/sdk';
6
6
  * Non-empty JSON is parsed with the generated message classes and throws on
7
7
  * invalid input — callers should catch and surface the error.
8
8
  *
9
- * @param componentName - Name of the component to move.
9
+ * @param frameName - The frame to move.
10
10
  * @param input - The pose, reference frame, and optional world-state/constraints JSON.
11
- * @returns The `[destination, componentName, worldState?, constraints?]` tuple.
11
+ * @returns The `[destination, frameName, worldState?, constraints?]` tuple.
12
12
  */
13
- export const parseMoveArgs = (componentName, input) => {
13
+ export const parseMoveArgs = (frameName, input) => {
14
14
  const destination = {
15
15
  referenceFrame: input.referenceFrame,
16
16
  pose: input.pose,
@@ -19,5 +19,5 @@ export const parseMoveArgs = (componentName, input) => {
19
19
  const constraints = input.constraintsJson.trim() === ''
20
20
  ? undefined
21
21
  : Constraints.fromJsonString(input.constraintsJson);
22
- return [destination, componentName, worldState, constraints];
22
+ return [destination, frameName, worldState, constraints];
23
23
  };
@@ -4,19 +4,19 @@
4
4
  >
5
5
  import type { Pose } from '@viamrobotics/sdk'
6
6
 
7
- const poseLabelsList = Object.entries({
8
- x: 'X',
9
- y: 'Y',
10
- z: 'Z',
11
- oX: 'OX',
12
- oY: 'OY',
13
- oZ: 'OZ',
14
- theta: 'θ',
15
- }) as [keyof Pose, string][]
7
+ const poseLabelsList: [keyof Pose, string][] = [
8
+ ['x', 'X'],
9
+ ['y', 'Y'],
10
+ ['z', 'Z'],
11
+ ['oX', 'OX'],
12
+ ['oY', 'OY'],
13
+ ['oZ', 'OZ'],
14
+ ['theta', 'θ'],
15
+ ]
16
16
  </script>
17
17
 
18
18
  <script lang="ts">
19
- import { Button, Icon, Input, Label, NumericInput, Tooltip } from '@viamrobotics/prime-core'
19
+ import { Button, Icon, NumericInput, Tooltip } from '@viamrobotics/prime-core'
20
20
 
21
21
  import AngleUnitToggle from '../../angle-unit-toggle.svelte'
22
22
  import CopyButton from '../../copy-button.svelte'
@@ -28,13 +28,11 @@
28
28
  import { parsePastedPose } from './parse-pasted-pose'
29
29
 
30
30
  interface Props {
31
- referenceFrame: string
32
31
  pose: Pose
33
- onReferenceFrameChange: (frame: string) => void
34
32
  onPoseChange: (pose: Pose) => void
35
33
  }
36
34
 
37
- const { referenceFrame, pose, onReferenceFrameChange, onPoseChange }: Props = $props()
35
+ const { pose, onPoseChange }: Props = $props()
38
36
 
39
37
  let useRadians = $state(false)
40
38
 
@@ -85,7 +83,8 @@
85
83
  />
86
84
 
87
85
  <span slot="description">
88
- The target pose expressed in the given reference frame. Translations are in millimeters.
86
+ The target pose expressed in the selected reference frame. Translations are in
87
+ millimeters.
89
88
  </span>
90
89
  </Tooltip>
91
90
  </span>
@@ -101,19 +100,6 @@
101
100
  </div>
102
101
  </div>
103
102
 
104
- <Label>
105
- Reference frame
106
-
107
- <Input
108
- slot="input"
109
- value={referenceFrame}
110
- placeholder="world"
111
- on:input={(event) => {
112
- onReferenceFrameChange((event.target as HTMLInputElement).value)
113
- }}
114
- />
115
- </Label>
116
-
117
103
  <Table>
118
104
  <thead>
119
105
  <tr>
@@ -0,0 +1,8 @@
1
+ import type { Pose } from '@viamrobotics/sdk';
2
+ interface Props {
3
+ pose: Pose;
4
+ onPoseChange: (pose: Pose) => void;
5
+ }
6
+ declare const PoseInput: import("svelte").Component<Props, {}, "">;
7
+ type PoseInput = ReturnType<typeof PoseInput>;
8
+ export default PoseInput;
package/dist/registry.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ArmGetJointPositionsWidget, ArmIsMovingWidget, ArmMoveToJointPositionsWidget, ArmMoveToPositionWidget, ArmQuickMoveWidget, ArmWidget, AudioInputGetPropertiesWidget, AudioInputWidget, AudioOutputGetPropertiesWidget, AudioOutputWidget, BaseIsMovingWidget, BaseMoveStraightWidget, BaseQuickMoveWidget, BaseSetPowerWidget, BaseSetVelocityWidget, BaseSpinWidget, BaseWidget, BoardWidget, ButtonWidget, CameraWidget, DiscoveryWidget, EncoderGetPositionWidget, EncoderWidget, GantryGetPositionWidget, GantryHomeWidget, GantryIsMovingWidget, GantryMoveToPositionWidget, GantryQuickMoveWidget, GantryWidget, GripperGrabWidget, GripperIsHoldingSomethingWidget, GripperIsMovingWidget, GripperOpenWidget, GripperWidget, InputControllerWidget, MLModelServiceWidget, MotionMoveWidget, MotionServiceWidget, MotorGoForWidget, MotorGoToWidget, MotorIsMovingWidget, MotorQuickMoveWidget, MotorSetPowerWidget, MotorSetRPMWidget, MotorWidget, MovementSensorGetAccuracyWidget, MovementSensorGetCompassHeadingWidget, MovementSensorGetOrientationWidget, MovementSensorGetPositionWidget, MovementSensorWidget, NavigationServiceWidget, PowerSensorGetCurrentWidget, PowerSensorGetPowerWidget, PowerSensorGetVoltageWidget, PowerSensorWidget, SensorWidget, ServoIsMovingWidget, ServoMoveWidget, ServoQuickMoveWidget, ServoWidget, SlamGetPositionWidget, SlamWidget, SwitchWidget, VisionServiceWidget, } from "./components/index.js";
1
+ import { ArmGetJointPositionsWidget, ArmIsMovingWidget, ArmMoveToJointPositionsWidget, ArmMoveToPositionWidget, ArmQuickMoveWidget, ArmWidget, AudioInputGetPropertiesWidget, AudioInputWidget, AudioOutputGetPropertiesWidget, AudioOutputWidget, BaseIsMovingWidget, BaseMoveStraightWidget, BaseQuickMoveWidget, BaseSetPowerWidget, BaseSetVelocityWidget, BaseSpinWidget, BaseWidget, BoardWidget, ButtonWidget, CameraWidget, DiscoveryWidget, EncoderGetPositionWidget, EncoderWidget, GantryGetPositionWidget, GantryHomeWidget, GantryIsMovingWidget, GantryMoveToPositionWidget, GantryQuickMoveWidget, GantryWidget, GripperGrabWidget, GripperIsHoldingSomethingWidget, GripperIsMovingWidget, GripperOpenWidget, GripperWidget, InputControllerWidget, MLModelServiceWidget, MotionServiceWidget, MotorGoForWidget, MotorGoToWidget, MotorIsMovingWidget, MotorQuickMoveWidget, MotorSetPowerWidget, MotorSetRPMWidget, MotorWidget, MovementSensorGetAccuracyWidget, MovementSensorGetCompassHeadingWidget, MovementSensorGetOrientationWidget, MovementSensorGetPositionWidget, MovementSensorWidget, NavigationServiceWidget, PowerSensorGetCurrentWidget, PowerSensorGetPowerWidget, PowerSensorGetVoltageWidget, PowerSensorWidget, SensorWidget, ServoIsMovingWidget, ServoMoveWidget, ServoQuickMoveWidget, ServoWidget, SlamGetPositionWidget, SlamWidget, SwitchWidget, VisionServiceWidget, } from "./components/index.js";
2
2
  import { getResourceAPI } from "./get-resource-api.js";
3
3
  import { ResourceTriplets } from "./resource-triplet.js";
4
4
  /**
@@ -132,10 +132,7 @@ const resourceWidgetRegistry = {
132
132
  // services
133
133
  [ResourceTriplets.Discovery]: { widget: DiscoveryWidget, apis: [] },
134
134
  [ResourceTriplets.MLModel]: { widget: MLModelServiceWidget, apis: [] },
135
- [ResourceTriplets.Motion]: {
136
- widget: MotionServiceWidget,
137
- apis: [{ id: 'move', label: 'Move', widgets: [MotionMoveWidget] }],
138
- },
135
+ [ResourceTriplets.Motion]: { widget: MotionServiceWidget, apis: [] },
139
136
  [ResourceTriplets.Navigation]: { widget: NavigationServiceWidget, apis: [] },
140
137
  [ResourceTriplets.Slam]: {
141
138
  widget: SlamWidget,
package/package.json CHANGED
@@ -1,8 +1,165 @@
1
1
  {
2
2
  "name": "@viamrobotics/test-widgets",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
+ "wireit": {
7
+ "build": {
8
+ "dependencies": [
9
+ "vite-build",
10
+ "package"
11
+ ]
12
+ },
13
+ "package": {
14
+ "command": "svelte-package && publint",
15
+ "files": [
16
+ "src/lib/**",
17
+ "svelte.config.js",
18
+ "tsconfig.json",
19
+ "package.json"
20
+ ],
21
+ "output": [
22
+ "dist/**"
23
+ ],
24
+ "dependencies": [
25
+ "svelte-sync"
26
+ ],
27
+ "packageLocks": [
28
+ "pnpm-lock.yaml"
29
+ ]
30
+ },
31
+ "vite-build": {
32
+ "command": "vite build",
33
+ "files": [
34
+ "src/**",
35
+ "static/**",
36
+ ".env",
37
+ ".env.*",
38
+ "vite.config.ts",
39
+ "svelte.config.js",
40
+ "postcss.config.js",
41
+ "tsconfig.json",
42
+ "package.json"
43
+ ],
44
+ "output": [
45
+ "build/**",
46
+ ".svelte-kit/output/**"
47
+ ],
48
+ "dependencies": [
49
+ "svelte-sync",
50
+ "package"
51
+ ],
52
+ "packageLocks": [
53
+ "pnpm-lock.yaml"
54
+ ]
55
+ },
56
+ "svelte-sync": {
57
+ "command": "svelte-kit sync",
58
+ "files": [
59
+ "svelte.config.js",
60
+ "src/**",
61
+ "tsconfig.json",
62
+ "package.json"
63
+ ],
64
+ "output": [
65
+ ".svelte-kit/generated/**",
66
+ ".svelte-kit/types/**",
67
+ ".svelte-kit/ambient.d.ts",
68
+ ".svelte-kit/non-ambient.d.ts",
69
+ ".svelte-kit/tsconfig.json"
70
+ ],
71
+ "packageLocks": [
72
+ "pnpm-lock.yaml"
73
+ ]
74
+ },
75
+ "prepack": {
76
+ "dependencies": [
77
+ "package"
78
+ ]
79
+ },
80
+ "check": {
81
+ "command": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
82
+ "files": [
83
+ "src/**",
84
+ "tsconfig.json",
85
+ "svelte.config.js",
86
+ "package.json"
87
+ ],
88
+ "output": [],
89
+ "dependencies": [
90
+ "svelte-sync"
91
+ ],
92
+ "packageLocks": [
93
+ "pnpm-lock.yaml"
94
+ ]
95
+ },
96
+ "lint": {
97
+ "command": "eslint . --concurrency auto",
98
+ "files": [
99
+ "**",
100
+ "!build/**",
101
+ "!dist/**",
102
+ "!.svelte-kit/**",
103
+ "!coverage/**",
104
+ "!test-results/**",
105
+ "!.env*",
106
+ "!**/*.tgz"
107
+ ],
108
+ "output": [],
109
+ "packageLocks": [
110
+ "pnpm-lock.yaml"
111
+ ]
112
+ },
113
+ "format": {
114
+ "command": "prettier --check .",
115
+ "files": [
116
+ "**",
117
+ "!build/**",
118
+ "!dist/**",
119
+ "!.svelte-kit/**",
120
+ "!coverage/**",
121
+ "!test-results/**",
122
+ "!.env*",
123
+ "!**/*.tgz"
124
+ ],
125
+ "output": [],
126
+ "packageLocks": [
127
+ "pnpm-lock.yaml"
128
+ ]
129
+ },
130
+ "test": {
131
+ "command": "vitest --run",
132
+ "files": [
133
+ "src/**",
134
+ "vite.config.ts",
135
+ "svelte.config.js",
136
+ "postcss.config.js",
137
+ "tsconfig.json",
138
+ "package.json"
139
+ ],
140
+ "output": [],
141
+ "packageLocks": [
142
+ "pnpm-lock.yaml"
143
+ ]
144
+ },
145
+ "test:coverage": {
146
+ "command": "vitest run --coverage",
147
+ "files": [
148
+ "src/**",
149
+ "vite.config.ts",
150
+ "svelte.config.js",
151
+ "postcss.config.js",
152
+ "tsconfig.json",
153
+ "package.json"
154
+ ],
155
+ "output": [
156
+ "coverage/**"
157
+ ],
158
+ "packageLocks": [
159
+ "pnpm-lock.yaml"
160
+ ]
161
+ }
162
+ },
6
163
  "files": [
7
164
  "dist",
8
165
  "!dist/**/*.test.*",
@@ -37,7 +194,6 @@
37
194
  "@viamrobotics/prime-core": ">=0.1",
38
195
  "@viamrobotics/sdk": ">=0.68",
39
196
  "@viamrobotics/svelte-sdk": ">=1.1",
40
- "@viamrobotics/three": ">=0.0.9",
41
197
  "lodash-es": ">=4",
42
198
  "maplibre-gl": ">=5",
43
199
  "runed": ">=0.28",
@@ -46,9 +202,6 @@
46
202
  "threlte-uikit": ">=2"
47
203
  },
48
204
  "peerDependenciesMeta": {
49
- "@viamrobotics/three": {
50
- "optional": true
51
- },
52
205
  "maplibre-gl": {
53
206
  "optional": true
54
207
  }
@@ -87,8 +240,7 @@
87
240
  "@viamrobotics/sdk": "^0.69.0",
88
241
  "@viamrobotics/svelte-sdk": "^1.2.1",
89
242
  "@viamrobotics/tailwind-config": "^1.0.0",
90
- "@viamrobotics/three": "^0.0.9",
91
- "@vitest/browser": "^4.1.8",
243
+ "@vitest/browser": "^4.1.10",
92
244
  "@vitest/browser-playwright": "^4.1.5",
93
245
  "@vitest/coverage-v8": "^4.1.5",
94
246
  "@zag-js/dialog": "^1.37.0",
@@ -121,7 +273,8 @@
121
273
  "vite-plugin-devtools-json": "^1.0.0",
122
274
  "vite-plugin-glsl": "^1.6.0",
123
275
  "vitest": "^4.1.5",
124
- "vitest-browser-svelte": "^2.1.1"
276
+ "vitest-browser-svelte": "^2.1.1",
277
+ "wireit": "^0.14.13"
125
278
  },
126
279
  "engines": {
127
280
  "node": ">=22.12.0"
@@ -131,16 +284,20 @@
131
284
  },
132
285
  "scripts": {
133
286
  "dev": "vite dev",
134
- "build": "vite build && pnpm prepack",
287
+ "build": "wireit",
288
+ "vite-build": "wireit",
289
+ "package": "wireit",
290
+ "svelte-sync": "wireit",
135
291
  "preview": "vite preview",
136
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
292
+ "check": "wireit",
137
293
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
138
- "lint": "eslint . --concurrency auto",
294
+ "lint": "wireit",
139
295
  "lint:fix": "eslint . --fix --concurrency auto",
140
- "format": "prettier --check .",
296
+ "format": "wireit",
141
297
  "format:fix": "prettier --write .",
142
298
  "test:unit": "vitest",
143
- "test": "pnpm test:unit -- --run",
299
+ "test": "wireit",
300
+ "test:coverage": "wireit",
144
301
  "test:e2e": "playwright test",
145
302
  "release": "changeset publish"
146
303
  }
@@ -1,9 +0,0 @@
1
- interface Props {
2
- value: string;
3
- options: string[];
4
- label?: string;
5
- onChange: (value: string) => void;
6
- }
7
- declare const ComponentNameSelect: import("svelte").Component<Props, {}, "">;
8
- type ComponentNameSelect = ReturnType<typeof ComponentNameSelect>;
9
- export default ComponentNameSelect;
@@ -1,10 +0,0 @@
1
- import type { Pose } from '@viamrobotics/sdk';
2
- interface Props {
3
- referenceFrame: string;
4
- pose: Pose;
5
- onReferenceFrameChange: (frame: string) => void;
6
- onPoseChange: (pose: Pose) => void;
7
- }
8
- declare const PoseInFrameInput: import("svelte").Component<Props, {}, "">;
9
- type PoseInFrameInput = ReturnType<typeof PoseInFrameInput>;
10
- export default PoseInFrameInput;