mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-25 00:01:55 +00:00
db0b9f0a2f
* fix(frontend): Fix context panel + delete component * fix(frontend): Handle nested paths
31 lines
832 B
Svelte
31 lines
832 B
Svelte
<script lang="ts">
|
|
import ObjectViewer from '$lib/components/propertyPicker/ObjectViewer.svelte'
|
|
import { getContext } from 'svelte'
|
|
import type { Output } from '../../rx'
|
|
import type { AppEditorContext } from '../../types'
|
|
|
|
export let outputs: string[] = []
|
|
export let componentId: string
|
|
|
|
const { worldStore } = getContext<AppEditorContext>('AppEditorContext')
|
|
|
|
let object = {}
|
|
|
|
function subscribeToAllOutputs(observableOutputs: Record<string, Output<any>>) {
|
|
if (observableOutputs) {
|
|
outputs.forEach((output) => {
|
|
observableOutputs[output].subscribe({
|
|
next: (value) => {
|
|
object[output] = value
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
$: $worldStore?.outputsById[componentId] &&
|
|
subscribeToAllOutputs($worldStore.outputsById[componentId])
|
|
</script>
|
|
|
|
<ObjectViewer json={object} on:select topBrackets={true} />
|