@neo4j-cypher/react-codemirror 1.0.0 → 1.0.1

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.
@@ -63,6 +63,12 @@ class CypherEditor extends Component {
63
63
  } = this.props;
64
64
  onKeyDown && onKeyDown(event);
65
65
  });
66
+ _defineProperty(this, "keyUp", event => {
67
+ const {
68
+ onKeyUp
69
+ } = this.props;
70
+ onKeyUp && onKeyUp(event);
71
+ });
66
72
  this.state = {
67
73
  focused: false
68
74
  };
@@ -151,6 +157,7 @@ class CypherEditor extends Component {
151
157
  this.cypherEditor.onSearchChanged(this.searchChanged);
152
158
  this.cypherEditor.onLineNumberClick(this.lineNumberClick);
153
159
  this.cypherEditor.onKeyDown(this.keyDown);
160
+ this.cypherEditor.onKeyUp(this.keyUp);
154
161
  onEditorCreated && onEditorCreated(this.cypherEditor);
155
162
  }
156
163
  componentWillUnmount() {
@@ -163,6 +170,7 @@ class CypherEditor extends Component {
163
170
  this.cypherEditor.offSearchChanged(this.searchChanged);
164
171
  this.cypherEditor.offLineNumberClick(this.lineNumberClick);
165
172
  this.cypherEditor.offKeyDown(this.keyDown);
173
+ this.cypherEditor.offKeyUp(this.keyUp);
166
174
  this.cypherEditor.destroy();
167
175
  }
168
176
  }
@@ -72,6 +72,12 @@ class CypherEditor extends _react.Component {
72
72
  } = this.props;
73
73
  onKeyDown && onKeyDown(event);
74
74
  });
75
+ (0, _defineProperty2.default)(this, "keyUp", event => {
76
+ const {
77
+ onKeyUp
78
+ } = this.props;
79
+ onKeyUp && onKeyUp(event);
80
+ });
75
81
  this.state = {
76
82
  focused: false
77
83
  };
@@ -160,6 +166,7 @@ class CypherEditor extends _react.Component {
160
166
  this.cypherEditor.onSearchChanged(this.searchChanged);
161
167
  this.cypherEditor.onLineNumberClick(this.lineNumberClick);
162
168
  this.cypherEditor.onKeyDown(this.keyDown);
169
+ this.cypherEditor.onKeyUp(this.keyUp);
163
170
  onEditorCreated && onEditorCreated(this.cypherEditor);
164
171
  }
165
172
  componentWillUnmount() {
@@ -172,6 +179,7 @@ class CypherEditor extends _react.Component {
172
179
  this.cypherEditor.offSearchChanged(this.searchChanged);
173
180
  this.cypherEditor.offLineNumberClick(this.lineNumberClick);
174
181
  this.cypherEditor.offKeyDown(this.keyDown);
182
+ this.cypherEditor.offKeyUp(this.keyUp);
175
183
  this.cypherEditor.destroy();
176
184
  }
177
185
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "codemirror",
8
8
  "codemirror 6"
9
9
  ],
10
- "version": "1.0.0",
10
+ "version": "1.0.1",
11
11
  "author": "Neo4j Inc.",
12
12
  "license": "Apache-2.0",
13
13
  "main": "./lib/react-codemirror.js",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@babel/runtime": "^7.20.13",
53
- "@neo4j-cypher/codemirror": "1.0.0"
53
+ "@neo4j-cypher/codemirror": "1.0.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "react": ">=16"
@@ -12,7 +12,7 @@ import type {
12
12
  ScrollChangedListener,
13
13
  SearchChangedListener,
14
14
  ValueChangedListener,
15
- KeyDownListener,
15
+ KeyListener,
16
16
  LineNumberClickListener,
17
17
  LineNumberFormatter
18
18
  } from "@neo4j-cypher/codemirror";
@@ -265,9 +265,13 @@ export interface CypherEditorProps {
265
265
  */
266
266
  onLineNumberClick?: LineNumberClickListener;
267
267
  /**
268
- * A listener for when the user presses a key down in the editor
268
+ * A listener for when the user performs a key down in the editor
269
269
  */
270
- onKeyDown?: KeyDownListener;
270
+ onKeyDown?: KeyListener;
271
+ /**
272
+ * A listener for when the user performs a key up in the editor
273
+ */
274
+ onKeyUp?: KeyListener;
271
275
 
272
276
  /**
273
277
  * The codemirror 6 extensions that should be added to the editor before the cypher language support extensions.