mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
feat: add chains page, update pipeline usage
This commit is contained in:
@@ -39,6 +39,8 @@ export type HeaderStrings = {
|
||||
footerNote: string;
|
||||
home: string;
|
||||
uiKit: string;
|
||||
chains: string;
|
||||
pipeline: string;
|
||||
};
|
||||
|
||||
export type Dict = {
|
||||
@@ -48,6 +50,7 @@ export type Dict = {
|
||||
catalog: Record<string, string>;
|
||||
toolPage: Record<string, string>;
|
||||
chain: Record<string, string>;
|
||||
savedChains: Record<string, string>;
|
||||
sourceCard: Record<string, string>;
|
||||
resultCard: Record<string, string>;
|
||||
paramsCard: Record<string, string>;
|
||||
|
||||
@@ -7,6 +7,8 @@ export const en: Dict = {
|
||||
sectionsAria: "Sections",
|
||||
home: "Home page",
|
||||
uiKit: "UI Kit",
|
||||
chains: "Pipelines",
|
||||
pipeline: "Pipeline",
|
||||
footerNote:
|
||||
"All operations run locally in your browser — your files are never uploaded anywhere.",
|
||||
},
|
||||
@@ -62,6 +64,23 @@ export const en: Dict = {
|
||||
busyHint: "Running chain step",
|
||||
removeStepAria: "Remove step",
|
||||
},
|
||||
savedChains: {
|
||||
pageTitle: "Saved pipelines — easy-png-tools",
|
||||
metaDescription:
|
||||
"Your saved image pipelines: named tool chains stored locally in your browser.",
|
||||
heading: "Saved pipelines",
|
||||
empty:
|
||||
"No saved pipelines yet — add a step on any tool page and it will appear here.",
|
||||
autoName: "Pipeline {stamp}",
|
||||
saveAs: "Save as pipeline",
|
||||
newChain: "New pipeline",
|
||||
use: "Open",
|
||||
rename: "Rename",
|
||||
renameSave: "Save name",
|
||||
deleteAction: "Delete",
|
||||
confirmDelete: "Sure?",
|
||||
nameAria: "Pipeline name",
|
||||
},
|
||||
sourceCard: {
|
||||
source: "Source",
|
||||
replaceImage: "Replace image",
|
||||
|
||||
@@ -7,6 +7,8 @@ export const ru: Dict = {
|
||||
sectionsAria: "Разделы",
|
||||
home: "Главная",
|
||||
uiKit: "UI Kit",
|
||||
chains: "Пайплайны",
|
||||
pipeline: "Пайплайн",
|
||||
footerNote:
|
||||
"Все операции выполняются локально в вашем браузере — файлы никуда не отправляются.",
|
||||
},
|
||||
@@ -63,6 +65,23 @@ export const ru: Dict = {
|
||||
busyHint: "Выполняется шаг цепочки",
|
||||
removeStepAria: "Убрать шаг",
|
||||
},
|
||||
savedChains: {
|
||||
pageTitle: "Сохранённые пайплайны — easy-png-tools",
|
||||
metaDescription:
|
||||
"Ваши сохранённые пайплайны изображений: именованные цепочки инструментов, хранятся локально в браузере.",
|
||||
heading: "Сохранённые пайплайны",
|
||||
empty:
|
||||
"Пока нет сохранённых пайплайнов — добавьте шаг на странице любого инструмента, и он появится здесь.",
|
||||
autoName: "Пайплайн {stamp}",
|
||||
saveAs: "Сохранить как пайплайн",
|
||||
newChain: "Новый пайплайн",
|
||||
use: "Открыть",
|
||||
rename: "Переименовать",
|
||||
renameSave: "Сохранить имя",
|
||||
deleteAction: "Удалить",
|
||||
confirmDelete: "Точно?",
|
||||
nameAria: "Название пайплайна",
|
||||
},
|
||||
sourceCard: {
|
||||
source: "Источник",
|
||||
replaceImage: "Заменить изображение",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Page } from "$lib/registry";
|
||||
import { PAGES } from "../registry";
|
||||
import type { Field } from "$lib/registry-schema";
|
||||
import { getMergedDict } from "./locale.svelte";
|
||||
import { normalizeForSearch, scoreDoc, type SearchDoc } from "./matching";
|
||||
@@ -20,6 +21,12 @@ export function pageDescription(page: Page): string {
|
||||
return getMergedDict().pages?.[page.slug]?.description ?? page.description;
|
||||
}
|
||||
|
||||
/** Step title for chain UIs: the owning page title, else the raw tool id. */
|
||||
export function chainStepTitle(toolId: string): string {
|
||||
const owner = PAGES.find((p) => p.steps[0].id === toolId);
|
||||
return owner ? pageTitle(owner) : toolId;
|
||||
}
|
||||
|
||||
export function fieldLabel(field: Field<unknown>, id: string): string {
|
||||
const key = (field.spec as { label?: string }).label;
|
||||
if (key) {
|
||||
|
||||
Reference in New Issue
Block a user