@codemirror/tooltip
Advanced tools
Comparing version 0.19.11 to 0.19.12
@@ -0,1 +1,7 @@ | ||
## 0.19.12 (2022-01-11) | ||
### New features | ||
The new `getTooltip` function can retrieve the active tooltip view from a tooltip object. | ||
## 0.19.11 (2022-01-11) | ||
@@ -2,0 +8,0 @@ |
@@ -136,2 +136,6 @@ import { EditorView, ViewUpdate } from '@codemirror/view'; | ||
/** | ||
Get the active tooltip view for a given tooltip, if available. | ||
*/ | ||
declare function getTooltip(view: EditorView, tooltip: Tooltip): TooltipView | null; | ||
/** | ||
Returns true if any hover tooltips are currently active. | ||
@@ -152,2 +156,2 @@ */ | ||
export { Tooltip, TooltipView, closeHoverTooltips, hasHoverTooltips, hoverTooltip, repositionTooltips, showTooltip, tooltips }; | ||
export { Tooltip, TooltipView, closeHoverTooltips, getTooltip, hasHoverTooltips, hoverTooltip, repositionTooltips, showTooltip, tooltips }; |
@@ -526,2 +526,12 @@ import { ViewPlugin, Direction, EditorView, logException } from '@codemirror/view'; | ||
/** | ||
Get the active tooltip view for a given tooltip, if available. | ||
*/ | ||
function getTooltip(view, tooltip) { | ||
let plugin = view.plugin(tooltipPlugin); | ||
if (!plugin) | ||
return null; | ||
let found = plugin.manager.tooltips.indexOf(tooltip); | ||
return found < 0 ? null : plugin.manager.tooltipViews[found]; | ||
} | ||
/** | ||
Returns true if any hover tooltips are currently active. | ||
@@ -548,2 +558,2 @@ */ | ||
export { closeHoverTooltips, hasHoverTooltips, hoverTooltip, repositionTooltips, showTooltip, tooltips }; | ||
export { closeHoverTooltips, getTooltip, hasHoverTooltips, hoverTooltip, repositionTooltips, showTooltip, tooltips }; |
{ | ||
"name": "@codemirror/tooltip", | ||
"version": "0.19.11", | ||
"version": "0.19.12", | ||
"description": "Tooltip support for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57594
1267