@atlaskit/editor-plugin-show-diff 19.0.2 → 19.0.4
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 +17 -0
- package/dist/cjs/pm-plugins/calculateDiff/calculateDiffDecorations.js +57 -93
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/cjs/pm-plugins/decorations/colorSchemes/standard.js +1 -26
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.js +12 -24
- package/dist/cjs/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/cjs/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.js +8 -16
- package/dist/cjs/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +7 -22
- package/dist/cjs/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -52
- package/dist/cjs/pm-plugins/decorations/decorationKeys.js +6 -14
- package/dist/cjs/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +3 -8
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeView.js +132 -205
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +13 -20
- package/dist/cjs/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -10
- package/dist/cjs/pm-plugins/getDefaultDiffType.js +10 -0
- package/dist/cjs/pm-plugins/getScrollableDecorations.js +5 -15
- package/dist/cjs/pm-plugins/main.js +45 -53
- package/dist/cjs/pm-plugins/resolveDiffContributors.js +18 -4
- package/dist/cjs/showDiffPlugin.js +14 -24
- package/dist/cjs/showDiffPluginType.js +1 -1
- package/dist/cjs/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/cjs/ui/ContributorTag/contributorTagController.js +28 -3
- package/dist/cjs/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/es2019/pm-plugins/calculateDiff/calculateDiffDecorations.js +67 -105
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/es2019/pm-plugins/decorations/colorSchemes/standard.js +0 -26
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.js +11 -23
- package/dist/es2019/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/es2019/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.js +8 -18
- package/dist/es2019/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +8 -23
- package/dist/es2019/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -54
- package/dist/es2019/pm-plugins/decorations/decorationKeys.js +6 -16
- package/dist/es2019/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +2 -7
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeView.js +53 -125
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +11 -12
- package/dist/es2019/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -7
- package/dist/es2019/pm-plugins/getDefaultDiffType.js +2 -0
- package/dist/es2019/pm-plugins/getScrollableDecorations.js +6 -19
- package/dist/es2019/pm-plugins/main.js +49 -65
- package/dist/es2019/pm-plugins/resolveDiffContributors.js +18 -3
- package/dist/es2019/showDiffPlugin.js +12 -24
- package/dist/es2019/showDiffPluginType.js +1 -1
- package/dist/es2019/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/es2019/ui/ContributorTag/contributorTagController.js +30 -2
- package/dist/es2019/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/esm/pm-plugins/calculateDiff/calculateDiffDecorations.js +56 -92
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +1 -1
- package/dist/esm/pm-plugins/decorations/colorSchemes/standard.js +0 -26
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.js +12 -24
- package/dist/esm/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.js +25 -57
- package/dist/esm/pm-plugins/decorations/createChangedRowDecorationWidgets.js +22 -60
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.js +8 -16
- package/dist/esm/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.js +8 -23
- package/dist/esm/pm-plugins/decorations/createNodeChangedDecorationWidget.js +34 -52
- package/dist/esm/pm-plugins/decorations/decorationKeys.js +6 -14
- package/dist/esm/pm-plugins/decorations/utils/createDeletedLineBreakWidget.js +3 -8
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeView.js +132 -205
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.js +13 -20
- package/dist/esm/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.js +6 -10
- package/dist/esm/pm-plugins/getDefaultDiffType.js +4 -0
- package/dist/esm/pm-plugins/getScrollableDecorations.js +6 -16
- package/dist/esm/pm-plugins/main.js +44 -52
- package/dist/esm/pm-plugins/resolveDiffContributors.js +18 -4
- package/dist/esm/showDiffPlugin.js +14 -24
- package/dist/esm/showDiffPluginType.js +1 -1
- package/dist/esm/ui/ContributorTag/contributorAvatarRenderer.js +19 -9
- package/dist/esm/ui/ContributorTag/contributorTagController.js +28 -3
- package/dist/esm/ui/ContributorTag/contributorTagIcons.js +2 -2
- package/dist/types/pm-plugins/decorations/colorSchemes/factory.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/colorSchemes/standard.d.ts +0 -3
- package/dist/types/pm-plugins/decorations/colorSchemes/types.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.d.ts +1 -3
- package/dist/types/pm-plugins/decorations/createBlockChangedDecoration.styles.legacy.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createChangedRowDecorationWidgets.d.ts +1 -3
- package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createInlineChangedDecoration.styles.legacy.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/createNodeChangedDecorationWidget.d.ts +2 -3
- package/dist/types/pm-plugins/decorations/decorationKeys.d.ts +5 -8
- package/dist/types/pm-plugins/decorations/utils/createDeletedLineBreakWidget.d.ts +3 -5
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeView.d.ts +4 -6
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.d.ts +3 -4
- package/dist/types/pm-plugins/decorations/utils/wrapBlockNodeViewStyles.legacy.d.ts +4 -4
- package/dist/types/pm-plugins/getDefaultDiffType.d.ts +2 -0
- package/dist/types/pm-plugins/getScrollableDecorations.d.ts +1 -2
- package/dist/types/pm-plugins/main.d.ts +0 -1
- package/dist/types/showDiffPluginType.d.ts +1 -3
- package/docs/smart-diff-design.md +13 -29
- package/package.json +5 -5
- package/dist/cjs/pm-plugins/isExtendedEnabled.js +0 -23
- package/dist/es2019/pm-plugins/isExtendedEnabled.js +0 -13
- package/dist/esm/pm-plugins/isExtendedEnabled.js +0 -17
- package/dist/types/pm-plugins/isExtendedEnabled.d.ts +0 -12
|
@@ -8,11 +8,9 @@ exports.getScrollableDecorations = void 0;
|
|
|
8
8
|
exports.isInlineDiffDecorationRenderableInDoc = isInlineDiffDecorationRenderableInDoc;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
11
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
13
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
14
13
|
var _decorationKeys = require("./decorations/decorationKeys");
|
|
15
|
-
var _isExtendedEnabled = require("./isExtendedEnabled");
|
|
16
14
|
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; }
|
|
17
15
|
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) { (0, _defineProperty2.default)(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; }
|
|
18
16
|
/**
|
|
@@ -48,9 +46,6 @@ function isInlineDiffDecorationRenderableInDoc(doc, from, to) {
|
|
|
48
46
|
function isRangeFullyInside(range1Start, range1End, range2Start, range2End) {
|
|
49
47
|
return range2Start <= range1Start && range1End <= range2End;
|
|
50
48
|
}
|
|
51
|
-
function specHasDiffKeyPrefix(spec, keyPrefix) {
|
|
52
|
-
return Boolean(spec && (0, _typeof2.default)(spec) === 'object' && 'key' in spec && typeof spec.key === 'string' && spec.key.startsWith(keyPrefix));
|
|
53
|
-
}
|
|
54
49
|
|
|
55
50
|
/**
|
|
56
51
|
* Where a decoration paints relative to others at the same position: negative before the node at
|
|
@@ -184,26 +179,21 @@ function groupTouchingDecorations(decorations, isInlineDecoration) {
|
|
|
184
179
|
* @param doc - Current document; when set, diff-inline ranges are validated against this doc
|
|
185
180
|
* @returns Array of scrollable decorations, sorted and deduplicated
|
|
186
181
|
*/
|
|
187
|
-
var getScrollableDecorations = exports.getScrollableDecorations = function getScrollableDecorations(set, doc
|
|
182
|
+
var getScrollableDecorations = exports.getScrollableDecorations = function getScrollableDecorations(set, doc) {
|
|
188
183
|
if (!set) {
|
|
189
184
|
return [];
|
|
190
185
|
}
|
|
191
186
|
var isBlockDecoration = function isBlockDecoration(decoration) {
|
|
192
|
-
|
|
193
|
-
return (0, _isExtendedEnabled.isExtendedEnabled)(diffType) ? (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'block' : (_decoration$spec$key$ = (_decoration$spec = decoration.spec) === null || _decoration$spec === void 0 || (_decoration$spec = _decoration$spec.key) === null || _decoration$spec === void 0 ? void 0 : _decoration$spec.startsWith(_decorationKeys.DiffDecorationKey.block)) !== null && _decoration$spec$key$ !== void 0 ? _decoration$spec$key$ : false;
|
|
187
|
+
return (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'block';
|
|
194
188
|
};
|
|
195
189
|
var isInlineDecoration = function isInlineDecoration(decoration) {
|
|
196
|
-
|
|
197
|
-
return (0, _isExtendedEnabled.isExtendedEnabled)(diffType) ? (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'inline' : (_decoration$spec$key$2 = (_decoration$spec2 = decoration.spec) === null || _decoration$spec2 === void 0 || (_decoration$spec2 = _decoration$spec2.key) === null || _decoration$spec2 === void 0 ? void 0 : _decoration$spec2.startsWith(_decorationKeys.DiffDecorationKey.inline)) !== null && _decoration$spec$key$2 !== void 0 ? _decoration$spec$key$2 : false;
|
|
190
|
+
return (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'inline';
|
|
198
191
|
};
|
|
199
192
|
var isWidgetDecoration = function isWidgetDecoration(decoration) {
|
|
200
|
-
|
|
201
|
-
return (0, _isExtendedEnabled.isExtendedEnabled)(diffType) ? (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'widget' : (_decoration$spec$key$3 = (_decoration$spec3 = decoration.spec) === null || _decoration$spec3 === void 0 || (_decoration$spec3 = _decoration$spec3.key) === null || _decoration$spec3 === void 0 ? void 0 : _decoration$spec3.startsWith(_decorationKeys.DiffDecorationKey.widget)) !== null && _decoration$spec$key$3 !== void 0 ? _decoration$spec$key$3 : false;
|
|
193
|
+
return (0, _decorationKeys.isDiffDecoration)(decoration) && decoration.spec.decorationType === 'widget';
|
|
202
194
|
};
|
|
203
195
|
var seenBlockKeys = new Set();
|
|
204
|
-
var allDecorations =
|
|
205
|
-
return specHasDiffKeyPrefix(spec, _decorationKeys.DiffDecorationKey.inline) || specHasDiffKeyPrefix(spec, _decorationKeys.DiffDecorationKey.widget) || specHasDiffKeyPrefix(spec, _decorationKeys.DiffDecorationKey.block);
|
|
206
|
-
});
|
|
196
|
+
var allDecorations = set.find(undefined, undefined, _decorationKeys.isDiffDecorationSpec);
|
|
207
197
|
|
|
208
198
|
// First pass: filter out listItem blocks and deduplicates blocks
|
|
209
199
|
var filtered = allDecorations.filter(function (dec) {
|
|
@@ -16,8 +16,8 @@ var _announceActiveDiff = require("../ui/DiffNavigation/announceActiveDiff");
|
|
|
16
16
|
var _calculateDiffDecorations = require("./calculateDiff/calculateDiffDecorations");
|
|
17
17
|
var _decorationKeys = require("./decorations/decorationKeys");
|
|
18
18
|
var _enforceCustomStepRegisters = require("./enforceCustomStepRegisters");
|
|
19
|
+
var _getDefaultDiffType = require("./getDefaultDiffType");
|
|
19
20
|
var _getScrollableDecorations = require("./getScrollableDecorations");
|
|
20
|
-
var _isExtendedEnabled = require("./isExtendedEnabled");
|
|
21
21
|
var _NodeViewSerializer = require("./NodeViewSerializer");
|
|
22
22
|
var _revealAnimation = require("./revealAnimation");
|
|
23
23
|
var _scrollToDiff = require("./scrollToDiff");
|
|
@@ -73,28 +73,26 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
73
73
|
state: {
|
|
74
74
|
init: function init(_, _state) {
|
|
75
75
|
// We do initial setup after we setup the editor view
|
|
76
|
-
|
|
77
|
-
return _objectSpread({
|
|
76
|
+
return {
|
|
78
77
|
steps: [],
|
|
79
78
|
stepAttributions: [],
|
|
80
79
|
originalDoc: undefined,
|
|
81
80
|
decorations: _view.DecorationSet.empty,
|
|
82
|
-
isDisplayingChanges: false
|
|
83
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(defaultDiffType) ? {
|
|
81
|
+
isDisplayingChanges: false,
|
|
84
82
|
isInverted: false,
|
|
85
|
-
diffType:
|
|
83
|
+
diffType: (0, _getDefaultDiffType.getDefaultDiffType)(),
|
|
86
84
|
hideDeletedDiffs: false,
|
|
87
85
|
hideAddedDiffsUnderline: false,
|
|
88
86
|
showIndicators: false,
|
|
89
87
|
diffDescriptors: []
|
|
90
|
-
}
|
|
88
|
+
};
|
|
91
89
|
},
|
|
92
90
|
apply: function apply(tr, currentPluginState, oldState, newState) {
|
|
93
91
|
var meta = tr.getMeta(showDiffPluginKey);
|
|
94
92
|
var newPluginState = currentPluginState;
|
|
95
93
|
if (meta) {
|
|
96
94
|
if ((meta === null || meta === void 0 ? void 0 : meta.action) === 'SHOW_DIFF' || (meta === null || meta === void 0 ? void 0 : meta.action) === 'REVEAL_COMPLETE') {
|
|
97
|
-
var _newPluginState$color, _newPluginState, _newPluginState2, _newPluginState3, _newPluginState4, _newPluginState5, _newPluginState6, _newPluginState7, _newPluginState8, _newPluginState9, _newPluginState0
|
|
95
|
+
var _newPluginState$color, _newPluginState, _newPluginState2, _newPluginState3, _newPluginState4, _newPluginState5, _newPluginState6, _newPluginState7, _newPluginState8, _newPluginState9, _newPluginState0;
|
|
98
96
|
// REVEAL_COMPLETE repaints with the reveal dropped, so the decorations render their
|
|
99
97
|
// ordinary resting style. Without it the reveal stays in state indefinitely and the
|
|
100
98
|
// next unrelated repaint re-emits the hidden, zero-width highlight with no animation
|
|
@@ -110,7 +108,7 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
110
108
|
reveal: meta.reveal
|
|
111
109
|
});
|
|
112
110
|
// Calculate and store decorations in state
|
|
113
|
-
var _calculateDiffDecorat = (0, _calculateDiffDecorations.calculateDiffDecorations)(
|
|
111
|
+
var _calculateDiffDecorat = (0, _calculateDiffDecorations.calculateDiffDecorations)({
|
|
114
112
|
state: newState,
|
|
115
113
|
pluginState: newPluginState,
|
|
116
114
|
nodeViewSerializer: nodeViewSerializer,
|
|
@@ -118,29 +116,26 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
118
116
|
intl: getIntl(),
|
|
119
117
|
activeIndexPos: newPluginState.activeIndexPos,
|
|
120
118
|
api: api,
|
|
121
|
-
tagMountContext: tagMountContext
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
inlineDeletedDiffPlacement: (_newPluginState0 = newPluginState) === null || _newPluginState0 === void 0 ? void 0 : _newPluginState0.inlineDeletedDiffPlacement,
|
|
119
|
+
tagMountContext: tagMountContext,
|
|
120
|
+
isInverted: (_newPluginState2 = newPluginState) === null || _newPluginState2 === void 0 ? void 0 : _newPluginState2.isInverted,
|
|
121
|
+
diffType: (_newPluginState3 = newPluginState) === null || _newPluginState3 === void 0 ? void 0 : _newPluginState3.diffType,
|
|
122
|
+
hideDeletedDiffs: (_newPluginState4 = newPluginState) === null || _newPluginState4 === void 0 ? void 0 : _newPluginState4.hideDeletedDiffs,
|
|
123
|
+
hideAddedDiffsUnderline: (_newPluginState5 = newPluginState) === null || _newPluginState5 === void 0 ? void 0 : _newPluginState5.hideAddedDiffsUnderline,
|
|
124
|
+
showIndicators: (_newPluginState6 = newPluginState) === null || _newPluginState6 === void 0 ? void 0 : _newPluginState6.showIndicators,
|
|
125
|
+
smartThresholds: (_newPluginState7 = newPluginState) === null || _newPluginState7 === void 0 ? void 0 : _newPluginState7.smartThresholds,
|
|
126
|
+
deletedDiffPlacement: (_newPluginState8 = newPluginState) === null || _newPluginState8 === void 0 ? void 0 : _newPluginState8.deletedDiffPlacement,
|
|
127
|
+
inlineDeletedDiffPlacement: (_newPluginState9 = newPluginState) === null || _newPluginState9 === void 0 ? void 0 : _newPluginState9.inlineDeletedDiffPlacement,
|
|
131
128
|
// SHOW_DIFF only. The scroll-to-next recalculation further down deliberately
|
|
132
129
|
// omits this so stepping through changes cannot replay the choreography.
|
|
133
|
-
reveal: (
|
|
134
|
-
}
|
|
130
|
+
reveal: (_newPluginState0 = newPluginState) === null || _newPluginState0 === void 0 ? void 0 : _newPluginState0.reveal
|
|
131
|
+
}),
|
|
135
132
|
contributorTags = _calculateDiffDecorat.contributorTags,
|
|
136
133
|
decorations = _calculateDiffDecorat.decorations,
|
|
137
134
|
diffDescriptors = _calculateDiffDecorat.diffDescriptors;
|
|
138
135
|
// Update the decorations and their ids
|
|
139
136
|
newPluginState.decorations = decorations;
|
|
140
137
|
newPluginState.contributorTags = contributorTags;
|
|
141
|
-
|
|
142
|
-
newPluginState.diffDescriptors = diffDescriptors;
|
|
143
|
-
}
|
|
138
|
+
newPluginState.diffDescriptors = diffDescriptors;
|
|
144
139
|
} else if ((meta === null || meta === void 0 ? void 0 : meta.action) === 'HIDE_DIFF') {
|
|
145
140
|
newPluginState = _objectSpread(_objectSpread(_objectSpread({}, currentPluginState), meta), {}, {
|
|
146
141
|
decorations: _view.DecorationSet.empty,
|
|
@@ -149,20 +144,22 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
149
144
|
contributorTags: [],
|
|
150
145
|
reveal: undefined,
|
|
151
146
|
// Per-call override — do not let it leak into the next, unrelated `showDiff` call.
|
|
152
|
-
colorScheme: undefined
|
|
153
|
-
|
|
147
|
+
colorScheme: undefined,
|
|
148
|
+
/**
|
|
149
|
+
* Reset isInverted & diffType state when hiding diffs
|
|
150
|
+
* Otherwise this should persist for the diff-showing session
|
|
151
|
+
*/
|
|
154
152
|
isInverted: false,
|
|
155
|
-
diffType: (0,
|
|
153
|
+
diffType: (0, _getDefaultDiffType.getDefaultDiffType)(),
|
|
156
154
|
hideDeletedDiffs: false,
|
|
157
155
|
hideAddedDiffsUnderline: false,
|
|
158
156
|
diffDescriptors: []
|
|
159
|
-
}
|
|
157
|
+
});
|
|
160
158
|
} else if ((meta === null || meta === void 0 ? void 0 : meta.action) === 'SCROLL_TO_NEXT' || (meta === null || meta === void 0 ? void 0 : meta.action) === 'SCROLL_TO_PREVIOUS') {
|
|
161
|
-
var _newPluginState11;
|
|
162
159
|
// Update the active index in plugin state and recalculate decorations
|
|
163
|
-
var _decorations = (0, _getScrollableDecorations.getScrollableDecorations)(currentPluginState.decorations, newState.doc
|
|
160
|
+
var _decorations = (0, _getScrollableDecorations.getScrollableDecorations)(currentPluginState.decorations, newState.doc);
|
|
164
161
|
if (_decorations.length > 0) {
|
|
165
|
-
var _currentPluginState$a, _newPluginState$color2,
|
|
162
|
+
var _currentPluginState$a, _newPluginState$color2, _newPluginState1;
|
|
166
163
|
// Initialize to -1 if undefined so that the first "next" scroll takes us to index 0 (first change).
|
|
167
164
|
// This allows the UI to start with no selection and only highlight on first user interaction.
|
|
168
165
|
var nextIndex = (_currentPluginState$a = currentPluginState.activeIndex) !== null && _currentPluginState$a !== void 0 ? _currentPluginState$a : -1;
|
|
@@ -186,16 +183,15 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
186
183
|
} : undefined
|
|
187
184
|
});
|
|
188
185
|
// Recalculate decorations with the new active index
|
|
189
|
-
var _calculateDiffDecorat2 = (0, _calculateDiffDecorations.calculateDiffDecorations)(
|
|
186
|
+
var _calculateDiffDecorat2 = (0, _calculateDiffDecorations.calculateDiffDecorations)({
|
|
190
187
|
state: newState,
|
|
191
188
|
pluginState: newPluginState,
|
|
192
189
|
nodeViewSerializer: nodeViewSerializer,
|
|
193
|
-
colorScheme: (_newPluginState$color2 = (
|
|
190
|
+
colorScheme: (_newPluginState$color2 = (_newPluginState1 = newPluginState) === null || _newPluginState1 === void 0 ? void 0 : _newPluginState1.colorScheme) !== null && _newPluginState$color2 !== void 0 ? _newPluginState$color2 : config === null || config === void 0 ? void 0 : config.colorScheme,
|
|
194
191
|
intl: getIntl(),
|
|
195
192
|
activeIndexPos: newPluginState.activeIndexPos,
|
|
196
193
|
api: api,
|
|
197
|
-
tagMountContext: tagMountContext
|
|
198
|
-
}, (0, _isExtendedEnabled.isExtendedEnabled)(newPluginState.diffType) ? {
|
|
194
|
+
tagMountContext: tagMountContext,
|
|
199
195
|
isInverted: newPluginState.isInverted,
|
|
200
196
|
diffType: newPluginState.diffType,
|
|
201
197
|
hideDeletedDiffs: newPluginState.hideDeletedDiffs,
|
|
@@ -204,15 +200,13 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
204
200
|
smartThresholds: newPluginState.smartThresholds,
|
|
205
201
|
deletedDiffPlacement: newPluginState.deletedDiffPlacement,
|
|
206
202
|
inlineDeletedDiffPlacement: newPluginState.inlineDeletedDiffPlacement
|
|
207
|
-
}
|
|
203
|
+
}),
|
|
208
204
|
updatedContributorTags = _calculateDiffDecorat2.contributorTags,
|
|
209
205
|
updatedDecorations = _calculateDiffDecorat2.decorations,
|
|
210
206
|
updatedDiffDescriptors = _calculateDiffDecorat2.diffDescriptors;
|
|
211
207
|
newPluginState.decorations = updatedDecorations;
|
|
212
208
|
newPluginState.contributorTags = updatedContributorTags;
|
|
213
|
-
|
|
214
|
-
newPluginState.diffDescriptors = updatedDiffDescriptors;
|
|
215
|
-
}
|
|
209
|
+
newPluginState.diffDescriptors = updatedDiffDescriptors;
|
|
216
210
|
}
|
|
217
211
|
} else {
|
|
218
212
|
newPluginState = _objectSpread(_objectSpread({}, currentPluginState), meta);
|
|
@@ -257,10 +251,10 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
257
251
|
// Scroll to the first decoration when scrollIntoView was requested.
|
|
258
252
|
// Use the same filtered/position-sorted list as the active-index path
|
|
259
253
|
// so "first" reliably means the topmost scrollable diff in the document.
|
|
260
|
-
if (pluginState !== null && pluginState !== void 0 && pluginState.scrollIntoView
|
|
254
|
+
if (pluginState !== null && pluginState !== void 0 && pluginState.scrollIntoView) {
|
|
261
255
|
var _cancelPendingScrollT;
|
|
262
256
|
(_cancelPendingScrollT = cancelPendingScrollToDecoration) === null || _cancelPendingScrollT === void 0 || _cancelPendingScrollT();
|
|
263
|
-
cancelPendingScrollToDecoration = (0, _scrollToDiff.scrollToDecoration)(view, (0, _getScrollableDecorations.getScrollableDecorations)(pluginState.decorations, view.state.doc
|
|
257
|
+
cancelPendingScrollToDecoration = (0, _scrollToDiff.scrollToDecoration)(view, (0, _getScrollableDecorations.getScrollableDecorations)(pluginState.decorations, view.state.doc), undefined, api);
|
|
264
258
|
|
|
265
259
|
// Reset the flag so we don't scroll again on subsequent updates
|
|
266
260
|
view.dispatch(view.state.tr.setMeta(showDiffPluginKey, {
|
|
@@ -274,7 +268,7 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
274
268
|
if ((pluginState === null || pluginState === void 0 ? void 0 : pluginState.activeIndex) !== undefined && activeIndexChanged) {
|
|
275
269
|
var _cancelPendingScrollT2;
|
|
276
270
|
(_cancelPendingScrollT2 = cancelPendingScrollToDecoration) === null || _cancelPendingScrollT2 === void 0 || _cancelPendingScrollT2();
|
|
277
|
-
var scrollableDecorations = (0, _getScrollableDecorations.getScrollableDecorations)(pluginState.decorations, view.state.doc
|
|
271
|
+
var scrollableDecorations = (0, _getScrollableDecorations.getScrollableDecorations)(pluginState.decorations, view.state.doc);
|
|
278
272
|
var activeDecoration = scrollableDecorations[pluginState.activeIndex];
|
|
279
273
|
if (activeDecoration) {
|
|
280
274
|
// EDITOR-7926: use editor-common's command instead of the expand plugin API to
|
|
@@ -287,17 +281,15 @@ var createPlugin = exports.createPlugin = function createPlugin(config, getIntl,
|
|
|
287
281
|
// screen-reader user gets silence. Announced through the live region rather than by
|
|
288
282
|
// focusing the change, since the "next change" control has to stay focused to be
|
|
289
283
|
// pressed again. After the scroll above, so the announcement never precedes it.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(announcement);
|
|
300
|
-
}
|
|
284
|
+
var announcement = (0, _announceActiveDiff.getActiveDiffAnnouncement)({
|
|
285
|
+
activeIndex: pluginState.activeIndex,
|
|
286
|
+
contributorTags: pluginState.contributorTags,
|
|
287
|
+
decorations: scrollableDecorations,
|
|
288
|
+
intl: getIntl()
|
|
289
|
+
});
|
|
290
|
+
if (announcement) {
|
|
291
|
+
var _api$accessibilityUti;
|
|
292
|
+
api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 || _api$accessibilityUti.actions.ariaNotify(announcement);
|
|
301
293
|
}
|
|
302
294
|
}
|
|
303
295
|
},
|
|
@@ -22,9 +22,19 @@ var ROVO_AGENT_TYPES = new Set(['convo-ai', 'rovo_chat']);
|
|
|
22
22
|
var SHOW_DIFF_AGENT_BRANDS = {
|
|
23
23
|
'agent-brand-claude': 'claude',
|
|
24
24
|
'agent-brand-chatgpt': 'chatgpt',
|
|
25
|
+
'agent-brand-figma': 'figma',
|
|
26
|
+
'agent-brand-lovable': 'lovable',
|
|
27
|
+
'agent-brand-replit': 'replit',
|
|
25
28
|
'agent-brand-rovo': 'rovo'
|
|
26
29
|
};
|
|
27
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Brands that prefer the account's real avatar over their fixed glyph when the invoking profile
|
|
33
|
+
* has one. Claude/ChatGPT/Rovo intentionally keep their fixed glyph always (see `AGENT_KIND_ICONS`
|
|
34
|
+
* in `contributorAvatarRenderer.ts`).
|
|
35
|
+
*/
|
|
36
|
+
var AVATAR_ELIGIBLE_BRANDS = new Set(['figma', 'lovable', 'replit']);
|
|
37
|
+
|
|
28
38
|
/** Known external agent types emitted by Confluence's agent identification service that carry
|
|
29
39
|
* no `@atlaskit/agent-color` brand — a generic labelled fallback. */
|
|
30
40
|
var EXTERNAL_AGENT_NAMES = {
|
|
@@ -65,19 +75,23 @@ var resolveUser = function resolveUser(userId, profilesByAccountId) {
|
|
|
65
75
|
var resolveAgent = function resolveAgent(attribution, profilesByAccountId) {
|
|
66
76
|
var _attribution$agentTyp2, _attribution$agentId2;
|
|
67
77
|
var agentType = (_attribution$agentTyp2 = attribution.agentType) === null || _attribution$agentTyp2 === void 0 ? void 0 : _attribution$agentTyp2.trim().toLowerCase();
|
|
78
|
+
// `agentType` may be a named id (e.g. `mcp_lovable_agent`) or a display name (e.g. `lovable`).
|
|
68
79
|
var brand = agentType ? (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
80
|
+
agentNamedId: agentType,
|
|
69
81
|
agentName: agentType
|
|
70
82
|
}) : undefined;
|
|
71
83
|
var diffBrand = brand ? SHOW_DIFF_AGENT_BRANDS[brand.scheme] : undefined;
|
|
84
|
+
var agentId = (_attribution$agentId2 = attribution.agentId) === null || _attribution$agentId2 === void 0 ? void 0 : _attribution$agentId2.trim();
|
|
85
|
+
var agentProfile = agentId ? profilesByAccountId.get(agentId) : undefined;
|
|
72
86
|
if (diffBrand && brand) {
|
|
73
|
-
return {
|
|
87
|
+
return _objectSpread({
|
|
74
88
|
agentKind: diffBrand,
|
|
75
89
|
kind: 'agent',
|
|
76
90
|
name: brand.name
|
|
77
|
-
}
|
|
91
|
+
}, AVATAR_ELIGIBLE_BRANDS.has(diffBrand) && agentProfile !== null && agentProfile !== void 0 && agentProfile.avatarUrl ? {
|
|
92
|
+
avatarUrl: agentProfile.avatarUrl
|
|
93
|
+
} : {});
|
|
78
94
|
}
|
|
79
|
-
var agentId = (_attribution$agentId2 = attribution.agentId) === null || _attribution$agentId2 === void 0 ? void 0 : _attribution$agentId2.trim();
|
|
80
|
-
var agentProfile = agentId ? profilesByAccountId.get(agentId) : undefined;
|
|
81
95
|
if (agentProfile) {
|
|
82
96
|
return _objectSpread(_objectSpread({}, agentProfile.agentBrand ? {
|
|
83
97
|
agentKind: agentProfile.agentBrand
|
|
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
13
|
var _attributions = require("./pm-plugins/decorations/colorSchemes/attributions");
|
|
15
14
|
var _getDeletedWidgets2 = require("./pm-plugins/getDeletedWidgets");
|
|
16
15
|
var _getScrollableDecorations = require("./pm-plugins/getScrollableDecorations");
|
|
@@ -82,13 +81,11 @@ var showDiffPlugin = exports.showDiffPlugin = function showDiffPlugin(_ref3) {
|
|
|
82
81
|
commands: {
|
|
83
82
|
showDiff: function showDiff(params) {
|
|
84
83
|
return function (_ref4) {
|
|
84
|
+
var _api$userIntent;
|
|
85
85
|
var tr = _ref4.tr;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
tr: tr
|
|
90
|
-
});
|
|
91
|
-
}
|
|
86
|
+
api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('viewingDiff')({
|
|
87
|
+
tr: tr
|
|
88
|
+
});
|
|
92
89
|
var reveal = resolveReveal(params === null || params === void 0 ? void 0 : params.reveal, editorView);
|
|
93
90
|
|
|
94
91
|
// Capture snapshot BEFORE transaction dispatch (last moment outgoing DOM exists).
|
|
@@ -113,16 +110,14 @@ var showDiffPlugin = exports.showDiffPlugin = function showDiffPlugin(_ref3) {
|
|
|
113
110
|
};
|
|
114
111
|
},
|
|
115
112
|
hideDiff: function hideDiff(_ref5) {
|
|
113
|
+
var _api$userIntent2;
|
|
116
114
|
var tr = _ref5.tr;
|
|
117
115
|
if (editorView) {
|
|
118
116
|
(0, _revealAnimation.cancelReveal)(editorView);
|
|
119
117
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
tr: tr
|
|
124
|
-
});
|
|
125
|
-
}
|
|
118
|
+
api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 || _api$userIntent2.commands.setCurrentUserIntent('default')({
|
|
119
|
+
tr: tr
|
|
120
|
+
});
|
|
126
121
|
return tr.setMeta(_main.showDiffPluginKey, {
|
|
127
122
|
steps: [],
|
|
128
123
|
stepAttributions: [],
|
|
@@ -155,9 +150,6 @@ var showDiffPlugin = exports.showDiffPlugin = function showDiffPlugin(_ref3) {
|
|
|
155
150
|
}];
|
|
156
151
|
},
|
|
157
152
|
contentComponent: function contentComponent() {
|
|
158
|
-
if (!(0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true)) {
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
153
|
// Rendered here sharing decoration anchor span DOM context (tags mount separately).
|
|
162
154
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IndicatorBarContentComponent.IndicatorBarContentComponent, {
|
|
163
155
|
api: api
|
|
@@ -165,24 +157,22 @@ var showDiffPlugin = exports.showDiffPlugin = function showDiffPlugin(_ref3) {
|
|
|
165
157
|
},
|
|
166
158
|
getSharedState: function getSharedState(editorState) {
|
|
167
159
|
if (!editorState) {
|
|
168
|
-
return
|
|
160
|
+
return {
|
|
169
161
|
isDisplayingChanges: false,
|
|
170
|
-
activeIndex: undefined
|
|
171
|
-
}, (0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) ? {
|
|
162
|
+
activeIndex: undefined,
|
|
172
163
|
diffDescriptors: []
|
|
173
|
-
}
|
|
164
|
+
};
|
|
174
165
|
}
|
|
175
166
|
var pluginState = _main.showDiffPluginKey.getState(editorState);
|
|
176
167
|
var decorationCount = (0, _getScrollableDecorations.getScrollableDecorations)(pluginState === null || pluginState === void 0 ? void 0 : pluginState.decorations, editorState.doc);
|
|
177
|
-
return
|
|
168
|
+
return {
|
|
178
169
|
isDisplayingChanges: decorationCount.length > 0,
|
|
179
170
|
activeIndex: pluginState === null || pluginState === void 0 ? void 0 : pluginState.activeIndex,
|
|
180
|
-
numberOfChanges: decorationCount.length
|
|
181
|
-
}, (0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) ? {
|
|
171
|
+
numberOfChanges: decorationCount.length,
|
|
182
172
|
contributorTags: pluginState === null || pluginState === void 0 ? void 0 : pluginState.contributorTags,
|
|
183
173
|
diffDescriptors: pluginState === null || pluginState === void 0 ? void 0 : pluginState.diffDescriptors,
|
|
184
174
|
showIndicators: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showIndicators
|
|
185
|
-
}
|
|
175
|
+
};
|
|
186
176
|
}
|
|
187
177
|
};
|
|
188
178
|
};
|
|
@@ -25,7 +25,7 @@ exports.DIFF_AGENT_BRANDS = exports.ASSERT_DIFF_AGENT_BRANDS_ARE_REGISTERED = vo
|
|
|
25
25
|
|
|
26
26
|
/** Branded agent presentations supported by contributor tags. */
|
|
27
27
|
|
|
28
|
-
var DIFF_AGENT_BRANDS = exports.DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt']);
|
|
28
|
+
var DIFF_AGENT_BRANDS = exports.DIFF_AGENT_BRANDS = new Set(['rovo', 'claude', 'chatgpt', 'figma', 'lovable', 'replit']);
|
|
29
29
|
|
|
30
30
|
/** The brand id `@atlaskit/agent-color` registers each `AgentBrandColorScheme` under. */
|
|
31
31
|
|
|
@@ -10,11 +10,11 @@ var _default = require("@atlaskit/avatar/constants/default");
|
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
11
|
var _contributorTagIcons = require("./contributorTagIcons");
|
|
12
12
|
/**
|
|
13
|
-
* Agent kinds with a custom contributor-tag icon.
|
|
14
|
-
* `
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Agent kinds with a custom contributor-tag icon. Figma/Lovable/Replit have no entry here — they
|
|
14
|
+
* always render the real avatar `resolveDiffContributors` supplies, falling back to the generic
|
|
15
|
+
* `aiAgent` glyph (see `showContributorIcon`) on load failure. The declared type stays the wider
|
|
16
|
+
* `TagContributor['agentKind']` so indexing below (with `'identified' | 'external'` in play too)
|
|
17
|
+
* stays safely partial.
|
|
18
18
|
*/
|
|
19
19
|
var AGENT_KIND_ICONS = {
|
|
20
20
|
claude: 'claude',
|
|
@@ -22,6 +22,14 @@ var AGENT_KIND_ICONS = {
|
|
|
22
22
|
rovo: 'rovoHex'
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Brands that always render their fixed glyph, even when the contributor also carries an
|
|
27
|
+
* `avatarUrl`. Figma/Lovable/Replit are excluded here and use the real avatar when
|
|
28
|
+
* `resolveDiffContributors` supplies one, falling back to the generic `aiAgent` glyph on load
|
|
29
|
+
* failure.
|
|
30
|
+
*/
|
|
31
|
+
var FIXED_GLYPH_AGENT_KINDS = new Set(['claude', 'chatgpt', 'rovo']);
|
|
32
|
+
|
|
25
33
|
/** The size `@atlaskit/avatar`'s `xxsmall` rendered at. */
|
|
26
34
|
var AVATAR_SIZE = _avatarSizes.AVATAR_SIZES.xxsmall;
|
|
27
35
|
/** `xxsmall` also carried a `space.025` margin — the same 2px — which is where the ring is painted. */
|
|
@@ -112,13 +120,15 @@ var contributorAvatarRenderer = exports.contributorAvatarRenderer = function con
|
|
|
112
120
|
shape.appendChild(fallback);
|
|
113
121
|
return;
|
|
114
122
|
}
|
|
115
|
-
|
|
123
|
+
var icon = (_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 : 'aiAgent';
|
|
124
|
+
shape.appendChild((0, _contributorTagIcons.getContributorTagIcon)(icon, doc));
|
|
116
125
|
};
|
|
117
126
|
if (contributor.avatarUrl) {
|
|
118
127
|
var _contributor$agentKin2;
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
// Claude/ChatGPT/Rovo always use their fixed glyph, even when the profile also has an
|
|
129
|
+
// avatar URL. Other agents (e.g. Figma/Lovable/Replit) and users prefer the real avatar.
|
|
130
|
+
var usesFixedGlyph = isAgent && FIXED_GLYPH_AGENT_KINDS.has((_contributor$agentKin2 = contributor.agentKind) !== null && _contributor$agentKin2 !== void 0 ? _contributor$agentKin2 : 'external');
|
|
131
|
+
if (usesFixedGlyph) {
|
|
122
132
|
showContributorIcon();
|
|
123
133
|
} else {
|
|
124
134
|
image = doc.createElement('img');
|
|
@@ -36,9 +36,18 @@ var getTagAccent = function getTagAccent(_ref) {
|
|
|
36
36
|
var chatgptBrandColor = (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
37
37
|
agentName: 'chatgpt'
|
|
38
38
|
});
|
|
39
|
+
var figmaBrandColor = (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
40
|
+
agentName: 'figma'
|
|
41
|
+
});
|
|
42
|
+
var lovableBrandColor = (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
43
|
+
agentName: 'lovable'
|
|
44
|
+
});
|
|
45
|
+
var replitBrandColor = (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
46
|
+
agentName: 'replit'
|
|
47
|
+
});
|
|
39
48
|
|
|
40
49
|
/** Brand accents for agent kinds with no ADS token match. New agents opt in by adding an entry. */
|
|
41
|
-
var AGENT_KIND_ACCENT_OVERRIDES = _objectSpread({
|
|
50
|
+
var AGENT_KIND_ACCENT_OVERRIDES = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
42
51
|
rovo: {
|
|
43
52
|
background: "var(--ds-background-neutral-bold, #292A2E)",
|
|
44
53
|
text: "var(--ds-text-inverse, #FFFFFF)"
|
|
@@ -48,6 +57,21 @@ var AGENT_KIND_ACCENT_OVERRIDES = _objectSpread({
|
|
|
48
57
|
background: chatgptBrandColor.bold,
|
|
49
58
|
text: chatgptBrandColor.boldText
|
|
50
59
|
}
|
|
60
|
+
} : {}), figmaBrandColor ? {
|
|
61
|
+
figma: {
|
|
62
|
+
background: figmaBrandColor.bold,
|
|
63
|
+
text: figmaBrandColor.boldText
|
|
64
|
+
}
|
|
65
|
+
} : {}), lovableBrandColor ? {
|
|
66
|
+
lovable: {
|
|
67
|
+
background: lovableBrandColor.bold,
|
|
68
|
+
text: lovableBrandColor.boldText
|
|
69
|
+
}
|
|
70
|
+
} : {}), replitBrandColor ? {
|
|
71
|
+
replit: {
|
|
72
|
+
background: replitBrandColor.bold,
|
|
73
|
+
text: replitBrandColor.boldText
|
|
74
|
+
}
|
|
51
75
|
} : {});
|
|
52
76
|
|
|
53
77
|
/**
|
|
@@ -372,8 +396,9 @@ var ContributorTagController = exports.ContributorTagController = /*#__PURE__*/f
|
|
|
372
396
|
stackIndex: stackIndex
|
|
373
397
|
});
|
|
374
398
|
if (index < stack.length - 1) {
|
|
375
|
-
//
|
|
376
|
-
|
|
399
|
+
// Sits the leading avatar of a connected pair flush against the one behind it, with
|
|
400
|
+
// no overlap and no extra gap.
|
|
401
|
+
avatar.element.style.setProperty('margin-inline-end', '0');
|
|
377
402
|
}
|
|
378
403
|
container.appendChild(avatar.element);
|
|
379
404
|
_this5.avatars.push(avatar);
|
|
@@ -31,8 +31,8 @@ var AI_AGENT_ICON_SVG = "<svg width=\"12\" height=\"12\" fill=\"none\" viewBox=\
|
|
|
31
31
|
/** `RovoHexIcon` from `@atlaskit/logo/rovo-hex/icon`, at the 16px `xxsmall` renders. */
|
|
32
32
|
var ROVO_HEX_ICON_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" role=\"presentation\" style=\"display:block\"><path fill=\"#1868db\" fill-rule=\"evenodd\" d=\"m13.227 16.789-7.154 4.169-3.403-1.96a2.72 2.72 0 0 1-1.362-2.355V7.366c0-.973.518-1.87 1.361-2.354l6.044-3.487-.038.114a3.6 3.6 0 0 0-.172 1.088v9.278c0 1.274.68 2.45 1.786 3.085z\" clip-rule=\"evenodd\"/><path fill=\"#6a9a23\" fill-rule=\"evenodd\" d=\"m11.296 15.671-7.193 4.153 6.607 3.812a2.73 2.73 0 0 0 2.676.026l.048-.033a2.73 2.73 0 0 0 1.232-1.525 2.7 2.7 0 0 0 .127-.822v-3.594z\" clip-rule=\"evenodd\"/><path fill=\"#af59e1\" fill-rule=\"evenodd\" d=\"m21.477 5.003-4.404-2.539-5.904 4.89 2.69 1.556a3.56 3.56 0 0 1 1.785 3.086v9.277a3.6 3.6 0 0 1-.21 1.202l6.044-3.486a2.71 2.71 0 0 0 1.362-2.355V7.357c0-.97-.521-1.87-1.363-2.354\" clip-rule=\"evenodd\"/><path fill=\"#fca700\" fill-rule=\"evenodd\" d=\"M12.74 8.266 9.353 6.312V2.718c0-.283.044-.56.127-.821A2.73 2.73 0 0 1 10.71.372V.37a.4.4 0 0 0 .048-.033 2.73 2.73 0 0 1 2.676.026l6.499 3.75z\" clip-rule=\"evenodd\"/></svg>";
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
var CLAUDE_ICON_SVG = "<svg width=\"
|
|
34
|
+
/** Claude hexagon lockup from the brand asset: the hexagon and knot glyph both baked in. */
|
|
35
|
+
var CLAUDE_ICON_SVG = "<svg width=\"16\" height=\"18\" viewBox=\"0 0 16 18\" fill=\"none\" role=\"presentation\" style=\"display:block\"><path fill=\"#D97757\" d=\"M14.5007 3.28903L9.50384 0.402344C8.5736 -0.13506 7.42701 -0.134016 6.49774 0.405082L1.49458 3.30759C0.569434 3.8443 0 4.83297 0 5.90253V11.1804C0 12.2519 0.571497 13.2421 1.49931 13.7781L6.49931 16.6666C7.42787 17.203 8.57213 17.203 9.50069 16.6666L14.5007 13.7781C15.4285 13.2421 16 12.2519 16 11.1804V5.88671C16 4.8152 15.4285 3.82504 14.5007 3.28903Z\"/><path fill=\"#FAF9F6\" d=\"M5.19791 10.055L7.0123 9.03681L7.04267 8.94806L7.0123 8.89907H6.92357L6.62 8.88034L5.58321 8.85232L4.68418 8.815L3.81317 8.76826L3.59367 8.72158L3.38818 8.4507L3.4092 8.31526L3.59367 8.1915L3.85754 8.21485L4.44133 8.25455L5.317 8.31526L5.95216 8.35262L6.89321 8.4507H7.04267L7.06368 8.38999L7.0123 8.35262L6.97261 8.31526L6.06658 7.70112L5.08582 7.05196L4.5721 6.67834L4.29422 6.48919L4.15411 6.31172L4.09339 5.92409L4.34559 5.64621L4.68418 5.66956L4.77058 5.69291L5.11384 5.95678L5.84708 6.52422L6.80448 7.22943L6.94459 7.34618L7.00063 7.30649L7.00763 7.27846L6.94459 7.17338L6.42385 6.23233L5.86809 5.27492L5.62057 4.87795L5.55519 4.63977C5.53183 4.54169 5.51549 4.45996 5.51549 4.35956L5.80271 3.96959L5.9615 3.91821L6.34446 3.96959L6.50558 4.10969L6.74377 4.65378L7.12907 5.51077L7.72686 6.676L7.90199 7.0216L7.99539 7.34152L8.0304 7.43959H8.09113V7.38354L8.14018 6.72737L8.23124 5.92175L8.31999 4.88496L8.35032 4.59307L8.49511 4.24279L8.78232 4.05365L9.00649 4.16107L9.19098 4.42494L9.16533 4.5954L9.05555 5.30762L8.84073 6.42381L8.70062 7.17105H8.78232L8.87574 7.07764L9.25401 6.57559L9.88922 5.78165L10.1694 5.4664L10.4963 5.11847L10.7065 4.95267H11.1035L11.3953 5.38701L11.2646 5.83535L10.8559 6.35375L10.5173 6.79276L10.0316 7.4466L9.72807 7.96966L9.7561 8.0117L9.82849 8.00469L10.926 7.77118L11.5191 7.66376L12.2266 7.54233L12.5466 7.69178L12.5816 7.84356L12.4555 8.15414L11.6989 8.34095L10.8116 8.51842L9.48985 8.83136L9.4735 8.84303L9.49223 8.86637L10.0877 8.92241L10.3422 8.93639H10.9657L12.1262 9.02283L12.4298 9.2236L12.612 9.46881L12.5816 9.6556L12.1146 9.89382L11.4841 9.74434L10.013 9.3941L9.50858 9.26797H9.43849V9.31004L9.85882 9.721L10.6294 10.4169L11.5938 11.3136L11.6429 11.5354L11.5191 11.7106L11.3884 11.6918L10.5407 11.0544L10.2137 10.7672L9.4735 10.1436H9.42451V10.209L9.59495 10.4589L10.4963 11.8133L10.543 12.2289L10.4776 12.3644L10.2441 12.4461L9.98726 12.3994L9.45952 11.6592L8.91544 10.8255L8.47645 10.0783L8.42271 10.1086L8.16352 12.8991L8.04207 13.0416L7.76188 13.149L7.52837 12.9715L7.40461 12.6843L7.52837 12.1168L7.67781 11.3766L7.79925 10.7881L7.90899 10.0573L7.97438 9.81443L7.96971 9.79808L7.916 9.80507L7.36491 10.5617L6.5266 11.6942L5.86342 12.4041L5.70463 12.4671L5.42909 12.3247L5.45477 12.0702L5.60889 11.8436L6.5266 10.6761L7.08002 9.95217L7.4373 9.53421L7.43497 9.47349H7.41395L4.97607 11.0567L4.54174 11.1127L4.35493 10.9376L4.37828 10.6504L4.46702 10.557L5.20024 10.0526L5.19791 10.055Z\"/></svg>";
|
|
36
36
|
|
|
37
37
|
/** ChatGPT hexagon lockup from the brand asset: the hexagon and knot glyph both baked in. */
|
|
38
38
|
var CHATGPT_ICON_SVG = "<svg width=\"16\" height=\"18\" viewBox=\"0 0 16 18\" fill=\"none\" role=\"presentation\" style=\"display:block\"><path fill=\"#14120B\" d=\"M14.5007 3.289L9.50384 0.402314C8.5736 -0.13509 7.42701 -0.134047 6.49774 0.405051L1.49458 3.30756C0.569434 3.84427 0 4.83294 0 5.9025V11.1804C0 12.2519 0.571497 13.2421 1.49931 13.7781L6.49931 16.6666C7.42787 17.203 8.57213 17.203 9.50069 16.6666L14.5007 13.7781C15.4285 13.2421 16 12.2519 16 11.1804V5.88668C16 4.81517 15.4285 3.82501 14.5007 3.289Z\"/><path fill=\"white\" d=\"M12.255 7.39338C12.4813 6.54514 12.2618 5.60258 11.5963 4.93713C10.9309 4.2717 9.9884 4.05217 9.1401 4.27852C8.51863 3.65837 7.59268 3.37721 6.68362 3.62082C5.77456 3.86436 5.11322 4.57087 4.88512 5.41867C4.03733 5.64676 3.33082 6.30819 3.08727 7.21717C2.84372 8.12623 3.12482 9.05218 3.74503 9.67365C3.51868 10.5219 3.73823 11.4645 4.40366 12.1299C5.06909 12.7953 6.01159 13.0149 6.85992 12.7885C7.48137 13.4087 8.4074 13.6898 9.31638 13.4463C10.2254 13.2027 10.8868 12.4962 11.1149 11.6485C11.9627 11.4203 12.6692 10.7589 12.9127 9.84993C13.1563 8.94089 12.8752 8.01491 12.255 7.39347V7.39338ZM11.1878 5.34578C11.6387 5.79673 11.8247 6.41226 11.7457 6.99902L9.62799 5.77632C9.53872 5.72478 9.42871 5.72478 9.3395 5.77632L6.85992 7.20789V6.26917C6.85992 6.20333 6.89519 6.1417 6.95226 6.10877L8.84042 5.01867C9.58854 4.60079 10.5519 4.7099 11.1878 5.34578H11.1878ZM8.00001 7.21703L9.14016 7.87529V9.19183L8.00001 9.85009L6.85984 9.19183V7.87529L8.00001 7.21703ZM5.37616 6.04832C5.38831 5.19153 5.96453 4.41177 6.83319 4.17899C7.44917 4.01397 8.07524 4.16069 8.54389 4.52241L6.42609 5.74505C6.33682 5.79656 6.28184 5.89186 6.28184 5.99489V8.85803L5.4689 8.38867C5.41189 8.35573 5.37616 8.29433 5.37616 8.22846V6.04826V6.04832ZM3.64542 7.36674C3.81044 6.75079 4.25056 6.28191 4.79817 6.05694V8.50232C4.79817 8.60534 4.85315 8.70061 4.94241 8.75216L7.42202 10.1837L6.60904 10.6531C6.55203 10.686 6.48098 10.6862 6.42397 10.6533L4.53581 9.56321C3.79984 9.12427 3.41272 8.23534 3.64542 7.36674ZM4.81224 11.7213C4.36129 11.2704 4.17534 10.6549 4.25429 10.0681L6.37201 11.2908C6.4613 11.3423 6.57129 11.3423 6.6605 11.2908L9.1401 9.85923V10.7979C9.1401 10.8638 9.10483 10.9254 9.04774 10.9584L7.15958 12.0485C6.41145 12.4663 5.44809 12.3572 4.81215 11.7213H4.81224ZM10.6238 11.0188C10.6117 11.8756 10.0355 12.6554 9.1668 12.8881C8.55083 13.0532 7.92476 12.9064 7.45613 12.5447L9.57391 11.322C9.6632 11.2705 9.71816 11.1753 9.71816 11.0722V8.20906L10.5311 8.67845C10.5881 8.71139 10.6238 8.77279 10.6238 8.83866V11.0189V11.0188ZM12.3546 9.70035C12.1896 10.3163 11.7494 10.7852 11.2018 11.0101V8.5648C11.2018 8.46178 11.1469 8.36648 11.0576 8.31496L8.57798 6.88339L9.39095 6.41401C9.44796 6.38107 9.51902 6.38085 9.57603 6.41378L11.4642 7.50388C12.2002 7.94285 12.5873 8.83178 12.3546 9.70035Z\"/></svg>";
|