@viamrobotics/test-widgets 0.5.0 → 0.6.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.
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
2
4
  import { Button, Progress } from '@viamrobotics/prime-core'
3
5
  import { CodeEditor } from '@viamrobotics/prime-core/code-editor'
4
6
  import { type ResourceName, Struct } from '@viamrobotics/sdk'
@@ -15,9 +17,11 @@
15
17
  interface Props {
16
18
  partID: string
17
19
  resource: ResourceName
20
+ /** Rendered above the input/output editor row. */
21
+ header?: Snippet<[{ input: string; setInput: (value: string) => void }]>
18
22
  }
19
23
 
20
- const { partID, resource }: Props = $props()
24
+ const { partID, resource, header }: Props = $props()
21
25
 
22
26
  const client = createDoCommandClient(
23
27
  () => resource,
@@ -37,6 +41,10 @@
37
41
 
38
42
  let output = $state('')
39
43
 
44
+ const setInput = (value: string) => {
45
+ input.current = value
46
+ }
47
+
40
48
  const execute = async () => {
41
49
  try {
42
50
  lastErr = null
@@ -52,6 +60,11 @@
52
60
  </script>
53
61
 
54
62
  {#if isSupported}
63
+ {#if header}
64
+ <div class="border-b">
65
+ {@render header({ input: input.current ?? '{}', setInput })}
66
+ </div>
67
+ {/if}
55
68
  <div class="flex flex-row items-center justify-between">
56
69
  <div class="flex w-[45%] flex-col gap-2 border-r py-2">
57
70
  <span class="text-gray-9 px-4 text-sm font-medium">Input</span>
@@ -1,7 +1,13 @@
1
+ import type { Snippet } from 'svelte';
1
2
  import { type ResourceName } from '@viamrobotics/sdk';
2
3
  interface Props {
3
4
  partID: string;
4
5
  resource: ResourceName;
6
+ /** Rendered above the input/output editor row. */
7
+ header?: Snippet<[{
8
+ input: string;
9
+ setInput: (value: string) => void;
10
+ }]>;
5
11
  }
6
12
  declare const DoCommand: import("svelte").Component<Props, {}, "">;
7
13
  type DoCommand = ReturnType<typeof DoCommand>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/test-widgets",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": [
@@ -49,7 +49,7 @@
49
49
  "@playwright/test": "^1.59.1",
50
50
  "@sentry/svelte": "^10.50.0",
51
51
  "@sveltejs/adapter-static": "^3.0.10",
52
- "@sveltejs/kit": "^2.58.0",
52
+ "@sveltejs/kit": "^2.60.1",
53
53
  "@sveltejs/package": "^2.5.7",
54
54
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
55
55
  "@tailwindcss/postcss": "^4.2.4",
@@ -72,7 +72,7 @@
72
72
  "@viamrobotics/svelte-sdk": "^1.2.1",
73
73
  "@viamrobotics/tailwind-config": "^1.0.0",
74
74
  "@viamrobotics/three": "^0.0.9",
75
- "@vitest/browser": "^4.1.5",
75
+ "@vitest/browser": "^4.1.6",
76
76
  "@vitest/browser-playwright": "^4.1.5",
77
77
  "@vitest/coverage-v8": "^4.1.5",
78
78
  "eslint": "^10.2.1",