refactor: 拆分模板配置契约与注册逻辑
This commit is contained in:
1 parent
7e1dd543fb
commit
d0902d6568
12 files changed
+1025
-945
No files matched your search
@@ -0,0 +1,108 @@
|
||||
import type { BrandTemplateKey } from "./template-keys.js";
|
||||
import type { CapabilityKey } from "./template-keys.js";
|
||||
import type { VisualTemplateKey } from "./template-keys.js";
|
||||
import type { TemplateSampleContent } from "./template-sample-content.js";
|
||||
|
||||
export interface TemplatePackageManifest {
|
||||
packageKey: string;
|
||||
version: string;
|
||||
displayName: string;
|
||||
visualTemplateKey: VisualTemplateKey;
|
||||
runtimeContract: "1.0";
|
||||
supportedIndustryTemplates: readonly BrandTemplateKey[];
|
||||
entrypoints: Readonly<Record<string, string>>;
|
||||
requiredCapabilities: readonly CapabilityKey[];
|
||||
defaultBrandSlug: string;
|
||||
navigation: readonly {
|
||||
key: string;
|
||||
label: string;
|
||||
page: string;
|
||||
iconPath?: string;
|
||||
selectedIconPath?: string;
|
||||
}[];
|
||||
renderers: Readonly<Record<string, string>>;
|
||||
runtimeOwnedPages: readonly string[];
|
||||
dataSlots: readonly {
|
||||
key: string;
|
||||
source: string;
|
||||
required: boolean;
|
||||
description: string;
|
||||
}[];
|
||||
templateFields?: readonly {
|
||||
key: string;
|
||||
page?: string;
|
||||
binding?: string;
|
||||
label: string;
|
||||
help?: string;
|
||||
input: string;
|
||||
itemFields?: readonly { key: string; label: string; input?: string; required?: boolean }[];
|
||||
itemValueKey?: string;
|
||||
required?: boolean;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
options?: readonly { value: string; label: string }[];
|
||||
}[];
|
||||
assetSlots: readonly {
|
||||
key: string;
|
||||
binding: string;
|
||||
target: "brand" | "offering" | "trust";
|
||||
label: string;
|
||||
help: string;
|
||||
required: boolean;
|
||||
}[];
|
||||
admin: {
|
||||
sections: readonly {
|
||||
key: string;
|
||||
title: string;
|
||||
description: string;
|
||||
page: string;
|
||||
target: "brand" | "offering" | "trust" | "inquiry";
|
||||
previewTargets?: readonly {
|
||||
key: string;
|
||||
label: string;
|
||||
composite?: boolean;
|
||||
children?: readonly string[];
|
||||
}[];
|
||||
fields: readonly {
|
||||
key: string;
|
||||
binding: string;
|
||||
label: string;
|
||||
input: string;
|
||||
help?: string;
|
||||
required?: boolean;
|
||||
itemFields?: readonly { key: string; label: string; input?: string; required?: boolean }[];
|
||||
itemValueKey?: string;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
options?: readonly { value: string; label: string }[];
|
||||
previewTarget?: string;
|
||||
}[];
|
||||
}[];
|
||||
};
|
||||
trustContentTypes?: readonly {
|
||||
type: string;
|
||||
label: string;
|
||||
adminFields: {
|
||||
title: string;
|
||||
summary: string;
|
||||
content: string;
|
||||
summaryHelp?: string;
|
||||
summaryPlaceholder?: string;
|
||||
};
|
||||
help?: string;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
maxPublishedItems?: number;
|
||||
hideStandardFields?: readonly ("summary" | "content")[];
|
||||
configFields?: readonly {
|
||||
key: string;
|
||||
binding: string;
|
||||
label: string;
|
||||
input: string;
|
||||
itemFields?: readonly { key: string; label: string; input?: string; required?: boolean }[];
|
||||
itemValueKey?: string;
|
||||
required?: boolean;
|
||||
}[];
|
||||
}[];
|
||||
sampleContent?: Partial<Record<BrandTemplateKey, TemplateSampleContent>>;
|
||||
}
|
||||
Reference in new issue
Block a user