@devite/nuxt-sanity 2.12.0 → 2.12.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 +1 -1
- package/dist/runtime/client/DefaultSanityClient.d.ts +2 -2
- package/dist/runtime/client/DefaultSanityClient.js +1 -3
- package/dist/runtime/components/SanityComponent.vue +16 -16
- package/dist/runtime/components/SanityComponent.vue.d.ts +1 -1
- package/dist/runtime/components/SanityPictureAsset.vue +1 -1
- package/dist/runtime/components/SanityRichText.vue +4 -4
- package/dist/runtime/composables/query.d.ts +1 -1
- package/dist/runtime/composables/sanity_seo.d.ts +1 -1
- package/dist/runtime/composables/visual_editing_state.d.ts +1 -1
- package/dist/runtime/plugins/visual-editing.client.d.ts +1 -1
- package/dist/runtime/plugins/visual-editing.server.d.ts +1 -1
- package/dist/runtime/server/routes/cache/asset.js +4 -1
- package/dist/runtime/server/routes/cache/query.js +4 -1
- package/dist/runtime/utils/visualEditing/fetchSanityData.d.ts +1 -1
- package/package.json +13 -13
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineNuxtModule, createResolver, addPlugin, addServerHandler, addImpor
|
|
|
3
3
|
import defu from 'defu';
|
|
4
4
|
|
|
5
5
|
const name = "@devite/nuxt-sanity";
|
|
6
|
-
const version = "2.12.
|
|
6
|
+
const version = "2.12.1";
|
|
7
7
|
|
|
8
8
|
const CONFIG_KEY = "sanity";
|
|
9
9
|
const module = defineNuxtModule({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ClientPerspective, QueryParams, SanityClient as SanityClientType } from '@sanity/client';
|
|
2
2
|
import type { ModuleOptions } from '@devite/nuxt-sanity';
|
|
3
|
-
import {
|
|
3
|
+
import type { QueryStore } from '@sanity/core-loader';
|
|
4
4
|
import { SanityClient } from '#imports';
|
|
5
5
|
declare class DefaultSanityClient extends SanityClient {
|
|
6
6
|
readonly client: SanityClientType;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createClient
|
|
3
|
-
} from "@sanity/client";
|
|
1
|
+
import { createClient } from "@sanity/client";
|
|
4
2
|
import { createQueryStore as createCoreQueryStore } from "@sanity/core-loader";
|
|
5
3
|
import { SanityClient } from "#imports";
|
|
6
4
|
class DefaultSanityClient extends SanityClient {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="component"
|
|
4
|
-
v-if="data"
|
|
5
|
-
ref="componentRef"
|
|
6
|
-
v-bind="{ ...$props, ...$attrs }"
|
|
7
|
-
>
|
|
8
|
-
<template
|
|
9
|
-
v-for="(_, slotName) in $slots"
|
|
10
|
-
#[slotName]="slotProps"
|
|
11
|
-
>
|
|
12
|
-
<slot
|
|
13
|
-
:name="slotName"
|
|
14
|
-
v-bind="slotProps ?? {}"
|
|
15
|
-
/>
|
|
16
|
-
</template>
|
|
17
|
-
</component>
|
|
2
|
+
<component
|
|
3
|
+
:is="component"
|
|
4
|
+
v-if="data"
|
|
5
|
+
ref="componentRef"
|
|
6
|
+
v-bind="{ ...$props, ...$attrs }"
|
|
7
|
+
>
|
|
8
|
+
<template
|
|
9
|
+
v-for="(_, slotName) in $slots"
|
|
10
|
+
#[slotName]="slotProps"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
:name="slotName"
|
|
14
|
+
v-bind="slotProps ?? {}"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</component>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script setup>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:alt="imageAsset.altText"
|
|
10
10
|
:placeholder="loading === 'eager' || !lqip ? void 0 : imageAsset.metadata.lqip"
|
|
11
11
|
:loading="loading || 'lazy'"
|
|
12
|
-
:format="
|
|
12
|
+
:format="isSvg ? 'svg+xml' : 'webp'"
|
|
13
13
|
legacy-format="png"
|
|
14
14
|
:img-attrs="{ ...imgAttrs, draggable: false }"
|
|
15
15
|
provider="cachedSanity"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AsyncDataOptions, AsyncDataRequestStatus } from 'nuxt/app';
|
|
2
2
|
import type { ContentSourceMap, QueryParams } from '@sanity/client';
|
|
3
3
|
import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
|
|
4
|
-
import {
|
|
4
|
+
import type { Ref } from 'vue';
|
|
5
5
|
export interface UseSanityQueryOptions<T> extends AsyncDataOptions<T> {
|
|
6
6
|
client?: 'default' | 'minimal';
|
|
7
7
|
perspective?: 'drafts' | 'published' | 'raw';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: any;
|
|
2
2
|
export default _default;
|
|
@@ -41,7 +41,10 @@ export default defineEventHandler(async (event) => {
|
|
|
41
41
|
const assetId = src.split("/").pop();
|
|
42
42
|
if (assetId) {
|
|
43
43
|
const sanityDocumentDeps = useStorage("sanityDocumentDeps");
|
|
44
|
-
|
|
44
|
+
let documentDeps = await sanityDocumentDeps.getItem(assetId);
|
|
45
|
+
if (!documentDeps || !Array.isArray(documentDeps)) {
|
|
46
|
+
documentDeps = [];
|
|
47
|
+
}
|
|
45
48
|
documentDeps.push(hashedPath);
|
|
46
49
|
await sanityDocumentDeps.setItem(assetId, documentDeps);
|
|
47
50
|
if (import.meta.dev) {
|
|
@@ -51,7 +51,10 @@ export default defineEventHandler(async (event) => {
|
|
|
51
51
|
await Promise.all(referencedIds.map((ref) => new Promise((resolve) => {
|
|
52
52
|
const id = ref.split('"')[3];
|
|
53
53
|
sanityDocumentDeps.getItem(id).then((deps) => {
|
|
54
|
-
|
|
54
|
+
let documentDeps = deps;
|
|
55
|
+
if (!documentDeps || !Array.isArray(documentDeps)) {
|
|
56
|
+
documentDeps = [];
|
|
57
|
+
}
|
|
55
58
|
documentDeps.push(hashedQuery);
|
|
56
59
|
sanityDocumentDeps.setItem(id, documentDeps).then(resolve);
|
|
57
60
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientPerspective, ContentSourceMap, QueryParams } from '@sanity/client';
|
|
2
2
|
import type { Reactive } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
|
|
4
4
|
import type { SanityClient } from '#imports';
|
|
5
5
|
export declare function fetchSanityData<T>(query: string, params: Reactive<QueryParams> | undefined, client: SanityClient, perspective: ClientPerspective, callback: (data: T | null, sourceMap?: ContentSourceMap, encodeDataAttribute?: EncodeDataAttributeFunction) => void): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devite/nuxt-sanity",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.1",
|
|
4
4
|
"description": "Advanced Sanity integration for Nuxt.js.",
|
|
5
5
|
"repository": "devite-io/nuxt-sanity",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,34 +29,34 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nuxt/image": "^1.10.0",
|
|
31
31
|
"@portabletext/vue": "^1.0.12",
|
|
32
|
-
"@sanity/client": "^7.
|
|
33
|
-
"@sanity/core-loader": "^1.8.
|
|
32
|
+
"@sanity/client": "^7.6.0",
|
|
33
|
+
"@sanity/core-loader": "^1.8.10",
|
|
34
34
|
"@sanity/preview-url-secret": "^2.1.11",
|
|
35
|
-
"@sanity/types": "^3.
|
|
36
|
-
"@sanity/visual-editing": "^2.
|
|
35
|
+
"@sanity/types": "^3.96.0",
|
|
36
|
+
"@sanity/visual-editing": "^2.15.0",
|
|
37
37
|
"defu": "^6.1.4",
|
|
38
38
|
"ofetch": "^1.4.1",
|
|
39
39
|
"ohash": "^1.1.6",
|
|
40
40
|
"unstorage": "^1.16.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@nuxt/eslint-config": "^1.
|
|
44
|
-
"@nuxt/kit": "^3.17.
|
|
43
|
+
"@nuxt/eslint-config": "^1.5.2",
|
|
44
|
+
"@nuxt/kit": "^3.17.6",
|
|
45
45
|
"@nuxt/module-builder": "^1.0.1",
|
|
46
|
-
"@nuxt/schema": "^3.17.
|
|
47
|
-
"@nuxt/test-utils": "^3.
|
|
46
|
+
"@nuxt/schema": "^3.17.6",
|
|
47
|
+
"@nuxt/test-utils": "^3.19.2",
|
|
48
48
|
"@types/node": "latest",
|
|
49
49
|
"changelogen": "^0.6.1",
|
|
50
|
-
"eslint": "^9.
|
|
50
|
+
"eslint": "^9.30.1",
|
|
51
51
|
"h3": "^1.15.3",
|
|
52
|
-
"nuxt": "^3.17.
|
|
52
|
+
"nuxt": "^3.17.6",
|
|
53
53
|
"typescript": "5.8.3",
|
|
54
54
|
"vite": "6.3.5",
|
|
55
|
-
"vitest": "^3.
|
|
55
|
+
"vitest": "^3.2.4",
|
|
56
56
|
"vitest-environment-nuxt": "1.0.1",
|
|
57
57
|
"vue": "3.5.13",
|
|
58
58
|
"vue-router": "^4.5.1",
|
|
59
|
-
"vue-tsc": "^2.2.
|
|
59
|
+
"vue-tsc": "^2.2.12"
|
|
60
60
|
},
|
|
61
61
|
"resolutions": {
|
|
62
62
|
"@devite/nuxt-sanity": "link:."
|