@nuxt/scripts 1.3.6 → 2.0.0-beta.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.
Files changed (207) hide show
  1. package/THIRD_PARTY_LICENSES.md +124 -0
  2. package/dist/devtools-client/200.html +1 -1
  3. package/dist/devtools-client/404.html +1 -1
  4. package/dist/devtools-client/_nuxt/{B551Pnuh.js → 2p1_IuX2.js} +1 -1
  5. package/dist/devtools-client/_nuxt/{KxC4Q3ev.js → 9elIQxwW.js} +1 -1
  6. package/dist/devtools-client/_nuxt/{DTP8MRtW.js → BNPn63Jz.js} +1 -1
  7. package/dist/devtools-client/_nuxt/BjRLaDIG.js +152 -0
  8. package/dist/devtools-client/_nuxt/BtNUYBXT.js +8 -0
  9. package/dist/devtools-client/_nuxt/CDDBpkXG.js +3 -0
  10. package/dist/devtools-client/_nuxt/Cpb0XAYP.js +1 -0
  11. package/dist/devtools-client/_nuxt/DAsiyhPm.js +6 -0
  12. package/dist/devtools-client/_nuxt/{VICyrUSM.js → DabLKy7M.js} +1 -1
  13. package/dist/devtools-client/_nuxt/Dat651Oh.js +1 -0
  14. package/dist/devtools-client/_nuxt/DcG2ZXvY.js +1 -0
  15. package/dist/devtools-client/_nuxt/DmlGWZ2X.js +1 -0
  16. package/dist/devtools-client/_nuxt/KsX6Az5B.js +1 -0
  17. package/dist/devtools-client/_nuxt/RL1np866.js +28 -0
  18. package/dist/devtools-client/_nuxt/UmWNrBO5.js +2 -0
  19. package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
  20. package/dist/devtools-client/_nuxt/builds/meta/e28b96f1-78e8-41a4-ad6f-904cd078f85e.json +1 -0
  21. package/dist/devtools-client/_nuxt/{entry.CYUdJFoE.css → entry.9HJPJ6Hp.css} +1 -1
  22. package/dist/devtools-client/_nuxt/error-404.DnwL1N6v.css +1 -0
  23. package/dist/devtools-client/_nuxt/error-500.DEbXRLdm.css +1 -0
  24. package/dist/devtools-client/docs/index.html +1 -1
  25. package/dist/devtools-client/first-party/index.html +1 -1
  26. package/dist/devtools-client/index.html +1 -1
  27. package/dist/devtools-client/registry/index.html +1 -1
  28. package/dist/module.d.mts +2 -86
  29. package/dist/module.d.ts +2 -86
  30. package/dist/module.json +3 -3
  31. package/dist/module.mjs +71 -328
  32. package/dist/registry.mjs +54 -22
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +1 -28
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +7 -50
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +1 -28
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +0 -8
  37. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +1 -13
  38. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +0 -8
  39. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +4 -4
  40. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +9 -15
  41. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +4 -4
  42. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +0 -22
  43. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +0 -31
  44. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.d.vue.ts +31 -0
  45. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue +43 -0
  46. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue.d.ts +31 -0
  47. package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +90 -0
  48. package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue +171 -0
  49. package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +90 -0
  50. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.d.vue.ts +47 -0
  51. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue +70 -0
  52. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue.d.ts +47 -0
  53. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.d.vue.ts +31 -0
  54. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue +81 -0
  55. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue.d.ts +31 -0
  56. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.d.vue.ts +26 -0
  57. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue +38 -0
  58. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue.d.ts +26 -0
  59. package/dist/runtime/components/Leaflet/useLeafletResource.d.ts +30 -0
  60. package/dist/runtime/components/Leaflet/useLeafletResource.js +46 -0
  61. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +39 -0
  62. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +84 -0
  63. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +39 -0
  64. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +122 -0
  65. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +214 -0
  66. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +122 -0
  67. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.d.vue.ts +35 -0
  68. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue +98 -0
  69. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue.d.ts +35 -0
  70. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.d.vue.ts +12 -0
  71. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue +23 -0
  72. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue.d.ts +12 -0
  73. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.d.vue.ts +31 -0
  74. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue +99 -0
  75. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue.d.ts +31 -0
  76. package/dist/runtime/components/MapLibre/useMapLibreResource.d.ts +23 -0
  77. package/dist/runtime/components/MapLibre/useMapLibreResource.js +41 -0
  78. package/dist/runtime/components/ScriptCrisp.vue +20 -18
  79. package/dist/runtime/components/ScriptDeskCrew.d.vue.ts +40 -0
  80. package/dist/runtime/components/ScriptDeskCrew.vue +82 -0
  81. package/dist/runtime/components/ScriptDeskCrew.vue.d.ts +40 -0
  82. package/dist/runtime/components/ScriptIntercom.vue +21 -19
  83. package/dist/runtime/components/ScriptLoadingIndicator.d.vue.ts +1 -1
  84. package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +1 -1
  85. package/dist/runtime/components/ScriptPayPalButtons.vue +7 -3
  86. package/dist/runtime/components/ScriptPayPalMessages.vue +8 -4
  87. package/dist/runtime/composables/useScript.js +96 -49
  88. package/dist/runtime/composables/useScriptProxyUrl.d.ts +4 -8
  89. package/dist/runtime/composables/useScriptProxyUrl.js +0 -7
  90. package/dist/runtime/composables/useScriptTriggerIdleTimeout.d.ts +2 -1
  91. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +3 -34
  92. package/dist/runtime/composables/useScriptTriggerInteraction.d.ts +2 -1
  93. package/dist/runtime/composables/useScriptTriggerInteraction.js +13 -46
  94. package/dist/runtime/composables/useScriptTriggerServiceWorker.d.ts +2 -1
  95. package/dist/runtime/composables/useScriptTriggerServiceWorker.js +5 -38
  96. package/dist/runtime/leaflet-styles.d.ts +13 -0
  97. package/dist/runtime/leaflet-styles.js +684 -0
  98. package/dist/runtime/maplibre-styles.d.ts +7 -0
  99. package/dist/runtime/maplibre-styles.js +25 -0
  100. package/dist/runtime/npm-script-api-state.d.ts +4 -0
  101. package/dist/runtime/npm-script-api-state.js +13 -0
  102. package/dist/runtime/registry/crisp.d.ts +1 -1
  103. package/dist/runtime/registry/crisp.js +30 -18
  104. package/dist/runtime/registry/deskcrew.d.ts +52 -0
  105. package/dist/runtime/registry/deskcrew.js +31 -0
  106. package/dist/runtime/registry/google-analytics.d.ts +0 -2
  107. package/dist/runtime/registry/google-maps.d.ts +2 -11
  108. package/dist/runtime/registry/google-maps.js +31 -10
  109. package/dist/runtime/registry/google-tag-manager.d.ts +0 -2
  110. package/dist/runtime/registry/leaflet.d.ts +13 -0
  111. package/dist/runtime/registry/leaflet.js +29 -0
  112. package/dist/runtime/registry/maplibre.d.ts +13 -0
  113. package/dist/runtime/registry/maplibre.js +29 -0
  114. package/dist/runtime/registry/matomo-analytics.js +1 -8
  115. package/dist/runtime/registry/plausible-analytics.d.ts +4 -16
  116. package/dist/runtime/registry/plausible-analytics.js +15 -58
  117. package/dist/runtime/registry/rybbit-analytics.d.ts +0 -4
  118. package/dist/runtime/registry/rybbit-analytics.js +1 -4
  119. package/dist/runtime/registry/schemas.d.ts +61 -5
  120. package/dist/runtime/registry/schemas.js +64 -5
  121. package/dist/runtime/registry/tiktok-pixel.d.ts +2 -12
  122. package/dist/runtime/registry/tiktok-pixel.js +1 -1
  123. package/dist/runtime/registry/usercentrics.js +46 -6
  124. package/dist/runtime/registry/youtube-player.d.ts +3 -4
  125. package/dist/runtime/registry/youtube-player.js +30 -23
  126. package/dist/runtime/server/bluesky-embed-image.d.ts +1 -1
  127. package/dist/runtime/server/bluesky-embed.d.ts +1 -1
  128. package/dist/runtime/server/bluesky-embed.js +3 -6
  129. package/dist/runtime/server/gravatar-proxy.d.ts +1 -1
  130. package/dist/runtime/server/gravatar-proxy.js +2 -3
  131. package/dist/runtime/server/instagram-embed-asset.d.ts +1 -1
  132. package/dist/runtime/server/instagram-embed-image.d.ts +1 -1
  133. package/dist/runtime/server/instagram-embed.d.ts +1 -1
  134. package/dist/runtime/server/instagram-embed.js +4 -7
  135. package/dist/runtime/server/utils/cached-upstream.d.ts +4 -11
  136. package/dist/runtime/server/utils/embed-rewriters.d.ts +3 -5
  137. package/dist/runtime/server/utils/embed-rewriters.js +8 -8
  138. package/dist/runtime/server/utils/image-proxy.d.ts +1 -1
  139. package/dist/runtime/server/utils/image-proxy.js +2 -3
  140. package/dist/runtime/server/utils/instagram-embed.d.ts +6 -6
  141. package/dist/runtime/server/utils/instagram-embed.js +18 -19
  142. package/dist/runtime/server/utils/proxy-url.d.ts +5 -6
  143. package/dist/runtime/server/utils/proxy-url.js +1 -4
  144. package/dist/runtime/server/x-embed-image.d.ts +1 -1
  145. package/dist/runtime/server/x-embed.d.ts +48 -1
  146. package/dist/runtime/server/x-embed.js +3 -6
  147. package/dist/runtime/types.d.ts +13 -13
  148. package/dist/runtime/utils/abortable-promise.js +26 -5
  149. package/dist/runtime/utils/nuxt-ready-script-trigger.d.ts +3 -0
  150. package/dist/runtime/utils/nuxt-ready-script-trigger.js +16 -0
  151. package/dist/runtime/utils.js +21 -32
  152. package/dist/stats.mjs +13 -0
  153. package/dist/types-source.mjs +1173 -100
  154. package/dist/types.d.mts +2 -2
  155. package/package.json +34 -21
  156. package/LICENSE.md +0 -9
  157. package/bin/cli.mjs +0 -2
  158. package/dist/cli.d.mts +0 -2
  159. package/dist/cli.d.ts +0 -2
  160. package/dist/cli.mjs +0 -50
  161. package/dist/devtools-client/_nuxt/8ltZ0o6d.js +0 -1
  162. package/dist/devtools-client/_nuxt/B8_EBdhg.js +0 -152
  163. package/dist/devtools-client/_nuxt/BKdLzFmX.js +0 -3
  164. package/dist/devtools-client/_nuxt/Bf2Kt1P0.js +0 -28
  165. package/dist/devtools-client/_nuxt/CC0GKROJ.js +0 -1
  166. package/dist/devtools-client/_nuxt/CH5oUfNi.js +0 -1
  167. package/dist/devtools-client/_nuxt/CMXzQxJZ.js +0 -1
  168. package/dist/devtools-client/_nuxt/CP7c-Js6.js +0 -8
  169. package/dist/devtools-client/_nuxt/C_v3_O0R.js +0 -6
  170. package/dist/devtools-client/_nuxt/CxN78VhB.js +0 -1
  171. package/dist/devtools-client/_nuxt/Dkc7iTdR.js +0 -1
  172. package/dist/devtools-client/_nuxt/builds/meta/35e54cbc-079c-4313-8838-34632d9dac97.json +0 -1
  173. package/dist/devtools-client/_nuxt/error-404.Bq2JQbJs.css +0 -1
  174. package/dist/devtools-client/_nuxt/error-500.5E_FOzlc.css +0 -1
  175. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +0 -13
  176. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +0 -15
  177. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +0 -13
  178. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +0 -27
  179. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +0 -34
  180. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +0 -27
  181. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +0 -13
  182. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +0 -11
  183. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +0 -13
  184. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +0 -13
  185. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +0 -8
  186. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +0 -10
  187. package/dist/runtime/components/GoogleMaps/injectionKeys.js +0 -2
  188. package/dist/runtime/composables/useScriptProxyToken.d.ts +0 -12
  189. package/dist/runtime/composables/useScriptProxyToken.js +0 -4
  190. package/dist/runtime/npm-script-stub.d.ts +0 -20
  191. package/dist/runtime/npm-script-stub.js +0 -72
  192. package/dist/runtime/plugins/proxy-token.server.d.ts +0 -10
  193. package/dist/runtime/plugins/proxy-token.server.js +0 -17
  194. package/dist/runtime/server/google-maps-geocode-proxy.d.ts +0 -2
  195. package/dist/runtime/server/google-maps-geocode-proxy.js +0 -43
  196. package/dist/runtime/server/google-static-maps-proxy.d.ts +0 -2
  197. package/dist/runtime/server/google-static-maps-proxy.js +0 -56
  198. package/dist/runtime/server/utils/proxy-query.d.ts +0 -2
  199. package/dist/runtime/server/utils/proxy-query.js +0 -10
  200. package/dist/runtime/server/utils/sign-constants.d.ts +0 -16
  201. package/dist/runtime/server/utils/sign-constants.js +0 -5
  202. package/dist/runtime/server/utils/sign.d.ts +0 -101
  203. package/dist/runtime/server/utils/sign.js +0 -91
  204. package/dist/runtime/server/utils/withSigning.d.ts +0 -23
  205. package/dist/runtime/server/utils/withSigning.js +0 -19
  206. package/dist/runtime/unhead-features.d.ts +0 -1
  207. package/dist/runtime/unhead-features.js +0 -3
@@ -0,0 +1,25 @@
1
+ export const MAPLIBRE_STYLESHEET_URL = "https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.css";
2
+ export const MAPLIBRE_STYLESHEET_INTEGRITY = "sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK";
3
+ const MAPLIBRE_STYLE_ID = "nuxt-scripts-maplibre-styles";
4
+ export function configureMapLibreWorker(maplibre, workerUrl) {
5
+ if (maplibre && workerUrl)
6
+ maplibre.setWorkerUrl(workerUrl);
7
+ }
8
+ export function ensureMapLibreStyles(stylesheetUrl = MAPLIBRE_STYLESHEET_URL) {
9
+ if (typeof document === "undefined")
10
+ return;
11
+ const link = document.createElement("link");
12
+ link.rel = "stylesheet";
13
+ link.href = stylesheetUrl;
14
+ const stylesheets = document.querySelectorAll('link[rel~="stylesheet"][href]');
15
+ if ([...stylesheets].some((stylesheet) => stylesheet.href === link.href))
16
+ return;
17
+ const injectedStylesheets = document.querySelectorAll("[data-nuxt-scripts-maplibre]");
18
+ link.id = injectedStylesheets.length ? `${MAPLIBRE_STYLE_ID}-${injectedStylesheets.length + 1}` : MAPLIBRE_STYLE_ID;
19
+ link.dataset.nuxtScriptsMaplibre = "1";
20
+ if (stylesheetUrl === MAPLIBRE_STYLESHEET_URL) {
21
+ link.integrity = MAPLIBRE_STYLESHEET_INTEGRITY;
22
+ link.crossOrigin = "anonymous";
23
+ }
24
+ document.head.append(link);
25
+ }
@@ -0,0 +1,4 @@
1
+ export declare function createNpmScriptApiState<T>(resolvePreload?: () => T | undefined): {
2
+ current(): T | undefined;
3
+ load(resolveLoaded?: () => T | Promise<T> | undefined, initialized?: T): Promise<T>;
4
+ };
@@ -0,0 +1,13 @@
1
+ export function createNpmScriptApiState(resolvePreload) {
2
+ let state = { _tag: "Preload" };
3
+ return {
4
+ current() {
5
+ return state._tag === "Loaded" ? state.api : resolvePreload?.();
6
+ },
7
+ async load(resolveLoaded, initialized) {
8
+ const api = await Promise.resolve(resolveLoaded?.() || initialized || {});
9
+ state = { _tag: "Loaded", api };
10
+ return api;
11
+ }
12
+ };
13
+ }
@@ -16,7 +16,7 @@ export interface CrispApi {
16
16
  }
17
17
  declare global {
18
18
  interface Window {
19
- CRISP_READY_TRIGGER: () => void;
19
+ CRISP_READY_TRIGGER?: () => void;
20
20
  CRISP_WEBSITE_ID: string;
21
21
  CRISP_RUNTIME_CONFIG?: {
22
22
  locale?: string;
@@ -2,7 +2,6 @@ import { useRegistryScript } from "../utils.js";
2
2
  import { CrispOptions } from "./schemas.js";
3
3
  export { CrispOptions };
4
4
  export function useScriptCrisp(_options) {
5
- let readyPromise = Promise.resolve();
6
5
  return useRegistryScript("crisp", (options) => ({
7
6
  scriptInput: {
8
7
  src: "https://client.crisp.chat/l.js"
@@ -10,24 +9,40 @@ export function useScriptCrisp(_options) {
10
9
  },
11
10
  schema: import.meta.dev ? CrispOptions : void 0,
12
11
  scriptOptions: {
13
- use() {
14
- const wrapFn = (fn) => window.$crisp?.[fn] || ((...args) => {
15
- readyPromise.then(() => window.$crisp[fn](...args));
12
+ resolve({ waitFor }) {
13
+ if (typeof window.$crisp?.is === "function")
14
+ return window.$crisp;
15
+ return waitFor((resolve, reject) => {
16
+ const previousReady = window.CRISP_READY_TRIGGER;
17
+ let onReady;
18
+ const restoreReady = () => {
19
+ if (window.CRISP_READY_TRIGGER !== onReady)
20
+ return;
21
+ if (previousReady)
22
+ window.CRISP_READY_TRIGGER = previousReady;
23
+ else
24
+ delete window.CRISP_READY_TRIGGER;
25
+ };
26
+ onReady = () => {
27
+ restoreReady();
28
+ try {
29
+ previousReady?.();
30
+ } catch (error) {
31
+ if (import.meta.dev)
32
+ console.error("[nuxt-scripts] Previous CRISP_READY_TRIGGER handler failed:", error);
33
+ }
34
+ if (typeof window.$crisp?.is === "function")
35
+ resolve(window.$crisp);
36
+ else
37
+ reject(new Error("[nuxt-scripts] Crisp reported ready without exposing window.$crisp"));
38
+ };
39
+ window.CRISP_READY_TRIGGER = onReady;
40
+ return restoreReady;
16
41
  });
17
- return {
18
- push: window.$crisp.push,
19
- do: wrapFn("do"),
20
- set: wrapFn("set"),
21
- get: wrapFn("get"),
22
- on: wrapFn("on"),
23
- off: wrapFn("off"),
24
- config: wrapFn("config"),
25
- help: wrapFn("help")
26
- };
27
42
  }
28
43
  },
29
44
  clientInit: import.meta.server ? void 0 : () => {
30
- window.$crisp = [];
45
+ window.$crisp = window.$crisp || [];
31
46
  window.CRISP_WEBSITE_ID = options.id;
32
47
  if (options.runtimeConfig?.locale)
33
48
  window.CRISP_RUNTIME_CONFIG = { locale: options.runtimeConfig.locale };
@@ -37,9 +52,6 @@ export function useScriptCrisp(_options) {
37
52
  window.CRISP_COOKIE_EXPIRATION = options.cookieExpiry;
38
53
  if (options.tokenId)
39
54
  window.CRISP_TOKEN_ID = options.tokenId;
40
- readyPromise = new Promise((resolve) => {
41
- window.CRISP_READY_TRIGGER = resolve;
42
- });
43
55
  }
44
56
  }), _options);
45
57
  }
@@ -0,0 +1,52 @@
1
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import { DeskCrewOptions } from './schemas.js';
3
+ export { DeskCrewOptions };
4
+ export type DeskCrewInput = RegistryScriptInput<typeof DeskCrewOptions, false, false>;
5
+ export interface DeskCrewIdentity {
6
+ /** A signed identity token minted by your backend. */
7
+ token: string;
8
+ }
9
+ export interface DeskCrewEmbedOptions {
10
+ /** Target element, or a selector for it. */
11
+ el: string | HTMLElement;
12
+ /** Board slug, defaults to the `board` option. */
13
+ board?: string;
14
+ /** Path the portal is mounted under, defaults to the current pathname. */
15
+ basePath?: string;
16
+ /** Which portal view to open first. */
17
+ view?: string;
18
+ theme?: 'light' | 'dark';
19
+ }
20
+ export interface DeskCrewChangelogOptions {
21
+ /** `'inline'` requires `selector`. */
22
+ mode?: 'inline' | 'floating';
23
+ selector?: string;
24
+ basePath?: string;
25
+ position?: 'left' | 'right';
26
+ }
27
+ export interface DeskCrewSurveyOptions {
28
+ /** Reserved. Surveys are opt in and may only be invoked once per page. */
29
+ [key: string]: unknown;
30
+ }
31
+ export interface DeskCrewApi {
32
+ /** Open the support panel. */
33
+ open: () => void;
34
+ /** Close the support panel. */
35
+ close: () => void;
36
+ /** Attach a signed identity token to the current session. */
37
+ identify: (identity: DeskCrewIdentity) => void;
38
+ /** Mount the embedded support portal into an element. May only be called once per page. */
39
+ embed: (options: DeskCrewEmbedOptions) => void;
40
+ /** Mount the changelog widget. May only be called once per page. */
41
+ changelog: (options?: DeskCrewChangelogOptions) => void;
42
+ /** Show an eligible survey. Opt in, may only be called once per page. */
43
+ surveys: (options?: DeskCrewSurveyOptions) => void;
44
+ /** Report an error to Signals. No-op unless the workspace has error capture enabled. */
45
+ captureError: (error: unknown, context?: Record<string, any>) => void;
46
+ }
47
+ declare global {
48
+ interface Window {
49
+ DeskCrew: DeskCrewApi;
50
+ }
51
+ }
52
+ export declare function useScriptDeskCrew<T extends DeskCrewApi>(_options?: DeskCrewInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -0,0 +1,31 @@
1
+ import { useRegistryScript } from "../utils.js";
2
+ import { DeskCrewOptions } from "./schemas.js";
3
+ export { DeskCrewOptions };
4
+ export function useScriptDeskCrew(_options) {
5
+ return useRegistryScript("deskcrew", (options) => ({
6
+ scriptInput: {
7
+ "src": "https://deskcrew.io/desk.js",
8
+ "data-key": options.widgetKey,
9
+ // `|| undefined` on every optional: with envDefaults an unset field resolves to
10
+ // '', and unhead would then render an empty data-board="" onto the tag. Same
11
+ // guard umami-analytics uses.
12
+ "data-board": options?.board || void 0,
13
+ "data-color": options?.color || void 0,
14
+ "data-position": options?.position || void 0,
15
+ "data-greeting": options?.greeting || void 0,
16
+ "data-launcher": options?.launcher || void 0
17
+ },
18
+ schema: import.meta.dev ? DeskCrewOptions : void 0,
19
+ scriptOptions: {
20
+ // `use()` rather than `resolve({ waitFor })`. desk.js is one synchronous IIFE:
21
+ // the queue stub and the real API are assigned at the same nesting level with no
22
+ // async boundary between them, so the API exists by the time the load event that
23
+ // use() waits on fires. The script also assigns its methods onto the stub rather
24
+ // than replacing the object, so window.DeskCrew keeps a single identity for the
25
+ // life of the page and a handle taken at any point stays live.
26
+ use() {
27
+ return window.DeskCrew;
28
+ }
29
+ }
30
+ }), _options);
31
+ }
@@ -59,8 +59,6 @@ export interface GoogleAnalyticsApi {
59
59
  }
60
60
  export { GoogleAnalyticsOptions };
61
61
  export type GoogleAnalyticsInput = RegistryScriptInput<typeof GoogleAnalyticsOptions>;
62
- /** @deprecated Use {@link GcmConsentApi} from `#nuxt-scripts/types` instead. */
63
- export type GoogleAnalyticsConsent = GcmConsentApi;
64
62
  export declare function useScriptGoogleAnalytics<T extends GoogleAnalyticsApi>(_options?: GoogleAnalyticsInput & {
65
63
  onBeforeGtagStart?: (gtag: GTag) => void;
66
64
  }): UseScriptContext<T, GcmConsentApi>;
@@ -2,17 +2,8 @@ import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
2
  import { GoogleMapsOptions } from './schemas.js';
3
3
  export { GoogleMapsOptions };
4
4
  export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>;
5
- type MapsNamespace = typeof window.google.maps;
5
+ type MapsNamespace = typeof google.maps;
6
6
  export interface GoogleMapsApi {
7
- maps: Promise<MapsNamespace>;
8
- }
9
- declare global {
10
- interface Window {
11
- google: {
12
- maps: {
13
- __ib__: () => void;
14
- };
15
- };
16
- }
7
+ maps: MapsNamespace;
17
8
  }
18
9
  export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -3,7 +3,6 @@ import { useRegistryScript } from "../utils.js";
3
3
  import { GoogleMapsOptions } from "./schemas.js";
4
4
  export { GoogleMapsOptions };
5
5
  export function useScriptGoogleMaps(_options) {
6
- let readyPromise = Promise.resolve();
7
6
  return useRegistryScript("googleMaps", (options) => {
8
7
  const libraries = options?.libraries || ["places"];
9
8
  const language = options?.language ? { language: options.language } : void 0;
@@ -22,18 +21,40 @@ export function useScriptGoogleMaps(_options) {
22
21
  })
23
22
  },
24
23
  clientInit: import.meta.server ? void 0 : () => {
25
- window.google = window.google || {};
26
- window.google.maps = window.google.maps || {};
27
- readyPromise = new Promise((resolve) => {
28
- window.google.maps.__ib__ = resolve;
29
- });
24
+ const runtimeWindow = window;
25
+ runtimeWindow.google = runtimeWindow.google || {};
26
+ runtimeWindow.google.maps = runtimeWindow.google.maps || {};
30
27
  },
31
28
  schema: import.meta.dev ? GoogleMapsOptions : void 0,
32
29
  scriptOptions: {
33
- use() {
34
- return {
35
- maps: readyPromise.then(() => window.google.maps)
36
- };
30
+ resolve({ waitFor }) {
31
+ const maps = window.google.maps;
32
+ if (typeof maps.importLibrary === "function")
33
+ return { maps };
34
+ return waitFor((resolve) => {
35
+ const previousReady = maps.__ib__;
36
+ let onReady;
37
+ const restoreReady = () => {
38
+ if (maps.__ib__ !== onReady)
39
+ return;
40
+ if (previousReady)
41
+ maps.__ib__ = previousReady;
42
+ else
43
+ Reflect.deleteProperty(maps, "__ib__");
44
+ };
45
+ onReady = () => {
46
+ restoreReady();
47
+ try {
48
+ previousReady?.();
49
+ } catch (error) {
50
+ if (import.meta.dev)
51
+ console.error("[nuxt-scripts] Previous google.maps.__ib__ handler failed:", error);
52
+ }
53
+ resolve({ maps });
54
+ };
55
+ maps.__ib__ = onReady;
56
+ return restoreReady;
57
+ });
37
58
  }
38
59
  }
39
60
  };
@@ -77,8 +77,6 @@ declare global {
77
77
  }
78
78
  export { GoogleTagManagerOptions };
79
79
  export type GoogleTagManagerInput = RegistryScriptInput<typeof GoogleTagManagerOptions>;
80
- /** @deprecated Use {@link GcmConsentApi} from `#nuxt-scripts/types` instead. */
81
- export type GoogleTagManagerConsent = GcmConsentApi;
82
80
  /**
83
81
  * Hook to use Google Tag Manager in Nuxt applications
84
82
  */
@@ -0,0 +1,13 @@
1
+ import type * as Leaflet from 'leaflet';
2
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
3
+ import { LeafletOptions } from './schemas.js';
4
+ export { LeafletOptions };
5
+ export type LeafletInput = RegistryScriptInput<typeof LeafletOptions>;
6
+ export interface LeafletApi {
7
+ L: typeof Leaflet;
8
+ }
9
+ declare global {
10
+ interface Window extends LeafletApi {
11
+ }
12
+ }
13
+ export declare function useScriptLeaflet<T extends LeafletApi>(_options?: LeafletInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -0,0 +1,29 @@
1
+ import { configureLeafletDefaultIcons, ensureLeafletStyles } from "../leaflet-styles.js";
2
+ import { useRegistryScript } from "../utils.js";
3
+ import { LeafletOptions } from "./schemas.js";
4
+ export { LeafletOptions };
5
+ export function useScriptLeaflet(_options) {
6
+ return useRegistryScript("leaflet", (options, context) => {
7
+ const injectStyles = options?.injectStyles !== false;
8
+ const usesDefaultSource = !context.scriptInput?.src;
9
+ return {
10
+ scriptInput: {
11
+ src: "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",
12
+ ...usesDefaultSource ? {
13
+ integrity: "sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=",
14
+ crossorigin: "anonymous"
15
+ } : {}
16
+ },
17
+ clientInit: injectStyles ? ensureLeafletStyles : void 0,
18
+ schema: import.meta.dev ? LeafletOptions : void 0,
19
+ scriptOptions: {
20
+ use() {
21
+ const leaflet = window.L;
22
+ if (injectStyles && leaflet)
23
+ configureLeafletDefaultIcons(leaflet);
24
+ return { L: leaflet };
25
+ }
26
+ }
27
+ };
28
+ }, _options);
29
+ }
@@ -0,0 +1,13 @@
1
+ import type * as MapLibre from 'maplibre-gl';
2
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
3
+ import { MapLibreOptions } from './schemas.js';
4
+ export { MapLibreOptions };
5
+ export type MapLibreInput = RegistryScriptInput<typeof MapLibreOptions>;
6
+ export interface MapLibreApi {
7
+ maplibregl: typeof MapLibre;
8
+ }
9
+ declare global {
10
+ interface Window extends MapLibreApi {
11
+ }
12
+ }
13
+ export declare function useScriptMapLibre<T extends MapLibreApi>(_options?: MapLibreInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -0,0 +1,29 @@
1
+ import { configureMapLibreWorker, ensureMapLibreStyles, MAPLIBRE_STYLESHEET_URL } from "../maplibre-styles.js";
2
+ import { useRegistryScript } from "../utils.js";
3
+ import { MapLibreOptions } from "./schemas.js";
4
+ export { MapLibreOptions };
5
+ export function useScriptMapLibre(_options) {
6
+ return useRegistryScript("maplibre", (options, context) => {
7
+ const injectStyles = options?.injectStyles !== false;
8
+ const stylesheetUrl = options?.stylesheetUrl || MAPLIBRE_STYLESHEET_URL;
9
+ const usesDefaultSource = !context.scriptInput?.src;
10
+ return {
11
+ scriptInput: {
12
+ src: "https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.js",
13
+ ...usesDefaultSource ? {
14
+ integrity: "sha384-5+cfbwT0iiub6VsQAdn6yz16nr6sDiQoHx6tm4O8OVYXHYOxcffFmCJBL0dgdvGp",
15
+ crossorigin: "anonymous"
16
+ } : {}
17
+ },
18
+ clientInit: injectStyles ? () => ensureMapLibreStyles(stylesheetUrl) : void 0,
19
+ schema: import.meta.dev ? MapLibreOptions : void 0,
20
+ scriptOptions: {
21
+ use() {
22
+ const maplibregl = window.maplibregl;
23
+ configureMapLibreWorker(maplibregl, options?.workerUrl);
24
+ return { maplibregl };
25
+ }
26
+ }
27
+ };
28
+ }, _options);
29
+ }
@@ -48,14 +48,7 @@ export function useScriptMatomoAnalytics(_options) {
48
48
  _paq.push(["setTrackerUrl", withBase(`/matomo.php`, withHttps(normalizedCloudId))]);
49
49
  }
50
50
  _paq.push(["setSiteId", String(options?.siteId) || "1"]);
51
- if (options?.trackPageView !== void 0) {
52
- if (import.meta.dev) {
53
- logger.warn("The `trackPageView` option is deprecated. Use `watch: true` (default) for automatic page view tracking, or remove this option entirely.");
54
- }
55
- if (options.trackPageView) {
56
- _paq.push(["trackPageView"]);
57
- }
58
- } else if (options?.watch !== false) {
51
+ if (options?.watch !== false) {
59
52
  useScriptEventPage((payload) => {
60
53
  window._paq.push(["setDocumentTitle", payload.title]);
61
54
  window._paq.push(["setCustomUrl", payload.path]);
@@ -1,8 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
2
  declare const PlausibleAnalyticsOptionsSchema: import("valibot").ObjectSchema<{
3
- readonly scriptId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
4
- readonly domain: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
5
- readonly extension: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", undefined> | import("valibot").LiteralSchema<"outbound-links", undefined> | import("valibot").LiteralSchema<"file-downloads", undefined> | import("valibot").LiteralSchema<"tagged-events", undefined> | import("valibot").LiteralSchema<"revenue", undefined> | import("valibot").LiteralSchema<"pageview-props", undefined> | import("valibot").LiteralSchema<"compat", undefined> | import("valibot").LiteralSchema<"local", undefined> | import("valibot").LiteralSchema<"manual", undefined>)[], undefined>, import("valibot").ArraySchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", undefined> | import("valibot").LiteralSchema<"outbound-links", undefined> | import("valibot").LiteralSchema<"file-downloads", undefined> | import("valibot").LiteralSchema<"tagged-events", undefined> | import("valibot").LiteralSchema<"revenue", undefined> | import("valibot").LiteralSchema<"pageview-props", undefined> | import("valibot").LiteralSchema<"compat", undefined> | import("valibot").LiteralSchema<"local", undefined> | import("valibot").LiteralSchema<"manual", undefined>)[], undefined>, undefined>], undefined>, undefined>;
3
+ readonly scriptId: import("valibot").StringSchema<undefined>;
6
4
  readonly customProperties: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").AnySchema, undefined>, undefined>;
7
5
  readonly endpoint: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
8
6
  readonly fileDownloads: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
@@ -19,7 +17,7 @@ declare const PlausibleAnalyticsOptionsSchema: import("valibot").ObjectSchema<{
19
17
  */
20
18
  export interface PlausibleAnalyticsOptions {
21
19
  /**
22
- * Unique script ID for your site (recommended - new format as of October 2025)
20
+ * Unique script ID for your site.
23
21
  * Get this from your Plausible dashboard under Site Installation
24
22
  *
25
23
  * Extract it from your Plausible script URL:
@@ -30,18 +28,7 @@ export interface PlausibleAnalyticsOptions {
30
28
  * ```
31
29
  * @example 'gYyxvZhkMzdzXBAtSeSNz'
32
30
  */
33
- scriptId?: string;
34
- /**
35
- * Your site domain
36
- * @deprecated Use `scriptId` instead (new October 2025 format)
37
- * @example 'example.com'
38
- */
39
- domain?: string;
40
- /**
41
- * Script extensions for additional features
42
- * @deprecated Use init options like `hashBasedRouting`, `captureOnLocalhost`, etc. instead (new October 2025 format)
43
- */
44
- extension?: 'hash' | 'outbound-links' | 'file-downloads' | 'tagged-events' | 'revenue' | 'pageview-props' | 'compat' | 'local' | 'manual' | Array<'hash' | 'outbound-links' | 'file-downloads' | 'tagged-events' | 'revenue' | 'pageview-props' | 'compat' | 'local' | 'manual'>;
31
+ scriptId: string;
45
32
  /** Custom properties to track with every pageview */
46
33
  customProperties?: Record<string, any>;
47
34
  /** Custom tracking endpoint URL */
@@ -74,6 +61,7 @@ export interface PlausibleInitOptions {
74
61
  hashBasedRouting?: boolean;
75
62
  autoCapturePageviews?: boolean;
76
63
  captureOnLocalhost?: boolean;
64
+ trackForms?: boolean;
77
65
  }
78
66
  export type PlausibleFunction = ((event: '404', options: Record<string, any>) => void) & ((event: 'event', options: Record<string, any>) => void) & ((...params: any[]) => void) & {
79
67
  q: any[];
@@ -1,25 +1,7 @@
1
- import { any, array, boolean, literal, object, optional, record, string, union } from "valibot";
2
- import { logger } from "../logger.js";
1
+ import { any, array, boolean, object, optional, record, string } from "valibot";
3
2
  import { useRegistryScript } from "../utils.js";
4
- const extensions = [
5
- literal("hash"),
6
- literal("outbound-links"),
7
- literal("file-downloads"),
8
- literal("tagged-events"),
9
- literal("revenue"),
10
- literal("pageview-props"),
11
- literal("compat"),
12
- literal("local"),
13
- literal("manual")
14
- ];
15
3
  const PlausibleAnalyticsOptionsSchema = object({
16
- // New October 2025: unique script ID per site (replaces domain)
17
- scriptId: optional(string()),
18
- // Legacy: domain-based approach (deprecated)
19
- domain: optional(string()),
20
- // Legacy extension support (deprecated)
21
- extension: optional(union([union(extensions), array(union(extensions))])),
22
- // New October 2025 init options
4
+ scriptId: string(),
23
5
  customProperties: optional(record(string(), any())),
24
6
  endpoint: optional(string()),
25
7
  fileDownloads: optional(object({
@@ -32,28 +14,6 @@ const PlausibleAnalyticsOptionsSchema = object({
32
14
  });
33
15
  export function useScriptPlausibleAnalytics(_options) {
34
16
  return useRegistryScript("plausibleAnalytics", (options) => {
35
- const useNewScript = !!options?.scriptId;
36
- const useLegacyScript = !!options?.extension;
37
- if (import.meta.dev) {
38
- if (!useNewScript && !options?.domain) {
39
- logger.warn("Plausible Analytics: No `scriptId` or `domain` provided. Please provide either `scriptId` or `domain` (legacy).");
40
- }
41
- if (useNewScript && options?.domain) {
42
- logger.warn("Plausible Analytics: You are using both `scriptId` (new format) and `domain` (deprecated). Please use only `scriptId` for the new format.");
43
- }
44
- if (useNewScript && useLegacyScript) {
45
- logger.warn("Plausible Analytics: You are using both `scriptId` (new format) and `extension` (deprecated). Please use `scriptId` with init options like `hashBasedRouting`, `captureOnLocalhost`, etc. instead.");
46
- }
47
- }
48
- let scriptSrc;
49
- if (useNewScript) {
50
- scriptSrc = `https://plausible.io/js/pa-${options.scriptId}.js`;
51
- } else if (useLegacyScript) {
52
- const extensions2 = Array.isArray(options.extension) ? options.extension.join(".") : [options.extension];
53
- scriptSrc = `https://plausible.io/js/script.${extensions2}.js`;
54
- } else {
55
- scriptSrc = "https://plausible.io/js/script.js";
56
- }
57
17
  const initOptions = {};
58
18
  if (options?.customProperties)
59
19
  initOptions.customProperties = options.customProperties;
@@ -67,28 +27,25 @@ export function useScriptPlausibleAnalytics(_options) {
67
27
  initOptions.autoCapturePageviews = options.autoCapturePageviews;
68
28
  if (options?.captureOnLocalhost !== void 0)
69
29
  initOptions.captureOnLocalhost = options.captureOnLocalhost;
70
- const scriptInput = { src: scriptSrc };
71
- if (!useNewScript && options?.domain)
72
- scriptInput["data-domain"] = options.domain;
73
- if (!useNewScript && options?.endpoint)
74
- scriptInput["data-api"] = options.endpoint;
30
+ if (options?.trackForms !== void 0)
31
+ initOptions.trackForms = options.trackForms;
75
32
  return {
76
- scriptInput,
33
+ scriptInput: { src: `https://plausible.io/js/pa-${options?.scriptId}.js` },
77
34
  schema: import.meta.dev ? PlausibleAnalyticsOptionsSchema : void 0,
78
35
  scriptOptions: {
79
36
  use() {
80
37
  return { plausible: window.plausible };
81
- },
82
- clientInit: import.meta.server ? void 0 : () => {
83
- const w = window;
84
- w.plausible = w.plausible || function(...args) {
85
- (w.plausible.q = w.plausible.q || []).push(args);
86
- };
87
- w.plausible.init = w.plausible.init || function(i) {
88
- w.plausible.o = i || {};
89
- };
90
- w.plausible.init(initOptions);
91
38
  }
39
+ },
40
+ clientInit: import.meta.server ? void 0 : () => {
41
+ const w = window;
42
+ w.plausible = w.plausible || function(...args) {
43
+ (w.plausible.q = w.plausible.q || []).push(args);
44
+ };
45
+ w.plausible.init = w.plausible.init || function(i) {
46
+ w.plausible.o = i || {};
47
+ };
48
+ w.plausible.init(initOptions);
92
49
  }
93
50
  };
94
51
  }, _options);
@@ -27,10 +27,6 @@ export interface RybbitAnalyticsApi {
27
27
  * @returns The current user ID or null if not set
28
28
  */
29
29
  getUserId: () => string | null;
30
- /**
31
- * @deprecated use top level functions instead
32
- */
33
- rybbit: RybbitAnalyticsApi;
34
30
  }
35
31
  declare global {
36
32
  interface Window {
@@ -62,10 +62,7 @@ export function useScriptRybbitAnalytics(_options) {
62
62
  event: (name, properties) => callOrQueue("event", name, properties),
63
63
  identify: (userId) => callOrQueue("identify", userId),
64
64
  clearUserId: () => callOrQueue("clearUserId"),
65
- getUserId: () => window.rybbit?.getUserId?.() ?? null,
66
- get rybbit() {
67
- return window.rybbit;
68
- }
65
+ getUserId: () => window.rybbit?.getUserId?.() ?? null
69
66
  };
70
67
  }
71
68
  }