@morya-ui/mcp 0.4.4 → 0.5.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/LICENSE +21 -21
- package/README.md +154 -154
- package/bin/morya-ui-mcp.js +2 -2
- package/data/catalog.json +1368 -413
- package/data/example-coverage.json +78 -73
- package/data/golden-pages/dashboard-page.vue +161 -161
- package/data/golden-pages/detail-page.vue +147 -147
- 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 +382 -382
- 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 +244 -244
- 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 +167 -167
- package/dist/decisions.js +1299 -6
- package/dist/page-snippets.js +669 -669
- package/dist/style-shells.js +153 -153
- package/dist/tools.js +192 -192
- package/package.json +1 -1
package/dist/tools.js
CHANGED
|
@@ -96,149 +96,149 @@ function generatedPageCode(patternId, intent, locale) {
|
|
|
96
96
|
const wizardImports = isWizard ? ', MStepper, MSpace' : '';
|
|
97
97
|
const settingsImports = isSettings ? ', MTabs' : '';
|
|
98
98
|
const statusImports = isList || isDetail || isDashboard ? ', MStatus' : '';
|
|
99
|
-
const script = `<script setup lang="ts">
|
|
100
|
-
import { ref } from 'vue'
|
|
101
|
-
import { MButton, MCard, MConfigProvider, MInput, MTag, zhCN${layoutImports}${pageImports}${listImports}${formImports}${dashboardImports}${detailImports}${emptyImports}${wizardImports}${settingsImports}${statusImports} } from 'morya-ui'
|
|
102
|
-
|
|
103
|
-
const loading = ref(false)
|
|
104
|
-
const error = ref('')
|
|
105
|
-
const title = ${JSON.stringify(title)}
|
|
106
|
-
${isList ? `const keyword = ref('')
|
|
107
|
-
const rows = ref<Record<string, unknown>[]>([])
|
|
108
|
-
const columns = [{ key: 'name', label: '${zh ? '名称' : 'Name'}' }, { key: 'status', label: '${zh ? '状态' : 'Status'}' }]
|
|
109
|
-
` : ''}${isForm || isAuth || isWizard ? `const model = ref({ name: '' })
|
|
110
|
-
` : ''}${isDashboard ? `const metrics = ref([
|
|
111
|
-
{ label: '${zh ? '总用户' : 'Users'}', value: '0' },
|
|
112
|
-
{ label: '${zh ? '今日活跃' : 'Active today'}', value: '0' },
|
|
113
|
-
])
|
|
114
|
-
` : ''}${isSettings ? `const activeTab = ref('general')
|
|
115
|
-
const settingTabs = [{ label: '${zh ? '常规' : 'General'}', value: 'general' }]
|
|
116
|
-
` : ''}${isWizard ? `const activeStep = ref(0)
|
|
117
|
-
const wizardSteps = [{ label: '${zh ? '基本信息' : 'Details'}' }, { label: '${zh ? '确认' : 'Confirm'}' }]
|
|
118
|
-
` : ''}
|
|
119
|
-
|
|
120
|
-
async function submit() {
|
|
121
|
-
loading.value = true
|
|
122
|
-
error.value = ''
|
|
123
|
-
try {
|
|
124
|
-
// Replace with the page API request.
|
|
125
|
-
} finally {
|
|
126
|
-
loading.value = false
|
|
127
|
-
}
|
|
128
|
-
}
|
|
99
|
+
const script = `<script setup lang="ts">
|
|
100
|
+
import { ref } from 'vue'
|
|
101
|
+
import { MButton, MCard, MConfigProvider, MInput, MTag, zhCN${layoutImports}${pageImports}${listImports}${formImports}${dashboardImports}${detailImports}${emptyImports}${wizardImports}${settingsImports}${statusImports} } from 'morya-ui'
|
|
102
|
+
|
|
103
|
+
const loading = ref(false)
|
|
104
|
+
const error = ref('')
|
|
105
|
+
const title = ${JSON.stringify(title)}
|
|
106
|
+
${isList ? `const keyword = ref('')
|
|
107
|
+
const rows = ref<Record<string, unknown>[]>([])
|
|
108
|
+
const columns = [{ key: 'name', label: '${zh ? '名称' : 'Name'}' }, { key: 'status', label: '${zh ? '状态' : 'Status'}' }]
|
|
109
|
+
` : ''}${isForm || isAuth || isWizard ? `const model = ref({ name: '' })
|
|
110
|
+
` : ''}${isDashboard ? `const metrics = ref([
|
|
111
|
+
{ label: '${zh ? '总用户' : 'Users'}', value: '0' },
|
|
112
|
+
{ label: '${zh ? '今日活跃' : 'Active today'}', value: '0' },
|
|
113
|
+
])
|
|
114
|
+
` : ''}${isSettings ? `const activeTab = ref('general')
|
|
115
|
+
const settingTabs = [{ label: '${zh ? '常规' : 'General'}', value: 'general' }]
|
|
116
|
+
` : ''}${isWizard ? `const activeStep = ref(0)
|
|
117
|
+
const wizardSteps = [{ label: '${zh ? '基本信息' : 'Details'}' }, { label: '${zh ? '确认' : 'Confirm'}' }]
|
|
118
|
+
` : ''}
|
|
119
|
+
|
|
120
|
+
async function submit() {
|
|
121
|
+
loading.value = true
|
|
122
|
+
error.value = ''
|
|
123
|
+
try {
|
|
124
|
+
// Replace with the page API request.
|
|
125
|
+
} finally {
|
|
126
|
+
loading.value = false
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
129
|
</script>`;
|
|
130
|
-
const listContent = ` <MPageHeader :title="title">
|
|
131
|
-
<template #actions>
|
|
132
|
-
<MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
|
|
133
|
-
</template>
|
|
134
|
-
</MPageHeader>
|
|
135
|
-
<MPageFilters variant="filled" :aria-label="${zh ? '筛选' : 'Filters'}">
|
|
136
|
-
<MSpace wrap>
|
|
137
|
-
<MInput v-model="keyword" placeholder="${zh ? '搜索关键词' : 'Search keyword'}" clearable style="width: 14rem" />
|
|
138
|
-
<MButton>${zh ? '查询' : 'Search'}</MButton>
|
|
139
|
-
<MButton>${zh ? '重置' : 'Reset'}</MButton>
|
|
140
|
-
</MSpace>
|
|
141
|
-
</MPageFilters>
|
|
142
|
-
<MTable :columns="columns" :rows="rows" :loading="loading" fill paginator :rows-per-page="10" striped bordered row-key="id">
|
|
143
|
-
<template #cell-status="{ value }">
|
|
144
|
-
<MStatus :label="String(value ?? '')" :type="value === 'active' ? 'success' : 'secondary'" />
|
|
145
|
-
</template>
|
|
146
|
-
<template #empty>
|
|
147
|
-
<MEmpty
|
|
148
|
-
:title="${zh ? '暂无数据' : 'No data yet'}"
|
|
149
|
-
:description="${zh ? '创建第一条记录开始使用。' : 'Create your first record to get started.'}"
|
|
150
|
-
>
|
|
151
|
-
<template #extra>
|
|
152
|
-
<MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
|
|
153
|
-
</template>
|
|
154
|
-
</MEmpty>
|
|
155
|
-
</template>
|
|
130
|
+
const listContent = ` <MPageHeader :title="title">
|
|
131
|
+
<template #actions>
|
|
132
|
+
<MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
|
|
133
|
+
</template>
|
|
134
|
+
</MPageHeader>
|
|
135
|
+
<MPageFilters variant="filled" :aria-label="${zh ? '筛选' : 'Filters'}">
|
|
136
|
+
<MSpace wrap>
|
|
137
|
+
<MInput v-model="keyword" placeholder="${zh ? '搜索关键词' : 'Search keyword'}" clearable style="width: 14rem" />
|
|
138
|
+
<MButton>${zh ? '查询' : 'Search'}</MButton>
|
|
139
|
+
<MButton>${zh ? '重置' : 'Reset'}</MButton>
|
|
140
|
+
</MSpace>
|
|
141
|
+
</MPageFilters>
|
|
142
|
+
<MTable :columns="columns" :rows="rows" :loading="loading" fill paginator :rows-per-page="10" striped bordered row-key="id">
|
|
143
|
+
<template #cell-status="{ value }">
|
|
144
|
+
<MStatus :label="String(value ?? '')" :type="value === 'active' ? 'success' : 'secondary'" />
|
|
145
|
+
</template>
|
|
146
|
+
<template #empty>
|
|
147
|
+
<MEmpty
|
|
148
|
+
:title="${zh ? '暂无数据' : 'No data yet'}"
|
|
149
|
+
:description="${zh ? '创建第一条记录开始使用。' : 'Create your first record to get started.'}"
|
|
150
|
+
>
|
|
151
|
+
<template #extra>
|
|
152
|
+
<MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
|
|
153
|
+
</template>
|
|
154
|
+
</MEmpty>
|
|
155
|
+
</template>
|
|
156
156
|
</MTable>`;
|
|
157
|
-
const formContent = ` <MPageHeader :title="title" :description="${zh ? '填写表单并保存。' : 'Fill in the form and save.'}" />
|
|
158
|
-
<MPageSection variant="form">
|
|
159
|
-
<MForm @submit.prevent="submit">
|
|
160
|
-
<MFormItem label="${zh ? '名称' : 'Name'}" name="name" required>
|
|
161
|
-
<MInput v-model="model.name" fluid />
|
|
162
|
-
</MFormItem>
|
|
163
|
-
<MPageSection variant="actions">
|
|
164
|
-
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
|
|
165
|
-
<MButton>${zh ? '取消' : 'Cancel'}</MButton>
|
|
166
|
-
</MPageSection>
|
|
167
|
-
</MForm>
|
|
157
|
+
const formContent = ` <MPageHeader :title="title" :description="${zh ? '填写表单并保存。' : 'Fill in the form and save.'}" />
|
|
158
|
+
<MPageSection variant="form">
|
|
159
|
+
<MForm @submit.prevent="submit">
|
|
160
|
+
<MFormItem label="${zh ? '名称' : 'Name'}" name="name" required>
|
|
161
|
+
<MInput v-model="model.name" fluid />
|
|
162
|
+
</MFormItem>
|
|
163
|
+
<MPageSection variant="actions">
|
|
164
|
+
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
|
|
165
|
+
<MButton>${zh ? '取消' : 'Cancel'}</MButton>
|
|
166
|
+
</MPageSection>
|
|
167
|
+
</MForm>
|
|
168
168
|
</MPageSection>`;
|
|
169
|
-
const dashboardContent = ` <MPageHeader :title="title" />
|
|
170
|
-
<MGrid :cols="2" :x-gap="16" :y-gap="16" responsive="screen">
|
|
171
|
-
<MGridItem v-for="metric in metrics" :key="metric.label" :span="1">
|
|
172
|
-
<MPageStat :label="metric.label" :value="metric.value" icon="activity" />
|
|
173
|
-
</MGridItem>
|
|
174
|
-
</MGrid>
|
|
175
|
-
<MCard shadow="always" :title="${zh ? '趋势概览' : 'Trend overview'}">
|
|
176
|
-
<MSkeleton v-if="loading" height="8rem" />
|
|
177
|
-
<MEmpty
|
|
178
|
-
v-else
|
|
179
|
-
:title="${zh ? '暂无图表数据' : 'No chart data yet'}"
|
|
180
|
-
:description="${zh ? '接入图表或业务组件。' : 'Connect charts or business widgets here.'}"
|
|
181
|
-
aria-label="${zh ? '图表占位' : 'Chart placeholder'}"
|
|
182
|
-
/>
|
|
169
|
+
const dashboardContent = ` <MPageHeader :title="title" />
|
|
170
|
+
<MGrid :cols="2" :x-gap="16" :y-gap="16" responsive="screen">
|
|
171
|
+
<MGridItem v-for="metric in metrics" :key="metric.label" :span="1">
|
|
172
|
+
<MPageStat :label="metric.label" :value="metric.value" icon="activity" />
|
|
173
|
+
</MGridItem>
|
|
174
|
+
</MGrid>
|
|
175
|
+
<MCard shadow="always" :title="${zh ? '趋势概览' : 'Trend overview'}">
|
|
176
|
+
<MSkeleton v-if="loading" height="8rem" />
|
|
177
|
+
<MEmpty
|
|
178
|
+
v-else
|
|
179
|
+
:title="${zh ? '暂无图表数据' : 'No chart data yet'}"
|
|
180
|
+
:description="${zh ? '接入图表或业务组件。' : 'Connect charts or business widgets here.'}"
|
|
181
|
+
aria-label="${zh ? '图表占位' : 'Chart placeholder'}"
|
|
182
|
+
/>
|
|
183
183
|
</MCard>`;
|
|
184
|
-
const detailContent = ` <MPageHeader :title="title" :description="${zh ? '查看资源摘要与属性。' : 'Review summary and properties.'}">
|
|
185
|
-
<template #actions>
|
|
186
|
-
<MSpace>
|
|
187
|
-
<MStatus :label="${zh ? '启用' : 'Active'}" type="success" />
|
|
188
|
-
<MButton type="primary">${zh ? '编辑' : 'Edit'}</MButton>
|
|
189
|
-
<MButton>${zh ? '返回' : 'Back'}</MButton>
|
|
190
|
-
</MSpace>
|
|
191
|
-
</template>
|
|
192
|
-
</MPageHeader>
|
|
193
|
-
<MCard :title="${zh ? '基本信息' : 'Basics'}">
|
|
194
|
-
<p style="margin:0;color:var(--m-color-text-muted)">${zh ? '用定义列表或网格展示属性;相关列表用 MTable + rows。' : 'Use a definition grid; related lists use MTable + rows.'}</p>
|
|
184
|
+
const detailContent = ` <MPageHeader :title="title" :description="${zh ? '查看资源摘要与属性。' : 'Review summary and properties.'}">
|
|
185
|
+
<template #actions>
|
|
186
|
+
<MSpace>
|
|
187
|
+
<MStatus :label="${zh ? '启用' : 'Active'}" type="success" />
|
|
188
|
+
<MButton type="primary">${zh ? '编辑' : 'Edit'}</MButton>
|
|
189
|
+
<MButton>${zh ? '返回' : 'Back'}</MButton>
|
|
190
|
+
</MSpace>
|
|
191
|
+
</template>
|
|
192
|
+
</MPageHeader>
|
|
193
|
+
<MCard :title="${zh ? '基本信息' : 'Basics'}">
|
|
194
|
+
<p style="margin:0;color:var(--m-color-text-muted)">${zh ? '用定义列表或网格展示属性;相关列表用 MTable + rows。' : 'Use a definition grid; related lists use MTable + rows.'}</p>
|
|
195
195
|
</MCard>`;
|
|
196
|
-
const settingsContent = ` <MPageHeader :title="title" :description="${zh ? '按域分组配置偏好。' : 'Grouped preference settings.'}" />
|
|
197
|
-
<MTabs v-model="activeTab" :tabs="settingTabs">
|
|
198
|
-
<template #default="{ activeValue }">
|
|
199
|
-
<MPageSection v-if="activeValue === 'general'" variant="form" :title="${zh ? '常规' : 'General'}">
|
|
200
|
-
<MForm @submit.prevent="submit">
|
|
201
|
-
<MFormItem label="${zh ? '显示名称' : 'Display name'}" name="name" required>
|
|
202
|
-
<MInput v-model="model.name" fluid />
|
|
203
|
-
</MFormItem>
|
|
204
|
-
<MPageSection variant="actions">
|
|
205
|
-
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
|
|
206
|
-
</MPageSection>
|
|
207
|
-
</MForm>
|
|
208
|
-
</MPageSection>
|
|
209
|
-
</template>
|
|
196
|
+
const settingsContent = ` <MPageHeader :title="title" :description="${zh ? '按域分组配置偏好。' : 'Grouped preference settings.'}" />
|
|
197
|
+
<MTabs v-model="activeTab" :tabs="settingTabs">
|
|
198
|
+
<template #default="{ activeValue }">
|
|
199
|
+
<MPageSection v-if="activeValue === 'general'" variant="form" :title="${zh ? '常规' : 'General'}">
|
|
200
|
+
<MForm @submit.prevent="submit">
|
|
201
|
+
<MFormItem label="${zh ? '显示名称' : 'Display name'}" name="name" required>
|
|
202
|
+
<MInput v-model="model.name" fluid />
|
|
203
|
+
</MFormItem>
|
|
204
|
+
<MPageSection variant="actions">
|
|
205
|
+
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
|
|
206
|
+
</MPageSection>
|
|
207
|
+
</MForm>
|
|
208
|
+
</MPageSection>
|
|
209
|
+
</template>
|
|
210
210
|
</MTabs>`;
|
|
211
|
-
const wizardContent = ` <MPageHeader :title="title" :description="${zh ? '每步一个主任务。' : 'One job per step.'}" />
|
|
212
|
-
<MStepper v-model="activeStep" :steps="wizardSteps" linear />
|
|
213
|
-
<MPageSection variant="form">
|
|
214
|
-
<MForm @submit.prevent="submit">
|
|
215
|
-
<MFormItem label="${zh ? '名称' : 'Name'}" name="name" required>
|
|
216
|
-
<MInput v-model="model.name" fluid />
|
|
217
|
-
</MFormItem>
|
|
218
|
-
<MPageSection variant="actions">
|
|
219
|
-
<MSpace>
|
|
220
|
-
<MButton type="text" :disabled="activeStep === 0" @click="activeStep = Math.max(activeStep - 1, 0)">${zh ? '上一步' : 'Back'}</MButton>
|
|
221
|
-
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '下一步' : 'Next'}</MButton>
|
|
222
|
-
</MSpace>
|
|
223
|
-
</MPageSection>
|
|
224
|
-
</MForm>
|
|
211
|
+
const wizardContent = ` <MPageHeader :title="title" :description="${zh ? '每步一个主任务。' : 'One job per step.'}" />
|
|
212
|
+
<MStepper v-model="activeStep" :steps="wizardSteps" linear />
|
|
213
|
+
<MPageSection variant="form">
|
|
214
|
+
<MForm @submit.prevent="submit">
|
|
215
|
+
<MFormItem label="${zh ? '名称' : 'Name'}" name="name" required>
|
|
216
|
+
<MInput v-model="model.name" fluid />
|
|
217
|
+
</MFormItem>
|
|
218
|
+
<MPageSection variant="actions">
|
|
219
|
+
<MSpace>
|
|
220
|
+
<MButton type="text" :disabled="activeStep === 0" @click="activeStep = Math.max(activeStep - 1, 0)">${zh ? '上一步' : 'Back'}</MButton>
|
|
221
|
+
<MButton html-type="submit" type="primary" :loading="loading">${zh ? '下一步' : 'Next'}</MButton>
|
|
222
|
+
</MSpace>
|
|
223
|
+
</MPageSection>
|
|
224
|
+
</MForm>
|
|
225
225
|
</MPageSection>`;
|
|
226
226
|
let innerTemplate = '';
|
|
227
227
|
if (isList) {
|
|
228
|
-
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
229
|
-
<MLayout has-sider fill-viewport>
|
|
230
|
-
<MLayoutSider bordered />
|
|
231
|
-
<MLayout>
|
|
232
|
-
<MLayoutHeader :padding="'var(--m-space-4) var(--m-space-6)'">
|
|
233
|
-
<MBreadcrumb :model="[{ label: '${zh ? '首页' : 'Home'}', to: '/' }, { label: '${title}' }]" />
|
|
234
|
-
</MLayoutHeader>
|
|
235
|
-
<MLayoutContent>
|
|
236
|
-
<MPageContent fill>
|
|
237
|
-
${listContent}
|
|
238
|
-
</MPageContent>
|
|
239
|
-
</MLayoutContent>
|
|
240
|
-
</MLayout>
|
|
241
|
-
</MLayout>
|
|
228
|
+
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
229
|
+
<MLayout has-sider fill-viewport>
|
|
230
|
+
<MLayoutSider bordered />
|
|
231
|
+
<MLayout>
|
|
232
|
+
<MLayoutHeader :padding="'var(--m-space-4) var(--m-space-6)'">
|
|
233
|
+
<MBreadcrumb :model="[{ label: '${zh ? '首页' : 'Home'}', to: '/' }, { label: '${title}' }]" />
|
|
234
|
+
</MLayoutHeader>
|
|
235
|
+
<MLayoutContent>
|
|
236
|
+
<MPageContent fill>
|
|
237
|
+
${listContent}
|
|
238
|
+
</MPageContent>
|
|
239
|
+
</MLayoutContent>
|
|
240
|
+
</MLayout>
|
|
241
|
+
</MLayout>
|
|
242
242
|
</MConfigProvider>`;
|
|
243
243
|
}
|
|
244
244
|
else if (useLayoutShell) {
|
|
@@ -252,76 +252,76 @@ ${listContent}
|
|
|
252
252
|
? wizardContent
|
|
253
253
|
: formContent;
|
|
254
254
|
const pageContentAttrs = isForm || isSettings || isWizard ? ' width="narrow"' : isDashboard ? ' density="spacious"' : '';
|
|
255
|
-
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
256
|
-
<MLayout fill-viewport>
|
|
257
|
-
<MLayoutHeader :padding="'var(--m-space-4) var(--m-space-6)'">
|
|
258
|
-
<MBreadcrumb :model="[{ label: '${zh ? '首页' : 'Home'}', to: '/' }, { label: title }]" />
|
|
259
|
-
</MLayoutHeader>
|
|
260
|
-
<MLayoutContent>
|
|
261
|
-
<MPageContent${pageContentAttrs}>
|
|
262
|
-
${content}
|
|
263
|
-
</MPageContent>
|
|
264
|
-
</MLayoutContent>
|
|
265
|
-
</MLayout>
|
|
255
|
+
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
256
|
+
<MLayout fill-viewport>
|
|
257
|
+
<MLayoutHeader :padding="'var(--m-space-4) var(--m-space-6)'">
|
|
258
|
+
<MBreadcrumb :model="[{ label: '${zh ? '首页' : 'Home'}', to: '/' }, { label: title }]" />
|
|
259
|
+
</MLayoutHeader>
|
|
260
|
+
<MLayoutContent>
|
|
261
|
+
<MPageContent${pageContentAttrs}>
|
|
262
|
+
${content}
|
|
263
|
+
</MPageContent>
|
|
264
|
+
</MLayoutContent>
|
|
265
|
+
</MLayout>
|
|
266
266
|
</MConfigProvider>`;
|
|
267
267
|
}
|
|
268
268
|
else if (isAuth) {
|
|
269
|
-
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
270
|
-
<main class="m-generated-page m-generated-auth">
|
|
271
|
-
<MCard>
|
|
272
|
-
<MForm label-position="top" @submit.prevent="submit">
|
|
273
|
-
<MFormItem label="${zh ? '邮箱' : 'Email'}" name="email">
|
|
274
|
-
<MInput type="email" fluid />
|
|
275
|
-
</MFormItem>
|
|
276
|
-
<MFormItem label="${zh ? '密码' : 'Password'}" name="password">
|
|
277
|
-
<MInput type="password" fluid />
|
|
278
|
-
</MFormItem>
|
|
279
|
-
<MButton html-type="submit" type="primary" :loading="loading" block>${zh ? '登录' : 'Sign in'}</MButton>
|
|
280
|
-
</MForm>
|
|
281
|
-
</MCard>
|
|
282
|
-
</main>
|
|
269
|
+
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
270
|
+
<main class="m-generated-page m-generated-auth">
|
|
271
|
+
<MCard>
|
|
272
|
+
<MForm label-position="top" @submit.prevent="submit">
|
|
273
|
+
<MFormItem label="${zh ? '邮箱' : 'Email'}" name="email">
|
|
274
|
+
<MInput type="email" fluid />
|
|
275
|
+
</MFormItem>
|
|
276
|
+
<MFormItem label="${zh ? '密码' : 'Password'}" name="password">
|
|
277
|
+
<MInput type="password" fluid />
|
|
278
|
+
</MFormItem>
|
|
279
|
+
<MButton html-type="submit" type="primary" :loading="loading" block>${zh ? '登录' : 'Sign in'}</MButton>
|
|
280
|
+
</MForm>
|
|
281
|
+
</MCard>
|
|
282
|
+
</main>
|
|
283
283
|
</MConfigProvider>`;
|
|
284
284
|
}
|
|
285
285
|
else if (isEmpty) {
|
|
286
|
-
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
287
|
-
<main class="m-generated-page">
|
|
288
|
-
<MPageContent>
|
|
289
|
-
<MPageHeader :title="title">
|
|
290
|
-
<template #actions>
|
|
291
|
-
<MButton type="primary" @click="submit">${zh ? '新建' : 'Create'}</MButton>
|
|
292
|
-
</template>
|
|
293
|
-
</MPageHeader>
|
|
294
|
-
<MEmpty
|
|
295
|
-
:title="${zh ? '暂无内容' : 'Nothing here yet'}"
|
|
296
|
-
:description="${zh ? '创建第一条记录开始使用。' : 'Create your first record to get started.'}"
|
|
297
|
-
icon="database"
|
|
298
|
-
>
|
|
299
|
-
<template #extra>
|
|
300
|
-
<MButton type="primary" @click="submit">${zh ? '创建' : 'Create'}</MButton>
|
|
301
|
-
</template>
|
|
302
|
-
</MEmpty>
|
|
303
|
-
</MPageContent>
|
|
304
|
-
</main>
|
|
286
|
+
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
287
|
+
<main class="m-generated-page">
|
|
288
|
+
<MPageContent>
|
|
289
|
+
<MPageHeader :title="title">
|
|
290
|
+
<template #actions>
|
|
291
|
+
<MButton type="primary" @click="submit">${zh ? '新建' : 'Create'}</MButton>
|
|
292
|
+
</template>
|
|
293
|
+
</MPageHeader>
|
|
294
|
+
<MEmpty
|
|
295
|
+
:title="${zh ? '暂无内容' : 'Nothing here yet'}"
|
|
296
|
+
:description="${zh ? '创建第一条记录开始使用。' : 'Create your first record to get started.'}"
|
|
297
|
+
icon="database"
|
|
298
|
+
>
|
|
299
|
+
<template #extra>
|
|
300
|
+
<MButton type="primary" @click="submit">${zh ? '创建' : 'Create'}</MButton>
|
|
301
|
+
</template>
|
|
302
|
+
</MEmpty>
|
|
303
|
+
</MPageContent>
|
|
304
|
+
</main>
|
|
305
305
|
</MConfigProvider>`;
|
|
306
306
|
}
|
|
307
307
|
else {
|
|
308
|
-
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
309
|
-
<main class="m-generated-page">
|
|
310
|
-
<MCard>
|
|
311
|
-
<p class="m-generated-muted">${zh ? '将此区域替换为页面内容。' : 'Replace this area with page content.'}</p>
|
|
312
|
-
<MTag value="${zh ? '示例' : 'Example'}" type="info" />
|
|
313
|
-
</MCard>
|
|
314
|
-
</main>
|
|
308
|
+
innerTemplate = `<MConfigProvider :locale="zhCN">
|
|
309
|
+
<main class="m-generated-page">
|
|
310
|
+
<MCard>
|
|
311
|
+
<p class="m-generated-muted">${zh ? '将此区域替换为页面内容。' : 'Replace this area with page content.'}</p>
|
|
312
|
+
<MTag value="${zh ? '示例' : 'Example'}" type="info" />
|
|
313
|
+
</MCard>
|
|
314
|
+
</main>
|
|
315
315
|
</MConfigProvider>`;
|
|
316
316
|
}
|
|
317
|
-
const template = `<template>
|
|
318
|
-
${innerTemplate}
|
|
319
|
-
<p v-if="error" role="alert" class="m-generated-error">${'{{ error }}'}</p>
|
|
317
|
+
const template = `<template>
|
|
318
|
+
${innerTemplate}
|
|
319
|
+
<p v-if="error" role="alert" class="m-generated-error">${'{{ error }}'}</p>
|
|
320
320
|
</template>`;
|
|
321
|
-
const style = `<style scoped>
|
|
322
|
-
.m-generated-auth { display: grid; place-items: center; padding: var(--m-space-8); max-width: 24rem; margin: 0 auto; min-height: 100vh; }
|
|
323
|
-
.m-generated-empty { display: grid; gap: var(--m-space-2); justify-items: center; padding: var(--m-space-8); text-align: center; }
|
|
324
|
-
.m-generated-error { color: var(--m-color-danger); padding: 0 var(--m-space-6); }
|
|
321
|
+
const style = `<style scoped>
|
|
322
|
+
.m-generated-auth { display: grid; place-items: center; padding: var(--m-space-8); max-width: 24rem; margin: 0 auto; min-height: 100vh; }
|
|
323
|
+
.m-generated-empty { display: grid; gap: var(--m-space-2); justify-items: center; padding: var(--m-space-8); text-align: center; }
|
|
324
|
+
.m-generated-error { color: var(--m-color-danger); padding: 0 var(--m-space-6); }
|
|
325
325
|
</style>`;
|
|
326
326
|
return { script, template, style };
|
|
327
327
|
}
|
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.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",
|