Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: content releases #8454

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ const config = {
'sortOrder',
'status',
'group',
'textWeight',
'showChangesBy',
],
},
},
Expand Down
4 changes: 2 additions & 2 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@portabletext/block-tools": "^1.1.3",
"@portabletext/editor": "^1.26.3",
"@portabletext/react": "^3.0.0",
"@sanity/assist": "^3.0.2",
"@sanity/assist": "^3.1.0",
"@sanity/client": "^6.27.2",
"@sanity/color": "^3.0.0",
"@sanity/color-input": "^4.0.1",
Expand All @@ -34,7 +34,7 @@
"@sanity/logos": "^2.1.2",
"@sanity/migrate": "workspace:*",
"@sanity/preview-url-secret": "^2.1.4",
"@sanity/react-loader": "^1.8.3",
"@sanity/react-loader": "^1.10.35",
"@sanity/tsdoc": "1.0.169",
"@sanity/types": "workspace:*",
"@sanity/ui": "^2.11.7",
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/preview/loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const client = createClient({
projectId: 'ppsg7ml5',
dataset: 'playground',
useCdn: true,
apiVersion: '2023-02-06',
apiVersion: 'X',
stega: {
enabled: true,
studioUrl: '/presentation',
Expand Down
5 changes: 5 additions & 0 deletions dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ export default defineConfig([
dataset: 'playground',
plugins: [sharedSettings()],
basePath: '/playground',
beta: {
eventsAPI: {
releases: true,
},
},
},
{
name: 'listener-events',
Expand Down
1 change: 1 addition & 0 deletions packages/@sanity/types/src/reference/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type ReferenceFilterSearchOptions = {
tag?: string
maxFieldDepth?: number
strategy?: SearchStrategy
perspective?: string | string[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the ClientPerspective type from @sanity/client here?

}

/** @public */
Expand Down
3 changes: 3 additions & 0 deletions packages/@sanity/types/src/schema/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export interface PrepareViewOptions {

/** @public */
export interface PreviewValue {
_id?: string
_createdAt?: string
_updatedAt?: string
title?: string
subtitle?: string
description?: string
Expand Down
3 changes: 2 additions & 1 deletion packages/@sanity/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"json5": "^2.2.3",
"lodash": "^4.17.21",
"quick-lru": "^5.1.1",
"react-compiler-runtime": "19.0.0-beta-27714ef-20250124"
"react-compiler-runtime": "19.0.0-beta-27714ef-20250124",
"react-fast-compare": "^3.2.2"
},
"devDependencies": {
"@repo/package.config": "workspace:*",
Expand Down
5 changes: 3 additions & 2 deletions packages/@sanity/vision/src/SanityVision.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type Tool, useClient} from 'sanity'
import {type Tool, useClient, usePerspective} from 'sanity'

import {DEFAULT_API_VERSION} from './apiVersions'
import {VisionContainer} from './containers/VisionContainer'
Expand All @@ -11,14 +11,15 @@ interface SanityVisionProps {

function SanityVision(props: SanityVisionProps) {
const client = useClient({apiVersion: '1'})
const perspective = usePerspective()
const config: VisionConfig = {
defaultApiVersion: DEFAULT_API_VERSION,
...props.tool.options,
}

return (
<VisionErrorBoundary>
<VisionContainer client={client} config={config} />
<VisionContainer client={client} config={config} pinnedPerspective={perspective} />
</VisionErrorBoundary>
)
}
Expand Down
Loading
Loading