@viamrobotics/test-widgets 0.15.1 → 0.17.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.
Files changed (200) hide show
  1. package/README.md +15 -1
  2. package/dist/api-docs-href.d.ts +2 -2
  3. package/dist/api-docs-href.js +0 -1
  4. package/dist/components/api-section.svelte +58 -49
  5. package/dist/components/api-section.svelte.d.ts +24 -10
  6. package/dist/components/boundary.svelte +51 -0
  7. package/dist/components/boundary.svelte.d.ts +5 -0
  8. package/dist/components/connection-status.svelte +57 -61
  9. package/dist/components/connection-status.svelte.d.ts +5 -5
  10. package/dist/components/content-rect.svelte +10 -5
  11. package/dist/components/content-rect.svelte.d.ts +3 -1
  12. package/dist/components/error.svelte +15 -5
  13. package/dist/components/error.svelte.d.ts +8 -1
  14. package/dist/components/index.d.ts +4 -3
  15. package/dist/components/index.js +4 -3
  16. package/dist/components/is-moving.svelte +29 -35
  17. package/dist/components/is-moving.svelte.d.ts +6 -6
  18. package/dist/components/maplibre/index.svelte +5 -6
  19. package/dist/components/maplibre/index.svelte.d.ts +3 -1
  20. package/dist/components/pose-editor.svelte +83 -15
  21. package/dist/components/pose-editor.svelte.d.ts +11 -4
  22. package/dist/components/progress.svelte +1 -0
  23. package/dist/components/queries.svelte +14 -4
  24. package/dist/components/queries.svelte.d.ts +6 -1
  25. package/dist/components/query.svelte +11 -3
  26. package/dist/components/query.svelte.d.ts +6 -1
  27. package/dist/components/section/error-key.d.ts +2 -0
  28. package/dist/components/section/error-key.js +2 -0
  29. package/dist/components/section/index.d.ts +21 -0
  30. package/dist/components/section/index.js +21 -0
  31. package/dist/components/section/section-body.svelte +36 -0
  32. package/dist/components/section/section-body.svelte.d.ts +13 -0
  33. package/dist/components/section/section-error-reporter.d.ts +8 -0
  34. package/dist/components/section/section-error-reporter.js +7 -0
  35. package/dist/components/section/section-error.svelte +36 -0
  36. package/dist/components/section/section-error.svelte.d.ts +9 -0
  37. package/dist/components/section/section-errors.svelte +145 -0
  38. package/dist/components/section/section-errors.svelte.d.ts +6 -0
  39. package/dist/components/section/section-heading.svelte +21 -0
  40. package/dist/components/section/section-heading.svelte.d.ts +9 -0
  41. package/dist/components/section/section-loading.d.ts +4 -0
  42. package/dist/components/section/section-loading.js +10 -0
  43. package/dist/components/section/section-method.svelte +29 -0
  44. package/dist/components/section/section-method.svelte.d.ts +9 -0
  45. package/dist/components/section/section-placeholder.svelte +29 -0
  46. package/dist/components/section/section-placeholder.svelte.d.ts +7 -0
  47. package/dist/components/section/section-text.svelte +17 -0
  48. package/dist/components/section/section-text.svelte.d.ts +8 -0
  49. package/dist/components/section/section-tooltip.svelte +25 -0
  50. package/dist/components/section/section-tooltip.svelte.d.ts +7 -0
  51. package/dist/components/section/section.svelte +23 -0
  52. package/dist/components/section/section.svelte.d.ts +11 -0
  53. package/dist/components/section/use-section-errors.svelte.d.ts +19 -0
  54. package/dist/components/section/use-section-errors.svelte.js +49 -0
  55. package/dist/components/stop-button.svelte +1 -5
  56. package/dist/components/stop-button.svelte.d.ts +0 -1
  57. package/dist/components/stop.svelte +31 -14
  58. package/dist/components/stop.svelte.d.ts +6 -1
  59. package/dist/components/widgets/arm/arm.svelte +43 -40
  60. package/dist/components/widgets/arm/get-joint-positions-widget.svelte +10 -9
  61. package/dist/components/widgets/arm/joint-position-editor.svelte +105 -27
  62. package/dist/components/widgets/arm/joint-position-editor.svelte.d.ts +4 -3
  63. package/dist/components/widgets/arm/joint-position-slider.svelte +6 -2
  64. package/dist/components/widgets/arm/joint-position-slider.svelte.d.ts +2 -1
  65. package/dist/components/widgets/arm/manual-mode-widget.svelte +16 -6
  66. package/dist/components/widgets/arm/manual-mode.svelte +1 -5
  67. package/dist/components/widgets/arm/manual-mode.svelte.d.ts +0 -1
  68. package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +22 -8
  69. package/dist/components/widgets/arm/move-to-joint-positions.svelte +15 -17
  70. package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +0 -1
  71. package/dist/components/widgets/arm/move-to-position-control.svelte +45 -33
  72. package/dist/components/widgets/arm/move-to-position.svelte +97 -34
  73. package/dist/components/widgets/arm/move-to-position.svelte.d.ts +3 -2
  74. package/dist/components/widgets/arm/quick-move-widget.svelte +10 -4
  75. package/dist/components/widgets/arm/quick-move.svelte +1 -4
  76. package/dist/components/widgets/arm/quick-move.svelte.d.ts +0 -1
  77. package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.d.ts +16 -0
  78. package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.js +37 -0
  79. package/dist/components/widgets/arm/use-edited-targets.svelte.d.ts +9 -0
  80. package/dist/components/widgets/arm/use-edited-targets.svelte.js +24 -0
  81. package/dist/components/widgets/audio-input/audio-input.svelte +80 -77
  82. package/dist/components/widgets/audio-input/get-properties-widget.svelte +16 -16
  83. package/dist/components/widgets/audio-output/audio-output.svelte +87 -84
  84. package/dist/components/widgets/audio-output/get-properties-widget.svelte +16 -16
  85. package/dist/components/widgets/base/base.svelte +78 -43
  86. package/dist/components/widgets/base/move-straight-widget.svelte +16 -4
  87. package/dist/components/widgets/base/quick-move-widget.svelte +25 -9
  88. package/dist/components/widgets/base/quick-move.svelte +5 -6
  89. package/dist/components/widgets/base/set-power-widget.svelte +20 -8
  90. package/dist/components/widgets/base/set-power.svelte +6 -4
  91. package/dist/components/widgets/base/set-velocity-widget.svelte +20 -8
  92. package/dist/components/widgets/base/set-velocity.svelte +6 -4
  93. package/dist/components/widgets/base/spin-widget.svelte +20 -8
  94. package/dist/components/widgets/base/vec3-builder.svelte +3 -2
  95. package/dist/components/widgets/base/vec3-builder.svelte.d.ts +2 -1
  96. package/dist/components/widgets/board/analog-read.svelte +2 -4
  97. package/dist/components/widgets/board/analog-write.svelte +2 -4
  98. package/dist/components/widgets/board/gpio-read.svelte +2 -1
  99. package/dist/components/widgets/board/gpio-write.svelte +2 -1
  100. package/dist/components/widgets/board/pin-section.svelte +5 -6
  101. package/dist/components/widgets/board/pin-section.svelte.d.ts +3 -2
  102. package/dist/components/widgets/board/read-write-pins.svelte +2 -2
  103. package/dist/components/widgets/button/push.svelte +2 -2
  104. package/dist/components/widgets/camera/camera.svelte +17 -24
  105. package/dist/components/widgets/camera/live-or-polling-video.svelte +33 -30
  106. package/dist/components/widgets/custom-control/__tests__/__fixtures__/with-sibling.svelte +10 -0
  107. package/dist/components/widgets/custom-control/control-frame.svelte +60 -0
  108. package/dist/components/widgets/custom-control/control-frame.svelte.d.ts +10 -0
  109. package/dist/components/widgets/custom-control/create-control-host.svelte.d.ts +19 -0
  110. package/dist/components/widgets/custom-control/create-control-host.svelte.js +26 -0
  111. package/dist/components/widgets/custom-control/custom-control.d.ts +35 -0
  112. package/dist/components/widgets/custom-control/custom-control.js +85 -0
  113. package/dist/components/widgets/custom-control/custom-control.svelte +45 -0
  114. package/dist/components/widgets/custom-control/custom-control.svelte.d.ts +14 -0
  115. package/dist/components/widgets/discovery/discovery.svelte +13 -17
  116. package/dist/components/widgets/encoder/encoder.svelte +25 -21
  117. package/dist/components/widgets/encoder/get-position-widget.svelte +19 -16
  118. package/dist/components/widgets/gantry/gantry.svelte +58 -76
  119. package/dist/components/widgets/gantry/get-position-widget.svelte +15 -14
  120. package/dist/components/widgets/gantry/home.svelte +21 -10
  121. package/dist/components/widgets/gantry/move-to-position-widget.svelte +2 -1
  122. package/dist/components/widgets/gantry/move-to-position.svelte +1 -4
  123. package/dist/components/widgets/gantry/move-to-position.svelte.d.ts +0 -1
  124. package/dist/components/widgets/gantry/quick-move-widget.svelte +3 -2
  125. package/dist/components/widgets/gantry/quick-move.svelte +1 -5
  126. package/dist/components/widgets/gantry/quick-move.svelte.d.ts +0 -1
  127. package/dist/components/widgets/generic/generic.svelte +11 -6
  128. package/dist/components/widgets/gripper/grab-widget.svelte +26 -0
  129. package/dist/components/widgets/gripper/grab-widget.svelte.d.ts +7 -0
  130. package/dist/components/widgets/gripper/grab.svelte +3 -19
  131. package/dist/components/widgets/gripper/grab.svelte.d.ts +1 -2
  132. package/dist/components/widgets/gripper/gripper.svelte +18 -18
  133. package/dist/components/widgets/gripper/is-holding-something.svelte +21 -21
  134. package/dist/components/widgets/gripper/open-widget.svelte +26 -0
  135. package/dist/components/widgets/gripper/open-widget.svelte.d.ts +7 -0
  136. package/dist/components/widgets/gripper/open.svelte +3 -19
  137. package/dist/components/widgets/gripper/open.svelte.d.ts +1 -2
  138. package/dist/components/widgets/input-controller/input-controller.svelte +10 -16
  139. package/dist/components/widgets/input-controller/webgamepad.svelte +2 -2
  140. package/dist/components/widgets/ml-model-service/ml-model-service.svelte +1 -1
  141. package/dist/components/widgets/motion/frame-select.svelte +4 -2
  142. package/dist/components/widgets/motion/frame-select.svelte.d.ts +2 -1
  143. package/dist/components/widgets/motion/motion.svelte +27 -31
  144. package/dist/components/widgets/motion/move-widget.svelte +32 -12
  145. package/dist/components/widgets/motion/move-widget.svelte.d.ts +6 -0
  146. package/dist/components/widgets/motion/move.svelte +6 -16
  147. package/dist/components/widgets/motion/move.svelte.d.ts +0 -1
  148. package/dist/components/widgets/motor/go-for-view.svelte +16 -8
  149. package/dist/components/widgets/motor/go-to-view.svelte +12 -4
  150. package/dist/components/widgets/motor/motor.svelte +100 -64
  151. package/dist/components/widgets/motor/quick-move-widget.svelte +16 -8
  152. package/dist/components/widgets/motor/set-power-widget.svelte +12 -4
  153. package/dist/components/widgets/motor/set-rpm-widget.svelte +12 -4
  154. package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +8 -11
  155. package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +8 -11
  156. package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +8 -11
  157. package/dist/components/widgets/movement-sensor/get-position-widget.svelte +8 -11
  158. package/dist/components/widgets/movement-sensor/movement-sensor.svelte +64 -66
  159. package/dist/components/widgets/operations-and-sessions/operations-and-sessions.svelte +2 -1
  160. package/dist/components/widgets/power-sensor/get-current-widget.svelte +8 -11
  161. package/dist/components/widgets/power-sensor/get-power-widget.svelte +8 -11
  162. package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +8 -11
  163. package/dist/components/widgets/power-sensor/power-sensor.svelte +35 -45
  164. package/dist/components/widgets/sensor/sensor.svelte +8 -12
  165. package/dist/components/widgets/servo/move-widget.svelte +2 -1
  166. package/dist/components/widgets/servo/move.svelte +1 -4
  167. package/dist/components/widgets/servo/move.svelte.d.ts +0 -1
  168. package/dist/components/widgets/servo/quick-move-widget.svelte +2 -1
  169. package/dist/components/widgets/servo/quick-move.svelte +1 -5
  170. package/dist/components/widgets/servo/quick-move.svelte.d.ts +0 -1
  171. package/dist/components/widgets/servo/servo.svelte +53 -37
  172. package/dist/components/widgets/slam/get-position-widget.svelte +8 -11
  173. package/dist/components/widgets/slam/move-on-map.svelte +9 -6
  174. package/dist/components/widgets/slam/move-on-map.svelte.d.ts +2 -1
  175. package/dist/components/widgets/slam/slam.svelte +65 -75
  176. package/dist/components/widgets/switch/position-view.svelte +1 -1
  177. package/dist/components/widgets/switch/position.svelte +2 -2
  178. package/dist/components/widgets/switch/switch.svelte +1 -1
  179. package/dist/components/widgets/vision-service/detection-row.svelte +4 -2
  180. package/dist/components/widgets/vision-service/detection-row.svelte.d.ts +2 -1
  181. package/dist/components/widgets/vision-service/fonts/public-sans.json +1 -0
  182. package/dist/components/widgets/vision-service/fonts/public-sans.png +0 -0
  183. package/dist/components/widgets/vision-service/image.svelte +4 -4
  184. package/dist/components/widgets/vision-service/legend.svelte +4 -4
  185. package/dist/components/widgets/vision-service/public-sans-font.d.ts +5 -0
  186. package/dist/components/widgets/vision-service/public-sans-font.js +14 -0
  187. package/dist/components/widgets/vision-service/vision-service.svelte +2 -2
  188. package/dist/index.d.ts +1 -1
  189. package/dist/index.js +0 -1
  190. package/package.json +19 -5
  191. package/dist/components/board/pin-section.svelte +0 -28
  192. package/dist/components/board/pin-section.svelte.d.ts +0 -9
  193. package/dist/components/mutation-section.svelte +0 -73
  194. package/dist/components/mutation-section.svelte.d.ts +0 -16
  195. package/dist/components/mutation-view.svelte +0 -29
  196. package/dist/components/mutation-view.svelte.d.ts +0 -10
  197. package/dist/components/section-group.svelte +0 -64
  198. package/dist/components/section-group.svelte.d.ts +0 -14
  199. package/dist/components/section-title.svelte +0 -63
  200. package/dist/components/section-title.svelte.d.ts +0 -14
@@ -9,9 +9,8 @@
9
9
  import ReadingsList from '../../readings-list.svelte'
10
10
  import RefetchController from '../../refetch-controller.svelte'
11
11
  import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
12
- import SectionTitle from '../../section-title.svelte'
13
-
14
- const MS_API = 'rdk:component:movement_sensor'
12
+ import { Section } from '../../section'
13
+ import { ResourceTriplets } from '../../../resource-triplet'
15
14
 
16
15
  import Accuracy from './accuracy.svelte'
17
16
  import CompassHeading from './compass-heading.svelte'
@@ -86,8 +85,6 @@
86
85
  enabled: showFullReadings,
87
86
  refetchInterval: refetchInterval.current,
88
87
  }))
89
-
90
- const headingID = $props.id()
91
88
  </script>
92
89
 
93
90
  <ConnectionStatus {partID}>
@@ -101,20 +98,22 @@
101
98
 
102
99
  <Query
103
100
  query={propertiesQuery}
104
- contentCx="p-4 h-14"
101
+ class="h-14 p-4"
105
102
  >
106
103
  <div class="@container">
107
104
  <div class="flex flex-wrap text-xs @4xl:flex-nowrap">
108
105
  <div class="flex w-full flex-col gap-5 py-4 pr-6 pl-4 @4xl:w-1/4">
109
106
  {#if propertiesQuery.data?.positionSupported}
110
107
  <div class="flex flex-col gap-2">
111
- <SectionTitle
112
- title="GetPosition"
113
- api={MS_API}
114
- />
108
+ <Section.Heading>
109
+ <Section.Method
110
+ method="GetPosition"
111
+ api={ResourceTriplets.MovementSensor}
112
+ />
113
+ </Section.Heading>
115
114
  <Query
116
115
  query={positionQuery}
117
- contentCx="h-6"
116
+ class="h-6"
118
117
  >
119
118
  {#if positionQuery.data !== undefined}
120
119
  <Position data={positionQuery.data} />
@@ -125,16 +124,16 @@
125
124
 
126
125
  {#if propertiesQuery.data?.orientationSupported}
127
126
  <div class="flex flex-col gap-2">
128
- <SectionTitle
129
- title="GetOrientation"
130
- api={MS_API}
131
- >
132
- {#snippet suffix()}<span class="text-subtle-2 text-xs font-normal">(º)</span
133
- >{/snippet}
134
- </SectionTitle>
127
+ <Section.Heading>
128
+ <Section.Method
129
+ method="GetOrientation"
130
+ api={ResourceTriplets.MovementSensor}
131
+ />
132
+ <span class="text-subtle-2 text-xs font-normal">(º)</span>
133
+ </Section.Heading>
135
134
  <Query
136
135
  query={orientationQuery}
137
- contentCx="h-6"
136
+ class="h-6"
138
137
  >
139
138
  {#if orientationQuery.data !== undefined}
140
139
  <Orientation data={orientationQuery.data} />
@@ -145,16 +144,16 @@
145
144
 
146
145
  {#if propertiesQuery.data?.compassHeadingSupported}
147
146
  <div class="flex flex-col gap-2">
148
- <SectionTitle
149
- title="GetCompassHeading"
150
- api={MS_API}
151
- >
152
- {#snippet suffix()}<span class="text-subtle-2 text-xs font-normal">(º)</span
153
- >{/snippet}
154
- </SectionTitle>
147
+ <Section.Heading>
148
+ <Section.Method
149
+ method="GetCompassHeading"
150
+ api={ResourceTriplets.MovementSensor}
151
+ />
152
+ <span class="text-subtle-2 text-xs font-normal">(º)</span>
153
+ </Section.Heading>
155
154
  <Query
156
155
  query={compassHeadingQuery}
157
- contentCx="h-6"
156
+ class="h-6"
158
157
  >
159
158
  {#if compassHeadingQuery.data !== undefined}
160
159
  <CompassHeading data={compassHeadingQuery.data} />
@@ -167,16 +166,16 @@
167
166
  <div class="flex w-full flex-col gap-5 p-4 @4xl:w-1/4">
168
167
  {#if propertiesQuery.data?.angularVelocitySupported}
169
168
  <div class="flex flex-col gap-2">
170
- <SectionTitle
171
- title="GetAngularVelocity"
172
- api={MS_API}
173
- >
174
- {#snippet suffix()}<span class="text-subtle-2 text-xs font-normal">(º/s)</span
175
- >{/snippet}
176
- </SectionTitle>
169
+ <Section.Heading>
170
+ <Section.Method
171
+ method="GetAngularVelocity"
172
+ api={ResourceTriplets.MovementSensor}
173
+ />
174
+ <span class="text-subtle-2 text-xs font-normal">(º/s)</span>
175
+ </Section.Heading>
177
176
  <Query
178
177
  query={angularVelocityQuery}
179
- contentCx="h-6"
178
+ class="h-6"
180
179
  >
181
180
  {#if angularVelocityQuery.data !== undefined}
182
181
  <Vector3 data={angularVelocityQuery.data} />
@@ -187,16 +186,16 @@
187
186
 
188
187
  {#if propertiesQuery.data?.linearVelocitySupported}
189
188
  <div class="flex flex-col gap-2">
190
- <SectionTitle
191
- title="GetLinearVelocity"
192
- api={MS_API}
193
- >
194
- {#snippet suffix()}<span class="text-subtle-2 text-xs font-normal">(m/s)</span
195
- >{/snippet}
196
- </SectionTitle>
189
+ <Section.Heading>
190
+ <Section.Method
191
+ method="GetLinearVelocity"
192
+ api={ResourceTriplets.MovementSensor}
193
+ />
194
+ <span class="text-subtle-2 text-xs font-normal">(m/s)</span>
195
+ </Section.Heading>
197
196
  <Query
198
197
  query={linearVelocityQuery}
199
- contentCx="h-6"
198
+ class="h-6"
200
199
  >
201
200
  {#if linearVelocityQuery.data !== undefined}
202
201
  <Vector3 data={linearVelocityQuery.data} />
@@ -207,17 +206,16 @@
207
206
 
208
207
  {#if propertiesQuery.data?.linearAccelerationSupported}
209
208
  <div class="flex flex-col gap-2">
210
- <SectionTitle
211
- title="GetLinearAcceleration"
212
- api={MS_API}
213
- >
214
- {#snippet suffix()}<span class="text-subtle-2 text-xs font-normal"
215
- >(m/s<sup>2</sup>)</span
216
- >{/snippet}
217
- </SectionTitle>
209
+ <Section.Heading>
210
+ <Section.Method
211
+ method="GetLinearAcceleration"
212
+ api={ResourceTriplets.MovementSensor}
213
+ />
214
+ <span class="text-subtle-2 text-xs font-normal">(m/s<sup>2</sup>)</span>
215
+ </Section.Heading>
218
216
  <Query
219
217
  query={linearAccelerationQuery}
220
- contentCx="h-6"
218
+ class="h-6"
221
219
  >
222
220
  {#if linearAccelerationQuery.data !== undefined}
223
221
  <Vector3 data={linearAccelerationQuery.data} />
@@ -227,13 +225,15 @@
227
225
  {/if}
228
226
 
229
227
  <div class="flex flex-col gap-2">
230
- <SectionTitle
231
- title="GetAccuracy"
232
- api={MS_API}
233
- />
228
+ <Section.Heading>
229
+ <Section.Method
230
+ method="GetAccuracy"
231
+ api={ResourceTriplets.MovementSensor}
232
+ />
233
+ </Section.Heading>
234
234
  <Query
235
235
  query={accuracyQuery}
236
- contentCx="h-6"
236
+ class="h-6"
237
237
  >
238
238
  {#if accuracyQuery.data !== undefined}
239
239
  <Accuracy data={accuracyQuery.data} />
@@ -252,16 +252,14 @@
252
252
  </div>
253
253
  </Query>
254
254
 
255
- <section
256
- class="flex flex-col gap-4 p-4"
257
- aria-labelledby={headingID}
258
- >
255
+ <section class="flex flex-col gap-4 p-4">
259
256
  <div class="flex flex-col gap-0.5">
260
- <SectionTitle
261
- title="GetReadings"
262
- api={MS_API}
263
- headingId={headingID}
264
- />
257
+ <Section.Heading>
258
+ <Section.Method
259
+ method="GetReadings"
260
+ api={ResourceTriplets.MovementSensor}
261
+ />
262
+ </Section.Heading>
265
263
  <p class="text-subtle-2 text-xs">Get all the measurements and data from the sensor</p>
266
264
  </div>
267
265
 
@@ -4,6 +4,7 @@
4
4
  import { slide } from 'svelte/transition'
5
5
 
6
6
  import ErrorDisplay from '../../error.svelte'
7
+ import { Section } from '../../section'
7
8
 
8
9
  import OperationsTable from './operations-table.svelte'
9
10
  import RttPill from './rtt-pill.svelte'
@@ -98,7 +99,7 @@
98
99
  />
99
100
  {/if}
100
101
  <ErrorDisplay lastError={operationsQuery.error} />
101
- <ErrorDisplay lastError={cancelOperationMutation.error} />
102
+ <Section.Error error={cancelOperationMutation.error} />
102
103
  </div>
103
104
  <div class="flex h-max flex-col gap-2">
104
105
  <span class="text-default text-sm font-semibold">Sessions</span>
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import CurrentReading from './current-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetCurrent"
28
- class="grow"
27
+ queries={[query]}
28
+ method="GetCurrent"
29
+ api={ResourceTriplets.PowerSensor}
30
+ class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- contentCx="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <CurrentReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <CurrentReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import PowerReading from './power-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetPower"
28
- class="grow"
27
+ queries={[query]}
28
+ method="GetPower"
29
+ api={ResourceTriplets.PowerSensor}
30
+ class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- contentCx="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <PowerReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <PowerReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import VoltageReading from './voltage-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetVoltage"
28
- class="grow"
27
+ queries={[query]}
28
+ method="GetVoltage"
29
+ api={ResourceTriplets.PowerSensor}
30
+ class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- contentCx="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <VoltageReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <VoltageReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -6,10 +6,11 @@
6
6
 
7
7
  import ApiSection from '../../api-section.svelte'
8
8
  import ConnectionStatus from '../../connection-status.svelte'
9
- import Query from '../../query.svelte'
10
9
  import ReadingsList from '../../readings-list.svelte'
11
10
  import RefetchController from '../../refetch-controller.svelte'
12
11
  import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
12
+ import { Section } from '../../section'
13
+ import { ResourceTriplets } from '../../../resource-triplet'
13
14
 
14
15
  import CurrentReading from './current-reading.svelte'
15
16
  import PowerReading from './power-reading.svelte'
@@ -66,55 +67,49 @@
66
67
  <div class="@container">
67
68
  <div class="grid w-full grid-cols-1 divide-y @2xl:grid-cols-3 @2xl:divide-x @2xl:divide-y-0">
68
69
  <ApiSection
69
- title="GetCurrent"
70
- api="rdk:component:power_sensor"
71
- class="pb-5"
70
+ queries={[currentQuery]}
71
+ method="GetCurrent"
72
+ api={ResourceTriplets.PowerSensor}
73
+ class="grow flex-col gap-4 pb-5"
72
74
  >
73
- <Query
74
- query={currentQuery}
75
- contentCx="h-6"
76
- >
77
- {#if currentQuery.data !== undefined}
78
- <CurrentReading data={currentQuery.data} />
79
- {/if}
80
- </Query>
75
+ {#if currentQuery.data !== undefined}
76
+ <CurrentReading data={currentQuery.data} />
77
+ {/if}
81
78
  </ApiSection>
82
79
  <ApiSection
83
- title="GetVoltage"
84
- api="rdk:component:power_sensor"
85
- class="pb-5"
80
+ queries={[voltageQuery]}
81
+ method="GetVoltage"
82
+ api={ResourceTriplets.PowerSensor}
83
+ class="grow flex-col gap-4 pb-5"
86
84
  >
87
- <Query
88
- query={voltageQuery}
89
- contentCx="h-6"
90
- >
91
- {#if voltageQuery.data !== undefined}
92
- <VoltageReading data={voltageQuery.data} />
93
- {/if}
94
- </Query>
85
+ {#if voltageQuery.data !== undefined}
86
+ <VoltageReading data={voltageQuery.data} />
87
+ {/if}
95
88
  </ApiSection>
96
89
  <ApiSection
97
- title="GetPower"
98
- api="rdk:component:power_sensor"
99
- class="pb-5"
90
+ queries={[powerQuery]}
91
+ method="GetPower"
92
+ api={ResourceTriplets.PowerSensor}
93
+ class="grow flex-col gap-4 pb-5"
100
94
  >
101
- <Query
102
- query={powerQuery}
103
- contentCx="h-6"
104
- >
105
- {#if powerQuery.data !== undefined}
106
- <PowerReading data={powerQuery.data} />
107
- {/if}
108
- </Query>
95
+ {#if powerQuery.data !== undefined}
96
+ <PowerReading data={powerQuery.data} />
97
+ {/if}
109
98
  </ApiSection>
110
99
  </div>
111
100
  </div>
112
101
 
113
102
  <ApiSection
114
- title="GetReadings"
115
- api="rdk:component:power_sensor"
116
- description="Get all the measurements and data that this power sensor provides"
103
+ queries={[readingsQuery]}
104
+ class="grow flex-col gap-4"
105
+ method="GetReadings"
106
+ api={ResourceTriplets.PowerSensor}
117
107
  >
108
+ {#snippet subheading()}
109
+ <Section.Text>
110
+ Get all the measurements and data that this power sensor provides
111
+ </Section.Text>
112
+ {/snippet}
118
113
  <Switch
119
114
  bind:on={isGetReadingsEnabled}
120
115
  cx="text-subtle-2"
@@ -125,14 +120,9 @@
125
120
  transition:slide={{ duration: 150 }}
126
121
  class="pt-2"
127
122
  >
128
- <Query
129
- query={readingsQuery}
130
- contentCx="h-6"
131
- >
132
- {#if readingsQuery.data !== undefined}
133
- <ReadingsList data={readingsQuery.data} />
134
- {/if}
135
- </Query>
123
+ {#if readingsQuery.data !== undefined}
124
+ <ReadingsList data={readingsQuery.data} />
125
+ {/if}
136
126
  </div>
137
127
  {/if}
138
128
  </ApiSection>
@@ -4,10 +4,10 @@
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
6
  import ConnectionStatus from '../../connection-status.svelte'
7
- import Query from '../../query.svelte'
8
7
  import ReadingsList from '../../readings-list.svelte'
9
8
  import RefetchController from '../../refetch-controller.svelte'
10
9
  import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
10
+ import { ResourceTriplets } from '../../../resource-triplet'
11
11
 
12
12
  interface Props {
13
13
  partID: string
@@ -43,18 +43,14 @@
43
43
  </div>
44
44
 
45
45
  <ApiSection
46
- title="GetReadings"
47
- api="rdk:component:sensor"
48
- class="relative"
46
+ queries={[readingsQuery]}
47
+ method="GetReadings"
48
+ api={ResourceTriplets.Sensor}
49
+ class="relative grow flex-col gap-4"
49
50
  >
50
- <Query
51
- query={readingsQuery}
52
- contentCx="h-6"
53
- >
54
- {#if readingsQuery.data !== undefined}
55
- <ReadingsList data={readingsQuery.data} />
56
- {/if}
57
- </Query>
51
+ {#if readingsQuery.data !== undefined}
52
+ <ReadingsList data={readingsQuery.data} />
53
+ {/if}
58
54
  </ApiSection>
59
55
  {/snippet}
60
56
  </ConnectionStatus>
@@ -7,6 +7,7 @@
7
7
  } from '@viamrobotics/svelte-sdk'
8
8
 
9
9
  import Query from '../../query.svelte'
10
+ import { Section } from '../../section'
10
11
 
11
12
  import Move from './move.svelte'
12
13
 
@@ -38,7 +39,7 @@
38
39
  <Move
39
40
  currentPosition={positionQuery.data}
40
41
  {moveTo}
41
- lastError={moveMutation.error}
42
42
  />
43
43
  {/if}
44
44
  </Query>
45
+ <Section.Error error={moveMutation.error} />
@@ -1,16 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { Button, Icon, Label, NumericInput, Tooltip } from '@viamrobotics/prime-core'
3
3
 
4
- import ErrorDisplay from '../../error.svelte'
5
4
  import { numberValueFromEvent } from '../../../event-handlers'
6
5
 
7
6
  interface Props {
8
7
  currentPosition: number
9
8
  moveTo: (angle: number) => void
10
- lastError: Error | null
11
9
  }
12
10
 
13
- const { currentPosition, moveTo, lastError }: Props = $props()
11
+ const { currentPosition, moveTo }: Props = $props()
14
12
 
15
13
  let desiredAngle = $state(0)
16
14
 
@@ -99,4 +97,3 @@
99
97
  Execute
100
98
  </Button>
101
99
  </div>
102
- <ErrorDisplay {lastError} />
@@ -1,7 +1,6 @@
1
1
  interface Props {
2
2
  currentPosition: number;
3
3
  moveTo: (angle: number) => void;
4
- lastError: Error | null;
5
4
  }
6
5
  declare const Move: import("svelte").Component<Props, {}, "">;
7
6
  type Move = ReturnType<typeof Move>;
@@ -7,6 +7,7 @@
7
7
  } from '@viamrobotics/svelte-sdk'
8
8
 
9
9
  import Query from '../../query.svelte'
10
+ import { Section } from '../../section'
10
11
 
11
12
  import QuickMove from './quick-move.svelte'
12
13
 
@@ -38,7 +39,7 @@
38
39
  <QuickMove
39
40
  currentPosition={positionQuery.data}
40
41
  moveTo={quickMoveTo}
41
- lastError={quickMoveMutation.error}
42
42
  />
43
43
  {/if}
44
44
  </Query>
45
+ <Section.Error error={quickMoveMutation.error} />
@@ -1,15 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { Button } from '@viamrobotics/prime-core'
3
3
 
4
- import ErrorDisplay from '../../error.svelte'
5
-
6
4
  interface Props {
7
5
  currentPosition: number
8
6
  moveTo: (angle: number) => void
9
- lastError: Error | null
10
7
  }
11
8
 
12
- const { currentPosition, moveTo, lastError }: Props = $props()
9
+ const { currentPosition, moveTo }: Props = $props()
13
10
  </script>
14
11
 
15
12
  <div class="flex flex-row gap-4 text-xs">
@@ -31,4 +28,3 @@
31
28
  <abbr class="text-subtle-2">º</abbr>
32
29
  </Button>
33
30
  </div>
34
- <ErrorDisplay {lastError} />
@@ -1,7 +1,6 @@
1
1
  interface Props {
2
2
  currentPosition: number;
3
3
  moveTo: (angle: number) => void;
4
- lastError: Error | null;
5
4
  }
6
5
  declare const QuickMove: import("svelte").Component<Props, {}, "">;
7
6
  type QuickMove = ReturnType<typeof QuickMove>;