mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 05:48:59 +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:
@@ -1,3 +1,4 @@
|
||||
import { ColorScheme } from '@blocksuite/affine-model';
|
||||
import { unsafeCSSVarV2 } from '@blocksuite/affine-shared/theme';
|
||||
import { SignalWatcher, WithDisposable } from '@blocksuite/global/lit';
|
||||
import { DeleteIcon } from '@blocksuite/icons/lit';
|
||||
@@ -7,7 +8,7 @@ import { css, html, nothing } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
|
||||
import { SurfaceRefNotFoundBackground } from '../icons';
|
||||
import { DarkDeletedSmallBanner, LightDeletedSmallBanner } from '../icons';
|
||||
import { getReferenceModelTitle, TYPE_ICON_MAP } from '../utils';
|
||||
|
||||
export class SurfaceRefPlaceHolder extends SignalWatcher(
|
||||
@@ -70,6 +71,9 @@ export class SurfaceRefPlaceHolder extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor inEdgeless = false;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor theme: ColorScheme = ColorScheme.Light;
|
||||
|
||||
override render() {
|
||||
const { referenceModel, refFlavour, inEdgeless } = this;
|
||||
|
||||
@@ -83,6 +87,11 @@ export class SurfaceRefPlaceHolder extends SignalWatcher(
|
||||
(referenceModel && getReferenceModelTitle(referenceModel)) ??
|
||||
matchedType.name;
|
||||
|
||||
const notFoundBackground =
|
||||
this.theme === ColorScheme.Light
|
||||
? LightDeletedSmallBanner
|
||||
: DarkDeletedSmallBanner;
|
||||
|
||||
return html`
|
||||
<div
|
||||
class=${classMap({
|
||||
@@ -92,7 +101,7 @@ export class SurfaceRefPlaceHolder extends SignalWatcher(
|
||||
>
|
||||
${modelNotFound
|
||||
? html`<div class="surface-ref-not-found-background">
|
||||
${SurfaceRefNotFoundBackground}
|
||||
${notFoundBackground}
|
||||
</div>`
|
||||
: nothing}
|
||||
<div class="surface-ref-placeholder-heading">
|
||||
|
||||
Reference in New Issue
Block a user