@atlaskit/editor-plugin-show-diff 15.1.6 → 15.1.8
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 +45 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +5 -4
- package/dist/cjs/pm-plugins/decorations/colorSchemes/attributions.js +32 -7
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +25 -4
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +40 -14
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +14 -0
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +58 -7
- package/dist/cjs/ui/ContributorTag/buildContributorTagDom.js +70 -14
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +8 -2
- package/dist/cjs/ui/ContributorTag/contributorTagController.js +169 -150
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +5 -1
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +5 -4
- package/dist/es2019/pm-plugins/decorations/colorSchemes/attributions.js +17 -0
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +25 -4
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +40 -14
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +14 -0
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +57 -4
- package/dist/es2019/ui/ContributorTag/buildContributorTagDom.js +69 -13
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +8 -2
- package/dist/es2019/ui/ContributorTag/contributorTagController.js +164 -104
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +5 -1
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +5 -4
- package/dist/esm/pm-plugins/decorations/colorSchemes/attributions.js +32 -7
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +25 -4
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +40 -14
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +14 -0
- package/dist/esm/pm-plugins/resolveDiffContributors.js +58 -7
- package/dist/esm/ui/ContributorTag/buildContributorTagDom.js +69 -13
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +8 -2
- package/dist/esm/ui/ContributorTag/contributorTagController.js +171 -152
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +5 -1
- package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +8 -2
- package/dist/types/showDiffPluginType.d.ts +2 -2
- package/dist/types/ui/ContributorTag/buildContributorTagDom.d.ts +32 -3
- package/dist/types/ui/ContributorTag/contributorTagController.d.ts +32 -12
- package/dist/types/ui/ContributorTag/contributorTagIcons.d.ts +2 -2
- package/package.json +5 -5
|
@@ -3,6 +3,7 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
|
3
3
|
import { trackChangesMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { getBaseNodeTypeName } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
5
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { isExtendedEnabled } from '../../isExtendedEnabled';
|
|
8
9
|
import { applyRevealToElement } from '../revealStyles';
|
|
@@ -277,6 +278,16 @@ var applyInlineLeafNodeStyles = function applyInlineLeafNodeStyles(_ref8) {
|
|
|
277
278
|
});
|
|
278
279
|
});
|
|
279
280
|
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Editor CSS makes `blockquote` `inline-block` for its block formatting context. Inside a widget
|
|
284
|
+
* that collapses the indicator bar: the container is an inline `span`, so its anchor rect comes from
|
|
285
|
+
* font metrics, not from an inline-level child. `flow-root` keeps the formatting context but is
|
|
286
|
+
* block-level — unlike `block`, which lets the child paragraph's top margin collapse out.
|
|
287
|
+
*/
|
|
288
|
+
var quoteBlockLevelStyle = convertToInlineCss({
|
|
289
|
+
display: 'flow-root'
|
|
290
|
+
});
|
|
280
291
|
var applyTextLikeBlockNodeStyles = function applyTextLikeBlockNodeStyles(_ref9) {
|
|
281
292
|
var element = _ref9.element,
|
|
282
293
|
targetNode = _ref9.targetNode,
|
|
@@ -540,6 +551,9 @@ export var wrapBlockNodeView = function wrapBlockNodeView(_ref12) {
|
|
|
540
551
|
hideAddedDiffsUnderline: hideAddedDiffsUnderline,
|
|
541
552
|
highlightInlineLeafNodes: highlightInlineLeafNodes
|
|
542
553
|
});
|
|
554
|
+
if (targetNode.type.name === 'blockquote' && fg('platform_editor_ai_show_diff_patch_1')) {
|
|
555
|
+
appendStyleToElement(nodeView, quoteBlockLevelStyle);
|
|
556
|
+
}
|
|
543
557
|
dom.append(nodeView);
|
|
544
558
|
return;
|
|
545
559
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
5
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import { getAttributionKey } from './decorations/colorSchemes/attributions';
|
|
8
8
|
|
|
9
9
|
/** A brand name, so a literal rather than a translated message. */
|
|
@@ -11,6 +11,49 @@ var ROVO_AGENT_NAME = 'Rovo';
|
|
|
11
11
|
|
|
12
12
|
/** `agentType` values that render as "Rovo" rather than as a generic external agent. */
|
|
13
13
|
var ROVO_AGENT_TYPES = new Set(['convo-ai', 'rovo_chat']);
|
|
14
|
+
/** Known external agent types emitted by Confluence's agent identification service. */
|
|
15
|
+
var EXTERNAL_AGENT_PRESENTATIONS = {
|
|
16
|
+
claude: {
|
|
17
|
+
agentKind: 'claude',
|
|
18
|
+
name: 'Claude'
|
|
19
|
+
},
|
|
20
|
+
codex: {
|
|
21
|
+
agentKind: 'external',
|
|
22
|
+
name: 'Codex'
|
|
23
|
+
},
|
|
24
|
+
vscode: {
|
|
25
|
+
agentKind: 'external',
|
|
26
|
+
name: 'VS Code'
|
|
27
|
+
},
|
|
28
|
+
hermes: {
|
|
29
|
+
agentKind: 'external',
|
|
30
|
+
name: 'Hermes'
|
|
31
|
+
},
|
|
32
|
+
runlayer: {
|
|
33
|
+
agentKind: 'external',
|
|
34
|
+
name: 'Runlayer'
|
|
35
|
+
},
|
|
36
|
+
zed: {
|
|
37
|
+
agentKind: 'external',
|
|
38
|
+
name: 'Zed'
|
|
39
|
+
},
|
|
40
|
+
ampcode: {
|
|
41
|
+
agentKind: 'external',
|
|
42
|
+
name: 'Ampcode'
|
|
43
|
+
},
|
|
44
|
+
antigravity: {
|
|
45
|
+
agentKind: 'external',
|
|
46
|
+
name: 'Antigravity'
|
|
47
|
+
},
|
|
48
|
+
devin_cli: {
|
|
49
|
+
agentKind: 'external',
|
|
50
|
+
name: 'Devin CLI'
|
|
51
|
+
},
|
|
52
|
+
pi_agent: {
|
|
53
|
+
agentKind: 'external',
|
|
54
|
+
name: 'Pi Agent'
|
|
55
|
+
}
|
|
56
|
+
};
|
|
14
57
|
var hasAgentIdentity = function hasAgentIdentity(attribution) {
|
|
15
58
|
var _attribution$agentId, _attribution$agentTyp;
|
|
16
59
|
return Boolean(((_attribution$agentId = attribution.agentId) === null || _attribution$agentId === void 0 ? void 0 : _attribution$agentId.trim()) || ((_attribution$agentTyp = attribution.agentType) === null || _attribution$agentTyp === void 0 ? void 0 : _attribution$agentTyp.trim()));
|
|
@@ -35,9 +78,16 @@ var resolveUser = function resolveUser(userId, profilesByAccountId) {
|
|
|
35
78
|
} : undefined;
|
|
36
79
|
};
|
|
37
80
|
|
|
38
|
-
/**
|
|
81
|
+
/** Resolve branding or a profile first, then a known type name or the external-agent fallback. */
|
|
39
82
|
var resolveAgent = function resolveAgent(attribution, profilesByAccountId) {
|
|
40
|
-
var _attribution$
|
|
83
|
+
var _attribution$agentTyp2, _attribution$agentId2;
|
|
84
|
+
var agentType = (_attribution$agentTyp2 = attribution.agentType) === null || _attribution$agentTyp2 === void 0 ? void 0 : _attribution$agentTyp2.trim().toLowerCase();
|
|
85
|
+
var agentPresentation = agentType ? EXTERNAL_AGENT_PRESENTATIONS[agentType] : undefined;
|
|
86
|
+
if (agentPresentation && agentPresentation.agentKind !== 'external') {
|
|
87
|
+
return _objectSpread(_objectSpread({}, agentPresentation), {}, {
|
|
88
|
+
kind: 'agent'
|
|
89
|
+
});
|
|
90
|
+
}
|
|
41
91
|
var agentId = (_attribution$agentId2 = attribution.agentId) === null || _attribution$agentId2 === void 0 ? void 0 : _attribution$agentId2.trim();
|
|
42
92
|
var agentProfile = agentId ? profilesByAccountId.get(agentId) : undefined;
|
|
43
93
|
if (agentProfile) {
|
|
@@ -48,14 +98,15 @@ var resolveAgent = function resolveAgent(attribution, profilesByAccountId) {
|
|
|
48
98
|
name: agentProfile.name
|
|
49
99
|
};
|
|
50
100
|
}
|
|
51
|
-
var agentType = (_attribution$agentTyp2 = attribution.agentType) === null || _attribution$agentTyp2 === void 0 ? void 0 : _attribution$agentTyp2.trim().toLowerCase();
|
|
52
101
|
|
|
53
|
-
//
|
|
102
|
+
// Unknown types keep an empty name for the tag's localised "External agent" label.
|
|
54
103
|
return agentType && ROVO_AGENT_TYPES.has(agentType) ? {
|
|
55
104
|
agentKind: 'rovo',
|
|
56
105
|
kind: 'agent',
|
|
57
106
|
name: ROVO_AGENT_NAME
|
|
58
|
-
} : {
|
|
107
|
+
} : agentPresentation ? _objectSpread(_objectSpread({}, agentPresentation), {}, {
|
|
108
|
+
kind: 'agent'
|
|
109
|
+
}) : {
|
|
59
110
|
agentKind: 'external',
|
|
60
111
|
kind: 'agent',
|
|
61
112
|
name: ''
|
|
@@ -4,43 +4,98 @@ export var CONTRIBUTOR_TAG_TESTID = 'diff-contributor-tag';
|
|
|
4
4
|
export var CONTRIBUTOR_TAG_NAME_TESTID = 'diff-contributor-tag-name';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Ceiling for the tag width. A constant rather than the width of the change: a change is routinely a
|
|
8
|
+
* word or two, and clamping to it ellipsised the contributor's name — the one thing the tag exists to
|
|
9
|
+
* show. Longer names are ellipsised into the tooltip.
|
|
9
10
|
*/
|
|
10
|
-
export var
|
|
11
|
+
export var MAX_TAG_WIDTH = '200px';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The tag sits on the line above the change, so it has to paint over that line to be readable —
|
|
15
|
+
* including any diff highlight already on it, which would otherwise slice straight through the tag.
|
|
16
|
+
* Hence one level above `akEditorUnitZIndex`, where the highlights sit; exported because the
|
|
17
|
+
* change's own highlight is stacked one level below it — see `stackBelowContributorTagStyle` in
|
|
18
|
+
* `createInlineChangedDecoration`.
|
|
19
|
+
*
|
|
20
|
+
* Painting above its own highlight is only safe because the tag can never reach it: `bottom: 100%`
|
|
21
|
+
* puts the root's bottom edge exactly on the highlight's top edge, and the root's `overflow: clip`
|
|
22
|
+
* keeps every pixel the tag paints inside it.
|
|
23
|
+
*/
|
|
24
|
+
export var CONTRIBUTOR_TAG_Z_INDEX = 2;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The plugin's whole side of the tag's motion: the fade and the hidden state are
|
|
28
|
+
* `contributorTagStyles` in both EditorContentContainer stylesheets, keyed on this literal and the
|
|
29
|
+
* one below — rename in step. This package cannot import `@atlaskit/editor-core` at runtime, so the
|
|
30
|
+
* plugin emits the hook and editor-core owns the rule, as `VanillaTooltip` does with
|
|
31
|
+
* `VANILLA_TOOLTIP_DEFAULT_CLASS`.
|
|
32
|
+
*/
|
|
33
|
+
export var CONTRIBUTOR_TAG_CLASS = 'ak-editor-diff-contributor-tag';
|
|
34
|
+
|
|
35
|
+
/** Toggled by the controller to move the tag between the fade's two ends. */
|
|
36
|
+
export var CONTRIBUTOR_TAG_REVEALED_ATTRIBUTE = 'data-revealed';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Backstop for removing a fading-out tag: a cancelled transition fires no `transitionend`. Must stay
|
|
40
|
+
* above the fade's 600ms, which lives in another package's stylesheet and cannot be read back as a
|
|
41
|
+
* number — hence the wide margin. Raise in step with that duration.
|
|
42
|
+
*/
|
|
43
|
+
export var TAG_EXIT_FALLBACK_MS = 1200;
|
|
11
44
|
|
|
12
45
|
// Positioned against the host widget its decoration renders on the change's first character:
|
|
13
46
|
// `bottom: 100%` lifts the tag onto the line above, `inset-inline-start` starts it on that
|
|
14
47
|
// character.
|
|
15
48
|
var constraintStyle = convertToInlineCss({
|
|
16
|
-
|
|
49
|
+
// `flex`, not `block`: a block box lays the tag on a line box whose strut is the *paragraph's*
|
|
50
|
+
// line-height (~24px) against the tag's ~20px, so `bottom: 100%` pins that leftover strut to the
|
|
51
|
+
// change and the tag floats above it. A flex container has no line box.
|
|
52
|
+
display: 'flex',
|
|
17
53
|
position: 'absolute',
|
|
18
54
|
bottom: '100%',
|
|
19
55
|
insetInlineStart: 0,
|
|
56
|
+
// On the root, since that is the absolutely positioned box; the tag below fills it.
|
|
57
|
+
maxWidth: MAX_TAG_WIDTH,
|
|
20
58
|
minWidth: 0,
|
|
21
|
-
//
|
|
22
|
-
|
|
59
|
+
// This box's bottom edge is the join with the highlight, and the tag paints *above* that
|
|
60
|
+
// highlight — so anything spilling past this edge would read as the tag laid on top of the change
|
|
61
|
+
// rather than attached to it. The reveal's `translateY` is exactly that spill: it starts the tag
|
|
62
|
+
// 4px low, and clipping the part that hangs over the highlight turns the rise into an unfurl out
|
|
63
|
+
// of the join. `clip`, not `hidden`: `hidden` would make this a scroll container, and focusing the
|
|
64
|
+
// tag mid-reveal would scroll it 4px out of alignment for good.
|
|
65
|
+
//
|
|
66
|
+
// The tooltip is unaffected — it is a `popover`, so it paints in the top layer, which no
|
|
67
|
+
// ancestor's clip reaches.
|
|
68
|
+
overflow: 'clip',
|
|
69
|
+
zIndex: CONTRIBUTOR_TAG_Z_INDEX,
|
|
23
70
|
// It renders inside the document and it is not content: dragging a selection across the change
|
|
24
71
|
// must not select it.
|
|
25
72
|
userSelect: 'none'
|
|
26
73
|
});
|
|
27
74
|
|
|
28
|
-
// `backgroundColor
|
|
29
|
-
//
|
|
75
|
+
// `backgroundColor` comes from the model, and is set by the controller. `opacity`, `pointer-events`
|
|
76
|
+
// and the transition between their two states are in `contributorTagStyles` — see
|
|
77
|
+
// `CONTRIBUTOR_TAG_CLASS`.
|
|
30
78
|
var tagStyle = convertToInlineCss({
|
|
31
79
|
display: 'inline-flex',
|
|
32
80
|
alignItems: 'center',
|
|
33
81
|
gap: "var(--ds-space-050, 4px)",
|
|
34
|
-
// Never wider than the
|
|
82
|
+
// Never wider than `MAX_TAG_WIDTH` on the root; overflow is ellipsised on the name below.
|
|
35
83
|
maxWidth: '100%',
|
|
36
84
|
minWidth: 0,
|
|
37
85
|
overflow: 'hidden',
|
|
38
86
|
paddingInline: "var(--ds-space-050, 4px)",
|
|
39
87
|
paddingBlock: "var(--ds-space-025, 2px)",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
88
|
+
// Top corners only: the bottom edge butts onto the change, and a rounded corner there would let
|
|
89
|
+
// the page background through at the join.
|
|
90
|
+
borderTopLeftRadius: "var(--ds-radius-small, 4px)",
|
|
91
|
+
borderTopRightRadius: "var(--ds-radius-small, 4px)",
|
|
92
|
+
borderBottomLeftRadius: 0,
|
|
93
|
+
borderBottomRightRadius: 0,
|
|
94
|
+
// Deliberately no bottom border: the change already carries the accent as its own underline, and
|
|
95
|
+
// a second rule directly above it reads as two objects rather than one label on one change.
|
|
96
|
+
//
|
|
97
|
+
// Deliberately no `elevation.shadow.overlay`: its `0 8px 12px` offset casts downwards onto the
|
|
98
|
+
// change, which reads as a gap between the tag and the content it captions.
|
|
44
99
|
font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
45
100
|
whiteSpace: 'nowrap',
|
|
46
101
|
boxSizing: 'border-box'
|
|
@@ -91,6 +146,7 @@ var createSpan = function createSpan(doc, style) {
|
|
|
91
146
|
export var buildContributorTagDom = function buildContributorTagDom(doc) {
|
|
92
147
|
var root = createSpan(doc, constraintStyle);
|
|
93
148
|
var tag = createSpan(doc, tagStyle, {
|
|
149
|
+
class: CONTRIBUTOR_TAG_CLASS,
|
|
94
150
|
'data-testid': CONTRIBUTOR_TAG_TESTID,
|
|
95
151
|
// Deliberately no `aria-label`: it would be announced ahead of the element's contents, but
|
|
96
152
|
// design requires the contributor *after* the change — hence the visually hidden label.
|
|
@@ -4,6 +4,12 @@ import { BORDER_WIDTH } from '@atlaskit/avatar/constants/default';
|
|
|
4
4
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
5
5
|
import { getContributorTagIcon } from './contributorTagIcons';
|
|
6
6
|
|
|
7
|
+
/** Agent kinds with a custom contributor-tag icon. */
|
|
8
|
+
var AGENT_KIND_ICONS = {
|
|
9
|
+
claude: 'claude',
|
|
10
|
+
rovo: 'rovoHex'
|
|
11
|
+
};
|
|
12
|
+
|
|
7
13
|
/** The size `@atlaskit/avatar`'s `xxsmall` rendered at. */
|
|
8
14
|
var AVATAR_SIZE = AVATAR_SIZES.xxsmall;
|
|
9
15
|
/** `xxsmall` also carried a `space.025` margin — the same 2px — which is where the ring is painted. */
|
|
@@ -81,7 +87,7 @@ export var contributorAvatarRenderer = function contributorAvatarRenderer(_ref)
|
|
|
81
87
|
var image;
|
|
82
88
|
var unbindImageError;
|
|
83
89
|
var showFallback = function showFallback() {
|
|
84
|
-
var _unbindImageError, _image;
|
|
90
|
+
var _unbindImageError, _image, _AGENT_KIND_ICONS, _contributor$agentKin;
|
|
85
91
|
(_unbindImageError = unbindImageError) === null || _unbindImageError === void 0 || _unbindImageError();
|
|
86
92
|
unbindImageError = undefined;
|
|
87
93
|
(_image = image) === null || _image === void 0 || _image.remove();
|
|
@@ -93,7 +99,7 @@ export var contributorAvatarRenderer = function contributorAvatarRenderer(_ref)
|
|
|
93
99
|
shape.appendChild(fallback);
|
|
94
100
|
return;
|
|
95
101
|
}
|
|
96
|
-
shape.appendChild(getContributorTagIcon(contributor.agentKind
|
|
102
|
+
shape.appendChild(getContributorTagIcon((_AGENT_KIND_ICONS = AGENT_KIND_ICONS[(_contributor$agentKin = contributor.agentKind) !== null && _contributor$agentKin !== void 0 ? _contributor$agentKin : 'external']) !== null && _AGENT_KIND_ICONS !== void 0 ? _AGENT_KIND_ICONS : 'aiBot', doc));
|
|
97
103
|
};
|
|
98
104
|
if (contributor.avatarUrl) {
|
|
99
105
|
image = doc.createElement('img');
|