@atlaskit/editor-plugin-collab-edit 1.19.1 → 1.19.3
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 +17 -0
- package/dist/cjs/pm-plugins/main/plugin-state.js +10 -10
- package/dist/cjs/pm-plugins/track-and-filter-spamming-steps.js +1 -3
- package/dist/es2019/pm-plugins/main/plugin-state.js +1 -1
- package/dist/es2019/pm-plugins/track-and-filter-spamming-steps.js +1 -3
- package/dist/esm/pm-plugins/main/plugin-state.js +1 -1
- package/dist/esm/pm-plugins/track-and-filter-spamming-steps.js +1 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 1.19.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136632](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136632)
|
|
8
|
+
[`d2f43d5cb2d52`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d2f43d5cb2d52) -
|
|
9
|
+
Exclude LinkMetaStep from going through filtering transaction logic
|
|
10
|
+
|
|
11
|
+
## 1.19.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#136348](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136348)
|
|
16
|
+
[`fb4fb56f1da7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb4fb56f1da7c) -
|
|
17
|
+
Use optimised entry-points on editor-common for browser.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 1.19.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -15,12 +15,12 @@ exports.getValidPos = void 0;
|
|
|
15
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
16
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
|
18
19
|
var _collab = require("@atlaskit/editor-common/collab");
|
|
19
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
21
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
22
22
|
var _participants = require("../../participants");
|
|
23
|
-
var
|
|
23
|
+
var _utils = require("../../utils");
|
|
24
24
|
/**
|
|
25
25
|
* Returns position where it's possible to place a decoration.
|
|
26
26
|
*/
|
|
@@ -102,7 +102,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
102
102
|
|
|
103
103
|
// Remove telepointers for users that left
|
|
104
104
|
left.forEach(function (i) {
|
|
105
|
-
var pointers = (0,
|
|
105
|
+
var pointers = (0, _utils.findPointers)(i.sessionId, _this.decorationSet);
|
|
106
106
|
if (pointers) {
|
|
107
107
|
remove = remove.concat(pointers);
|
|
108
108
|
}
|
|
@@ -111,7 +111,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
111
111
|
if (telepointerData) {
|
|
112
112
|
var sessionId = telepointerData.sessionId;
|
|
113
113
|
if (participants.get(sessionId) && sessionId !== sid) {
|
|
114
|
-
var oldPointers = (0,
|
|
114
|
+
var oldPointers = (0, _utils.findPointers)(telepointerData.sessionId, this.decorationSet);
|
|
115
115
|
if (oldPointers) {
|
|
116
116
|
remove = remove.concat(oldPointers);
|
|
117
117
|
}
|
|
@@ -135,7 +135,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
135
135
|
} catch (err) {
|
|
136
136
|
this.onError(err);
|
|
137
137
|
}
|
|
138
|
-
add = add.concat((0,
|
|
138
|
+
add = add.concat((0, _utils.createTelepointers)(from, to, sessionId, isSelection, this.getInitial(sessionId)));
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (tr.docChanged) {
|
|
@@ -145,14 +145,14 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
145
145
|
// Reapplies decorators those got removed by the state change
|
|
146
146
|
onRemove: function onRemove(spec) {
|
|
147
147
|
if (spec.pointer && spec.pointer.sessionId && spec.key === "telepointer-".concat(spec.pointer.sessionId)) {
|
|
148
|
-
var step = tr.steps.filter(
|
|
148
|
+
var step = tr.steps.filter(_utils.isReplaceStep)[0];
|
|
149
149
|
if (step) {
|
|
150
150
|
var _sessionId = spec.pointer.sessionId;
|
|
151
151
|
var _ref = step,
|
|
152
152
|
size = _ref.slice.content.size,
|
|
153
153
|
_from = _ref.from;
|
|
154
154
|
var pos = getValidPos(tr, size ? Math.min(_from + size, tr.doc.nodeSize - 3) : Math.max(_from, 1));
|
|
155
|
-
add = add.concat((0,
|
|
155
|
+
add = add.concat((0, _utils.createTelepointers)(pos, pos, _sessionId, false, _this.getInitial(_sessionId)));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -163,7 +163,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
163
163
|
|
|
164
164
|
// Remove any selection decoration within the change range,
|
|
165
165
|
// takes care of the issue when after pasting we end up with a dead selection
|
|
166
|
-
tr.steps.filter(
|
|
166
|
+
tr.steps.filter(_utils.isReplaceStep).forEach(function (s) {
|
|
167
167
|
var _ref2 = s,
|
|
168
168
|
from = _ref2.from,
|
|
169
169
|
to = _ref2.to;
|
|
@@ -188,7 +188,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
188
188
|
// Browser condition here to fix ED-14722 where telepointer
|
|
189
189
|
// decorations with side -1 in Firefox causes backspace issues.
|
|
190
190
|
// This is likely caused by contenteditable quirks in Firefox
|
|
191
|
-
if (!
|
|
191
|
+
if (!_browser.browser.gecko) {
|
|
192
192
|
deco.type.side = -1;
|
|
193
193
|
}
|
|
194
194
|
} else {
|
|
@@ -211,7 +211,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
211
211
|
if (telepointerData) {
|
|
212
212
|
var _sessionId2 = telepointerData.sessionId;
|
|
213
213
|
if (participants.get(_sessionId2)) {
|
|
214
|
-
var positionForScroll = (0,
|
|
214
|
+
var positionForScroll = (0, _utils.getPositionOfTelepointer)(_sessionId2, this.decorationSet);
|
|
215
215
|
if (positionForScroll) {
|
|
216
216
|
participants = participants.updateCursorPos(_sessionId2, positionForScroll);
|
|
217
217
|
}
|
|
@@ -78,7 +78,7 @@ var createFilterTransaction = exports.createFilterTransaction = function createF
|
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
var containsExcludedSteps = tr.steps.some(function (step) {
|
|
81
|
-
return step instanceof _steps.AnalyticsStep || step instanceof _transform.ReplaceStep || step instanceof _transform.ReplaceAroundStep;
|
|
81
|
+
return step instanceof _steps.AnalyticsStep || step instanceof _transform.ReplaceStep || step instanceof _transform.ReplaceAroundStep || step instanceof _steps.LinkMetaStep;
|
|
82
82
|
});
|
|
83
83
|
if (containsExcludedSteps) {
|
|
84
84
|
return true;
|
|
@@ -126,8 +126,6 @@ function generateTransactionKey(tr) {
|
|
|
126
126
|
}
|
|
127
127
|
} else if (step instanceof _transform.AddMarkStep || step instanceof _transform.RemoveMarkStep) {
|
|
128
128
|
return "from_".concat(step.from, "_to_").concat(step.to);
|
|
129
|
-
} else if (step instanceof _steps.LinkMetaStep) {
|
|
130
|
-
return "from_".concat(step.toJSON().from, "_to_").concat(step.toJSON().to);
|
|
131
129
|
} else if (step instanceof _steps.InsertTypeAheadStep) {
|
|
132
130
|
return "insertTypeAheadStep";
|
|
133
131
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
2
3
|
import { TELEPOINTER_DIM_CLASS } from '@atlaskit/editor-common/collab';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { Participants } from '../../participants';
|
|
@@ -70,7 +70,7 @@ export const createFilterTransaction = (recentTransactionsTimestamps, trackFilte
|
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
72
72
|
const containsExcludedSteps = tr.steps.some(step => {
|
|
73
|
-
return step instanceof AnalyticsStep || step instanceof ReplaceStep || step instanceof ReplaceAroundStep;
|
|
73
|
+
return step instanceof AnalyticsStep || step instanceof ReplaceStep || step instanceof ReplaceAroundStep || step instanceof LinkMetaStep;
|
|
74
74
|
});
|
|
75
75
|
if (containsExcludedSteps) {
|
|
76
76
|
return true;
|
|
@@ -118,8 +118,6 @@ export function generateTransactionKey(tr) {
|
|
|
118
118
|
}
|
|
119
119
|
} else if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) {
|
|
120
120
|
return `from_${step.from}_to_${step.to}`;
|
|
121
|
-
} else if (step instanceof LinkMetaStep) {
|
|
122
|
-
return `from_${step.toJSON().from}_to_${step.toJSON().to}`;
|
|
123
121
|
} else if (step instanceof InsertTypeAheadStep) {
|
|
124
122
|
return `insertTypeAheadStep`;
|
|
125
123
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
4
5
|
import { TELEPOINTER_DIM_CLASS } from '@atlaskit/editor-common/collab';
|
|
5
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { Participants } from '../../participants';
|
|
@@ -70,7 +70,7 @@ export var createFilterTransaction = function createFilterTransaction(recentTran
|
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
72
72
|
var containsExcludedSteps = tr.steps.some(function (step) {
|
|
73
|
-
return step instanceof AnalyticsStep || step instanceof ReplaceStep || step instanceof ReplaceAroundStep;
|
|
73
|
+
return step instanceof AnalyticsStep || step instanceof ReplaceStep || step instanceof ReplaceAroundStep || step instanceof LinkMetaStep;
|
|
74
74
|
});
|
|
75
75
|
if (containsExcludedSteps) {
|
|
76
76
|
return true;
|
|
@@ -118,8 +118,6 @@ export function generateTransactionKey(tr) {
|
|
|
118
118
|
}
|
|
119
119
|
} else if (step instanceof AddMarkStep || step instanceof RemoveMarkStep) {
|
|
120
120
|
return "from_".concat(step.from, "_to_").concat(step.to);
|
|
121
|
-
} else if (step instanceof LinkMetaStep) {
|
|
122
|
-
return "from_".concat(step.toJSON().from, "_to_").concat(step.toJSON().to);
|
|
123
121
|
} else if (step instanceof InsertTypeAheadStep) {
|
|
124
122
|
return "insertTypeAheadStep";
|
|
125
123
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.3",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
34
34
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
35
|
-
"@atlaskit/editor-common": "^88.
|
|
35
|
+
"@atlaskit/editor-common": "^88.8.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "1.8.3",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|