@kuankuan/assist-2026 0.1.8 → 0.1.10
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/dist/i18n.js +3 -5
- package/dist/motion.js +2 -2
- package/package.json +3 -2
- package/src/i18n.ts +3 -8
- package/src/motion.ts +2 -2
package/dist/i18n.js
CHANGED
|
@@ -50,17 +50,15 @@ export default class I18nInstance {
|
|
|
50
50
|
}));
|
|
51
51
|
this.localSettingLanguage = storageRef(this.storageKey, '_auto');
|
|
52
52
|
this.browserLanguage = computed(() => getBrowserLanguageInLangs(browserLanguageSetting.value));
|
|
53
|
-
watch(() => now.localSettingLanguage.value, (newValue) => {
|
|
54
|
-
if (newValue !== '_auto' && !now.langs.includes(newValue)) {
|
|
55
|
-
now.localSettingLanguage.value = '_auto';
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
53
|
this.language = computed({
|
|
59
54
|
get() {
|
|
60
55
|
const currentBrowserLanguage = now.browserLanguage.value;
|
|
61
56
|
if (now.localSettingLanguage.value === '_auto') {
|
|
62
57
|
return currentBrowserLanguage;
|
|
63
58
|
}
|
|
59
|
+
if (!now.langs.includes(now.localSettingLanguage.value)) {
|
|
60
|
+
now.localSettingLanguage.value = '_auto';
|
|
61
|
+
}
|
|
64
62
|
return now.localSettingLanguage.value;
|
|
65
63
|
},
|
|
66
64
|
set(newValue) {
|
package/dist/motion.js
CHANGED
|
@@ -8,12 +8,12 @@ export var Motions;
|
|
|
8
8
|
Motions["Auto"] = "auto";
|
|
9
9
|
})(Motions || (Motions = {}));
|
|
10
10
|
export const motionValueList = [Motions.Auto, Motions.NoPreference, Motions.Reduce];
|
|
11
|
-
export const motionValue = storageRef('_k_motion', Motions.
|
|
11
|
+
export const motionValue = storageRef('_k_motion', Motions.Auto, localStorage);
|
|
12
12
|
const matcherRef = mediaRef(window.matchMedia('(prefers-reduced-motion: reduce)'));
|
|
13
13
|
export const motion = computed(() => {
|
|
14
14
|
const systemMotion = matcherRef.value ? Motions.Reduce : Motions.NoPreference;
|
|
15
15
|
if (!motionValueList.includes(motionValue.value)) {
|
|
16
|
-
motionValue.value = Motions.
|
|
16
|
+
motionValue.value = Motions.Auto;
|
|
17
17
|
}
|
|
18
18
|
if (motionValue.value === Motions.Auto) {
|
|
19
19
|
return systemMotion;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kuankuan/assist-2026",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "A toolset from kuankuan",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -79,5 +79,6 @@
|
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"vite": ">=7.0.0"
|
|
82
|
-
}
|
|
82
|
+
},
|
|
83
|
+
"sideEffects": false
|
|
83
84
|
}
|
package/src/i18n.ts
CHANGED
|
@@ -52,20 +52,15 @@ export default class I18nInstance {
|
|
|
52
52
|
}));
|
|
53
53
|
this.localSettingLanguage = storageRef(this.storageKey, '_auto');
|
|
54
54
|
this.browserLanguage = computed(() => getBrowserLanguageInLangs(browserLanguageSetting.value));
|
|
55
|
-
watch(
|
|
56
|
-
() => now.localSettingLanguage.value,
|
|
57
|
-
(newValue) => {
|
|
58
|
-
if (newValue !== '_auto' && !now.langs.includes(newValue)) {
|
|
59
|
-
now.localSettingLanguage.value = '_auto';
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
55
|
this.language = computed({
|
|
64
56
|
get() {
|
|
65
57
|
const currentBrowserLanguage = now.browserLanguage.value;
|
|
66
58
|
if (now.localSettingLanguage.value === '_auto') {
|
|
67
59
|
return currentBrowserLanguage;
|
|
68
60
|
}
|
|
61
|
+
if (!now.langs.includes(now.localSettingLanguage.value)) {
|
|
62
|
+
now.localSettingLanguage.value = '_auto';
|
|
63
|
+
}
|
|
69
64
|
return now.localSettingLanguage.value;
|
|
70
65
|
},
|
|
71
66
|
set(newValue) {
|
package/src/motion.ts
CHANGED
|
@@ -10,13 +10,13 @@ export enum Motions {
|
|
|
10
10
|
|
|
11
11
|
export const motionValueList = [Motions.Auto, Motions.NoPreference, Motions.Reduce] as const;
|
|
12
12
|
|
|
13
|
-
export const motionValue = storageRef<Motions>('_k_motion', Motions.
|
|
13
|
+
export const motionValue = storageRef<Motions>('_k_motion', Motions.Auto, localStorage);
|
|
14
14
|
const matcherRef = mediaRef(window.matchMedia('(prefers-reduced-motion: reduce)'));
|
|
15
15
|
|
|
16
16
|
export const motion = computed(() => {
|
|
17
17
|
const systemMotion = matcherRef.value ? Motions.Reduce : Motions.NoPreference;
|
|
18
18
|
if (!motionValueList.includes(motionValue.value)) {
|
|
19
|
-
motionValue.value = Motions.
|
|
19
|
+
motionValue.value = Motions.Auto;
|
|
20
20
|
}
|
|
21
21
|
if (motionValue.value === Motions.Auto) {
|
|
22
22
|
return systemMotion;
|