sanity 5.26.0-next.8 → 5.26.0
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/ActiveWorkspaceMatcherContext.d.ts +16 -12
- package/lib/_chunks-es/structureTool.js +4 -4
- package/lib/_chunks-es/structureTool.js.map +1 -1
- package/lib/_chunks-es/version.js +2 -2
- package/lib/_singletons.d.ts +1 -1
- package/lib/_singletons.js +4 -1
- package/lib/_singletons.js.map +1 -1
- package/lib/cli.d.ts +1 -1
- package/lib/index.js +314 -236
- package/lib/index.js.map +1 -1
- package/lib/media-library.d.ts +5 -0
- package/package.json +12 -12
|
@@ -4486,6 +4486,7 @@ declare function ActiveWorkspaceMatcher({
|
|
|
4486
4486
|
NotFoundComponent,
|
|
4487
4487
|
unstable_history: historyProp
|
|
4488
4488
|
}: ActiveWorkspaceMatcherProps): _$react.JSX.Element;
|
|
4489
|
+
type WorkspaceAuthStates = Record<string, AuthState | undefined>;
|
|
4489
4490
|
/** @internal */
|
|
4490
4491
|
interface WorkspaceLike {
|
|
4491
4492
|
name?: string;
|
|
@@ -4510,15 +4511,7 @@ declare function getNamelessWorkspaceIdentifier(title: string | undefined, index
|
|
|
4510
4511
|
/** @internal */
|
|
4511
4512
|
interface VisibleWorkspacesContextValue {
|
|
4512
4513
|
visibleWorkspaces: WorkspaceSummary[];
|
|
4513
|
-
|
|
4514
|
-
* `true` while auth state is still resolving for one or more workspaces
|
|
4515
|
-
* whose visibility depends on a function-based `hidden` property.
|
|
4516
|
-
* `visibleWorkspaces` includes these workspaces optimistically in the
|
|
4517
|
-
* meantime.
|
|
4518
|
-
*
|
|
4519
|
-
* Follows the same fail-open pattern as `evaluateWorkspaceHidden`.
|
|
4520
|
-
*/
|
|
4521
|
-
isResolvingHiddenWorkspaces: boolean;
|
|
4514
|
+
workspaceAuthStates: WorkspaceAuthStates;
|
|
4522
4515
|
}
|
|
4523
4516
|
/** @internal */
|
|
4524
4517
|
declare function VisibleWorkspacesProvider({
|
|
@@ -4602,6 +4595,7 @@ interface MatchWorkspaceOptions {
|
|
|
4602
4595
|
workspaces: NormalizedWorkspace[];
|
|
4603
4596
|
pathname: string;
|
|
4604
4597
|
basePathRegex: RegExp;
|
|
4598
|
+
workspaceAuthStates: WorkspaceAuthStates;
|
|
4605
4599
|
}
|
|
4606
4600
|
/** @internal */
|
|
4607
4601
|
type MatchWorkspaceResult = {
|
|
@@ -4612,17 +4606,27 @@ type MatchWorkspaceResult = {
|
|
|
4612
4606
|
pathname: string;
|
|
4613
4607
|
} | {
|
|
4614
4608
|
type: 'not-found';
|
|
4609
|
+
} | {
|
|
4610
|
+
type: 'loading';
|
|
4615
4611
|
};
|
|
4616
4612
|
/**
|
|
4617
|
-
*
|
|
4618
|
-
* a redirect
|
|
4613
|
+
* Resolves a pathname against the configured workspaces. Returns a match for a
|
|
4614
|
+
* known workspace path, a redirect to the first visible workspace when the
|
|
4615
|
+
* pathname is the common base path, or not-found otherwise.
|
|
4616
|
+
*
|
|
4617
|
+
* The default redirect walks workspaces in config order, skipping any with
|
|
4618
|
+
* `hidden: true` or with a `hidden()` callback that returns `true`. It returns
|
|
4619
|
+
* `loading` only when a function-hidden workspace is reached whose auth state
|
|
4620
|
+
* has not yet resolved. If every workspace is hidden, it falls back to the
|
|
4621
|
+
* first configured workspace.
|
|
4619
4622
|
*
|
|
4620
4623
|
* @internal
|
|
4621
4624
|
*/
|
|
4622
4625
|
declare function matchWorkspace({
|
|
4623
4626
|
pathname,
|
|
4624
4627
|
workspaces,
|
|
4625
|
-
basePathRegex
|
|
4628
|
+
basePathRegex,
|
|
4629
|
+
workspaceAuthStates
|
|
4626
4630
|
}: MatchWorkspaceOptions): MatchWorkspaceResult;
|
|
4627
4631
|
/** @internal */
|
|
4628
4632
|
declare function useActiveWorkspace(): ActiveWorkspaceMatcherContextValue;
|
|
@@ -2,9 +2,9 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { Box, Text, Flex, Button, Badge, Menu, MenuItem, Stack, Card, Container as Container$1, DialogProvider, PortalProvider, BoundaryElementProvider, useToast, Layer, MenuDivider, TextSkeleton, useElementRect, LayerProvider, _raf2, rem, TextInput, Code, TabList, TabPanel, useClickOutsideEvent, Heading, Inline, Spinner, focusFirstDescendant, usePortal, Dialog as Dialog$1, Popover as Popover$1, useLayer, useGlobalKeyDown, AvatarStack, Skeleton } from "@sanity/ui";
|
|
4
4
|
import { useRef, useEffect, forwardRef, useState, useContext, useImperativeHandle, useLayoutEffect, useId, memo, useEffectEvent, Fragment as Fragment$1, useDeferredValue, lazy, Suspense, startTransition } from "react";
|
|
5
|
-
import { ReviewChangesContext, CommentsEnabledContext, ReferenceInputOptionsContext, PaneLayoutContext, PaneContext, DocumentPaneContext, DocumentActionsStateContext, StructureToolContext, DocumentPaneInfoContext, PaneRouterContext, ResolvedPanesContext, EventsContext,
|
|
5
|
+
import { ReviewChangesContext, CommentsEnabledContext, ReferenceInputOptionsContext, PaneLayoutContext, PaneContext, DocumentPaneContext, DocumentActionsStateContext, StructureToolContext, DocumentPaneInfoContext, PaneRouterContext, ResolvedPanesContext, EventsContext, DocumentChangeContext } from "sanity/_singletons";
|
|
6
6
|
import { motion, AnimatePresence } from "motion/react";
|
|
7
|
-
import { isPublishedId, isDraftId, getReleaseIdFromReleaseDocumentId, getVersionFromId, useTranslation, useDocumentVersions, useActiveReleases, getPublishedId, useEditState, useWorkspace, isReleaseDocument, getReleaseTone, isReleaseScheduledOrScheduling, ReleaseAvatar, isSystemBundleName, PUBLISHED, LATEST, useFormatRelativeLocalePublishDate, getDraftId, getVersionId, ReleaseTitle, useMiddlewareComponents, ChangeIndicatorsTracker, VirtualizerScrollInstanceProvider, useDocumentForm, LoadingBlock, FormBuilder, isVersionId, createPatchChannel, getDocumentVariantType, LegacyLayerProvider, IsLastPaneProvider, useGetI18nText, useI18nText, TooltipOfDisabled, ContextMenuButton, StatusButton, isDev, CommentsEnabledProvider, useCommentsEnabled, usePerspective, CommentsProvider, COMMENTS_INSPECTOR_NAME, GetHookCollectionState, EMPTY_ARRAY as EMPTY_ARRAY$2, getDocumentIdForCanvasLink, useCanvasCompanionDoc, useUnique, isPublishedPerspective, prepareForPreview, useValuePreview, useDocumentOperationEvent, useDocumentLimitsUpsellContext, isDocumentLimitError, Translate, isNewDocument, Resizable,
|
|
7
|
+
import { isPublishedId, isDraftId, getReleaseIdFromReleaseDocumentId, getVersionFromId, useTranslation, useDocumentVersions, useActiveReleases, getPublishedId, useEditState, useWorkspace, isReleaseDocument, getReleaseTone, isReleaseScheduledOrScheduling, ReleaseAvatar, isSystemBundleName, PUBLISHED, LATEST, useFormatRelativeLocalePublishDate, getDraftId, getVersionId, ReleaseTitle, useMiddlewareComponents, ChangeIndicatorsTracker, VirtualizerScrollInstanceProvider, useDocumentForm, LoadingBlock, FormBuilder, isVersionId, createPatchChannel, getDocumentVariantType, LegacyLayerProvider, IsLastPaneProvider, useGetI18nText, useI18nText, TooltipOfDisabled, ContextMenuButton, StatusButton, isDev, CommentsEnabledProvider, useCommentsEnabled, usePerspective, CommentsProvider, COMMENTS_INSPECTOR_NAME, GetHookCollectionState, EMPTY_ARRAY as EMPTY_ARRAY$2, getDocumentIdForCanvasLink, useCanvasCompanionDoc, useUnique, isPublishedPerspective, prepareForPreview, useValuePreview, useDocumentOperationEvent, useDocumentLimitsUpsellContext, isDocumentLimitError, Translate, isNewDocument, Resizable, useKeyValueStore, isRecord, isString, isDraftPerspective, useDocumentOperation, isDeprecatedSchemaType, useProjectId, useClient, useZIndex, useCurrentUser, useListFormat, useDocumentPreviewStore, isSystemBundle, useScheduledDraftDocument, useArchivedReleases, isCardinalityOneRelease, getVersionInlineBadge, useNavigateToCanvasDoc, isPerspectiveWriteable, ReleasesNav, useVersionOperations, useConditionalToast, isAgentBundleName, useOnlyHasVersions, useSetPerspective, VersionInlineBadge, isGoingToUnpublish, useDocumentStore, useDocumentPresence, FormRow, FormContainer, PresenceOverlay, fromMutationPatches, useDocumentPreviewValues, useManageFavorite, useActiveWorkspace, CapabilityGate, useFilteredReleases, usePausedScheduledDraft, isPausedCardinalityOneRelease, ScrollContainer, useStudioUrl, VersionChip, Chip, useDateTimeFormat, useSchema, useGetDefaultPerspective, useSingleDocRelease, useAgentVersionDisplay, useFieldActions, useDocumentVersionTypeSortedList, useDocumentPairPermissions, InsufficientPermissionsMessage, useValidationStatus, useSyncState, useRelativeTime, useSource, Hotkeys, isSanityDefinedAction, UserAvatar, useUser, AvatarSkeleton, CommandList, TextWithTone, useTimelineSelector, useEvents, TIMELINE_ITEM_I18N_KEY_MAPPING as TIMELINE_ITEM_I18N_KEY_MAPPING$1, ChangeConnectorRoot, useGlobalCopyPasteElementHandler, useDocumentIdStack, GetFormValueProvider, FieldActionsResolver, FieldActionsProvider, useTemplates, useInitialValue, useCopyPaste, selectUpstreamVersion, pathToString, ParseErrorsProvider, DivergencesProvider, useDocumentDivergences, useEventsStore, EventsProvider, PerspectiveProvider, useTimelineStore, SingleDocReleaseProvider, SourceProvider, CopyPasteProvider, useDocumentType, useTemplatePermissions, ReferenceInputOptionsProvider, useDocumentVersionInfo, getPreviewStateObservable, getPreviewValueWithFallback, SanityDefaultPreview, DocumentPreviewPresence, DocumentStatusIndicator, DocumentStatus, PreviewCard, ReleaseAvatarIcon, createHookFromObservableFactory, DEFAULT_STUDIO_CLIENT_OPTIONS, EMPTY_OBJECT, CrossDatasetReferencePreview, getPreviewPaths, isNonNullable as isNonNullable$1, getReferencePaths, ErrorActions, collate, createSWR, getSearchableTypes, compileFieldPath, createSearch, useSearchMaxFieldDepth, measureFirstMatch, catchWithCount, useReconnectingToast, ChangeFieldWrapper, NoChanges, ChangeList, isDeleteDocumentVersionEvent, isDeleteDocumentGroupEvent, isUnpublishDocumentEvent, isScheduleDocumentVersionEvent, isUnscheduleDocumentVersionEvent, Event, RELEASES_INTENT, isCreateDocumentVersionEvent, isEditDocumentVersionEvent, isPublishDocumentVersionEvent, ChangesError, isArray, useParseErrors, mergeParseErrors, isValidationError, isValidationWarning, definePlugin } from "sanity";
|
|
8
8
|
import { useRouter, useIntentLink, useRouterState, StateLink, IntentLink, route, encodeJsonParams, decodeJsonParams } from "sanity/router";
|
|
9
9
|
import { structureLocaleNamespace, structureUsEnglishLocaleBundle } from "./StructureToolProvider.js";
|
|
10
10
|
import * as PathUtils from "@sanity/util/paths";
|
|
@@ -2323,7 +2323,7 @@ function DocumentInspectorPanel(props) {
|
|
|
2323
2323
|
return null;
|
|
2324
2324
|
const Component = inspector.component;
|
|
2325
2325
|
let t1;
|
|
2326
|
-
$[3] !== Component || $[4] !== documentId || $[5] !== documentType || $[6] !== handleClose ? (t1 = /* @__PURE__ */ jsx(
|
|
2326
|
+
$[3] !== Component || $[4] !== documentId || $[5] !== documentType || $[6] !== handleClose ? (t1 = /* @__PURE__ */ jsx(Component, { onClose: handleClose, documentId, documentType }), $[3] = Component, $[4] = documentId, $[5] = documentType, $[6] = handleClose, $[7] = t1) : t1 = $[7];
|
|
2327
2327
|
const element = t1;
|
|
2328
2328
|
if (features.resizablePanes) {
|
|
2329
2329
|
let t22;
|
|
@@ -8306,7 +8306,7 @@ function DocumentPaneProvider(props) {
|
|
|
8306
8306
|
}, $[216] = paramPath, $[217] = ready, $[218] = syncPathFromUrl, $[219] = t50) : t50 = $[219];
|
|
8307
8307
|
let t51;
|
|
8308
8308
|
$[220] !== paramPath || $[221] !== ready ? (t51 = [paramPath, ready], $[220] = paramPath, $[221] = ready, $[222] = t51) : t51 = $[222], useEffect(t50, t51);
|
|
8309
|
-
const isDivergencesEnabled =
|
|
8309
|
+
const isDivergencesEnabled = advancedVersionControlEnabled && !!(formState && schemaType);
|
|
8310
8310
|
let t52;
|
|
8311
8311
|
$[223] !== editState_1 || $[224] !== formState || $[225] !== isDivergencesEnabled || $[226] !== schemaType || $[227] !== upstreamEditState_0 || $[228] !== value_0._id ? (t52 = isDivergencesEnabled && formState && schemaType ? {
|
|
8312
8312
|
enabled: !0,
|