@atlaskit/editor-common 99.1.2 → 99.3.0

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,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 99.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#100830](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100830)
8
+ [`c46ec6d414867`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c46ec6d414867) -
9
+ New collab event namespace-lock:check
10
+
11
+ ## 99.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#102499](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102499)
16
+ [`c1bfe8b68a35e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c1bfe8b68a35e) -
17
+ log obfuscated steps in collab provider when catchup out of sync
18
+
3
19
  ## 99.1.2
4
20
 
5
21
  ### Patch Changes
@@ -119,7 +119,11 @@ var DisconnectReason = exports.DisconnectReason = /*#__PURE__*/function (Disconn
119
119
  DisconnectReason["SOCKET_TIMEOUT"] = "SOCKET_TIMEOUT";
120
120
  DisconnectReason["UNKNOWN_DISCONNECT"] = "UNKNOWN_DISCONNECT";
121
121
  return DisconnectReason;
122
- }({});
122
+ }({}); // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceStep
123
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep
124
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.AttrStep
125
+ //Intersection: NCS custom step type config in adf-schema
126
+ //Unions
123
127
  var telepointerColorStyle = function telepointerColorStyle(backgroundColor, textColor, index) {
124
128
  var _getGlobalTheme = (0, _tokens.getGlobalTheme)(),
125
129
  colorMode = _getGlobalTheme.colorMode;
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "99.1.2";
20
+ var packageVersion = "99.3.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "99.1.2";
26
+ var packageVersion = "99.3.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -128,6 +128,17 @@ export let DisconnectReason = /*#__PURE__*/function (DisconnectReason) {
128
128
  DisconnectReason["UNKNOWN_DISCONNECT"] = "UNKNOWN_DISCONNECT";
129
129
  return DisconnectReason;
130
130
  }({});
131
+
132
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceStep
133
+
134
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep
135
+
136
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.AttrStep
137
+
138
+ //Intersection: NCS custom step type config in adf-schema
139
+
140
+ //Unions
141
+
131
142
  const telepointerColorStyle = (backgroundColor, textColor, index) => {
132
143
  const {
133
144
  colorMode
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "99.1.2";
4
+ const packageVersion = "99.3.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "99.1.2";
16
+ const packageVersion = "99.3.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -130,6 +130,17 @@ export var DisconnectReason = /*#__PURE__*/function (DisconnectReason) {
130
130
  DisconnectReason["UNKNOWN_DISCONNECT"] = "UNKNOWN_DISCONNECT";
131
131
  return DisconnectReason;
132
132
  }({});
133
+
134
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceStep
135
+
136
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.ReplaceAroundStep
137
+
138
+ // Match with ProseMirror: https://prosemirror.net/docs/ref/#transform.AttrStep
139
+
140
+ //Intersection: NCS custom step type config in adf-schema
141
+
142
+ //Unions
143
+
133
144
  var telepointerColorStyle = function telepointerColorStyle(backgroundColor, textColor, index) {
134
145
  var _getGlobalTheme = getGlobalTheme(),
135
146
  colorMode = _getGlobalTheme.colorMode;
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "99.1.2";
10
+ var packageVersion = "99.3.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "99.1.2";
23
+ var packageVersion = "99.3.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -1,4 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
+ import { type BatchAttrsStep, type OverrideDocumentStepJSON as OverrideDocumentStep } from '@atlaskit/adf-schema/steps';
2
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
3
4
  import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
4
5
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
@@ -241,6 +242,9 @@ export interface CollabDisconnectedPayload {
241
242
  reason: DisconnectReason;
242
243
  sid: string;
243
244
  }
245
+ export interface CollabNamespaceLockCheckPayload {
246
+ isLocked: boolean;
247
+ }
244
248
  export interface CollabEventRemoteData {
245
249
  json?: any;
246
250
  newState?: EditorState;
@@ -252,7 +256,7 @@ type MarkJson = {
252
256
  [key: string]: any;
253
257
  };
254
258
  };
255
- type NodeJson = {
259
+ export type NodeJson = {
256
260
  type: string;
257
261
  attrs: {
258
262
  [key: string]: any;
@@ -266,16 +270,72 @@ type SliceJson = {
266
270
  openStart: number;
267
271
  openEnd: number;
268
272
  };
269
- export type StepJson = {
270
- stepType?: string;
271
- from?: number;
272
- to?: number;
273
- slice?: SliceJson;
273
+ export interface StepMetadata {
274
+ metadata?: {
275
+ source?: string;
276
+ stepId?: string;
277
+ prevStepId?: string;
278
+ rebased?: boolean;
279
+ traceId?: string;
280
+ reqId?: string;
281
+ schemaVersion?: string;
282
+ };
283
+ }
284
+ export interface BaseStepPM extends StepMetadata {
274
285
  clientId: number | string;
275
286
  userId: string;
276
- createdAt?: number;
287
+ stepType: string;
288
+ to?: number;
289
+ from?: number;
290
+ slice?: SliceJson;
291
+ }
292
+ export interface ReplaceStepPM extends BaseStepPM {
293
+ from: number;
294
+ to: number;
295
+ slice: SliceJson;
277
296
  structure?: boolean;
278
- };
297
+ }
298
+ export interface ReplaceAroundStepPM extends BaseStepPM {
299
+ from: number;
300
+ to: number;
301
+ gapFrom: number;
302
+ gapTo: number;
303
+ slice: SliceJson;
304
+ insert: number;
305
+ structure?: boolean;
306
+ }
307
+ export type InlineCommentStepPM = InlineCommentAddMarkStepPM | InlineCommentAddNodeMarkStepPM;
308
+ interface InlineCommentAddMarkStepPM extends BaseStepPM {
309
+ stepType: 'addMark';
310
+ from: number;
311
+ to: number;
312
+ mark?: {
313
+ type?: 'annotation';
314
+ attrs?: {
315
+ id?: string;
316
+ annotationType?: 'inlineComment';
317
+ };
318
+ };
319
+ }
320
+ export interface InlineCommentAddNodeMarkStepPM extends BaseStepPM {
321
+ stepType: 'addNodeMark';
322
+ pos: number;
323
+ mark?: {
324
+ type?: 'annotation';
325
+ attrs?: {
326
+ id?: string;
327
+ annotationType?: 'inlineComment';
328
+ };
329
+ };
330
+ }
331
+ export interface SetAttrsStepPM extends BaseStepPM {
332
+ stepType: 'setAttrs';
333
+ pos: number;
334
+ attrs: Record<string, unknown>;
335
+ }
336
+ export type BatchAttrsStepPM = BaseStepPM & BatchAttrsStep;
337
+ export type OverrideDocumentStepPM = BaseStepPM & OverrideDocumentStep;
338
+ export type StepJson = OverrideDocumentStepPM | ReplaceAroundStepPM | ReplaceStepPM | InlineCommentStepPM | SetAttrsStepPM;
279
339
  export interface CollabDataPayload extends CollabEventRemoteData {
280
340
  version: number;
281
341
  json: StepJson[];
@@ -384,6 +444,7 @@ export interface CollabEvents {
384
444
  connecting: CollabConnectingPayload;
385
445
  permission: CollabPermissionEventPayload;
386
446
  'commit-status': CollabCommitStatusEventPayload;
447
+ 'namespace-lock:check': CollabNamespaceLockCheckPayload;
387
448
  }
388
449
  export type SyncUpErrorFunction = (attributes: NewCollabSyncUpErrorAttributes) => void;
389
450
  export interface CollabEditProvider<Events extends CollabEvents = CollabEvents> {
@@ -1,4 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
+ import { type BatchAttrsStep, type OverrideDocumentStepJSON as OverrideDocumentStep } from '@atlaskit/adf-schema/steps';
2
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
3
4
  import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
4
5
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
@@ -241,6 +242,9 @@ export interface CollabDisconnectedPayload {
241
242
  reason: DisconnectReason;
242
243
  sid: string;
243
244
  }
245
+ export interface CollabNamespaceLockCheckPayload {
246
+ isLocked: boolean;
247
+ }
244
248
  export interface CollabEventRemoteData {
245
249
  json?: any;
246
250
  newState?: EditorState;
@@ -252,7 +256,7 @@ type MarkJson = {
252
256
  [key: string]: any;
253
257
  };
254
258
  };
255
- type NodeJson = {
259
+ export type NodeJson = {
256
260
  type: string;
257
261
  attrs: {
258
262
  [key: string]: any;
@@ -266,16 +270,72 @@ type SliceJson = {
266
270
  openStart: number;
267
271
  openEnd: number;
268
272
  };
269
- export type StepJson = {
270
- stepType?: string;
271
- from?: number;
272
- to?: number;
273
- slice?: SliceJson;
273
+ export interface StepMetadata {
274
+ metadata?: {
275
+ source?: string;
276
+ stepId?: string;
277
+ prevStepId?: string;
278
+ rebased?: boolean;
279
+ traceId?: string;
280
+ reqId?: string;
281
+ schemaVersion?: string;
282
+ };
283
+ }
284
+ export interface BaseStepPM extends StepMetadata {
274
285
  clientId: number | string;
275
286
  userId: string;
276
- createdAt?: number;
287
+ stepType: string;
288
+ to?: number;
289
+ from?: number;
290
+ slice?: SliceJson;
291
+ }
292
+ export interface ReplaceStepPM extends BaseStepPM {
293
+ from: number;
294
+ to: number;
295
+ slice: SliceJson;
277
296
  structure?: boolean;
278
- };
297
+ }
298
+ export interface ReplaceAroundStepPM extends BaseStepPM {
299
+ from: number;
300
+ to: number;
301
+ gapFrom: number;
302
+ gapTo: number;
303
+ slice: SliceJson;
304
+ insert: number;
305
+ structure?: boolean;
306
+ }
307
+ export type InlineCommentStepPM = InlineCommentAddMarkStepPM | InlineCommentAddNodeMarkStepPM;
308
+ interface InlineCommentAddMarkStepPM extends BaseStepPM {
309
+ stepType: 'addMark';
310
+ from: number;
311
+ to: number;
312
+ mark?: {
313
+ type?: 'annotation';
314
+ attrs?: {
315
+ id?: string;
316
+ annotationType?: 'inlineComment';
317
+ };
318
+ };
319
+ }
320
+ export interface InlineCommentAddNodeMarkStepPM extends BaseStepPM {
321
+ stepType: 'addNodeMark';
322
+ pos: number;
323
+ mark?: {
324
+ type?: 'annotation';
325
+ attrs?: {
326
+ id?: string;
327
+ annotationType?: 'inlineComment';
328
+ };
329
+ };
330
+ }
331
+ export interface SetAttrsStepPM extends BaseStepPM {
332
+ stepType: 'setAttrs';
333
+ pos: number;
334
+ attrs: Record<string, unknown>;
335
+ }
336
+ export type BatchAttrsStepPM = BaseStepPM & BatchAttrsStep;
337
+ export type OverrideDocumentStepPM = BaseStepPM & OverrideDocumentStep;
338
+ export type StepJson = OverrideDocumentStepPM | ReplaceAroundStepPM | ReplaceStepPM | InlineCommentStepPM | SetAttrsStepPM;
279
339
  export interface CollabDataPayload extends CollabEventRemoteData {
280
340
  version: number;
281
341
  json: StepJson[];
@@ -384,6 +444,7 @@ export interface CollabEvents {
384
444
  connecting: CollabConnectingPayload;
385
445
  permission: CollabPermissionEventPayload;
386
446
  'commit-status': CollabCommitStatusEventPayload;
447
+ 'namespace-lock:check': CollabNamespaceLockCheckPayload;
387
448
  }
388
449
  export type SyncUpErrorFunction = (attributes: NewCollabSyncUpErrorAttributes) => void;
389
450
  export interface CollabEditProvider<Events extends CollabEvents = CollabEvents> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "99.1.2",
3
+ "version": "99.3.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -113,7 +113,7 @@
113
113
  "dependencies": {
114
114
  "@atlaskit/activity-provider": "^2.5.0",
115
115
  "@atlaskit/adf-schema": "^46.1.0",
116
- "@atlaskit/adf-utils": "^19.16.0",
116
+ "@atlaskit/adf-utils": "^19.17.0",
117
117
  "@atlaskit/analytics-listeners": "^8.13.0",
118
118
  "@atlaskit/analytics-namespaced-context": "^6.12.0",
119
119
  "@atlaskit/analytics-next": "^10.2.0",
@@ -129,7 +129,7 @@
129
129
  "@atlaskit/editor-shared-styles": "^3.2.0",
130
130
  "@atlaskit/editor-tables": "^2.8.0",
131
131
  "@atlaskit/emoji": "^67.12.0",
132
- "@atlaskit/icon": "^23.3.0",
132
+ "@atlaskit/icon": "^23.4.0",
133
133
  "@atlaskit/icon-object": "^6.9.0",
134
134
  "@atlaskit/link-datasource": "^3.15.0",
135
135
  "@atlaskit/link-picker": "^1.47.0",
@@ -141,7 +141,7 @@
141
141
  "@atlaskit/media-picker": "^67.0.0",
142
142
  "@atlaskit/media-ui": "^27.3.0",
143
143
  "@atlaskit/media-viewer": "49.6.1",
144
- "@atlaskit/mention": "^23.7.0",
144
+ "@atlaskit/mention": "^23.8.0",
145
145
  "@atlaskit/menu": "^2.13.0",
146
146
  "@atlaskit/onboarding": "^12.2.0",
147
147
  "@atlaskit/platform-feature-flags": "^0.3.0",
@@ -149,12 +149,12 @@
149
149
  "@atlaskit/primitives": "^13.3.0",
150
150
  "@atlaskit/profilecard": "^21.1.0",
151
151
  "@atlaskit/section-message": "^6.8.0",
152
- "@atlaskit/smart-card": "^34.1.0",
152
+ "@atlaskit/smart-card": "^34.2.0",
153
153
  "@atlaskit/smart-user-picker": "^6.11.0",
154
154
  "@atlaskit/spinner": "^16.3.0",
155
155
  "@atlaskit/task-decision": "^17.11.0",
156
156
  "@atlaskit/textfield": "^6.7.0",
157
- "@atlaskit/tmp-editor-statsig": "^2.34.0",
157
+ "@atlaskit/tmp-editor-statsig": "^2.35.0",
158
158
  "@atlaskit/tokens": "^3.0.0",
159
159
  "@atlaskit/tooltip": "^19.0.0",
160
160
  "@atlaskit/width-detector": "^4.3.0",