@inzombieland/core 1.20.4 → 1.20.5

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.
@@ -1,11 +1,12 @@
1
1
  import { useLocalStorage } from "@vueuse/core";
2
2
  export const useAppLocale = () => {
3
+ const namespace = import.meta.env.VITE_APP_NAMESPACE ?? "app";
3
4
  let value = "en";
4
5
  if (typeof window !== "undefined" && window.navigator.language) {
5
6
  value = window.navigator.language.split("-")[0] ?? "en";
6
7
  }
7
8
  return useLocalStorage(
8
- "app-preferences-locale",
9
+ `${namespace}-preferences-locale`,
9
10
  { value },
10
11
  {
11
12
  serializer: {
@@ -1,8 +1,9 @@
1
1
  import { useLocalStorage, usePreferredDark } from "@vueuse/core";
2
2
  export const useThemeMode = () => {
3
+ const namespace = import.meta.env.VITE_APP_NAMESPACE ?? "app";
3
4
  const isDark = usePreferredDark();
4
5
  return useLocalStorage(
5
- "app-preferences-theme",
6
+ `${namespace}-preferences-theme`,
6
7
  { value: isDark.value ? "dark" : "light" },
7
8
  {
8
9
  serializer: {
@@ -1,22 +1,23 @@
1
+ const namespace = import.meta.env.VITE_APP_NAMESPACE ?? "app";
1
2
  export const getSessionId = () => {
2
3
  if (typeof window !== "undefined") {
3
- return window.localStorage.getItem("sid");
4
+ return window.localStorage.getItem(`${namespace}-sid`);
4
5
  }
5
6
  return null;
6
7
  };
7
8
  export const setSessionId = (sessionId = "") => {
8
9
  if (typeof window !== "undefined") {
9
- window.localStorage.setItem("sid", sessionId);
10
+ window.localStorage.setItem(`${namespace}-sid`, sessionId);
10
11
  }
11
12
  };
12
13
  export const getVisitorId = () => {
13
14
  if (typeof window !== "undefined") {
14
- return window.localStorage.getItem("vid");
15
+ return window.localStorage.getItem(`${namespace}-vid`);
15
16
  }
16
17
  return null;
17
18
  };
18
19
  export const setVisitorId = (visitorId = "") => {
19
20
  if (typeof window !== "undefined") {
20
- window.localStorage.setItem("vid", visitorId);
21
+ window.localStorage.setItem(`${namespace}-vid`, visitorId);
21
22
  }
22
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.20.4",
3
+ "version": "1.20.5",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.js",