@atlaskit/editor-plugin-collab-edit 15.0.5 → 15.0.6

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,13 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 15.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88aff7b9d6346`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88aff7b9d6346) -
8
+ Allowlist BE streaming Review Moment agentTypes via Statsig dynamic config
9
+ platform_editor_backend_review_moment_agent_types (code default empty until Statsig is set).
10
+
3
11
  ## 15.0.5
4
12
 
5
13
  ### Patch Changes
@@ -3,9 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getAgentEditSegments = void 0;
6
+ exports.getAgentEditSegments = exports.REVIEW_MOMENT_AGENT_TYPES_CONFIG = void 0;
7
+ var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
7
8
  var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
8
9
  var _agentShimmerRanges = require("./agent-shimmer-ranges");
10
+ // Statsig dynamic config: which BE-streaming `agentType` values may open Review Moment.
11
+ // Code default is `[]` (fail closed) until the list is set in Statsig.
12
+ var REVIEW_MOMENT_AGENT_TYPES_CONFIG = exports.REVIEW_MOMENT_AGENT_TYPES_CONFIG = 'platform_editor_backend_review_moment_agent_types';
13
+
9
14
  // [CCI-17994] Post Stream Review ("Review moment") recording for BE streaming.
10
15
  //
11
16
  // Sibling to `getAgentShimmerRanges`: same idea of deriving what the agent wrote
@@ -58,6 +63,12 @@ var getAgentEditSegments = exports.getAgentEditSegments = function getAgentEditS
58
63
  if (agentType === undefined) {
59
64
  return null;
60
65
  }
66
+ // Only record Review Moment for agentTypes allowlisted in Statsig. Default `[]` fails
67
+ // closed until the config is populated (CCI-18607).
68
+ var allowedAgentTypes = (0, _expVal.expVal)(REVIEW_MOMENT_AGENT_TYPES_CONFIG, 'value', []);
69
+ if (!allowedAgentTypes.includes(agentType)) {
70
+ return null;
71
+ }
61
72
  // The user the agent acted on behalf of (the requester). Optional/additive on the
62
73
  // step contract, so it may be absent.
63
74
  var actorUserId = typeof (agentStep === null || agentStep === void 0 ? void 0 : agentStep.userId) === 'string' ? agentStep.userId : undefined;
@@ -1,6 +1,11 @@
1
+ import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
1
2
  import { getCollabState } from '@atlaskit/prosemirror-collab';
2
3
  import { isPositionNeutralStep } from './agent-shimmer-ranges';
3
4
 
5
+ // Statsig dynamic config: which BE-streaming `agentType` values may open Review Moment.
6
+ // Code default is `[]` (fail closed) until the list is set in Statsig.
7
+ export const REVIEW_MOMENT_AGENT_TYPES_CONFIG = 'platform_editor_backend_review_moment_agent_types';
8
+
4
9
  // [CCI-17994] Post Stream Review ("Review moment") recording for BE streaming.
5
10
  //
6
11
  // Sibling to `getAgentShimmerRanges`: same idea of deriving what the agent wrote
@@ -49,6 +54,12 @@ export const getAgentEditSegments = (json, steps, tr, view) => {
49
54
  if (agentType === undefined) {
50
55
  return null;
51
56
  }
57
+ // Only record Review Moment for agentTypes allowlisted in Statsig. Default `[]` fails
58
+ // closed until the config is populated (CCI-18607).
59
+ const allowedAgentTypes = expVal(REVIEW_MOMENT_AGENT_TYPES_CONFIG, 'value', []);
60
+ if (!allowedAgentTypes.includes(agentType)) {
61
+ return null;
62
+ }
52
63
  // The user the agent acted on behalf of (the requester). Optional/additive on the
53
64
  // step contract, so it may be absent.
54
65
  const actorUserId = typeof (agentStep === null || agentStep === void 0 ? void 0 : agentStep.userId) === 'string' ? agentStep.userId : undefined;
@@ -1,6 +1,11 @@
1
+ import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
1
2
  import { getCollabState } from '@atlaskit/prosemirror-collab';
2
3
  import { isPositionNeutralStep } from './agent-shimmer-ranges';
3
4
 
5
+ // Statsig dynamic config: which BE-streaming `agentType` values may open Review Moment.
6
+ // Code default is `[]` (fail closed) until the list is set in Statsig.
7
+ export var REVIEW_MOMENT_AGENT_TYPES_CONFIG = 'platform_editor_backend_review_moment_agent_types';
8
+
4
9
  // [CCI-17994] Post Stream Review ("Review moment") recording for BE streaming.
5
10
  //
6
11
  // Sibling to `getAgentShimmerRanges`: same idea of deriving what the agent wrote
@@ -53,6 +58,12 @@ export var getAgentEditSegments = function getAgentEditSegments(json, steps, tr,
53
58
  if (agentType === undefined) {
54
59
  return null;
55
60
  }
61
+ // Only record Review Moment for agentTypes allowlisted in Statsig. Default `[]` fails
62
+ // closed until the config is populated (CCI-18607).
63
+ var allowedAgentTypes = expVal(REVIEW_MOMENT_AGENT_TYPES_CONFIG, 'value', []);
64
+ if (!allowedAgentTypes.includes(agentType)) {
65
+ return null;
66
+ }
56
67
  // The user the agent acted on behalf of (the requester). Optional/additive on the
57
68
  // step contract, so it may be absent.
58
69
  var actorUserId = typeof (agentStep === null || agentStep === void 0 ? void 0 : agentStep.userId) === 'string' ? agentStep.userId : undefined;
@@ -2,6 +2,7 @@ import type { AgentRemoteEditReviewData } from '@atlaskit/editor-common/collab-a
2
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ export declare const REVIEW_MOMENT_AGENT_TYPES_CONFIG = "platform_editor_backend_review_moment_agent_types";
5
6
  /**
6
7
  * Derive per-change Review moment segments from an agent-authored remote-step
7
8
  * batch. Returns `null` when there is nothing to record (no agent steps, or a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "15.0.5",
3
+ "version": "15.0.6",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,6 +29,7 @@
29
29
  "@atlaskit/editor-prosemirror": "^8.0.0",
30
30
  "@atlaskit/editor-shared-styles": "^4.0.0",
31
31
  "@atlaskit/frontend-utilities": "^4.1.0",
32
+ "@atlaskit/platform-feature-experiments": "^0.3.0",
32
33
  "@atlaskit/platform-feature-flags": "^2.1.0",
33
34
  "@atlaskit/prosemirror-collab": "^1.0.0",
34
35
  "@atlaskit/tmp-editor-statsig": "^146.0.0",