feat: land page aggregate and phase7 document ai mainline
- 收口 page aggregate 读取、本地状态与命令客户端\n- 接入 phase7 document ai sidecar 与前端编排入口\n- 更新 architecture 与 design 状态迁移
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
import type {
|
||||
BooleanPageOptionKey,
|
||||
PageLayoutDensity,
|
||||
PageOptionsState,
|
||||
} from "@/types/page-options";
|
||||
|
||||
export type PageOptionSurface =
|
||||
| "page_shell_layout"
|
||||
| "read_view"
|
||||
| "editor_runtime"
|
||||
| "inspector_only";
|
||||
|
||||
export type PageOptionRuntimeSupport = "wired" | "planned" | "ui_only";
|
||||
|
||||
export type PageOptionSemanticDescriptor = {
|
||||
surfaces: PageOptionSurface[];
|
||||
runtimeSupport: PageOptionRuntimeSupport;
|
||||
};
|
||||
|
||||
export const PAGE_OPTION_PANEL_GROUPS: {
|
||||
page: BooleanPageOptionKey[];
|
||||
custom: BooleanPageOptionKey[];
|
||||
} = {
|
||||
page: [
|
||||
"wideLayout",
|
||||
"smallText",
|
||||
"showHeadingNumbers",
|
||||
"showToc",
|
||||
"protectEditing",
|
||||
"showWordCount",
|
||||
],
|
||||
custom: ["collapseBacklinks", "hideChildPages", "showBlockRefCount"],
|
||||
};
|
||||
|
||||
export const PAGE_OPTION_SEMANTICS: Record<
|
||||
BooleanPageOptionKey | "pageFont" | "layoutDensity" | "showStructure" | "embedDefaultBlockId",
|
||||
PageOptionSemanticDescriptor
|
||||
> = {
|
||||
wideLayout: {
|
||||
surfaces: ["page_shell_layout", "editor_runtime"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
smallText: {
|
||||
surfaces: ["page_shell_layout", "editor_runtime"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
showHeadingNumbers: {
|
||||
surfaces: ["read_view", "editor_runtime"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
showToc: {
|
||||
surfaces: ["read_view"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
showStructure: {
|
||||
surfaces: ["read_view"],
|
||||
runtimeSupport: "ui_only",
|
||||
},
|
||||
protectEditing: {
|
||||
surfaces: ["page_shell_layout", "editor_runtime"],
|
||||
runtimeSupport: "planned",
|
||||
},
|
||||
showWordCount: {
|
||||
surfaces: ["inspector_only"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
collapseBacklinks: {
|
||||
surfaces: ["page_shell_layout"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
pageFont: {
|
||||
surfaces: ["page_shell_layout"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
layoutDensity: {
|
||||
surfaces: ["page_shell_layout", "editor_runtime"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
hideChildPages: {
|
||||
surfaces: ["page_shell_layout", "read_view"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
showBlockRefCount: {
|
||||
surfaces: ["editor_runtime", "inspector_only"],
|
||||
runtimeSupport: "planned",
|
||||
},
|
||||
embedDefaultBlockId: {
|
||||
surfaces: ["editor_runtime"],
|
||||
runtimeSupport: "wired",
|
||||
},
|
||||
};
|
||||
|
||||
export type LeptosTiptapRuntimePageOptions = {
|
||||
wideLayout: boolean;
|
||||
smallText: boolean;
|
||||
layoutDensity: PageLayoutDensity;
|
||||
showHeadingNumbers: boolean;
|
||||
embedDefaultBlockId: string | null;
|
||||
};
|
||||
|
||||
export function pickLeptosTiptapRuntimePageOptions(
|
||||
pageOptions: PageOptionsState,
|
||||
): LeptosTiptapRuntimePageOptions {
|
||||
return {
|
||||
wideLayout: pageOptions.wideLayout,
|
||||
smallText: pageOptions.smallText,
|
||||
layoutDensity: pageOptions.layoutDensity,
|
||||
showHeadingNumbers: pageOptions.showHeadingNumbers,
|
||||
embedDefaultBlockId: pageOptions.embedDefaultBlockId,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user