@atlaskit/tokens 1.2.18 → 1.3.1

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,27 @@
1
1
  # @atlaskit/tokens
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e55ef3fcfac`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e55ef3fcfac) - Fixes an issue where the dark theme tweaks (currently behind a feature flag) were not being displayed in some cases due to a race condition.
8
+
9
+ ## 1.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
19
+ ## 1.2.19
20
+
21
+ ### Patch Changes
22
+
23
+ - [`1a1dc6a0370`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1a1dc6a0370) - Upgrade `@babel` scoped packages to `^7.20.0`
24
+
3
25
  ## 1.2.18
4
26
 
5
27
  ### Patch Changes
@@ -23,42 +23,50 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
23
  var themeImportsMap = {
24
24
  'light': function light() {
25
25
  return Promise.resolve().then(function () {
26
- return _interopRequireWildcard(require('./themes/atlassian-light'));
26
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-light" */
27
+ './themes/atlassian-light'));
27
28
  });
28
29
  },
29
30
  'dark': function dark() {
30
31
  return Promise.resolve().then(function () {
31
- return _interopRequireWildcard(require('./themes/atlassian-dark'));
32
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-dark" */
33
+ './themes/atlassian-dark'));
32
34
  });
33
35
  },
34
36
  'legacy-light': function legacyLight() {
35
37
  return Promise.resolve().then(function () {
36
- return _interopRequireWildcard(require('./themes/atlassian-legacy-light'));
38
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-light" */
39
+ './themes/atlassian-legacy-light'));
37
40
  });
38
41
  },
39
42
  'legacy-dark': function legacyDark() {
40
43
  return Promise.resolve().then(function () {
41
- return _interopRequireWildcard(require('./themes/atlassian-legacy-dark'));
44
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-legacy-dark" */
45
+ './themes/atlassian-legacy-dark'));
42
46
  });
43
47
  },
44
48
  'spacing': function spacing() {
45
49
  return Promise.resolve().then(function () {
46
- return _interopRequireWildcard(require('./themes/atlassian-spacing'));
50
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-spacing" */
51
+ './themes/atlassian-spacing'));
47
52
  });
48
53
  },
49
54
  'typography': function typography() {
50
55
  return Promise.resolve().then(function () {
51
- return _interopRequireWildcard(require('./themes/atlassian-typography'));
56
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-typography" */
57
+ './themes/atlassian-typography'));
52
58
  });
53
59
  },
54
60
  'shape': function shape() {
55
61
  return Promise.resolve().then(function () {
56
- return _interopRequireWildcard(require('./themes/atlassian-shape'));
62
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-shape" */
63
+ './themes/atlassian-shape'));
57
64
  });
58
65
  },
59
66
  'dark-iteration': function darkIteration() {
60
67
  return Promise.resolve().then(function () {
61
- return _interopRequireWildcard(require('./themes/atlassian-dark-iteration'));
68
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_atlassian-dark-iteration" */
69
+ './themes/atlassian-dark-iteration'));
62
70
  });
63
71
  }
64
72
  };
@@ -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.2.18";
11
+ var version = "1.3.1";
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.2.18";
12
+ var version = "1.3.1";
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.
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.getThemeStyles = exports.getThemeHtmlAttrs = exports.getSSRAutoScript = exports.default = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
@@ -16,7 +16,6 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _constants = require("./constants");
17
17
  var _themeLoading = require("./utils/theme-loading");
18
18
  var _themeStateTransformer = require("./utils/theme-state-transformer");
19
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
20
19
  // Represents theme state once mounted to the page (auto is hidden from observers)
21
20
 
22
21
  var defaultColorMode = 'light';
@@ -53,11 +52,6 @@ var getThemePreferences = function getThemePreferences(themeState) {
53
52
  themePreferences.push(themeId);
54
53
  }
55
54
  });
56
- if (
57
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
58
- (0, _platformFeatureFlags.getBooleanFF)('design-system-team.dark-theme-iteration_dk1ln') && themePreferences.includes('dark')) {
59
- themePreferences.push('dark-iteration');
60
- }
61
55
  return (0, _toConsumableArray2.default)(new Set(themePreferences));
62
56
  };
63
57
 
@@ -79,7 +73,7 @@ var getThemePreferences = function getThemePreferences(themeState) {
79
73
  * ```
80
74
  */
81
75
  var setGlobalTheme = /*#__PURE__*/function () {
82
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
76
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
83
77
  var _ref2,
84
78
  _ref2$colorMode,
85
79
  colorMode,
@@ -94,70 +88,75 @@ var setGlobalTheme = /*#__PURE__*/function () {
94
88
  themePreferences,
95
89
  themeAttributes,
96
90
  _args2 = arguments;
97
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
98
- while (1) {
99
- switch (_context2.prev = _context2.next) {
100
- case 0:
101
- _ref2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref2$colorMode = _ref2.colorMode, colorMode = _ref2$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref2$colorMode, _ref2$dark = _ref2.dark, dark = _ref2$dark === void 0 ? themeStateDefaults['dark'] : _ref2$dark, _ref2$light = _ref2.light, light = _ref2$light === void 0 ? themeStateDefaults['light'] : _ref2$light, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? themeStateDefaults['spacing'] : _ref2$spacing, _ref2$typography = _ref2.typography, typography = _ref2$typography === void 0 ? themeStateDefaults['typography'] : _ref2$typography;
102
- themePreferences = getThemePreferences({
103
- colorMode: colorMode,
104
- dark: dark,
105
- light: light,
106
- spacing: spacing,
107
- typography: typography
108
- });
109
- _context2.next = 4;
110
- return Promise.all(themePreferences.map( /*#__PURE__*/function () {
111
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(themeId) {
112
- return _regeneratorRuntime().wrap(function _callee$(_context) {
113
- while (1) {
114
- switch (_context.prev = _context.next) {
115
- case 0:
116
- _context.next = 2;
117
- return (0, _themeLoading.loadAndAppendThemeCss)(themeId);
118
- case 2:
119
- return _context.abrupt("return", _context.sent);
120
- case 3:
121
- case "end":
122
- return _context.stop();
123
- }
124
- }
125
- }, _callee);
126
- }));
127
- return function (_x) {
128
- return _ref3.apply(this, arguments);
129
- };
130
- }()));
131
- case 4:
132
- if (colorMode === 'auto' && darkModeMql) {
133
- colorMode = darkModeMql.matches ? 'dark' : 'light';
134
- // Add an event listener for changes to the system theme.
135
- // If the function exists, it will not be added again.
136
- unbindThemeChangeListener = (0, _bindEventListener.bind)(darkModeMql, {
137
- type: 'change',
138
- listener: checkNativeListener
139
- });
140
- } else {
141
- unbindThemeChangeListener();
142
- }
143
- themeAttributes = getThemeHtmlAttrs({
144
- colorMode: colorMode,
145
- dark: dark,
146
- light: light,
147
- spacing: spacing,
148
- typography: typography
149
- });
150
- Object.entries(themeAttributes).forEach(function (_ref4) {
151
- var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
152
- key = _ref5[0],
153
- value = _ref5[1];
154
- document.documentElement.setAttribute(key, value);
91
+ return _regenerator.default.wrap(function _callee2$(_context2) {
92
+ while (1) switch (_context2.prev = _context2.next) {
93
+ case 0:
94
+ _ref2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref2$colorMode = _ref2.colorMode, colorMode = _ref2$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref2$colorMode, _ref2$dark = _ref2.dark, dark = _ref2$dark === void 0 ? themeStateDefaults['dark'] : _ref2$dark, _ref2$light = _ref2.light, light = _ref2$light === void 0 ? themeStateDefaults['light'] : _ref2$light, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? themeStateDefaults['spacing'] : _ref2$spacing, _ref2$typography = _ref2.typography, typography = _ref2$typography === void 0 ? themeStateDefaults['typography'] : _ref2$typography;
95
+ themePreferences = getThemePreferences({
96
+ colorMode: colorMode,
97
+ dark: dark,
98
+ light: light,
99
+ spacing: spacing,
100
+ typography: typography
101
+ });
102
+ _context2.next = 4;
103
+ return Promise.all(themePreferences.map( /*#__PURE__*/function () {
104
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(themeId) {
105
+ return _regenerator.default.wrap(function _callee$(_context) {
106
+ while (1) switch (_context.prev = _context.next) {
107
+ case 0:
108
+ _context.next = 2;
109
+ return (0, _themeLoading.loadAndAppendThemeCss)(themeId);
110
+ case 2:
111
+ return _context.abrupt("return", _context.sent);
112
+ case 3:
113
+ case "end":
114
+ return _context.stop();
115
+ }
116
+ }, _callee);
117
+ }));
118
+ return function (_x) {
119
+ return _ref3.apply(this, arguments);
120
+ };
121
+ }()));
122
+ case 4:
123
+ if (!(
124
+ // 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;
127
+ break;
128
+ }
129
+ _context2.next = 7;
130
+ return (0, _themeLoading.loadAndAppendThemeCss)('dark-iteration');
131
+ case 7:
132
+ if (colorMode === 'auto' && darkModeMql) {
133
+ colorMode = darkModeMql.matches ? 'dark' : 'light';
134
+ // Add an event listener for changes to the system theme.
135
+ // If the function exists, it will not be added again.
136
+ unbindThemeChangeListener = (0, _bindEventListener.bind)(darkModeMql, {
137
+ type: 'change',
138
+ listener: checkNativeListener
155
139
  });
156
- return _context2.abrupt("return", unbindThemeChangeListener);
157
- case 8:
158
- case "end":
159
- return _context2.stop();
160
- }
140
+ } else {
141
+ unbindThemeChangeListener();
142
+ }
143
+ themeAttributes = getThemeHtmlAttrs({
144
+ colorMode: colorMode,
145
+ dark: dark,
146
+ light: light,
147
+ spacing: spacing,
148
+ typography: typography
149
+ });
150
+ Object.entries(themeAttributes).forEach(function (_ref4) {
151
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
152
+ key = _ref5[0],
153
+ value = _ref5[1];
154
+ document.documentElement.setAttribute(key, value);
155
+ });
156
+ return _context2.abrupt("return", unbindThemeChangeListener);
157
+ case 11:
158
+ case "end":
159
+ return _context2.stop();
161
160
  }
162
161
  }, _callee2);
163
162
  }));
@@ -180,7 +179,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
180
179
  * If an error is encountered while loading themes, the themes arrav will be emptv.
181
180
  */
182
181
  var getThemeStyles = /*#__PURE__*/function () {
183
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
182
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
184
183
  var _ref7,
185
184
  _ref7$colorMode,
186
185
  colorMode,
@@ -195,62 +194,63 @@ var getThemeStyles = /*#__PURE__*/function () {
195
194
  themePreferences,
196
195
  results,
197
196
  _args4 = arguments;
198
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
199
- while (1) {
200
- switch (_context4.prev = _context4.next) {
201
- case 0:
202
- _ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref7$colorMode = _ref7.colorMode, colorMode = _ref7$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref7$colorMode, _ref7$dark = _ref7.dark, dark = _ref7$dark === void 0 ? themeStateDefaults['dark'] : _ref7$dark, _ref7$light = _ref7.light, light = _ref7$light === void 0 ? themeStateDefaults['light'] : _ref7$light, _ref7$spacing = _ref7.spacing, spacing = _ref7$spacing === void 0 ? themeStateDefaults['spacing'] : _ref7$spacing, _ref7$typography = _ref7.typography, typography = _ref7$typography === void 0 ? themeStateDefaults['typography'] : _ref7$typography;
203
- themePreferences = getThemePreferences({
204
- colorMode: colorMode,
205
- dark: dark,
206
- light: light,
207
- spacing: spacing,
208
- typography: typography
209
- });
210
- _context4.next = 4;
211
- return Promise.all(themePreferences.map( /*#__PURE__*/function () {
212
- var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(themeId) {
213
- var css;
214
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
215
- while (1) {
216
- switch (_context3.prev = _context3.next) {
217
- case 0:
218
- _context3.prev = 0;
219
- _context3.next = 3;
220
- return (0, _themeLoading.loadThemeCss)(themeId);
221
- case 3:
222
- css = _context3.sent;
223
- return _context3.abrupt("return", {
224
- id: themeId,
225
- attrs: {
226
- 'data-theme': themeId
227
- },
228
- css: css
229
- });
230
- case 7:
231
- _context3.prev = 7;
232
- _context3.t0 = _context3["catch"](0);
233
- return _context3.abrupt("return", undefined);
234
- case 10:
235
- case "end":
236
- return _context3.stop();
237
- }
238
- }
239
- }, _callee3, null, [[0, 7]]);
240
- }));
241
- return function (_x2) {
242
- return _ref8.apply(this, arguments);
243
- };
244
- }()));
245
- case 4:
246
- results = _context4.sent;
247
- return _context4.abrupt("return", results.filter(function (theme) {
248
- return theme !== undefined;
197
+ return _regenerator.default.wrap(function _callee4$(_context4) {
198
+ while (1) switch (_context4.prev = _context4.next) {
199
+ case 0:
200
+ _ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref7$colorMode = _ref7.colorMode, colorMode = _ref7$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref7$colorMode, _ref7$dark = _ref7.dark, dark = _ref7$dark === void 0 ? themeStateDefaults['dark'] : _ref7$dark, _ref7$light = _ref7.light, light = _ref7$light === void 0 ? themeStateDefaults['light'] : _ref7$light, _ref7$spacing = _ref7.spacing, spacing = _ref7$spacing === void 0 ? themeStateDefaults['spacing'] : _ref7$spacing, _ref7$typography = _ref7.typography, typography = _ref7$typography === void 0 ? themeStateDefaults['typography'] : _ref7$typography;
201
+ themePreferences = getThemePreferences({
202
+ colorMode: colorMode,
203
+ dark: dark,
204
+ light: light,
205
+ spacing: spacing,
206
+ typography: typography
207
+ });
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');
212
+ }
213
+ _context4.next = 5;
214
+ return Promise.all(themePreferences.map( /*#__PURE__*/function () {
215
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(themeId) {
216
+ var css;
217
+ return _regenerator.default.wrap(function _callee3$(_context3) {
218
+ while (1) switch (_context3.prev = _context3.next) {
219
+ case 0:
220
+ _context3.prev = 0;
221
+ _context3.next = 3;
222
+ return (0, _themeLoading.loadThemeCss)(themeId);
223
+ case 3:
224
+ css = _context3.sent;
225
+ return _context3.abrupt("return", {
226
+ id: themeId,
227
+ attrs: {
228
+ 'data-theme': themeId
229
+ },
230
+ css: css
231
+ });
232
+ case 7:
233
+ _context3.prev = 7;
234
+ _context3.t0 = _context3["catch"](0);
235
+ return _context3.abrupt("return", undefined);
236
+ case 10:
237
+ case "end":
238
+ return _context3.stop();
239
+ }
240
+ }, _callee3, null, [[0, 7]]);
249
241
  }));
250
- case 6:
251
- case "end":
252
- return _context4.stop();
253
- }
242
+ return function (_x2) {
243
+ return _ref8.apply(this, arguments);
244
+ };
245
+ }()));
246
+ case 5:
247
+ results = _context4.sent;
248
+ return _context4.abrupt("return", results.filter(function (theme) {
249
+ return theme !== undefined;
250
+ }));
251
+ case 7:
252
+ case "end":
253
+ return _context4.stop();
254
254
  }
255
255
  }, _callee4);
256
256
  }));
@@ -1,40 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.loadThemeCss = exports.loadAndAppendThemeCss = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _themeImportMap = _interopRequireDefault(require("../artifacts/theme-import-map"));
11
11
  var _constants = require("../constants");
12
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
13
12
  var loadAndAppendThemeCss = /*#__PURE__*/function () {
14
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(themeId) {
13
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(themeId) {
15
14
  var themeCss, style;
16
- return _regeneratorRuntime().wrap(function _callee$(_context) {
17
- while (1) {
18
- switch (_context.prev = _context.next) {
19
- case 0:
20
- if (!document.head.querySelector("style[".concat(_constants.THEME_DATA_ATTRIBUTE, "=\"").concat(themeId, "\"]"))) {
21
- _context.next = 2;
22
- break;
23
- }
24
- return _context.abrupt("return");
25
- case 2:
26
- _context.next = 4;
27
- return loadThemeCss(themeId);
28
- case 4:
29
- themeCss = _context.sent;
30
- style = document.createElement('style');
31
- style.textContent = themeCss;
32
- style.dataset.theme = themeId;
33
- document.head.appendChild(style);
34
- case 9:
35
- case "end":
36
- return _context.stop();
37
- }
15
+ return _regenerator.default.wrap(function _callee$(_context) {
16
+ while (1) switch (_context.prev = _context.next) {
17
+ case 0:
18
+ if (!document.head.querySelector("style[".concat(_constants.THEME_DATA_ATTRIBUTE, "=\"").concat(themeId, "\"]"))) {
19
+ _context.next = 2;
20
+ break;
21
+ }
22
+ return _context.abrupt("return");
23
+ case 2:
24
+ _context.next = 4;
25
+ return loadThemeCss(themeId);
26
+ case 4:
27
+ themeCss = _context.sent;
28
+ style = document.createElement('style');
29
+ style.textContent = themeCss;
30
+ style.dataset.theme = themeId;
31
+ document.head.appendChild(style);
32
+ case 9:
33
+ case "end":
34
+ return _context.stop();
38
35
  }
39
36
  }, _callee);
40
37
  }));
@@ -44,22 +41,20 @@ var loadAndAppendThemeCss = /*#__PURE__*/function () {
44
41
  }();
45
42
  exports.loadAndAppendThemeCss = loadAndAppendThemeCss;
46
43
  var loadThemeCss = /*#__PURE__*/function () {
47
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(themeId) {
44
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(themeId) {
48
45
  var _yield$themeImportMap, themeCss;
49
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
50
- while (1) {
51
- switch (_context2.prev = _context2.next) {
52
- case 0:
53
- _context2.next = 2;
54
- return _themeImportMap.default[themeId]();
55
- case 2:
56
- _yield$themeImportMap = _context2.sent;
57
- themeCss = _yield$themeImportMap.default;
58
- return _context2.abrupt("return", themeCss);
59
- case 5:
60
- case "end":
61
- return _context2.stop();
62
- }
46
+ return _regenerator.default.wrap(function _callee2$(_context2) {
47
+ while (1) switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ _context2.next = 2;
50
+ return _themeImportMap.default[themeId]();
51
+ case 2:
52
+ _yield$themeImportMap = _context2.sent;
53
+ themeCss = _yield$themeImportMap.default;
54
+ return _context2.abrupt("return", themeCss);
55
+ case 5:
56
+ case "end":
57
+ return _context2.stop();
63
58
  }
64
59
  }, _callee2);
65
60
  }));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tokens",
3
- "version": "1.2.18",
3
+ "version": "1.3.1",
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.2.18";
4
+ const version = "1.3.1";
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.2.18";
5
+ const version = "1.3.1";
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.