bt-core-app 2.0.20 → 2.0.22

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.
@@ -9954,7 +9954,7 @@ function w_() {
9954
9954
  return by;
9955
9955
  }
9956
9956
  function Eoe(e) {
9957
- const t = localStorage.getItem("cosmetics");
9957
+ const t = localStorage.getItem((e == null ? void 0 : e.storageName) ?? "cosmetics");
9958
9958
  let a;
9959
9959
  return t != null && t.length > 0 && (a = JSON.parse(t)), a ?? (a = {}), a.dark ?? (a.dark = e == null ? void 0 : e.dark), a.light ?? (a.light = e == null ? void 0 : e.light), a.theme ?? (a.theme = e == null ? void 0 : e.defaultTheme), {
9960
9960
  defaultTheme: a.theme ?? "dark",
@@ -9970,10 +9970,10 @@ function Eoe(e) {
9970
9970
  }
9971
9971
  function mP(e) {
9972
9972
  const t = q({});
9973
- let a = e.vuetifyInstance;
9974
- function n() {
9975
- const m = localStorage.getItem("cosmetics");
9976
- m != null && m.length > 0 ? t.value = JSON.parse(m) : t.value = {
9973
+ let a = e.vuetifyInstance, n = e.storageName ?? "cosmetics";
9974
+ function l() {
9975
+ const f = localStorage.getItem(n);
9976
+ f != null && f.length > 0 ? t.value = JSON.parse(f) : t.value = {
9977
9977
  theme: e.defaultTheme ?? "light",
9978
9978
  light: { ...zp, ...e.defaultLightTheme },
9979
9979
  dark: { ...Op, ...e.defaultDarkTheme },
@@ -9981,68 +9981,68 @@ function mP(e) {
9981
9981
  drawerStick: e.defaultDrawerStick ?? !1
9982
9982
  };
9983
9983
  }
9984
- function l() {
9985
- localStorage.setItem("cosmetics", JSON.stringify(t.value));
9984
+ function r() {
9985
+ localStorage.setItem(n, JSON.stringify(t.value));
9986
9986
  }
9987
- function r(m) {
9988
- var f;
9987
+ function i(f) {
9988
+ var g;
9989
9989
  if (a != null) {
9990
9990
  a.global.name.value = t.value.theme;
9991
- let g;
9992
- a.global.name.value == "dark" ? (m && (t.value.dark = { ...Op, ...e.defaultDarkTheme }), a.themes.value.dark = {
9991
+ let p;
9992
+ a.global.name.value == "dark" ? (f && (t.value.dark = { ...Op, ...e.defaultDarkTheme }), a.themes.value.dark = {
9993
9993
  ...a.themes.value.dark,
9994
9994
  colors: {
9995
9995
  ...a.themes.value.dark.colors,
9996
9996
  ...t.value.dark
9997
9997
  }
9998
- }, g = a.themes.value.dark.colors.primary) : (m && (t.value.light = { ...zp, ...e.defaultLightTheme }), a.themes.value.light = {
9998
+ }, p = a.themes.value.dark.colors.primary) : (f && (t.value.light = { ...zp, ...e.defaultLightTheme }), a.themes.value.light = {
9999
9999
  ...a.themes.value.light,
10000
10000
  colors: {
10001
10001
  ...a.themes.value.light.colors,
10002
10002
  ...t.value.light
10003
10003
  }
10004
- }, g = a.themes.value.light.colors.primary), (f = document.querySelector('meta[name="theme-color"]')) == null || f.setAttribute("content", g), l();
10004
+ }, p = a.themes.value.light.colors.primary), (g = document.querySelector('meta[name="theme-color"]')) == null || g.setAttribute("content", p), r();
10005
10005
  }
10006
10006
  }
10007
- function i(m) {
10008
- var f;
10007
+ function o(f) {
10008
+ var g;
10009
10009
  if (a != null) {
10010
- const g = a.themes.value.dark, p = a.themes.value.light;
10011
- g.colors.primary = m, p.colors.primary = m, (f = document.querySelector('meta[name="theme-color"]')) == null || f.setAttribute("content", m);
10010
+ const p = a.themes.value.dark, h = a.themes.value.light;
10011
+ p.colors.primary = f, h.colors.primary = f, (g = document.querySelector('meta[name="theme-color"]')) == null || g.setAttribute("content", f);
10012
10012
  }
10013
10013
  }
10014
- function o() {
10015
- t.value.drawer = !t.value.drawer, l();
10016
- }
10017
- function s(m) {
10018
- t.value.drawer = m, l();
10014
+ function s() {
10015
+ t.value.drawer = !t.value.drawer, r();
10019
10016
  }
10020
- function c() {
10021
- t.value.drawerStick = !t.value.drawerStick, l();
10017
+ function c(f) {
10018
+ t.value.drawer = f, r();
10022
10019
  }
10023
10020
  function u() {
10024
- t.value.theme = t.value.theme == "dark" ? "light" : "dark", a != null && (a.global.name.value = t.value.theme), l();
10021
+ t.value.drawerStick = !t.value.drawerStick, r();
10025
10022
  }
10026
10023
  function d() {
10027
- var m;
10024
+ t.value.theme = t.value.theme == "dark" ? "light" : "dark", a != null && a.change(t.value.theme), r();
10025
+ }
10026
+ function m() {
10027
+ var f;
10028
10028
  if (a != null) {
10029
- const f = a.themes.value.dark, g = a.themes.value.light;
10030
- f.colors.primary = (t.value.dark ?? { ...Op, ...e.defaultDarkTheme }).primary, g.colors.primary = (t.value.light ?? { ...zp, ...e.defaultLightTheme }).primary, (m = document.querySelector('meta[name="theme-color"]')) == null || m.setAttribute("content", "");
10029
+ const g = a.themes.value.dark, p = a.themes.value.light;
10030
+ g.colors.primary = (t.value.dark ?? { ...Op, ...e.defaultDarkTheme }).primary, p.colors.primary = (t.value.light ?? { ...zp, ...e.defaultLightTheme }).primary, (f = document.querySelector('meta[name="theme-color"]')) == null || f.setAttribute("content", "");
10031
10031
  }
10032
10032
  }
10033
- return n(), _e(t, () => {
10034
- l();
10033
+ return l(), _e(t, () => {
10034
+ r();
10035
10035
  }), by = {
10036
10036
  state: t,
10037
10037
  currentSet: A(() => t.value.theme == "dark" ? t.value.dark : t.value.light),
10038
- resetCosmetics: r,
10039
- saveState: l,
10040
- setTemporaryColor: i,
10041
- toggleDrawer: o,
10042
- toggleDrawerStick: c,
10043
- toggleLightDark: u,
10044
- updateDrawer: s,
10045
- undoTemporaryColor: d
10038
+ resetCosmetics: i,
10039
+ saveState: r,
10040
+ setTemporaryColor: o,
10041
+ toggleDrawer: s,
10042
+ toggleDrawerStick: u,
10043
+ toggleLightDark: d,
10044
+ updateDrawer: c,
10045
+ undoTemporaryColor: m
10046
10046
  }, by;
10047
10047
  }
10048
10048
  var h1 = {}, hc = {};
package/dist/index.d.ts CHANGED
@@ -1829,6 +1829,7 @@ export declare interface UseCosmeticsOptions<T extends BaseCosmeticTheme> {
1829
1829
  defaultDrawer?: boolean;
1830
1830
  defaultDrawerStick?: boolean;
1831
1831
  defaultTheme?: string;
1832
+ storageName?: string;
1832
1833
  vuetifyInstance?: ThemeInstance;
1833
1834
  }
1834
1835
 
@@ -2494,6 +2495,7 @@ declare interface UseLocalCosmeticsOptions {
2494
2495
  defaultTheme?: string;
2495
2496
  dark?: any;
2496
2497
  light?: any;
2498
+ storageName?: string;
2497
2499
  }
2498
2500
 
2499
2501
  export declare function useLocalDb(): LocalForage_2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {