diff --git a/docs/plan-redesign.md b/docs/plan-redesign.md index 1a8990a..0ae416f 100644 --- a/docs/plan-redesign.md +++ b/docs/plan-redesign.md @@ -332,7 +332,7 @@ src/routes/preview/tools/[id]/+page.svelte - [x] **[C11]** `/preview/demo` — зеркало воркспейса (4 шага + панель превью), статичный приёмочный стенд. - [x] **[C12]** `/preview/tools/[id]` — data-driven settings-panel + preview-panel (gradient live, остальные — плейсхолдер); `NumberField`, `entries()` для prerender, ToolCard-ссылки подключены. - [x] **[C13]** `/preview/tools/[id]` — comparison-grid для file-source инструментов (`Dropzone` + before/after `CheckerCanvas`, `result-meta`); охватывает background-remover и прочие. -- [ ] **[C14]** step-cards для chain в tool-page. +- [x] **[C14]** `/preview/tools/[id]` — исполняемая цепочка: `StepCard`-шаги (параметры inline) + «Add step» (chainable), живой прогон пайплайна на исходнике, превью каждого шага + итог + Download. ### Шаг 4. Переключатель и проверка diff --git a/web/src/routes/preview/tools/[id]/+page.svelte b/web/src/routes/preview/tools/[id]/+page.svelte index 84d1001..177251f 100644 --- a/web/src/routes/preview/tools/[id]/+page.svelte +++ b/web/src/routes/preview/tools/[id]/+page.svelte @@ -1,7 +1,13 @@ - easy-png-tools / {tool?.title ?? "Tool"} + easy-png-tools / {firstTool?.title ?? "Tool"} -{#snippet settingsPanel()} - - - {#snippet actions()} - AUTO - {/snippet} - -

{tool!.description}

-
- {#each tool!.params as p (p.id)} -
- {#if p.type === "color"} - setParam(p.id, v)} - /> - {:else if p.type === "slider"} - setParam(p.id, v)} - /> - {:else if p.type === "select"} - setParam(p.id, v)} - /> - {:else if p.type === "checkbox"} - - {:else if p.type === "text"} - setParam(p.id, v)} - /> - {:else if p.type === "number"} - setParam(p.id, v)} - /> - {/if} -
- {/each} -
- - - -
+{#snippet control( + p: ParamDef, + value: ParamValue, + onInput: (v: ParamValue) => void, +)} + {#if p.type === "color"} + onInput(v)} + /> + {:else if p.type === "slider"} + onInput(v)} + /> + {:else if p.type === "select"} + onInput(v)} + /> + {:else if p.type === "checkbox"} + + {:else if p.type === "text"} + onInput(v)} + /> + {:else if p.type === "number"} + onInput(v)} + /> + {/if} {/snippet} -{#if !tool} +{#if !firstTool}
-{:else if tool.sourceMode === "none"} +{:else}
-
{@render settingsPanel()}
-
+
- + {#snippet actions()} - + AUTO {/snippet} -
- {#if previewError} - - {:else if previewUrl} - - result - - {:else if tool.generate} -
- -
- {:else} +
+ {#if steps.length === 0} {/if} - + {#each steps as step, i (step.toolId + i)} + {@const st = getTool(step.toolId)} + removeStep(i)} + > + {#if st} +
+ {#each st.params as p (p.id)} + {@render control(p, step.params[p.id] as ParamValue, (v) => + setStepParam(i, p.id, v), + )} + {/each} +
+ {/if} +
+ {/each}
+ +
+ (addId = v)} + /> + +
+
-
-{:else if isFileTool} -
-
{@render settingsPanel()}
+
- + {#snippet actions()} {#if resultUrl}
- {#if previewError} - + {#if chainError} + {/if} - {#if !sourceImg} + {#if needsSource && !sourceImg} - {:else} -
-
-
- SOURCE{sourceName} -
-
- - source - - {sourceImg.width} × {sourceImg.height} -
-
-
-
- RESULT{sourceName} -
-
- {#if resultUrl} - - result - - {/if} - {resultImg - ? `${resultImg.width} × ${resultImg.height}` - : "—"} -
-
-
-
- FORMAT PNG-24 - ALPHA ENABLED - STATUS PROCESSED -
- + {:else if needsSource && sourceImg} + {/if} -
-
-
-
-{:else} -
-
{@render settingsPanel()}
-
- - -
- +
+ {#if needsSource && sourceImg} + + + source + + + {/if} + {#each stepOutputs as out, i (out.toolId + i)} + + + {out.title} + + + {/each} +
+ {#if processing} + + {/if} +
@@ -375,31 +380,23 @@