refactor(editor): reorg block specs (#9421)

This commit is contained in:
Saul-Mirone
2024-12-30 05:59:25 +00:00
parent 87331b49b7
commit e3b6841944
16 changed files with 121 additions and 173 deletions
@@ -64,19 +64,28 @@ export const pageRootWidgetViewMap = {
[AFFINE_SCROLL_ANCHORING_WIDGET]: literal`${unsafeStatic(AFFINE_SCROLL_ANCHORING_WIDGET)}`,
};
export const PageRootBlockSpec: ExtensionType[] = [
const PageCommonExtension: ExtensionType[] = [
FlavourExtension('affine:page'),
PageRootService,
DocModeService,
ThemeService,
EmbedOptionService,
CommandExtension(commands),
DocDisplayMetaService,
PageViewportServiceExtension,
];
export const PageRootBlockSpec: ExtensionType[] = [
...PageCommonExtension,
BlockViewExtension('affine:page', literal`affine-page-root`),
CommandExtension(commands),
WidgetViewMapExtension('affine:page', pageRootWidgetViewMap),
ExportManagerExtension,
DNDAPIExtension,
PageViewportServiceExtension,
DocDisplayMetaService,
RootBlockAdapterExtensions,
FileDropExtension,
].flat();
export const PreviewPageRootBlockSpec: ExtensionType[] = [
...PageCommonExtension,
BlockViewExtension('affine:page', literal`affine-preview-root`),
];