@atlaskit/adf-schema 40.0.0 → 40.0.2
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
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 40.0.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 32c5913: Remove forwards compatability check in JSOn schema
|
8
|
+
|
9
|
+
## 40.0.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- fe59c22: Fix table background colour on dark mode when pasting from the renderer
|
14
|
+
|
3
15
|
## 40.0.0
|
4
16
|
|
5
17
|
### Major Changes
|
@@ -81,6 +81,7 @@ var getGlobalTheme = function getGlobalTheme() {
|
|
81
81
|
colorMode: colorMode
|
82
82
|
};
|
83
83
|
};
|
84
|
+
var cssVariablePattern = /^var\(--.*\)$/;
|
84
85
|
|
85
86
|
/**
|
86
87
|
* gets cell dom attributes based on node attributes
|
@@ -131,6 +132,14 @@ var getCellDomAttrs = exports.getCellDomAttrs = function getCellDomAttrs(node) {
|
|
131
132
|
var tokenColor = (0, _editorPalette.hexToEditorBackgroundPaletteRawValue)(color);
|
132
133
|
if (tokenColor) {
|
133
134
|
attrs.style = "background-color: ".concat(tokenColor, ";");
|
135
|
+
} else if (
|
136
|
+
/**
|
137
|
+
* There was previously a bug in dark mode where we would attempt to invert
|
138
|
+
* a design token in `getDarkModeLCHColor` causing issues.
|
139
|
+
* If it's a design token we should return it as is.
|
140
|
+
*/
|
141
|
+
cssVariablePattern.test(color)) {
|
142
|
+
attrs.style = "background-color: ".concat(color, ";");
|
134
143
|
} else {
|
135
144
|
// if we have a custom color, we need to check if we are in dark mode
|
136
145
|
if (getGlobalTheme().colorMode === 'dark') {
|
@@ -72,6 +72,7 @@ const getGlobalTheme = () => {
|
|
72
72
|
colorMode
|
73
73
|
};
|
74
74
|
};
|
75
|
+
const cssVariablePattern = /^var\(--.*\)$/;
|
75
76
|
|
76
77
|
/**
|
77
78
|
* gets cell dom attributes based on node attributes
|
@@ -124,6 +125,14 @@ export const getCellDomAttrs = node => {
|
|
124
125
|
const tokenColor = hexToEditorBackgroundPaletteRawValue(color);
|
125
126
|
if (tokenColor) {
|
126
127
|
attrs.style = `background-color: ${tokenColor};`;
|
128
|
+
} else if (
|
129
|
+
/**
|
130
|
+
* There was previously a bug in dark mode where we would attempt to invert
|
131
|
+
* a design token in `getDarkModeLCHColor` causing issues.
|
132
|
+
* If it's a design token we should return it as is.
|
133
|
+
*/
|
134
|
+
cssVariablePattern.test(color)) {
|
135
|
+
attrs.style = `background-color: ${color};`;
|
127
136
|
} else {
|
128
137
|
// if we have a custom color, we need to check if we are in dark mode
|
129
138
|
if (getGlobalTheme().colorMode === 'dark') {
|
@@ -77,6 +77,7 @@ var getGlobalTheme = function getGlobalTheme() {
|
|
77
77
|
colorMode: colorMode
|
78
78
|
};
|
79
79
|
};
|
80
|
+
var cssVariablePattern = /^var\(--.*\)$/;
|
80
81
|
|
81
82
|
/**
|
82
83
|
* gets cell dom attributes based on node attributes
|
@@ -127,6 +128,14 @@ export var getCellDomAttrs = function getCellDomAttrs(node) {
|
|
127
128
|
var tokenColor = hexToEditorBackgroundPaletteRawValue(color);
|
128
129
|
if (tokenColor) {
|
129
130
|
attrs.style = "background-color: ".concat(tokenColor, ";");
|
131
|
+
} else if (
|
132
|
+
/**
|
133
|
+
* There was previously a bug in dark mode where we would attempt to invert
|
134
|
+
* a design token in `getDarkModeLCHColor` causing issues.
|
135
|
+
* If it's a design token we should return it as is.
|
136
|
+
*/
|
137
|
+
cssVariablePattern.test(color)) {
|
138
|
+
attrs.style = "background-color: ".concat(color, ";");
|
130
139
|
} else {
|
131
140
|
// if we have a custom color, we need to check if we are in dark mode
|
132
141
|
if (getGlobalTheme().colorMode === 'dark') {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "40.0.
|
3
|
+
"version": "40.0.2",
|
4
4
|
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"devDependencies": {
|
49
49
|
"@atlassian/adf-schema-json": "^1.16.0",
|
50
50
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
51
|
-
"@atlaskit/adf-schema-generator": "^1.28.
|
51
|
+
"@atlaskit/adf-schema-generator": "^1.28.1",
|
52
52
|
"@atlaskit/adf-utils": "^19.2.2",
|
53
53
|
"@atlaskit/codemod-utils": "^4.2.4",
|
54
54
|
"@babel/cli": "^7.22.9",
|
@@ -44,23 +44,9 @@ test('ADF DSL to JSON Schema backwards compatibility for full schema', () => {
|
|
44
44
|
expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
|
45
45
|
});
|
46
46
|
|
47
|
-
test('JSON Schema to ADF DSL backwards compatibility for full schema', () => {
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
49
|
-
const currentSchema = require('../../../json-schema/v1/full.json');
|
50
|
-
const nextSchema = adfToJSON(adfNode, true);
|
51
|
-
expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
|
52
|
-
});
|
53
|
-
|
54
47
|
test('ADF DSL to JSON Schema backwards compatibility for stage0 schema', () => {
|
55
48
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
56
49
|
const currentSchema = require('../../../json-schema/v1/stage-0.json');
|
57
50
|
const nextSchema = adfToJSON(adfNode);
|
58
51
|
expect(nextSchema).toBeBackwardsCompatibleWith(currentSchema);
|
59
52
|
});
|
60
|
-
|
61
|
-
test('JSON Schema to ADF DSL backwards compatibility for stage0 schema', () => {
|
62
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
63
|
-
const currentSchema = require('../../../json-schema/v1/stage-0.json');
|
64
|
-
const nextSchema = adfToJSON(adfNode);
|
65
|
-
expect(currentSchema).toBeBackwardsCompatibleWith(nextSchema);
|
66
|
-
});
|