next-sanity 6.1.2 → 7.0.0
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/README.md +5 -0
- package/dist/client.cjs +1 -23
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -18
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +1 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/preview/index.cjs +1 -31
- package/dist/preview/index.cjs.map +1 -1
- package/dist/preview/index.d.ts +12 -3
- package/dist/preview/index.js +1 -2
- package/dist/preview/index.js.map +1 -1
- package/dist/preview/live-query.cjs +1 -19
- package/dist/preview/live-query.cjs.map +1 -1
- package/dist/preview/live-query.d.ts +6 -0
- package/dist/preview/live-query.js +1 -2
- package/dist/preview/live-query.js.map +1 -1
- package/dist/studio/NextStudio.cjs +1 -58
- package/dist/studio/NextStudio.cjs.map +1 -1
- package/dist/studio/NextStudio.js +1 -53
- package/dist/studio/NextStudio.js.map +1 -1
- package/dist/studio/NextStudioClientOnly.cjs +1 -20
- package/dist/studio/NextStudioClientOnly.cjs.map +1 -1
- package/dist/studio/NextStudioClientOnly.js +1 -15
- package/dist/studio/NextStudioClientOnly.js.map +1 -1
- package/dist/studio/NextStudioLayout.cjs +1 -32
- package/dist/studio/NextStudioLayout.cjs.map +1 -1
- package/dist/studio/NextStudioLayout.js +1 -27
- package/dist/studio/NextStudioLayout.js.map +1 -1
- package/dist/studio/NextStudioLoading.cjs +1 -108
- package/dist/studio/NextStudioLoading.cjs.map +1 -1
- package/dist/studio/NextStudioLoading.js +1 -103
- package/dist/studio/NextStudioLoading.js.map +1 -1
- package/dist/studio/NextStudioNoScript.cjs +1 -30
- package/dist/studio/NextStudioNoScript.cjs.map +1 -1
- package/dist/studio/NextStudioNoScript.js +1 -25
- package/dist/studio/NextStudioNoScript.js.map +1 -1
- package/dist/studio/index.cjs +1 -18
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +1 -7
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/loading.cjs +1 -8
- package/dist/studio/loading.cjs.map +1 -1
- package/dist/studio/loading.js +1 -2
- package/dist/studio/loading.js.map +1 -1
- package/dist/studio/metadata.cjs +1 -11
- package/dist/studio/metadata.cjs.map +1 -1
- package/dist/studio/metadata.js +1 -6
- package/dist/studio/metadata.js.map +1 -1
- package/dist/studio/usePrefersColorScheme.cjs +1 -30
- package/dist/studio/usePrefersColorScheme.cjs.map +1 -1
- package/dist/studio/usePrefersColorScheme.js +1 -25
- package/dist/studio/usePrefersColorScheme.js.map +1 -1
- package/dist/studio/useTheme.cjs +1 -13
- package/dist/studio/useTheme.cjs.map +1 -1
- package/dist/studio/useTheme.js +1 -8
- package/dist/studio/useTheme.js.map +1 -1
- package/dist/studio/viewport.cjs +1 -13
- package/dist/studio/viewport.cjs.map +1 -1
- package/dist/studio/viewport.js +1 -8
- package/dist/studio/viewport.js.map +1 -1
- package/dist/webhook/config.cjs +1 -19
- package/dist/webhook/config.cjs.map +1 -1
- package/dist/webhook/config.js +1 -14
- package/dist/webhook/config.js.map +1 -1
- package/dist/webhook/parseBody.cjs +1 -60
- package/dist/webhook/parseBody.cjs.map +1 -1
- package/dist/webhook/parseBody.js +1 -54
- package/dist/webhook/parseBody.js.map +1 -1
- package/dist/webhook/readBody.cjs +1 -14
- package/dist/webhook/readBody.cjs.map +1 -1
- package/dist/webhook/readBody.js +1 -9
- package/dist/webhook/readBody.js.map +1 -1
- package/dist/webhook.cjs +1 -11
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.js +1 -3
- package/dist/webhook.js.map +1 -1
- package/package.json +8 -23
- package/src/preview/LiveQuery/index.ts +1 -0
- package/src/preview/index.ts +4 -1
- package/dist/studio/head/NextStudioHead.cjs +0 -52
- package/dist/studio/head/NextStudioHead.cjs.map +0 -1
- package/dist/studio/head/NextStudioHead.js +0 -47
- package/dist/studio/head/NextStudioHead.js.map +0 -1
- package/dist/studio/head/apple-touch-icon.png.cjs +0 -5
- package/dist/studio/head/apple-touch-icon.png.cjs.map +0 -1
- package/dist/studio/head/apple-touch-icon.png.js +0 -3
- package/dist/studio/head/apple-touch-icon.png.js.map +0 -1
- package/dist/studio/head/favicon.ico.cjs +0 -5
- package/dist/studio/head/favicon.ico.cjs.map +0 -1
- package/dist/studio/head/favicon.ico.js +0 -3
- package/dist/studio/head/favicon.ico.js.map +0 -1
- package/dist/studio/head/favicon.svg.cjs +0 -5
- package/dist/studio/head/favicon.svg.cjs.map +0 -1
- package/dist/studio/head/favicon.svg.js +0 -3
- package/dist/studio/head/favicon.svg.js.map +0 -1
- package/dist/studio/head.cjs +0 -9
- package/dist/studio/head.cjs.js +0 -4
- package/dist/studio/head.cjs.map +0 -1
- package/dist/studio/head.d.ts +0 -82
- package/dist/studio/head.js +0 -3
- package/dist/studio/head.js.map +0 -1
- package/src/studio/head/NextStudioHead.tsx +0 -113
- package/src/studio/head/apple-touch-icon.png +0 -0
- package/src/studio/head/favicon-192.png +0 -0
- package/src/studio/head/favicon-512.png +0 -0
- package/src/studio/head/favicon.ico +0 -0
- package/src/studio/head/favicon.svg +0 -7
- package/src/studio/head/index.ts +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
The official [Sanity.io][sanity] toolkit for Next.js apps.
|
|
4
4
|
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> You're looking at the README for v7, the README for [v6 is available here.](https://github.com/sanity-io/next-sanity/tree/v6?tab=readme-ov-file#next-sanity)
|
|
7
|
+
|
|
5
8
|
**Features:**
|
|
6
9
|
|
|
7
10
|
- The [Sanity Client][sanity-client] fully compatible with [Next.js’ caching features][next-cache]
|
|
@@ -711,6 +714,7 @@ function StudioPage() {
|
|
|
711
714
|
|
|
712
715
|
## Migration guides
|
|
713
716
|
|
|
717
|
+
- [From `v6` to `v7`][migrate-v6-to-v7]
|
|
714
718
|
- [From `v5` to `v6`][migrate-v5-to-v6]
|
|
715
719
|
- From `v4` to `v5`
|
|
716
720
|
- [`app-router`][migrate-v4-to-v5-app]
|
|
@@ -738,6 +742,7 @@ MIT-licensed. See [LICENSE][LICENSE].
|
|
|
738
742
|
[migrate-v4-to-v5-app]: ./MIGRATE-v4-to-v5-pages-app-router.md
|
|
739
743
|
[migrate-v4-to-v5-pages]: ./MIGRATE-v4-to-v5-pages-pages-router.md
|
|
740
744
|
[migrate-v5-to-v6]: ./MIGRATE-v5-to-v6.md
|
|
745
|
+
[migrate-v6-to-v7]: ./MIGRATE-v6-to-v7.md
|
|
741
746
|
[next-cache]: https://nextjs.org/docs/app/building-your-application/caching
|
|
742
747
|
[next-data-fetching]: https://nextjs.org/docs/basic-features/data-fetching/overview
|
|
743
748
|
[next-preview-mode]: https://nextjs.org/docs/advanced-features/preview-mode
|
package/dist/client.cjs
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var client = require('@sanity/preview-kit/client');
|
|
8
|
-
function createClient(config) {
|
|
9
|
-
let {
|
|
10
|
-
// eslint-disable-next-line prefer-const, no-process-env
|
|
11
|
-
studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,
|
|
12
|
-
encodeSourceMap = studioUrl ? "auto" : false
|
|
13
|
-
} = config;
|
|
14
|
-
if (encodeSourceMap === "auto" && process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
|
|
15
|
-
encodeSourceMap = true;
|
|
16
|
-
}
|
|
17
|
-
return client.createClient({
|
|
18
|
-
...config,
|
|
19
|
-
studioUrl,
|
|
20
|
-
encodeSourceMap
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.createClient = createClient;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@sanity/preview-kit/client");exports.createClient=function(r){let{studioUrl:t=process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,encodeSourceMap:o=!!t&&"auto"}=r;return"auto"===o&&"preview"===process.env.NEXT_PUBLIC_VERCEL_ENV&&(o=!0),e.createClient({...r,studioUrl:t,encodeSourceMap:o})};
|
|
24
2
|
//# sourceMappingURL=client.cjs.map
|
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["studioUrl","encodeSourceMap"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.cjs","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["config","studioUrl","process","env","NEXT_PUBLIC_SANITY_STUDIO_URL","encodeSourceMap","NEXT_PUBLIC_VERCEL_ENV","createPreviewKitClient"],"mappings":"qIAgCO,SAAsBA,GACvB,IAAAC,UAEFA,EAAYC,QAAQC,IAAIC,8BAAAC,gBACxBA,IAAkBJ,GAAY,QAC5BD,EAKJ,MAHwB,SAApBK,GAAqE,YAAvCH,QAAQC,IAAIG,yBAC1BD,GAAA,GAEbE,EAAAA,aAAuB,IAAIP,EAAQC,YAAWI,mBACvD"}
|
package/dist/client.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { createClient as createClient$1 } from '@sanity/preview-kit/client';
|
|
3
|
-
function createClient(config) {
|
|
4
|
-
let {
|
|
5
|
-
// eslint-disable-next-line prefer-const, no-process-env
|
|
6
|
-
studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,
|
|
7
|
-
encodeSourceMap = studioUrl ? "auto" : false
|
|
8
|
-
} = config;
|
|
9
|
-
if (encodeSourceMap === "auto" && process.env.NEXT_PUBLIC_VERCEL_ENV === "preview") {
|
|
10
|
-
encodeSourceMap = true;
|
|
11
|
-
}
|
|
12
|
-
return createClient$1({
|
|
13
|
-
...config,
|
|
14
|
-
studioUrl,
|
|
15
|
-
encodeSourceMap
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
export { createClient };
|
|
1
|
+
import{createClient as e}from"@sanity/preview-kit/client";function o(o){let{studioUrl:r=process.env.NEXT_PUBLIC_SANITY_STUDIO_URL,encodeSourceMap:t=!!r&&"auto"}=o;return"auto"===t&&"preview"===process.env.NEXT_PUBLIC_VERCEL_ENV&&(t=!0),e({...o,studioUrl:r,encodeSourceMap:t})}export{o as createClient};
|
|
19
2
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["studioUrl","encodeSourceMap"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import {\n createClient as createPreviewKitClient,\n type PreviewKitClientConfig,\n} from '@sanity/preview-kit/client'\n\nexport type * from '@sanity/preview-kit/client'\n\n/** @public */\nexport interface ClientConfig\n extends Omit<PreviewKitClientConfig, 'studioUrl' | 'encodeSourceMap'> {\n /**\n * Where the Studio is hosted.\n * If it's embedded in the app, use the base path for example `/studio`.\n * Otherwise provide the full URL to where the Studio is hosted, for example: `https://blog.sanity.studio`.\n * @defaultValue process.env.NEXT_PUBLIC_SANITY_STUDIO_URL\n * @alpha\n */\n studioUrl?: PreviewKitClientConfig['studioUrl']\n /**\n * If there's no `studioUrl` then the default value is `none` and the normal `@sanity/client` will be used. If `studioUrl` is set, then it's `auto` by default.\n * @defaultValue process.env.MEXT_PUBLIC_SANITY_SOURCE_MAP || studioUrl ? 'auto' : 'none'\n * @alpha\n */\n encodeSourceMap?: PreviewKitClientConfig['encodeSourceMap']\n}\n\n/** @public */\nexport type SanityClient = ReturnType<typeof createPreviewKitClient>\n\n/**\n * @public\n */\nexport function createClient(config: ClientConfig): SanityClient {\n let {\n // eslint-disable-next-line prefer-const, no-process-env\n studioUrl = process.env.NEXT_PUBLIC_SANITY_STUDIO_URL! as PreviewKitClientConfig['studioUrl'],\n encodeSourceMap = studioUrl ? 'auto' : false,\n } = config\n // eslint-disable-next-line no-process-env\n if (encodeSourceMap === 'auto' && process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {\n encodeSourceMap = true\n }\n return createPreviewKitClient({...config, studioUrl, encodeSourceMap})\n}\n"],"names":["createClient","config","studioUrl","process","env","NEXT_PUBLIC_SANITY_STUDIO_URL","encodeSourceMap","NEXT_PUBLIC_VERCEL_ENV","createPreviewKitClient"],"mappings":"0DAgCO,SAASA,EAAaC,GACvB,IAAAC,UAEFA,EAAYC,QAAQC,IAAIC,8BAAAC,gBACxBA,IAAkBJ,GAAY,QAC5BD,EAKJ,MAHwB,SAApBK,GAAqE,YAAvCH,QAAQC,IAAIG,yBAC1BD,GAAA,GAEbE,EAAuB,IAAIP,EAAQC,YAAWI,mBACvD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var client = require('./client.cjs');
|
|
8
|
-
var groq = require('groq');
|
|
9
|
-
function _interopDefaultCompat(e) {
|
|
10
|
-
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
11
|
-
default: e
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
var groq__default = /*#__PURE__*/_interopDefaultCompat(groq);
|
|
15
|
-
exports.createClient = client.createClient;
|
|
16
|
-
Object.defineProperty(exports, 'groq', {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return groq__default.default;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./client.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("groq"));exports.createClient=e.createClient,Object.defineProperty(exports,"groq",{enumerable:!0,get:function(){return r.default}});
|
|
22
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/preview/index.cjs
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var previewKit = require('@sanity/preview-kit');
|
|
8
|
-
function _interopDefaultCompat(e) {
|
|
9
|
-
return e && typeof e === 'object' && 'default' in e ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
var previewKit__default = /*#__PURE__*/_interopDefaultCompat(previewKit);
|
|
14
|
-
Object.defineProperty(exports, 'LiveQueryProvider', {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return previewKit.LiveQueryProvider;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, 'default', {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return previewKit__default.default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, 'useLiveQuery', {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () {
|
|
29
|
-
return previewKit.useLiveQuery;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@sanity/preview-kit");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(e);Object.defineProperty(exports,"LiveQueryProvider",{enumerable:!0,get:function(){return e.LiveQueryProvider}}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"useLiveQuery",{enumerable:!0,get:function(){return e.useLiveQuery}});
|
|
32
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/preview/index.d.ts
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import {CacheOptions} from '@sanity/preview-kit'
|
|
2
|
-
import {ClientQueryParams} from '@sanity/preview-kit'
|
|
3
2
|
import {default as default_2} from '@sanity/preview-kit'
|
|
3
|
+
import {DefineListenerContext} from '@sanity/preview-kit'
|
|
4
4
|
import {isEqualFn} from '@sanity/preview-kit'
|
|
5
|
+
import {ListenerGetSnapshot} from '@sanity/preview-kit'
|
|
6
|
+
import {ListenerSubscribe} from '@sanity/preview-kit'
|
|
5
7
|
import {LiveQueryHookOptions} from '@sanity/preview-kit'
|
|
6
8
|
import {LiveQueryProvider} from '@sanity/preview-kit'
|
|
7
9
|
import {LiveQueryProviderProps} from '@sanity/preview-kit'
|
|
8
10
|
import {Logger} from '@sanity/preview-kit'
|
|
11
|
+
import {QueryEnabled} from '@sanity/preview-kit'
|
|
9
12
|
import {QueryLoading} from '@sanity/preview-kit'
|
|
10
13
|
import {useLiveQuery} from '@sanity/preview-kit'
|
|
11
14
|
|
|
12
15
|
export {CacheOptions}
|
|
13
16
|
|
|
14
|
-
export {ClientQueryParams}
|
|
15
|
-
|
|
16
17
|
export default default_2
|
|
17
18
|
|
|
19
|
+
export {DefineListenerContext}
|
|
20
|
+
|
|
18
21
|
export {isEqualFn}
|
|
19
22
|
|
|
23
|
+
export {ListenerGetSnapshot}
|
|
24
|
+
|
|
25
|
+
export {ListenerSubscribe}
|
|
26
|
+
|
|
20
27
|
export {LiveQueryHookOptions}
|
|
21
28
|
|
|
22
29
|
export {LiveQueryProvider}
|
|
@@ -25,6 +32,8 @@ export {LiveQueryProviderProps}
|
|
|
25
32
|
|
|
26
33
|
export {Logger}
|
|
27
34
|
|
|
35
|
+
export {QueryEnabled}
|
|
36
|
+
|
|
28
37
|
export {QueryLoading}
|
|
29
38
|
|
|
30
39
|
export {useLiveQuery}
|
package/dist/preview/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var liveQuery = require('@sanity/preview-kit/live-query');
|
|
8
|
-
Object.defineProperty(exports, 'LiveQuery', {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return liveQuery.LiveQuery;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, 'default', {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return liveQuery.LiveQuery;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@sanity/preview-kit/live-query");Object.defineProperty(exports,"LiveQuery",{enumerable:!0,get:function(){return e.LiveQuery}}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.LiveQuery}});
|
|
20
2
|
//# sourceMappingURL=live-query.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-query.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"live-query.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {LiveQuery} from '@sanity/preview-kit/live-query'
|
|
2
|
+
import {LiveQueryClientComponentProps} from '@sanity/preview-kit/live-query'
|
|
3
|
+
import {LiveQueryProps} from '@sanity/preview-kit/live-query'
|
|
2
4
|
|
|
3
5
|
export {LiveQuery}
|
|
4
6
|
export default LiveQuery
|
|
5
7
|
|
|
8
|
+
export {LiveQueryClientComponentProps}
|
|
9
|
+
|
|
10
|
+
export {LiveQueryProps}
|
|
11
|
+
|
|
6
12
|
export {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-query.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"live-query.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var sanity = require('sanity');
|
|
10
|
-
var NextStudioClientOnly = require('./NextStudioClientOnly.cjs');
|
|
11
|
-
var NextStudioLayout = require('./NextStudioLayout.cjs');
|
|
12
|
-
var NextStudioLoading = require('./NextStudioLoading.cjs');
|
|
13
|
-
var NextStudioNoScript = require('./NextStudioNoScript.cjs');
|
|
14
|
-
const NextStudioComponent = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
config,
|
|
18
|
-
unstable__noScript = true,
|
|
19
|
-
unstable__fastRender,
|
|
20
|
-
scheme,
|
|
21
|
-
...props
|
|
22
|
-
} = _ref;
|
|
23
|
-
if (unstable__fastRender) {
|
|
24
|
-
return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
25
|
-
children: [unstable__noScript && /* @__PURE__ */jsxRuntime.jsx(NextStudioNoScript.NextStudioNoScript, {}), /* @__PURE__ */jsxRuntime.jsx(NextStudioLayout.NextStudioLayout, {
|
|
26
|
-
config,
|
|
27
|
-
scheme,
|
|
28
|
-
children: children || /* @__PURE__ */jsxRuntime.jsx(sanity.Studio, {
|
|
29
|
-
config,
|
|
30
|
-
scheme,
|
|
31
|
-
unstable_globalStyles: true,
|
|
32
|
-
...props
|
|
33
|
-
})
|
|
34
|
-
})]
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38
|
-
children: [unstable__noScript && /* @__PURE__ */jsxRuntime.jsx(NextStudioNoScript.NextStudioNoScript, {}), /* @__PURE__ */jsxRuntime.jsx(NextStudioClientOnly.NextStudioClientOnly, {
|
|
39
|
-
fallback: /* @__PURE__ */jsxRuntime.jsx(NextStudioLoading.NextStudioLoading, {
|
|
40
|
-
unstable__noScript,
|
|
41
|
-
config,
|
|
42
|
-
scheme
|
|
43
|
-
}),
|
|
44
|
-
children: /* @__PURE__ */jsxRuntime.jsx(NextStudioLayout.NextStudioLayout, {
|
|
45
|
-
config,
|
|
46
|
-
scheme,
|
|
47
|
-
children: children || /* @__PURE__ */jsxRuntime.jsx(sanity.Studio, {
|
|
48
|
-
config,
|
|
49
|
-
scheme,
|
|
50
|
-
unstable_globalStyles: true,
|
|
51
|
-
...props
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
})]
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const NextStudio = react.memo(NextStudioComponent);
|
|
58
|
-
exports.NextStudio = NextStudio;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("sanity"),r=require("./NextStudioClientOnly.cjs"),s=require("./NextStudioLayout.cjs"),o=require("./NextStudioLoading.cjs"),c=require("./NextStudioNoScript.cjs");const n=t.memo((t=>{let{children:n,config:u,unstable__noScript:l=!0,unstable__fastRender:d,scheme:x,...a}=t;return d?e.jsxs(e.Fragment,{children:[l&&e.jsx(c.NextStudioNoScript,{}),e.jsx(s.NextStudioLayout,{config:u,scheme:x,children:n||e.jsx(i.Studio,{config:u,scheme:x,unstable_globalStyles:!0,...a})})]}):e.jsxs(e.Fragment,{children:[l&&e.jsx(c.NextStudioNoScript,{}),e.jsx(r.NextStudioClientOnly,{fallback:e.jsx(o.NextStudioLoading,{unstable__noScript:l,config:u,scheme:x}),children:e.jsx(s.NextStudioLayout,{config:u,scheme:x,children:n||e.jsx(i.Studio,{config:u,scheme:x,unstable_globalStyles:!0,...a})})})]})}));exports.NextStudio=n;
|
|
59
2
|
//# sourceMappingURL=NextStudio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudio.cjs","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n"],"names":["unstable__noScript","
|
|
1
|
+
{"version":3,"file":"NextStudio.cjs","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n"],"names":["NextStudio","memo","_ref","children","config","unstable__noScript","unstable__fastRender","scheme","props","jsxs","Fragment","NextStudioNoScript","jsx","NextStudioLayout","Studio","unstable_globalStyles","NextStudioClientOnly","fallback","NextStudioLoading"],"mappings":"qSA8BA,MA0DaA,EAAaC,QA1DEC,IAOL,IAPMC,SAC3BA,EAAAC,OACAA,EAAAC,mBACAA,GAAqB,EAAAC,qBACrBA,EAAAC,OACAA,KACGC,GACkBN,EACrB,OAAII,EAGGG,EAAAA,KAAAC,WAAA,CAAAP,SAAA,CAAAE,SAAuBM,EAAmBA,mBAAA,IAC1CC,EAAAA,IAAAC,EAAAA,iBAAA,CAAiBT,SAAgBG,SAC/BJ,SACCA,GAAAS,EAAAA,IAACE,EAAOA,OAAA,CAAAV,SAAgBG,SAAgBQ,uBAAqB,KAAKP,SASvEC,EAAAA,KAAAC,WAAA,CAAAP,SAAA,CAAAE,SAAuBM,EAAmBA,mBAAA,IAC3CC,EAAAA,IAACI,EAAAA,qBAAA,CACCC,SACEL,EAAAA,IAACM,EAAAA,kBAAA,CACCb,qBACAD,SACAG,WAIJJ,SAACS,EAAAA,IAAAC,mBAAA,CAAiBT,SAAgBG,SAC/BJ,SACCA,GAAAS,EAAAA,IAACE,EAAAA,OAAO,CAAAV,SAAgBG,SAAgBQ,uBAAqB,KAAKP,UAI1E"}
|
|
@@ -1,54 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { Studio } from 'sanity';
|
|
5
|
-
import { NextStudioClientOnly } from './NextStudioClientOnly.js';
|
|
6
|
-
import { NextStudioLayout } from './NextStudioLayout.js';
|
|
7
|
-
import { NextStudioLoading } from './NextStudioLoading.js';
|
|
8
|
-
import { NextStudioNoScript } from './NextStudioNoScript.js';
|
|
9
|
-
const NextStudioComponent = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
children,
|
|
12
|
-
config,
|
|
13
|
-
unstable__noScript = true,
|
|
14
|
-
unstable__fastRender,
|
|
15
|
-
scheme,
|
|
16
|
-
...props
|
|
17
|
-
} = _ref;
|
|
18
|
-
if (unstable__fastRender) {
|
|
19
|
-
return /* @__PURE__ */jsxs(Fragment, {
|
|
20
|
-
children: [unstable__noScript && /* @__PURE__ */jsx(NextStudioNoScript, {}), /* @__PURE__ */jsx(NextStudioLayout, {
|
|
21
|
-
config,
|
|
22
|
-
scheme,
|
|
23
|
-
children: children || /* @__PURE__ */jsx(Studio, {
|
|
24
|
-
config,
|
|
25
|
-
scheme,
|
|
26
|
-
unstable_globalStyles: true,
|
|
27
|
-
...props
|
|
28
|
-
})
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */jsxs(Fragment, {
|
|
33
|
-
children: [unstable__noScript && /* @__PURE__ */jsx(NextStudioNoScript, {}), /* @__PURE__ */jsx(NextStudioClientOnly, {
|
|
34
|
-
fallback: /* @__PURE__ */jsx(NextStudioLoading, {
|
|
35
|
-
unstable__noScript,
|
|
36
|
-
config,
|
|
37
|
-
scheme
|
|
38
|
-
}),
|
|
39
|
-
children: /* @__PURE__ */jsx(NextStudioLayout, {
|
|
40
|
-
config,
|
|
41
|
-
scheme,
|
|
42
|
-
children: children || /* @__PURE__ */jsx(Studio, {
|
|
43
|
-
config,
|
|
44
|
-
scheme,
|
|
45
|
-
unstable_globalStyles: true,
|
|
46
|
-
...props
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
})]
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
const NextStudio = memo(NextStudioComponent);
|
|
53
|
-
export { NextStudio };
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{memo as i}from"react";import{Studio as r}from"sanity";import{NextStudioClientOnly as n}from"./NextStudioClientOnly.js";import{NextStudioLayout as c}from"./NextStudioLayout.js";import{NextStudioLoading as l}from"./NextStudioLoading.js";import{NextStudioNoScript as m}from"./NextStudioNoScript.js";const s=i((i=>{let{children:s,config:a,unstable__noScript:f=!0,unstable__fastRender:d,scheme:h,...u}=i;return e(t,d?{children:[f&&o(m,{}),o(c,{config:a,scheme:h,children:s||o(r,{config:a,scheme:h,unstable_globalStyles:!0,...u})})]}:{children:[f&&o(m,{}),o(n,{fallback:o(l,{unstable__noScript:f,config:a,scheme:h}),children:o(c,{config:a,scheme:h,children:s||o(r,{config:a,scheme:h,unstable_globalStyles:!0,...u})})})]})}));export{s as NextStudio};
|
|
54
2
|
//# sourceMappingURL=NextStudio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudio.js","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n"],"names":["
|
|
1
|
+
{"version":3,"file":"NextStudio.js","sources":["../../src/studio/NextStudio.tsx"],"sourcesContent":["import {memo} from 'react'\nimport {Studio, type StudioProps} from 'sanity'\n\nimport {NextStudioClientOnly} from './NextStudioClientOnly'\nimport {NextStudioLayout} from './NextStudioLayout'\nimport {NextStudioLoading} from './NextStudioLoading'\nimport {NextStudioNoScript} from './NextStudioNoScript'\n\nexport type {NextStudioLoadingProps} from './NextStudioLoading'\n\n/** @beta */\nexport interface NextStudioProps extends StudioProps {\n children?: React.ReactNode\n /**\n * Render the <noscript> tag\n * @defaultValue true\n * @alpha\n */\n unstable__noScript?: boolean\n /**\n * Render in a faster mode that requires `styled-components` SSR to be setup.\n * @defaultValue false\n * @alpha\n */\n unstable__fastRender?: boolean\n}\n/**\n * Intended to render at the root of a page, letting the Studio own that page and render much like it would if you used `npx sanity start` to render\n * It's a drop-in replacement for `import {Studio} from 'sanity'`\n */\nconst NextStudioComponent = ({\n children,\n config,\n unstable__noScript = true,\n unstable__fastRender,\n scheme,\n ...props\n}: NextStudioProps) => {\n if (unstable__fastRender) {\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </>\n )\n }\n\n return (\n <>\n {unstable__noScript && <NextStudioNoScript />}\n <NextStudioClientOnly\n fallback={\n <NextStudioLoading\n unstable__noScript={unstable__noScript}\n config={config}\n scheme={scheme}\n />\n }\n >\n <NextStudioLayout config={config} scheme={scheme}>\n {children || (\n <Studio config={config} scheme={scheme} unstable_globalStyles {...props} />\n )}\n </NextStudioLayout>\n </NextStudioClientOnly>\n </>\n )\n}\n\n/**\n * Override how the Studio renders by passing children.\n * This is useful for advanced use cases where you're using StudioProvider and StudioLayout instead of Studio:\n * ```\n * import {StudioProvider, StudioLayout} from 'sanity'\n * import {NextStudio} from 'next-sanity/studio'\n * <NextStudio config={config}>\n * <StudioProvider config={config}>\n * <CustomComponentThatUsesContextFromStudioProvider />\n * <StudioLayout />\n * </StudioProvider>\n * </NextStudio>\n * ```\n * @beta\n */\nexport const NextStudio = memo(NextStudioComponent)\n"],"names":["NextStudio","memo","_ref","children","config","unstable__noScript","unstable__fastRender","scheme","props","jsxs","Fragment","NextStudioNoScript","jsx","NextStudioLayout","Studio","unstable_globalStyles","NextStudioClientOnly","fallback","NextStudioLoading"],"mappings":"+WA8BA,MA0DaA,EAAaC,GA1DEC,IAOL,IAPMC,SAC3BA,EAAAC,OACAA,EAAAC,mBACAA,GAAqB,EAAAC,qBACrBA,EAAAC,OACAA,KACGC,GACkBN,EACrB,OAGOO,EAAAC,EAHHJ,EAGG,CAAAH,SAAA,CAAAE,KAAuBM,EAAmB,IAC1CC,EAAAC,EAAA,CAAiBT,SAAgBG,SAC/BJ,SACCA,GAAAS,EAACE,EAAO,CAAAV,SAAgBG,SAAgBQ,uBAAqB,KAAKP,QASvE,CAAAL,SAAA,CAAAE,KAAuBM,EAAmB,IAC3CC,EAACI,EAAA,CACCC,SACEL,EAACM,EAAA,CACCb,qBACAD,SACAG,WAIJJ,SAACS,EAAAC,EAAA,CAAiBT,SAAgBG,SAC/BJ,SACCA,GAAAS,EAACE,EAAO,CAAAV,SAAgBG,SAAgBQ,uBAAqB,KAAKP,UAI1E"}
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
function NextStudioClientOnly(_ref) {
|
|
10
|
-
let {
|
|
11
|
-
children,
|
|
12
|
-
fallback
|
|
13
|
-
} = _ref;
|
|
14
|
-
const [mounted, setMounted] = react.useState(false);
|
|
15
|
-
react.useEffect(() => react.startTransition(() => setMounted(true)), []);
|
|
16
|
-
return /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
17
|
-
children: mounted ? children : fallback
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.NextStudioClientOnly = NextStudioClientOnly;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");exports.NextStudioClientOnly=function(r){let{children:n,fallback:i}=r;const[s,u]=t.useState(!1);return t.useEffect((()=>t.startTransition((()=>u(!0)))),[]),e.jsx(e.Fragment,{children:s?n:i})};
|
|
21
2
|
//# sourceMappingURL=NextStudioClientOnly.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioClientOnly.cjs","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["fallback","useEffect","
|
|
1
|
+
{"version":3,"file":"NextStudioClientOnly.cjs","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["_ref","children","fallback","mounted","setMounted","useState","useEffect","startTransition","jsx","Fragment"],"mappings":"uJASO,SAA8BA,GAAiD,IAAjDC,SAACA,EAAUC,SAAAA,GAAsCF,EACpF,MAAOG,EAASC,GAAcC,YAAS,GAGhC,OAFGC,EAAAA,WAAA,IAAMC,EAAAA,iBAAgB,IAAMH,GAAW,MAAQ,IAElDI,EAAAA,IAAAC,EAAAA,SAAA,CAAGR,SAAUE,EAAAF,EAAWC,GACjC"}
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect, startTransition } from 'react';
|
|
4
|
-
function NextStudioClientOnly(_ref) {
|
|
5
|
-
let {
|
|
6
|
-
children,
|
|
7
|
-
fallback
|
|
8
|
-
} = _ref;
|
|
9
|
-
const [mounted, setMounted] = useState(false);
|
|
10
|
-
useEffect(() => startTransition(() => setMounted(true)), []);
|
|
11
|
-
return /* @__PURE__ */jsx(Fragment, {
|
|
12
|
-
children: mounted ? children : fallback
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
export { NextStudioClientOnly };
|
|
1
|
+
import{jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as e,useEffect as c,startTransition as n}from"react";function o(o){let{children:i,fallback:l}=o;const[m,a]=e(!1);return c((()=>n((()=>a(!0)))),[]),r(t,{children:m?i:l})}export{o as NextStudioClientOnly};
|
|
16
2
|
//# sourceMappingURL=NextStudioClientOnly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioClientOnly.js","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["fallback","useEffect","
|
|
1
|
+
{"version":3,"file":"NextStudioClientOnly.js","sources":["../../src/studio/NextStudioClientOnly.tsx"],"sourcesContent":["import {type ReactNode, startTransition, useEffect, useState} from 'react'\n\n/** @alpha */\nexport type NextStudioClientOnlyProps = {\n children: ReactNode\n fallback: ReactNode\n}\n\n/** @alpha */\nexport function NextStudioClientOnly({children, fallback}: NextStudioClientOnlyProps) {\n const [mounted, setMounted] = useState(false)\n useEffect(() => startTransition(() => setMounted(true)), [])\n\n return <>{mounted ? children : fallback}</>\n}\n"],"names":["NextStudioClientOnly","_ref","children","fallback","mounted","setMounted","useState","useEffect","startTransition","jsx","Fragment"],"mappings":"2HASO,SAASA,EAAqBC,GAAiD,IAAjDC,SAACA,EAAUC,SAAAA,GAAsCF,EACpF,MAAOG,EAASC,GAAcC,GAAS,GAGhC,OAFGC,GAAA,IAAMC,GAAgB,IAAMH,GAAW,MAAQ,IAElDI,EAAAC,EAAA,CAAGR,SAAUE,EAAAF,EAAWC,GACjC"}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var useTheme = require('./useTheme.cjs');
|
|
10
|
-
const NextStudioLayoutComponent = _ref => {
|
|
11
|
-
let {
|
|
12
|
-
children,
|
|
13
|
-
config,
|
|
14
|
-
scheme = "light"
|
|
15
|
-
} = _ref;
|
|
16
|
-
const theme = useTheme.useTheme(config);
|
|
17
|
-
return /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
18
|
-
"data-ui": "NextStudioLayout",
|
|
19
|
-
style: {
|
|
20
|
-
fontFamily: theme.fonts.text.family,
|
|
21
|
-
backgroundColor: theme.color[scheme === "dark" ? "dark" : "light"].default.base.bg,
|
|
22
|
-
height: "100vh",
|
|
23
|
-
maxHeight: "100dvh",
|
|
24
|
-
overscrollBehavior: "none",
|
|
25
|
-
WebkitFontSmoothing: "antialiased",
|
|
26
|
-
overflow: "auto"
|
|
27
|
-
},
|
|
28
|
-
children
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
const NextStudioLayout = react.memo(NextStudioLayoutComponent);
|
|
32
|
-
exports.NextStudioLayout = NextStudioLayout;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./useTheme.cjs");const r=t.memo((t=>{let{children:r,config:i,scheme:a="light"}=t;const s=o.useTheme(i);return e.jsx("div",{"data-ui":"NextStudioLayout",style:{fontFamily:s.fonts.text.family,backgroundColor:s.color["dark"===a?"dark":"light"].default.base.bg,height:"100vh",maxHeight:"100dvh",overscrollBehavior:"none",WebkitFontSmoothing:"antialiased",overflow:"auto"},children:r})}));exports.NextStudioLayout=r;
|
|
33
2
|
//# sourceMappingURL=NextStudioLayout.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioLayout.cjs","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["scheme","style","fontFamily","backgroundColor","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow"
|
|
1
|
+
{"version":3,"file":"NextStudioLayout.cjs","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["NextStudioLayout","memo","_ref","children","config","scheme","theme","useTheme","jsx","style","fontFamily","fonts","text","family","backgroundColor","color","default","base","bg","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow"],"mappings":"sJAWA,MA0BaA,EAAmBC,QA1BEC,IAIL,IAJMC,SACjCA,EAAAC,OACAA,EAAAC,OACAA,EAAS,SACkBH,EACrB,MAAAI,EAAQC,WAASH,GAGrB,OAAAI,EAAAA,IAAC,MAAA,CACC,UAAQ,mBACRC,MAAO,CACLC,WAAYJ,EAAMK,MAAMC,KAAKC,OAC7BC,gBAAiBR,EAAMS,MAAiB,SAAXV,EAAoB,OAAS,SAASW,QAAQC,KAAKC,GAChFC,OAAQ,QACRC,UAAW,SACXC,mBAAoB,OACpBC,oBAAqB,cACrBC,SAAU,QAGXpB,YACH"}
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { useTheme } from './useTheme.js';
|
|
5
|
-
const NextStudioLayoutComponent = _ref => {
|
|
6
|
-
let {
|
|
7
|
-
children,
|
|
8
|
-
config,
|
|
9
|
-
scheme = "light"
|
|
10
|
-
} = _ref;
|
|
11
|
-
const theme = useTheme(config);
|
|
12
|
-
return /* @__PURE__ */jsx("div", {
|
|
13
|
-
"data-ui": "NextStudioLayout",
|
|
14
|
-
style: {
|
|
15
|
-
fontFamily: theme.fonts.text.family,
|
|
16
|
-
backgroundColor: theme.color[scheme === "dark" ? "dark" : "light"].default.base.bg,
|
|
17
|
-
height: "100vh",
|
|
18
|
-
maxHeight: "100dvh",
|
|
19
|
-
overscrollBehavior: "none",
|
|
20
|
-
WebkitFontSmoothing: "antialiased",
|
|
21
|
-
overflow: "auto"
|
|
22
|
-
},
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const NextStudioLayout = memo(NextStudioLayoutComponent);
|
|
27
|
-
export { NextStudioLayout };
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{memo as o}from"react";import{useTheme as e}from"./useTheme.js";const r=o((o=>{let{children:r,config:i,scheme:a="light"}=o;const l=e(i);return t("div",{"data-ui":"NextStudioLayout",style:{fontFamily:l.fonts.text.family,backgroundColor:l.color["dark"===a?"dark":"light"].default.base.bg,height:"100vh",maxHeight:"100dvh",overscrollBehavior:"none",WebkitFontSmoothing:"antialiased",overflow:"auto"},children:r})}));export{r as NextStudioLayout};
|
|
28
2
|
//# sourceMappingURL=NextStudioLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextStudioLayout.js","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["scheme","style","fontFamily","backgroundColor","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow"
|
|
1
|
+
{"version":3,"file":"NextStudioLayout.js","sources":["../../src/studio/NextStudioLayout.tsx"],"sourcesContent":["/* eslint-disable camelcase */\nimport {memo} from 'react'\nimport type {StudioProps} from 'sanity'\n\nimport {useTheme} from './useTheme'\n\n/** @alpha */\nexport interface NextStudioLayoutProps extends Pick<StudioProps, 'config' | 'scheme'> {\n children: React.ReactNode\n}\n\nconst NextStudioLayoutComponent = ({\n children,\n config,\n scheme = 'light',\n}: NextStudioLayoutProps) => {\n const theme = useTheme(config)\n\n return (\n <div\n data-ui=\"NextStudioLayout\"\n style={{\n fontFamily: theme.fonts.text.family,\n backgroundColor: theme.color[scheme === 'dark' ? 'dark' : 'light'].default.base.bg,\n height: '100vh',\n maxHeight: '100dvh',\n overscrollBehavior: 'none',\n WebkitFontSmoothing: 'antialiased',\n overflow: 'auto',\n }}\n >\n {children}\n </div>\n )\n}\n\n/** @alpha */\nexport const NextStudioLayout = memo(NextStudioLayoutComponent)\n"],"names":["NextStudioLayout","memo","_ref","children","config","scheme","theme","useTheme","jsx","style","fontFamily","fonts","text","family","backgroundColor","color","default","base","bg","height","maxHeight","overscrollBehavior","WebkitFontSmoothing","overflow"],"mappings":"8GAWA,MA0BaA,EAAmBC,GA1BEC,IAIL,IAJMC,SACjCA,EAAAC,OACAA,EAAAC,OACAA,EAAS,SACkBH,EACrB,MAAAI,EAAQC,EAASH,GAGrB,OAAAI,EAAC,MAAA,CACC,UAAQ,mBACRC,MAAO,CACLC,WAAYJ,EAAMK,MAAMC,KAAKC,OAC7BC,gBAAiBR,EAAMS,MAAiB,SAAXV,EAAoB,OAAS,SAASW,QAAQC,KAAKC,GAChFC,OAAQ,QACRC,UAAW,SACXC,mBAAoB,OACpBC,oBAAqB,cACrBC,SAAU,QAGXpB,YACH"}
|