@@ -7,20 +7,19 @@ import MiradorMenuButton from '../containers/MiradorMenuButton';
77import { PluginHook } from './PluginHook' ;
88import WorkspaceContext from '../contexts/WorkspaceContext' ;
99import { usePlugins } from '../extend/usePlugins' ;
10-
1110/**
1211 *
1312 */
1413export function WindowTopBarPluginMenu ( {
15- windowId, menuIcon = < MoreVertIcon /> ,
14+ windowId, menuIcon = < MoreVertIcon /> , pluginTarget = 'WindowTopBarPluginMenu' ,
1615} ) {
1716 const { t } = useTranslation ( ) ;
1817 const container = useContext ( WorkspaceContext ) ;
1918 const pluginProps = arguments [ 0 ] ; // eslint-disable-line prefer-rest-params
2019 const [ anchorEl , setAnchorEl ] = useState ( null ) ;
2120 const [ open , setOpen ] = useState ( false ) ;
2221 const windowPluginMenuId = useId ( ) ;
23- const { PluginComponents } = usePlugins ( 'WindowTopBarPluginMenu' ) ;
22+ const { PluginComponents } = usePlugins ( pluginTarget ) ;
2423
2524 /** */
2625 const handleMenuClick = ( event ) => {
@@ -63,7 +62,7 @@ export function WindowTopBarPluginMenu({
6362 open = { open }
6463 onClose = { handleMenuClose }
6564 >
66- < PluginHook targetName = "WindowTopBarPluginMenu" handleClose = { handleMenuClose } { ...pluginProps } />
65+ < PluginHook targetName = { pluginTarget } handleClose = { handleMenuClose } { ...pluginProps } />
6766 </ Menu >
6867 </ >
6968 ) ;
@@ -74,5 +73,6 @@ WindowTopBarPluginMenu.propTypes = {
7473 container : PropTypes . shape ( { current : PropTypes . instanceOf ( Element ) } ) ,
7574 menuIcon : PropTypes . element ,
7675 open : PropTypes . bool ,
76+ pluginTarget : PropTypes . string ,
7777 windowId : PropTypes . string . isRequired ,
7878} ;
0 commit comments