import { menu, popFilterableSimpleMenu, type PopupTarget, } from '@blocksuite/affine-components/context-menu'; import { CopyIcon, DeleteIcon, ExpandFullIcon, MoveLeftIcon, MoveRightIcon, } from '@blocksuite/icons/lit'; import { html } from 'lit'; import { TableViewRowSelection } from '../../selection'; import type { TableSelectionController } from '../controller/selection'; import type { VirtualTableViewUILogic } from '../table-view-ui-logic'; export const openDetail = ( tableViewLogic: VirtualTableViewUILogic, rowId: string, selection: TableSelectionController ) => { const old = selection.selection; selection.selection = undefined; tableViewLogic.root.openDetailPanel({ view: tableViewLogic.view, rowId: rowId, onClose: () => { selection.selection = old; }, }); }; export const popRowMenu = ( tableViewLogic: VirtualTableViewUILogic, ele: PopupTarget, selectionController: TableSelectionController ) => { const selection = selectionController.selection; if (!TableViewRowSelection.is(selection)) { return; } if (selection.rows.length > 1) { const rows = TableViewRowSelection.rowsIds(selection); popFilterableSimpleMenu(ele, [ menu.group({ name: '', items: [ menu.action({ name: 'Copy', prefix: html`