feat: 完善模板驱动的品牌内容工作台

This commit is contained in:
que01 committed 2026-09-25 05:21:42 +08:00
1 parent 77224ea51f
commit dd55af8d73
46 files changed
+2204 -295

No files matched your search

@@ -10,6 +10,7 @@ import {
resolveCapabilities,
capabilityPlugins,
getDefaultVisualTemplateKey,
getTemplatePackageManifestForVisualKey,
} from "@personal-brand/config";
import type {
RuntimeInquiryField,
@@ -120,6 +121,9 @@ export class PublicWorkspaceController {
releaseSnapshot.visualTemplateDefinition ?? getVisualTemplate(visualTemplateKey);
const visualTemplateManifest =
releaseSnapshot.visualTemplateManifest ?? getVisualTemplateManifest(visualTemplateKey);
const templatePackageManifest =
releaseSnapshot.templatePackageManifest ??
getTemplatePackageManifestForVisualKey(visualTemplateKey);
const runtimeBrand = {
...brandData,
...brandConfig,
@@ -177,6 +181,20 @@ export class PublicWorkspaceController {
schemaKey: typeof config.schemaKey === "string" ? config.schemaKey : "offering.default",
schemaVersion: typeof config.schemaVersion === "string" ? config.schemaVersion : "1.0.0",
presentation: {
...Object.fromEntries(
Object.entries(config).filter(
([key]) =>
![
"schemaKey",
"schemaVersion",
"details",
"sections",
"media",
"presentation",
].includes(key),
),
),
...this.jsonObject(config.presentation),
categoryKey: typeof config.categoryKey === "string" ? config.categoryKey : "custom",
categoryLabel:
typeof config.categoryLabel === "string" ? config.categoryLabel : "业务提供项",
@@ -266,11 +284,15 @@ export class PublicWorkspaceController {
},
brand: runtimeBrand,
navigation: {
tabs: [
{ key: "home", label: "首页", page: "pages/index/index" },
{ key: "offerings", label: "案例与体系", page: "pages/services/index" },
{ key: "profile", label: "主理人与我", page: "pages/bookings/index" },
],
tabs:
templatePackageManifest?.navigation.map((tab) => ({
key: tab.key,
label: tab.label,
page:
templatePackageManifest.entrypoints[
tab.page as keyof typeof templatePackageManifest.entrypoints
] ?? tab.page,
})) ?? [],
},
modules: runtimeModules,
offerings: runtimeOfferings,