mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 05:29:08 +08:00
refactor(editor): merge get surface util (#9371)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import type { Doc } from '@blocksuite/store';
|
||||
|
||||
import type { SurfaceBlockModel } from '../surface-model';
|
||||
|
||||
export function getSurfaceBlock(doc: Doc) {
|
||||
const blocks = doc.getBlocksByFlavour('affine:surface');
|
||||
return blocks.length !== 0 ? (blocks[0].model as SurfaceBlockModel) : null;
|
||||
}
|
||||
@@ -34,3 +34,4 @@ export function normalizeWheelDeltaY(delta: number, zoom = 1) {
|
||||
}
|
||||
|
||||
export { getLastPropsKey } from './get-last-props-key';
|
||||
export { getSurfaceBlock } from './get-surface-block';
|
||||
|
||||
Reference in New Issue
Block a user