feat: 增加可视化模板页面编辑器

This commit is contained in:
que01 committed 2026-10-08 18:00:36 +08:00
1 parent 9d2038cc93
commit c5af790554
24 files changed
+773 -129

No files matched your search

@@ -1,6 +1,7 @@
import assert from "node:assert/strict";
import {
applyPresentationValues,
filterSectionsForPreviewTarget,
presentationFieldName,
readPresentationValue,
} from "../src/features/brand/presentation-bindings.ts";
@@ -37,6 +38,21 @@ assert.equal(next.visualPresentation.inquiry.subtitle, "原说明");
assert.equal(next.unrelatedSetting, true);
assert.equal(config.founder, "阿成");
const previewSections = [
{
key: "home",
fields: [
{ key: "location", previewTarget: "home.location" },
{ key: "hero", previewTarget: "home.hero" },
],
},
{ key: "profile", fields: [{ key: "bio", previewTarget: "profile.bio" }] },
];
assert.deepEqual(filterSectionsForPreviewTarget(previewSections, "home.hero"), [
{ key: "home", fields: [{ key: "hero", previewTarget: "home.hero" }] },
]);
assert.equal(filterSectionsForPreviewTarget(previewSections).length, 2);
const unsafe = applyPresentationValues(
{ founder: "原主理人" },
[