@atlaskit/editor-plugin-collab-edit 4.1.5 → 4.1.7
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 +16 -0
- package/dist/cjs/pm-plugins/main/plugin-state.js +6 -21
- package/dist/cjs/pm-plugins/utils.js +22 -29
- package/dist/es2019/pm-plugins/main/plugin-state.js +7 -22
- package/dist/es2019/pm-plugins/utils.js +21 -24
- package/dist/esm/pm-plugins/main/plugin-state.js +7 -22
- package/dist/esm/pm-plugins/utils.js +21 -28
- package/dist/types/pm-plugins/utils.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -1
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 4.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`57b19274b9fdd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/57b19274b9fdd) -
|
|
8
|
+
EDITOR-1373 Bump adf-schema version
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 4.1.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`128002718ba34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/128002718ba34) -
|
|
16
|
+
confluence_team_presence_scroll_to_pointer feature flag cleaned up
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 4.1.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -12,7 +12,6 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
12
12
|
var _collab = require("@atlaskit/editor-common/collab");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var _participants = require("../participants");
|
|
18
17
|
var _utils = require("../utils");
|
|
@@ -114,12 +113,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
114
113
|
|
|
115
114
|
// Remove telepointers for users that left
|
|
116
115
|
left.forEach(function (i) {
|
|
117
|
-
var pointers;
|
|
118
|
-
if ((0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer')) {
|
|
119
|
-
pointers = (0, _utils.findPointers)(_this.getPresenceId(i.sessionId), _this.decorationSet);
|
|
120
|
-
} else {
|
|
121
|
-
pointers = (0, _utils._findPointers)(i.sessionId, _this.decorationSet);
|
|
122
|
-
}
|
|
116
|
+
var pointers = (0, _utils.findPointers)(_this.getPresenceId(i.sessionId), _this.decorationSet);
|
|
123
117
|
if (pointers) {
|
|
124
118
|
remove = remove.concat(pointers);
|
|
125
119
|
}
|
|
@@ -128,12 +122,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
128
122
|
if (telepointerData) {
|
|
129
123
|
var sessionId = telepointerData.sessionId;
|
|
130
124
|
if (participants.get(sessionId) && sessionId !== sid) {
|
|
131
|
-
var oldPointers;
|
|
132
|
-
if ((0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer')) {
|
|
133
|
-
oldPointers = (0, _utils.findPointers)(this.getPresenceId(sessionId), this.decorationSet);
|
|
134
|
-
} else {
|
|
135
|
-
oldPointers = (0, _utils._findPointers)(sessionId, this.decorationSet);
|
|
136
|
-
}
|
|
125
|
+
var oldPointers = (0, _utils.findPointers)(this.getPresenceId(sessionId), this.decorationSet);
|
|
137
126
|
if (oldPointers) {
|
|
138
127
|
remove = remove.concat(oldPointers);
|
|
139
128
|
}
|
|
@@ -157,7 +146,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
157
146
|
} catch (err) {
|
|
158
147
|
this.onError(err);
|
|
159
148
|
}
|
|
160
|
-
add = add.concat((0, _utils.createTelepointers)(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId), (0,
|
|
149
|
+
add = add.concat((0, _utils.createTelepointers)(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId), (0, _utils.hasExistingNudge)(sessionId, this.nudgeAnimations)));
|
|
161
150
|
}
|
|
162
151
|
}
|
|
163
152
|
if (tr.docChanged) {
|
|
@@ -176,7 +165,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
176
165
|
size = _ref.slice.content.size,
|
|
177
166
|
_from = _ref.from;
|
|
178
167
|
var pos = getValidPos(tr, size ? Math.min(_from + size, tr.doc.nodeSize - 3) : Math.max(_from, 1));
|
|
179
|
-
add = add.concat((0, _utils.createTelepointers)(pos, pos, _sessionId, false, _this.getInitial(_sessionId), presenceId, _this.getFullName(_sessionId), (0,
|
|
168
|
+
add = add.concat((0, _utils.createTelepointers)(pos, pos, _sessionId, false, _this.getInitial(_sessionId), presenceId, _this.getFullName(_sessionId), (0, _utils.hasExistingNudge)(_sessionId, _this.nudgeAnimations)));
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
171
|
}
|
|
@@ -230,7 +219,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
230
219
|
}
|
|
231
220
|
}
|
|
232
221
|
});
|
|
233
|
-
if (nudgeTelepointerData
|
|
222
|
+
if (nudgeTelepointerData) {
|
|
234
223
|
var nudgeSessionId = nudgeTelepointerData === null || nudgeTelepointerData === void 0 ? void 0 : nudgeTelepointerData.sessionId;
|
|
235
224
|
|
|
236
225
|
// Ignored via go/ees005
|
|
@@ -265,11 +254,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
265
254
|
}
|
|
266
255
|
}
|
|
267
256
|
}
|
|
268
|
-
|
|
269
|
-
var _nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
270
|
-
return PluginState.eq(_nextState, this) ? this : _nextState;
|
|
271
|
-
}
|
|
272
|
-
var nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised);
|
|
257
|
+
var nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
273
258
|
return PluginState.eq(nextState, this) ? this : nextState;
|
|
274
259
|
}
|
|
275
260
|
}], [{
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.findPointers = exports.createTelepointers =
|
|
7
|
+
exports.findPointers = exports.createTelepointers = void 0;
|
|
8
8
|
exports.getAvatarColor = getAvatarColor;
|
|
9
9
|
exports.scrollToCollabCursor = exports.replaceDocument = exports.originalTransactionHasMeta = exports.isReplaceStep = exports.isOrganicChange = exports.hasExistingNudge = exports.getPositionOfTelepointer = void 0;
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -17,12 +17,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
17
17
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
18
18
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
19
19
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
|
-
var _findPointers = exports._findPointers = function _findPointers(id, decorations) {
|
|
22
|
-
return decorations.find().reduce(function (arr, deco) {
|
|
23
|
-
return deco.spec.pointer.sessionId === id ? arr.concat(deco) : arr;
|
|
24
|
-
}, []);
|
|
25
|
-
};
|
|
26
20
|
var findPointers = exports.findPointers = function findPointers(id, decorations) {
|
|
27
21
|
return decorations.find().reduce(function (arr, deco) {
|
|
28
22
|
return deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr;
|
|
@@ -69,29 +63,28 @@ var createTelepointers = exports.createTelepointers = function createTelepointer
|
|
|
69
63
|
cursor.setAttribute('data-initial', initial);
|
|
70
64
|
cursor.setAttribute('aria-label', "".concat(fullName, " cursor position"));
|
|
71
65
|
cursor.setAttribute('role', 'button');
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
var fullNameEl = document.createElement('span');
|
|
81
|
-
fullNameEl.textContent = fullName;
|
|
82
|
-
fullNameEl.className = 'telepointer-fullname';
|
|
83
|
-
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
84
|
-
fullNameEl.style.color = avatarColor.textColor;
|
|
85
|
-
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
86
|
-
cursor.appendChild(fullNameEl);
|
|
87
|
-
var initialEl = document.createElement('span');
|
|
88
|
-
initialEl.textContent = initial;
|
|
89
|
-
initialEl.className = 'telepointer-initial';
|
|
90
|
-
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
91
|
-
initialEl.style.color = avatarColor.textColor;
|
|
92
|
-
initialEl.setAttribute('aria-hidden', 'true');
|
|
93
|
-
cursor.appendChild(initialEl);
|
|
66
|
+
cursor.setAttribute(_collab.TELEPOINTER_DATA_SESSION_ID_ATTR, sessionId);
|
|
67
|
+
|
|
68
|
+
// If there is an ongoing expand animation, we'll keep the telepointer expanded
|
|
69
|
+
// until the keyframe animation is complete. Please note that this will restart the anim timer
|
|
70
|
+
// from 0 everytime it's re-added.
|
|
71
|
+
if (isNudged) {
|
|
72
|
+
cursor.classList.add(_collab.TELEPOINTER_PULSE_DURING_TR_CLASS);
|
|
94
73
|
}
|
|
74
|
+
var fullNameEl = document.createElement('span');
|
|
75
|
+
fullNameEl.textContent = fullName;
|
|
76
|
+
fullNameEl.className = 'telepointer-fullname';
|
|
77
|
+
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
78
|
+
fullNameEl.style.color = avatarColor.textColor;
|
|
79
|
+
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
80
|
+
cursor.appendChild(fullNameEl);
|
|
81
|
+
var initialEl = document.createElement('span');
|
|
82
|
+
initialEl.textContent = initial;
|
|
83
|
+
initialEl.className = 'telepointer-initial';
|
|
84
|
+
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
85
|
+
initialEl.style.color = avatarColor.textColor;
|
|
86
|
+
initialEl.setAttribute('aria-hidden', 'true');
|
|
87
|
+
cursor.appendChild(initialEl);
|
|
95
88
|
return decorations.concat(_view.Decoration.widget(to, spaceJoinerAfter, {
|
|
96
89
|
pointer: {
|
|
97
90
|
sessionId: sessionId,
|
|
@@ -3,10 +3,9 @@ import { browser } from '@atlaskit/editor-common/browser';
|
|
|
3
3
|
import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURING_TR_CLASS } from '@atlaskit/editor-common/collab';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { Participants } from '../participants';
|
|
9
|
-
import { createTelepointers,
|
|
8
|
+
import { createTelepointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Returns position where it's possible to place a decoration.
|
|
@@ -85,12 +84,7 @@ export class PluginState {
|
|
|
85
84
|
|
|
86
85
|
// Remove telepointers for users that left
|
|
87
86
|
left.forEach(i => {
|
|
88
|
-
|
|
89
|
-
if (fg('confluence_team_presence_scroll_to_pointer')) {
|
|
90
|
-
pointers = findPointers(this.getPresenceId(i.sessionId), this.decorationSet);
|
|
91
|
-
} else {
|
|
92
|
-
pointers = _findPointers(i.sessionId, this.decorationSet);
|
|
93
|
-
}
|
|
87
|
+
const pointers = findPointers(this.getPresenceId(i.sessionId), this.decorationSet);
|
|
94
88
|
if (pointers) {
|
|
95
89
|
remove = remove.concat(pointers);
|
|
96
90
|
}
|
|
@@ -101,12 +95,7 @@ export class PluginState {
|
|
|
101
95
|
sessionId
|
|
102
96
|
} = telepointerData;
|
|
103
97
|
if (participants.get(sessionId) && sessionId !== sid) {
|
|
104
|
-
|
|
105
|
-
if (fg('confluence_team_presence_scroll_to_pointer')) {
|
|
106
|
-
oldPointers = findPointers(this.getPresenceId(sessionId), this.decorationSet);
|
|
107
|
-
} else {
|
|
108
|
-
oldPointers = _findPointers(sessionId, this.decorationSet);
|
|
109
|
-
}
|
|
98
|
+
const oldPointers = findPointers(this.getPresenceId(sessionId), this.decorationSet);
|
|
110
99
|
if (oldPointers) {
|
|
111
100
|
remove = remove.concat(oldPointers);
|
|
112
101
|
}
|
|
@@ -130,7 +119,7 @@ export class PluginState {
|
|
|
130
119
|
} catch (err) {
|
|
131
120
|
this.onError(err);
|
|
132
121
|
}
|
|
133
|
-
add = add.concat(createTelepointers(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId),
|
|
122
|
+
add = add.concat(createTelepointers(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId), hasExistingNudge(sessionId, this.nudgeAnimations)));
|
|
134
123
|
}
|
|
135
124
|
}
|
|
136
125
|
if (tr.docChanged) {
|
|
@@ -157,7 +146,7 @@ export class PluginState {
|
|
|
157
146
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
147
|
} = step;
|
|
159
148
|
const pos = getValidPos(tr, size ? Math.min(from + size, tr.doc.nodeSize - 3) : Math.max(from, 1));
|
|
160
|
-
add = add.concat(createTelepointers(pos, pos, sessionId, false, this.getInitial(sessionId), presenceId, this.getFullName(sessionId),
|
|
149
|
+
add = add.concat(createTelepointers(pos, pos, sessionId, false, this.getInitial(sessionId), presenceId, this.getFullName(sessionId), hasExistingNudge(sessionId, this.nudgeAnimations)));
|
|
161
150
|
}
|
|
162
151
|
}
|
|
163
152
|
}
|
|
@@ -214,7 +203,7 @@ export class PluginState {
|
|
|
214
203
|
}
|
|
215
204
|
}
|
|
216
205
|
});
|
|
217
|
-
if (nudgeTelepointerData
|
|
206
|
+
if (nudgeTelepointerData) {
|
|
218
207
|
const nudgeSessionId = nudgeTelepointerData === null || nudgeTelepointerData === void 0 ? void 0 : nudgeTelepointerData.sessionId;
|
|
219
208
|
|
|
220
209
|
// Ignored via go/ees005
|
|
@@ -251,11 +240,7 @@ export class PluginState {
|
|
|
251
240
|
}
|
|
252
241
|
}
|
|
253
242
|
}
|
|
254
|
-
|
|
255
|
-
const nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
256
|
-
return PluginState.eq(nextState, this) ? this : nextState;
|
|
257
|
-
}
|
|
258
|
-
const nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised);
|
|
243
|
+
const nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
259
244
|
return PluginState.eq(nextState, this) ? this : nextState;
|
|
260
245
|
}
|
|
261
246
|
static eq(a, b) {
|
|
@@ -7,8 +7,6 @@ import { Transaction, Selection, TextSelection } from '@atlaskit/editor-prosemir
|
|
|
7
7
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import { getParticipantColor } from '@atlaskit/editor-shared-styles';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
-
export const _findPointers = (id, decorations) => decorations.find().reduce((arr, deco) => deco.spec.pointer.sessionId === id ? arr.concat(deco) : arr, []);
|
|
12
10
|
export const findPointers = (id, decorations) => decorations.find().reduce((arr, deco) => deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr, []);
|
|
13
11
|
function style(options) {
|
|
14
12
|
const color = options && options.color || 'black';
|
|
@@ -51,29 +49,28 @@ export const createTelepointers = (from, to, sessionId, isSelection, initial, pr
|
|
|
51
49
|
cursor.setAttribute('data-initial', initial);
|
|
52
50
|
cursor.setAttribute('aria-label', `${fullName} cursor position`);
|
|
53
51
|
cursor.setAttribute('role', 'button');
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
const fullNameEl = document.createElement('span');
|
|
63
|
-
fullNameEl.textContent = fullName;
|
|
64
|
-
fullNameEl.className = 'telepointer-fullname';
|
|
65
|
-
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
66
|
-
fullNameEl.style.color = avatarColor.textColor;
|
|
67
|
-
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
68
|
-
cursor.appendChild(fullNameEl);
|
|
69
|
-
const initialEl = document.createElement('span');
|
|
70
|
-
initialEl.textContent = initial;
|
|
71
|
-
initialEl.className = 'telepointer-initial';
|
|
72
|
-
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
73
|
-
initialEl.style.color = avatarColor.textColor;
|
|
74
|
-
initialEl.setAttribute('aria-hidden', 'true');
|
|
75
|
-
cursor.appendChild(initialEl);
|
|
52
|
+
cursor.setAttribute(TELEPOINTER_DATA_SESSION_ID_ATTR, sessionId);
|
|
53
|
+
|
|
54
|
+
// If there is an ongoing expand animation, we'll keep the telepointer expanded
|
|
55
|
+
// until the keyframe animation is complete. Please note that this will restart the anim timer
|
|
56
|
+
// from 0 everytime it's re-added.
|
|
57
|
+
if (isNudged) {
|
|
58
|
+
cursor.classList.add(TELEPOINTER_PULSE_DURING_TR_CLASS);
|
|
76
59
|
}
|
|
60
|
+
const fullNameEl = document.createElement('span');
|
|
61
|
+
fullNameEl.textContent = fullName;
|
|
62
|
+
fullNameEl.className = 'telepointer-fullname';
|
|
63
|
+
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
64
|
+
fullNameEl.style.color = avatarColor.textColor;
|
|
65
|
+
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
66
|
+
cursor.appendChild(fullNameEl);
|
|
67
|
+
const initialEl = document.createElement('span');
|
|
68
|
+
initialEl.textContent = initial;
|
|
69
|
+
initialEl.className = 'telepointer-initial';
|
|
70
|
+
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
71
|
+
initialEl.style.color = avatarColor.textColor;
|
|
72
|
+
initialEl.setAttribute('aria-hidden', 'true');
|
|
73
|
+
cursor.appendChild(initialEl);
|
|
77
74
|
return decorations.concat(Decoration.widget(to, spaceJoinerAfter, {
|
|
78
75
|
pointer: {
|
|
79
76
|
sessionId,
|
|
@@ -5,10 +5,9 @@ import { browser } from '@atlaskit/editor-common/browser';
|
|
|
5
5
|
import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURING_TR_CLASS } from '@atlaskit/editor-common/collab';
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
9
|
import { Participants } from '../participants';
|
|
11
|
-
import { createTelepointers,
|
|
10
|
+
import { createTelepointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Returns position where it's possible to place a decoration.
|
|
@@ -108,12 +107,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
108
107
|
|
|
109
108
|
// Remove telepointers for users that left
|
|
110
109
|
left.forEach(function (i) {
|
|
111
|
-
var pointers;
|
|
112
|
-
if (fg('confluence_team_presence_scroll_to_pointer')) {
|
|
113
|
-
pointers = findPointers(_this.getPresenceId(i.sessionId), _this.decorationSet);
|
|
114
|
-
} else {
|
|
115
|
-
pointers = _findPointers(i.sessionId, _this.decorationSet);
|
|
116
|
-
}
|
|
110
|
+
var pointers = findPointers(_this.getPresenceId(i.sessionId), _this.decorationSet);
|
|
117
111
|
if (pointers) {
|
|
118
112
|
remove = remove.concat(pointers);
|
|
119
113
|
}
|
|
@@ -122,12 +116,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
122
116
|
if (telepointerData) {
|
|
123
117
|
var sessionId = telepointerData.sessionId;
|
|
124
118
|
if (participants.get(sessionId) && sessionId !== sid) {
|
|
125
|
-
var oldPointers;
|
|
126
|
-
if (fg('confluence_team_presence_scroll_to_pointer')) {
|
|
127
|
-
oldPointers = findPointers(this.getPresenceId(sessionId), this.decorationSet);
|
|
128
|
-
} else {
|
|
129
|
-
oldPointers = _findPointers(sessionId, this.decorationSet);
|
|
130
|
-
}
|
|
119
|
+
var oldPointers = findPointers(this.getPresenceId(sessionId), this.decorationSet);
|
|
131
120
|
if (oldPointers) {
|
|
132
121
|
remove = remove.concat(oldPointers);
|
|
133
122
|
}
|
|
@@ -151,7 +140,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
151
140
|
} catch (err) {
|
|
152
141
|
this.onError(err);
|
|
153
142
|
}
|
|
154
|
-
add = add.concat(createTelepointers(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId),
|
|
143
|
+
add = add.concat(createTelepointers(from, to, sessionId, isSelection, this.getInitial(sessionId), this.getPresenceId(sessionId), this.getFullName(sessionId), hasExistingNudge(sessionId, this.nudgeAnimations)));
|
|
155
144
|
}
|
|
156
145
|
}
|
|
157
146
|
if (tr.docChanged) {
|
|
@@ -170,7 +159,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
170
159
|
size = _ref.slice.content.size,
|
|
171
160
|
_from = _ref.from;
|
|
172
161
|
var pos = getValidPos(tr, size ? Math.min(_from + size, tr.doc.nodeSize - 3) : Math.max(_from, 1));
|
|
173
|
-
add = add.concat(createTelepointers(pos, pos, _sessionId, false, _this.getInitial(_sessionId), presenceId, _this.getFullName(_sessionId),
|
|
162
|
+
add = add.concat(createTelepointers(pos, pos, _sessionId, false, _this.getInitial(_sessionId), presenceId, _this.getFullName(_sessionId), hasExistingNudge(_sessionId, _this.nudgeAnimations)));
|
|
174
163
|
}
|
|
175
164
|
}
|
|
176
165
|
}
|
|
@@ -224,7 +213,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
224
213
|
}
|
|
225
214
|
}
|
|
226
215
|
});
|
|
227
|
-
if (nudgeTelepointerData
|
|
216
|
+
if (nudgeTelepointerData) {
|
|
228
217
|
var nudgeSessionId = nudgeTelepointerData === null || nudgeTelepointerData === void 0 ? void 0 : nudgeTelepointerData.sessionId;
|
|
229
218
|
|
|
230
219
|
// Ignored via go/ees005
|
|
@@ -259,11 +248,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
259
248
|
}
|
|
260
249
|
}
|
|
261
250
|
}
|
|
262
|
-
|
|
263
|
-
var _nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
264
|
-
return PluginState.eq(_nextState, this) ? this : _nextState;
|
|
265
|
-
}
|
|
266
|
-
var nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised);
|
|
251
|
+
var nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised, this.onError, this.nudgeAnimations);
|
|
267
252
|
return PluginState.eq(nextState, this) ? this : nextState;
|
|
268
253
|
}
|
|
269
254
|
}], [{
|
|
@@ -8,12 +8,6 @@ import { Transaction, Selection, TextSelection } from '@atlaskit/editor-prosemir
|
|
|
8
8
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
9
9
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { getParticipantColor } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
export var _findPointers = function _findPointers(id, decorations) {
|
|
13
|
-
return decorations.find().reduce(function (arr, deco) {
|
|
14
|
-
return deco.spec.pointer.sessionId === id ? arr.concat(deco) : arr;
|
|
15
|
-
}, []);
|
|
16
|
-
};
|
|
17
11
|
export var findPointers = function findPointers(id, decorations) {
|
|
18
12
|
return decorations.find().reduce(function (arr, deco) {
|
|
19
13
|
return deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr;
|
|
@@ -60,29 +54,28 @@ export var createTelepointers = function createTelepointers(from, to, sessionId,
|
|
|
60
54
|
cursor.setAttribute('data-initial', initial);
|
|
61
55
|
cursor.setAttribute('aria-label', "".concat(fullName, " cursor position"));
|
|
62
56
|
cursor.setAttribute('role', 'button');
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
var fullNameEl = document.createElement('span');
|
|
72
|
-
fullNameEl.textContent = fullName;
|
|
73
|
-
fullNameEl.className = 'telepointer-fullname';
|
|
74
|
-
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
75
|
-
fullNameEl.style.color = avatarColor.textColor;
|
|
76
|
-
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
77
|
-
cursor.appendChild(fullNameEl);
|
|
78
|
-
var initialEl = document.createElement('span');
|
|
79
|
-
initialEl.textContent = initial;
|
|
80
|
-
initialEl.className = 'telepointer-initial';
|
|
81
|
-
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
82
|
-
initialEl.style.color = avatarColor.textColor;
|
|
83
|
-
initialEl.setAttribute('aria-hidden', 'true');
|
|
84
|
-
cursor.appendChild(initialEl);
|
|
57
|
+
cursor.setAttribute(TELEPOINTER_DATA_SESSION_ID_ATTR, sessionId);
|
|
58
|
+
|
|
59
|
+
// If there is an ongoing expand animation, we'll keep the telepointer expanded
|
|
60
|
+
// until the keyframe animation is complete. Please note that this will restart the anim timer
|
|
61
|
+
// from 0 everytime it's re-added.
|
|
62
|
+
if (isNudged) {
|
|
63
|
+
cursor.classList.add(TELEPOINTER_PULSE_DURING_TR_CLASS);
|
|
85
64
|
}
|
|
65
|
+
var fullNameEl = document.createElement('span');
|
|
66
|
+
fullNameEl.textContent = fullName;
|
|
67
|
+
fullNameEl.className = 'telepointer-fullname';
|
|
68
|
+
fullNameEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
69
|
+
fullNameEl.style.color = avatarColor.textColor;
|
|
70
|
+
fullNameEl.setAttribute('aria-hidden', 'true');
|
|
71
|
+
cursor.appendChild(fullNameEl);
|
|
72
|
+
var initialEl = document.createElement('span');
|
|
73
|
+
initialEl.textContent = initial;
|
|
74
|
+
initialEl.className = 'telepointer-initial';
|
|
75
|
+
initialEl.style.backgroundColor = avatarColor.backgroundColor;
|
|
76
|
+
initialEl.style.color = avatarColor.textColor;
|
|
77
|
+
initialEl.setAttribute('aria-hidden', 'true');
|
|
78
|
+
cursor.appendChild(initialEl);
|
|
86
79
|
return decorations.concat(Decoration.widget(to, spaceJoinerAfter, {
|
|
87
80
|
pointer: {
|
|
88
81
|
sessionId: sessionId,
|
|
@@ -5,7 +5,6 @@ import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
|
5
5
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
6
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
export declare const _findPointers: (id: string, decorations: DecorationSet) => Decoration[];
|
|
9
8
|
export declare const findPointers: (id: string, decorations: DecorationSet) => Decoration[];
|
|
10
9
|
export declare function getAvatarColor(str: string): {
|
|
11
10
|
index: number;
|
|
@@ -5,7 +5,6 @@ import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
|
5
5
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
6
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
export declare const _findPointers: (id: string, decorations: DecorationSet) => Decoration[];
|
|
9
8
|
export declare const findPointers: (id: string, decorations: DecorationSet) => Decoration[];
|
|
10
9
|
export declare function getAvatarColor(str: string): {
|
|
11
10
|
index: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
".": "./src/index.ts"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
33
|
+
"@atlaskit/adf-schema": "^50.2.1",
|
|
34
34
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
35
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
35
|
+
"@atlaskit/editor-json-transformer": "^8.26.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-connectivity": "^3.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/prosemirror-collab": "^0.17.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^11.3.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"memoize-one": "^6.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@atlaskit/editor-common": "^107.
|
|
50
|
+
"@atlaskit/editor-common": "^107.26.0",
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-dom": "^18.2.0"
|
|
53
53
|
},
|
|
@@ -103,9 +103,6 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"platform-feature-flags": {
|
|
106
|
-
"confluence_team_presence_scroll_to_pointer": {
|
|
107
|
-
"type": "boolean"
|
|
108
|
-
},
|
|
109
106
|
"platform_enable_ncs_step_metrics": {
|
|
110
107
|
"type": "boolean"
|
|
111
108
|
}
|