@devite/nuxt-sanity 2.16.1 → 2.17.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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/SanityComponent.d.vue.ts +2 -2
- package/dist/runtime/components/SanityComponent.vue.d.ts +2 -2
- package/dist/runtime/components/SanityPage.d.vue.ts +1 -0
- package/dist/runtime/components/SanityPage.vue +14 -13
- package/dist/runtime/components/SanityPage.vue.d.ts +1 -0
- package/dist/runtime/components/SanityPictureAsset.d.vue.ts +2 -2
- package/dist/runtime/components/SanityPictureAsset.vue.d.ts +2 -2
- package/dist/runtime/components/link/SanityLinkExternal.d.vue.ts +2 -2
- package/dist/runtime/components/link/SanityLinkExternal.vue.d.ts +2 -2
- package/dist/runtime/components/link/SanityLinkInternal.d.vue.ts +2 -2
- package/dist/runtime/components/link/SanityLinkInternal.vue.d.ts +2 -2
- package/dist/runtime/imageProviders/sanity.d.ts +3 -2
- package/dist/runtime/imageProviders/sanity.js +14 -11
- package/dist/runtime/plugins/visual-editing.client.d.ts +1 -1
- package/dist/runtime/plugins/visual-editing.server.d.ts +1 -1
- package/package.json +22 -22
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import defu from 'defu';
|
|
|
3
3
|
import { randomBytes } from 'node:crypto';
|
|
4
4
|
|
|
5
5
|
const name = "@devite/nuxt-sanity";
|
|
6
|
-
const version = "2.
|
|
6
|
+
const version = "2.17.1";
|
|
7
7
|
|
|
8
8
|
const CONFIG_KEY = "sanity";
|
|
9
|
-
const module = defineNuxtModule({
|
|
9
|
+
const module$1 = defineNuxtModule({
|
|
10
10
|
meta: {
|
|
11
11
|
name,
|
|
12
12
|
version,
|
|
@@ -204,4 +204,4 @@ const module = defineNuxtModule({
|
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
|
|
207
|
-
export { module as default };
|
|
207
|
+
export { module$1 as default };
|
|
@@ -3,9 +3,9 @@ import type { SanityModule } from '@devite/nuxt-sanity';
|
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
data?: SanityModule | Array<SanityModule>;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_11: string, __VLS_12: any;
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
[K in NonNullable<typeof
|
|
8
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
11
11
|
componentRef: import("vue").Ref<Component | undefined, Component | undefined>;
|
|
@@ -3,9 +3,9 @@ import type { SanityModule } from '@devite/nuxt-sanity';
|
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
data?: SanityModule | Array<SanityModule>;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_11: string, __VLS_12: any;
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
[K in NonNullable<typeof
|
|
8
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
11
11
|
componentRef: import("vue").Ref<Component | undefined, Component | undefined>;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<main v-if="sanityData?.modules?.length">
|
|
3
|
-
<SanityComponent
|
|
4
|
-
v-for="(module, index) in sanityData.modules"
|
|
5
|
-
:key="module._key"
|
|
6
|
-
:index="index"
|
|
7
|
-
:data="module"
|
|
8
|
-
/>
|
|
9
|
-
<slot />
|
|
10
|
-
</main>
|
|
2
|
+
<main v-if="sanityData?.modules?.length">
|
|
3
|
+
<SanityComponent
|
|
4
|
+
v-for="(module, index) in sanityData.modules"
|
|
5
|
+
:key="module._key"
|
|
6
|
+
:index="index"
|
|
7
|
+
:data="module"
|
|
8
|
+
/>
|
|
9
|
+
<slot />
|
|
10
|
+
</main>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script setup>
|
|
14
14
|
import { computed } from "vue";
|
|
15
15
|
import { setResponseStatus } from "h3";
|
|
16
16
|
import { groq, IMAGE_WITHOUT_PREVIEW_PROJECTION, useRequestEvent, useRoute, useRuntimeConfig, useSanityQuery, useSanitySEO } from "#imports";
|
|
17
|
-
const { prefix = "" } = defineProps({
|
|
18
|
-
prefix: { type: String, required: false }
|
|
17
|
+
const { prefix = "", allowedSchemaTypes = ["page"] } = defineProps({
|
|
18
|
+
prefix: { type: String, required: false },
|
|
19
|
+
allowedSchemaTypes: { type: Array, required: false }
|
|
19
20
|
});
|
|
20
21
|
const path = useRoute().path;
|
|
21
|
-
const groqFilter = path === "/" ? '_type == "home"' : `_type
|
|
22
|
+
const groqFilter = path === "/" ? '_type == "home"' : `_type in $allowedSchemaTypes && slug.current == $slug`;
|
|
22
23
|
const { data: sanityData } = await useSanityQuery(
|
|
23
24
|
groq`*[(${groqFilter}) || _type == "notFound"][0] { _id, _type, slug, title, modules, seo { _type, indexable, title, shortTitle, description, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} } }`,
|
|
24
|
-
{ slug: prefix + path.substring(1) }
|
|
25
|
+
{ slug: prefix + path.substring(1), allowedSchemaTypes }
|
|
25
26
|
);
|
|
26
27
|
if (sanityData.value?._type === "notFound" && import.meta.server) {
|
|
27
28
|
const event = useRequestEvent();
|
|
@@ -6,9 +6,9 @@ type __VLS_Props = {
|
|
|
6
6
|
lqip?: boolean;
|
|
7
7
|
imgAttrs?: Record<string, unknown>;
|
|
8
8
|
};
|
|
9
|
-
declare var
|
|
9
|
+
declare var __VLS_8: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_8) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -6,9 +6,9 @@ type __VLS_Props = {
|
|
|
6
6
|
lqip?: boolean;
|
|
7
7
|
imgAttrs?: Record<string, unknown>;
|
|
8
8
|
};
|
|
9
|
-
declare var
|
|
9
|
+
declare var __VLS_8: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_8) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,9 +2,9 @@ import type { LinkExternal } from '@devite/nuxt-sanity';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
data: LinkExternal;
|
|
4
4
|
};
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,9 +2,9 @@ import type { LinkExternal } from '@devite/nuxt-sanity';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
data: LinkExternal;
|
|
4
4
|
};
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,9 +4,9 @@ type __VLS_Props = {
|
|
|
4
4
|
reference: Reference;
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
declare var
|
|
7
|
+
declare var __VLS_8: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
|
-
default?: (props: typeof
|
|
9
|
+
default?: (props: typeof __VLS_8) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -4,9 +4,9 @@ type __VLS_Props = {
|
|
|
4
4
|
reference: Reference;
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
declare var
|
|
7
|
+
declare var __VLS_8: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
|
-
default?: (props: typeof
|
|
9
|
+
default?: (props: typeof __VLS_8) => any;
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ImageOptions } from '@nuxt/image';
|
|
2
|
+
declare const _default: () => import("@nuxt/image").ImageProvider<ImageOptions<never>>;
|
|
3
|
+
export default _default;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
params.set("
|
|
9
|
-
|
|
1
|
+
import sanity from "@nuxt/image/runtime/providers/sanity";
|
|
2
|
+
import { defineProvider } from "@nuxt/image/runtime";
|
|
3
|
+
export default defineProvider({
|
|
4
|
+
getImage(src, { modifiers = {}, projectId, dataset, cacheEndpoint }, context) {
|
|
5
|
+
modifiers.format = modifiers.format === "svg+xml" ? void 0 : modifiers.format;
|
|
6
|
+
if (cacheEndpoint) {
|
|
7
|
+
const params = new URLSearchParams();
|
|
8
|
+
params.set("src", src);
|
|
9
|
+
if (modifiers.format || !src.endsWith("-svg"))
|
|
10
|
+
params.set("modifiers", JSON.stringify(modifiers));
|
|
11
|
+
return { url: cacheEndpoint + `?${params.toString()}` };
|
|
12
|
+
}
|
|
13
|
+
return sanity().getImage(src, { modifiers, projectId, dataset }, context);
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
}
|
|
15
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: unknown;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: unknown;
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devite/nuxt-sanity",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.1",
|
|
4
4
|
"description": "Advanced Sanity integration for Nuxt.js.",
|
|
5
5
|
"repository": "devite-io/nuxt-sanity",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nuxt/image": "^
|
|
30
|
+
"@nuxt/image": "^2.0.0",
|
|
31
31
|
"@portabletext/vue": "^1.0.14",
|
|
32
|
-
"@sanity/client": "^7.
|
|
33
|
-
"@sanity/core-loader": "^2.0.
|
|
34
|
-
"@sanity/preview-url-secret": "^
|
|
35
|
-
"@sanity/types": "^
|
|
36
|
-
"@sanity/visual-editing": "^
|
|
32
|
+
"@sanity/client": "^7.13.2",
|
|
33
|
+
"@sanity/core-loader": "^2.0.5",
|
|
34
|
+
"@sanity/preview-url-secret": "^4.0.2",
|
|
35
|
+
"@sanity/types": "^5.1.0",
|
|
36
|
+
"@sanity/visual-editing": "^5.0.4",
|
|
37
37
|
"defu": "^6.1.4",
|
|
38
|
-
"ofetch": "^1.5.
|
|
39
|
-
"ohash": "^
|
|
40
|
-
"unstorage": "^1.17.
|
|
38
|
+
"ofetch": "^1.5.1",
|
|
39
|
+
"ohash": "^2.0.11",
|
|
40
|
+
"unstorage": "^1.17.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@nuxt/eslint-config": "^1.
|
|
44
|
-
"@nuxt/kit": "^4.2.
|
|
43
|
+
"@nuxt/eslint-config": "^1.12.1",
|
|
44
|
+
"@nuxt/kit": "^4.2.2",
|
|
45
45
|
"@nuxt/module-builder": "^1.0.2",
|
|
46
|
-
"@nuxt/schema": "^4.2.
|
|
47
|
-
"@nuxt/test-utils": "^3.
|
|
46
|
+
"@nuxt/schema": "^4.2.2",
|
|
47
|
+
"@nuxt/test-utils": "^3.22.0",
|
|
48
48
|
"@types/node": "latest",
|
|
49
49
|
"changelogen": "^0.6.2",
|
|
50
|
-
"eslint": "^9.
|
|
50
|
+
"eslint": "^9.39.2",
|
|
51
51
|
"h3": "^1.15.4",
|
|
52
|
-
"nuxt": "^4.2.
|
|
53
|
-
"typescript": "5.9.3",
|
|
54
|
-
"vite": "7.
|
|
52
|
+
"nuxt": "^4.2.2",
|
|
53
|
+
"typescript": "^5.9.3",
|
|
54
|
+
"vite": "^7.3.0",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
|
-
"vitest-environment-nuxt": "1.0.1",
|
|
57
|
-
"vue": "3.5.
|
|
58
|
-
"vue-router": "^4.6.
|
|
59
|
-
"vue-tsc": "^3.1
|
|
56
|
+
"vitest-environment-nuxt": "^1.0.1",
|
|
57
|
+
"vue": "^3.5.26",
|
|
58
|
+
"vue-router": "^4.6.4",
|
|
59
|
+
"vue-tsc": "^3.2.1"
|
|
60
60
|
},
|
|
61
61
|
"resolutions": {
|
|
62
62
|
"@devite/nuxt-sanity": "link:."
|