diff --git a/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte b/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte index 114e349ce7..e334e2ab2d 100644 --- a/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte +++ b/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte @@ -17,22 +17,32 @@ import ResolveConfig from '../helpers/ResolveConfig.svelte' import { userStore } from '$lib/stores' - export let id: string - export let componentInput: AppInput | undefined - export let initializing: boolean | undefined = undefined - export let customCss: ComponentCustomCSS<'displaycomponent'> | undefined = undefined - export let render: boolean - export let configuration: RichConfigurations + interface Props { + id: string + componentInput: AppInput | undefined + initializing?: boolean | undefined + customCss?: ComponentCustomCSS<'displaycomponent'> | undefined + render: boolean + configuration: RichConfigurations + } + + let { + id, + componentInput, + initializing = $bindable(undefined), + customCss = undefined, + render, + configuration + }: Props = $props() const requireHtmlApproval = getContext(IS_APP_PUBLIC_CONTEXT_KEY) const { app, worldStore, componentControl, workspace, appPath } = getContext('AppViewerContext') - let result: any = undefined + let result: any = $state(undefined) - const resolvedConfig = initConfig( - components['displaycomponent'].initialData.configuration, - configuration + const resolvedConfig = $state( + initConfig(components['displaycomponent'].initialData.configuration, configuration) ) $componentControl[id] = { @@ -46,7 +56,7 @@ loading: false }) - let css = initCss($app.css?.displaycomponent, customCss) + let css = $state(initCss($app.css?.displaycomponent, customCss)) {#each Object.keys(components['displaycomponent'].initialData.configuration) as key (key)} diff --git a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte index 44cdb9c779..6c7c6590fa 100644 --- a/frontend/src/lib/components/apps/components/helpers/InputValue.svelte +++ b/frontend/src/lib/components/apps/components/helpers/InputValue.svelte @@ -1,11 +1,10 @@ + + diff --git a/frontend/src/lib/components/apps/components/helpers/NonRunnableComponent.svelte b/frontend/src/lib/components/apps/components/helpers/NonRunnableComponent.svelte index c0856b8b90..af31a65955 100644 --- a/frontend/src/lib/components/apps/components/helpers/NonRunnableComponent.svelte +++ b/frontend/src/lib/components/apps/components/helpers/NonRunnableComponent.svelte @@ -1,5 +1,5 @@ {#if !noInitialize} @@ -79,7 +98,7 @@ {#if render || hasChildrens}
- + {@render children?.()}
diff --git a/frontend/src/lib/components/apps/editor/AppEditor.svelte b/frontend/src/lib/components/apps/editor/AppEditor.svelte index 3530a1fcd8..f146559a2c 100644 --- a/frontend/src/lib/components/apps/editor/AppEditor.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditor.svelte @@ -100,7 +100,8 @@ migrateApp(app) - const appStore = writable(app) + const stateApp = $state(app) + const appStore = writable(stateApp) const selectedComponent = writable(undefined) // $: selectedComponent.subscribe((s) => { diff --git a/frontend/src/lib/components/apps/editor/GridEditor.svelte b/frontend/src/lib/components/apps/editor/GridEditor.svelte index 5163a92885..d5cc728a08 100644 --- a/frontend/src/lib/components/apps/editor/GridEditor.svelte +++ b/frontend/src/lib/components/apps/editor/GridEditor.svelte @@ -1,5 +1,5 @@ @@ -797,7 +808,9 @@ >{error}
- +
{/snippet} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte index b706095172..e0f4787dae 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte @@ -46,11 +46,19 @@ import { twMerge } from 'tailwind-merge' import Popover from '$lib/components/Popover.svelte' - export let componentSettings: { item: GridItem; parent: string | undefined } | undefined = - undefined - export let onDelete: (() => void) | undefined = undefined - export let noGrid = false - export let duplicateMoveAllowed = true + interface Props { + componentSettings?: { item: GridItem; parent: string | undefined } | undefined + onDelete?: (() => void) | undefined + noGrid?: boolean + duplicateMoveAllowed?: boolean + } + + let { + componentSettings = $bindable(undefined), + onDelete = undefined, + noGrid = false, + duplicateMoveAllowed = true + }: Props = $props() const { app, @@ -108,10 +116,10 @@ let viewCssOptions = false - $: extraLib = + let extraLib = $derived( (componentSettings?.item?.data?.componentInput?.type === 'template' || componentSettings?.item?.data?.componentInput?.type === 'templatev2') && - $worldStore + $worldStore ? buildExtraLib( $worldStore?.outputsById ?? {}, componentSettings?.item?.data?.id, @@ -119,6 +127,7 @@ false ) : undefined + ) // ` // /** The current's app state */ @@ -144,7 +153,7 @@ ? isTriggerable(componentSettings?.item.data.type) : false - let evalV2editor: EvalV2InputEditor | undefined = undefined + let evalV2editor: EvalV2InputEditor | undefined = $state(undefined) function transformToFrontend() { if (componentSettings?.item.data.componentInput) { @@ -173,7 +182,7 @@ } - + {#if componentSettings?.item?.id && isTableAction(componentSettings?.item?.id, $app)}
- + {#snippet text()}
Back to table component
-
+ {/snippet} -
+ {#snippet action()} +
+ +
+ {/snippet}
Full height
{#if componentSettings?.item?.[12]?.fullHeight !== undefined} @@ -525,20 +536,22 @@ {#if duplicateMoveAllowed} -
- -
+ {#snippet action()} +
+ +
+ {/snippet}
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte index d802eacfd8..b7fd418849 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte @@ -7,21 +7,39 @@ import OneOfInputSpecsEditor from './OneOfInputSpecsEditor.svelte' import Tooltip from '$lib/components/Tooltip.svelte' - export let id: string - export let inputSpecs: RichConfigurations - export let inputSpecsConfiguration: RichConfigurations | undefined = undefined - export let userInputEnabled: boolean = false - export let shouldCapitalize: boolean = true - export let resourceOnly = false - export let displayType = false - export let deletable = false - export let acceptSelf: boolean = false - export let recomputeOnInputChanged = true - export let showOnDemandOnlyToggle = false - export let securedContext = false - export let overridenByComponent: string[] = [] + interface Props { + id: string + inputSpecs: RichConfigurations + inputSpecsConfiguration?: RichConfigurations | undefined + userInputEnabled?: boolean + shouldCapitalize?: boolean + resourceOnly?: boolean + displayType?: boolean + deletable?: boolean + acceptSelf?: boolean + recomputeOnInputChanged?: boolean + showOnDemandOnlyToggle?: boolean + securedContext?: boolean + overridenByComponent?: string[] + } - $: finalInputSpecsConfiguration = inputSpecsConfiguration ?? inputSpecs + let { + id, + inputSpecs = $bindable(), + inputSpecsConfiguration = undefined, + userInputEnabled = false, + shouldCapitalize = true, + resourceOnly = false, + displayType = false, + deletable = false, + acceptSelf = false, + recomputeOnInputChanged = true, + showOnDemandOnlyToggle = false, + securedContext = false, + overridenByComponent = [] + }: Props = $props() + + let finalInputSpecsConfiguration = $derived(inputSpecsConfiguration ?? inputSpecs) const dispatch = createEventDispatcher()