sanity 5.28.0-next.1 → 5.28.0-next.11
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-dts/types2.d.ts +1 -1
- package/lib/_chunks-es/PresentationToolGrantsCheck.js +10 -3
- package/lib/_chunks-es/PresentationToolGrantsCheck.js.map +1 -1
- package/lib/_chunks-es/createAgentBundlesStore.js +52 -0
- package/lib/_chunks-es/createAgentBundlesStore.js.map +1 -0
- package/lib/_chunks-es/resources.js +1 -0
- package/lib/_chunks-es/resources.js.map +1 -1
- package/lib/_chunks-es/resources2.js +1 -0
- package/lib/_chunks-es/resources2.js.map +1 -1
- package/lib/_chunks-es/resources3.js +1 -0
- package/lib/_chunks-es/resources3.js.map +1 -1
- package/lib/_chunks-es/resources4.js +1 -0
- package/lib/_chunks-es/resources4.js.map +1 -1
- package/lib/_chunks-es/resources5.js +1 -0
- package/lib/_chunks-es/resources5.js.map +1 -1
- package/lib/_chunks-es/resources6.js +1 -0
- package/lib/_chunks-es/resources6.js.map +1 -1
- package/lib/_chunks-es/version.js +2 -2
- package/lib/index.js +55 -88
- package/lib/index.js.map +1 -1
- package/package.json +16 -16
|
@@ -3,7 +3,7 @@ import { SanityDocument } from "@sanity/types";
|
|
|
3
3
|
import { ClientPerspective, StackablePerspective } from "@sanity/client";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
import { DocumentStore, DocumentValuePermission, PermissionCheckResult, SanityClient as SanityClient$1 } from "sanity";
|
|
6
|
-
import { PreviewUrlResolver } from "/home/runner/work/sanity/sanity/node_modules/.pnpm/@sanity+preview-url-secret@4.0.
|
|
6
|
+
import { PreviewUrlResolver } from "/home/runner/work/sanity/sanity/node_modules/.pnpm/@sanity+preview-url-secret@4.0.6_@sanity+client@7.22.0/node_modules/@sanity/preview-url-secret/dist/define-preview-url.js";
|
|
7
7
|
import * as _$xstate from "xstate";
|
|
8
8
|
import { ActorRefFrom } from "xstate";
|
|
9
9
|
interface Context$2 {
|
|
@@ -29,6 +29,7 @@ import { disablePreviewAccessSharing, enablePreviewAccessSharing } from "@sanity
|
|
|
29
29
|
import { validateApiPerspective } from "@sanity/client";
|
|
30
30
|
import isEqual from "fast-deep-equal";
|
|
31
31
|
import { match } from "path-to-regexp";
|
|
32
|
+
import { isAgentBundleName } from "./createAgentBundlesStore.js";
|
|
32
33
|
import { createPreviewSecret } from "@sanity/preview-url-secret/create-secret";
|
|
33
34
|
import { uuid } from "@sanity/uuid";
|
|
34
35
|
import { throwError } from "rxjs";
|
|
@@ -2517,15 +2518,21 @@ function _temp2$4(unsub) {
|
|
|
2517
2518
|
return unsub();
|
|
2518
2519
|
}
|
|
2519
2520
|
function usePresentationPerspective(t0) {
|
|
2520
|
-
const $ = c(
|
|
2521
|
+
const $ = c(3), {
|
|
2521
2522
|
scheduledDraft
|
|
2522
2523
|
} = t0, {
|
|
2523
2524
|
selectedPerspectiveName: t1,
|
|
2524
2525
|
selectedReleaseId,
|
|
2525
2526
|
perspectiveStack
|
|
2526
2527
|
} = usePerspective(), selectedPerspectiveName = t1 === void 0 ? "drafts" : t1;
|
|
2527
|
-
|
|
2528
|
-
|
|
2528
|
+
if (selectedReleaseId || scheduledDraft || isAgentBundleName(selectedPerspectiveName)) {
|
|
2529
|
+
if (scheduledDraft) {
|
|
2530
|
+
let t2;
|
|
2531
|
+
return $[0] !== perspectiveStack || $[1] !== scheduledDraft ? (t2 = [scheduledDraft, ...perspectiveStack], $[0] = perspectiveStack, $[1] = scheduledDraft, $[2] = t2) : t2 = $[2], t2;
|
|
2532
|
+
}
|
|
2533
|
+
return perspectiveStack;
|
|
2534
|
+
}
|
|
2535
|
+
return selectedPerspectiveName === "published" ? "published" : "drafts";
|
|
2529
2536
|
}
|
|
2530
2537
|
function useStatus() {
|
|
2531
2538
|
const $ = c(4);
|