@atlaskit/collab-provider 10.20.5 → 10.21.1
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 +18 -0
- package/dist/cjs/channel.js +1 -1
- package/dist/cjs/document/document-service.js +30 -2
- package/dist/cjs/participants/participants-service.js +222 -159
- package/dist/cjs/provider/index.js +1 -1
- package/dist/cjs/socket-io-provider.js +9 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/channel.js +1 -1
- package/dist/es2019/document/document-service.js +29 -2
- package/dist/es2019/participants/participants-service.js +62 -40
- package/dist/es2019/provider/index.js +1 -1
- package/dist/es2019/socket-io-provider.js +12 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/channel.js +1 -1
- package/dist/esm/document/document-service.js +30 -2
- package/dist/esm/participants/participants-service.js +222 -159
- package/dist/esm/provider/index.js +1 -1
- package/dist/esm/socket-io-provider.js +9 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/document/document-service.d.ts +2 -0
- package/dist/types/participants/participants-helper.d.ts +1 -1
- package/dist/types/participants/participants-service.d.ts +7 -3
- package/dist/types/socket-io-provider.d.ts +1 -1
- package/dist/types/types.d.ts +5 -1
- package/dist/types-ts4.5/document/document-service.d.ts +2 -0
- package/dist/types-ts4.5/participants/participants-helper.d.ts +1 -1
- package/dist/types-ts4.5/participants/participants-service.d.ts +7 -3
- package/dist/types-ts4.5/socket-io-provider.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +5 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 10.21.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#179865](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179865)
|
|
8
|
+
[`33dc1bfc85993`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/33dc1bfc85993) -
|
|
9
|
+
ED-28407 Offline Editing: Add logic that will mark offline steps as regular steps after 6s of
|
|
10
|
+
being online. Added as a fallback incase there's issue with the offline storage plugin and it's
|
|
11
|
+
unable to handle the steps.
|
|
12
|
+
|
|
13
|
+
## 10.21.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#179240](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179240)
|
|
18
|
+
[`a5d25b58c755a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a5d25b58c755a) -
|
|
19
|
+
Support for custom authentication headers
|
|
20
|
+
|
|
3
21
|
## 10.20.5
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/channel.js
CHANGED
|
@@ -636,7 +636,7 @@ var Channel = exports.Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
636
636
|
};
|
|
637
637
|
}();
|
|
638
638
|
}
|
|
639
|
-
this.socket = createSocket("".concat(url, "/session/").concat(documentAri), auth, this.config.productInfo, this.config.isPresenceOnly, this.analyticsHelper);
|
|
639
|
+
this.socket = createSocket("".concat(url, "/session/").concat(documentAri), auth, this.config.productInfo, this.config.isPresenceOnly, this.analyticsHelper, this.config.customExtraHeaders);
|
|
640
640
|
|
|
641
641
|
// Due to https://github.com/socketio/socket.io-client/issues/1473,
|
|
642
642
|
// reconnect no longer fired on the socket.
|
|
@@ -79,6 +79,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
79
79
|
(0, _defineProperty2.default)(this, "catchUpOutofSync", false);
|
|
80
80
|
(0, _defineProperty2.default)(this, "hasRecovered", false);
|
|
81
81
|
(0, _defineProperty2.default)(this, "numberOfStepCommitsSent", 0);
|
|
82
|
+
(0, _defineProperty2.default)(this, "timeoutExceeded", false);
|
|
82
83
|
/**
|
|
83
84
|
* To prevent calling catchup to often, use lodash throttle to reduce the frequency
|
|
84
85
|
* @param reason - optional reason to attach.
|
|
@@ -1001,6 +1002,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
1001
1002
|
*/
|
|
1002
1003
|
function send(tr, _oldState, newState, sendAnalyticsEvent, reason // only used for publish and draft-sync events - when called through getFinalAcknowledgedState
|
|
1003
1004
|
) {
|
|
1005
|
+
var _this3 = this;
|
|
1004
1006
|
var unconfirmedStepsData = (0, _prosemirrorCollab.sendableSteps)(newState);
|
|
1005
1007
|
var version = this.getVersionFromCollabState(newState, 'collab-provider: send');
|
|
1006
1008
|
|
|
@@ -1055,12 +1057,38 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
1055
1057
|
return origin.setMeta('mergeIsLocked', true);
|
|
1056
1058
|
}
|
|
1057
1059
|
});
|
|
1058
|
-
|
|
1060
|
+
}
|
|
1061
|
+
if ((0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
1062
|
+
var containsOfflineSteps = unconfirmedStepsData === null || unconfirmedStepsData === void 0 ? void 0 : unconfirmedStepsData.origins.some(function (tr) {
|
|
1059
1063
|
var _tr$getMeta;
|
|
1060
1064
|
return tr instanceof _state.Transaction ? (_tr$getMeta = tr.getMeta('isOffline')) !== null && _tr$getMeta !== void 0 ? _tr$getMeta : false : false;
|
|
1061
1065
|
});
|
|
1062
|
-
if (
|
|
1066
|
+
if (containsOfflineSteps && !this.timeoutExceeded) {
|
|
1067
|
+
// Only start timer if we're online and don't already have one running
|
|
1068
|
+
if (this.getConnected() && !this.timeout) {
|
|
1069
|
+
this.timeout = setTimeout(function () {
|
|
1070
|
+
// If the timer expires and we're still online, handle the offline steps.
|
|
1071
|
+
// Otherwise, clear the timer so it can restart when we're online again.
|
|
1072
|
+
if (_this3.getConnected()) {
|
|
1073
|
+
_this3.timeoutExceeded = true;
|
|
1074
|
+
var updatedUnconfirmedStepsData = (0, _prosemirrorCollab.sendableSteps)(newState);
|
|
1075
|
+
updatedUnconfirmedStepsData === null || updatedUnconfirmedStepsData === void 0 || updatedUnconfirmedStepsData.origins.forEach(function (origin) {
|
|
1076
|
+
if (origin instanceof _state.Transaction && origin.getMeta('isOffline')) {
|
|
1077
|
+
origin.setMeta('isOffline', false);
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
} else {
|
|
1081
|
+
_this3.timeout = undefined;
|
|
1082
|
+
}
|
|
1083
|
+
}, 6000);
|
|
1084
|
+
}
|
|
1063
1085
|
return;
|
|
1086
|
+
} else if (this.timeoutExceeded) {
|
|
1087
|
+
this.timeoutExceeded = false;
|
|
1088
|
+
if (this.timeout) {
|
|
1089
|
+
clearTimeout(this.timeout);
|
|
1090
|
+
this.timeout = undefined;
|
|
1091
|
+
}
|
|
1064
1092
|
}
|
|
1065
1093
|
}
|
|
1066
1094
|
|