@atlaskit/editor-shared-styles 4.1.17 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/utils.js +19 -3
- package/dist/es2019/utils.js +19 -3
- package/dist/esm/utils.js +19 -3
- package/dist/types/utils.d.ts +5 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-shared-styles
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`920a9bc294e07`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/920a9bc294e07) -
|
|
8
|
+
Show names for supported external agents, plus Claude branding and its consistent orange diff
|
|
9
|
+
colour. Share the Claude colour override through getParticipantColor for diff attribution and
|
|
10
|
+
collaboration telepointers behind confluence_ncs_step_diffing_version_history.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 4.1.17
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/utils.js
CHANGED
|
@@ -6,6 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getHashCode = getHashCode;
|
|
7
7
|
exports.getParticipantColor = getParticipantColor;
|
|
8
8
|
var _consts = require("./consts");
|
|
9
|
+
/** Agent types with a fixed participant colour instead of an identity-derived colour. */
|
|
10
|
+
var AGENT_PARTICIPANT_COLOR_OVERRIDES = {
|
|
11
|
+
claude: 7,
|
|
12
|
+
rovo_chat: 4
|
|
13
|
+
};
|
|
14
|
+
|
|
9
15
|
/**
|
|
10
16
|
* Generates a hash code for a given string.
|
|
11
17
|
*
|
|
@@ -27,12 +33,22 @@ function getHashCode(str) {
|
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
|
-
* Returns
|
|
36
|
+
* Returns an agent brand colour when known, otherwise hashes the participant identity.
|
|
31
37
|
*
|
|
32
38
|
* @param str - The input string used to determine the participant color.
|
|
33
|
-
* @
|
|
39
|
+
* @param agentType - Optional agent type supplied by agent-aware callers.
|
|
40
|
+
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
34
41
|
*/
|
|
35
|
-
function getParticipantColor(str) {
|
|
42
|
+
function getParticipantColor(str, agentType) {
|
|
43
|
+
var fixedColorIndex = agentType ? AGENT_PARTICIPANT_COLOR_OVERRIDES[agentType.trim().toLowerCase()] : undefined;
|
|
44
|
+
if (fixedColorIndex !== undefined) {
|
|
45
|
+
var _index = fixedColorIndex;
|
|
46
|
+
return {
|
|
47
|
+
index: _index,
|
|
48
|
+
color: _consts.participantColors[_index],
|
|
49
|
+
isFixed: true
|
|
50
|
+
};
|
|
51
|
+
}
|
|
36
52
|
var index = getHashCode(str) % _consts.participantColors.length;
|
|
37
53
|
return {
|
|
38
54
|
index: index,
|
package/dist/es2019/utils.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { participantColors } from './consts';
|
|
2
2
|
|
|
3
|
+
/** Agent types with a fixed participant colour instead of an identity-derived colour. */
|
|
4
|
+
const AGENT_PARTICIPANT_COLOR_OVERRIDES = {
|
|
5
|
+
claude: 7,
|
|
6
|
+
rovo_chat: 4
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* Generates a hash code for a given string.
|
|
5
11
|
*
|
|
@@ -21,12 +27,22 @@ export function getHashCode(str) {
|
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
|
-
* Returns
|
|
30
|
+
* Returns an agent brand colour when known, otherwise hashes the participant identity.
|
|
25
31
|
*
|
|
26
32
|
* @param str - The input string used to determine the participant color.
|
|
27
|
-
* @
|
|
33
|
+
* @param agentType - Optional agent type supplied by agent-aware callers.
|
|
34
|
+
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
28
35
|
*/
|
|
29
|
-
export function getParticipantColor(str) {
|
|
36
|
+
export function getParticipantColor(str, agentType) {
|
|
37
|
+
const fixedColorIndex = agentType ? AGENT_PARTICIPANT_COLOR_OVERRIDES[agentType.trim().toLowerCase()] : undefined;
|
|
38
|
+
if (fixedColorIndex !== undefined) {
|
|
39
|
+
const index = fixedColorIndex;
|
|
40
|
+
return {
|
|
41
|
+
index,
|
|
42
|
+
color: participantColors[index],
|
|
43
|
+
isFixed: true
|
|
44
|
+
};
|
|
45
|
+
}
|
|
30
46
|
const index = getHashCode(str) % participantColors.length;
|
|
31
47
|
return {
|
|
32
48
|
index,
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { participantColors } from './consts';
|
|
2
2
|
|
|
3
|
+
/** Agent types with a fixed participant colour instead of an identity-derived colour. */
|
|
4
|
+
var AGENT_PARTICIPANT_COLOR_OVERRIDES = {
|
|
5
|
+
claude: 7,
|
|
6
|
+
rovo_chat: 4
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* Generates a hash code for a given string.
|
|
5
11
|
*
|
|
@@ -21,12 +27,22 @@ export function getHashCode(str) {
|
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
|
-
* Returns
|
|
30
|
+
* Returns an agent brand colour when known, otherwise hashes the participant identity.
|
|
25
31
|
*
|
|
26
32
|
* @param str - The input string used to determine the participant color.
|
|
27
|
-
* @
|
|
33
|
+
* @param agentType - Optional agent type supplied by agent-aware callers.
|
|
34
|
+
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
28
35
|
*/
|
|
29
|
-
export function getParticipantColor(str) {
|
|
36
|
+
export function getParticipantColor(str, agentType) {
|
|
37
|
+
var fixedColorIndex = agentType ? AGENT_PARTICIPANT_COLOR_OVERRIDES[agentType.trim().toLowerCase()] : undefined;
|
|
38
|
+
if (fixedColorIndex !== undefined) {
|
|
39
|
+
var _index = fixedColorIndex;
|
|
40
|
+
return {
|
|
41
|
+
index: _index,
|
|
42
|
+
color: participantColors[_index],
|
|
43
|
+
isFixed: true
|
|
44
|
+
};
|
|
45
|
+
}
|
|
30
46
|
var index = getHashCode(str) % participantColors.length;
|
|
31
47
|
return {
|
|
32
48
|
index: index,
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -10,12 +10,14 @@ import { type ParticipantColor } from './consts';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function getHashCode(str: string): number;
|
|
12
12
|
/**
|
|
13
|
-
* Returns
|
|
13
|
+
* Returns an agent brand colour when known, otherwise hashes the participant identity.
|
|
14
14
|
*
|
|
15
15
|
* @param str - The input string used to determine the participant color.
|
|
16
|
-
* @
|
|
16
|
+
* @param agentType - Optional agent type supplied by agent-aware callers.
|
|
17
|
+
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
17
18
|
*/
|
|
18
|
-
export declare function getParticipantColor(str: string): {
|
|
19
|
+
export declare function getParticipantColor(str: string, agentType?: string): {
|
|
19
20
|
color: ParticipantColor;
|
|
20
21
|
index: number;
|
|
22
|
+
isFixed?: true;
|
|
21
23
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-shared-styles",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Style values used in the editor/renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
33
|
-
"@atlaskit/tokens": "^16.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^186.0.0",
|
|
33
|
+
"@atlaskit/tokens": "^16.12.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"@emotion/react": "^11.7.1"
|
|
36
36
|
}
|