fix: update i18n - update schema fields descriptions

This commit is contained in:
2026-09-13 07:16:46 +05:00
parent 4de42b1e40
commit 08c9fbce3b
10 changed files with 287 additions and 57 deletions
+6 -1
View File
@@ -26,6 +26,8 @@
label: string;
value: unknown;
spec: FieldSpec;
toolId: string;
fieldId: string;
onchange?: (value: unknown) => void;
}
@@ -49,10 +51,11 @@
interface Props {
schema: ToolSchema<Record<string, unknown>>;
values: Record<string, unknown>;
toolId: string;
onchange: (id: string, value: unknown) => void;
onreset: () => void;
}
let { schema, values, onchange, onreset }: Props = $props();
let { schema, values, toolId, onchange, onreset }: Props = $props();
interface LayoutGroup {
key: string;
@@ -104,6 +107,8 @@
label={fieldLabel(schema.fields[id], id)}
value={values[id]}
spec={schema.fields[id].spec}
{toolId}
fieldId={id}
onchange={(v) => onchange(id, v)}
/>
{/each}
+7 -1
View File
@@ -179,7 +179,13 @@
<span class="label">{t("paramsCard.toolSettings")}</span>
<strong>{t("paramsCard.configureOutput")}</strong>
</div>
<SchemaFields {schema} {values} onchange={setValue} onreset={reset} />
<SchemaFields
{schema}
{values}
toolId={tool.id}
onchange={setValue}
onreset={reset}
/>
</section>
<section class="panel">
@@ -1,13 +1,16 @@
<script lang="ts">
import { optionLabel } from "$lib/i18n/schema-tool-strings";
import type { FieldSpec, SelectSpec } from "$lib/registry-schema";
interface Props {
label: string;
value: unknown;
spec: FieldSpec;
toolId: string;
fieldId: string;
onchange?: (value: string) => void;
}
let { label, value, spec, onchange }: Props = $props();
let { label, value, spec, toolId, fieldId, onchange }: Props = $props();
const sp = $derived(spec as SelectSpec);
const current = $derived(
@@ -25,7 +28,9 @@
oninput={(e) => onchange?.((e.target as HTMLSelectElement).value)}
>
{#each sp.options as option (option.value)}
<option value={option.value}>{option.label}</option>
<option value={option.value}>
{optionLabel(toolId, fieldId, option.value, option.label)}
</option>
{/each}
</select>
</label>