Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

Add interactive template gallery and live previews for infographic notes

tianma-iffa1b86a50332
diff --git a/apps/web/src/components/InfographicEditorPane.tsx b/apps/web/src/components/InfographicEditorPane.tsx
index f3790c7f..cfa1d73e 100644
--- a/apps/web/src/components/InfographicEditorPane.tsx
+++ b/apps/web/src/components/InfographicEditorPane.tsx
@@ -1,11 +1,14 @@
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
-import { Check, ChevronLeft, Download, FileCode2, FileImage, LoaderCircle, Pencil, Sparkles } from "lucide-react";
+import { Check, ChevronLeft, Download, FileCode2, FileImage, LayoutTemplate, LoaderCircle, Pencil, Sparkles } from "lucide-react";
import * as m from "motion/react-m";
import { useTranslation } from "react-i18next";
import { INFOGRAPHIC_AGENT_SOURCE_MAX_LENGTH, markdownToDoc, infographicFallbackMarkdown, parseInfographicDocument, serializeInfographicDocument, type InfographicConversationTurn, type InfographicDocument, type MemoDetail, type MemoEditSession, type Notebook } from "@edgeever/shared";
import type { Infographic as InfographicInstance, SyntaxParseResult } from "@antv/infographic";
import { Button } from "@/components/ui/button";
+import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
+import { InfographicGallery } from "./InfographicGallery";
+import type { InfographicSample } from "@/lib/infographic-samples";
import { AiSidebar, readAiSidebarOpen, writeAiSidebarOpen } from "@/components/ai-sidebar/AiSidebar";
import { AiSidebarErrorBoundary } from "@/components/ai-sidebar/AiSidebarErrorBoundary";
import type { InfographicSidebarController } from "@/components/ai-sidebar/InfographicSidebarSession";
@@ -211,6 +214,7 @@ export default function InfographicEditorPane({
const [ready, setReady] = useState(false);
const [savedSnapshot, setSavedSnapshot] = useState(JSON.stringify([memo.title ?? "", parsed?.syntax ?? "", parsed?.history ?? [], initialTags]));
const [savedHistorySnapshot, setSavedHistorySnapshot] = useState(JSON.stringify(parsed?.history ?? []));
+ const [galleryDialogOpen, setGalleryDialogOpen] = useState(false);
const [mobileNotebookSheetOpen, setMobileNotebookSheetOpen] = useState(false);
const [notebookUpdatePending, setNotebookUpdatePending] = useState(false);
const [headerTitleSlot, setHeaderTitleSlot] = useState<HTMLDivElement | null>(null);
@@ -357,6 +361,21 @@ export default function InfographicEditorPane({
setError(null);
};
+ const handleApplySample = (sample: InfographicSample, sampleSyntax: string, sampleTitle: string) => {
+ if (readOnly) return;
+ if (syntax.trim() && !window.confirm(t("infographic.galleryConfirmReplace"))) {
+ return;
+ }
+ setPreviousGeneration(null);
+ setSyntax(sampleSyntax);
+ if (!title.trim() || title.trim() === t("infographic.name")) {
+ setTitle(sampleTitle);
+ }
+ setGalleryDialogOpen(false);
+ setError(null);
+ setRenderError(null);
+ };
+
const save = async () => {
if (readOnly || saving || !dirty || !ready || !sessionRef.current) return false;
if (syntax.trim() && (renderError || !previewReady || !instanceRef.current)) {
@@ -603,6 +622,17 @@ export default function InfographicEditorPane({
<MemoEditorToolbarDivider className="mx-0.5 hidden h-4 sm:block" />
<div className="flex items-center gap-0.5">
<MemoEditorFocusModeButton desktopFocusMode={desktopFocusMode} onToggleDesktopFocusMode={onToggleDesktopFocusMode} />
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="h-8 gap-1 px-2 text-xs"
+ onClick={() => setGalleryDialogOpen(true)}
+ aria-label={t("infographic.galleryTemplatesButton")}
+ >
+ <LayoutTemplate className="h-4 w-4 text-slate-500" />
+ <span className="hidden sm:inline">{t("infographic.galleryTemplatesButton")}</span>
+ </Button>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
@@ -634,6 +664,10 @@ export default function InfographicEditorPane({
onOpenExecutionCenter={onOpenExecutionCenter}
moreMenuItems={(
<>
+ <DropdownMenuItem onClick={() => setGalleryDialogOpen(true)}>
+ <LayoutTemplate className="h-4 w-4 text-slate-500" />
+ {t("infographic.galleryTitle")}
+ </DropdownMenuItem>
<DropdownMenuItem disabled={!previewReady || Boolean(renderError)} onClick={() => void exportImage("svg")}>
<FileCode2 className="h-4 w-4 text-slate-500" />
{t("infographic.exportSvg")}
@@ -651,11 +685,20 @@ export default function InfographicEditorPane({
</header>
{error ? <p role="alert" className="border-b border-red-100 bg-red-50 px-5 py-2 text-sm text-red-700">{error}</p> : null}
<section className="min-h-0 flex-1 overflow-auto bg-slate-50 p-4">
- <div className={`relative flex min-h-full flex-col rounded-xl border border-slate-200 p-4 shadow-sm ${previewUsesLightSheet ? "bg-white" : "bg-card"}`}>
- <div ref={containerRef} className="edgeever-infographic-preview min-h-[380px] w-full flex-1" />
- {!syntax.trim() ? <p className="pointer-events-none absolute inset-0 flex items-center justify-center px-6 text-center text-sm text-muted-foreground">{t("infographic.noPreview")}</p> : null}
- {renderError ? <p role="alert" className="text-sm text-destructive">{renderError}</p> : null}
- </div>
+ {!syntax.trim() ? (
+ <div className="relative min-h-full rounded-xl border border-slate-200 bg-white p-2 sm:p-4 shadow-sm">
+ <div ref={containerRef} className="edgeever-infographic-preview hidden" />
+ <InfographicGallery
+ readOnly={readOnly}
+ onSelect={handleApplySample}
+ />
+ </div>
+ ) : (
+ <div className={`relative flex min-h-full flex-col rounded-xl border border-slate-200 p-4 shadow-sm ${previewUsesLightSheet ? "bg-white" : "bg-card"}`}>
+ <div ref={containerRef} className="edgeever-infographic-preview min-h-[380px] w-full flex-1" />
+ {renderError ? <p role="alert" className="text-sm text-destructive">{renderError}</p> : null}
+ </div>
+ )}
</section>
{!readOnly && !aiAssistantOpen ? (
<IconTooltip
@@ -688,5 +731,18 @@ export default function InfographicEditorPane({
infographic={infographicAssistant}
/>
</AiSidebarErrorBoundary>
+ <Dialog open={galleryDialogOpen} onOpenChange={setGalleryDialogOpen}>
+ <DialogContent className="max-w-5xl max-h-[85vh] overflow-y-auto p-4 sm:p-6">
+ <DialogHeader className="sr-only">
+ <DialogTitle>{t("infographic.galleryTitle")}</DialogTitle>
+ <DialogDescription>{t("infographic.galleryTitle")}</DialogDescription>
+ </DialogHeader>
+ <InfographicGallery
+ readOnly={readOnly}
+ isDialog
+ onSelect={handleApplySample}
+ />
+ </DialogContent>
+ </Dialog>
</div>;
}
diff --git a/apps/web/src/components/InfographicGallery.test.mjs b/apps/web/src/components/InfographicGallery.test.mjs
new file mode 100644
index 00000000..5a606881
--- /dev/null
+++ b/apps/web/src/components/InfographicGallery.test.mjs
@@ -0,0 +1,70 @@
+import { describe, expect, test } from "bun:test";
+import { readFileSync } from "node:fs";
+import { parseSyntax } from "@antv/infographic";
+import {
+ INFOGRAPHIC_SAMPLE_CATEGORIES,
+ INFOGRAPHIC_SAMPLES,
+ getSampleDesc,
+ getSampleSyntax,
+ getSampleTitle,
+} from "../lib/infographic-samples";
+
+const editorPaneSource = readFileSync(new URL("./InfographicEditorPane.tsx", import.meta.url), "utf8");
+const gallerySource = readFileSync(new URL("./InfographicGallery.tsx", import.meta.url), "utf8");
+
+describe("infographic gallery samples", () => {
+ test("covers all 7 AntV template categories with curated samples", () => {
+ const categories = new Set(INFOGRAPHIC_SAMPLES.map((s) => s.category));
+ expect(categories.has("sequence")).toBe(true);
+ expect(categories.has("compare")).toBe(true);
+ expect(categories.has("list")).toBe(true);
+ expect(categories.has("quadrant")).toBe(true);
+ expect(categories.has("hierarchy")).toBe(true);
+ expect(categories.has("relation")).toBe(true);
+ expect(categories.has("chart")).toBe(true);
+ expect(INFOGRAPHIC_SAMPLE_CATEGORIES.length).toBe(7);
+ });
+
+ test("all Chinese sample syntaxes parse cleanly without errors", () => {
+ for (const sample of INFOGRAPHIC_SAMPLES) {
+ const parsed = parseSyntax(sample.syntaxZh);
+ expect(parsed.errors.length).toBe(0);
+ expect(parsed.options.template).toBe(sample.template);
+ }
+ });
+
+ test("all English sample syntaxes parse cleanly without errors", () => {
+ for (const sample of INFOGRAPHIC_SAMPLES) {
+ const parsed = parseSyntax(sample.syntaxEn);
+ expect(parsed.errors.length).toBe(0);
+ expect(parsed.options.template).toBe(sample.template);
+ }
+ });
+
+ test("multilingual helper methods return appropriate localized content", () => {
+ const sample = INFOGRAPHIC_SAMPLES[0];
+ expect(getSampleTitle(sample, "zh-CN")).toBe(sample.titleZh);
+ expect(getSampleTitle(sample, "en-US")).toBe(sample.titleEn);
+ expect(getSampleTitle(sample, "ja")).toBe(sample.titleJa ?? sample.titleEn);
+
+ expect(getSampleSyntax(sample, "zh-CN")).toBe(sample.syntaxZh);
+ expect(getSampleSyntax(sample, "en-US")).toBe(sample.syntaxEn);
+
+ expect(getSampleDesc(sample, "zh-CN")).toBe(sample.descZh);
+ expect(getSampleDesc(sample, "en-US")).toBe(sample.descEn);
+ });
+});
+
+describe("infographic editor gallery integration", () => {
+ test("renders InfographicGallery in empty canvas state and provides toolbar gallery trigger without leaking technical branding", () => {
+ expect(editorPaneSource).toContain("<InfographicGallery");
+ expect(editorPaneSource).toContain("handleApplySample");
+ expect(editorPaneSource).toContain('t("infographic.galleryTemplatesButton")');
+ expect(gallerySource).toContain("data-infographic-gallery");
+ expect(gallerySource).toContain("data-infographic-sample-card");
+ expect(gallerySource).toContain("data-infographic-card-preview");
+ expect(gallerySource).not.toContain("https://infographic.antv.vision/gallery");
+ expect(gallerySource).not.toContain("sample.template");
+ expect(gallerySource).not.toContain("AntV Infographic");
+ });
+});
diff --git a/apps/web/src/components/InfographicGallery.tsx b/apps/web/src/components/InfographicGallery.tsx
new file mode 100644
index 00000000..8cd77d63
--- /dev/null
+++ b/apps/web/src/components/InfographicGallery.tsx
@@ -0,0 +1,315 @@
+import { useEffect, useMemo, useRef, useState } from "react";
+import { useTranslation } from "react-i18next";
+import {
+ ArrowRight,
+ ArrowRightLeft,
+ BarChart3,
+ Compass,
+ GitFork,
+ Layers,
+ Milestone,
+ Network,
+ Search,
+ X,
+} from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import {
+ INFOGRAPHIC_SAMPLE_CATEGORIES,
+ INFOGRAPHIC_SAMPLES,
+ getSampleDesc,
+ getSampleSyntax,
+ getSampleTitle,
+ type InfographicSample,
+ type InfographicSampleCategory,
+} from "@/lib/infographic-samples";
+import { cn } from "@/lib/utils";
+
+type Props = {
+ onSelect: (sample: InfographicSample, syntax: string, title: string) => void;
+ readOnly?: boolean;
+ className?: string;
+ isDialog?: boolean;
+};
+
+function InfographicCardPreview({ syntax }: { syntax: string }) {
+ const containerRef = useRef<HTMLDivElement>(null);
+ const rootRef = useRef<HTMLDivElement>(null);
+ const [isVisible, setIsVisible] = useState(false);
+ const [ready, setReady] = useState(false);
+
+ useEffect(() => {
+ const el = rootRef.current;
+ if (!el || isVisible) return;
+ if (typeof IntersectionObserver === "undefined") {
+ setIsVisible(true);
+ return;
+ }
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (entries.some((e) => e.isIntersecting)) {
+ setIsVisible(true);
+ observer.disconnect();
+ }
+ },
+ { rootMargin: "150px" }
+ );
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [isVisible]);
+
+ useEffect(() => {
+ if (!isVisible) return;
+ let cancelled = false;
+ let instance: { render: (s: string) => void; destroy: () => void } | null = null;
+
+ void import("@antv/infographic").then(({ Infographic }) => {
+ if (cancelled || !containerRef.current) return;
+ try {
+ instance = new Infographic({
+ container: containerRef.current,
+ width: "100%",
+ height: "100%",
+ padding: 16,
+ editable: false,
+ svg: { style: { width: "100%", height: "100%", maxHeight: "100%", display: "block" } },
+ });
+ instance.render(syntax);
+ if (!cancelled) setReady(true);
+ } catch (err) {
+ console.error("Failed to render card preview", err);
+ }
+ });
+
+ return () => {
+ cancelled = true;
+ try {
+ instance?.destroy();
+ } catch {}
+ };
+ }, [isVisible, syntax]);
+
+ return (
+ <div
+ ref={rootRef}
+ className="relative w-full aspect-[16/10] overflow-hidden rounded-lg bg-slate-50/80 border border-slate-100 flex items-center justify-center group-hover:bg-white transition-colors"
+ data-infographic-card-preview=""
+ >
+ <div
+ ref={containerRef}
+ className={cn(
+ "w-full h-full pointer-events-none flex items-center justify-center p-1.5 transition-opacity duration-200",
+ ready ? "opacity-100" : "opacity-0",
+ "[&_svg]:max-w-full [&_svg]:max-h-full [&_svg]:w-auto [&_svg]:h-auto [&_svg]:mx-auto [&_svg]:object-contain"
+ )}
+ />
+ {!ready && (
+ <div className="absolute inset-0 flex items-center justify-center bg-slate-50/60">
+ <div className="h-5 w-20 rounded bg-slate-200/60 animate-pulse" />
+ </div>
+ )}
+ </div>
+ );
+}
+
+const CATEGORY_ICONS: Record<InfographicSampleCategory, React.ComponentType<{ className?: string }>> = {
+ sequence: Milestone,
+ compare: ArrowRightLeft,
+ list: Layers,
+ quadrant: Compass,
+ hierarchy: GitFork,
+ relation: Network,
+ chart: BarChart3,
+};
+
+const CATEGORY_COLORS: Record<
+ InfographicSampleCategory,
+ { bg: string; text: string; border: string; badge: string }
+> = {
+ sequence: { bg: "bg-emerald-50", text: "text-emerald-700", border: "border-emerald-200", badge: "bg-emerald-100/70 text-emerald-800" },
+ compare: { bg: "bg-sky-50", text: "text-sky-700", border: "border-sky-200", badge: "bg-sky-100/70 text-sky-800" },
+ list: { bg: "bg-violet-50", text: "text-violet-700", border: "border-violet-200", badge: "bg-violet-100/70 text-violet-800" },
+ quadrant: { bg: "bg-amber-50", text: "text-amber-700", border: "border-amber-200", badge: "bg-amber-100/70 text-amber-800" },
+ hierarchy: { bg: "bg-indigo-50", text: "text-indigo-700", border: "border-indigo-200", badge: "bg-indigo-100/70 text-indigo-800" },
+ relation: { bg: "bg-teal-50", text: "text-teal-700", border: "border-teal-200", badge: "bg-teal-100/70 text-teal-800" },
+ chart: { bg: "bg-rose-50", text: "text-rose-700", border: "border-rose-200", badge: "bg-rose-100/70 text-rose-800" },
+};
+
+export function InfographicGallery({ onSelect, readOnly = false, className, isDialog = false }: Props) {
+ const { t, i18n } = useTranslation();
+ const lang = i18n.resolvedLanguage ?? "zh-CN";
+ const [selectedCategory, setSelectedCategory] = useState<InfographicSampleCategory | "all">("all");
+ const [searchQuery, setSearchQuery] = useState("");
+
+ const filteredSamples = useMemo(() => {
+ const q = searchQuery.trim().toLowerCase();
+ return INFOGRAPHIC_SAMPLES.filter((sample) => {
+ if (selectedCategory !== "all" && sample.category !== selectedCategory) {
+ return false;
+ }
+ if (!q) return true;
+ const title = getSampleTitle(sample, lang).toLowerCase();
+ const desc = getSampleDesc(sample, lang).toLowerCase();
+ return title.includes(q) || desc.includes(q);
+ });
+ }, [selectedCategory, searchQuery, lang]);
+
+ const handleSelectSample = (sample: InfographicSample) => {
+ if (readOnly) return;
+ const syntax = getSampleSyntax(sample, lang);
+ const title = getSampleTitle(sample, lang);
+ onSelect(sample, syntax, title);
+ };
+
+ return (
+ <div className={cn("flex flex-col gap-4", isDialog ? "p-1" : "mx-auto max-w-6xl p-4 sm:p-6", className)} data-infographic-gallery="">
+ {/* Header section */}
+ <div>
+ <h2 className="text-lg font-bold text-slate-900 tracking-tight sm:text-xl">
+ {t("infographic.galleryTitle")}
+ </h2>
+ </div>
+
+ {/* Filter and search bar */}
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
+ {/* Category tabs */}
+ <div className="flex flex-wrap items-center gap-1.5 overflow-x-auto py-0.5">
+ <button
+ type="button"
+ onClick={() => setSelectedCategory("all")}
+ className={cn(
+ "rounded-full px-3 py-1 text-xs font-medium transition-colors",
+ selectedCategory === "all"
+ ? "bg-slate-900 text-white shadow-sm"
+ : "bg-slate-100 text-slate-600 hover:bg-slate-200 hover:text-slate-900"
+ )}
+ >
+ {t("infographic.galleryCategoryAll")} ({INFOGRAPHIC_SAMPLES.length})
+ </button>
+ {INFOGRAPHIC_SAMPLE_CATEGORIES.map((cat) => {
+ const count = INFOGRAPHIC_SAMPLES.filter((s) => s.category === cat.id).length;
+ const active = selectedCategory === cat.id;
+ return (
+ <button
+ key={cat.id}
+ type="button"
+ onClick={() => setSelectedCategory(cat.id)}
+ className={cn(
+ "rounded-full px-3 py-1 text-xs font-medium transition-colors",
+ active
+ ? "bg-slate-900 text-white shadow-sm"
+ : "bg-slate-100 text-slate-600 hover:bg-slate-200 hover:text-slate-900"
+ )}
+ >
+ {t(`infographic.${cat.key}`)} ({count})
+ </button>
+ );
+ })}
+ </div>
+
+ {/* Search input */}
+ <div className="relative min-w-[200px] max-w-xs shrink-0">
+ <Search className="absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" />
+ <Input
+ value={searchQuery}
+ onChange={(e) => setSearchQuery(e.target.value)}
+ placeholder={t("infographic.gallerySearchPlaceholder")}
+ className="h-8 pl-8 pr-7 text-xs bg-white"
+ />
+ {searchQuery ? (
+ <button
+ type="button"
+ onClick={() => setSearchQuery("")}
+ className="absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600"
+ >
+ <X className="h-3.5 w-3.5" />
+ </button>
+ ) : null}
+ </div>
+ </div>
+
+ {/* Grid of sample cards */}
+ {filteredSamples.length === 0 ? (
+ <div className="flex flex-col items-center justify-center rounded-xl border border-dashed border-slate-200 bg-white/50 py-12 text-center">
+ <p className="text-sm text-slate-500">{t("infographic.noPreview")}</p>
+ </div>
+ ) : (
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
+ {filteredSamples.map((sample) => {
+ const Icon = CATEGORY_ICONS[sample.category] ?? Milestone;
+ const theme = CATEGORY_COLORS[sample.category] ?? CATEGORY_COLORS.sequence;
+ const title = getSampleTitle(sample, lang);
+ const desc = getSampleDesc(sample, lang);
+ const catObj = INFOGRAPHIC_SAMPLE_CATEGORIES.find((c) => c.id === sample.category);
+ const catLabel = catObj ? t(`infographic.${catObj.key}`) : sample.category;
+
+ return (
+ <div
+ key={sample.id}
+ role="button"
+ tabIndex={readOnly ? -1 : 0}
+ onClick={() => handleSelectSample(sample)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" || e.key === " ") {
+ e.preventDefault();
+ handleSelectSample(sample);
+ }
+ }}
+ className={cn(
+ "group relative flex flex-col justify-between rounded-xl border border-slate-200/90 bg-white p-4 shadow-sm transition-all duration-150 text-left",
+ readOnly
+ ? "opacity-75 cursor-default"
+ : "cursor-pointer hover:-translate-y-0.5 hover:border-emerald-500/80 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500"
+ )}
+ data-infographic-sample-card={sample.id}
+ >
+ <div className="space-y-3">
+ {/* Visual Preview */}
+ <InfographicCardPreview syntax={getSampleSyntax(sample, lang)} />
+
+ {/* Top bar with category badge */}
+ <div className="flex items-center justify-between gap-2">
+ <span
+ className={cn(
+ "inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[11px] font-semibold tracking-wide",
+ theme.badge
+ )}
+ >
+ <Icon className="h-3 w-3" />
+ <span>{catLabel}</span>
+ </span>
+ </div>
+
+ {/* Title and description */}
+ <div className="space-y-1">
+ <h3 className="text-sm font-semibold text-slate-900 group-hover:text-emerald-700 transition-colors">
+ {title}
+ </h3>
+ <p className="text-xs text-slate-500 line-clamp-2 leading-relaxed">
+ {desc}
+ </p>
+ </div>
+ </div>
+
+ {/* Bottom action trigger */}
+ <div className="mt-4 flex items-center justify-end border-t border-slate-100 pt-3 text-xs">
+ <span
+ className={cn(
+ "inline-flex items-center gap-1 font-medium text-xs transition-colors",
+ readOnly
+ ? "text-slate-400"
+ : "text-slate-600 group-hover:text-emerald-600"
+ )}
+ >
+ <span>{t("infographic.galleryUseSample")}</span>
+ <ArrowRight className="h-3 w-3 transition-transform group-hover:translate-x-0.5" />
+ </span>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/apps/web/src/lib/infographic-samples.ts b/apps/web/src/lib/infographic-samples.ts
new file mode 100644
index 00000000..158a3b88
--- /dev/null
+++ b/apps/web/src/lib/infographic-samples.ts
@@ -0,0 +1,650 @@
+export type InfographicSampleCategory =
+ | "sequence"
+ | "compare"
+ | "list"
+ | "quadrant"
+ | "hierarchy"
+ | "relation"
+ | "chart";
+
+export type InfographicSample = {
+ id: string;
+ category: InfographicSampleCategory;
+ template: string;
+ titleZh: string;
+ titleEn: string;
+ titleJa?: string;
+ descZh: string;
+ descEn: string;
+ descJa?: string;
+ syntaxZh: string;
+ syntaxEn: string;
+};
+
+export const INFOGRAPHIC_SAMPLE_CATEGORIES: Array<{
+ id: InfographicSampleCategory;
+ key: string;
+ labelZh: string;
+ labelEn: string;
+ labelJa: string;
+}> = [
+ { id: "sequence", key: "sequenceCategory", labelZh: "顺序 / 流程", labelEn: "Sequence", labelJa: "順序・工程" },
+ { id: "compare", key: "comparisonCategory", labelZh: "对比 / SWOT", labelEn: "Comparison", labelJa: "比較・SWOT" },
+ { id: "list", key: "listCategory", labelZh: "列表 / 金字塔", labelEn: "List", labelJa: "リスト" },
+ { id: "quadrant", key: "quadrantCategory", labelZh: "四象限矩阵", labelEn: "Quadrant", labelJa: "四象限" },
+ { id: "hierarchy", key: "hierarchyCategory", labelZh: "层级 / 脑图", labelEn: "Hierarchy", labelJa: "階層・マインドマップ" },
+ { id: "relation", key: "relationCategory", labelZh: "关系拓扑", labelEn: "Relation", labelJa: "関係ネットワーク" },
+ { id: "chart", key: "chartCategory", labelZh: "统计图表", labelEn: "Chart", labelJa: "チャート" },
+];
+
+export const INFOGRAPHIC_SAMPLES: InfographicSample[] = [
+ // 1. sequence
+ {
+ id: "sequence-steps",
+ category: "sequence",
+ template: "sequence-steps-simple",
+ titleZh: "产品研发全周期流程",
+ titleEn: "Product Development Lifecycle",
+ titleJa: "製品開発ライフサイクル",
+ descZh: "从需求分析到上线发布的标准敏捷研发流程",
+ descEn: "Standard agile workflow from discovery to deployment",
+ descJa: "要件定義からリリースまでの標準アジャイル開発フロー",
+ syntaxZh: `infographic sequence-steps-simple
+data
+ title 产品研发全周期流程
+ desc 从需求调研到交付上线的关键阶段
+ sequences
+ - label 需求分析
+ desc 收集用户反馈与商业目标规划
+ - label 原型设计
+ desc 交互界面与用户体验方案输出
+ - label 敏捷研发
+ desc 前后端核心功能模块编码实现
+ - label 质量验证
+ desc 自动化测试与全链路回归演练
+ - label 发布上线
+ desc 灰度放量与生产环境监控护航`,
+ syntaxEn: `infographic sequence-steps-simple
+data
+ title Product Development Lifecycle
+ desc Key stages from discovery to production launch
+ sequences
+ - label Discovery & Specs
+ desc Gather user feedback and define key requirements
+ - label UI & Prototype
+ desc Design user flows and high-fidelity mockups
+ - label Agile Sprint
+ desc Full-stack engineering and feature implementation
+ - label Quality Assurance
+ desc Automated tests, regression audits, and performance checks
+ - label Production Release
+ desc Phased rollout and real-time observability`,
+ },
+ {
+ id: "sequence-timeline",
+ category: "sequence",
+ template: "sequence-timeline-done-list",
+ titleZh: "企业发展关键里程碑",
+ titleEn: "Company Milestones Timeline",
+ titleJa: "企業の主要マイルストーン",
+ descZh: "记录团队从创立到规模化的关键跃迁时刻",
+ descEn: "Key turning points from inception to scale",
+ descJa: "創業からスケール期までの重要マイルストーン",
+ syntaxZh: `infographic sequence-timeline-done-list
+data
+ title 企业发展关键里程碑
+ desc 记录团队从创立到规模化的关键跃迁
+ sequences
+ - label 2022 年初创成立
+ desc 核心创始团队组建,完成天使轮融资
+ - label 2023 产品 1.0 发布
+ desc 突破首批 10,000 名种子活跃用户
+ - label 2024 商业化落地
+ desc 上线企业级协同能力,实现自负盈亏
+ - label 2025 全球化出海
+ desc 布局多语言与跨国合规部署架构`,
+ syntaxEn: `infographic sequence-timeline-done-list
+data
+ title Company Milestones Timeline
+ desc Key turning points from inception to scale
+ sequences
+ - label 2022 Founding
+ desc Core team assembled and seed round completed
+ - label 2023 Product 1.0
+ desc Surpassed first 10,000 active users
+ - label 2024 Monetization
+ desc Enterprise collaboration launched with break-even revenue
+ - label 2025 Global Expansion
+ desc Multi-region compliance and localized deployments`,
+ },
+ {
+ id: "sequence-roadmap",
+ category: "sequence",
+ template: "sequence-roadmap-vertical-simple",
+ titleZh: "技术架构演进路线图",
+ titleEn: "Architecture Evolution Roadmap",
+ titleJa: "技術アーキテクチャのロードマップ",
+ descZh: "基础设施升级与云原生转型的演进路径",
+ descEn: "Infrastructure modernization and cloud-native journey",
+ descJa: "インフラ刷新とクラウドネイティブ化の歩み",
+ syntaxZh: `infographic sequence-roadmap-vertical-simple
+data
+ title 技术架构演进路线图
+ desc 基础设施升级与云原生转型的演进路径
+ sequences
+ - label 阶段一:单体解耦
+ desc 拆分核心数据模型,建立统一领域服务接口
+ - label 阶段二:容器编排
+ desc 全面接入 Kubernetes,实现声明式部署与调度
+ - label 阶段三:服务网格
+ desc 引入 Istio 网格,实现精细化流量治理与可观测性
+ - label 阶段四:智能运维
+ desc 结合大模型与日志度量,落地自愈式巡检告警`,
+ syntaxEn: `infographic sequence-roadmap-vertical-simple
+data
+ title Architecture Evolution Roadmap
+ desc Infrastructure modernization and cloud-native journey
+ sequences
+ - label Phase 1: Modular Monolith
+ desc Decouple core domain models and define clean contracts
+ - label Phase 2: Containerization
+ desc Adopt Kubernetes for declarative deployments and scaling
+ - label Phase 3: Service Mesh
+ desc Introduce Istio for traffic control and fine-grained telemetry
+ - label Phase 4: AIOps Automation
+ desc Autonomous anomaly detection and self-healing alerts`,
+ },
+
+ // 2. compare
+ {
+ id: "compare-vs",
+ category: "compare",
+ template: "compare-binary-horizontal-compact-card-vs",
+ titleZh: "云原生与传统部署对比",
+ titleEn: "Cloud-Native vs Traditional Hosting",
+ titleJa: "クラウドネイティブと従来運用の比較",
+ descZh: "架构灵活性与运维成本的深度权衡分析",
+ descEn: "Architectural agility and infrastructure cost trade-offs",
+ descJa: "拡張性と運用コストの包括的な比較分析",
+ syntaxZh: `infographic compare-binary-horizontal-compact-card-vs
+data
+ title 云原生与传统部署对比
+ desc 架构灵活性与运维成本的全面权衡
+ compares
+ - label 传统物理部署
+ desc 依赖固定机房资产与人工维护
+ children
+ - label 弹性扩展
+ desc 扩容周期通常需要数周甚至数月
+ - label 资源利用率
+ desc 峰谷波动大,服务器平均闲置率高
+ - label 运维复杂度
+ desc 人工巡检部署,故障恢复时间较长
+ - label 云原生架构
+ desc 容器化编排与按需弹性扩缩容
+ children
+ - label 弹性扩展
+ desc 秒级自动伸缩,轻松应对突发流量
+ - label 资源利用率
+ desc 多租户动态调度,整体成本优化 40%
+ - label 运维复杂度
+ desc CI/CD 自动化流水线与自愈式监控`,
+ syntaxEn: `infographic compare-binary-horizontal-compact-card-vs
+data
+ title Cloud-Native vs Traditional Hosting
+ desc Architectural agility and infrastructure cost trade-offs
+ compares
+ - label Traditional Dedicated Server
+ desc Fixed on-premise hardware and manual maintenance
+ children
+ - label Scalability
+ desc Provisioning new hardware takes weeks or months
+ - label Resource Utilization
+ desc Peak-provisioned servers sit idle most of the day
+ - label Operational Overhead
+ desc Manual patching and slower disaster recovery
+ - label Cloud-Native Platform
+ desc Containerized orchestration with on-demand autoscaling
+ children
+ - label Scalability
+ desc Sub-second auto-scaling handles traffic spikes seamlessly
+ - label Resource Utilization
+ desc Dynamic multi-tenant scheduling cuts infrastructure cost 40%
+ - label Operational Overhead
+ desc Automated CI/CD pipelines and self-healing nodes`,
+ },
+ {
+ id: "compare-swot",
+ category: "compare",
+ template: "compare-swot",
+ titleZh: "产品战略 SWOT 分析",
+ titleEn: "Strategic SWOT Analysis",
+ titleJa: "製品戦略の SWOT 分析",
+ descZh: "全面审视内部优劣势与外部市场机遇威胁",
+ descEn: "Internal strengths/weaknesses and external market opportunities/threats",
+ descJa: "内部の強み・弱みと外部の機会・脅威の網羅分析",
+ syntaxZh: `infographic compare-swot
+data
+ title 产品战略 SWOT 分析
+ desc 全面审视内部优劣势与外部市场环境
+ compares
+ - label 优势 (Strengths)
+ children
+ - label 核心专利技术壁垒
+ desc 拥有业内领先的离线协同与加密算法
+ - label 敏捷响应能力
+ desc 团队扁平,两周一次稳定迭代演进
+ - label 劣势 (Weaknesses)
+ children
+ - label 品牌知名度有限
+ desc 市场拓展初期,整体认知度仍在积累
+ - label 移动端覆盖刚起步
+ desc 部分跨平台高级交互仍在完善中
+ - label 机会 (Opportunities)
+ children
+ - label 远程与混合办公普及
+ desc 全球知识管理协同工具需求持续增长
+ - label AI Agent 生态蓬勃
+ desc 与大模型协同工作流带来全新爆发点
+ - label 威胁 (Threats)
+ children
+ - label 头部大厂生态挤压
+ desc 巨头免费捆绑分发带来的竞争压力
+ - label 数据合规监管趋严
+ desc 全球各地区合规成本与审查风险上升`,
+ syntaxEn: `infographic compare-swot
+data
+ title Strategic SWOT Analysis
+ desc Internal strengths/weaknesses and external market environment
+ compares
+ - label Strengths
+ children
+ - label Proprietary Tech
+ desc Industry-leading offline-first sync algorithms
+ - label Rapid Execution
+ desc Flat engineering team with bi-weekly stable releases
+ - label Weaknesses
+ children
+ - label Brand Awareness
+ desc Early stage market presence still expanding
+ - label Mobile Parity
+ desc Advanced cross-platform interactions still maturing
+ - label Opportunities
+ children
+ - label Remote Collaboration
+ desc Global demand for lightweight self-hosted knowledge bases
+ - label AI Agent Ecosystem
+ desc Model Context Protocol unlocks novel assistant workflows
+ - label Threats
+ children
+ - label Incumbent Bundling
+ desc Big-tech suites offering free bundled alternatives
+ - label Compliance Complexity
+ desc Stricter multi-region data residency and audits`,
+ },
+ {
+ id: "compare-arrow",
+ category: "compare",
+ template: "compare-binary-horizontal-simple-arrow",
+ titleZh: "工程体系重构演进",
+ titleEn: "Engineering Workflow Evolution",
+ titleJa: "エンジニアリング体系の進化",
+ descZh: "从传统手工操作升级为现代高度自动化流程",
+ descEn: "Transition from manual operations to modern automated workflows",
+ descJa: "手動オペレーションから自動化パイプラインへの進化",
+ syntaxZh: `infographic compare-binary-horizontal-simple-arrow
+data
+ title 工程体系重构演进
+ desc 从传统手工操作升级为现代高度自动化流程
+ compares
+ - label 过去:手工碎片化
+ desc 依赖人工执行脚本与零散文档传递
+ children
+ - label 交付节奏
+ desc 每月一次集中发布,风险积聚
+ - label 质量门槛
+ desc 依赖人工点工测试,漏测率高
+ - label 现在:持续自动化
+ desc 代码提交即触发完整验证流水线
+ children
+ - label 交付节奏
+ desc 每日主干集成,随时可发布生产
+ - label 质量门槛
+ desc 90% 自动化测试覆盖与分支保护`,
+ syntaxEn: `infographic compare-binary-horizontal-simple-arrow
+data
+ title Engineering Workflow Evolution
+ desc Transition from manual tasks to fully automated pipelines
+ compares
+ - label Legacy: Manual & Fragmented
+ desc Ad-hoc scripts and tribal knowledge
+ children
+ - label Release Cadence
+ desc Monthly batch releases with accumulated risk
+ - label Quality Gate
+ desc Manual QA passes with high escape rates
+ - label Modern: Continuous & Automated
+ desc Git push triggers end-to-end verification
+ children
+ - label Release Cadence
+ desc Trunk-based development deployable anytime
+ - label Quality Gate
+ desc 90% test coverage with automated branch protection`,
+ },
+
+ // 3. list
+ {
+ id: "list-grid",
+ category: "list",
+ template: "list-grid-simple",
+ titleZh: "团队高效协同五大原则",
+ titleEn: "Team Collaboration Principles",
+ titleJa: "チーム協調の 5 大原則",
+ descZh: "打造透明、自驱、可预测的高效工程文化",
+ descEn: "Fostering a transparent, autonomous, and predictable culture",
+ descJa: "自律的で予測可能な高効率エンジニアリング文化",
+ syntaxZh: `infographic list-grid-simple
+data
+ title 团队高效协同五大原则
+ desc 打造透明、自驱、可预测的工程文化
+ lists
+ - label 异步优先
+ desc 完整记录决策上下文,减少打断式即时会议
+ - label 文档即代码
+ desc 核心架构与规范以 Markdown 纳管审查
+ - label 小步快跑
+ desc 频繁合并短生命周期分支,降低集成风险
+ - label 自动化验证
+ desc 单元测试与端到端回归门禁拦截潜在缺陷
+ - label 结果导向
+ desc 聚焦交付价值与用户体验,避免形式主义`,
+ syntaxEn: `infographic list-grid-simple
+data
+ title Team Collaboration Principles
+ desc Fostering a transparent, autonomous, and predictable culture
+ lists
+ - label Async First
+ desc Document decisions clearly to minimize disruptive meetings
+ - label Docs as Code
+ desc Core architecture and standards reviewed in Markdown
+ - label Small Iterations
+ desc Merge short-lived branches frequently to derisk integration
+ - label Automated Verification
+ desc Strict unit and integration gates catch regressions early
+ - label Value Focused
+ desc Prioritize user outcome and polish over bureaucracy`,
+ },
+ {
+ id: "list-pyramid",
+ category: "list",
+ template: "list-pyramid-compact-card",
+ titleZh: "DIKW 知识层级金字塔",
+ titleEn: "DIKW Knowledge Hierarchy",
+ titleJa: "DIKW ピラミッドモデル",
+ descZh: "从原始事实到深刻见解的认知跃升模型",
+ descEn: "Cognitive progression from raw facts to actionable wisdom",
+ descJa: "データから知恵への認知の階層的ステップ",
+ syntaxZh: `infographic list-pyramid-compact-card
+data
+ title DIKW 知识层级金字塔
+ desc 从原始事实到深刻见解的认知跃升模型
+ lists
+ - label 智慧 (Wisdom)
+ desc 洞察未来趋势与深层本质的决策力
+ - label 知识 (Knowledge)
+ desc 经验积累、思维模型与实践方法论
+ - label 信息 (Information)
+ desc 结构化整理、具备上下文的数据集合
+ - label 数据 (Data)
+ desc 未经加工的原始事实与客观记录`,
+ syntaxEn: `infographic list-pyramid-compact-card
+data
+ title DIKW Knowledge Hierarchy
+ desc Cognitive progression from raw facts to actionable wisdom
+ lists
+ - label Wisdom
+ desc Foresight, strategic clarity, and principled judgment
+ - label Knowledge
+ desc Contextual understanding, mental models, and expertise
+ - label Information
+ desc Structured, organized, and relational data points
+ - label Data
+ desc Objective facts, signals, and raw observations`,
+ },
+
+ // 4. quadrant
+ {
+ id: "quadrant-matrix",
+ category: "quadrant",
+ template: "compare-quadrant-quarter-simple-card",
+ titleZh: "时间管理四象限法则",
+ titleEn: "Eisenhower Priority Matrix",
+ titleJa: "時間管理のマトリクス",
+ descZh: "按重要性与紧迫性科学分配精力与优先级",
+ descEn: "Allocate focus and bandwidth by importance and urgency",
+ descJa: "重要度と緊急度で優先順位を整理する枠組み",
+ syntaxZh: `infographic compare-quadrant-quarter-simple-card
+data
+ title 时间管理四象限法则
+ desc 按重要性与紧急性科学规划工作重心
+ compares
+ - label 第一象限:重要且紧急
+ desc 危机突发事件、紧急生产事故与临近截期的核心交付
+ - label 第二象限:重要不紧急
+ desc 长期战略规划、技术重构、深度学习与身心健康建设
+ - label 第三象限:紧急不重要
+ desc 突发临时打断、次要琐事与非必要的即时沟通
+ - label 第四象限:不重要不紧急
+ desc 无效社交闲聊、过度刷屏消遣与低价值重复劳动`,
+ syntaxEn: `infographic compare-quadrant-quarter-simple-card
+data
+ title Eisenhower Priority Matrix
+ desc Allocate focus and bandwidth by importance and urgency
+ compares
+ - label Q1: Urgent & Important
+ desc Production crises, hard deadlines, and pressing issues
+ - label Q2: Not Urgent but Important
+ desc Strategic planning, refactoring, learning, and self-care
+ - label Q3: Urgent but Not Important
+ desc Unplanned interruptions, trivial requests, and busywork
+ - label Q4: Not Urgent & Not Important
+ desc Distractions, mindless browsing, and low-value tasks`,
+ },
+
+ // 5. hierarchy
+ {
+ id: "hierarchy-mindmap",
+ category: "hierarchy",
+ template: "hierarchy-mindmap-branch-gradient-lined-palette",
+ titleZh: "现代 Web 全栈技术体系",
+ titleEn: "Modern Web Architecture",
+ titleJa: "モダン Web フルスタック体系",
+ descZh: "现代化 Web 应用各层级核心组件与选型参考",
+ descEn: "Core technical components of modern web applications",
+ descJa: "モダン Web アプリケーションの要素と技術選定",
+ syntaxZh: `infographic hierarchy-mindmap-branch-gradient-lined-palette
+data
+ title 现代 Web 全栈技术体系
+ desc 现代化 Web 应用各层级核心选型
+ root
+ label 全栈技术体系
+ children
+ - label 前端运行时
+ desc React / Vite 响应式交互
+ - label 服务端逻辑
+ desc Hono / Cloudflare Workers
+ - label 存储与缓存
+ desc D1 SQLite / R2 对象存储
+ - label 智能体协同
+ desc Model Context Protocol`,
+ syntaxEn: `infographic hierarchy-mindmap-branch-gradient-lined-palette
+data
+ title Modern Web Architecture
+ desc Core technical components of modern web applications
+ root
+ label Full-Stack Stack
+ children
+ - label Frontend Layer
+ desc React & Vite reactive interfaces
+ - label Backend Services
+ desc Hono on edge serverless runtime
+ - label Storage Layer
+ desc D1 SQLite & R2 object storage
+ - label AI Synergy
+ desc Model Context Protocol tools`,
+ },
+
+ // 6. relation
+ {
+ id: "relation-network",
+ category: "relation",
+ template: "relation-network-simple-circle-node",
+ titleZh: "分布式服务拓扑网络",
+ titleEn: "Distributed Microservice Mesh",
+ titleJa: "分散サービス・トポロジー",
+ descZh: "微服务间调用关系与数据流动链路可视化",
+ descEn: "Invocations and data pipelines between core services",
+ descJa: "マイクロサービス間の連携とデータフロー",
+ syntaxZh: `infographic relation-network-simple-circle-node
+data
+ title 分布式服务拓扑网络
+ desc API 网关与后端核心微服务调用链路
+ nodes
+ - id gateway
+ label 统一 API 网关
+ desc 流量调度与鉴权中心
+ - id auth
+ label 统一认证服务
+ desc JWT 校验与权限模型
+ - id note
+ label 笔记核心服务
+ desc 内容版本控制与元数据
+ - id sync
+ label 同步引擎服务
+ desc 离线游标与协同合并
+ relations
+ - from gateway
+ to auth
+ - from gateway
+ to note
+ - from note
+ to sync`,
+ syntaxEn: `infographic relation-network-simple-circle-node
+data
+ title Distributed Microservice Mesh
+ desc Invocations and data pipelines between core services
+ nodes
+ - id gateway
+ label API Gateway
+ desc Ingress routing and TLS termination
+ - id auth
+ label Auth Service
+ desc Token validation and RBAC enforcement
+ - id note
+ label Note Core
+ desc Content revision engine and SQLite storage
+ - id sync
+ label Sync Engine
+ desc Offline cursors and conflict resolution
+ relations
+ - from gateway
+ to auth
+ - from gateway
+ to note
+ - from note
+ to sync`,
+ },
+
+ // 7. chart
+ {
+ id: "chart-donut",
+ category: "chart",
+ template: "chart-pie-donut-plain-text",
+ titleZh: "产品用户来源构成占比",
+ titleEn: "User Acquisition Breakdown",
+ titleJa: "ユーザー獲得チャネル比率",
+ descZh: "各渠道活跃新用户的占比构成分布",
+ descEn: "Share of new active users across primary channels",
+ descJa: "新規アクティブユーザーの獲得チャネル内訳",
+ syntaxZh: `infographic chart-pie-donut-plain-text
+data
+ title 产品用户来源构成占比
+ desc 季度新增活跃用户的核心来源渠道构成
+ values
+ - label 开源社区口碑
+ value 45
+ - label 搜索引擎自然流量
+ value 25
+ - label 技术博客与媒体
+ value 18
+ - label 线下沙龙与推荐
+ value 12`,
+ syntaxEn: `infographic chart-pie-donut-plain-text
+data
+ title User Acquisition Breakdown
+ desc Share of new active users across primary channels
+ values
+ - label Open Source Word-of-Mouth
+ value 45
+ - label Organic Search
+ value 25
+ - label Tech Blogs & Social
+ value 18
+ - label Developer Events
+ value 12`,
+ },
+ {
+ id: "chart-column",
+ category: "chart",
+ template: "chart-column-simple",
+ titleZh: "季度特性交付速率对比",
+ titleEn: "Quarterly Feature Delivery",
+ titleJa: "四半期ごとの機能リリース速度",
+ descZh: "近四个季度研发团队完成的核心特性数量",
+ descEn: "Number of major customer-facing capabilities shipped",
+ descJa: "過去 4 四半期に提供した主要機能の推移",
+ syntaxZh: `infographic chart-column-simple
+data
+ title 季度特性交付速率对比
+ desc 近四个季度研发团队交付的核心业务特性统计
+ values
+ - label Q1 季度
+ value 18
+ - label Q2 季度
+ value 26
+ - label Q3 季度
+ value 35
+ - label Q4 季度
+ value 42`,
+ syntaxEn: `infographic chart-column-simple
+data
+ title Quarterly Feature Delivery
+ desc Number of major customer-facing capabilities shipped
+ values
+ - label Q1
+ value 18
+ - label Q2
+ value 26
+ - label Q3
+ value 35
+ - label Q4
+ value 42`,
+ },
+];
+
+export function getSampleSyntax(sample: InfographicSample, lang?: string): string {
+ if (lang && lang.toLowerCase().startsWith("zh")) return sample.syntaxZh;
+ return sample.syntaxEn;
+}
+
+export function getSampleTitle(sample: InfographicSample, lang?: string): string {
+ if (lang && lang.toLowerCase().startsWith("zh")) return sample.titleZh;
+ if (lang && lang.toLowerCase().startsWith("ja")) return sample.titleJa ?? sample.titleEn;
+ return sample.titleEn;
+}
+
+export function getSampleDesc(sample: InfographicSample, lang?: string): string {
+ if (lang && lang.toLowerCase().startsWith("zh")) return sample.descZh;
+ if (lang && lang.toLowerCase().startsWith("ja")) return sample.descJa ?? sample.descEn;
+ return sample.descEn;
+}
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 9c9f4bf5..4683647f 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -18,6 +18,10 @@ export const enUS = {
selectTemplate: "Choose template", simpleList: "Horizontal steps", numberedSteps: "Numbered steps", zigzagSteps: "Zigzag process", verticalList: "Vertical list", gridList: "Grid list", pyramidList: "Pyramid list", timeline: "Timeline", timelineChecklist: "Milestone timeline", roadmap: "Vertical roadmap", comparison: "Side-by-side comparison", compactComparison: "Compact comparison", arrowComparison: "Directional comparison", quadrant: "Quadrant", circularQuadrant: "Circular quadrant", themeDefault: "Default", themeDark: "Dark",
stepsGroup: "Process", listGroup: "List", timelineGroup: "Time and roadmap", comparisonGroup: "Comparison", quadrantGroup: "Quadrant",
officialTemplates: "AntV templates ({{count}})", searchTemplates: "Search template IDs", templateCategory: "Template category", chooseCategory: "Which infographic type fits this content?", keepCategory: "Keep current type", allCategories: "All categories", chartCategory: "Chart", comparisonCategory: "Comparison", hierarchyCategory: "Hierarchy", listCategory: "List", quadrantCategory: "Quadrant", relationCategory: "Relation", sequenceCategory: "Sequence",
+ galleryTitle: "Infographic Examples & Templates", gallerySubtitle: "Curated infographic structures and layouts. Click any example to load and visually edit, or describe what you want to AI on the right.",
+ galleryEmptyHint: "The canvas is currently empty. Choose a curated example to get started, or ask the AI assistant to create one.", galleryExploreOfficial: "Explore Gallery", galleryUseSample: "Load Example",
+ galleryTemplatesButton: "Gallery", gallerySearchPlaceholder: "Search examples or types…", galleryCategoryAll: "All",
+ galleryConfirmReplace: "Loading a new example will replace current canvas content. Continue?",
sourceHelp: "The syntax is the editable source of this infographic. The preview updates as you edit.", readOnly: "Read only",
},
companion: {
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 55e4aec5..7db08a65 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -18,6 +18,10 @@ export const ja = {
selectTemplate: "テンプレートを選択", simpleList: "横向きの手順", numberedSteps: "番号付き手順", zigzagSteps: "ジグザグ手順", verticalList: "縦向きのリスト", gridList: "グリッドリスト", pyramidList: "ピラミッドリスト", timeline: "タイムライン", timelineChecklist: "マイルストーン", roadmap: "縦型ロードマップ", comparison: "左右比較図", compactComparison: "コンパクト比較図", arrowComparison: "方向比較図", quadrant: "四象限図", circularQuadrant: "円形四象限", themeDefault: "標準", themeDark: "ダーク",
stepsGroup: "手順", listGroup: "リスト", timelineGroup: "時間とロードマップ", comparisonGroup: "比較", quadrantGroup: "四象限",
officialTemplates: "AntV テンプレート({{count}})", searchTemplates: "テンプレート ID を検索", templateCategory: "テンプレート分類", chooseCategory: "この内容に合う図の種類を選んでください", keepCategory: "現在の種類を維持", allCategories: "すべての分類", chartCategory: "チャート", comparisonCategory: "比較", hierarchyCategory: "階層", listCategory: "リスト", quadrantCategory: "四象限", relationCategory: "関係", sequenceCategory: "順序",
+ galleryTitle: "インフォグラフィックのサンプルとテンプレート", gallerySubtitle: "厳選されたインフォグラフィックの構成とレイアウト。クリックして読み込み、または右側の AI に指示して直接生成できます。",
+ galleryEmptyHint: "現在キャンバスは空です。おすすめのサンプルから始めるか、AI アシスタントで生成してください。", galleryExploreOfficial: "公式ギャラリーを見る", galleryUseSample: "サンプルを読み込む",
+ galleryTemplatesButton: "サンプル集", gallerySearchPlaceholder: "サンプルやタイプを検索…", galleryCategoryAll: "すべて",
+ galleryConfirmReplace: "選択したサンプルで現在の内容が置き換わります。続行しますか?",
sourceHelp: "構文が編集可能な元データです。変更するとプレビューが更新されます。", readOnly: "読み取り専用",
},
companion: {
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 82c2c8b8..38477f86 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -18,6 +18,10 @@ export const zhCN = {
selectTemplate: "选择模板", simpleList: "横向步骤", numberedSteps: "编号步骤", zigzagSteps: "交错流程", verticalList: "纵向清单", gridList: "网格清单", pyramidList: "金字塔清单", timeline: "时间线", timelineChecklist: "里程碑时间线", roadmap: "纵向路线图", comparison: "双栏对比图", compactComparison: "紧凑对比图", arrowComparison: "方向对比图", quadrant: "四象限图", circularQuadrant: "圆形四象限", themeDefault: "默认", themeDark: "深色",
stepsGroup: "流程型", listGroup: "列表型", timelineGroup: "时间与路线", comparisonGroup: "对比型", quadrantGroup: "四象限型",
officialTemplates: "AntV 官方模板({{count}})", searchTemplates: "搜索模板 ID", templateCategory: "模板分类", chooseCategory: "这段内容适合哪类信息图?", keepCategory: "保持当前类型", allCategories: "全部分类", chartCategory: "图表型", comparisonCategory: "对比型", hierarchyCategory: "层级型", listCategory: "列表型", quadrantCategory: "四象限型", relationCategory: "关系型", sequenceCategory: "顺序型",
+ galleryTitle: "信息图示例与模板库", gallerySubtitle: "精选常见信息图结构与版式。点击任意示例即可载入并可视化编辑,或在右侧向 AI 描述直接生成。",
+ galleryEmptyHint: "当前画布为空,你可以从精选示例开始体验,或使用 AI 助手一键生成。", galleryExploreOfficial: "浏览官方画廊", galleryUseSample: "载入示例",
+ galleryTemplatesButton: "示例库", gallerySearchPlaceholder: "搜索示例标题或类型…", galleryCategoryAll: "全部",
+ galleryConfirmReplace: "载入新示例将替换当前画布内容,是否继续?",
sourceHelp: "语法是此信息图的可编辑源文件;预览随更改更新。", readOnly: "只读",
},
companion: {