feat: flatten lib/preview -> lib folder

This commit is contained in:
2026-09-10 20:15:21 +05:00
parent f8a1da6ff7
commit 1e5e096d5d
13 changed files with 10 additions and 14 deletions
@@ -1,5 +1,5 @@
import { CATEGORY_IDS } from "./categories";
import { TOOLS, type ToolEntry } from "../registry-new";
import { TOOLS, type ToolEntry } from "./registry-new";
export type PreviewGroup = {
id: string;
+1 -1
View File
@@ -5,8 +5,8 @@
import { ToolError } from "$lib/core/errors";
import { decodeFile, encode } from "$lib/core/io";
import type { PixelImage } from "$lib/core/types";
import { execute } from "$lib/executor";
import { t } from "$lib/i18n/t";
import { execute } from "$lib/preview/executor";
import type { ToolEntry } from "$lib/registry-new";
import {
defaultSchemaParams,
@@ -35,10 +35,6 @@
padding: var(--space-s) var(--space-m);
cursor: pointer;
}
.lang-div {
color: var(--color-text);
font-family: var(--font-sans);
}
.lang-btn.active {
background: var(--color-text);
color: var(--color-background);
@@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest";
import { PREVIEW_GROUPS } from "../preview/catalog";
import { PREVIEW_GROUPS } from "../catalog";
import type { PixelImage } from "../core/types";
import { TOOLS } from "../registry-new";
import { defaultSchemaParams, sanitizeSchemaParams } from "../registry-schema";
import type { PixelImage } from "../core/types";
import type { ToolResult } from "./types";
function asImage(result: ToolResult): PixelImage {
+1 -1
View File
@@ -1,7 +1,7 @@
import type { CategoryId } from "../categories";
import { ToolError } from "../core/errors";
import type { OutputMime } from "../core/io";
import type { PixelImage } from "../core/types";
import type { CategoryId } from "../preview/categories";
import type { ToolSchema } from "../registry-schema";
/** Формат скачивания, отличный от PNG (bmp/jpeg/webp). */
+2 -2
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import { PREVIEW_GROUPS, PREVIEW_TOTAL } from "$lib/catalog";
import CatalogGroup from "$lib/components/CatalogGroup.svelte";
import CatalogHeader from "$lib/components/CatalogHeader.svelte";
import CatalogToolbar from "$lib/components/CatalogToolbar.svelte";
import ToolCard from "$lib/components/ToolCard.svelte";
import { PREVIEW_GROUPS, PREVIEW_TOTAL } from "$lib/preview/catalog";
import { TOOL_ICONS } from "$lib/preview/tool-icons";
import { TOOL_ICONS } from "$lib/tool-icons";
let query = $state("");
let category = $state<string>("all");
+1 -1
View File
@@ -23,8 +23,8 @@
import Toggle from "$lib/components/ui/Toggle.svelte";
import { Download, ImageOff, Plus, Trash2 } from "@lucide/svelte";
import { TOOL_ICONS } from "$lib/preview/tool-icons";
import { TOOLS } from "$lib/registry-new";
import { TOOL_ICONS } from "$lib/tool-icons";
let mode = $state("preview");
let radius = $state(8);
+2 -2
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import { PREVIEW_GROUPS, PREVIEW_TOTAL } from "$lib/catalog";
import CatalogGroup from "$lib/components/CatalogGroup.svelte";
import CatalogHeader from "$lib/components/CatalogHeader.svelte";
import CatalogToolbar from "$lib/components/CatalogToolbar.svelte";
import ToolCard from "$lib/components/ToolCard.svelte";
import { PREVIEW_GROUPS, PREVIEW_TOTAL } from "$lib/preview/catalog";
import { TOOL_ICONS } from "$lib/preview/tool-icons";
import { TOOL_ICONS } from "$lib/tool-icons";
let query = $state("");
let category = $state<string>("all");