@devite/nuxt-sanity 2.10.0 → 2.10.2
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/plugins/visual-editing.client.d.ts +2 -0
- package/dist/runtime/plugins/visual-editing.server.d.ts +2 -0
- package/dist/runtime/server/routes/proxy.js +6 -2
- package/dist/runtime/utils/visualEditing/subscribeToChanges.d.ts +1 -1
- package/dist/runtime/utils/visualEditing/subscribeToChanges.js +1 -2
- package/package.json +12 -7
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.10.
|
|
6
|
+
const version = "2.10.2";
|
|
7
7
|
|
|
8
8
|
const CONFIG_KEY = "sanity";
|
|
9
9
|
const module = defineNuxtModule({
|
|
@@ -8,12 +8,16 @@ export default defineEventHandler(async (event) => {
|
|
|
8
8
|
statusMessage: "This route is only available in preview mode"
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
const { query, params = {} } = await readBody(event);
|
|
11
|
+
const { query, params = {}, options } = await readBody(event);
|
|
12
12
|
if (!query) {
|
|
13
13
|
return createError({
|
|
14
14
|
statusCode: 400,
|
|
15
15
|
statusMessage: `Field "query" is required`
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
return await useSanityClient("default").fetch(
|
|
18
|
+
return (await useSanityClient("default")).fetch(
|
|
19
|
+
query,
|
|
20
|
+
params,
|
|
21
|
+
options ?? void 0
|
|
22
|
+
);
|
|
19
23
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Reactive } from 'vue';
|
|
2
2
|
import type { ContentSourceMap, QueryParams } from '@sanity/client';
|
|
3
3
|
import type { EncodeDataAttributeFunction } from '@sanity/core-loader/encode-data-attribute';
|
|
4
4
|
import type { SanityClient } from '#imports';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { toRaw } from "vue";
|
|
2
1
|
import { defineEncodeDataAttribute } from "@sanity/core-loader/encode-data-attribute";
|
|
3
2
|
export const subscribeToChanges = (query, params, client, updateData) => {
|
|
4
3
|
let unsubscribe = () => {
|
|
5
4
|
};
|
|
6
5
|
function setupFetcher(cb) {
|
|
7
6
|
unsubscribe();
|
|
8
|
-
const deepClonedParams = params ? JSON.parse(JSON.stringify(
|
|
7
|
+
const deepClonedParams = params ? JSON.parse(JSON.stringify(params)) : void 0;
|
|
9
8
|
const fetcher = client.queryStore.createFetcherStore(query, deepClonedParams, void 0);
|
|
10
9
|
unsubscribe = fetcher.subscribe((newSnapshot) => {
|
|
11
10
|
if (newSnapshot.data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devite/nuxt-sanity",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "Advanced Sanity integration for Nuxt.js.",
|
|
5
5
|
"repository": "devite-io/nuxt-sanity",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,13 +11,18 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./dist/
|
|
15
|
-
"import": "./dist/module.mjs"
|
|
16
|
-
|
|
14
|
+
"types": "./dist/module.d.mts",
|
|
15
|
+
"import": "./dist/module.mjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/module.mjs",
|
|
19
|
+
"typesVersions": {
|
|
20
|
+
"*": {
|
|
21
|
+
".": [
|
|
22
|
+
"./dist/module.d.mts"
|
|
23
|
+
]
|
|
17
24
|
}
|
|
18
25
|
},
|
|
19
|
-
"main": "./dist/module.cjs",
|
|
20
|
-
"types": "./dist/types.d.ts",
|
|
21
26
|
"files": [
|
|
22
27
|
"dist"
|
|
23
28
|
],
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
"@sanity/client": "^6.28.4",
|
|
28
33
|
"@sanity/core-loader": "^1.8.1",
|
|
29
34
|
"@sanity/preview-url-secret": "^2.1.7",
|
|
30
|
-
"@sanity/types": "^3.
|
|
35
|
+
"@sanity/types": "^3.83.0",
|
|
31
36
|
"@sanity/visual-editing": "^2.13.15",
|
|
32
37
|
"defu": "^6.1.4",
|
|
33
38
|
"ofetch": "^1.4.1",
|