@viamrobotics/test-widgets 0.15.0 → 0.16.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 (139) 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 +7 -6
  5. package/dist/components/api-section.svelte.d.ts +4 -3
  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 +4 -5
  11. package/dist/components/content-rect.svelte.d.ts +2 -1
  12. package/dist/components/error.svelte +6 -5
  13. package/dist/components/error.svelte.d.ts +2 -1
  14. package/dist/components/index.d.ts +0 -1
  15. package/dist/components/index.js +0 -1
  16. package/dist/components/is-moving.svelte +4 -2
  17. package/dist/components/is-moving.svelte.d.ts +2 -1
  18. package/dist/components/maplibre/index.svelte +5 -6
  19. package/dist/components/maplibre/index.svelte.d.ts +3 -1
  20. package/dist/components/mutation-section.svelte +7 -5
  21. package/dist/components/mutation-section.svelte.d.ts +4 -2
  22. package/dist/components/pose-editor.svelte +83 -15
  23. package/dist/components/pose-editor.svelte.d.ts +11 -4
  24. package/dist/components/queries.svelte +7 -4
  25. package/dist/components/queries.svelte.d.ts +2 -1
  26. package/dist/components/query.svelte +4 -3
  27. package/dist/components/query.svelte.d.ts +2 -1
  28. package/dist/components/section/error-key.d.ts +2 -0
  29. package/dist/components/section/error-key.js +2 -0
  30. package/dist/components/section/index.d.ts +19 -0
  31. package/dist/components/section/index.js +19 -0
  32. package/dist/components/section/section-body.svelte +36 -0
  33. package/dist/components/section/section-body.svelte.d.ts +13 -0
  34. package/dist/components/section/section-errors.svelte +18 -0
  35. package/dist/components/section/section-errors.svelte.d.ts +6 -0
  36. package/dist/components/section/section-heading.svelte +21 -0
  37. package/dist/components/section/section-heading.svelte.d.ts +9 -0
  38. package/dist/components/section/section-loading.d.ts +4 -0
  39. package/dist/components/section/section-loading.js +10 -0
  40. package/dist/components/section/section-method.svelte +29 -0
  41. package/dist/components/section/section-method.svelte.d.ts +9 -0
  42. package/dist/components/section/section-placeholder.svelte +29 -0
  43. package/dist/components/section/section-placeholder.svelte.d.ts +7 -0
  44. package/dist/components/section/section-text.svelte +17 -0
  45. package/dist/components/section/section-text.svelte.d.ts +8 -0
  46. package/dist/components/section/section-tooltip.svelte +25 -0
  47. package/dist/components/section/section-tooltip.svelte.d.ts +7 -0
  48. package/dist/components/section/section.svelte +17 -0
  49. package/dist/components/section/section.svelte.d.ts +8 -0
  50. package/dist/components/section/use-section-errors.svelte.d.ts +18 -0
  51. package/dist/components/section/use-section-errors.svelte.js +39 -0
  52. package/dist/components/section-title.svelte +3 -1
  53. package/dist/components/section-title.svelte.d.ts +2 -1
  54. package/dist/components/stop.svelte +31 -14
  55. package/dist/components/stop.svelte.d.ts +6 -1
  56. package/dist/components/widgets/arm/arm.svelte +22 -11
  57. package/dist/components/widgets/arm/get-joint-positions-widget.svelte +1 -1
  58. package/dist/components/widgets/arm/joint-position-editor.svelte +105 -27
  59. package/dist/components/widgets/arm/joint-position-editor.svelte.d.ts +4 -3
  60. package/dist/components/widgets/arm/joint-position-slider.svelte +6 -2
  61. package/dist/components/widgets/arm/joint-position-slider.svelte.d.ts +2 -1
  62. package/dist/components/widgets/arm/manual-mode-widget.svelte +3 -2
  63. package/dist/components/widgets/arm/manual-mode.svelte +2 -2
  64. package/dist/components/widgets/arm/manual-mode.svelte.d.ts +1 -1
  65. package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +12 -4
  66. package/dist/components/widgets/arm/move-to-joint-positions.svelte +14 -6
  67. package/dist/components/widgets/arm/move-to-position-control.svelte +25 -17
  68. package/dist/components/widgets/arm/move-to-position.svelte +97 -30
  69. package/dist/components/widgets/arm/move-to-position.svelte.d.ts +3 -1
  70. package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.d.ts +16 -0
  71. package/dist/components/widgets/arm/use-arm-motion-tracking.svelte.js +37 -0
  72. package/dist/components/widgets/arm/use-edited-targets.svelte.d.ts +9 -0
  73. package/dist/components/widgets/arm/use-edited-targets.svelte.js +24 -0
  74. package/dist/components/widgets/audio-input/audio-input.svelte +5 -4
  75. package/dist/components/widgets/audio-input/get-properties-widget.svelte +2 -2
  76. package/dist/components/widgets/audio-output/audio-output.svelte +5 -4
  77. package/dist/components/widgets/audio-output/get-properties-widget.svelte +2 -2
  78. package/dist/components/widgets/base/base.svelte +8 -6
  79. package/dist/components/widgets/base/quick-move.svelte +5 -6
  80. package/dist/components/widgets/base/set-power.svelte +6 -4
  81. package/dist/components/widgets/base/set-velocity.svelte +6 -4
  82. package/dist/components/widgets/base/vec3-builder.svelte +3 -2
  83. package/dist/components/widgets/base/vec3-builder.svelte.d.ts +2 -1
  84. package/dist/components/widgets/board/analog-read.svelte +2 -4
  85. package/dist/components/widgets/board/analog-write.svelte +2 -4
  86. package/dist/components/widgets/board/gpio-read.svelte +2 -1
  87. package/dist/components/widgets/board/gpio-write.svelte +2 -1
  88. package/dist/components/widgets/board/pin-section.svelte +5 -6
  89. package/dist/components/widgets/board/pin-section.svelte.d.ts +3 -2
  90. package/dist/components/widgets/camera/camera.svelte +4 -3
  91. package/dist/components/widgets/camera/live-or-polling-video.svelte +22 -22
  92. package/dist/components/widgets/discovery/discovery.svelte +4 -3
  93. package/dist/components/widgets/encoder/encoder.svelte +5 -3
  94. package/dist/components/widgets/encoder/get-position-widget.svelte +1 -1
  95. package/dist/components/widgets/gantry/gantry.svelte +13 -7
  96. package/dist/components/widgets/gantry/get-position-widget.svelte +1 -1
  97. package/dist/components/widgets/gantry/quick-move-widget.svelte +1 -1
  98. package/dist/components/widgets/generic/generic.svelte +4 -1
  99. package/dist/components/widgets/gripper/gripper.svelte +8 -6
  100. package/dist/components/widgets/gripper/is-holding-something.svelte +3 -2
  101. package/dist/components/widgets/input-controller/input-controller.svelte +4 -3
  102. package/dist/components/widgets/ml-model-service/ml-model-service.svelte +1 -1
  103. package/dist/components/widgets/motion/frame-select.svelte +4 -2
  104. package/dist/components/widgets/motion/frame-select.svelte.d.ts +2 -1
  105. package/dist/components/widgets/motion/motion.svelte +9 -5
  106. package/dist/components/widgets/motion/move.svelte +5 -3
  107. package/dist/components/widgets/motor/motor.svelte +12 -10
  108. package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +2 -2
  109. package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +2 -2
  110. package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +2 -2
  111. package/dist/components/widgets/movement-sensor/get-position-widget.svelte +2 -2
  112. package/dist/components/widgets/movement-sensor/movement-sensor.svelte +17 -18
  113. package/dist/components/widgets/power-sensor/get-current-widget.svelte +2 -2
  114. package/dist/components/widgets/power-sensor/get-power-widget.svelte +2 -2
  115. package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +2 -2
  116. package/dist/components/widgets/power-sensor/power-sensor.svelte +13 -11
  117. package/dist/components/widgets/sensor/sensor.svelte +4 -3
  118. package/dist/components/widgets/servo/servo.svelte +9 -4
  119. package/dist/components/widgets/slam/get-position-widget.svelte +2 -2
  120. package/dist/components/widgets/slam/move-on-map.svelte +3 -1
  121. package/dist/components/widgets/slam/slam.svelte +10 -5
  122. package/dist/components/widgets/switch/position-view.svelte +1 -1
  123. package/dist/components/widgets/switch/switch.svelte +1 -1
  124. package/dist/components/widgets/vision-service/detection-row.svelte +4 -2
  125. package/dist/components/widgets/vision-service/detection-row.svelte.d.ts +2 -1
  126. package/dist/components/widgets/vision-service/fonts/public-sans.json +1 -0
  127. package/dist/components/widgets/vision-service/fonts/public-sans.png +0 -0
  128. package/dist/components/widgets/vision-service/image.svelte +4 -4
  129. package/dist/components/widgets/vision-service/legend.svelte +4 -4
  130. package/dist/components/widgets/vision-service/public-sans-font.d.ts +5 -0
  131. package/dist/components/widgets/vision-service/public-sans-font.js +14 -0
  132. package/dist/components/widgets/vision-service/vision-service.svelte +2 -2
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.js +0 -1
  135. package/package.json +24 -11
  136. package/dist/components/board/pin-section.svelte +0 -28
  137. package/dist/components/board/pin-section.svelte.d.ts +0 -9
  138. package/dist/components/section-group.svelte +0 -64
  139. package/dist/components/section-group.svelte.d.ts +0 -14
package/README.md CHANGED
@@ -36,7 +36,9 @@ The playground (`pnpm dev`) can be used to develop the test-cards against prod r
36
36
 
37
37
  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?).
38
38
 
39
- To setup your playground, create a `.env.local` in the test-widgets directory with the following format (no need to create two robots):
39
+ The sidebar lists your machines. The `?machine=<name>` search param picks which one the playground shows, and the first machine is the default.
40
+
41
+ A `.env.local` in the test-widgets directory is optional. It seeds the list with the following format (no need to create two robots):
40
42
 
41
43
  ```json
42
44
  VITE_PLAYGROUND_ROBOTS='
@@ -70,3 +72,15 @@ VITE_PLAYGROUND_ROBOTS='
70
72
  }
71
73
  '
72
74
  ```
75
+
76
+ You can also add machines from the sidebar. Paste one machine config with a `name`, or a whole `VITE_PLAYGROUND_ROBOTS` value, into the form and submit. Machines added this way are kept in your browser's localStorage, and you can remove them from the sidebar. Machines from `.env.local` cannot be removed there.
77
+
78
+ ### Hosted playground and docs
79
+
80
+ Every push to `main` deploys the docs site to `https://viamrobotics.github.io/test-widgets/` and the playground to `https://viamrobotics.github.io/test-widgets/playground/`. The docs live in `docs/`, a separate Astro Starlight project. Run them with `pnpm docs:dev`, or build them with the playground included using `pnpm docs:build`.
81
+
82
+ ### PR previews
83
+
84
+ Each pull request from a branch in this repo deploys the playground to `https://viamrobotics.github.io/test-widgets/pr-preview/pr-<N>/`, and a bot comment links it. The preview has no machines built in, so paste a config into the sidebar form. Closing the pull request removes the preview. Pull requests from forks and Dependabot get no preview.
85
+
86
+ On GitHub Pages, every `viamrobotics` site shares the `viamrobotics.github.io` origin. Those sites can read the keys stored in localStorage. Use keys for test machines only.
@@ -1,8 +1,8 @@
1
+ import type { ResourceTriplet } from './resource-triplet';
1
2
  /**
2
3
  * Returns the docs URL for a given resource API + method, or undefined
3
4
  * when the method has no dedicated anchor (e.g. GetStatus, GetSourceNames).
4
5
  *
5
- * @param api - RDK API string, e.g. "rdk:component:movement_sensor"
6
6
  * @param method - camelCase method name, e.g. "getPosition"
7
7
  */
8
- export declare const apiDocsHref: (api: string, method: string) => string | undefined;
8
+ export declare const apiDocsHref: (api: ResourceTriplet, method: string) => string | undefined;
@@ -3,7 +3,6 @@ const NO_LINK_METHODS = new Set(['getStatus', 'getSourceNames']);
3
3
  * Returns the docs URL for a given resource API + method, or undefined
4
4
  * when the method has no dedicated anchor (e.g. GetStatus, GetSourceNames).
5
5
  *
6
- * @param api - RDK API string, e.g. "rdk:component:movement_sensor"
7
6
  * @param method - camelCase method name, e.g. "getPosition"
8
7
  */
9
8
  export const apiDocsHref = (api, method) => {
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
- import type { HTMLAttributes } from 'svelte/elements'
3
+ import type { ClassValue, HTMLAttributes } from 'svelte/elements'
4
4
 
5
- import { twMerge } from 'tailwind-merge'
5
+ import type { ResourceTriplet } from '../resource-triplet'
6
6
 
7
+ import Boundary from './boundary.svelte'
7
8
  import SectionTitle from './section-title.svelte'
8
9
 
9
10
  interface Props extends HTMLAttributes<HTMLElement> {
@@ -12,8 +13,8 @@
12
13
  description?: string | undefined
13
14
  bottomText?: string | undefined
14
15
  /** RDK API string; presence renders the title as a linked monospace method name */
15
- api?: string | undefined
16
- class?: string
16
+ api?: ResourceTriplet | undefined
17
+ class?: ClassValue
17
18
  children?: Snippet
18
19
  }
19
20
 
@@ -32,7 +33,7 @@
32
33
  </script>
33
34
 
34
35
  <section
35
- class={twMerge('flex grow flex-col gap-4 p-4', className)}
36
+ class={['flex p-4', className]}
36
37
  aria-labelledby={title ? headingID : undefined}
37
38
  {...rest}
38
39
  >
@@ -59,7 +60,7 @@
59
60
  </div>
60
61
  {/if}
61
62
 
62
- {@render children?.()}
63
+ <Boundary {children} />
63
64
 
64
65
  {#if bottomText}
65
66
  <p class="text-subtle-2 mt-auto text-xs">{bottomText}</p>
@@ -1,13 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { ClassValue, HTMLAttributes } from 'svelte/elements';
3
+ import type { ResourceTriplet } from '../resource-triplet';
3
4
  interface Props extends HTMLAttributes<HTMLElement> {
4
5
  title?: string | undefined;
5
6
  tooltip?: string | undefined;
6
7
  description?: string | undefined;
7
8
  bottomText?: string | undefined;
8
9
  /** RDK API string; presence renders the title as a linked monospace method name */
9
- api?: string | undefined;
10
- class?: string;
10
+ api?: ResourceTriplet | undefined;
11
+ class?: ClassValue;
11
12
  children?: Snippet;
12
13
  }
13
14
  declare const ApiSection: import("svelte").Component<Props, {}, "">;
@@ -0,0 +1,51 @@
1
+ <script lang="ts">
2
+ import * as Sentry from '@sentry/svelte'
3
+
4
+ const { children } = $props()
5
+
6
+ let isErrorExpanded = $state(false)
7
+
8
+ const describeError = (error: unknown) => {
9
+ return error instanceof Error ? (error.stack ?? error.message) : String(error)
10
+ }
11
+ </script>
12
+
13
+ <svelte:boundary
14
+ onerror={(error) => {
15
+ Sentry.captureException(error)
16
+ }}
17
+ >
18
+ {@render children?.()}
19
+
20
+ {#snippet failed(error, reset)}
21
+ <div
22
+ role="alert"
23
+ class="bg-extralight flex h-full w-full flex-col items-center justify-center gap-2 p-4"
24
+ >
25
+ <div>Something went wrong</div>
26
+ <button
27
+ class="text-subtle-1 text-xs hover:underline"
28
+ type="button"
29
+ onclick={() => {
30
+ isErrorExpanded = false
31
+ reset()
32
+ }}
33
+ >
34
+ Try again
35
+ </button>
36
+ <button
37
+ class="text-danger-dark text-xs hover:underline"
38
+ type="button"
39
+ aria-expanded={isErrorExpanded}
40
+ onclick={() => {
41
+ isErrorExpanded = !isErrorExpanded
42
+ }}
43
+ >
44
+ {isErrorExpanded ? 'Hide' : 'Show'} error
45
+ </button>
46
+ {#if isErrorExpanded}
47
+ <pre class="text-danger-dark font-mono text-xs text-wrap">{describeError(error)}</pre>
48
+ {/if}
49
+ </div>
50
+ {/snippet}
51
+ </svelte:boundary>
@@ -0,0 +1,5 @@
1
+ declare const Boundary: import("svelte").Component<{
2
+ children: any;
3
+ }, {}, "">;
4
+ type Boundary = ReturnType<typeof Boundary>;
5
+ export default Boundary;
@@ -1,85 +1,81 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
3
 
4
- import { Progress } from '@viamrobotics/prime-core'
4
+ import { Icon, Progress } from '@viamrobotics/prime-core'
5
5
  import { MachineConnectionEvent } from '@viamrobotics/sdk'
6
6
  import { useConnectionStatus } from '@viamrobotics/svelte-sdk'
7
- import { twMerge } from 'tailwind-merge'
7
+
8
+ import Boundary from './boundary.svelte'
8
9
 
9
10
  interface Props {
10
11
  partID: string
11
- connectingClass?: string
12
- disconnectedClass?: string
13
- status?: MachineConnectionEvent
14
- connected?: Snippet
12
+ connected: Snippet
13
+ dialing?: Snippet
15
14
  connecting?: Snippet
15
+ reconnecting?: Snippet
16
+ reconnectionFailed?: Snippet
17
+ disconnecting?: Snippet
16
18
  disconnected?: Snippet
17
19
  }
18
20
 
19
21
  const {
20
22
  partID,
21
- connectingClass = '',
22
- disconnectedClass = '',
23
- status,
24
23
  connected,
24
+ dialing,
25
25
  connecting,
26
+ reconnecting,
27
+ reconnectionFailed,
28
+ disconnecting,
26
29
  disconnected,
27
30
  }: Props = $props()
28
31
 
29
32
  const connectionStatus = useConnectionStatus(() => partID)
30
- const currentStatus = $derived(status ?? connectionStatus.current)
31
33
 
32
- let isErrorExpanded = $state(false)
34
+ const views: Record<MachineConnectionEvent, Snippet> = $derived({
35
+ [MachineConnectionEvent.CONNECTED]: connected,
36
+ [MachineConnectionEvent.DIALING]: dialing ?? loader,
37
+ [MachineConnectionEvent.CONNECTING]: connecting ?? loader,
38
+ [MachineConnectionEvent.RECONNECTING]: reconnecting ?? loader,
39
+ [MachineConnectionEvent.RECONNECTION_FAILED]: reconnectionFailed ?? failed,
40
+ [MachineConnectionEvent.DISCONNECTING]: disconnecting ?? loader,
41
+ [MachineConnectionEvent.DISCONNECTED]: disconnected ?? offline,
42
+ })
43
+
44
+ const view = $derived(views[connectionStatus.current ?? MachineConnectionEvent.DISCONNECTED])
33
45
  </script>
34
46
 
35
- <svelte:boundary>
36
- {#if currentStatus === MachineConnectionEvent.CONNECTED}
37
- {@render connected?.()}
38
- {:else if currentStatus === MachineConnectionEvent.CONNECTING}
39
- {#if connecting}
40
- {@render connecting()}
41
- {:else}
42
- <div
43
- class={twMerge(
44
- 'bg-extralight text-disabled flex h-full min-h-40 w-full items-center justify-center gap-2',
45
- connectingClass
46
- )}
47
- >
48
- <Progress />
49
- <div class="capitalize">{currentStatus}...</div>
50
- </div>
51
- {/if}
52
- {:else if currentStatus === MachineConnectionEvent.DISCONNECTED}
53
- {#if disconnected}
54
- {@render disconnected()}
55
- {:else}
56
- <div
57
- class={twMerge(
58
- 'bg-extralight text-disabled flex h-full min-h-40 w-full items-center justify-center',
59
- disconnectedClass
60
- )}
61
- >
62
- This machine is offline
63
- </div>
64
- {/if}
65
- {/if}
47
+ {#snippet loader()}
48
+ <div
49
+ class="bg-extralight text-disabled flex h-full min-h-40 w-full items-center justify-center gap-2"
50
+ >
51
+ <Progress />
52
+ <div class="capitalize">{connectionStatus.current}...</div>
53
+ </div>
54
+ {/snippet}
55
+
56
+ {#snippet failed()}
57
+ <div
58
+ class="bg-extralight text-disabled flex h-full min-h-40 w-full items-center justify-center gap-2"
59
+ >
60
+ <Icon
61
+ name="alert"
62
+ cx="text-danger-dark"
63
+ aria-hidden="true"
64
+ />
65
+
66
+ Could not connect to the machine.
67
+ </div>
68
+ {/snippet}
69
+
70
+ {#snippet offline()}
71
+ <div class="bg-extralight text-disabled flex h-full min-h-40 w-full items-center justify-center">
72
+ This machine is offline
73
+ </div>
74
+ {/snippet}
66
75
 
67
- {#snippet failed(error, reset)}
68
- <div class="bg-extralight flex h-full w-full flex-col items-center justify-center gap-2 p-4">
69
- <div>Something went wrong</div>
70
- <button
71
- class="text-disabled text-xs hover:underline"
72
- onclick={reset}>Try again</button
73
- >
74
- <button
75
- class="text-disabled text-xs hover:underline"
76
- onclick={() => {
77
- isErrorExpanded = !isErrorExpanded
78
- }}>{isErrorExpanded ? 'Hide' : 'Show'} error</button
79
- >
80
- {#if isErrorExpanded}
81
- <pre class="font-mono text-xs text-wrap">{error}</pre>
82
- {/if}
83
- </div>
84
- {/snippet}
85
- </svelte:boundary>
76
+ {#key connectionStatus.current}
77
+ <!-- fallback outer boundary -->
78
+ <Boundary>
79
+ {@render view()}
80
+ </Boundary>
81
+ {/key}
@@ -1,12 +1,12 @@
1
1
  import type { Snippet } from 'svelte';
2
- import { MachineConnectionEvent } from '@viamrobotics/sdk';
3
2
  interface Props {
4
3
  partID: string;
5
- connectingClass?: string;
6
- disconnectedClass?: string;
7
- status?: MachineConnectionEvent;
8
- connected?: Snippet;
4
+ connected: Snippet;
5
+ dialing?: Snippet;
9
6
  connecting?: Snippet;
7
+ reconnecting?: Snippet;
8
+ reconnectionFailed?: Snippet;
9
+ disconnecting?: Snippet;
10
10
  disconnected?: Snippet;
11
11
  }
12
12
  declare const ConnectionStatus: import("svelte").Component<Props, {}, "">;
@@ -1,19 +1,18 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
-
4
- import { twMerge } from 'tailwind-merge'
3
+ import type { ClassValue } from 'svelte/elements'
5
4
 
6
5
  interface Props {
7
6
  contentRect: DOMRect | undefined
8
- cx?: string
7
+ class?: ClassValue
9
8
  children?: Snippet
10
9
  }
11
10
 
12
- const { contentRect, cx = '', children }: Props = $props()
11
+ const { contentRect, class: classNames = 'h-full w-full', children }: Props = $props()
13
12
  </script>
14
13
 
15
14
  <div
16
- class={twMerge('h-full w-full', cx)}
15
+ class={classNames}
17
16
  style:width={contentRect ? `${contentRect.width.toString()}px` : undefined}
18
17
  style:height={contentRect ? `${contentRect.height.toString()}px` : undefined}
19
18
  >
@@ -1,7 +1,8 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  interface Props {
3
4
  contentRect: DOMRect | undefined;
4
- cx?: string;
5
+ class?: ClassValue;
5
6
  children?: Snippet;
6
7
  }
7
8
  declare const ContentRect: import("svelte").Component<Props, {}, "">;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
+ import type { ClassValue } from 'svelte/elements'
3
+
2
4
  import { IconButton, Tooltip } from '@viamrobotics/prime-core'
3
- import { twMerge } from 'tailwind-merge'
4
5
 
5
6
  interface Props {
6
7
  lastError: Error | null | undefined
7
8
  id?: string
8
- class?: string
9
+ class?: ClassValue
9
10
  }
10
11
 
11
12
  const defaultId = $props.id()
@@ -39,10 +40,10 @@
39
40
  <div class="flex items-center justify-between gap-1">
40
41
  <p
41
42
  {id}
42
- class={twMerge(
43
+ class={[
43
44
  'font-roboto-mono text-danger-dark min-w-0 overflow-auto text-xs wrap-break-word',
44
- className
45
- )}
45
+ className,
46
+ ]}
46
47
  >
47
48
  {errorText}
48
49
  </p>
@@ -1,7 +1,8 @@
1
+ import type { ClassValue } from 'svelte/elements';
1
2
  interface Props {
2
3
  lastError: Error | null | undefined;
3
4
  id?: string;
4
- class?: string;
5
+ class?: ClassValue;
5
6
  }
6
7
  declare const Error: import("svelte").Component<Props, {}, "">;
7
8
  type Error = ReturnType<typeof Error>;
@@ -1,5 +1,4 @@
1
1
  export { default as ConnectionStatus } from './connection-status.svelte';
2
- export { default as SectionTitle } from './section-title.svelte';
3
2
  export { default as ArmWidget } from './widgets/arm/arm.svelte';
4
3
  export { default as ArmGetJointPositionsWidget } from './widgets/arm/get-joint-positions-widget.svelte';
5
4
  export { default as ArmIsMovingWidget } from './widgets/arm/is-moving-widget.svelte';
@@ -1,5 +1,4 @@
1
1
  export { default as ConnectionStatus } from './connection-status.svelte';
2
- export { default as SectionTitle } from './section-title.svelte';
3
2
  export { default as ArmWidget } from './widgets/arm/arm.svelte';
4
3
  export { default as ArmGetJointPositionsWidget } from './widgets/arm/get-joint-positions-widget.svelte';
5
4
  export { default as ArmIsMovingWidget } from './widgets/arm/is-moving-widget.svelte';
@@ -17,6 +17,8 @@
17
17
 
18
18
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
19
19
 
20
+ import type { ResourceTriplet } from '../resource-triplet'
21
+
20
22
  import ApiSection from './api-section.svelte'
21
23
  import Query from './query.svelte'
22
24
  import StatusPill from './status-pill.svelte'
@@ -33,7 +35,7 @@
33
35
  client: Client
34
36
  partID: string
35
37
  resourceName: string
36
- api: string
38
+ api: ResourceTriplet
37
39
  children?: Snippet
38
40
  }
39
41
 
@@ -54,7 +56,7 @@
54
56
  title="IsMoving"
55
57
  {api}
56
58
  bottomText="Updates automatically"
57
- class="grow"
59
+ class="grow flex-col gap-4"
58
60
  >
59
61
  <Query {query}>
60
62
  <StatusPill isActive={query.data ?? false} />
@@ -1,11 +1,12 @@
1
1
  import type { ArmClient, BaseClient, GantryClient, GripperClient, MotorClient, ServoClient } from '@viamrobotics/sdk';
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ResourceTriplet } from '../resource-triplet';
3
4
  type Client = typeof ArmClient | typeof BaseClient | typeof GantryClient | typeof GripperClient | typeof MotorClient | typeof ServoClient;
4
5
  interface Props {
5
6
  client: Client;
6
7
  partID: string;
7
8
  resourceName: string;
8
- api: string;
9
+ api: ResourceTriplet;
9
10
  children?: Snippet;
10
11
  }
11
12
  declare const IsMoving: import("svelte").Component<Props, {}, "">;
@@ -3,7 +3,9 @@
3
3
 
4
4
  Creates a maplibre-gl map that will fill its parent.
5
5
 
6
- Children will mount once the map is fully loaded.
6
+ Children will mount once the map is fully loaded. They render inside the
7
+ map's own positioned, isolated box, so absolutely positioned overlays sit
8
+ relative to the map and their z-index never competes with the host page.
7
9
 
8
10
  ```svelte
9
11
  <MapLibre mapProvider="open-street">
@@ -220,12 +222,8 @@
220
222
  })
221
223
  </script>
222
224
 
223
- {#if created}
224
- {@render children?.()}
225
- {/if}
226
-
227
225
  <div
228
- class={['h-full', className]}
226
+ class={['relative isolate h-full', className]}
229
227
  {...rest}
230
228
  >
231
229
  <div
@@ -234,6 +232,7 @@
234
232
  ></div>
235
233
 
236
234
  {#if created}
235
+ {@render children?.()}
237
236
  {@render layer?.()}
238
237
  {/if}
239
238
  </div>
@@ -56,7 +56,9 @@ interface Props extends HTMLAttributes<HTMLDivElement> {
56
56
  /**
57
57
  * Creates a maplibre-gl map that will fill its parent.
58
58
  *
59
- * Children will mount once the map is fully loaded.
59
+ * Children will mount once the map is fully loaded. They render inside the
60
+ * map's own positioned, isolated box, so absolutely positioned overlays sit
61
+ * relative to the map and their z-index never competes with the host page.
60
62
  *
61
63
  * ```svelte
62
64
  * <MapLibre mapProvider="open-street">
@@ -1,8 +1,10 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte'
3
+ import type { ClassValue } from 'svelte/elements'
3
4
 
4
- import { twMerge } from 'tailwind-merge'
5
+ import type { ResourceTriplet } from '../resource-triplet'
5
6
 
7
+ import Boundary from './boundary.svelte'
6
8
  import ErrorDisplay from './error.svelte'
7
9
  import SectionTitle from './section-title.svelte'
8
10
 
@@ -12,8 +14,8 @@
12
14
  description?: string | undefined
13
15
  lastError: Error | null
14
16
  /** RDK API string; presence renders the title as a linked monospace method name */
15
- api?: string | undefined
16
- class?: string
17
+ api?: ResourceTriplet | undefined
18
+ class?: ClassValue
17
19
  titleInput?: Snippet
18
20
  error?: Snippet
19
21
  children?: Snippet
@@ -38,7 +40,7 @@
38
40
  class="flex w-full flex-col gap-2 p-4"
39
41
  aria-labelledby={headingID}
40
42
  >
41
- <div class={twMerge('flex grow flex-row flex-wrap gap-2', className)}>
43
+ <div class={['flex grow flex-row flex-wrap gap-2', className]}>
42
44
  <div class="flex max-w-50 grow flex-col gap-0.5 pr-4">
43
45
  {#if api}
44
46
  <SectionTitle
@@ -62,7 +64,7 @@
62
64
  </div>
63
65
 
64
66
  <div class="flex grow flex-wrap justify-between gap-2">
65
- {@render children?.()}
67
+ <Boundary {children} />
66
68
  </div>
67
69
  </div>
68
70
  {#if error}
@@ -1,12 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
3
+ import type { ResourceTriplet } from '../resource-triplet';
2
4
  interface Props {
3
5
  title: string;
4
6
  tooltip?: string | undefined;
5
7
  description?: string | undefined;
6
8
  lastError: Error | null;
7
9
  /** RDK API string; presence renders the title as a linked monospace method name */
8
- api?: string | undefined;
9
- class?: string;
10
+ api?: ResourceTriplet | undefined;
11
+ class?: ClassValue;
10
12
  titleInput?: Snippet;
11
13
  error?: Snippet;
12
14
  children?: Snippet;