@atlaskit/editor-plugin-show-diff 30.0.10 → 30.0.11
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 +12 -0
- package/dist/cjs/pm-plugins/decorations/colorSchemes/attributions.js +19 -13
- package/dist/cjs/pm-plugins/decorations/colorSchemes/factory.js +9 -8
- package/dist/es2019/pm-plugins/decorations/colorSchemes/attributions.js +21 -14
- package/dist/es2019/pm-plugins/decorations/colorSchemes/factory.js +6 -5
- package/dist/esm/pm-plugins/decorations/colorSchemes/attributions.js +19 -13
- package/dist/esm/pm-plugins/decorations/colorSchemes/factory.js +9 -8
- package/dist/types/pm-plugins/decorations/colorSchemes/attributions.d.ts +3 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-show-diff
|
|
2
2
|
|
|
3
|
+
## 30.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4ad02bd627f7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4ad02bd627f7f) -
|
|
8
|
+
Respect explicit brand active colours and otherwise use the existing gray active diff treatment.
|
|
9
|
+
Preserve Rovo purple active colours and Claude specified light and dark colours. Route contributor
|
|
10
|
+
attribution through shared brand schemes under platform_editor_attributed_version_history,
|
|
11
|
+
platform_editor_show_diff_color_scheme_refactor, platform_editor_agent_mentions and
|
|
12
|
+
platform_editor_agent_telepointer_redesign.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 30.0.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -28,8 +28,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
28
28
|
var HASHED_PARTICIPANT_COLOR_SCHEMES = [].concat((0, _toConsumableArray2.default)(_types.PARTICIPANT_COLOR_SCHEMES), ['blue', 'red', 'orange', 'yellow', 'green', 'teal', 'purple', 'magenta']);
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* ADS red means "deleted" in both public schemes, so it is excluded from hashed participant colours.
|
|
32
|
+
* Brand schemes retain their own palettes. `createAttributionColorMap` is the only caller, and
|
|
33
33
|
* it is gated on `platform_editor_attributed_version_history` plus
|
|
34
34
|
* `platform_editor_show_diff_color_scheme_refactor`.
|
|
35
35
|
*/
|
|
@@ -142,23 +142,25 @@ var isContributorTagsEnabled = exports.isContributorTagsEnabled = function isCon
|
|
|
142
142
|
})) && contributors !== undefined && Object.keys(contributors).length > 0;
|
|
143
143
|
};
|
|
144
144
|
var getAttributionParticipantColor = function getAttributionParticipantColor(attribution, identity, contributors) {
|
|
145
|
-
var _ref2,
|
|
145
|
+
var _ref2, _attribution$agentId2;
|
|
146
146
|
var contributor = contributors === null || contributors === void 0 ? void 0 : contributors[identity.key];
|
|
147
147
|
var brand = isDiffAgentBrand(contributor === null || contributor === void 0 ? void 0 : contributor.agentKind) ? contributor === null || contributor === void 0 ? void 0 : contributor.agentKind : undefined;
|
|
148
|
-
var
|
|
149
|
-
agentNamedId: attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
150
|
-
agentName: contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
151
|
-
})
|
|
152
|
-
|
|
148
|
+
var brandColor = (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
149
|
+
agentNamedId: brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
150
|
+
agentName: brand !== null && brand !== void 0 ? brand : contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
151
|
+
});
|
|
152
|
+
var agentName = (_ref2 = brand !== null && brand !== void 0 ? brand : brandColor === null || brandColor === void 0 ? void 0 : brandColor.name) !== null && _ref2 !== void 0 ? _ref2 : attribution !== null && attribution !== void 0 && (_attribution$agentId2 = attribution.agentId) !== null && _attribution$agentId2 !== void 0 && _attribution$agentId2.trim() ? (contributor === null || contributor === void 0 ? void 0 : contributor.name) || 'Agent' : undefined;
|
|
153
|
+
return _objectSpread(_objectSpread({}, (0, _utils.getParticipantColor)(identity.colorSeed, agentName,
|
|
153
154
|
// Keep an explicitly resolved brand consistent with the contributor's icon.
|
|
154
|
-
brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId)
|
|
155
|
+
brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId)), {}, {
|
|
156
|
+
scheme: brandColor === null || brandColor === void 0 ? void 0 : brandColor.scheme
|
|
157
|
+
});
|
|
155
158
|
};
|
|
156
159
|
var createAttributionColorMap = exports.createAttributionColorMap = function createAttributionColorMap(stepAttributions, contributors) {
|
|
157
160
|
var colors = new Map();
|
|
158
161
|
var allocatedColors = new Set();
|
|
159
162
|
|
|
160
|
-
//
|
|
161
|
-
// slot is pinned deliberately, so it is taken verbatim rather than through `getSlotColor`.
|
|
163
|
+
// Keep brand schemes intact; only unbranded contributors use the hashed ADS palette below.
|
|
162
164
|
var _iterator2 = _createForOfIteratorHelper(stepAttributions),
|
|
163
165
|
_step2;
|
|
164
166
|
try {
|
|
@@ -170,10 +172,14 @@ var createAttributionColorMap = exports.createAttributionColorMap = function cre
|
|
|
170
172
|
}
|
|
171
173
|
var _getAttributionPartic = getAttributionParticipantColor(attribution, identity, contributors),
|
|
172
174
|
index = _getAttributionPartic.index,
|
|
173
|
-
isFixed = _getAttributionPartic.isFixed
|
|
175
|
+
isFixed = _getAttributionPartic.isFixed,
|
|
176
|
+
scheme = _getAttributionPartic.scheme;
|
|
177
|
+
if (scheme) {
|
|
178
|
+
colors.set(identity.key, scheme);
|
|
179
|
+
}
|
|
180
|
+
// Keep the old slot reserved so selecting a brand cannot recolour other contributors.
|
|
174
181
|
var color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
|
|
175
182
|
if (isFixed && color) {
|
|
176
|
-
colors.set(identity.key, color);
|
|
177
183
|
allocatedColors.add(color);
|
|
178
184
|
}
|
|
179
185
|
}
|
|
@@ -221,8 +221,8 @@ function bgBolder(color) {
|
|
|
221
221
|
return (_getBrand$bold = (_getBrand4 = getBrand(color)) === null || _getBrand4 === void 0 ? void 0 : _getBrand4.bold) !== null && _getBrand$bold !== void 0 ? _getBrand$bold : bgBolderMap[color];
|
|
222
222
|
}
|
|
223
223
|
function bgSubtlerPressed(color) {
|
|
224
|
-
var _getBrand$
|
|
225
|
-
return (_getBrand$
|
|
224
|
+
var _ref, _getBrand$emphasisBac, _getBrand5;
|
|
225
|
+
return (_ref = (_getBrand$emphasisBac = (_getBrand5 = getBrand(color)) === null || _getBrand5 === void 0 ? void 0 : _getBrand5.emphasisBackground) !== null && _getBrand$emphasisBac !== void 0 ? _getBrand$emphasisBac : bgSubtlerPressedMap[color]) !== null && _ref !== void 0 ? _ref : bgSubtlerPressedMap.gray;
|
|
226
226
|
}
|
|
227
227
|
function borderAccent(color) {
|
|
228
228
|
var _getBrand$border2, _getBrand6;
|
|
@@ -233,8 +233,8 @@ function textAccent(color) {
|
|
|
233
233
|
return (_getBrand$accentText = (_getBrand7 = getBrand(color)) === null || _getBrand7 === void 0 ? void 0 : _getBrand7.accentText) !== null && _getBrand$accentText !== void 0 ? _getBrand$accentText : textAccentMap[color];
|
|
234
234
|
}
|
|
235
235
|
function deletedBackground(color) {
|
|
236
|
-
var _getBrand$
|
|
237
|
-
return (_getBrand$
|
|
236
|
+
var _getBrand$emphasisBac2, _getBrand8;
|
|
237
|
+
return (_getBrand$emphasisBac2 = (_getBrand8 = getBrand(color)) === null || _getBrand8 === void 0 ? void 0 : _getBrand8.emphasisBackground) !== null && _getBrand$emphasisBac2 !== void 0 ? _getBrand$emphasisBac2 : bgSubtlest(color);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/** Contributor tags use a bold fill with a contrasting foreground, including branded schemes. */
|
|
@@ -316,13 +316,14 @@ function buildInsertStyleInBlockExtended(colors) {
|
|
|
316
316
|
|
|
317
317
|
/** Active state of the extended insert style. */
|
|
318
318
|
function buildInsertStyleExtendedActive(colors) {
|
|
319
|
+
var _ref2, _brand$activeBorder;
|
|
319
320
|
var brand = getBrand(colors.insertColor);
|
|
320
321
|
return (0, _cssHelper.convertToInlineCss)(_objectSpread(_objectSpread({
|
|
321
322
|
background: bgSubtlerPressed(colors.insertActiveColor)
|
|
322
323
|
}, brand ? {
|
|
323
324
|
color: brand.text
|
|
324
325
|
} : {}), {}, {
|
|
325
|
-
borderBottom: "2px solid ".concat(
|
|
326
|
+
borderBottom: "2px solid ".concat((_ref2 = (_brand$activeBorder = brand === null || brand === void 0 ? void 0 : brand.activeBorder) !== null && _brand$activeBorder !== void 0 ? _brand$activeBorder : borderAccentMap[colors.insertColor]) !== null && _ref2 !== void 0 ? _ref2 : borderAccentMap.gray),
|
|
326
327
|
padding: "1px 0 2px"
|
|
327
328
|
}));
|
|
328
329
|
}
|
|
@@ -1117,9 +1118,9 @@ function buildDeletedQuoteNodeWithLozengeStyle(colors, isActive) {
|
|
|
1117
1118
|
* codeBlock). Every scheme shares the active state; `deletedNodeEmphasis` changes only the
|
|
1118
1119
|
* resting one — 'stateful' a 4px subtlest ring, 'static' a 1px accent ring.
|
|
1119
1120
|
*/
|
|
1120
|
-
function buildDeletedWrappedBlockOutline(colors,
|
|
1121
|
-
var isActive =
|
|
1122
|
-
isRounded =
|
|
1121
|
+
function buildDeletedWrappedBlockOutline(colors, _ref3) {
|
|
1122
|
+
var isActive = _ref3.isActive,
|
|
1123
|
+
isRounded = _ref3.isRounded;
|
|
1123
1124
|
if (isActive) {
|
|
1124
1125
|
return isRounded ? buildDeletedBlockOutlineRoundedActive(colors) : buildDeletedBlockOutlineActive(colors);
|
|
1125
1126
|
}
|
|
@@ -12,8 +12,8 @@ import { PARTICIPANT_COLOR_SCHEMES } from './types';
|
|
|
12
12
|
const HASHED_PARTICIPANT_COLOR_SCHEMES = [...PARTICIPANT_COLOR_SCHEMES, 'blue', 'red', 'orange', 'yellow', 'green', 'teal', 'purple', 'magenta'];
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* ADS red means "deleted" in both public schemes, so it is excluded from hashed participant colours.
|
|
16
|
+
* Brand schemes retain their own palettes. `createAttributionColorMap` is the only caller, and
|
|
17
17
|
* it is gated on `platform_editor_attributed_version_history` plus
|
|
18
18
|
* `platform_editor_show_diff_color_scheme_refactor`.
|
|
19
19
|
*/
|
|
@@ -109,23 +109,26 @@ export const isAttributionColoringEnabled = stepAttributions => {
|
|
|
109
109
|
*/
|
|
110
110
|
export const isContributorTagsEnabled = (stepAttributions, contributors) => areAttributionColorGatesEnabled() && Boolean(stepAttributions === null || stepAttributions === void 0 ? void 0 : stepAttributions.some(attribution => getAttributionKey(attribution) !== undefined)) && contributors !== undefined && Object.keys(contributors).length > 0;
|
|
111
111
|
const getAttributionParticipantColor = (attribution, identity, contributors) => {
|
|
112
|
-
var _ref,
|
|
112
|
+
var _ref, _attribution$agentId2;
|
|
113
113
|
const contributor = contributors === null || contributors === void 0 ? void 0 : contributors[identity.key];
|
|
114
114
|
const brand = isDiffAgentBrand(contributor === null || contributor === void 0 ? void 0 : contributor.agentKind) ? contributor === null || contributor === void 0 ? void 0 : contributor.agentKind : undefined;
|
|
115
|
-
const
|
|
116
|
-
agentNamedId: attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
117
|
-
agentName: contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
const brandColor = getThirdPartyAgentColor({
|
|
116
|
+
agentNamedId: brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
117
|
+
agentName: brand !== null && brand !== void 0 ? brand : contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
118
|
+
});
|
|
119
|
+
const agentName = (_ref = brand !== null && brand !== void 0 ? brand : brandColor === null || brandColor === void 0 ? void 0 : brandColor.name) !== null && _ref !== void 0 ? _ref : attribution !== null && attribution !== void 0 && (_attribution$agentId2 = attribution.agentId) !== null && _attribution$agentId2 !== void 0 && _attribution$agentId2.trim() ? (contributor === null || contributor === void 0 ? void 0 : contributor.name) || 'Agent' : undefined;
|
|
120
|
+
return {
|
|
121
|
+
...getParticipantColor(identity.colorSeed, agentName,
|
|
122
|
+
// Keep an explicitly resolved brand consistent with the contributor's icon.
|
|
123
|
+
brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId),
|
|
124
|
+
scheme: brandColor === null || brandColor === void 0 ? void 0 : brandColor.scheme
|
|
125
|
+
};
|
|
122
126
|
};
|
|
123
127
|
export const createAttributionColorMap = (stepAttributions, contributors) => {
|
|
124
128
|
const colors = new Map();
|
|
125
129
|
const allocatedColors = new Set();
|
|
126
130
|
|
|
127
|
-
//
|
|
128
|
-
// slot is pinned deliberately, so it is taken verbatim rather than through `getSlotColor`.
|
|
131
|
+
// Keep brand schemes intact; only unbranded contributors use the hashed ADS palette below.
|
|
129
132
|
for (const attribution of stepAttributions) {
|
|
130
133
|
const identity = getAttributionIdentity(attribution);
|
|
131
134
|
if (!identity) {
|
|
@@ -133,11 +136,15 @@ export const createAttributionColorMap = (stepAttributions, contributors) => {
|
|
|
133
136
|
}
|
|
134
137
|
const {
|
|
135
138
|
index,
|
|
136
|
-
isFixed
|
|
139
|
+
isFixed,
|
|
140
|
+
scheme
|
|
137
141
|
} = getAttributionParticipantColor(attribution, identity, contributors);
|
|
142
|
+
if (scheme) {
|
|
143
|
+
colors.set(identity.key, scheme);
|
|
144
|
+
}
|
|
145
|
+
// Keep the old slot reserved so selecting a brand cannot recolour other contributors.
|
|
138
146
|
const color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
|
|
139
147
|
if (isFixed && color) {
|
|
140
|
-
colors.set(identity.key, color);
|
|
141
148
|
allocatedColors.add(color);
|
|
142
149
|
}
|
|
143
150
|
}
|
|
@@ -141,8 +141,8 @@ function bgBolder(color) {
|
|
|
141
141
|
return (_getBrand$bold = (_getBrand4 = getBrand(color)) === null || _getBrand4 === void 0 ? void 0 : _getBrand4.bold) !== null && _getBrand$bold !== void 0 ? _getBrand$bold : bgBolderMap[color];
|
|
142
142
|
}
|
|
143
143
|
function bgSubtlerPressed(color) {
|
|
144
|
-
var _getBrand$
|
|
145
|
-
return (_getBrand$
|
|
144
|
+
var _ref, _getBrand$emphasisBac, _getBrand5;
|
|
145
|
+
return (_ref = (_getBrand$emphasisBac = (_getBrand5 = getBrand(color)) === null || _getBrand5 === void 0 ? void 0 : _getBrand5.emphasisBackground) !== null && _getBrand$emphasisBac !== void 0 ? _getBrand$emphasisBac : bgSubtlerPressedMap[color]) !== null && _ref !== void 0 ? _ref : bgSubtlerPressedMap.gray;
|
|
146
146
|
}
|
|
147
147
|
function borderAccent(color) {
|
|
148
148
|
var _getBrand$border2, _getBrand6;
|
|
@@ -153,8 +153,8 @@ function textAccent(color) {
|
|
|
153
153
|
return (_getBrand$accentText = (_getBrand7 = getBrand(color)) === null || _getBrand7 === void 0 ? void 0 : _getBrand7.accentText) !== null && _getBrand$accentText !== void 0 ? _getBrand$accentText : textAccentMap[color];
|
|
154
154
|
}
|
|
155
155
|
function deletedBackground(color) {
|
|
156
|
-
var _getBrand$
|
|
157
|
-
return (_getBrand$
|
|
156
|
+
var _getBrand$emphasisBac2, _getBrand8;
|
|
157
|
+
return (_getBrand$emphasisBac2 = (_getBrand8 = getBrand(color)) === null || _getBrand8 === void 0 ? void 0 : _getBrand8.emphasisBackground) !== null && _getBrand$emphasisBac2 !== void 0 ? _getBrand$emphasisBac2 : bgSubtlest(color);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/** Contributor tags use a bold fill with a contrasting foreground, including branded schemes. */
|
|
@@ -236,13 +236,14 @@ export function buildInsertStyleInBlockExtended(colors) {
|
|
|
236
236
|
|
|
237
237
|
/** Active state of the extended insert style. */
|
|
238
238
|
export function buildInsertStyleExtendedActive(colors) {
|
|
239
|
+
var _ref2, _brand$activeBorder;
|
|
239
240
|
const brand = getBrand(colors.insertColor);
|
|
240
241
|
return convertToInlineCss({
|
|
241
242
|
background: bgSubtlerPressed(colors.insertActiveColor),
|
|
242
243
|
...(brand ? {
|
|
243
244
|
color: brand.text
|
|
244
245
|
} : {}),
|
|
245
|
-
borderBottom: `2px solid ${
|
|
246
|
+
borderBottom: `2px solid ${(_ref2 = (_brand$activeBorder = brand === null || brand === void 0 ? void 0 : brand.activeBorder) !== null && _brand$activeBorder !== void 0 ? _brand$activeBorder : borderAccentMap[colors.insertColor]) !== null && _ref2 !== void 0 ? _ref2 : borderAccentMap.gray}`,
|
|
246
247
|
padding: `1px 0 2px`
|
|
247
248
|
});
|
|
248
249
|
}
|
|
@@ -22,8 +22,8 @@ import { PARTICIPANT_COLOR_SCHEMES } from './types';
|
|
|
22
22
|
var HASHED_PARTICIPANT_COLOR_SCHEMES = [].concat(_toConsumableArray(PARTICIPANT_COLOR_SCHEMES), ['blue', 'red', 'orange', 'yellow', 'green', 'teal', 'purple', 'magenta']);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* ADS red means "deleted" in both public schemes, so it is excluded from hashed participant colours.
|
|
26
|
+
* Brand schemes retain their own palettes. `createAttributionColorMap` is the only caller, and
|
|
27
27
|
* it is gated on `platform_editor_attributed_version_history` plus
|
|
28
28
|
* `platform_editor_show_diff_color_scheme_refactor`.
|
|
29
29
|
*/
|
|
@@ -136,23 +136,25 @@ export var isContributorTagsEnabled = function isContributorTagsEnabled(stepAttr
|
|
|
136
136
|
})) && contributors !== undefined && Object.keys(contributors).length > 0;
|
|
137
137
|
};
|
|
138
138
|
var getAttributionParticipantColor = function getAttributionParticipantColor(attribution, identity, contributors) {
|
|
139
|
-
var _ref2,
|
|
139
|
+
var _ref2, _attribution$agentId2;
|
|
140
140
|
var contributor = contributors === null || contributors === void 0 ? void 0 : contributors[identity.key];
|
|
141
141
|
var brand = isDiffAgentBrand(contributor === null || contributor === void 0 ? void 0 : contributor.agentKind) ? contributor === null || contributor === void 0 ? void 0 : contributor.agentKind : undefined;
|
|
142
|
-
var
|
|
143
|
-
agentNamedId: attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
144
|
-
agentName: contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
145
|
-
})
|
|
146
|
-
|
|
142
|
+
var brandColor = getThirdPartyAgentColor({
|
|
143
|
+
agentNamedId: brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId,
|
|
144
|
+
agentName: brand !== null && brand !== void 0 ? brand : contributor === null || contributor === void 0 ? void 0 : contributor.name
|
|
145
|
+
});
|
|
146
|
+
var agentName = (_ref2 = brand !== null && brand !== void 0 ? brand : brandColor === null || brandColor === void 0 ? void 0 : brandColor.name) !== null && _ref2 !== void 0 ? _ref2 : attribution !== null && attribution !== void 0 && (_attribution$agentId2 = attribution.agentId) !== null && _attribution$agentId2 !== void 0 && _attribution$agentId2.trim() ? (contributor === null || contributor === void 0 ? void 0 : contributor.name) || 'Agent' : undefined;
|
|
147
|
+
return _objectSpread(_objectSpread({}, getParticipantColor(identity.colorSeed, agentName,
|
|
147
148
|
// Keep an explicitly resolved brand consistent with the contributor's icon.
|
|
148
|
-
brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId)
|
|
149
|
+
brand ? undefined : attribution === null || attribution === void 0 ? void 0 : attribution.agentNamedId)), {}, {
|
|
150
|
+
scheme: brandColor === null || brandColor === void 0 ? void 0 : brandColor.scheme
|
|
151
|
+
});
|
|
149
152
|
};
|
|
150
153
|
export var createAttributionColorMap = function createAttributionColorMap(stepAttributions, contributors) {
|
|
151
154
|
var colors = new Map();
|
|
152
155
|
var allocatedColors = new Set();
|
|
153
156
|
|
|
154
|
-
//
|
|
155
|
-
// slot is pinned deliberately, so it is taken verbatim rather than through `getSlotColor`.
|
|
157
|
+
// Keep brand schemes intact; only unbranded contributors use the hashed ADS palette below.
|
|
156
158
|
var _iterator2 = _createForOfIteratorHelper(stepAttributions),
|
|
157
159
|
_step2;
|
|
158
160
|
try {
|
|
@@ -164,10 +166,14 @@ export var createAttributionColorMap = function createAttributionColorMap(stepAt
|
|
|
164
166
|
}
|
|
165
167
|
var _getAttributionPartic = getAttributionParticipantColor(attribution, identity, contributors),
|
|
166
168
|
index = _getAttributionPartic.index,
|
|
167
|
-
isFixed = _getAttributionPartic.isFixed
|
|
169
|
+
isFixed = _getAttributionPartic.isFixed,
|
|
170
|
+
scheme = _getAttributionPartic.scheme;
|
|
171
|
+
if (scheme) {
|
|
172
|
+
colors.set(identity.key, scheme);
|
|
173
|
+
}
|
|
174
|
+
// Keep the old slot reserved so selecting a brand cannot recolour other contributors.
|
|
168
175
|
var color = HASHED_PARTICIPANT_COLOR_SCHEMES[index];
|
|
169
176
|
if (isFixed && color) {
|
|
170
|
-
colors.set(identity.key, color);
|
|
171
177
|
allocatedColors.add(color);
|
|
172
178
|
}
|
|
173
179
|
}
|
|
@@ -146,8 +146,8 @@ function bgBolder(color) {
|
|
|
146
146
|
return (_getBrand$bold = (_getBrand4 = getBrand(color)) === null || _getBrand4 === void 0 ? void 0 : _getBrand4.bold) !== null && _getBrand$bold !== void 0 ? _getBrand$bold : bgBolderMap[color];
|
|
147
147
|
}
|
|
148
148
|
function bgSubtlerPressed(color) {
|
|
149
|
-
var _getBrand$
|
|
150
|
-
return (_getBrand$
|
|
149
|
+
var _ref, _getBrand$emphasisBac, _getBrand5;
|
|
150
|
+
return (_ref = (_getBrand$emphasisBac = (_getBrand5 = getBrand(color)) === null || _getBrand5 === void 0 ? void 0 : _getBrand5.emphasisBackground) !== null && _getBrand$emphasisBac !== void 0 ? _getBrand$emphasisBac : bgSubtlerPressedMap[color]) !== null && _ref !== void 0 ? _ref : bgSubtlerPressedMap.gray;
|
|
151
151
|
}
|
|
152
152
|
function borderAccent(color) {
|
|
153
153
|
var _getBrand$border2, _getBrand6;
|
|
@@ -158,8 +158,8 @@ function textAccent(color) {
|
|
|
158
158
|
return (_getBrand$accentText = (_getBrand7 = getBrand(color)) === null || _getBrand7 === void 0 ? void 0 : _getBrand7.accentText) !== null && _getBrand$accentText !== void 0 ? _getBrand$accentText : textAccentMap[color];
|
|
159
159
|
}
|
|
160
160
|
function deletedBackground(color) {
|
|
161
|
-
var _getBrand$
|
|
162
|
-
return (_getBrand$
|
|
161
|
+
var _getBrand$emphasisBac2, _getBrand8;
|
|
162
|
+
return (_getBrand$emphasisBac2 = (_getBrand8 = getBrand(color)) === null || _getBrand8 === void 0 ? void 0 : _getBrand8.emphasisBackground) !== null && _getBrand$emphasisBac2 !== void 0 ? _getBrand$emphasisBac2 : bgSubtlest(color);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
/** Contributor tags use a bold fill with a contrasting foreground, including branded schemes. */
|
|
@@ -241,13 +241,14 @@ export function buildInsertStyleInBlockExtended(colors) {
|
|
|
241
241
|
|
|
242
242
|
/** Active state of the extended insert style. */
|
|
243
243
|
export function buildInsertStyleExtendedActive(colors) {
|
|
244
|
+
var _ref2, _brand$activeBorder;
|
|
244
245
|
var brand = getBrand(colors.insertColor);
|
|
245
246
|
return convertToInlineCss(_objectSpread(_objectSpread({
|
|
246
247
|
background: bgSubtlerPressed(colors.insertActiveColor)
|
|
247
248
|
}, brand ? {
|
|
248
249
|
color: brand.text
|
|
249
250
|
} : {}), {}, {
|
|
250
|
-
borderBottom: "2px solid ".concat(
|
|
251
|
+
borderBottom: "2px solid ".concat((_ref2 = (_brand$activeBorder = brand === null || brand === void 0 ? void 0 : brand.activeBorder) !== null && _brand$activeBorder !== void 0 ? _brand$activeBorder : borderAccentMap[colors.insertColor]) !== null && _ref2 !== void 0 ? _ref2 : borderAccentMap.gray),
|
|
251
252
|
padding: "1px 0 2px"
|
|
252
253
|
}));
|
|
253
254
|
}
|
|
@@ -1042,9 +1043,9 @@ export function buildDeletedQuoteNodeWithLozengeStyle(colors, isActive) {
|
|
|
1042
1043
|
* codeBlock). Every scheme shares the active state; `deletedNodeEmphasis` changes only the
|
|
1043
1044
|
* resting one — 'stateful' a 4px subtlest ring, 'static' a 1px accent ring.
|
|
1044
1045
|
*/
|
|
1045
|
-
export function buildDeletedWrappedBlockOutline(colors,
|
|
1046
|
-
var isActive =
|
|
1047
|
-
isRounded =
|
|
1046
|
+
export function buildDeletedWrappedBlockOutline(colors, _ref3) {
|
|
1047
|
+
var isActive = _ref3.isActive,
|
|
1048
|
+
isRounded = _ref3.isRounded;
|
|
1048
1049
|
if (isActive) {
|
|
1049
1050
|
return isRounded ? buildDeletedBlockOutlineRoundedActive(colors) : buildDeletedBlockOutlineActive(colors);
|
|
1050
1051
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Change } from 'prosemirror-changeset';
|
|
2
2
|
import { type DiffContributors, type DiffStepAttribution, type TagContributor } from '../../../showDiffPluginType';
|
|
3
|
-
import { type
|
|
3
|
+
import { type AccentColor, type ColorScheme } from './types';
|
|
4
4
|
export type DiffAttributionSpanData = DiffStepAttribution & {
|
|
5
5
|
stepIndex: number;
|
|
6
6
|
};
|
|
@@ -24,10 +24,10 @@ export declare const isAttributionColoringEnabled: (stepAttributions: Array<Diff
|
|
|
24
24
|
* a tag only has to name one.
|
|
25
25
|
*/
|
|
26
26
|
export declare const isContributorTagsEnabled: (stepAttributions: Array<DiffStepAttribution | undefined> | undefined, contributors: ResolvedDiffContributors | undefined) => boolean;
|
|
27
|
-
export declare const createAttributionColorMap: (stepAttributions: Array<DiffStepAttribution | undefined>, contributors?: ResolvedDiffContributors) => Map<string,
|
|
27
|
+
export declare const createAttributionColorMap: (stepAttributions: Array<DiffStepAttribution | undefined>, contributors?: ResolvedDiffContributors) => Map<string, AccentColor>;
|
|
28
28
|
/**
|
|
29
29
|
* Preserve overlap attribution outside Confluence version history. Within version history, a
|
|
30
30
|
* recovery step's keyless spans must not inherit an overlapping NCS step's actor.
|
|
31
31
|
*/
|
|
32
32
|
export declare const getAttributionKeyForChange: (change: Change, attributedChanges: Change[]) => string | undefined;
|
|
33
|
-
export declare const getColorSchemeForChange: (change: Change, attributedChanges: Change[], attributionColors: Map<string,
|
|
33
|
+
export declare const getColorSchemeForChange: (change: Change, attributedChanges: Change[], attributionColors: Map<string, AccentColor>, fallback: ColorScheme | undefined) => ColorScheme | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-show-diff",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.11",
|
|
4
4
|
"description": "ShowDiff plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"atlaskit:src": "src/index.ts",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/adf-schema": "^57.7.0",
|
|
29
|
-
"@atlaskit/agent-color": "^1.
|
|
29
|
+
"@atlaskit/agent-color": "^1.1.0",
|
|
30
30
|
"@atlaskit/avatar": "^30.1.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^1.1.0",
|
|
32
32
|
"@atlaskit/editor-plugin-accessibility-utils": "^30.0.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
|
-
"@atlaskit/primitives": "^22.
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
43
|
-
"@atlaskit/tokens": "^20.
|
|
41
|
+
"@atlaskit/primitives": "^22.7.0",
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^260.0.0",
|
|
43
|
+
"@atlaskit/tokens": "^20.10.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@compiled/react": "^1.0.2",
|
|
46
46
|
"bind-event-listener": "^3.0.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/css": "^1.1.0",
|
|
55
55
|
"@atlaskit/dropdown-menu": "^21.1.0",
|
|
56
56
|
"@atlaskit/editor-common": "^134.9.0",
|
|
57
|
-
"@atlaskit/editor-core": "^242.
|
|
57
|
+
"@atlaskit/editor-core": "^242.1.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",
|