@morya-ui/mcp 0.3.8 → 0.4.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/data/catalog.json +21699 -15787
- package/data/example-coverage.json +713 -99
- package/data/golden-pages/dashboard-page.vue +25 -2
- package/data/golden-pages/detail-page.vue +41 -72
- package/data/golden-pages/empty-state.vue +1 -1
- package/data/golden-pages/landing-page.vue +58 -34
- package/data/golden-pages/login-page.vue +23 -10
- package/dist/__tests__/page-snippets.test.js +15 -0
- package/dist/decisions.js +1 -1
- package/dist/page-snippets.js +58 -16
- package/dist/patterns.js +30 -11
- package/dist/reference-brief.js +11 -6
- package/package.json +1 -1
package/dist/page-snippets.js
CHANGED
|
@@ -615,15 +615,15 @@ const loading = ref(false)`,
|
|
|
615
615
|
id: 'empty-block',
|
|
616
616
|
title: '空状态 MEmpty',
|
|
617
617
|
titleEn: 'Empty state with MEmpty',
|
|
618
|
-
description: '列表或内容区无数据时使用 MEmpty
|
|
619
|
-
descriptionEn: 'MEmpty for no-data; domain next-step copy; one primary in #extra.',
|
|
618
|
+
description: '列表或内容区无数据时使用 MEmpty;主区域优先 illustration(no-content / no-result / …);标题/说明写领域下一步,#extra 放唯一 primary。',
|
|
619
|
+
descriptionEn: 'MEmpty for no-data; prefer illustration on main empties; domain next-step copy; one primary in #extra.',
|
|
620
620
|
pageTypes: ['list', 'common'],
|
|
621
|
-
keywords: ['空状态', '无数据', 'empty', 'zero state', 'no data'],
|
|
621
|
+
keywords: ['空状态', '无数据', 'empty', 'zero state', 'no data', 'illustration'],
|
|
622
622
|
imports: ['MEmpty', 'MButton'],
|
|
623
623
|
template: `<MEmpty
|
|
624
624
|
title="还没有成员"
|
|
625
625
|
description="邀请或新建第一位成员后,这里会显示状态与最近活动。"
|
|
626
|
-
|
|
626
|
+
illustration="no-content"
|
|
627
627
|
>
|
|
628
628
|
<template #extra>
|
|
629
629
|
<MButton severity="primary">新建成员</MButton>
|
|
@@ -632,11 +632,13 @@ const loading = ref(false)`,
|
|
|
632
632
|
</MEmpty>`,
|
|
633
633
|
rules: [
|
|
634
634
|
'正常无数据用 MEmpty,不要用错误色',
|
|
635
|
+
'主区域空态优先 illustration(no-content / no-result / no-message / network-error…);轻量内嵌可用 icon',
|
|
635
636
|
'主 CTA 用 severity="primary",次动作用 text/secondary',
|
|
636
637
|
'文案写清「现在可以做什么」,禁止「暂无数据 / No data / 示例」',
|
|
637
638
|
],
|
|
638
639
|
rulesEn: [
|
|
639
640
|
'Use MEmpty for normal emptiness, not error colors',
|
|
641
|
+
'Main-region empties prefer illustration; light in-table empties may use icon',
|
|
640
642
|
'Primary CTA with severity="primary"; lesser actions text/secondary',
|
|
641
643
|
'Copy says what to do next — no “暂无数据 / No data / 示例”',
|
|
642
644
|
],
|
|
@@ -811,8 +813,8 @@ const roleOptions = [
|
|
|
811
813
|
id: 'dashboard-chart-card',
|
|
812
814
|
title: '仪表盘图表卡片',
|
|
813
815
|
titleEn: 'Dashboard chart card',
|
|
814
|
-
description: 'MCard shadow="always" + MEmpty 作为图表占位。',
|
|
815
|
-
descriptionEn: 'MCard with shadow="always" and MEmpty for chart pending state.',
|
|
816
|
+
description: 'MCard shadow="always" + MEmpty illustration 作为图表占位。',
|
|
817
|
+
descriptionEn: 'MCard with shadow="always" and illustrated MEmpty for chart pending state.',
|
|
816
818
|
pageTypes: ['dashboard'],
|
|
817
819
|
keywords: ['chart', '图表', 'placeholder', 'card', 'trend'],
|
|
818
820
|
imports: ['MCard', 'MEmpty', 'MSkeleton'],
|
|
@@ -821,12 +823,17 @@ const roleOptions = [
|
|
|
821
823
|
<MEmpty
|
|
822
824
|
v-else
|
|
823
825
|
aria-label="图表占位"
|
|
824
|
-
title="
|
|
825
|
-
description="
|
|
826
|
+
title="还没有趋势数据"
|
|
827
|
+
description="接入图表后将展示近 7 日活跃与转化。"
|
|
828
|
+
illustration="activity-low"
|
|
826
829
|
/>
|
|
827
830
|
</MCard>`,
|
|
828
|
-
rules: ['图表区适合 MCard,因为需要 card 标题', '加载中用 MSkeleton'],
|
|
829
|
-
rulesEn: [
|
|
831
|
+
rules: ['图表区适合 MCard,因为需要 card 标题', '加载中用 MSkeleton', '占位空态用 illustration,避免裸 icon'],
|
|
832
|
+
rulesEn: [
|
|
833
|
+
'Charts belong in MCard when a card title is needed',
|
|
834
|
+
'Use MSkeleton while loading',
|
|
835
|
+
'Pending chart empties prefer illustration over a bare icon',
|
|
836
|
+
],
|
|
830
837
|
avoid: ['不要用 MPageFilters 风格包裹图表'],
|
|
831
838
|
avoidEn: ['Do not wrap charts with MPageFilters styling'],
|
|
832
839
|
},
|
|
@@ -904,10 +911,10 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
|
|
|
904
911
|
pageTypes: ['detail'],
|
|
905
912
|
keywords: ['detail', '详情', 'edit', 'header'],
|
|
906
913
|
imports: ['MPageHeader', 'MButton', 'MStatus', 'MSpace'],
|
|
907
|
-
template: `<MPageHeader title="
|
|
914
|
+
template: `<MPageHeader title="林晓" description="查看账号摘要、属性与近期活动。">
|
|
908
915
|
<template #actions>
|
|
909
916
|
<MSpace>
|
|
910
|
-
<MStatus label="
|
|
917
|
+
<MStatus label="启用" severity="success" />
|
|
911
918
|
<MButton severity="primary">编辑</MButton>
|
|
912
919
|
<MButton severity="danger" text>删除</MButton>
|
|
913
920
|
</MSpace>
|
|
@@ -918,6 +925,38 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
|
|
|
918
925
|
avoid: ['不要把操作散落到多个无关区域'],
|
|
919
926
|
avoidEn: ['Do not scatter actions across unrelated areas'],
|
|
920
927
|
},
|
|
928
|
+
{
|
|
929
|
+
id: 'detail-descriptions',
|
|
930
|
+
title: '详情属性 Descriptions',
|
|
931
|
+
titleEn: 'Detail attributes with MDescriptions',
|
|
932
|
+
description: '详情页属性网格用 MDescriptions / MDescriptionsItem;多字段对比可 bordered。',
|
|
933
|
+
descriptionEn: 'Detail attribute grids use MDescriptions / MDescriptionsItem; bordered when comparing many fields.',
|
|
934
|
+
pageTypes: ['detail'],
|
|
935
|
+
keywords: ['descriptions', '属性', '详情字段', 'detail props', 'dl'],
|
|
936
|
+
imports: ['MDescriptions', 'MDescriptionsItem', 'MStatus'],
|
|
937
|
+
template: `<MDescriptions title="基本信息" bordered :column="2">
|
|
938
|
+
<MDescriptionsItem label="姓名">林晓</MDescriptionsItem>
|
|
939
|
+
<MDescriptionsItem label="邮箱">linxiao@example.com</MDescriptionsItem>
|
|
940
|
+
<MDescriptionsItem label="角色">成员</MDescriptionsItem>
|
|
941
|
+
<MDescriptionsItem label="部门">产品设计</MDescriptionsItem>
|
|
942
|
+
<MDescriptionsItem label="入职日期">2025-03-12</MDescriptionsItem>
|
|
943
|
+
<MDescriptionsItem label="状态">
|
|
944
|
+
<MStatus label="启用" severity="success" />
|
|
945
|
+
</MDescriptionsItem>
|
|
946
|
+
</MDescriptions>`,
|
|
947
|
+
rules: [
|
|
948
|
+
'属性网格用 MDescriptions,不要手写 <dl> / 嵌套表格',
|
|
949
|
+
'字段较多或需对齐对比时用 bordered',
|
|
950
|
+
'状态值内嵌 MStatus,不要裸色文本',
|
|
951
|
+
],
|
|
952
|
+
rulesEn: [
|
|
953
|
+
'Use MDescriptions for attribute grids — not hand-rolled <dl> / nested tables',
|
|
954
|
+
'Use bordered when comparing many fields',
|
|
955
|
+
'Embed MStatus for status values — no raw colored text',
|
|
956
|
+
],
|
|
957
|
+
avoid: ['不要用自定义 CSS grid 复刻 Descriptions', '不要把叙事型活动流硬塞进 Descriptions'],
|
|
958
|
+
avoidEn: ['Do not reinvent Descriptions with custom CSS grids', 'Do not force narrative activity into Descriptions'],
|
|
959
|
+
},
|
|
921
960
|
{
|
|
922
961
|
id: 'page-header-actions',
|
|
923
962
|
title: '页头单主操作',
|
|
@@ -1207,14 +1246,15 @@ async function finish() {
|
|
|
1207
1246
|
id: 'auth-split-shell',
|
|
1208
1247
|
title: '登录左右分栏壳',
|
|
1209
1248
|
titleEn: 'Auth split brand + form shell',
|
|
1210
|
-
description: '左品牌 /
|
|
1211
|
-
descriptionEn: 'Brand left / form right;
|
|
1249
|
+
description: '左品牌 / 右表单;MConfigProvider input-variant="filled";可选 themeConfig 品牌种子;失败用 role="alert" 或 errorMessage,不用 Toast。',
|
|
1250
|
+
descriptionEn: 'Brand left / form right; filled inputs via ConfigProvider; optional themeConfig seed; failures via role="alert" or errorMessage, not Toast.',
|
|
1212
1251
|
pageTypes: ['common'],
|
|
1213
|
-
keywords: ['登录', '认证', '分栏', 'login', 'auth', 'split', 'brand'],
|
|
1252
|
+
keywords: ['登录', '认证', '分栏', 'login', 'auth', 'split', 'brand', 'filled', 'themeConfig'],
|
|
1214
1253
|
imports: ['MForm', 'MFormItem', 'MInput', 'MInputPassword', 'MButton', 'MSpace', 'MConfigProvider', 'zhCN'],
|
|
1215
1254
|
scriptSetup: `const submitting = ref(false)
|
|
1216
1255
|
const formError = ref('')
|
|
1217
1256
|
const model = reactive({ email: '', password: '' })
|
|
1257
|
+
const themeConfig = { seed: { colorPrimary: '#0b6e4f' } }
|
|
1218
1258
|
|
|
1219
1259
|
async function onSubmit() {
|
|
1220
1260
|
formError.value = ''
|
|
@@ -1227,7 +1267,7 @@ async function onSubmit() {
|
|
|
1227
1267
|
submitting.value = false
|
|
1228
1268
|
}
|
|
1229
1269
|
}`,
|
|
1230
|
-
template: `<MConfigProvider :locale="zhCN">
|
|
1270
|
+
template: `<MConfigProvider :locale="zhCN" input-variant="filled" :theme-config="themeConfig">
|
|
1231
1271
|
<div class="login-shell">
|
|
1232
1272
|
<aside class="login-brand" aria-label="品牌">
|
|
1233
1273
|
<p class="login-brand__mark">产品名</p>
|
|
@@ -1258,11 +1298,13 @@ async function onSubmit() {
|
|
|
1258
1298
|
</div>
|
|
1259
1299
|
</MConfigProvider>`,
|
|
1260
1300
|
rules: [
|
|
1301
|
+
'认证表单默认 input-variant="filled";品牌色走 themeConfig.seed,不要页级 hex',
|
|
1261
1302
|
'品牌区用 --m-* / color-mix,默认扁平勿叠 aurora',
|
|
1262
1303
|
'失败留在表单区(role="alert" 或 errorMessage),不要 Toast',
|
|
1263
1304
|
'窄屏改为单栏:表单在上或品牌收短',
|
|
1264
1305
|
],
|
|
1265
1306
|
rulesEn: [
|
|
1307
|
+
'Auth forms default to input-variant="filled"; brand via themeConfig.seed — no page-level hex',
|
|
1266
1308
|
'Brand panel: --m-* / color-mix; flat by default — no stacked aurora',
|
|
1267
1309
|
'Keep failures in the form (role="alert" or errorMessage), not Toast',
|
|
1268
1310
|
'Narrow screens: single column',
|
package/dist/patterns.js
CHANGED
|
@@ -222,7 +222,9 @@ export const pagePatterns = [
|
|
|
222
222
|
{ component: 'Breadcrumb', role: '页面层级导航' },
|
|
223
223
|
{ component: 'PageContent', role: '仪表盘垂直间距', reason: 'density="spacious"' },
|
|
224
224
|
{ component: 'PageHeader', role: '页面标题' },
|
|
225
|
-
{ component: '
|
|
225
|
+
{ component: 'Alert', role: '运营提示 / 依赖降级', required: false },
|
|
226
|
+
{ component: 'PageStat', role: 'KPI 指标卡(含趋势)' },
|
|
227
|
+
{ component: 'Statistic', role: '卡片内无趋势的纯数字指标', required: false },
|
|
226
228
|
{ component: 'PagePlaceholder', role: '图表占位' },
|
|
227
229
|
{ component: 'Grid', role: 'KPI 与内容区栅格' },
|
|
228
230
|
{ component: 'GridItem', role: '栅格子项' },
|
|
@@ -230,7 +232,8 @@ export const pagePatterns = [
|
|
|
230
232
|
{ component: 'Icon', role: 'KPI 图标', required: false },
|
|
231
233
|
{ component: 'Tag', role: '分类标签和告警级别', required: false },
|
|
232
234
|
{ component: 'Status', role: '行内状态圆点+文案', required: false },
|
|
233
|
-
{ component: 'Empty', role: '
|
|
235
|
+
{ component: 'Empty', role: '图表/明细空态(优先 illustration)', required: false },
|
|
236
|
+
{ component: 'List', role: '轻量动态流', required: false },
|
|
234
237
|
{ component: 'Result', role: '接口失败结果区', required: false },
|
|
235
238
|
{ component: 'Table', role: '明细数据', required: false },
|
|
236
239
|
{ component: 'Button', role: '刷新、查看详情和快捷操作', required: false },
|
|
@@ -305,12 +308,18 @@ export const pagePatterns = [
|
|
|
305
308
|
structure: [
|
|
306
309
|
'MPageContent (or MTable #empty)',
|
|
307
310
|
'└── MEmpty',
|
|
308
|
-
' ├── icon / image',
|
|
311
|
+
' ├── illustration (preferred) / icon / image',
|
|
309
312
|
' ├── title + description',
|
|
310
313
|
' └── #extra primary + optional secondary MButton',
|
|
311
314
|
],
|
|
312
315
|
layout: { page: '空态在当前内容区域内居中,不一定占满整个视口', content: '说明原因、下一步动作和可选的辅助信息', responsive: '保持按钮可触达,窄屏垂直排列' },
|
|
313
|
-
styleRules: [
|
|
316
|
+
styleRules: [
|
|
317
|
+
'空态文案使用中性、可行动的语气',
|
|
318
|
+
'主区域优先 illustration(no-content / no-result / …),轻量内嵌可用 icon',
|
|
319
|
+
'主恢复动作使用 primary MButton,次动作使用 text',
|
|
320
|
+
'不要用错误色表达正常的无数据状态',
|
|
321
|
+
'颜色与间距使用 --m-* Token',
|
|
322
|
+
],
|
|
314
323
|
interactionRules: ['搜索无结果提供清除筛选或修改条件入口', '首次使用提供创建或导入入口', '保留页面标题和上下文导航'],
|
|
315
324
|
avoid: ['不要只显示“暂无数据”而没有下一步', '不要把无数据和接口错误混为一谈', '不要堆 emoji 或促销贴纸'],
|
|
316
325
|
},
|
|
@@ -428,9 +437,13 @@ export const pagePatterns = [
|
|
|
428
437
|
keywords: ['详情', '明细', '查看', '概览', '属性', '详情页', 'detail', 'overview', 'profile'],
|
|
429
438
|
components: [
|
|
430
439
|
{ component: 'Breadcrumb', role: '页面层级导航' },
|
|
431
|
-
{ component: '
|
|
440
|
+
{ component: 'PageHeader', role: '标题、状态与主操作' },
|
|
441
|
+
{ component: 'Descriptions', role: '属性网格(替代手写 dl)' },
|
|
442
|
+
{ component: 'Card', role: '内容分组表面', required: false },
|
|
432
443
|
{ component: 'Status', role: '标题旁轻量状态(圆点+文案)', required: false },
|
|
433
444
|
{ component: 'Tag', role: '分类/强调态标签', required: false },
|
|
445
|
+
{ component: 'List', role: '叙事型近期活动流', required: false },
|
|
446
|
+
{ component: 'Table', role: '需对齐列的相关数据', required: false },
|
|
434
447
|
{ component: 'Divider', role: '内容分组分隔', required: false },
|
|
435
448
|
{ component: 'Button', role: '编辑、返回和危险操作' },
|
|
436
449
|
{ component: 'Dialog', role: '危险操作确认', required: false },
|
|
@@ -442,19 +455,19 @@ export const pagePatterns = [
|
|
|
442
455
|
'├── PageHeader',
|
|
443
456
|
'│ ├── Title + MStatus (or MTag)',
|
|
444
457
|
'│ └── Actions',
|
|
445
|
-
'├── Summary
|
|
446
|
-
'├──
|
|
447
|
-
'└── Related
|
|
458
|
+
'├── Summary tags (optional)',
|
|
459
|
+
'├── MDescriptions (attributes)',
|
|
460
|
+
'└── Related: MList feed or MTable',
|
|
448
461
|
],
|
|
449
462
|
layout: {
|
|
450
463
|
page: '使用清晰的标题区和多个语义分组,避免一张超长 Card',
|
|
451
464
|
header: '资源名称、状态和上下文操作集中在顶部',
|
|
452
|
-
content: '
|
|
465
|
+
content: '属性用 MDescriptions;叙事活动用 MList;需对齐列时用 MTable',
|
|
453
466
|
actions: '编辑为主操作,返回为次操作,删除放在低强调区域',
|
|
454
467
|
},
|
|
455
468
|
styleRules: [
|
|
456
469
|
'轻量状态优先 MStatus;需要芯片感或可关闭时用 MTag',
|
|
457
|
-
'
|
|
470
|
+
'属性网格用 MDescriptions,不要手写 dl',
|
|
458
471
|
'编辑使用 primary 或 outlined MButton,删除使用 danger',
|
|
459
472
|
'不使用大面积自定义背景色覆盖组件库 surface Token',
|
|
460
473
|
],
|
|
@@ -469,7 +482,13 @@ export const pagePatterns = [
|
|
|
469
482
|
'不要让详情页的操作按钮分散在多个无关区域',
|
|
470
483
|
],
|
|
471
484
|
goldenPage: 'detail-page',
|
|
472
|
-
suggestedSnippets: [
|
|
485
|
+
suggestedSnippets: [
|
|
486
|
+
'detail-toolbar',
|
|
487
|
+
'detail-descriptions',
|
|
488
|
+
'form-in-dialog',
|
|
489
|
+
'confirm-delete',
|
|
490
|
+
'list-status-dot',
|
|
491
|
+
],
|
|
473
492
|
},
|
|
474
493
|
{
|
|
475
494
|
id: 'result-page',
|
package/dist/reference-brief.js
CHANGED
|
@@ -69,8 +69,8 @@ const BLOCK_TO_SNIPPET = {
|
|
|
69
69
|
},
|
|
70
70
|
empty: {
|
|
71
71
|
snippetId: 'empty-block',
|
|
72
|
-
notesZh: '空态带下一步 CTA',
|
|
73
|
-
notesEn: 'Empty state with
|
|
72
|
+
notesZh: '空态带下一步 CTA;主区域优先 illustration',
|
|
73
|
+
notesEn: 'Empty state with next-step CTA; prefer illustration on main regions',
|
|
74
74
|
},
|
|
75
75
|
'form-header': {
|
|
76
76
|
snippetId: 'form-header',
|
|
@@ -94,8 +94,8 @@ const BLOCK_TO_SNIPPET = {
|
|
|
94
94
|
},
|
|
95
95
|
chart: {
|
|
96
96
|
snippetId: 'dashboard-chart-card',
|
|
97
|
-
notesZh: '图表区 MCard + MSkeleton / MEmpty
|
|
98
|
-
notesEn: 'Chart area: MCard + MSkeleton / MEmpty
|
|
97
|
+
notesZh: '图表区 MCard + MSkeleton / 带 illustration 的 MEmpty',
|
|
98
|
+
notesEn: 'Chart area: MCard + MSkeleton / illustrated MEmpty',
|
|
99
99
|
},
|
|
100
100
|
recent: {
|
|
101
101
|
snippetId: 'dashboard-recent-table',
|
|
@@ -107,6 +107,11 @@ const BLOCK_TO_SNIPPET = {
|
|
|
107
107
|
notesZh: '详情顶栏:状态 + 唯一编辑 primary',
|
|
108
108
|
notesEn: 'Detail toolbar: status + one edit primary',
|
|
109
109
|
},
|
|
110
|
+
descriptions: {
|
|
111
|
+
snippetId: 'detail-descriptions',
|
|
112
|
+
notesZh: '属性网格用 MDescriptions,不要手写 dl',
|
|
113
|
+
notesEn: 'Attribute grids use MDescriptions, not hand-rolled dl',
|
|
114
|
+
},
|
|
110
115
|
result: {
|
|
111
116
|
snippetId: 'result-block',
|
|
112
117
|
notesZh: '流程终点用 MResult',
|
|
@@ -119,8 +124,8 @@ const BLOCK_TO_SNIPPET = {
|
|
|
119
124
|
},
|
|
120
125
|
auth: {
|
|
121
126
|
snippetId: 'auth-split-shell',
|
|
122
|
-
notesZh: '
|
|
123
|
-
notesEn: 'Auth split shell; brand panel uses --m-* only',
|
|
127
|
+
notesZh: '登录分栏壳;filled + 可选 themeConfig;品牌面只用 --m-*',
|
|
128
|
+
notesEn: 'Auth split shell; filled + optional themeConfig; brand panel uses --m-* only',
|
|
124
129
|
},
|
|
125
130
|
shell: {
|
|
126
131
|
snippetId: 'layout-app-shell',
|
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.4.0",
|
|
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",
|