diff --git a/services/web/frontend/js/features/source-editor/components/toolbar/button-menu.tsx b/services/web/frontend/js/features/source-editor/components/toolbar/button-menu.tsx index 55990c6d6b..97cdc709ff 100644 --- a/services/web/frontend/js/features/source-editor/components/toolbar/button-menu.tsx +++ b/services/web/frontend/js/features/source-editor/components/toolbar/button-menu.tsx @@ -3,14 +3,20 @@ import { Button, ListGroup, Overlay, Popover } from 'react-bootstrap' import Icon from '../../../../shared/components/icon' import useDropdown from '../../../../shared/hooks/use-dropdown' import Tooltip from '../../../../shared/components/tooltip' +import { EditorView } from '@codemirror/view' +import { emitCommandEvent } from '../../extensions/toolbar/utils/analytics' +import { useCodeMirrorViewContext } from '../codemirror-editor' export const ToolbarButtonMenu: FC<{ id: string label: string icon: string -}> = memo(function ButtonMenu({ icon, id, label, children }) { + altCommand?: (view: EditorView) => void +}> = memo(function ButtonMenu({ icon, id, label, altCommand, children }) { const target = useRef(null) const { open, onToggle, ref } = useDropdown() + const view = useCodeMirrorViewContext() + const button = (