sanity 5.28.0-next.10 → 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.
@@ -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(5), {
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
- let t2;
2528
- return $[0] !== perspectiveStack || $[1] !== scheduledDraft || $[2] !== selectedPerspectiveName || $[3] !== selectedReleaseId ? (t2 = selectedReleaseId || scheduledDraft ? scheduledDraft ? [scheduledDraft, ...perspectiveStack] : perspectiveStack : selectedPerspectiveName === "published" ? "published" : "drafts", $[0] = perspectiveStack, $[1] = scheduledDraft, $[2] = selectedPerspectiveName, $[3] = selectedReleaseId, $[4] = t2) : t2 = $[4], t2;
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);