@viamrobotics/test-widgets 0.10.2 → 0.11.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.
Files changed (31) hide show
  1. package/dist/components/audio-properties.svelte +3 -3
  2. package/dist/components/connection-status.svelte +1 -3
  3. package/dist/components/error.svelte +15 -10
  4. package/dist/components/readings-list.svelte +30 -30
  5. package/dist/components/refetch-controller.svelte +2 -2
  6. package/dist/components/widgets/audio-input/audio-input.svelte +85 -83
  7. package/dist/components/widgets/audio-output/audio-output.svelte +93 -91
  8. package/dist/components/widgets/base/base.svelte +39 -37
  9. package/dist/components/widgets/base/move-straight.svelte +1 -1
  10. package/dist/components/widgets/base/set-power.svelte +1 -1
  11. package/dist/components/widgets/base/set-velocity.svelte +1 -1
  12. package/dist/components/widgets/base/spin.svelte +1 -1
  13. package/dist/components/widgets/board/pin-selector.svelte +1 -1
  14. package/dist/components/widgets/board/read-write-pins.svelte +1 -1
  15. package/dist/components/widgets/camera/camera.svelte +6 -5
  16. package/dist/components/widgets/camera/live-or-polling-video.svelte +2 -2
  17. package/dist/components/widgets/discovery/resources-list.svelte +35 -33
  18. package/dist/components/widgets/do-command/do-command.svelte +44 -41
  19. package/dist/components/widgets/gantry/gantry.svelte +102 -98
  20. package/dist/components/widgets/gantry/move-to-position.svelte +1 -1
  21. package/dist/components/widgets/gripper/gripper.svelte +41 -39
  22. package/dist/components/widgets/motor/go-for.svelte +1 -1
  23. package/dist/components/widgets/motor/go-to.svelte +1 -1
  24. package/dist/components/widgets/motor/motor.svelte +88 -86
  25. package/dist/components/widgets/pcd/inputs.svelte +1 -1
  26. package/dist/components/widgets/pcd/pcd-widget.svelte +19 -17
  27. package/dist/components/widgets/servo/servo.svelte +69 -64
  28. package/dist/components/widgets/vision-service/image.svelte +10 -3
  29. package/dist/components/widgets/vision-service/object-point-clouds.svelte +1 -1
  30. package/dist/components/widgets/vision-service/vision-service.svelte +5 -5
  31. package/package.json +16 -6
@@ -76,107 +76,109 @@
76
76
 
77
77
  <ConnectionStatus {partID}>
78
78
  {#snippet connected()}
79
- <div class="flex flex-row divide-x">
80
- <div class="flex w-full flex-col divide-y">
81
- <MutationSection
82
- title="Quick move"
83
- lastError={quickSetPowerMutation.error}
84
- >
85
- <QuickMove setPower={quickSetPower} />
86
- </MutationSection>
87
- <MutationSection
88
- title="SetPower"
89
- api="rdk:component:motor"
90
- description="Move continuously"
91
- lastError={setPowerMutation.error}
92
- >
93
- <SetPower {setPower} />
94
- </MutationSection>
95
- {#if propertiesQuery.data?.positionReporting}
79
+ <div class="@container">
80
+ <div class="flex flex-col divide-y @2xl:flex-row @2xl:divide-x @2xl:divide-y-0">
81
+ <div class="flex w-full flex-col divide-y">
96
82
  <MutationSection
97
- title="SetRPM"
98
- api="rdk:component:motor"
99
- description="Move indefinitely at a specified speed."
100
- lastError={setRPMMutation.error}
101
- >
102
- <SetRPM {setRPM} />
103
- </MutationSection>
104
- <MutationSection
105
- title="GoFor"
106
- api="rdk:component:motor"
107
- description="Move a specified number of revolutions"
108
- lastError={goForMutation.error}
83
+ title="Quick move"
84
+ lastError={quickSetPowerMutation.error}
109
85
  >
110
- <GoFor {goFor} />
86
+ <QuickMove setPower={quickSetPower} />
111
87
  </MutationSection>
112
88
  <MutationSection
113
- title="GoTo"
89
+ title="SetPower"
114
90
  api="rdk:component:motor"
115
- description="Turn to a specified position"
116
- lastError={goToMutation.error}
91
+ description="Move continuously"
92
+ lastError={setPowerMutation.error}
117
93
  >
118
- <GoTo {goTo} />
94
+ <SetPower {setPower} />
119
95
  </MutationSection>
120
- {/if}
121
- </div>
122
-
123
- <div class="ml-auto flex w-full max-w-1/2 flex-col divide-y sm:max-w-1/3">
124
- <ApiSection
125
- title="Stop"
126
- api="rdk:component:motor"
127
- >
128
- <StopButton
129
- error={stopMutation.error}
130
- onStop={() => {
131
- stopMutation.mutate([])
132
- }}
133
- />
134
- </ApiSection>
135
- <IsMoving
136
- client={MotorClient}
137
- api="rdk:component:motor"
138
- {partID}
139
- {resourceName}
140
- >
141
- <div class="flex flex-col gap-6 pt-2">
142
- <ApiSection
143
- title="IsPowered"
96
+ {#if propertiesQuery.data?.positionReporting}
97
+ <MutationSection
98
+ title="SetRPM"
144
99
  api="rdk:component:motor"
145
- class="gap-3 p-0"
146
- tooltip="Returns whether or not the motor is running and the current portion of max power.
147
-
148
- Stepper motors will report ”true” if they are being powered while holding
149
- a position and while they are turning."
100
+ description="Move indefinitely at a specified speed."
101
+ lastError={setRPMMutation.error}
150
102
  >
151
- <Query query={isPoweredQuery}>
152
- {#if isPoweredQuery.data !== undefined}
153
- {@const [isPowered, powerPct] = isPoweredQuery.data}
154
- <span class="font-roboto-mono flex flex-row gap-1 text-xs">
155
- <p class="text-default">{isPowered}</p>
156
- <p class="text-disabled">/</p>
157
- <p class="text-subtle-1">
158
- {formatNumeric(powerPct * 100, 1)}%
159
- </p>
160
- </span>
161
- {/if}
162
- </Query>
163
- </ApiSection>
164
- {#if propertiesQuery.data?.positionReporting === true}
103
+ <SetRPM {setRPM} />
104
+ </MutationSection>
105
+ <MutationSection
106
+ title="GoFor"
107
+ api="rdk:component:motor"
108
+ description="Move a specified number of revolutions"
109
+ lastError={goForMutation.error}
110
+ >
111
+ <GoFor {goFor} />
112
+ </MutationSection>
113
+ <MutationSection
114
+ title="GoTo"
115
+ api="rdk:component:motor"
116
+ description="Turn to a specified position"
117
+ lastError={goToMutation.error}
118
+ >
119
+ <GoTo {goTo} />
120
+ </MutationSection>
121
+ {/if}
122
+ </div>
123
+
124
+ <div class="flex w-full flex-col divide-y @2xl:ml-auto @2xl:max-w-1/2 @4xl:max-w-1/3">
125
+ <ApiSection
126
+ title="Stop"
127
+ api="rdk:component:motor"
128
+ >
129
+ <StopButton
130
+ error={stopMutation.error}
131
+ onStop={() => {
132
+ stopMutation.mutate([])
133
+ }}
134
+ />
135
+ </ApiSection>
136
+ <IsMoving
137
+ client={MotorClient}
138
+ api="rdk:component:motor"
139
+ {partID}
140
+ {resourceName}
141
+ >
142
+ <div class="flex flex-col gap-6 pt-2">
165
143
  <ApiSection
166
- title="GetPosition"
144
+ title="IsPowered"
167
145
  api="rdk:component:motor"
168
146
  class="gap-3 p-0"
169
- tooltip="Reports the position of an encoded motor in revolutions from zero/home."
147
+ tooltip="Returns whether or not the motor is running and the current portion of max power.
148
+
149
+ Stepper motors will report ”true” if they are being powered while holding
150
+ a position and while they are turning."
170
151
  >
171
- <Query query={positionQuery}>
172
- <p class="font-roboto-mono text-default text-xs">
173
- {formatNumeric(positionQuery.data, 4)}
174
- </p>
152
+ <Query query={isPoweredQuery}>
153
+ {#if isPoweredQuery.data !== undefined}
154
+ {@const [isPowered, powerPct] = isPoweredQuery.data}
155
+ <span class="font-roboto-mono flex flex-row gap-1 text-xs">
156
+ <p class="text-default">{isPowered}</p>
157
+ <p class="text-disabled">/</p>
158
+ <p class="text-subtle-1">
159
+ {formatNumeric(powerPct * 100, 1)}%
160
+ </p>
161
+ </span>
162
+ {/if}
175
163
  </Query>
176
164
  </ApiSection>
177
- {/if}
178
- </div>
179
- </IsMoving>
165
+ {#if propertiesQuery.data?.positionReporting === true}
166
+ <ApiSection
167
+ title="GetPosition"
168
+ api="rdk:component:motor"
169
+ class="gap-3 p-0"
170
+ tooltip="Reports the position of an encoded motor in revolutions from zero/home."
171
+ >
172
+ <Query query={positionQuery}>
173
+ <p class="font-roboto-mono text-default text-xs">
174
+ {formatNumeric(positionQuery.data, 4)}
175
+ </p>
176
+ </Query>
177
+ </ApiSection>
178
+ {/if}
179
+ </div>
180
+ </IsMoving>
181
+ </div>
180
182
  </div>
181
183
  </div>
182
184
  {/snippet}
@@ -40,7 +40,7 @@
40
40
  }
41
41
  </script>
42
42
 
43
- <div class="flex w-1/3 flex-col gap-2">
43
+ <div class="flex flex-col gap-2 @2xl:w-1/3">
44
44
  <Label>
45
45
  Point size
46
46
 
@@ -24,22 +24,24 @@
24
24
  }
25
25
  </script>
26
26
 
27
- <div class="flex h-120 gap-4">
28
- <Inputs
29
- {pointSize}
30
- {up}
31
- {data}
32
- onPointSizeChange={handlePointSizeChange}
33
- onUpChange={handleUpChange}
34
- />
35
-
36
- <div class="relative h-full w-2/3 overflow-hidden border">
37
- <Canvas>
38
- <Scene
39
- {data}
40
- {up}
41
- {pointSize}
42
- />
43
- </Canvas>
27
+ <div class="@container">
28
+ <div class="flex flex-col gap-4 @2xl:h-120 @2xl:flex-row">
29
+ <Inputs
30
+ {pointSize}
31
+ {up}
32
+ {data}
33
+ onPointSizeChange={handlePointSizeChange}
34
+ onUpChange={handleUpChange}
35
+ />
36
+
37
+ <div class="relative h-80 overflow-hidden border @2xl:h-full @2xl:w-2/3">
38
+ <Canvas>
39
+ <Scene
40
+ {data}
41
+ {up}
42
+ {pointSize}
43
+ />
44
+ </Canvas>
45
+ </div>
44
46
  </div>
45
47
  </div>
@@ -48,71 +48,76 @@
48
48
 
49
49
  <ConnectionStatus {partID}>
50
50
  {#snippet connected()}
51
- <div class="flex flex-row divide-x">
52
- <div class="grid grow grid-cols-3 divide-x">
53
- <ApiSection
54
- title="GetPosition"
55
- api="rdk:component:servo"
56
- bottomText="Updates automatically"
57
- >
58
- <Query query={positionQuery}>
59
- {#if positionQuery.data !== undefined}
60
- <!-- span required to get unit closer to position reading -->
61
- <span class="flex flex-row gap-1">
62
- <span class="font-roboto-mono font-normal">{formatNumeric(positionQuery.data)}</span
63
- >
64
- <abbr class="text-subtle-2">º</abbr>
65
- </span>
66
- {/if}
67
- </Query>
68
- </ApiSection>
69
- <ApiSection
70
- title="Move"
71
- api="rdk:component:servo"
72
- >
73
- <Query query={positionQuery}>
74
- {#if positionQuery.data !== undefined}
75
- <Move
76
- currentPosition={positionQuery.data}
77
- {moveTo}
78
- lastError={moveMutation.error}
79
- />
80
- {/if}
81
- </Query>
82
- </ApiSection>
83
- <ApiSection
84
- title="Quick move"
85
- bottomText="Press a button to execute"
86
- >
87
- <Query query={positionQuery}>
88
- {#if positionQuery.data !== undefined}
89
- <QuickMove
90
- currentPosition={positionQuery.data}
91
- moveTo={quickMoveTo}
92
- lastError={quickMoveMutation.error}
93
- />
94
- {/if}
95
- </Query>
96
- </ApiSection>
97
- </div>
98
- <div class="ml-auto flex w-full max-w-40 flex-col divide-y">
99
- <ApiSection
100
- title="Stop"
101
- api="rdk:component:servo"
102
- >
103
- <StopButton
104
- error={stopMutation.error}
105
- onStop={() => {
106
- stopMutation.mutate([])
107
- }}
51
+ <div class="@container">
52
+ <div class="flex flex-col divide-y @4xl:flex-row @4xl:divide-x @4xl:divide-y-0">
53
+ <div class="@container grow">
54
+ <div class="grid grid-cols-1 divide-y @2xl:grid-cols-3 @2xl:divide-x @2xl:divide-y-0">
55
+ <ApiSection
56
+ title="GetPosition"
57
+ api="rdk:component:servo"
58
+ bottomText="Updates automatically"
59
+ >
60
+ <Query query={positionQuery}>
61
+ {#if positionQuery.data !== undefined}
62
+ <!-- span required to get unit closer to position reading -->
63
+ <span class="flex flex-row gap-1">
64
+ <span class="font-roboto-mono font-normal"
65
+ >{formatNumeric(positionQuery.data)}</span
66
+ >
67
+ <abbr class="text-subtle-2">º</abbr>
68
+ </span>
69
+ {/if}
70
+ </Query>
71
+ </ApiSection>
72
+ <ApiSection
73
+ title="Move"
74
+ api="rdk:component:servo"
75
+ >
76
+ <Query query={positionQuery}>
77
+ {#if positionQuery.data !== undefined}
78
+ <Move
79
+ currentPosition={positionQuery.data}
80
+ {moveTo}
81
+ lastError={moveMutation.error}
82
+ />
83
+ {/if}
84
+ </Query>
85
+ </ApiSection>
86
+ <ApiSection
87
+ title="Quick move"
88
+ bottomText="Press a button to execute"
89
+ >
90
+ <Query query={positionQuery}>
91
+ {#if positionQuery.data !== undefined}
92
+ <QuickMove
93
+ currentPosition={positionQuery.data}
94
+ moveTo={quickMoveTo}
95
+ lastError={quickMoveMutation.error}
96
+ />
97
+ {/if}
98
+ </Query>
99
+ </ApiSection>
100
+ </div>
101
+ </div>
102
+ <div class="flex flex-col divide-y @4xl:ml-auto @4xl:w-full @4xl:max-w-40">
103
+ <ApiSection
104
+ title="Stop"
105
+ api="rdk:component:servo"
106
+ >
107
+ <StopButton
108
+ error={stopMutation.error}
109
+ onStop={() => {
110
+ stopMutation.mutate([])
111
+ }}
112
+ />
113
+ </ApiSection>
114
+ <IsMoving
115
+ client={ServoClient}
116
+ api="rdk:component:servo"
117
+ {partID}
118
+ {resourceName}
108
119
  />
109
- </ApiSection>
110
- <IsMoving
111
- client={ServoClient}
112
- api="rdk:component:servo"
113
- {partID}
114
- {resourceName}
115
- />
120
+ </div>
116
121
  </div>
117
122
  </div>
118
123
  {/snippet}
@@ -70,6 +70,9 @@
70
70
 
71
71
  let container = $state<HTMLElement>()
72
72
  let size = $state<Size>()
73
+ let isStacked = $state(false)
74
+
75
+ const STACK_WIDTH_PX = 672
73
76
 
74
77
  useResizeObserver(
75
78
  () => container,
@@ -80,6 +83,7 @@
80
83
 
81
84
  const setSize = () => {
82
85
  if (container) {
86
+ isStacked = container.clientWidth < STACK_WIDTH_PX
83
87
  size = getImageSize(img, container)
84
88
  }
85
89
  }
@@ -101,7 +105,10 @@
101
105
  </script>
102
106
 
103
107
  <div
104
- class="flex h-full min-h-0 w-full min-w-0 gap-2 py-2 pl-2"
108
+ class={[
109
+ 'flex min-h-0 w-full min-w-0 gap-2 py-2 pl-2',
110
+ isStacked ? 'flex-col' : 'h-full flex-row',
111
+ ]}
105
112
  bind:this={container}
106
113
  >
107
114
  {#if !size}
@@ -129,8 +136,8 @@
129
136
  </Canvas>
130
137
  </div>
131
138
  <div
132
- class="flex grow flex-col pr-2"
133
- style:height={`${size.height.toString()}px`}
139
+ class={['flex grow flex-col pr-2', isStacked && 'min-h-40']}
140
+ style:height={isStacked ? undefined : `${size.height.toString()}px`}
134
141
  >
135
142
  <Legend
136
143
  classifications={data?.classifications}
@@ -61,7 +61,7 @@
61
61
  </script>
62
62
 
63
63
  <div class="relative h-[600px] max-h-[80vh] bg-white">
64
- <div class="relative z-10 h-full overflow-y-scroll p-4">
64
+ <div class="relative z-10 h-full overflow-x-auto overflow-y-scroll p-4">
65
65
  <div class="grid grid-cols-[repeat(auto-fit,320px)] justify-center gap-4">
66
66
  {#each items as item (item.id)}
67
67
  <div class="w-[320px] shadow-sm">
@@ -122,8 +122,8 @@
122
122
  <ConnectionStatus {partID}>
123
123
  {#snippet connected()}
124
124
  <div class="flex flex-col gap-2 px-4 pt-4 pb-3">
125
- <div class="flex flex-row gap-4">
126
- <div class="w-50">
125
+ <div class="flex flex-wrap gap-4">
126
+ <div class="w-50 max-w-full">
127
127
  <Label position="top">
128
128
  Camera
129
129
  <Select
@@ -160,7 +160,7 @@
160
160
 
161
161
  <h6 class="text-subtle-1 font-semibold">Detections/Classifications</h6>
162
162
 
163
- <div class="flex gap-4">
163
+ <div class="flex flex-wrap gap-4">
164
164
  <RefetchController
165
165
  allowLive
166
166
  {refetchInterval}
@@ -218,8 +218,8 @@
218
218
  </Queries>
219
219
 
220
220
  <h6 class="text-subtle-1 mt-4 font-semibold">Object point clouds</h6>
221
- <div class="flex items-center gap-4">
222
- <div class="w-50">
221
+ <div class="flex flex-wrap items-center gap-4">
222
+ <div class="w-50 max-w-full">
223
223
  <Label position="left">
224
224
  Show object point clouds
225
225
  <Switch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/test-widgets",
3
- "version": "0.10.2",
3
+ "version": "0.11.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "wireit": {
@@ -103,7 +103,8 @@
103
103
  "!coverage/**",
104
104
  "!test-results/**",
105
105
  "!.env*",
106
- "!**/*.tgz"
106
+ "!**/*.tgz",
107
+ "!.claude/**"
107
108
  ],
108
109
  "output": [],
109
110
  "packageLocks": [
@@ -120,7 +121,8 @@
120
121
  "!coverage/**",
121
122
  "!test-results/**",
122
123
  "!.env*",
123
- "!**/*.tgz"
124
+ "!**/*.tgz",
125
+ "!.claude/**"
124
126
  ],
125
127
  "output": [],
126
128
  "packageLocks": [
@@ -216,18 +218,27 @@
216
218
  "@fontsource-variable/public-sans": "^5.2.7",
217
219
  "@fontsource-variable/roboto-mono": "^5.2.8",
218
220
  "@fontsource-variable/space-grotesk": "^5.2.10",
221
+ "@houserules/cli": "^0.4.1",
222
+ "@houserules/plugin-accessibility": "^0.1.3",
223
+ "@houserules/plugin-changesets": "^0.2.2",
224
+ "@houserules/plugin-design": "^0.2.2",
225
+ "@houserules/plugin-prose": "^0.1.4",
226
+ "@houserules/plugin-svelte": "^0.1.2",
227
+ "@houserules/plugin-testing": "^0.2.1",
228
+ "@houserules/plugin-three": "^0.2.1",
229
+ "@houserules/plugin-typescript": "^0.1.2",
219
230
  "@playwright/test": "^1.59.1",
220
231
  "@sentry/svelte": "^10.50.0",
221
232
  "@sveltejs/adapter-static": "^3.0.10",
222
233
  "@sveltejs/kit": "^2.69.1",
223
234
  "@sveltejs/package": "^2.5.7",
224
235
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
236
+ "@tailwindcss/oxide": "^4.2.4",
225
237
  "@tailwindcss/postcss": "^4.2.4",
226
238
  "@tailwindcss/vite": "^4.2.4",
227
239
  "@tanstack/svelte-query": "^6.1.25",
228
240
  "@tanstack/svelte-query-devtools": "^6.1.25",
229
241
  "@testing-library/dom": "^10.4.1",
230
- "@testing-library/jest-dom": "^6.9.1",
231
242
  "@testing-library/svelte": "^5.3.1",
232
243
  "@testing-library/user-event": "^14.6.1",
233
244
  "@threlte/core": "^8.5.9",
@@ -239,7 +250,7 @@
239
250
  "@viamrobotics/prime-core": "^0.1.22",
240
251
  "@viamrobotics/sdk": "^0.69.0",
241
252
  "@viamrobotics/svelte-sdk": "^1.2.1",
242
- "@viamrobotics/tailwind-config": "^1.0.0",
253
+ "@viamrobotics/tailwind-config": "^1.2.0",
243
254
  "@vitest/browser": "^4.1.10",
244
255
  "@vitest/browser-playwright": "^4.1.5",
245
256
  "@vitest/coverage-v8": "^4.1.5",
@@ -252,7 +263,6 @@
252
263
  "globals": "^17.5.0",
253
264
  "lodash-es": "^4.18.1",
254
265
  "maplibre-gl": "^5.24.0",
255
- "mock-match-media": "^1.0.3",
256
266
  "playwright": "^1.59.1",
257
267
  "prettier": "^3.8.3",
258
268
  "prettier-plugin-svelte": "^3.5.1",