next-sanity 13.0.0-cache-components.40 → 13.0.0-cache-components.41
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/live/conditions/default/index.d.ts +2 -2
- package/dist/live/conditions/default/index.d.ts.map +1 -1
- package/dist/live/conditions/default/index.js +2 -2
- package/dist/live/conditions/default/index.js.map +1 -1
- package/dist/live/conditions/next-js/index.d.ts +1 -1
- package/dist/live/conditions/react-server/index.d.ts +1 -1
- package/dist/parseTags.d.ts +1 -21
- package/dist/parseTags.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as isCorsOriginError } from "../../../isCorsOriginError.js";
|
|
2
2
|
import { d as StrictDefinedFetchType, f as StrictDefinedLiveProps, i as LivePerspective, n as DefinedFetchType, r as DefinedLiveProps, t as DefineLiveOptions } from "../../../types.js";
|
|
3
|
-
import { n as
|
|
3
|
+
import { n as resolvePerspectiveFromCookies$1, t as parseTags } from "../../../parseTags.js";
|
|
4
4
|
/**
|
|
5
5
|
* One
|
|
6
6
|
* @public
|
|
@@ -21,6 +21,6 @@ declare function defineLive(config: DefineLiveOptions & {
|
|
|
21
21
|
sanityFetch: DefinedFetchType;
|
|
22
22
|
SanityLive: React.ComponentType<DefinedLiveProps>;
|
|
23
23
|
};
|
|
24
|
-
declare const resolvePerspectiveFromCookies:
|
|
24
|
+
declare const resolvePerspectiveFromCookies: typeof resolvePerspectiveFromCookies$1;
|
|
25
25
|
export { type LivePerspective, defineLive, isCorsOriginError, parseTags, resolvePerspectiveFromCookies };
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/live/conditions/default/index.ts"],"mappings":";;;AAsBA;;;;AAAA,iBAAgB,UAAA,CAAW,MAAA,EAAQ,iBAAA;EAAqB,MAAA;AAAA;EACtD,WAAA,EAAa,sBAAA;EACb,UAAA,EAAY,KAAA,CAAM,aAAA,CAAc,sBAAA;AAAA;;;;;iBAMlB,UAAA,CAAW,MAAA,EAAQ,iBAAA;EAAqB,MAAA;AAAA;EACtD,WAAA,EAAa,gBAAA;EACb,UAAA,EAAY,KAAA,CAAM,aAAA,CAAc,gBAAA;AAAA;AAAA,cAWrB,6BAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/live/conditions/default/index.ts"],"mappings":";;;AAsBA;;;;AAAA,iBAAgB,UAAA,CAAW,MAAA,EAAQ,iBAAA;EAAqB,MAAA;AAAA;EACtD,WAAA,EAAa,sBAAA;EACb,UAAA,EAAY,KAAA,CAAM,aAAA,CAAc,sBAAA;AAAA;;;;;iBAMlB,UAAA,CAAW,MAAA,EAAQ,iBAAA;EAAqB,MAAA;AAAA;EACtD,WAAA,EAAa,gBAAA;EACb,UAAA,EAAY,KAAA,CAAM,aAAA,CAAc,gBAAA;AAAA;AAAA,cAWrB,6BAAA,SAEA,+BAAA"}
|
|
@@ -7,9 +7,9 @@ import { t as parseTags } from "../../../parseTags.js";
|
|
|
7
7
|
function defineLive(_config) {
|
|
8
8
|
throw new Error(`defineLive can't be imported by a client component`);
|
|
9
9
|
}
|
|
10
|
-
const resolvePerspectiveFromCookies = () => {
|
|
10
|
+
const resolvePerspectiveFromCookies = (() => {
|
|
11
11
|
throw new Error(`resolvePerspectiveFromCookies can't be imported by a client component`);
|
|
12
|
-
};
|
|
12
|
+
});
|
|
13
13
|
export { defineLive, isCorsOriginError, parseTags, resolvePerspectiveFromCookies };
|
|
14
14
|
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/live/conditions/default/index.ts"],"sourcesContent":["// This is the fallback export condition for `import 'next-sanity/live'`,\n// it should have the same type definitions as the other conditions so that userland don't have to worry about setting the right\n// `customCondition` in their `tsconfig.json` in order to get accurate typings.\n// The implementation here though should all throw errors, as importing this file means userland made a mistake and somehow a client component is\n// trying to pull in something it shouldn't.\n\nimport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/live/conditions/default/index.ts"],"sourcesContent":["// This is the fallback export condition for `import 'next-sanity/live'`,\n// it should have the same type definitions as the other conditions so that userland don't have to worry about setting the right\n// `customCondition` in their `tsconfig.json` in order to get accurate typings.\n// The implementation here though should all throw errors, as importing this file means userland made a mistake and somehow a client component is\n// trying to pull in something it shouldn't.\n\nimport type {resolvePerspectiveFromCookies as _resolvePerspectiveFromCookies} from '#live/resolvePerspectiveFromCookies'\nimport type {\n DefinedFetchType,\n DefinedLiveProps,\n DefineLiveOptions,\n StrictDefinedFetchType,\n StrictDefinedLiveProps,\n} from '#live/types'\n\nexport {isCorsOriginError} from '#live/isCorsOriginError'\nexport {parseTags} from '#live/parseTags'\n\n/**\n * One\n * @public\n */\nexport function defineLive(config: DefineLiveOptions & {strict: true}): {\n sanityFetch: StrictDefinedFetchType\n SanityLive: React.ComponentType<StrictDefinedLiveProps>\n}\n/**\n * Two\n * @public\n */\nexport function defineLive(config: DefineLiveOptions & {strict?: false}): {\n sanityFetch: DefinedFetchType\n SanityLive: React.ComponentType<DefinedLiveProps>\n}\n/**\n * Three\n * @public\n */\nexport function defineLive(_config: DefineLiveOptions): never {\n throw new Error(`defineLive can't be imported by a client component`)\n}\n\n\nexport const resolvePerspectiveFromCookies = (() => {\n throw new Error(`resolvePerspectiveFromCookies can't be imported by a client component`)\n}) as typeof _resolvePerspectiveFromCookies\n\nexport type {LivePerspective} from '#live/types'\n"],"mappings":";;;;;;AAsCA,SAAgB,WAAW,SAAmC;AAC5D,OAAM,IAAI,MAAM,qDAAqD;;AAIvE,MAAa,uCAAuC;AAClD,OAAM,IAAI,MAAM,wEAAwE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as isCorsOriginError } from "../../../isCorsOriginError.js";
|
|
2
2
|
import { d as StrictDefinedFetchType, f as StrictDefinedLiveProps, i as LivePerspective, n as DefinedFetchType, r as DefinedLiveProps, t as DefineLiveOptions } from "../../../types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as resolvePerspectiveFromCookies, t as parseTags } from "../../../parseTags.js";
|
|
4
4
|
declare function defineLive(config: DefineLiveOptions & {
|
|
5
5
|
strict: true;
|
|
6
6
|
}): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as isCorsOriginError } from "../../../isCorsOriginError.js";
|
|
2
2
|
import { d as StrictDefinedFetchType, f as StrictDefinedLiveProps, i as LivePerspective, n as DefinedFetchType, r as DefinedLiveProps, t as DefineLiveOptions } from "../../../types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as resolvePerspectiveFromCookies, t as parseTags } from "../../../parseTags.js";
|
|
4
4
|
declare function defineLive(config: DefineLiveOptions & {
|
|
5
5
|
strict: true;
|
|
6
6
|
}): {
|
package/dist/parseTags.d.ts
CHANGED
|
@@ -24,26 +24,6 @@ declare function resolvePerspectiveFromCookies({
|
|
|
24
24
|
}: {
|
|
25
25
|
cookies: Awaited<ReturnType<typeof cookies>>;
|
|
26
26
|
}): Promise<Exclude<ClientPerspective, "raw">>;
|
|
27
|
-
/**
|
|
28
|
-
* This helper is intended for use with Next.js Cache Components (`cacheComponents: true`),
|
|
29
|
-
* where `cookies()` and `draftMode()` cannot be called inside `'use cache'` boundaries.
|
|
30
|
-
* Resolve the perspective once outside the cache boundary and pass it in as a prop / cache key.
|
|
31
|
-
*
|
|
32
|
-
* The caller is responsible for awaiting `cookies()` from `next/headers` and passing the
|
|
33
|
-
* resulting cookie store as the `cookies` option — this keeps the helper free of dynamic APIs
|
|
34
|
-
* so it can be invoked from anywhere a `ReadonlyRequestCookies` instance is available.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* import {cookies} from 'next/headers'
|
|
39
|
-
* import {resolvePerspectiveFromCookies} from 'next-sanity/live'
|
|
40
|
-
*
|
|
41
|
-
* const perspective = await resolvePerspectiveFromCookies({cookies: await cookies()})
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
|
-
type ResolvePerspectiveFromCookies = typeof resolvePerspectiveFromCookies;
|
|
47
27
|
declare const cacheTagPrefixes: {
|
|
48
28
|
published: string;
|
|
49
29
|
drafts: string;
|
|
@@ -81,5 +61,5 @@ type ParsedTags = ParsedPublishedTags | ParsedDraftTags;
|
|
|
81
61
|
* ```
|
|
82
62
|
*/
|
|
83
63
|
declare function parseTags(unsafeTags: unknown): ParsedTags;
|
|
84
|
-
export {
|
|
64
|
+
export { resolvePerspectiveFromCookies as n, parseTags as t };
|
|
85
65
|
//# sourceMappingURL=parseTags.d.ts.map
|
package/dist/parseTags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseTags.d.ts","names":[],"sources":["../src/live/shared/resolvePerspectiveFromCookies.ts","../src/live/shared/constants.ts","../src/live/shared/parseTags.ts"],"mappings":";;;AAyBA;;;;;;;;;;;;;;;;;;iBAAsB,6BAAA,CAAA;EACpB,OAAA,EAAS;AAAA;EAET,OAAA,EAAS,OAAA,CAAQ,UAAA,QAAkB,OAAA;AAAA,IACjC,OAAA,CAAQ,OAAA,CAAQ,iBAAA
|
|
1
|
+
{"version":3,"file":"parseTags.d.ts","names":[],"sources":["../src/live/shared/resolvePerspectiveFromCookies.ts","../src/live/shared/constants.ts","../src/live/shared/parseTags.ts"],"mappings":";;;AAyBA;;;;;;;;;;;;;;;;;;iBAAsB,6BAAA,CAAA;EACpB,OAAA,EAAS;AAAA;EAET,OAAA,EAAS,OAAA,CAAQ,UAAA,QAAkB,OAAA;AAAA,IACjC,OAAA,CAAQ,OAAA,CAAQ,iBAAA;AAAA,cCtBP,gBAAA;EACX,SAAA;EACA,MAAA;AAAA;AAAA,UCLQ,mBAAA;EACR,IAAA,YAAgB,gBAAA,CAAiB,SAAA,GAAY,OAAA;EAC7C,MAAA,SAAe,gBAAA,CAAiB,SAAA;EAChC,UAAA;AAAA;AAAA,UAEQ,eAAA;EACR,IAAA,YAAgB,gBAAA,CAAiB,MAAA,GAAS,OAAA;EAC1C,MAAA,SAAe,gBAAA,CAAiB,MAAA;EAChC,UAAA;AAAA;AAAA,KAEG,UAAA,GAAa,mBAAA,GAAsB,eAAA;;;;;;;;;;;;;;;ADPxC;;;;;;ACL+B;iBAmCf,SAAA,CAAU,UAAA,YAAsB,UAAA"}
|