@atlaskit/editor-common 118.10.1 → 118.10.2

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,16 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 118.10.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1d1cb3e25a787`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1d1cb3e25a787) -
8
+ Fix BE-streaming Review moment data loss and chimera diffs: derive coarse review segments as
9
+ closed, whole top-level node slices (mapped consistently between the pre-edit and post-edit doc),
10
+ filter out position-neutral phantom collab touches, and fall back to a safe add-only segment when
11
+ a change relocates content. Behind the platform_editor_backend_review_moment_agent_types gate.
12
+ - Updated dependencies
13
+
3
14
  ## 118.10.1
4
15
 
5
16
  ### Patch Changes
@@ -13,10 +13,21 @@ exports.AGENT_REMOTE_EDIT_REVIEW_DATA = void 0;
13
13
  * plugins already depend on.
14
14
  *
15
15
  * Stamped whenever a received remote-step batch contains agent-authored steps.
16
- * Consumed by `aiSessionContextPlugin.apply()`,
17
- * which appends coarse `aiContentPositions` entriesexactly like the in-editor
18
- * (FE) streaming path's `AI_FINAL_STREAMING_TRANSFORMATION_DATA`, so the whole
19
- * downstream Review moment pipeline (merge segment diff undo/redo → accept)
20
- * is reused unchanged.
16
+ *
17
+ * The batch is reduced to COARSE segments one per edited top-level region — in
18
+ * exactly the shape the AI plugin already stores in `aiContentPositions` for the
19
+ * FE (`buildCommitTransaction`) path: `[startPos, endPos]` in the live doc plus a
20
+ * closed `originalSlice` / `newSlice` pair. The AI plugin appends these verbatim,
21
+ * then the Post Stream Review screen refines them identically to FE
22
+ * (`calculateTopLevelNodeSegments`, and `calculateDiffSegments` when the
23
+ * diff-based-segmenting gate is on). Producing coarse segments here (rather than
24
+ * fine-grained diffs) preserves the screen's two-layer contract; producing them
25
+ * as CLOSED, whole-top-level-node slices avoids the boundary-bleed / open-slice
26
+ * data-loss hazards of the earlier hand-rolled per-step slicing.
21
27
  */
22
- var AGENT_REMOTE_EDIT_REVIEW_DATA = exports.AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
28
+ var AGENT_REMOTE_EDIT_REVIEW_DATA = exports.AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
29
+
30
+ /**
31
+ * One coarse reviewable segment for a single edited top-level region, matching the
32
+ * `aiContentPositions` entry shape the AI plugin stores for FE streaming.
33
+ */
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "118.10.0";
31
+ var packageVersion = "118.10.1";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "118.10.0";
27
+ var packageVersion = "118.10.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -7,10 +7,21 @@
7
7
  * plugins already depend on.
8
8
  *
9
9
  * Stamped whenever a received remote-step batch contains agent-authored steps.
10
- * Consumed by `aiSessionContextPlugin.apply()`,
11
- * which appends coarse `aiContentPositions` entriesexactly like the in-editor
12
- * (FE) streaming path's `AI_FINAL_STREAMING_TRANSFORMATION_DATA`, so the whole
13
- * downstream Review moment pipeline (merge segment diff undo/redo → accept)
14
- * is reused unchanged.
10
+ *
11
+ * The batch is reduced to COARSE segments one per edited top-level region — in
12
+ * exactly the shape the AI plugin already stores in `aiContentPositions` for the
13
+ * FE (`buildCommitTransaction`) path: `[startPos, endPos]` in the live doc plus a
14
+ * closed `originalSlice` / `newSlice` pair. The AI plugin appends these verbatim,
15
+ * then the Post Stream Review screen refines them identically to FE
16
+ * (`calculateTopLevelNodeSegments`, and `calculateDiffSegments` when the
17
+ * diff-based-segmenting gate is on). Producing coarse segments here (rather than
18
+ * fine-grained diffs) preserves the screen's two-layer contract; producing them
19
+ * as CLOSED, whole-top-level-node slices avoids the boundary-bleed / open-slice
20
+ * data-loss hazards of the earlier hand-rolled per-step slicing.
15
21
  */
16
- export const AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
22
+ export const AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
23
+
24
+ /**
25
+ * One coarse reviewable segment for a single edited top-level region, matching the
26
+ * `aiContentPositions` entry shape the AI plugin stores for FE streaming.
27
+ */
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "118.10.0";
17
+ const packageVersion = "118.10.1";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "118.10.0";
17
+ const packageVersion = "118.10.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -7,10 +7,21 @@
7
7
  * plugins already depend on.
8
8
  *
9
9
  * Stamped whenever a received remote-step batch contains agent-authored steps.
10
- * Consumed by `aiSessionContextPlugin.apply()`,
11
- * which appends coarse `aiContentPositions` entriesexactly like the in-editor
12
- * (FE) streaming path's `AI_FINAL_STREAMING_TRANSFORMATION_DATA`, so the whole
13
- * downstream Review moment pipeline (merge segment diff undo/redo → accept)
14
- * is reused unchanged.
10
+ *
11
+ * The batch is reduced to COARSE segments one per edited top-level region — in
12
+ * exactly the shape the AI plugin already stores in `aiContentPositions` for the
13
+ * FE (`buildCommitTransaction`) path: `[startPos, endPos]` in the live doc plus a
14
+ * closed `originalSlice` / `newSlice` pair. The AI plugin appends these verbatim,
15
+ * then the Post Stream Review screen refines them identically to FE
16
+ * (`calculateTopLevelNodeSegments`, and `calculateDiffSegments` when the
17
+ * diff-based-segmenting gate is on). Producing coarse segments here (rather than
18
+ * fine-grained diffs) preserves the screen's two-layer contract; producing them
19
+ * as CLOSED, whole-top-level-node slices avoids the boundary-bleed / open-slice
20
+ * data-loss hazards of the earlier hand-rolled per-step slicing.
15
21
  */
16
- export var AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
22
+ export var AGENT_REMOTE_EDIT_REVIEW_DATA = 'agentRemoteEditReviewData';
23
+
24
+ /**
25
+ * One coarse reviewable segment for a single edited top-level region, matching the
26
+ * `aiContentPositions` entry shape the AI plugin stores for FE streaming.
27
+ */
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "118.10.0";
23
+ var packageVersion = "118.10.1";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "118.10.0";
24
+ var packageVersion = "118.10.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -8,26 +8,39 @@ import type { Slice } from '@atlaskit/editor-prosemirror/model';
8
8
  * plugins already depend on.
9
9
  *
10
10
  * Stamped whenever a received remote-step batch contains agent-authored steps.
11
- * Consumed by `aiSessionContextPlugin.apply()`,
12
- * which appends coarse `aiContentPositions` entriesexactly like the in-editor
13
- * (FE) streaming path's `AI_FINAL_STREAMING_TRANSFORMATION_DATA`, so the whole
14
- * downstream Review moment pipeline (merge segment diff undo/redo → accept)
15
- * is reused unchanged.
11
+ *
12
+ * The batch is reduced to COARSE segments one per edited top-level region — in
13
+ * exactly the shape the AI plugin already stores in `aiContentPositions` for the
14
+ * FE (`buildCommitTransaction`) path: `[startPos, endPos]` in the live doc plus a
15
+ * closed `originalSlice` / `newSlice` pair. The AI plugin appends these verbatim,
16
+ * then the Post Stream Review screen refines them identically to FE
17
+ * (`calculateTopLevelNodeSegments`, and `calculateDiffSegments` when the
18
+ * diff-based-segmenting gate is on). Producing coarse segments here (rather than
19
+ * fine-grained diffs) preserves the screen's two-layer contract; producing them
20
+ * as CLOSED, whole-top-level-node slices avoids the boundary-bleed / open-slice
21
+ * data-loss hazards of the earlier hand-rolled per-step slicing.
16
22
  */
17
23
  export declare const AGENT_REMOTE_EDIT_REVIEW_DATA = "agentRemoteEditReviewData";
24
+ /**
25
+ * One coarse reviewable segment for a single edited top-level region, matching the
26
+ * `aiContentPositions` entry shape the AI plugin stores for FE streaming.
27
+ */
18
28
  export interface AgentRemoteEditReviewSegment {
19
- /** Live-doc end of the change after the batch applied. A `remove` is zero-width (`endPos === startPos`). */
29
+ /** Live-doc end of the applied (new) content. Equals `startPos` for a pure removal. */
20
30
  endPos: number;
31
+ /** Change kind, mirroring the FE coarse-entry classification. */
32
+ kind: 'add' | 'remove' | 'update';
21
33
  /**
22
- * Derived from the slice pair: empty original `add`, empty new `remove`,
23
- * else `update`. Carried so the consumer does not re-derive it.
34
+ * The post-edit content of this region (`tr.doc`), as a CLOSED slice snapped to
35
+ * whole top-level nodes. `Slice.empty` for a pure removal.
24
36
  */
25
- kind: 'add' | 'remove' | 'update';
26
- /** Content now at [startPos, endPos] AFTER the batch (the agent's content; for redo). */
27
37
  newSlice: Slice;
28
- /** Content that was at the range BEFORE the batch (for undo / "compare with original"). */
38
+ /**
39
+ * The pre-edit content of this region (`tr.before`), as a CLOSED slice snapped
40
+ * to whole top-level nodes. `Slice.empty` for a pure addition.
41
+ */
29
42
  originalSlice: Slice;
30
- /** Live-doc start of the change after the batch applied. */
43
+ /** Live-doc start of the applied (new) content. */
31
44
  startPos: number;
32
45
  }
33
46
  export interface AgentRemoteEditReviewData {
@@ -54,5 +67,10 @@ export interface AgentRemoteEditReviewData {
54
67
  * waiting for the idle debounce. `false`/absent ⇒ rely on the debounce.
55
68
  */
56
69
  complete?: boolean;
70
+ /**
71
+ * The coarse reviewable segments derived from the batch — one per edited
72
+ * top-level region, with closed whole-node slices. Appended verbatim to
73
+ * `aiContentPositions` by the AI plugin.
74
+ */
57
75
  segments: AgentRemoteEditReviewSegment[];
58
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "118.10.1",
3
+ "version": "118.10.2",
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/"
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/profilecard": "^26.17.0",
77
77
  "@atlaskit/prosemirror-history": "^1.1.0",
78
78
  "@atlaskit/react-compiler-gating": "^0.2.0",
79
- "@atlaskit/react-ufo": "^7.4.0",
79
+ "@atlaskit/react-ufo": "^7.5.0",
80
80
  "@atlaskit/section-message": "^10.0.0",
81
81
  "@atlaskit/smart-card": "^45.17.0",
82
82
  "@atlaskit/smart-user-picker": "^11.5.0",