@viamrobotics/test-widgets 0.13.0 → 0.14.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.
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { CameraClient } from '@viamrobotics/sdk'
|
|
5
5
|
import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
|
|
6
6
|
import { PersistedState } from 'runed'
|
|
7
|
+
import { untrack } from 'svelte'
|
|
7
8
|
|
|
8
9
|
import { useAddImageToDataset } from '../../../add-image-to-dataset'
|
|
9
10
|
import ConnectionStatus from '../../connection-status.svelte'
|
|
@@ -29,9 +30,11 @@
|
|
|
29
30
|
interface Props {
|
|
30
31
|
partID: string
|
|
31
32
|
resourceName: string
|
|
33
|
+
/** Start the feed on mount even when "Start feed automatically" is off, e.g. the user just expanded the card. */
|
|
34
|
+
autoplay?: boolean
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
const { partID, resourceName }: Props = $props()
|
|
37
|
+
const { partID, resourceName, autoplay = false }: Props = $props()
|
|
35
38
|
|
|
36
39
|
const refetchInterval = createRefetchIntervalStore(
|
|
37
40
|
() => partID,
|
|
@@ -44,6 +47,10 @@
|
|
|
44
47
|
)
|
|
45
48
|
|
|
46
49
|
let isPlaying = $derived(!waitToStartFeed.current)
|
|
50
|
+
// Read once on purpose: mounting with autoplay is the same override as pressing
|
|
51
|
+
// "Start feed", so later prop changes do not restart the feed.
|
|
52
|
+
if (untrack(() => autoplay)) isPlaying = true
|
|
53
|
+
|
|
47
54
|
let isShowingPointcloud = $state(false)
|
|
48
55
|
let selectedSource = $state('')
|
|
49
56
|
let sourceNames = $state<string[]>([])
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
partID: string;
|
|
3
3
|
resourceName: string;
|
|
4
|
+
/** Start the feed on mount even when "Start feed automatically" is off, e.g. the user just expanded the card. */
|
|
5
|
+
autoplay?: boolean;
|
|
4
6
|
}
|
|
5
7
|
declare const Camera: import("svelte").Component<Props, {}, "">;
|
|
6
8
|
type Camera = ReturnType<typeof Camera>;
|