import { WithDisposable } from '@blockeditor/lit'; import { css, html, LitElement, nothing } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { toggleEmbedCardCreateModal } from '../../../../../_common/components/embed-card/modal/index.js'; import { BookmarkIcon } from '../../../../../_common/icons/edgeless.js'; import { type NoteChildrenFlavour, type NoteTool, } from '../../../../../_common/utils/index.js'; import { FigmaIcon } from '../../../../../embed-figma-block/styles.js'; import { GithubIcon } from '../../../../../embed-github-block/styles.js'; import { YoutubeIcon } from '../../../../../embed-youtube-block/styles.js'; import type { EdgelessPageBlockComponent } from '../../../edgeless-page-block.js'; import { NOTE_MENU_ITEMS, NOTE_MENU_WIDTH } from './note-menu-config.js'; @customElement('edgeless-note-menu') export class EdgelessNoteMenu extends WithDisposable(LitElement) { static override styles = css` :host { position: absolute; display: flex; z-index: -1; } .menu-content { display: flex; align-items: center; justify-content: center; } .button-group-label { font-family: 'Inter'; font-size: 12px; font-weight: 400; font-style: normal; display: flex; text-align: center; color: var(--light-text-color-text-secondary-color, #8e8d91); width: 38px; height: 20px; line-height: 20px; margin-right: 16px; } .button-group-container { display: flex; justify-content: center; align-items: center; gap: 14px; fill: var(--affine-icon-color); } `; @property({ attribute: false }) edgeless!: EdgelessPageBlockComponent; @property({ attribute: false }) childFlavour!: NoteChildrenFlavour; @property({ attribute: false }) childType!: string; @property({ attribute: false }) tip!: string; @property({ attribute: false }) onChange!: ( props: Partial<{ childFlavour: NoteTool['childFlavour']; childType: string | null; tip: string; }> ) => void; override render() { if (this.edgeless.edgelessTool.type !== 'affine:note') return nothing; const { childType } = this; return html` `; } } declare global { interface HTMLElementTagNameMap { 'edgeless-note-menu': EdgelessNoteMenu; } }