@atlaskit/tokens 1.45.1 → 1.47.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 +28 -0
- package/dist/cjs/artifacts/replacement-mapping.js +1 -10
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography-adg3.js +13 -19
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -19
- package/dist/cjs/theme-mutation-observer.js +40 -10
- package/dist/es2019/artifacts/replacement-mapping.js +1 -10
- package/dist/es2019/artifacts/tokens-raw/atlassian-typography-adg3.js +13 -19
- package/dist/es2019/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -19
- package/dist/es2019/theme-mutation-observer.js +38 -10
- package/dist/esm/artifacts/replacement-mapping.js +1 -10
- package/dist/esm/artifacts/tokens-raw/atlassian-typography-adg3.js +13 -19
- package/dist/esm/artifacts/tokens-raw/atlassian-typography-minor3.js +13 -19
- package/dist/esm/theme-mutation-observer.js +39 -9
- package/dist/types/artifacts/replacement-mapping.d.ts +2 -2
- package/dist/types/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/theme-mutation-observer.d.ts +8 -5
- package/dist/types/types.d.ts +9 -9
- package/dist/types/use-theme-observer.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/replacement-mapping.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-adg3.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/theme-mutation-observer.d.ts +8 -5
- package/dist/types-ts4.5/types.d.ts +9 -9
- package/dist/types-ts4.5/use-theme-observer.d.ts +1 -1
- package/figma/atlassian-typography-adg3.json +27 -0
- package/figma/atlassian-typography-minor3.json +27 -0
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/tokens
|
|
2
2
|
|
|
3
|
+
## 1.47.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#98149](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98149)
|
|
8
|
+
[`45101e24202a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/45101e24202a) -
|
|
9
|
+
Change the state of the following tokens from deprecated to active:
|
|
10
|
+
|
|
11
|
+
- font.family.body
|
|
12
|
+
- font.family.code
|
|
13
|
+
- font.family.heading
|
|
14
|
+
|
|
15
|
+
## 1.46.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#97306](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97306)
|
|
20
|
+
[`cefbd515c807`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cefbd515c807) -
|
|
21
|
+
Add support for React 18.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#98562](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98562)
|
|
26
|
+
[`5c59b4fec679`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c59b4fec679) -
|
|
27
|
+
ThemeMutationObserver only ever creates one instance of a mutation observer which reduces memory
|
|
28
|
+
impacts at scale. This change is behind a platform feature flag -
|
|
29
|
+
"platform.design-system-team.mutation-observer-performance-improvement_8usdg"
|
|
30
|
+
|
|
3
31
|
## 1.45.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -18,7 +18,7 @@ exports.default = void 0;
|
|
|
18
18
|
* These changes will then be picked up by our tooling which will attempt to
|
|
19
19
|
* migrate as many of these renames as possible.
|
|
20
20
|
*
|
|
21
|
-
* @codegen <<SignedSource::
|
|
21
|
+
* @codegen <<SignedSource::0bd5759a2d00fb9285fe55febafed591>>
|
|
22
22
|
* @codegenCommand yarn build tokens
|
|
23
23
|
*/
|
|
24
24
|
|
|
@@ -40,15 +40,6 @@ var replacementMapper = [{
|
|
|
40
40
|
}, {
|
|
41
41
|
"path": "font.letterSpacing.400",
|
|
42
42
|
"state": "deprecated"
|
|
43
|
-
}, {
|
|
44
|
-
"path": "font.family.body",
|
|
45
|
-
"state": "deprecated"
|
|
46
|
-
}, {
|
|
47
|
-
"path": "font.family.code",
|
|
48
|
-
"state": "deprecated"
|
|
49
|
-
}, {
|
|
50
|
-
"path": "font.family.heading",
|
|
51
|
-
"state": "deprecated"
|
|
52
43
|
}, {
|
|
53
44
|
"path": "font.family.monospace",
|
|
54
45
|
"state": "deprecated"
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::f7311d82caa5765e51932737a2b690a2>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
var tokens = [{
|
|
@@ -510,10 +510,9 @@ var tokens = [{
|
|
|
510
510
|
}, {
|
|
511
511
|
"attributes": {
|
|
512
512
|
"group": "fontFamily",
|
|
513
|
-
"state": "
|
|
513
|
+
"state": "active",
|
|
514
514
|
"introduced": "1.14.0",
|
|
515
|
-
"description": "
|
|
516
|
-
"deprecated": "1.29.0"
|
|
515
|
+
"description": "Use for body text."
|
|
517
516
|
},
|
|
518
517
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
519
518
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -521,10 +520,9 @@ var tokens = [{
|
|
|
521
520
|
"original": {
|
|
522
521
|
"attributes": {
|
|
523
522
|
"group": "fontFamily",
|
|
524
|
-
"state": "
|
|
523
|
+
"state": "active",
|
|
525
524
|
"introduced": "1.14.0",
|
|
526
|
-
"description": "
|
|
527
|
-
"deprecated": "1.29.0"
|
|
525
|
+
"description": "Use for body text."
|
|
528
526
|
},
|
|
529
527
|
"value": "FontFamilyWebSans"
|
|
530
528
|
},
|
|
@@ -534,10 +532,9 @@ var tokens = [{
|
|
|
534
532
|
}, {
|
|
535
533
|
"attributes": {
|
|
536
534
|
"group": "fontFamily",
|
|
537
|
-
"state": "
|
|
535
|
+
"state": "active",
|
|
538
536
|
"introduced": "1.14.0",
|
|
539
|
-
"description": "
|
|
540
|
-
"deprecated": "1.29.0"
|
|
537
|
+
"description": "Use for monospaced text."
|
|
541
538
|
},
|
|
542
539
|
"value": "ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace",
|
|
543
540
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -545,10 +542,9 @@ var tokens = [{
|
|
|
545
542
|
"original": {
|
|
546
543
|
"attributes": {
|
|
547
544
|
"group": "fontFamily",
|
|
548
|
-
"state": "
|
|
545
|
+
"state": "active",
|
|
549
546
|
"introduced": "1.14.0",
|
|
550
|
-
"description": "
|
|
551
|
-
"deprecated": "1.29.0"
|
|
547
|
+
"description": "Use for monospaced text."
|
|
552
548
|
},
|
|
553
549
|
"value": "FontFamilyWebMono"
|
|
554
550
|
},
|
|
@@ -558,10 +554,9 @@ var tokens = [{
|
|
|
558
554
|
}, {
|
|
559
555
|
"attributes": {
|
|
560
556
|
"group": "fontFamily",
|
|
561
|
-
"state": "
|
|
557
|
+
"state": "active",
|
|
562
558
|
"introduced": "1.14.0",
|
|
563
|
-
"description": "
|
|
564
|
-
"deprecated": "1.29.0"
|
|
559
|
+
"description": "Use for headings."
|
|
565
560
|
},
|
|
566
561
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
567
562
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -569,10 +564,9 @@ var tokens = [{
|
|
|
569
564
|
"original": {
|
|
570
565
|
"attributes": {
|
|
571
566
|
"group": "fontFamily",
|
|
572
|
-
"state": "
|
|
567
|
+
"state": "active",
|
|
573
568
|
"introduced": "1.14.0",
|
|
574
|
-
"description": "
|
|
575
|
-
"deprecated": "1.29.0"
|
|
569
|
+
"description": "Use for headings."
|
|
576
570
|
},
|
|
577
571
|
"value": "FontFamilyWebSans"
|
|
578
572
|
},
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::ddba0c829dd376cacc42efc6bab78142>>
|
|
10
10
|
* @codegenCommand yarn build tokens
|
|
11
11
|
*/
|
|
12
12
|
var tokens = [{
|
|
@@ -510,10 +510,9 @@ var tokens = [{
|
|
|
510
510
|
}, {
|
|
511
511
|
"attributes": {
|
|
512
512
|
"group": "fontFamily",
|
|
513
|
-
"state": "
|
|
513
|
+
"state": "active",
|
|
514
514
|
"introduced": "1.14.0",
|
|
515
|
-
"description": "
|
|
516
|
-
"deprecated": "1.29.0"
|
|
515
|
+
"description": "Use for body text."
|
|
517
516
|
},
|
|
518
517
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
519
518
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -521,10 +520,9 @@ var tokens = [{
|
|
|
521
520
|
"original": {
|
|
522
521
|
"attributes": {
|
|
523
522
|
"group": "fontFamily",
|
|
524
|
-
"state": "
|
|
523
|
+
"state": "active",
|
|
525
524
|
"introduced": "1.14.0",
|
|
526
|
-
"description": "
|
|
527
|
-
"deprecated": "1.29.0"
|
|
525
|
+
"description": "Use for body text."
|
|
528
526
|
},
|
|
529
527
|
"value": "FontFamilyWebSans"
|
|
530
528
|
},
|
|
@@ -534,10 +532,9 @@ var tokens = [{
|
|
|
534
532
|
}, {
|
|
535
533
|
"attributes": {
|
|
536
534
|
"group": "fontFamily",
|
|
537
|
-
"state": "
|
|
535
|
+
"state": "active",
|
|
538
536
|
"introduced": "1.14.0",
|
|
539
|
-
"description": "
|
|
540
|
-
"deprecated": "1.29.0"
|
|
537
|
+
"description": "Use for monospaced text."
|
|
541
538
|
},
|
|
542
539
|
"value": "ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace",
|
|
543
540
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -545,10 +542,9 @@ var tokens = [{
|
|
|
545
542
|
"original": {
|
|
546
543
|
"attributes": {
|
|
547
544
|
"group": "fontFamily",
|
|
548
|
-
"state": "
|
|
545
|
+
"state": "active",
|
|
549
546
|
"introduced": "1.14.0",
|
|
550
|
-
"description": "
|
|
551
|
-
"deprecated": "1.29.0"
|
|
547
|
+
"description": "Use for monospaced text."
|
|
552
548
|
},
|
|
553
549
|
"value": "FontFamilyWebMono"
|
|
554
550
|
},
|
|
@@ -558,10 +554,9 @@ var tokens = [{
|
|
|
558
554
|
}, {
|
|
559
555
|
"attributes": {
|
|
560
556
|
"group": "fontFamily",
|
|
561
|
-
"state": "
|
|
557
|
+
"state": "active",
|
|
562
558
|
"introduced": "1.14.0",
|
|
563
|
-
"description": "
|
|
564
|
-
"deprecated": "1.29.0"
|
|
559
|
+
"description": "Use for headings."
|
|
565
560
|
},
|
|
566
561
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
567
562
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -569,10 +564,9 @@ var tokens = [{
|
|
|
569
564
|
"original": {
|
|
570
565
|
"attributes": {
|
|
571
566
|
"group": "fontFamily",
|
|
572
|
-
"state": "
|
|
567
|
+
"state": "active",
|
|
573
568
|
"introduced": "1.14.0",
|
|
574
|
-
"description": "
|
|
575
|
-
"deprecated": "1.29.0"
|
|
569
|
+
"description": "Use for headings."
|
|
576
570
|
},
|
|
577
571
|
"value": "FontFamilyWebSans"
|
|
578
572
|
},
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _constants = require("./constants");
|
|
12
13
|
var _getGlobalTheme = _interopRequireDefault(require("./get-global-theme"));
|
|
13
14
|
/**
|
|
@@ -26,28 +27,57 @@ var _getGlobalTheme = _interopRequireDefault(require("./get-global-theme"));
|
|
|
26
27
|
var ThemeMutationObserver = exports.default = /*#__PURE__*/function () {
|
|
27
28
|
function ThemeMutationObserver(callback) {
|
|
28
29
|
(0, _classCallCheck2.default)(this, ThemeMutationObserver);
|
|
29
|
-
(0, _defineProperty2.default)(this, "
|
|
30
|
-
(0, _defineProperty2.default)(this, "mediaObserver", null);
|
|
30
|
+
(0, _defineProperty2.default)(this, "legacyObserver", null);
|
|
31
31
|
this.callback = callback;
|
|
32
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
33
|
+
ThemeMutationObserver.callbacks.add(callback);
|
|
34
|
+
}
|
|
32
35
|
}
|
|
33
36
|
(0, _createClass2.default)(ThemeMutationObserver, [{
|
|
34
37
|
key: "observe",
|
|
35
38
|
value: function observe() {
|
|
36
39
|
var _this = this;
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
41
|
+
if (!ThemeMutationObserver.observer) {
|
|
42
|
+
ThemeMutationObserver.observer = new MutationObserver(function () {
|
|
43
|
+
var theme = (0, _getGlobalTheme.default)();
|
|
44
|
+
ThemeMutationObserver.callbacks.forEach(function (callback) {
|
|
45
|
+
return callback(theme);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
// Observer only needs to be configured once
|
|
49
|
+
ThemeMutationObserver.observer.observe(document.documentElement, {
|
|
50
|
+
attributeFilter: [_constants.THEME_DATA_ATTRIBUTE, _constants.COLOR_MODE_ATTRIBUTE]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
if (!this.legacyObserver) {
|
|
55
|
+
this.legacyObserver = new MutationObserver(function () {
|
|
56
|
+
_this.callback((0, _getGlobalTheme.default)());
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
this.legacyObserver.observe(document.documentElement, {
|
|
60
|
+
attributeFilter: [_constants.THEME_DATA_ATTRIBUTE, _constants.COLOR_MODE_ATTRIBUTE]
|
|
40
61
|
});
|
|
41
62
|
}
|
|
42
|
-
this.observer.observe(document.documentElement, {
|
|
43
|
-
attributeFilter: [_constants.THEME_DATA_ATTRIBUTE, _constants.COLOR_MODE_ATTRIBUTE]
|
|
44
|
-
});
|
|
45
63
|
}
|
|
46
64
|
}, {
|
|
47
65
|
key: "disconnect",
|
|
48
66
|
value: function disconnect() {
|
|
49
|
-
|
|
67
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
68
|
+
if (this.callback) {
|
|
69
|
+
ThemeMutationObserver.callbacks.delete(this.callback);
|
|
70
|
+
}
|
|
71
|
+
if (ThemeMutationObserver.callbacks.size === 0 && ThemeMutationObserver.observer) {
|
|
72
|
+
ThemeMutationObserver.observer.disconnect();
|
|
73
|
+
ThemeMutationObserver.observer = null;
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
this.legacyObserver && this.legacyObserver.disconnect();
|
|
77
|
+
}
|
|
50
78
|
}
|
|
51
79
|
}]);
|
|
52
80
|
return ThemeMutationObserver;
|
|
53
|
-
}();
|
|
81
|
+
}();
|
|
82
|
+
(0, _defineProperty2.default)(ThemeMutationObserver, "observer", null);
|
|
83
|
+
(0, _defineProperty2.default)(ThemeMutationObserver, "callbacks", new Set());
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* These changes will then be picked up by our tooling which will attempt to
|
|
13
13
|
* migrate as many of these renames as possible.
|
|
14
14
|
*
|
|
15
|
-
* @codegen <<SignedSource::
|
|
15
|
+
* @codegen <<SignedSource::0bd5759a2d00fb9285fe55febafed591>>
|
|
16
16
|
* @codegenCommand yarn build tokens
|
|
17
17
|
*/
|
|
18
18
|
|
|
@@ -34,15 +34,6 @@ const replacementMapper = [{
|
|
|
34
34
|
}, {
|
|
35
35
|
"path": "font.letterSpacing.400",
|
|
36
36
|
"state": "deprecated"
|
|
37
|
-
}, {
|
|
38
|
-
"path": "font.family.body",
|
|
39
|
-
"state": "deprecated"
|
|
40
|
-
}, {
|
|
41
|
-
"path": "font.family.code",
|
|
42
|
-
"state": "deprecated"
|
|
43
|
-
}, {
|
|
44
|
-
"path": "font.family.heading",
|
|
45
|
-
"state": "deprecated"
|
|
46
37
|
}, {
|
|
47
38
|
"path": "font.family.monospace",
|
|
48
39
|
"state": "deprecated"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::f7311d82caa5765e51932737a2b690a2>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
const tokens = [{
|
|
@@ -504,10 +504,9 @@ const tokens = [{
|
|
|
504
504
|
}, {
|
|
505
505
|
"attributes": {
|
|
506
506
|
"group": "fontFamily",
|
|
507
|
-
"state": "
|
|
507
|
+
"state": "active",
|
|
508
508
|
"introduced": "1.14.0",
|
|
509
|
-
"description": "
|
|
510
|
-
"deprecated": "1.29.0"
|
|
509
|
+
"description": "Use for body text."
|
|
511
510
|
},
|
|
512
511
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
513
512
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -515,10 +514,9 @@ const tokens = [{
|
|
|
515
514
|
"original": {
|
|
516
515
|
"attributes": {
|
|
517
516
|
"group": "fontFamily",
|
|
518
|
-
"state": "
|
|
517
|
+
"state": "active",
|
|
519
518
|
"introduced": "1.14.0",
|
|
520
|
-
"description": "
|
|
521
|
-
"deprecated": "1.29.0"
|
|
519
|
+
"description": "Use for body text."
|
|
522
520
|
},
|
|
523
521
|
"value": "FontFamilyWebSans"
|
|
524
522
|
},
|
|
@@ -528,10 +526,9 @@ const tokens = [{
|
|
|
528
526
|
}, {
|
|
529
527
|
"attributes": {
|
|
530
528
|
"group": "fontFamily",
|
|
531
|
-
"state": "
|
|
529
|
+
"state": "active",
|
|
532
530
|
"introduced": "1.14.0",
|
|
533
|
-
"description": "
|
|
534
|
-
"deprecated": "1.29.0"
|
|
531
|
+
"description": "Use for monospaced text."
|
|
535
532
|
},
|
|
536
533
|
"value": "ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace",
|
|
537
534
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -539,10 +536,9 @@ const tokens = [{
|
|
|
539
536
|
"original": {
|
|
540
537
|
"attributes": {
|
|
541
538
|
"group": "fontFamily",
|
|
542
|
-
"state": "
|
|
539
|
+
"state": "active",
|
|
543
540
|
"introduced": "1.14.0",
|
|
544
|
-
"description": "
|
|
545
|
-
"deprecated": "1.29.0"
|
|
541
|
+
"description": "Use for monospaced text."
|
|
546
542
|
},
|
|
547
543
|
"value": "FontFamilyWebMono"
|
|
548
544
|
},
|
|
@@ -552,10 +548,9 @@ const tokens = [{
|
|
|
552
548
|
}, {
|
|
553
549
|
"attributes": {
|
|
554
550
|
"group": "fontFamily",
|
|
555
|
-
"state": "
|
|
551
|
+
"state": "active",
|
|
556
552
|
"introduced": "1.14.0",
|
|
557
|
-
"description": "
|
|
558
|
-
"deprecated": "1.29.0"
|
|
553
|
+
"description": "Use for headings."
|
|
559
554
|
},
|
|
560
555
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
561
556
|
"filePath": "schema/themes/atlassian-typography-adg3/font-family.tsx",
|
|
@@ -563,10 +558,9 @@ const tokens = [{
|
|
|
563
558
|
"original": {
|
|
564
559
|
"attributes": {
|
|
565
560
|
"group": "fontFamily",
|
|
566
|
-
"state": "
|
|
561
|
+
"state": "active",
|
|
567
562
|
"introduced": "1.14.0",
|
|
568
|
-
"description": "
|
|
569
|
-
"deprecated": "1.29.0"
|
|
563
|
+
"description": "Use for headings."
|
|
570
564
|
},
|
|
571
565
|
"value": "FontFamilyWebSans"
|
|
572
566
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::ddba0c829dd376cacc42efc6bab78142>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
const tokens = [{
|
|
@@ -504,10 +504,9 @@ const tokens = [{
|
|
|
504
504
|
}, {
|
|
505
505
|
"attributes": {
|
|
506
506
|
"group": "fontFamily",
|
|
507
|
-
"state": "
|
|
507
|
+
"state": "active",
|
|
508
508
|
"introduced": "1.14.0",
|
|
509
|
-
"description": "
|
|
510
|
-
"deprecated": "1.29.0"
|
|
509
|
+
"description": "Use for body text."
|
|
511
510
|
},
|
|
512
511
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
513
512
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -515,10 +514,9 @@ const tokens = [{
|
|
|
515
514
|
"original": {
|
|
516
515
|
"attributes": {
|
|
517
516
|
"group": "fontFamily",
|
|
518
|
-
"state": "
|
|
517
|
+
"state": "active",
|
|
519
518
|
"introduced": "1.14.0",
|
|
520
|
-
"description": "
|
|
521
|
-
"deprecated": "1.29.0"
|
|
519
|
+
"description": "Use for body text."
|
|
522
520
|
},
|
|
523
521
|
"value": "FontFamilyWebSans"
|
|
524
522
|
},
|
|
@@ -528,10 +526,9 @@ const tokens = [{
|
|
|
528
526
|
}, {
|
|
529
527
|
"attributes": {
|
|
530
528
|
"group": "fontFamily",
|
|
531
|
-
"state": "
|
|
529
|
+
"state": "active",
|
|
532
530
|
"introduced": "1.14.0",
|
|
533
|
-
"description": "
|
|
534
|
-
"deprecated": "1.29.0"
|
|
531
|
+
"description": "Use for monospaced text."
|
|
535
532
|
},
|
|
536
533
|
"value": "ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace",
|
|
537
534
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -539,10 +536,9 @@ const tokens = [{
|
|
|
539
536
|
"original": {
|
|
540
537
|
"attributes": {
|
|
541
538
|
"group": "fontFamily",
|
|
542
|
-
"state": "
|
|
539
|
+
"state": "active",
|
|
543
540
|
"introduced": "1.14.0",
|
|
544
|
-
"description": "
|
|
545
|
-
"deprecated": "1.29.0"
|
|
541
|
+
"description": "Use for monospaced text."
|
|
546
542
|
},
|
|
547
543
|
"value": "FontFamilyWebMono"
|
|
548
544
|
},
|
|
@@ -552,10 +548,9 @@ const tokens = [{
|
|
|
552
548
|
}, {
|
|
553
549
|
"attributes": {
|
|
554
550
|
"group": "fontFamily",
|
|
555
|
-
"state": "
|
|
551
|
+
"state": "active",
|
|
556
552
|
"introduced": "1.14.0",
|
|
557
|
-
"description": "
|
|
558
|
-
"deprecated": "1.29.0"
|
|
553
|
+
"description": "Use for headings."
|
|
559
554
|
},
|
|
560
555
|
"value": "ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif",
|
|
561
556
|
"filePath": "schema/themes/atlassian-typography-minor3/font-family.tsx",
|
|
@@ -563,10 +558,9 @@ const tokens = [{
|
|
|
563
558
|
"original": {
|
|
564
559
|
"attributes": {
|
|
565
560
|
"group": "fontFamily",
|
|
566
|
-
"state": "
|
|
561
|
+
"state": "active",
|
|
567
562
|
"introduced": "1.14.0",
|
|
568
|
-
"description": "
|
|
569
|
-
"deprecated": "1.29.0"
|
|
563
|
+
"description": "Use for headings."
|
|
570
564
|
},
|
|
571
565
|
"value": "FontFamilyWebSans"
|
|
572
566
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { COLOR_MODE_ATTRIBUTE, THEME_DATA_ATTRIBUTE } from './constants';
|
|
3
4
|
import getGlobalTheme from './get-global-theme';
|
|
4
5
|
/**
|
|
@@ -16,21 +17,48 @@ import getGlobalTheme from './get-global-theme';
|
|
|
16
17
|
*/
|
|
17
18
|
export default class ThemeMutationObserver {
|
|
18
19
|
constructor(callback) {
|
|
19
|
-
_defineProperty(this, "
|
|
20
|
-
_defineProperty(this, "mediaObserver", null);
|
|
20
|
+
_defineProperty(this, "legacyObserver", null);
|
|
21
21
|
this.callback = callback;
|
|
22
|
+
if (getBooleanFF('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
23
|
+
ThemeMutationObserver.callbacks.add(callback);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
observe() {
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
if (getBooleanFF('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
28
|
+
if (!ThemeMutationObserver.observer) {
|
|
29
|
+
ThemeMutationObserver.observer = new MutationObserver(() => {
|
|
30
|
+
const theme = getGlobalTheme();
|
|
31
|
+
ThemeMutationObserver.callbacks.forEach(callback => callback(theme));
|
|
32
|
+
});
|
|
33
|
+
// Observer only needs to be configured once
|
|
34
|
+
ThemeMutationObserver.observer.observe(document.documentElement, {
|
|
35
|
+
attributeFilter: [THEME_DATA_ATTRIBUTE, COLOR_MODE_ATTRIBUTE]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
if (!this.legacyObserver) {
|
|
40
|
+
this.legacyObserver = new MutationObserver(() => {
|
|
41
|
+
this.callback(getGlobalTheme());
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
this.legacyObserver.observe(document.documentElement, {
|
|
45
|
+
attributeFilter: [THEME_DATA_ATTRIBUTE, COLOR_MODE_ATTRIBUTE]
|
|
27
46
|
});
|
|
28
47
|
}
|
|
29
|
-
this.observer.observe(document.documentElement, {
|
|
30
|
-
attributeFilter: [THEME_DATA_ATTRIBUTE, COLOR_MODE_ATTRIBUTE]
|
|
31
|
-
});
|
|
32
48
|
}
|
|
33
49
|
disconnect() {
|
|
34
|
-
|
|
50
|
+
if (getBooleanFF('platform.design-system-team.mutation-observer-performance-improvement_8usdg')) {
|
|
51
|
+
if (this.callback) {
|
|
52
|
+
ThemeMutationObserver.callbacks.delete(this.callback);
|
|
53
|
+
}
|
|
54
|
+
if (ThemeMutationObserver.callbacks.size === 0 && ThemeMutationObserver.observer) {
|
|
55
|
+
ThemeMutationObserver.observer.disconnect();
|
|
56
|
+
ThemeMutationObserver.observer = null;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
this.legacyObserver && this.legacyObserver.disconnect();
|
|
60
|
+
}
|
|
35
61
|
}
|
|
36
|
-
}
|
|
62
|
+
}
|
|
63
|
+
_defineProperty(ThemeMutationObserver, "observer", null);
|
|
64
|
+
_defineProperty(ThemeMutationObserver, "callbacks", new Set());
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* These changes will then be picked up by our tooling which will attempt to
|
|
13
13
|
* migrate as many of these renames as possible.
|
|
14
14
|
*
|
|
15
|
-
* @codegen <<SignedSource::
|
|
15
|
+
* @codegen <<SignedSource::0bd5759a2d00fb9285fe55febafed591>>
|
|
16
16
|
* @codegenCommand yarn build tokens
|
|
17
17
|
*/
|
|
18
18
|
|
|
@@ -34,15 +34,6 @@ var replacementMapper = [{
|
|
|
34
34
|
}, {
|
|
35
35
|
"path": "font.letterSpacing.400",
|
|
36
36
|
"state": "deprecated"
|
|
37
|
-
}, {
|
|
38
|
-
"path": "font.family.body",
|
|
39
|
-
"state": "deprecated"
|
|
40
|
-
}, {
|
|
41
|
-
"path": "font.family.code",
|
|
42
|
-
"state": "deprecated"
|
|
43
|
-
}, {
|
|
44
|
-
"path": "font.family.heading",
|
|
45
|
-
"state": "deprecated"
|
|
46
37
|
}, {
|
|
47
38
|
"path": "font.family.monospace",
|
|
48
39
|
"state": "deprecated"
|