sanity 3.68.4-corel.526 → 3.68.4-corel.527

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.
@@ -1,4 +1,4 @@
1
- const SANITY_VERSION = "3.68.4-corel.526+b512378d01";
1
+ const SANITY_VERSION = "3.68.4-corel.527+e9a5002c70";
2
2
  export {
3
3
  SANITY_VERSION
4
4
  };
package/lib/desk.d.mts CHANGED
@@ -700,10 +700,14 @@ declare interface BaseStructureToolPaneProps<T extends PaneNode_2['type']> {
700
700
  }
701
701
  >
702
702
  /**
703
- * Decides if the pane should check for the global version when determining the document id.
704
- * default: true
703
+ * Allows to override the global version with a specific version or release.
704
+ * @beta
705
705
  */
706
- matchGlobalVersion?: boolean
706
+ forcedVersion?: {
707
+ selectedPerspectiveName: ReleaseId | 'published' | undefined
708
+ isReleaseLocked: boolean
709
+ selectedReleaseId: ReleaseId | undefined
710
+ }
707
711
  }
708
712
 
709
713
  /**
package/lib/desk.d.ts CHANGED
@@ -700,10 +700,14 @@ declare interface BaseStructureToolPaneProps<T extends PaneNode_2['type']> {
700
700
  }
701
701
  >
702
702
  /**
703
- * Decides if the pane should check for the global version when determining the document id.
704
- * default: true
703
+ * Allows to override the global version with a specific version or release.
704
+ * @beta
705
705
  */
706
- matchGlobalVersion?: boolean
706
+ forcedVersion?: {
707
+ selectedPerspectiveName: ReleaseId | 'published' | undefined
708
+ isReleaseLocked: boolean
709
+ selectedReleaseId: ReleaseId | undefined
710
+ }
707
711
  }
708
712
 
709
713
  /**
@@ -145,10 +145,14 @@ declare interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
145
145
  }
146
146
  >
147
147
  /**
148
- * Decides if the pane should check for the global version when determining the document id.
149
- * default: true
148
+ * Allows to override the global version with a specific version or release.
149
+ * @beta
150
150
  */
151
- matchGlobalVersion?: boolean
151
+ forcedVersion?: {
152
+ selectedPerspectiveName: ReleaseId | 'published' | undefined
153
+ isReleaseLocked: boolean
154
+ selectedReleaseId: ReleaseId | undefined
155
+ }
152
156
  }
153
157
 
154
158
  /**
@@ -145,10 +145,14 @@ declare interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
145
145
  }
146
146
  >
147
147
  /**
148
- * Decides if the pane should check for the global version when determining the document id.
149
- * default: true
148
+ * Allows to override the global version with a specific version or release.
149
+ * @beta
150
150
  */
151
- matchGlobalVersion?: boolean
151
+ forcedVersion?: {
152
+ selectedPerspectiveName: ReleaseId | 'published' | undefined
153
+ isReleaseLocked: boolean
154
+ selectedReleaseId: ReleaseId | undefined
155
+ }
152
156
  }
153
157
 
154
158
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity",
3
- "version": "3.68.4-corel.526+b512378d01",
3
+ "version": "3.68.4-corel.527+e9a5002c70",
4
4
  "description": "Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches",
5
5
  "keywords": [
6
6
  "sanity",
@@ -158,11 +158,11 @@
158
158
  "@rexxars/react-json-inspector": "^9.0.1",
159
159
  "@sanity/asset-utils": "^2.0.6",
160
160
  "@sanity/bifur-client": "^0.4.1",
161
- "@sanity/block-tools": "3.68.4-corel.526+b512378d01",
162
- "@sanity/cli": "3.68.4-corel.526+b512378d01",
161
+ "@sanity/block-tools": "3.68.4-corel.527+e9a5002c70",
162
+ "@sanity/cli": "3.68.4-corel.527+e9a5002c70",
163
163
  "@sanity/client": "^6.24.1",
164
164
  "@sanity/color": "^3.0.0",
165
- "@sanity/diff": "3.68.4-corel.526+b512378d01",
165
+ "@sanity/diff": "3.68.4-corel.527+e9a5002c70",
166
166
  "@sanity/diff-match-patch": "^3.1.1",
167
167
  "@sanity/eventsource": "^5.0.0",
168
168
  "@sanity/export": "^3.42.1",
@@ -171,14 +171,14 @@
171
171
  "@sanity/import": "^3.37.9",
172
172
  "@sanity/insert-menu": "1.0.18",
173
173
  "@sanity/logos": "^2.1.4",
174
- "@sanity/migrate": "3.68.4-corel.526+b512378d01",
175
- "@sanity/mutator": "3.68.4-corel.526+b512378d01",
174
+ "@sanity/migrate": "3.68.4-corel.527+e9a5002c70",
175
+ "@sanity/mutator": "3.68.4-corel.527+e9a5002c70",
176
176
  "@sanity/presentation": "1.19.14-release.0",
177
- "@sanity/schema": "3.68.4-corel.526+b512378d01",
177
+ "@sanity/schema": "3.68.4-corel.527+e9a5002c70",
178
178
  "@sanity/telemetry": "^0.7.7",
179
- "@sanity/types": "3.68.4-corel.526+b512378d01",
179
+ "@sanity/types": "3.68.4-corel.527+e9a5002c70",
180
180
  "@sanity/ui": "^2.10.14",
181
- "@sanity/util": "3.68.4-corel.526+b512378d01",
181
+ "@sanity/util": "3.68.4-corel.527+e9a5002c70",
182
182
  "@sanity/uuid": "^3.0.1",
183
183
  "@sentry/react": "^8.33.0",
184
184
  "@tanstack/react-table": "^8.16.0",
@@ -272,7 +272,7 @@
272
272
  "@repo/dev-aliases": "3.68.3",
273
273
  "@repo/package.config": "3.68.3",
274
274
  "@repo/test-config": "3.68.3",
275
- "@sanity/codegen": "3.68.4-corel.526+b512378d01",
275
+ "@sanity/codegen": "3.68.4-corel.527+e9a5002c70",
276
276
  "@sanity/generate-help-url": "^3.0.0",
277
277
  "@sanity/pkg-utils": "6.12.3",
278
278
  "@sanity/tsdoc": "1.0.157",
@@ -315,5 +315,5 @@
315
315
  "engines": {
316
316
  "node": ">=18"
317
317
  },
318
- "gitHead": "b512378d011a6cfcc4b6a66acc6e40f66467b397"
318
+ "gitHead": "e9a5002c70dee7d575cf85867d80feb23c74c69a"
319
319
  }
@@ -1,3 +1,4 @@
1
+ import {type ReleaseId} from '@sanity/client'
1
2
  import {useMemo} from 'react'
2
3
  import {
3
4
  EventsProvider,
@@ -24,7 +25,8 @@ export const DocumentEventsPane = (props: DocumentPaneProviderProps) => {
24
25
 
25
26
  const {selectedPerspectiveName} = usePerspective()
26
27
  const {archivedReleases} = useReleases()
27
- const {rev, since, historyVersion} = params
28
+ const {rev, since} = params
29
+ const historyVersion = params.historyVersion as ReleaseId | undefined
28
30
 
29
31
  const documentId = useMemo(() => {
30
32
  if (
@@ -69,9 +71,24 @@ export const DocumentEventsPane = (props: DocumentPaneProviderProps) => {
69
71
 
70
72
  const value = useMemo(() => eventsStore, [eventsStore])
71
73
 
74
+ const forcedProviderVersion = useMemo(() => {
75
+ if (historyVersion) {
76
+ return {
77
+ selectedPerspectiveName: historyVersion,
78
+ selectedReleaseId: historyVersion,
79
+ isReleaseLocked: true,
80
+ }
81
+ }
82
+ return undefined
83
+ }, [historyVersion])
84
+
72
85
  return (
73
86
  <EventsProvider value={value}>
74
- <DocumentPaneProvider {...props} historyStore={historyStoreProps} />
87
+ <DocumentPaneProvider
88
+ {...props}
89
+ historyStore={historyStoreProps}
90
+ forcedVersion={forcedProviderVersion}
91
+ />
75
92
  </EventsProvider>
76
93
  )
77
94
  }
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable camelcase */
2
- import {type ReleaseId} from '@sanity/client'
3
2
  import {isActionEnabled} from '@sanity/schema/_internal'
4
3
  import {useTelemetry} from '@sanity/telemetry/react'
5
4
  import {
@@ -81,7 +80,7 @@ interface DocumentPaneProviderProps extends DocumentPaneProviderWrapperProps {
81
80
  */
82
81
  // eslint-disable-next-line complexity, max-statements
83
82
  export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
84
- const {children, index, pane, paneKey, onFocusPath, matchGlobalVersion = true} = props
83
+ const {children, index, pane, paneKey, onFocusPath, forcedVersion} = props
85
84
  const schema = useSchema()
86
85
  const templates = useTemplates()
87
86
  const {setDocumentMeta} = useCopyPaste()
@@ -116,20 +115,8 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
116
115
  const perspective = usePerspective()
117
116
 
118
117
  const {isReleaseLocked, selectedReleaseId, selectedPerspectiveName} = useMemo(() => {
119
- if (!matchGlobalVersion) {
120
- return {
121
- selectedPerspectiveName: undefined,
122
- isReleaseLocked: false,
123
- selectedReleaseId: undefined,
124
- }
125
- }
126
- const historyVersion = params.historyVersion as ReleaseId | undefined
127
- if (historyVersion) {
128
- return {
129
- selectedPerspectiveName: historyVersion,
130
- selectedReleaseId: historyVersion,
131
- isReleaseLocked: true,
132
- }
118
+ if (forcedVersion) {
119
+ return forcedVersion
133
120
  }
134
121
  return {
135
122
  selectedPerspectiveName: perspective.selectedPerspectiveName,
@@ -139,8 +126,7 @@ export const DocumentPaneProvider = memo((props: DocumentPaneProviderProps) => {
139
126
  : false,
140
127
  }
141
128
  }, [
142
- matchGlobalVersion,
143
- params.historyVersion,
129
+ forcedVersion,
144
130
  perspective.selectedPerspectiveName,
145
131
  perspective.selectedReleaseId,
146
132
  perspective.selectedPerspective,
@@ -1,3 +1,5 @@
1
+ import {type ReleaseId} from '@sanity/client'
2
+
1
3
  import {type PaneNode} from '../types'
2
4
 
3
5
  export interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
@@ -9,8 +11,12 @@ export interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
9
11
  isActive?: boolean
10
12
  pane: Extract<PaneNode, {type: T}>
11
13
  /**
12
- * Decides if the pane should check for the global version when determining the document id.
13
- * default: true
14
+ * Allows to override the global version with a specific version or release.
15
+ * @beta
14
16
  */
15
- matchGlobalVersion?: boolean
17
+ forcedVersion?: {
18
+ selectedPerspectiveName: ReleaseId | 'published' | undefined
19
+ isReleaseLocked: boolean
20
+ selectedReleaseId: ReleaseId | undefined
21
+ }
16
22
  }