@morya-ui/mcp 0.3.5 → 0.3.6
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/LICENSE +21 -21
- package/README.md +154 -151
- package/bin/morya-ui-mcp.js +2 -2
- package/data/catalog.json +26 -26
- package/data/example-coverage.json +2 -2
- package/data/golden-pages/dashboard-page.vue +138 -138
- package/data/golden-pages/detail-page.vue +178 -178
- package/data/golden-pages/empty-state.vue +56 -56
- package/data/golden-pages/form-in-dialog.vue +166 -166
- package/data/golden-pages/form-page.vue +107 -107
- package/data/golden-pages/landing-page.vue +358 -358
- package/data/golden-pages/list-page-dense.vue +168 -168
- package/data/golden-pages/list-page-rail.vue +272 -272
- package/data/golden-pages/list-page.vue +222 -222
- package/data/golden-pages/login-page.vue +231 -231
- package/data/golden-pages/result-page.vue +84 -84
- package/data/golden-pages/settings-page.vue +163 -163
- package/data/golden-pages/wizard-form.vue +182 -182
- package/dist/__tests__/fidelity.test.d.ts +1 -0
- package/dist/__tests__/fidelity.test.js +88 -0
- package/dist/__tests__/page-snippets.test.js +13 -5
- package/dist/__tests__/tools.test.js +10 -8
- package/dist/index.js +46 -3
- package/dist/page-snippets.js +722 -635
- package/dist/reference-brief.d.ts +55 -0
- package/dist/reference-brief.js +468 -0
- package/dist/style-shells.d.ts +20 -0
- package/dist/style-shells.js +249 -0
- package/dist/tools.d.ts +26 -0
- package/dist/tools.js +464 -374
- package/package.json +1 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token-only signature shells for Account / Express / Flow / Ops.
|
|
3
|
+
* Pasteable CSS — no hex; brand differences belong in theme overrides.
|
|
4
|
+
*/
|
|
5
|
+
export const styleShells = [
|
|
6
|
+
{
|
|
7
|
+
id: 'ops-quiet',
|
|
8
|
+
surface: 'ops',
|
|
9
|
+
titleZh: '后台安静面',
|
|
10
|
+
titleEn: 'Quiet ops surface',
|
|
11
|
+
signatureZh: '单一主色强调 + 对齐节奏,无装饰渐变',
|
|
12
|
+
signatureEn: 'One accent + alignment rhythm; no decorative gradients',
|
|
13
|
+
whenZh: '列表 / 表单 / 仪表盘 / 设置等 Operate 表面',
|
|
14
|
+
whenEn: 'List / form / dashboard / settings Operate surfaces',
|
|
15
|
+
htmlHintZh: '结构用 MLayout + MPage*;本壳几乎不需要自定义 CSS',
|
|
16
|
+
htmlHintEn: 'Compose with MLayout + MPage*; little custom CSS needed',
|
|
17
|
+
css: `/* Ops: prefer component spacing; optional page tweaks only */
|
|
18
|
+
.ops-page :is(.m-page-content) {
|
|
19
|
+
/* density via MPageContent density prop — do not invent a second scale */
|
|
20
|
+
}
|
|
21
|
+
.ops-page :is(td, th).is-numeric,
|
|
22
|
+
.ops-page .cell-numeric {
|
|
23
|
+
font-variant-numeric: tabular-nums;
|
|
24
|
+
text-align: end;
|
|
25
|
+
}`,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'account-split',
|
|
29
|
+
surface: 'account',
|
|
30
|
+
titleZh: '登录分栏品牌壳',
|
|
31
|
+
titleEn: 'Auth split brand shell',
|
|
32
|
+
signatureZh: '一侧品牌面(主色混底)+ 一侧表单,仅一个签名:品牌字号跳跃',
|
|
33
|
+
signatureEn: 'Brand panel (primary mix) + form; one signature: type jump on brand title',
|
|
34
|
+
whenZh: '登录 / 注册 / 找回密码',
|
|
35
|
+
whenEn: 'Login / register / password recovery',
|
|
36
|
+
htmlHintZh: '对齐 auth-split-shell 片段;文案用产品名,不要「示例」',
|
|
37
|
+
htmlHintEn: 'Align with auth-split-shell snippet; use product copy, not placeholders',
|
|
38
|
+
css: `.login-shell {
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-template-columns: minmax(16rem, 0.95fr) minmax(20rem, 1.05fr);
|
|
41
|
+
min-height: 100vh;
|
|
42
|
+
background: var(--m-color-surface);
|
|
43
|
+
}
|
|
44
|
+
.login-brand {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
justify-content: flex-end;
|
|
48
|
+
gap: var(--m-space-4);
|
|
49
|
+
padding: clamp(2rem, 6vw, 4.5rem);
|
|
50
|
+
background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface));
|
|
51
|
+
border-right: 1px solid var(--m-color-border);
|
|
52
|
+
}
|
|
53
|
+
.login-brand__mark {
|
|
54
|
+
margin: 0;
|
|
55
|
+
font-size: var(--m-font-size-sm);
|
|
56
|
+
letter-spacing: 0.08em;
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
color: var(--m-color-text-muted);
|
|
59
|
+
}
|
|
60
|
+
.login-brand__title {
|
|
61
|
+
margin: 0;
|
|
62
|
+
font-size: clamp(1.75rem, 3vw, 2.25rem);
|
|
63
|
+
line-height: 1.2;
|
|
64
|
+
color: var(--m-color-text);
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
}
|
|
67
|
+
.login-brand__lead {
|
|
68
|
+
margin: 0;
|
|
69
|
+
max-width: 28rem;
|
|
70
|
+
color: var(--m-color-text-muted);
|
|
71
|
+
font-size: var(--m-font-size-md);
|
|
72
|
+
}
|
|
73
|
+
.login-main {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
padding: var(--m-space-6);
|
|
78
|
+
}
|
|
79
|
+
.login-panel {
|
|
80
|
+
width: min(100%, 22rem);
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: var(--m-space-4);
|
|
84
|
+
}
|
|
85
|
+
.login-panel__header h2 {
|
|
86
|
+
margin: 0 0 var(--m-space-2);
|
|
87
|
+
font-size: var(--m-font-size-xl);
|
|
88
|
+
}
|
|
89
|
+
.login-panel__header p,
|
|
90
|
+
.login-alert {
|
|
91
|
+
margin: 0;
|
|
92
|
+
color: var(--m-color-text-muted);
|
|
93
|
+
font-size: var(--m-font-size-sm);
|
|
94
|
+
}
|
|
95
|
+
.login-alert {
|
|
96
|
+
color: var(--m-color-danger);
|
|
97
|
+
}
|
|
98
|
+
@media (max-width: 720px) {
|
|
99
|
+
.login-shell { grid-template-columns: 1fr; }
|
|
100
|
+
.login-brand { border-right: none; border-bottom: 1px solid var(--m-color-border); }
|
|
101
|
+
}`,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'account-centered',
|
|
105
|
+
surface: 'account',
|
|
106
|
+
titleZh: '登录居中信任壳',
|
|
107
|
+
titleEn: 'Centered trust auth shell',
|
|
108
|
+
signatureZh: '居中窄卡 + 顶部门户名,签名是安静边框而非装饰渐变',
|
|
109
|
+
signatureEn: 'Centered narrow card + product mark; signature is quiet border, not gradients',
|
|
110
|
+
whenZh: '无强品牌图、或窄屏优先的认证页',
|
|
111
|
+
whenEn: 'Auth without a strong brand image, or mobile-first',
|
|
112
|
+
htmlHintZh: '单列居中;表单错误用 errorMessage 或 role=alert',
|
|
113
|
+
htmlHintEn: 'Single centered column; form errors via errorMessage or role=alert',
|
|
114
|
+
css: `.auth-center {
|
|
115
|
+
min-height: 100vh;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
padding: var(--m-space-6);
|
|
120
|
+
background: var(--m-color-surface);
|
|
121
|
+
}
|
|
122
|
+
.auth-center__card {
|
|
123
|
+
width: min(100%, 22rem);
|
|
124
|
+
padding: var(--m-space-6);
|
|
125
|
+
border: 1px solid var(--m-color-border);
|
|
126
|
+
border-radius: var(--m-radius-md);
|
|
127
|
+
background: var(--m-color-surface);
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: var(--m-space-4);
|
|
131
|
+
}
|
|
132
|
+
.auth-center__mark {
|
|
133
|
+
margin: 0;
|
|
134
|
+
font-size: var(--m-font-size-sm);
|
|
135
|
+
color: var(--m-color-text-muted);
|
|
136
|
+
letter-spacing: 0.06em;
|
|
137
|
+
}
|
|
138
|
+
.auth-center__title {
|
|
139
|
+
margin: 0;
|
|
140
|
+
font-size: var(--m-font-size-xl);
|
|
141
|
+
color: var(--m-color-text);
|
|
142
|
+
}`,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'flow-empty-frame',
|
|
146
|
+
surface: 'flow',
|
|
147
|
+
titleZh: '空态轻框',
|
|
148
|
+
titleEn: 'Empty-state light frame',
|
|
149
|
+
signatureZh: '虚线框包住 MEmpty,签名是边框节奏而非插画堆叠',
|
|
150
|
+
signatureEn: 'Dashed frame around MEmpty; signature is border rhythm, not illustration clutter',
|
|
151
|
+
whenZh: '首次使用 / 筛选无结果 / 资源清空',
|
|
152
|
+
whenEn: 'First use / no filter matches / cleared resources',
|
|
153
|
+
htmlHintZh: '优先用 empty-block 片段;框可选',
|
|
154
|
+
htmlHintEn: 'Prefer empty-block snippet; frame is optional',
|
|
155
|
+
css: `.empty-state-shell {
|
|
156
|
+
border: 1px dashed var(--m-color-border);
|
|
157
|
+
border-radius: var(--m-radius-md);
|
|
158
|
+
background: var(--m-color-surface);
|
|
159
|
+
padding: var(--m-space-6);
|
|
160
|
+
display: flex;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
}`,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'flow-result-hero',
|
|
166
|
+
surface: 'flow',
|
|
167
|
+
titleZh: '结果页大标题壳',
|
|
168
|
+
titleEn: 'Result page hero type',
|
|
169
|
+
signatureZh: 'MResult 居中;签名是标题层级与明确下一步',
|
|
170
|
+
signatureEn: 'Centered MResult; signature is type hierarchy + clear next step',
|
|
171
|
+
whenZh: '提交成功 / 失败 / 403 / 404 / 500',
|
|
172
|
+
whenEn: 'Submit success/failure / 403 / 404 / 500',
|
|
173
|
+
htmlHintZh: '用 result-block;不要用 MEmpty 冒充结果页',
|
|
174
|
+
htmlHintEn: 'Use result-block; do not fake results with MEmpty',
|
|
175
|
+
css: `.result-shell {
|
|
176
|
+
min-height: 60vh;
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
padding: var(--m-space-6);
|
|
181
|
+
background: var(--m-color-surface);
|
|
182
|
+
}`,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: 'express-hero',
|
|
186
|
+
surface: 'express',
|
|
187
|
+
titleZh: '营销首屏平面',
|
|
188
|
+
titleEn: 'Marketing hero plane',
|
|
189
|
+
signatureZh: '首屏单一任务:品牌/标题/一句支持/一组 CTA + 一块实色视觉面',
|
|
190
|
+
signatureEn: 'First viewport one job: brand/title/support/CTA + one solid visual plane',
|
|
191
|
+
whenZh: '落地页 / 定价前导 / 产品介绍',
|
|
192
|
+
whenEn: 'Landing / pricing lead-in / product intro',
|
|
193
|
+
htmlHintZh: '控件仍用 MButton/MTag;禁止未要求的 aurora / 毛玻璃',
|
|
194
|
+
htmlHintEn: 'Controls stay MButton/MTag; no unsolicited aurora/glass',
|
|
195
|
+
css: `.landing-hero {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
gap: var(--m-space-4);
|
|
199
|
+
padding: clamp(2rem, 5vw, 4rem) var(--m-space-6);
|
|
200
|
+
background: var(--m-color-surface);
|
|
201
|
+
border-bottom: 1px solid var(--m-color-border);
|
|
202
|
+
}
|
|
203
|
+
.landing-hero__brand {
|
|
204
|
+
margin: 0;
|
|
205
|
+
font-size: var(--m-font-size-sm);
|
|
206
|
+
letter-spacing: 0.08em;
|
|
207
|
+
text-transform: uppercase;
|
|
208
|
+
color: var(--m-color-primary);
|
|
209
|
+
}
|
|
210
|
+
.landing-hero__title {
|
|
211
|
+
margin: 0;
|
|
212
|
+
max-width: 18ch;
|
|
213
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
214
|
+
line-height: 1.15;
|
|
215
|
+
color: var(--m-color-text);
|
|
216
|
+
}
|
|
217
|
+
.landing-hero__lead {
|
|
218
|
+
margin: 0;
|
|
219
|
+
max-width: 36rem;
|
|
220
|
+
color: var(--m-color-text-muted);
|
|
221
|
+
font-size: var(--m-font-size-md);
|
|
222
|
+
}
|
|
223
|
+
.landing-hero__actions {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-wrap: wrap;
|
|
226
|
+
gap: var(--m-space-3);
|
|
227
|
+
}
|
|
228
|
+
.landing-hero__visual {
|
|
229
|
+
margin-top: var(--m-space-5);
|
|
230
|
+
min-height: 12rem;
|
|
231
|
+
padding: var(--m-space-5);
|
|
232
|
+
border: 1px solid var(--m-color-border);
|
|
233
|
+
border-radius: var(--m-radius-md);
|
|
234
|
+
background: color-mix(in srgb, var(--m-color-primary) 8%, var(--m-color-surface));
|
|
235
|
+
}`,
|
|
236
|
+
},
|
|
237
|
+
];
|
|
238
|
+
export function findStyleShell(idOrSurface) {
|
|
239
|
+
const q = idOrSurface.trim().toLowerCase();
|
|
240
|
+
return (styleShells.find((s) => s.id === q) ||
|
|
241
|
+
styleShells.find((s) => s.surface === q) ||
|
|
242
|
+
styleShells.find((s) => s.id.includes(q) || s.titleZh.includes(idOrSurface) || s.titleEn.toLowerCase().includes(q)));
|
|
243
|
+
}
|
|
244
|
+
export function listStyleShells(surface) {
|
|
245
|
+
if (!surface)
|
|
246
|
+
return styleShells;
|
|
247
|
+
const s = surface.trim().toLowerCase();
|
|
248
|
+
return styleShells.filter((item) => item.surface === s || item.id.startsWith(s) || item.whenZh.includes(surface) || item.whenEn.toLowerCase().includes(s));
|
|
249
|
+
}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReferenceBriefInput } from './reference-brief.js';
|
|
1
2
|
export declare function createToolHandlers(catalog?: import("./catalog.js").Catalog): {
|
|
2
3
|
catalog: import("./catalog.js").Catalog;
|
|
3
4
|
list: (args: {
|
|
@@ -117,6 +118,8 @@ export declare function createToolHandlers(catalog?: import("./catalog.js").Cata
|
|
|
117
118
|
pageType?: string;
|
|
118
119
|
features?: string[];
|
|
119
120
|
style?: string;
|
|
121
|
+
density?: string;
|
|
122
|
+
brief?: ReferenceBriefInput;
|
|
120
123
|
mode?: string;
|
|
121
124
|
includeScaffold?: boolean;
|
|
122
125
|
}) => {
|
|
@@ -126,6 +129,15 @@ export declare function createToolHandlers(catalog?: import("./catalog.js").Cata
|
|
|
126
129
|
text: string;
|
|
127
130
|
}[];
|
|
128
131
|
};
|
|
132
|
+
mapReference: (args: ReferenceBriefInput & {
|
|
133
|
+
mode?: string;
|
|
134
|
+
}) => {
|
|
135
|
+
structuredContent?: Record<string, unknown> | undefined;
|
|
136
|
+
content: {
|
|
137
|
+
type: "text";
|
|
138
|
+
text: string;
|
|
139
|
+
}[];
|
|
140
|
+
};
|
|
129
141
|
getDesignRules: (args?: {
|
|
130
142
|
mode?: string;
|
|
131
143
|
}) => {
|
|
@@ -146,6 +158,17 @@ export declare function createToolHandlers(catalog?: import("./catalog.js").Cata
|
|
|
146
158
|
text: string;
|
|
147
159
|
}[];
|
|
148
160
|
};
|
|
161
|
+
getStyleShells: (args?: {
|
|
162
|
+
shell?: string;
|
|
163
|
+
surface?: string;
|
|
164
|
+
mode?: string;
|
|
165
|
+
}) => {
|
|
166
|
+
structuredContent?: Record<string, unknown> | undefined;
|
|
167
|
+
content: {
|
|
168
|
+
type: "text";
|
|
169
|
+
text: string;
|
|
170
|
+
}[];
|
|
171
|
+
};
|
|
149
172
|
recommendComponent: (args: {
|
|
150
173
|
query?: string;
|
|
151
174
|
decision?: string;
|
|
@@ -205,6 +228,9 @@ export declare function createToolHandlers(catalog?: import("./catalog.js").Cata
|
|
|
205
228
|
validatePage: (args: {
|
|
206
229
|
code?: string;
|
|
207
230
|
mode?: string;
|
|
231
|
+
brief?: ReferenceBriefInput;
|
|
232
|
+
requiredBlocks?: string[];
|
|
233
|
+
requiredComponents?: string[];
|
|
208
234
|
}) => {
|
|
209
235
|
structuredContent?: Record<string, unknown> | undefined;
|
|
210
236
|
content: {
|