@codemirror/panel
Advanced tools
Comparing version 0.19.0 to 0.19.1
@@ -0,1 +1,7 @@ | ||
## 0.19.1 (2021-12-16) | ||
### New features | ||
Panels can now define a `destroy` method that will be called when they are removed from the view. | ||
## 0.19.0 (2021-08-11) | ||
@@ -2,0 +8,0 @@ |
@@ -38,2 +38,7 @@ import { ViewUpdate, EditorView } from '@codemirror/view'; | ||
/** | ||
Called when the panel is removed from the editor or the editor | ||
is destroyed. | ||
*/ | ||
destroy?(): void; | ||
/** | ||
Whether the panel should be at the top or bottom of the editor. | ||
@@ -40,0 +45,0 @@ Defaults to false. |
@@ -110,2 +110,5 @@ import { ViewPlugin, PluginField, EditorView } from '@codemirror/view'; | ||
sync(panels) { | ||
for (let p of this.panels) | ||
if (p.destroy && panels.indexOf(p) < 0) | ||
p.destroy(); | ||
this.panels = panels; | ||
@@ -112,0 +115,0 @@ this.syncDOM(); |
{ | ||
"name": "@codemirror/panel", | ||
"version": "0.19.0", | ||
"version": "0.19.1", | ||
"description": "UI panels 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
20111
466