refactor(editor): remove AbstractEditor type and feature flags in test (#10308)

This commit is contained in:
Saul-Mirone
2025-02-20 07:05:35 +00:00
parent 13f1859cdf
commit 9f4311f654
19 changed files with 215 additions and 412 deletions
@@ -37,10 +37,10 @@ export function removeModeFromStorage(docId: string) {
const DEFAULT_MODE: DocMode = 'page';
const slotMap = new Map<string, Slot<DocMode>>();
export function mockDocModeService(
getEditorModeCallback: () => DocMode,
setEditorModeCallback: (mode: DocMode) => void
) {
export function mockDocModeService(editor: AffineEditorContainer) {
const getEditorModeCallback: () => DocMode = () => editor.mode;
const setEditorModeCallback: (mode: DocMode) => void = mode =>
editor.switchEditor(mode);
const docModeService: DocModeProvider = {
getPrimaryMode: (docId: string) => {
try {