sanity 3.87.0 → 3.87.1-canary.4
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/lib/_chunks-cjs/pane.js +95 -84
- package/lib/_chunks-cjs/pane.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/pane.mjs +96 -85
- package/lib/_chunks-es/pane.mjs.map +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/package.json +12 -12
- package/src/structure/panes/document/documentPanel/DocumentPanel.tsx +12 -3
- package/src/structure/panes/document/documentPanel/banners/{AddToReleaseBanner.tsx → DocumentNotInReleaseBanner.tsx} +15 -8
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "sanity",
|
3
|
-
"version": "3.87.
|
3
|
+
"version": "3.87.1-canary.4+84c6362d84",
|
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",
|
@@ -156,11 +156,11 @@
|
|
156
156
|
"@rexxars/react-json-inspector": "^9.0.1",
|
157
157
|
"@sanity/asset-utils": "^2.0.6",
|
158
158
|
"@sanity/bifur-client": "^0.4.1",
|
159
|
-
"@sanity/cli": "3.87.
|
160
|
-
"@sanity/client": "^
|
159
|
+
"@sanity/cli": "3.87.1-canary.4+84c6362d84",
|
160
|
+
"@sanity/client": "^7.0.0",
|
161
161
|
"@sanity/color": "^3.0.0",
|
162
162
|
"@sanity/comlink": "^3.0.1",
|
163
|
-
"@sanity/diff": "3.87.
|
163
|
+
"@sanity/diff": "3.87.1-canary.4+84c6362d84",
|
164
164
|
"@sanity/diff-match-patch": "^3.1.1",
|
165
165
|
"@sanity/diff-patch": "^5.0.0",
|
166
166
|
"@sanity/eventsource": "^5.0.0",
|
@@ -172,16 +172,16 @@
|
|
172
172
|
"@sanity/insert-menu": "^1.1.9",
|
173
173
|
"@sanity/logos": "^2.1.13",
|
174
174
|
"@sanity/message-protocol": "^0.9.0",
|
175
|
-
"@sanity/migrate": "3.87.
|
176
|
-
"@sanity/mutator": "3.87.
|
175
|
+
"@sanity/migrate": "3.87.1-canary.4+84c6362d84",
|
176
|
+
"@sanity/mutator": "3.87.1-canary.4+84c6362d84",
|
177
177
|
"@sanity/presentation-comlink": "^1.0.16",
|
178
178
|
"@sanity/preview-url-secret": "^2.1.7",
|
179
|
-
"@sanity/schema": "3.87.
|
179
|
+
"@sanity/schema": "3.87.1-canary.4+84c6362d84",
|
180
180
|
"@sanity/sdk": "0.0.0-alpha.25",
|
181
181
|
"@sanity/telemetry": "^0.8.0",
|
182
|
-
"@sanity/types": "3.87.
|
183
|
-
"@sanity/ui": "^2.15.
|
184
|
-
"@sanity/util": "3.87.
|
182
|
+
"@sanity/types": "3.87.1-canary.4+84c6362d84",
|
183
|
+
"@sanity/ui": "^2.15.14",
|
184
|
+
"@sanity/util": "3.87.1-canary.4+84c6362d84",
|
185
185
|
"@sanity/uuid": "^3.0.2",
|
186
186
|
"@sentry/react": "^8.33.0",
|
187
187
|
"@tanstack/react-table": "^8.16.0",
|
@@ -281,7 +281,7 @@
|
|
281
281
|
"@repo/dev-aliases": "3.87.0",
|
282
282
|
"@repo/package.config": "3.87.0",
|
283
283
|
"@repo/test-config": "3.87.0",
|
284
|
-
"@sanity/codegen": "3.87.
|
284
|
+
"@sanity/codegen": "3.87.1-canary.4+84c6362d84",
|
285
285
|
"@sanity/generate-help-url": "^3.0.0",
|
286
286
|
"@sanity/pkg-utils": "6.13.4",
|
287
287
|
"@sanity/tsdoc": "1.0.169",
|
@@ -328,5 +328,5 @@
|
|
328
328
|
"engines": {
|
329
329
|
"node": ">=18"
|
330
330
|
},
|
331
|
-
"gitHead": "
|
331
|
+
"gitHead": "84c6362d849ed7a45de7126d3652f9f1e1d2ba03"
|
332
332
|
}
|
@@ -27,9 +27,9 @@ import {
|
|
27
27
|
InsufficientPermissionBanner,
|
28
28
|
ReferenceChangedBanner,
|
29
29
|
} from './banners'
|
30
|
-
import {AddToReleaseBanner} from './banners/AddToReleaseBanner'
|
31
30
|
import {ArchivedReleaseDocumentBanner} from './banners/ArchivedReleaseDocumentBanner'
|
32
31
|
import {CreateLinkedBanner} from './banners/CreateLinkedBanner'
|
32
|
+
import {DocumentNotInReleaseBanner} from './banners/DocumentNotInReleaseBanner'
|
33
33
|
import {DraftLiveEditBanner} from './banners/DraftLiveEditBanner'
|
34
34
|
import {OpenReleaseToEditBanner} from './banners/OpenReleaseToEditBanner'
|
35
35
|
import {ScheduledReleaseBanner} from './banners/ScheduledReleaseBanner'
|
@@ -167,9 +167,17 @@ export const DocumentPanel = function DocumentPanel(props: DocumentPanelProps) {
|
|
167
167
|
if (params?.historyVersion) {
|
168
168
|
return <ArchivedReleaseDocumentBanner />
|
169
169
|
}
|
170
|
+
|
170
171
|
const isScheduledRelease =
|
171
172
|
isReleaseDocument(selectedPerspective) && isReleaseScheduledOrScheduling(selectedPerspective)
|
172
|
-
|
173
|
+
|
174
|
+
const documentInScheduledRelease = Boolean(
|
175
|
+
isScheduledRelease &&
|
176
|
+
displayed?._id &&
|
177
|
+
getVersionFromId(displayed?._id) === selectedReleaseId,
|
178
|
+
)
|
179
|
+
|
180
|
+
if (documentInScheduledRelease) {
|
173
181
|
return <ScheduledReleaseBanner currentRelease={selectedPerspective as ReleaseDocument} />
|
174
182
|
}
|
175
183
|
const isPinnedDraftOrPublish = isSystemBundle(selectedPerspective)
|
@@ -181,10 +189,11 @@ export const DocumentPanel = function DocumentPanel(props: DocumentPanelProps) {
|
|
181
189
|
!isPinnedDraftOrPublish
|
182
190
|
) {
|
183
191
|
return (
|
184
|
-
<
|
192
|
+
<DocumentNotInReleaseBanner
|
185
193
|
documentId={value._id}
|
186
194
|
currentRelease={selectedPerspective as ReleaseDocument}
|
187
195
|
value={displayed || undefined}
|
196
|
+
isScheduledRelease={isScheduledRelease}
|
188
197
|
/>
|
189
198
|
)
|
190
199
|
}
|
@@ -23,14 +23,16 @@ type VersionCreateState = {
|
|
23
23
|
lastUpdate: Date
|
24
24
|
}
|
25
25
|
|
26
|
-
export function
|
26
|
+
export function DocumentNotInReleaseBanner({
|
27
27
|
documentId,
|
28
28
|
currentRelease,
|
29
29
|
value,
|
30
|
+
isScheduledRelease,
|
30
31
|
}: {
|
31
32
|
documentId: string
|
32
33
|
currentRelease: ReleaseDocument
|
33
34
|
value?: Record<string, unknown>
|
35
|
+
isScheduledRelease?: boolean
|
34
36
|
}): React.JSX.Element {
|
35
37
|
const tone = getReleaseTone(currentRelease ?? LATEST)
|
36
38
|
const {t} = useTranslation(structureLocaleNamespace)
|
@@ -98,13 +100,18 @@ export function AddToReleaseBanner({
|
|
98
100
|
/>
|
99
101
|
</Text>
|
100
102
|
}
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
103
|
+
// Adding to a scheduled release is not allowed
|
104
|
+
action={
|
105
|
+
isScheduledRelease
|
106
|
+
? undefined
|
107
|
+
: {
|
108
|
+
text: t('banners.release.action.add-to-release'),
|
109
|
+
tone: tone,
|
110
|
+
disabled: Boolean(versionCreateState),
|
111
|
+
onClick: handleAddToRelease,
|
112
|
+
mode: 'default',
|
113
|
+
}
|
114
|
+
}
|
108
115
|
/>
|
109
116
|
)
|
110
117
|
}
|