@viamrobotics/test-widgets 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/api-section.svelte +58 -50
- package/dist/components/api-section.svelte.d.ts +24 -11
- package/dist/components/content-rect.svelte +6 -0
- package/dist/components/content-rect.svelte.d.ts +1 -0
- package/dist/components/error.svelte +9 -0
- package/dist/components/error.svelte.d.ts +6 -0
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +4 -2
- package/dist/components/is-moving.svelte +26 -34
- package/dist/components/is-moving.svelte.d.ts +4 -5
- package/dist/components/progress.svelte +1 -0
- package/dist/components/queries.svelte +7 -0
- package/dist/components/queries.svelte.d.ts +4 -0
- package/dist/components/query.svelte +7 -0
- package/dist/components/query.svelte.d.ts +4 -0
- package/dist/components/section/index.d.ts +2 -0
- package/dist/components/section/index.js +2 -0
- package/dist/components/section/section-error-reporter.d.ts +8 -0
- package/dist/components/section/section-error-reporter.js +7 -0
- package/dist/components/section/section-error.svelte +36 -0
- package/dist/components/section/section-error.svelte.d.ts +9 -0
- package/dist/components/section/section-errors.svelte +132 -5
- package/dist/components/section/section.svelte +7 -1
- package/dist/components/section/section.svelte.d.ts +3 -0
- package/dist/components/section/use-section-errors.svelte.d.ts +1 -0
- package/dist/components/section/use-section-errors.svelte.js +11 -1
- package/dist/components/stop-button.svelte +1 -5
- package/dist/components/stop-button.svelte.d.ts +0 -1
- package/dist/components/stop.svelte +2 -2
- package/dist/components/widgets/arm/arm.svelte +24 -32
- package/dist/components/widgets/arm/get-joint-positions-widget.svelte +9 -8
- package/dist/components/widgets/arm/manual-mode-widget.svelte +13 -4
- package/dist/components/widgets/arm/manual-mode.svelte +1 -5
- package/dist/components/widgets/arm/manual-mode.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +10 -4
- package/dist/components/widgets/arm/move-to-joint-positions.svelte +1 -11
- package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/move-to-position-control.svelte +22 -18
- package/dist/components/widgets/arm/move-to-position.svelte +0 -4
- package/dist/components/widgets/arm/move-to-position.svelte.d.ts +0 -1
- package/dist/components/widgets/arm/quick-move-widget.svelte +10 -4
- package/dist/components/widgets/arm/quick-move.svelte +1 -4
- package/dist/components/widgets/arm/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/audio-input/audio-input.svelte +76 -74
- package/dist/components/widgets/audio-input/get-properties-widget.svelte +15 -15
- package/dist/components/widgets/audio-output/audio-output.svelte +83 -81
- package/dist/components/widgets/audio-output/get-properties-widget.svelte +15 -15
- package/dist/components/widgets/base/base.svelte +70 -37
- package/dist/components/widgets/base/move-straight-widget.svelte +16 -4
- package/dist/components/widgets/base/quick-move-widget.svelte +25 -9
- package/dist/components/widgets/base/set-power-widget.svelte +20 -8
- package/dist/components/widgets/base/set-velocity-widget.svelte +20 -8
- package/dist/components/widgets/base/spin-widget.svelte +20 -8
- package/dist/components/widgets/board/read-write-pins.svelte +2 -2
- package/dist/components/widgets/button/push.svelte +2 -2
- package/dist/components/widgets/camera/camera.svelte +15 -23
- package/dist/components/widgets/camera/live-or-polling-video.svelte +12 -9
- package/dist/components/widgets/custom-control/__tests__/__fixtures__/with-sibling.svelte +10 -0
- package/dist/components/widgets/custom-control/control-frame.svelte +60 -0
- package/dist/components/widgets/custom-control/control-frame.svelte.d.ts +10 -0
- package/dist/components/widgets/custom-control/create-control-host.svelte.d.ts +19 -0
- package/dist/components/widgets/custom-control/create-control-host.svelte.js +28 -0
- package/dist/components/widgets/custom-control/custom-control.d.ts +35 -0
- package/dist/components/widgets/custom-control/custom-control.js +85 -0
- package/dist/components/widgets/custom-control/custom-control.svelte +45 -0
- package/dist/components/widgets/custom-control/custom-control.svelte.d.ts +14 -0
- package/dist/components/widgets/discovery/discovery.svelte +10 -15
- package/dist/components/widgets/encoder/encoder.svelte +20 -18
- package/dist/components/widgets/encoder/get-position-widget.svelte +18 -15
- package/dist/components/widgets/gantry/gantry.svelte +50 -74
- package/dist/components/widgets/gantry/get-position-widget.svelte +14 -13
- package/dist/components/widgets/gantry/home.svelte +21 -10
- package/dist/components/widgets/gantry/move-to-position-widget.svelte +2 -1
- package/dist/components/widgets/gantry/move-to-position.svelte +1 -4
- package/dist/components/widgets/gantry/move-to-position.svelte.d.ts +0 -1
- package/dist/components/widgets/gantry/quick-move-widget.svelte +2 -1
- package/dist/components/widgets/gantry/quick-move.svelte +1 -5
- package/dist/components/widgets/gantry/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/generic/generic.svelte +7 -5
- package/dist/components/widgets/gripper/grab-widget.svelte +26 -0
- package/dist/components/widgets/gripper/grab-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gripper/grab.svelte +3 -19
- package/dist/components/widgets/gripper/grab.svelte.d.ts +1 -2
- package/dist/components/widgets/gripper/gripper.svelte +10 -12
- package/dist/components/widgets/gripper/is-holding-something.svelte +18 -19
- package/dist/components/widgets/gripper/open-widget.svelte +26 -0
- package/dist/components/widgets/gripper/open-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gripper/open.svelte +3 -19
- package/dist/components/widgets/gripper/open.svelte.d.ts +1 -2
- package/dist/components/widgets/input-controller/input-controller.svelte +7 -14
- package/dist/components/widgets/input-controller/webgamepad.svelte +2 -2
- package/dist/components/widgets/motion/motion.svelte +27 -35
- package/dist/components/widgets/motion/move-widget.svelte +32 -12
- package/dist/components/widgets/motion/move-widget.svelte.d.ts +6 -0
- package/dist/components/widgets/motion/move.svelte +1 -13
- package/dist/components/widgets/motion/move.svelte.d.ts +0 -1
- package/dist/components/widgets/motor/go-for-view.svelte +16 -8
- package/dist/components/widgets/motor/go-to-view.svelte +12 -4
- package/dist/components/widgets/motor/motor.svelte +88 -54
- package/dist/components/widgets/motor/quick-move-widget.svelte +16 -8
- package/dist/components/widgets/motor/set-power-widget.svelte +12 -4
- package/dist/components/widgets/motor/set-rpm-widget.svelte +12 -4
- package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +7 -10
- package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +7 -10
- package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +7 -10
- package/dist/components/widgets/movement-sensor/get-position-widget.svelte +7 -10
- package/dist/components/widgets/movement-sensor/movement-sensor.svelte +55 -56
- package/dist/components/widgets/operations-and-sessions/operations-and-sessions.svelte +2 -1
- package/dist/components/widgets/power-sensor/get-current-widget.svelte +7 -10
- package/dist/components/widgets/power-sensor/get-power-widget.svelte +7 -10
- package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +7 -10
- package/dist/components/widgets/power-sensor/power-sensor.svelte +26 -38
- package/dist/components/widgets/sensor/sensor.svelte +5 -10
- package/dist/components/widgets/servo/move-widget.svelte +2 -1
- package/dist/components/widgets/servo/move.svelte +1 -4
- package/dist/components/widgets/servo/move.svelte.d.ts +0 -1
- package/dist/components/widgets/servo/quick-move-widget.svelte +2 -1
- package/dist/components/widgets/servo/quick-move.svelte +1 -5
- package/dist/components/widgets/servo/quick-move.svelte.d.ts +0 -1
- package/dist/components/widgets/servo/servo.svelte +44 -33
- package/dist/components/widgets/slam/get-position-widget.svelte +7 -10
- package/dist/components/widgets/slam/move-on-map.svelte +6 -5
- package/dist/components/widgets/slam/move-on-map.svelte.d.ts +2 -1
- package/dist/components/widgets/slam/slam.svelte +64 -79
- package/dist/components/widgets/switch/position.svelte +2 -2
- package/package.json +3 -2
- package/dist/components/mutation-section.svelte +0 -75
- package/dist/components/mutation-section.svelte.d.ts +0 -18
- package/dist/components/mutation-view.svelte +0 -29
- package/dist/components/mutation-view.svelte.d.ts +0 -10
- package/dist/components/section-title.svelte +0 -65
- package/dist/components/section-title.svelte.d.ts +0 -15
|
@@ -16,13 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
import ApiSection from '../../api-section.svelte'
|
|
18
18
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
19
|
-
import Queries from '../../queries.svelte'
|
|
20
|
-
import Query from '../../query.svelte'
|
|
21
19
|
import RefetchController from '../../refetch-controller.svelte'
|
|
22
20
|
import {
|
|
23
21
|
createRefetchIntervalStore,
|
|
24
22
|
RefetchIntervals,
|
|
25
23
|
} from '../../refetch-interval-store.svelte'
|
|
24
|
+
import { Section } from '../../section'
|
|
26
25
|
import SlamMap2D from '../../slam/map2d/index.svelte'
|
|
27
26
|
import { ResourceTriplets } from '../../../resource-triplet'
|
|
28
27
|
|
|
@@ -179,48 +178,41 @@
|
|
|
179
178
|
|
|
180
179
|
<ConnectionStatus {partID}>
|
|
181
180
|
{#snippet connected()}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
{refetchInterval}
|
|
201
|
-
queries={[positionQuery, pointCloudMapQuery]}
|
|
202
|
-
/>
|
|
203
|
-
</div>
|
|
181
|
+
{#if propertiesQuery.data?.cloudSlam}
|
|
182
|
+
<div class="p-4 text-sm">
|
|
183
|
+
This resource is using Cloud SLAM. <a
|
|
184
|
+
href="https://docs.viam.com/operate/reference/services/slam/cloudslam/"
|
|
185
|
+
target="_blank"
|
|
186
|
+
class="text-link">Learn more</a
|
|
187
|
+
>.
|
|
188
|
+
</div>
|
|
189
|
+
{:else}
|
|
190
|
+
<div class="@container">
|
|
191
|
+
<div class="flex flex-col @2xl:flex-row @2xl:divide-x">
|
|
192
|
+
<div class="divide-y">
|
|
193
|
+
<div class="m-4">
|
|
194
|
+
<RefetchController
|
|
195
|
+
{refetchInterval}
|
|
196
|
+
queries={[positionQuery, pointCloudMapQuery]}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
204
199
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
<Position position={positionQuery.data} />
|
|
216
|
-
{/if}
|
|
217
|
-
</Queries>
|
|
218
|
-
</ApiSection>
|
|
200
|
+
<ApiSection
|
|
201
|
+
class="grow flex-col gap-4"
|
|
202
|
+
method="GetPosition"
|
|
203
|
+
api={ResourceTriplets.Slam}
|
|
204
|
+
queries={[propertiesQuery, positionQuery, pointCloudMapQuery]}
|
|
205
|
+
>
|
|
206
|
+
{#if positionQuery.data !== undefined}
|
|
207
|
+
<Position position={positionQuery.data} />
|
|
208
|
+
{/if}
|
|
209
|
+
</ApiSection>
|
|
219
210
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
>
|
|
211
|
+
<Section class="grow flex-col gap-4">
|
|
212
|
+
<div class="flex flex-col gap-0.5">
|
|
213
|
+
<Section.Heading>Motion</Section.Heading>
|
|
214
|
+
</div>
|
|
215
|
+
<Section.Body>
|
|
224
216
|
<Label>
|
|
225
217
|
Base name
|
|
226
218
|
|
|
@@ -238,46 +230,39 @@
|
|
|
238
230
|
bind:value={motionName}
|
|
239
231
|
/>
|
|
240
232
|
</Label>
|
|
241
|
-
</
|
|
233
|
+
</Section.Body>
|
|
234
|
+
</Section>
|
|
242
235
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
236
|
+
<MoveOnMap
|
|
237
|
+
{destination}
|
|
238
|
+
{updateDestination}
|
|
239
|
+
{moveOnMap}
|
|
240
|
+
{stopPlan}
|
|
241
|
+
mutations={[moveOnMapMutation, stopPlanMutation]}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
251
244
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
: undefined}
|
|
271
|
-
helpers={true}
|
|
272
|
-
onClick={handleClick}
|
|
273
|
-
/>
|
|
274
|
-
</div>
|
|
275
|
-
{/if}
|
|
276
|
-
</Queries>
|
|
277
|
-
</div>
|
|
245
|
+
<div class="flex w-full p-4">
|
|
246
|
+
{#if positionQuery.data?.pose !== undefined && pointCloudMapQuery.data !== undefined}
|
|
247
|
+
<div class="h-80 w-full @2xl:h-full">
|
|
248
|
+
<SlamMap2D
|
|
249
|
+
pointcloud={pointCloudMapQuery.data}
|
|
250
|
+
basePose={{
|
|
251
|
+
// Position is returned in millimeters, but the map uses meters
|
|
252
|
+
x: positionQuery.data.pose.x / 1000,
|
|
253
|
+
y: positionQuery.data.pose.y / 1000,
|
|
254
|
+
theta: positionQuery.data.pose.theta,
|
|
255
|
+
}}
|
|
256
|
+
{motionPath}
|
|
257
|
+
destination={destination ? new Vector2(destination.x, destination.y) : undefined}
|
|
258
|
+
helpers={true}
|
|
259
|
+
onClick={handleClick}
|
|
260
|
+
/>
|
|
261
|
+
</div>
|
|
262
|
+
{/if}
|
|
278
263
|
</div>
|
|
279
264
|
</div>
|
|
280
|
-
|
|
281
|
-
|
|
265
|
+
</div>
|
|
266
|
+
{/if}
|
|
282
267
|
{/snippet}
|
|
283
268
|
</ConnectionStatus>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ToggleButtons } from '@viamrobotics/prime-core'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { Section } from '../../section'
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
numPositions: number
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
cx={[{ '[&>div>button]:w-12!': !hasLabels }, 'font-roboto-mono [&>div]:flex-wrap!']}
|
|
40
40
|
on:input={handleInput}
|
|
41
41
|
/>
|
|
42
|
-
<
|
|
42
|
+
<Section.Error error={lastError} />
|
|
43
43
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamrobotics/test-widgets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"wireit": {
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
"@types/node": "^25.6.0",
|
|
254
254
|
"@types/three": "^0.183.1",
|
|
255
255
|
"@viamrobotics/prime-core": "^0.1.22",
|
|
256
|
-
"@viamrobotics/sdk": "^0.
|
|
256
|
+
"@viamrobotics/sdk": "^0.76.0",
|
|
257
257
|
"@viamrobotics/svelte-sdk": "^1.5.1",
|
|
258
258
|
"@viamrobotics/tailwind-config": "^1.2.0",
|
|
259
259
|
"@vitest/browser": "^5.0.1",
|
|
@@ -294,6 +294,7 @@
|
|
|
294
294
|
"node": ">=22.12.0"
|
|
295
295
|
},
|
|
296
296
|
"dependencies": {
|
|
297
|
+
"@viamrobotics/post-message-sdk": "0.2.0",
|
|
297
298
|
"svelte-tweakpane-ui": "^1.5.17"
|
|
298
299
|
},
|
|
299
300
|
"scripts": {
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte'
|
|
3
|
-
import type { ClassValue } from 'svelte/elements'
|
|
4
|
-
|
|
5
|
-
import type { ResourceTriplet } from '../resource-triplet'
|
|
6
|
-
|
|
7
|
-
import Boundary from './boundary.svelte'
|
|
8
|
-
import ErrorDisplay from './error.svelte'
|
|
9
|
-
import SectionTitle from './section-title.svelte'
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
title: string
|
|
13
|
-
tooltip?: string | undefined
|
|
14
|
-
description?: string | undefined
|
|
15
|
-
lastError: Error | null
|
|
16
|
-
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
17
|
-
api?: ResourceTriplet | undefined
|
|
18
|
-
class?: ClassValue
|
|
19
|
-
titleInput?: Snippet
|
|
20
|
-
error?: Snippet
|
|
21
|
-
children?: Snippet
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
title,
|
|
26
|
-
tooltip,
|
|
27
|
-
description,
|
|
28
|
-
lastError = null,
|
|
29
|
-
api,
|
|
30
|
-
class: className,
|
|
31
|
-
titleInput,
|
|
32
|
-
error,
|
|
33
|
-
children,
|
|
34
|
-
}: Props = $props()
|
|
35
|
-
|
|
36
|
-
const headingID = $props.id()
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<section
|
|
40
|
-
class="flex w-full flex-col gap-2 p-4"
|
|
41
|
-
aria-labelledby={headingID}
|
|
42
|
-
>
|
|
43
|
-
<div class={['flex grow flex-row flex-wrap gap-2', className]}>
|
|
44
|
-
<div class="flex max-w-50 grow flex-col gap-0.5 pr-4">
|
|
45
|
-
{#if api}
|
|
46
|
-
<SectionTitle
|
|
47
|
-
{title}
|
|
48
|
-
{tooltip}
|
|
49
|
-
{api}
|
|
50
|
-
headingId={headingID}
|
|
51
|
-
/>
|
|
52
|
-
{:else}
|
|
53
|
-
<h3
|
|
54
|
-
class="flex flex-row items-center gap-1 text-sm font-semibold"
|
|
55
|
-
id={headingID}
|
|
56
|
-
>
|
|
57
|
-
{title}
|
|
58
|
-
</h3>
|
|
59
|
-
{/if}
|
|
60
|
-
{#if description}
|
|
61
|
-
<p class="text-subtle-2 text-xs">{description}</p>
|
|
62
|
-
{/if}
|
|
63
|
-
{@render titleInput?.()}
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div class="flex grow flex-wrap justify-between gap-2">
|
|
67
|
-
<Boundary {children} />
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
{#if error}
|
|
71
|
-
{@render error()}
|
|
72
|
-
{:else}
|
|
73
|
-
<ErrorDisplay {lastError} />
|
|
74
|
-
{/if}
|
|
75
|
-
</section>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { ClassValue } from 'svelte/elements';
|
|
3
|
-
import type { ResourceTriplet } from '../resource-triplet';
|
|
4
|
-
interface Props {
|
|
5
|
-
title: string;
|
|
6
|
-
tooltip?: string | undefined;
|
|
7
|
-
description?: string | undefined;
|
|
8
|
-
lastError: Error | null;
|
|
9
|
-
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
10
|
-
api?: ResourceTriplet | undefined;
|
|
11
|
-
class?: ClassValue;
|
|
12
|
-
titleInput?: Snippet;
|
|
13
|
-
error?: Snippet;
|
|
14
|
-
children?: Snippet;
|
|
15
|
-
}
|
|
16
|
-
declare const MutationSection: import("svelte").Component<Props, {}, "">;
|
|
17
|
-
type MutationSection = ReturnType<typeof MutationSection>;
|
|
18
|
-
export default MutationSection;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte'
|
|
3
|
-
|
|
4
|
-
import ErrorDisplay from './error.svelte'
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
lastError: Error | null
|
|
8
|
-
|
|
9
|
-
titleInput?: Snippet
|
|
10
|
-
error?: Snippet
|
|
11
|
-
children: Snippet
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const { lastError, titleInput, error, children }: Props = $props()
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class="flex flex-col gap-2">
|
|
18
|
-
<span class="inline-flex flex-wrap gap-2">
|
|
19
|
-
{@render titleInput?.()}
|
|
20
|
-
<div class="flex grow flex-wrap justify-between gap-2">
|
|
21
|
-
{@render children()}
|
|
22
|
-
</div>
|
|
23
|
-
</span>
|
|
24
|
-
{#if error}
|
|
25
|
-
{@render error()}
|
|
26
|
-
{:else}
|
|
27
|
-
<ErrorDisplay {lastError} />
|
|
28
|
-
{/if}
|
|
29
|
-
</div>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
interface Props {
|
|
3
|
-
lastError: Error | null;
|
|
4
|
-
titleInput?: Snippet;
|
|
5
|
-
error?: Snippet;
|
|
6
|
-
children: Snippet;
|
|
7
|
-
}
|
|
8
|
-
declare const MutationView: import("svelte").Component<Props, {}, "">;
|
|
9
|
-
type MutationView = ReturnType<typeof MutationView>;
|
|
10
|
-
export default MutationView;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte'
|
|
3
|
-
|
|
4
|
-
import { Icon, Tooltip } from '@viamrobotics/prime-core'
|
|
5
|
-
|
|
6
|
-
import type { ResourceTriplet } from '../resource-triplet'
|
|
7
|
-
|
|
8
|
-
import { apiDocsHref } from '../api-docs-href'
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
title: string
|
|
12
|
-
tooltip?: string | undefined
|
|
13
|
-
/** RDK API string, e.g. "rdk:component:camera". Required — SectionTitle is only for headers that map to an API method; the docs link is built from this plus the title. */
|
|
14
|
-
api: ResourceTriplet
|
|
15
|
-
/** Optional external ID for the <h3>; generated internally if omitted */
|
|
16
|
-
headingId?: string | undefined
|
|
17
|
-
/** Inline content rendered after the title inside the <h3> (e.g. unit labels) */
|
|
18
|
-
suffix?: Snippet
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const { title, tooltip, api, headingId, suffix }: Props = $props()
|
|
22
|
-
|
|
23
|
-
const generatedID = $props.id()
|
|
24
|
-
const id = $derived(headingId ?? generatedID)
|
|
25
|
-
|
|
26
|
-
// Method names are the camelCase form of the PascalCase title (GetPosition → getPosition).
|
|
27
|
-
const method = $derived(title.charAt(0).toLowerCase() + title.slice(1))
|
|
28
|
-
const href = $derived(apiDocsHref(api, method))
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<h3
|
|
32
|
-
class="flex flex-row items-center gap-1 text-sm font-semibold"
|
|
33
|
-
{id}
|
|
34
|
-
>
|
|
35
|
-
{#if href}
|
|
36
|
-
<a
|
|
37
|
-
{href}
|
|
38
|
-
target="_blank"
|
|
39
|
-
rel="noopener noreferrer external"
|
|
40
|
-
class="decoration-gray-5 hover:decoration-default font-mono underline underline-offset-3"
|
|
41
|
-
>
|
|
42
|
-
{title}
|
|
43
|
-
</a>
|
|
44
|
-
{:else}
|
|
45
|
-
<span class="font-mono">{title}</span>
|
|
46
|
-
{/if}
|
|
47
|
-
{#if suffix}
|
|
48
|
-
{@render suffix()}
|
|
49
|
-
{/if}
|
|
50
|
-
{#if tooltip}
|
|
51
|
-
<Tooltip>
|
|
52
|
-
<Icon
|
|
53
|
-
name="information-outline"
|
|
54
|
-
cx="text-gray-6"
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
<p
|
|
58
|
-
slot="description"
|
|
59
|
-
class="text-xs whitespace-pre-line"
|
|
60
|
-
>
|
|
61
|
-
{tooltip}
|
|
62
|
-
</p>
|
|
63
|
-
</Tooltip>
|
|
64
|
-
{/if}
|
|
65
|
-
</h3>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { ResourceTriplet } from '../resource-triplet';
|
|
3
|
-
interface Props {
|
|
4
|
-
title: string;
|
|
5
|
-
tooltip?: string | undefined;
|
|
6
|
-
/** RDK API string, e.g. "rdk:component:camera". Required — SectionTitle is only for headers that map to an API method; the docs link is built from this plus the title. */
|
|
7
|
-
api: ResourceTriplet;
|
|
8
|
-
/** Optional external ID for the <h3>; generated internally if omitted */
|
|
9
|
-
headingId?: string | undefined;
|
|
10
|
-
/** Inline content rendered after the title inside the <h3> (e.g. unit labels) */
|
|
11
|
-
suffix?: Snippet;
|
|
12
|
-
}
|
|
13
|
-
declare const SectionTitle: import("svelte").Component<Props, {}, "">;
|
|
14
|
-
type SectionTitle = ReturnType<typeof SectionTitle>;
|
|
15
|
-
export default SectionTitle;
|