@jskit-ai/users-web 0.1.180 → 0.1.181

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/users-web",
3
- "version": "0.1.180",
3
+ "version": "0.1.181",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -12,13 +12,13 @@
12
12
  "./client/account-settings/sections": "./src/client/account-settings/sections.js"
13
13
  },
14
14
  "dependencies": {
15
- "@jskit-ai/auth-web": "0.1.162",
16
- "@jskit-ai/http-web": "0.1.7",
17
- "@jskit-ai/http-runtime": "0.1.160",
18
- "@jskit-ai/kernel": "0.1.162",
19
- "@jskit-ai/shell-web": "0.1.166",
20
- "@jskit-ai/uploads-image-web": "0.1.137",
21
- "@jskit-ai/users-core": "0.1.175"
15
+ "@jskit-ai/auth-web": "0.1.163",
16
+ "@jskit-ai/http-web": "0.1.8",
17
+ "@jskit-ai/http-runtime": "0.1.161",
18
+ "@jskit-ai/kernel": "0.1.163",
19
+ "@jskit-ai/shell-web": "0.1.167",
20
+ "@jskit-ai/uploads-image-web": "0.1.138",
21
+ "@jskit-ai/users-core": "0.1.176"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@tanstack/vue-query": "^5.90.5",
@@ -118,7 +118,12 @@ function resolveVuetifyThemeController(vueApp) {
118
118
  }
119
119
 
120
120
  const themeController = provides[ThemeSymbol];
121
- if (!themeController || typeof themeController !== "object" || !themeController.global || !themeController.global.name) {
121
+ if (
122
+ !themeController ||
123
+ typeof themeController !== "object" ||
124
+ typeof themeController.change !== "function" ||
125
+ !themeController.name
126
+ ) {
122
127
  return null;
123
128
  }
124
129
 
@@ -126,16 +131,21 @@ function resolveVuetifyThemeController(vueApp) {
126
131
  }
127
132
 
128
133
  function setVuetifyThemeName(themeController, themeName) {
129
- if (!themeController || typeof themeController !== "object" || !themeController.global || !themeController.global.name) {
134
+ if (
135
+ !themeController ||
136
+ typeof themeController !== "object" ||
137
+ typeof themeController.change !== "function" ||
138
+ !themeController.name
139
+ ) {
130
140
  return false;
131
141
  }
132
142
 
133
143
  const normalizedThemeName = themeName === THEME_PREFERENCE_DARK ? THEME_PREFERENCE_DARK : THEME_PREFERENCE_LIGHT;
134
- if (themeController.global.name.value === normalizedThemeName) {
144
+ if (themeController.name.value === normalizedThemeName) {
135
145
  return false;
136
146
  }
137
147
 
138
- themeController.global.name.value = normalizedThemeName;
148
+ void themeController.change(normalizedThemeName);
139
149
  return true;
140
150
  }
141
151
 
@@ -14,12 +14,27 @@ import {
14
14
  } from "../src/client/lib/theme.js";
15
15
 
16
16
  function createVuetifyThemeController(initialTheme = "light") {
17
+ const name = {
18
+ value: initialTheme
19
+ };
20
+ const changeCalls = [];
17
21
  return {
22
+ changeCalls,
23
+ name,
18
24
  global: {
19
25
  name: {
20
- value: initialTheme
26
+ get value() {
27
+ return name.value;
28
+ },
29
+ set value(_nextTheme) {
30
+ throw new Error("Deprecated theme.global.name mutation was used.");
31
+ }
21
32
  }
22
33
  },
34
+ change(nextTheme) {
35
+ changeCalls.push(nextTheme);
36
+ name.value = nextTheme;
37
+ },
23
38
  themes: {
24
39
  value: {
25
40
  light: {
@@ -162,5 +177,6 @@ test("setVuetifyThemeName updates only when the value changes", () => {
162
177
 
163
178
  assert.equal(setVuetifyThemeName(themeController, "light"), false);
164
179
  assert.equal(setVuetifyThemeName(themeController, "dark"), true);
165
- assert.equal(themeController.global.name.value, "dark");
180
+ assert.deepEqual(themeController.changeCalls, ["dark"]);
181
+ assert.equal(themeController.name.value, "dark");
166
182
  });