next-sanity 13.0.0-cache-components.26 → 13.0.0-cache-components.27
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/hooks/index.d.ts +2 -30
- package/dist/hooks/index.js +1 -12
- package/package.json +2 -2
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
import { useIsPresentationTool, useOptimistic, useVisualEditingEnvironment } from "@sanity/visual-editing/react";
|
|
2
|
-
|
|
3
|
-
/** @alpha */
|
|
4
|
-
type UsePresentationQueryReturnsInactive = {
|
|
5
|
-
data: null;
|
|
6
|
-
sourceMap: null;
|
|
7
|
-
perspective: null;
|
|
8
|
-
};
|
|
9
|
-
/** @alpha */
|
|
10
|
-
type UsePresentationQueryReturnsActive<QueryString extends string> = {
|
|
11
|
-
data: ClientReturn<QueryString>;
|
|
12
|
-
sourceMap: ContentSourceMap | null;
|
|
13
|
-
perspective: ClientPerspective;
|
|
14
|
-
};
|
|
15
|
-
type UsePresentationQueryReturns<QueryString extends string> = UsePresentationQueryReturnsInactive | UsePresentationQueryReturnsActive<QueryString>;
|
|
16
|
-
/**
|
|
17
|
-
* Experimental hook that can run queries in Presentation Tool.
|
|
18
|
-
* Query results are sent back over postMessage whenever the query results change.
|
|
19
|
-
* It also works with optimistic updates in the studio itself, offering low latency updates.
|
|
20
|
-
* It's not as low latency as the `useOptimistic` hook, but it's a good compromise for some use cases.
|
|
21
|
-
* Especially until `useOptimistic` propagates edits in the Studio parent window back into the iframe.
|
|
22
|
-
* @alpha
|
|
23
|
-
*/
|
|
24
|
-
declare function usePresentationQuery<const QueryString extends string>(_: {
|
|
25
|
-
query: QueryString;
|
|
26
|
-
params?: QueryParams | Promise<QueryParams>;
|
|
27
|
-
stega?: boolean;
|
|
28
|
-
}): UsePresentationQueryReturns<QueryString>;
|
|
29
|
-
export { useIsPresentationTool, useOptimistic, usePresentationQuery, useVisualEditingEnvironment };
|
|
30
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { useIsPresentationTool, useOptimistic, usePresentationQuery, useVisualEditingEnvironment } from "@sanity/visual-editing/react";
|
|
2
|
+
export { useIsPresentationTool, useOptimistic, usePresentationQuery, useVisualEditingEnvironment };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useIsPresentationTool, useOptimistic, useVisualEditingEnvironment } from "@sanity/visual-editing/react";
|
|
3
|
-
const initialState = {
|
|
4
|
-
data: null,
|
|
5
|
-
sourceMap: null,
|
|
6
|
-
perspective: null
|
|
7
|
-
};
|
|
8
|
-
function usePresentationQuery(_) {
|
|
9
|
-
console.log("TODO: Implement usePresentationQuery");
|
|
10
|
-
return initialState;
|
|
11
|
-
}
|
|
2
|
+
import { useIsPresentationTool, useOptimistic, usePresentationQuery, useVisualEditingEnvironment } from "@sanity/visual-editing/react";
|
|
12
3
|
export { useIsPresentationTool, useOptimistic, usePresentationQuery, useVisualEditingEnvironment };
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-sanity",
|
|
3
|
-
"version": "13.0.0-cache-components.
|
|
3
|
+
"version": "13.0.0-cache-components.27",
|
|
4
4
|
"description": "Sanity.io toolkit for Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"live",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@sanity/comlink": "^4.0.1",
|
|
67
67
|
"@sanity/presentation-comlink": "^2.0.1",
|
|
68
68
|
"@sanity/preview-url-secret": "^4.0.3",
|
|
69
|
-
"@sanity/visual-editing": "^5.
|
|
69
|
+
"@sanity/visual-editing": "^5.3.0",
|
|
70
70
|
"@sanity/webhook": "^4.0.4",
|
|
71
71
|
"dequal": "^2.0.3",
|
|
72
72
|
"groq": "^5.8.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/visual-editing/hooks/usePresentationQuery.ts"],"mappings":";;;KAGY,mCAAA;EACV,IAAA;EACA,SAAA;EACA,WAAA;AAAA;;KAIU,iCAAA;EACV,IAAA,EAAM,YAAA,CAAa,WAAA;EACnB,SAAA,EAAW,gBAAA;EACX,WAAA,EAAa,iBAAA;AAAA;AAAA,KAGH,2BAAA,+BACR,mCAAA,GACA,iCAAA,CAAkC,WAAA;;;;;;;;;iBAgBtB,oBAAA,kCAAA,CAAuD,CAAA;EACrE,KAAA,EAAO,WAAA;EACP,MAAA,GAAS,WAAA,GAAc,OAAA,CAAQ,WAAA;EAC/B,KAAA;AAAA,IACE,2BAAA,CAA4B,WAAA"}
|
package/dist/hooks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/visual-editing/hooks/usePresentationQuery.ts"],"sourcesContent":["import type {ClientPerspective, ClientReturn, ContentSourceMap, QueryParams} from '@sanity/client'\n\n/** @alpha */\nexport type UsePresentationQueryReturnsInactive = {\n data: null\n sourceMap: null\n perspective: null\n}\n\n/** @alpha */\nexport type UsePresentationQueryReturnsActive<QueryString extends string> = {\n data: ClientReturn<QueryString>\n sourceMap: ContentSourceMap | null\n perspective: ClientPerspective\n}\n\nexport type UsePresentationQueryReturns<QueryString extends string> =\n | UsePresentationQueryReturnsInactive\n | UsePresentationQueryReturnsActive<QueryString>\n\nconst initialState: UsePresentationQueryReturnsInactive = {\n data: null,\n sourceMap: null,\n perspective: null,\n}\n\n/**\n * Experimental hook that can run queries in Presentation Tool.\n * Query results are sent back over postMessage whenever the query results change.\n * It also works with optimistic updates in the studio itself, offering low latency updates.\n * It's not as low latency as the `useOptimistic` hook, but it's a good compromise for some use cases.\n * Especially until `useOptimistic` propagates edits in the Studio parent window back into the iframe.\n * @alpha\n */\nexport function usePresentationQuery<const QueryString extends string>(_: {\n query: QueryString\n params?: QueryParams | Promise<QueryParams>\n stega?: boolean\n}): UsePresentationQueryReturns<QueryString> {\n // oxlint-disable-next-line no-console\n console.log('TODO: Implement usePresentationQuery')\n\n return initialState\n}\n"],"mappings":";;AAoBA,MAAM,eAAoD;CACxD,MAAM;CACN,WAAW;CACX,aAAa;CACd;AAUD,SAAgB,qBAAuD,GAI1B;AAE3C,SAAQ,IAAI,uCAAuC;AAEnD,QAAO"}
|