vuetify-nuxt-module 0.16.0 → 0.16.1

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
@@ -5,5 +5,5 @@
5
5
  "nuxt": ">=3.9.0",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.16.0"
8
+ "version": "0.16.1"
9
9
  }
package/dist/module.mjs CHANGED
@@ -14,7 +14,7 @@ import { pathToFileURL } from 'node:url';
14
14
  import { parseQuery, parseURL } from 'ufo';
15
15
  import destr from 'destr';
16
16
 
17
- const version = "0.16.0";
17
+ const version = "0.16.1";
18
18
 
19
19
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
20
20
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -24,7 +24,8 @@ const AcceptClientHintsRequestHeaders = Object.entries(AcceptClientHintsHeaders)
24
24
  acc[key] = value.toLowerCase();
25
25
  return acc;
26
26
  }, {});
27
- const HttpRequestHeaders = Array.from(Object.values(AcceptClientHintsRequestHeaders)).concat("user-agent", "cookie");
27
+ const SecChUaMobile = "Sec-CH-UA-Mobile".toLowerCase();
28
+ const HttpRequestHeaders = Array.from(Object.values(AcceptClientHintsRequestHeaders)).concat("user-agent", "cookie", SecChUaMobile);
28
29
  const plugin = defineNuxtPlugin({
29
30
  name: "vuetify:client-hints:server:plugin",
30
31
  order: 24,
@@ -117,7 +118,7 @@ function browserFeatureAvailable(userAgent, feature) {
117
118
  return false;
118
119
  }
119
120
  }
120
- function lookupClientHints(userAgent, ssrClientHintsConfiguration2) {
121
+ function lookupClientHints(userAgent, ssrClientHintsConfiguration2, headers) {
121
122
  const features = {
122
123
  firstRequest: true,
123
124
  prefersColorSchemeAvailable: false,
@@ -135,12 +136,14 @@ function lookupClientHints(userAgent, ssrClientHintsConfiguration2) {
135
136
  if (ssrClientHintsConfiguration2.viewportSize) {
136
137
  features.viewportHeightAvailable = browserFeatureAvailable(userAgent, "viewportHeight");
137
138
  features.viewportWidthAvailable = browserFeatureAvailable(userAgent, "viewportWidth");
138
- features.devicePixelRatioAvailable = browserFeatureAvailable(userAgent, "devicePixelRatio");
139
+ const mobileHeader = headers[SecChUaMobile];
140
+ if (mobileHeader === "?1")
141
+ features.devicePixelRatioAvailable = browserFeatureAvailable(userAgent, "devicePixelRatio");
139
142
  }
140
143
  return features;
141
144
  }
142
145
  function collectClientHints(userAgent, ssrClientHintsConfiguration2, headers) {
143
- const hints = lookupClientHints(userAgent, ssrClientHintsConfiguration2);
146
+ const hints = lookupClientHints(userAgent, ssrClientHintsConfiguration2, headers);
144
147
  if (ssrClientHintsConfiguration2.prefersColorScheme) {
145
148
  if (ssrClientHintsConfiguration2.prefersColorSchemeOptions) {
146
149
  const cookieName = ssrClientHintsConfiguration2.prefersColorSchemeOptions.cookieName;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.16.0",
4
+ "version": "0.16.1",
5
5
  "packageManager": "pnpm@9.5.0",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
@@ -142,4 +142,4 @@
142
142
  "installDependencies": false,
143
143
  "startCommand": "node .stackblitz.js && pnpm install && nr prepack && nr dev:prepare && nr dev"
144
144
  }
145
- }
145
+ }