feat: wire page options through aggregate AI flow

This commit is contained in:
lix-2026
2026-05-10 08:40:16 +08:00
parent 3adc2b5e85
commit b7ceb7afae
12 changed files with 1085 additions and 161 deletions
@@ -11,6 +11,7 @@ export type PageOptionSurface =
| "inspector_only";
export type PageOptionRuntimeSupport = "wired" | "planned" | "ui_only";
export type PageOptionPanelPolicy = "keep" | "downgrade" | "global_only";
export type PageOptionSemanticDescriptor = {
surfaces: PageOptionSurface[];
@@ -98,6 +99,25 @@ export type LeptosTiptapRuntimePageOptions = {
embedDefaultBlockId: string | null;
};
export const PAGE_OPTION_PANEL_POLICY: Record<
BooleanPageOptionKey | "pageFont" | "layoutDensity" | "showStructure" | "embedDefaultBlockId",
PageOptionPanelPolicy
> = {
wideLayout: "keep",
smallText: "keep",
showHeadingNumbers: "keep",
showToc: "keep",
showStructure: "global_only",
protectEditing: "downgrade",
showWordCount: "keep",
collapseBacklinks: "keep",
pageFont: "keep",
layoutDensity: "keep",
hideChildPages: "keep",
showBlockRefCount: "downgrade",
embedDefaultBlockId: "keep",
};
export function pickLeptosTiptapRuntimePageOptions(
pageOptions: PageOptionsState,
): LeptosTiptapRuntimePageOptions {