mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 03:19:52 +08:00
feat(editor): type safe draft model and transformer (#10486)
This commit is contained in:
@@ -24,7 +24,7 @@ import type {
|
||||
Store,
|
||||
TransformerMiddleware,
|
||||
} from '@blocksuite/affine/store';
|
||||
import { Transformer } from '@blocksuite/affine/store';
|
||||
import { toDraftModel, Transformer } from '@blocksuite/affine/store';
|
||||
|
||||
const updateSnapshotText = (
|
||||
point: TextRangePoint,
|
||||
@@ -51,10 +51,10 @@ function processSnapshot(
|
||||
|
||||
const modelId = model.id;
|
||||
if (text.from.blockId === modelId) {
|
||||
updateSnapshotText(text.from, snapshot, model);
|
||||
updateSnapshotText(text.from, snapshot, toDraftModel(model));
|
||||
}
|
||||
if (text.to && text.to.blockId === modelId) {
|
||||
updateSnapshotText(text.to, snapshot, model);
|
||||
updateSnapshotText(text.to, snapshot, toDraftModel(model));
|
||||
}
|
||||
|
||||
// If the snapshot has children, handle them recursively
|
||||
|
||||
Reference in New Issue
Block a user