@atlaskit/editor-plugin-collab-edit 1.1.8 → 1.1.10
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 +13 -0
- package/dist/cjs/actions.js +3 -32
- package/dist/es2019/actions.js +3 -30
- package/dist/esm/actions.js +3 -31
- package/package.json +6 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 1.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#84283](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84283) [`fcc12bc22e37`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fcc12bc22e37) - Clean up platform.editor.enable-map-selection-backward FE FF
|
|
8
|
+
|
|
9
|
+
## 1.1.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#81777](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81777) [`c6d7a5378751`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c6d7a5378751) - Bump adf-schema to 35.7.0
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 1.1.8
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/actions.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.handleTelePointer = exports.handlePresence = exports.handleInit = exports.handleConnection = exports.getSendableSelection = exports.applyRemoteSteps = exports.applyRemoteData = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
8
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
9
|
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
13
10
|
var _utils = require("./utils");
|
|
14
11
|
var handleInit = exports.handleInit = function handleInit(initData, view, options) {
|
|
@@ -52,16 +49,9 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
52
49
|
});
|
|
53
50
|
var tr;
|
|
54
51
|
if (options && options.useNativePlugin && userIds) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.enable-map-selection-backward')) {
|
|
59
|
-
tr = (0, _prosemirrorCollab.receiveTransaction)(state, steps, userIds, {
|
|
60
|
-
mapSelectionBackward: true
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
tr = (0, _prosemirrorCollab.receiveTransaction)(state, steps, userIds);
|
|
64
|
-
}
|
|
52
|
+
tr = (0, _prosemirrorCollab.receiveTransaction)(state, steps, userIds, {
|
|
53
|
+
mapSelectionBackward: true
|
|
54
|
+
});
|
|
65
55
|
} else {
|
|
66
56
|
tr = state.tr;
|
|
67
57
|
steps.forEach(function (step) {
|
|
@@ -71,11 +61,6 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
71
61
|
if (tr) {
|
|
72
62
|
tr.setMeta('addToHistory', false);
|
|
73
63
|
tr.setMeta('isRemote', true);
|
|
74
|
-
var _state$selection = state.selection,
|
|
75
|
-
from = _state$selection.from,
|
|
76
|
-
to = _state$selection.to;
|
|
77
|
-
var _json = (0, _slicedToArray2.default)(json, 1),
|
|
78
|
-
firstStep = _json[0];
|
|
79
64
|
|
|
80
65
|
/*
|
|
81
66
|
* Persist marks across transactions. Fixes an issue where
|
|
@@ -85,20 +70,6 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
85
70
|
if (state.tr.storedMarks) {
|
|
86
71
|
tr.setStoredMarks(state.tr.storedMarks);
|
|
87
72
|
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* https://switcheroo.atlassian.com/changes/confluence/platform.editor.enable-map-selection-backward
|
|
91
|
-
*/
|
|
92
|
-
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.enable-map-selection-backward')) {
|
|
93
|
-
/**
|
|
94
|
-
* If the cursor is a the same position as the first step in
|
|
95
|
-
* the remote data, we need to manually set it back again
|
|
96
|
-
* in order to prevent the cursor from moving.
|
|
97
|
-
*/
|
|
98
|
-
if (from === firstStep.from && to === firstStep.to) {
|
|
99
|
-
tr.setSelection(state.selection.map(tr.doc, tr.mapping));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
73
|
view.dispatch(tr);
|
|
103
74
|
}
|
|
104
75
|
};
|
package/dist/es2019/actions.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AllSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { receiveTransaction } from '@atlaskit/prosemirror-collab';
|
|
5
4
|
import { replaceDocument } from './utils';
|
|
6
5
|
export const handleInit = (initData, view, options) => {
|
|
@@ -59,16 +58,9 @@ export const applyRemoteSteps = (json, view, userIds, options) => {
|
|
|
59
58
|
const steps = json.map(step => Step.fromJSON(schema, step));
|
|
60
59
|
let tr;
|
|
61
60
|
if (options && options.useNativePlugin && userIds) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (getBooleanFF('platform.editor.enable-map-selection-backward')) {
|
|
66
|
-
tr = receiveTransaction(state, steps, userIds, {
|
|
67
|
-
mapSelectionBackward: true
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
tr = receiveTransaction(state, steps, userIds);
|
|
71
|
-
}
|
|
61
|
+
tr = receiveTransaction(state, steps, userIds, {
|
|
62
|
+
mapSelectionBackward: true
|
|
63
|
+
});
|
|
72
64
|
} else {
|
|
73
65
|
tr = state.tr;
|
|
74
66
|
steps.forEach(step => tr.step(step));
|
|
@@ -76,11 +68,6 @@ export const applyRemoteSteps = (json, view, userIds, options) => {
|
|
|
76
68
|
if (tr) {
|
|
77
69
|
tr.setMeta('addToHistory', false);
|
|
78
70
|
tr.setMeta('isRemote', true);
|
|
79
|
-
const {
|
|
80
|
-
from,
|
|
81
|
-
to
|
|
82
|
-
} = state.selection;
|
|
83
|
-
const [firstStep] = json;
|
|
84
71
|
|
|
85
72
|
/*
|
|
86
73
|
* Persist marks across transactions. Fixes an issue where
|
|
@@ -90,20 +77,6 @@ export const applyRemoteSteps = (json, view, userIds, options) => {
|
|
|
90
77
|
if (state.tr.storedMarks) {
|
|
91
78
|
tr.setStoredMarks(state.tr.storedMarks);
|
|
92
79
|
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* https://switcheroo.atlassian.com/changes/confluence/platform.editor.enable-map-selection-backward
|
|
96
|
-
*/
|
|
97
|
-
if (!getBooleanFF('platform.editor.enable-map-selection-backward')) {
|
|
98
|
-
/**
|
|
99
|
-
* If the cursor is a the same position as the first step in
|
|
100
|
-
* the remote data, we need to manually set it back again
|
|
101
|
-
* in order to prevent the cursor from moving.
|
|
102
|
-
*/
|
|
103
|
-
if (from === firstStep.from && to === firstStep.to) {
|
|
104
|
-
tr.setSelection(state.selection.map(tr.doc, tr.mapping));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
80
|
view.dispatch(tr);
|
|
108
81
|
}
|
|
109
82
|
};
|
package/dist/esm/actions.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import { AllSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
3
|
import { receiveTransaction } from '@atlaskit/prosemirror-collab';
|
|
6
4
|
import { replaceDocument } from './utils';
|
|
7
5
|
export var handleInit = function handleInit(initData, view, options) {
|
|
@@ -45,16 +43,9 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
45
43
|
});
|
|
46
44
|
var tr;
|
|
47
45
|
if (options && options.useNativePlugin && userIds) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (getBooleanFF('platform.editor.enable-map-selection-backward')) {
|
|
52
|
-
tr = receiveTransaction(state, steps, userIds, {
|
|
53
|
-
mapSelectionBackward: true
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
tr = receiveTransaction(state, steps, userIds);
|
|
57
|
-
}
|
|
46
|
+
tr = receiveTransaction(state, steps, userIds, {
|
|
47
|
+
mapSelectionBackward: true
|
|
48
|
+
});
|
|
58
49
|
} else {
|
|
59
50
|
tr = state.tr;
|
|
60
51
|
steps.forEach(function (step) {
|
|
@@ -64,11 +55,6 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
64
55
|
if (tr) {
|
|
65
56
|
tr.setMeta('addToHistory', false);
|
|
66
57
|
tr.setMeta('isRemote', true);
|
|
67
|
-
var _state$selection = state.selection,
|
|
68
|
-
from = _state$selection.from,
|
|
69
|
-
to = _state$selection.to;
|
|
70
|
-
var _json = _slicedToArray(json, 1),
|
|
71
|
-
firstStep = _json[0];
|
|
72
58
|
|
|
73
59
|
/*
|
|
74
60
|
* Persist marks across transactions. Fixes an issue where
|
|
@@ -78,20 +64,6 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
78
64
|
if (state.tr.storedMarks) {
|
|
79
65
|
tr.setStoredMarks(state.tr.storedMarks);
|
|
80
66
|
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* https://switcheroo.atlassian.com/changes/confluence/platform.editor.enable-map-selection-backward
|
|
84
|
-
*/
|
|
85
|
-
if (!getBooleanFF('platform.editor.enable-map-selection-backward')) {
|
|
86
|
-
/**
|
|
87
|
-
* If the cursor is a the same position as the first step in
|
|
88
|
-
* the remote data, we need to manually set it back again
|
|
89
|
-
* in order to prevent the cursor from moving.
|
|
90
|
-
*/
|
|
91
|
-
if (from === firstStep.from && to === firstStep.to) {
|
|
92
|
-
tr.setSelection(state.selection.map(tr.doc, tr.mapping));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
67
|
view.dispatch(tr);
|
|
96
68
|
}
|
|
97
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,13 +32,12 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^35.
|
|
36
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
37
|
-
"@atlaskit/editor-common": "^78.
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "1.0.
|
|
35
|
+
"@atlaskit/adf-schema": "^35.7.0",
|
|
36
|
+
"@atlaskit/custom-steps": "^0.0.16",
|
|
37
|
+
"@atlaskit/editor-common": "^78.20.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "1.0.5",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
41
|
-
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
42
41
|
"@atlaskit/prosemirror-collab": "^0.2.0",
|
|
43
42
|
"@babel/runtime": "^7.0.0",
|
|
44
43
|
"memoize-one": "^6.0.0"
|
|
@@ -98,10 +97,5 @@
|
|
|
98
97
|
]
|
|
99
98
|
}
|
|
100
99
|
},
|
|
101
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
102
|
-
"platform-feature-flags": {
|
|
103
|
-
"platform.editor.enable-map-selection-backward": {
|
|
104
|
-
"type": "boolean"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
100
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
107
101
|
}
|