mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
feat(editor): unify block props api (#10888)
Closes: [BS-2707](https://linear.app/affine-design/issue/BS-2707/统一使用props获取和更新block-prop)
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@ export class EmbedHtmlFullscreenToolbar extends LitElement {
|
||||
|
||||
this.embedHtml.std.clipboard
|
||||
.writeToClipboard(items => {
|
||||
items['text/plain'] = this.embedHtml.model.html ?? '';
|
||||
items['text/plain'] = this.embedHtml.model.props.html ?? '';
|
||||
return items;
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -88,7 +88,7 @@ export const builtinToolbarConfig = {
|
||||
.actions=${actions}
|
||||
.context=${ctx}
|
||||
.toggle=${toggle}
|
||||
.style$=${model.style$}
|
||||
.style=${model.props.style$}
|
||||
></affine-card-style-dropdown-menu>`
|
||||
)}`;
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ export class EmbedHtmlBlockComponent extends EmbedBlockComponent<EmbedHtmlModel>
|
||||
|
||||
override connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this._cardStyle = this.model.style;
|
||||
this._cardStyle = this.model.props.style;
|
||||
|
||||
// this is required to prevent iframe from capturing pointer events
|
||||
this.disposables.add(
|
||||
@@ -80,11 +80,11 @@ export class EmbedHtmlBlockComponent extends EmbedBlockComponent<EmbedHtmlModel>
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
${this.model.html}
|
||||
${this.model.props.html}
|
||||
`;
|
||||
|
||||
return this.renderEmbed(() => {
|
||||
if (!this.model.html) {
|
||||
if (!this.model.props.html) {
|
||||
return html` <div class="affine-html-empty">Empty</div>`;
|
||||
}
|
||||
return html`
|
||||
|
||||
Reference in New Issue
Block a user