@sanity/sdk-react 0.0.0-alpha.1
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/dist/_chunks-es/useLogOut.js +36 -0
- package/dist/_chunks-es/useLogOut.js.map +1 -0
- package/dist/components.d.ts +235 -0
- package/dist/components.js +250 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.d.ts +145 -0
- package/dist/hooks.js +27 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +113 -0
- package/src/_exports/components.ts +12 -0
- package/src/_exports/hooks.ts +7 -0
- package/src/_exports/index.ts +10 -0
- package/src/components/DocumentGridLayout/DocumentGridLayout.stories.tsx +95 -0
- package/src/components/DocumentGridLayout/DocumentGridLayout.test.tsx +42 -0
- package/src/components/DocumentGridLayout/DocumentGridLayout.tsx +23 -0
- package/src/components/DocumentListLayout/DocumentListLayout.stories.tsx +95 -0
- package/src/components/DocumentListLayout/DocumentListLayout.test.tsx +42 -0
- package/src/components/DocumentListLayout/DocumentListLayout.tsx +15 -0
- package/src/components/DocumentPreviewLayout/DocumentPreviewLayout.md +49 -0
- package/src/components/DocumentPreviewLayout/DocumentPreviewLayout.stories.tsx +34 -0
- package/src/components/DocumentPreviewLayout/DocumentPreviewLayout.test.tsx +30 -0
- package/src/components/DocumentPreviewLayout/DocumentPreviewLayout.tsx +115 -0
- package/src/components/Login/LoginLinks.test.tsx +100 -0
- package/src/components/Login/LoginLinks.tsx +73 -0
- package/src/components/auth/AuthBoundary.test.tsx +103 -0
- package/src/components/auth/AuthBoundary.tsx +101 -0
- package/src/components/auth/AuthError.test.ts +36 -0
- package/src/components/auth/AuthError.ts +27 -0
- package/src/components/auth/Login.test.tsx +41 -0
- package/src/components/auth/Login.tsx +58 -0
- package/src/components/auth/LoginCallback.test.tsx +86 -0
- package/src/components/auth/LoginCallback.tsx +41 -0
- package/src/components/auth/LoginError.test.tsx +56 -0
- package/src/components/auth/LoginError.tsx +54 -0
- package/src/components/auth/LoginFooter.test.tsx +29 -0
- package/src/components/auth/LoginFooter.tsx +67 -0
- package/src/components/auth/LoginLayout.test.tsx +33 -0
- package/src/components/auth/LoginLayout.tsx +99 -0
- package/src/components/context/SanityProvider.test.tsx +25 -0
- package/src/components/context/SanityProvider.tsx +42 -0
- package/src/hooks/Documents/.keep +0 -0
- package/src/hooks/auth/useAuthState.test.tsx +106 -0
- package/src/hooks/auth/useAuthState.tsx +33 -0
- package/src/hooks/auth/useAuthToken.test.tsx +94 -0
- package/src/hooks/auth/useAuthToken.tsx +16 -0
- package/src/hooks/auth/useCurrentUser.test.tsx +50 -0
- package/src/hooks/auth/useCurrentUser.tsx +27 -0
- package/src/hooks/auth/useHandleCallback.test.tsx +25 -0
- package/src/hooks/auth/useHandleCallback.tsx +50 -0
- package/src/hooks/auth/useLogOut.test.tsx +67 -0
- package/src/hooks/auth/useLogOut.tsx +15 -0
- package/src/hooks/auth/useLoginUrls.test.tsx +61 -0
- package/src/hooks/auth/useLoginUrls.tsx +51 -0
- package/src/hooks/client/useClient.test.tsx +130 -0
- package/src/hooks/client/useClient.ts +56 -0
- package/src/hooks/context/useSanityInstance.test.tsx +31 -0
- package/src/hooks/context/useSanityInstance.ts +23 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getAuthStore } from "@sanity/sdk";
|
|
2
|
+
import { useStore } from "zustand/react";
|
|
3
|
+
import { createContext, useContext, useMemo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
const SanityInstanceContext = createContext(null), SanityProvider = ({ children, sanityInstance }) => /* @__PURE__ */ jsx(SanityInstanceContext.Provider, { value: sanityInstance, children }), useSanityInstance = () => {
|
|
6
|
+
const sanityInstance = useContext(SanityInstanceContext);
|
|
7
|
+
if (!sanityInstance)
|
|
8
|
+
throw new Error("useSanityInstance must be called from within the SanityProvider");
|
|
9
|
+
return sanityInstance;
|
|
10
|
+
};
|
|
11
|
+
function useAuthState() {
|
|
12
|
+
const instance = useSanityInstance(), { authState } = getAuthStore(instance);
|
|
13
|
+
return useStore(authState);
|
|
14
|
+
}
|
|
15
|
+
function useLoginUrls() {
|
|
16
|
+
const instance = useSanityInstance(), result = useMemo(() => getAuthStore(instance), [instance]).getLoginUrls();
|
|
17
|
+
if (Array.isArray(result)) return result;
|
|
18
|
+
throw result;
|
|
19
|
+
}
|
|
20
|
+
function useHandleCallback() {
|
|
21
|
+
const instance = useSanityInstance();
|
|
22
|
+
return useMemo(() => getAuthStore(instance), [instance]).handleCallback;
|
|
23
|
+
}
|
|
24
|
+
const useLogOut = () => {
|
|
25
|
+
const instance = useSanityInstance(), { logout } = getAuthStore(instance);
|
|
26
|
+
return logout;
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
SanityProvider,
|
|
30
|
+
useAuthState,
|
|
31
|
+
useHandleCallback,
|
|
32
|
+
useLogOut,
|
|
33
|
+
useLoginUrls,
|
|
34
|
+
useSanityInstance
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=useLogOut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLogOut.js","sources":["../../src/components/context/SanityProvider.tsx","../../src/hooks/context/useSanityInstance.ts","../../src/hooks/auth/useAuthState.tsx","../../src/hooks/auth/useLoginUrls.tsx","../../src/hooks/auth/useHandleCallback.tsx","../../src/hooks/auth/useLogOut.tsx"],"sourcesContent":["import {type SanityInstance} from '@sanity/sdk'\nimport {createContext, type ReactElement} from 'react'\n\n/**\n * @public\n */\nexport interface SanityProviderProps {\n children: React.ReactNode\n sanityInstance: SanityInstance\n}\n\nexport const SanityInstanceContext = createContext<SanityInstance | null>(null)\n\n/**\n * Top-level context provider that provides a Sanity configuration instance.\n * This must wrap any Sanity SDK React component.\n * @public\n * @param props - Sanity project and dataset configuration\n * @returns Rendered component\n * @example\n * ```tsx\n * import {createSanityInstance} from '@sanity/sdk'\n * import {ExampleComponent, SanityProvider} from '@sanity/sdk-react'\n *\n * const sanityInstance = createSanityInstance({projectId: 'your-project-id', dataset: 'production'})\n *\n * export default function MyApp() {\n * return (\n * <SanityProvider sanityInstance={sanityInstance}>\n * <ExampleComponent />\n * </SanityProvider>\n * )\n * }\n * ```\n */\nexport const SanityProvider = ({children, sanityInstance}: SanityProviderProps): ReactElement => {\n return (\n <SanityInstanceContext.Provider value={sanityInstance}>\n {children}\n </SanityInstanceContext.Provider>\n )\n}\n","import type {SanityInstance} from '@sanity/sdk'\nimport {useContext} from 'react'\n\nimport {SanityInstanceContext} from '../../components/context/SanityProvider'\n\n/**\n * Hook that provides the current Sanity instance from the context.\n * This must be called from within a `SanityProvider` component.\n * @public\n * @returns the current Sanity instance\n * @example\n * ```tsx\n * const instance = useSanityInstance()\n * ```\n */\nexport const useSanityInstance = (): SanityInstance => {\n const sanityInstance = useContext(SanityInstanceContext)\n if (!sanityInstance) {\n throw new Error('useSanityInstance must be called from within the SanityProvider')\n }\n\n return sanityInstance\n}\n","import {type AuthState, getAuthStore} from '@sanity/sdk'\nimport {useStore} from 'zustand/react'\n\nimport {useSanityInstance} from '../context/useSanityInstance'\n\n/**\n * A React hook that subscribes to authentication state changes.\n *\n * This hook provides access to the current authentication state type from the Sanity auth store.\n * It automatically re-renders the component when the authentication state changes.\n *\n * @remarks\n * The hook uses `useSyncExternalStore` to safely subscribe to auth state changes\n * and ensure consistency between server and client rendering.\n *\n * @returns The current authentication state type\n *\n * @example\n * ```tsx\n * function AuthStatus() {\n * const authState = useAuthState()\n * return <div>Current auth state: {authState}</div>\n * }\n * ```\n *\n * @public\n */\nexport function useAuthState(): AuthState {\n const instance = useSanityInstance()\n const {authState} = getAuthStore(instance)\n\n return useStore(authState)\n}\n","import {type AuthProvider, getAuthStore} from '@sanity/sdk'\nimport {useMemo} from 'react'\n\nimport {useSanityInstance} from '../context/useSanityInstance'\n\n/**\n * A React hook that retrieves the available authentication provider URLs for login.\n *\n * @remarks\n * This hook fetches the login URLs from the Sanity auth store when the component mounts.\n * Each provider object contains information about an authentication method, including its URL.\n * The hook will suspend if the login URLs have not yet loaded.\n *\n * @example\n * ```tsx\n * // LoginProviders component that uses the hook\n * function LoginProviders() {\n * const providers = useLoginUrls()\n *\n * return (\n * <div>\n * {providers.map((provider) => (\n * <a key={provider.name} href={provider.url}>\n * Login with {provider.title}\n * </a>\n * ))}\n * </div>\n * )\n * }\n *\n * // Parent component with Suspense boundary\n * function LoginPage() {\n * return (\n * <Suspense fallback={<div>Loading authentication providers...</div>}>\n * <LoginProviders />\n * </Suspense>\n * )\n * }\n * ```\n *\n * @returns An array of {@link AuthProvider} objects containing login URLs and provider information\n * @public\n */\nexport function useLoginUrls(): AuthProvider[] {\n const instance = useSanityInstance()\n const authStore = useMemo(() => getAuthStore(instance), [instance])\n const result = authStore.getLoginUrls()\n\n if (Array.isArray(result)) return result\n throw result\n}\n","import {type AuthStore, getAuthStore} from '@sanity/sdk'\nimport {useMemo} from 'react'\n\nimport {useSanityInstance} from '../context/useSanityInstance'\n\n/**\n * A React hook that returns a function for handling authentication callbacks.\n *\n * @remarks\n * This hook provides access to the authentication store's callback handler,\n * which processes auth redirects by extracting the session ID and fetching the\n * authentication token. If fetching the long-lived token is successful,\n * `handleCallback` will return a Promise that resolves a new location that\n * removes the short-lived token from the URL. Use this in combination with\n * `history.replaceState` or your own router's `replace` function to update the\n * current location without triggering a reload.\n *\n * @example\n * ```tsx\n * function AuthCallback() {\n * const handleCallback = useHandleCallback()\n * const router = useRouter() // Example router\n *\n * useEffect(() => {\n * async function processCallback() {\n * // Handle the callback and get the cleaned URL\n * const newUrl = await handleCallback(window.location.href)\n *\n * if (newUrl) {\n * // Replace URL without triggering navigation\n * router.replace(newUrl, {shallow: true})\n * }\n * }\n *\n * processCallback().catch(console.error)\n * }, [handleCallback, router])\n *\n * return <div>Completing login...</div>\n * }\n * ```\n *\n * @returns A callback handler function that processes OAuth redirects\n * @public\n */\nexport function useHandleCallback(): AuthStore['handleCallback'] {\n const instance = useSanityInstance()\n const authStore = useMemo(() => getAuthStore(instance), [instance])\n\n return authStore.handleCallback\n}\n","import {type AuthStore, getAuthStore} from '@sanity/sdk'\n\nimport {useSanityInstance} from '../context/useSanityInstance'\n\n/**\n * Hook to log out of the current session\n * @public\n * @returns A function to log out of the current session\n */\nexport const useLogOut = (): AuthStore['logout'] => {\n const instance = useSanityInstance()\n const {logout} = getAuthStore(instance)\n\n return logout\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,wBAAwB,cAAqC,IAAI,GAwBjE,iBAAiB,CAAC,EAAC,UAAU,eAAc,0BAEnD,sBAAsB,UAAtB,EAA+B,OAAO,gBACpC,SACH,CAAA,GCxBS,oBAAoB,MAAsB;AAC/C,QAAA,iBAAiB,WAAW,qBAAqB;AACvD,MAAI,CAAC;AACG,UAAA,IAAI,MAAM,iEAAiE;AAG5E,SAAA;AACT;ACKO,SAAS,eAA0B;AACxC,QAAM,WAAW,kBAAkB,GAC7B,EAAC,UAAS,IAAI,aAAa,QAAQ;AAEzC,SAAO,SAAS,SAAS;AAC3B;ACWO,SAAS,eAA+B;AAC7C,QAAM,WAAW,qBAEX,SADY,QAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC,EACzC,aAAa;AAEtC,MAAI,MAAM,QAAQ,MAAM,EAAU,QAAA;AAC5B,QAAA;AACR;ACNO,SAAS,oBAAiD;AAC/D,QAAM,WAAW,kBAAkB;AACjB,SAAA,QAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC,EAEjD;AACnB;ACxCO,MAAM,YAAY,MAA2B;AAClD,QAAM,WAAW,kBAAkB,GAC7B,EAAC,OAAM,IAAI,aAAa,QAAQ;AAE/B,SAAA;AACT;"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import {FallbackProps} from 'react-error-boundary'
|
|
2
|
+
import type {PropsWithChildren} from 'react'
|
|
3
|
+
import {ReactElement} from 'react'
|
|
4
|
+
import {SanityInstance} from '@sanity/sdk'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A component that handles authentication flow and error boundaries for a
|
|
8
|
+
* protected section of the application.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This component manages different authentication states and renders the
|
|
12
|
+
* appropriate components based on that state.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* function App() {
|
|
17
|
+
* return (
|
|
18
|
+
* <AuthBoundary header={<MyLogo />}>
|
|
19
|
+
* <ProtectedContent />
|
|
20
|
+
* </AuthBoundary>
|
|
21
|
+
* )
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @alpha
|
|
26
|
+
*/
|
|
27
|
+
export declare function AuthBoundary({
|
|
28
|
+
LoginErrorComponent,
|
|
29
|
+
...props
|
|
30
|
+
}: AuthBoundaryProps): React.ReactNode
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @alpha
|
|
34
|
+
*/
|
|
35
|
+
export declare interface AuthBoundaryProps extends LoginLayoutProps {
|
|
36
|
+
/**
|
|
37
|
+
* Custom component to render the login screen.
|
|
38
|
+
* Receives all login layout props. Defaults to {@link Login}.
|
|
39
|
+
*/
|
|
40
|
+
LoginComponent?: React.ComponentType<LoginLayoutProps>
|
|
41
|
+
/**
|
|
42
|
+
* Custom component to render during OAuth callback processing.
|
|
43
|
+
* Receives all login layout props. Defaults to {@link LoginCallback}.
|
|
44
|
+
*/
|
|
45
|
+
CallbackComponent?: React.ComponentType<LoginLayoutProps>
|
|
46
|
+
/**
|
|
47
|
+
* Custom component to render when authentication errors occur.
|
|
48
|
+
* Receives login layout props and error boundary props. Defaults to
|
|
49
|
+
* {@link LoginError}
|
|
50
|
+
*/
|
|
51
|
+
LoginErrorComponent?: React.ComponentType<LoginErrorProps>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export declare const DocumentGridLayout: {
|
|
58
|
+
(props: PropsWithChildren): ReactElement
|
|
59
|
+
displayName: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare const DocumentListLayout: {
|
|
66
|
+
(props: PropsWithChildren): ReactElement
|
|
67
|
+
displayName: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* This is a component that renders a document preview.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*
|
|
75
|
+
* @param props - The props for the DocumentPreviewLayout component.
|
|
76
|
+
* @returns - The DocumentPreviewLayout component.
|
|
77
|
+
*/
|
|
78
|
+
export declare const DocumentPreviewLayout: {
|
|
79
|
+
({docType, selected, status, subtitle, title, url}: DocumentPreviewLayoutProps): JSX.Element
|
|
80
|
+
displayName: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export declare interface DocumentPreviewLayoutProps {
|
|
87
|
+
docType?: string
|
|
88
|
+
media?: React.ReactNode
|
|
89
|
+
selected?: boolean
|
|
90
|
+
status?: string
|
|
91
|
+
subtitle?: string
|
|
92
|
+
title: string
|
|
93
|
+
url?: string
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Login component that displays available authentication providers.
|
|
98
|
+
* Renders a list of login options with a loading fallback while providers load.
|
|
99
|
+
*
|
|
100
|
+
* @alpha
|
|
101
|
+
*/
|
|
102
|
+
export declare function Login({header, footer}: LoginLayoutProps): JSX.Element
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Component shown during auth callback processing that handles login completion.
|
|
106
|
+
* Automatically processes the auth callback when mounted and updates the URL
|
|
107
|
+
* to remove callback parameters without triggering a page reload.
|
|
108
|
+
*
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
export declare function LoginCallback({header, footer}: LoginLayoutProps): React.ReactNode
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Displays authentication error details and provides retry functionality.
|
|
115
|
+
* Only handles {@link AuthError} instances - rethrows other error types.
|
|
116
|
+
*
|
|
117
|
+
* @alpha
|
|
118
|
+
*/
|
|
119
|
+
export declare function LoginError({
|
|
120
|
+
error,
|
|
121
|
+
resetErrorBoundary,
|
|
122
|
+
header,
|
|
123
|
+
footer,
|
|
124
|
+
}: LoginErrorProps): React.ReactNode
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @alpha
|
|
128
|
+
*/
|
|
129
|
+
export declare type LoginErrorProps = FallbackProps & LoginLayoutProps
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Layout component for login-related screens providing consistent styling and structure.
|
|
133
|
+
* Renders content in a centered card with optional header and footer sections.
|
|
134
|
+
*
|
|
135
|
+
* Can be used to build custom login screens for the AuthBoundary component, including:
|
|
136
|
+
* - Login provider selection (LoginComponent)
|
|
137
|
+
* - OAuth callback handling (CallbackComponent)
|
|
138
|
+
* - Error states (LoginErrorComponent)
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* // Custom login screen using the layout
|
|
143
|
+
* function CustomLogin({header, footer}: LoginLayoutProps) {
|
|
144
|
+
* return (
|
|
145
|
+
* <LoginLayout
|
|
146
|
+
* header={header}
|
|
147
|
+
* footer={footer}
|
|
148
|
+
* >
|
|
149
|
+
* <CustomLoginContent />
|
|
150
|
+
* </LoginLayout>
|
|
151
|
+
* )
|
|
152
|
+
* }
|
|
153
|
+
*
|
|
154
|
+
* // Use with AuthBoundary
|
|
155
|
+
* <AuthBoundary
|
|
156
|
+
* LoginComponent={CustomLogin}
|
|
157
|
+
* header={<Logo />}
|
|
158
|
+
* >
|
|
159
|
+
* <ProtectedContent />
|
|
160
|
+
* </AuthBoundary>
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @alpha
|
|
164
|
+
*/
|
|
165
|
+
export declare function LoginLayout({children, footer, header}: LoginLayoutProps): React.ReactNode
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @alpha
|
|
169
|
+
*/
|
|
170
|
+
export declare interface LoginLayoutProps {
|
|
171
|
+
/** Optional header content rendered at top of card */
|
|
172
|
+
header?: React.ReactNode
|
|
173
|
+
/** Optional footer content rendered below card. Defaults to an internal login footer */
|
|
174
|
+
footer?: React.ReactNode
|
|
175
|
+
/** Main content rendered in card body */
|
|
176
|
+
children?: React.ReactNode
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Component that handles Sanity authentication flow and renders login provider options
|
|
181
|
+
*
|
|
182
|
+
* @public
|
|
183
|
+
*
|
|
184
|
+
* @returns Rendered component
|
|
185
|
+
*
|
|
186
|
+
* @remarks
|
|
187
|
+
* The component handles three states:
|
|
188
|
+
* 1. Loading state during token exchange
|
|
189
|
+
* 2. Success state after successful authentication
|
|
190
|
+
* 3. Provider selection UI when not authenticated
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* const config = { projectId: 'your-project-id', dataset: 'production' }
|
|
195
|
+
* return <LoginLinks sanityInstance={config} />
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export declare const LoginLinks: () => ReactElement
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Top-level context provider that provides a Sanity configuration instance.
|
|
202
|
+
* This must wrap any Sanity SDK React component.
|
|
203
|
+
* @public
|
|
204
|
+
* @param props - Sanity project and dataset configuration
|
|
205
|
+
* @returns Rendered component
|
|
206
|
+
* @example
|
|
207
|
+
* ```tsx
|
|
208
|
+
* import {createSanityInstance} from '@sanity/sdk'
|
|
209
|
+
* import {ExampleComponent, SanityProvider} from '@sanity/sdk-react'
|
|
210
|
+
*
|
|
211
|
+
* const sanityInstance = createSanityInstance({projectId: 'your-project-id', dataset: 'production'})
|
|
212
|
+
*
|
|
213
|
+
* export default function MyApp() {
|
|
214
|
+
* return (
|
|
215
|
+
* <SanityProvider sanityInstance={sanityInstance}>
|
|
216
|
+
* <ExampleComponent />
|
|
217
|
+
* </SanityProvider>
|
|
218
|
+
* )
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
export declare const SanityProvider: ({
|
|
223
|
+
children,
|
|
224
|
+
sanityInstance,
|
|
225
|
+
}: SanityProviderProps) => ReactElement
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export declare interface SanityProviderProps {
|
|
231
|
+
children: React.ReactNode
|
|
232
|
+
sanityInstance: SanityInstance
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export {}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, Suspense, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
4
|
+
import { useLoginUrls, useHandleCallback, useLogOut, useAuthState } from "./_chunks-es/useLogOut.js";
|
|
5
|
+
import { SanityProvider } from "./_chunks-es/useLogOut.js";
|
|
6
|
+
import { Text, Flex, Card, Heading, Spinner, Button, Stack, Badge, Container as Container$2 } from "@sanity/ui";
|
|
7
|
+
import styled from "styled-components";
|
|
8
|
+
import { SanityLogo } from "@sanity/logos";
|
|
9
|
+
class AuthError extends Error {
|
|
10
|
+
constructor(error) {
|
|
11
|
+
typeof error == "object" && error && "message" in error && typeof error.message == "string" ? super(error.message) : super(), this.cause = error;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const LINKS = [
|
|
15
|
+
{
|
|
16
|
+
url: "https://slack.sanity.io/",
|
|
17
|
+
i18nKey: "workspaces.community-title",
|
|
18
|
+
title: "Community"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
url: "https://www.sanity.io/docs",
|
|
22
|
+
i18nKey: "workspaces.docs-title",
|
|
23
|
+
title: "Docs"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
url: "https://www.sanity.io/legal/privacy",
|
|
27
|
+
i18nKey: "workspaces.privacy-title",
|
|
28
|
+
title: "Privacy"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
url: "https://www.sanity.io",
|
|
32
|
+
i18nKey: "workspaces.sanity-io-title",
|
|
33
|
+
title: "sanity.io"
|
|
34
|
+
}
|
|
35
|
+
], StyledText = styled(Text)`
|
|
36
|
+
a {
|
|
37
|
+
color: inherit;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
function LoginFooter() {
|
|
41
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, justify: "center", align: "center", paddingTop: 2, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Text, { size: 3, children: /* @__PURE__ */ jsx(SanityLogo, {}) }),
|
|
43
|
+
/* @__PURE__ */ jsx(Flex, { align: "center", gap: 2, children: LINKS.map((link, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(StyledText, { muted: !0, size: 1, children: /* @__PURE__ */ jsx("a", { href: link.url, target: "_blank", rel: "noopener noreferrer", children: link.title }) }),
|
|
45
|
+
index < LINKS.length - 1 && /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: "\u2022" })
|
|
46
|
+
] }, link.title)) })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
const Root = styled.div`
|
|
50
|
+
width: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
`, Container$1 = styled(Flex)`
|
|
53
|
+
width: 320px;
|
|
54
|
+
margin: auto;
|
|
55
|
+
display: flex;
|
|
56
|
+
`, StyledCard = styled(Card)``, ChildrenFlex = styled(Flex)`
|
|
57
|
+
min-height: 154px;
|
|
58
|
+
`;
|
|
59
|
+
function LoginLayout({
|
|
60
|
+
children,
|
|
61
|
+
footer = /* @__PURE__ */ jsx(LoginFooter, {}),
|
|
62
|
+
header
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(Container$1, { direction: "column", gap: 4, children: [
|
|
65
|
+
/* @__PURE__ */ jsx(StyledCard, { border: !0, radius: 2, paddingY: 4, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, children: [
|
|
66
|
+
header && /* @__PURE__ */ jsx(Card, { borderBottom: !0, paddingX: 4, paddingBottom: 3, children: header }),
|
|
67
|
+
children && /* @__PURE__ */ jsx(ChildrenFlex, { paddingX: 4, direction: "column", children })
|
|
68
|
+
] }) }),
|
|
69
|
+
footer
|
|
70
|
+
] }) });
|
|
71
|
+
}
|
|
72
|
+
const FallbackRoot = styled(Flex)`
|
|
73
|
+
height: 123px;
|
|
74
|
+
`;
|
|
75
|
+
function Login({ header, footer }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(LoginLayout, { header, footer, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(Heading, { as: "h1", size: 1, align: "center", children: "Choose login provider" }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Suspense,
|
|
80
|
+
{
|
|
81
|
+
fallback: /* @__PURE__ */ jsx(FallbackRoot, { align: "center", justify: "center", children: /* @__PURE__ */ jsx(Spinner, {}) }),
|
|
82
|
+
children: /* @__PURE__ */ jsx(Providers, {})
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }) });
|
|
86
|
+
}
|
|
87
|
+
function Providers() {
|
|
88
|
+
const loginUrls = useLoginUrls();
|
|
89
|
+
return /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, children: loginUrls.map(({ title, url }) => /* @__PURE__ */ jsx(Button, { text: title, as: "a", href: url, mode: "ghost" }, url)) });
|
|
90
|
+
}
|
|
91
|
+
const StyledFlex$1 = styled(Flex)`
|
|
92
|
+
margin: auto;
|
|
93
|
+
`;
|
|
94
|
+
function LoginCallback({ header, footer }) {
|
|
95
|
+
const handleCallback = useHandleCallback();
|
|
96
|
+
return useEffect(() => {
|
|
97
|
+
const url = new URL(location.href);
|
|
98
|
+
handleCallback(url.toString()).then((replacementLocation) => {
|
|
99
|
+
replacementLocation && history.replaceState(null, "", replacementLocation);
|
|
100
|
+
});
|
|
101
|
+
}, [handleCallback]), /* @__PURE__ */ jsx(LoginLayout, { header, footer, children: /* @__PURE__ */ jsxs(StyledFlex$1, { direction: "column", justify: "center", align: "center", gap: 4, children: [
|
|
102
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: "Logging you in\u2026" }),
|
|
103
|
+
/* @__PURE__ */ jsx(Spinner, { size: 4 })
|
|
104
|
+
] }) });
|
|
105
|
+
}
|
|
106
|
+
const StyledFlex = styled(Flex)`
|
|
107
|
+
margin: auto;
|
|
108
|
+
`;
|
|
109
|
+
function LoginError({
|
|
110
|
+
error,
|
|
111
|
+
resetErrorBoundary,
|
|
112
|
+
header,
|
|
113
|
+
footer
|
|
114
|
+
}) {
|
|
115
|
+
if (!(error instanceof AuthError)) throw error;
|
|
116
|
+
const logout = useLogOut(), handleRetry = useCallback(async () => {
|
|
117
|
+
await logout(), resetErrorBoundary();
|
|
118
|
+
}, [logout, resetErrorBoundary]);
|
|
119
|
+
return /* @__PURE__ */ jsx(LoginLayout, { header, footer, children: /* @__PURE__ */ jsxs(StyledFlex, { direction: "column", gap: 4, children: [
|
|
120
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, children: [
|
|
121
|
+
/* @__PURE__ */ jsx(Text, { as: "h2", align: "center", weight: "bold", size: 3, children: "Authentication Error" }),
|
|
122
|
+
/* @__PURE__ */ jsx(Text, { size: 1, align: "center", children: "Please try again or contact support if the problem persists." })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsx(Button, { text: "Retry", tone: "primary", onClick: handleRetry })
|
|
125
|
+
] }) });
|
|
126
|
+
}
|
|
127
|
+
function AuthBoundary({
|
|
128
|
+
LoginErrorComponent = LoginError,
|
|
129
|
+
...props
|
|
130
|
+
}) {
|
|
131
|
+
const { header, footer } = props, FallbackComponent = useMemo(() => function(fallbackProps) {
|
|
132
|
+
return /* @__PURE__ */ jsx(LoginErrorComponent, { ...fallbackProps, header, footer });
|
|
133
|
+
}, [header, footer, LoginErrorComponent]);
|
|
134
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent, children: /* @__PURE__ */ jsx(AuthSwitch, { ...props }) });
|
|
135
|
+
}
|
|
136
|
+
function AuthSwitch({
|
|
137
|
+
LoginComponent = Login,
|
|
138
|
+
CallbackComponent = LoginCallback,
|
|
139
|
+
children,
|
|
140
|
+
...props
|
|
141
|
+
}) {
|
|
142
|
+
const authState = useAuthState();
|
|
143
|
+
switch (authState.type) {
|
|
144
|
+
case "error":
|
|
145
|
+
throw new AuthError(authState.error);
|
|
146
|
+
case "logging-in":
|
|
147
|
+
return /* @__PURE__ */ jsx(CallbackComponent, { ...props });
|
|
148
|
+
case "logged-in":
|
|
149
|
+
return children;
|
|
150
|
+
default:
|
|
151
|
+
return /* @__PURE__ */ jsx(LoginComponent, { ...props });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const DocumentGrid = styled.div`
|
|
155
|
+
display: grid;
|
|
156
|
+
list-style: none;
|
|
157
|
+
margin: unset;
|
|
158
|
+
padding: unset;
|
|
159
|
+
grid-template-columns: repeat(auto-fit, minmax(38ch, 1fr));
|
|
160
|
+
`, DocumentGridLayout = (props) => /* @__PURE__ */ jsx(DocumentGrid, { as: "ol", "data-ui": "DocumentGridLayout", children: props.children });
|
|
161
|
+
DocumentGridLayout.displayName = "DocumentGridLayout";
|
|
162
|
+
const DocumentListLayout = (props) => /* @__PURE__ */ jsx(Stack, { as: "ol", "data-ui": "DocumentListLayout", children: props.children });
|
|
163
|
+
DocumentListLayout.displayName = "DocumentListLayout";
|
|
164
|
+
const TempMedia = styled.div`
|
|
165
|
+
aspect-ratio: 1 / 1;
|
|
166
|
+
inline-size: 33px;
|
|
167
|
+
border: 1px solid #ccc;
|
|
168
|
+
`, Container = styled.div`
|
|
169
|
+
container-type: inline-size;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 0.75em;
|
|
173
|
+
`, StatusLabel = styled.span`
|
|
174
|
+
@container (width < 52ch) {
|
|
175
|
+
clip: rect(0 0 0 0);
|
|
176
|
+
clip-path: inset(50%);
|
|
177
|
+
height: 1px;
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
position: absolute;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
width: 1px;
|
|
182
|
+
}
|
|
183
|
+
`, DocumentPreviewLayout = ({
|
|
184
|
+
docType,
|
|
185
|
+
selected = !1,
|
|
186
|
+
status = "",
|
|
187
|
+
subtitle = "",
|
|
188
|
+
title,
|
|
189
|
+
url = ""
|
|
190
|
+
}) => title ? /* @__PURE__ */ jsx(
|
|
191
|
+
Button,
|
|
192
|
+
{
|
|
193
|
+
as: "a",
|
|
194
|
+
href: url,
|
|
195
|
+
mode: "bleed",
|
|
196
|
+
width: "fill",
|
|
197
|
+
padding: 3,
|
|
198
|
+
selected,
|
|
199
|
+
"data-ui": "DocumentPreviewLayout",
|
|
200
|
+
children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
201
|
+
/* @__PURE__ */ jsx(TempMedia, {}),
|
|
202
|
+
/* @__PURE__ */ jsxs(Stack, { flex: 1, space: 2, children: [
|
|
203
|
+
/* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", textOverflow: "ellipsis", children: title }),
|
|
204
|
+
subtitle && /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, textOverflow: "ellipsis", children: subtitle })
|
|
205
|
+
] }),
|
|
206
|
+
docType && /* @__PURE__ */ jsx(Badge, { padding: 2, fontSize: 0, children: docType }),
|
|
207
|
+
status === "published" && /* @__PURE__ */ jsxs(Badge, { padding: 2, fontSize: 0, tone: "positive", children: [
|
|
208
|
+
"\u2714\uFE0E ",
|
|
209
|
+
/* @__PURE__ */ jsx(StatusLabel, { children: "published" })
|
|
210
|
+
] }),
|
|
211
|
+
status === "draft" && /* @__PURE__ */ jsxs(Badge, { padding: 2, fontSize: 0, tone: "caution", children: [
|
|
212
|
+
"\u26D1\uFE0E ",
|
|
213
|
+
/* @__PURE__ */ jsx(StatusLabel, { children: "draft" })
|
|
214
|
+
] })
|
|
215
|
+
] })
|
|
216
|
+
}
|
|
217
|
+
) : /* @__PURE__ */ jsx(Fragment$1, {});
|
|
218
|
+
DocumentPreviewLayout.displayName = "DocumentPreviewLayout";
|
|
219
|
+
const LoginLinks = () => {
|
|
220
|
+
const loginUrls = useLoginUrls(), authState = useAuthState();
|
|
221
|
+
return useHandleCallback(), authState.type === "logging-in" ? /* @__PURE__ */ jsx("div", { children: "Logging in..." }) : authState.type === "logged-in" ? /* @__PURE__ */ jsx("div", { children: "You are logged in" }) : /* @__PURE__ */ jsx(Card, { height: "fill", overflow: "auto", paddingX: 4, children: /* @__PURE__ */ jsx(Flex, { height: "fill", direction: "column", align: "center", justify: "center", paddingTop: 4, children: /* @__PURE__ */ jsx(Container$2, { width: 0, children: /* @__PURE__ */ jsxs(Stack, { space: 4, children: [
|
|
222
|
+
/* @__PURE__ */ jsx(Heading, { align: "center", size: 1, children: "Choose login provider" }),
|
|
223
|
+
/* @__PURE__ */ jsx(Stack, { space: 2, children: loginUrls.map((provider, index) => /* @__PURE__ */ jsx(
|
|
224
|
+
Button,
|
|
225
|
+
{
|
|
226
|
+
as: "a",
|
|
227
|
+
href: provider.url,
|
|
228
|
+
mode: "ghost",
|
|
229
|
+
tone: "default",
|
|
230
|
+
space: 3,
|
|
231
|
+
padding: 3,
|
|
232
|
+
text: provider.title
|
|
233
|
+
},
|
|
234
|
+
`${provider.url}_${index}`
|
|
235
|
+
)) })
|
|
236
|
+
] }) }) }) });
|
|
237
|
+
};
|
|
238
|
+
export {
|
|
239
|
+
AuthBoundary,
|
|
240
|
+
DocumentGridLayout,
|
|
241
|
+
DocumentListLayout,
|
|
242
|
+
DocumentPreviewLayout,
|
|
243
|
+
Login,
|
|
244
|
+
LoginCallback,
|
|
245
|
+
LoginError,
|
|
246
|
+
LoginLayout,
|
|
247
|
+
LoginLinks,
|
|
248
|
+
SanityProvider
|
|
249
|
+
};
|
|
250
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/auth/AuthError.ts","../src/components/auth/LoginFooter.tsx","../src/components/auth/LoginLayout.tsx","../src/components/auth/Login.tsx","../src/components/auth/LoginCallback.tsx","../src/components/auth/LoginError.tsx","../src/components/auth/AuthBoundary.tsx","../src/components/DocumentGridLayout/DocumentGridLayout.tsx","../src/components/DocumentListLayout/DocumentListLayout.tsx","../src/components/DocumentPreviewLayout/DocumentPreviewLayout.tsx","../src/components/Login/LoginLinks.tsx"],"sourcesContent":["/**\n * Error class for authentication-related errors. Wraps errors thrown during the\n * authentication flow.\n *\n * @remarks\n * This class provides a consistent error type for authentication failures while\n * preserving the original error as the cause. If the original error has a\n * message property, it will be used as the error message.\n *\n * @alpha\n */\nexport class AuthError extends Error {\n constructor(error: unknown) {\n if (\n typeof error === 'object' &&\n !!error &&\n 'message' in error &&\n typeof error.message === 'string'\n ) {\n super(error.message)\n } else {\n super()\n }\n\n this.cause = error\n }\n}\n","import {SanityLogo} from '@sanity/logos'\nimport {Flex, Text} from '@sanity/ui'\nimport {Fragment} from 'react'\nimport styled from 'styled-components'\n\nconst LINKS = [\n {\n url: 'https://slack.sanity.io/',\n i18nKey: 'workspaces.community-title',\n title: 'Community',\n },\n {\n url: 'https://www.sanity.io/docs',\n i18nKey: 'workspaces.docs-title',\n title: 'Docs',\n },\n {\n url: 'https://www.sanity.io/legal/privacy',\n i18nKey: 'workspaces.privacy-title',\n title: 'Privacy',\n },\n {\n url: 'https://www.sanity.io',\n i18nKey: 'workspaces.sanity-io-title',\n title: 'sanity.io',\n },\n]\n\nconst StyledText = styled(Text)`\n a {\n color: inherit;\n }\n`\n\n/**\n * Default footer component for login screens showing Sanity branding and legal\n * links.\n *\n * @alpha\n */\nexport function LoginFooter(): React.ReactNode {\n return (\n <Flex direction=\"column\" gap={4} justify=\"center\" align=\"center\" paddingTop={2}>\n <Text size={3}>\n <SanityLogo />\n </Text>\n\n <Flex align=\"center\" gap={2}>\n {LINKS.map((link, index) => (\n <Fragment key={link.title}>\n <StyledText muted size={1}>\n <a href={link.url} target=\"_blank\" rel=\"noopener noreferrer\">\n {link.title}\n </a>\n </StyledText>\n\n {index < LINKS.length - 1 && (\n <Text size={1} muted>\n •\n </Text>\n )}\n </Fragment>\n ))}\n </Flex>\n </Flex>\n )\n}\n","import {Card, Flex} from '@sanity/ui'\nimport styled from 'styled-components'\n\nimport {LoginFooter} from './LoginFooter'\n\n/**\n * @alpha\n */\nexport interface LoginLayoutProps {\n /** Optional header content rendered at top of card */\n header?: React.ReactNode\n\n /** Optional footer content rendered below card. Defaults to an internal login footer */\n footer?: React.ReactNode\n\n /** Main content rendered in card body */\n children?: React.ReactNode\n}\n\nconst Root = styled.div`\n width: 100%;\n display: flex;\n`\n\nconst Container = styled(Flex)`\n width: 320px;\n margin: auto;\n display: flex;\n`\n\nconst StyledCard = styled(Card)``\n\nconst ChildrenFlex = styled(Flex)`\n min-height: 154px;\n`\n\n/**\n * Layout component for login-related screens providing consistent styling and structure.\n * Renders content in a centered card with optional header and footer sections.\n *\n * Can be used to build custom login screens for the AuthBoundary component, including:\n * - Login provider selection (LoginComponent)\n * - OAuth callback handling (CallbackComponent)\n * - Error states (LoginErrorComponent)\n *\n * @example\n * ```tsx\n * // Custom login screen using the layout\n * function CustomLogin({header, footer}: LoginLayoutProps) {\n * return (\n * <LoginLayout\n * header={header}\n * footer={footer}\n * >\n * <CustomLoginContent />\n * </LoginLayout>\n * )\n * }\n *\n * // Use with AuthBoundary\n * <AuthBoundary\n * LoginComponent={CustomLogin}\n * header={<Logo />}\n * >\n * <ProtectedContent />\n * </AuthBoundary>\n * ```\n *\n * @alpha\n */\nexport function LoginLayout({\n children,\n footer = <LoginFooter />,\n header,\n}: LoginLayoutProps): React.ReactNode {\n return (\n <Root>\n <Container direction=\"column\" gap={4}>\n <StyledCard border radius={2} paddingY={4}>\n <Flex direction=\"column\" gap={4}>\n {header && (\n <Card borderBottom paddingX={4} paddingBottom={3}>\n {header}\n </Card>\n )}\n\n {children && (\n <ChildrenFlex paddingX={4} direction=\"column\">\n {children}\n </ChildrenFlex>\n )}\n </Flex>\n </StyledCard>\n\n {footer}\n </Container>\n </Root>\n )\n}\n","import {Button, Flex, Heading, Spinner} from '@sanity/ui'\nimport {Suspense} from 'react'\nimport styled from 'styled-components'\n\nimport {useLoginUrls} from '../../hooks/auth/useLoginUrls'\nimport {LoginLayout, type LoginLayoutProps} from './LoginLayout'\n\n/**\n * @alpha\n */\nexport interface LoginProps {\n header?: React.ReactNode\n footer?: React.ReactNode\n}\n\nconst FallbackRoot = styled(Flex)`\n height: 123px;\n`\n\n/**\n * Login component that displays available authentication providers.\n * Renders a list of login options with a loading fallback while providers load.\n *\n * @alpha\n */\nexport function Login({header, footer}: LoginLayoutProps): JSX.Element {\n return (\n <LoginLayout header={header} footer={footer}>\n <Flex direction=\"column\" gap={4}>\n <Heading as=\"h1\" size={1} align=\"center\">\n Choose login provider\n </Heading>\n\n <Suspense\n fallback={\n <FallbackRoot align=\"center\" justify=\"center\">\n <Spinner />\n </FallbackRoot>\n }\n >\n <Providers />\n </Suspense>\n </Flex>\n </LoginLayout>\n )\n}\n\nfunction Providers() {\n const loginUrls = useLoginUrls()\n\n return (\n <Flex direction=\"column\" gap={3}>\n {loginUrls.map(({title, url}) => (\n <Button key={url} text={title} as=\"a\" href={url} mode=\"ghost\" />\n ))}\n </Flex>\n )\n}\n","import {Flex, Spinner, Text} from '@sanity/ui'\nimport {useEffect} from 'react'\nimport styled from 'styled-components'\n\nimport {useHandleCallback} from '../../hooks/auth/useHandleCallback'\nimport {LoginLayout, type LoginLayoutProps} from './LoginLayout'\n\nconst StyledFlex = styled(Flex)`\n margin: auto;\n`\n\n/**\n * Component shown during auth callback processing that handles login completion.\n * Automatically processes the auth callback when mounted and updates the URL\n * to remove callback parameters without triggering a page reload.\n *\n * @alpha\n */\nexport function LoginCallback({header, footer}: LoginLayoutProps): React.ReactNode {\n const handleCallback = useHandleCallback()\n\n useEffect(() => {\n const url = new URL(location.href)\n handleCallback(url.toString()).then((replacementLocation) => {\n if (replacementLocation) {\n // history API with `replaceState` is used to prevent a reload but still\n // remove the short-lived token from the URL\n history.replaceState(null, '', replacementLocation)\n }\n })\n }, [handleCallback])\n\n return (\n <LoginLayout header={header} footer={footer}>\n <StyledFlex direction=\"column\" justify=\"center\" align=\"center\" gap={4}>\n <Text size={1}>Logging you in…</Text>\n <Spinner size={4} />\n </StyledFlex>\n </LoginLayout>\n )\n}\n","import {Button, Flex, Text} from '@sanity/ui'\nimport {useCallback} from 'react'\nimport {type FallbackProps} from 'react-error-boundary'\nimport styled from 'styled-components'\n\nimport {useLogOut} from '../../hooks/auth/useLogOut'\nimport {AuthError} from './AuthError'\nimport {LoginLayout, type LoginLayoutProps} from './LoginLayout'\n\n/**\n * @alpha\n */\nexport type LoginErrorProps = FallbackProps & LoginLayoutProps\n\nconst StyledFlex = styled(Flex)`\n margin: auto;\n`\n\n/**\n * Displays authentication error details and provides retry functionality.\n * Only handles {@link AuthError} instances - rethrows other error types.\n *\n * @alpha\n */\nexport function LoginError({\n error,\n resetErrorBoundary,\n header,\n footer,\n}: LoginErrorProps): React.ReactNode {\n if (!(error instanceof AuthError)) throw error\n const logout = useLogOut()\n\n const handleRetry = useCallback(async () => {\n await logout()\n resetErrorBoundary()\n }, [logout, resetErrorBoundary])\n\n return (\n <LoginLayout header={header} footer={footer}>\n <StyledFlex direction=\"column\" gap={4}>\n <Flex direction=\"column\" gap={3}>\n <Text as=\"h2\" align=\"center\" weight=\"bold\" size={3}>\n Authentication Error\n </Text>\n <Text size={1} align=\"center\">\n Please try again or contact support if the problem persists.\n </Text>\n </Flex>\n <Button text=\"Retry\" tone=\"primary\" onClick={handleRetry} />\n </StyledFlex>\n </LoginLayout>\n )\n}\n","import {useMemo} from 'react'\nimport {ErrorBoundary, type FallbackProps} from 'react-error-boundary'\n\nimport {useAuthState} from '../../hooks/auth/useAuthState'\nimport {AuthError} from './AuthError'\nimport {Login} from './Login'\nimport {LoginCallback} from './LoginCallback'\nimport {LoginError, type LoginErrorProps} from './LoginError'\nimport type {LoginLayoutProps} from './LoginLayout'\n\n/**\n * @alpha\n */\nexport interface AuthBoundaryProps extends LoginLayoutProps {\n /**\n * Custom component to render the login screen.\n * Receives all login layout props. Defaults to {@link Login}.\n */\n LoginComponent?: React.ComponentType<LoginLayoutProps>\n\n /**\n * Custom component to render during OAuth callback processing.\n * Receives all login layout props. Defaults to {@link LoginCallback}.\n */\n CallbackComponent?: React.ComponentType<LoginLayoutProps>\n\n /**\n * Custom component to render when authentication errors occur.\n * Receives login layout props and error boundary props. Defaults to\n * {@link LoginError}\n */\n LoginErrorComponent?: React.ComponentType<LoginErrorProps>\n}\n\n/**\n * A component that handles authentication flow and error boundaries for a\n * protected section of the application.\n *\n * @remarks\n * This component manages different authentication states and renders the\n * appropriate components based on that state.\n *\n * @example\n * ```tsx\n * function App() {\n * return (\n * <AuthBoundary header={<MyLogo />}>\n * <ProtectedContent />\n * </AuthBoundary>\n * )\n * }\n * ```\n *\n * @alpha\n */\nexport function AuthBoundary({\n LoginErrorComponent = LoginError,\n ...props\n}: AuthBoundaryProps): React.ReactNode {\n const {header, footer} = props\n const FallbackComponent = useMemo(() => {\n return function LoginComponentWithLayoutProps(fallbackProps: FallbackProps) {\n return <LoginErrorComponent {...fallbackProps} header={header} footer={footer} />\n }\n }, [header, footer, LoginErrorComponent])\n\n return (\n <ErrorBoundary FallbackComponent={FallbackComponent}>\n <AuthSwitch {...props} />\n </ErrorBoundary>\n )\n}\n\ninterface AuthSwitchProps extends LoginLayoutProps {\n LoginComponent?: React.ComponentType<LoginLayoutProps>\n CallbackComponent?: React.ComponentType<LoginLayoutProps>\n}\n\nfunction AuthSwitch({\n LoginComponent = Login,\n CallbackComponent = LoginCallback,\n children,\n ...props\n}: AuthSwitchProps) {\n const authState = useAuthState()\n\n switch (authState.type) {\n case 'error': {\n throw new AuthError(authState.error)\n }\n case 'logging-in': {\n return <CallbackComponent {...props} />\n }\n case 'logged-in': {\n return children\n }\n default: {\n return <LoginComponent {...props} />\n }\n }\n}\n","import type {PropsWithChildren, ReactElement} from 'react'\nimport styled from 'styled-components'\n\nconst DocumentGrid = styled.div`\n display: grid;\n list-style: none;\n margin: unset;\n padding: unset;\n grid-template-columns: repeat(auto-fit, minmax(38ch, 1fr));\n`\n\n/**\n * @public\n */\nexport const DocumentGridLayout = (props: PropsWithChildren): ReactElement => {\n return (\n <DocumentGrid as=\"ol\" data-ui=\"DocumentGridLayout\">\n {props.children}\n </DocumentGrid>\n )\n}\n\nDocumentGridLayout.displayName = 'DocumentGridLayout'\n","import {Stack} from '@sanity/ui'\nimport type {PropsWithChildren, ReactElement} from 'react'\n\n/**\n * @public\n */\nexport const DocumentListLayout = (props: PropsWithChildren): ReactElement => {\n return (\n <Stack as=\"ol\" data-ui=\"DocumentListLayout\">\n {props.children}\n </Stack>\n )\n}\n\nDocumentListLayout.displayName = 'DocumentListLayout'\n","import {Badge, Button, Stack, Text} from '@sanity/ui'\nimport styled from 'styled-components'\n\n/**\n * @public\n */\nexport interface DocumentPreviewLayoutProps {\n docType?: string\n media?: React.ReactNode // Todo: determine how media data will be passed to this component; need to represent either an image or an icon\n selected?: boolean\n status?: string\n subtitle?: string\n title: string\n url?: string\n}\n\n// Todo: replace with actual media (either image or icon)\nconst TempMedia = styled.div`\n aspect-ratio: 1 / 1;\n inline-size: 33px;\n border: 1px solid #ccc;\n`\n\n// Set a containment context for the Preview\nconst Container = styled.div`\n container-type: inline-size;\n display: flex;\n align-items: center;\n gap: 0.75em;\n`\n\n// Status labels are visually hidden when a narrow document list is rendered;\n// text remains accessible to screen readers\nconst StatusLabel = styled.span`\n @container (width < 52ch) {\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n`\n\n/**\n * This is a component that renders a document preview.\n *\n * @public\n *\n * @param props - The props for the DocumentPreviewLayout component.\n * @returns - The DocumentPreviewLayout component.\n */\nexport const DocumentPreviewLayout = ({\n docType,\n selected = false,\n status = '',\n subtitle = '',\n title,\n url = '',\n}: DocumentPreviewLayoutProps): JSX.Element => {\n // Todo: empty state\n if (!title) {\n return <></>\n }\n\n return (\n <Button\n as=\"a\"\n href={url}\n mode=\"bleed\"\n width=\"fill\"\n padding={3}\n selected={selected}\n data-ui=\"DocumentPreviewLayout\"\n >\n <Container>\n <TempMedia />\n\n <Stack flex={1} space={2}>\n <Text size={1} weight=\"medium\" textOverflow=\"ellipsis\">\n {title}\n </Text>\n {subtitle && (\n <Text muted size={1} textOverflow=\"ellipsis\">\n {subtitle}\n </Text>\n )}\n </Stack>\n\n {docType && (\n <Badge padding={2} fontSize={0}>\n {docType}\n </Badge>\n )}\n\n {/* Todo: finalize UI for this */}\n {status === 'published' && (\n <Badge padding={2} fontSize={0} tone=\"positive\">\n ✔︎ <StatusLabel>published</StatusLabel>\n </Badge>\n )}\n\n {/* Todo: finalize UI for this, determine if we need to show 'draft' or just 'published' */}\n {status === 'draft' && (\n <Badge padding={2} fontSize={0} tone=\"caution\">\n ⛑︎ <StatusLabel>draft</StatusLabel>\n </Badge>\n )}\n </Container>\n </Button>\n )\n}\n\nDocumentPreviewLayout.displayName = 'DocumentPreviewLayout'\n","import {Button, Card, Container, Flex, Heading, Stack} from '@sanity/ui'\nimport {type ReactElement} from 'react'\n\nimport {useAuthState} from '../../hooks/auth/useAuthState'\nimport {useHandleCallback} from '../../hooks/auth/useHandleCallback'\nimport {useLoginUrls} from '../../hooks/auth/useLoginUrls'\n\n/**\n * Component that handles Sanity authentication flow and renders login provider options\n *\n * @public\n *\n * @returns Rendered component\n *\n * @remarks\n * The component handles three states:\n * 1. Loading state during token exchange\n * 2. Success state after successful authentication\n * 3. Provider selection UI when not authenticated\n *\n * @example\n * ```tsx\n * const config = { projectId: 'your-project-id', dataset: 'production' }\n * return <LoginLinks sanityInstance={config} />\n * ```\n */\nexport const LoginLinks = (): ReactElement => {\n const loginUrls = useLoginUrls()\n const authState = useAuthState()\n useHandleCallback()\n\n if (authState.type === 'logging-in') {\n return <div>Logging in...</div>\n }\n\n // Show success state after authentication\n if (authState.type === 'logged-in') {\n return <div>You are logged in</div>\n }\n\n /**\n * Render provider selection UI\n * Uses Sanity UI components for consistent styling\n */\n return (\n <Card height=\"fill\" overflow=\"auto\" paddingX={4}>\n <Flex height=\"fill\" direction=\"column\" align=\"center\" justify=\"center\" paddingTop={4}>\n <Container width={0}>\n <Stack space={4}>\n <Heading align=\"center\" size={1}>\n Choose login provider\n </Heading>\n\n <Stack space={2}>\n {loginUrls.map((provider, index) => (\n <Button\n key={`${provider.url}_${index}`}\n as=\"a\"\n href={provider.url}\n mode=\"ghost\"\n tone=\"default\"\n space={3}\n padding={3}\n text={provider.title}\n />\n ))}\n </Stack>\n </Stack>\n </Container>\n </Flex>\n </Card>\n )\n}\n"],"names":["Container","StyledFlex","Fragment"],"mappings":";;;;;;;;AAWO,MAAM,kBAAkB,MAAM;AAAA,EACnC,YAAY,OAAgB;AAExB,WAAO,SAAU,YACf,SACF,aAAa,SACb,OAAO,MAAM,WAAY,WAEzB,MAAM,MAAM,OAAO,IAEnB,MAAM,GAGR,KAAK,QAAQ;AAAA,EAAA;AAEjB;ACrBA,MAAM,QAAQ;AAAA,EACZ;AAAA,IACE,KAAK;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAA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