@atlaskit/editor-shared-styles 4.3.18 → 4.3.20
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 +27 -0
- package/dist/cjs/utils.js +35 -16
- package/dist/es2019/utils.js +35 -16
- package/dist/esm/utils.js +35 -16
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/editor-shared-styles
|
|
2
2
|
|
|
3
|
+
## 4.3.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b378d1dd86483`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b378d1dd86483) -
|
|
8
|
+
Brand ChatGPT contributor tags with the ChatGPT icon and a fixed colour.
|
|
9
|
+
|
|
10
|
+
Centralised agent brand metadata in `@atlaskit/agent-color`: added `agent-brand-claude`,
|
|
11
|
+
`agent-brand-chatgpt` and `agent-brand-rovo` colour schemes, and extended
|
|
12
|
+
`getThirdPartyAgentColor` (`./get-third-party-agent-color`) to also resolve the
|
|
13
|
+
`claude`/`chatgpt`/`rovo`/`rovo_chat` aliases and return a canonical display `name`. Removed the
|
|
14
|
+
now-redundant `./chatgpt-brand-color` export (`CHATGPT_BRAND_COLOR`) — its value is now the
|
|
15
|
+
`agent-brand-chatgpt` scheme's `bold`/`boldText` fields, reachable through
|
|
16
|
+
`getThirdPartyAgentColor`.
|
|
17
|
+
|
|
18
|
+
`editor-shared-styles` and `editor-plugin-show-diff` now resolve their brand colours and
|
|
19
|
+
contributor-tag names through this shared lookup instead of maintaining their own per-package
|
|
20
|
+
brand tables, with no behaviour change.
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 4.3.19
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 4.3.18
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/cjs/utils.js
CHANGED
|
@@ -6,21 +6,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getHashCode = getHashCode;
|
|
7
7
|
exports.getParticipantColor = getParticipantColor;
|
|
8
8
|
var _getAgentColor = require("@atlaskit/agent-color/get-agent-color");
|
|
9
|
+
var _getThirdPartyAgentColor = require("@atlaskit/agent-color/get-third-party-agent-color");
|
|
9
10
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
10
11
|
var _consts = require("./consts");
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
+
* Fixed telepointer palette slot for each `@atlaskit/agent-color` brand this editor recognises by
|
|
14
|
+
* a reserved identity colour rather than a hashed one.
|
|
13
15
|
*
|
|
14
|
-
* Claude uses orange
|
|
15
|
-
*
|
|
16
|
+
* Claude uses orange (`participantColors[7]`), Rovo purple (`[4]`), ChatGPT gray (`[9]`, but with
|
|
17
|
+
* its own brand colour rather than the palette's — see `BRAND_EXACT_COLOR_SCHEMES`). The palette's
|
|
18
|
+
* numbered positions also back the telepointer CSS classes, so preserve these positions when
|
|
19
|
+
* editing the palette. Brands `@atlaskit/agent-color` resolves but this table omits (e.g. Figma,
|
|
20
|
+
* Replit) fall through to the identity-hashed colour below.
|
|
16
21
|
*/
|
|
17
|
-
var
|
|
18
|
-
claude: 7,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
rovo_chat: 4
|
|
22
|
+
var BRAND_PARTICIPANT_COLOR_INDEX = {
|
|
23
|
+
'agent-brand-claude': 7,
|
|
24
|
+
'agent-brand-rovo': 4,
|
|
25
|
+
'agent-brand-chatgpt': 9
|
|
22
26
|
};
|
|
23
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Brands whose own colour (`getThirdPartyAgentColor`'s `bold`/`boldText`) is used instead of their
|
|
30
|
+
* palette slot's — no ADS token matches these brands' colour, so the palette slot would be wrong.
|
|
31
|
+
*/
|
|
32
|
+
var BRAND_EXACT_COLOR_SCHEMES = new Set(['agent-brand-chatgpt']);
|
|
33
|
+
|
|
24
34
|
/** Maps Agent Studio's semantic palette to the established telepointer palette slots. */
|
|
25
35
|
var AGENT_COLOR_TO_PARTICIPANT_COLOR_INDEX = {
|
|
26
36
|
yellow: 3,
|
|
@@ -74,14 +84,23 @@ function getHashCode(str) {
|
|
|
74
84
|
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
75
85
|
*/
|
|
76
86
|
function getParticipantColor(str, agentType) {
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
var brand = agentType ? (0, _getThirdPartyAgentColor.getThirdPartyAgentColor)({
|
|
88
|
+
agentName: agentType
|
|
89
|
+
}) : undefined;
|
|
90
|
+
if (brand) {
|
|
91
|
+
var fixedIndex = BRAND_PARTICIPANT_COLOR_INDEX[brand.scheme];
|
|
92
|
+
if (fixedIndex !== undefined) {
|
|
93
|
+
var color = BRAND_EXACT_COLOR_SCHEMES.has(brand.scheme) ? {
|
|
94
|
+
backgroundColor: brand.bold,
|
|
95
|
+
svgBackgroundColor: brand.bold,
|
|
96
|
+
textColor: brand.boldText
|
|
97
|
+
} : _consts.participantColors[fixedIndex];
|
|
98
|
+
return {
|
|
99
|
+
index: fixedIndex,
|
|
100
|
+
color: color,
|
|
101
|
+
isFixed: true
|
|
102
|
+
};
|
|
103
|
+
}
|
|
85
104
|
}
|
|
86
105
|
var agentColor = agentType ? (0, _getAgentColor.getAgentColor)({
|
|
87
106
|
agentId: str
|
package/dist/es2019/utils.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { getAgentColor } from '@atlaskit/agent-color/get-agent-color';
|
|
2
|
+
import { getThirdPartyAgentColor } from '@atlaskit/agent-color/get-third-party-agent-color';
|
|
2
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
4
|
import { participantColors } from './consts';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Fixed telepointer palette slot for each `@atlaskit/agent-color` brand this editor recognises by
|
|
8
|
+
* a reserved identity colour rather than a hashed one.
|
|
7
9
|
*
|
|
8
|
-
* Claude uses orange
|
|
9
|
-
*
|
|
10
|
+
* Claude uses orange (`participantColors[7]`), Rovo purple (`[4]`), ChatGPT gray (`[9]`, but with
|
|
11
|
+
* its own brand colour rather than the palette's — see `BRAND_EXACT_COLOR_SCHEMES`). The palette's
|
|
12
|
+
* numbered positions also back the telepointer CSS classes, so preserve these positions when
|
|
13
|
+
* editing the palette. Brands `@atlaskit/agent-color` resolves but this table omits (e.g. Figma,
|
|
14
|
+
* Replit) fall through to the identity-hashed colour below.
|
|
10
15
|
*/
|
|
11
|
-
const
|
|
12
|
-
claude: 7,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rovo_chat: 4
|
|
16
|
+
const BRAND_PARTICIPANT_COLOR_INDEX = {
|
|
17
|
+
'agent-brand-claude': 7,
|
|
18
|
+
'agent-brand-rovo': 4,
|
|
19
|
+
'agent-brand-chatgpt': 9
|
|
16
20
|
};
|
|
17
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Brands whose own colour (`getThirdPartyAgentColor`'s `bold`/`boldText`) is used instead of their
|
|
24
|
+
* palette slot's — no ADS token matches these brands' colour, so the palette slot would be wrong.
|
|
25
|
+
*/
|
|
26
|
+
const BRAND_EXACT_COLOR_SCHEMES = new Set(['agent-brand-chatgpt']);
|
|
27
|
+
|
|
18
28
|
/** Maps Agent Studio's semantic palette to the established telepointer palette slots. */
|
|
19
29
|
const AGENT_COLOR_TO_PARTICIPANT_COLOR_INDEX = {
|
|
20
30
|
yellow: 3,
|
|
@@ -68,14 +78,23 @@ export function getHashCode(str) {
|
|
|
68
78
|
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
69
79
|
*/
|
|
70
80
|
export function getParticipantColor(str, agentType) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
const brand = agentType ? getThirdPartyAgentColor({
|
|
82
|
+
agentName: agentType
|
|
83
|
+
}) : undefined;
|
|
84
|
+
if (brand) {
|
|
85
|
+
const fixedIndex = BRAND_PARTICIPANT_COLOR_INDEX[brand.scheme];
|
|
86
|
+
if (fixedIndex !== undefined) {
|
|
87
|
+
const color = BRAND_EXACT_COLOR_SCHEMES.has(brand.scheme) ? {
|
|
88
|
+
backgroundColor: brand.bold,
|
|
89
|
+
svgBackgroundColor: brand.bold,
|
|
90
|
+
textColor: brand.boldText
|
|
91
|
+
} : participantColors[fixedIndex];
|
|
92
|
+
return {
|
|
93
|
+
index: fixedIndex,
|
|
94
|
+
color,
|
|
95
|
+
isFixed: true
|
|
96
|
+
};
|
|
97
|
+
}
|
|
79
98
|
}
|
|
80
99
|
const agentColor = agentType ? getAgentColor({
|
|
81
100
|
agentId: str
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { getAgentColor } from '@atlaskit/agent-color/get-agent-color';
|
|
2
|
+
import { getThirdPartyAgentColor } from '@atlaskit/agent-color/get-third-party-agent-color';
|
|
2
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
4
|
import { participantColors } from './consts';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Fixed telepointer palette slot for each `@atlaskit/agent-color` brand this editor recognises by
|
|
8
|
+
* a reserved identity colour rather than a hashed one.
|
|
7
9
|
*
|
|
8
|
-
* Claude uses orange
|
|
9
|
-
*
|
|
10
|
+
* Claude uses orange (`participantColors[7]`), Rovo purple (`[4]`), ChatGPT gray (`[9]`, but with
|
|
11
|
+
* its own brand colour rather than the palette's — see `BRAND_EXACT_COLOR_SCHEMES`). The palette's
|
|
12
|
+
* numbered positions also back the telepointer CSS classes, so preserve these positions when
|
|
13
|
+
* editing the palette. Brands `@atlaskit/agent-color` resolves but this table omits (e.g. Figma,
|
|
14
|
+
* Replit) fall through to the identity-hashed colour below.
|
|
10
15
|
*/
|
|
11
|
-
var
|
|
12
|
-
claude: 7,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rovo_chat: 4
|
|
16
|
+
var BRAND_PARTICIPANT_COLOR_INDEX = {
|
|
17
|
+
'agent-brand-claude': 7,
|
|
18
|
+
'agent-brand-rovo': 4,
|
|
19
|
+
'agent-brand-chatgpt': 9
|
|
16
20
|
};
|
|
17
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Brands whose own colour (`getThirdPartyAgentColor`'s `bold`/`boldText`) is used instead of their
|
|
24
|
+
* palette slot's — no ADS token matches these brands' colour, so the palette slot would be wrong.
|
|
25
|
+
*/
|
|
26
|
+
var BRAND_EXACT_COLOR_SCHEMES = new Set(['agent-brand-chatgpt']);
|
|
27
|
+
|
|
18
28
|
/** Maps Agent Studio's semantic palette to the established telepointer palette slots. */
|
|
19
29
|
var AGENT_COLOR_TO_PARTICIPANT_COLOR_INDEX = {
|
|
20
30
|
yellow: 3,
|
|
@@ -68,14 +78,23 @@ export function getHashCode(str) {
|
|
|
68
78
|
* @returns The palette colour and index; `isFixed` prevents callers from reallocating brand colours.
|
|
69
79
|
*/
|
|
70
80
|
export function getParticipantColor(str, agentType) {
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
var brand = agentType ? getThirdPartyAgentColor({
|
|
82
|
+
agentName: agentType
|
|
83
|
+
}) : undefined;
|
|
84
|
+
if (brand) {
|
|
85
|
+
var fixedIndex = BRAND_PARTICIPANT_COLOR_INDEX[brand.scheme];
|
|
86
|
+
if (fixedIndex !== undefined) {
|
|
87
|
+
var color = BRAND_EXACT_COLOR_SCHEMES.has(brand.scheme) ? {
|
|
88
|
+
backgroundColor: brand.bold,
|
|
89
|
+
svgBackgroundColor: brand.bold,
|
|
90
|
+
textColor: brand.boldText
|
|
91
|
+
} : participantColors[fixedIndex];
|
|
92
|
+
return {
|
|
93
|
+
index: fixedIndex,
|
|
94
|
+
color: color,
|
|
95
|
+
isFixed: true
|
|
96
|
+
};
|
|
97
|
+
}
|
|
79
98
|
}
|
|
80
99
|
var agentColor = agentType ? getAgentColor({
|
|
81
100
|
agentId: str
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-shared-styles",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.20",
|
|
4
4
|
"description": "Style values used in the editor/renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/agent-color": "^0.
|
|
32
|
+
"@atlaskit/agent-color": "^1.0.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
35
|
-
"@atlaskit/tokens": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^203.0.0",
|
|
35
|
+
"@atlaskit/tokens": "^19.0.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"@emotion/react": "^11.7.1"
|
|
38
38
|
},
|