diff --git a/dev/test-studio/.depcheckignore.json b/dev/test-studio/.depcheckignore.json index d82ba3bf601..540c020880f 100644 --- a/dev/test-studio/.depcheckignore.json +++ b/dev/test-studio/.depcheckignore.json @@ -2,10 +2,11 @@ "//": "https://github.com/depcheck/depcheck/pull/756", "ignore": [ "https:", + "@portabletext/react", "@sanity/client", - "@vercel/stega", - "@sanity/visual-editing", + "@sanity/preview-url-secret", "@sanity/react-loader", - "@portabletext/react" + "@sanity/visual-editing", + "@vercel/stega" ] } diff --git a/dev/test-studio/package.json b/dev/test-studio/package.json index dede39db345..186b6496f11 100644 --- a/dev/test-studio/package.json +++ b/dev/test-studio/package.json @@ -35,6 +35,7 @@ "@sanity/logos": "^2.1.2", "@sanity/migrate": "3.29.1", "@sanity/portable-text-editor": "3.29.1", + "@sanity/preview-url-secret": "^1.6.1", "@sanity/react-loader": "^1.8.3", "@sanity/tsdoc": "1.0.0-alpha.38", "@sanity/types": "3.29.1", diff --git a/dev/test-studio/plugins/router-debug/RouterDebug.tsx b/dev/test-studio/plugins/router-debug/RouterDebug.tsx index dc90ab9d3d0..746a29637e0 100644 --- a/dev/test-studio/plugins/router-debug/RouterDebug.tsx +++ b/dev/test-studio/plugins/router-debug/RouterDebug.tsx @@ -1,4 +1,6 @@ +import {createPreviewSecret} from '@sanity/preview-url-secret/create-secret' import {Button, Card, Code, Flex, Stack, Text} from '@sanity/ui' +import {useClient} from 'sanity' import {IntentLink, RouteScope, StateLink, useRouter, useStateLink} from 'sanity/router' export function RouterDebug() { @@ -11,10 +13,16 @@ export function RouterDebug() { }, }) + const client = useClient() + return ( + + Tool home Boolean(type.type && type.type.name === 'document') -const isSanityType = (type: SchemaType): boolean => type.name.startsWith('sanity.') +const isIgnoredType = (type: SchemaType): boolean => + type.name.startsWith('sanity.') && type.name !== 'sanity.previewUrlSecret' /** * @internal @@ -16,4 +17,4 @@ export const getSearchableTypes = (schema: Schema): ObjectSchemaType[] => .map((typeName) => schema.get(typeName)) .filter(isNonNullable) .filter((schemaType) => isDocumentType(schemaType)) - .filter((type) => !isSanityType(type)) as ObjectSchemaType[] + .filter((type) => !isIgnoredType(type)) as ObjectSchemaType[] diff --git a/packages/sanity/src/structure/panes/documentList/listenSearchQuery.ts b/packages/sanity/src/structure/panes/documentList/listenSearchQuery.ts index 3b8d7f4f0c0..af80bb118b6 100644 --- a/packages/sanity/src/structure/panes/documentList/listenSearchQuery.ts +++ b/packages/sanity/src/structure/panes/documentList/listenSearchQuery.ts @@ -90,7 +90,7 @@ export function listenSearchQuery(options: ListenQueryOptions): Observable { const types = getSearchTypesWithMaxDepth( getSearchableTypes(schema).filter((type) => { - return typeNames.includes(type.name) || type.name === 'sanity.previewUrlSecret' + return typeNames.includes(type.name) }), maxFieldDepth, ) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe43137adce..1c7696bd25b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -425,6 +425,9 @@ importers: '@sanity/portable-text-editor': specifier: 3.29.1 version: link:../../packages/@sanity/portable-text-editor + '@sanity/preview-url-secret': + specifier: ^1.6.1 + version: 1.6.1(@sanity/client@6.12.4) '@sanity/react-loader': specifier: ^1.8.3 version: 1.8.3(@sanity/client@6.12.4)(react@18.2.0)