@codemirror/panel
Advanced tools
Comparing version 0.17.1 to 0.18.0
@@ -0,1 +1,7 @@ | ||
## 0.18.0 (2021-03-03) | ||
### Breaking changes | ||
Extra CSS classes for panels must now be specified with the `class` option. The `style` option no longer exists. | ||
## 0.17.1 (2021-01-06) | ||
@@ -2,0 +8,0 @@ |
@@ -13,3 +13,3 @@ import { ViewUpdate, EditorView } from '@codemirror/view'; | ||
update?(update: ViewUpdate): void; | ||
style?: string; | ||
class?: string; | ||
top?: boolean; | ||
@@ -16,0 +16,0 @@ pos?: number; |
@@ -1,2 +0,2 @@ | ||
import { ViewPlugin, themeClass, PluginField, EditorView } from '@codemirror/view'; | ||
import { ViewPlugin, PluginField, EditorView } from '@codemirror/view'; | ||
import { Facet } from '@codemirror/state'; | ||
@@ -43,3 +43,5 @@ | ||
for (let p of this.panels) { | ||
p.dom.className += " " + panelClass(p); | ||
p.dom.classList.add("cm-panel"); | ||
if (p.class) | ||
p.dom.classList.add(p.class); | ||
if (p.mount) | ||
@@ -83,3 +85,5 @@ p.mount(); | ||
for (let p of mount) { | ||
p.dom.className += " " + panelClass(p); | ||
p.dom.classList.add("cm-panel"); | ||
if (p.class) | ||
p.dom.classList.add(p.class); | ||
if (p.mount) | ||
@@ -102,5 +106,2 @@ p.mount(); | ||
}); | ||
function panelClass(panel) { | ||
return themeClass(panel.style ? `panel.${panel.style}` : "panel"); | ||
} | ||
class PanelGroup { | ||
@@ -130,3 +131,3 @@ constructor(view, top, container) { | ||
this.dom = document.createElement("div"); | ||
this.dom.className = themeClass(this.top ? "panels.top" : "panels.bottom"); | ||
this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom"; | ||
this.dom.style[this.top ? "top" : "bottom"] = "0"; | ||
@@ -172,3 +173,3 @@ let parent = this.container || this.view.dom; | ||
const baseTheme = EditorView.baseTheme({ | ||
$panels: { | ||
".cm-panels": { | ||
boxSizing: "border-box", | ||
@@ -179,13 +180,13 @@ position: "sticky", | ||
}, | ||
"$$light $panels": { | ||
"&light .cm-panels": { | ||
backgroundColor: "#f5f5f5", | ||
color: "black" | ||
}, | ||
"$$light $panels.top": { | ||
"&light .cm-panels-top": { | ||
borderBottom: "1px solid #ddd" | ||
}, | ||
"$$light $panels.bottom": { | ||
"&light .cm-panels-bottom": { | ||
borderTop: "1px solid #ddd" | ||
}, | ||
"$$dark $panels": { | ||
"&dark .cm-panels": { | ||
backgroundColor: "#333338", | ||
@@ -192,0 +193,0 @@ color: "white" |
{ | ||
"name": "@codemirror/panel", | ||
"version": "0.17.1", | ||
"version": "0.18.0", | ||
"description": "UI panels for the CodeMirror code editor", | ||
@@ -29,4 +29,4 @@ "scripts": { | ||
"dependencies": { | ||
"@codemirror/state": "^0.17.0", | ||
"@codemirror/view": "^0.17.0" | ||
"@codemirror/state": "^0.18.0", | ||
"@codemirror/view": "^0.18.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
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
32570
419
+ Added@codemirror/rangeset@0.18.5(transitive)
+ Added@codemirror/state@0.18.7(transitive)
+ Added@codemirror/text@0.18.1(transitive)
+ Added@codemirror/view@0.18.19(transitive)
+ Addedstyle-mod@4.1.2(transitive)
- Removed@codemirror/rangeset@0.17.1(transitive)
- Removed@codemirror/state@0.17.2(transitive)
- Removed@codemirror/text@0.17.2(transitive)
- Removed@codemirror/view@0.17.13(transitive)
- Removedstyle-mod@3.2.2(transitive)
Updated@codemirror/state@^0.18.0
Updated@codemirror/view@^0.18.0