From a12177892c692b44c106d60f2819fbf7f1094f22 Mon Sep 17 00:00:00 2001 From: Progyan Bhattacharya Date: Sun, 5 Sep 2021 23:04:04 +0530 Subject: [PATCH] (chore) Dependency: Bump version to 0.1.1 Fixes: #43 Signed-off-by: Progyan Bhattacharya --- CHANGELOG.md | 7 +++++++ package.json | 8 ++++---- src/monaco-adapter.ts | 21 +++++++++------------ yarn.lock | 26 +++++++++++++------------- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f49c2f6..d321e2df4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,13 @@ Good to have: commit or PR links. --> +## v0.3.1 [#44](https://github.com/interviewstreet/firepad-x/pull/44) + +### Changed + +- Bump version of `@operational-transformation` packages to `v0.1.1`. +- This fixes [issue](https://github.com/interviewstreet/firepad-x/issues/43) with Universal Application building using this library. + ## v0.3.0 [#42](https://github.com/interviewstreet/firepad-x/pull/42) ### Changed diff --git a/package.json b/package.json index 6d855d326..b30cf2e39 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@hackerrank/firepad", "description": "Collaborative text editing powered by Firebase", - "version": "0.3.0", + "version": "0.3.1", "author": { "email": "bprogyan@gmail.com", "name": "Progyan Bhattacharya", @@ -59,9 +59,9 @@ "monaco-editor": "0.18.1" }, "dependencies": { - "@operational-transformation/plaintext": "0.1.0", - "@operational-transformation/plaintext-editor": "0.1.0", - "@operational-transformation/state-machine": "0.1.0", + "@operational-transformation/plaintext": "0.1.1", + "@operational-transformation/plaintext-editor": "0.1.1", + "@operational-transformation/state-machine": "0.1.1", "mitt": "3.0.0", "uuid": "8.3.2" }, diff --git a/src/monaco-adapter.ts b/src/monaco-adapter.ts index 392130eea..9ef058f83 100644 --- a/src/monaco-adapter.ts +++ b/src/monaco-adapter.ts @@ -609,7 +609,7 @@ export class MonacoAdapter implements IEditorAdapter { /** If no change information received */ if (!ev.changes || ev.changes.length === 0) { - const op = new TextOperation().retain(contentLength, null); + const op = new TextOperation().retain(contentLength); this._trigger(EditorAdapterEvent.Change, { operation: op, inverse: op, @@ -705,8 +705,8 @@ export class MonacoAdapter implements IEditorAdapter { const retain = rangeOffset - skippedChars; try { - mainOp = mainOp.retain(retain, null); - reverseOp = reverseOp.retain(retain, null); + mainOp = mainOp.retain(retain); + reverseOp = reverseOp.retain(retain); } catch (err) { this._trigger(EditorAdapterEvent.Error, { err, @@ -718,17 +718,14 @@ export class MonacoAdapter implements IEditorAdapter { if (!text && !range.isEmpty()) { mainOp = mainOp.delete(rangeLength); - reverseOp = reverseOp.insert( - this._getPreviousContentInRange(range), - null - ); + reverseOp = reverseOp.insert(this._getPreviousContentInRange(range)); } else if (text && !range.isEmpty()) { - mainOp = mainOp.delete(rangeLength).insert(text, null); + mainOp = mainOp.delete(rangeLength).insert(text); reverseOp = reverseOp - .insert(this._getPreviousContentInRange(range), null) + .insert(this._getPreviousContentInRange(range)) .delete(text); } else { - mainOp = mainOp.insert(text, null); + mainOp = mainOp.insert(text); reverseOp = reverseOp.delete(text); } @@ -736,8 +733,8 @@ export class MonacoAdapter implements IEditorAdapter { } try { - mainOp = mainOp.retain(contentLength - skippedChars, null); - reverseOp = reverseOp.retain(contentLength - skippedChars, null); + mainOp = mainOp.retain(contentLength - skippedChars); + reverseOp = reverseOp.retain(contentLength - skippedChars); } catch (err) { this._trigger(EditorAdapterEvent.Error, { err, diff --git a/yarn.lock b/yarn.lock index 3b38e2af8..adb3c0737 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1445,23 +1445,23 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@operational-transformation/plaintext-editor@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@operational-transformation/plaintext-editor/-/plaintext-editor-0.1.0.tgz#0c7fc3253b9917bb95ba65134f4e07006cba8fd6" - integrity sha512-1o7XR/DbOyY0CkSnPRyLsXHanVBq4XwLIKyPkTvlwHVFn2NuxkpAL/3tlwhIKA1fRd06pxxe+Dhzprf1yaTW4g== +"@operational-transformation/plaintext-editor@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@operational-transformation/plaintext-editor/-/plaintext-editor-0.1.1.tgz#6523a7b52fe619c96b72f026fa157a3b1486fe25" + integrity sha512-2vQEItOulQeQp7lOu4rLCSd9H1Liq/arv26I88JfnhnPD1IFGEvrFJjHfgOoJSghMvNV/HxrpojOnRneRvdMXw== dependencies: - "@operational-transformation/state-machine" "0.1.0" + "@operational-transformation/state-machine" "0.1.1" mitt "3.0.0" -"@operational-transformation/plaintext@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@operational-transformation/plaintext/-/plaintext-0.1.0.tgz#2d7469b7bf886e7345fcbbb300afe45827ba990b" - integrity sha512-Kg0sU5+7+Fi0p9b2F558tioeInlPzlWhgSQRt4I6xwMNQAu6jpWTbnvEhGc8jAh5kaVjNYPQhzvpdZHnmDeX0g== +"@operational-transformation/plaintext@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@operational-transformation/plaintext/-/plaintext-0.1.1.tgz#22bbb4f4eacdb63a90f3557adeb9d438c91b4617" + integrity sha512-90vZeG74f0Ruz2avG8jDj7y4w1LxxTuSGNwAht9vWzNl8U01JEP1rcIDZ/jhQGL9yZFWTZY4mwPSUJuMZks7Bg== -"@operational-transformation/state-machine@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@operational-transformation/state-machine/-/state-machine-0.1.0.tgz#92096618e9747d94b9f6f12afe76a6a4b58177c1" - integrity sha512-fcttrjExFey5noy4eFQUXecK/YPqyINkS5GifMHirTw2cJGX8+oDosroFW+RnflS7lnSxuNq+M2S40at75B+mg== +"@operational-transformation/state-machine@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@operational-transformation/state-machine/-/state-machine-0.1.1.tgz#ef13979993c41a32eacd1a0bae4e40b3998ada37" + integrity sha512-2Get0p4quTXts5JzroPs7Ry1zu2bjD1R/oMjBRI4YgRRshRfDSOrxvfHsN2R+wNM1akfGfLgVKgxh8sLKR5ZSw== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2"