@atlaskit/editor-plugin-show-diff 27.0.2 → 27.1.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,17 @@
1
1
  # @atlaskit/editor-plugin-show-diff
2
2
 
3
+ ## 27.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1a9b1697e578d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a9b1697e578d) -
8
+ Propagate named agent IDs through suggestion diff attribution so OOTB agent colour overrides are
9
+ applied.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 27.0.2
4
16
 
5
17
  ### Patch Changes
@@ -164,6 +164,9 @@ var isContributorTagsEnabled = exports.isContributorTagsEnabled = function isCon
164
164
  return getAttributionKey(attribution) !== undefined;
165
165
  })) && contributors !== undefined && Object.keys(contributors).length > 0;
166
166
  };
167
+ var getAttributionParticipantColor = function getAttributionParticipantColor(attribution, identity, contributors) {
168
+ return (0, _utils.getParticipantColor)(identity.colorSeed, getAgentBrandForColor(attribution, contributors), attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId);
169
+ };
167
170
  var createAttributionColorMap = exports.createAttributionColorMap = function createAttributionColorMap(stepAttributions, contributors) {
168
171
  var colors = new Map();
169
172
  var allocatedColors = new Set();
@@ -179,9 +182,9 @@ var createAttributionColorMap = exports.createAttributionColorMap = function cre
179
182
  if (!identity) {
180
183
  continue;
181
184
  }
182
- var _getParticipantColor = (0, _utils.getParticipantColor)(identity.colorSeed, getAgentBrandForColor(attribution, contributors)),
183
- index = _getParticipantColor.index,
184
- isFixed = _getParticipantColor.isFixed;
185
+ var _getAttributionPartic = getAttributionParticipantColor(attribution, identity, contributors),
186
+ index = _getAttributionPartic.index,
187
+ isFixed = _getAttributionPartic.isFixed;
185
188
  var color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
186
189
  if (isFixed && color) {
187
190
  colors.set(identity.key, color);
@@ -202,8 +205,8 @@ var createAttributionColorMap = exports.createAttributionColorMap = function cre
202
205
  if (!_identity || colors.has(_identity.key)) {
203
206
  continue;
204
207
  }
205
- var _getParticipantColor2 = (0, _utils.getParticipantColor)(_identity.colorSeed, getAgentBrandForColor(_attribution, contributors)),
206
- _index = _getParticipantColor2.index;
208
+ var _getAttributionPartic2 = getAttributionParticipantColor(_attribution, _identity, contributors),
209
+ _index = _getAttributionPartic2.index;
207
210
  var hashedColor = getSlotColor(_index);
208
211
  if (!hashedColor) {
209
212
  continue;
@@ -18,7 +18,8 @@ exports.DIFF_AGENT_BRANDS = exports.ASSERT_DIFF_AGENT_BRANDS_ARE_REGISTERED = vo
18
18
  *
19
19
  * `userId` is the primary actor identity. `agentId` distinguishes multiple agents (or an agent
20
20
  * from its user) when they share that user ID, with `agentType` used as a fallback when `agentId`
21
- * is empty. `wasOffline` preserves additional provenance without affecting identity.
21
+ * is empty. `agentNamedId` carries a stable external configuration reference for presentation
22
+ * overrides. `wasOffline` preserves additional provenance without affecting identity.
22
23
  */
23
24
 
24
25
  /** Keeps a step and its attribution coupled through mapping and filtering. */
@@ -131,6 +131,7 @@ export const isAttributionColoringEnabled = stepAttributions => {
131
131
  * a tag only has to name one.
132
132
  */
133
133
  export const isContributorTagsEnabled = (stepAttributions, contributors) => areAttributionColorGatesEnabled() && Boolean(stepAttributions === null || stepAttributions === void 0 ? void 0 : stepAttributions.some(attribution => getAttributionKey(attribution) !== undefined)) && contributors !== undefined && Object.keys(contributors).length > 0;
134
+ const getAttributionParticipantColor = (attribution, identity, contributors) => getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors), attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId);
134
135
  export const createAttributionColorMap = (stepAttributions, contributors) => {
135
136
  const colors = new Map();
136
137
  const allocatedColors = new Set();
@@ -145,7 +146,7 @@ export const createAttributionColorMap = (stepAttributions, contributors) => {
145
146
  const {
146
147
  index,
147
148
  isFixed
148
- } = getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors));
149
+ } = getAttributionParticipantColor(attribution, identity, contributors);
149
150
  const color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
150
151
  if (isFixed && color) {
151
152
  colors.set(identity.key, color);
@@ -159,7 +160,7 @@ export const createAttributionColorMap = (stepAttributions, contributors) => {
159
160
  }
160
161
  const {
161
162
  index
162
- } = getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors));
163
+ } = getAttributionParticipantColor(attribution, identity, contributors);
163
164
  const hashedColor = getSlotColor(index);
164
165
  if (!hashedColor) {
165
166
  continue;
@@ -12,7 +12,8 @@
12
12
  *
13
13
  * `userId` is the primary actor identity. `agentId` distinguishes multiple agents (or an agent
14
14
  * from its user) when they share that user ID, with `agentType` used as a fallback when `agentId`
15
- * is empty. `wasOffline` preserves additional provenance without affecting identity.
15
+ * is empty. `agentNamedId` carries a stable external configuration reference for presentation
16
+ * overrides. `wasOffline` preserves additional provenance without affecting identity.
16
17
  */
17
18
 
18
19
  /** Keeps a step and its attribution coupled through mapping and filtering. */
@@ -158,6 +158,9 @@ export var isContributorTagsEnabled = function isContributorTagsEnabled(stepAttr
158
158
  return getAttributionKey(attribution) !== undefined;
159
159
  })) && contributors !== undefined && Object.keys(contributors).length > 0;
160
160
  };
161
+ var getAttributionParticipantColor = function getAttributionParticipantColor(attribution, identity, contributors) {
162
+ return getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors), attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId);
163
+ };
161
164
  export var createAttributionColorMap = function createAttributionColorMap(stepAttributions, contributors) {
162
165
  var colors = new Map();
163
166
  var allocatedColors = new Set();
@@ -173,9 +176,9 @@ export var createAttributionColorMap = function createAttributionColorMap(stepAt
173
176
  if (!identity) {
174
177
  continue;
175
178
  }
176
- var _getParticipantColor = getParticipantColor(identity.colorSeed, getAgentBrandForColor(attribution, contributors)),
177
- index = _getParticipantColor.index,
178
- isFixed = _getParticipantColor.isFixed;
179
+ var _getAttributionPartic = getAttributionParticipantColor(attribution, identity, contributors),
180
+ index = _getAttributionPartic.index,
181
+ isFixed = _getAttributionPartic.isFixed;
179
182
  var color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
180
183
  if (isFixed && color) {
181
184
  colors.set(identity.key, color);
@@ -196,8 +199,8 @@ export var createAttributionColorMap = function createAttributionColorMap(stepAt
196
199
  if (!_identity || colors.has(_identity.key)) {
197
200
  continue;
198
201
  }
199
- var _getParticipantColor2 = getParticipantColor(_identity.colorSeed, getAgentBrandForColor(_attribution, contributors)),
200
- _index = _getParticipantColor2.index;
202
+ var _getAttributionPartic2 = getAttributionParticipantColor(_attribution, _identity, contributors),
203
+ _index = _getAttributionPartic2.index;
201
204
  var hashedColor = getSlotColor(_index);
202
205
  if (!hashedColor) {
203
206
  continue;
@@ -12,7 +12,8 @@
12
12
  *
13
13
  * `userId` is the primary actor identity. `agentId` distinguishes multiple agents (or an agent
14
14
  * from its user) when they share that user ID, with `agentType` used as a fallback when `agentId`
15
- * is empty. `wasOffline` preserves additional provenance without affecting identity.
15
+ * is empty. `agentNamedId` carries a stable external configuration reference for presentation
16
+ * overrides. `wasOffline` preserves additional provenance without affecting identity.
16
17
  */
17
18
 
18
19
  /** Keeps a step and its attribution coupled through mapping and filtering. */
@@ -26,10 +26,12 @@ export type DiffType = 'inline' | 'block' | 'step' | 'smart';
26
26
  *
27
27
  * `userId` is the primary actor identity. `agentId` distinguishes multiple agents (or an agent
28
28
  * from its user) when they share that user ID, with `agentType` used as a fallback when `agentId`
29
- * is empty. `wasOffline` preserves additional provenance without affecting identity.
29
+ * is empty. `agentNamedId` carries a stable external configuration reference for presentation
30
+ * overrides. `wasOffline` preserves additional provenance without affecting identity.
30
31
  */
31
32
  export type DiffStepAttribution = {
32
33
  agentId?: string;
34
+ agentNamedId?: string;
33
35
  agentType?: string;
34
36
  userId?: string;
35
37
  wasOffline?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "27.0.2",
3
+ "version": "27.1.0",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/editor-plugin-limited-mode": "^26.0.0",
35
35
  "@atlaskit/editor-plugin-user-intent": "^27.0.0",
36
36
  "@atlaskit/editor-prosemirror": "^9.0.0",
37
- "@atlaskit/editor-shared-styles": "^4.5.0",
37
+ "@atlaskit/editor-shared-styles": "^4.6.0",
38
38
  "@atlaskit/editor-tables": "^3.2.0",
39
39
  "@atlaskit/platform-feature-experiments": "^0.3.0",
40
40
  "@atlaskit/platform-feature-flags": "^2.2.0",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@atlaskit/adf-utils": "^20.9.0",
53
- "@atlaskit/button": "^25.5.0",
53
+ "@atlaskit/button": "^25.6.0",
54
54
  "@atlaskit/css": "^1.1.0",
55
55
  "@atlaskit/dropdown-menu": "^21.0.0",
56
56
  "@atlaskit/editor-core": "^239.0.0",
@@ -71,7 +71,7 @@
71
71
  "react-intl": "^7.0.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^133.1.0",
74
+ "@atlaskit/editor-common": "^133.3.0",
75
75
  "react": "^18.2.0 || ^19.2.0",
76
76
  "react-dom": "^18.2.0 || ^19.2.0",
77
77
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"