mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat(editor): merge store and blocks (#9591)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Blocks } from '@blocksuite/store';
|
||||
import type { Store } from '@blocksuite/store';
|
||||
|
||||
import {
|
||||
type GfxCompatibleInterface,
|
||||
@@ -124,16 +124,13 @@ export function isLockedImpl(element: GfxCompatibleInterface): boolean {
|
||||
return isLockedBySelfImpl(element) || isLockedByAncestorImpl(element);
|
||||
}
|
||||
|
||||
export function lockElementImpl(doc: Blocks, element: GfxCompatibleInterface) {
|
||||
export function lockElementImpl(doc: Store, element: GfxCompatibleInterface) {
|
||||
doc.transact(() => {
|
||||
element.lockedBySelf = true;
|
||||
});
|
||||
}
|
||||
|
||||
export function unlockElementImpl(
|
||||
doc: Blocks,
|
||||
element: GfxCompatibleInterface
|
||||
) {
|
||||
export function unlockElementImpl(doc: Store, element: GfxCompatibleInterface) {
|
||||
doc.transact(() => {
|
||||
element.lockedBySelf = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user