refactor(editor): remove redundant edgeless icons (#10169)

Continue [BS-2240](https://linear.app/affine-design/issue/BS-2240/%E6%B8%85%E7%90%86%E9%87%8D%E5%A4%8D%E7%9A%84icon)

This PR removes `icons/edgeless.ts` and refactor with `@blocksuite/icons` for reducing redundant icons
This commit is contained in:
L-Sun
2025-02-14 05:03:26 +00:00
parent 1f6ac4b1fe
commit 9d08f446cc
90 changed files with 2309 additions and 2899 deletions

View File

@@ -1,13 +1,6 @@
import type { SurfaceRefBlockComponent } from '@blocksuite/affine-block-surface-ref';
import { HoverController } from '@blocksuite/affine-components/hover';
import {
CaptionIcon,
CenterPeekIcon,
EdgelessModeIcon,
MoreVerticalIcon,
OpenIcon,
SmallArrowDownIcon,
} from '@blocksuite/affine-components/icons';
import { CaptionIcon, OpenIcon } from '@blocksuite/affine-components/icons';
import { isPeekable, peek } from '@blocksuite/affine-components/peek';
import {
cloneGroups,
@@ -24,6 +17,12 @@ import {
TextSelection,
WidgetComponent,
} from '@blocksuite/block-std';
import {
ArrowDownSmallIcon,
CenterPeekIcon,
EdgelessIcon,
MoreVerticalIcon,
} from '@blocksuite/icons/lit';
import { offset, shift } from '@floating-ui/dom';
import { html, nothing } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';
@@ -123,11 +122,13 @@ function SurfaceRefToolbarOptions({
const hasValidReference = !!blockComponent.referenceModel;
const openMenuActions: MenuItem[] = [];
const iconSize = { width: '20px', height: '20px' };
if (hasValidReference) {
openMenuActions.push({
type: 'open-in-edgeless',
label: 'Open in edgeless',
icon: EdgelessModeIcon,
icon: EdgelessIcon(iconSize),
action: () => blockComponent.viewInEdgeless(),
disabled: readonly,
});
@@ -136,7 +137,7 @@ function SurfaceRefToolbarOptions({
openMenuActions.push({
type: 'open-in-center-peek',
label: 'Open in center peek',
icon: CenterPeekIcon,
icon: CenterPeekIcon(iconSize),
action: () => peek(blockComponent),
});
}
@@ -155,7 +156,10 @@ function SurfaceRefToolbarOptions({
.justify=${'space-between'}
.labelHeight=${'20px'}
>
${OpenIcon}${SmallArrowDownIcon}
${OpenIcon}${ArrowDownSmallIcon({
width: '16px',
height: '16px',
})}
</editor-icon-button>
`}
>
@@ -197,8 +201,12 @@ function SurfaceRefToolbarOptions({
<editor-menu-button
.contentPadding=${'8px'}
.button=${html`
<editor-icon-button aria-label="More" .tooltip=${'More'}>
${MoreVerticalIcon}
<editor-icon-button
aria-label="More"
.tooltip=${'More'}
.iconSize=${'20px'}
>
${MoreVerticalIcon()}
</editor-icon-button>
`}
>