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

@@ -97,16 +97,16 @@ export class BlockModel<Props extends object = object> {
return this._childModels.value;
}
get doc() {
get store() {
return this._store;
}
set doc(doc: Store) {
set store(doc: Store) {
this._store = doc;
}
get parent() {
return this.doc.getParent(this);
return this.store.getParent(this);
}
get role() {

View File

@@ -63,7 +63,7 @@ export class FlatSyncController {
model.stash = this.stash;
model.pop = this.pop;
if (this.doc) {
model.doc = this.doc;
model.store = this.doc;
}
const defaultProps = schema.model.props?.(internalPrimitives);

View File

@@ -168,7 +168,7 @@ export class SyncController {
model.stash = this.stash;
model.pop = this.pop;
if (this.doc) {
model.doc = this.doc;
model.store = this.doc;
}
const proxy = new Proxy(signalWithProps, {

View File

@@ -70,7 +70,7 @@ function getBlockViewType(query: Query, block: Block): BlockViewType {
}
function setAncestorsToDisplayIfHidden(mode: QueryMode, block: Block) {
const doc = block.model.doc;
const doc = block.model.store;
let parent = doc.getParent(block.model);
while (parent) {
const parentBlock = doc.getBlock(parent.id);