chore(editor): update github block ui (#11690)

Close [BS-2651](https://linear.app/affine-design/issue/BS-2651/github-embed-block的样式修复)
This commit is contained in:
L-Sun
2025-04-15 04:14:59 +00:00
parent 84ff54f9d7
commit 6f35021f22
2 changed files with 8 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import type {
EmbedGithubStyles, EmbedGithubStyles,
} from '@blocksuite/affine-model'; } from '@blocksuite/affine-model';
import { ThemeProvider } from '@blocksuite/affine-shared/services'; import { ThemeProvider } from '@blocksuite/affine-shared/services';
import { BlockSelection } from '@blocksuite/std'; import { BlockSelection, isGfxBlockComponent } from '@blocksuite/std';
import { html, nothing } from 'lit'; import { html, nothing } from 'lit';
import { property } from 'lit/decorators.js'; import { property } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js'; import { classMap } from 'lit/directives/class-map.js';
@@ -166,16 +166,16 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
'affine-embed-github-block': true, 'affine-embed-github-block': true,
loading, loading,
[style]: true, [style]: true,
edgeless: isGfxBlockComponent(this),
selected: this.selected$.value, selected: this.selected$.value,
})} })}
style=${styleMap({ style=${styleMap({
transform: `scale(${this._scale})`, // transform: `scale(${this._scale})`,
transformOrigin: '0 0 ', transformOrigin: '0 0 ',
})} })}
@click=${this._handleClick} @click=${this._handleClick}
@dblclick=${this._handleDoubleClick} @dblclick=${this._handleDoubleClick}
> >
<div class="affine-embed-github-banner">${bannerImage}</div>
<div class="affine-embed-github-content"> <div class="affine-embed-github-content">
<div class="affine-embed-github-content-title"> <div class="affine-embed-github-content-title">
<div class="affine-embed-github-content-title-icons"> <div class="affine-embed-github-content-title-icons">
@@ -260,6 +260,7 @@ export class EmbedGithubBlockComponent extends EmbedBlockComponent<
</div> </div>
</div> </div>
</div> </div>
<div class="affine-embed-github-banner">${bannerImage}</div>
</div> </div>
` `
); );

View File

@@ -14,6 +14,7 @@ export const styles = css`
opacity: var(--add, 1); opacity: var(--add, 1);
background: var(--affine-background-primary-color); background: var(--affine-background-primary-color);
user-select: none; user-select: none;
overflow: hidden;
} }
.affine-embed-github-content { .affine-embed-github-content {
@@ -275,7 +276,7 @@ export const styles = css`
} }
.affine-embed-github-block.vertical { .affine-embed-github-block.vertical {
flex-direction: column; flex-direction: column-reverse;
.affine-embed-github-content { .affine-embed-github-content {
width: 100%; width: 100%;
@@ -383,7 +384,8 @@ export const styles = css`
.affine-embed-github-content { .affine-embed-github-content {
width: 100%; width: 100%;
} }
.affine-embed-github-banner {
.affine-embed-github-block:not(.edgeless) .affine-embed-github-banner {
display: none; display: none;
} }
} }