sanity 5.30.1-next.7 → 5.31.0-next.9

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.
@@ -306,10 +306,22 @@ type LoginComponentProps = {
306
306
  projectId: string; /** @deprecated use redirectPath instead */
307
307
  basePath: string;
308
308
  redirectPath?: string;
309
+ /**
310
+ * Invoked when the user chooses to switch workspaces from the login screen
311
+ * (e.g. when the active workspace has no usable login providers). Only
312
+ * provided when more than one workspace is available to switch to.
313
+ */
314
+ onChooseAnotherWorkspace?: () => void;
309
315
  } | {
310
316
  projectId: string;
311
317
  redirectPath: string; /** @deprecated use redirectPath instead */
312
318
  basePath?: string;
319
+ /**
320
+ * Invoked when the user chooses to switch workspaces from the login screen
321
+ * (e.g. when the active workspace has no usable login providers). Only
322
+ * provided when more than one workspace is available to switch to.
323
+ */
324
+ onChooseAnotherWorkspace?: () => void;
313
325
  };
314
326
  /**
315
327
  * Result returned from `handleCallbackUrl` describing what happened during
@@ -1,4 +1,4 @@
1
- var version = "5.30.1-next.7+273b0be7e1";
1
+ var version = "5.31.0-next.9+967a62d83b";
2
2
  let buildVersion;
3
3
  try {
4
4
  buildVersion = process.env.PKG_BUILD_VERSION;
@@ -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.30.1-next.7+273b0be7e1";
10
+ "5.31.0-next.9+967a62d83b";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@ import { FeedbackContext as FeedbackContext2, SchedulesContext as SchedulesConte
10
10
  import { useVirtualizer, defaultRangeExtractor, elementScroll } from "@tanstack/react-virtual";
11
11
  import throttle from "lodash-es/throttle.js";
12
12
  import { styled, css, keyframes, useTheme as useTheme$1, createGlobalStyle } from "styled-components";
13
- import { EllipsisHorizontalIcon, ErrorOutlineIcon, CircleIcon, CalendarIcon, UnpublishIcon, PublishIcon, EditIcon, CloseIcon, TrashIcon, AddCircleIcon, TimelineIcon, ChevronRightIcon, ArrowRightIcon, ArrowDownIcon, DocumentIcon, ImageIcon, ChevronDownIcon, RevertIcon, WarningOutlineIcon, InfoOutlineIcon, ArrowLeftIcon, CheckmarkIcon, AddIcon, HelpCircleIcon, AccessDeniedIcon, ToggleArrowRightIcon, SyncIcon, LaunchIcon, BulbOutlineIcon, UnknownIcon, LinkIcon, ChevronUpIcon, DownloadIcon, DocumentsIcon, UploadIcon, DragHandleIcon, InsertAboveIcon, InsertBelowIcon, CopyIcon, AddDocumentIcon, SearchIcon, ChevronLeftIcon, EarthGlobeIcon, EarthAmericasIcon, UlistIcon, OlistIcon, CodeIcon, UnderlineIcon, StrikethroughIcon, ItalicIcon, BoldIcon, BlockElementIcon, InlineElementIcon, CollapseIcon, ExpandIcon, ResetIcon, Icon, ReadOnlyIcon, BinaryDocumentIcon, LockIcon, CropIcon, EyeOpenIcon, ClockIcon, DotIcon, BoltIcon, CheckmarkCircleIcon, PinFilledIcon, PinIcon, RestoreIcon, CloseCircleIcon, UnarchiveIcon, ArchiveIcon, ShareIcon, TargetIcon, TextIcon, ArrowUpIcon, ControlsIcon, SpinnerIcon, SortIcon, FilterIcon as FilterIcon$1, ComposeSparklesIcon, UnlockIcon, ClipboardIcon, StringIcon, NumberIcon, BlockContentIcon, UndoIcon, UnlinkIcon, LinkRemovedIcon, AddCommentIcon, CommentIcon, SelectIcon, TaskIcon, UserIcon, DiamondIcon, SparkleIcon, EyeClosedIcon, DesktopIcon, MoonIcon, SunIcon, DoubleChevronRightIcon, AddUserIcon, CogIcon, LeaveIcon, UsersIcon, FaceHappyIcon, FaceIndifferentIcon, FaceSadIcon, FeedbackIcon, GithubIcon, RefreshIcon, MenuIcon } from "@sanity/icons";
13
+ import { EllipsisHorizontalIcon, ErrorOutlineIcon, ArrowLeftIcon, WarningOutlineIcon, CircleIcon, CalendarIcon, UnpublishIcon, PublishIcon, EditIcon, CloseIcon, TrashIcon, AddCircleIcon, TimelineIcon, ChevronRightIcon, ArrowRightIcon, ArrowDownIcon, DocumentIcon, ImageIcon, ChevronDownIcon, RevertIcon, InfoOutlineIcon, CheckmarkIcon, AddIcon, HelpCircleIcon, AccessDeniedIcon, ToggleArrowRightIcon, SyncIcon, LaunchIcon, BulbOutlineIcon, UnknownIcon, LinkIcon, ChevronUpIcon, DownloadIcon, DocumentsIcon, UploadIcon, DragHandleIcon, InsertAboveIcon, InsertBelowIcon, CopyIcon, AddDocumentIcon, SearchIcon, ChevronLeftIcon, EarthGlobeIcon, EarthAmericasIcon, UlistIcon, OlistIcon, CodeIcon, UnderlineIcon, StrikethroughIcon, ItalicIcon, BoldIcon, BlockElementIcon, InlineElementIcon, CollapseIcon, ExpandIcon, ResetIcon, Icon, ReadOnlyIcon, BinaryDocumentIcon, LockIcon, CropIcon, EyeOpenIcon, ClockIcon, DotIcon, BoltIcon, CheckmarkCircleIcon, PinFilledIcon, PinIcon, RestoreIcon, CloseCircleIcon, UnarchiveIcon, ArchiveIcon, ShareIcon, TargetIcon, TextIcon, ArrowUpIcon, ControlsIcon, SpinnerIcon, SortIcon, FilterIcon as FilterIcon$1, ComposeSparklesIcon, UnlockIcon, ClipboardIcon, StringIcon, NumberIcon, BlockContentIcon, UndoIcon, UnlinkIcon, LinkRemovedIcon, AddCommentIcon, CommentIcon, SelectIcon, TaskIcon, UserIcon, DiamondIcon, SparkleIcon, EyeClosedIcon, DesktopIcon, MoonIcon, SunIcon, DoubleChevronRightIcon, AddUserIcon, CogIcon, LeaveIcon, UsersIcon, FaceHappyIcon, FaceIndifferentIcon, FaceSadIcon, FeedbackIcon, GithubIcon, RefreshIcon, MenuIcon } from "@sanity/icons";
14
14
  import { createMemoryHistory, createBrowserHistory } from "history";
15
15
  import { of, concat, defer, EMPTY as EMPTY$5, map as map$1, merge, defaultIfEmpty, catchError as catchError$1, switchMap as switchMap$1, take, concatMap, from, Observable, BehaviorSubject, fromEvent, skip, ReplaySubject, timer, firstValueFrom, throwError, NEVER, Subject, tap as tap$1, finalize, share as share$1, combineLatest, asyncScheduler, bufferTime, mergeMap as mergeMap$1, filter as filter$1, lastValueFrom, partition as partition$1, distinctUntilChanged as distinctUntilChanged$1, asapScheduler, using, shareReplay as shareReplay$1, repeat, pipe, iif, startWith as startWith$1, concatWith, scan as scan$1, count, toArray as toArray$2, reduce as reduce$1, switchScan, delayWhen, first as first$1, zipWith, takeWhile, debounceTime as debounceTime$1, find, zip, isObservable, retry, expand, forkJoin, debounce as debounce$2, delay as delay$1, timeout as timeout$1, connect } from "rxjs";
16
16
  import { catchError, tap, switchMap, map, scan, distinctUntilChanged, startWith, shareReplay, mergeMap, filter, share, mergeMapTo, takeUntil, take as take$1, publishReplay, refCount, withLatestFrom, concatMap as concatMap$1, groupBy as groupBy$1, throttleTime, last, mergeAll, toArray as toArray$1, distinct, skip as skip$1, first, debounceTime, auditTime, switchMapTo, delay, reduce as reduce$2, debounce as debounce$1, finalize as finalize$1, expand as expand$1, mapTo, retry as retry$1, timeout } from "rxjs/operators";
@@ -39,9 +39,6 @@ import memoize$1 from "lodash-es/memoize.js";
39
39
  import { SANITY_VERSION } from "./_chunks-es/version.js";
40
40
  import { Button, ErrorBoundary, Tooltip, Popover, MenuItem, MenuButton, TooltipDelayGroupProvider, Dialog as Dialog$1, Tab, generateHelpUrl } from "./_chunks-es/index.js";
41
41
  import { Hotkeys } from "./_chunks-es/index.js";
42
- import { observableCallback } from "observable-callback";
43
- import { useTelemetry, TelemetryProvider, DeferredTelemetryProvider } from "@sanity/telemetry/react";
44
- import { usePortableTextEditor, PortableTextEditor, usePortableTextEditorSelection, PortableTextEditable, EditorProvider, useEditor, defineSchema, keyGenerator as keyGenerator$1 } from "@portabletext/editor";
45
42
  import { fromUrl } from "@sanity/bifur-client";
46
43
  import debug$c from "debug";
47
44
  import startCase from "lodash-es/startCase.js";
@@ -53,12 +50,15 @@ import { isHotkey } from "is-hotkey-esm";
53
50
  import FocusLock from "react-focus-lock";
54
51
  import { defineEvent, createSessionId, createBatchedStore } from "@sanity/telemetry";
55
52
  import { isDraftId as isDraftId$1, isVersionId as isVersionId$1, getVersionNameFromId } from "@sanity/id-utils";
53
+ import { usePortableTextEditor, PortableTextEditor, usePortableTextEditorSelection, PortableTextEditable, EditorProvider, useEditor, defineSchema, keyGenerator as keyGenerator$1 } from "@portabletext/editor";
54
+ import { nanoid, customAlphabet } from "nanoid";
55
+ import { useTelemetry, TelemetryProvider, DeferredTelemetryProvider } from "@sanity/telemetry/react";
56
56
  import { cleanupEfficiency, makeDiff, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL, applyPatches, parsePatch, makePatches } from "@sanity/diff-match-patch";
57
57
  import flatten$1 from "lodash-es/flatten.js";
58
58
  import orderBy from "lodash-es/orderBy.js";
59
- import { nanoid, customAlphabet } from "nanoid";
60
59
  import * as legacyDateFormat from "@sanity/util/legacyDateFormat";
61
60
  import { sanitizeLocale, format as format$1, DEFAULT_DATE_FORMAT, parse as parse$2, isValidTimeZoneString, DEFAULT_TIME_FORMAT } from "@sanity/util/legacyDateFormat";
61
+ import { observableCallback } from "observable-callback";
62
62
  import { getImageDimensions, isDefaultCrop, isDefaultHotspot, isImageSource, isFileSource, tryGetImageDimensions, isSanityImageUrl, parseImageAssetUrl, isAssetObjectStub, isImageAssetId, isFileAssetId } from "@sanity/asset-utils";
63
63
  import { createImageUrlBuilder } from "@sanity/image-url";
64
64
  import uniq from "lodash-es/uniq.js";
@@ -4810,10 +4810,12 @@ function createLoginComponent({
4810
4810
  ...providerOptions
4811
4811
  }) {
4812
4812
  function LoginComponent(t0) {
4813
- const $ = c(22), {
4813
+ const $ = c(28), {
4814
4814
  projectId,
4815
4815
  ...props2
4816
- } = t0, redirectPath = props2.redirectPath || props2.basePath || "/";
4816
+ } = t0, {
4817
+ t
4818
+ } = useTranslation(), redirectPath = props2.redirectPath || props2.basePath || "/";
4817
4819
  let t1;
4818
4820
  $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
4819
4821
  providers: [],
@@ -4874,9 +4876,43 @@ function createLoginComponent({
4874
4876
  let t62;
4875
4877
  return $[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t62 = /* @__PURE__ */ jsx(LoadingBlock, { showText: !0 }), $[9] = t62) : t62 = $[9], t62;
4876
4878
  }
4879
+ if (providers_1.length === 0) {
4880
+ let t62;
4881
+ $[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t62 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text$1, { size: 1, children: /* @__PURE__ */ jsx(WarningOutlineIcon, {}) }) }), $[10] = t62) : t62 = $[10];
4882
+ let t72;
4883
+ $[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t72 = /* @__PURE__ */ jsx(Text$1, { as: "h1", size: 1, weight: "medium", children: "No login providers available" }), $[11] = t72) : t72 = $[11];
4884
+ let t82;
4885
+ $[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t82 = /* @__PURE__ */ jsx("code", { children: "auth.providers" }), $[12] = t82) : t82 = $[12];
4886
+ let t92;
4887
+ $[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t92 = /* @__PURE__ */ jsxs(Text$1, { as: "p", muted: !0, size: 1, children: [
4888
+ "The ",
4889
+ t82,
4890
+ " setting in your Studio configuration resolved to an empty list. This usually means an empty array is combined with",
4891
+ " ",
4892
+ /* @__PURE__ */ jsx("code", { children: "mode: 'replace'" }),
4893
+ ", which replaces the default providers with none."
4894
+ ] }), $[13] = t92) : t92 = $[13];
4895
+ let t102;
4896
+ $[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t102 = /* @__PURE__ */ jsxs(Text$1, { as: "p", muted: !0, size: 1, children: [
4897
+ "Add at least one provider, or remove ",
4898
+ /* @__PURE__ */ jsx("code", { children: "mode: 'replace'" }),
4899
+ " to keep the defaults."
4900
+ ] }), $[14] = t102) : t102 = $[14];
4901
+ let t112;
4902
+ return $[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t112 = /* @__PURE__ */ jsx(Text$1, { as: "p", muted: !0, size: 1, children: /* @__PURE__ */ jsx("a", { href: "https://www.sanity.io/docs/configuration#dc516e8cb39e", rel: "noreferrer", target: "_blank", children: "Learn about auth configuration \u2192" }) }), $[15] = t112) : t112 = $[15], /* @__PURE__ */ jsx(Card, { padding: 4, radius: 2, shadow: 1, tone: "caution", children: /* @__PURE__ */ jsxs(Flex, { children: [
4903
+ t62,
4904
+ /* @__PURE__ */ jsxs(Stack, { flex: 1, marginLeft: 3, space: 4, children: [
4905
+ t72,
4906
+ t92,
4907
+ t102,
4908
+ props2.onChooseAnotherWorkspace && /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(Button, { icon: ArrowLeftIcon, mode: "ghost", onClick: props2.onChooseAnotherWorkspace, text: t("workspaces.action.choose-another-workspace") }) }),
4909
+ t112
4910
+ ] })
4911
+ ] }) });
4912
+ }
4877
4913
  const T0 = Stack, t6 = 4;
4878
4914
  let t7;
4879
- $[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Heading, { align: "center", size: 1, children: "Choose login provider" }), $[10] = t7) : t7 = $[10];
4915
+ $[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Heading, { align: "center", size: 1, children: "Choose login provider" }), $[16] = t7) : t7 = $[16];
4880
4916
  const T1 = Stack, t8 = lastUsedProvider_0 && /* @__PURE__ */ jsx(LastUsedProviderButton, { provider: lastUsedProvider_0, href: createHrefForProvider({
4881
4917
  loginMethod,
4882
4918
  projectId,
@@ -4889,17 +4925,17 @@ function createLoginComponent({
4889
4925
  redirectPath
4890
4926
  }) }, `${provider.url}_${index}`));
4891
4927
  let t11;
4892
- $[11] !== T2 || $[12] !== t10 ? (t11 = /* @__PURE__ */ jsx(T2, { space: t9, children: t10 }), $[11] = T2, $[12] = t10, $[13] = t11) : t11 = $[13];
4928
+ $[17] !== T2 || $[18] !== t10 ? (t11 = /* @__PURE__ */ jsx(T2, { space: t9, children: t10 }), $[17] = T2, $[18] = t10, $[19] = t11) : t11 = $[19];
4893
4929
  let t12;
4894
- $[14] !== T1 || $[15] !== t11 || $[16] !== t8 ? (t12 = /* @__PURE__ */ jsxs(T1, { children: [
4930
+ $[20] !== T1 || $[21] !== t11 || $[22] !== t8 ? (t12 = /* @__PURE__ */ jsxs(T1, { children: [
4895
4931
  t8,
4896
4932
  t11
4897
- ] }), $[14] = T1, $[15] = t11, $[16] = t8, $[17] = t12) : t12 = $[17];
4933
+ ] }), $[20] = T1, $[21] = t11, $[22] = t8, $[23] = t12) : t12 = $[23];
4898
4934
  let t13;
4899
- return $[18] !== T0 || $[19] !== t12 || $[20] !== t7 ? (t13 = /* @__PURE__ */ jsxs(T0, { space: t6, children: [
4935
+ return $[24] !== T0 || $[25] !== t12 || $[26] !== t7 ? (t13 = /* @__PURE__ */ jsxs(T0, { space: t6, children: [
4900
4936
  t7,
4901
4937
  t12
4902
- ] }), $[18] = T0, $[19] = t12, $[20] = t7, $[21] = t13) : t13 = $[21], t13;
4938
+ ] }), $[24] = T0, $[25] = t12, $[26] = t7, $[27] = t13) : t13 = $[27], t13;
4903
4939
  }
4904
4940
  function _temp10(providerList) {
4905
4941
  if (!providerList || providerList.length <= 1)
@@ -85808,63 +85844,57 @@ const StyledContainer$1 = /* @__PURE__ */ styled(Container$3).withConfig({
85808
85844
  };
85809
85845
  });
85810
85846
  function WorkspaceAuth() {
85811
- const $ = c(44), {
85847
+ const $ = c(42), {
85812
85848
  visibleWorkspaces
85813
85849
  } = useVisibleWorkspaces(), {
85814
85850
  activeWorkspace,
85815
85851
  setActiveWorkspace
85816
- } = useActiveWorkspace(), [selectedWorkspaceName, setSelectedWorkspaceName] = useState(activeWorkspace?.name || null);
85852
+ } = useActiveWorkspace(), [showChooser, setShowChooser] = useState(!1), {
85853
+ t
85854
+ } = useTranslation(), canChooseAnotherWorkspace = visibleWorkspaces.length > 1, selectedWorkspace = activeWorkspace, LoginComponent = selectedWorkspace?.auth?.LoginComponent;
85817
85855
  let t0;
85818
- $[0] !== selectedWorkspaceName || $[1] !== visibleWorkspaces ? (t0 = visibleWorkspaces.length === 1 ? visibleWorkspaces[0] : visibleWorkspaces.find((workspace) => workspace.name === selectedWorkspaceName), $[0] = selectedWorkspaceName, $[1] = visibleWorkspaces, $[2] = t0) : t0 = $[2];
85819
- const selectedWorkspace = t0, LoginComponent = selectedWorkspace?.auth?.LoginComponent;
85856
+ $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = () => setShowChooser(!0), $[0] = t0) : t0 = $[0];
85857
+ const handleBack = t0;
85820
85858
  let t1;
85821
- $[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => setSelectedWorkspaceName(null), $[3] = t1) : t1 = $[3];
85822
- const handleBack = t1, {
85823
- t
85824
- } = useTranslation();
85825
- let t2;
85826
- $[4] !== activeWorkspace.name || $[5] !== setActiveWorkspace ? (t2 = (workspaceName, state) => {
85827
- if ((state === "logged-in" || state === "loading") && workspaceName !== activeWorkspace.name) {
85828
- setActiveWorkspace(workspaceName);
85829
- return;
85830
- }
85831
- state === "logged-out" && setSelectedWorkspaceName(workspaceName);
85832
- }, $[4] = activeWorkspace.name, $[5] = setActiveWorkspace, $[6] = t2) : t2 = $[6];
85833
- const handleCardSelect = t2;
85834
- if (LoginComponent && selectedWorkspace) {
85835
- let t32;
85836
- $[7] !== t || $[8] !== visibleWorkspaces.length ? (t32 = visibleWorkspaces.length > 1 && /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(Button, { icon: ArrowLeftIcon, mode: "bleed", onClick: handleBack, text: t("workspaces.action.choose-another-workspace") }) }), $[7] = t, $[8] = visibleWorkspaces.length, $[9] = t32) : t32 = $[9];
85837
- const t42 = selectedWorkspace?.subtitle;
85859
+ $[1] !== activeWorkspace.name || $[2] !== setActiveWorkspace ? (t1 = (workspaceName, state) => {
85860
+ (state === "logged-in" || state === "loading" || state === "logged-out") && (workspaceName !== activeWorkspace.name && setActiveWorkspace(workspaceName), setShowChooser(!1));
85861
+ }, $[1] = activeWorkspace.name, $[2] = setActiveWorkspace, $[3] = t1) : t1 = $[3];
85862
+ const handleCardSelect = t1;
85863
+ if (LoginComponent && selectedWorkspace && !showChooser) {
85864
+ let t22;
85865
+ $[4] !== canChooseAnotherWorkspace || $[5] !== t ? (t22 = canChooseAnotherWorkspace && /* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(Button, { icon: ArrowLeftIcon, mode: "bleed", onClick: handleBack, text: t("workspaces.action.choose-another-workspace") }) }), $[4] = canChooseAnotherWorkspace, $[5] = t, $[6] = t22) : t22 = $[6];
85866
+ const t32 = selectedWorkspace?.subtitle;
85867
+ let t42;
85868
+ $[7] !== selectedWorkspace.icon || $[8] !== selectedWorkspace.title || $[9] !== t32 ? (t42 = /* @__PURE__ */ jsx(Box, { padding: 3, children: /* @__PURE__ */ jsx(WorkspacePreview, { icon: selectedWorkspace.icon, title: selectedWorkspace.title, subtitle: t32 }) }), $[7] = selectedWorkspace.icon, $[8] = selectedWorkspace.title, $[9] = t32, $[10] = t42) : t42 = $[10];
85838
85869
  let t52;
85839
- $[10] !== selectedWorkspace.icon || $[11] !== selectedWorkspace.title || $[12] !== t42 ? (t52 = /* @__PURE__ */ jsx(Box, { padding: 3, children: /* @__PURE__ */ jsx(WorkspacePreview, { icon: selectedWorkspace.icon, title: selectedWorkspace.title, subtitle: t42 }) }), $[10] = selectedWorkspace.icon, $[11] = selectedWorkspace.title, $[12] = t42, $[13] = t52) : t52 = $[13];
85840
- let t62;
85841
- $[14] !== selectedWorkspace.basePath ? (t62 = window.location.pathname.startsWith(selectedWorkspace.basePath) ? `${window.location.pathname}${window.location.search}` : selectedWorkspace.basePath, $[14] = selectedWorkspace.basePath, $[15] = t62) : t62 = $[15];
85870
+ $[11] !== selectedWorkspace.basePath ? (t52 = window.location.pathname.startsWith(selectedWorkspace.basePath) ? `${window.location.pathname}${window.location.search}` : selectedWorkspace.basePath, $[11] = selectedWorkspace.basePath, $[12] = t52) : t52 = $[12];
85871
+ const t62 = canChooseAnotherWorkspace ? handleBack : void 0;
85842
85872
  let t72;
85843
- $[16] !== LoginComponent || $[17] !== selectedWorkspace.projectId || $[18] !== selectedWorkspaceName || $[19] !== t62 ? (t72 = /* @__PURE__ */ jsx(Stack, { padding: 2, paddingBottom: 3, paddingTop: 4, children: /* @__PURE__ */ jsx(LoginComponent, { projectId: selectedWorkspace.projectId, redirectPath: t62 }, selectedWorkspaceName) }), $[16] = LoginComponent, $[17] = selectedWorkspace.projectId, $[18] = selectedWorkspaceName, $[19] = t62, $[20] = t72) : t72 = $[20];
85844
- let t82;
85845
- $[21] !== t52 || $[22] !== t72 ? (t82 = /* @__PURE__ */ jsx(Layout, { header: t52, children: t72 }), $[21] = t52, $[22] = t72, $[23] = t82) : t82 = $[23];
85873
+ $[13] !== LoginComponent || $[14] !== selectedWorkspace.name || $[15] !== selectedWorkspace.projectId || $[16] !== t52 || $[17] !== t62 ? (t72 = /* @__PURE__ */ jsx(Stack, { padding: 2, paddingBottom: 3, paddingTop: 4, children: /* @__PURE__ */ jsx(LoginComponent, { projectId: selectedWorkspace.projectId, redirectPath: t52, onChooseAnotherWorkspace: t62 }, selectedWorkspace.name) }), $[13] = LoginComponent, $[14] = selectedWorkspace.name, $[15] = selectedWorkspace.projectId, $[16] = t52, $[17] = t62, $[18] = t72) : t72 = $[18];
85874
+ let t8;
85875
+ $[19] !== t42 || $[20] !== t72 ? (t8 = /* @__PURE__ */ jsx(Layout, { header: t42, children: t72 }), $[19] = t42, $[20] = t72, $[21] = t8) : t8 = $[21];
85846
85876
  let t9;
85847
- return $[24] !== t32 || $[25] !== t82 ? (t9 = /* @__PURE__ */ jsx(Container$3, { width: 0, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
85848
- t32,
85849
- t82
85850
- ] }) }), $[24] = t32, $[25] = t82, $[26] = t9) : t9 = $[26], t9;
85877
+ return $[22] !== t22 || $[23] !== t8 ? (t9 = /* @__PURE__ */ jsx(Container$3, { width: 0, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
85878
+ t22,
85879
+ t8
85880
+ ] }) }), $[22] = t22, $[23] = t8, $[24] = t9) : t9 = $[24], t9;
85851
85881
  }
85882
+ let t2;
85883
+ $[25] !== t ? (t2 = t("workspaces.choose-your-workspace-label"), $[25] = t, $[26] = t2) : t2 = $[26];
85852
85884
  let t3;
85853
- $[27] !== t ? (t3 = t("workspaces.choose-your-workspace-label"), $[27] = t, $[28] = t3) : t3 = $[28];
85885
+ $[27] !== t ? (t3 = t("workspaces.action.add-workspace"), $[27] = t, $[28] = t3) : t3 = $[28];
85854
85886
  let t4;
85855
- $[29] !== t ? (t4 = t("workspaces.action.add-workspace"), $[29] = t, $[30] = t4) : t4 = $[30];
85887
+ $[29] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "a", href: WORKSPACES_DOCS_URL, icon: AddIcon, mode: "bleed", rel: "noopener noreferrer", size: "large", target: "__blank", text: t3 }) }), $[29] = t3, $[30] = t4) : t4 = $[30];
85856
85888
  let t5;
85857
- $[31] !== t4 ? (t5 = /* @__PURE__ */ jsx(Stack, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "a", href: WORKSPACES_DOCS_URL, icon: AddIcon, mode: "bleed", rel: "noopener noreferrer", size: "large", target: "__blank", text: t4 }) }), $[31] = t4, $[32] = t5) : t5 = $[32];
85858
- let t6;
85859
- if ($[33] !== handleCardSelect || $[34] !== visibleWorkspaces) {
85860
- let t72;
85861
- $[36] !== handleCardSelect ? (t72 = (workspace_0) => /* @__PURE__ */ jsx(WorkspaceAuthCard, { workspace: workspace_0, onSelect: (state_0) => handleCardSelect(workspace_0.name, state_0) }, workspace_0.name), $[36] = handleCardSelect, $[37] = t72) : t72 = $[37], t6 = visibleWorkspaces.map(t72), $[33] = handleCardSelect, $[34] = visibleWorkspaces, $[35] = t6;
85889
+ if ($[31] !== handleCardSelect || $[32] !== visibleWorkspaces) {
85890
+ let t62;
85891
+ $[34] !== handleCardSelect ? (t62 = (workspace) => /* @__PURE__ */ jsx(WorkspaceAuthCard, { workspace, onSelect: (state_0) => handleCardSelect(workspace.name, state_0) }, workspace.name), $[34] = handleCardSelect, $[35] = t62) : t62 = $[35], t5 = visibleWorkspaces.map(t62), $[31] = handleCardSelect, $[32] = visibleWorkspaces, $[33] = t5;
85862
85892
  } else
85863
- t6 = $[35];
85893
+ t5 = $[33];
85894
+ let t6;
85895
+ $[36] !== t5 ? (t6 = /* @__PURE__ */ jsx(Stack, { space: 1, paddingX: 1, paddingY: 2, children: t5 }), $[36] = t5, $[37] = t6) : t6 = $[37];
85864
85896
  let t7;
85865
- $[38] !== t6 ? (t7 = /* @__PURE__ */ jsx(Stack, { space: 1, paddingX: 1, paddingY: 2, children: t6 }), $[38] = t6, $[39] = t7) : t7 = $[39];
85866
- let t8;
85867
- return $[40] !== t3 || $[41] !== t5 || $[42] !== t7 ? (t8 = /* @__PURE__ */ jsx(StyledContainer$1, { width: 1, children: /* @__PURE__ */ jsx(Layout, { header: t3, footer: t5, children: t7 }) }), $[40] = t3, $[41] = t5, $[42] = t7, $[43] = t8) : t8 = $[43], t8;
85897
+ return $[38] !== t2 || $[39] !== t4 || $[40] !== t6 ? (t7 = /* @__PURE__ */ jsx(StyledContainer$1, { width: 1, children: /* @__PURE__ */ jsx(Layout, { header: t2, footer: t4, children: t6 }) }), $[38] = t2, $[39] = t4, $[40] = t6, $[41] = t7) : t7 = $[41], t7;
85868
85898
  }
85869
85899
  const PERMISSION_NAME = "sanity.project.members", GRANT_NAME = "invite";
85870
85900
  function useCanInviteProjectMembers(opts) {