@morya-ui/mcp 0.4.5 → 0.5.1
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/data/catalog.json +481 -326
- package/data/example-coverage.json +56 -48
- package/data/golden-pages/dashboard-page.vue +20 -14
- package/data/golden-pages/detail-page.vue +3 -2
- package/data/golden-pages/empty-state.vue +7 -6
- package/data/golden-pages/form-in-dialog.vue +4 -5
- package/data/golden-pages/form-page.vue +1 -1
- package/data/golden-pages/landing-page.vue +8 -41
- package/data/golden-pages/list-page-dense.vue +12 -14
- package/data/golden-pages/list-page-rail.vue +16 -82
- package/data/golden-pages/list-page.vue +10 -8
- package/data/golden-pages/login-page.vue +10 -29
- package/data/golden-pages/result-page.vue +7 -18
- package/data/golden-pages/settings-page.vue +3 -3
- package/data/golden-pages/wizard-form.vue +2 -2
- package/dist/__tests__/tools.test.js +24 -1
- package/dist/decisions.js +1299 -6
- package/dist/index.js +1 -1
- package/dist/page-snippets.d.ts +4 -0
- package/dist/page-snippets.js +5 -0
- package/dist/tools.js +16 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ register('get_pattern', 'Read the structure, component composition, layout, and
|
|
|
86
86
|
pattern: z.string().min(1),
|
|
87
87
|
mode: z.string().optional(),
|
|
88
88
|
}, async (args) => handlers.getPattern(args));
|
|
89
|
-
register('recommend_page', 'Recommend a page pattern and component composition from product intent. Pass style as free-text look; density=compact|default|spacious; brief for reference fidelity mapping; includeScaffold
|
|
89
|
+
register('recommend_page', 'Recommend a page pattern and component composition from product intent. Default path composes suggestedSnippets + get_page_snippet (golden pages are optional block-order checks, not a default look). Pass style as free-text look; density=compact|default|spacious; brief for reference fidelity mapping; includeScaffold only when you explicitly need the golden structure source.', {
|
|
90
90
|
intent: z.string().min(1),
|
|
91
91
|
pageType: z.string().optional(),
|
|
92
92
|
features: z.array(z.string()).max(20).optional(),
|
package/dist/page-snippets.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export interface PageSnippet {
|
|
|
14
14
|
rulesEn: string[];
|
|
15
15
|
avoid: string[];
|
|
16
16
|
avoidEn: string[];
|
|
17
|
+
/** Mutually exclusive sibling snippets (pick one for the same block). */
|
|
18
|
+
excludes?: string[];
|
|
19
|
+
/** Snippets commonly composed together (weak pointer for polish/validate). */
|
|
20
|
+
pairsWith?: string[];
|
|
17
21
|
}
|
|
18
22
|
export declare const pageSnippets: PageSnippet[];
|
|
19
23
|
export declare function findPageSnippet(id: string): PageSnippet | undefined;
|
package/dist/page-snippets.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const pageSnippets = [
|
|
2
2
|
{
|
|
3
3
|
id: 'list-filters',
|
|
4
|
+
excludes: ['list-filters-collapsible', 'list-filters-stack', 'list-filters-dense'],
|
|
4
5
|
title: '列表页基础筛选栏',
|
|
5
6
|
titleEn: 'Basic list filter bar',
|
|
6
7
|
description: '关键词 + 1–2 个枚举 + 查询/重置。条件少、无需已选摘要时用本片段;有次要条件用 list-filters-collapsible;默认列表推荐 list-filters-stack。',
|
|
@@ -61,6 +62,7 @@ function resetFilters() {
|
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
id: 'list-filters-collapsible',
|
|
65
|
+
excludes: ['list-filters', 'list-filters-stack', 'list-filters-dense'],
|
|
64
66
|
title: '列表页折叠高级筛选',
|
|
65
67
|
titleEn: 'Collapsible advanced list filters',
|
|
66
68
|
description: '常用条件在 default,次要条件在 #advanced;对齐 list-page 黄金结构。通常再接 list-filter-chips,或直接用 list-filters-stack。',
|
|
@@ -215,6 +217,8 @@ function clearFilter(key: string) {
|
|
|
215
217
|
},
|
|
216
218
|
{
|
|
217
219
|
id: 'list-filters-stack',
|
|
220
|
+
excludes: ['list-filters', 'list-filters-collapsible', 'list-filters-dense'],
|
|
221
|
+
pairsWith: ['list-filter-chips'],
|
|
218
222
|
title: '列表筛选完整栈(折叠 + 已选)',
|
|
219
223
|
titleEn: 'Full list filter stack (collapsible + chips)',
|
|
220
224
|
description: '默认推荐的列表筛选组合:MPageFilters collapsible + #advanced + MPageFilterChips。对齐 list-page / list-page-rail 黄金结构;dense 无高级条件时可改用 list-filters(plain/small)。',
|
|
@@ -352,6 +356,7 @@ function resetFilters() {
|
|
|
352
356
|
},
|
|
353
357
|
{
|
|
354
358
|
id: 'list-filters-dense',
|
|
359
|
+
excludes: ['list-filters', 'list-filters-collapsible', 'list-filters-stack'],
|
|
355
360
|
title: '列表页紧凑筛选栏',
|
|
356
361
|
titleEn: 'Dense list filter bar',
|
|
357
362
|
description: 'list-page-dense craft:variant="plain" + size="small",字段少、无折叠/Chips。监控/告警等高密度列表用。',
|
package/dist/tools.js
CHANGED
|
@@ -1125,6 +1125,22 @@ export function createToolHandlers(catalog = loadCatalog()) {
|
|
|
1125
1125
|
m = iconOnlyRe.exec(code);
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
+
// Craft: composition relations — multiple filter regions on one page
|
|
1129
|
+
{
|
|
1130
|
+
const filterCount = (code.match(/<MPageFilters\b/gi) || []).length;
|
|
1131
|
+
if (filterCount > 1) {
|
|
1132
|
+
push('craft', 'composition', 'multiple-filter-regions', '组合建议:一个列表视图通常只保留一个 MPageFilters 筛选区(list-filters / collapsible / stack / dense 四选一)。', 'Composition: keep a single MPageFilters region per list view (pick one of list-filters / collapsible / stack / dense).');
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
// Craft: composition relations — filter stack already carries chips; avoid stacking a standalone chip row
|
|
1136
|
+
if (/<MPageFilters\b[^>]*\bcollapsible\b[\s\S]*?<\/MPageFilters>/i.test(code) &&
|
|
1137
|
+
/<MPageFilterChips\b/i.test(code)) {
|
|
1138
|
+
push('craft', 'composition', 'redundant-filter-chips', '组合建议:使用折叠筛选栈(list-filters-stack / collapsible 已含已选摘要)时,通常不再叠加独立 MPageFilterChips。', 'Composition: when the collapsible filter stack already renders active chips, avoid adding a standalone MPageFilterChips row.');
|
|
1139
|
+
}
|
|
1140
|
+
// Craft: composition relations — density mixed within one page
|
|
1141
|
+
if (/density\s*=\s*["']compact["']/i.test(code) && /density\s*=\s*["']spacious["']/i.test(code)) {
|
|
1142
|
+
push('craft', 'composition', 'mixed-density', '组合建议:同一页面内保持密度一致,不要混用 compact 与 spacious。', 'Composition: keep density consistent within one page — do not mix compact and spacious.');
|
|
1143
|
+
}
|
|
1128
1144
|
// Brief fidelity: required blocks / components
|
|
1129
1145
|
const mapped = args.brief
|
|
1130
1146
|
? mapReferenceBrief(args.brief)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morya-ui/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"description": "MCP server for morya-ui — component docs, examples, and usage guidance for AI coding agents.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp#readme",
|