rich-text
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -0,4 +1,11 @@ | ||
## v4.1.0 | ||
#### Features | ||
- Add `transformPresence()` method | ||
## v4.0.0 | ||
#### Breaking Changes | ||
These were never documented as officially supported but to be safe we are doing a major version bump. | ||
@@ -13,20 +20,21 @@ | ||
#### Breaking Changes | ||
- Deep copy and compare attributes and deltas | ||
#### Features | ||
## v2.1.0 | ||
#### Features | ||
- Add `concat()` method for document Deltas | ||
## v2.0.0 | ||
#### Breaking Changes | ||
- `compose()` returns a new Delta instead of self-modifying | ||
#### Features | ||
- Support embed being any non-string type |
@@ -53,4 +53,19 @@ var Delta = require('quill-delta'); | ||
return new Delta(ops); | ||
} | ||
}, | ||
transformPresence: function(range, op, isOwnOp) { | ||
if (!range) { | ||
return null; | ||
} | ||
const delta = new Delta(op); | ||
const start = this.transformCursor(range.index, delta, isOwnOp); | ||
const end = this.transformCursor(range.index + range.length, delta, isOwnOp); | ||
return Object.assign({}, range, { | ||
index: start, | ||
length: end - start, | ||
}); | ||
}, | ||
} | ||
}; |
{ | ||
"name": "rich-text", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "OT type for rich text", | ||
@@ -12,6 +12,6 @@ "author": "Jason Chen <jhchen7@gmail.com>", | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"lodash": "^4.16.4", | ||
"mocha": "^3.1.2", | ||
"ot-fuzzer": "^1.0.0" | ||
"chai": "^4.2.0", | ||
"lodash": "^4.17.15", | ||
"mocha": "^6.1.4", | ||
"ot-fuzzer": "^1.2.1" | ||
}, | ||
@@ -23,3 +23,3 @@ "engines": { | ||
"scripts": { | ||
"test": "mocha test/fuzzer.js --timeout 5000" | ||
"test": "mocha test/**/*.js --timeout 5000" | ||
}, | ||
@@ -26,0 +26,0 @@ "repository": { |
16319
9
273