@atlaskit/collab-provider 18.1.6 → 18.2.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 18.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`967cff1c14097`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/967cff1c14097) -
8
+ Add isolatedDeclarations: true to tsconfig.app.json and tsconfig.dev.json
9
+ - Updated dependencies
10
+
11
+ ## 18.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`efed9a7ddd2cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/efed9a7ddd2cd) -
16
+ Use websocket transport only for socket connections on GCP tenants
17
+
3
18
  ## 18.1.6
4
19
 
5
20
  ### Patch Changes
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
- "target": "es5",
5
4
  "outDir": "../../../../../confluence/tsDist/@atlaskit__collab-provider",
6
5
  "rootDir": "../",
7
6
  "composite": true,
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.isAIProviderID = exports.getSubProduct = exports.getStepsAdfWithObfuscation = exports.getStepUGCFreeDetails = exports.getStepTypes = exports.getStepPositions = exports.getProduct = exports.getObfuscatedSteps = exports.getDocAdfWithObfuscationFromJSON = exports.getDocAdfWithObfuscation = exports.createLogger = void 0;
8
+ exports.isGCPtenant = isGCPtenant;
8
9
  exports.logObfuscatedSteps = logObfuscatedSteps;
9
10
  exports.sleep = sleep;
10
11
  exports.toObfuscatedSteps = toObfuscatedSteps;
@@ -267,6 +268,12 @@ function _logObfuscatedSteps() {
267
268
  function toObfuscatedSteps(_x3) {
268
269
  return _toObfuscatedSteps.apply(this, arguments);
269
270
  }
271
+ /**
272
+ * Copied from confluence/next/packages/graphql/src/utils/gcpDomainUtils.ts
273
+ * Checks if the current domain is a GCP tenant matching the pattern: .*-cdp-{cdp-id}\.jira-dev\.com
274
+ * @param {string | undefined} hostname optional hostname to evaluate
275
+ * @returns {boolean} true if the domain matches the GCP tenant pattern
276
+ */
270
277
  function _toObfuscatedSteps() {
271
278
  _toObfuscatedSteps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(steps) {
272
279
  var _steps;
@@ -287,4 +294,13 @@ function _toObfuscatedSteps() {
287
294
  }, _callee2);
288
295
  }));
289
296
  return _toObfuscatedSteps.apply(this, arguments);
297
+ }
298
+ function isGCPtenant(hostname) {
299
+ if (!hostname) {
300
+ return false;
301
+ }
302
+
303
+ // eslint-disable-next-line require-unicode-regexp
304
+ var gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
305
+ return gcpTenantPattern.test(hostname);
290
306
  }
@@ -35,6 +35,10 @@ var MULTI_COLLAB_MODE = exports.MULTI_COLLAB_MODE = 'collab';
35
35
  * @param sendPresenceJoined Callback to Channel class
36
36
  */
37
37
  var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function () {
38
+ // Initialized in the constructor body; declared here so the parameter
39
+ // can be optional without requiring the type to include `undefined`
40
+ // (avoids TS9025 under `--isolatedDeclarations`).
41
+
38
42
  /**
39
43
  * constructor
40
44
  *
@@ -51,18 +55,8 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
51
55
  * @param fetchAnonymousAsset
52
56
  * @example
53
57
  */
54
- function ParticipantsService(analyticsHelper) {
58
+ function ParticipantsService(analyticsHelper, participantsState, emit, getUser, batchProps, channelBroadcast, sendPresenceJoined, getPresenceData, setUserId, getAIProviderActiveIds, fetchAnonymousAsset) {
55
59
  var _this = this;
56
- var participantsState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _participantsState.ParticipantsState();
57
- var emit = arguments.length > 2 ? arguments[2] : undefined;
58
- var getUser = arguments.length > 3 ? arguments[3] : undefined;
59
- var batchProps = arguments.length > 4 ? arguments[4] : undefined;
60
- var channelBroadcast = arguments.length > 5 ? arguments[5] : undefined;
61
- var sendPresenceJoined = arguments.length > 6 ? arguments[6] : undefined;
62
- var getPresenceData = arguments.length > 7 ? arguments[7] : undefined;
63
- var setUserId = arguments.length > 8 ? arguments[8] : undefined;
64
- var getAIProviderActiveIds = arguments.length > 9 ? arguments[9] : undefined;
65
- var fetchAnonymousAsset = arguments.length > 10 ? arguments[10] : undefined;
66
60
  (0, _classCallCheck2.default)(this, ParticipantsService);
67
61
  (0, _defineProperty2.default)(this, "currentlyPollingFetchUsers", true);
68
62
  (0, _defineProperty2.default)(this, "hasBatchFetchError", false);
@@ -736,7 +730,6 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
736
730
  return _this.participantsState.size() > 1 ? MULTI_COLLAB_MODE : SINGLE_COLLAB_MODE;
737
731
  });
738
732
  this.analyticsHelper = analyticsHelper;
739
- this.participantsState = participantsState;
740
733
  this.emit = emit;
741
734
  this.getUser = getUser;
742
735
  this.batchProps = batchProps;
@@ -746,6 +739,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
746
739
  this.setUserId = setUserId;
747
740
  this.getAIProviderActiveIds = getAIProviderActiveIds;
748
741
  this.fetchAnonymousAsset = fetchAnonymousAsset;
742
+ this.participantsState = participantsState !== null && participantsState !== void 0 ? participantsState : new _participantsState.ParticipantsState();
749
743
  }
750
744
  return (0, _createClass2.default)(ParticipantsService, [{
751
745
  key: "emitTelepointersFromSteps",
@@ -17,7 +17,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
17
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
18
  function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, analyticsHelper, path, documentAri) {
19
19
  var _URL = new URL(url),
20
- pathname = _URL.pathname;
20
+ pathname = _URL.pathname,
21
+ hostname = _URL.hostname;
21
22
  var socketIOOptions = _config.SOCKET_IO_OPTIONS;
22
23
  // Polling first
23
24
  var transports = ['polling', 'websocket'];
@@ -36,6 +37,9 @@ function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, analyticsH
36
37
  if ((0, _expValEquals.expValEquals)('platform_editor_to_use_pmr_for_collab_edit_none_ic', 'isEnabled', true, false)) {
37
38
  usePMR = true;
38
39
  }
40
+ if ((0, _utils.isGCPtenant)(hostname) && (0, _platformFeatureFlags.fg)('collab_edit_via_websocket_only_for_gcp')) {
41
+ transports = ['websocket'];
42
+ }
39
43
  }
40
44
  var extraHeaders = {
41
45
  'x-product': (0, _utils.getProduct)(productInfo),
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "18.1.5";
8
+ var version = exports.version = "0.0.0-development";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -217,4 +217,20 @@ export async function logObfuscatedSteps(oldState, newState) {
217
217
  export async function toObfuscatedSteps(steps) {
218
218
  const _steps = await Promise.resolve(steps.slice().map(s => s.toJSON()));
219
219
  return JSON.stringify(getObfuscatedSteps(_steps));
220
+ }
221
+
222
+ /**
223
+ * Copied from confluence/next/packages/graphql/src/utils/gcpDomainUtils.ts
224
+ * Checks if the current domain is a GCP tenant matching the pattern: .*-cdp-{cdp-id}\.jira-dev\.com
225
+ * @param {string | undefined} hostname optional hostname to evaluate
226
+ * @returns {boolean} true if the domain matches the GCP tenant pattern
227
+ */
228
+ export function isGCPtenant(hostname) {
229
+ if (!hostname) {
230
+ return false;
231
+ }
232
+
233
+ // eslint-disable-next-line require-unicode-regexp
234
+ const gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
235
+ return gcpTenantPattern.test(hostname);
220
236
  }
@@ -22,6 +22,10 @@ export const MULTI_COLLAB_MODE = 'collab';
22
22
  * @param sendPresenceJoined Callback to Channel class
23
23
  */
24
24
  export class ParticipantsService {
25
+ // Initialized in the constructor body; declared here so the parameter
26
+ // can be optional without requiring the type to include `undefined`
27
+ // (avoids TS9025 under `--isolatedDeclarations`).
28
+
25
29
  /**
26
30
  * constructor
27
31
  *
@@ -38,7 +42,7 @@ export class ParticipantsService {
38
42
  * @param fetchAnonymousAsset
39
43
  * @example
40
44
  */
41
- constructor(analyticsHelper, participantsState = new ParticipantsState(), emit, getUser, batchProps, channelBroadcast, sendPresenceJoined, getPresenceData, setUserId, getAIProviderActiveIds, fetchAnonymousAsset) {
45
+ constructor(analyticsHelper, participantsState, emit, getUser, batchProps, channelBroadcast, sendPresenceJoined, getPresenceData, setUserId, getAIProviderActiveIds, fetchAnonymousAsset) {
42
46
  _defineProperty(this, "currentlyPollingFetchUsers", true);
43
47
  _defineProperty(this, "hasBatchFetchError", false);
44
48
  _defineProperty(this, "sendPresenceActivityChanged", () => {
@@ -565,7 +569,6 @@ export class ParticipantsService {
565
569
  return this.participantsState.size() > 1 ? MULTI_COLLAB_MODE : SINGLE_COLLAB_MODE;
566
570
  });
567
571
  this.analyticsHelper = analyticsHelper;
568
- this.participantsState = participantsState;
569
572
  this.emit = emit;
570
573
  this.getUser = getUser;
571
574
  this.batchProps = batchProps;
@@ -575,6 +578,7 @@ export class ParticipantsService {
575
578
  this.setUserId = setUserId;
576
579
  this.getAIProviderActiveIds = getAIProviderActiveIds;
577
580
  this.fetchAnonymousAsset = fetchAnonymousAsset;
581
+ this.participantsState = participantsState !== null && participantsState !== void 0 ? participantsState : new ParticipantsState();
578
582
  }
579
583
  /**
580
584
  * Called on receiving steps, emits each step's telepointer
@@ -2,11 +2,12 @@ import { io } from 'socket.io-client';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
4
  import { Provider } from './provider';
5
- import { getProduct, getSubProduct } from './helpers/utils';
5
+ import { getProduct, getSubProduct, isGCPtenant } from './helpers/utils';
6
6
  import { SOCKET_IO_OPTIONS, SOCKET_IO_OPTIONS_WITH_HIGH_JITTER } from './config';
7
7
  export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, analyticsHelper, path, documentAri) {
8
8
  const {
9
- pathname
9
+ pathname,
10
+ hostname
10
11
  } = new URL(url);
11
12
  let socketIOOptions = SOCKET_IO_OPTIONS;
12
13
  // Polling first
@@ -26,6 +27,9 @@ export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, ana
26
27
  if (expValEquals('platform_editor_to_use_pmr_for_collab_edit_none_ic', 'isEnabled', true, false)) {
27
28
  usePMR = true;
28
29
  }
30
+ if (isGCPtenant(hostname) && fg('collab_edit_via_websocket_only_for_gcp')) {
31
+ transports = ['websocket'];
32
+ }
29
33
  }
30
34
  const extraHeaders = {
31
35
  'x-product': getProduct(productInfo),
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "18.1.5";
2
+ export const version = "0.0.0-development";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -257,6 +257,13 @@ function _logObfuscatedSteps() {
257
257
  export function toObfuscatedSteps(_x3) {
258
258
  return _toObfuscatedSteps.apply(this, arguments);
259
259
  }
260
+
261
+ /**
262
+ * Copied from confluence/next/packages/graphql/src/utils/gcpDomainUtils.ts
263
+ * Checks if the current domain is a GCP tenant matching the pattern: .*-cdp-{cdp-id}\.jira-dev\.com
264
+ * @param {string | undefined} hostname optional hostname to evaluate
265
+ * @returns {boolean} true if the domain matches the GCP tenant pattern
266
+ */
260
267
  function _toObfuscatedSteps() {
261
268
  _toObfuscatedSteps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(steps) {
262
269
  var _steps;
@@ -277,4 +284,13 @@ function _toObfuscatedSteps() {
277
284
  }, _callee2);
278
285
  }));
279
286
  return _toObfuscatedSteps.apply(this, arguments);
287
+ }
288
+ export function isGCPtenant(hostname) {
289
+ if (!hostname) {
290
+ return false;
291
+ }
292
+
293
+ // eslint-disable-next-line require-unicode-regexp
294
+ var gcpTenantPattern = /^.*-cdp-\w+\.jira-dev\.com$/;
295
+ return gcpTenantPattern.test(hostname);
280
296
  }
@@ -28,6 +28,10 @@ export var MULTI_COLLAB_MODE = 'collab';
28
28
  * @param sendPresenceJoined Callback to Channel class
29
29
  */
30
30
  export var ParticipantsService = /*#__PURE__*/function () {
31
+ // Initialized in the constructor body; declared here so the parameter
32
+ // can be optional without requiring the type to include `undefined`
33
+ // (avoids TS9025 under `--isolatedDeclarations`).
34
+
31
35
  /**
32
36
  * constructor
33
37
  *
@@ -44,18 +48,8 @@ export var ParticipantsService = /*#__PURE__*/function () {
44
48
  * @param fetchAnonymousAsset
45
49
  * @example
46
50
  */
47
- function ParticipantsService(analyticsHelper) {
51
+ function ParticipantsService(analyticsHelper, participantsState, emit, getUser, batchProps, channelBroadcast, sendPresenceJoined, getPresenceData, setUserId, getAIProviderActiveIds, fetchAnonymousAsset) {
48
52
  var _this = this;
49
- var participantsState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new ParticipantsState();
50
- var emit = arguments.length > 2 ? arguments[2] : undefined;
51
- var getUser = arguments.length > 3 ? arguments[3] : undefined;
52
- var batchProps = arguments.length > 4 ? arguments[4] : undefined;
53
- var channelBroadcast = arguments.length > 5 ? arguments[5] : undefined;
54
- var sendPresenceJoined = arguments.length > 6 ? arguments[6] : undefined;
55
- var getPresenceData = arguments.length > 7 ? arguments[7] : undefined;
56
- var setUserId = arguments.length > 8 ? arguments[8] : undefined;
57
- var getAIProviderActiveIds = arguments.length > 9 ? arguments[9] : undefined;
58
- var fetchAnonymousAsset = arguments.length > 10 ? arguments[10] : undefined;
59
53
  _classCallCheck(this, ParticipantsService);
60
54
  _defineProperty(this, "currentlyPollingFetchUsers", true);
61
55
  _defineProperty(this, "hasBatchFetchError", false);
@@ -729,7 +723,6 @@ export var ParticipantsService = /*#__PURE__*/function () {
729
723
  return _this.participantsState.size() > 1 ? MULTI_COLLAB_MODE : SINGLE_COLLAB_MODE;
730
724
  });
731
725
  this.analyticsHelper = analyticsHelper;
732
- this.participantsState = participantsState;
733
726
  this.emit = emit;
734
727
  this.getUser = getUser;
735
728
  this.batchProps = batchProps;
@@ -739,6 +732,7 @@ export var ParticipantsService = /*#__PURE__*/function () {
739
732
  this.setUserId = setUserId;
740
733
  this.getAIProviderActiveIds = getAIProviderActiveIds;
741
734
  this.fetchAnonymousAsset = fetchAnonymousAsset;
735
+ this.participantsState = participantsState !== null && participantsState !== void 0 ? participantsState : new ParticipantsState();
742
736
  }
743
737
  return _createClass(ParticipantsService, [{
744
738
  key: "emitTelepointersFromSteps",
@@ -5,11 +5,12 @@ import { io } from 'socket.io-client';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
  import { Provider } from './provider';
8
- import { getProduct, getSubProduct } from './helpers/utils';
8
+ import { getProduct, getSubProduct, isGCPtenant } from './helpers/utils';
9
9
  import { SOCKET_IO_OPTIONS, SOCKET_IO_OPTIONS_WITH_HIGH_JITTER } from './config';
10
10
  export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, analyticsHelper, path, documentAri) {
11
11
  var _URL = new URL(url),
12
- pathname = _URL.pathname;
12
+ pathname = _URL.pathname,
13
+ hostname = _URL.hostname;
13
14
  var socketIOOptions = SOCKET_IO_OPTIONS;
14
15
  // Polling first
15
16
  var transports = ['polling', 'websocket'];
@@ -28,6 +29,9 @@ export function createSocketIOSocket(url, auth, productInfo, isPresenceOnly, ana
28
29
  if (expValEquals('platform_editor_to_use_pmr_for_collab_edit_none_ic', 'isEnabled', true, false)) {
29
30
  usePMR = true;
30
31
  }
32
+ if (isGCPtenant(hostname) && fg('collab_edit_via_websocket_only_for_gcp')) {
33
+ transports = ['websocket'];
34
+ }
31
35
  }
32
36
  var extraHeaders = {
33
37
  'x-product': getProduct(productInfo),
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "18.1.5";
2
+ export var version = "0.0.0-development";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -18,34 +18,22 @@ export type UGCFreeStepDetails = {
18
18
  };
19
19
  export declare const getStepUGCFreeDetails: (step: ProseMirrorStep) => UGCFreeStepDetails;
20
20
  export declare const getStepTypes: (stepJson: StepJson) => {
21
- type: string;
22
21
  contentTypes: string | null;
22
+ type: string;
23
23
  };
24
24
  export declare const getStepsAdfWithObfuscation: (stepJson: StepJson) => ADFEntity[] | null;
25
25
  export declare const getDocAdfWithObfuscation: (doc: ProseMirrorNode) => ADFEntity | null;
26
26
  export declare const getDocAdfWithObfuscationFromJSON: (docJson: JSONDocNode) => ADFEntity | null;
27
27
  export declare const getStepPositions: (stepJson: StepJson) => {
28
- pos?: number | undefined;
29
- insert?: number | undefined;
28
+ from?: number | undefined;
30
29
  gapFrom?: number | undefined;
31
30
  gapTo?: number | undefined;
32
- from?: number | undefined;
31
+ insert?: number | undefined;
32
+ pos?: number | undefined;
33
33
  to?: number | undefined;
34
34
  };
35
35
  export declare const getObfuscatedSteps: (steps: StepJson[], endIndex?: number | undefined) => {
36
- stepType: {
37
- type: string;
38
- contentTypes: string | null;
39
- };
40
36
  stepContent: ADFEntity[] | null;
41
- stepPositions: {
42
- pos?: number | undefined;
43
- insert?: number | undefined;
44
- gapFrom?: number | undefined;
45
- gapTo?: number | undefined;
46
- from?: number | undefined;
47
- to?: number | undefined;
48
- };
49
37
  stepMetadata: {
50
38
  createdOffline?: boolean;
51
39
  prevStepId?: string;
@@ -57,9 +45,28 @@ export declare const getObfuscatedSteps: (steps: StepJson[], endIndex?: number |
57
45
  traceId?: string;
58
46
  unconfirmedStepAfterRecovery?: boolean;
59
47
  } | undefined;
48
+ stepPositions: {
49
+ from?: number | undefined;
50
+ gapFrom?: number | undefined;
51
+ gapTo?: number | undefined;
52
+ insert?: number | undefined;
53
+ pos?: number | undefined;
54
+ to?: number | undefined;
55
+ };
56
+ stepType: {
57
+ contentTypes: string | null;
58
+ type: string;
59
+ };
60
60
  }[];
61
61
  export declare function logObfuscatedSteps(oldState: EditorState | null, newState: EditorState): Promise<CustomError | {
62
- stepsFromOldState: string;
63
62
  stepsFromNewState: string;
63
+ stepsFromOldState: string;
64
64
  }>;
65
65
  export declare function toObfuscatedSteps(steps: readonly ProseMirrorStep[]): Promise<string>;
66
+ /**
67
+ * Copied from confluence/next/packages/graphql/src/utils/gcpDomainUtils.ts
68
+ * Checks if the current domain is a GCP tenant matching the pattern: .*-cdp-{cdp-id}\.jira-dev\.com
69
+ * @param {string | undefined} hostname optional hostname to evaluate
70
+ * @returns {boolean} true if the domain matches the GCP tenant pattern
71
+ */
72
+ export declare function isGCPtenant(hostname?: string): boolean;
@@ -17,7 +17,6 @@ export declare const MULTI_COLLAB_MODE = "collab";
17
17
  */
18
18
  export declare class ParticipantsService {
19
19
  private analyticsHelper;
20
- private participantsState;
21
20
  private emit;
22
21
  private getUser;
23
22
  private batchProps;
@@ -32,6 +31,7 @@ export declare class ParticipantsService {
32
31
  private presenceFetchTimeout;
33
32
  private currentlyPollingFetchUsers;
34
33
  private hasBatchFetchError;
34
+ private participantsState;
35
35
  /**
36
36
  * constructor
37
37
  *
@@ -18,34 +18,22 @@ export type UGCFreeStepDetails = {
18
18
  };
19
19
  export declare const getStepUGCFreeDetails: (step: ProseMirrorStep) => UGCFreeStepDetails;
20
20
  export declare const getStepTypes: (stepJson: StepJson) => {
21
- type: string;
22
21
  contentTypes: string | null;
22
+ type: string;
23
23
  };
24
24
  export declare const getStepsAdfWithObfuscation: (stepJson: StepJson) => ADFEntity[] | null;
25
25
  export declare const getDocAdfWithObfuscation: (doc: ProseMirrorNode) => ADFEntity | null;
26
26
  export declare const getDocAdfWithObfuscationFromJSON: (docJson: JSONDocNode) => ADFEntity | null;
27
27
  export declare const getStepPositions: (stepJson: StepJson) => {
28
- pos?: number | undefined;
29
- insert?: number | undefined;
28
+ from?: number | undefined;
30
29
  gapFrom?: number | undefined;
31
30
  gapTo?: number | undefined;
32
- from?: number | undefined;
31
+ insert?: number | undefined;
32
+ pos?: number | undefined;
33
33
  to?: number | undefined;
34
34
  };
35
35
  export declare const getObfuscatedSteps: (steps: StepJson[], endIndex?: number | undefined) => {
36
- stepType: {
37
- type: string;
38
- contentTypes: string | null;
39
- };
40
36
  stepContent: ADFEntity[] | null;
41
- stepPositions: {
42
- pos?: number | undefined;
43
- insert?: number | undefined;
44
- gapFrom?: number | undefined;
45
- gapTo?: number | undefined;
46
- from?: number | undefined;
47
- to?: number | undefined;
48
- };
49
37
  stepMetadata: {
50
38
  createdOffline?: boolean;
51
39
  prevStepId?: string;
@@ -57,9 +45,28 @@ export declare const getObfuscatedSteps: (steps: StepJson[], endIndex?: number |
57
45
  traceId?: string;
58
46
  unconfirmedStepAfterRecovery?: boolean;
59
47
  } | undefined;
48
+ stepPositions: {
49
+ from?: number | undefined;
50
+ gapFrom?: number | undefined;
51
+ gapTo?: number | undefined;
52
+ insert?: number | undefined;
53
+ pos?: number | undefined;
54
+ to?: number | undefined;
55
+ };
56
+ stepType: {
57
+ contentTypes: string | null;
58
+ type: string;
59
+ };
60
60
  }[];
61
61
  export declare function logObfuscatedSteps(oldState: EditorState | null, newState: EditorState): Promise<CustomError | {
62
- stepsFromOldState: string;
63
62
  stepsFromNewState: string;
63
+ stepsFromOldState: string;
64
64
  }>;
65
65
  export declare function toObfuscatedSteps(steps: readonly ProseMirrorStep[]): Promise<string>;
66
+ /**
67
+ * Copied from confluence/next/packages/graphql/src/utils/gcpDomainUtils.ts
68
+ * Checks if the current domain is a GCP tenant matching the pattern: .*-cdp-{cdp-id}\.jira-dev\.com
69
+ * @param {string | undefined} hostname optional hostname to evaluate
70
+ * @returns {boolean} true if the domain matches the GCP tenant pattern
71
+ */
72
+ export declare function isGCPtenant(hostname?: string): boolean;
@@ -17,7 +17,6 @@ export declare const MULTI_COLLAB_MODE = "collab";
17
17
  */
18
18
  export declare class ParticipantsService {
19
19
  private analyticsHelper;
20
- private participantsState;
21
20
  private emit;
22
21
  private getUser;
23
22
  private batchProps;
@@ -32,6 +31,7 @@ export declare class ParticipantsService {
32
31
  private presenceFetchTimeout;
33
32
  private currentlyPollingFetchUsers;
34
33
  private hasBatchFetchError;
34
+ private participantsState;
35
35
  /**
36
36
  * constructor
37
37
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "18.1.6",
3
+ "version": "18.2.1",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/prosemirror-collab": "^0.22.0",
39
39
  "@atlaskit/react-ufo": "^5.19.0",
40
- "@atlaskit/tmp-editor-statsig": "^77.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^77.2.0",
41
41
  "@atlaskit/ufo": "^0.4.0",
42
42
  "@atlaskit/util-service-support": "^6.3.0",
43
43
  "@babel/runtime": "^7.0.0",
@@ -65,14 +65,17 @@
65
65
  "devDependencies": {
66
66
  "@atlaskit/adf-schema": "^52.9.0",
67
67
  "@atlassian/a11y-jest-testing": "^0.11.0",
68
- "@atlassian/feature-flags-test-utils": "^1.0.0"
68
+ "@atlassian/feature-flags-test-utils": "^1.1.0"
69
69
  },
70
70
  "platform-feature-flags": {
71
71
  "platform-editor-presence-websocket-only": {
72
72
  "type": "boolean"
73
+ },
74
+ "collab_edit_via_websocket_only_for_gcp": {
75
+ "type": "boolean"
73
76
  }
74
77
  },
75
78
  "peerDependencies": {
76
- "@atlaskit/editor-common": "^114.20.0"
79
+ "@atlaskit/editor-common": "^114.25.0"
77
80
  }
78
81
  }
@@ -1,72 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.local-consumption.json",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "outDir": "../../../../../jira/tsDist/@atlaskit__collab-provider/app",
6
- "rootDir": "../",
7
- "composite": true,
8
- "noCheck": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": [
26
- {
27
- "path": "../../adf-utils/afm-jira/tsconfig.json"
28
- },
29
- {
30
- "path": "../../../analytics/analytics-gas-types/afm-jira/tsconfig.json"
31
- },
32
- {
33
- "path": "../../../analytics/analytics-listeners/afm-jira/tsconfig.json"
34
- },
35
- {
36
- "path": "../../../elements/anonymous-assets/afm-jira/tsconfig.json"
37
- },
38
- {
39
- "path": "../../../uip/atlassian-context/afm-jira/tsconfig.json"
40
- },
41
- {
42
- "path": "../../editor-json-transformer/afm-jira/tsconfig.json"
43
- },
44
- {
45
- "path": "../../editor-prosemirror/afm-jira/tsconfig.json"
46
- },
47
- {
48
- "path": "../../../measurement/feature-gate-js-client/afm-jira/tsconfig.json"
49
- },
50
- {
51
- "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
52
- },
53
- {
54
- "path": "../../prosemirror-collab/afm-jira/tsconfig.json"
55
- },
56
- {
57
- "path": "../../../react-ufo/atlaskit/afm-jira/tsconfig.json"
58
- },
59
- {
60
- "path": "../../tmp-editor-statsig/afm-jira/tsconfig.json"
61
- },
62
- {
63
- "path": "../../../data/ufo-external/afm-jira/tsconfig.json"
64
- },
65
- {
66
- "path": "../../../elements/util-service-support/afm-jira/tsconfig.json"
67
- },
68
- {
69
- "path": "../../editor-common/afm-jira/tsconfig.json"
70
- }
71
- ]
72
- }