react-ace
Advanced tools
Comparing version 9.5.0 to 10.0.0
# Changelog | ||
## 10.0.0 | ||
- Fix changing value loses annotations #1429 | ||
- Fix Uncaught TypeError: (reading 'destroy') #1293 | ||
- Upgrade dev dependencies | ||
- Upgrade Ace-builds to 1.4.14 | ||
## 9.5.0 | ||
- Upgrade dev dependencies | ||
- Upgrade Ace-builds to 1.4.13 | ||
## 9.4.4 | ||
- Upgrade dev dependencies | ||
## 9.4.2 | ||
@@ -4,0 +18,0 @@ |
@@ -75,6 +75,6 @@ "use strict"; | ||
.getSession() | ||
.setMode(typeof mode === "string" ? "ace/mode/" + mode : mode); | ||
.setMode(typeof mode === "string" ? "ace/mode/".concat(mode) : mode); | ||
if (theme && theme !== "") | ||
this.editor.setTheme("ace/theme/" + theme); | ||
this.editor.setFontSize(typeof fontSize === "number" ? fontSize + "px" : fontSize); | ||
this.editor.setTheme("ace/theme/".concat(theme)); | ||
this.editor.setFontSize(typeof fontSize === "number" ? "".concat(fontSize, "px") : fontSize); | ||
this.editor | ||
@@ -123,3 +123,3 @@ .getSession() | ||
else if (_this.props[option]) { | ||
console.warn("ReactAce: editor option " + option + " was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"); | ||
console.warn("ReactAce: editor option ".concat(option, " was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")); | ||
} | ||
@@ -174,5 +174,6 @@ }); | ||
// First process editor value, as it may create a new session (see issue #300) | ||
if (this.editor && | ||
var valueChanged = this.editor && | ||
nextProps.value != null && | ||
this.editor.getValue() !== nextProps.value) { | ||
this.editor.getValue() !== nextProps.value; | ||
if (valueChanged) { | ||
// editor.setValue is a synchronous function call, change event is emitted before setValue return. | ||
@@ -192,3 +193,3 @@ this.silent = true; | ||
.setMode(typeof nextProps.mode === "string" | ||
? "ace/mode/" + nextProps.mode | ||
? "ace/mode/".concat(nextProps.mode) | ||
: nextProps.mode); | ||
@@ -209,3 +210,3 @@ } | ||
this.editor.setFontSize(typeof nextProps.fontSize === "number" | ||
? nextProps.fontSize + "px" | ||
? "".concat(nextProps.fontSize, "px") | ||
: nextProps.fontSize); | ||
@@ -225,3 +226,5 @@ } | ||
} | ||
if (!isEqual(nextProps.annotations, oldProps.annotations)) { | ||
// if the value or annotations changed, set the annotations | ||
// changing the value may create create a new session which will require annotations to be re-set | ||
if (valueChanged || !isEqual(nextProps.annotations, oldProps.annotations)) { | ||
this.editor.getSession().setAnnotations(nextProps.annotations || []); | ||
@@ -250,4 +253,6 @@ } | ||
ReactAce.prototype.componentWillUnmount = function () { | ||
this.editor.destroy(); | ||
this.editor = null; | ||
if (this.editor) { | ||
this.editor.destroy(); | ||
this.editor = null; | ||
} | ||
}; | ||
@@ -254,0 +259,0 @@ ReactAce.prototype.onChange = function (event) { |
@@ -64,3 +64,3 @@ "use strict"; | ||
} | ||
this.editor.setTheme("ace/theme/" + theme); | ||
this.editor.setTheme("ace/theme/".concat(theme)); | ||
if (onBeforeLoad) { | ||
@@ -70,3 +70,3 @@ onBeforeLoad(ace); | ||
var editorProps = Object.keys(this.props.editorProps); | ||
var split = new ext_split_1.Split(this.editor.container, "ace/theme/" + theme, splits); | ||
var split = new ext_split_1.Split(this.editor.container, "ace/theme/".concat(theme), splits); | ||
this.editor.env.split = split; | ||
@@ -90,5 +90,5 @@ this.splitEditor = split.getEditor(0); | ||
editor.session.setUndoManager(new ace.UndoManager()); | ||
editor.setTheme("ace/theme/" + theme); | ||
editor.setTheme("ace/theme/".concat(theme)); | ||
editor.renderer.setScrollMargin(scrollMargin[0], scrollMargin[1], scrollMargin[2], scrollMargin[3]); | ||
editor.getSession().setMode("ace/mode/" + mode); | ||
editor.getSession().setMode("ace/mode/".concat(mode)); | ||
editor.setFontSize(fontSize); | ||
@@ -124,3 +124,3 @@ editor.renderer.setShowGutter(showGutter); | ||
else if (_this.props[option]) { | ||
console.warn("ReaceAce: editor option " + option + " was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"); | ||
console.warn("ReaceAce: editor option ".concat(option, " was activated but not found. Did you need to import a related tool or did you possibly mispell the option?")); | ||
} | ||
@@ -127,0 +127,0 @@ } |
{ | ||
"name": "react-ace", | ||
"version": "9.5.0", | ||
"version": "10.0.0", | ||
"description": "A react component for Ace Editor", | ||
@@ -41,4 +41,4 @@ "main": "lib/index.js", | ||
"@types/prop-types": "^15.7.4", | ||
"@types/react": "^17.0.31", | ||
"@types/react-dom": "^17.0.10", | ||
"@types/react": "^18.0.5", | ||
"@types/react-dom": "^18.0.1", | ||
"@types/sinon": "^10.0.4", | ||
@@ -51,3 +51,3 @@ "babel-eslint": "^10.1.0", | ||
"enzyme-adapter-react-16": "^1.15.6", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.11.0", | ||
"eslint-plugin-import": "^2.25.2", | ||
@@ -57,5 +57,5 @@ "eslint-plugin-jsx-a11y": "^6.4.1", | ||
"husky": "^7.0.4", | ||
"jsdom": "18.0.0", | ||
"jsdom": "19.0.0", | ||
"minimist": ">=1.2.5", | ||
"mocha": "9.1.3", | ||
"mocha": "9.2.2", | ||
"node-forge": ">=0.10.0", | ||
@@ -69,3 +69,3 @@ "nyc": "15.1.0", | ||
"rimraf": "3.0.2", | ||
"sinon": "11.1.2", | ||
"sinon": "13.0.2", | ||
"ts-loader": "^9.2.6", | ||
@@ -76,5 +76,5 @@ "ts-node": "^10.3.1", | ||
"typescript": "^4.4.4", | ||
"webpack": "5.59.1", | ||
"webpack-cli": "4.9.1", | ||
"webpack-dev-server": "4.3.1" | ||
"webpack": "5.72.0", | ||
"webpack-cli": "4.9.2", | ||
"webpack-dev-server": "4.8.1" | ||
}, | ||
@@ -88,3 +88,3 @@ "keywords": [ | ||
"dependencies": { | ||
"ace-builds": "^1.4.13", | ||
"ace-builds": "^1.4.14", | ||
"diff-match-patch": "^1.0.5", | ||
@@ -91,0 +91,0 @@ "lodash.get": "^4.4.2", |
@@ -38,2 +38,3 @@ # React-Ace | ||
import "ace-builds/src-noconflict/theme-github"; | ||
import "ace-builds/src-noconflict/ext-language_tools"; | ||
@@ -40,0 +41,0 @@ function onChange(newValue) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1937391
62
6799
124
Updatedace-builds@^1.4.14