sanity 5.1.0-next.13 → 5.1.0-next.15

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.
@@ -7,7 +7,7 @@ try {
7
7
  try {
8
8
  buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
9
9
  // and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
10
- "5.1.0-next.13+05f65ae994";
10
+ "5.1.0-next.15+b86a4f6ad7";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
@@ -14618,7 +14618,7 @@ declare interface Tag {
14618
14618
  *
14619
14619
  * @public
14620
14620
  */
14621
- declare type TargetPerspective = ReleaseDocument | SystemBundle
14621
+ declare type TargetPerspective = ReleaseDocument | SystemBundle | string
14622
14622
 
14623
14623
  /**
14624
14624
  * A value representing a perspective, including the data describing it. This is either the name of a
@@ -14626,7 +14626,7 @@ declare type TargetPerspective = ReleaseDocument | SystemBundle
14626
14626
  *
14627
14627
  * @public
14628
14628
  */
14629
- declare type TargetPerspective_2 = ReleaseDocument | SystemBundle_2
14629
+ declare type TargetPerspective_2 = ReleaseDocument | SystemBundle_2 | string
14630
14630
 
14631
14631
  /**
14632
14632
  * @beta
package/lib/desk.d.ts CHANGED
@@ -12681,7 +12681,7 @@ declare type SystemBundle_2 = 'drafts' | 'published'
12681
12681
  *
12682
12682
  * @public
12683
12683
  */
12684
- declare type TargetPerspective = ReleaseDocument | SystemBundle
12684
+ declare type TargetPerspective = ReleaseDocument | SystemBundle | string
12685
12685
 
12686
12686
  /**
12687
12687
  * A value representing a perspective, including the data describing it. This is either the name of a
@@ -12689,7 +12689,7 @@ declare type TargetPerspective = ReleaseDocument | SystemBundle
12689
12689
  *
12690
12690
  * @public
12691
12691
  */
12692
- declare type TargetPerspective_2 = ReleaseDocument | SystemBundle_2
12692
+ declare type TargetPerspective_2 = ReleaseDocument | SystemBundle_2 | string
12693
12693
 
12694
12694
  /**
12695
12695
  * An initial value template is a template that can be used to create a new documents.
package/lib/index.d.ts CHANGED
@@ -15230,7 +15230,7 @@ export declare type TagsArrayInputProps = ArrayOfPrimitivesInputProps<string>
15230
15230
  *
15231
15231
  * @public
15232
15232
  */
15233
- export declare type TargetPerspective = ReleaseDocument | SystemBundle
15233
+ export declare type TargetPerspective = ReleaseDocument | SystemBundle | string
15234
15234
 
15235
15235
  /**
15236
15236
  *
package/lib/index.js CHANGED
@@ -58081,7 +58081,7 @@ function useValidationStatus(validationTargetId, docTypeName, requireReferenceEx
58081
58081
  return $[0] !== docTypeName || $[1] !== documentStore.pair || $[2] !== requireReferenceExistence || $[3] !== validationTargetId ? (t0 = documentStore.pair.validation(validationTargetId, docTypeName, requireReferenceExistence), $[0] = docTypeName, $[1] = documentStore.pair, $[2] = requireReferenceExistence, $[3] = validationTargetId, $[4] = t0) : t0 = $[4], useObservable(t0, INITIAL);
58082
58082
  }
58083
58083
  function getSelectedPerspective(selectedPerspectiveName, releases2) {
58084
- return selectedPerspectiveName ? selectedPerspectiveName === "published" ? "published" : releases2.find((release) => getReleaseIdFromReleaseDocumentId(release._id) === selectedPerspectiveName) || "drafts" : "drafts";
58084
+ return selectedPerspectiveName ? selectedPerspectiveName === "published" ? "published" : releases2.find((release) => getReleaseIdFromReleaseDocumentId(release._id) === selectedPerspectiveName) || selectedPerspectiveName : "drafts";
58085
58085
  }
58086
58086
  function useComlinkViewHistory(t0) {
58087
58087
  const $ = c(18), {
@@ -79442,7 +79442,10 @@ function CurrentGlobalPerspectiveLabel(t0) {
79442
79442
  $[0] !== selectedPerspective || $[1] !== t ? (t2 = isPublishedPerspective(selectedPerspective) || isDraftPerspective(selectedPerspective) ? /* @__PURE__ */ jsx(Box, { padding: 2, style: {
79443
79443
  userSelect: "none",
79444
79444
  overflow: "hidden"
79445
- }, children: /* @__PURE__ */ jsx(Text$1, { size: 1, textOverflow: "ellipsis", weight: "medium", children: isPublishedPerspective(selectedPerspective) ? t("release.chip.published") : t("release.chip.global.drafts") }) }) : /* @__PURE__ */ jsx(ReleasesLink, { selectedPerspective }), $[0] = selectedPerspective, $[1] = t, $[2] = t2) : t2 = $[2];
79445
+ }, children: /* @__PURE__ */ jsx(Text$1, { size: 1, textOverflow: "ellipsis", weight: "medium", children: isPublishedPerspective(selectedPerspective) ? t("release.chip.published") : t("release.chip.global.drafts") }) }) : isReleaseDocument(selectedPerspective) ? /* @__PURE__ */ jsx(ReleasesLink, { selectedPerspective }) : /* @__PURE__ */ jsx(Box, { padding: 2, style: {
79446
+ userSelect: "none",
79447
+ overflow: "hidden"
79448
+ }, children: /* @__PURE__ */ jsx(Text$1, { size: 1, textOverflow: "ellipsis", weight: "medium", children: selectedPerspective }) }), $[0] = selectedPerspective, $[1] = t, $[2] = t2) : t2 = $[2];
79446
79449
  let t3;
79447
79450
  return $[3] !== t1 || $[4] !== t2 ? (t3 = /* @__PURE__ */ jsx(AnimatedTextWidth, { text: t1, children: t2 }), $[3] = t1, $[4] = t2, $[5] = t3) : t3 = $[5], t3;
79448
79451
  }
@@ -79796,16 +79799,14 @@ function ReleasesList(t0) {
79796
79799
  setScrollContainer,
79797
79800
  onScroll,
79798
79801
  isRangeVisible,
79799
- selectedReleaseId,
79802
+ selectedPerspectiveName,
79800
79803
  handleOpenBundleDialog,
79801
79804
  scrollElementRef,
79802
79805
  menuItemProps
79803
79806
  } = t0, {
79804
79807
  loading,
79805
79808
  data: allReleases
79806
- } = useActiveReleases(), {
79807
- selectedPerspectiveName
79808
- } = usePerspective();
79809
+ } = useActiveReleases();
79809
79810
  let t1;
79810
79811
  $[0] !== allReleases ? (t1 = allReleases.filter(_temp$y), $[0] = allReleases, $[1] = t1) : t1 = $[1];
79811
79812
  const releases2 = t1, {
@@ -79827,7 +79828,7 @@ function ReleasesList(t0) {
79827
79828
  }), {}), $[2] = releases2, $[3] = t4) : t4 = $[3];
79828
79829
  const sortedReleaseTypeReleases = t4, isDraftsPerspective = typeof selectedPerspectiveName > "u";
79829
79830
  let lastIndex, offsets;
79830
- if ($[4] !== isDraftModelEnabled || $[5] !== isDraftsPerspective || $[6] !== selectedReleaseId || $[7] !== sortedReleaseTypeReleases) {
79831
+ if ($[4] !== isDraftModelEnabled || $[5] !== isDraftsPerspective || $[6] !== selectedPerspectiveName || $[7] !== sortedReleaseTypeReleases) {
79831
79832
  lastIndex = isDraftsPerspective ? 1 : 0;
79832
79833
  let t52;
79833
79834
  $[10] !== isDraftModelEnabled ? (t52 = [PUBLISHED$1, isDraftModelEnabled ? LATEST : []].flat(), $[10] = isDraftModelEnabled, $[11] = t52) : t52 = $[11];
@@ -79845,10 +79846,10 @@ function ReleasesList(t0) {
79845
79846
  const groupSubsetReleases = sortedReleaseTypeReleases[type], offset = offsets[type];
79846
79847
  groupSubsetReleases.forEach((release_0, groupReleaseIndex) => {
79847
79848
  const index = offset + groupReleaseIndex;
79848
- selectedReleaseId === getReleaseIdFromReleaseDocumentId(release_0._id) && (lastIndex = index);
79849
+ selectedPerspectiveName === getReleaseIdFromReleaseDocumentId(release_0._id) && (lastIndex = index);
79849
79850
  });
79850
79851
  };
79851
- orderedReleaseTypes.forEach(adjustIndexForReleaseType), $[4] = isDraftModelEnabled, $[5] = isDraftsPerspective, $[6] = selectedReleaseId, $[7] = sortedReleaseTypeReleases, $[8] = lastIndex, $[9] = offsets;
79852
+ orderedReleaseTypes.forEach(adjustIndexForReleaseType), $[4] = isDraftModelEnabled, $[5] = isDraftsPerspective, $[6] = selectedPerspectiveName, $[7] = sortedReleaseTypeReleases, $[8] = lastIndex, $[9] = offsets;
79852
79853
  } else
79853
79854
  lastIndex = $[8], offsets = $[9];
79854
79855
  let t5;
@@ -79928,7 +79929,7 @@ const useScrollIndicatorVisibility = () => {
79928
79929
  `;
79929
79930
  function GlobalPerspectiveMenu(t0) {
79930
79931
  const $ = c(23), {
79931
- selectedReleaseId,
79932
+ selectedPerspectiveName,
79932
79933
  areReleasesEnabled: t1,
79933
79934
  menuItemProps
79934
79935
  } = t0, areReleasesEnabled = t1 === void 0 ? !0 : t1, [createBundleDialogOpen, setCreateBundleDialogOpen] = useState(!1), {
@@ -79958,7 +79959,7 @@ function GlobalPerspectiveMenu(t0) {
79958
79959
  let t4;
79959
79960
  $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsx(OversizedButton, { "data-testid": "global-perspective-menu-button", iconRight: ChevronDownIcon, mode: "bleed", padding: 2, radius: "full" }), $[4] = t4) : t4 = $[4];
79960
79961
  let t5;
79961
- $[5] !== areReleasesEnabled || $[6] !== handleOpenBundleDialog || $[7] !== isRangeVisible || $[8] !== menuItemProps || $[9] !== onScroll || $[10] !== scrollElementRef || $[11] !== selectedReleaseId || $[12] !== setScrollContainer ? (t5 = /* @__PURE__ */ jsx(StyledMenu$3, { "data-testid": "release-menu", ref: styledMenuRef, children: /* @__PURE__ */ jsx(ReleasesList, { areReleasesEnabled, setScrollContainer, onScroll, isRangeVisible, scrollElementRef, selectedReleaseId, handleOpenBundleDialog, menuItemProps }) }), $[5] = areReleasesEnabled, $[6] = handleOpenBundleDialog, $[7] = isRangeVisible, $[8] = menuItemProps, $[9] = onScroll, $[10] = scrollElementRef, $[11] = selectedReleaseId, $[12] = setScrollContainer, $[13] = t5) : t5 = $[13];
79962
+ $[5] !== areReleasesEnabled || $[6] !== handleOpenBundleDialog || $[7] !== isRangeVisible || $[8] !== menuItemProps || $[9] !== onScroll || $[10] !== scrollElementRef || $[11] !== selectedPerspectiveName || $[12] !== setScrollContainer ? (t5 = /* @__PURE__ */ jsx(StyledMenu$3, { "data-testid": "release-menu", ref: styledMenuRef, children: /* @__PURE__ */ jsx(ReleasesList, { areReleasesEnabled, setScrollContainer, onScroll, isRangeVisible, scrollElementRef, selectedPerspectiveName, handleOpenBundleDialog, menuItemProps }) }), $[5] = areReleasesEnabled, $[6] = handleOpenBundleDialog, $[7] = isRangeVisible, $[8] = menuItemProps, $[9] = onScroll, $[10] = scrollElementRef, $[11] = selectedPerspectiveName, $[12] = setScrollContainer, $[13] = t5) : t5 = $[13];
79962
79963
  let t6;
79963
79964
  $[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t6 = {
79964
79965
  constrainSize: !0,
@@ -80008,7 +80009,7 @@ const ReleasesNavContainer = styled(Card)`
80008
80009
  menuItemProps
80009
80010
  } = t0, releasesToolAvailable = useReleasesToolAvailable(), isReleasesEnabled = !!useWorkspace().releases?.enabled, {
80010
80011
  selectedPerspective,
80011
- selectedReleaseId
80012
+ selectedPerspectiveName
80012
80013
  } = usePerspective();
80013
80014
  let t1;
80014
80015
  $[0] !== releasesToolAvailable || $[1] !== withReleasesToolButton ? (t1 = withReleasesToolButton && releasesToolAvailable && /* @__PURE__ */ jsx(ReleasesToolLink, {}), $[0] = releasesToolAvailable, $[1] = withReleasesToolButton, $[2] = t1) : t1 = $[2];
@@ -80016,7 +80017,7 @@ const ReleasesNavContainer = styled(Card)`
80016
80017
  $[3] !== selectedPerspective ? (t2 = /* @__PURE__ */ jsx(CurrentGlobalPerspectiveLabel, { selectedPerspective }), $[3] = selectedPerspective, $[4] = t2) : t2 = $[4];
80017
80018
  const t3 = releasesToolAvailable && isReleasesEnabled;
80018
80019
  let t4;
80019
- $[5] !== menuItemProps || $[6] !== selectedReleaseId || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsx(GlobalPerspectiveMenu, { selectedReleaseId, areReleasesEnabled: t3, menuItemProps }), $[5] = menuItemProps, $[6] = selectedReleaseId, $[7] = t3, $[8] = t4) : t4 = $[8];
80020
+ $[5] !== menuItemProps || $[6] !== selectedPerspectiveName || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsx(GlobalPerspectiveMenu, { selectedPerspectiveName, areReleasesEnabled: t3, menuItemProps }), $[5] = menuItemProps, $[6] = selectedPerspectiveName, $[7] = t3, $[8] = t4) : t4 = $[8];
80020
80021
  let t5;
80021
80022
  return $[9] !== t1 || $[10] !== t2 || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ReleasesNavContainer, { flex: "none", tone: "inherit", radius: "full", "data-ui": "ReleasesNav", border: !0, children: [
80022
80023
  t1,