@neo4j-cypher/react-codemirror
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -42,2 +42,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
}); | ||
_defineProperty(this, "selectionChanged", selection => { | ||
this.lastSelection = selection; | ||
const { | ||
onSelectionChanged | ||
} = this.props; | ||
onSelectionChanged && onSelectionChanged(selection); | ||
}); | ||
_defineProperty(this, "autocompleteChanged", (autocompleteOpen, options, option) => { | ||
@@ -78,2 +85,3 @@ const { | ||
this.lastPosition = null; | ||
this.lastSelection = null; | ||
} | ||
@@ -107,2 +115,3 @@ componentDidMount() { | ||
searchTop, | ||
selection, | ||
tabKey, | ||
@@ -146,2 +155,3 @@ theme, | ||
searchTop, | ||
selection, | ||
tabKey, | ||
@@ -160,2 +170,3 @@ theme, | ||
this.cypherEditor.onPositionChanged(this.positionChanged); | ||
this.cypherEditor.onSelectionChanged(this.selectionChanged); | ||
this.cypherEditor.onAutocompleteChanged(this.autocompleteChanged); | ||
@@ -174,2 +185,3 @@ this.cypherEditor.onSearchChanged(this.searchChanged); | ||
this.cypherEditor.offPositionChanged(this.positionChanged); | ||
this.cypherEditor.offSelectionChanged(this.selectionChanged); | ||
this.cypherEditor.offAutocompleteChanged(this.autocompleteChanged); | ||
@@ -219,2 +231,9 @@ this.cypherEditor.offSearchChanged(this.searchChanged); | ||
} | ||
if (key === "selection") { | ||
if (prop[key] === this.lastSelection) { | ||
return; | ||
} else { | ||
this.lastSelection = prop[key]; | ||
} | ||
} | ||
const methodName = "set" + key[0].toUpperCase() + key.slice(1); | ||
@@ -221,0 +240,0 @@ if (this.cypherEditor[methodName]) { |
@@ -51,2 +51,9 @@ "use strict"; | ||
}); | ||
(0, _defineProperty2.default)(this, "selectionChanged", selection => { | ||
this.lastSelection = selection; | ||
const { | ||
onSelectionChanged | ||
} = this.props; | ||
onSelectionChanged && onSelectionChanged(selection); | ||
}); | ||
(0, _defineProperty2.default)(this, "autocompleteChanged", (autocompleteOpen, options, option) => { | ||
@@ -87,2 +94,3 @@ const { | ||
this.lastPosition = null; | ||
this.lastSelection = null; | ||
} | ||
@@ -116,2 +124,3 @@ componentDidMount() { | ||
searchTop, | ||
selection, | ||
tabKey, | ||
@@ -155,2 +164,3 @@ theme, | ||
searchTop, | ||
selection, | ||
tabKey, | ||
@@ -169,2 +179,3 @@ theme, | ||
this.cypherEditor.onPositionChanged(this.positionChanged); | ||
this.cypherEditor.onSelectionChanged(this.selectionChanged); | ||
this.cypherEditor.onAutocompleteChanged(this.autocompleteChanged); | ||
@@ -183,2 +194,3 @@ this.cypherEditor.onSearchChanged(this.searchChanged); | ||
this.cypherEditor.offPositionChanged(this.positionChanged); | ||
this.cypherEditor.offSelectionChanged(this.selectionChanged); | ||
this.cypherEditor.offAutocompleteChanged(this.autocompleteChanged); | ||
@@ -228,2 +240,9 @@ this.cypherEditor.offSearchChanged(this.searchChanged); | ||
} | ||
if (key === "selection") { | ||
if (prop[key] === this.lastSelection) { | ||
return; | ||
} else { | ||
this.lastSelection = prop[key]; | ||
} | ||
} | ||
const methodName = "set" + key[0].toUpperCase() + key.slice(1); | ||
@@ -230,0 +249,0 @@ if (this.cypherEditor[methodName]) { |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Neo4j Inc.", | ||
@@ -54,3 +54,3 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.20.13", | ||
"@neo4j-cypher/codemirror": "1.0.1" | ||
"@neo4j-cypher/codemirror": "1.0.2" | ||
}, | ||
@@ -57,0 +57,0 @@ "peerDependencies": { |
import * as React from "react"; | ||
import type { Extension } from "@codemirror/state"; | ||
import type { Extension, EditorSelection } from "@codemirror/state"; | ||
import type { EditorSupportSchema } from "@neo4j-cypher/editor-support"; | ||
@@ -17,3 +17,4 @@ import type { | ||
LineNumberClickListener, | ||
LineNumberFormatter | ||
LineNumberFormatter, | ||
SelectionChangedListener | ||
} from "@neo4j-cypher/codemirror"; | ||
@@ -204,2 +205,8 @@ | ||
/** | ||
* The editor text selection | ||
* | ||
* @defaultValue undefined | ||
*/ | ||
selection?: EditorSelection; | ||
/** | ||
* Whether the tab key is enabled | ||
@@ -266,2 +273,6 @@ * | ||
/** | ||
* A listener for when the editor text selection changes | ||
*/ | ||
onSelectionChanged?: SelectionChangedListener; | ||
/** | ||
* A listener for when the user clicks an editor line number | ||
@@ -268,0 +279,0 @@ */ |
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
27507
862
+ Added@neo4j-cypher/codemirror@1.0.2(transitive)
- Removed@neo4j-cypher/codemirror@1.0.1(transitive)