@nuxt/scripts 1.0.0-beta.27 → 1.0.0-beta.28

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 (46) hide show
  1. package/dist/client/200.html +1 -1
  2. package/dist/client/404.html +1 -1
  3. package/dist/client/_nuxt/{KCxg59bo.js → AwAKM0sG.js} +1 -1
  4. package/dist/client/_nuxt/{CwXQ1Eqw.js → Bl23o3st.js} +18 -18
  5. package/dist/client/_nuxt/{JXDRhrZp.js → CYlYSSNW.js} +1 -1
  6. package/dist/client/_nuxt/{viP3Pc9X.js → D5FIkDae.js} +1 -1
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/3ca2fe82-918c-4528-826c-0bf9ff54a5fa.json +1 -0
  9. package/dist/client/_nuxt/error-404.1K8v8Su2.css +1 -0
  10. package/dist/client/_nuxt/error-500.B9qvKpQm.css +1 -0
  11. package/dist/client/index.html +1 -1
  12. package/dist/module.json +1 -1
  13. package/dist/module.mjs +12 -1
  14. package/dist/registry.mjs +4 -1
  15. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +13 -3
  16. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +12 -7
  17. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +13 -3
  18. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +4 -34
  19. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +37 -36
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +4 -34
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +5 -9
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +35 -0
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +68 -0
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +35 -0
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +4 -4
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +2 -6
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +4 -4
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +6 -4
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +18 -10
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +6 -4
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +40 -0
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +168 -0
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +40 -0
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +4 -9
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +4 -9
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +5 -9
  37. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
  38. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
  39. package/dist/runtime/registry/gravatar.d.ts +1 -0
  40. package/dist/runtime/registry/gravatar.js +1 -0
  41. package/dist/stats.mjs +283 -227
  42. package/dist/types-source.mjs +1247 -67
  43. package/package.json +3 -3
  44. package/dist/client/_nuxt/builds/meta/d0d06e27-af53-4f1a-b7ae-18727423b3ed.json +0 -1
  45. package/dist/client/_nuxt/error-404.C_3_IG5y.css +0 -1
  46. package/dist/client/_nuxt/error-500.DSv6YikH.css +0 -1
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { watch } from "vue";
3
+ import { bindGoogleMapsEvents } from "./bindGoogleMapsEvents";
3
4
  import { useGoogleMapsResource } from "./useGoogleMapsResource";
4
5
  const props = defineProps({
5
6
  options: { type: Object, required: false }
@@ -23,7 +24,9 @@ const eventsWithMapMouseEventPayload = [
23
24
  const polyline = useGoogleMapsResource({
24
25
  create({ mapsApi, map }) {
25
26
  const p = new mapsApi.Polyline({ map, ...props.options });
26
- setupEventListeners(p);
27
+ bindGoogleMapsEvents(p, emit, {
28
+ withPayload: [...eventsWithPolyMouseEventPayload, ...eventsWithMapMouseEventPayload]
29
+ });
27
30
  return p;
28
31
  },
29
32
  cleanup(p, { mapsApi }) {
@@ -36,14 +39,6 @@ watch(() => props.options, (options) => {
36
39
  polyline.value.setOptions(options);
37
40
  }
38
41
  }, { deep: true });
39
- function setupEventListeners(p) {
40
- eventsWithPolyMouseEventPayload.forEach((event) => {
41
- p.addListener(event, (payload) => emit(event, payload));
42
- });
43
- eventsWithMapMouseEventPayload.forEach((event) => {
44
- p.addListener(event, (payload) => emit(event, payload));
45
- });
46
- }
47
42
  </script>
48
43
 
49
44
  <template>
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
2
  import { watch } from "vue";
3
+ import { bindGoogleMapsEvents } from "./bindGoogleMapsEvents";
3
4
  import { useGoogleMapsResource } from "./useGoogleMapsResource";
4
5
  const props = defineProps({
5
6
  options: { type: Object, required: false }
@@ -24,7 +25,10 @@ const eventsWithMapMouseEventPayload = [
24
25
  const rectangle = useGoogleMapsResource({
25
26
  create({ mapsApi, map }) {
26
27
  const r = new mapsApi.Rectangle({ map, ...props.options });
27
- setupEventListeners(r);
28
+ bindGoogleMapsEvents(r, emit, {
29
+ noPayload: eventsWithoutPayload,
30
+ withPayload: eventsWithMapMouseEventPayload
31
+ });
28
32
  return r;
29
33
  },
30
34
  cleanup(r, { mapsApi }) {
@@ -37,14 +41,6 @@ watch(() => props.options, (options) => {
37
41
  rectangle.value.setOptions(options);
38
42
  }
39
43
  }, { deep: true });
40
- function setupEventListeners(r) {
41
- eventsWithoutPayload.forEach((event) => {
42
- r.addListener(event, () => emit(event));
43
- });
44
- eventsWithMapMouseEventPayload.forEach((event) => {
45
- r.addListener(event, (payload) => emit(event, payload));
46
- });
47
- }
48
44
  </script>
49
45
 
50
46
  <template>
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Bind Google Maps event listeners that forward to Vue emit.
3
+ *
4
+ * Two categories:
5
+ * - `noPayload`: emits with no arguments (state-change events like `position_changed`)
6
+ * - `withPayload`: forwards the first argument from the listener (mouse events, etc.)
7
+ */
8
+ export declare function bindGoogleMapsEvents(instance: {
9
+ addListener: (event: string, handler: (...args: any[]) => void) => void;
10
+ }, emit: (...args: any[]) => void, config: {
11
+ noPayload?: readonly string[];
12
+ withPayload?: readonly string[];
13
+ }): void;
@@ -0,0 +1,8 @@
1
+ export function bindGoogleMapsEvents(instance, emit, config) {
2
+ config.noPayload?.forEach((event) => {
3
+ instance.addListener(event, () => emit(event));
4
+ });
5
+ config.withPayload?.forEach((event) => {
6
+ instance.addListener(event, (payload) => emit(event, payload));
7
+ });
8
+ }
@@ -1,5 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
2
  import { GravatarOptions } from './schemas.js';
3
+ export { GravatarOptions } from './schemas.js';
3
4
  export type GravatarInput = RegistryScriptInput<typeof GravatarOptions>;
4
5
  export interface GravatarApi {
5
6
  /**
@@ -1,5 +1,6 @@
1
1
  import { useRegistryScript } from "#nuxt-scripts/utils";
2
2
  import { GravatarOptions } from "./schemas.js";
3
+ export { GravatarOptions } from "./schemas.js";
3
4
  export function useScriptGravatar(_options) {
4
5
  return useRegistryScript(_options?.key || "gravatar", (options) => {
5
6
  const size = options?.size ?? 80;