@atlaskit/editor-plugin-show-diff 30.0.11 → 30.0.13

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/editor-plugin-show-diff
2
2
 
3
+ ## 30.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 30.0.12
10
+
11
+ ### Patch Changes
12
+
13
+ - [`ba8362b562ea6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ba8362b562ea6) -
14
+ EDITOR-10060 Renders the human avatar in a connected agent+human contributor tag 4px smaller
15
+ (12px) and overlapping the agent icon, instead of sitting flush beside it.
16
+ - Updated dependencies
17
+
3
18
  ## 30.0.11
4
19
 
5
20
  ### Patch Changes
package/compass.yml CHANGED
@@ -35,7 +35,7 @@ customFields:
35
35
  value: true
36
36
  - name: Reviewer Selection Mechanism
37
37
  type: text
38
- value: random(2)
38
+ value: randomTZIgnored(2)
39
39
  - name: Required Reviewer Approvals
40
40
  type: number
41
41
  value: 1
@@ -13,40 +13,35 @@ var _contributorTagIcons = require("./contributorTagIcons");
13
13
  var AVATAR_SIZE = _avatarSizes.AVATAR_SIZES.xxsmall;
14
14
  /** `xxsmall` also carried a `space.025` margin — the same 2px — which is where the ring is painted. */
15
15
  var AVATAR_RING_WIDTH = _default.BORDER_WIDTH;
16
- var AVATAR_BOX_SIZE = AVATAR_SIZE + AVATAR_RING_WIDTH * 2;
17
16
 
18
17
  /** Reused from `@atlaskit/avatar`'s `avatar-content`, so the two shapes cannot drift. */
19
18
  var HEXAGON_CLIP_PATH = 'polygon(45% 1.33975%, 46.5798% 0.60307%, 48.26352% 0.15192%, 50% 0%, 51.73648% 0.15192%, 53.4202% 0.60307%, 55% 1.33975%, 89.64102% 21.33975%, 91.06889% 22.33956%, 92.30146% 23.57212%, 93.30127% 25%, 94.03794% 26.5798%, 94.48909% 28.26352%, 94.64102% 30%, 94.64102% 70%, 94.48909% 71.73648%, 94.03794% 73.4202%, 93.30127% 75%, 92.30146% 76.42788%, 91.06889% 77.66044%, 89.64102% 78.66025%, 55% 98.66025%, 53.4202% 99.39693%, 51.73648% 99.84808%, 50% 100%, 48.26352% 99.84808%, 46.5798% 99.39693%, 45% 98.66025%, 10.35898% 78.66025%, 8.93111% 77.66044%, 7.69854% 76.42788%, 6.69873% 75%, 5.96206% 73.4202%, 5.51091% 71.73648%, 5.35898% 70%, 5.35898% 30%, 5.51091% 28.26352%, 5.96206% 26.5798%, 6.69873% 25%, 7.69854% 23.57212%, 8.93111% 22.33956%, 10.35898% 21.33975%)';
20
- var boxStyle = (0, _cssHelper.convertToInlineCss)({
21
- display: 'inline-flex',
22
- alignItems: 'center',
23
- justifyContent: 'center',
24
- flexShrink: 0,
25
- boxSizing: 'border-box',
26
- width: "".concat(AVATAR_BOX_SIZE, "px"),
27
- height: "".concat(AVATAR_BOX_SIZE, "px")
28
- });
29
19
 
30
- /** Agents get a drop shadow instead of a ring, so their box skips the ring's padding. */
31
- var agentBoxStyle = (0, _cssHelper.convertToInlineCss)({
32
- display: 'inline-flex',
33
- alignItems: 'center',
34
- justifyContent: 'center',
35
- flexShrink: 0,
36
- boxSizing: 'border-box',
37
- width: "".concat(AVATAR_SIZE, "px"),
38
- height: "".concat(AVATAR_SIZE, "px")
39
- });
40
- var shapeStyle = (0, _cssHelper.convertToInlineCss)({
41
- display: 'flex',
42
- alignItems: 'center',
43
- justifyContent: 'center',
44
- boxSizing: 'border-box',
45
- width: "".concat(AVATAR_SIZE, "px"),
46
- height: "".concat(AVATAR_SIZE, "px"),
47
- aspectRatio: '1/1',
48
- overflow: 'hidden'
49
- });
20
+ /** The avatar plus its ring. */
21
+ var getBoxStyle = function getBoxStyle(size, ringWidth) {
22
+ var boxSize = size + ringWidth * 2;
23
+ return (0, _cssHelper.convertToInlineCss)({
24
+ display: 'inline-flex',
25
+ alignItems: 'center',
26
+ justifyContent: 'center',
27
+ flexShrink: 0,
28
+ boxSizing: 'border-box',
29
+ width: "".concat(boxSize, "px"),
30
+ height: "".concat(boxSize, "px")
31
+ });
32
+ };
33
+ var getShapeStyle = function getShapeStyle(size) {
34
+ return (0, _cssHelper.convertToInlineCss)({
35
+ display: 'flex',
36
+ alignItems: 'center',
37
+ justifyContent: 'center',
38
+ boxSizing: 'border-box',
39
+ width: "".concat(size, "px"),
40
+ height: "".concat(size, "px"),
41
+ aspectRatio: '1/1',
42
+ overflow: 'hidden'
43
+ });
44
+ };
50
45
 
51
46
  /**
52
47
  * The shadow's colour per theme. In the dark theme `elevation.shadow.overflow.perimeter` is
@@ -88,10 +83,16 @@ var contributorAvatarRenderer = exports.contributorAvatarRenderer = function con
88
83
  var contributor = _ref.contributor,
89
84
  doc = _ref.doc,
90
85
  ringColor = _ref.ringColor,
86
+ _ref$ringWidth = _ref.ringWidth,
87
+ ringWidth = _ref$ringWidth === void 0 ? AVATAR_RING_WIDTH : _ref$ringWidth,
88
+ _ref$size = _ref.size,
89
+ size = _ref$size === void 0 ? AVATAR_SIZE : _ref$size,
91
90
  stackIndex = _ref.stackIndex;
92
91
  var isAgent = contributor.kind === 'agent';
93
92
  var element = doc.createElement('span');
94
- element.setAttribute('style', isAgent ? "".concat(agentBoxStyle, " ").concat(agentShadowStyle) : boxStyle);
93
+ // Agents get a drop shadow instead of a ring, so their box skips the ring's padding.
94
+ var boxStyle = getBoxStyle(size, isAgent ? 0 : ringWidth);
95
+ element.setAttribute('style', isAgent ? "".concat(boxStyle, " ").concat(agentShadowStyle) : boxStyle);
95
96
  // Decorative: the tag names its contributors in the visually hidden label its screen-reader
96
97
  // announcement comes from.
97
98
  element.setAttribute('aria-hidden', 'true');
@@ -99,7 +100,7 @@ var contributorAvatarRenderer = exports.contributorAvatarRenderer = function con
99
100
  element.style.setProperty('z-index', String(stackIndex));
100
101
  }
101
102
  var shape = doc.createElement('span');
102
- shape.setAttribute('style', shapeStyle);
103
+ shape.setAttribute('style', getShapeStyle(size));
103
104
  element.appendChild(shape);
104
105
  if (isAgent) {
105
106
  shape.style.setProperty('clip-path', HEXAGON_CLIP_PATH);
@@ -145,7 +146,7 @@ var contributorAvatarRenderer = exports.contributorAvatarRenderer = function con
145
146
  shape.style.setProperty('background', nextRingColor);
146
147
  return;
147
148
  }
148
- shape.style.setProperty('box-shadow', "0 0 0 ".concat(AVATAR_RING_WIDTH, "px ").concat(nextRingColor));
149
+ shape.style.setProperty('box-shadow', "0 0 0 ".concat(ringWidth, "px ").concat(nextRingColor));
149
150
  shape.style.setProperty('background', nextRingColor);
150
151
  };
151
152
  setRingColor(ringColor);
@@ -32,6 +32,13 @@ var getTagAccent = function getTagAccent(_ref) {
32
32
  return (0, _factory.getAccentTokens)(accent);
33
33
  };
34
34
 
35
+ /** Person's diameter in a connected pair. */
36
+ var CONNECTED_USER_AVATAR_SIZE = 12;
37
+ /** Px the person overlaps the agent. */
38
+ var CONNECTED_AVATAR_OVERLAP = 3;
39
+ /** Px of ring around the person in a connected pair. */
40
+ var CONNECTED_USER_RING_WIDTH = 1;
41
+
35
42
  /** Bespoke accents for agent kinds that use standard ADS tokens rather than the agent-color registry. */
36
43
  var BESPOKE_AGENT_ACCENTS = {
37
44
  rovo: {
@@ -342,29 +349,34 @@ var ContributorTagController = exports.ContributorTagController = /*#__PURE__*/f
342
349
  var agent = isPrimaryAgent ? model.contributor : model.connectedContributor;
343
350
 
344
351
  // Hand-rolled avatar stack: `@atlaskit/avatar-group` cannot render below 24px and the tag uses
345
- // 16px avatars.
352
+ // 16px avatars. A connected pair's person is smaller and overlaps the agent.
346
353
  var stack = model.connectedContributor ? [].concat((0, _toConsumableArray2.default)(agent ? [{
347
354
  contributor: agent,
348
- stackIndex: 1
355
+ stackIndex: 0
349
356
  }] : []), (0, _toConsumableArray2.default)(user ? [{
350
357
  contributor: user,
351
- stackIndex: 0
358
+ ringWidth: CONNECTED_USER_RING_WIDTH,
359
+ size: CONNECTED_USER_AVATAR_SIZE,
360
+ stackIndex: 1
352
361
  }] : [])) : [{
353
362
  contributor: model.contributor
354
363
  }];
355
364
  stack.forEach(function (_ref6, index) {
356
365
  var contributor = _ref6.contributor,
366
+ ringWidth = _ref6.ringWidth,
367
+ size = _ref6.size,
357
368
  stackIndex = _ref6.stackIndex;
358
369
  var avatar = (0, _contributorAvatarRenderer.contributorAvatarRenderer)({
359
370
  contributor: contributor,
360
371
  doc: doc,
361
372
  ringColor: background,
373
+ ringWidth: ringWidth,
374
+ size: size,
362
375
  stackIndex: stackIndex
363
376
  });
364
377
  if (index < stack.length - 1) {
365
- // Sits the leading avatar of a connected pair flush against the one behind it, with
366
- // no overlap and no extra gap.
367
- avatar.element.style.setProperty('margin-inline-end', '0');
378
+ // The person's ring cuts a gap into the agent.
379
+ avatar.element.style.setProperty('margin-inline-end', "-".concat(CONNECTED_AVATAR_OVERLAP, "px"));
368
380
  }
369
381
  container.appendChild(avatar.element);
370
382
  _this5.avatars.push(avatar);
@@ -1,4 +1,4 @@
1
- /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -1,4 +1,4 @@
1
- /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -8,37 +8,30 @@ import { getContributorTagIcon } from './contributorTagIcons';
8
8
  const AVATAR_SIZE = AVATAR_SIZES.xxsmall;
9
9
  /** `xxsmall` also carried a `space.025` margin — the same 2px — which is where the ring is painted. */
10
10
  const AVATAR_RING_WIDTH = BORDER_WIDTH;
11
- const AVATAR_BOX_SIZE = AVATAR_SIZE + AVATAR_RING_WIDTH * 2;
12
11
 
13
12
  /** Reused from `@atlaskit/avatar`'s `avatar-content`, so the two shapes cannot drift. */
14
13
  const HEXAGON_CLIP_PATH = 'polygon(45% 1.33975%, 46.5798% 0.60307%, 48.26352% 0.15192%, 50% 0%, 51.73648% 0.15192%, 53.4202% 0.60307%, 55% 1.33975%, 89.64102% 21.33975%, 91.06889% 22.33956%, 92.30146% 23.57212%, 93.30127% 25%, 94.03794% 26.5798%, 94.48909% 28.26352%, 94.64102% 30%, 94.64102% 70%, 94.48909% 71.73648%, 94.03794% 73.4202%, 93.30127% 75%, 92.30146% 76.42788%, 91.06889% 77.66044%, 89.64102% 78.66025%, 55% 98.66025%, 53.4202% 99.39693%, 51.73648% 99.84808%, 50% 100%, 48.26352% 99.84808%, 46.5798% 99.39693%, 45% 98.66025%, 10.35898% 78.66025%, 8.93111% 77.66044%, 7.69854% 76.42788%, 6.69873% 75%, 5.96206% 73.4202%, 5.51091% 71.73648%, 5.35898% 70%, 5.35898% 30%, 5.51091% 28.26352%, 5.96206% 26.5798%, 6.69873% 25%, 7.69854% 23.57212%, 8.93111% 22.33956%, 10.35898% 21.33975%)';
15
- const boxStyle = convertToInlineCss({
16
- display: 'inline-flex',
17
- alignItems: 'center',
18
- justifyContent: 'center',
19
- flexShrink: 0,
20
- boxSizing: 'border-box',
21
- width: `${AVATAR_BOX_SIZE}px`,
22
- height: `${AVATAR_BOX_SIZE}px`
23
- });
24
14
 
25
- /** Agents get a drop shadow instead of a ring, so their box skips the ring's padding. */
26
- const agentBoxStyle = convertToInlineCss({
27
- display: 'inline-flex',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- flexShrink: 0,
31
- boxSizing: 'border-box',
32
- width: `${AVATAR_SIZE}px`,
33
- height: `${AVATAR_SIZE}px`
34
- });
35
- const shapeStyle = convertToInlineCss({
15
+ /** The avatar plus its ring. */
16
+ const getBoxStyle = (size, ringWidth) => {
17
+ const boxSize = size + ringWidth * 2;
18
+ return convertToInlineCss({
19
+ display: 'inline-flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ flexShrink: 0,
23
+ boxSizing: 'border-box',
24
+ width: `${boxSize}px`,
25
+ height: `${boxSize}px`
26
+ });
27
+ };
28
+ const getShapeStyle = size => convertToInlineCss({
36
29
  display: 'flex',
37
30
  alignItems: 'center',
38
31
  justifyContent: 'center',
39
32
  boxSizing: 'border-box',
40
- width: `${AVATAR_SIZE}px`,
41
- height: `${AVATAR_SIZE}px`,
33
+ width: `${size}px`,
34
+ height: `${size}px`,
42
35
  aspectRatio: '1/1',
43
36
  overflow: 'hidden'
44
37
  });
@@ -83,11 +76,15 @@ export const contributorAvatarRenderer = ({
83
76
  contributor,
84
77
  doc,
85
78
  ringColor,
79
+ ringWidth = AVATAR_RING_WIDTH,
80
+ size = AVATAR_SIZE,
86
81
  stackIndex
87
82
  }) => {
88
83
  const isAgent = contributor.kind === 'agent';
89
84
  const element = doc.createElement('span');
90
- element.setAttribute('style', isAgent ? `${agentBoxStyle} ${agentShadowStyle}` : boxStyle);
85
+ // Agents get a drop shadow instead of a ring, so their box skips the ring's padding.
86
+ const boxStyle = getBoxStyle(size, isAgent ? 0 : ringWidth);
87
+ element.setAttribute('style', isAgent ? `${boxStyle} ${agentShadowStyle}` : boxStyle);
91
88
  // Decorative: the tag names its contributors in the visually hidden label its screen-reader
92
89
  // announcement comes from.
93
90
  element.setAttribute('aria-hidden', 'true');
@@ -95,7 +92,7 @@ export const contributorAvatarRenderer = ({
95
92
  element.style.setProperty('z-index', String(stackIndex));
96
93
  }
97
94
  const shape = doc.createElement('span');
98
- shape.setAttribute('style', shapeStyle);
95
+ shape.setAttribute('style', getShapeStyle(size));
99
96
  element.appendChild(shape);
100
97
  if (isAgent) {
101
98
  shape.style.setProperty('clip-path', HEXAGON_CLIP_PATH);
@@ -141,7 +138,7 @@ export const contributorAvatarRenderer = ({
141
138
  shape.style.setProperty('background', nextRingColor);
142
139
  return;
143
140
  }
144
- shape.style.setProperty('box-shadow', `0 0 0 ${AVATAR_RING_WIDTH}px ${nextRingColor}`);
141
+ shape.style.setProperty('box-shadow', `0 0 0 ${ringWidth}px ${nextRingColor}`);
145
142
  shape.style.setProperty('background', nextRingColor);
146
143
  };
147
144
  setRingColor(ringColor);
@@ -21,6 +21,13 @@ const getTagAccent = ({
21
21
  return getAccentTokens(accent);
22
22
  };
23
23
 
24
+ /** Person's diameter in a connected pair. */
25
+ const CONNECTED_USER_AVATAR_SIZE = 12;
26
+ /** Px the person overlaps the agent. */
27
+ const CONNECTED_AVATAR_OVERLAP = 3;
28
+ /** Px of ring around the person in a connected pair. */
29
+ const CONNECTED_USER_RING_WIDTH = 1;
30
+
24
31
  /** Bespoke accents for agent kinds that use standard ADS tokens rather than the agent-color registry. */
25
32
  const BESPOKE_AGENT_ACCENTS = {
26
33
  rovo: {
@@ -298,30 +305,35 @@ export class ContributorTagController {
298
305
  const agent = isPrimaryAgent ? model.contributor : model.connectedContributor;
299
306
 
300
307
  // Hand-rolled avatar stack: `@atlaskit/avatar-group` cannot render below 24px and the tag uses
301
- // 16px avatars.
308
+ // 16px avatars. A connected pair's person is smaller and overlaps the agent.
302
309
  const stack = model.connectedContributor ? [...(agent ? [{
303
310
  contributor: agent,
304
- stackIndex: 1
311
+ stackIndex: 0
305
312
  }] : []), ...(user ? [{
306
313
  contributor: user,
307
- stackIndex: 0
314
+ ringWidth: CONNECTED_USER_RING_WIDTH,
315
+ size: CONNECTED_USER_AVATAR_SIZE,
316
+ stackIndex: 1
308
317
  }] : [])] : [{
309
318
  contributor: model.contributor
310
319
  }];
311
320
  stack.forEach(({
312
321
  contributor,
322
+ ringWidth,
323
+ size,
313
324
  stackIndex
314
325
  }, index) => {
315
326
  const avatar = contributorAvatarRenderer({
316
327
  contributor,
317
328
  doc,
318
329
  ringColor: background,
330
+ ringWidth,
331
+ size,
319
332
  stackIndex
320
333
  });
321
334
  if (index < stack.length - 1) {
322
- // Sits the leading avatar of a connected pair flush against the one behind it, with
323
- // no overlap and no extra gap.
324
- avatar.element.style.setProperty('margin-inline-end', '0');
335
+ // The person's ring cuts a gap into the agent.
336
+ avatar.element.style.setProperty('margin-inline-end', `-${CONNECTED_AVATAR_OVERLAP}px`);
325
337
  }
326
338
  container.appendChild(avatar.element);
327
339
  this.avatars.push(avatar);
@@ -1,4 +1,4 @@
1
- /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./IndicatorBar.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import { ax, ix } from "@compiled/react/runtime";
3
3
  import React from 'react';
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
@@ -8,40 +8,35 @@ import { getContributorTagIcon } from './contributorTagIcons';
8
8
  var AVATAR_SIZE = AVATAR_SIZES.xxsmall;
9
9
  /** `xxsmall` also carried a `space.025` margin — the same 2px — which is where the ring is painted. */
10
10
  var AVATAR_RING_WIDTH = BORDER_WIDTH;
11
- var AVATAR_BOX_SIZE = AVATAR_SIZE + AVATAR_RING_WIDTH * 2;
12
11
 
13
12
  /** Reused from `@atlaskit/avatar`'s `avatar-content`, so the two shapes cannot drift. */
14
13
  var HEXAGON_CLIP_PATH = 'polygon(45% 1.33975%, 46.5798% 0.60307%, 48.26352% 0.15192%, 50% 0%, 51.73648% 0.15192%, 53.4202% 0.60307%, 55% 1.33975%, 89.64102% 21.33975%, 91.06889% 22.33956%, 92.30146% 23.57212%, 93.30127% 25%, 94.03794% 26.5798%, 94.48909% 28.26352%, 94.64102% 30%, 94.64102% 70%, 94.48909% 71.73648%, 94.03794% 73.4202%, 93.30127% 75%, 92.30146% 76.42788%, 91.06889% 77.66044%, 89.64102% 78.66025%, 55% 98.66025%, 53.4202% 99.39693%, 51.73648% 99.84808%, 50% 100%, 48.26352% 99.84808%, 46.5798% 99.39693%, 45% 98.66025%, 10.35898% 78.66025%, 8.93111% 77.66044%, 7.69854% 76.42788%, 6.69873% 75%, 5.96206% 73.4202%, 5.51091% 71.73648%, 5.35898% 70%, 5.35898% 30%, 5.51091% 28.26352%, 5.96206% 26.5798%, 6.69873% 25%, 7.69854% 23.57212%, 8.93111% 22.33956%, 10.35898% 21.33975%)';
15
- var boxStyle = convertToInlineCss({
16
- display: 'inline-flex',
17
- alignItems: 'center',
18
- justifyContent: 'center',
19
- flexShrink: 0,
20
- boxSizing: 'border-box',
21
- width: "".concat(AVATAR_BOX_SIZE, "px"),
22
- height: "".concat(AVATAR_BOX_SIZE, "px")
23
- });
24
14
 
25
- /** Agents get a drop shadow instead of a ring, so their box skips the ring's padding. */
26
- var agentBoxStyle = convertToInlineCss({
27
- display: 'inline-flex',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- flexShrink: 0,
31
- boxSizing: 'border-box',
32
- width: "".concat(AVATAR_SIZE, "px"),
33
- height: "".concat(AVATAR_SIZE, "px")
34
- });
35
- var shapeStyle = convertToInlineCss({
36
- display: 'flex',
37
- alignItems: 'center',
38
- justifyContent: 'center',
39
- boxSizing: 'border-box',
40
- width: "".concat(AVATAR_SIZE, "px"),
41
- height: "".concat(AVATAR_SIZE, "px"),
42
- aspectRatio: '1/1',
43
- overflow: 'hidden'
44
- });
15
+ /** The avatar plus its ring. */
16
+ var getBoxStyle = function getBoxStyle(size, ringWidth) {
17
+ var boxSize = size + ringWidth * 2;
18
+ return convertToInlineCss({
19
+ display: 'inline-flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ flexShrink: 0,
23
+ boxSizing: 'border-box',
24
+ width: "".concat(boxSize, "px"),
25
+ height: "".concat(boxSize, "px")
26
+ });
27
+ };
28
+ var getShapeStyle = function getShapeStyle(size) {
29
+ return convertToInlineCss({
30
+ display: 'flex',
31
+ alignItems: 'center',
32
+ justifyContent: 'center',
33
+ boxSizing: 'border-box',
34
+ width: "".concat(size, "px"),
35
+ height: "".concat(size, "px"),
36
+ aspectRatio: '1/1',
37
+ overflow: 'hidden'
38
+ });
39
+ };
45
40
 
46
41
  /**
47
42
  * The shadow's colour per theme. In the dark theme `elevation.shadow.overflow.perimeter` is
@@ -83,10 +78,16 @@ export var contributorAvatarRenderer = function contributorAvatarRenderer(_ref)
83
78
  var contributor = _ref.contributor,
84
79
  doc = _ref.doc,
85
80
  ringColor = _ref.ringColor,
81
+ _ref$ringWidth = _ref.ringWidth,
82
+ ringWidth = _ref$ringWidth === void 0 ? AVATAR_RING_WIDTH : _ref$ringWidth,
83
+ _ref$size = _ref.size,
84
+ size = _ref$size === void 0 ? AVATAR_SIZE : _ref$size,
86
85
  stackIndex = _ref.stackIndex;
87
86
  var isAgent = contributor.kind === 'agent';
88
87
  var element = doc.createElement('span');
89
- element.setAttribute('style', isAgent ? "".concat(agentBoxStyle, " ").concat(agentShadowStyle) : boxStyle);
88
+ // Agents get a drop shadow instead of a ring, so their box skips the ring's padding.
89
+ var boxStyle = getBoxStyle(size, isAgent ? 0 : ringWidth);
90
+ element.setAttribute('style', isAgent ? "".concat(boxStyle, " ").concat(agentShadowStyle) : boxStyle);
90
91
  // Decorative: the tag names its contributors in the visually hidden label its screen-reader
91
92
  // announcement comes from.
92
93
  element.setAttribute('aria-hidden', 'true');
@@ -94,7 +95,7 @@ export var contributorAvatarRenderer = function contributorAvatarRenderer(_ref)
94
95
  element.style.setProperty('z-index', String(stackIndex));
95
96
  }
96
97
  var shape = doc.createElement('span');
97
- shape.setAttribute('style', shapeStyle);
98
+ shape.setAttribute('style', getShapeStyle(size));
98
99
  element.appendChild(shape);
99
100
  if (isAgent) {
100
101
  shape.style.setProperty('clip-path', HEXAGON_CLIP_PATH);
@@ -140,7 +141,7 @@ export var contributorAvatarRenderer = function contributorAvatarRenderer(_ref)
140
141
  shape.style.setProperty('background', nextRingColor);
141
142
  return;
142
143
  }
143
- shape.style.setProperty('box-shadow', "0 0 0 ".concat(AVATAR_RING_WIDTH, "px ").concat(nextRingColor));
144
+ shape.style.setProperty('box-shadow', "0 0 0 ".concat(ringWidth, "px ").concat(nextRingColor));
144
145
  shape.style.setProperty('background', nextRingColor);
145
146
  };
146
147
  setRingColor(ringColor);
@@ -25,6 +25,13 @@ var getTagAccent = function getTagAccent(_ref) {
25
25
  return getAccentTokens(accent);
26
26
  };
27
27
 
28
+ /** Person's diameter in a connected pair. */
29
+ var CONNECTED_USER_AVATAR_SIZE = 12;
30
+ /** Px the person overlaps the agent. */
31
+ var CONNECTED_AVATAR_OVERLAP = 3;
32
+ /** Px of ring around the person in a connected pair. */
33
+ var CONNECTED_USER_RING_WIDTH = 1;
34
+
28
35
  /** Bespoke accents for agent kinds that use standard ADS tokens rather than the agent-color registry. */
29
36
  var BESPOKE_AGENT_ACCENTS = {
30
37
  rovo: {
@@ -335,29 +342,34 @@ export var ContributorTagController = /*#__PURE__*/function () {
335
342
  var agent = isPrimaryAgent ? model.contributor : model.connectedContributor;
336
343
 
337
344
  // Hand-rolled avatar stack: `@atlaskit/avatar-group` cannot render below 24px and the tag uses
338
- // 16px avatars.
345
+ // 16px avatars. A connected pair's person is smaller and overlaps the agent.
339
346
  var stack = model.connectedContributor ? [].concat(_toConsumableArray(agent ? [{
340
347
  contributor: agent,
341
- stackIndex: 1
348
+ stackIndex: 0
342
349
  }] : []), _toConsumableArray(user ? [{
343
350
  contributor: user,
344
- stackIndex: 0
351
+ ringWidth: CONNECTED_USER_RING_WIDTH,
352
+ size: CONNECTED_USER_AVATAR_SIZE,
353
+ stackIndex: 1
345
354
  }] : [])) : [{
346
355
  contributor: model.contributor
347
356
  }];
348
357
  stack.forEach(function (_ref6, index) {
349
358
  var contributor = _ref6.contributor,
359
+ ringWidth = _ref6.ringWidth,
360
+ size = _ref6.size,
350
361
  stackIndex = _ref6.stackIndex;
351
362
  var avatar = contributorAvatarRenderer({
352
363
  contributor: contributor,
353
364
  doc: doc,
354
365
  ringColor: background,
366
+ ringWidth: ringWidth,
367
+ size: size,
355
368
  stackIndex: stackIndex
356
369
  });
357
370
  if (index < stack.length - 1) {
358
- // Sits the leading avatar of a connected pair flush against the one behind it, with
359
- // no overlap and no extra gap.
360
- avatar.element.style.setProperty('margin-inline-end', '0');
371
+ // The person's ring cuts a gap into the agent.
372
+ avatar.element.style.setProperty('margin-inline-end', "-".concat(CONNECTED_AVATAR_OVERLAP, "px"));
361
373
  }
362
374
  container.appendChild(avatar.element);
363
375
  _this5.avatars.push(avatar);
@@ -1,4 +1,4 @@
1
- /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBar.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./IndicatorBar.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* IndicatorBarContentComponent.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import { ax, ix } from "@compiled/react/runtime";
3
3
  import React from 'react';
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
@@ -13,10 +13,14 @@ export type ContributorAvatar = {
13
13
  * `box-shadow` on the circle and a second clipped hexagon behind the agent, since `box-shadow` is
14
14
  * cut away by `clip-path`.
15
15
  */
16
- export declare const contributorAvatarRenderer: ({ contributor, doc, ringColor, stackIndex, }: {
16
+ export declare const contributorAvatarRenderer: ({ contributor, doc, ringColor, ringWidth, size, stackIndex, }: {
17
17
  contributor: TagContributor;
18
18
  doc: Document;
19
19
  ringColor: string;
20
- /** Paints the leading avatar of a connected pair over the one it overlaps. */
20
+ /** Ring width in px around a person. */
21
+ ringWidth?: number;
22
+ /** Diameter in px. */
23
+ size?: number;
24
+ /** Paints above lower indexes: the person (1) over the agent (0) in a connected pair. */
21
25
  stackIndex?: number;
22
26
  }) => ContributorAvatar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-show-diff",
3
- "version": "30.0.11",
3
+ "version": "30.0.13",
4
4
  "description": "ShowDiff plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,8 +39,8 @@
39
39
  "@atlaskit/platform-feature-experiments": "^0.3.0",
40
40
  "@atlaskit/platform-feature-flags": "^2.2.0",
41
41
  "@atlaskit/primitives": "^22.7.0",
42
- "@atlaskit/tmp-editor-statsig": "^260.0.0",
43
- "@atlaskit/tokens": "^20.10.0",
42
+ "@atlaskit/tmp-editor-statsig": "^261.0.0",
43
+ "@atlaskit/tokens": "^20.11.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^1.0.2",
46
46
  "bind-event-listener": "^3.0.0",
@@ -50,11 +50,11 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@atlaskit/adf-utils": "^20.9.0",
53
- "@atlaskit/button": "^25.7.0",
53
+ "@atlaskit/button": "^25.8.0",
54
54
  "@atlaskit/css": "^1.1.0",
55
- "@atlaskit/dropdown-menu": "^21.1.0",
56
- "@atlaskit/editor-common": "^134.9.0",
57
- "@atlaskit/editor-core": "^242.1.0",
55
+ "@atlaskit/dropdown-menu": "^21.3.0",
56
+ "@atlaskit/editor-common": "^134.16.0",
57
+ "@atlaskit/editor-core": "^242.3.0",
58
58
  "@atlaskit/editor-json-transformer": "^10.0.0",
59
59
  "@atlaskit/editor-plugins": "^17.0.0",
60
60
  "@atlaskit/form": "^18.3.0",
@@ -65,14 +65,14 @@
65
65
  "@atlassian/confluence-presets": "workspace:^",
66
66
  "@atlassian/content-reconciliation": "^0.1.3506",
67
67
  "@atlassian/editor-ai-injected-editors": "^46.0.0",
68
- "@atlassian/editor-plugin-ai": "^84.7.0",
68
+ "@atlassian/editor-plugin-ai": "^84.13.0",
69
69
  "@atlassian/structured-docs-types": "workspace:^",
70
70
  "react": "^19.2.0",
71
71
  "react-dom": "^19.2.0",
72
72
  "react-intl": "^7.0.0"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^134.9.0",
75
+ "@atlaskit/editor-common": "^134.16.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"