fix(editor): some UI bugs of table block (#9987)

close: BS-2507, BS-2508, BS-2511, BS-2519, BS-2523
This commit is contained in:
zzj3720
2025-02-06 15:42:05 +00:00
parent 7c7febd495
commit 1652e6df6b
4 changed files with 41 additions and 19 deletions

View File

@@ -60,7 +60,12 @@ import {
} from '@blocksuite/affine-shared/utils';
import { viewPresets } from '@blocksuite/data-view/view-presets';
import { assertType } from '@blocksuite/global/utils';
import { DualLinkIcon, GroupingIcon, TeXIcon } from '@blocksuite/icons/lit';
import {
DualLinkIcon,
GroupingIcon,
TableIcon,
TeXIcon,
} from '@blocksuite/icons/lit';
import type { DeltaInsert } from '@blocksuite/inline';
import type { BlockModel } from '@blocksuite/store';
import { Slice, Text } from '@blocksuite/store';
@@ -259,8 +264,11 @@ export const defaultSlashMenuConfig: SlashMenuConfig = {
{ groupName: 'Content & Media' },
{
name: 'Table',
description: 'Create a table block.',
icon: DatabaseTableViewIcon20,
description: 'Create a simple table.',
icon: TableIcon({
width: '20',
height: '20',
}),
tooltip: slashMenuToolTips['Table View'],
showWhen: ({ model }) => !insideEdgelessText(model),
action: ({ rootComponent }) => {