mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(editor): rename model.doc to store (#12172)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user