107 lines
2.3 KiB
TypeScript
107 lines
2.3 KiB
TypeScript
import type { DetailUiGlobalStyle } from "@/lib/detail-ui-protocol";
|
|
|
|
export type DetailUiDslRegion = {
|
|
x: number;
|
|
y: number;
|
|
width: number;
|
|
height: number;
|
|
};
|
|
|
|
export type DetailUiDslNode =
|
|
| {
|
|
kind: "panel";
|
|
id: string;
|
|
variant?: "glass" | "solid" | "ghost";
|
|
tone?: "light" | "dark" | "accent";
|
|
region?: DetailUiDslRegion;
|
|
direction?: "column" | "row";
|
|
gap?: number;
|
|
children: DetailUiDslNode[];
|
|
}
|
|
| {
|
|
kind: "stack";
|
|
id: string;
|
|
gap?: number;
|
|
children: DetailUiDslNode[];
|
|
}
|
|
| {
|
|
kind: "row";
|
|
id: string;
|
|
gap?: number;
|
|
columns?: number;
|
|
children: DetailUiDslNode[];
|
|
}
|
|
| {
|
|
kind: "badge";
|
|
id: string;
|
|
icon?: "sparkle" | "shield" | "arrow" | "check";
|
|
text: string;
|
|
tone?: "primary" | "secondary" | "neutral";
|
|
}
|
|
| {
|
|
kind: "heading";
|
|
id: string;
|
|
text: string;
|
|
level?: 1 | 2 | 3;
|
|
emphasis?: "hero" | "section";
|
|
}
|
|
| {
|
|
kind: "body";
|
|
id: string;
|
|
text: string;
|
|
emphasis?: "normal" | "muted" | "strong";
|
|
}
|
|
| {
|
|
kind: "feature-card";
|
|
id: string;
|
|
icon?: "sparkle" | "shield" | "arrow" | "check";
|
|
tone?: "primary" | "secondary" | "neutral";
|
|
tag?: string;
|
|
title: string;
|
|
body?: string;
|
|
}
|
|
| {
|
|
kind: "spec-table";
|
|
id: string;
|
|
rows: Array<{ label: string; value: string }>;
|
|
}
|
|
| {
|
|
kind: "compare";
|
|
id: string;
|
|
before: { title: string; body: string };
|
|
after: { title: string; body: string };
|
|
}
|
|
| {
|
|
kind: "proof";
|
|
id: string;
|
|
icon?: "shield" | "check" | "sparkle";
|
|
text: string;
|
|
}
|
|
| {
|
|
kind: "cta";
|
|
id: string;
|
|
headline?: string;
|
|
buttonText: string;
|
|
supportText?: string;
|
|
};
|
|
|
|
export interface DetailUiDslV2Document {
|
|
version: "detail-ui-dsl/v2";
|
|
surfaceId: string;
|
|
screenIndex: number;
|
|
generationMode: "classic" | "agent_layout";
|
|
screenSize: {
|
|
width: number;
|
|
height: number;
|
|
};
|
|
designStyle?: DetailUiGlobalStyle;
|
|
region: DetailUiDslRegion;
|
|
layoutVariant:
|
|
| "hero-left-panel"
|
|
| "hero-right-panel"
|
|
| "top-banner-bottom-grid"
|
|
| "floating-split"
|
|
| "cta-focus";
|
|
nodes: DetailUiDslNode[];
|
|
}
|