refactor(editor): rename model.doc to store (#12172)

This commit is contained in:
Saul-Mirone
2025-05-07 09:17:01 +00:00
parent eb62d0e853
commit 95b9e4b3d0
95 changed files with 264 additions and 246 deletions

View File

@@ -438,7 +438,7 @@ export class ExportManager {
if (matchModels(block, [ImageBlockModel])) {
if (!block.props.sourceId) return;
const blob = await block.doc.blobSync.get(block.props.sourceId);
const blob = await block.store.blobSync.get(block.props.sourceId);
if (!blob) return;
const blobToImage = (blob: Blob) =>

View File

@@ -44,7 +44,7 @@ export class SurfaceBlockModel extends BaseSurfaceModel {
override _init() {
this._extendElement(elementsCtorMap);
super._init();
this.doc.provider
this.store.provider
.getAll(surfaceMiddlewareIdentifier)
.forEach(({ middleware }) => {
this._disposables.add(middleware(this));

View File

@@ -51,7 +51,7 @@ export function updateXYWH(
bound.w = clamp(bound.w, NOTE_MIN_WIDTH * scale, Infinity);
bound.h = clamp(bound.h, NOTE_MIN_HEIGHT * scale, Infinity);
if (bound.h >= NOTE_MIN_HEIGHT * scale) {
updateBlock.call(ele.doc, ele, () => {
updateBlock.call(ele.store, ele, () => {
ele.props.edgeless.collapse = true;
ele.props.edgeless.collapsedHeight = bound.h / scale;
});