@clerk/react-router 3.4.1 → 3.4.2-canary.v20260610190754
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/ReactRouterClerkProvider-trOD2EJy.d.ts +17 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +3 -3
- package/dist/client/ReactRouterClerkProvider.d.ts +2 -13
- package/dist/client/ReactRouterClerkProvider.js +75 -121
- package/dist/client/ReactRouterClerkProvider.js.map +1 -1
- package/dist/client/ReactRouterOptionsContext.d.ts +6 -7
- package/dist/client/ReactRouterOptionsContext.js +11 -12
- package/dist/client/ReactRouterOptionsContext.js.map +1 -1
- package/dist/client/index.d.ts +4 -9
- package/dist/client/index.js +4 -12
- package/dist/client/types.d.ts +2 -56
- package/dist/client/types.js +1 -1
- package/dist/client/uiComponents.d.ts +2 -10
- package/dist/client/uiComponents.js +21 -34
- package/dist/client/uiComponents.js.map +1 -1
- package/dist/client/useAwaitableNavigate.d.ts +4 -2
- package/dist/client/useAwaitableNavigate.js +22 -21
- package/dist/client/useAwaitableNavigate.js.map +1 -1
- package/dist/client/usePathnameWithoutSplatRouteParams.d.ts +3 -1
- package/dist/client/usePathnameWithoutSplatRouteParams.js +10 -12
- package/dist/client/usePathnameWithoutSplatRouteParams.js.map +1 -1
- package/dist/errorThrower.d.ts +4 -4
- package/dist/errorThrower.js +6 -5
- package/dist/errorThrower.js.map +1 -1
- package/dist/errors.d.ts +2 -4
- package/dist/errors.js +3 -28
- package/dist/global.d.ts +1 -0
- package/dist/index.d.ts +6 -9
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/legacy.js +2 -6
- package/dist/loadOptions-DNSRkrk0.d.ts +63 -0
- package/dist/server/clerkClient.d.ts +6 -8
- package/dist/server/clerkClient.js +19 -19
- package/dist/server/clerkClient.js.map +1 -1
- package/dist/server/clerkMiddleware.d.ts +12 -11
- package/dist/server/clerkMiddleware.js +83 -90
- package/dist/server/clerkMiddleware.js.map +1 -1
- package/dist/server/getAuth.d.ts +5 -3
- package/dist/server/getAuth.js +16 -23
- package/dist/server/getAuth.js.map +1 -1
- package/dist/server/index.d.ts +6 -10
- package/dist/server/index.js +5 -10
- package/dist/server/keyless/fileStorage.d.ts +6 -5
- package/dist/server/keyless/fileStorage.js +12 -11
- package/dist/server/keyless/fileStorage.js.map +1 -1
- package/dist/server/keyless/index.d.ts +6 -9
- package/dist/server/keyless/index.js +34 -40
- package/dist/server/keyless/index.js.map +1 -1
- package/dist/server/keyless/utils.d.ts +8 -11
- package/dist/server/keyless/utils.js +10 -12
- package/dist/server/keyless/utils.js.map +1 -1
- package/dist/server/loadOptions.d.ts +2 -64
- package/dist/server/loadOptions.js +50 -63
- package/dist/server/loadOptions.js.map +1 -1
- package/dist/server/rootAuthLoader.d.ts +17 -16
- package/dist/server/rootAuthLoader.js +45 -71
- package/dist/server/rootAuthLoader.js.map +1 -1
- package/dist/server/types.d.ts +2 -84
- package/dist/server/types.js +1 -1
- package/dist/server/utils.d.ts +13 -13
- package/dist/server/utils.js +93 -83
- package/dist/server/utils.js.map +1 -1
- package/dist/ssr/index.d.ts +4 -7
- package/dist/ssr/index.js +5 -5
- package/dist/ssr/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -9
- package/dist/types/index.js +1 -1
- package/dist/types-C3uAu7q3.d.ts +58 -0
- package/dist/types-CkBFvMvW.d.ts +86 -0
- package/dist/uiComponents-CuYpqdGX.d.ts +12 -0
- package/dist/utils/assert.d.ts +4 -6
- package/dist/utils/assert.js +20 -29
- package/dist/utils/assert.js.map +1 -1
- package/dist/utils/env.d.ts +25 -23
- package/dist/utils/env.js +32 -33
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/errors.d.ts +3 -1
- package/dist/utils/errors.js +15 -24
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/feature-flags.d.ts +3 -1
- package/dist/utils/feature-flags.js +7 -6
- package/dist/utils/feature-flags.js.map +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.js +3 -3
- package/package.json +6 -6
- package/dist/api/index.js.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/types.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/global.d.d.ts +0 -2
- package/dist/global.d.js +0 -1
- package/dist/global.d.js.map +0 -1
- package/dist/legacy.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/types.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/webhooks.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as ReactRouterClerkProviderProps } from "./types-C3uAu7q3.js";
|
|
2
|
+
import { Ui } from "@clerk/react/internal";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/client/ReactRouterClerkProvider.d.ts
|
|
6
|
+
type ClerkReactRouterOptions<TUi extends Ui = Ui> = Partial<Omit<ReactRouterClerkProviderProps<TUi>, 'routerPush' | 'routerReplace' | 'clerkState'>>;
|
|
7
|
+
type ClerkProviderProps<TUi extends Ui = Ui> = ClerkReactRouterOptions<TUi> & {
|
|
8
|
+
loaderData?: any;
|
|
9
|
+
};
|
|
10
|
+
declare const ClerkProvider: <TUi extends Ui = Ui>({
|
|
11
|
+
children,
|
|
12
|
+
loaderData,
|
|
13
|
+
...opts
|
|
14
|
+
}: ClerkProviderProps<TUi>) => React.JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ClerkProvider as t };
|
|
17
|
+
//# sourceMappingURL=ReactRouterClerkProvider-trOD2EJy.d.ts.map
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@clerk/backend";
|
package/dist/api/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export * from "@clerk/backend"
|
|
2
|
+
|
|
3
|
+
export { };
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ReactRouterClerkProviderProps } from './types.js';
|
|
4
|
-
export * from '@clerk/react';
|
|
5
|
-
import '@clerk/shared/types';
|
|
6
|
-
|
|
7
|
-
type ClerkReactRouterOptions<TUi extends Ui = Ui> = Partial<Omit<ReactRouterClerkProviderProps<TUi>, 'routerPush' | 'routerReplace' | 'clerkState'>>;
|
|
8
|
-
type ClerkProviderProps<TUi extends Ui = Ui> = ClerkReactRouterOptions<TUi> & {
|
|
9
|
-
loaderData?: any;
|
|
10
|
-
};
|
|
11
|
-
declare const ClerkProvider: <TUi extends Ui = Ui>({ children, loaderData, ...opts }: ClerkProviderProps<TUi>) => React.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { ClerkProvider };
|
|
1
|
+
import { t as ClerkProvider } from "../ReactRouterClerkProvider-trOD2EJy.js";
|
|
2
|
+
export { ClerkProvider };
|
|
@@ -1,129 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
import { InternalClerkProvider as ReactClerkProvider } from "@clerk/react/internal";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import {
|
|
5
|
-
assertPublishableKeyInSpaMode,
|
|
6
|
-
assertValidClerkState,
|
|
7
|
-
isSpaMode as _isSpaMode,
|
|
8
|
-
warnForSsr
|
|
9
|
-
} from "../utils/assert.js";
|
|
1
|
+
import { assertPublishableKeyInSpaMode, assertValidClerkState, isSpaMode, warnForSsr } from "../utils/assert.js";
|
|
10
2
|
import { getPublicEnvVariables } from "../utils/env.js";
|
|
11
3
|
import { ClerkReactRouterOptionsProvider } from "./ReactRouterOptionsContext.js";
|
|
12
4
|
import { useAwaitableNavigate } from "./useAwaitableNavigate.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
import { InternalClerkProvider } from "@clerk/react/internal";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
//#region src/client/ReactRouterClerkProvider.tsx
|
|
9
|
+
const SDK_METADATA = {
|
|
10
|
+
name: "@clerk/react-router",
|
|
11
|
+
version: "3.4.2-canary.v20260610190754"
|
|
17
12
|
};
|
|
18
|
-
|
|
13
|
+
/**
|
|
14
|
+
* React Router hydration errors should not stop Clerk navigation from working, as the components mount only after
|
|
15
|
+
* hydration is done (in the case of a hydration error, the components will simply mount after client-side hydration).
|
|
16
|
+
*/
|
|
17
|
+
const awaitableNavigateRef = { current: void 0 };
|
|
19
18
|
function ClerkProviderBase({ children, ...rest }) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
signUpForceRedirectUrl: __signUpForceRedirectUrl,
|
|
71
|
-
signInFallbackRedirectUrl: __signInFallbackRedirectUrl,
|
|
72
|
-
signUpFallbackRedirectUrl: __signUpFallbackRedirectUrl,
|
|
73
|
-
__internal_clerkJSUrl: __clerkJSUrl,
|
|
74
|
-
__internal_clerkJSVersion: __clerkJSVersion,
|
|
75
|
-
__internal_clerkUIUrl: __clerkUIUrl,
|
|
76
|
-
__internal_clerkUIVersion: __clerkUIVersion,
|
|
77
|
-
prefetchUI: __prefetchUI,
|
|
78
|
-
telemetry: {
|
|
79
|
-
disabled: __telemetryDisabled,
|
|
80
|
-
debug: __telemetryDebug
|
|
81
|
-
},
|
|
82
|
-
unsafe_disableDevelopmentModeConsoleWarning: __unsafeDisableDevelopmentModeConsoleWarning != null ? __unsafeDisableDevelopmentModeConsoleWarning : getPublicEnvVariables(void 0).unsafeDisableDevelopmentModeConsoleWarning
|
|
83
|
-
};
|
|
84
|
-
const keylessProps = __keylessClaimUrl ? {
|
|
85
|
-
__internal_keyless_claimKeylessApplicationUrl: __keylessClaimUrl,
|
|
86
|
-
__internal_keyless_copyInstanceKeysUrl: __keylessApiKeysUrl
|
|
87
|
-
} : {};
|
|
88
|
-
return /* @__PURE__ */ React.createElement(ClerkReactRouterOptionsProvider, { options: mergedProps }, /* @__PURE__ */ React.createElement(
|
|
89
|
-
ReactClerkProvider,
|
|
90
|
-
{
|
|
91
|
-
routerPush: (to) => {
|
|
92
|
-
var _a;
|
|
93
|
-
return (_a = awaitableNavigateRef.current) == null ? void 0 : _a.call(awaitableNavigateRef, to);
|
|
94
|
-
},
|
|
95
|
-
routerReplace: (to) => {
|
|
96
|
-
var _a;
|
|
97
|
-
return (_a = awaitableNavigateRef.current) == null ? void 0 : _a.call(awaitableNavigateRef, to, { replace: true });
|
|
98
|
-
},
|
|
99
|
-
initialState: __clerk_ssr_state,
|
|
100
|
-
sdkMetadata: SDK_METADATA,
|
|
101
|
-
...mergedProps,
|
|
102
|
-
...keylessProps,
|
|
103
|
-
...restProps
|
|
104
|
-
},
|
|
105
|
-
children
|
|
106
|
-
));
|
|
19
|
+
const awaitableNavigate = useAwaitableNavigate();
|
|
20
|
+
const isSpaMode$1 = isSpaMode();
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
awaitableNavigateRef.current = awaitableNavigate;
|
|
23
|
+
}, [awaitableNavigate]);
|
|
24
|
+
const { clerkState, ...restProps } = rest;
|
|
25
|
+
InternalClerkProvider.displayName = "ReactClerkProvider";
|
|
26
|
+
if (typeof isSpaMode$1 !== "undefined" && !isSpaMode$1) assertValidClerkState(clerkState);
|
|
27
|
+
const { __clerk_ssr_state, __publishableKey, __proxyUrl, __domain, __isSatellite, __clerk_debug, __signInUrl, __signUpUrl, __signInForceRedirectUrl, __signUpForceRedirectUrl, __signInFallbackRedirectUrl, __signUpFallbackRedirectUrl, __clerkJSUrl, __clerkJSVersion, __clerkUIUrl, __clerkUIVersion, __prefetchUI, __telemetryDisabled, __telemetryDebug, __unsafeDisableDevelopmentModeConsoleWarning, __keylessClaimUrl, __keylessApiKeysUrl } = clerkState?.__internal_clerk_state || {};
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (typeof isSpaMode$1 !== "undefined" && !isSpaMode$1) warnForSsr(clerkState);
|
|
30
|
+
}, []);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
window.__clerk_debug = __clerk_debug;
|
|
33
|
+
}, []);
|
|
34
|
+
const mergedProps = {
|
|
35
|
+
publishableKey: __publishableKey,
|
|
36
|
+
proxyUrl: __proxyUrl,
|
|
37
|
+
domain: __domain,
|
|
38
|
+
isSatellite: __isSatellite,
|
|
39
|
+
signInUrl: __signInUrl,
|
|
40
|
+
signUpUrl: __signUpUrl,
|
|
41
|
+
signInForceRedirectUrl: __signInForceRedirectUrl,
|
|
42
|
+
signUpForceRedirectUrl: __signUpForceRedirectUrl,
|
|
43
|
+
signInFallbackRedirectUrl: __signInFallbackRedirectUrl,
|
|
44
|
+
signUpFallbackRedirectUrl: __signUpFallbackRedirectUrl,
|
|
45
|
+
__internal_clerkJSUrl: __clerkJSUrl,
|
|
46
|
+
__internal_clerkJSVersion: __clerkJSVersion,
|
|
47
|
+
__internal_clerkUIUrl: __clerkUIUrl,
|
|
48
|
+
__internal_clerkUIVersion: __clerkUIVersion,
|
|
49
|
+
prefetchUI: __prefetchUI,
|
|
50
|
+
telemetry: {
|
|
51
|
+
disabled: __telemetryDisabled,
|
|
52
|
+
debug: __telemetryDebug
|
|
53
|
+
},
|
|
54
|
+
unsafe_disableDevelopmentModeConsoleWarning: __unsafeDisableDevelopmentModeConsoleWarning ?? getPublicEnvVariables(void 0).unsafeDisableDevelopmentModeConsoleWarning
|
|
55
|
+
};
|
|
56
|
+
const keylessProps = __keylessClaimUrl ? {
|
|
57
|
+
__internal_keyless_claimKeylessApplicationUrl: __keylessClaimUrl,
|
|
58
|
+
__internal_keyless_copyInstanceKeysUrl: __keylessApiKeysUrl
|
|
59
|
+
} : {};
|
|
60
|
+
return /* @__PURE__ */ React.createElement(ClerkReactRouterOptionsProvider, { options: mergedProps }, /* @__PURE__ */ React.createElement(InternalClerkProvider, {
|
|
61
|
+
routerPush: (to) => awaitableNavigateRef.current?.(to),
|
|
62
|
+
routerReplace: (to) => awaitableNavigateRef.current?.(to, { replace: true }),
|
|
63
|
+
initialState: __clerk_ssr_state,
|
|
64
|
+
sdkMetadata: SDK_METADATA,
|
|
65
|
+
...mergedProps,
|
|
66
|
+
...keylessProps,
|
|
67
|
+
...restProps
|
|
68
|
+
}, children));
|
|
107
69
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return /* @__PURE__ */ React.createElement(
|
|
118
|
-
ClerkProviderBase,
|
|
119
|
-
{
|
|
120
|
-
...opts,
|
|
121
|
-
clerkState
|
|
122
|
-
},
|
|
123
|
-
children
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
ClerkProvider
|
|
70
|
+
const ClerkProvider = ({ children, loaderData, ...opts }) => {
|
|
71
|
+
let clerkState;
|
|
72
|
+
const isSpaMode$2 = isSpaMode();
|
|
73
|
+
if (!isSpaMode$2 && loaderData?.clerkState) clerkState = loaderData.clerkState;
|
|
74
|
+
if (typeof isSpaMode$2 !== "undefined" && isSpaMode$2) assertPublishableKeyInSpaMode(opts.publishableKey);
|
|
75
|
+
return /* @__PURE__ */ React.createElement(ClerkProviderBase, {
|
|
76
|
+
...opts,
|
|
77
|
+
clerkState
|
|
78
|
+
}, children);
|
|
128
79
|
};
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { ClerkProvider };
|
|
129
83
|
//# sourceMappingURL=ReactRouterClerkProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/ReactRouterClerkProvider.tsx"],"sourcesContent":["import { InternalClerkProvider as ReactClerkProvider, type Ui } from '@clerk/react/internal';\nimport React from 'react';\n\nimport {\n assertPublishableKeyInSpaMode,\n assertValidClerkState,\n isSpaMode as _isSpaMode,\n warnForSsr,\n} from '../utils/assert';\nimport { getPublicEnvVariables } from '../utils/env';\nimport { ClerkReactRouterOptionsProvider } from './ReactRouterOptionsContext';\nimport type { ClerkState, ReactRouterClerkProviderProps } from './types';\nimport { useAwaitableNavigate } from './useAwaitableNavigate';\n\
|
|
1
|
+
{"version":3,"file":"ReactRouterClerkProvider.js","names":["isSpaMode","_isSpaMode","ReactClerkProvider"],"sources":["../../src/client/ReactRouterClerkProvider.tsx"],"sourcesContent":["import { InternalClerkProvider as ReactClerkProvider, type Ui } from '@clerk/react/internal';\nimport React from 'react';\n\nimport {\n assertPublishableKeyInSpaMode,\n assertValidClerkState,\n isSpaMode as _isSpaMode,\n warnForSsr,\n} from '../utils/assert';\nimport { getPublicEnvVariables } from '../utils/env';\nimport { ClerkReactRouterOptionsProvider } from './ReactRouterOptionsContext';\nimport type { ClerkState, ReactRouterClerkProviderProps } from './types';\nimport { useAwaitableNavigate } from './useAwaitableNavigate';\n\nconst SDK_METADATA = {\n name: PACKAGE_NAME,\n version: PACKAGE_VERSION,\n};\n\n/**\n * React Router hydration errors should not stop Clerk navigation from working, as the components mount only after\n * hydration is done (in the case of a hydration error, the components will simply mount after client-side hydration).\n */\nconst awaitableNavigateRef: { current: ReturnType<typeof useAwaitableNavigate> | undefined } = { current: undefined };\n\n/**\n * Internal type that includes the initial state prop that is passed to the ClerkProvider during SSR.\n * This is a value that we pass automatically so it does not need to pollute the public API.\n */\ntype ClerkProviderPropsWithState<TUi extends Ui = Ui> = ReactRouterClerkProviderProps<TUi> & {\n clerkState?: ClerkState;\n};\n\nfunction ClerkProviderBase<TUi extends Ui = Ui>({ children, ...rest }: ClerkProviderPropsWithState<TUi>) {\n const awaitableNavigate = useAwaitableNavigate();\n const isSpaMode = _isSpaMode();\n\n React.useEffect(() => {\n awaitableNavigateRef.current = awaitableNavigate;\n }, [awaitableNavigate]);\n\n const { clerkState, ...restProps } = rest;\n ReactClerkProvider.displayName = 'ReactClerkProvider';\n\n if (typeof isSpaMode !== 'undefined' && !isSpaMode) {\n assertValidClerkState(clerkState);\n }\n\n const {\n __clerk_ssr_state,\n __publishableKey,\n __proxyUrl,\n __domain,\n __isSatellite,\n __clerk_debug,\n __signInUrl,\n __signUpUrl,\n __signInForceRedirectUrl,\n __signUpForceRedirectUrl,\n __signInFallbackRedirectUrl,\n __signUpFallbackRedirectUrl,\n __clerkJSUrl,\n __clerkJSVersion,\n __clerkUIUrl,\n __clerkUIVersion,\n __prefetchUI,\n __telemetryDisabled,\n __telemetryDebug,\n __unsafeDisableDevelopmentModeConsoleWarning,\n __keylessClaimUrl,\n __keylessApiKeysUrl,\n } = clerkState?.__internal_clerk_state || {};\n\n React.useEffect(() => {\n if (typeof isSpaMode !== 'undefined' && !isSpaMode) {\n warnForSsr(clerkState);\n }\n }, []);\n\n React.useEffect(() => {\n (window as any).__clerk_debug = __clerk_debug;\n }, []);\n\n const mergedProps = {\n publishableKey: __publishableKey as any,\n proxyUrl: __proxyUrl as any,\n domain: __domain as any,\n isSatellite: __isSatellite,\n signInUrl: __signInUrl,\n signUpUrl: __signUpUrl,\n signInForceRedirectUrl: __signInForceRedirectUrl,\n signUpForceRedirectUrl: __signUpForceRedirectUrl,\n signInFallbackRedirectUrl: __signInFallbackRedirectUrl,\n signUpFallbackRedirectUrl: __signUpFallbackRedirectUrl,\n __internal_clerkJSUrl: __clerkJSUrl,\n __internal_clerkJSVersion: __clerkJSVersion,\n __internal_clerkUIUrl: __clerkUIUrl,\n __internal_clerkUIVersion: __clerkUIVersion,\n prefetchUI: __prefetchUI,\n telemetry: {\n disabled: __telemetryDisabled,\n debug: __telemetryDebug,\n },\n unsafe_disableDevelopmentModeConsoleWarning:\n __unsafeDisableDevelopmentModeConsoleWarning ??\n getPublicEnvVariables(undefined).unsafeDisableDevelopmentModeConsoleWarning,\n };\n\n const keylessProps = __keylessClaimUrl\n ? {\n __internal_keyless_claimKeylessApplicationUrl: __keylessClaimUrl,\n __internal_keyless_copyInstanceKeysUrl: __keylessApiKeysUrl,\n }\n : {};\n\n return (\n <ClerkReactRouterOptionsProvider options={mergedProps}>\n <ReactClerkProvider\n routerPush={(to: string) => awaitableNavigateRef.current?.(to)}\n routerReplace={(to: string) => awaitableNavigateRef.current?.(to, { replace: true })}\n initialState={__clerk_ssr_state}\n sdkMetadata={SDK_METADATA}\n {...mergedProps}\n {...keylessProps}\n {...restProps}\n >\n {children}\n </ReactClerkProvider>\n </ClerkReactRouterOptionsProvider>\n );\n}\n\ntype ClerkReactRouterOptions<TUi extends Ui = Ui> = Partial<\n Omit<ReactRouterClerkProviderProps<TUi>, 'routerPush' | 'routerReplace' | 'clerkState'>\n>;\n\n// TODO: Remove \"any\" on loaderData type and use Route.ComponentProps from userland code\ntype ClerkProviderProps<TUi extends Ui = Ui> = ClerkReactRouterOptions<TUi> & {\n loaderData?: any;\n};\n\nexport const ClerkProvider = <TUi extends Ui = Ui>({ children, loaderData, ...opts }: ClerkProviderProps<TUi>) => {\n let clerkState;\n const isSpaMode = _isSpaMode();\n\n // Don't use `loaderData` to fetch the clerk state if we're in SPA mode or if React Router is used as a library\n if (!isSpaMode && loaderData?.clerkState) {\n clerkState = loaderData.clerkState;\n }\n\n // In SPA mode the publishable key is required on the ClerkProvider\n if (typeof isSpaMode !== 'undefined' && isSpaMode) {\n assertPublishableKeyInSpaMode(opts.publishableKey);\n }\n\n return (\n <ClerkProviderBase\n {...(opts as ReactRouterClerkProviderProps)}\n clerkState={clerkState}\n >\n {children}\n </ClerkProviderBase>\n );\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,eAAe;CACnB;CACA;AACF;;;;;AAMA,MAAM,uBAAyF,EAAE,SAAS,OAAU;AAUpH,SAAS,kBAAuC,EAAE,UAAU,GAAG,QAA0C;CACvG,MAAM,oBAAoB,qBAAqB;CAC/C,MAAMA,cAAYC,UAAW;CAE7B,MAAM,gBAAgB;EACpB,qBAAqB,UAAU;CACjC,GAAG,CAAC,iBAAiB,CAAC;CAEtB,MAAM,EAAE,YAAY,GAAG,cAAc;CACrC,sBAAmB,cAAc;CAEjC,IAAI,OAAOD,gBAAc,eAAe,CAACA,aACvC,sBAAsB,UAAU;CAGlC,MAAM,EACJ,mBACA,kBACA,YACA,UACA,eACA,eACA,aACA,aACA,0BACA,0BACA,6BACA,6BACA,cACA,kBACA,cACA,kBACA,cACA,qBACA,kBACA,8CACA,mBACA,wBACE,YAAY,0BAA0B,CAAC;CAE3C,MAAM,gBAAgB;EACpB,IAAI,OAAOA,gBAAc,eAAe,CAACA,aACvC,WAAW,UAAU;CAEzB,GAAG,CAAC,CAAC;CAEL,MAAM,gBAAgB;EACpB,AAAC,OAAe,gBAAgB;CAClC,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc;EAClB,gBAAgB;EAChB,UAAU;EACV,QAAQ;EACR,aAAa;EACb,WAAW;EACX,WAAW;EACX,wBAAwB;EACxB,wBAAwB;EACxB,2BAA2B;EAC3B,2BAA2B;EAC3B,uBAAuB;EACvB,2BAA2B;EAC3B,uBAAuB;EACvB,2BAA2B;EAC3B,YAAY;EACZ,WAAW;GACT,UAAU;GACV,OAAO;EACT;EACA,6CACE,gDACA,sBAAsB,MAAS,CAAC,CAAC;CACrC;CAEA,MAAM,eAAe,oBACjB;EACE,+CAA+C;EAC/C,wCAAwC;CAC1C,IACA,CAAC;CAEL,OACE,oCAAC,iCAAD,EAAiC,SAAS,YAYT,GAX/B,oCAACE,uBAAD;EACE,aAAa,OAAe,qBAAqB,UAAU,EAAE;EAC7D,gBAAgB,OAAe,qBAAqB,UAAU,IAAI,EAAE,SAAS,KAAK,CAAC;EACnF,cAAc;EACd,aAAa;EACb,GAAI;EACJ,GAAI;EACJ,GAAI;CAGc,GADjB,QACiB,CACW;AAErC;AAWA,MAAa,iBAAsC,EAAE,UAAU,YAAY,GAAG,WAAoC;CAChH,IAAI;CACJ,MAAMF,cAAYC,UAAW;CAG7B,IAAI,CAACD,eAAa,YAAY,YAC5B,aAAa,WAAW;CAI1B,IAAI,OAAOA,gBAAc,eAAeA,aACtC,8BAA8B,KAAK,cAAc;CAGnD,OACE,oCAAC,mBAAD;EACE,GAAK;EACO;CAGK,GADhB,QACgB;AAEvB"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '@clerk/react';
|
|
4
|
-
import '@clerk/react/internal';
|
|
5
|
-
import '@clerk/shared/types';
|
|
1
|
+
import { n as ReactRouterClerkProviderProps } from "../types-C3uAu7q3.js";
|
|
2
|
+
import React from "react";
|
|
6
3
|
|
|
4
|
+
//#region src/client/ReactRouterOptionsContext.d.ts
|
|
7
5
|
type ClerkReactRouterContextValue = Partial<Omit<ReactRouterClerkProviderProps, 'children'>>;
|
|
8
6
|
declare const useClerkReactRouterOptions: () => ClerkReactRouterContextValue;
|
|
9
7
|
declare const ClerkReactRouterOptionsProvider: (props: React.PropsWithChildren<{
|
|
10
|
-
|
|
8
|
+
options: ClerkReactRouterContextValue;
|
|
11
9
|
}>) => React.JSX.Element;
|
|
12
|
-
|
|
10
|
+
//#endregion
|
|
13
11
|
export { ClerkReactRouterOptionsProvider, useClerkReactRouterOptions };
|
|
12
|
+
//# sourceMappingURL=ReactRouterOptionsContext.d.ts.map
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
// src/client/ReactRouterOptionsContext.tsx
|
|
2
1
|
import React from "react";
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
//#region src/client/ReactRouterOptionsContext.tsx
|
|
4
|
+
const ClerkReactRouterOptionsCtx = React.createContext(void 0);
|
|
4
5
|
ClerkReactRouterOptionsCtx.displayName = "ClerkReactRouterOptionsCtx";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return ctx.value;
|
|
6
|
+
const useClerkReactRouterOptions = () => {
|
|
7
|
+
return React.useContext(ClerkReactRouterOptionsCtx).value;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
ClerkReactRouterOptionsProvider,
|
|
15
|
-
useClerkReactRouterOptions
|
|
9
|
+
const ClerkReactRouterOptionsProvider = (props) => {
|
|
10
|
+
const { children, options } = props;
|
|
11
|
+
return /* @__PURE__ */ React.createElement(ClerkReactRouterOptionsCtx.Provider, { value: { value: options } }, children);
|
|
16
12
|
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ClerkReactRouterOptionsProvider, useClerkReactRouterOptions };
|
|
17
16
|
//# sourceMappingURL=ReactRouterOptionsContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/ReactRouterOptionsContext.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { ReactRouterClerkProviderProps } from './types';\n\ntype ClerkReactRouterContextValue = Partial<Omit<ReactRouterClerkProviderProps, 'children'>>;\n\nconst ClerkReactRouterOptionsCtx = React.createContext<{ value: ClerkReactRouterContextValue } | undefined>(undefined);\nClerkReactRouterOptionsCtx.displayName = 'ClerkReactRouterOptionsCtx';\n\nconst useClerkReactRouterOptions = (): ClerkReactRouterContextValue => {\n const ctx = React.useContext(ClerkReactRouterOptionsCtx) as { value: ClerkReactRouterContextValue };\n return ctx.value;\n};\n\nconst ClerkReactRouterOptionsProvider = (props: React.PropsWithChildren<{ options: ClerkReactRouterContextValue }>) => {\n const { children, options } = props;\n return (\n <ClerkReactRouterOptionsCtx.Provider value={{ value: options }}>{children}</ClerkReactRouterOptionsCtx.Provider>\n );\n};\n\nexport { ClerkReactRouterOptionsProvider, useClerkReactRouterOptions };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReactRouterOptionsContext.js","names":[],"sources":["../../src/client/ReactRouterOptionsContext.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { ReactRouterClerkProviderProps } from './types';\n\ntype ClerkReactRouterContextValue = Partial<Omit<ReactRouterClerkProviderProps, 'children'>>;\n\nconst ClerkReactRouterOptionsCtx = React.createContext<{ value: ClerkReactRouterContextValue } | undefined>(undefined);\nClerkReactRouterOptionsCtx.displayName = 'ClerkReactRouterOptionsCtx';\n\nconst useClerkReactRouterOptions = (): ClerkReactRouterContextValue => {\n const ctx = React.useContext(ClerkReactRouterOptionsCtx) as { value: ClerkReactRouterContextValue };\n return ctx.value;\n};\n\nconst ClerkReactRouterOptionsProvider = (props: React.PropsWithChildren<{ options: ClerkReactRouterContextValue }>) => {\n const { children, options } = props;\n return (\n <ClerkReactRouterOptionsCtx.Provider value={{ value: options }}>{children}</ClerkReactRouterOptionsCtx.Provider>\n );\n};\n\nexport { ClerkReactRouterOptionsProvider, useClerkReactRouterOptions };\n"],"mappings":";;;AAMA,MAAM,6BAA6B,MAAM,cAAmE,MAAS;AACrH,2BAA2B,cAAc;AAEzC,MAAM,mCAAiE;CAErE,OADY,MAAM,WAAW,0BACpB,CAAC,CAAC;AACb;AAEA,MAAM,mCAAmC,UAA8E;CACrH,MAAM,EAAE,UAAU,YAAY;CAC9B,OACE,oCAAC,2BAA2B,UAA5B,EAAqC,OAAO,EAAE,OAAO,QAAQ,EAAkD,GAA9C,QAA8C;AAEnH"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export { UNSAFE_PortalProvider } from '@clerk/react';
|
|
6
|
-
import '@clerk/shared/getToken';
|
|
7
|
-
import '@clerk/react/internal';
|
|
8
|
-
import 'react';
|
|
9
|
-
import '@clerk/shared/types';
|
|
1
|
+
import { r as WithClerkState } from "../types-C3uAu7q3.js";
|
|
2
|
+
import { t as ClerkProvider } from "../ReactRouterClerkProvider-trOD2EJy.js";
|
|
3
|
+
import { i as UserProfile, n as SignIn, r as SignUp, t as OrganizationProfile } from "../uiComponents-CuYpqdGX.js";
|
|
4
|
+
export { ClerkProvider, OrganizationProfile, SignIn, SignUp, UserProfile, type WithClerkState };
|
package/dist/client/index.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
OrganizationProfile,
|
|
7
|
-
SignIn,
|
|
8
|
-
SignUp,
|
|
9
|
-
UNSAFE_PortalProvider,
|
|
10
|
-
UserProfile
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { ClerkProvider } from "./ReactRouterClerkProvider.js";
|
|
2
|
+
import { OrganizationProfile, SignIn, SignUp, UserProfile } from "./uiComponents.js";
|
|
3
|
+
|
|
4
|
+
export { ClerkProvider, OrganizationProfile, SignIn, SignUp, UserProfile };
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Without, InitialState } from '@clerk/shared/types';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
6
|
-
type ClerkState = {
|
|
7
|
-
__type: 'clerkState';
|
|
8
|
-
__internal_clerk_state: {
|
|
9
|
-
__clerk_ssr_state: InitialState;
|
|
10
|
-
__publishableKey: string | undefined;
|
|
11
|
-
__proxyUrl: string | undefined;
|
|
12
|
-
__domain: string | undefined;
|
|
13
|
-
__isSatellite: boolean;
|
|
14
|
-
__signInUrl: string | undefined;
|
|
15
|
-
__signUpUrl: string | undefined;
|
|
16
|
-
__signInForceRedirectUrl: string | undefined;
|
|
17
|
-
__signUpForceRedirectUrl: string | undefined;
|
|
18
|
-
__signInFallbackRedirectUrl: string | undefined;
|
|
19
|
-
__signUpFallbackRedirectUrl: string | undefined;
|
|
20
|
-
__clerk_debug: any;
|
|
21
|
-
__clerkJSUrl: string | undefined;
|
|
22
|
-
__clerkJSVersion: string | undefined;
|
|
23
|
-
__clerkUIUrl: string | undefined;
|
|
24
|
-
__clerkUIVersion: string | undefined;
|
|
25
|
-
__prefetchUI: boolean | undefined;
|
|
26
|
-
__telemetryDisabled: boolean | undefined;
|
|
27
|
-
__telemetryDebug: boolean | undefined;
|
|
28
|
-
__unsafeDisableDevelopmentModeConsoleWarning: boolean | undefined;
|
|
29
|
-
__keylessClaimUrl?: string;
|
|
30
|
-
__keylessApiKeysUrl?: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
type WithClerkState<U = any> = {
|
|
34
|
-
data: U;
|
|
35
|
-
clerkState: {
|
|
36
|
-
__type: 'clerkState';
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
type ReactRouterClerkProviderProps<TUi extends Ui = Ui> = Without<ClerkProviderProps<TUi>, 'publishableKey' | 'initialState'> & {
|
|
40
|
-
/**
|
|
41
|
-
* Used to override the default VITE_CLERK_PUBLISHABLE_KEY env variable if needed.
|
|
42
|
-
* This is optional for React Router (in SSR mode) as the ClerkProvider will automatically use the VITE_CLERK_PUBLISHABLE_KEY env variable if it exists.
|
|
43
|
-
* If you use React Router in SPA mode or as a library, you have to pass the publishableKey prop.
|
|
44
|
-
*/
|
|
45
|
-
publishableKey?: string;
|
|
46
|
-
children: React.ReactNode;
|
|
47
|
-
};
|
|
48
|
-
declare global {
|
|
49
|
-
interface Window {
|
|
50
|
-
__reactRouterContext: {
|
|
51
|
-
isSpaMode?: boolean;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type { ClerkState, ReactRouterClerkProviderProps, WithClerkState };
|
|
1
|
+
import { n as ReactRouterClerkProviderProps, r as WithClerkState, t as ClerkState } from "../types-C3uAu7q3.js";
|
|
2
|
+
export { ClerkState, ReactRouterClerkProviderProps, WithClerkState };
|
package/dist/client/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
declare const UserProfile: typeof UserProfile$1;
|
|
6
|
-
declare const OrganizationProfile: typeof OrganizationProfile$1;
|
|
7
|
-
declare const SignIn: (props: SignInProps) => React.JSX.Element;
|
|
8
|
-
declare const SignUp: (props: SignUpProps) => React.JSX.Element;
|
|
9
|
-
|
|
10
|
-
export { OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
1
|
+
import { i as UserProfile, n as SignIn, r as SignUp, t as OrganizationProfile } from "../uiComponents-CuYpqdGX.js";
|
|
2
|
+
export { OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
OrganizationProfile as BaseOrganizationProfile,
|
|
4
|
-
SignIn as BaseSignIn,
|
|
5
|
-
SignUp as BaseSignUp,
|
|
6
|
-
UserProfile as BaseUserProfile
|
|
7
|
-
} from "@clerk/react";
|
|
1
|
+
import { usePathnameWithoutSplatRouteParams } from "./usePathnameWithoutSplatRouteParams.js";
|
|
2
|
+
import { OrganizationProfile as OrganizationProfile$1, SignIn as SignIn$1, SignUp as SignUp$1, UserProfile as UserProfile$1 } from "@clerk/react";
|
|
8
3
|
import { useRoutingProps } from "@clerk/react/internal";
|
|
9
4
|
import React from "react";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{ ...BaseOrganizationProfile }
|
|
24
|
-
);
|
|
25
|
-
var SignIn = (props) => {
|
|
26
|
-
const path = usePathnameWithoutSplatRouteParams();
|
|
27
|
-
return /* @__PURE__ */ React.createElement(BaseSignIn, { ...useRoutingProps("SignIn", props, { path }) });
|
|
28
|
-
};
|
|
29
|
-
var SignUp = (props) => {
|
|
30
|
-
const path = usePathnameWithoutSplatRouteParams();
|
|
31
|
-
return /* @__PURE__ */ React.createElement(BaseSignUp, { ...useRoutingProps("SignUp", props, { path }) });
|
|
5
|
+
|
|
6
|
+
//#region src/client/uiComponents.tsx
|
|
7
|
+
const UserProfile = Object.assign((props) => {
|
|
8
|
+
const path = usePathnameWithoutSplatRouteParams();
|
|
9
|
+
return /* @__PURE__ */ React.createElement(UserProfile$1, useRoutingProps("UserProfile", props, { path }));
|
|
10
|
+
}, { ...UserProfile$1 });
|
|
11
|
+
const OrganizationProfile = Object.assign((props) => {
|
|
12
|
+
const path = usePathnameWithoutSplatRouteParams();
|
|
13
|
+
return /* @__PURE__ */ React.createElement(OrganizationProfile$1, useRoutingProps("OrganizationProfile", props, { path }));
|
|
14
|
+
}, { ...OrganizationProfile$1 });
|
|
15
|
+
const SignIn = (props) => {
|
|
16
|
+
const path = usePathnameWithoutSplatRouteParams();
|
|
17
|
+
return /* @__PURE__ */ React.createElement(SignIn$1, useRoutingProps("SignIn", props, { path }));
|
|
32
18
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
SignUp,
|
|
37
|
-
UserProfile
|
|
19
|
+
const SignUp = (props) => {
|
|
20
|
+
const path = usePathnameWithoutSplatRouteParams();
|
|
21
|
+
return /* @__PURE__ */ React.createElement(SignUp$1, useRoutingProps("SignUp", props, { path }));
|
|
38
22
|
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
39
26
|
//# sourceMappingURL=uiComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/uiComponents.tsx"],"sourcesContent":["import {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport { useRoutingProps } from '@clerk/react/internal';\nimport type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { usePathnameWithoutSplatRouteParams } from './usePathnameWithoutSplatRouteParams';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolved the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: UserProfileProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseUserProfile {...useRoutingProps('UserProfile', props, { path })} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: OrganizationProfileProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseOrganizationProfile {...useRoutingProps('OrganizationProfile', props, { path })} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: SignInProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseSignIn {...useRoutingProps('SignIn', props, { path })} />;\n};\n\nexport const SignUp = (props: SignUpProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseSignUp {...useRoutingProps('SignUp', props, { path })} />;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"uiComponents.js","names":["BaseUserProfile","BaseOrganizationProfile","BaseSignIn","BaseSignUp"],"sources":["../../src/client/uiComponents.tsx"],"sourcesContent":["import {\n OrganizationProfile as BaseOrganizationProfile,\n SignIn as BaseSignIn,\n SignUp as BaseSignUp,\n UserProfile as BaseUserProfile,\n} from '@clerk/react';\nimport { useRoutingProps } from '@clerk/react/internal';\nimport type { OrganizationProfileProps, SignInProps, SignUpProps, UserProfileProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { usePathnameWithoutSplatRouteParams } from './usePathnameWithoutSplatRouteParams';\n\n// The assignment of UserProfile with BaseUserProfile props is used\n// to support the CustomPage functionality (eg UserProfile.Page)\n// Also the `typeof BaseUserProfile` is used to resolved the following error:\n// \"The inferred type of 'UserProfile' cannot be named without a reference to ...\"\nexport const UserProfile: typeof BaseUserProfile = Object.assign(\n (props: UserProfileProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseUserProfile {...useRoutingProps('UserProfile', props, { path })} />;\n },\n { ...BaseUserProfile },\n);\n\n// The assignment of OrganizationProfile with BaseOrganizationProfile props is used\n// to support the CustomPage functionality (eg OrganizationProfile.Page)\n// Also the `typeof BaseOrganizationProfile` is used to resolved the following error:\n// \"The inferred type of 'OrganizationProfile' cannot be named without a reference to ...\"\nexport const OrganizationProfile: typeof BaseOrganizationProfile = Object.assign(\n (props: OrganizationProfileProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseOrganizationProfile {...useRoutingProps('OrganizationProfile', props, { path })} />;\n },\n { ...BaseOrganizationProfile },\n);\n\nexport const SignIn = (props: SignInProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseSignIn {...useRoutingProps('SignIn', props, { path })} />;\n};\n\nexport const SignUp = (props: SignUpProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseSignUp {...useRoutingProps('SignUp', props, { path })} />;\n};\n"],"mappings":";;;;;;AAgBA,MAAa,cAAsC,OAAO,QACvD,UAA4B;CAC3B,MAAM,OAAO,mCAAmC;CAChD,OAAO,oCAACA,eAAoB,gBAAgB,eAAe,OAAO,EAAE,KAAK,CAAC,CAAI;AAChF,GACA,EAAE,GAAGA,cAAgB,CACvB;AAMA,MAAa,sBAAsD,OAAO,QACvE,UAAoC;CACnC,MAAM,OAAO,mCAAmC;CAChD,OAAO,oCAACC,uBAA4B,gBAAgB,uBAAuB,OAAO,EAAE,KAAK,CAAC,CAAI;AAChG,GACA,EAAE,GAAGA,sBAAwB,CAC/B;AAEA,MAAa,UAAU,UAAuB;CAC5C,MAAM,OAAO,mCAAmC;CAChD,OAAO,oCAACC,UAAe,gBAAgB,UAAU,OAAO,EAAE,KAAK,CAAC,CAAI;AACtE;AAEA,MAAa,UAAU,UAAuB;CAC5C,MAAM,OAAO,mCAAmC;CAChD,OAAO,oCAACC,UAAe,gBAAgB,UAAU,OAAO,EAAE,KAAK,CAAC,CAAI;AACtE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { NavigateOptions } from
|
|
1
|
+
import { NavigateOptions } from "react-router";
|
|
2
2
|
|
|
3
|
+
//#region src/client/useAwaitableNavigate.d.ts
|
|
3
4
|
declare const useAwaitableNavigate: () => (to: string, opts?: NavigateOptions) => Promise<unknown>;
|
|
4
|
-
|
|
5
|
+
//#endregion
|
|
5
6
|
export { useAwaitableNavigate };
|
|
7
|
+
//# sourceMappingURL=useAwaitableNavigate.d.ts.map
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
// src/client/useAwaitableNavigate.tsx
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { useLocation, useNavigate } from "react-router";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
useAwaitableNavigate
|
|
3
|
+
|
|
4
|
+
//#region src/client/useAwaitableNavigate.tsx
|
|
5
|
+
const useAwaitableNavigate = () => {
|
|
6
|
+
const navigate = useNavigate();
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
const resolveFunctionsRef = React.useRef([]);
|
|
9
|
+
const resolveAll = () => {
|
|
10
|
+
resolveFunctionsRef.current.forEach((resolve) => resolve());
|
|
11
|
+
resolveFunctionsRef.current.splice(0, resolveFunctionsRef.current.length);
|
|
12
|
+
};
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
resolveAll();
|
|
15
|
+
}, [location]);
|
|
16
|
+
return (to, opts) => {
|
|
17
|
+
return new Promise((res) => {
|
|
18
|
+
resolveFunctionsRef.current.push(res);
|
|
19
|
+
navigate(to, opts);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
24
22
|
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useAwaitableNavigate };
|
|
25
26
|
//# sourceMappingURL=useAwaitableNavigate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/client/useAwaitableNavigate.tsx"],"sourcesContent":["import React from 'react';\nimport type { NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate } from 'react-router';\n\ntype Resolve = (value?: unknown) => void;\n\nexport const useAwaitableNavigate = () => {\n const navigate = useNavigate();\n const location = useLocation();\n\n const resolveFunctionsRef = React.useRef<Resolve[]>([]);\n const resolveAll = () => {\n resolveFunctionsRef.current.forEach(resolve => resolve());\n resolveFunctionsRef.current.splice(0, resolveFunctionsRef.current.length);\n };\n\n // location.key will change even when navigating to the same url,\n // so we will successfully resolve in that case as well\n React.useEffect(() => {\n resolveAll();\n }, [location]);\n\n return (to: string, opts?: NavigateOptions) => {\n return new Promise(res => {\n resolveFunctionsRef.current.push(res);\n void navigate(to, opts);\n });\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAwaitableNavigate.js","names":[],"sources":["../../src/client/useAwaitableNavigate.tsx"],"sourcesContent":["import React from 'react';\nimport type { NavigateOptions } from 'react-router';\nimport { useLocation, useNavigate } from 'react-router';\n\ntype Resolve = (value?: unknown) => void;\n\nexport const useAwaitableNavigate = () => {\n const navigate = useNavigate();\n const location = useLocation();\n\n const resolveFunctionsRef = React.useRef<Resolve[]>([]);\n const resolveAll = () => {\n resolveFunctionsRef.current.forEach(resolve => resolve());\n resolveFunctionsRef.current.splice(0, resolveFunctionsRef.current.length);\n };\n\n // location.key will change even when navigating to the same url,\n // so we will successfully resolve in that case as well\n React.useEffect(() => {\n resolveAll();\n }, [location]);\n\n return (to: string, opts?: NavigateOptions) => {\n return new Promise(res => {\n resolveFunctionsRef.current.push(res);\n void navigate(to, opts);\n });\n };\n};\n"],"mappings":";;;;AAMA,MAAa,6BAA6B;CACxC,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY;CAE7B,MAAM,sBAAsB,MAAM,OAAkB,CAAC,CAAC;CACtD,MAAM,mBAAmB;EACvB,oBAAoB,QAAQ,SAAQ,YAAW,QAAQ,CAAC;EACxD,oBAAoB,QAAQ,OAAO,GAAG,oBAAoB,QAAQ,MAAM;CAC1E;CAIA,MAAM,gBAAgB;EACpB,WAAW;CACb,GAAG,CAAC,QAAQ,CAAC;CAEb,QAAQ,IAAY,SAA2B;EAC7C,OAAO,IAAI,SAAQ,QAAO;GACxB,oBAAoB,QAAQ,KAAK,GAAG;GACpC,AAAK,SAAS,IAAI,IAAI;EACxB,CAAC;CACH;AACF"}
|