@gravity-ui/markdown-editor 13.21.1 → 13.21.3

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.
@@ -33,6 +33,10 @@ class SelectionTooltip {
33
33
  }),
34
34
  handleDOMEvents: {
35
35
  mousedown: (view) => {
36
+ const startState = {
37
+ doc: view.state.doc,
38
+ selection: view.state.selection,
39
+ };
36
40
  this._isMousePressed = true;
37
41
  this.cancelTooltipHiding();
38
42
  this.tooltip.hide(view);
@@ -40,7 +44,7 @@ class SelectionTooltip {
40
44
  if (this.destroyed)
41
45
  return;
42
46
  this._isMousePressed = false;
43
- this.update(view, this._prevState);
47
+ this.update(view, startState);
44
48
  };
45
49
  document.addEventListener('mouseup', onMouseUp, { once: true });
46
50
  },
@@ -59,10 +63,8 @@ class SelectionTooltip {
59
63
  };
60
64
  }
61
65
  update(view, prevState) {
62
- this._prevState = prevState;
63
66
  if (this._isMousePressed)
64
67
  return;
65
- this._prevState = null;
66
68
  this.cancelTooltipHiding();
67
69
  // Don't show tooltip if editor not mounted to the DOM
68
70
  // or when view is out of focus
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  /** During build process, the current version will be injected here */
5
- exports.VERSION = typeof '13.21.1' !== 'undefined' ? '13.21.1' : 'unknown';
5
+ exports.VERSION = typeof '13.21.3' !== 'undefined' ? '13.21.3' : 'unknown';
@@ -29,6 +29,10 @@ class SelectionTooltip {
29
29
  }),
30
30
  handleDOMEvents: {
31
31
  mousedown: (view) => {
32
+ const startState = {
33
+ doc: view.state.doc,
34
+ selection: view.state.selection,
35
+ };
32
36
  this._isMousePressed = true;
33
37
  this.cancelTooltipHiding();
34
38
  this.tooltip.hide(view);
@@ -36,7 +40,7 @@ class SelectionTooltip {
36
40
  if (this.destroyed)
37
41
  return;
38
42
  this._isMousePressed = false;
39
- this.update(view, this._prevState);
43
+ this.update(view, startState);
40
44
  };
41
45
  document.addEventListener('mouseup', onMouseUp, { once: true });
42
46
  },
@@ -55,10 +59,8 @@ class SelectionTooltip {
55
59
  };
56
60
  }
57
61
  update(view, prevState) {
58
- this._prevState = prevState;
59
62
  if (this._isMousePressed)
60
63
  return;
61
- this._prevState = null;
62
64
  this.cancelTooltipHiding();
63
65
  // Don't show tooltip if editor not mounted to the DOM
64
66
  // or when view is out of focus
@@ -1,2 +1,2 @@
1
1
  /** During build process, the current version will be injected here */
2
- export const VERSION = typeof '13.21.1' !== 'undefined' ? '13.21.1' : 'unknown';
2
+ export const VERSION = typeof '13.21.3' !== 'undefined' ? '13.21.3' : 'unknown';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/markdown-editor",
3
- "version": "13.21.1",
3
+ "version": "13.21.3",
4
4
  "description": "Markdown wysiwyg and markup editor",
5
5
  "license": "MIT",
6
6
  "repository": {