@atlaskit/prosemirror-collab 0.14.0 → 0.15.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/prosemirror-collab
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
8
+ [`73c800ab5f2fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73c800ab5f2fc) -
9
+ ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0
10
+
3
11
  ## 0.14.0
4
12
 
5
13
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -160,8 +160,11 @@ function syncFromAnotherSource(state, version,
160
160
  docJSON, unconfirmedSteps) {
161
161
  var tr = state.tr;
162
162
  var doc = state.schema.nodeFromJSON(docJSON);
163
- var selection = _state.TextSelection.create(state.doc, 0, state.doc.content.size);
164
- tr.setSelection(selection).replaceSelectionWith(doc, false);
163
+ var _tr$selection = tr.selection,
164
+ from = _tr$selection.from,
165
+ to = _tr$selection.to;
166
+ tr.replaceWith(0, state.doc.content.size, doc);
167
+ tr.setSelection(_state.TextSelection.create(tr.doc, Math.min(tr.mapping.map(from), tr.doc.nodeSize), Math.min(tr.mapping.map(to), tr.doc.nodeSize)));
165
168
 
166
169
  // apply new unconfirmed steps to doc
167
170
  for (var i = 0; i < unconfirmedSteps.length; i++) {
@@ -145,8 +145,12 @@ export function syncFromAnotherSource(state, version,
145
145
  docJSON, unconfirmedSteps) {
146
146
  const tr = state.tr;
147
147
  const doc = state.schema.nodeFromJSON(docJSON);
148
- const selection = TextSelection.create(state.doc, 0, state.doc.content.size);
149
- tr.setSelection(selection).replaceSelectionWith(doc, false);
148
+ const {
149
+ from,
150
+ to
151
+ } = tr.selection;
152
+ tr.replaceWith(0, state.doc.content.size, doc);
153
+ tr.setSelection(TextSelection.create(tr.doc, Math.min(tr.mapping.map(from), tr.doc.nodeSize), Math.min(tr.mapping.map(to), tr.doc.nodeSize)));
150
154
 
151
155
  // apply new unconfirmed steps to doc
152
156
  for (let i = 0; i < unconfirmedSteps.length; i++) {
package/dist/esm/index.js CHANGED
@@ -147,8 +147,11 @@ export function syncFromAnotherSource(state, version,
147
147
  docJSON, unconfirmedSteps) {
148
148
  var tr = state.tr;
149
149
  var doc = state.schema.nodeFromJSON(docJSON);
150
- var selection = TextSelection.create(state.doc, 0, state.doc.content.size);
151
- tr.setSelection(selection).replaceSelectionWith(doc, false);
150
+ var _tr$selection = tr.selection,
151
+ from = _tr$selection.from,
152
+ to = _tr$selection.to;
153
+ tr.replaceWith(0, state.doc.content.size, doc);
154
+ tr.setSelection(TextSelection.create(tr.doc, Math.min(tr.mapping.map(from), tr.doc.nodeSize), Math.min(tr.mapping.map(to), tr.doc.nodeSize)));
152
155
 
153
156
  // apply new unconfirmed steps to doc
154
157
  for (var i = 0; i < unconfirmedSteps.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-collab",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Collaborative editing for ProseMirror - Atlassian Fork",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,7 +36,7 @@
36
36
  "uuid": "^3.1.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@atlaskit/adf-schema": "^47.2.1"
39
+ "@atlaskit/adf-schema": "^47.6.0"
40
40
  },
41
41
  "techstack": {
42
42
  "@atlassian/frontend": {