vuetify-nuxt-module 0.6.2 → 0.6.4

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
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.6.2"
7
+ "version": "0.6.4"
8
8
  }
package/dist/module.mjs CHANGED
@@ -15,7 +15,7 @@ import { parseQuery, parseURL } from 'ufo';
15
15
  import destr from 'destr';
16
16
  import { transformAssetUrls } from 'vite-plugin-vuetify';
17
17
 
18
- const version = "0.6.2";
18
+ const version = "0.6.4";
19
19
 
20
20
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
21
21
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -50,8 +50,14 @@ export default defineNuxtPlugin((nuxtApp) => {
50
50
  clientHeight
51
51
  } : true;
52
52
  }
53
- if (prefersColorScheme && prefersColorSchemeOptions)
54
- vuetifyOptions.theme.defaultTheme = state.value.colorSchemeFromCookie ?? prefersColorSchemeOptions.defaultTheme;
53
+ if (prefersColorScheme && prefersColorSchemeOptions) {
54
+ if (vuetifyOptions.theme === false) {
55
+ vuetifyOptions.theme = { defaultTheme: state.value.colorSchemeFromCookie ?? prefersColorSchemeOptions.defaultTheme };
56
+ } else {
57
+ vuetifyOptions.theme = vuetifyOptions.theme ?? {};
58
+ vuetifyOptions.theme.defaultTheme = state.value.colorSchemeFromCookie ?? prefersColorSchemeOptions.defaultTheme;
59
+ }
60
+ }
55
61
  });
56
62
  if (prefersColorScheme && prefersColorSchemeOptions) {
57
63
  const themeCookie = state.value.colorSchemeCookie;
@@ -9,6 +9,7 @@ import {
9
9
  defineNuxtPlugin,
10
10
  useCookie,
11
11
  useNuxtApp,
12
+ useRequestEvent,
12
13
  useRequestHeaders,
13
14
  useState
14
15
  } from "#imports";
@@ -42,11 +43,20 @@ export default defineNuxtPlugin((nuxtApp) => {
42
43
  clientWidth,
43
44
  clientHeight
44
45
  } : true;
45
- if (clientHintsRequest.colorSchemeFromCookie)
46
- vuetifyOptions.theme.defaultTheme = clientHintsRequest.colorSchemeFromCookie;
46
+ if (clientHintsRequest.colorSchemeFromCookie) {
47
+ if (vuetifyOptions.theme === false) {
48
+ vuetifyOptions.theme = { defaultTheme: clientHintsRequest.colorSchemeFromCookie };
49
+ } else {
50
+ vuetifyOptions.theme ??= {};
51
+ vuetifyOptions.theme.defaultTheme = clientHintsRequest.colorSchemeFromCookie;
52
+ }
53
+ }
47
54
  await nuxtApp.hooks.callHook("vuetify:ssr-client-hints", {
48
55
  vuetifyOptions,
49
- ssrClientHintsConfiguration,
56
+ ssrClientHintsConfiguration: {
57
+ ...ssrClientHintsConfiguration,
58
+ enabled: true
59
+ },
50
60
  ssrClientHints: state.value
51
61
  });
52
62
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "packageManager": "pnpm@8.10.2",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
@@ -43,24 +43,23 @@
43
43
  "*.mjs"
44
44
  ],
45
45
  "scripts": {
46
- "build": "pnpm dev:prepare && nuxt-module-build",
46
+ "prepack": "nuxt-module-build",
47
47
  "dev": "nuxi dev playground",
48
48
  "dev:multiple-json": "MULTIPLE_LANG_FILES=true nuxi dev playground",
49
- "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
50
- "dev:prepare:multiple-json": "nuxt-module-build --stub && MULTIPLE_LANG_FILES=true nuxi prepare playground",
49
+ "dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground",
50
+ "dev:prepare:multiple-json": "nuxt-module-build --stub && nuxt-module-build prepare && MULTIPLE_LANG_FILES=true nuxi prepare playground",
51
51
  "dev:build": "nuxi build playground",
52
52
  "dev:generate": "nuxi generate playground",
53
53
  "dev:build:multiple-json": "MULTIPLE_LANG_FILES=true nuxi build playground",
54
54
  "dev:generate:multiple-json": "MULTIPLE_LANG_FILES=true nuxi generate playground",
55
55
  "dev:preview": "nuxi preview playground",
56
56
  "docs:dev": "pnpm -C docs run dev",
57
- "docs:build": "pnpm dev:prepare && pnpm -C docs run build",
57
+ "docs:build": "nuxt-module-build prepare && pnpm -C docs run build",
58
58
  "docs:serve": "pnpm -C docs run serve",
59
59
  "lint": "eslint .",
60
60
  "lint:fix": "nr lint --fix",
61
61
  "test": "vitest run",
62
62
  "test:watch": "vitest watch",
63
- "prepublishOnly": "pnpm build",
64
63
  "release": "bumpp && npm publish"
65
64
  },
66
65
  "dependencies": {