fix: replace activatable to editable

This commit is contained in:
QiShaoXuan
2022-08-24 19:41:06 +08:00
parent 280fb4d8c7
commit 2e2d0b121b
3 changed files with 49 additions and 31 deletions
@@ -116,7 +116,7 @@ export class BlockHelper {
: blockOrBlockId;
const blockView = this._editor.getView(block.type);
return blockView.activatable;
return blockView.editable;
}
public async getFlatBlocksUnderParent(
@@ -198,7 +198,7 @@ export class BlockHelper {
public async getBlockPropertiesBySelectInfo(selectBlockInfo: SelectBlock) {
const block = await this._editor.getBlockById(selectBlockInfo.blockId);
const blockView = this._editor.getView(block.type);
if (blockView.activatable) {
if (blockView.editable) {
return this.getEditableBlockPropertiesBySelectInfo(
block,
selectBlockInfo
@@ -256,11 +256,11 @@ export class Editor implements Virgo {
}
getEditableViews() {
return Object.values(this.views)
.map(view => (view.activatable ? view : null))
.map(view => (view.editable ? view : null))
.filter(v => v);
}
isEditableView(type: string) {
return this.views[type].activatable;
return this.views[type].editable;
}
private async _initBlock(