@sprucelabs/spruce-heartwood-utils 29.2.54 → 29.2.56

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.
@@ -21,7 +21,6 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  export class ThemeManagerImpl {
22
22
  constructor(theme) {
23
23
  this.themeCount = 0;
24
- this.currentTheme = theme;
25
24
  void this.setTheme(theme, false);
26
25
  this.themeCount = 0;
27
26
  }
@@ -48,21 +47,21 @@ export class ThemeManagerImpl {
48
47
  }
49
48
  setTheme(theme_1) {
50
49
  return __awaiter(this, arguments, void 0, function* (theme, shouldAnimate = true) {
51
- var _a, _b;
52
- if (this.currentTheme.name === theme.name) {
50
+ var _a, _b, _c;
51
+ if (((_a = this.currentTheme) === null || _a === void 0 ? void 0 : _a.name) === theme.name) {
53
52
  return;
54
53
  }
55
54
  this.themeCount++;
56
55
  this.currentTheme = theme;
57
- const _c = theme.props, { calendarEvents, borderRadius } = _c, rest = __rest(_c, ["calendarEvents", "borderRadius"]);
56
+ const _d = theme.props, { calendarEvents, borderRadius } = _d, rest = __rest(_d, ["calendarEvents", "borderRadius"]);
58
57
  this.applyBorderRadius(borderRadius);
59
58
  //@ts-ignore
60
59
  yield this.setProps(Object.entries(rest), shouldAnimate);
61
60
  if (calendarEvents) {
62
61
  yield this.setProps(Object.entries(calendarEvents), shouldAnimate);
63
62
  }
64
- (_a = document
65
- .querySelector('meta[name="theme-color"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('content', (_b = theme.props.color1Inverse) !== null && _b !== void 0 ? _b : 'white');
63
+ (_b = document
64
+ .querySelector('meta[name="theme-color"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('content', (_c = theme.props.color1Inverse) !== null && _c !== void 0 ? _c : 'white');
66
65
  });
67
66
  }
68
67
  applyBorderRadius(borderRadius) {
@@ -15,7 +15,6 @@ exports.heartwoodTheme = exports.ThemeManagerImpl = void 0;
15
15
  class ThemeManagerImpl {
16
16
  constructor(theme) {
17
17
  this.themeCount = 0;
18
- this.currentTheme = theme;
19
18
  void this.setTheme(theme, false);
20
19
  this.themeCount = 0;
21
20
  }
@@ -41,21 +40,21 @@ class ThemeManagerImpl {
41
40
  this.themeCount = 0;
42
41
  }
43
42
  async setTheme(theme, shouldAnimate = true) {
44
- var _a, _b;
45
- if (this.currentTheme.name === theme.name) {
43
+ var _a, _b, _c;
44
+ if (((_a = this.currentTheme) === null || _a === void 0 ? void 0 : _a.name) === theme.name) {
46
45
  return;
47
46
  }
48
47
  this.themeCount++;
49
48
  this.currentTheme = theme;
50
- const _c = theme.props, { calendarEvents, borderRadius } = _c, rest = __rest(_c, ["calendarEvents", "borderRadius"]);
49
+ const _d = theme.props, { calendarEvents, borderRadius } = _d, rest = __rest(_d, ["calendarEvents", "borderRadius"]);
51
50
  this.applyBorderRadius(borderRadius);
52
51
  //@ts-ignore
53
52
  await this.setProps(Object.entries(rest), shouldAnimate);
54
53
  if (calendarEvents) {
55
54
  await this.setProps(Object.entries(calendarEvents), shouldAnimate);
56
55
  }
57
- (_a = document
58
- .querySelector('meta[name="theme-color"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('content', (_b = theme.props.color1Inverse) !== null && _b !== void 0 ? _b : 'white');
56
+ (_b = document
57
+ .querySelector('meta[name="theme-color"]')) === null || _b === void 0 ? void 0 : _b.setAttribute('content', (_c = theme.props.color1Inverse) !== null && _c !== void 0 ? _c : 'white');
59
58
  }
60
59
  applyBorderRadius(borderRadius) {
61
60
  if (!borderRadius || borderRadius === 'rounded') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-heartwood-utils",
3
3
  "description": "Heartwood Utilities",
4
- "version": "29.2.54",
4
+ "version": "29.2.56",
5
5
  "skill": {
6
6
  "namespace": "heartwood"
7
7
  },