@viamrobotics/test-widgets 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api-docs-href.d.ts +8 -0
- package/dist/api-docs-href.js +17 -0
- package/dist/client-map.d.ts +30 -30
- package/dist/client-map.js +32 -29
- package/dist/components/angle-unit-toggle.svelte +1 -4
- package/dist/components/api-section.svelte +21 -23
- package/dist/components/api-section.svelte.d.ts +2 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.js +21 -0
- package/dist/components/is-moving.svelte +4 -5
- package/dist/components/is-moving.svelte.d.ts +1 -0
- package/dist/components/mutation-section.svelte +20 -23
- package/dist/components/mutation-section.svelte.d.ts +2 -0
- package/dist/components/section-title.svelte +63 -0
- package/dist/components/section-title.svelte.d.ts +14 -0
- package/dist/components/widgets/arm/arm.svelte +25 -29
- package/dist/components/widgets/arm/get-joint-positions-widget.svelte +36 -0
- package/dist/components/widgets/arm/get-joint-positions-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/arm/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/arm/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/arm/joint-position-editor.svelte +89 -0
- package/dist/components/widgets/arm/joint-position-editor.svelte.d.ts +11 -0
- package/dist/components/widgets/arm/joint-position-quick-move.svelte +85 -0
- package/dist/components/widgets/arm/joint-position-quick-move.svelte.d.ts +9 -0
- package/dist/components/widgets/arm/joint-position-slider.svelte +36 -0
- package/dist/components/widgets/arm/joint-position-slider.svelte.d.ts +9 -0
- package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +9 -5
- package/dist/components/widgets/arm/move-to-joint-positions.svelte +73 -127
- package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +1 -0
- package/dist/components/widgets/arm/move-to-position.svelte +31 -3
- package/dist/components/widgets/audio-input/audio-input.svelte +2 -0
- package/dist/components/widgets/audio-input/get-properties-widget.svelte +43 -0
- package/dist/components/widgets/audio-input/get-properties-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/audio-output/audio-output.svelte +2 -0
- package/dist/components/widgets/audio-output/get-properties-widget.svelte +43 -0
- package/dist/components/widgets/audio-output/get-properties-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/base/base.svelte +9 -1
- package/dist/components/widgets/base/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/base/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/base/quick-move.svelte +12 -5
- package/dist/components/widgets/camera/camera.svelte +156 -142
- package/dist/components/widgets/camera/live-or-polling-video.svelte +9 -1
- package/dist/components/widgets/discovery/discovery.svelte +1 -0
- package/dist/components/widgets/encoder/encoder-position-type.d.ts +8 -0
- package/dist/components/widgets/encoder/encoder-position-type.js +20 -0
- package/dist/components/widgets/encoder/encoder.svelte +5 -20
- package/dist/components/widgets/encoder/get-position-widget.svelte +54 -0
- package/dist/components/widgets/encoder/get-position-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gantry/gantry.svelte +28 -5
- package/dist/components/widgets/gantry/get-position-widget.svelte +43 -0
- package/dist/components/widgets/gantry/get-position-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gantry/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/gantry/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/generic/generic.svelte +8 -1
- package/dist/components/widgets/gripper/gripper.svelte +11 -5
- package/dist/components/widgets/gripper/is-holding-something.svelte +2 -4
- package/dist/components/widgets/gripper/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/gripper/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/input-controller/input-controller.svelte +2 -1
- package/dist/components/widgets/motor/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/motor/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/motor/motor.svelte +13 -9
- package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +38 -0
- package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +38 -0
- package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +38 -0
- package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/movement-sensor/get-position-widget.svelte +38 -0
- package/dist/components/widgets/movement-sensor/get-position-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/movement-sensor/movement-sensor.svelte +53 -26
- package/dist/components/widgets/power-sensor/get-current-widget.svelte +38 -0
- package/dist/components/widgets/power-sensor/get-current-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/power-sensor/get-power-widget.svelte +38 -0
- package/dist/components/widgets/power-sensor/get-power-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +38 -0
- package/dist/components/widgets/power-sensor/get-voltage-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/power-sensor/power-sensor.svelte +4 -0
- package/dist/components/widgets/sensor/sensor.svelte +1 -0
- package/dist/components/widgets/servo/is-moving-widget.svelte +20 -0
- package/dist/components/widgets/servo/is-moving-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/servo/servo.svelte +10 -2
- package/dist/components/widgets/slam/get-position-widget.svelte +38 -0
- package/dist/components/widgets/slam/get-position-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/slam/move-on-map.svelte +4 -1
- package/dist/components/widgets/slam/slam.svelte +4 -1
- package/dist/components/widgets/vision-service/context.svelte.d.ts +1 -0
- package/dist/components/widgets/vision-service/context.svelte.js +7 -0
- package/dist/components/widgets/vision-service/detection-row.svelte +38 -0
- package/dist/components/widgets/vision-service/detection-row.svelte.d.ts +8 -0
- package/dist/components/widgets/vision-service/detection.svelte +7 -4
- package/dist/components/widgets/vision-service/legend.svelte +14 -11
- package/dist/components/widgets/vision-service/vision-service.svelte +9 -10
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -1
- package/dist/pip/context.svelte.d.ts +2 -0
- package/dist/pip/context.svelte.js +48 -20
- package/dist/resource-triplet.d.ts +37 -0
- package/dist/resource-triplet.js +37 -0
- package/dist/resource-widget.js +187 -0
- package/dist/resource.d.ts +0 -9
- package/dist/resource.js +0 -72
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The playground (`pnpm dev`) can be used to develop the test-cards against prod r
|
|
|
10
10
|
|
|
11
11
|
This is useful if you need to validate the sdk against specific behavior of modules or need to replicate a bug from another robot (why replicate locally when you could just develop directly against the robot with the bug?).
|
|
12
12
|
|
|
13
|
-
To setup your playground, create a `.env.local` in the test-
|
|
13
|
+
To setup your playground, create a `.env.local` in the test-widgets directory with the following format (no need to create two robots):
|
|
14
14
|
|
|
15
15
|
```json
|
|
16
16
|
VITE_PLAYGROUND_ROBOTS='
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the docs URL for a given resource API + method, or undefined
|
|
3
|
+
* when the method has no dedicated anchor (e.g. GetStatus, GetSourceNames).
|
|
4
|
+
*
|
|
5
|
+
* @param api - RDK API string, e.g. "rdk:component:movement_sensor"
|
|
6
|
+
* @param method - camelCase method name, e.g. "getPosition"
|
|
7
|
+
*/
|
|
8
|
+
export declare const apiDocsHref: (api: string, method: string) => string | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const NO_LINK_METHODS = new Set(['getStatus', 'getSourceNames']);
|
|
2
|
+
/**
|
|
3
|
+
* Returns the docs URL for a given resource API + method, or undefined
|
|
4
|
+
* when the method has no dedicated anchor (e.g. GetStatus, GetSourceNames).
|
|
5
|
+
*
|
|
6
|
+
* @param api - RDK API string, e.g. "rdk:component:movement_sensor"
|
|
7
|
+
* @param method - camelCase method name, e.g. "getPosition"
|
|
8
|
+
*/
|
|
9
|
+
export const apiDocsHref = (api, method) => {
|
|
10
|
+
if (NO_LINK_METHODS.has(method))
|
|
11
|
+
return undefined;
|
|
12
|
+
const isService = api.includes(':service:');
|
|
13
|
+
// RDK API strings use underscores (movement_sensor); docs URLs use hyphens (movement-sensor)
|
|
14
|
+
const subtype = api.split(':').at(-1).replaceAll('_', '-');
|
|
15
|
+
const kind = isService ? 'services' : 'components';
|
|
16
|
+
return `https://docs.viam.com/reference/apis/${kind}/${subtype}/#${method.toLowerCase()}`;
|
|
17
|
+
};
|
package/dist/client-map.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { ArmClient, AudioInClient, AudioOutClient, BaseClient, BoardClient, ButtonClient, CameraClient, DataManagerClient, DiscoveryClient, EncoderClient, GantryClient, GenericComponentClient, GenericServiceClient, GripperClient, InputControllerClient, MLModelClient, MotionClient, MotorClient, MovementSensorClient, NavigationClient, PoseTrackerClient, PowerSensorClient, type ResourceName, SensorClient, ServoClient, SlamClient, SwitchClient, VideoClient, VisionClient, WorldStateStoreClient } from '@viamrobotics/sdk';
|
|
2
2
|
export declare const clientMap: {
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
3
|
+
readonly "rdk:component:arm": typeof ArmClient;
|
|
4
|
+
readonly "rdk:component:audio_in": typeof AudioInClient;
|
|
5
|
+
readonly "rdk:component:audio_out": typeof AudioOutClient;
|
|
6
|
+
readonly "rdk:component:base": typeof BaseClient;
|
|
7
|
+
readonly "rdk:component:board": typeof BoardClient;
|
|
8
|
+
readonly "rdk:component:button": typeof ButtonClient;
|
|
9
|
+
readonly "rdk:component:camera": typeof CameraClient;
|
|
10
|
+
readonly "rdk:component:encoder": typeof EncoderClient;
|
|
11
|
+
readonly "rdk:component:gantry": typeof GantryClient;
|
|
12
|
+
readonly "rdk:component:generic": typeof GenericComponentClient;
|
|
13
|
+
readonly "rdk:component:gripper": typeof GripperClient;
|
|
14
|
+
readonly "rdk:component:input_controller": typeof InputControllerClient;
|
|
15
|
+
readonly "rdk:component:motor": typeof MotorClient;
|
|
16
|
+
readonly "rdk:component:movement_sensor": typeof MovementSensorClient;
|
|
17
|
+
readonly "rdk:component:pose_tracker": typeof PoseTrackerClient;
|
|
18
|
+
readonly "rdk:component:power_sensor": typeof PowerSensorClient;
|
|
19
|
+
readonly "rdk:component:sensor": typeof SensorClient;
|
|
20
|
+
readonly "rdk:component:servo": typeof ServoClient;
|
|
21
|
+
readonly "rdk:component:switch": typeof SwitchClient;
|
|
22
|
+
readonly "rdk:service:data_manager": typeof DataManagerClient;
|
|
23
|
+
readonly "rdk:service:discovery": typeof DiscoveryClient;
|
|
24
|
+
readonly "rdk:service:generic": typeof GenericServiceClient;
|
|
25
|
+
readonly "rdk:service:mlmodel": typeof MLModelClient;
|
|
26
|
+
readonly "rdk:service:motion": typeof MotionClient;
|
|
27
|
+
readonly "rdk:service:navigation": typeof NavigationClient;
|
|
28
|
+
readonly "rdk:service:slam": typeof SlamClient;
|
|
29
|
+
readonly "rdk:service:video": typeof VideoClient;
|
|
30
|
+
readonly "rdk:service:vision": typeof VisionClient;
|
|
31
|
+
readonly "rdk:service:world_state_store": typeof WorldStateStoreClient;
|
|
32
32
|
};
|
|
33
|
-
export declare const clientForResource: (resource: ResourceName) => typeof ArmClient | typeof AudioInClient | typeof AudioOutClient | typeof BaseClient | typeof BoardClient | typeof ButtonClient | typeof CameraClient | typeof EncoderClient | typeof GantryClient | typeof GenericComponentClient | typeof GripperClient | typeof InputControllerClient | typeof MotorClient | typeof MovementSensorClient | typeof PoseTrackerClient | typeof PowerSensorClient | typeof SensorClient | typeof ServoClient | typeof SwitchClient | typeof DataManagerClient | typeof DiscoveryClient | typeof GenericServiceClient | typeof MLModelClient | typeof MotionClient | typeof NavigationClient | typeof SlamClient | typeof
|
|
33
|
+
export declare const clientForResource: (resource: ResourceName) => typeof ArmClient | typeof AudioInClient | typeof AudioOutClient | typeof BaseClient | typeof BoardClient | typeof ButtonClient | typeof CameraClient | typeof EncoderClient | typeof GantryClient | typeof GenericComponentClient | typeof GripperClient | typeof InputControllerClient | typeof MotorClient | typeof MovementSensorClient | typeof PoseTrackerClient | typeof PowerSensorClient | typeof SensorClient | typeof ServoClient | typeof SwitchClient | typeof DataManagerClient | typeof DiscoveryClient | typeof GenericServiceClient | typeof MLModelClient | typeof MotionClient | typeof NavigationClient | typeof SlamClient | typeof VideoClient | typeof VisionClient | typeof WorldStateStoreClient | undefined;
|
|
34
34
|
export declare const supportsDoCommand: (resource: ResourceName) => boolean;
|
package/dist/client-map.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { ArmClient, AudioInClient, AudioOutClient, BaseClient, BoardClient, ButtonClient, CameraClient, DataManagerClient, DiscoveryClient, EncoderClient, GantryClient, GenericComponentClient, GenericServiceClient, GripperClient, InputControllerClient, MLModelClient, MotionClient, MotorClient, MovementSensorClient, NavigationClient, PoseTrackerClient, PowerSensorClient, SensorClient, ServoClient, SlamClient, SwitchClient, VideoClient, VisionClient, WorldStateStoreClient, } from '@viamrobotics/sdk';
|
|
2
2
|
import { getResourceAPI } from "./get-resource-api.js";
|
|
3
|
+
import { ResourceTriplets } from "./resource-triplet.js";
|
|
3
4
|
export const clientMap = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
5
|
+
// components
|
|
6
|
+
[ResourceTriplets.Arm]: ArmClient,
|
|
7
|
+
[ResourceTriplets.AudioInput]: AudioInClient,
|
|
8
|
+
[ResourceTriplets.AudioOutput]: AudioOutClient,
|
|
9
|
+
[ResourceTriplets.Base]: BaseClient,
|
|
10
|
+
[ResourceTriplets.Board]: BoardClient,
|
|
11
|
+
[ResourceTriplets.Button]: ButtonClient,
|
|
12
|
+
[ResourceTriplets.Camera]: CameraClient,
|
|
13
|
+
[ResourceTriplets.Encoder]: EncoderClient,
|
|
14
|
+
[ResourceTriplets.Gantry]: GantryClient,
|
|
15
|
+
[ResourceTriplets.GenericComponent]: GenericComponentClient,
|
|
16
|
+
[ResourceTriplets.Gripper]: GripperClient,
|
|
17
|
+
[ResourceTriplets.InputController]: InputControllerClient,
|
|
18
|
+
[ResourceTriplets.Motor]: MotorClient,
|
|
19
|
+
[ResourceTriplets.MovementSensor]: MovementSensorClient,
|
|
20
|
+
[ResourceTriplets.PoseTracker]: PoseTrackerClient,
|
|
21
|
+
[ResourceTriplets.PowerSensor]: PowerSensorClient,
|
|
22
|
+
[ResourceTriplets.Sensor]: SensorClient,
|
|
23
|
+
[ResourceTriplets.Servo]: ServoClient,
|
|
24
|
+
[ResourceTriplets.Switch]: SwitchClient,
|
|
25
|
+
// services
|
|
26
|
+
[ResourceTriplets.DataManager]: DataManagerClient,
|
|
27
|
+
[ResourceTriplets.Discovery]: DiscoveryClient,
|
|
28
|
+
[ResourceTriplets.GenericService]: GenericServiceClient,
|
|
29
|
+
[ResourceTriplets.MLModel]: MLModelClient,
|
|
30
|
+
[ResourceTriplets.Motion]: MotionClient,
|
|
31
|
+
[ResourceTriplets.Navigation]: NavigationClient,
|
|
32
|
+
[ResourceTriplets.Slam]: SlamClient,
|
|
33
|
+
[ResourceTriplets.Video]: VideoClient,
|
|
34
|
+
[ResourceTriplets.Vision]: VisionClient,
|
|
35
|
+
[ResourceTriplets.WorldStateStore]: WorldStateStoreClient,
|
|
33
36
|
};
|
|
34
37
|
export const clientForResource = (resource) => {
|
|
35
38
|
const resAPI = getResourceAPI(resource);
|
|
@@ -15,10 +15,7 @@
|
|
|
15
15
|
aria-label={useRadians ? 'Switch to Degrees' : 'Switch to Radians'}
|
|
16
16
|
class="text-gray-6 hover:border-medium hover:bg-medium active:bg-gray-2 justify-items-end p-0.5"
|
|
17
17
|
>
|
|
18
|
-
<Icon
|
|
19
|
-
name="sync"
|
|
20
|
-
size="xs"
|
|
21
|
-
/>
|
|
18
|
+
<Icon name="sync" />
|
|
22
19
|
</button>
|
|
23
20
|
|
|
24
21
|
<span slot="description">
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
4
|
|
|
5
|
-
import { Icon, Tooltip } from '@viamrobotics/prime-core'
|
|
6
5
|
import { twMerge } from 'tailwind-merge'
|
|
7
6
|
|
|
7
|
+
import SectionTitle from './section-title.svelte'
|
|
8
|
+
|
|
8
9
|
interface Props extends HTMLAttributes<HTMLElement> {
|
|
9
10
|
title?: string | undefined
|
|
10
11
|
tooltip?: string | undefined
|
|
11
12
|
description?: string | undefined
|
|
12
13
|
bottomText?: string | undefined
|
|
14
|
+
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
15
|
+
api?: string | undefined
|
|
13
16
|
class?: string
|
|
14
17
|
children?: Snippet
|
|
15
18
|
}
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
tooltip,
|
|
20
23
|
description,
|
|
21
24
|
bottomText,
|
|
25
|
+
api,
|
|
22
26
|
class: className = '',
|
|
23
27
|
children,
|
|
24
28
|
...rest
|
|
@@ -29,32 +33,26 @@
|
|
|
29
33
|
|
|
30
34
|
<section
|
|
31
35
|
class={twMerge('flex grow flex-col gap-4 p-4', className)}
|
|
32
|
-
aria-labelledby={headingID}
|
|
36
|
+
aria-labelledby={title ? headingID : undefined}
|
|
33
37
|
{...rest}
|
|
34
38
|
>
|
|
35
39
|
{#if title}
|
|
36
40
|
<div class="flex flex-col gap-0.5">
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
{tooltip}
|
|
54
|
-
</p>
|
|
55
|
-
</Tooltip>
|
|
56
|
-
{/if}
|
|
57
|
-
</h3>
|
|
41
|
+
{#if api}
|
|
42
|
+
<SectionTitle
|
|
43
|
+
{title}
|
|
44
|
+
{tooltip}
|
|
45
|
+
{api}
|
|
46
|
+
headingId={headingID}
|
|
47
|
+
/>
|
|
48
|
+
{:else}
|
|
49
|
+
<h3
|
|
50
|
+
class="flex flex-row items-center gap-1 text-sm font-semibold"
|
|
51
|
+
id={headingID}
|
|
52
|
+
>
|
|
53
|
+
{title}
|
|
54
|
+
</h3>
|
|
55
|
+
{/if}
|
|
58
56
|
{#if description}
|
|
59
57
|
<p class="text-subtle-2 text-xs">{description}</p>
|
|
60
58
|
{/if}
|
|
@@ -5,6 +5,8 @@ interface Props extends HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
tooltip?: string | undefined;
|
|
6
6
|
description?: string | undefined;
|
|
7
7
|
bottomText?: string | undefined;
|
|
8
|
+
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
9
|
+
api?: string | undefined;
|
|
8
10
|
class?: string;
|
|
9
11
|
children?: Snippet;
|
|
10
12
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export { default as ConnectionStatus } from './connection-status.svelte';
|
|
2
|
+
export { default as SectionTitle } from './section-title.svelte';
|
|
2
3
|
export { default as ArmWidget } from './widgets/arm/arm.svelte';
|
|
4
|
+
export { default as ArmGetJointPositionsWidget } from './widgets/arm/get-joint-positions-widget.svelte';
|
|
5
|
+
export { default as ArmIsMovingWidget } from './widgets/arm/is-moving-widget.svelte';
|
|
3
6
|
export { default as ArmMoveToJointPositionsWidget } from './widgets/arm/move-to-joint-positions-widget.svelte';
|
|
4
7
|
export { default as ArmMoveToPositionWidget } from './widgets/arm/move-to-position-widget.svelte';
|
|
5
8
|
export { default as ArmQuickMoveWidget } from './widgets/arm/quick-move-widget.svelte';
|
|
6
9
|
export { default as AudioInputWidget } from './widgets/audio-input/audio-input.svelte';
|
|
10
|
+
export { default as AudioInputGetPropertiesWidget } from './widgets/audio-input/get-properties-widget.svelte';
|
|
7
11
|
export { default as AudioOutputWidget } from './widgets/audio-output/audio-output.svelte';
|
|
12
|
+
export { default as AudioOutputGetPropertiesWidget } from './widgets/audio-output/get-properties-widget.svelte';
|
|
8
13
|
export { default as BaseWidget } from './widgets/base/base.svelte';
|
|
14
|
+
export { default as BaseIsMovingWidget } from './widgets/base/is-moving-widget.svelte';
|
|
9
15
|
export { default as BaseMoveStraightWidget } from './widgets/base/move-straight-widget.svelte';
|
|
10
16
|
export { default as BaseQuickMoveWidget } from './widgets/base/quick-move-widget.svelte';
|
|
11
17
|
export { default as BaseSetPowerWidget } from './widgets/base/set-power-widget.svelte';
|
|
@@ -21,31 +27,46 @@ export type { ComponentPreview, ComponentPreviewSnippet, } from './widgets/disco
|
|
|
21
27
|
export { default as DiscoveryWidget } from './widgets/discovery/discovery.svelte';
|
|
22
28
|
export { default as DoCommandWidget } from './widgets/do-command/do-command.svelte';
|
|
23
29
|
export { default as EncoderWidget } from './widgets/encoder/encoder.svelte';
|
|
30
|
+
export { default as EncoderGetPositionWidget } from './widgets/encoder/get-position-widget.svelte';
|
|
24
31
|
export { default as GantryWidget } from './widgets/gantry/gantry.svelte';
|
|
32
|
+
export { default as GantryGetPositionWidget } from './widgets/gantry/get-position-widget.svelte';
|
|
33
|
+
export { default as GantryIsMovingWidget } from './widgets/gantry/is-moving-widget.svelte';
|
|
25
34
|
export { default as GantryHomeWidget } from './widgets/gantry/home.svelte';
|
|
26
35
|
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position-widget.svelte';
|
|
27
36
|
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move-widget.svelte';
|
|
28
37
|
export { default as GenericWidget } from './widgets/generic/generic.svelte';
|
|
29
38
|
export { default as GripperGrabWidget } from './widgets/gripper/grab.svelte';
|
|
30
39
|
export { default as GripperWidget } from './widgets/gripper/gripper.svelte';
|
|
40
|
+
export { default as GripperIsHoldingSomethingWidget } from './widgets/gripper/is-holding-something.svelte';
|
|
41
|
+
export { default as GripperIsMovingWidget } from './widgets/gripper/is-moving-widget.svelte';
|
|
31
42
|
export { default as GripperOpenWidget } from './widgets/gripper/open.svelte';
|
|
32
43
|
export { default as InputControllerWidget } from './widgets/input-controller/input-controller.svelte';
|
|
33
44
|
export { default as MLModelServiceWidget } from './widgets/ml-model-service/ml-model-service.svelte';
|
|
34
45
|
export { default as MotorGoForWidget } from './widgets/motor/go-for-view.svelte';
|
|
35
46
|
export { default as MotorGoToWidget } from './widgets/motor/go-to-view.svelte';
|
|
36
47
|
export { default as MotorWidget } from './widgets/motor/motor.svelte';
|
|
48
|
+
export { default as MotorIsMovingWidget } from './widgets/motor/is-moving-widget.svelte';
|
|
37
49
|
export { default as MotorQuickMoveWidget } from './widgets/motor/quick-move-widget.svelte';
|
|
38
50
|
export { default as MotorSetPowerWidget } from './widgets/motor/set-power-widget.svelte';
|
|
39
51
|
export { default as MotorSetRPMWidget } from './widgets/motor/set-rpm-widget.svelte';
|
|
40
52
|
export { default as MovementSensorWidget } from './widgets/movement-sensor/movement-sensor.svelte';
|
|
53
|
+
export { default as MovementSensorGetPositionWidget } from './widgets/movement-sensor/get-position-widget.svelte';
|
|
54
|
+
export { default as MovementSensorGetOrientationWidget } from './widgets/movement-sensor/get-orientation-widget.svelte';
|
|
55
|
+
export { default as MovementSensorGetCompassHeadingWidget } from './widgets/movement-sensor/get-compass-heading-widget.svelte';
|
|
56
|
+
export { default as MovementSensorGetAccuracyWidget } from './widgets/movement-sensor/get-accuracy-widget.svelte';
|
|
41
57
|
export { default as NavigationServiceWidget } from './widgets/navigation/navigation.svelte';
|
|
42
58
|
export { default as PowerSensorWidget } from './widgets/power-sensor/power-sensor.svelte';
|
|
59
|
+
export { default as PowerSensorGetVoltageWidget } from './widgets/power-sensor/get-voltage-widget.svelte';
|
|
60
|
+
export { default as PowerSensorGetCurrentWidget } from './widgets/power-sensor/get-current-widget.svelte';
|
|
61
|
+
export { default as PowerSensorGetPowerWidget } from './widgets/power-sensor/get-power-widget.svelte';
|
|
43
62
|
export { default as SensorWidget } from './widgets/sensor/sensor.svelte';
|
|
44
63
|
export { default as ServoMoveWidget } from './widgets/servo/move-widget.svelte';
|
|
45
64
|
export { default as ServoQuickMoveWidget } from './widgets/servo/quick-move-widget.svelte';
|
|
46
65
|
export { default as ServoWidget } from './widgets/servo/servo.svelte';
|
|
66
|
+
export { default as ServoIsMovingWidget } from './widgets/servo/is-moving-widget.svelte';
|
|
47
67
|
export { default as SlamMap2D } from './slam/map2d/index.svelte';
|
|
48
68
|
export { default as SlamWidget } from './widgets/slam/slam.svelte';
|
|
69
|
+
export { default as SlamGetPositionWidget } from './widgets/slam/get-position-widget.svelte';
|
|
49
70
|
export { default as StopWidget } from './stop.svelte';
|
|
50
71
|
export { default as SwitchPositionWidget } from './widgets/switch/position-view.svelte';
|
|
51
72
|
export { default as SwitchWidget } from './widgets/switch/switch.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
export { default as ConnectionStatus } from './connection-status.svelte';
|
|
2
|
+
export { default as SectionTitle } from './section-title.svelte';
|
|
2
3
|
export { default as ArmWidget } from './widgets/arm/arm.svelte';
|
|
4
|
+
export { default as ArmGetJointPositionsWidget } from './widgets/arm/get-joint-positions-widget.svelte';
|
|
5
|
+
export { default as ArmIsMovingWidget } from './widgets/arm/is-moving-widget.svelte';
|
|
3
6
|
export { default as ArmMoveToJointPositionsWidget } from './widgets/arm/move-to-joint-positions-widget.svelte';
|
|
4
7
|
export { default as ArmMoveToPositionWidget } from './widgets/arm/move-to-position-widget.svelte';
|
|
5
8
|
export { default as ArmQuickMoveWidget } from './widgets/arm/quick-move-widget.svelte';
|
|
6
9
|
export { default as AudioInputWidget } from './widgets/audio-input/audio-input.svelte';
|
|
10
|
+
export { default as AudioInputGetPropertiesWidget } from './widgets/audio-input/get-properties-widget.svelte';
|
|
7
11
|
export { default as AudioOutputWidget } from './widgets/audio-output/audio-output.svelte';
|
|
12
|
+
export { default as AudioOutputGetPropertiesWidget } from './widgets/audio-output/get-properties-widget.svelte';
|
|
8
13
|
export { default as BaseWidget } from './widgets/base/base.svelte';
|
|
14
|
+
export { default as BaseIsMovingWidget } from './widgets/base/is-moving-widget.svelte';
|
|
9
15
|
export { default as BaseMoveStraightWidget } from './widgets/base/move-straight-widget.svelte';
|
|
10
16
|
export { default as BaseQuickMoveWidget } from './widgets/base/quick-move-widget.svelte';
|
|
11
17
|
export { default as BaseSetPowerWidget } from './widgets/base/set-power-widget.svelte';
|
|
@@ -20,31 +26,46 @@ export { default as LiveOrPollingVideo } from './widgets/camera/live-or-polling-
|
|
|
20
26
|
export { default as DiscoveryWidget } from './widgets/discovery/discovery.svelte';
|
|
21
27
|
export { default as DoCommandWidget } from './widgets/do-command/do-command.svelte';
|
|
22
28
|
export { default as EncoderWidget } from './widgets/encoder/encoder.svelte';
|
|
29
|
+
export { default as EncoderGetPositionWidget } from './widgets/encoder/get-position-widget.svelte';
|
|
23
30
|
export { default as GantryWidget } from './widgets/gantry/gantry.svelte';
|
|
31
|
+
export { default as GantryGetPositionWidget } from './widgets/gantry/get-position-widget.svelte';
|
|
32
|
+
export { default as GantryIsMovingWidget } from './widgets/gantry/is-moving-widget.svelte';
|
|
24
33
|
export { default as GantryHomeWidget } from './widgets/gantry/home.svelte';
|
|
25
34
|
export { default as GantryMoveToPositionWidget } from './widgets/gantry/move-to-position-widget.svelte';
|
|
26
35
|
export { default as GantryQuickMoveWidget } from './widgets/gantry/quick-move-widget.svelte';
|
|
27
36
|
export { default as GenericWidget } from './widgets/generic/generic.svelte';
|
|
28
37
|
export { default as GripperGrabWidget } from './widgets/gripper/grab.svelte';
|
|
29
38
|
export { default as GripperWidget } from './widgets/gripper/gripper.svelte';
|
|
39
|
+
export { default as GripperIsHoldingSomethingWidget } from './widgets/gripper/is-holding-something.svelte';
|
|
40
|
+
export { default as GripperIsMovingWidget } from './widgets/gripper/is-moving-widget.svelte';
|
|
30
41
|
export { default as GripperOpenWidget } from './widgets/gripper/open.svelte';
|
|
31
42
|
export { default as InputControllerWidget } from './widgets/input-controller/input-controller.svelte';
|
|
32
43
|
export { default as MLModelServiceWidget } from './widgets/ml-model-service/ml-model-service.svelte';
|
|
33
44
|
export { default as MotorGoForWidget } from './widgets/motor/go-for-view.svelte';
|
|
34
45
|
export { default as MotorGoToWidget } from './widgets/motor/go-to-view.svelte';
|
|
35
46
|
export { default as MotorWidget } from './widgets/motor/motor.svelte';
|
|
47
|
+
export { default as MotorIsMovingWidget } from './widgets/motor/is-moving-widget.svelte';
|
|
36
48
|
export { default as MotorQuickMoveWidget } from './widgets/motor/quick-move-widget.svelte';
|
|
37
49
|
export { default as MotorSetPowerWidget } from './widgets/motor/set-power-widget.svelte';
|
|
38
50
|
export { default as MotorSetRPMWidget } from './widgets/motor/set-rpm-widget.svelte';
|
|
39
51
|
export { default as MovementSensorWidget } from './widgets/movement-sensor/movement-sensor.svelte';
|
|
52
|
+
export { default as MovementSensorGetPositionWidget } from './widgets/movement-sensor/get-position-widget.svelte';
|
|
53
|
+
export { default as MovementSensorGetOrientationWidget } from './widgets/movement-sensor/get-orientation-widget.svelte';
|
|
54
|
+
export { default as MovementSensorGetCompassHeadingWidget } from './widgets/movement-sensor/get-compass-heading-widget.svelte';
|
|
55
|
+
export { default as MovementSensorGetAccuracyWidget } from './widgets/movement-sensor/get-accuracy-widget.svelte';
|
|
40
56
|
export { default as NavigationServiceWidget } from './widgets/navigation/navigation.svelte';
|
|
41
57
|
export { default as PowerSensorWidget } from './widgets/power-sensor/power-sensor.svelte';
|
|
58
|
+
export { default as PowerSensorGetVoltageWidget } from './widgets/power-sensor/get-voltage-widget.svelte';
|
|
59
|
+
export { default as PowerSensorGetCurrentWidget } from './widgets/power-sensor/get-current-widget.svelte';
|
|
60
|
+
export { default as PowerSensorGetPowerWidget } from './widgets/power-sensor/get-power-widget.svelte';
|
|
42
61
|
export { default as SensorWidget } from './widgets/sensor/sensor.svelte';
|
|
43
62
|
export { default as ServoMoveWidget } from './widgets/servo/move-widget.svelte';
|
|
44
63
|
export { default as ServoQuickMoveWidget } from './widgets/servo/quick-move-widget.svelte';
|
|
45
64
|
export { default as ServoWidget } from './widgets/servo/servo.svelte';
|
|
65
|
+
export { default as ServoIsMovingWidget } from './widgets/servo/is-moving-widget.svelte';
|
|
46
66
|
export { default as SlamMap2D } from './slam/map2d/index.svelte';
|
|
47
67
|
export { default as SlamWidget } from './widgets/slam/slam.svelte';
|
|
68
|
+
export { default as SlamGetPositionWidget } from './widgets/slam/get-position-widget.svelte';
|
|
48
69
|
export { default as StopWidget } from './stop.svelte';
|
|
49
70
|
export { default as SwitchPositionWidget } from './widgets/switch/position-view.svelte';
|
|
50
71
|
export { default as SwitchWidget } from './widgets/switch/switch.svelte';
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
client: Client
|
|
34
34
|
partID: string
|
|
35
35
|
resourceName: string
|
|
36
|
+
api: string
|
|
36
37
|
children?: Snippet
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
const { client: clientClass, partID, resourceName, children }: Props = $props()
|
|
40
|
+
const { client: clientClass, partID, resourceName, api, children }: Props = $props()
|
|
40
41
|
|
|
41
42
|
const client = $derived(
|
|
42
43
|
createResourceClient<Arm | Base | Gantry | Gripper | Motor | Servo>(
|
|
@@ -51,13 +52,11 @@
|
|
|
51
52
|
|
|
52
53
|
<ApiSection
|
|
53
54
|
title="IsMoving"
|
|
55
|
+
{api}
|
|
54
56
|
bottomText="Updates automatically"
|
|
55
57
|
class="grow"
|
|
56
58
|
>
|
|
57
|
-
<Query
|
|
58
|
-
{query}
|
|
59
|
-
contentCx="h-5"
|
|
60
|
-
>
|
|
59
|
+
<Query {query}>
|
|
61
60
|
<StatusPill isActive={query.data ?? false} />
|
|
62
61
|
</Query>
|
|
63
62
|
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte'
|
|
3
3
|
|
|
4
|
-
import { Icon, Tooltip } from '@viamrobotics/prime-core'
|
|
5
4
|
import { twMerge } from 'tailwind-merge'
|
|
6
5
|
|
|
7
6
|
import ErrorDisplay from './error.svelte'
|
|
7
|
+
import SectionTitle from './section-title.svelte'
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
title: string
|
|
11
11
|
tooltip?: string | undefined
|
|
12
12
|
description?: string | undefined
|
|
13
13
|
lastError: Error | null
|
|
14
|
+
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
15
|
+
api?: string | undefined
|
|
14
16
|
class?: string
|
|
15
17
|
titleInput?: Snippet
|
|
16
18
|
error?: Snippet
|
|
@@ -22,6 +24,7 @@
|
|
|
22
24
|
tooltip,
|
|
23
25
|
description,
|
|
24
26
|
lastError = null,
|
|
27
|
+
api,
|
|
25
28
|
class: className,
|
|
26
29
|
titleInput,
|
|
27
30
|
error,
|
|
@@ -36,28 +39,22 @@
|
|
|
36
39
|
aria-labelledby={headingID}
|
|
37
40
|
>
|
|
38
41
|
<div class={twMerge('flex grow flex-row flex-wrap gap-2', className)}>
|
|
39
|
-
<div class="flex max-w-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
>
|
|
56
|
-
{tooltip}
|
|
57
|
-
</p>
|
|
58
|
-
</Tooltip>
|
|
59
|
-
{/if}
|
|
60
|
-
</h3>
|
|
42
|
+
<div class="flex max-w-50 grow flex-col gap-0.5 pr-4">
|
|
43
|
+
{#if api}
|
|
44
|
+
<SectionTitle
|
|
45
|
+
{title}
|
|
46
|
+
{tooltip}
|
|
47
|
+
{api}
|
|
48
|
+
headingId={headingID}
|
|
49
|
+
/>
|
|
50
|
+
{:else}
|
|
51
|
+
<h3
|
|
52
|
+
class="flex flex-row items-center gap-1 text-sm font-semibold"
|
|
53
|
+
id={headingID}
|
|
54
|
+
>
|
|
55
|
+
{title}
|
|
56
|
+
</h3>
|
|
57
|
+
{/if}
|
|
61
58
|
{#if description}
|
|
62
59
|
<p class="text-subtle-2 text-xs">{description}</p>
|
|
63
60
|
{/if}
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
tooltip?: string | undefined;
|
|
5
5
|
description?: string | undefined;
|
|
6
6
|
lastError: Error | null;
|
|
7
|
+
/** RDK API string; presence renders the title as a linked monospace method name */
|
|
8
|
+
api?: string | undefined;
|
|
7
9
|
class?: string;
|
|
8
10
|
titleInput?: Snippet;
|
|
9
11
|
error?: Snippet;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { Icon, Tooltip } from '@viamrobotics/prime-core'
|
|
5
|
+
|
|
6
|
+
import { apiDocsHref } from '../api-docs-href'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
title: string
|
|
10
|
+
tooltip?: string | undefined
|
|
11
|
+
/** 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. */
|
|
12
|
+
api: string
|
|
13
|
+
/** Optional external ID for the <h3>; generated internally if omitted */
|
|
14
|
+
headingId?: string | undefined
|
|
15
|
+
/** Inline content rendered after the title inside the <h3> (e.g. unit labels) */
|
|
16
|
+
suffix?: Snippet
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const { title, tooltip, api, headingId, suffix }: Props = $props()
|
|
20
|
+
|
|
21
|
+
const generatedID = $props.id()
|
|
22
|
+
const id = $derived(headingId ?? generatedID)
|
|
23
|
+
|
|
24
|
+
// Method names are the camelCase form of the PascalCase title (GetPosition → getPosition).
|
|
25
|
+
const method = $derived(title.charAt(0).toLowerCase() + title.slice(1))
|
|
26
|
+
const href = $derived(apiDocsHref(api, method))
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<h3
|
|
30
|
+
class="flex flex-row items-center gap-1 text-sm font-semibold"
|
|
31
|
+
{id}
|
|
32
|
+
>
|
|
33
|
+
{#if href}
|
|
34
|
+
<a
|
|
35
|
+
{href}
|
|
36
|
+
target="_blank"
|
|
37
|
+
rel="noopener noreferrer external"
|
|
38
|
+
class="decoration-gray-5 hover:decoration-default font-mono underline underline-offset-3"
|
|
39
|
+
>
|
|
40
|
+
{title}
|
|
41
|
+
</a>
|
|
42
|
+
{:else}
|
|
43
|
+
<span class="font-mono">{title}</span>
|
|
44
|
+
{/if}
|
|
45
|
+
{#if suffix}
|
|
46
|
+
{@render suffix()}
|
|
47
|
+
{/if}
|
|
48
|
+
{#if tooltip}
|
|
49
|
+
<Tooltip>
|
|
50
|
+
<Icon
|
|
51
|
+
name="information-outline"
|
|
52
|
+
cx="text-gray-6"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<p
|
|
56
|
+
slot="description"
|
|
57
|
+
class="text-xs whitespace-pre-line"
|
|
58
|
+
>
|
|
59
|
+
{tooltip}
|
|
60
|
+
</p>
|
|
61
|
+
</Tooltip>
|
|
62
|
+
{/if}
|
|
63
|
+
</h3>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
tooltip?: string | undefined;
|
|
5
|
+
/** 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. */
|
|
6
|
+
api: string;
|
|
7
|
+
/** Optional external ID for the <h3>; generated internally if omitted */
|
|
8
|
+
headingId?: string | undefined;
|
|
9
|
+
/** Inline content rendered after the title inside the <h3> (e.g. unit labels) */
|
|
10
|
+
suffix?: Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const SectionTitle: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type SectionTitle = ReturnType<typeof SectionTitle>;
|
|
14
|
+
export default SectionTitle;
|