sanity 5.10.0 → 5.11.0-next.10
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 +1 -1
- package/lib/_chunks-dts/index.d.ts +12 -12
- package/lib/_chunks-dts/types2.d.ts +25 -25
- package/lib/_chunks-es/package.js +1 -1
- package/lib/_chunks-es/pane.js +7 -1
- package/lib/_chunks-es/pane.js.map +1 -1
- package/lib/_chunks-es/version.js +1 -1
- package/lib/_singletons.d.ts +102 -102
- package/lib/desk.d.ts +1 -1
- package/lib/index.js +39 -6
- package/lib/index.js.map +1 -1
- package/lib/router.d.ts +4 -4
- package/lib/structure.d.ts +2 -2
- package/package.json +19 -19
|
@@ -7389,8 +7389,8 @@ declare function useScheduleAction(props: DocumentActionProps): {
|
|
|
7389
7389
|
icon: react576.ForwardRefExoticComponent<Omit<react576.SVGProps<SVGSVGElement>, "ref"> & react576.RefAttributes<SVGSVGElement>>;
|
|
7390
7390
|
label: string;
|
|
7391
7391
|
title: react576.JSX.Element;
|
|
7392
|
-
onHandle?: undefined;
|
|
7393
7392
|
dialog?: undefined;
|
|
7393
|
+
onHandle?: undefined;
|
|
7394
7394
|
} | {
|
|
7395
7395
|
dialog: false | DocumentActionModalDialogProps;
|
|
7396
7396
|
disabled: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { A as StructureToolOptions, E as StructureResolver, O as StructureToolContextValue, _t as DefaultDocumentNodeResolver, f as DocumentPaneNode, i as PaneRouterContextValue, s as DocumentPaneContextValue, v as PaneNode } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react652 from "react";
|
|
3
3
|
import { ComponentProps, ComponentType, ElementType, HTMLProps, ReactNode } from "react";
|
|
4
4
|
import { Path, PreviewValue, SanityDocument, SanityDocumentLike, SchemaType, SortOrdering } from "@sanity/types";
|
|
5
5
|
import { BoxOverflow, CardProps, SelectableTone } from "@sanity/ui";
|
|
6
6
|
import { PaneRouterContext } from "sanity/_singletons";
|
|
7
|
-
import * as
|
|
7
|
+
import * as sanity4 from "sanity";
|
|
8
8
|
import { ActionComponent, DecorationMember, DocumentActionComponent, DocumentActionDialogProps, DocumentDefinition, EditStateFor, GeneralPreviewLayoutKey, InitialValueTemplateItem, PreviewConfig, ReleaseId, SanityClient, SanityDocument as SanityDocument$1, TimelineStore } from "sanity";
|
|
9
9
|
interface BaseStructureToolPaneProps<T extends PaneNode['type']> {
|
|
10
10
|
paneKey: string;
|
|
@@ -54,7 +54,7 @@ interface ConfirmDeleteDialogProps {
|
|
|
54
54
|
onConfirm: (versions: string[]) => void;
|
|
55
55
|
}
|
|
56
56
|
/** @internal */
|
|
57
|
-
declare function ConfirmDeleteDialogContainer(props: ConfirmDeleteDialogProps):
|
|
57
|
+
declare function ConfirmDeleteDialogContainer(props: ConfirmDeleteDialogProps): react652.JSX.Element;
|
|
58
58
|
interface PaneProps {
|
|
59
59
|
children?: ReactNode;
|
|
60
60
|
currentMinWidth?: number;
|
|
@@ -69,7 +69,7 @@ interface PaneProps {
|
|
|
69
69
|
* @hidden
|
|
70
70
|
* @internal
|
|
71
71
|
*/
|
|
72
|
-
declare const Pane:
|
|
72
|
+
declare const Pane: react652.ForwardRefExoticComponent<Omit<PaneProps & Omit<CardProps, "as" | "overflow"> & Omit<HTMLProps<HTMLDivElement>, "as" | "height" | "hidden" | "id" | "style">, "ref"> & react652.RefAttributes<HTMLDivElement>>;
|
|
73
73
|
interface PaneContentProps {
|
|
74
74
|
as?: ElementType | keyof React.JSX.IntrinsicElements;
|
|
75
75
|
overflow?: BoxOverflow;
|
|
@@ -79,7 +79,7 @@ interface PaneContentProps {
|
|
|
79
79
|
* @hidden
|
|
80
80
|
* @internal
|
|
81
81
|
*/
|
|
82
|
-
declare const PaneContent:
|
|
82
|
+
declare const PaneContent: react652.ForwardRefExoticComponent<PaneContentProps & Omit<HTMLProps<HTMLDivElement>, "as" | "height" | "ref"> & react652.RefAttributes<HTMLDivElement>>;
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
85
|
* @hidden
|
|
@@ -95,7 +95,7 @@ interface PaneLayoutProps {
|
|
|
95
95
|
* @hidden
|
|
96
96
|
* @beta This API will change. DO NOT USE IN PRODUCTION.
|
|
97
97
|
*/
|
|
98
|
-
declare function PaneLayout(props: PaneLayoutProps & CardProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'wrap'>):
|
|
98
|
+
declare function PaneLayout(props: PaneLayoutProps & CardProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'wrap'>): react652.JSX.Element;
|
|
99
99
|
/**
|
|
100
100
|
*
|
|
101
101
|
* @hidden
|
|
@@ -666,7 +666,7 @@ type DocumentPaneOptions = DocumentPaneNode['options'];
|
|
|
666
666
|
/**
|
|
667
667
|
* @internal
|
|
668
668
|
*/
|
|
669
|
-
declare const DocumentPane:
|
|
669
|
+
declare const DocumentPane: react652.NamedExoticComponent<DocumentPaneProviderProps>;
|
|
670
670
|
/**
|
|
671
671
|
* @internal
|
|
672
672
|
*/
|
|
@@ -674,7 +674,7 @@ declare function usePaneOptions(options: DocumentPaneOptions, params?: Record<st
|
|
|
674
674
|
/**
|
|
675
675
|
* @internal
|
|
676
676
|
*/
|
|
677
|
-
declare const DocumentPaneProviderWrapper:
|
|
677
|
+
declare const DocumentPaneProviderWrapper: react652.MemoExoticComponent<(props: DocumentPaneProviderProps) => react652.JSX.Element>;
|
|
678
678
|
/**
|
|
679
679
|
* useDocumentTitle hook return type.
|
|
680
680
|
*
|
|
@@ -702,13 +702,13 @@ interface DocumentInspectorHeaderProps {
|
|
|
702
702
|
title: ReactNode;
|
|
703
703
|
}
|
|
704
704
|
/** @internal */
|
|
705
|
-
declare function DocumentInspectorHeader(props: DocumentInspectorHeaderProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref'>):
|
|
705
|
+
declare function DocumentInspectorHeader(props: DocumentInspectorHeaderProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref'>): react652.JSX.Element;
|
|
706
706
|
/** @internal */
|
|
707
707
|
declare function useDocumentPane(): DocumentPaneContextValue;
|
|
708
708
|
/**
|
|
709
709
|
* @internal
|
|
710
710
|
*/
|
|
711
|
-
declare const PaneContainer:
|
|
711
|
+
declare const PaneContainer: react652.NamedExoticComponent<BaseStructureToolPaneProps<"documentList">>;
|
|
712
712
|
/**
|
|
713
713
|
* @internal
|
|
714
714
|
*/
|
|
@@ -759,7 +759,7 @@ type DocumentListPaneProps = ComponentProps<typeof PaneContainer>;
|
|
|
759
759
|
* })
|
|
760
760
|
* ```
|
|
761
761
|
* */
|
|
762
|
-
declare const structureTool:
|
|
762
|
+
declare const structureTool: sanity4.Plugin<void | StructureToolOptions>;
|
|
763
763
|
/** @internal */
|
|
764
764
|
interface StructureToolProviderProps {
|
|
765
765
|
structure?: StructureResolver;
|
|
@@ -774,4 +774,4 @@ declare function StructureToolProvider({
|
|
|
774
774
|
}: StructureToolProviderProps): React.JSX.Element;
|
|
775
775
|
/** @internal */
|
|
776
776
|
declare function useStructureTool(): StructureToolContextValue;
|
|
777
|
-
export {
|
|
777
|
+
export { PaneLayout as C, ConfirmDeleteDialogProps as D, ConfirmDeleteDialogContainer as E, BaseStructureToolPaneProps as O, usePaneRouter as S, Pane as T, StructureLocaleResourceKeys as _, structureTool as a, IncomingReferenceAction as b, useDocumentPane as c, useDocumentTitle as d, DocumentPaneProviderWrapper as f, structureLocaleNamespace as g, DocumentPaneProviderProps as h, StructureToolProviderProps as i, DocumentInspectorHeader as l, usePaneOptions as m, useStructureTool as n, DocumentListPaneProps as o, DocumentPane as p, StructureToolProvider as r, PaneContainer as s, PaneRouterContext as t, UseDocumentTitle as u, isIncomingReferenceCreation as v, PaneContent as w, IncomingReferencesOptions as x, defineIncomingReferenceDecoration as y };
|
|
@@ -4,14 +4,14 @@ 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
6
|
import { PreviewUrlResolver } from "@sanity/preview-url-secret/define-preview-url";
|
|
7
|
-
import * as
|
|
7
|
+
import * as xstate53 from "xstate";
|
|
8
8
|
import { ActorRefFrom } from "xstate";
|
|
9
9
|
interface Context$2 {
|
|
10
10
|
url: URL | null;
|
|
11
11
|
error: Error | null;
|
|
12
12
|
visualEditingOverlaysEnabled: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const presentationMachine:
|
|
14
|
+
declare const presentationMachine: xstate53.StateMachine<Context$2, {
|
|
15
15
|
type: "toggle visual editing overlays";
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
} | {
|
|
@@ -22,7 +22,7 @@ declare const presentationMachine: xstate102.StateMachine<Context$2, {
|
|
|
22
22
|
type: "iframe reload";
|
|
23
23
|
}, {}, never, never, never, never, "error" | "loading" | {
|
|
24
24
|
loaded: "idle" | "refreshing" | "reloading";
|
|
25
|
-
}, "busy" | "error",
|
|
25
|
+
}, "busy" | "error", xstate53.NonReducibleUnknown, xstate53.NonReducibleUnknown, xstate53.EventObject, xstate53.MetaObject, {
|
|
26
26
|
id: "Presentation Tool";
|
|
27
27
|
states: {
|
|
28
28
|
readonly error: {};
|
|
@@ -68,65 +68,65 @@ interface CheckPermissionInput {
|
|
|
68
68
|
checkPermissionName: DocumentValuePermission;
|
|
69
69
|
document: Partial<SanityDocument> | null;
|
|
70
70
|
}
|
|
71
|
-
declare const previewUrlMachine:
|
|
72
|
-
[x: string]:
|
|
71
|
+
declare const previewUrlMachine: xstate53.StateMachine<Context$1, SetPreviewSearchParamEvent, {
|
|
72
|
+
[x: string]: xstate53.ActorRefFromLogic<xstate53.ObservableActorLogic<PermissionCheckResult, CheckPermissionInput, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<URLPattern[], {
|
|
73
73
|
initialUrl: URL;
|
|
74
|
-
},
|
|
74
|
+
}, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<URL, ResolvePreviewModeUrlInput, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<URL, {
|
|
75
75
|
initialUrl: URL;
|
|
76
76
|
previewSearchParam: string | null | undefined;
|
|
77
77
|
allowOrigins: URLPattern[];
|
|
78
|
-
},
|
|
78
|
+
}, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<URL, {
|
|
79
79
|
previewSearchParam: string | null;
|
|
80
|
-
},
|
|
80
|
+
}, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<{
|
|
81
81
|
secret: string;
|
|
82
82
|
expiresAt: Date;
|
|
83
|
-
},
|
|
83
|
+
}, xstate53.NonReducibleUnknown, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<string | null, xstate53.NonReducibleUnknown, xstate53.EventObject>> | xstate53.ActorRefFromLogic<xstate53.PromiseActorLogic<false | PreviewUrlPreviewMode, {
|
|
84
84
|
targetOrigin: string;
|
|
85
|
-
},
|
|
85
|
+
}, xstate53.EventObject>> | undefined;
|
|
86
86
|
}, {
|
|
87
87
|
src: "check permission";
|
|
88
|
-
logic:
|
|
88
|
+
logic: xstate53.ObservableActorLogic<PermissionCheckResult, CheckPermissionInput, xstate53.EventObject>;
|
|
89
89
|
id: string | undefined;
|
|
90
90
|
} | {
|
|
91
91
|
src: "create preview secret";
|
|
92
|
-
logic:
|
|
92
|
+
logic: xstate53.PromiseActorLogic<{
|
|
93
93
|
secret: string;
|
|
94
94
|
expiresAt: Date;
|
|
95
|
-
},
|
|
95
|
+
}, xstate53.NonReducibleUnknown, xstate53.EventObject>;
|
|
96
96
|
id: string | undefined;
|
|
97
97
|
} | {
|
|
98
98
|
src: "read shared preview secret";
|
|
99
|
-
logic:
|
|
99
|
+
logic: xstate53.PromiseActorLogic<string | null, xstate53.NonReducibleUnknown, xstate53.EventObject>;
|
|
100
100
|
id: string | undefined;
|
|
101
101
|
} | {
|
|
102
102
|
src: "resolve allow patterns";
|
|
103
|
-
logic:
|
|
103
|
+
logic: xstate53.PromiseActorLogic<URLPattern[], {
|
|
104
104
|
initialUrl: URL;
|
|
105
|
-
},
|
|
105
|
+
}, xstate53.EventObject>;
|
|
106
106
|
id: string | undefined;
|
|
107
107
|
} | {
|
|
108
108
|
src: "resolve initial url";
|
|
109
|
-
logic:
|
|
109
|
+
logic: xstate53.PromiseActorLogic<URL, {
|
|
110
110
|
previewSearchParam: string | null;
|
|
111
|
-
},
|
|
111
|
+
}, xstate53.EventObject>;
|
|
112
112
|
id: string | undefined;
|
|
113
113
|
} | {
|
|
114
114
|
src: "resolve preview mode";
|
|
115
|
-
logic:
|
|
115
|
+
logic: xstate53.PromiseActorLogic<false | PreviewUrlPreviewMode, {
|
|
116
116
|
targetOrigin: string;
|
|
117
|
-
},
|
|
117
|
+
}, xstate53.EventObject>;
|
|
118
118
|
id: string | undefined;
|
|
119
119
|
} | {
|
|
120
120
|
src: "resolve preview mode url";
|
|
121
|
-
logic:
|
|
121
|
+
logic: xstate53.PromiseActorLogic<URL, ResolvePreviewModeUrlInput, xstate53.EventObject>;
|
|
122
122
|
id: string | undefined;
|
|
123
123
|
} | {
|
|
124
124
|
src: "resolve url from preview search param";
|
|
125
|
-
logic:
|
|
125
|
+
logic: xstate53.PromiseActorLogic<URL, {
|
|
126
126
|
initialUrl: URL;
|
|
127
127
|
previewSearchParam: string | null | undefined;
|
|
128
128
|
allowOrigins: URLPattern[];
|
|
129
|
-
},
|
|
129
|
+
}, xstate53.EventObject>;
|
|
130
130
|
id: string | undefined;
|
|
131
131
|
}, {
|
|
132
132
|
type: "assign error";
|
|
@@ -141,7 +141,7 @@ declare const previewUrlMachine: xstate102.StateMachine<Context$1, SetPreviewSea
|
|
|
141
141
|
};
|
|
142
142
|
} | {
|
|
143
143
|
type: "notify preview will likely fail";
|
|
144
|
-
params:
|
|
144
|
+
params: xstate53.NonReducibleUnknown;
|
|
145
145
|
}, {
|
|
146
146
|
type: "can create preview secret";
|
|
147
147
|
params: unknown;
|
|
@@ -162,7 +162,7 @@ declare const previewUrlMachine: xstate102.StateMachine<Context$1, SetPreviewSea
|
|
|
162
162
|
params: unknown;
|
|
163
163
|
}, "expiredSecret", "checkingPermissions" | "error" | "resolvingAllowPatterns" | "resolvingInitialUrl" | "resolvingPreviewMode" | "resolvingUrlFromPreviewSearchParam" | "success" | {
|
|
164
164
|
previewMode: "createPreviewSecret" | "error" | "readShareAccess" | "resolvePreviewUrl" | "success";
|
|
165
|
-
}, "busy" | "error", Input,
|
|
165
|
+
}, "busy" | "error", Input, xstate53.NonReducibleUnknown, xstate53.EventObject, xstate53.MetaObject, {
|
|
166
166
|
id: "Preview URL";
|
|
167
167
|
states: {
|
|
168
168
|
readonly checkingPermissions: {};
|
package/lib/_chunks-es/pane.js
CHANGED
|
@@ -5588,7 +5588,9 @@ const usePublishAction = (props) => {
|
|
|
5588
5588
|
published,
|
|
5589
5589
|
release,
|
|
5590
5590
|
version
|
|
5591
|
-
} = props,
|
|
5591
|
+
} = props, {
|
|
5592
|
+
selectedPerspective
|
|
5593
|
+
} = usePerspective(), [publishState, setPublishState] = useState(null);
|
|
5592
5594
|
let t0;
|
|
5593
5595
|
$[0] !== version ? (t0 = version?._id && getVersionFromId(version._id), $[0] = version, $[1] = t0) : t0 = $[1];
|
|
5594
5596
|
const bundleId = t0, {
|
|
@@ -5656,6 +5658,10 @@ const usePublishAction = (props) => {
|
|
|
5656
5658
|
const handle = t10;
|
|
5657
5659
|
let t11;
|
|
5658
5660
|
bb0: {
|
|
5661
|
+
if (isPublishedPerspective(selectedPerspective)) {
|
|
5662
|
+
t11 = null;
|
|
5663
|
+
break bb0;
|
|
5664
|
+
}
|
|
5659
5665
|
if (release && version) {
|
|
5660
5666
|
t11 = null;
|
|
5661
5667
|
break bb0;
|