@blocksuite/lit
Advanced tools
Comparing version 0.13.0-canary-202403071041-3d3374e to 0.13.0-canary-202403080648-55b867a
@@ -40,4 +40,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
}): void; | ||
renderModel: (model: BlockModel) => TemplateResult; | ||
renderModelChildren: (model: BlockModel) => TemplateResult; | ||
renderChildren: (model: BlockModel) => TemplateResult; | ||
protected getUpdateComplete(): Promise<boolean>; | ||
@@ -44,0 +43,0 @@ protected update(changedProperties: PropertyValues): void; |
@@ -33,8 +33,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
this.renderModel = (model) => { | ||
return this.host.renderModel(model); | ||
this.renderChildren = (model) => { | ||
return this.host.renderChildren(model); | ||
}; | ||
this.renderModelChildren = (model) => { | ||
return this.host.renderModelChildren(model); | ||
}; | ||
} | ||
@@ -41,0 +38,0 @@ get parentPath() { |
@@ -27,5 +27,11 @@ import type { BlockSpec, CommandManager, SelectionManager, SpecStore, UIEventDispatcher, ViewStore } from '@blocksuite/block-std'; | ||
render(): TemplateResult | typeof nothing; | ||
private _renderModel; | ||
/** | ||
* @deprecated | ||
* | ||
* This method is deprecated. Use `renderSpecPortal` instead. | ||
*/ | ||
renderModel: (model: BlockModel) => TemplateResult; | ||
renderSpecPortal: (doc: Doc, specs: BlockSpec[]) => TemplateResult; | ||
renderModelChildren: (model: BlockModel) => TemplateResult; | ||
renderChildren: (model: BlockModel) => TemplateResult; | ||
private _registerView; | ||
@@ -32,0 +38,0 @@ } |
@@ -24,3 +24,3 @@ /* eslint-disable lit/binding-positions, lit/no-invalid-html */ | ||
this.rangeManager = null; | ||
this.renderModel = (model) => { | ||
this._renderModel = (model) => { | ||
const { flavour } = model; | ||
@@ -55,2 +55,10 @@ const schema = this.doc.schema.flavourSchemaMap.get(flavour); | ||
}; | ||
/** | ||
* @deprecated | ||
* | ||
* This method is deprecated. Use `renderSpecPortal` instead. | ||
*/ | ||
this.renderModel = (model) => { | ||
return this._renderModel(model); | ||
}; | ||
this.renderSpecPortal = (doc, specs) => { | ||
@@ -65,4 +73,4 @@ return html ` | ||
}; | ||
this.renderModelChildren = (model) => { | ||
return html `${repeat(model.children, child => child.id, child => this.renderModel(child))}`; | ||
this.renderChildren = (model) => { | ||
return html `${repeat(model.children, child => child.id, child => this._renderModel(child))}`; | ||
}; | ||
@@ -159,3 +167,3 @@ this._registerView = () => { | ||
return nothing; | ||
return this.renderModel(root); | ||
return this._renderModel(root); | ||
} | ||
@@ -162,0 +170,0 @@ }; |
{ | ||
"name": "@blocksuite/lit", | ||
"version": "0.13.0-canary-202403071041-3d3374e", | ||
"version": "0.13.0-canary-202403080648-55b867a", | ||
"description": "Lit renderer for blocksuite store", | ||
@@ -11,13 +11,13 @@ "type": "module", | ||
"peerDependencies": { | ||
"@blocksuite/store": "0.13.0-canary-202403071041-3d3374e", | ||
"@blocksuite/block-std": "0.13.0-canary-202403071041-3d3374e" | ||
"@blocksuite/block-std": "0.13.0-canary-202403080648-55b867a", | ||
"@blocksuite/store": "0.13.0-canary-202403080648-55b867a" | ||
}, | ||
"dependencies": { | ||
"lit": "^3.1.1", | ||
"@blocksuite/global": "0.13.0-canary-202403071041-3d3374e", | ||
"@blocksuite/inline": "0.13.0-canary-202403071041-3d3374e" | ||
"@blocksuite/global": "0.13.0-canary-202403080648-55b867a", | ||
"@blocksuite/inline": "0.13.0-canary-202403080648-55b867a" | ||
}, | ||
"devDependencies": { | ||
"@blocksuite/block-std": "0.13.0-canary-202403071041-3d3374e", | ||
"@blocksuite/store": "0.13.0-canary-202403071041-3d3374e" | ||
"@blocksuite/block-std": "0.13.0-canary-202403080648-55b867a", | ||
"@blocksuite/store": "0.13.0-canary-202403080648-55b867a" | ||
}, | ||
@@ -24,0 +24,0 @@ "exports": { |
@@ -170,10 +170,6 @@ import type { BlockService } from '@blocksuite/block-std'; | ||
renderModel = (model: BlockModel): TemplateResult => { | ||
return this.host.renderModel(model); | ||
renderChildren = (model: BlockModel): TemplateResult => { | ||
return this.host.renderChildren(model); | ||
}; | ||
renderModelChildren = (model: BlockModel): TemplateResult => { | ||
return this.host.renderModelChildren(model); | ||
}; | ||
protected override async getUpdateComplete(): Promise<boolean> { | ||
@@ -180,0 +176,0 @@ const result = await super.getUpdateComplete(); |
@@ -137,6 +137,6 @@ /* eslint-disable lit/binding-positions, lit/no-invalid-html */ | ||
return this.renderModel(root); | ||
return this._renderModel(root); | ||
} | ||
renderModel = (model: BlockModel): TemplateResult => { | ||
private _renderModel = (model: BlockModel): TemplateResult => { | ||
const { flavour } = model; | ||
@@ -178,2 +178,11 @@ const schema = this.doc.schema.flavourSchemaMap.get(flavour); | ||
/** | ||
* @deprecated | ||
* | ||
* This method is deprecated. Use `renderSpecPortal` instead. | ||
*/ | ||
renderModel = (model: BlockModel): TemplateResult => { | ||
return this._renderModel(model); | ||
}; | ||
renderSpecPortal = (doc: Doc, specs: BlockSpec[]) => { | ||
@@ -189,7 +198,7 @@ return html` | ||
renderModelChildren = (model: BlockModel): TemplateResult => { | ||
renderChildren = (model: BlockModel): TemplateResult => { | ||
return html`${repeat( | ||
model.children, | ||
child => child.id, | ||
child => this.renderModel(child) | ||
child => this._renderModel(child) | ||
)}`; | ||
@@ -196,0 +205,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
154919
2620
+ Added@blocksuite/block-std@0.13.0-canary-202403080648-55b867a(transitive)
+ Added@blocksuite/global@0.13.0-canary-202403080648-55b867a(transitive)
+ Added@blocksuite/inline@0.13.0-canary-202403080648-55b867a(transitive)
+ Added@blocksuite/store@0.13.0-canary-202403080648-55b867a(transitive)
+ Added@blocksuite/sync@0.13.0-canary-202403080648-55b867a(transitive)
- Removed@blocksuite/block-std@0.13.0-canary-202403071041-3d3374e(transitive)
- Removed@blocksuite/global@0.13.0-canary-202403071041-3d3374e(transitive)
- Removed@blocksuite/inline@0.13.0-canary-202403071041-3d3374e(transitive)
- Removed@blocksuite/store@0.13.0-canary-202403071041-3d3374e(transitive)
- Removed@blocksuite/sync@0.13.0-canary-202403071041-3d3374e(transitive)
Updated@blocksuite/global@0.13.0-canary-202403080648-55b867a
Updated@blocksuite/inline@0.13.0-canary-202403080648-55b867a