feat: 建立行业与视觉模板注册表
This commit is contained in:
1 parent
4339e73819
commit
9feea651a0
3 files changed
+66
No files matched your search
@@ -1,6 +1,7 @@
|
||||
export const configPackageName = "personal-brand-config";
|
||||
|
||||
export type BrandTemplateKey = "personal" | "food";
|
||||
export type VisualTemplateKey = "linjing-editorial" | "minimal-neutral";
|
||||
export type CapabilityKey = "offerings" | "inquiry" | "booking";
|
||||
|
||||
export interface WorkflowDefinition {
|
||||
@@ -65,6 +66,44 @@ export interface BrandTemplateDefinition {
|
||||
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 {
|
||||
const workflow = workflowRegistry[workflowKey as keyof typeof workflowRegistry] as
|
||||
WorkflowDefinition | undefined;
|
||||
|
||||
Reference in new issue
Block a user