pomaster 0.1.0 → 0.2.0
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.
- package/README.md +393 -396
- package/TRADEMARKS.md +2 -2
- package/catalog/archetypes/archetype.api.error.json +55 -0
- package/catalog/archetypes/archetype.api.pagination.json +68 -0
- package/catalog/archetypes/archetype.api.resource.json +45 -0
- package/catalog/archetypes/archetype.backend.approval_workflow.json +63 -0
- package/catalog/archetypes/archetype.backend.audit.json +44 -0
- package/catalog/archetypes/archetype.backend.crud_resource.json +56 -0
- package/catalog/archetypes/archetype.backend.export.json +40 -0
- package/catalog/archetypes/archetype.backend.external_integration.json +89 -0
- package/catalog/archetypes/archetype.backend.idempotent_command.json +65 -0
- package/catalog/archetypes/archetype.backend.import.json +47 -0
- package/catalog/archetypes/archetype.backend.master_data.json +45 -0
- package/catalog/archetypes/archetype.backend.outbox_event.json +80 -0
- package/catalog/archetypes/archetype.backend.query_resource.json +40 -0
- package/catalog/archetypes/archetype.backend.scheduled_job.json +69 -0
- package/catalog/archetypes/archetype.backend.transactional_write.json +79 -0
- package/catalog/archetypes/archetype.component.button.json +53 -0
- package/catalog/archetypes/archetype.component.data_grid.json +78 -0
- package/catalog/archetypes/archetype.component.dialog.json +52 -0
- package/catalog/archetypes/archetype.component.search_input.json +34 -0
- package/catalog/archetypes/archetype.component.search_select.json +77 -0
- package/catalog/archetypes/archetype.data.hierarchy.json +71 -0
- package/catalog/archetypes/archetype.data.ledger.json +40 -0
- package/catalog/archetypes/archetype.data.master_data.json +43 -0
- package/catalog/archetypes/archetype.data.transaction.json +42 -0
- package/catalog/archetypes/archetype.data.versioned.json +43 -0
- package/catalog/archetypes/archetype.frontend.error_taxonomy.json +99 -0
- package/catalog/archetypes/archetype.frontend.feature_oriented.json +59 -0
- package/catalog/archetypes/archetype.frontend.modular.json +37 -0
- package/catalog/archetypes/archetype.frontend.spa_layered.json +48 -0
- package/catalog/archetypes/archetype.page.analysis.json +39 -0
- package/catalog/archetypes/archetype.page.master_data.json +63 -0
- package/catalog/archetypes/archetype.runtime.environment_parity.json +178 -0
- package/catalog/archetypes/archetype.runtime.observability_binding.json +93 -0
- package/catalog/archetypes/archetype.state.async_command.json +63 -0
- package/catalog/archetypes/archetype.state.background_refresh.json +45 -0
- package/catalog/archetypes/archetype.state.form_edit.json +45 -0
- package/catalog/archetypes/archetype.state.optimistic_mutation.json +48 -0
- package/catalog/archetypes/archetype.state.selection.json +35 -0
- package/catalog/archetypes/archetype.state.server_query.json +60 -0
- package/catalog/archetypes/archetype.state.url_filter.json +47 -0
- package/catalog/archetypes/archetype.state.wizard.json +46 -0
- package/catalog/catalog-lock.draft.json +349 -5
- package/catalog/gates/gate.new-entity.checks.json +106 -0
- package/catalog/knowledge/knowledge.web.browser.mcp_eyes.json +99 -0
- package/catalog/sensors/sensor.browser.deterministic.json +17 -6
- package/catalog/sensors/sensor.browser.interactive.json +16 -6
- package/catalog/tools/materialize_v06_relock.py +218 -0
- package/catalog/tools/seed_v06_archetypes.py +283 -0
- package/catalog/tools/seed_v06_batch2_materials.py +504 -0
- package/catalog/tools/seed_v06_batch3_materials.py +756 -0
- package/catalog/tools/seed_v06_batch4_materials.py +353 -0
- package/dist/bin.js +2920 -331
- package/package.json +1 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""P-v06 批次 1:首批 archetype 物料落盘(10 份)。
|
|
3
|
+
|
|
4
|
+
语义全部锚定联网核实报告(.trellis/tasks/09-02-vnext-prd-v06-governed-substrate/
|
|
5
|
+
research/external-design-references.md,2026-09-02 官网实抓):
|
|
6
|
+
- Geist Button variant/Best Practices 实抓;AntD Table demo 锚点能力面(v6.6.2);
|
|
7
|
+
Radix Select/Dialog anatomy 实抓;APG combobox/grid 键盘契约实抓。
|
|
8
|
+
- 差异表 #6 裁决:SEARCH_SELECT 标 combobox(popup=listbox)+ 两条补强契约。
|
|
9
|
+
- 词形裁定:组件族用 COMPONENT_ARCHETYPE.*(PRD §90 的 COMPONENT.* 词形在 truth
|
|
10
|
+
面被 governed 前缀占用——catalog 侧按域前缀改写避免两平面词形碰撞)。
|
|
11
|
+
幂等:同输入重跑 byte-stable。
|
|
12
|
+
"""
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
19
|
+
except Exception:
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # .../catalog
|
|
23
|
+
OUT = os.path.join(ROOT, "archetypes")
|
|
24
|
+
FETCH = "2026-09-02"
|
|
25
|
+
|
|
26
|
+
materials = {}
|
|
27
|
+
|
|
28
|
+
materials["archetype.page.master_data.json"] = {
|
|
29
|
+
"id": "PAGE_ARCHETYPE.MASTER_DATA",
|
|
30
|
+
"kind": "archetype",
|
|
31
|
+
"layer": "ARCHETYPE",
|
|
32
|
+
"title_zh": "主数据管理页",
|
|
33
|
+
"summary_zh": "企业主数据(供应商/物料/客户等)的列表维护页:过滤→操作→网格→分页的标准组合,编辑走抽屉或对话框,默认假设远程数据+服务端分页。",
|
|
34
|
+
"semantic": {
|
|
35
|
+
"responsibility": "单一主数据实体的全生命周期维护入口(查/增/改/删/批操作)",
|
|
36
|
+
"when_to_use": "实体有独立维护入口、字段成表、需过滤检索与批量操作时(v0.6.1 §70 用户管理判例)",
|
|
37
|
+
"when_not_to_use": "纯展示分析页(走 PAGE_ARCHETYPE.ANALYSIS);跨实体复杂工作流主页面",
|
|
38
|
+
},
|
|
39
|
+
"composition": {
|
|
40
|
+
"requires": ["COMPONENT_ARCHETYPE.DATA_GRID", "COMPONENT_ARCHETYPE.SEARCH_INPUT", "COMPONENT_ARCHETYPE.BUTTON"],
|
|
41
|
+
"optional": ["COMPONENT_ARCHETYPE.DIALOG", "ARCHETYPE.BACKEND.IMPORT", "ARCHETYPE.BACKEND.EXPORT", "ARCHETYPE.BACKEND.BATCH", "ARCHETYPE.BACKEND.AUDIT"],
|
|
42
|
+
"incompatible": [],
|
|
43
|
+
},
|
|
44
|
+
"composition_order": ["PageHeader", "FilterBar", "Toolbar", "DataGrid", "Pagination"],
|
|
45
|
+
"default_states": ["LOADING", "READY", "EMPTY", "ERROR", "DIRTY", "SAVING", "FORBIDDEN"],
|
|
46
|
+
"backend_binding": ["ARCHETYPE.BACKEND.CRUD_RESOURCE", "ARCHETYPE.BACKEND.QUERY_RESOURCE"],
|
|
47
|
+
"data_binding": ["DATA_ARCHETYPE.MASTER_DATA"],
|
|
48
|
+
"x-research-anchors": {
|
|
49
|
+
"note": "组合语义参照 AntD Table demo 锚点能力面(远程数据+分页为默认假设)",
|
|
50
|
+
"sources": [
|
|
51
|
+
{"url": "https://ant.design/components/table", "fetched": FETCH},
|
|
52
|
+
{"url": "https://ant.design/components/overview", "fetched": FETCH},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
materials["archetype.page.analysis.json"] = {
|
|
58
|
+
"id": "PAGE_ARCHETYPE.ANALYSIS",
|
|
59
|
+
"kind": "archetype",
|
|
60
|
+
"layer": "ARCHETYPE",
|
|
61
|
+
"title_zh": "分析页",
|
|
62
|
+
"summary_zh": "指标/成本/差异类分析页:上下文→过滤→汇总→主分析面→下钻→导出的标准动线,适用于成本分析、经营分析、指标诊断、差异比较。",
|
|
63
|
+
"semantic": {
|
|
64
|
+
"responsibility": "围绕一个分析主题的多维探索与结论呈现",
|
|
65
|
+
"when_to_use": "成本分析/经营分析/指标诊断/差异比较(v0.6.1 §15 逐字)",
|
|
66
|
+
"when_not_to_use": "行级数据维护(走 PAGE_ARCHETYPE.MASTER_DATA)",
|
|
67
|
+
},
|
|
68
|
+
"composition": {
|
|
69
|
+
"requires": ["COMPONENT_ARCHETYPE.SEARCH_INPUT", "COMPONENT_ARCHETYPE.DATA_GRID"],
|
|
70
|
+
"optional": ["COMPONENT_ARCHETYPE.DIALOG", "ARCHETYPE.BACKEND.EXPORT"],
|
|
71
|
+
"incompatible": [],
|
|
72
|
+
},
|
|
73
|
+
"composition_order": ["ContextHeader", "Filters", "Summary", "PrimaryAnalysisSurface", "Drill-down", "Action/Export"],
|
|
74
|
+
"x-research-anchors": {
|
|
75
|
+
"sources": [{"url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §15", "fetched": FETCH}]
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
materials["archetype.backend.crud_resource.json"] = {
|
|
80
|
+
"id": "ARCHETYPE.BACKEND.CRUD_RESOURCE",
|
|
81
|
+
"kind": "archetype",
|
|
82
|
+
"layer": "ARCHETYPE",
|
|
83
|
+
"title_zh": "标准企业 CRUD 资源",
|
|
84
|
+
"summary_zh": "Create/Read/Update/Delete/List 五操作的标准资源原型:分页/校验/审计/乐观锁为默认档,软删/批量/导入/导出为可选档;错误契约与授权为强制约束。",
|
|
85
|
+
"semantic": {
|
|
86
|
+
"responsibility": "单实体的标准写面与单点读面(get)",
|
|
87
|
+
"when_to_use": "实体需要标准维护 API 时;业务决定字段/权限/删除策略(v0.6.1 §70)",
|
|
88
|
+
"when_not_to_use": "纯查询报表资源(配 QUERY_RESOURCE);事件驱动写路径",
|
|
89
|
+
},
|
|
90
|
+
"composition": {
|
|
91
|
+
"requires": [],
|
|
92
|
+
"optional": ["ARCHETYPE.BACKEND.QUERY_RESOURCE", "DATA_ARCHETYPE.MASTER_DATA"],
|
|
93
|
+
"incompatible": [],
|
|
94
|
+
},
|
|
95
|
+
"operations": ["create", "get", "list", "update", "delete"],
|
|
96
|
+
"defaults": {"pagination": True, "validation": True, "audit": True, "optimistic_lock": True},
|
|
97
|
+
"optional_capabilities": {"soft_delete": None, "batch": None, "import": None, "export": None},
|
|
98
|
+
"constraints": ["api_error_contract", "authorization_required"],
|
|
99
|
+
"verification": ["unit", "contract", "persistence"],
|
|
100
|
+
"x-research-anchors": {
|
|
101
|
+
"sources": [{"url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §26-§27/§83", "fetched": FETCH}]
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
materials["archetype.backend.query_resource.json"] = {
|
|
106
|
+
"id": "ARCHETYPE.BACKEND.QUERY_RESOURCE",
|
|
107
|
+
"kind": "archetype",
|
|
108
|
+
"layer": "ARCHETYPE",
|
|
109
|
+
"title_zh": "查询资源",
|
|
110
|
+
"summary_zh": "LIST/FILTER/SORT/PAGE/SEARCH 五能力的查询面原型:服务端分页、稳定排序、有界页大小、过滤字段有索引为默认档。",
|
|
111
|
+
"semantic": {
|
|
112
|
+
"responsibility": "实体的列表/检索读面(与 CRUD 写面分离)",
|
|
113
|
+
"when_to_use": "任何列表页/分析页的取数面;大表必须服务端分页",
|
|
114
|
+
"when_not_to_use": "单点 get(CRUD_RESOURCE.operations.get 承载)",
|
|
115
|
+
},
|
|
116
|
+
"composition": {"requires": [], "optional": ["ARCHETYPE.BACKEND.CRUD_RESOURCE"], "incompatible": []},
|
|
117
|
+
"capabilities": ["LIST", "FILTER", "SORT", "PAGE", "SEARCH"],
|
|
118
|
+
"defaults": ["server_side_pagination", "stable_sort", "bounded_page_size", "indexed_filter_fields"],
|
|
119
|
+
"x-research-anchors": {
|
|
120
|
+
"sources": [{"url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §28", "fetched": FETCH}]
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
materials["archetype.data.master_data.json"] = {
|
|
125
|
+
"id": "DATA_ARCHETYPE.MASTER_DATA",
|
|
126
|
+
"kind": "archetype",
|
|
127
|
+
"layer": "ARCHETYPE",
|
|
128
|
+
"title_zh": "主数据表",
|
|
129
|
+
"summary_zh": "主数据实体的表结构原型:业务码/名称/状态/审计四段公共字段 + 版本位;这些是 Archetype 默认,不是所有业务表强制字段。",
|
|
130
|
+
"semantic": {
|
|
131
|
+
"responsibility": "主数据实体的持久化形状基线(减少从零设计表结构)",
|
|
132
|
+
"when_to_use": "主数据类实体建表(v0.6.1 §90 Tracer:AI 不需要从零设计标准 Master Data 表结构)",
|
|
133
|
+
"when_not_to_use": "交易流水(走 TRANSACTION 原型——不默认软删)/层级/版本台账等专形",
|
|
134
|
+
},
|
|
135
|
+
"composition": {"requires": [], "optional": [], "incompatible": []},
|
|
136
|
+
"recommended_fields": ["id", "business_code", "name", "status", "created_at", "created_by", "updated_at", "updated_by", "version"],
|
|
137
|
+
"optional_fields": ["description", "effective_from", "effective_to", "sort_order"],
|
|
138
|
+
"enforcement_note": "Archetype 默认非强制(v0.6.1 §48 逐字);业务特有字段仍由业务决定",
|
|
139
|
+
"x-research-anchors": {
|
|
140
|
+
"sources": [{"url": "doc/POMaster-vNext-PRD-v0.6.1-Engineering-Substrate-Archetype-Catalog.md §47-§48", "fetched": FETCH}]
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
materials["archetype.component.button.json"] = {
|
|
145
|
+
"id": "COMPONENT_ARCHETYPE.BUTTON",
|
|
146
|
+
"kind": "archetype",
|
|
147
|
+
"layer": "PRIMITIVE",
|
|
148
|
+
"title_zh": "按钮",
|
|
149
|
+
"summary_zh": "动作触发原语:状态变更动作用 Button、URL 导航用 Link、一行多个相关动作用 Menu/Split Button;variant 词表与 Best Practices 机器可核对(Geist 实抓)。",
|
|
150
|
+
"semantic": {
|
|
151
|
+
"responsibility": "触发一个明确的动作或事件",
|
|
152
|
+
"when_to_use": "表单提交/行操作/工具栏动作;表单提交必须 submit 类型",
|
|
153
|
+
"when_not_to_use": "页面导航(Link);一组相关动作(Menu/SplitButton)",
|
|
154
|
+
},
|
|
155
|
+
"composition": {"requires": [], "optional": [], "incompatible": []},
|
|
156
|
+
"variants": ["default", "secondary", "tertiary", "error", "warning"],
|
|
157
|
+
"states": ["default", "hover", "active", "loading", "disabled"],
|
|
158
|
+
"usage_rules": [
|
|
159
|
+
"状态变更用 Button、改 URL 用 Link、多动作合并用 Menu/SplitButton",
|
|
160
|
+
"表单提交用 submit 类型;视觉 variant 与提交类型分离命名(Geist typeName 先例)",
|
|
161
|
+
"传 loading 而非替换 spinner——按钮保持可聚焦并向辅助技术播报忙态",
|
|
162
|
+
"仅在动作当前不可能时 disable,且配 Tooltip 解释原因",
|
|
163
|
+
"标签动词+名词、Title Case(Deploy Project);破坏性动作与 toast 1:1 配对",
|
|
164
|
+
],
|
|
165
|
+
"forbidden": ["bare_verb_label", "general_confirm_label", "aria_label_on_text_button", "spinner_swap_button"],
|
|
166
|
+
"x-research-anchors": {
|
|
167
|
+
"note": "variant 词表 Default/Secondary/Tertiary/Error/Warning 与 Best Practices 均为 Geist Button 页实抓;icon-only 缺 svgOnly+aria-label 时 validator 抛错=现成 fail-closed 先例",
|
|
168
|
+
"sources": [{"url": "https://vercel.com/geist/button", "fetched": FETCH}]
|
|
169
|
+
},
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
materials["archetype.component.search_input.json"] = {
|
|
173
|
+
"id": "COMPONENT_ARCHETYPE.SEARCH_INPUT",
|
|
174
|
+
"kind": "archetype",
|
|
175
|
+
"layer": "PRIMITIVE",
|
|
176
|
+
"title_zh": "搜索输入框",
|
|
177
|
+
"summary_zh": "文本输入触发的过滤/检索原语:企业站把它列为独立组件而非 Input 变体(Geist Search Input 独立词条佐证语义独立性)。",
|
|
178
|
+
"semantic": {
|
|
179
|
+
"responsibility": "按关键词过滤当前数据面(本地或远程)",
|
|
180
|
+
"when_to_use": "列表页/选择器的过滤区",
|
|
181
|
+
"when_not_to_use": "需要选项列表选择语义时(走 COMPONENT_ARCHETYPE.SEARCH_SELECT)",
|
|
182
|
+
},
|
|
183
|
+
"composition": {"requires": [], "optional": ["COMPONENT_ARCHETYPE.SEARCH_SELECT"], "incompatible": []},
|
|
184
|
+
"states": ["default", "focus", "filled", "clearable", "disabled"],
|
|
185
|
+
"x-research-anchors": {
|
|
186
|
+
"sources": [{"url": "https://vercel.com/geist/search-input", "fetched": FETCH}]
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
materials["archetype.component.search_select.json"] = {
|
|
191
|
+
"id": "COMPONENT_ARCHETYPE.SEARCH_SELECT",
|
|
192
|
+
"kind": "archetype",
|
|
193
|
+
"layer": "PRIMITIVE",
|
|
194
|
+
"title_zh": "可搜索选择器",
|
|
195
|
+
"summary_zh": "可搜索的选项选择器:aria 模式=combobox(popup=listbox 变体);四键键盘词表+两条行为契约(selection_follows_focus/single_select);anatomy 词表照 Radix Select 16 部件。",
|
|
196
|
+
"semantic": {
|
|
197
|
+
"responsibility": "从大选项集中按关键词检索并选择(车型/供应商选择器类)",
|
|
198
|
+
"when_to_use": "选项多到需要搜索;可搜索选 combobox、纯选择选 listbox(aria_pattern 分型——核实差异表 #6)",
|
|
199
|
+
"when_not_to_use": "选项少(≤10)用纯 Select;自由文本用 Input",
|
|
200
|
+
},
|
|
201
|
+
"composition": {"requires": [], "optional": [], "incompatible": []},
|
|
202
|
+
"aria_pattern": "https://www.w3.org/WAI/ARIA/apg/patterns/combobox/",
|
|
203
|
+
"anatomy": ["trigger", "input", "popup", "option", "clear_button"],
|
|
204
|
+
"anatomy_reference_radix": ["Root", "Trigger", "Value", "Icon", "Portal", "Content", "Viewport", "Item", "ItemText", "ItemIndicator", "ScrollUpButton", "ScrollDownButton", "Group", "Label", "Separator", "Arrow"],
|
|
205
|
+
"keyboard": ["ArrowDown", "ArrowUp", "Enter", "Escape"],
|
|
206
|
+
"keyboard_contracts": ["selection_follows_focus", "single_select", "printable_characters_refocus_input"],
|
|
207
|
+
"variants": {"selection": ["single", "multiple"]},
|
|
208
|
+
"forbidden": ["page_local_custom_select", "anonymous_dropdown_copy"],
|
|
209
|
+
"x-research-anchors": {
|
|
210
|
+
"note": "四键语义按 APG combobox listbox-popup 段落核实并补两条契约(差异表 #6 裁决);anatomy 全表为 Radix Select 页实抓",
|
|
211
|
+
"sources": [
|
|
212
|
+
{"url": "https://www.w3.org/WAI/ARIA/apg/patterns/combobox/", "fetched": FETCH},
|
|
213
|
+
{"url": "https://www.radix-ui.com/primitives/docs/components/select", "fetched": FETCH},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
materials["archetype.component.data_grid.json"] = {
|
|
219
|
+
"id": "COMPONENT_ARCHETYPE.DATA_GRID",
|
|
220
|
+
"kind": "archetype",
|
|
221
|
+
"layer": "PRIMITIVE",
|
|
222
|
+
"title_zh": "数据网格",
|
|
223
|
+
"summary_zh": "重量级数据网格:默认能力集(分页/排序/筛选/行选/固定/空态等)以 AntD Table demo 锚点为词表,role/键盘契约以 APG grid 为准,两源拼装各管一层。",
|
|
224
|
+
"semantic": {
|
|
225
|
+
"responsibility": "结构化数据的表格化呈现与行级交互",
|
|
226
|
+
"when_to_use": "主数据/查询结果的表格面;只读展示表可退回 table role(gating 条件)",
|
|
227
|
+
"when_not_to_use": "轻量静态表格(table role 语义足够时禁滥用 grid role)",
|
|
228
|
+
},
|
|
229
|
+
"composition": {"requires": [], "optional": ["COMPONENT_ARCHETYPE.SEARCH_INPUT", "COMPONENT_ARCHETYPE.BUTTON"], "incompatible": []},
|
|
230
|
+
"aria_pattern": "https://www.w3.org/WAI/ARIA/apg/patterns/grid/",
|
|
231
|
+
"default_capabilities": ["pagination", "sorting_single", "sorting_multi", "filtering", "filter_reset", "row_selection", "fixed_header_columns", "ellipsis", "empty_state", "summary", "responsive"],
|
|
232
|
+
"extended_capabilities": ["editable_cell", "editable_row", "expand", "tree_data", "drag_sort", "virtual", "grouping_columns"],
|
|
233
|
+
"keyboard_navigation": ["ArrowRight", "ArrowLeft", "ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", "Control+Home", "Control+End"],
|
|
234
|
+
"keyboard_selection": ["Control+Space", "Shift+Space", "Control+A", "Shift+Arrow"],
|
|
235
|
+
"structural_contracts": ["single_tab_stop", "focus_managed_internally"],
|
|
236
|
+
"x-research-anchors": {
|
|
237
|
+
"note": "能力词表=AntD Table demo 锚点实抓(v6.6.2);键盘/role 契约=APG grid pattern 实抓;virtual 为 AntD 一等 prop",
|
|
238
|
+
"sources": [
|
|
239
|
+
{"url": "https://ant.design/components/table", "fetched": FETCH},
|
|
240
|
+
{"url": "https://www.w3.org/WAI/ARIA/apg/patterns/grid/", "fetched": FETCH},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
materials["archetype.component.dialog.json"] = {
|
|
246
|
+
"id": "COMPONENT_ARCHETYPE.DIALOG",
|
|
247
|
+
"kind": "archetype",
|
|
248
|
+
"layer": "PRIMITIVE",
|
|
249
|
+
"title_zh": "对话框",
|
|
250
|
+
"summary_zh": "模态对话框原语:anatomy 八部件(Radix 实抓)中 Title/Description 为必配 a11y 部件;对话框族按模态/方向/风险分型(Modal/Drawer/Popconfirm/Result——AntD Feedback 分型)。",
|
|
251
|
+
"semantic": {
|
|
252
|
+
"responsibility": "中断式任务流(确认/编辑/呈现结果)的容器",
|
|
253
|
+
"when_to_use": "需要用户明确决策或输入且不能被后台打断时",
|
|
254
|
+
"when_not_to_use": "非阻断提示(Toast/Message);轻确认用 Popconfirm 分型",
|
|
255
|
+
},
|
|
256
|
+
"composition": {"requires": [], "optional": [], "incompatible": []},
|
|
257
|
+
"aria_pattern": "https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/",
|
|
258
|
+
"anatomy": ["Root", "Trigger", "Portal", "Overlay", "Content", "Close", "Title", "Description"],
|
|
259
|
+
"required_bindings": ["Title", "Description"],
|
|
260
|
+
"family_variants": {"modal_task": "任务模态", "drawer_side": "侧滑面板", "popconfirm_light": "轻确认", "result_page": "结果页"},
|
|
261
|
+
"props_convention": "受控/非受控成对命名(open/defaultOpen/onOpenChange——Radix 实抓约定)",
|
|
262
|
+
"x-research-anchors": {
|
|
263
|
+
"note": "anatomy 八部件与 modal prop 默认值为 Radix Dialog 页实抓;族分型参照 AntD Feedback 类(Modal/Drawer/Popconfirm/Result)",
|
|
264
|
+
"sources": [
|
|
265
|
+
{"url": "https://www.radix-ui.com/primitives/docs/components/dialog", "fetched": FETCH},
|
|
266
|
+
{"url": "https://ant.design/components/overview", "fetched": FETCH},
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def main():
|
|
273
|
+
os.makedirs(OUT, exist_ok=True)
|
|
274
|
+
for name, body in materials.items():
|
|
275
|
+
path = os.path.join(OUT, name)
|
|
276
|
+
with open(path, "w", encoding="utf-8", newline="\n") as f:
|
|
277
|
+
json.dump(body, f, ensure_ascii=False, indent=2)
|
|
278
|
+
f.write("\n")
|
|
279
|
+
print("wrote", name, "id=", body["id"])
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
if __name__ == "__main__":
|
|
283
|
+
main()
|