@atlaskit/tokens 0.11.4 → 0.11.5
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 +6 -0
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/theme-change-observer.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/theme-change-observer.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/theme-change-observer.js +2 -2
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
- package/report.api.md +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/tokens
|
|
2
2
|
|
|
3
|
+
## 0.11.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bcef9745338`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bcef9745338) - useThemeObserver now exclusively watches `data-theme` instead of `data-color-mode` to ensure all changes to the theme attr trigger an event. Previously, if a theme moved from light theme, which had a mode="light", to another theme such as legacy-light with the same mode, no event will be triggered.
|
|
8
|
+
|
|
3
9
|
## 0.11.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/get-token.js
CHANGED
|
@@ -14,7 +14,7 @@ var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
|
14
14
|
var _constants = require("./constants");
|
|
15
15
|
|
|
16
16
|
var name = "@atlaskit/tokens";
|
|
17
|
-
var version = "0.11.
|
|
17
|
+
var version = "0.11.5";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/get-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
4
|
const name = "@atlaskit/tokens";
|
|
5
|
-
const version = "0.11.
|
|
5
|
+
const version = "0.11.5";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { COLOR_MODE_ATTRIBUTE } from './constants';
|
|
3
|
+
import { COLOR_MODE_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
|
|
4
4
|
|
|
5
5
|
const getGlobalTheme = () => typeof document !== 'undefined' ? document.documentElement.getAttribute(COLOR_MODE_ATTRIBUTE) : null;
|
|
6
6
|
/**
|
|
@@ -35,7 +35,7 @@ export class ThemeMutationObserver {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
this.observer.observe(document.documentElement, {
|
|
38
|
-
attributeFilter: [
|
|
38
|
+
attributeFilter: [THEME_DATA_ATTRIBUTE]
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/get-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
4
|
var name = "@atlaskit/tokens";
|
|
5
|
-
var version = "0.11.
|
|
5
|
+
var version = "0.11.5";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
|
@@ -3,7 +3,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
|
-
import { COLOR_MODE_ATTRIBUTE } from './constants';
|
|
6
|
+
import { COLOR_MODE_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
|
|
7
7
|
|
|
8
8
|
var getGlobalTheme = function getGlobalTheme() {
|
|
9
9
|
return typeof document !== 'undefined' ? document.documentElement.getAttribute(COLOR_MODE_ATTRIBUTE) : null;
|
|
@@ -46,7 +46,7 @@ export var ThemeMutationObserver = /*#__PURE__*/function () {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
this.observer.observe(document.documentElement, {
|
|
49
|
-
attributeFilter: [
|
|
49
|
+
attributeFilter: [THEME_DATA_ATTRIBUTE]
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
}, {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -916,3 +917,15 @@ export const useThemeObserver: () => ThemeIds | null;
|
|
|
916
917
|
```
|
|
917
918
|
|
|
918
919
|
<!--SECTION END: Main Entry Types-->
|
|
920
|
+
|
|
921
|
+
### Peer Dependencies
|
|
922
|
+
|
|
923
|
+
<!--SECTION START: Peer Dependencies-->
|
|
924
|
+
|
|
925
|
+
```json
|
|
926
|
+
{
|
|
927
|
+
"react": "^16.8.0"
|
|
928
|
+
}
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
<!--SECTION END: Peer Dependencies-->
|