mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
46 lines
817 B
TypeScript
46 lines
817 B
TypeScript
import { MenuContext } from '@blocksuite/affine-components/toolbar';
|
|
|
|
import type { AttachmentBlockComponent } from '../attachment-block.js';
|
|
|
|
export class AttachmentToolbarMoreMenuContext extends MenuContext {
|
|
override close = () => {
|
|
this.abortController.abort();
|
|
};
|
|
|
|
get doc() {
|
|
return this.blockComponent.doc;
|
|
}
|
|
|
|
get host() {
|
|
return this.blockComponent.host;
|
|
}
|
|
|
|
get selectedBlockModels() {
|
|
if (this.blockComponent.model) return [this.blockComponent.model];
|
|
return [];
|
|
}
|
|
|
|
get std() {
|
|
return this.blockComponent.std;
|
|
}
|
|
|
|
constructor(
|
|
public blockComponent: AttachmentBlockComponent,
|
|
public abortController: AbortController
|
|
) {
|
|
super();
|
|
}
|
|
|
|
isEmpty() {
|
|
return false;
|
|
}
|
|
|
|
isMultiple() {
|
|
return false;
|
|
}
|
|
|
|
isSingle() {
|
|
return true;
|
|
}
|
|
}
|