hd-garden 0.3.8 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/.agents/skills/garden-post-review/SKILL.md +2 -0
  2. package/.agents/skills/garden-ui/SKILL.md +111 -0
  3. package/.env.example +8 -0
  4. package/app/admin/page.tsx +14 -3
  5. package/app/admin/preview/[...path]/page.tsx +88 -0
  6. package/app/admin/ui/blocks/page.tsx +16 -0
  7. package/app/admin/ui/catalog/page.tsx +16 -0
  8. package/app/admin/ui/evals/page.tsx +19 -0
  9. package/app/admin/ui/page.tsx +22 -0
  10. package/app/admin-ui.css +227 -0
  11. package/app/api/admin/distribution/route.ts +4 -2
  12. package/app/api/admin/posts/source/route.ts +21 -0
  13. package/app/api/admin/preview/asset/route.ts +32 -0
  14. package/app/api/admin/thoughts/route.ts +1 -1
  15. package/app/api/admin/ui/blocks/route.ts +19 -0
  16. package/app/api/admin/ui/draft/route.ts +30 -0
  17. package/app/api/auth/github/route.ts +40 -1
  18. package/app/blog/page.tsx +6 -5
  19. package/app/columns/page.tsx +1 -1
  20. package/app/components/AdminDashboard.tsx +53 -1
  21. package/app/components/AdminUiPanels.tsx +258 -0
  22. package/app/components/AdminUiShell.tsx +56 -0
  23. package/app/components/ContentEmptyState.tsx +6 -6
  24. package/app/components/MarkdownArticle.tsx +15 -5
  25. package/app/components/UiBlock.tsx +22 -0
  26. package/app/components/UiStudio.tsx +422 -0
  27. package/app/components/ui-studio-keys.ts +3 -0
  28. package/app/globals.css +2 -0
  29. package/app/lib/admin-auth.ts +13 -1
  30. package/app/lib/content.ts +2 -1
  31. package/app/lib/fallback-site-config.ts +18 -18
  32. package/app/lib/github-content.ts +47 -4
  33. package/app/lib/repository-path.mjs +55 -0
  34. package/app/lib/ui-content.ts +79 -0
  35. package/app/lib/ui-model.ts +145 -0
  36. package/app/raw.d.ts +4 -0
  37. package/app/rss.xml/route.ts +2 -1
  38. package/app/ui-parity/page.tsx +120 -0
  39. package/bin/garden.mjs +71 -0
  40. package/eslint.config.mjs +3 -0
  41. package/package.json +15 -1
  42. package/scripts/build-content.mjs +35 -4
  43. package/scripts/build-ui-preview.mjs +29 -0
  44. package/scripts/check-post.mjs +26 -4
  45. package/scripts/ui-cli.mjs +303 -0
  46. package/site.config.yaml +19 -19
  47. package/templates/site/site.config.yaml +19 -19
  48. package/tsconfig.json +1 -1
  49. package/ui/core/apply.mjs +81 -0
  50. package/ui/core/catalog.mjs +536 -0
  51. package/ui/core/compile.mjs +63 -0
  52. package/ui/core/demos.mjs +223 -0
  53. package/ui/core/expr.mjs +310 -0
  54. package/ui/core/fence.mjs +201 -0
  55. package/ui/core/fix-prompt.mjs +35 -0
  56. package/ui/core/format.mjs +96 -0
  57. package/ui/core/index.mjs +37 -0
  58. package/ui/core/parse.mjs +229 -0
  59. package/ui/core/scan.mjs +53 -0
  60. package/ui/core/sha256.mjs +66 -0
  61. package/ui/core/starters.mjs +18 -0
  62. package/ui/core/state.mjs +259 -0
  63. package/ui/core/static.mjs +524 -0
  64. package/ui/core/transform.mjs +146 -0
  65. package/ui/core/validate.mjs +665 -0
  66. package/ui/evals/cases.yaml +155 -0
  67. package/ui/preview/dist/garden-ui.css +1182 -0
  68. package/ui/preview/dist/garden-ui.esm.js +367 -0
  69. package/ui/preview/dist/garden-ui.iife.js +367 -0
  70. package/ui/preview/index.tsx +191 -0
  71. package/ui/preview/mermaid-shim.ts +19 -0
  72. package/ui/prompt/build.mjs +24 -0
  73. package/ui/prompt/recipes/code-walkthrough.md +68 -0
  74. package/ui/prompt/recipes/compare.md +48 -0
  75. package/ui/prompt/recipes/converter.md +55 -0
  76. package/ui/prompt/recipes/data-chart.md +57 -0
  77. package/ui/prompt/recipes/inspect-grid.md +45 -0
  78. package/ui/prompt/recipes/param-bench.md +55 -0
  79. package/ui/prompt/recipes/plan.md +45 -0
  80. package/ui/prompt/recipes/stepper.md +52 -0
  81. package/ui/prompt/recipes/trace.md +62 -0
  82. package/ui/prompt/rules.md +104 -0
  83. package/ui/prompt/studio.md +20 -0
  84. package/ui/react/CatalogPage.tsx +166 -0
  85. package/ui/react/components/chart.tsx +470 -0
  86. package/ui/react/components/display.tsx +296 -0
  87. package/ui/react/components/inputs.tsx +268 -0
  88. package/ui/react/components/layout.tsx +236 -0
  89. package/ui/react/components/media.tsx +184 -0
  90. package/ui/react/index.tsx +59 -0
  91. package/ui/react/recipes.ts +25 -0
  92. package/ui/react/runtime.tsx +239 -0
  93. package/ui/react/types.ts +29 -0
  94. package/ui/react/ui.css +1182 -0
  95. package/vite.config.ts +4 -3
@@ -0,0 +1,62 @@
1
+ # 配方:轨迹
2
+
3
+ **读者卡在哪:** 状态图上看不出"现在走到哪"。TCP 状态、Raft 角色、GPM 调度,图是全的,可读者不知道这一刻哪个节点亮着。
4
+
5
+ **什么时候用:** 有一张明确的状态图或流程图,并且过程是沿着它一步步走的。
6
+
7
+ **什么时候不用:** 只需要展示拓扑(写 Mermaid);或者节点超过 9 个、边超过 12 条(先拆)。
8
+
9
+ **作者可能这样说:** "沿着状态机走一遍""现在在哪个状态""三次握手每一步双方处于什么状态"。
10
+
11
+ **骨架(阶段 6 之前):** `Steps bind="step"` + 一张 `Table`,列出每个参与方此刻的状态,这一步变了的标成 `new`。阶段 6 起改用 `Diagram`,用 `highlight` 标出当前节点。
12
+
13
+ ````md
14
+ ```ui
15
+ ---
16
+ id: tcp-handshake
17
+ caption: 三次握手里,客户端先进入 ESTABLISHED,服务端要等最后一个 ACK。
18
+ intent: |
19
+ 一步步走 TCP 三次握手,每步列出客户端和服务端的状态,标出这一步变了的那一方。
20
+ ---
21
+ <State step={0} />
22
+ <Let clientStates={["CLOSED", "SYN-SENT", "ESTABLISHED", "ESTABLISHED"]}
23
+ serverStates={["LISTEN", "SYN-RCVD", "SYN-RCVD", "ESTABLISHED"]}
24
+ prev={max(step - 1, 0)} />
25
+
26
+ <Steps bind="step">
27
+ <Step title="开始">服务端在 LISTEN 等连接。</Step>
28
+ <Step title="SYN">客户端发 SYN;服务端收到后回 SYN+ACK,进入 SYN-RCVD。</Step>
29
+ <Step title="SYN+ACK">客户端收到 SYN+ACK,回 ACK,自己先进入 ESTABLISHED。</Step>
30
+ <Step title="ACK">服务端收到 ACK,也进入 ESTABLISHED。</Step>
31
+ </Steps>
32
+
33
+ <Table columns={["一方", "状态"]}>
34
+ <Row cells={["客户端", clientStates[step]]}
35
+ tones={step > 0 && clientStates[step] != clientStates[prev] ? "new" : "plain"} />
36
+ <Row cells={["服务端", serverStates[step]]}
37
+ tones={step > 0 && serverStates[step] != serverStates[prev] ? "new" : "plain"} />
38
+ </Table>
39
+ ```
40
+ ````
41
+
42
+ 阶段 6 起的写法:
43
+
44
+ ```text
45
+ <Diagram highlight={[["closed"], ["synsent"], ["established"], ["established"]][step]} mermaid={`
46
+ stateDiagram-v2
47
+ closed --> synsent: 发 SYN
48
+ synsent --> established: 收到 SYN+ACK
49
+ `} />
50
+ ```
51
+
52
+ **要点:**
53
+
54
+ - 每一步的状态写成数组,用 `step` 取下标;"这一步变了"用和上一步比较得出。
55
+ - 节点名和作者原话保持一致,不要自己翻译或缩写。
56
+ - 图本身已经在正文里用 Mermaid 画过时,这一块只负责"走",不要重画一遍完整拓扑。
57
+
58
+ **常见错误:**
59
+
60
+ - 数组长度和步数对不上。
61
+ - 在第 0 步就把某一方标成 `new`。
62
+ - 阶段 6 之前写了 `Diagram`。
@@ -0,0 +1,104 @@
1
+ # 把作者的意图写成 Garden 的 ui 块
2
+
3
+ 你在帮一位技术博客作者,把他用自然语言写下的"这里想让读者动手看看",写成 Garden 站点能直接绘制的 `ui` 块。读者在网页上拖滑杆、翻步骤、点格子,全部在本地计算,不会再调用模型。
4
+
5
+ 你只能使用下面"组件参考"里列出的组件和属性,用"配方"里的组合方式。目录里没有的东西,不要发明。
6
+
7
+ ## 一、ui 块长什么样
8
+
9
+ 一个 `ui` 围栏分两部分:开头 `---` 之间是块头(YAML),下面是正文。
10
+
11
+ ````md
12
+ ```ui
13
+ ---
14
+ id: kv-memory
15
+ caption: 显存与 batch、序列长度都成正比;batch 8、序列 32K 就要 32 GiB。
16
+ intent: |
17
+ (作者原话,一字不改)
18
+ expect:
19
+ - given: { batch: 1, seq: 4096 }
20
+ mem: 536870912
21
+ ---
22
+ <State batch={1} seq={4096} />
23
+ <Let mem={2 * 32 * 8 * 128 * seq * batch * 2} />
24
+
25
+ <Slider bind="batch" label="batch" min={1} max={32} />
26
+ <Slider bind="seq" label="序列长度" min={1024} max={32768} scale="log" format="thousands" />
27
+
28
+ batch 为 {batch}、序列 {thousands(seq)} 时,KV cache 要 **{bytes(mem)}**。
29
+
30
+ <Chart sweep="seq">
31
+ <Line y={mem} label="KV 显存" format="bytes" />
32
+ </Chart>
33
+ ```
34
+ ````
35
+
36
+ ### 块头
37
+
38
+ - `id`:必填。小写字母、数字、连字符,篇内唯一。作者给了就用作者的。
39
+ - `caption`:必填。一句判断,告诉没法交互的读者结论是什么。不能写"见下图""拖动滑杆试试"。
40
+ - `intent`:作者原话,原样抄进来,不改一个字。
41
+ - `expect`:作者原话里出现具体数值时必写,见第五节。
42
+ - 不要写 `compiled`,它由工具生成。
43
+
44
+ ### 正文
45
+
46
+ - 组件标签用大写开头,属性用名字传:字符串用双引号,数字、布尔、表达式用 `{}`。
47
+ - 正文里可以写普通 Markdown 段落、加粗、列表;用 `{表达式}` 把会变的数字插进句子。字面的 `{` 写成 `\{`。
48
+ - 不能写:标题、HTML 标签、图片语法、代码围栏、脚注、`import` / `export`。
49
+
50
+ ## 二、状态和表达式
51
+
52
+ - `<State 名字={默认值} />` 声明会变的量,值只能是数字、字符串或布尔字面量。
53
+ - `<Let 名字={表达式} />` 声明由别的量算出来的值,数组和对象也用 `Let` 写。
54
+ - 输入控件用 `bind="名字"` 绑定状态,名字必须先在 `State` 里声明,类型要一致。
55
+ - `Steps` / `Tabs` 的 `bind` 绑定的是从 0 开始的序号。
56
+ - 表达式是 JavaScript 表达式的子集:字面量、数组、对象、`+ - * / % **`、比较、`&& || ?? !`、三元、`a.b`、`a[i]`。
57
+ - 只能调用这些函数:`abs min max floor ceil round trunc sqrt cbrt pow exp log log2 log10 sin cos tan atan2 clamp`、`range len sum avg col includes join`、`fixed percent bytes si thousands`、`float32 bits32 bits64`。常量只有 `PI`、`E`。
58
+ - 不能写:赋值、函数、箭头函数、`new`、`this`、正则、`Math.xxx`、`.map()` 之类的方法调用。要循环就用 `<Each>`。
59
+ - 数字是 JavaScript 双精度。要好读就用格式函数或组件的 `format`:`fixed:2`、`percent`、`bytes`、`si`、`thousands`。
60
+
61
+ ## 三、先判断要不要上交互
62
+
63
+ 先读作者原话和它所在的那一节,再决定:
64
+
65
+ 1. **写回正文**:一句话、一张静态表格或一张 Mermaid 就能说清,读者动手也不会多懂一点。
66
+ 2. **写 `ui`**:读者卡在下面某一种情况,动手能看懂:过程被拍成了一张图;参数是作者算好的死数字;二维结构被压成了表格;两种东西只能上下翻着对比;"如果……会怎样"没法试。
67
+ 3. **写 `widget`**:确实需要画布动画、音频、物理模拟这类目录里没有的能力。
68
+
69
+ ## 四、设计规则
70
+
71
+ 1. 默认状态就要能看出结论。不碰任何控件的读者,以及 RSS 里的静态版,也得读到重点。
72
+ 2. 每个控件都要改变看得见的东西。控件超过 3 个时,先考虑拆成两块。
73
+ 3. 不要重复周围散文已经讲过的内容,只放散文做不到的部分。
74
+ 4. 数字只来自作者原话或由原话里的公式算出。原话没给的数字,不要编;提到已有数据文件时用 `Data` 引用。
75
+ 5. 多列用 `Columns`,不写任何固定宽度;360px 宽的手机上也要能读。
76
+ 6. 一块里 `accent` / `waste` 色合起来最多用在两个焦点上。
77
+ 7. 块里不写标题,不写"如图所示"。
78
+ 8. 标签和说明用作者的语言,简短,不用感叹号,不写口号。
79
+
80
+ ## 五、写 expect
81
+
82
+ 作者原话里只要出现"某个输入下,结果是多少",就写成断言:
83
+
84
+ ```yaml
85
+ expect:
86
+ - given: { batch: 1, seq: 4096 }
87
+ mem: 536870912
88
+ ```
89
+
90
+ - `given` 覆盖状态;其余键是状态名或 `Let` 名,值是期望结果。
91
+ - 原话给的是近似值("约 27.9 万")时,写成 `{ value: 279000, tol: 0.01 }`,`tol` 是相对误差。
92
+ - 断言不过时,先检查公式是否抄错,不要改断言去迁就公式。
93
+
94
+ ## 六、常见错误
95
+
96
+ - 用了目录里没有的组件或属性,比如 `<Slidr>`、`<Text>`、`color="red"`。
97
+ - `bind` 的名字没在 `State` 里声明,或者类型不对(`Toggle` 绑了数字)。
98
+ - `Step` 没放在 `Steps` 里,`Row` 没放在 `Table` / `Grid` 里。
99
+ - 对数滑杆的 `min` 写成 0。
100
+ - `Choice` 的默认值不在 `options` 里。
101
+ - 用 `Math.pow`、`arr.map`、箭头函数。
102
+ - 在正文里写 `##` 标题或 HTML。
103
+ - `caption` 写成"拖动看看",而不是一句结论。
104
+ - 自己编原话里没有的数据。
@@ -0,0 +1,20 @@
1
+ # 工作台的输出约定
2
+
3
+ 你在 Garden 后台的组件工作台里。作者已经决定要一块交互,你的回复会被程序直接解析。
4
+
5
+ ## 生成
6
+
7
+ 用户消息是作者对这块交互的描述。把它原样写进块头的 `intent`,然后写出这一块。
8
+
9
+ ## 修改
10
+
11
+ 用户消息里有当前的 `ui` 围栏和一句修改要求。按要求改,返回改过的完整围栏:
12
+
13
+ - 没被要求改的部分保持原样,包括 `id`。
14
+ - 把 `intent` 改写成能描述修改后这块交互的话,尽量保留作者原来的措辞,只补上这次改动。
15
+
16
+ ## 回复格式
17
+
18
+ - 回复里只有一个 `ui` 围栏,围栏外不写任何解释。
19
+ - 唯一的例外:你认为这段内容用一句话、一张表或一张 Mermaid 就够了,不值得做成交互,可以在围栏前加一行,以"提醒:"开头说明理由。即便如此,仍然要给出你认为最合适的一块。
20
+ - 收到程序发回的诊断时,按诊断修正后重新给出完整围栏,格式不变。
@@ -0,0 +1,166 @@
1
+ "use client";
2
+
3
+ import { marked } from "marked";
4
+ import { useEffect, useMemo, useState } from "react";
5
+ import { COMPONENTS, GROUPS } from "../core/catalog.mjs";
6
+ import { compileUiBlock } from "../core/compile.mjs";
7
+ import { DEMOS, demoFence } from "../core/demos.mjs";
8
+ import { scanFences } from "../core/fence.mjs";
9
+ import { UiFigure } from "./index";
10
+ import { parseRecipe, type RecipeSource } from "./recipes";
11
+ import type { UiPayload } from "./types";
12
+
13
+ export type { RecipeSource } from "./recipes";
14
+
15
+ function payloadOf(fence: string | null): UiPayload | null {
16
+ if (!fence) return null;
17
+ const body = scanFences(fence)[0]?.body;
18
+ if (!body) return null;
19
+ return (compileUiBlock(body).payload as UiPayload | null) ?? null;
20
+ }
21
+
22
+ function StartButton({ fence, onStart }: { fence: string; onStart?: (fence: string) => void }) {
23
+ const [copied, setCopied] = useState(false);
24
+ if (onStart) {
25
+ return <button type="button" className="garden-ui-button garden-ui-tone-accent" onClick={() => onStart(fence)}>用它开始</button>;
26
+ }
27
+ return (
28
+ <button
29
+ type="button"
30
+ className="garden-ui-button"
31
+ onClick={() => {
32
+ void navigator.clipboard?.writeText(fence).then(() => setCopied(true));
33
+ }}
34
+ >
35
+ {copied ? "已复制围栏" : "复制围栏"}
36
+ </button>
37
+ );
38
+ }
39
+
40
+ type Spec = (typeof COMPONENTS)[keyof typeof COMPONENTS] & { parents?: string[]; phase: number };
41
+
42
+ function PropTable({ spec }: { spec: Spec }) {
43
+ const props = Object.entries(spec.props);
44
+ if (!props.length) return null;
45
+ return (
46
+ <table className="garden-catalog-props">
47
+ <thead>
48
+ <tr><th>属性</th><th>说明</th></tr>
49
+ </thead>
50
+ <tbody>
51
+ {props.map(([prop, propSpec]) => {
52
+ const details = propSpec as { desc?: string; required?: boolean; literal?: boolean; values?: string[]; default?: unknown };
53
+ return (
54
+ <tr key={prop}>
55
+ <td><code>{prop}</code>{details.required ? " · 必填" : ""}{details.literal ? " · 字面量" : ""}</td>
56
+ <td>
57
+ {details.desc}
58
+ {details.values ? `(${details.values.join(" / ")})` : ""}
59
+ {details.default !== undefined ? `,默认 ${JSON.stringify(details.default)}` : ""}
60
+ </td>
61
+ </tr>
62
+ );
63
+ })}
64
+ </tbody>
65
+ </table>
66
+ );
67
+ }
68
+
69
+ const CATEGORIES = ["配方", ...GROUPS];
70
+
71
+ /** Category rail on the left, a grid of name + preview cards on the right. */
72
+ export function CatalogPage({ recipes = [], onStart }: { recipes?: RecipeSource[]; onStart?: (fence: string) => void }) {
73
+ const parsedRecipes = useMemo(() => recipes.map(parseRecipe).filter((recipe) => recipe.fence), [recipes]);
74
+ const [query, setQuery] = useState("");
75
+ const [category, setCategory] = useState("展示");
76
+ const [openId, setOpenId] = useState<string | null>(null);
77
+ const normalized = query.trim().toLowerCase();
78
+
79
+ const matchesComponent = (name: string) => {
80
+ if (!normalized) return true;
81
+ const spec = COMPONENTS[name as keyof typeof COMPONENTS];
82
+ return [name, spec.summary, ...spec.phrases].some((text) => text.toLowerCase().includes(normalized));
83
+ };
84
+ const recipeMatches = (title: string, intro: string) => !normalized || title.toLowerCase().includes(normalized) || intro.toLowerCase().includes(normalized);
85
+
86
+ const cardsFor = (name: string) => {
87
+ if (name === "配方") {
88
+ return parsedRecipes.filter((recipe) => recipeMatches(recipe.title, recipe.intro)).map((recipe) => ({
89
+ id: `recipe-${recipe.file}`,
90
+ title: recipe.title.replace(/^配方:/, ""),
91
+ fence: recipe.fence,
92
+ spec: null as Spec | null,
93
+ intro: recipe.intro,
94
+ }));
95
+ }
96
+ return Object.keys(COMPONENTS)
97
+ .filter((component) => COMPONENTS[component as keyof typeof COMPONENTS].group === name && component in DEMOS && matchesComponent(component))
98
+ .map((component) => ({
99
+ id: `component-${component}`,
100
+ title: component,
101
+ fence: demoFence(component),
102
+ spec: COMPONENTS[component as keyof typeof COMPONENTS] as Spec,
103
+ intro: "",
104
+ }));
105
+ };
106
+
107
+ const categories = CATEGORIES.filter((name) => (normalized ? cardsFor(name).length > 0 : name === "配方" ? parsedRecipes.length > 0 : true));
108
+ const activeCategory = categories.includes(category) ? category : categories[0];
109
+ const cards = activeCategory ? cardsFor(activeCategory) : [];
110
+
111
+ useEffect(() => {
112
+ const id = window.location.hash.replace(/^#/, "");
113
+ if (id.startsWith("component-")) {
114
+ const spec = COMPONENTS[id.slice("component-".length) as keyof typeof COMPONENTS] as Spec | undefined;
115
+ if (spec?.group) setCategory(spec.group);
116
+ } else if (id === "配方" || id.startsWith("recipe-")) setCategory("配方");
117
+ else if ((CATEGORIES as string[]).includes(decodeURIComponent(id))) setCategory(decodeURIComponent(id));
118
+ }, []);
119
+
120
+ const chooseCategory = (name: string) => {
121
+ setCategory(name);
122
+ setOpenId(null);
123
+ window.history.replaceState(null, "", `#${encodeURIComponent(name)}`);
124
+ };
125
+
126
+ return (
127
+ <div className="garden-catalog">
128
+ <nav className="garden-catalog-nav" aria-label="大类">
129
+ <input type="search" placeholder="搜索" value={query} onChange={(event) => setQuery(event.target.value)} aria-label="搜索组件" />
130
+ {categories.map((name) => (
131
+ <button key={name} type="button" aria-current={name === activeCategory ? "page" : undefined} onClick={() => chooseCategory(name)}>
132
+ {name}
133
+ </button>
134
+ ))}
135
+ </nav>
136
+ {cards.length ? (
137
+ <div className="garden-catalog-grid">
138
+ {cards.map((card) => {
139
+ const payload = payloadOf(card.fence);
140
+ const open = openId === card.id;
141
+ return (
142
+ <article key={card.id} className="garden-catalog-card" id={card.id}>
143
+ <button type="button" className="garden-catalog-card-name" aria-expanded={open} onClick={() => setOpenId(open ? null : card.id)}>
144
+ {card.title}
145
+ </button>
146
+ <div className="garden-catalog-well">
147
+ {payload ? <UiFigure payload={payload} /> : <p className="garden-catalog-empty">没有预览</p>}
148
+ </div>
149
+ {open ? (
150
+ <div className="garden-catalog-more">
151
+ {card.spec ? <p>{card.spec.summary}</p> : null}
152
+ {card.spec?.phrases.length ? <p className="garden-catalog-phrases">可以这样说:{card.spec.phrases.map((phrase) => `“${phrase}”`).join("、")}</p> : null}
153
+ {card.intro ? <div className="garden-catalog-intro" dangerouslySetInnerHTML={{ __html: marked.parse(card.intro, { async: false }) as string }} /> : null}
154
+ {card.spec ? <PropTable spec={card.spec} /> : null}
155
+ {card.fence ? <pre><code>{card.fence}</code></pre> : null}
156
+ {card.fence && payload ? <StartButton fence={card.fence} onStart={onStart} /> : null}
157
+ </div>
158
+ ) : null}
159
+ </article>
160
+ );
161
+ })}
162
+ </div>
163
+ ) : <p className="garden-catalog-empty">没有符合的组件。</p>}
164
+ </div>
165
+ );
166
+ }