feat: 建立组件化模板预览基线并规划可视化编辑

This commit is contained in:
que01 committed 2026-10-09 12:32:24 +08:00
1 parent c5af790554
commit 0b14b5a814
46 files changed
+1880 -427

No files matched your search

@@ -19,7 +19,7 @@ function Home({ workspace }: { workspace: RuntimeWorkspace }) {
const credential = slot(workspace, "credential");
const t = workspace.trustPresentation;
return (
<View className="editorial-home">
<View className="editorial-home" data-editor-target="linjing-editorial.home.home">
<View className="page">
<View className="founder-card" data-editor-target="editorial.home.identity">
{text(b.avatarUrl) && (
@@ -125,9 +125,12 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "profile");
const config = object(b.profilePresentation);
return (
<View className="editorial-profile">
<View
className="editorial-profile"
data-editor-target="linjing-editorial.profile.profileDetails"
>
<View className="profile">
<View className="founder-card">
<View className="founder-card" data-editor-target="linjing-editorial.profile.identity">
<View className="identity">
{text(b.avatarUrl) && (
<Image className="avatar" src={text(b.avatarUrl)} mode="aspectFill" />
@@ -215,7 +218,7 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
function List({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "offerings");
return (
<View className="editorial-list">
<View className="editorial-list" data-editor-target="linjing-editorial.offerings.cases">
<View className="page">
<Text className="eyebrow">{p.eyebrow}</Text>
<Text className="section-title">{p.title || "作品与服务"}</Text>
@@ -255,7 +258,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
const item = offering(found);
const p = presentation(workspace, "detail");
return (
<View className="editorial-detail">
<View className="editorial-detail" data-editor-target="linjing-editorial.detail.projectDetail">
<View className="detail">
<View className="hero-wrap">
<Image
@@ -272,7 +275,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
<Text>{item.series}</Text>
</View>
</View>
<View className="content">
<View className="content" data-editor-target="linjing-editorial.detail.detailCopy">
<View className="price-card">
<View>
<Text>{p.priceLabel}</Text>
@@ -333,10 +336,19 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
</View>
);
}
const formTargets: Record<string, string> = {
inquiry: "linjing-editorial.inquiry.consultation",
success: "linjing-editorial.success.successCopy",
records: "linjing-editorial.records.recordsCopy",
};
export function TemplatePage({ workspace, page, children, offeringId }: TemplateProps) {
if (page === "home") return <Home workspace={workspace} />;
if (page === "offerings") return <List workspace={workspace} />;
if (page === "profile" || page === "service") return <Profile workspace={workspace} />;
if (page === "detail") return <Detail workspace={workspace} id={offeringId} />;
return <View className="editorial-forms">{children}</View>;
return (
<View className="editorial-forms" data-editor-target={formTargets[page]}>
{children}
</View>
);
}