@mevbg/nuxt-kit 0.1.20 → 0.1.23

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mevbg/nuxt-kit",
3
3
  "configKey": "mevKit",
4
- "version": "0.1.20",
4
+ "version": "0.1.23",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
package/dist/module.mjs CHANGED
@@ -31,8 +31,8 @@ const module = defineNuxtModule({
31
31
  addPlugin(resolver.resolve("./runtime/plugins/tooltip-system.plugin"));
32
32
  addImports([
33
33
  {
34
- name: "useClientInfo",
35
- from: resolver.resolve("./runtime/composables/useClientInfo")
34
+ name: "useClientInfoClasses",
35
+ from: resolver.resolve("./runtime/composables/useClientInfoClasses")
36
36
  },
37
37
  {
38
38
  name: "useErrorHandler",
@@ -1,4 +1,4 @@
1
- export * from './useClientInfo.js';
1
+ export * from './useClientInfoClasses.js';
2
2
  export * from './useErrorHandler.js';
3
3
  export * from './useHeadLinks.js';
4
4
  export * from './useMetaData.js';
@@ -1,4 +1,4 @@
1
- export * from "./useClientInfo.js";
1
+ export * from "./useClientInfoClasses.js";
2
2
  export * from "./useErrorHandler.js";
3
3
  export * from "./useHeadLinks.js";
4
4
  export * from "./useMetaData.js";
@@ -0,0 +1,3 @@
1
+ export declare function useClientInfoClasses(): {
2
+ setClientInfoClasses: () => Promise<void>;
3
+ };
@@ -0,0 +1,19 @@
1
+ import { computed, ref } from "vue";
2
+ export function useClientInfoClasses() {
3
+ const data = ref({});
4
+ const classes = computed(
5
+ () => Object.keys(data.value).filter(
6
+ (key) => typeof data.value[key] === "boolean" && data.value[key]
7
+ )
8
+ );
9
+ const setClientInfoClasses = async () => {
10
+ const {
11
+ default: defaultInfo,
12
+ deviceDetect,
13
+ ...clientData
14
+ } = await import("mobile-device-detect");
15
+ data.value = clientData;
16
+ window.document.documentElement.classList.add(...classes.value);
17
+ };
18
+ return { setClientInfoClasses };
19
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mevbg/nuxt-kit",
3
3
  "title": "Mev’s Nuxt Kit",
4
- "version": "0.1.20",
4
+ "version": "0.1.23",
5
5
  "description": "Mev’s personal Nuxt kit module.",
6
6
  "keywords": [
7
7
  "nuxt kit",
@@ -51,6 +51,10 @@
51
51
  "./useNotificationSystem": {
52
52
  "types": "./dist/runtime/composables/useNotificationSystem.d.ts",
53
53
  "import": "./dist/runtime/composables/useNotificationSystem.js"
54
+ },
55
+ "./useClientInfoClasses": {
56
+ "types": "./dist/runtime/composables/useClientInfoClasses.d.ts",
57
+ "import": "./dist/runtime/composables/useClientInfoClasses.js"
54
58
  }
55
59
  },
56
60
  "files": [
@@ -1,4 +0,0 @@
1
- export declare function useClientInfo(): {
2
- data: import("vue").Ref<Record<string, any>, Record<string, any>>;
3
- classes: import("vue").ComputedRef<string[]>;
4
- };
@@ -1,20 +0,0 @@
1
- import { computed, onBeforeMount, ref } from "vue";
2
- const data = ref({});
3
- const classes = computed(
4
- () => Object.keys(data.value).filter(
5
- (key) => typeof data.value[key] === "boolean" && data.value[key]
6
- )
7
- );
8
- export function useClientInfo() {
9
- if (import.meta.client) {
10
- onBeforeMount(async () => {
11
- const {
12
- default: defaultInfo,
13
- deviceDetect,
14
- ...clientData
15
- } = await import("mobile-device-detect");
16
- data.value = clientData;
17
- });
18
- }
19
- return { data, classes };
20
- }