@nuxt/scripts 0.8.2 → 0.8.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.
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
3
  <link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.BAZUAl3s.css">
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/g9Cc3Sbs.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qH8ZJPJc.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
6
6
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BigF1UXR.js">
7
7
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
@@ -257,10 +257,10 @@
257
257
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B3g-KkBK.js">
258
258
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Bxkoe-BC.js">
259
259
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Br6ll-O0.js">
260
- <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.JSbzC_WU.css">
261
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C-wUfrx2.js">
262
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DZ7-g9rx.js">
263
- <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.DRrtE75f.css">
264
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CcDMurmi.js">
265
- <script type="module" src="/__nuxt-scripts/_nuxt/g9Cc3Sbs.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
266
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"6230635b-42e6-4b41-bd9b-303f3656c78e",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
260
+ <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.Dh7DYMRz.css">
261
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Ba8BmHI-.js">
262
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CQ_lMUWv.js">
263
+ <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.W3BiwNt2.css">
264
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CL9amlOg.js">
265
+ <script type="module" src="/__nuxt-scripts/_nuxt/qH8ZJPJc.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"serverRendered":1},false]</script>
266
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"663d447b-1805-44f3-9c37-fee30740d200",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.8.2",
8
+ "version": "0.8.4",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.8.3",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -236,9 +236,11 @@ function setupPublicAssetStrategy(options = {}) {
236
236
  const assetsBaseURL = options.prefix || "/_scripts";
237
237
  const nuxt = useNuxt();
238
238
  const renderedScriptSrc = /* @__PURE__ */ new Map();
239
- const storage = createStorage(fsDriver({
240
- base: "node_modules/.cache/nuxt/scripts"
241
- }));
239
+ const storage = createStorage({
240
+ driver: fsDriver({
241
+ base: "node_modules/.cache/nuxt/scripts"
242
+ })
243
+ });
242
244
  function normalizeScriptData(src) {
243
245
  if (hasProtocol(src, { acceptRelative: true })) {
244
246
  src = src.replace(/^\/\//, "https://");
@@ -135,6 +135,18 @@ function isLocationQuery(s: string | any) {
135
135
  return typeof s === 'string' && (s.split(',').length > 2 || s.includes('+'))
136
136
  }
137
137
 
138
+ function resetMapMarkerMap(_marker: google.maps.marker.AdvancedMarkerElement | Promise<google.maps.marker.AdvancedMarkerElement>) {
139
+ // eslint-disable-next-line no-async-promise-executor
140
+ return new Promise<void>(async (resolve) => {
141
+ const marker = _marker instanceof Promise ? await _marker : _marker
142
+ if (marker) {
143
+ // @ts-expect-error broken type
144
+ marker.setMap(null)
145
+ }
146
+ resolve()
147
+ })
148
+ }
149
+
138
150
  async function createAdvancedMapMarker(_options: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) {
139
151
  const key = hash(_options)
140
152
  if (mapMarkers.value.has(key))
@@ -266,10 +278,10 @@ onMounted(() => {
266
278
  }
267
279
  const marker = await mapMarkers.value.get(key)
268
280
  if (marker) {
269
- // @ts-expect-error broken type
270
- marker.setMap(null)
271
- // make sure it gets removed from map
272
- mapMarkers.value.delete(key)
281
+ resetMapMarkerMap(marker)
282
+ .then(() => {
283
+ mapMarkers.value.delete(key)
284
+ })
273
285
  }
274
286
  }
275
287
  for (const k of toAdd) {
@@ -298,9 +310,12 @@ onMounted(() => {
298
310
  }
299
311
  if (prev[0]) {
300
312
  const prevCenterHash = hash({ position: prev[0] })
301
- // @ts-expect-error broken upstream type
302
- mapMarkers.value.get(prevCenterHash)?.setMap(null)
303
- mapMarkers.value.delete(prevCenterHash)
313
+ if (mapMarkers.value.has(prevCenterHash)) {
314
+ resetMapMarkerMap(mapMarkers.value.get(prevCenterHash)!)
315
+ .then(() => {
316
+ mapMarkers.value.delete(prevCenterHash)
317
+ })
318
+ }
304
319
  }
305
320
  createAdvancedMapMarker({ position: center })
306
321
  }
@@ -427,13 +442,7 @@ const rootAttrs = computed(() => {
427
442
  const ScriptLoadingIndicator = resolveComponent('ScriptLoadingIndicator')
428
443
 
429
444
  onBeforeUnmount(async () => {
430
- await Promise.all([...mapMarkers.value.entries()].map(async (_marker) => {
431
- const marker = await _marker
432
- if (marker) {
433
- // @ts-expect-error broken type
434
- marker.setMap(null)
435
- }
436
- }))
445
+ await Promise.all([...mapMarkers.value.entries()].map(([,marker]) => resetMapMarkerMap(marker)))
437
446
  mapMarkers.value.clear()
438
447
  map.value?.unbindAll()
439
448
  map.value = undefined
@@ -18,7 +18,7 @@ export function useScript(input, options) {
18
18
  rel,
19
19
  as: rel === "preload" ? "script" : void 0,
20
20
  href: input.src,
21
- crossorigin: isCrossOrigin ? void 0 : typeof input.crossorigin !== "undefined" ? input.crossorigin : "anonymous",
21
+ crossorigin: !isCrossOrigin ? void 0 : typeof input.crossorigin !== "undefined" ? input.crossorigin : "anonymous",
22
22
  key: `nuxt-script-${id}`,
23
23
  tagPriority: rel === "preload" ? "high" : 0,
24
24
  fetchpriority: "low"
@@ -23,4 +23,4 @@ declare global {
23
23
  *
24
24
  * A 3P wrapper for Google Analytics that takes an options input to feed into third-party-capital({@link https://github.com/GoogleChromeLabs/third-party-capital}), which returns instructions for nuxt-scripts.
25
25
  */
26
- export declare function useScriptGoogleAdsense<T extends GoogleAdsenseApi>(_options?: GoogleAdsenseInput): import("../composables/useScript").UseScriptContext<T>;
26
+ export declare function useScriptGoogleAdsense<T extends GoogleAdsenseApi>(_options?: GoogleAdsenseInput): import("#imports").UseScriptContext<T>;
@@ -11,5 +11,5 @@ declare global {
11
11
  interface Window extends VimeoPlayerApi {
12
12
  }
13
13
  }
14
- export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): import("../composables/useScript").UseScriptContext<T>;
14
+ export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): import("#imports").UseScriptContext<T>;
15
15
  export {};
@@ -10,4 +10,4 @@ declare global {
10
10
  }
11
11
  }
12
12
  export type YouTubePlayerInput = RegistryScriptInput;
13
- export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): import("../composables/useScript").UseScriptContext<T>;
13
+ export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): import("#imports").UseScriptContext<T>;
@@ -8,5 +8,5 @@ type OptionsFn<O extends ObjectSchema<any, any>> = (options: InferInput<O>) => (
8
8
  clientInit?: () => void;
9
9
  });
10
10
  export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry[T];
11
- export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any, any> = EmptyOptionsSchema, U = {}>(registryKey: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): import("./composables/useScript").UseScriptContext<T>;
11
+ export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any, any> = EmptyOptionsSchema, U = {}>(registryKey: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): import("#imports").UseScriptContext<T>;
12
12
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.8.2",
4
+ "version": "0.8.4",
5
5
  "packageManager": "pnpm@9.9.0",
6
6
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
7
7
  "author": {
@@ -67,12 +67,12 @@
67
67
  "dependencies": {
68
68
  "@nuxt/devtools-kit": "^1.4.1",
69
69
  "@nuxt/devtools-ui-kit": "^1.4.1",
70
- "@nuxt/kit": "^3.13.0",
71
- "@types/google.maps": "^3.57.0",
70
+ "@nuxt/kit": "^3.13.1",
71
+ "@types/google.maps": "^3.58.0",
72
72
  "@types/stripe-v3": "^3.1.33",
73
73
  "@types/vimeo__player": "^2.18.3",
74
74
  "@types/youtube": "^0.1.0",
75
- "@unhead/vue": "^1.10.4",
75
+ "@unhead/vue": "1.11.0-beta.1",
76
76
  "@vueuse/core": "^11.0.3",
77
77
  "consola": "^3.2.3",
78
78
  "defu": "^6.1.4",
@@ -84,36 +84,36 @@
84
84
  "pathe": "^1.1.2",
85
85
  "pkg-types": "^1.2.0",
86
86
  "semver": "^7.6.3",
87
- "shiki": "1.16.1",
87
+ "shiki": "1.16.2",
88
88
  "sirv": "^2.0.4",
89
89
  "std-env": "^3.7.0",
90
90
  "third-party-capital": "2.3.0",
91
91
  "ufo": "^1.5.4",
92
92
  "unimport": "^3.11.1",
93
- "unplugin": "^1.12.3",
94
- "unstorage": "^1.10.2",
93
+ "unplugin": "^1.13.1",
94
+ "unstorage": "^1.12.0",
95
95
  "valibot": "^0.41.0"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@nuxt/devtools-ui-kit": "^1.4.1",
99
- "@nuxt/eslint-config": "^0.5.5",
99
+ "@nuxt/eslint-config": "^0.5.6",
100
100
  "@nuxt/module-builder": "^0.8.3",
101
101
  "@nuxt/test-utils": "3.14.1",
102
102
  "@types/semver": "^7.5.8",
103
103
  "@typescript-eslint/typescript-estree": "^8.4.0",
104
- "@unhead/schema": "^1.10.4",
104
+ "@unhead/schema": "1.11.0-beta.1",
105
105
  "acorn-loose": "^8.4.0",
106
106
  "bumpp": "^9.5.2",
107
107
  "changelogen": "^0.5.5",
108
- "eslint": "9.9.1",
108
+ "eslint": "9.10.0",
109
109
  "eslint-plugin-n": "^17.10.2",
110
110
  "knitwork": "^1.1.0",
111
- "nuxt": "^3.13.0",
111
+ "nuxt": "^3.13.1",
112
112
  "nuxt-scripts-devtools": "workspace:*",
113
- "playwright-core": "^1.46.1",
113
+ "playwright-core": "^1.47.0",
114
114
  "typescript": "^5.5.4",
115
115
  "vitest": "^2.0.5",
116
- "vue": "^3.5.0",
116
+ "vue": "^3.5.3",
117
117
  "vue-router": "^4.4.3"
118
118
  },
119
119
  "resolutions": {
@@ -124,11 +124,11 @@
124
124
  "@unhead/shared": "1.10.4",
125
125
  "@unhead/ssr": "1.10.4",
126
126
  "@unhead/vue": "1.10.4",
127
- "nuxt": "^3.13.0",
127
+ "nuxt": "^3.13.1",
128
128
  "nuxt-scripts-devtools": "workspace:*",
129
129
  "shiki": "1.10.3",
130
130
  "unhead": "1.10.4",
131
- "vue": "^3.5.0",
131
+ "vue": "^3.5.3",
132
132
  "vue-router": "^4.4.3"
133
133
  }
134
134
  }
@@ -1 +0,0 @@
1
- {"id":"6230635b-42e6-4b41-bd9b-303f3656c78e","timestamp":1725423640831,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -1 +0,0 @@
1
- .spotlight[data-v-170ceab2]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-30vh;filter:blur(20vh);height:40vh}.gradient-border[data-v-170ceab2]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:.5rem;position:relative}@media (prefers-color-scheme:light){.gradient-border[data-v-170ceab2]{background-color:#ffffff4d}.gradient-border[data-v-170ceab2]:before{background:linear-gradient(90deg,#e2e2e2,#e2e2e2 25%,#00dc82,#36e4da 75%,#0047e1)}}@media (prefers-color-scheme:dark){.gradient-border[data-v-170ceab2]{background-color:#1414144d}.gradient-border[data-v-170ceab2]:before{background:linear-gradient(90deg,#303030,#303030 25%,#00dc82,#36e4da 75%,#0047e1)}}.gradient-border[data-v-170ceab2]:before{background-size:400% auto;border-radius:.5rem;bottom:0;content:"";left:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5;padding:2px;position:absolute;right:0;top:0;transition:background-position .3s ease-in-out,opacity .2s ease-in-out;width:100%}.gradient-border[data-v-170ceab2]:hover:before{background-position:-50% 0;opacity:1}.fixed[data-v-170ceab2]{position:fixed}.left-0[data-v-170ceab2]{left:0}.right-0[data-v-170ceab2]{right:0}.z-10[data-v-170ceab2]{z-index:10}.z-20[data-v-170ceab2]{z-index:20}.grid[data-v-170ceab2]{display:grid}.mb-16[data-v-170ceab2]{margin-bottom:4rem}.mb-8[data-v-170ceab2]{margin-bottom:2rem}.max-w-520px[data-v-170ceab2]{max-width:520px}.min-h-screen[data-v-170ceab2]{min-height:100vh}.w-full[data-v-170ceab2]{width:100%}.flex[data-v-170ceab2]{display:flex}.cursor-pointer[data-v-170ceab2]{cursor:pointer}.place-content-center[data-v-170ceab2]{place-content:center}.items-center[data-v-170ceab2]{align-items:center}.justify-center[data-v-170ceab2]{justify-content:center}.overflow-hidden[data-v-170ceab2]{overflow:hidden}.bg-white[data-v-170ceab2]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-4[data-v-170ceab2]{padding-left:1rem;padding-right:1rem}.px-8[data-v-170ceab2]{padding-left:2rem;padding-right:2rem}.py-2[data-v-170ceab2]{padding-bottom:.5rem;padding-top:.5rem}.text-center[data-v-170ceab2]{text-align:center}.text-8xl[data-v-170ceab2]{font-size:6rem;line-height:1}.text-xl[data-v-170ceab2]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-170ceab2]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-170ceab2]{font-weight:300}.font-medium[data-v-170ceab2]{font-weight:500}.leading-tight[data-v-170ceab2]{line-height:1.25}.font-sans[data-v-170ceab2]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-170ceab2]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-170ceab2]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-170ceab2]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-170ceab2]{padding-left:0;padding-right:0}.sm\:px-6[data-v-170ceab2]{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3[data-v-170ceab2]{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-4xl[data-v-170ceab2]{font-size:2.25rem;line-height:2.5rem}.sm\:text-xl[data-v-170ceab2]{font-size:1.25rem;line-height:1.75rem}}
@@ -1 +0,0 @@
1
- .spotlight[data-v-b658c521]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}.fixed[data-v-b658c521]{position:fixed}.-bottom-1\/2[data-v-b658c521]{bottom:-50%}.left-0[data-v-b658c521]{left:0}.right-0[data-v-b658c521]{right:0}.grid[data-v-b658c521]{display:grid}.mb-16[data-v-b658c521]{margin-bottom:4rem}.mb-8[data-v-b658c521]{margin-bottom:2rem}.h-1\/2[data-v-b658c521]{height:50%}.max-w-520px[data-v-b658c521]{max-width:520px}.min-h-screen[data-v-b658c521]{min-height:100vh}.place-content-center[data-v-b658c521]{place-content:center}.overflow-hidden[data-v-b658c521]{overflow:hidden}.bg-white[data-v-b658c521]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8[data-v-b658c521]{padding-left:2rem;padding-right:2rem}.text-center[data-v-b658c521]{text-align:center}.text-8xl[data-v-b658c521]{font-size:6rem;line-height:1}.text-xl[data-v-b658c521]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-b658c521]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-b658c521]{font-weight:300}.font-medium[data-v-b658c521]{font-weight:500}.leading-tight[data-v-b658c521]{line-height:1.25}.font-sans[data-v-b658c521]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-b658c521]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-b658c521]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-b658c521]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-b658c521]{padding-left:0;padding-right:0}.sm\:text-4xl[data-v-b658c521]{font-size:2.25rem;line-height:2.5rem}}