refactor: workspace manager (#5060)

This commit is contained in:
EYHN
2023-12-15 07:20:50 +00:00
parent af15aa06d4
commit fe2851d3e9
217 changed files with 3605 additions and 4244 deletions

View File

@@ -1,5 +1,6 @@
/// <reference types="@blocksuite/global" />
import { assertEquals } from '@blocksuite/global/utils';
import type { Workspace } from '@blocksuite/store';
import { z } from 'zod';
import { isDesktop, isServer } from './constant.js';
@@ -149,3 +150,12 @@ export function setupGlobal() {
globalThis.$AFFINE_SETUP = true;
}
export function setupEditorFlags(workspace: Workspace) {
Object.entries(runtimeConfig.editorFlags).forEach(([key, value]) => {
workspace.awarenessStore.setFlag(
key as keyof BlockSuiteFeatureFlags,
value
);
});
}