@nuxt/scripts 1.0.2 → 1.0.3
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.
- package/dist/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/B5UH0Ds3.js +188 -0
- package/dist/devtools-client/_nuxt/{DBnmHlYd.js → BKha4otU.js} +1 -1
- package/dist/devtools-client/_nuxt/{B6vzhpP9.js → BNnOFEgA.js} +1 -1
- package/dist/devtools-client/_nuxt/{Bo8cAJTo.js → CK-VPzWc.js} +1 -1
- package/dist/devtools-client/_nuxt/{348WW8S2.js → D1-tSGjF.js} +1 -1
- package/dist/devtools-client/_nuxt/{BBkg4uxE.js → DXbMEK4S.js} +1 -1
- package/dist/devtools-client/_nuxt/DZC4fp-D.js +1 -0
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/6689578b-eedf-440f-89c7-1c51715a9fd2.json +1 -0
- package/dist/devtools-client/_nuxt/entry.By2_NhVg.css +1 -0
- package/dist/devtools-client/_nuxt/error-404.CmHnDJ22.css +1 -0
- package/dist/devtools-client/_nuxt/error-500.C0mC5XzU.css +1 -0
- package/dist/devtools-client/docs/index.html +1 -1
- package/dist/devtools-client/first-party/index.html +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/devtools-client/registry/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +33 -4
- package/dist/runtime/server/bluesky-embed-image.d.ts +1 -1
- package/dist/runtime/server/bluesky-embed.d.ts +1 -1
- package/dist/runtime/server/google-maps-geocode-proxy.d.ts +1 -1
- package/dist/runtime/server/google-static-maps-proxy.d.ts +1 -1
- package/dist/runtime/server/gravatar-proxy.d.ts +1 -1
- package/dist/runtime/server/instagram-embed-asset.d.ts +1 -1
- package/dist/runtime/server/instagram-embed-image.d.ts +1 -1
- package/dist/runtime/server/instagram-embed.d.ts +1 -1
- package/dist/runtime/server/proxy-handler.js +2 -3
- package/dist/runtime/server/utils/image-proxy.d.ts +1 -1
- package/dist/runtime/server/utils/withSigning.d.ts +1 -1
- package/dist/runtime/server/x-embed-image.d.ts +1 -1
- package/dist/runtime/server/x-embed.d.ts +1 -48
- package/package.json +3 -3
- package/dist/devtools-client/_nuxt/builds/meta/831017e7-487a-40a4-83f3-dd537354844c.json +0 -1
- package/dist/devtools-client/_nuxt/entry.BKkVrcJj.css +0 -1
- package/dist/devtools-client/_nuxt/error-404.B3yGjJCG.css +0 -1
- package/dist/devtools-client/_nuxt/error-500.njrud7Pk.css +0 -1
- package/dist/devtools-client/_nuxt/fSf6EEYR.js +0 -188
- package/dist/devtools-client/_nuxt/r9yOu_bc.js +0 -1
|
@@ -8,7 +8,7 @@ import { useScriptGoogleMaps } from "#nuxt-scripts/registry/google-maps";
|
|
|
8
8
|
import { scriptRuntimeConfig, scriptsPrefix } from "#nuxt-scripts/utils";
|
|
9
9
|
import { defu } from "defu";
|
|
10
10
|
import { tryUseNuxtApp, useHead, useRuntimeConfig } from "nuxt/app";
|
|
11
|
-
import { computed, onBeforeUnmount, onMounted, provide, ref, shallowRef, toRaw, useAttrs, useTemplateRef, watch } from "vue";
|
|
11
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, provide, ref, shallowRef, toRaw, useAttrs, useTemplateRef, watch } from "vue";
|
|
12
12
|
import ScriptAriaLoadingIndicator from "../ScriptAriaLoadingIndicator.vue";
|
|
13
13
|
import { defineDeprecatedAlias, MAP_INJECTION_KEY, waitForMapsReady, warnDeprecatedTopLevelMapProps } from "./useGoogleMapsResource";
|
|
14
14
|
const props = defineProps({
|
|
@@ -42,6 +42,11 @@ const currentMapId = computed(() => {
|
|
|
42
42
|
return props.mapOptions?.mapId;
|
|
43
43
|
return props.mapIds[currentColorMode.value] || props.mapIds.light || props.mapOptions?.mapId;
|
|
44
44
|
});
|
|
45
|
+
const currentColorScheme = computed(() => {
|
|
46
|
+
if (!props.mapIds && !props.colorMode && !nuxtColorMode.value)
|
|
47
|
+
return void 0;
|
|
48
|
+
return currentColorMode.value === "dark" ? "DARK" : "LIGHT";
|
|
49
|
+
});
|
|
45
50
|
const mapsApi = shallowRef();
|
|
46
51
|
if (import.meta.dev) {
|
|
47
52
|
if (!apiKey)
|
|
@@ -76,13 +81,14 @@ const { load, status, onLoaded } = useScriptGoogleMaps({
|
|
|
76
81
|
const options = computed(() => {
|
|
77
82
|
const mapId = props.mapOptions?.styles ? void 0 : currentMapId.value || "DEMO_MAP_ID";
|
|
78
83
|
return defu(
|
|
79
|
-
{ center: centerOverride.value, mapId },
|
|
84
|
+
{ center: centerOverride.value, mapId, colorScheme: currentColorScheme.value },
|
|
80
85
|
props.mapOptions,
|
|
81
86
|
{ center: props.center, zoom: props.zoom },
|
|
82
87
|
{ zoom: 15 }
|
|
83
88
|
);
|
|
84
89
|
});
|
|
85
90
|
const isMapReady = ref(false);
|
|
91
|
+
const slotMounted = ref(true);
|
|
86
92
|
const map = shallowRef();
|
|
87
93
|
function isLocationQuery(s) {
|
|
88
94
|
return typeof s === "string" && (s.split(",").length > 2 || s.includes("+"));
|
|
@@ -191,9 +197,32 @@ onMounted(() => {
|
|
|
191
197
|
watch(options, () => {
|
|
192
198
|
if (!map.value)
|
|
193
199
|
return;
|
|
194
|
-
const { center: _, zoom: __, ...rest } = options.value;
|
|
200
|
+
const { center: _, zoom: __, mapId: ___, colorScheme: ____, ...rest } = options.value;
|
|
195
201
|
map.value.setOptions(rest);
|
|
196
202
|
});
|
|
203
|
+
watch([currentMapId, currentColorScheme], async ([newMapId, newScheme], [oldMapId, oldScheme]) => {
|
|
204
|
+
if (!map.value || !mapsApi.value || !mapEl.value)
|
|
205
|
+
return;
|
|
206
|
+
if (newMapId === oldMapId && newScheme === oldScheme)
|
|
207
|
+
return;
|
|
208
|
+
const center = map.value.getCenter();
|
|
209
|
+
const zoom = map.value.getZoom();
|
|
210
|
+
map.value.unbindAll();
|
|
211
|
+
map.value = void 0;
|
|
212
|
+
slotMounted.value = false;
|
|
213
|
+
if (mapEl.value)
|
|
214
|
+
mapEl.value.innerHTML = "";
|
|
215
|
+
await nextTick();
|
|
216
|
+
if (!mapEl.value || !mapsApi.value)
|
|
217
|
+
return;
|
|
218
|
+
const _options = {
|
|
219
|
+
...options.value,
|
|
220
|
+
center: center ? { lat: center.lat(), lng: center.lng() } : options.value.center,
|
|
221
|
+
zoom: zoom ?? options.value.zoom
|
|
222
|
+
};
|
|
223
|
+
map.value = new mapsApi.value.Map(mapEl.value, _options);
|
|
224
|
+
slotMounted.value = true;
|
|
225
|
+
});
|
|
197
226
|
watch(() => options.value.zoom, (zoom) => {
|
|
198
227
|
if (map.value && zoom != null)
|
|
199
228
|
map.value.setZoom(zoom);
|
|
@@ -294,6 +323,6 @@ onBeforeUnmount(() => {
|
|
|
294
323
|
</slot>
|
|
295
324
|
<slot v-if="status === 'awaitingLoad'" name="awaitingLoad" />
|
|
296
325
|
<slot v-else-if="status === 'error'" name="error" />
|
|
297
|
-
<slot />
|
|
326
|
+
<slot v-if="slotMounted" />
|
|
298
327
|
</div>
|
|
299
328
|
</template>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { proxyAssetUrl, proxyImageUrl, rewriteUrl, rewriteUrlsInText, scopeCss } from './utils/instagram-embed.js';
|
|
2
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
2
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
3
3
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createError, defineEventHandler, getHeaders, getQuery, getRequestIP, getRequestWebStream, readBody, setResponseHeader } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, getHeaders, getQuery, getRequestIP, getRequestWebStream, readBody, setResponseHeader, setResponseStatus } from "h3";
|
|
2
2
|
import { useNitroApp, useRuntimeConfig } from "nitropack/runtime";
|
|
3
3
|
import {
|
|
4
4
|
anonymizeIP,
|
|
@@ -264,8 +264,7 @@ export default defineEventHandler(async (event) => {
|
|
|
264
264
|
setResponseHeader(event, key, value);
|
|
265
265
|
}
|
|
266
266
|
});
|
|
267
|
-
event.
|
|
268
|
-
event.node.res.statusMessage = response.statusText;
|
|
267
|
+
setResponseStatus(event, response.status, response.statusText);
|
|
269
268
|
const responseContentType = response.headers.get("content-type") || "";
|
|
270
269
|
const isTextContent = responseContentType.includes("text") || responseContentType.includes("javascript") || responseContentType.includes("json");
|
|
271
270
|
if (isTextContent) {
|
|
@@ -11,4 +11,4 @@ export interface ImageProxyConfig {
|
|
|
11
11
|
/** Unique name for the nitro cache group (defaults to derived from allowedDomains). */
|
|
12
12
|
cacheName?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function createImageProxyHandler(config: ImageProxyConfig): import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
14
|
+
export declare function createImageProxyHandler(config: ImageProxyConfig): import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
* never reach the upstream fetch and cannot consume API quota.
|
|
21
21
|
*/
|
|
22
22
|
import type { EventHandler, EventHandlerRequest, EventHandlerResponse } from 'h3';
|
|
23
|
-
export declare function withSigning<Req extends EventHandlerRequest = EventHandlerRequest, Res extends EventHandlerResponse = EventHandlerResponse>(handler: EventHandler<Req, Res>): EventHandler<Req,
|
|
23
|
+
export declare function withSigning<Req extends EventHandlerRequest = EventHandlerRequest, Res extends EventHandlerResponse = EventHandlerResponse>(handler: EventHandler<Req, Res>): EventHandler<Req, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest,
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,49 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
id_str: string;
|
|
3
|
-
text: string;
|
|
4
|
-
created_at: string;
|
|
5
|
-
favorite_count: number;
|
|
6
|
-
conversation_count: number;
|
|
7
|
-
user: {
|
|
8
|
-
name: string;
|
|
9
|
-
screen_name: string;
|
|
10
|
-
profile_image_url_https: string;
|
|
11
|
-
verified?: boolean;
|
|
12
|
-
is_blue_verified?: boolean;
|
|
13
|
-
};
|
|
14
|
-
entities?: {
|
|
15
|
-
media?: Array<{
|
|
16
|
-
media_url_https: string;
|
|
17
|
-
type: string;
|
|
18
|
-
sizes: Record<string, {
|
|
19
|
-
w: number;
|
|
20
|
-
h: number;
|
|
21
|
-
}>;
|
|
22
|
-
}>;
|
|
23
|
-
urls?: Array<{
|
|
24
|
-
url: string;
|
|
25
|
-
expanded_url: string;
|
|
26
|
-
display_url: string;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
29
|
-
photos?: Array<{
|
|
30
|
-
url: string;
|
|
31
|
-
width: number;
|
|
32
|
-
height: number;
|
|
33
|
-
}>;
|
|
34
|
-
video?: {
|
|
35
|
-
poster: string;
|
|
36
|
-
variants: Array<{
|
|
37
|
-
type: string;
|
|
38
|
-
src: string;
|
|
39
|
-
}>;
|
|
40
|
-
};
|
|
41
|
-
quoted_tweet?: TweetData;
|
|
42
|
-
parent?: {
|
|
43
|
-
user: {
|
|
44
|
-
screen_name: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<TweetData>>;
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
|
|
49
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/scripts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
"magic-string": "^0.30.21",
|
|
113
113
|
"ofetch": "^1.5.1",
|
|
114
114
|
"ohash": "^2.0.11",
|
|
115
|
-
"oxc-parser": "^0.
|
|
115
|
+
"oxc-parser": "^0.128.0",
|
|
116
116
|
"oxc-walker": "^0.7.0",
|
|
117
117
|
"pathe": "^2.0.3",
|
|
118
|
-
"pkg-types": "^2.3.
|
|
118
|
+
"pkg-types": "^2.3.1",
|
|
119
119
|
"sirv": "^3.0.2",
|
|
120
120
|
"std-env": "^4.1.0",
|
|
121
121
|
"ufo": "^1.6.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"831017e7-487a-40a4-83f3-dd537354844c","timestamp":1776929246336,"prerendered":[]}
|