@viamrobotics/test-widgets 0.17.3 → 0.18.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/dist/components/boundary.svelte +6 -1
- package/dist/components/index.d.ts +8 -1
- package/dist/components/index.js +8 -1
- package/dist/components/maplibre/index.svelte +3 -2
- package/dist/components/section/section-error.svelte +52 -8
- package/dist/components/section/section-error.svelte.d.ts +2 -0
- package/dist/components/section/section-errors.svelte +10 -2
- package/dist/components/widgets/arm/arm.svelte +5 -14
- package/dist/components/widgets/arm/stop-widget.svelte +20 -0
- package/dist/components/widgets/arm/stop-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/base/base.svelte +32 -150
- package/dist/components/widgets/base/stop-widget.svelte +20 -0
- package/dist/components/widgets/base/stop-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/camera/camera.svelte +28 -10
- package/dist/components/widgets/camera/export-screenshot.svelte +12 -20
- package/dist/components/widgets/camera/export-screenshot.svelte.d.ts +2 -0
- package/dist/components/widgets/camera/live-or-polling-video.svelte +13 -12
- package/dist/components/widgets/camera/picture-in-picture-button.svelte +7 -15
- package/dist/components/widgets/custom-control/custom-control.svelte +2 -2
- package/dist/components/widgets/do-command/do-command.svelte +6 -6
- package/dist/components/widgets/gantry/move-to-position-widget.svelte +12 -8
- package/dist/components/widgets/gantry/quick-move-widget.svelte +29 -15
- package/dist/components/widgets/gripper/grab-widget.svelte +10 -3
- package/dist/components/widgets/gripper/gripper.svelte +15 -54
- package/dist/components/widgets/gripper/is-holding-something-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/gripper/open-grab-control.svelte +60 -0
- package/dist/components/widgets/gripper/open-grab-control.svelte.d.ts +9 -0
- package/dist/components/widgets/gripper/open-widget.svelte +10 -3
- package/dist/components/widgets/gripper/stop-widget.svelte +20 -0
- package/dist/components/widgets/gripper/stop-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/ml-model-service/metadata-widget.svelte +52 -0
- package/dist/components/widgets/ml-model-service/metadata-widget.svelte.d.ts +13 -0
- package/dist/components/widgets/ml-model-service/ml-model-service.svelte +9 -22
- package/dist/components/widgets/movement-sensor/movement-sensor.svelte +102 -125
- package/dist/components/widgets/operations-and-sessions/operations-and-sessions.svelte +11 -7
- package/dist/components/widgets/servo/get-position-widget.svelte +42 -0
- package/dist/components/widgets/servo/get-position-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/servo/move-widget.svelte +10 -5
- package/dist/components/widgets/servo/quick-move-widget.svelte +28 -10
- package/dist/components/widgets/servo/servo.svelte +22 -111
- package/dist/components/widgets/servo/stop-widget.svelte +20 -0
- package/dist/components/widgets/servo/stop-widget.svelte.d.ts +7 -0
- package/dist/components/widgets/switch/position-view.svelte +8 -5
- package/dist/components/widgets/switch/position.svelte +1 -5
- package/dist/components/widgets/switch/position.svelte.d.ts +0 -1
- package/dist/components/widgets/switch/switch.svelte +18 -17
- package/dist/components/widgets/vision-service/vision-service.svelte +12 -7
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +15 -5
- package/package.json +13 -13
- package/dist/components/content-rect.svelte +0 -26
- package/dist/components/content-rect.svelte.d.ts +0 -11
- package/dist/components/error.svelte +0 -71
- package/dist/components/error.svelte.d.ts +0 -15
- package/dist/components/queries.svelte +0 -97
- package/dist/components/queries.svelte.d.ts +0 -17
- package/dist/components/query.svelte +0 -29
- package/dist/components/query.svelte.d.ts +0 -15
- package/dist/components/widgets/gripper/is-holding-something.svelte.d.ts +0 -7
- /package/dist/components/widgets/gripper/{is-holding-something.svelte → is-holding-something-widget.svelte} +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
|
|
4
|
-
@deprecated A section owns its async state now. Pass the queries to `ApiSection` as `queries`, or to a
|
|
5
|
-
`Section` control's `useSectionErrors` call, and guard `query.data` in the children. Kept for the sectionless files until their resource PRs.
|
|
6
|
-
-->
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import type { QueryObserverResult } from '@tanstack/svelte-query'
|
|
10
|
-
import type { Snippet } from 'svelte'
|
|
11
|
-
import type { ClassValue } from 'svelte/elements'
|
|
12
|
-
|
|
13
|
-
import { useResizeObserver } from 'runed'
|
|
14
|
-
|
|
15
|
-
import ContentRect from './content-rect.svelte'
|
|
16
|
-
import ErrorDisplay from './error.svelte'
|
|
17
|
-
import Progress from './progress.svelte'
|
|
18
|
-
|
|
19
|
-
interface Props {
|
|
20
|
-
queries: QueryObserverResult[]
|
|
21
|
-
class?: ClassValue
|
|
22
|
-
children?: Snippet<[{ data: unknown[] }]>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { queries, class: classNames, children }: Props = $props()
|
|
26
|
-
|
|
27
|
-
let el = $state.raw<HTMLDivElement>()
|
|
28
|
-
let contentRect = $state.raw<DOMRect>()
|
|
29
|
-
|
|
30
|
-
useResizeObserver(
|
|
31
|
-
() => el,
|
|
32
|
-
([entry]) => {
|
|
33
|
-
contentRect = entry.contentRect
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
let errors = $state.raw<Error[]>([])
|
|
38
|
-
let data = $state.raw<unknown[]>([])
|
|
39
|
-
|
|
40
|
-
const errorKey = (error: Error) => `${error.name}\0${error.message}`
|
|
41
|
-
const serializeErrors = (errs: Error[]) => errs.map((element) => errorKey(element)).join('\0\0')
|
|
42
|
-
const dedupeErrors = (errs: Error[]) => [
|
|
43
|
-
...new Map(errs.map((error) => [errorKey(error), error])).values(),
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
// Errors are null during loading, so keep the latest errors during polling.
|
|
47
|
-
// Only update errors if the content has changed to avoid re-rendering identical errors.
|
|
48
|
-
$effect.pre(() => {
|
|
49
|
-
const nextErrors = dedupeErrors(
|
|
50
|
-
queries.map((query) => query.error).filter((error) => error !== null)
|
|
51
|
-
)
|
|
52
|
-
if (nextErrors.length > 0) {
|
|
53
|
-
if (serializeErrors(nextErrors) !== serializeErrors(errors)) {
|
|
54
|
-
errors = nextErrors
|
|
55
|
-
}
|
|
56
|
-
} else if (queries.every((query) => query.isSuccess)) {
|
|
57
|
-
errors = []
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
// Data is undefined during loading, so keep the latest data during polling.
|
|
62
|
-
$effect.pre(() => {
|
|
63
|
-
const nextData = queries.map((query) => query.data)
|
|
64
|
-
if (nextData.length > 0) {
|
|
65
|
-
data = nextData
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const isLoading = $derived(queries.some((query) => query.isLoading))
|
|
70
|
-
// A caller's class sets the placeholder height, so it replaces ContentRect's default `h-full`.
|
|
71
|
-
const contentRectClass = $derived(['w-full', classNames ?? 'h-full'])
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
{#if errors.length > 0}
|
|
75
|
-
<ContentRect
|
|
76
|
-
{contentRect}
|
|
77
|
-
class={contentRectClass}
|
|
78
|
-
>
|
|
79
|
-
{#each errors as error (errorKey(error))}
|
|
80
|
-
<ErrorDisplay lastError={error} />
|
|
81
|
-
{/each}
|
|
82
|
-
</ContentRect>
|
|
83
|
-
{:else if isLoading}
|
|
84
|
-
<ContentRect
|
|
85
|
-
{contentRect}
|
|
86
|
-
class={contentRectClass}
|
|
87
|
-
>
|
|
88
|
-
<Progress />
|
|
89
|
-
</ContentRect>
|
|
90
|
-
{:else}
|
|
91
|
-
<div
|
|
92
|
-
class="w-full"
|
|
93
|
-
bind:this={el}
|
|
94
|
-
>
|
|
95
|
-
{@render children?.({ data })}
|
|
96
|
-
</div>
|
|
97
|
-
{/if}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { QueryObserverResult } from '@tanstack/svelte-query';
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { ClassValue } from 'svelte/elements';
|
|
4
|
-
interface Props {
|
|
5
|
-
queries: QueryObserverResult[];
|
|
6
|
-
class?: ClassValue;
|
|
7
|
-
children?: Snippet<[{
|
|
8
|
-
data: unknown[];
|
|
9
|
-
}]>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated A section owns its async state now. Pass the queries to `ApiSection` as `queries`, or to a
|
|
13
|
-
* `Section` control's `useSectionErrors` call, and guard `query.data` in the children. Kept for the sectionless files until their resource PRs.
|
|
14
|
-
*/
|
|
15
|
-
declare const Queries: import("svelte").Component<Props, {}, "">;
|
|
16
|
-
type Queries = ReturnType<typeof Queries>;
|
|
17
|
-
export default Queries;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
@component
|
|
3
|
-
|
|
4
|
-
@deprecated A section owns its async state now. Pass the query to `ApiSection` as `queries`, or to a
|
|
5
|
-
`Section` control's `useSectionErrors` call, and guard `query.data` in the children. Kept for the sectionless files until their resource PRs.
|
|
6
|
-
-->
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
import type { QueryObserverResult } from '@tanstack/svelte-query'
|
|
10
|
-
import type { Snippet } from 'svelte'
|
|
11
|
-
import type { ClassValue } from 'svelte/elements'
|
|
12
|
-
|
|
13
|
-
import Queries from './queries.svelte'
|
|
14
|
-
|
|
15
|
-
interface Props {
|
|
16
|
-
query: QueryObserverResult
|
|
17
|
-
class?: ClassValue
|
|
18
|
-
children?: Snippet
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const { query, class: classNames, children }: Props = $props()
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<Queries
|
|
25
|
-
queries={[query]}
|
|
26
|
-
class={classNames}
|
|
27
|
-
>
|
|
28
|
-
{@render children?.()}
|
|
29
|
-
</Queries>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { QueryObserverResult } from '@tanstack/svelte-query';
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { ClassValue } from 'svelte/elements';
|
|
4
|
-
interface Props {
|
|
5
|
-
query: QueryObserverResult;
|
|
6
|
-
class?: ClassValue;
|
|
7
|
-
children?: Snippet;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated A section owns its async state now. Pass the query to `ApiSection` as `queries`, or to a
|
|
11
|
-
* `Section` control's `useSectionErrors` call, and guard `query.data` in the children. Kept for the sectionless files until their resource PRs.
|
|
12
|
-
*/
|
|
13
|
-
declare const Query: import("svelte").Component<Props, {}, "">;
|
|
14
|
-
type Query = ReturnType<typeof Query>;
|
|
15
|
-
export default Query;
|
|
File without changes
|