@atlaskit/collab-provider 10.9.2 → 10.9.4
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 +19 -0
- package/dist/cjs/channel.js +1 -1
- package/dist/cjs/document/document-service.js +180 -156
- package/dist/cjs/document/getConflictChanges.js +177 -0
- package/dist/cjs/document/null-document-service.js +1 -1
- package/dist/cjs/errors/ncs-errors.js +1 -1
- package/dist/cjs/provider/commit-step.js +3 -4
- package/dist/cjs/provider/index.js +27 -22
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/channel.js +1 -1
- package/dist/es2019/document/document-service.js +27 -12
- package/dist/es2019/document/getConflictChanges.js +161 -0
- package/dist/es2019/document/null-document-service.js +1 -1
- package/dist/es2019/errors/ncs-errors.js +1 -1
- package/dist/es2019/provider/commit-step.js +3 -4
- package/dist/es2019/provider/index.js +3 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/channel.js +1 -1
- package/dist/esm/document/document-service.js +180 -156
- package/dist/esm/document/getConflictChanges.js +170 -0
- package/dist/esm/document/null-document-service.js +1 -1
- package/dist/esm/errors/ncs-errors.js +1 -1
- package/dist/esm/provider/commit-step.js +3 -4
- package/dist/esm/provider/index.js +27 -22
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/document/document-service.d.ts +5 -4
- package/dist/types/document/getConflictChanges.d.ts +26 -0
- package/dist/types/document/interface-document-service.d.ts +3 -2
- package/dist/types/document/null-document-service.d.ts +2 -1
- package/dist/types/provider/commit-step.d.ts +4 -3
- package/dist/types/provider/index.d.ts +2 -1
- package/dist/types-ts4.5/document/document-service.d.ts +5 -4
- package/dist/types-ts4.5/document/getConflictChanges.d.ts +26 -0
- package/dist/types-ts4.5/document/interface-document-service.d.ts +3 -2
- package/dist/types-ts4.5/document/null-document-service.d.ts +2 -1
- package/dist/types-ts4.5/provider/commit-step.d.ts +4 -3
- package/dist/types-ts4.5/provider/index.d.ts +2 -1
- package/package.json +5 -4
|
@@ -270,27 +270,32 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
270
270
|
* Used when returning the document to Confluence on publish.
|
|
271
271
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
272
272
|
*/
|
|
273
|
-
_defineProperty(_this, "getFinalAcknowledgedState", /*#__PURE__*/
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
273
|
+
_defineProperty(_this, "getFinalAcknowledgedState", /*#__PURE__*/function () {
|
|
274
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(reason) {
|
|
275
|
+
var _this$analyticsHelper5;
|
|
276
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
277
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
278
|
+
case 0:
|
|
279
|
+
_context3.prev = 0;
|
|
280
|
+
_context3.next = 3;
|
|
281
|
+
return _this.documentService.getFinalAcknowledgedState(reason);
|
|
282
|
+
case 3:
|
|
283
|
+
return _context3.abrupt("return", _context3.sent);
|
|
284
|
+
case 6:
|
|
285
|
+
_context3.prev = 6;
|
|
286
|
+
_context3.t0 = _context3["catch"](0);
|
|
287
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(_context3.t0, 'Error while returning ADF version of the final draft document');
|
|
288
|
+
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _context3.t0);
|
|
289
|
+
case 10:
|
|
290
|
+
case "end":
|
|
291
|
+
return _context3.stop();
|
|
292
|
+
}
|
|
293
|
+
}, _callee3, null, [[0, 6]]);
|
|
294
|
+
}));
|
|
295
|
+
return function (_x2) {
|
|
296
|
+
return _ref7.apply(this, arguments);
|
|
297
|
+
};
|
|
298
|
+
}());
|
|
294
299
|
_defineProperty(_this, "getUnconfirmedSteps", function () {
|
|
295
300
|
return _this.documentService.getUnconfirmedSteps();
|
|
296
301
|
});
|
|
@@ -347,7 +352,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
347
352
|
}
|
|
348
353
|
_this.sendStepsTimer = setInterval(function () {
|
|
349
354
|
logger('Intervally sendStepsFromCurrentState');
|
|
350
|
-
_this.documentService.sendStepsFromCurrentState(true);
|
|
355
|
+
_this.documentService.sendStepsFromCurrentState(true, undefined);
|
|
351
356
|
}, 5000);
|
|
352
357
|
return _this;
|
|
353
358
|
}
|
|
@@ -10,6 +10,7 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
|
10
10
|
import type { InternalError } from '../errors/internal-errors';
|
|
11
11
|
import type { ParticipantsService } from '../participants/participants-service';
|
|
12
12
|
import { type DocumentServiceInterface } from './interface-document-service';
|
|
13
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
13
14
|
export declare class DocumentService implements DocumentServiceInterface {
|
|
14
15
|
private participantsService;
|
|
15
16
|
private analyticsHelper;
|
|
@@ -111,7 +112,7 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
111
112
|
obfuscatedDoc: string | import("@atlaskit/adf-utils/types").ADFEntity | null | undefined;
|
|
112
113
|
};
|
|
113
114
|
onRestore: ({ doc, version, metadata, targetClientId }: CollabInitPayload) => Promise<void>;
|
|
114
|
-
getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
|
|
115
|
+
getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
|
|
115
116
|
getIsNamespaceLocked(): boolean;
|
|
116
117
|
updateDocument: ({ doc, version, metadata, reserveCursor }: CollabInitPayload) => void;
|
|
117
118
|
private updateDocumentAnalytics;
|
|
@@ -120,7 +121,7 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
120
121
|
* Commit the unconfirmed local steps to the back-end service
|
|
121
122
|
* @throws {Error} Couldn't sync the steps after retrying 30 times
|
|
122
123
|
*/
|
|
123
|
-
commitUnconfirmedSteps: () => Promise<void>;
|
|
124
|
+
commitUnconfirmedSteps: (reason: GetResolvedEditorStateReason) => Promise<void>;
|
|
124
125
|
setup({ getState, onSyncUpError, clientId, }: {
|
|
125
126
|
getState: () => EditorState;
|
|
126
127
|
onSyncUpError?: SyncUpErrorFunction;
|
|
@@ -133,11 +134,11 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
133
134
|
* The getState function will return the current EditorState
|
|
134
135
|
* from the EditorView.
|
|
135
136
|
*/
|
|
136
|
-
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean,
|
|
137
|
+
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
137
138
|
onStepRejectedError: () => void;
|
|
138
139
|
/**
|
|
139
140
|
* Send steps from transaction to other participants
|
|
140
141
|
* It needs the superfluous arguments because we keep the interface of the send API the same as the Synchrony plugin
|
|
141
142
|
*/
|
|
142
|
-
send(tr: Transaction | null, _oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean,
|
|
143
|
+
send(tr: Transaction | null, _oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
143
144
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { ConflictChanges } from '@atlaskit/editor-common/collab';
|
|
4
|
+
interface Options {
|
|
5
|
+
localSteps: readonly {
|
|
6
|
+
inverted: ProseMirrorStep;
|
|
7
|
+
step: ProseMirrorStep;
|
|
8
|
+
}[];
|
|
9
|
+
remoteSteps: ProseMirrorStep[];
|
|
10
|
+
tr: Transaction;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Gets the conflicts between the local document and the remote document based on steps.
|
|
14
|
+
* It assumes the steps will be rebased using the `prosemirror-collab` algorithm synchronously after this
|
|
15
|
+
* Therefore the `tr` property is based on the document before rebasing.
|
|
16
|
+
*
|
|
17
|
+
* In the future we could possibly use `prosemirror-recreate-steps` (or similar approach)
|
|
18
|
+
* and tweak this to work for arbitrary diffs between offline and remote documents.
|
|
19
|
+
*
|
|
20
|
+
* @param localSteps Local steps applied between now and the server steps
|
|
21
|
+
* @param remoteSteps Steps retrieved from the server
|
|
22
|
+
* @param tr Transaction of the current document (expected to happen with local steps applied, before remote are applied)
|
|
23
|
+
* @returns All the conflicts (inserted + deleted) which can be applied to the current document
|
|
24
|
+
*/
|
|
25
|
+
export declare function getConflictChanges({ localSteps, remoteSteps, tr }: Options): ConflictChanges;
|
|
26
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import type { ResolvedEditorState, SyncUpErrorFunction } from '@atlaskit/editor-
|
|
|
2
2
|
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { InternalError } from '../errors/internal-errors';
|
|
5
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
5
6
|
export interface DocumentServiceInterface {
|
|
6
7
|
setup(params: {
|
|
7
8
|
getState: () => EditorState;
|
|
@@ -25,10 +26,10 @@ export interface DocumentServiceInterface {
|
|
|
25
26
|
}): void;
|
|
26
27
|
onStepRejectedError(): void;
|
|
27
28
|
send(tr: Transaction | null, oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean): void;
|
|
28
|
-
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean,
|
|
29
|
+
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
29
30
|
throttledCatchupv2(): void;
|
|
30
31
|
getCurrentState(): Promise<ResolvedEditorState>;
|
|
31
|
-
getFinalAcknowledgedState(): Promise<ResolvedEditorState>;
|
|
32
|
+
getFinalAcknowledgedState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState>;
|
|
32
33
|
getIsNamespaceLocked(): boolean;
|
|
33
34
|
getUnconfirmedSteps(): readonly ProseMirrorStep[] | undefined;
|
|
34
35
|
getCurrentPmVersion(): number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
2
2
|
import type { DocumentServiceInterface } from './interface-document-service';
|
|
3
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
3
4
|
export declare class NullDocumentService implements DocumentServiceInterface {
|
|
4
5
|
setup: () => this;
|
|
5
6
|
updateDocument(): void;
|
|
@@ -10,7 +11,7 @@ export declare class NullDocumentService implements DocumentServiceInterface {
|
|
|
10
11
|
sendStepsFromCurrentState(): void;
|
|
11
12
|
throttledCatchupv2(): void;
|
|
12
13
|
getCurrentState(): Promise<ResolvedEditorState>;
|
|
13
|
-
getFinalAcknowledgedState(): Promise<ResolvedEditorState>;
|
|
14
|
+
getFinalAcknowledgedState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState>;
|
|
14
15
|
getIsNamespaceLocked(): boolean;
|
|
15
16
|
getUnconfirmedSteps(): undefined;
|
|
16
17
|
getCurrentPmVersion(): number;
|
|
@@ -3,9 +3,10 @@ import type { CollabCommitStatusEventPayload, CollabEvents } from '@atlaskit/edi
|
|
|
3
3
|
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
4
|
import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
5
5
|
import type { InternalError } from '../errors/internal-errors';
|
|
6
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
6
7
|
export declare let readyToCommit: boolean;
|
|
7
|
-
export declare const RESET_READYTOCOMMIT_INTERVAL_MS =
|
|
8
|
-
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode,
|
|
8
|
+
export declare const RESET_READYTOCOMMIT_INTERVAL_MS = 5000;
|
|
9
|
+
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode, reason, }: {
|
|
9
10
|
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void;
|
|
10
11
|
steps: readonly ProseMirrorStep[];
|
|
11
12
|
version: number;
|
|
@@ -18,5 +19,5 @@ export declare const commitStepQueue: ({ broadcast, steps, version, userId, clie
|
|
|
18
19
|
__livePage: boolean;
|
|
19
20
|
hasRecovered: boolean;
|
|
20
21
|
collabMode: string;
|
|
21
|
-
|
|
22
|
+
reason?: GetResolvedEditorStateReason | undefined;
|
|
22
23
|
}) => void;
|
|
@@ -5,6 +5,7 @@ import type { Config } from '../types';
|
|
|
5
5
|
import type { CollabEditProvider, CollabEvents, CollabTelepointerPayload, ResolvedEditorState, Metadata, SyncUpErrorFunction, CollabPresenceActivityChangePayload, CollabActivityAIProviderChangedPayload, PresenceActivity } from '@atlaskit/editor-common/collab';
|
|
6
6
|
import { Api } from '../api/api';
|
|
7
7
|
import { NullApi } from '../api/null-api';
|
|
8
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
8
9
|
export declare const MAX_STEP_REJECTED_ERROR = 15;
|
|
9
10
|
export declare const MAX_STEP_REJECTED_ERROR_AGGRESSIVE = 2;
|
|
10
11
|
type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
|
|
@@ -156,7 +157,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
156
157
|
* Used when returning the document to Confluence on publish.
|
|
157
158
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
158
159
|
*/
|
|
159
|
-
getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
|
|
160
|
+
getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
|
|
160
161
|
/**
|
|
161
162
|
* Returns the namespace locking status via true/false
|
|
162
163
|
*/
|
|
@@ -10,6 +10,7 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
|
10
10
|
import type { InternalError } from '../errors/internal-errors';
|
|
11
11
|
import type { ParticipantsService } from '../participants/participants-service';
|
|
12
12
|
import { type DocumentServiceInterface } from './interface-document-service';
|
|
13
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
13
14
|
export declare class DocumentService implements DocumentServiceInterface {
|
|
14
15
|
private participantsService;
|
|
15
16
|
private analyticsHelper;
|
|
@@ -111,7 +112,7 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
111
112
|
obfuscatedDoc: string | import("@atlaskit/adf-utils/types").ADFEntity | null | undefined;
|
|
112
113
|
};
|
|
113
114
|
onRestore: ({ doc, version, metadata, targetClientId }: CollabInitPayload) => Promise<void>;
|
|
114
|
-
getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
|
|
115
|
+
getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
|
|
115
116
|
getIsNamespaceLocked(): boolean;
|
|
116
117
|
updateDocument: ({ doc, version, metadata, reserveCursor }: CollabInitPayload) => void;
|
|
117
118
|
private updateDocumentAnalytics;
|
|
@@ -120,7 +121,7 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
120
121
|
* Commit the unconfirmed local steps to the back-end service
|
|
121
122
|
* @throws {Error} Couldn't sync the steps after retrying 30 times
|
|
122
123
|
*/
|
|
123
|
-
commitUnconfirmedSteps: () => Promise<void>;
|
|
124
|
+
commitUnconfirmedSteps: (reason: GetResolvedEditorStateReason) => Promise<void>;
|
|
124
125
|
setup({ getState, onSyncUpError, clientId, }: {
|
|
125
126
|
getState: () => EditorState;
|
|
126
127
|
onSyncUpError?: SyncUpErrorFunction;
|
|
@@ -133,11 +134,11 @@ export declare class DocumentService implements DocumentServiceInterface {
|
|
|
133
134
|
* The getState function will return the current EditorState
|
|
134
135
|
* from the EditorView.
|
|
135
136
|
*/
|
|
136
|
-
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean,
|
|
137
|
+
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
137
138
|
onStepRejectedError: () => void;
|
|
138
139
|
/**
|
|
139
140
|
* Send steps from transaction to other participants
|
|
140
141
|
* It needs the superfluous arguments because we keep the interface of the send API the same as the Synchrony plugin
|
|
141
142
|
*/
|
|
142
|
-
send(tr: Transaction | null, _oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean,
|
|
143
|
+
send(tr: Transaction | null, _oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
143
144
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { ConflictChanges } from '@atlaskit/editor-common/collab';
|
|
4
|
+
interface Options {
|
|
5
|
+
localSteps: readonly {
|
|
6
|
+
inverted: ProseMirrorStep;
|
|
7
|
+
step: ProseMirrorStep;
|
|
8
|
+
}[];
|
|
9
|
+
remoteSteps: ProseMirrorStep[];
|
|
10
|
+
tr: Transaction;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Gets the conflicts between the local document and the remote document based on steps.
|
|
14
|
+
* It assumes the steps will be rebased using the `prosemirror-collab` algorithm synchronously after this
|
|
15
|
+
* Therefore the `tr` property is based on the document before rebasing.
|
|
16
|
+
*
|
|
17
|
+
* In the future we could possibly use `prosemirror-recreate-steps` (or similar approach)
|
|
18
|
+
* and tweak this to work for arbitrary diffs between offline and remote documents.
|
|
19
|
+
*
|
|
20
|
+
* @param localSteps Local steps applied between now and the server steps
|
|
21
|
+
* @param remoteSteps Steps retrieved from the server
|
|
22
|
+
* @param tr Transaction of the current document (expected to happen with local steps applied, before remote are applied)
|
|
23
|
+
* @returns All the conflicts (inserted + deleted) which can be applied to the current document
|
|
24
|
+
*/
|
|
25
|
+
export declare function getConflictChanges({ localSteps, remoteSteps, tr }: Options): ConflictChanges;
|
|
26
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import type { ResolvedEditorState, SyncUpErrorFunction } from '@atlaskit/editor-
|
|
|
2
2
|
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { InternalError } from '../errors/internal-errors';
|
|
5
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
5
6
|
export interface DocumentServiceInterface {
|
|
6
7
|
setup(params: {
|
|
7
8
|
getState: () => EditorState;
|
|
@@ -25,10 +26,10 @@ export interface DocumentServiceInterface {
|
|
|
25
26
|
}): void;
|
|
26
27
|
onStepRejectedError(): void;
|
|
27
28
|
send(tr: Transaction | null, oldState: EditorState | null, newState: EditorState, sendAnalyticsEvent?: boolean): void;
|
|
28
|
-
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean,
|
|
29
|
+
sendStepsFromCurrentState(sendAnalyticsEvent?: boolean, reason?: GetResolvedEditorStateReason): void;
|
|
29
30
|
throttledCatchupv2(): void;
|
|
30
31
|
getCurrentState(): Promise<ResolvedEditorState>;
|
|
31
|
-
getFinalAcknowledgedState(): Promise<ResolvedEditorState>;
|
|
32
|
+
getFinalAcknowledgedState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState>;
|
|
32
33
|
getIsNamespaceLocked(): boolean;
|
|
33
34
|
getUnconfirmedSteps(): readonly ProseMirrorStep[] | undefined;
|
|
34
35
|
getCurrentPmVersion(): number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
2
2
|
import type { DocumentServiceInterface } from './interface-document-service';
|
|
3
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
3
4
|
export declare class NullDocumentService implements DocumentServiceInterface {
|
|
4
5
|
setup: () => this;
|
|
5
6
|
updateDocument(): void;
|
|
@@ -10,7 +11,7 @@ export declare class NullDocumentService implements DocumentServiceInterface {
|
|
|
10
11
|
sendStepsFromCurrentState(): void;
|
|
11
12
|
throttledCatchupv2(): void;
|
|
12
13
|
getCurrentState(): Promise<ResolvedEditorState>;
|
|
13
|
-
getFinalAcknowledgedState(): Promise<ResolvedEditorState>;
|
|
14
|
+
getFinalAcknowledgedState(reason: GetResolvedEditorStateReason): Promise<ResolvedEditorState>;
|
|
14
15
|
getIsNamespaceLocked(): boolean;
|
|
15
16
|
getUnconfirmedSteps(): undefined;
|
|
16
17
|
getCurrentPmVersion(): number;
|
|
@@ -3,9 +3,10 @@ import type { CollabCommitStatusEventPayload, CollabEvents } from '@atlaskit/edi
|
|
|
3
3
|
import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
4
|
import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
5
5
|
import type { InternalError } from '../errors/internal-errors';
|
|
6
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
6
7
|
export declare let readyToCommit: boolean;
|
|
7
|
-
export declare const RESET_READYTOCOMMIT_INTERVAL_MS =
|
|
8
|
-
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode,
|
|
8
|
+
export declare const RESET_READYTOCOMMIT_INTERVAL_MS = 5000;
|
|
9
|
+
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode, reason, }: {
|
|
9
10
|
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void;
|
|
10
11
|
steps: readonly ProseMirrorStep[];
|
|
11
12
|
version: number;
|
|
@@ -18,5 +19,5 @@ export declare const commitStepQueue: ({ broadcast, steps, version, userId, clie
|
|
|
18
19
|
__livePage: boolean;
|
|
19
20
|
hasRecovered: boolean;
|
|
20
21
|
collabMode: string;
|
|
21
|
-
|
|
22
|
+
reason?: GetResolvedEditorStateReason | undefined;
|
|
22
23
|
}) => void;
|
|
@@ -5,6 +5,7 @@ import type { Config } from '../types';
|
|
|
5
5
|
import type { CollabEditProvider, CollabEvents, CollabTelepointerPayload, ResolvedEditorState, Metadata, SyncUpErrorFunction, CollabPresenceActivityChangePayload, CollabActivityAIProviderChangedPayload, PresenceActivity } from '@atlaskit/editor-common/collab';
|
|
6
6
|
import { Api } from '../api/api';
|
|
7
7
|
import { NullApi } from '../api/null-api';
|
|
8
|
+
import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
|
|
8
9
|
export declare const MAX_STEP_REJECTED_ERROR = 15;
|
|
9
10
|
export declare const MAX_STEP_REJECTED_ERROR_AGGRESSIVE = 2;
|
|
10
11
|
type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
|
|
@@ -156,7 +157,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
156
157
|
* Used when returning the document to Confluence on publish.
|
|
157
158
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
158
159
|
*/
|
|
159
|
-
getFinalAcknowledgedState: () => Promise<ResolvedEditorState>;
|
|
160
|
+
getFinalAcknowledgedState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState>;
|
|
160
161
|
/**
|
|
161
162
|
* Returns the namespace locking status via true/false
|
|
162
163
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "10.9.
|
|
3
|
+
"version": "10.9.4",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,18 +35,19 @@
|
|
|
35
35
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
36
36
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
37
37
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
38
|
-
"@atlaskit/editor-common": "^102.
|
|
38
|
+
"@atlaskit/editor-common": "^102.5.0",
|
|
39
39
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/feature-gate-js-client": "^4.26.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
43
|
"@atlaskit/prosemirror-collab": "^0.15.0",
|
|
44
|
-
"@atlaskit/react-ufo": "^3.
|
|
44
|
+
"@atlaskit/react-ufo": "^3.4.0",
|
|
45
45
|
"@atlaskit/ufo": "^0.4.0",
|
|
46
|
-
"@atlaskit/util-service-support": "^6.
|
|
46
|
+
"@atlaskit/util-service-support": "^6.3.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"eventemitter2": "^4.1.0",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
|
+
"prosemirror-changeset": "^2.2.1",
|
|
50
51
|
"socket.io-client": "^4.7.5",
|
|
51
52
|
"uuid": "^3.1.0"
|
|
52
53
|
},
|