mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
feat(editor): add editor store (#9584)
This commit is contained in:
@@ -7,7 +7,7 @@ import { createPageModeSpecs } from '@affine/core/components/blocksuite/block-su
|
||||
import type { AffineDNDData } from '@affine/core/types/dnd';
|
||||
import { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import { DndApiExtensionIdentifier } from '@blocksuite/affine/blocks';
|
||||
import { type SliceSnapshot } from '@blocksuite/affine/store';
|
||||
import { type SliceSnapshot, Store } from '@blocksuite/affine/store';
|
||||
import { Service } from '@toeverything/infra';
|
||||
|
||||
import type { DocsService } from '../../doc';
|
||||
@@ -69,7 +69,7 @@ export class DndService extends Service {
|
||||
}
|
||||
|
||||
const std = new BlockStdScope({
|
||||
doc,
|
||||
store: new Store({ blocks: doc }),
|
||||
extensions: createPageModeSpecs(this.framework),
|
||||
});
|
||||
const dndAPI = std.get(DndApiExtensionIdentifier);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { BlockStdScope } from '@blocksuite/affine/block-std';
|
||||
import { PageEditorBlockSpecs } from '@blocksuite/affine/blocks';
|
||||
import type { Blocks } from '@blocksuite/affine/store';
|
||||
import { type Blocks, Store } from '@blocksuite/affine/store';
|
||||
import { LiveData } from '@toeverything/infra';
|
||||
import { useMemo } from 'react';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -45,7 +45,7 @@ export function signalToLiveData<T>(
|
||||
export function createBlockStdScope(doc: Blocks) {
|
||||
logger.debug('createBlockStdScope', doc.id);
|
||||
const std = new BlockStdScope({
|
||||
doc,
|
||||
store: new Store({ blocks: doc }),
|
||||
extensions: PageEditorBlockSpecs,
|
||||
});
|
||||
return std;
|
||||
|
||||
Reference in New Issue
Block a user