vuetify-nuxt-module 0.5.10 → 0.5.12

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.d.ts CHANGED
@@ -202,7 +202,7 @@ interface MOptions {
202
202
  /**
203
203
  * Add Vuetify Vite Plugin `transformAssetsUrls`?
204
204
  *
205
- * @default false
205
+ * @default true
206
206
  */
207
207
  includeTransformAssetsUrls?: boolean;
208
208
  /**
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.5.10"
7
+ "version": "0.5.12"
8
8
  }
package/dist/module.mjs CHANGED
@@ -12,7 +12,7 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
12
12
  import { isAbsolute, join, relative } from 'pathe';
13
13
  import { normalizePath as normalizePath$1 } from 'vite';
14
14
 
15
- const version = "0.5.10";
15
+ const version = "0.5.12";
16
16
 
17
17
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
18
18
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -1121,7 +1121,7 @@ function configureNuxt(configKey, nuxt, ctx) {
1121
1121
  importComposables,
1122
1122
  prefixComposables,
1123
1123
  styles,
1124
- includeTransformAssetsUrls = false
1124
+ includeTransformAssetsUrls = true
1125
1125
  } = ctx.moduleOptions;
1126
1126
  const runtimeDir = ctx.resolver.resolve("./runtime");
1127
1127
  nuxt.options.build.transpile.push(configKey);
@@ -1138,8 +1138,6 @@ function configureNuxt(configKey, nuxt, ctx) {
1138
1138
  (_c = nuxt.options.vite.vue).template ?? (_c.template = {});
1139
1139
  if (typeof nuxt.options.vite.vue.template.transformAssetUrls === "undefined")
1140
1140
  nuxt.options.vite.vue.template.transformAssetUrls = transformAssetUrls;
1141
- else
1142
- ctx.logger.warn("[vuetify-nuxt-module] `includeTransformAssetsUrls` is enabled but `vite.vue.template.transformAssetUrls` is already configured, ignored!");
1143
1141
  }
1144
1142
  extendWebpackConfig(() => {
1145
1143
  throw new Error("Webpack is not supported: vuetify-nuxt-module module can only be used with Vite!");
@@ -1,7 +1,7 @@
1
1
  import { ssrClientHintsConfiguration } from "virtual:vuetify-ssr-client-hints-configuration";
2
+ import { reactive, watch } from "vue";
2
3
  import { VuetifyHTTPClientHints } from "./client-hints.mjs";
3
- import { defineNuxtPlugin } from "#imports";
4
- import { useNuxtApp } from "#app";
4
+ import { defineNuxtPlugin, useNuxtApp, useState } from "#imports";
5
5
  export default defineNuxtPlugin((nuxtApp) => {
6
6
  const state = useState(VuetifyHTTPClientHints);
7
7
  const {
@@ -67,9 +67,9 @@ export default defineNuxtPlugin((nuxtApp) => {
67
67
  if (prefersColorSchemeOptions.useBrowserThemeOnly) {
68
68
  const { darkThemeName, lightThemeName } = prefersColorSchemeOptions;
69
69
  const prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
70
- const prefersLight = window.matchMedia("(prefers-color-scheme: light)");
71
- prefersDark.addEventListener("change", (e) => switchTheme(e, darkThemeName, vuetify));
72
- prefersLight.addEventListener("change", (e) => switchTheme(e, lightThemeName, vuetify));
70
+ prefersDark.addEventListener("change", (e) => {
71
+ vuetify.theme.global.name.value = e.matches ? darkThemeName : lightThemeName;
72
+ });
73
73
  }
74
74
  });
75
75
  }
@@ -81,6 +81,3 @@ export default defineNuxtPlugin((nuxtApp) => {
81
81
  })
82
82
  };
83
83
  });
84
- function switchTheme(e, newThemeName, vuetify) {
85
- e.matches && (vuetify.theme.global.name.value = newThemeName);
86
- }
@@ -1,7 +1,16 @@
1
- import { ssrClientHintsConfiguration } from "virtual:vuetify-ssr-client-hints-configuration";
1
+ import {
2
+ ssrClientHintsConfiguration
3
+ } from "virtual:vuetify-ssr-client-hints-configuration";
4
+ import { reactive } from "vue";
2
5
  import { parseUserAgent } from "./detect-browser.mjs";
3
6
  import { VuetifyHTTPClientHints } from "./client-hints.mjs";
4
- import { defineNuxtPlugin, useNuxtApp } from "#imports";
7
+ import {
8
+ defineNuxtPlugin,
9
+ useCookie,
10
+ useNuxtApp,
11
+ useRequestEvent,
12
+ useState
13
+ } from "#imports";
5
14
  export default defineNuxtPlugin((nuxtApp) => {
6
15
  const event = useRequestEvent();
7
16
  const state = useState(VuetifyHTTPClientHints);
@@ -185,6 +194,14 @@ function writeClientHintHeaders(key, headers) {
185
194
  headers[header] = (headers[header] ? headers[header] : []).concat(key);
186
195
  });
187
196
  }
197
+ function withNuxtAppRendered(callback) {
198
+ const nuxtApp = useNuxtApp();
199
+ const unhook = nuxtApp.hooks.hookOnce("app:rendered", callback);
200
+ nuxtApp.hooks.hookOnce("app:error", () => {
201
+ unhook();
202
+ return callback();
203
+ });
204
+ }
188
205
  function writeClientHintsResponseHeaders(clientHintsRequest, ssrClientHintsConfiguration2, response) {
189
206
  const headers = {};
190
207
  if (ssrClientHintsConfiguration2.prefersColorScheme && clientHintsRequest.prefersColorSchemeAvailable)
@@ -203,14 +220,6 @@ function writeClientHintsResponseHeaders(clientHintsRequest, ssrClientHintsConfi
203
220
  });
204
221
  });
205
222
  }
206
- function withNuxtAppRendered(callback) {
207
- const nuxtApp = useNuxtApp();
208
- const unhook = nuxtApp.hooks.hookOnce("app:rendered", callback);
209
- nuxtApp.hooks.hookOnce("app:error", () => {
210
- unhook();
211
- return callback();
212
- });
213
- }
214
223
  function writeThemeCookie(clientHintsRequest, ssrClientHintsConfiguration2) {
215
224
  if (!ssrClientHintsConfiguration2.prefersColorScheme || !ssrClientHintsConfiguration2.prefersColorSchemeOptions)
216
225
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.5.10",
4
+ "version": "0.5.12",
5
5
  "packageManager": "pnpm@8.7.6",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
@@ -69,7 +69,7 @@
69
69
  "perfect-debounce": "^1.0.0",
70
70
  "unconfig": "^0.3.9",
71
71
  "vite-plugin-vuetify": "^1.0.2",
72
- "vuetify": "^3.3.9"
72
+ "vuetify": "^3.3.17"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@antfu/eslint-config": "^0.41.0",