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

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 (60) 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/05eb1abd-7d1c-43e9-b78e-dc8ec287cc6f.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 +28 -16
  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 +23 -8
  17. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +13 -3
  18. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +5 -35
  19. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +44 -42
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +5 -35
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +1 -1
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +6 -10
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +1 -1
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +35 -0
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +61 -0
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +35 -0
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +5 -5
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +34 -18
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +5 -5
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +7 -5
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +19 -11
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +7 -5
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +1 -1
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +3 -7
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +1 -1
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +40 -0
  37. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +160 -0
  38. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +40 -0
  39. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +1 -1
  40. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +5 -10
  41. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +1 -1
  42. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +1 -1
  43. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +5 -10
  44. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +1 -1
  45. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +1 -1
  46. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +6 -10
  47. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +1 -1
  48. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
  49. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
  50. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +2 -0
  51. package/dist/runtime/composables/useScript.js +3 -1
  52. package/dist/runtime/registry/gravatar.d.ts +1 -0
  53. package/dist/runtime/registry/gravatar.js +1 -0
  54. package/dist/runtime/registry/rybbit-analytics.js +3 -1
  55. package/dist/stats.mjs +283 -227
  56. package/dist/types-source.mjs +1420 -50
  57. package/package.json +7 -7
  58. package/dist/client/_nuxt/builds/meta/d0d06e27-af53-4f1a-b7ae-18727423b3ed.json +0 -1
  59. package/dist/client/_nuxt/error-404.C_3_IG5y.css +0 -1
  60. package/dist/client/_nuxt/error-500.DSv6YikH.css +0 -1
@@ -0,0 +1,40 @@
1
+ type OverlayAnchor = 'center' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-center' | 'right-center';
2
+ type OverlayPane = 'mapPane' | 'overlayLayer' | 'markerLayer' | 'overlayMouseTarget' | 'floatPane';
3
+ type __VLS_Props = {
4
+ position?: google.maps.LatLngLiteral;
5
+ anchor?: OverlayAnchor;
6
+ offset?: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ pane?: OverlayPane;
11
+ zIndex?: number;
12
+ blockMapInteraction?: boolean;
13
+ };
14
+ type __VLS_ModelProps = {
15
+ 'open'?: boolean;
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ declare var __VLS_1: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_1) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
23
+ overlay: import("vue").ShallowRef<google.maps.OverlayView | undefined>;
24
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "update:open": (value: boolean) => any;
26
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
28
+ }>, {
29
+ anchor: OverlayAnchor;
30
+ pane: OverlayPane;
31
+ blockMapInteraction: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,160 @@
1
+ <script setup>
2
+ import { inject, useTemplateRef, watch } from "vue";
3
+ import { ADVANCED_MARKER_ELEMENT_INJECTION_KEY, MARKER_INJECTION_KEY } from "./injectionKeys";
4
+ import { useGoogleMapsResource } from "./useGoogleMapsResource";
5
+ const props = defineProps({
6
+ position: { type: null, required: false },
7
+ anchor: { type: String, required: false, default: "bottom-center" },
8
+ offset: { type: Object, required: false },
9
+ pane: { type: String, required: false, default: "floatPane" },
10
+ zIndex: { type: Number, required: false },
11
+ blockMapInteraction: { type: Boolean, required: false, default: true }
12
+ });
13
+ const open = defineModel("open", { type: Boolean, ...{ default: void 0 } });
14
+ const markerContext = inject(MARKER_INJECTION_KEY, void 0);
15
+ const advancedMarkerElementContext = inject(ADVANCED_MARKER_ELEMENT_INJECTION_KEY, void 0);
16
+ function getResolvedPosition() {
17
+ if (props.position)
18
+ return props.position;
19
+ if (markerContext?.marker.value) {
20
+ const pos = markerContext.marker.value.getPosition();
21
+ if (pos)
22
+ return { lat: pos.lat(), lng: pos.lng() };
23
+ }
24
+ if (advancedMarkerElementContext?.advancedMarkerElement.value) {
25
+ const pos = advancedMarkerElementContext.advancedMarkerElement.value.position;
26
+ if (pos) {
27
+ if ("lat" in pos && typeof pos.lat === "function")
28
+ return { lat: pos.lat(), lng: pos.lng() };
29
+ return pos;
30
+ }
31
+ }
32
+ return void 0;
33
+ }
34
+ const ANCHOR_TRANSFORMS = {
35
+ "center": "translate(-50%, -50%)",
36
+ "top-left": "translate(0, 0)",
37
+ "top-center": "translate(-50%, 0)",
38
+ "top-right": "translate(-100%, 0)",
39
+ "bottom-left": "translate(0, -100%)",
40
+ "bottom-center": "translate(-50%, -100%)",
41
+ "bottom-right": "translate(-100%, -100%)",
42
+ "left-center": "translate(0, -50%)",
43
+ "right-center": "translate(-100%, -50%)"
44
+ };
45
+ const overlayContent = useTemplateRef("overlay-content");
46
+ const listeners = [];
47
+ const overlay = useGoogleMapsResource({
48
+ // ready condition accesses .value on ShallowRefs — tracked by whenever() in useGoogleMapsResource
49
+ ready: () => !!overlayContent.value && !!(props.position || markerContext?.marker.value || advancedMarkerElementContext?.advancedMarkerElement.value),
50
+ create({ mapsApi, map }) {
51
+ const el = overlayContent.value;
52
+ class CustomOverlay extends mapsApi.OverlayView {
53
+ onAdd() {
54
+ const panes = this.getPanes();
55
+ if (panes) {
56
+ panes[props.pane].appendChild(el);
57
+ if (props.blockMapInteraction)
58
+ mapsApi.OverlayView.preventMapHitsAndGesturesFrom(el);
59
+ }
60
+ }
61
+ draw() {
62
+ if (open.value === false) {
63
+ el.style.visibility = "hidden";
64
+ return;
65
+ }
66
+ const position = getResolvedPosition();
67
+ if (!position) {
68
+ el.style.visibility = "hidden";
69
+ return;
70
+ }
71
+ const projection = this.getProjection();
72
+ if (!projection) {
73
+ el.style.visibility = "hidden";
74
+ return;
75
+ }
76
+ const pos = projection.fromLatLngToDivPixel(
77
+ new mapsApi.LatLng(position.lat, position.lng)
78
+ );
79
+ if (!pos) {
80
+ el.style.visibility = "hidden";
81
+ return;
82
+ }
83
+ el.style.position = "absolute";
84
+ el.style.left = `${pos.x + (props.offset?.x ?? 0)}px`;
85
+ el.style.top = `${pos.y + (props.offset?.y ?? 0)}px`;
86
+ el.style.transform = ANCHOR_TRANSFORMS[props.anchor];
87
+ if (props.zIndex !== void 0)
88
+ el.style.zIndex = String(props.zIndex);
89
+ el.style.visibility = "visible";
90
+ }
91
+ onRemove() {
92
+ el.parentNode?.removeChild(el);
93
+ }
94
+ }
95
+ el.style.visibility = "hidden";
96
+ const ov = new CustomOverlay();
97
+ ov.setMap(map);
98
+ if (markerContext?.marker.value) {
99
+ listeners.push(
100
+ markerContext.marker.value.addListener("position_changed", () => ov.draw())
101
+ );
102
+ } else if (advancedMarkerElementContext?.advancedMarkerElement.value) {
103
+ const ame = advancedMarkerElementContext.advancedMarkerElement.value;
104
+ listeners.push(
105
+ ame.addListener("drag", () => ov.draw()),
106
+ ame.addListener("dragend", () => ov.draw())
107
+ );
108
+ }
109
+ return ov;
110
+ },
111
+ cleanup(ov) {
112
+ listeners.forEach((l) => l.remove());
113
+ listeners.length = 0;
114
+ ov.setMap(null);
115
+ }
116
+ });
117
+ if (advancedMarkerElementContext) {
118
+ watch(
119
+ () => {
120
+ const pos = advancedMarkerElementContext.advancedMarkerElement.value?.position;
121
+ if (!pos)
122
+ return void 0;
123
+ if ("lat" in pos && typeof pos.lat === "function")
124
+ return { lat: pos.lat(), lng: pos.lng() };
125
+ return pos;
126
+ },
127
+ () => {
128
+ overlay.value?.draw();
129
+ }
130
+ );
131
+ }
132
+ watch(
133
+ () => [props.position?.lat, props.position?.lng, props.offset?.x, props.offset?.y, props.zIndex, props.anchor],
134
+ () => {
135
+ overlay.value?.draw();
136
+ }
137
+ );
138
+ watch(() => open.value, () => {
139
+ if (!overlay.value)
140
+ return;
141
+ overlay.value.draw();
142
+ });
143
+ watch([() => props.pane, () => props.blockMapInteraction], () => {
144
+ if (overlay.value) {
145
+ const map = overlay.value.getMap();
146
+ overlay.value.setMap(null);
147
+ if (map)
148
+ overlay.value.setMap(map);
149
+ }
150
+ });
151
+ defineExpose({ overlay });
152
+ </script>
153
+
154
+ <template>
155
+ <div style="display: none;">
156
+ <div ref="overlay-content">
157
+ <slot />
158
+ </div>
159
+ </div>
160
+ </template>
@@ -0,0 +1,40 @@
1
+ type OverlayAnchor = 'center' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-center' | 'right-center';
2
+ type OverlayPane = 'mapPane' | 'overlayLayer' | 'markerLayer' | 'overlayMouseTarget' | 'floatPane';
3
+ type __VLS_Props = {
4
+ position?: google.maps.LatLngLiteral;
5
+ anchor?: OverlayAnchor;
6
+ offset?: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ pane?: OverlayPane;
11
+ zIndex?: number;
12
+ blockMapInteraction?: boolean;
13
+ };
14
+ type __VLS_ModelProps = {
15
+ 'open'?: boolean;
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ declare var __VLS_1: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_1) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
23
+ overlay: import("vue").ShallowRef<google.maps.OverlayView | undefined>;
24
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "update:open": (value: boolean) => any;
26
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
28
+ }>, {
29
+ anchor: OverlayAnchor;
30
+ pane: OverlayPane;
31
+ blockMapInteraction: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.PolygonOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.PolyMouseEvent) => any;
6
6
  click: (payload: google.maps.PolyMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.PolyMouseEvent) => any;
@@ -1,10 +1,11 @@
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 }
6
7
  });
7
- const emit = defineEmits([]);
8
+ const emit = defineEmits(["click", "contextmenu", "dblclick", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "drag", "dragend", "dragstart"]);
8
9
  const eventsWithPolyMouseEventPayload = [
9
10
  "click",
10
11
  "contextmenu",
@@ -23,7 +24,9 @@ const eventsWithMapMouseEventPayload = [
23
24
  const polygon = useGoogleMapsResource({
24
25
  create({ mapsApi, map }) {
25
26
  const p = new mapsApi.Polygon({ 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
  polygon.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,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.PolygonOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.PolyMouseEvent) => any;
6
6
  click: (payload: google.maps.PolyMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.PolyMouseEvent) => any;
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.PolylineOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.PolyMouseEvent) => any;
6
6
  click: (payload: google.maps.PolyMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.PolyMouseEvent) => any;
@@ -1,10 +1,11 @@
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 }
6
7
  });
7
- const emit = defineEmits([]);
8
+ const emit = defineEmits(["click", "contextmenu", "dblclick", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "drag", "dragend", "dragstart"]);
8
9
  const eventsWithPolyMouseEventPayload = [
9
10
  "click",
10
11
  "contextmenu",
@@ -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,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.PolylineOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.PolyMouseEvent) => any;
6
6
  click: (payload: google.maps.PolyMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.PolyMouseEvent) => any;
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.RectangleOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.MapMouseEvent) => any;
6
6
  click: (payload: google.maps.MapMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.MapMouseEvent) => any;
@@ -1,10 +1,11 @@
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 }
6
7
  });
7
- const emit = defineEmits([]);
8
+ const emit = defineEmits(["bounds_changed", "click", "contextmenu", "dblclick", "drag", "dragend", "dragstart", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup"]);
8
9
  const eventsWithoutPayload = [
9
10
  "bounds_changed"
10
11
  ];
@@ -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>
@@ -1,7 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  options?: Omit<google.maps.RectangleOptions, 'map'>;
3
3
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  contextmenu: (payload: google.maps.MapMouseEvent) => any;
6
6
  click: (payload: google.maps.MapMouseEvent) => any;
7
7
  dblclick: (payload: google.maps.MapMouseEvent) => any;
@@ -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
+ }
@@ -2,6 +2,8 @@ import type { InjectionKey, Ref, ShallowRef } from 'vue';
2
2
  export declare const MAP_INJECTION_KEY: InjectionKey<{
3
3
  map: ShallowRef<google.maps.Map | undefined>;
4
4
  mapsApi: Ref<typeof google.maps | undefined>;
5
+ /** Close the previously active InfoWindow and register a new one as active */
6
+ activateInfoWindow: (iw: google.maps.InfoWindow) => void;
5
7
  }>;
6
8
  export declare const ADVANCED_MARKER_ELEMENT_INJECTION_KEY: InjectionKey<{
7
9
  advancedMarkerElement: ShallowRef<google.maps.marker.AdvancedMarkerElement | undefined>;
@@ -2,7 +2,7 @@ import { resolveTrigger } from "#build/nuxt-scripts-trigger-resolver";
2
2
  import { useScript as _useScript } from "@unhead/vue/scripts";
3
3
  import { defu } from "defu";
4
4
  import { injectHead, onNuxtReady, useHead, useNuxtApp, useRuntimeConfig } from "nuxt/app";
5
- import { ref } from "vue";
5
+ import { markRaw, ref } from "vue";
6
6
  import { logger } from "../logger.js";
7
7
  function ensureScripts(nuxtApp) {
8
8
  if (!nuxtApp.$scripts) {
@@ -157,5 +157,7 @@ export function useScript(input, options) {
157
157
  syncScripts();
158
158
  }
159
159
  }
160
+ markRaw(instance);
161
+ instance.toJSON = () => ({ id: instance.id, status: instance.status.value });
160
162
  return instance;
161
163
  }
@@ -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;
@@ -63,7 +63,9 @@ export function useScriptRybbitAnalytics(_options) {
63
63
  identify: (userId) => callOrQueue("identify", userId),
64
64
  clearUserId: () => callOrQueue("clearUserId"),
65
65
  getUserId: () => window.rybbit?.getUserId?.() ?? null,
66
- rybbit: window.rybbit
66
+ get rybbit() {
67
+ return window.rybbit;
68
+ }
67
69
  };
68
70
  }
69
71
  }