@codemirror/view 0.20.4 → 0.20.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.20.5 (2022-05-18)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix an issue where gutter elements without any markers in them would not get the `cm-gutterElement` class assigned.
|
|
6
|
+
|
|
7
|
+
Fix an issue where DOM event handlers registered by plugins were retained indefinitely, even after the editor was reconfigured.
|
|
8
|
+
|
|
1
9
|
## 0.20.4 (2022-05-03)
|
|
2
10
|
|
|
3
11
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -3319,6 +3319,7 @@ class InputState {
|
|
|
3319
3319
|
ensureHandlers(view, plugins) {
|
|
3320
3320
|
var _a;
|
|
3321
3321
|
let handlers;
|
|
3322
|
+
this.customHandlers = [];
|
|
3322
3323
|
for (let plugin of plugins)
|
|
3323
3324
|
if (handlers = (_a = plugin.update(view).spec) === null || _a === void 0 ? void 0 : _a.domEventHandlers) {
|
|
3324
3325
|
this.customHandlers.push({ plugin: plugin.value, handlers });
|
|
@@ -8181,7 +8182,6 @@ class HoverPlugin {
|
|
|
8181
8182
|
this.startHover();
|
|
8182
8183
|
}
|
|
8183
8184
|
startHover() {
|
|
8184
|
-
var _a;
|
|
8185
8185
|
clearTimeout(this.restartTimeout);
|
|
8186
8186
|
let { lastMove } = this;
|
|
8187
8187
|
let pos = this.view.contentDOM.contains(lastMove.target) ? this.view.posAtCoords(lastMove) : null;
|
|
@@ -8195,7 +8195,7 @@ class HoverPlugin {
|
|
|
8195
8195
|
let bidi = this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find(s => s.from <= pos && s.to >= pos);
|
|
8196
8196
|
let rtl = bidi && bidi.dir == exports.Direction.RTL ? -1 : 1;
|
|
8197
8197
|
let open = this.source(this.view, pos, (lastMove.x < posCoords.left ? -rtl : rtl));
|
|
8198
|
-
if (
|
|
8198
|
+
if (open === null || open === void 0 ? void 0 : open.then) {
|
|
8199
8199
|
let pending = this.pending = { pos };
|
|
8200
8200
|
open.then(result => {
|
|
8201
8201
|
if (this.pending == pending) {
|
|
@@ -8795,6 +8795,7 @@ class GutterElement {
|
|
|
8795
8795
|
this.above = 0;
|
|
8796
8796
|
this.markers = [];
|
|
8797
8797
|
this.dom = document.createElement("div");
|
|
8798
|
+
this.dom.className = "cm-gutterElement";
|
|
8798
8799
|
this.update(view, height, above, markers);
|
|
8799
8800
|
}
|
|
8800
8801
|
update(view, height, above, markers) {
|
package/dist/index.js
CHANGED
|
@@ -3313,6 +3313,7 @@ class InputState {
|
|
|
3313
3313
|
ensureHandlers(view, plugins) {
|
|
3314
3314
|
var _a;
|
|
3315
3315
|
let handlers;
|
|
3316
|
+
this.customHandlers = [];
|
|
3316
3317
|
for (let plugin of plugins)
|
|
3317
3318
|
if (handlers = (_a = plugin.update(view).spec) === null || _a === void 0 ? void 0 : _a.domEventHandlers) {
|
|
3318
3319
|
this.customHandlers.push({ plugin: plugin.value, handlers });
|
|
@@ -8174,7 +8175,6 @@ class HoverPlugin {
|
|
|
8174
8175
|
this.startHover();
|
|
8175
8176
|
}
|
|
8176
8177
|
startHover() {
|
|
8177
|
-
var _a;
|
|
8178
8178
|
clearTimeout(this.restartTimeout);
|
|
8179
8179
|
let { lastMove } = this;
|
|
8180
8180
|
let pos = this.view.contentDOM.contains(lastMove.target) ? this.view.posAtCoords(lastMove) : null;
|
|
@@ -8188,7 +8188,7 @@ class HoverPlugin {
|
|
|
8188
8188
|
let bidi = this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find(s => s.from <= pos && s.to >= pos);
|
|
8189
8189
|
let rtl = bidi && bidi.dir == Direction.RTL ? -1 : 1;
|
|
8190
8190
|
let open = this.source(this.view, pos, (lastMove.x < posCoords.left ? -rtl : rtl));
|
|
8191
|
-
if (
|
|
8191
|
+
if (open === null || open === void 0 ? void 0 : open.then) {
|
|
8192
8192
|
let pending = this.pending = { pos };
|
|
8193
8193
|
open.then(result => {
|
|
8194
8194
|
if (this.pending == pending) {
|
|
@@ -8788,6 +8788,7 @@ class GutterElement {
|
|
|
8788
8788
|
this.above = 0;
|
|
8789
8789
|
this.markers = [];
|
|
8790
8790
|
this.dom = document.createElement("div");
|
|
8791
|
+
this.dom.className = "cm-gutterElement";
|
|
8791
8792
|
this.update(view, height, above, markers);
|
|
8792
8793
|
}
|
|
8793
8794
|
update(view, height, above, markers) {
|