feat: 建立行业与视觉模板注册表
This commit is contained in:
1 parent
4339e73819
commit
9feea651a0
3 files changed
+66
No files matched your search
@@ -0,0 +1,26 @@
|
|||||||
|
# 模板注册表
|
||||||
|
|
||||||
|
模板采用“行业模板 + 视觉模板”组合,不再为每个行业复制一套小程序代码。
|
||||||
|
|
||||||
|
## 当前注册
|
||||||
|
|
||||||
|
### 行业模板
|
||||||
|
|
||||||
|
- `personal@1.0.0`:个人品牌基线。
|
||||||
|
- `food@1.0.0`:餐饮业务表达示例。
|
||||||
|
|
||||||
|
### 视觉模板
|
||||||
|
|
||||||
|
- `linjing-editorial@1.0.0`:林境建筑画册,适合高端定制和项目型业务。
|
||||||
|
- `minimal-neutral@1.0.0`:极简留白,适合咨询、设计和专业服务。
|
||||||
|
|
||||||
|
## 组合规则
|
||||||
|
|
||||||
|
行业模板决定字段、Offering schema、表单用途和能力依赖;视觉模板决定模块变体、主题 token 和页面表达。安装结果必须保存行业模板和视觉模板的版本快照,后续升级只能显式执行并提供差异预览。
|
||||||
|
|
||||||
|
## 后续
|
||||||
|
|
||||||
|
1. Prisma 增加视觉模板安装快照字段;
|
||||||
|
2. Admin 模板中心展示行业 / 视觉模板组合预览;
|
||||||
|
3. Runtime Workspace 合并两类模板的模块和主题;
|
||||||
|
4. 为每个组合生成 fixture 和视觉回归基线。
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
- [x] 建立林境门作模板 fixture 和标准模块 / 页面完整性检查。
|
- [x] 建立林境门作模板 fixture 和标准模块 / 页面完整性检查。
|
||||||
- [x] 建立固定页面状态、视口和视觉锚点清单,可供后续截图回归执行。
|
- [x] 建立固定页面状态、视口和视觉锚点清单,可供后续截图回归执行。
|
||||||
- [ ] Phase 3:模板中心、安装快照、升级和回滚。
|
- [ ] Phase 3:模板中心、安装快照、升级和回滚。
|
||||||
|
- [x] 建立行业模板与视觉模板注册表,并注册林境建筑画册与极简留白视觉模板。
|
||||||
- [ ] Phase 4:Capability Plugin。
|
- [ ] Phase 4:Capability Plugin。
|
||||||
- [ ] Phase 5:林境门作与第二行业双模板验证。
|
- [ ] Phase 5:林境门作与第二行业双模板验证。
|
||||||
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
|
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export const configPackageName = "personal-brand-config";
|
export const configPackageName = "personal-brand-config";
|
||||||
|
|
||||||
export type BrandTemplateKey = "personal" | "food";
|
export type BrandTemplateKey = "personal" | "food";
|
||||||
|
export type VisualTemplateKey = "linjing-editorial" | "minimal-neutral";
|
||||||
export type CapabilityKey = "offerings" | "inquiry" | "booking";
|
export type CapabilityKey = "offerings" | "inquiry" | "booking";
|
||||||
|
|
||||||
export interface WorkflowDefinition {
|
export interface WorkflowDefinition {
|
||||||
@@ -65,6 +66,44 @@ export interface BrandTemplateDefinition {
|
|||||||
capabilities: CapabilityKey[];
|
capabilities: CapabilityKey[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VisualTemplateDefinition {
|
||||||
|
key: VisualTemplateKey;
|
||||||
|
version: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
variants: Record<string, string>;
|
||||||
|
theme: { colors: Record<string, string>; radius: Record<string, string> };
|
||||||
|
}
|
||||||
|
|
||||||
|
export const visualTemplates: Record<VisualTemplateKey, VisualTemplateDefinition> = {
|
||||||
|
"linjing-editorial": {
|
||||||
|
key: "linjing-editorial",
|
||||||
|
version: "1.0.0",
|
||||||
|
name: "林境建筑画册",
|
||||||
|
description: "适合高端定制、建筑作品和项目型个人品牌。",
|
||||||
|
variants: { hero: "architectural", offeringList: "editorial", detail: "project-case" },
|
||||||
|
theme: {
|
||||||
|
colors: { background: "#F7F5F1", foreground: "#252525", accent: "#8A6846", dark: "#202221" },
|
||||||
|
radius: { card: "16rpx" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"minimal-neutral": {
|
||||||
|
key: "minimal-neutral",
|
||||||
|
version: "1.0.0",
|
||||||
|
name: "极简留白",
|
||||||
|
description: "适合咨询、设计和专业服务型个人品牌。",
|
||||||
|
variants: { hero: "minimal", offeringList: "square-card", detail: "service-process" },
|
||||||
|
theme: {
|
||||||
|
colors: { background: "#FAFAF8", foreground: "#202221", accent: "#4B5563", dark: "#202221" },
|
||||||
|
radius: { card: "8rpx" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export function getVisualTemplate(key: string): VisualTemplateDefinition | undefined {
|
||||||
|
return visualTemplates[key as VisualTemplateKey];
|
||||||
|
}
|
||||||
|
|
||||||
export function canTransitionWorkflow(workflowKey: string, from: string, to: string): boolean {
|
export function canTransitionWorkflow(workflowKey: string, from: string, to: string): boolean {
|
||||||
const workflow = workflowRegistry[workflowKey as keyof typeof workflowRegistry] as
|
const workflow = workflowRegistry[workflowKey as keyof typeof workflowRegistry] as
|
||||||
WorkflowDefinition | undefined;
|
WorkflowDefinition | undefined;
|
||||||
|
|||||||
Reference in new issue
Block a user