@atlaskit/tokens 1.3.1 → 1.3.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,11 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bae41641c82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bae41641c82) - Enable the dark theme tweaks for Confluence behind a feature flag.
8
+
3
9
  ## 1.3.1
4
10
 
5
11
  ### Patch Changes
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
9
9
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
10
10
  var name = "@atlaskit/tokens";
11
- var version = "1.3.1";
11
+ var version = "1.3.2";
12
12
  /**
13
13
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
14
14
  * resulting CSS Custom Property.
@@ -9,7 +9,7 @@ var _warnOnce = _interopRequireDefault(require("@atlaskit/ds-lib/warn-once"));
9
9
  var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
10
10
  var _constants = require("./constants");
11
11
  var name = "@atlaskit/tokens";
12
- var version = "1.3.1";
12
+ var version = "1.3.2";
13
13
  /**
14
14
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
15
15
  * This should be used to implement design decisions throughout your application.
@@ -120,15 +120,29 @@ var setGlobalTheme = /*#__PURE__*/function () {
120
120
  };
121
121
  }()));
122
122
  case 4:
123
- if (!(
123
+ if (!themePreferences.includes('dark')) {
124
+ _context2.next = 13;
125
+ break;
126
+ }
127
+ if (!
124
128
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
125
- (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark'))) {
126
- _context2.next = 7;
129
+ (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln')) {
130
+ _context2.next = 10;
127
131
  break;
128
132
  }
129
- _context2.next = 7;
133
+ _context2.next = 8;
130
134
  return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
131
- case 7:
135
+ case 8:
136
+ _context2.next = 13;
137
+ break;
138
+ case 10:
139
+ if (!(0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.dark-iteration-confluence_e2t22')) {
140
+ _context2.next = 13;
141
+ break;
142
+ }
143
+ _context2.next = 13;
144
+ return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
145
+ case 13:
132
146
  if (colorMode === 'auto' && darkModeMql) {
133
147
  colorMode = darkModeMql.matches ? 'dark' : 'light';
134
148
  // Add an event listener for changes to the system theme.
@@ -154,7 +168,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
154
168
  document.documentElement.setAttribute(key, value);
155
169
  });
156
170
  return _context2.abrupt("return", unbindThemeChangeListener);
157
- case 11:
171
+ case 17:
158
172
  case "end":
159
173
  return _context2.stop();
160
174
  }
@@ -205,10 +219,14 @@ var getThemeStyles = /*#__PURE__*/function () {
205
219
  spacing: spacing,
206
220
  typography: typography
207
221
  });
208
- if (
209
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
210
- (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
211
- themePreferences.push('dark-iteration');
222
+ if (themePreferences.includes('dark')) {
223
+ if (
224
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
225
+ (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln')) {
226
+ themePreferences.push('dark-iteration');
227
+ } else if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.dark-iteration-confluence_e2t22')) {
228
+ themePreferences.push('dark-iteration');
229
+ }
212
230
  }
213
231
  _context4.next = 5;
214
232
  return Promise.all(themePreferences.map( /*#__PURE__*/function () {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -1,7 +1,7 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  const name = "@atlaskit/tokens";
4
- const version = "1.3.1";
4
+ const version = "1.3.2";
5
5
  /**
6
6
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
7
7
  * resulting CSS Custom Property.
@@ -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 = "1.3.1";
5
+ const version = "1.3.2";
6
6
  /**
7
7
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
8
8
  * This should be used to implement design decisions throughout your application.
@@ -78,10 +78,14 @@ const setGlobalTheme = async ({
78
78
  typography
79
79
  });
80
80
  await Promise.all(themePreferences.map(async themeId => await loadAndAppendThemeCss(themeId)));
81
- if (
82
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
83
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
84
- await loadAndAppendThemeCss('dark-iteration');
81
+ if (themePreferences.includes('dark')) {
82
+ if (
83
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
84
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
85
+ await loadAndAppendThemeCss('dark-iteration');
86
+ } else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
87
+ await loadAndAppendThemeCss('dark-iteration');
88
+ }
85
89
  }
86
90
  if (colorMode === 'auto' && darkModeMql) {
87
91
  colorMode = darkModeMql.matches ? 'dark' : 'light';
@@ -134,10 +138,14 @@ export const getThemeStyles = async ({
134
138
  spacing,
135
139
  typography
136
140
  });
137
- if (
138
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
139
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
140
- themePreferences.push('dark-iteration');
141
+ if (themePreferences.includes('dark')) {
142
+ if (
143
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
144
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
145
+ themePreferences.push('dark-iteration');
146
+ } else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
147
+ themePreferences.push('dark-iteration');
148
+ }
141
149
  }
142
150
  const results = await Promise.all(themePreferences.map(async themeId => {
143
151
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
@@ -1,7 +1,7 @@
1
1
  import warnOnce from '@atlaskit/ds-lib/warn-once';
2
2
  import tokens from './artifacts/token-names';
3
3
  var name = "@atlaskit/tokens";
4
- var version = "1.3.1";
4
+ var version = "1.3.2";
5
5
  /**
6
6
  * Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
7
7
  * resulting CSS Custom Property.
@@ -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 = "1.3.1";
5
+ var version = "1.3.2";
6
6
  /**
7
7
  * Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
8
8
  * This should be used to implement design decisions throughout your application.
@@ -114,15 +114,29 @@ var setGlobalTheme = /*#__PURE__*/function () {
114
114
  };
115
115
  }()));
116
116
  case 4:
117
- if (!(
117
+ if (!themePreferences.includes('dark')) {
118
+ _context2.next = 13;
119
+ break;
120
+ }
121
+ if (!
118
122
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
119
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark'))) {
120
- _context2.next = 7;
123
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
124
+ _context2.next = 10;
121
125
  break;
122
126
  }
123
- _context2.next = 7;
127
+ _context2.next = 8;
124
128
  return loadAndAppendThemeCss('dark-iteration');
125
- case 7:
129
+ case 8:
130
+ _context2.next = 13;
131
+ break;
132
+ case 10:
133
+ if (!getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
134
+ _context2.next = 13;
135
+ break;
136
+ }
137
+ _context2.next = 13;
138
+ return loadAndAppendThemeCss('dark-iteration');
139
+ case 13:
126
140
  if (colorMode === 'auto' && darkModeMql) {
127
141
  colorMode = darkModeMql.matches ? 'dark' : 'light';
128
142
  // Add an event listener for changes to the system theme.
@@ -148,7 +162,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
148
162
  document.documentElement.setAttribute(key, value);
149
163
  });
150
164
  return _context2.abrupt("return", unbindThemeChangeListener);
151
- case 11:
165
+ case 17:
152
166
  case "end":
153
167
  return _context2.stop();
154
168
  }
@@ -199,10 +213,14 @@ export var getThemeStyles = /*#__PURE__*/function () {
199
213
  spacing: spacing,
200
214
  typography: typography
201
215
  });
202
- if (
203
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
204
- getBooleanFF('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
205
- themePreferences.push('dark-iteration');
216
+ if (themePreferences.includes('dark')) {
217
+ if (
218
+ // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
219
+ getBooleanFF('design-system-team.dark-theme-iteration_dk1ln')) {
220
+ themePreferences.push('dark-iteration');
221
+ } else if (getBooleanFF('platform.design-system-team.dark-iteration-confluence_e2t22')) {
222
+ themePreferences.push('dark-iteration');
223
+ }
206
224
  }
207
225
  _context4.next = 5;
208
226
  return Promise.all(themePreferences.map( /*#__PURE__*/function () {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "sideEffects": [
5
5
  "**/*.css"
6
6
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "author": "Atlassian Pty Ltd",
5
5
  "description": "Design tokens are the single source of truth to name and store design decisions.",
6
6
  "license": "Apache-2.0",
@@ -135,6 +135,9 @@
135
135
  "platform-feature-flags": {
136
136
  "design-system-team.dark-theme-iteration_dk1ln": {
137
137
  "type": "boolean"
138
+ },
139
+ "platform.design-system-team.dark-iteration-confluence_e2t22": {
140
+ "type": "boolean"
138
141
  }
139
142
  },
140
143
  "homepage": "https://atlassian.design/components/tokens",