@morya-ui/mcp 0.4.2 → 0.4.3
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 +223 -223
- package/data/example-coverage.json +2 -2
- package/data/golden-pages/dashboard-page.vue +10 -10
- package/data/golden-pages/detail-page.vue +3 -3
- package/data/golden-pages/form-in-dialog.vue +1 -1
- package/data/golden-pages/landing-page.vue +2 -2
- package/data/golden-pages/list-page-dense.vue +1 -1
- package/data/golden-pages/list-page-rail.vue +1 -1
- package/data/golden-pages/list-page.vue +1 -1
- package/dist/__tests__/tools.test.js +2 -2
- package/dist/decisions.js +8 -8
- package/dist/page-snippets.js +13 -13
- package/dist/patterns.d.ts +1 -1
- package/dist/patterns.js +2 -2
- package/dist/reference-brief.js +2 -2
- package/dist/tools.js +4 -4
- package/package.json +1 -1
|
@@ -27,8 +27,8 @@ import {
|
|
|
27
27
|
const stats = [
|
|
28
28
|
{ label: '总用户', value: '12,480', trend: '+8.2%', trendDirection: 'up' as const, trendLabel: '较上月', icon: 'users' },
|
|
29
29
|
{ label: '今日活跃', value: '1,926', trend: '+3.1%', trendDirection: 'up' as const, trendLabel: '较昨日', icon: 'activity' },
|
|
30
|
-
{ label: '待处理工单', value: '47', trend: '-12%', trendDirection: 'down' as const, trendLabel: '较上周',
|
|
31
|
-
{ label: '系统健康', value: '99.9%', trend: '稳定',
|
|
30
|
+
{ label: '待处理工单', value: '47', trend: '-12%', trendDirection: 'down' as const, trendLabel: '较上周', trendType: 'warning' as const, icon: 'clipboard' },
|
|
31
|
+
{ label: '系统健康', value: '99.9%', trend: '稳定', trendType: 'secondary' as const, icon: 'heart' },
|
|
32
32
|
]
|
|
33
33
|
|
|
34
34
|
const recentColumns = [
|
|
@@ -44,9 +44,9 @@ const recentRows = [
|
|
|
44
44
|
{ id: 'WO-1022', title: '权限配置咨询', priority: 'low', status: 'done' },
|
|
45
45
|
]
|
|
46
46
|
|
|
47
|
-
function
|
|
47
|
+
function priorityType(p: string) {
|
|
48
48
|
if (p === 'high') return 'danger'
|
|
49
|
-
if (p === 'medium') return '
|
|
49
|
+
if (p === 'medium') return 'warning'
|
|
50
50
|
return 'secondary'
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -62,8 +62,8 @@ function statusLabel(s: string) {
|
|
|
62
62
|
return '已完成'
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function
|
|
66
|
-
if (s === 'open') return '
|
|
65
|
+
function statusType(s: string) {
|
|
66
|
+
if (s === 'open') return 'warning'
|
|
67
67
|
if (s === 'progress') return 'info'
|
|
68
68
|
return 'success'
|
|
69
69
|
}
|
|
@@ -84,7 +84,7 @@ function statusSeverity(s: string) {
|
|
|
84
84
|
/>
|
|
85
85
|
|
|
86
86
|
<MAlert
|
|
87
|
-
|
|
87
|
+
type="info"
|
|
88
88
|
title="报表管道延迟约 15 分钟"
|
|
89
89
|
description="实时告警仍可用;看板数字以管道落库为准。"
|
|
90
90
|
closable
|
|
@@ -96,7 +96,7 @@ function statusSeverity(s: string) {
|
|
|
96
96
|
:label="item.label"
|
|
97
97
|
:value="item.value"
|
|
98
98
|
:trend="item.trend"
|
|
99
|
-
:trend-
|
|
99
|
+
:trend-type="item.trendType ?? 'primary'"
|
|
100
100
|
:trend-direction="item.trendDirection"
|
|
101
101
|
:trend-label="item.trendLabel"
|
|
102
102
|
:icon="item.icon"
|
|
@@ -132,13 +132,13 @@ function statusSeverity(s: string) {
|
|
|
132
132
|
<template #cell-priority="{ value }">
|
|
133
133
|
<MTag
|
|
134
134
|
:value="priorityLabel(String(value))"
|
|
135
|
-
:
|
|
135
|
+
:type="priorityType(String(value))"
|
|
136
136
|
/>
|
|
137
137
|
</template>
|
|
138
138
|
<template #cell-status="{ value }">
|
|
139
139
|
<MStatus
|
|
140
140
|
:label="statusLabel(String(value))"
|
|
141
|
-
:
|
|
141
|
+
:type="statusType(String(value))"
|
|
142
142
|
/>
|
|
143
143
|
</template>
|
|
144
144
|
</MTable>
|
|
@@ -65,7 +65,7 @@ const activityRows = [
|
|
|
65
65
|
<MSpace>
|
|
66
66
|
<MStatus
|
|
67
67
|
:label="profile.status === 'active' ? '启用' : '停用'"
|
|
68
|
-
:
|
|
68
|
+
:type="profile.status === 'active' ? 'success' : 'secondary'"
|
|
69
69
|
/>
|
|
70
70
|
<MButton type="primary">
|
|
71
71
|
编辑
|
|
@@ -83,7 +83,7 @@ const activityRows = [
|
|
|
83
83
|
<MPageSection title="摘要">
|
|
84
84
|
<MSpace wrap style="gap: var(--m-space-2)">
|
|
85
85
|
<MTag :value="profile.role" />
|
|
86
|
-
<MTag :value="profile.dept"
|
|
86
|
+
<MTag :value="profile.dept" type="info" />
|
|
87
87
|
</MSpace>
|
|
88
88
|
<p class="detail-lead">
|
|
89
89
|
工作邮箱 {{ profile.email }} · 入职 {{ profile.joinedAt }}
|
|
@@ -109,7 +109,7 @@ const activityRows = [
|
|
|
109
109
|
<MDescriptionsItem label="状态">
|
|
110
110
|
<MStatus
|
|
111
111
|
:label="profile.status === 'active' ? '启用' : '停用'"
|
|
112
|
-
:
|
|
112
|
+
:type="profile.status === 'active' ? 'success' : 'secondary'"
|
|
113
113
|
/>
|
|
114
114
|
</MDescriptionsItem>
|
|
115
115
|
</MDescriptions>
|
|
@@ -120,7 +120,7 @@ async function onSave() {
|
|
|
120
120
|
<template #cell-status="{ value }">
|
|
121
121
|
<MStatus
|
|
122
122
|
:label="value === 'active' ? '启用' : '停用'"
|
|
123
|
-
:
|
|
123
|
+
:type="value === 'active' ? 'success' : 'secondary'"
|
|
124
124
|
/>
|
|
125
125
|
</template>
|
|
126
126
|
<template #cell-actions="{ row }">
|
|
@@ -88,7 +88,7 @@ const faqTabs = [
|
|
|
88
88
|
</MParagraph>
|
|
89
89
|
<div class="landing-cards">
|
|
90
90
|
<article>
|
|
91
|
-
<MTag value="构建"
|
|
91
|
+
<MTag value="构建" type="info" />
|
|
92
92
|
<MTitle :level="3">
|
|
93
93
|
并行矩阵
|
|
94
94
|
</MTitle>
|
|
@@ -97,7 +97,7 @@ const faqTabs = [
|
|
|
97
97
|
</MParagraph>
|
|
98
98
|
</article>
|
|
99
99
|
<article>
|
|
100
|
-
<MTag value="发布"
|
|
100
|
+
<MTag value="发布" type="success" />
|
|
101
101
|
<MTitle :level="3">
|
|
102
102
|
环境门禁
|
|
103
103
|
</MTitle>
|
|
@@ -137,7 +137,7 @@ const rows = [
|
|
|
137
137
|
<template #cell-status="{ value }">
|
|
138
138
|
<MStatus
|
|
139
139
|
:label="value === 'active' ? '启用' : '停用'"
|
|
140
|
-
:
|
|
140
|
+
:type="value === 'active' ? 'success' : 'secondary'"
|
|
141
141
|
/>
|
|
142
142
|
</template>
|
|
143
143
|
<template #cell-actions>
|
|
@@ -195,7 +195,7 @@ const rows = [
|
|
|
195
195
|
<template #cell-status="{ value }">
|
|
196
196
|
<MStatus
|
|
197
197
|
:label="value === 'active' ? '启用' : '停用'"
|
|
198
|
-
:
|
|
198
|
+
:type="value === 'active' ? 'success' : 'secondary'"
|
|
199
199
|
/>
|
|
200
200
|
</template>
|
|
201
201
|
<template #cell-actions>
|
|
@@ -187,7 +187,7 @@ const rows = [
|
|
|
187
187
|
<template #cell-status="{ value }">
|
|
188
188
|
<MStatus
|
|
189
189
|
:label="value === 'active' ? '启用' : '停用'"
|
|
190
|
-
:
|
|
190
|
+
:type="value === 'active' ? 'success' : 'secondary'"
|
|
191
191
|
/>
|
|
192
192
|
</template>
|
|
193
193
|
<template #cell-actions>
|
|
@@ -322,9 +322,9 @@ describe('@morya-ui/mcp handlers', () => {
|
|
|
322
322
|
expect(result.ok).toBe(false);
|
|
323
323
|
expect(result.suggestions.some((item) => item.type === 'table-data-prop' && item.severity === 'contract')).toBe(true);
|
|
324
324
|
});
|
|
325
|
-
it('flags MMessage
|
|
325
|
+
it('flags MMessage type as inline-alert misuse', () => {
|
|
326
326
|
const result = read(handlers.validatePage({
|
|
327
|
-
code: '<MMessage
|
|
327
|
+
code: '<MMessage type="danger">登录失败</MMessage>',
|
|
328
328
|
}));
|
|
329
329
|
expect(result.ok).toBe(false);
|
|
330
330
|
expect(result.suggestions.some((item) => item.type === 'mmessage-as-alert' && item.severity === 'contract')).toBe(true);
|
package/dist/decisions.js
CHANGED
|
@@ -681,7 +681,7 @@ export const componentDecisions = [
|
|
|
681
681
|
avoidWhenEn: ['Generic content grouping', 'Tables or forms'],
|
|
682
682
|
recipe: recipe([
|
|
683
683
|
['label + value', 'label + value'],
|
|
684
|
-
['trend /
|
|
684
|
+
['trend / trendType / trendDirection 按需', 'trend / trendType / trendDirection as needed'],
|
|
685
685
|
['loading 骨架;layout card|plain', 'loading skeleton; layout card|plain'],
|
|
686
686
|
]),
|
|
687
687
|
...anti([['普通段落用 PageStat → 文案或 Card', 'Paragraph as PageStat → copy or Card']]),
|
|
@@ -1018,7 +1018,7 @@ export const componentDecisions = [
|
|
|
1018
1018
|
avoidWhen: ['可关闭的分类标签', '挂在按钮上的数字'],
|
|
1019
1019
|
avoidWhenEn: ['A closable category label', 'A count attached to a button'],
|
|
1020
1020
|
recipe: recipe([
|
|
1021
|
-
['label +
|
|
1021
|
+
['label + type', 'label + type'],
|
|
1022
1022
|
['variant 默认 dot;可用 tag|text', 'variant default dot; or tag|text'],
|
|
1023
1023
|
['表格状态列优先 MStatus,不要一排实心 Tag', 'Prefer MStatus in table status columns over solid Tags'],
|
|
1024
1024
|
]),
|
|
@@ -1035,7 +1035,7 @@ export const componentDecisions = [
|
|
|
1035
1035
|
avoidWhenEn: ['A lightweight inline status', 'An entity with an image that can be removed'],
|
|
1036
1036
|
recipe: recipe([
|
|
1037
1037
|
['value 或默认插槽文案', 'value or default-slot copy'],
|
|
1038
|
-
['
|
|
1038
|
+
['type;closable + @close', 'type; closable + @close'],
|
|
1039
1039
|
['rounded / bordered 按需', 'rounded / bordered as needed'],
|
|
1040
1040
|
], undefined, [['@close', '@close']]),
|
|
1041
1041
|
...anti([['行内启用/停用状态用 Tag → Status', 'Enabled/disabled inline via Tag → Status']]),
|
|
@@ -1049,7 +1049,7 @@ export const componentDecisions = [
|
|
|
1049
1049
|
recipe: recipe([
|
|
1050
1050
|
['label;icon 或 image', 'label; icon or image'],
|
|
1051
1051
|
['removable + @remove', 'removable + @remove'],
|
|
1052
|
-
['
|
|
1052
|
+
['type 按需', 'type as needed'],
|
|
1053
1053
|
], undefined, [['@remove', '@remove']]),
|
|
1054
1054
|
...anti([['纯状态点用 Chip → Status', 'Status dot via Chip → Status']]),
|
|
1055
1055
|
},
|
|
@@ -1061,7 +1061,7 @@ export const componentDecisions = [
|
|
|
1061
1061
|
avoidWhenEn: ['A standalone status sentence'],
|
|
1062
1062
|
recipe: recipe([
|
|
1063
1063
|
['value 数量;省略则圆点', 'value count; omit for dot'],
|
|
1064
|
-
['
|
|
1064
|
+
['type;max 封顶', 'type; max cap'],
|
|
1065
1065
|
['默认插槽包裹宿主控件', 'Default slot wraps the host control'],
|
|
1066
1066
|
], [['默认插槽:被角标包裹的控件', 'Default slot: host control']]),
|
|
1067
1067
|
...anti([
|
|
@@ -1170,7 +1170,7 @@ export const componentDecisions = [
|
|
|
1170
1170
|
recipe: recipe([
|
|
1171
1171
|
[':model / items 操作项', ':model / items for actions'],
|
|
1172
1172
|
['触发器放默认插槽(按钮/图标)', 'Trigger in default slot (button/icon)'],
|
|
1173
|
-
['
|
|
1173
|
+
['危险项走确认流(ConfirmDialog)', 'Danger items: confirm flow (ConfirmDialog)'],
|
|
1174
1174
|
]),
|
|
1175
1175
|
relatedSnippets: ['row-actions-menu', 'list-row-actions'],
|
|
1176
1176
|
...anti([['表单枚举用 Dropdown → Select', 'Form enum via Dropdown → Select']]),
|
|
@@ -1265,7 +1265,7 @@ export const componentDecisions = [
|
|
|
1265
1265
|
relatedSnippets: ['confirm-delete', 'form-in-dialog'],
|
|
1266
1266
|
...anti([
|
|
1267
1267
|
["toast.add({ summary: '已保存' }) → message.success('已保存')", "toast.add({ summary: 'Saved' }) → message.success('Saved')"],
|
|
1268
|
-
['<MMessage
|
|
1268
|
+
['<MMessage type> 当内嵌 Alert → errorMessage / role="alert"', '<MMessage type> as inline Alert → errorMessage / role="alert"'],
|
|
1269
1269
|
]),
|
|
1270
1270
|
},
|
|
1271
1271
|
{
|
|
@@ -1298,7 +1298,7 @@ export const componentDecisions = [
|
|
|
1298
1298
|
relatedSnippets: ['auth-split-shell'],
|
|
1299
1299
|
...anti([
|
|
1300
1300
|
['登录失败只闪 Toast → 表单区 alert / errorMessage', 'Login failure only via Toast → form alert / errorMessage'],
|
|
1301
|
-
['编造 MMessage
|
|
1301
|
+
['编造 MMessage type / 插槽 Alert API', 'Invented MMessage type / slot Alert API'],
|
|
1302
1302
|
]),
|
|
1303
1303
|
},
|
|
1304
1304
|
],
|
package/dist/page-snippets.js
CHANGED
|
@@ -500,7 +500,7 @@ const loading = ref(false)`,
|
|
|
500
500
|
<template #cell-status="{ value }">
|
|
501
501
|
<MStatus
|
|
502
502
|
:label="value === 'active' || value === 'online' ? '启用' : '停用'"
|
|
503
|
-
:
|
|
503
|
+
:type="value === 'active' || value === 'online' ? 'success' : 'secondary'"
|
|
504
504
|
/>
|
|
505
505
|
</template>
|
|
506
506
|
<template #cell-count="{ value }">
|
|
@@ -583,7 +583,7 @@ const loading = ref(false)`,
|
|
|
583
583
|
template: `<template #cell-category="{ value }">
|
|
584
584
|
<MTag
|
|
585
585
|
:value="String(value ?? '')"
|
|
586
|
-
|
|
586
|
+
type="info"
|
|
587
587
|
/>
|
|
588
588
|
</template>`,
|
|
589
589
|
rules: ['分类/强调态用 MTag;行内业务状态用 MStatus(list-status-dot)', '不要用 Button 颜色表达状态'],
|
|
@@ -603,7 +603,7 @@ const loading = ref(false)`,
|
|
|
603
603
|
template: `<template #cell-status="{ value }">
|
|
604
604
|
<MStatus
|
|
605
605
|
:label="value === 'active' || value === 'online' ? '启用' : '停用'"
|
|
606
|
-
:
|
|
606
|
+
:type="value === 'active' || value === 'online' ? 'success' : 'secondary'"
|
|
607
607
|
/>
|
|
608
608
|
</template>`,
|
|
609
609
|
rules: ['行内轻量业务状态优先 MStatus', '不要用 Button 颜色表达状态'],
|
|
@@ -755,8 +755,8 @@ const roleOptions = [
|
|
|
755
755
|
id: 'dashboard-kpi-grid',
|
|
756
756
|
title: '仪表盘 KPI 栅格',
|
|
757
757
|
titleEn: 'Dashboard KPI grid',
|
|
758
|
-
description: 'MGrid + MPageStat:带 trend / trendDirection /
|
|
759
|
-
descriptionEn: 'MGrid + MPageStat with trend / trendDirection /
|
|
758
|
+
description: 'MGrid + MPageStat:带 trend / trendDirection / trendType;高密条可用 density="compact"。',
|
|
759
|
+
descriptionEn: 'MGrid + MPageStat with trend / trendDirection / trendType; use density="compact" for dense strips.',
|
|
760
760
|
pageTypes: ['dashboard'],
|
|
761
761
|
keywords: ['kpi', '指标', 'stat', 'grid', 'metrics', 'trend', 'compact'],
|
|
762
762
|
imports: ['MGrid', 'MGridItem', 'MPageStat'],
|
|
@@ -766,7 +766,7 @@ const roleOptions = [
|
|
|
766
766
|
value: '12,480',
|
|
767
767
|
trend: '+8.2%',
|
|
768
768
|
trendDirection: 'up' as const,
|
|
769
|
-
|
|
769
|
+
trendType: 'success' as const,
|
|
770
770
|
trendLabel: '较上月',
|
|
771
771
|
icon: 'users',
|
|
772
772
|
},
|
|
@@ -775,7 +775,7 @@ const roleOptions = [
|
|
|
775
775
|
value: '1,926',
|
|
776
776
|
trend: '-3.1%',
|
|
777
777
|
trendDirection: 'down' as const,
|
|
778
|
-
|
|
778
|
+
trendType: 'warning' as const,
|
|
779
779
|
trendLabel: '较昨日',
|
|
780
780
|
icon: 'activity',
|
|
781
781
|
},
|
|
@@ -787,7 +787,7 @@ const roleOptions = [
|
|
|
787
787
|
:value="metric.value"
|
|
788
788
|
:trend="metric.trend"
|
|
789
789
|
:trend-direction="metric.trendDirection"
|
|
790
|
-
:trend-
|
|
790
|
+
:trend-type="metric.trendType"
|
|
791
791
|
:trend-label="metric.trendLabel"
|
|
792
792
|
:icon="metric.icon"
|
|
793
793
|
/>
|
|
@@ -796,13 +796,13 @@ const roleOptions = [
|
|
|
796
796
|
<!-- 高密条带示例:density="compact" layout="plain" orientation="inline" -->`,
|
|
797
797
|
rules: [
|
|
798
798
|
'KPI 用 MPageStat,不要每页自定义 stat CSS',
|
|
799
|
-
'趋势务必带 trendDirection +
|
|
799
|
+
'趋势务必带 trendDirection + trendType(升 success / 降 warning|danger)',
|
|
800
800
|
'responsive="screen" 便于窄屏降列',
|
|
801
801
|
'密集工作台可用 density="compact";加载中用 loading',
|
|
802
802
|
],
|
|
803
803
|
rulesEn: [
|
|
804
804
|
'Use MPageStat for KPIs — no per-page stat CSS',
|
|
805
|
-
'Always set trendDirection +
|
|
805
|
+
'Always set trendDirection + trendType (up→success, down→warning|danger)',
|
|
806
806
|
'Use responsive="screen" for narrow layouts',
|
|
807
807
|
'Dense dashboards may use density="compact"; use loading while fetching',
|
|
808
808
|
],
|
|
@@ -914,7 +914,7 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
|
|
|
914
914
|
template: `<MPageHeader title="林晓" description="查看账号摘要、属性与近期活动。">
|
|
915
915
|
<template #actions>
|
|
916
916
|
<MSpace>
|
|
917
|
-
<MStatus label="启用"
|
|
917
|
+
<MStatus label="启用" type="success" />
|
|
918
918
|
<MButton type="primary">编辑</MButton>
|
|
919
919
|
<MButton danger type="text">删除</MButton>
|
|
920
920
|
</MSpace>
|
|
@@ -941,7 +941,7 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
|
|
|
941
941
|
<MDescriptionsItem label="部门">产品设计</MDescriptionsItem>
|
|
942
942
|
<MDescriptionsItem label="入职日期">2025-03-12</MDescriptionsItem>
|
|
943
943
|
<MDescriptionsItem label="状态">
|
|
944
|
-
<MStatus label="启用"
|
|
944
|
+
<MStatus label="启用" type="success" />
|
|
945
945
|
</MDescriptionsItem>
|
|
946
946
|
</MDescriptions>`,
|
|
947
947
|
rules: [
|
|
@@ -1176,7 +1176,7 @@ function onAcceptDelete() {
|
|
|
1176
1176
|
scriptSetup: `const rowMenu = [
|
|
1177
1177
|
{ label: '编辑', command: () => {/* open edit */} },
|
|
1178
1178
|
{ label: '复制', command: () => {/* duplicate */} },
|
|
1179
|
-
{ label: '删除',
|
|
1179
|
+
{ label: '删除', command: () => {/* askDelete */} },
|
|
1180
1180
|
]`,
|
|
1181
1181
|
template: `<template #cell-actions>
|
|
1182
1182
|
<MDropdown :model="rowMenu">
|
package/dist/patterns.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ export declare const designRules: {
|
|
|
128
128
|
};
|
|
129
129
|
readonly inlineMessage: {
|
|
130
130
|
readonly api: "field errorMessage | token-styled role=alert";
|
|
131
|
-
readonly when: readonly ["登录/表单区常驻错误:优先字段 errorMessage", "表单级总结:使用 --m-* 样式的 role=alert 条(见 login-page 黄金样例)", "MMessage 组件当前主要为 message 服务宿主,勿臆造
|
|
131
|
+
readonly when: readonly ["登录/表单区常驻错误:优先字段 errorMessage", "表单级总结:使用 --m-* 样式的 role=alert 条(见 login-page 黄金样例)", "MMessage 组件当前主要为 message 服务宿主,勿臆造 type / 子节点 Alert API"];
|
|
132
132
|
};
|
|
133
133
|
readonly doc: "design-kit/.agents/skills/morya-ui-pages/references/feedback.md";
|
|
134
134
|
};
|
package/dist/patterns.js
CHANGED
|
@@ -78,7 +78,7 @@ export const pagePatterns = [
|
|
|
78
78
|
'新增、保存等主操作使用 primary MButton',
|
|
79
79
|
'查询等次要操作使用默认或 variant="outlined" MButton',
|
|
80
80
|
'删除使用 danger MButton,并配合 MConfirmDialog',
|
|
81
|
-
'业务状态优先使用 MStatus(圆点+文案)或 MTag(分类标签),不使用 Button
|
|
81
|
+
'业务状态优先使用 MStatus(圆点+文案)或 MTag(分类标签),不使用 Button color 表达状态',
|
|
82
82
|
'间距、颜色、圆角优先使用 --m-* 设计令牌,不直接硬编码色板',
|
|
83
83
|
],
|
|
84
84
|
interactionRules: [
|
|
@@ -802,7 +802,7 @@ export const designRules = {
|
|
|
802
802
|
when: [
|
|
803
803
|
'登录/表单区常驻错误:优先字段 errorMessage',
|
|
804
804
|
'表单级总结:使用 --m-* 样式的 role=alert 条(见 login-page 黄金样例)',
|
|
805
|
-
'MMessage 组件当前主要为 message 服务宿主,勿臆造
|
|
805
|
+
'MMessage 组件当前主要为 message 服务宿主,勿臆造 type / 子节点 Alert API',
|
|
806
806
|
],
|
|
807
807
|
},
|
|
808
808
|
doc: 'design-kit/.agents/skills/morya-ui-pages/references/feedback.md',
|
package/dist/reference-brief.js
CHANGED
|
@@ -89,8 +89,8 @@ const BLOCK_TO_SNIPPET = {
|
|
|
89
89
|
},
|
|
90
90
|
kpi: {
|
|
91
91
|
snippetId: 'dashboard-kpi-grid',
|
|
92
|
-
notesZh: 'MPageStat 带 trend / trendDirection /
|
|
93
|
-
notesEn: 'MPageStat with trend / trendDirection /
|
|
92
|
+
notesZh: 'MPageStat 带 trend / trendDirection / trendType',
|
|
93
|
+
notesEn: 'MPageStat with trend / trendDirection / trendType',
|
|
94
94
|
},
|
|
95
95
|
chart: {
|
|
96
96
|
snippetId: 'dashboard-chart-card',
|
package/dist/tools.js
CHANGED
|
@@ -141,7 +141,7 @@ async function submit() {
|
|
|
141
141
|
</MPageFilters>
|
|
142
142
|
<MTable :columns="columns" :rows="rows" :loading="loading" fill paginator :rows-per-page="10" striped bordered row-key="id">
|
|
143
143
|
<template #cell-status="{ value }">
|
|
144
|
-
<MStatus :label="String(value ?? '')" :
|
|
144
|
+
<MStatus :label="String(value ?? '')" :type="value === 'active' ? 'success' : 'secondary'" />
|
|
145
145
|
</template>
|
|
146
146
|
<template #empty>
|
|
147
147
|
<MEmpty
|
|
@@ -184,7 +184,7 @@ async function submit() {
|
|
|
184
184
|
const detailContent = ` <MPageHeader :title="title" :description="${zh ? '查看资源摘要与属性。' : 'Review summary and properties.'}">
|
|
185
185
|
<template #actions>
|
|
186
186
|
<MSpace>
|
|
187
|
-
<MStatus :label="${zh ? '启用' : 'Active'}"
|
|
187
|
+
<MStatus :label="${zh ? '启用' : 'Active'}" type="success" />
|
|
188
188
|
<MButton type="primary">${zh ? '编辑' : 'Edit'}</MButton>
|
|
189
189
|
<MButton>${zh ? '返回' : 'Back'}</MButton>
|
|
190
190
|
</MSpace>
|
|
@@ -309,7 +309,7 @@ ${content}
|
|
|
309
309
|
<main class="m-generated-page">
|
|
310
310
|
<MCard>
|
|
311
311
|
<p class="m-generated-muted">${zh ? '将此区域替换为页面内容。' : 'Replace this area with page content.'}</p>
|
|
312
|
-
<MTag value="${zh ? '示例' : 'Example'}"
|
|
312
|
+
<MTag value="${zh ? '示例' : 'Example'}" type="info" />
|
|
313
313
|
</MCard>
|
|
314
314
|
</main>
|
|
315
315
|
</MConfigProvider>`;
|
|
@@ -1082,7 +1082,7 @@ export function createToolHandlers(catalog = loadCatalog()) {
|
|
|
1082
1082
|
!(/<MPageContent\b[^>]*\bfill\b/i.test(code) && /<MTable\b[^>]*\bfill\b/i.test(code))) {
|
|
1083
1083
|
push('craft', 'page-sections', 'list-fill-height', '参考建议:若这是全视口后台主列表且表格是页面主任务,可考虑 MPageContent fill + MTable fill(表体滚动、分页贴底)。嵌入表/短页/整页文档滚动则跳过 fill(见 page-scroll-choice / 黄金样例 list-page)。', 'Advisory: for a full-viewport admin list whose main job is one table, consider MPageContent fill + MTable fill so the body scrolls and pagination stays at the page bottom. Skip fill for embedded/short/document-scroll tables (see page-scroll-choice / golden list-page).');
|
|
1084
1084
|
}
|
|
1085
|
-
if (/<MMessage\b[^>]*\
|
|
1085
|
+
if (/<MMessage\b[^>]*\b(?:severity|type)\s*=/i.test(code)) {
|
|
1086
1086
|
push('contract', 'feedback', 'mmessage-as-alert', '契约:<MMessage> 是 message 服务宿主,不是内嵌 Alert。表单常驻错误用字段 errorMessage 或 token 样式的 role="alert"。', 'Contract: <MMessage> is the message service host, not an inline alert. Use field errorMessage or a token-styled role="alert".');
|
|
1087
1087
|
}
|
|
1088
1088
|
if (/toast\.(?:success|info|warn|warning|error)\s*\(\s*['"`][^'"`]+['"`]\s*\)/i.test(code)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morya-ui/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.3",
|
|
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",
|