@nuxt/scripts 1.0.0-beta.6 → 1.0.0-rc.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 (256) hide show
  1. package/dist/devtools-client/200.html +1 -0
  2. package/dist/devtools-client/404.html +1 -0
  3. package/dist/devtools-client/_fonts/4ppnHhMi-pBsWSPo7mY0avYxlDoAg1N3PTzCwXLZ5rA-d9oibkGnTd1JL3tc_xnaVgBLYmOB8kjrK2cvZaqwj9s.woff2 +0 -0
  4. package/dist/devtools-client/_fonts/4qBuU9MRVUlPZNPSF7Xom_sK8RBEnfYu-9VXFrdq8A8-8TDwLE1HAj1sQn7XxVWtM_7sIaPM-DTdO3Pf8U2DF1U.woff2 +0 -0
  5. package/dist/devtools-client/_fonts/6dYsbWUd_BpKJ7mdDihgOcya1gHXLpJBuMYXux3WMjE-q3fYNS8YbW5n7ZeXI2vSNgkRWW5VDPKAl51SNTjG2qk.woff2 +0 -0
  6. package/dist/devtools-client/_fonts/Lr-hqqZZsYmCt0ITUlr1CUrWim9fsKvoDFZliMxgNHY-iTa_Yt_PzhOY9TX7ZXdSlEPim6iRt92xhECwaxWxd5w.woff2 +0 -0
  7. package/dist/devtools-client/_fonts/OknHvWI6KtYn1JQBzX7eSpNDBQ8520F9TvSUJYkVf6A-xeZn9253svK_8Q2LD0XEruY_MnEsuCRO5LenPoggC0Y.woff2 +0 -0
  8. package/dist/devtools-client/_fonts/PV2hrQG6wq5BlIPDjdL1IcOflycaghyt5MHzlBqZtlo-lb_WexLz3VZqfTN0oi554iBH5tT2j2UFEV-XErCAS3E.woff2 +0 -0
  9. package/dist/devtools-client/_fonts/UA7OtwYHwGN_HjcVGTdmiQxUit7FlqkCwxVUWSeXVnQ-B4OXCFOL_tWrYODpQTc07aMaj0c2cewTOmBRWR9tD-A.woff2 +0 -0
  10. package/dist/devtools-client/_fonts/VE4cDVCv5MxbFM7ZLoLCGbIpNd71zhp7MDI9lmN5Y7I-xZyDYCUVrd6LV8eVGF3Um3UZjBFuUtDGtvdyTBBRYBo.woff2 +0 -0
  11. package/dist/devtools-client/_fonts/fVoGbnMbBFd5L9BBp9fUPavUSkZ_EmsQNSyadkT-108-U4T0khaeLQSIhtt9eVvaCEKJjtWJ4ioRJOf8hvqkWY0.woff2 +0 -0
  12. package/dist/devtools-client/_fonts/lQAxeCEs1R0Lw-H9XRU1RlOARQN8J6npRsPjyEDMe5s-_DUSLEkO3tKTuun_gSnDLoQPVEnpOnyqZMOw0ByZ6PA.woff2 +0 -0
  13. package/dist/devtools-client/_fonts/lntlqNHKLV2n82yTwMde70QqOjcfLE2XJ5oKZ3vRPWc-z6TxpIZQdWXztWLr9_OFWqt_WJJoeGtuK_-XQMZGQwE.woff2 +0 -0
  14. package/dist/devtools-client/_fonts/qxAYvKsXWeYv731eb-h5TRurcdIP_W44mpNdX-HABAk-zUDeMEFlNtNbrwvT9JxLEBg0TphGy70O6RfIoIX_ZwU.woff2 +0 -0
  15. package/dist/devtools-client/_nuxt/B3kN3DAy.js +1 -0
  16. package/dist/devtools-client/_nuxt/B8PEiB0p.js +1 -0
  17. package/dist/devtools-client/_nuxt/C8jhSQ8l.js +1 -0
  18. package/dist/devtools-client/_nuxt/CJD6wrkT.js +188 -0
  19. package/dist/devtools-client/_nuxt/CfOsp0mU.js +1 -0
  20. package/dist/devtools-client/_nuxt/DKL6PHO3.js +1 -0
  21. package/dist/devtools-client/_nuxt/ajngqPCs.js +1 -0
  22. package/dist/devtools-client/_nuxt/builds/latest.json +1 -0
  23. package/dist/devtools-client/_nuxt/builds/meta/b800a0be-5cab-4ea6-89e3-dd3a85690a73.json +1 -0
  24. package/dist/devtools-client/_nuxt/dlaR8P-P.js +1 -0
  25. package/dist/devtools-client/_nuxt/entry.BwpOBArY.css +1 -0
  26. package/dist/devtools-client/_nuxt/error-404.CvOVjXeC.css +1 -0
  27. package/dist/devtools-client/_nuxt/error-500.BIm53nmx.css +1 -0
  28. package/dist/devtools-client/_nuxt/first-party.C8Ha4JLM.css +1 -0
  29. package/dist/devtools-client/_nuxt/index.CA-OpSj0.css +1 -0
  30. package/dist/devtools-client/_nuxt/registry.B9lnjF_b.css +1 -0
  31. package/dist/devtools-client/_nuxt/wDzz0qaB.js +1 -0
  32. package/dist/devtools-client/docs/index.html +1 -0
  33. package/dist/devtools-client/first-party/index.html +1 -0
  34. package/dist/devtools-client/index.html +1 -0
  35. package/dist/devtools-client/registry/index.html +1 -0
  36. package/dist/module.d.mts +29 -84
  37. package/dist/module.d.ts +121 -0
  38. package/dist/module.json +1 -1
  39. package/dist/module.mjs +941 -757
  40. package/dist/registry.d.mts +91 -4
  41. package/dist/registry.d.ts +93 -0
  42. package/dist/registry.mjs +669 -324
  43. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +15 -79
  44. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +78 -180
  45. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +15 -79
  46. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +6 -55
  47. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +12 -83
  48. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +6 -55
  49. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +5 -1
  50. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +24 -38
  51. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +5 -1
  52. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +43 -0
  53. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +60 -0
  54. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +43 -0
  55. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +4 -0
  56. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +22 -26
  57. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +4 -0
  58. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +9 -5
  59. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +56 -57
  60. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +9 -5
  61. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +24 -41
  62. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +69 -73
  63. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +24 -41
  64. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +36 -4
  65. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +82 -37
  66. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +36 -4
  67. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +78 -0
  68. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +222 -0
  69. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +78 -0
  70. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +10 -3
  71. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +9 -41
  72. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +10 -3
  73. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +7 -3
  74. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +23 -38
  75. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +7 -3
  76. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +7 -3
  77. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +23 -38
  78. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +7 -3
  79. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +7 -3
  80. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +24 -38
  81. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +7 -3
  82. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +200 -0
  83. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +165 -0
  84. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +200 -0
  85. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
  86. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
  87. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +10 -0
  88. package/dist/runtime/components/GoogleMaps/injectionKeys.js +2 -0
  89. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +48 -0
  90. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +51 -0
  91. package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +85 -0
  92. package/dist/runtime/components/ScriptBlueskyEmbed.vue +88 -0
  93. package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +85 -0
  94. package/dist/runtime/components/ScriptCrisp.vue +1 -1
  95. package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
  96. package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
  97. package/dist/runtime/components/ScriptGravatar.vue +46 -0
  98. package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
  99. package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +1 -2
  100. package/dist/runtime/components/ScriptInstagramEmbed.vue +8 -3
  101. package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +1 -2
  102. package/dist/runtime/components/ScriptIntercom.vue +4 -3
  103. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
  104. package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
  105. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
  106. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
  107. package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
  108. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
  109. package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
  110. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
  111. package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
  112. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
  113. package/dist/runtime/components/ScriptXEmbed.d.vue.ts +0 -2
  114. package/dist/runtime/components/ScriptXEmbed.vue +14 -8
  115. package/dist/runtime/components/ScriptXEmbed.vue.d.ts +0 -2
  116. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
  117. package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
  118. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
  119. package/dist/runtime/composables/useScript.js +148 -8
  120. package/dist/runtime/composables/useScriptEventPage.js +2 -2
  121. package/dist/runtime/composables/useScriptTriggerConsent.d.ts +10 -0
  122. package/dist/runtime/composables/useScriptTriggerConsent.js +33 -20
  123. package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
  124. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
  125. package/dist/runtime/devtools-standalone-bridge.client.d.ts +8 -0
  126. package/dist/runtime/devtools-standalone-bridge.client.js +50 -0
  127. package/dist/runtime/registry/bing-uet.d.ts +20 -0
  128. package/dist/runtime/registry/bing-uet.js +29 -0
  129. package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
  130. package/dist/runtime/registry/bluesky-embed.js +72 -0
  131. package/dist/runtime/registry/clarity.d.ts +10 -15
  132. package/dist/runtime/registry/clarity.js +22 -31
  133. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
  134. package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
  135. package/dist/runtime/registry/crisp.d.ts +10 -40
  136. package/dist/runtime/registry/crisp.js +2 -33
  137. package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
  138. package/dist/runtime/registry/databuddy-analytics.js +20 -45
  139. package/dist/runtime/registry/fathom-analytics.d.ts +7 -26
  140. package/dist/runtime/registry/fathom-analytics.js +3 -25
  141. package/dist/runtime/registry/google-adsense.d.ts +3 -11
  142. package/dist/runtime/registry/google-adsense.js +2 -11
  143. package/dist/runtime/registry/google-analytics.d.ts +3 -5
  144. package/dist/runtime/registry/google-analytics.js +3 -8
  145. package/dist/runtime/registry/google-maps.d.ts +3 -9
  146. package/dist/runtime/registry/google-maps.js +2 -8
  147. package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
  148. package/dist/runtime/registry/google-recaptcha.js +4 -12
  149. package/dist/runtime/registry/google-sign-in.d.ts +2 -13
  150. package/dist/runtime/registry/google-sign-in.js +2 -22
  151. package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
  152. package/dist/runtime/registry/google-tag-manager.js +4 -27
  153. package/dist/runtime/registry/gravatar.d.ts +26 -0
  154. package/dist/runtime/registry/gravatar.js +36 -0
  155. package/dist/runtime/registry/hotjar.d.ts +4 -6
  156. package/dist/runtime/registry/hotjar.js +2 -5
  157. package/dist/runtime/registry/instagram-embed.d.ts +3 -18
  158. package/dist/runtime/registry/instagram-embed.js +4 -19
  159. package/dist/runtime/registry/intercom.d.ts +5 -13
  160. package/dist/runtime/registry/intercom.js +2 -12
  161. package/dist/runtime/registry/matomo-analytics.d.ts +3 -12
  162. package/dist/runtime/registry/matomo-analytics.js +3 -12
  163. package/dist/runtime/registry/meta-pixel.d.ts +4 -6
  164. package/dist/runtime/registry/meta-pixel.js +2 -4
  165. package/dist/runtime/registry/mixpanel-analytics.d.ts +22 -0
  166. package/dist/runtime/registry/mixpanel-analytics.js +46 -0
  167. package/dist/runtime/registry/npm.d.ts +3 -7
  168. package/dist/runtime/registry/npm.js +2 -9
  169. package/dist/runtime/registry/paypal.d.ts +4 -25
  170. package/dist/runtime/registry/paypal.js +3 -66
  171. package/dist/runtime/registry/plausible-analytics.js +19 -14
  172. package/dist/runtime/registry/posthog.d.ts +10 -12
  173. package/dist/runtime/registry/posthog.js +4 -13
  174. package/dist/runtime/registry/reddit-pixel.d.ts +5 -6
  175. package/dist/runtime/registry/reddit-pixel.js +2 -4
  176. package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
  177. package/dist/runtime/registry/rybbit-analytics.js +10 -20
  178. package/dist/runtime/registry/schemas.d.ts +982 -0
  179. package/dist/runtime/registry/schemas.js +937 -0
  180. package/dist/runtime/registry/segment.d.ts +2 -5
  181. package/dist/runtime/registry/segment.js +2 -5
  182. package/dist/runtime/registry/snapchat-pixel.d.ts +5 -34
  183. package/dist/runtime/registry/snapchat-pixel.js +2 -20
  184. package/dist/runtime/registry/stripe.d.ts +3 -4
  185. package/dist/runtime/registry/stripe.js +2 -4
  186. package/dist/runtime/registry/tiktok-pixel.d.ts +4 -7
  187. package/dist/runtime/registry/tiktok-pixel.js +2 -6
  188. package/dist/runtime/registry/umami-analytics.d.ts +2 -31
  189. package/dist/runtime/registry/umami-analytics.js +2 -36
  190. package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
  191. package/dist/runtime/registry/vercel-analytics.js +84 -0
  192. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  193. package/dist/runtime/registry/vimeo-player.js +1 -1
  194. package/dist/runtime/registry/x-embed.d.ts +3 -17
  195. package/dist/runtime/registry/x-embed.js +3 -18
  196. package/dist/runtime/registry/x-pixel.d.ts +4 -7
  197. package/dist/runtime/registry/x-pixel.js +2 -5
  198. package/dist/runtime/registry/youtube-player.d.ts +7 -7
  199. package/dist/runtime/registry/youtube-player.js +1 -1
  200. package/dist/runtime/server/bluesky-embed-image.d.ts +2 -0
  201. package/dist/runtime/server/bluesky-embed-image.js +7 -0
  202. package/dist/runtime/server/bluesky-embed.d.ts +16 -0
  203. package/dist/runtime/server/bluesky-embed.js +59 -0
  204. package/dist/runtime/server/google-maps-geocode-proxy.d.ts +2 -0
  205. package/dist/runtime/server/google-maps-geocode-proxy.js +34 -0
  206. package/dist/runtime/server/google-static-maps-proxy.js +2 -13
  207. package/dist/runtime/server/gravatar-proxy.d.ts +2 -0
  208. package/dist/runtime/server/gravatar-proxy.js +46 -0
  209. package/dist/runtime/server/instagram-embed-asset.js +8 -41
  210. package/dist/runtime/server/instagram-embed-image.js +6 -53
  211. package/dist/runtime/server/instagram-embed.d.ts +16 -0
  212. package/dist/runtime/server/instagram-embed.js +176 -35
  213. package/dist/runtime/server/proxy-handler.js +142 -95
  214. package/dist/runtime/server/utils/image-proxy.d.ts +12 -0
  215. package/dist/runtime/server/utils/image-proxy.js +70 -0
  216. package/dist/runtime/server/utils/privacy.d.ts +1 -10
  217. package/dist/runtime/server/utils/privacy.js +60 -40
  218. package/dist/runtime/server/x-embed-image.js +5 -49
  219. package/dist/runtime/server/x-embed.js +3 -2
  220. package/dist/runtime/types.d.ts +272 -51
  221. package/dist/runtime/types.js +0 -2
  222. package/dist/runtime/utils/pure.d.ts +1 -1
  223. package/dist/runtime/utils.d.ts +6 -4
  224. package/dist/runtime/utils.js +31 -14
  225. package/dist/stats.d.mts +202 -0
  226. package/dist/stats.d.ts +202 -0
  227. package/dist/stats.mjs +3875 -0
  228. package/dist/types-source.d.mts +17 -0
  229. package/dist/types-source.d.ts +17 -0
  230. package/dist/types-source.mjs +3414 -0
  231. package/dist/types.d.mts +4 -2
  232. package/package.json +35 -61
  233. package/README.md +0 -86
  234. package/dist/client/200.html +0 -1
  235. package/dist/client/404.html +0 -1
  236. package/dist/client/_nuxt/BPQ3VLAy.js +0 -1
  237. package/dist/client/_nuxt/BpR-tlZc.js +0 -1
  238. package/dist/client/_nuxt/CBbMDhE2.js +0 -162
  239. package/dist/client/_nuxt/CEMAW3aB.js +0 -1
  240. package/dist/client/_nuxt/MWkREqzj.js +0 -1
  241. package/dist/client/_nuxt/builds/latest.json +0 -1
  242. package/dist/client/_nuxt/builds/meta/762d443a-0880-424f-bda8-2b32b39d43ec.json +0 -1
  243. package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
  244. package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
  245. package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
  246. package/dist/client/index.html +0 -1
  247. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
  248. package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
  249. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
  250. package/dist/runtime/validation/mock.d.ts +0 -42
  251. package/dist/runtime/validation/mock.js +0 -21
  252. package/dist/runtime/validation/valibot.d.ts +0 -1
  253. package/dist/runtime/validation/valibot.js +0 -1
  254. /package/dist/{client → devtools-client}/_nuxt/CVO1_9PV.js +0 -0
  255. /package/dist/{client → devtools-client}/_nuxt/Cp-IABpG.js +0 -0
  256. /package/dist/{client → devtools-client}/_nuxt/D0r3Knsf.js +0 -0
@@ -1,8 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
- export declare const SegmentOptions: import("valibot").ObjectSchema<{
3
- readonly writeKey: import("valibot").StringSchema<undefined>;
4
- readonly analyticsKey: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
5
- }, undefined>;
2
+ import { SegmentOptions } from './schemas.js';
3
+ export { SegmentOptions };
6
4
  export type SegmentInput = RegistryScriptInput<typeof SegmentOptions>;
7
5
  interface AnalyticsApi {
8
6
  track: (event: string, properties?: Record<string, any>) => void;
@@ -30,4 +28,3 @@ declare global {
30
28
  }
31
29
  }
32
30
  export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): import("#nuxt-scripts/types").UseScriptContext<T>;
33
- export {};
@@ -1,10 +1,7 @@
1
1
  import { joinURL } from "ufo";
2
2
  import { useRegistryScript } from "../utils.js";
3
- import { object, optional, string } from "#nuxt-scripts-validator";
4
- export const SegmentOptions = object({
5
- writeKey: string(),
6
- analyticsKey: optional(string())
7
- });
3
+ import { SegmentOptions } from "./schemas.js";
4
+ export { SegmentOptions };
8
5
  const methods = ["track", "page", "identify", "group", "alias", "reset"];
9
6
  export function useScriptSegment(_options) {
10
7
  return useRegistryScript("segment", (options) => {
@@ -1,5 +1,7 @@
1
- import type { InferInput } from '#nuxt-scripts-validator';
2
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import type { InferInput } from 'valibot';
3
+ import { InitObjectPropertiesSchema, SnapTrPixelOptions } from './schemas.js';
4
+ export { InitObjectPropertiesSchema, SnapTrPixelOptions };
3
5
  type StandardEvents = 'PAGE_VIEW' | 'VIEW_CONTENT' | 'ADD_CART' | 'SIGN_UP' | 'SAVE' | 'START_CHECKOUT' | 'APP_OPEN' | 'ADD_BILLING' | 'SEARCH' | 'SUBSCRIBE' | 'AD_CLICK' | 'AD_VIEW' | 'COMPLETE_TUTORIAL' | 'LEVEL_COMPLETE' | 'INVITE' | 'LOGIN' | 'SHARE' | 'RESERVE' | 'ACHIEVEMENT_UNLOCKED' | 'ADD_TO_WISHLIST' | 'SPENT_CREDITS' | 'RATE' | 'START_TRIAL' | 'LIST_VIEW';
4
6
  interface EventObjectProperties {
5
7
  price?: number;
@@ -20,22 +22,8 @@ interface EventObjectProperties {
20
22
  event_tag?: string;
21
23
  [key: string]: any;
22
24
  }
23
- export declare const InitObjectPropertiesSchema: import("valibot").ObjectSchema<{
24
- readonly user_email: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
25
- readonly ip_address: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
26
- readonly user_phone_number: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
27
- readonly user_hashed_email: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
28
- readonly user_hashed_phone_number: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
29
- readonly firstname: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
30
- readonly lastname: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
31
- readonly geo_city: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
32
- readonly geo_region: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
33
- readonly geo_postal_code: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
34
- readonly geo_country: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
35
- readonly age: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
36
- }, undefined>;
37
25
  type InitObjectProperties = InferInput<typeof InitObjectPropertiesSchema>;
38
- type SnapTrFns = ((event: 'track', eventName: StandardEvents | '', data?: EventObjectProperties) => void) & ((event: 'init', id: string, data?: Record<string, any>) => void) & ((event: 'init', id: string, data?: InitObjectProperties) => void) & ((event: string, ...params: any[]) => void);
26
+ type SnapTrFns = ((event: 'track', eventName: StandardEvents | (string & {}), data?: EventObjectProperties) => void) & ((event: 'init', id: string, data?: Record<string, any>) => void) & ((event: 'init', id: string, data?: InitObjectProperties) => void) & ((event: (string & {}), ...params: any[]) => void);
39
27
  export interface SnapPixelApi {
40
28
  snaptr: SnapTrFns & {
41
29
  push: SnapTrFns;
@@ -50,22 +38,5 @@ declare global {
50
38
  interface Window extends SnapPixelApi {
51
39
  }
52
40
  }
53
- export declare const SnapTrPixelOptions: import("valibot").ObjectSchema<{
54
- readonly user_email: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
55
- readonly ip_address: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
56
- readonly user_phone_number: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
57
- readonly user_hashed_email: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
58
- readonly user_hashed_phone_number: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
59
- readonly firstname: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
60
- readonly lastname: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
61
- readonly geo_city: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
62
- readonly geo_region: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
63
- readonly geo_postal_code: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
64
- readonly geo_country: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
65
- readonly age: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
66
- readonly id: import("valibot").StringSchema<undefined>;
67
- readonly trackPageView: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
68
- }, undefined>;
69
- export type SnapTrPixelInput = RegistryScriptInput<typeof SnapTrPixelOptions, true, false, false>;
41
+ export type SnapTrPixelInput = RegistryScriptInput<typeof SnapTrPixelOptions, true, false>;
70
42
  export declare function useScriptSnapchatPixel<T extends SnapPixelApi>(_options?: SnapTrPixelInput): import("#nuxt-scripts/types").UseScriptContext<T>;
71
- export {};
@@ -1,24 +1,6 @@
1
1
  import { useRegistryScript } from "../utils.js";
2
- import { boolean, object, optional, string } from "#nuxt-scripts-validator";
3
- export const InitObjectPropertiesSchema = object({
4
- user_email: optional(string()),
5
- ip_address: optional(string()),
6
- user_phone_number: optional(string()),
7
- user_hashed_email: optional(string()),
8
- user_hashed_phone_number: optional(string()),
9
- firstname: optional(string()),
10
- lastname: optional(string()),
11
- geo_city: optional(string()),
12
- geo_region: optional(string()),
13
- geo_postal_code: optional(string()),
14
- geo_country: optional(string()),
15
- age: optional(string())
16
- });
17
- export const SnapTrPixelOptions = object({
18
- id: string(),
19
- trackPageView: optional(boolean()),
20
- ...InitObjectPropertiesSchema?.entries || {}
21
- });
2
+ import { InitObjectPropertiesSchema, SnapTrPixelOptions } from "./schemas.js";
3
+ export { InitObjectPropertiesSchema, SnapTrPixelOptions };
22
4
  export function useScriptSnapchatPixel(_options) {
23
5
  return useRegistryScript("snapchatPixel", (options) => ({
24
6
  scriptInput: {
@@ -1,8 +1,7 @@
1
- import type { StripeConstructor } from '@stripe/stripe-js';
2
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
3
- export declare const StripeOptions: import("valibot").ObjectSchema<{
4
- readonly advancedFraudSignals: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
5
- }, undefined>;
2
+ import type { StripeConstructor } from '@stripe/stripe-js';
3
+ import { StripeOptions } from './schemas.js';
4
+ export { StripeOptions };
6
5
  export type StripeInput = RegistryScriptInput<typeof StripeOptions, false>;
7
6
  export interface StripeApi {
8
7
  Stripe: StripeConstructor;
@@ -1,9 +1,7 @@
1
1
  import { withQuery } from "ufo";
2
2
  import { useRegistryScript } from "../utils.js";
3
- import { boolean, object, optional } from "#nuxt-scripts-validator";
4
- export const StripeOptions = object({
5
- advancedFraudSignals: optional(boolean())
6
- });
3
+ import { StripeOptions } from "./schemas.js";
4
+ export { StripeOptions };
7
5
  export function useScriptStripe(_options) {
8
6
  return useRegistryScript("stripe", (options) => ({
9
7
  scriptInput: {
@@ -1,4 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import { TikTokPixelOptions } from './schemas.js';
2
3
  type StandardEvents = 'ViewContent' | 'ClickButton' | 'Search' | 'AddToWishlist' | 'AddToCart' | 'InitiateCheckout' | 'AddPaymentInfo' | 'CompletePayment' | 'PlaceAnOrder' | 'Contact' | 'Download' | 'SubmitForm' | 'CompleteRegistration' | 'Subscribe';
3
4
  interface EventProperties {
4
5
  content_id?: string;
@@ -22,7 +23,7 @@ interface IdentifyProperties {
22
23
  phone_number?: string;
23
24
  external_id?: string;
24
25
  }
25
- type TtqFns = ((cmd: 'track', event: StandardEvents | string, properties?: EventProperties) => void) & ((cmd: 'page') => void) & ((cmd: 'identify', properties: IdentifyProperties) => void) & ((cmd: string, ...args: any[]) => void);
26
+ type TtqFns = ((cmd: 'track', event: StandardEvents | (string & {}), properties?: EventProperties) => void) & ((cmd: 'page') => void) & ((cmd: 'identify', properties: IdentifyProperties) => void) & ((cmd: (string & {}), ...args: any[]) => void);
26
27
  export interface TikTokPixelApi {
27
28
  ttq: TtqFns & {
28
29
  push: TtqFns;
@@ -35,10 +36,6 @@ declare global {
35
36
  TiktokAnalyticsObject: string;
36
37
  }
37
38
  }
38
- export declare const TikTokPixelOptions: import("valibot").ObjectSchema<{
39
- readonly id: import("valibot").StringSchema<undefined>;
40
- readonly trackPageView: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
41
- }, undefined>;
42
- export type TikTokPixelInput = RegistryScriptInput<typeof TikTokPixelOptions, true, false, false>;
39
+ export { TikTokPixelOptions };
40
+ export type TikTokPixelInput = RegistryScriptInput<typeof TikTokPixelOptions, true, false>;
43
41
  export declare function useScriptTikTokPixel<T extends TikTokPixelApi>(_options?: TikTokPixelInput): import("#nuxt-scripts/types").UseScriptContext<T>;
44
- export {};
@@ -1,11 +1,7 @@
1
1
  import { withQuery } from "ufo";
2
2
  import { useRegistryScript } from "../utils.js";
3
- import { object, string, optional, boolean } from "#nuxt-scripts-validator";
4
- export const TikTokPixelOptions = object({
5
- id: string(),
6
- trackPageView: optional(boolean())
7
- // default true
8
- });
3
+ import { TikTokPixelOptions } from "./schemas.js";
4
+ export { TikTokPixelOptions };
9
5
  export function useScriptTikTokPixel(_options) {
10
6
  return useRegistryScript("tiktokPixel", (options) => ({
11
7
  scriptInput: {
@@ -1,35 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
- export declare const UmamiAnalyticsOptions: import("valibot").ObjectSchema<{
3
- readonly websiteId: import("valibot").StringSchema<undefined>;
4
- /**
5
- * By default, Umami will send data to wherever the script is located.
6
- * You can override this to send data to another location.
7
- */
8
- readonly hostUrl: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
9
- /**
10
- * By default, Umami tracks all pageviews and events for you automatically.
11
- * You can disable this behavior and track events yourself using the tracker functions.
12
- * https://umami.is/docs/tracker-functions
13
- */
14
- readonly autoTrack: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
15
- /**
16
- * If you want the tracker to only run on specific domains, you can add them to your tracker script.
17
- * This is a comma delimited list of domain names.
18
- * Helps if you are working in a staging/development environment.
19
- */
20
- readonly domains: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
21
- /**
22
- * If you want the tracker to collect events under a specific tag.
23
- * Events can be filtered in the dashboard by a specific tag.
24
- */
25
- readonly tag: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
26
- /**
27
- * Function that will be called before data is sent to Umami.
28
- * The function takes two parameters: type and payload.
29
- * Return the payload to continue sending, or return a falsy value to cancel.
30
- */
31
- readonly beforeSend: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").CustomSchema<(type: string, payload: Record<string, any>) => Record<string, any> | null | false, undefined>, import("valibot").StringSchema<undefined>], undefined>, undefined>;
32
- }, undefined>;
2
+ import { UmamiAnalyticsOptions } from './schemas.js';
3
+ export { UmamiAnalyticsOptions };
33
4
  export type UmamiAnalyticsInput = RegistryScriptInput<typeof UmamiAnalyticsOptions, false>;
34
5
  export interface UmamiAnalyticsApi {
35
6
  track: ((payload?: Record<string, any>) => void) & ((event_name: string, event_data: Record<string, any>) => void);
@@ -1,40 +1,6 @@
1
1
  import { useRegistryScript } from "../utils.js";
2
- import { object, optional, string, boolean, array, union, custom } from "#nuxt-scripts-validator";
3
- export const UmamiAnalyticsOptions = object({
4
- websiteId: string(),
5
- // required
6
- /**
7
- * By default, Umami will send data to wherever the script is located.
8
- * You can override this to send data to another location.
9
- */
10
- hostUrl: optional(string()),
11
- /**
12
- * By default, Umami tracks all pageviews and events for you automatically.
13
- * You can disable this behavior and track events yourself using the tracker functions.
14
- * https://umami.is/docs/tracker-functions
15
- */
16
- autoTrack: optional(boolean()),
17
- /**
18
- * If you want the tracker to only run on specific domains, you can add them to your tracker script.
19
- * This is a comma delimited list of domain names.
20
- * Helps if you are working in a staging/development environment.
21
- */
22
- domains: optional(array(string())),
23
- /**
24
- * If you want the tracker to collect events under a specific tag.
25
- * Events can be filtered in the dashboard by a specific tag.
26
- */
27
- tag: optional(string()),
28
- /**
29
- * Function that will be called before data is sent to Umami.
30
- * The function takes two parameters: type and payload.
31
- * Return the payload to continue sending, or return a falsy value to cancel.
32
- */
33
- beforeSend: optional(union([
34
- custom((input) => typeof input === "function"),
35
- string()
36
- ]))
37
- });
2
+ import { UmamiAnalyticsOptions } from "./schemas.js";
3
+ export { UmamiAnalyticsOptions };
38
4
  export function useScriptUmamiAnalytics(_options) {
39
5
  return useRegistryScript("umamiAnalytics", (options) => {
40
6
  const domains = Array.isArray(options?.domains) ? options.domains.join(",") : options?.domains;
@@ -0,0 +1,29 @@
1
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import { VercelAnalyticsOptions } from './schemas.js';
3
+ export { VercelAnalyticsOptions };
4
+ export type AllowedPropertyValues = string | number | boolean | null;
5
+ export type VercelAnalyticsMode = 'auto' | 'development' | 'production';
6
+ export interface BeforeSendEvent {
7
+ type: 'pageview' | 'event';
8
+ url: string;
9
+ }
10
+ export type BeforeSend = (event: BeforeSendEvent) => BeforeSendEvent | null;
11
+ export type VercelAnalyticsInput = RegistryScriptInput<typeof VercelAnalyticsOptions, false, false> & {
12
+ beforeSend?: BeforeSend;
13
+ };
14
+ export interface VercelAnalyticsApi {
15
+ va: (event: string, properties?: unknown) => void;
16
+ track: (name: string, properties?: Record<string, AllowedPropertyValues>) => void;
17
+ pageview: (options?: {
18
+ route?: string | null;
19
+ path?: string;
20
+ }) => void;
21
+ }
22
+ declare global {
23
+ interface Window {
24
+ va?: (event: string, properties?: unknown) => void;
25
+ vaq?: [string, unknown?][];
26
+ vam?: VercelAnalyticsMode;
27
+ }
28
+ }
29
+ export declare function useScriptVercelAnalytics<T extends VercelAnalyticsApi>(_options?: VercelAnalyticsInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -0,0 +1,84 @@
1
+ import { useRegistryScript } from "../utils.js";
2
+ import { VercelAnalyticsOptions } from "./schemas.js";
3
+ export { VercelAnalyticsOptions };
4
+ function parseProperties(properties, options) {
5
+ let props = properties;
6
+ const errorProperties = [];
7
+ for (const [key, value] of Object.entries(properties)) {
8
+ if (typeof value === "object" && value !== null) {
9
+ if (options.strip) {
10
+ const { [key]: _, ...rest } = props;
11
+ props = rest;
12
+ } else {
13
+ errorProperties.push(key);
14
+ }
15
+ }
16
+ }
17
+ if (errorProperties.length > 0 && !options.strip) {
18
+ throw new Error(
19
+ `The following properties are not valid: ${errorProperties.join(", ")}. Only strings, numbers, booleans, and null are allowed.`
20
+ );
21
+ }
22
+ return props;
23
+ }
24
+ export function useScriptVercelAnalytics(_options) {
25
+ const beforeSend = _options?.beforeSend;
26
+ return useRegistryScript("vercelAnalytics", (options) => {
27
+ const scriptInput = {
28
+ "src": import.meta.dev ? "https://va.vercel-scripts.com/v1/script.debug.js" : "https://va.vercel-scripts.com/v1/script.js",
29
+ "defer": true,
30
+ "data-sdkn": "@nuxt/scripts"
31
+ };
32
+ if (options?.dsn)
33
+ scriptInput["data-dsn"] = options.dsn;
34
+ if (options?.disableAutoTrack)
35
+ scriptInput["data-disable-auto-track"] = "1";
36
+ if (options?.endpoint)
37
+ scriptInput["data-endpoint"] = options.endpoint;
38
+ if (import.meta.dev && options?.debug === false)
39
+ scriptInput["data-debug"] = "false";
40
+ return {
41
+ scriptInput,
42
+ schema: import.meta.dev ? VercelAnalyticsOptions : void 0,
43
+ scriptOptions: {
44
+ // Load on client hydration for accurate web vitals
45
+ trigger: "client",
46
+ use: () => ({
47
+ va: (...args) => window.va?.(...args),
48
+ track(name, properties) {
49
+ if (!properties) {
50
+ window.va?.("event", { name });
51
+ return;
52
+ }
53
+ try {
54
+ const props = parseProperties(properties, { strip: !import.meta.dev });
55
+ window.va?.("event", { name, data: props });
56
+ } catch (err) {
57
+ if (err instanceof Error && import.meta.dev)
58
+ console.error(err);
59
+ }
60
+ },
61
+ pageview(opts) {
62
+ window.va?.("pageview", opts);
63
+ }
64
+ })
65
+ },
66
+ clientInit: import.meta.server ? void 0 : () => {
67
+ if (window.va)
68
+ return;
69
+ window.va = function(...params) {
70
+ ;
71
+ (window.vaq = window.vaq || []).push(params);
72
+ };
73
+ if (options?.mode === "auto" || !options?.mode) {
74
+ window.vam = import.meta.dev ? "development" : "production";
75
+ } else {
76
+ window.vam = options.mode;
77
+ }
78
+ if (beforeSend) {
79
+ window.va("beforeSend", beforeSend);
80
+ }
81
+ }
82
+ };
83
+ }, _options);
84
+ }
@@ -1,6 +1,6 @@
1
- import type Vimeo from '@vimeo/player';
2
- import type { UseScriptContext } from '@unhead/vue';
3
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import type { UseScriptContext } from '@unhead/vue';
3
+ import type Vimeo from '@vimeo/player';
4
4
  type Constructor<T extends new (...args: any) => any> = T extends new (...args: infer A) => infer R ? new (...args: A) => R : never;
5
5
  export interface VimeoPlayerApi {
6
6
  Vimeo: {
@@ -1,5 +1,5 @@
1
- import { watch } from "vue";
2
1
  import { useHead } from "@unhead/vue";
2
+ import { watch } from "vue";
3
3
  import { useRegistryScript } from "../utils.js";
4
4
  export function useScriptVimeoPlayer(_options) {
5
5
  const instance = useRegistryScript("vimeoPlayer", () => ({
@@ -1,4 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import { XEmbedOptions } from './schemas.js';
3
+ export { XEmbedOptions };
2
4
  export interface XEmbedTweetData {
3
5
  id_str: string;
4
6
  text: string;
@@ -46,23 +48,7 @@ export interface XEmbedTweetData {
46
48
  };
47
49
  };
48
50
  }
49
- export declare const XEmbedOptions: import("valibot").ObjectSchema<{
50
- /**
51
- * The tweet ID to embed
52
- */
53
- readonly tweetId: import("valibot").StringSchema<undefined>;
54
- /**
55
- * Optional: Custom API endpoint for fetching tweet data
56
- * @default '/api/_scripts/x-embed'
57
- */
58
- readonly apiEndpoint: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
59
- /**
60
- * Optional: Custom image proxy endpoint
61
- * @default '/api/_scripts/x-embed-image'
62
- */
63
- readonly imageProxyEndpoint: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
64
- }, undefined>;
65
- export type XEmbedInput = RegistryScriptInput<typeof XEmbedOptions, false, false, false>;
51
+ export type XEmbedInput = RegistryScriptInput<typeof XEmbedOptions, false, false>;
66
52
  /**
67
53
  * Proxy an X/Twitter image URL through the server
68
54
  */
@@ -1,21 +1,6 @@
1
- import { object, optional, string } from "#nuxt-scripts-validator";
2
- export const XEmbedOptions = object({
3
- /**
4
- * The tweet ID to embed
5
- */
6
- tweetId: string(),
7
- /**
8
- * Optional: Custom API endpoint for fetching tweet data
9
- * @default '/api/_scripts/x-embed'
10
- */
11
- apiEndpoint: optional(string()),
12
- /**
13
- * Optional: Custom image proxy endpoint
14
- * @default '/api/_scripts/x-embed-image'
15
- */
16
- imageProxyEndpoint: optional(string())
17
- });
18
- export function proxyXImageUrl(url, proxyEndpoint = "/api/_scripts/x-embed-image") {
1
+ import { XEmbedOptions } from "./schemas.js";
2
+ export { XEmbedOptions };
3
+ export function proxyXImageUrl(url, proxyEndpoint = "/_scripts/embed/x-image") {
19
4
  const separator = proxyEndpoint.includes("?") ? "&" : "?";
20
5
  return `${proxyEndpoint}${separator}url=${encodeURIComponent(url)}`;
21
6
  }
@@ -1,4 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ import { XPixelOptions } from './schemas.js';
2
3
  interface ContentProperties {
3
4
  content_type?: string | null;
4
5
  content_id?: string | number | null;
@@ -15,7 +16,7 @@ interface EventObjectProperties {
15
16
  phone_number?: string | null;
16
17
  contents: ContentProperties[];
17
18
  }
18
- type TwqFns = ((event: 'event', eventId: string, data?: EventObjectProperties) => void) & ((event: 'config', id: string) => void) & ((event: string, ...params: any[]) => void);
19
+ type TwqFns = ((event: 'event', eventId: string, data?: EventObjectProperties) => void) & ((event: 'config', id: string) => void) & ((event: (string & {}), ...params: any[]) => void);
19
20
  export interface XPixelApi {
20
21
  twq: TwqFns & {
21
22
  loaded: boolean;
@@ -27,10 +28,6 @@ declare global {
27
28
  interface Window extends XPixelApi {
28
29
  }
29
30
  }
30
- export declare const XPixelOptions: import("valibot").ObjectSchema<{
31
- readonly id: import("valibot").StringSchema<undefined>;
32
- readonly version: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
33
- }, undefined>;
34
- export type XPixelInput = RegistryScriptInput<typeof XPixelOptions, true, false, false>;
31
+ export { XPixelOptions };
32
+ export type XPixelInput = RegistryScriptInput<typeof XPixelOptions, true, false>;
35
33
  export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): import("#nuxt-scripts/types").UseScriptContext<T>;
36
- export {};
@@ -1,9 +1,6 @@
1
1
  import { useRegistryScript } from "../utils.js";
2
- import { object, optional, string } from "#nuxt-scripts-validator";
3
- export const XPixelOptions = object({
4
- id: string(),
5
- version: optional(string())
6
- });
2
+ import { XPixelOptions } from "./schemas.js";
3
+ export { XPixelOptions };
7
4
  export function useScriptXPixel(_options) {
8
5
  return useRegistryScript("xPixel", (options) => {
9
6
  return {
@@ -1,18 +1,18 @@
1
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
1
2
  import type { UseScriptContext } from '@unhead/vue';
2
3
  import type { MaybePromise } from '../utils.js';
3
- import type { RegistryScriptInput } from '#nuxt-scripts/types';
4
4
  export interface YouTubePlayerApi {
5
5
  YT: MaybePromise<{
6
6
  Player: YT.Player;
7
7
  PlayerState: YT.PlayerState;
8
- get(k: string): any;
8
+ get: (k: string) => any;
9
9
  loaded: 0 | 1;
10
10
  loading: 0 | 1;
11
- ready(f: () => void): void;
12
- scan(): void;
13
- setConfig(config: YT.PlayerOptions): void;
14
- subscribe<EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any): void;
15
- unsubscribe<EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any): void;
11
+ ready: (f: () => void) => void;
12
+ scan: () => void;
13
+ setConfig: (config: YT.PlayerOptions) => void;
14
+ subscribe: <EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any) => void;
15
+ unsubscribe: <EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any) => void;
16
16
  }>;
17
17
  }
18
18
  declare global {
@@ -1,5 +1,5 @@
1
- import { watch } from "vue";
2
1
  import { useHead } from "@unhead/vue";
2
+ import { watch } from "vue";
3
3
  import { useRegistryScript } from "../utils.js";
4
4
  export function useScriptYouTubePlayer(_options) {
5
5
  let readyPromise = Promise.resolve();
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { createImageProxyHandler } from "./utils/image-proxy.js";
2
+ export default createImageProxyHandler({
3
+ allowedDomains: [
4
+ "cdn.bsky.app",
5
+ "av-cdn.bsky.app"
6
+ ]
7
+ });
@@ -0,0 +1,16 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ uri: string;
3
+ cid: string;
4
+ author: Record<string, any>;
5
+ record: Record<string, any>;
6
+ embed?: Record<string, any>;
7
+ likeCount: number;
8
+ repostCount: number;
9
+ replyCount: number;
10
+ quoteCount: number;
11
+ indexedAt: string;
12
+ labels: Array<{
13
+ val: string;
14
+ }>;
15
+ }>>;
16
+ export default _default;
@@ -0,0 +1,59 @@
1
+ import { createError, defineEventHandler, getQuery, setHeader } from "h3";
2
+ import { $fetch } from "ofetch";
3
+ const BSKY_POST_URL_RE = /^https:\/\/bsky\.app\/profile\/([^/]+)\/post\/([^/?]+)$/;
4
+ export default defineEventHandler(async (event) => {
5
+ const query = getQuery(event);
6
+ const postUrl = query.url;
7
+ if (!postUrl) {
8
+ throw createError({
9
+ statusCode: 400,
10
+ statusMessage: "Post URL is required"
11
+ });
12
+ }
13
+ const match = postUrl.match(BSKY_POST_URL_RE);
14
+ if (!match) {
15
+ throw createError({
16
+ statusCode: 400,
17
+ statusMessage: "Invalid Bluesky post URL"
18
+ });
19
+ }
20
+ const [, actor, rkey] = match;
21
+ let did = actor;
22
+ if (!actor.startsWith("did:")) {
23
+ const profile = await $fetch(
24
+ `https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(actor)}`
25
+ ).catch((error) => {
26
+ throw createError({
27
+ statusCode: error.statusCode || 500,
28
+ statusMessage: "Failed to resolve Bluesky handle"
29
+ });
30
+ });
31
+ did = profile.did;
32
+ }
33
+ const uri = `at://${did}/app.bsky.feed.post/${rkey}`;
34
+ const response = await $fetch(
35
+ `https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?uri=${encodeURIComponent(uri)}&depth=0&parentHeight=0`
36
+ ).catch((error) => {
37
+ throw createError({
38
+ statusCode: error.statusCode || 500,
39
+ statusMessage: error.statusMessage || "Failed to fetch Bluesky post"
40
+ });
41
+ });
42
+ if (response.thread.$type !== "app.bsky.feed.defs#threadViewPost") {
43
+ throw createError({
44
+ statusCode: 404,
45
+ statusMessage: "Post not found"
46
+ });
47
+ }
48
+ const post = response.thread.post;
49
+ const hasOptOut = post.labels?.some((l) => l.val === "!no-unauthenticated") || post.author?.labels?.some((l) => l.val === "!no-unauthenticated");
50
+ if (hasOptOut) {
51
+ throw createError({
52
+ statusCode: 403,
53
+ statusMessage: "Author has opted out of external embedding"
54
+ });
55
+ }
56
+ setHeader(event, "Content-Type", "application/json");
57
+ setHeader(event, "Cache-Control", "public, max-age=600, s-maxage=600");
58
+ return post;
59
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
+ export default _default;