mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
fix(editor): update color of deleted banner of surface-ref (#12393)
Close [BS-3504](https://linear.app/affine-design/issue/BS-3504/linked-card-ui调整) Close [BS-3377](https://linear.app/affine-design/issue/BS-3377/surface-ref在page-mode下的dark颜色不对,垃圾桶也不对) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - The "not found" placeholder now adapts its appearance to match light or dark themes for a more cohesive visual experience. - **Style** - Updated placeholder icons to use distinct designs for light and dark themes, providing improved clarity and consistency. - **Chores** - Theme information is now more accurately passed to placeholder components for proper rendering. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -374,6 +374,7 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
||||
const { w, h } = Bound.deserialize(this._referenceXYWH$.value);
|
||||
const aspectRatio = h !== 0 ? w / h : 1;
|
||||
const _previewSpec = this._previewSpec.concat(this._runtimePreviewExt);
|
||||
const edgelessTheme = this.std.get(ThemeProvider).edgeless$.value;
|
||||
|
||||
return html`<div class="ref-content">
|
||||
<div
|
||||
@@ -381,6 +382,7 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
||||
style=${styleMap({
|
||||
aspectRatio: `${aspectRatio}`,
|
||||
})}
|
||||
data-theme=${edgelessTheme}
|
||||
>
|
||||
${guard(this._previewDoc, () => {
|
||||
return this._previewDoc
|
||||
@@ -440,13 +442,14 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
||||
|
||||
const { _referencedModel, model } = this;
|
||||
const isEmpty = !_referencedModel || !_referencedModel.xywh;
|
||||
const theme = this.std.get(ThemeProvider).theme$.value;
|
||||
const content = isEmpty
|
||||
? html`<surface-ref-placeholder
|
||||
.referenceModel=${_referencedModel}
|
||||
.refFlavour=${model.props.refFlavour$.value}
|
||||
.theme=${theme}
|
||||
></surface-ref-placeholder>`
|
||||
: this._renderRefContent();
|
||||
const edgelessTheme = this.std.get(ThemeProvider).edgeless$.value;
|
||||
|
||||
return html`
|
||||
<div
|
||||
@@ -454,7 +457,6 @@ export class SurfaceRefBlockComponent extends BlockComponent<SurfaceRefBlockMode
|
||||
'affine-surface-ref': true,
|
||||
focused: this.selected$.value,
|
||||
})}
|
||||
data-theme=${edgelessTheme}
|
||||
@click=${this._handleClick}
|
||||
>
|
||||
${content}
|
||||
|
||||
Reference in New Issue
Block a user