2023-03-08 16:35:13 +00:00
|
|
|
import type { Editor } from '@tiptap/core'
|
2023-03-08 17:44:09 +00:00
|
|
|
import styles from './EditorBubbleMenu.module.scss'
|
|
|
|
import { Icon } from '../_shared/Icon'
|
|
|
|
import { clsx } from 'clsx'
|
2023-03-08 16:35:13 +00:00
|
|
|
|
|
|
|
type BubbleMenuProps = {
|
|
|
|
editor: Editor
|
|
|
|
ref: (el: HTMLDivElement) => void
|
|
|
|
}
|
|
|
|
|
|
|
|
export const EditorBubbleMenu = (props: BubbleMenuProps) => {
|
|
|
|
return (
|
2023-03-08 17:44:09 +00:00
|
|
|
<div ref={props.ref} class={styles.bubbleMenu}>
|
|
|
|
<button class={clsx(styles.bubbleMenuButton, styles.bubbleMenuButtonActive)}>
|
|
|
|
<Icon name="editor-text-size" />
|
|
|
|
</button>
|
|
|
|
<button class={styles.bubbleMenuButton}>
|
|
|
|
<Icon name="editor-bold" />
|
|
|
|
</button>
|
|
|
|
<button class={styles.bubbleMenuButton}>
|
|
|
|
<Icon name="editor-italic" />
|
|
|
|
</button>
|
|
|
|
<div class={styles.delimiter}></div>
|
|
|
|
<button class={styles.bubbleMenuButton}>
|
|
|
|
<Icon name="editor-link" />
|
|
|
|
</button>
|
|
|
|
<button class={styles.bubbleMenuButton}>
|
|
|
|
<Icon name="editor-footnote" />
|
|
|
|
</button>
|
|
|
|
<div class={styles.delimiter}></div>
|
|
|
|
<button class={styles.bubbleMenuButton}>
|
|
|
|
<Icon name="editor-ul" />
|
|
|
|
</button>
|
2023-03-08 16:35:13 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|