@mongodb-js/compass-context-menu
Advanced tools
Comparing version
import React from 'react'; | ||
import type { ContextMenuContextType, ContextMenuState } from './types'; | ||
export declare const ContextMenuContext: React.Context<ContextMenuContextType | null>; | ||
export declare function ContextMenuProvider({ children, menuWrapper, }: { | ||
export declare function ContextMenuProvider({ disabled, children, menuWrapper, }: { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
@@ -6,0 +7,0 @@ menuWrapper: React.ComponentType<{ |
@@ -30,3 +30,3 @@ "use strict"; | ||
exports.ContextMenuContext = (0, react_1.createContext)(null); | ||
function ContextMenuProvider({ children, menuWrapper, }) { | ||
function ContextMenuProvider({ disabled = false, children, menuWrapper, }) { | ||
// Check if there's already a parent context menu provider | ||
@@ -47,3 +47,3 @@ const parentContext = (0, react_1.useContext)(exports.ContextMenuContext); | ||
// Don't set up event listeners if we have a parent context | ||
if (parentContext) | ||
if (parentContext || disabled) | ||
return; | ||
@@ -72,3 +72,3 @@ function handleContextMenu(event) { | ||
}; | ||
}, [handleClosingEvent, parentContext]); | ||
}, [disabled, handleClosingEvent, parentContext]); | ||
const value = (0, react_1.useMemo)(() => ({ | ||
@@ -75,0 +75,0 @@ close, |
@@ -16,3 +16,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/compass", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"repository": { | ||
@@ -74,3 +74,3 @@ "type": "git", | ||
}, | ||
"gitHead": "529958272c8600ca6a938f22a4e9beb56b52da4b" | ||
"gitHead": "b7caa2e7e2c72d359fb70cb50045f64dc3a73ff7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
48497
0.33%208
0.48%