@clerk/tanstack-react-start 1.4.1 → 1.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/ClerkProvider-BgJPTole.d.ts +14 -0
- package/dist/client/ClerkProvider.d.ts +2 -12
- package/dist/client/ClerkProvider.js +58 -68
- package/dist/client/ClerkProvider.js.map +1 -1
- package/dist/client/OptionsContext.d.ts +7 -9
- package/dist/client/OptionsContext.js +13 -11
- package/dist/client/OptionsContext.js.map +1 -1
- package/dist/client/index.d.ts +3 -10
- package/dist/client/index.js +4 -5
- package/dist/client/types.d.ts +2 -34
- package/dist/client/types.js +1 -3
- package/dist/client/uiComponents.d.ts +2 -11
- package/dist/client/uiComponents.js +25 -44
- package/dist/client/uiComponents.js.map +1 -1
- package/dist/client/useAwaitableNavigate.d.ts +4 -2
- package/dist/client/useAwaitableNavigate.js +24 -24
- package/dist/client/useAwaitableNavigate.js.map +1 -1
- package/dist/client/utils.d.ts +12 -13
- package/dist/client/utils.js +59 -76
- package/dist/client/utils.js.map +1 -1
- package/dist/errors.d.ts +2 -4
- package/dist/errors.js +3 -3
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.js +3 -3
- package/dist/global.d.ts +1 -0
- package/dist/index.d.ts +5 -10
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/legacy.js +3 -3
- package/dist/server/auth.d.ts +5 -3
- package/dist/server/auth.js +13 -13
- package/dist/server/auth.js.map +1 -1
- package/dist/server/clerkClient.d.ts +4 -2
- package/dist/server/clerkClient.js +23 -23
- package/dist/server/clerkClient.js.map +1 -1
- package/dist/server/clerkMiddleware.d.ts +5 -6
- package/dist/server/clerkMiddleware.js +54 -68
- package/dist/server/clerkMiddleware.js.map +1 -1
- package/dist/server/constants.d.ts +27 -25
- package/dist/server/constants.js +33 -35
- package/dist/server/constants.js.map +1 -1
- package/dist/server/index.d.ts +6 -8
- package/dist/server/index.js +5 -5
- package/dist/server/keyless/fileStorage.d.ts +6 -5
- package/dist/server/keyless/fileStorage.js +10 -10
- package/dist/server/keyless/fileStorage.js.map +1 -1
- package/dist/server/keyless/index.d.ts +4 -4
- package/dist/server/keyless/index.js +33 -35
- package/dist/server/keyless/index.js.map +1 -1
- package/dist/server/keyless/utils.d.ts +6 -5
- package/dist/server/keyless/utils.js +13 -6
- package/dist/server/keyless/utils.js.map +1 -1
- package/dist/server/loadOptions.d.ts +59 -60
- package/dist/server/loadOptions.js +42 -52
- package/dist/server/loadOptions.js.map +1 -1
- package/dist/server/types.d.ts +29 -27
- package/dist/server/types.js +1 -3
- package/dist/server/utils/index.d.ts +7 -7
- package/dist/server/utils/index.js +62 -50
- package/dist/server/utils/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -8
- package/dist/types/index.js +1 -3
- package/dist/types-DePBcrHU.d.ts +36 -0
- package/dist/uiComponents-Cle0hs-_.d.ts +12 -0
- package/dist/utils/env.d.ts +20 -18
- package/dist/utils/env.js +27 -29
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/errors.d.ts +3 -1
- package/dist/utils/errors.js +6 -6
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/feature-flags.d.ts +3 -1
- package/dist/utils/feature-flags.js +16 -7
- package/dist/utils/feature-flags.js.map +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/index.js +6 -8
- package/dist/utils/index.js.map +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.js +3 -3
- package/package.json +6 -6
- 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/experimental.js.map +0 -1
- package/dist/global.d.d.ts +0 -2
- package/dist/global.d.js +0 -3
- 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,14 @@
|
|
|
1
|
+
import { n as TanstackStartClerkProviderProps } from "./types-DePBcrHU.js";
|
|
2
|
+
import { Ui } from "@clerk/react/internal";
|
|
3
|
+
|
|
4
|
+
//#region src/client/ClerkProvider.d.ts
|
|
5
|
+
declare function ClerkProvider<TUi extends Ui = Ui>({
|
|
6
|
+
children,
|
|
7
|
+
...providerProps
|
|
8
|
+
}: TanstackStartClerkProviderProps<TUi>): JSX.Element;
|
|
9
|
+
declare namespace ClerkProvider {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ClerkProvider as t };
|
|
14
|
+
//# sourceMappingURL=ClerkProvider-BgJPTole.d.ts.map
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export * from '@clerk/react';
|
|
4
|
-
import '@clerk/shared/types';
|
|
5
|
-
import 'react';
|
|
6
|
-
|
|
7
|
-
declare function ClerkProvider<TUi extends Ui = Ui>({ children, ...providerProps }: TanstackStartClerkProviderProps<TUi>): JSX.Element;
|
|
8
|
-
declare namespace ClerkProvider {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { ClerkProvider };
|
|
1
|
+
import { t as ClerkProvider } from "../ClerkProvider-BgJPTole.js";
|
|
2
|
+
export { ClerkProvider };
|
|
@@ -1,75 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { isClient } from "../utils/index.js";
|
|
2
|
+
import { ClerkOptionsProvider } from "./OptionsContext.js";
|
|
3
|
+
import { useAwaitableNavigate } from "./useAwaitableNavigate.js";
|
|
4
|
+
import { mergeWithPublicEnvs, parseUrlForNavigation, pickFromClerkInitState } from "./utils.js";
|
|
5
|
+
import { InternalClerkProvider } from "@clerk/react/internal";
|
|
6
|
+
import { ScriptOnce } from "@tanstack/react-router";
|
|
7
|
+
import { getGlobalStartContext } from "@tanstack/react-start";
|
|
8
|
+
import { useEffect } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
//#region src/client/ClerkProvider.tsx
|
|
12
|
+
const SDK_METADATA = {
|
|
13
|
+
name: "@clerk/tanstack-react-start",
|
|
14
|
+
version: "1.4.2-canary.v20260610190754"
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
function ClerkProvider({
|
|
19
|
-
|
|
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
|
-
replace: true
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
...mergedProps,
|
|
65
|
-
...keylessProps,
|
|
66
|
-
children
|
|
67
|
-
}
|
|
68
|
-
) })
|
|
69
|
-
] });
|
|
16
|
+
const awaitableNavigateRef = { current: void 0 };
|
|
17
|
+
function ClerkProvider({ children, ...providerProps }) {
|
|
18
|
+
const awaitableNavigate = useAwaitableNavigate();
|
|
19
|
+
const clerkInitialState = getGlobalStartContext()?.clerkInitialState ?? {};
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
awaitableNavigateRef.current = awaitableNavigate;
|
|
22
|
+
}, [awaitableNavigate]);
|
|
23
|
+
const { clerkSsrState, __keylessClaimUrl, __keylessApiKeysUrl, ...restInitState } = pickFromClerkInitState((isClient() ? window.__clerk_init_state : clerkInitialState)?.__internal_clerk_state);
|
|
24
|
+
const mergedProps = {
|
|
25
|
+
...mergeWithPublicEnvs(restInitState),
|
|
26
|
+
...providerProps
|
|
27
|
+
};
|
|
28
|
+
const keylessProps = __keylessClaimUrl ? {
|
|
29
|
+
__internal_keyless_claimKeylessApplicationUrl: __keylessClaimUrl,
|
|
30
|
+
__internal_keyless_copyInstanceKeysUrl: __keylessApiKeysUrl
|
|
31
|
+
} : {};
|
|
32
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScriptOnce, { children: `window.__clerk_init_state = ${JSON.stringify(clerkInitialState)};` }), /* @__PURE__ */ jsx(ClerkOptionsProvider, {
|
|
33
|
+
options: mergedProps,
|
|
34
|
+
children: /* @__PURE__ */ jsx(InternalClerkProvider, {
|
|
35
|
+
initialState: clerkSsrState,
|
|
36
|
+
sdkMetadata: SDK_METADATA,
|
|
37
|
+
routerPush: (to) => {
|
|
38
|
+
const { search, hash, ...rest } = parseUrlForNavigation(to, window.location.origin);
|
|
39
|
+
return awaitableNavigateRef.current?.({
|
|
40
|
+
...rest,
|
|
41
|
+
search,
|
|
42
|
+
hash,
|
|
43
|
+
replace: false
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
routerReplace: (to) => {
|
|
47
|
+
const { search, hash, ...rest } = parseUrlForNavigation(to, window.location.origin);
|
|
48
|
+
return awaitableNavigateRef.current?.({
|
|
49
|
+
...rest,
|
|
50
|
+
search,
|
|
51
|
+
hash,
|
|
52
|
+
replace: true
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
...mergedProps,
|
|
56
|
+
...keylessProps,
|
|
57
|
+
children
|
|
58
|
+
})
|
|
59
|
+
})] });
|
|
70
60
|
}
|
|
71
61
|
ClerkProvider.displayName = "ClerkProvider";
|
|
72
62
|
|
|
63
|
+
//#endregion
|
|
73
64
|
export { ClerkProvider };
|
|
74
|
-
//# sourceMappingURL=ClerkProvider.js.map
|
|
75
65
|
//# sourceMappingURL=ClerkProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"ClerkProvider.js","names":["ReactClerkProvider"],"sources":["../../src/client/ClerkProvider.tsx"],"sourcesContent":["import { InternalClerkProvider as ReactClerkProvider, type Ui } from '@clerk/react/internal';\nimport { ScriptOnce } from '@tanstack/react-router';\nimport { getGlobalStartContext } from '@tanstack/react-start';\nimport { useEffect } from 'react';\n\nimport { isClient } from '../utils';\nimport { ClerkOptionsProvider } from './OptionsContext';\nimport type { TanstackStartClerkProviderProps } from './types';\nimport { useAwaitableNavigate } from './useAwaitableNavigate';\nimport { mergeWithPublicEnvs, parseUrlForNavigation, pickFromClerkInitState } from './utils';\n\nconst SDK_METADATA = {\n name: PACKAGE_NAME,\n version: PACKAGE_VERSION,\n};\n\nconst awaitableNavigateRef: { current: ReturnType<typeof useAwaitableNavigate> | undefined } = { current: undefined };\n\nexport function ClerkProvider<TUi extends Ui = Ui>({\n children,\n ...providerProps\n}: TanstackStartClerkProviderProps<TUi>): JSX.Element {\n const awaitableNavigate = useAwaitableNavigate();\n // @ts-expect-error: Untyped internal Clerk initial state\n const clerkInitialState = getGlobalStartContext()?.clerkInitialState ?? {};\n\n useEffect(() => {\n awaitableNavigateRef.current = awaitableNavigate;\n }, [awaitableNavigate]);\n\n const clerkInitState = isClient() ? (window as any).__clerk_init_state : clerkInitialState;\n\n const { clerkSsrState, __keylessClaimUrl, __keylessApiKeysUrl, ...restInitState } = pickFromClerkInitState(\n clerkInitState?.__internal_clerk_state,\n );\n\n const mergedProps = {\n ...mergeWithPublicEnvs(restInitState),\n ...providerProps,\n };\n\n // Add keyless mode props if present\n const keylessProps = __keylessClaimUrl\n ? {\n __internal_keyless_claimKeylessApplicationUrl: __keylessClaimUrl,\n __internal_keyless_copyInstanceKeysUrl: __keylessApiKeysUrl,\n }\n : {};\n\n return (\n <>\n <ScriptOnce>{`window.__clerk_init_state = ${JSON.stringify(clerkInitialState)};`}</ScriptOnce>\n <ClerkOptionsProvider options={mergedProps}>\n <ReactClerkProvider\n initialState={clerkSsrState}\n sdkMetadata={SDK_METADATA}\n routerPush={(to: string) => {\n const { search, hash, ...rest } = parseUrlForNavigation(to, window.location.origin);\n return awaitableNavigateRef.current?.({\n ...rest,\n search: search as any,\n hash,\n replace: false,\n });\n }}\n routerReplace={(to: string) => {\n const { search, hash, ...rest } = parseUrlForNavigation(to, window.location.origin);\n return awaitableNavigateRef.current?.({\n ...rest,\n search: search as any,\n hash,\n replace: true,\n });\n }}\n {...mergedProps}\n {...keylessProps}\n >\n {children}\n </ReactClerkProvider>\n </ClerkOptionsProvider>\n </>\n );\n}\nClerkProvider.displayName = 'ClerkProvider';\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,eAAe;CACnB;CACA;AACF;AAEA,MAAM,uBAAyF,EAAE,SAAS,OAAU;AAEpH,SAAgB,cAAmC,EACjD,UACA,GAAG,iBACiD;CACpD,MAAM,oBAAoB,qBAAqB;CAE/C,MAAM,oBAAoB,sBAAsB,CAAC,EAAE,qBAAqB,CAAC;CAEzE,gBAAgB;EACd,qBAAqB,UAAU;CACjC,GAAG,CAAC,iBAAiB,CAAC;CAItB,MAAM,EAAE,eAAe,mBAAmB,qBAAqB,GAAG,kBAAkB,wBAF7D,SAAS,IAAK,OAAe,qBAAqB,kBAGzD,EAAE,sBAClB;CAEA,MAAM,cAAc;EAClB,GAAG,oBAAoB,aAAa;EACpC,GAAG;CACL;CAGA,MAAM,eAAe,oBACjB;EACE,+CAA+C;EAC/C,wCAAwC;CAC1C,IACA,CAAC;CAEL,OACE,4CACE,oBAAC,YAAD,YAAa,+BAA+B,KAAK,UAAU,iBAAiB,EAAE,GAAe,IAC7F,oBAAC,sBAAD;EAAsB,SAAS;YAC7B,oBAACA,uBAAD;GACE,cAAc;GACd,aAAa;GACb,aAAa,OAAe;IAC1B,MAAM,EAAE,QAAQ,MAAM,GAAG,SAAS,sBAAsB,IAAI,OAAO,SAAS,MAAM;IAClF,OAAO,qBAAqB,UAAU;KACpC,GAAG;KACK;KACR;KACA,SAAS;IACX,CAAC;GACH;GACA,gBAAgB,OAAe;IAC7B,MAAM,EAAE,QAAQ,MAAM,GAAG,SAAS,sBAAsB,IAAI,OAAO,SAAS,MAAM;IAClF,OAAO,qBAAqB,UAAU;KACpC,GAAG;KACK;KACR;KACA,SAAS;IACX,CAAC;GACH;GACA,GAAI;GACJ,GAAI;GAEH;EACiB;CACA,EACtB;AAEN;AACA,cAAc,cAAc"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from
|
|
3
|
-
import { TanstackStartClerkProviderProps } from './types.js';
|
|
4
|
-
import '@clerk/react';
|
|
5
|
-
import '@clerk/react/internal';
|
|
6
|
-
import '@clerk/shared/types';
|
|
1
|
+
import { n as TanstackStartClerkProviderProps } from "../types-DePBcrHU.js";
|
|
2
|
+
import React from "react";
|
|
7
3
|
|
|
4
|
+
//#region src/client/OptionsContext.d.ts
|
|
8
5
|
type ClerkContextValue = Partial<Omit<TanstackStartClerkProviderProps, 'children'>>;
|
|
9
6
|
declare const useClerkOptions: () => ClerkContextValue;
|
|
10
7
|
declare const ClerkOptionsProvider: (props: React.PropsWithChildren<{
|
|
11
|
-
|
|
12
|
-
}>) =>
|
|
13
|
-
|
|
8
|
+
options: ClerkContextValue;
|
|
9
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//#endregion
|
|
14
11
|
export { ClerkOptionsProvider, useClerkOptions };
|
|
12
|
+
//# sourceMappingURL=OptionsContext.d.ts.map
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { jsx } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
//#region src/client/OptionsContext.tsx
|
|
5
|
+
const ClerkOptionsCtx = React.createContext(void 0);
|
|
6
6
|
ClerkOptionsCtx.displayName = "ClerkOptionsCtx";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return ctx.value;
|
|
7
|
+
const useClerkOptions = () => {
|
|
8
|
+
return React.useContext(ClerkOptionsCtx).value;
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const ClerkOptionsProvider = (props) => {
|
|
11
|
+
const { children, options } = props;
|
|
12
|
+
return /* @__PURE__ */ jsx(ClerkOptionsCtx.Provider, {
|
|
13
|
+
value: { value: options },
|
|
14
|
+
children
|
|
15
|
+
});
|
|
14
16
|
};
|
|
15
17
|
|
|
18
|
+
//#endregion
|
|
16
19
|
export { ClerkOptionsProvider, useClerkOptions };
|
|
17
|
-
//# sourceMappingURL=OptionsContext.js.map
|
|
18
20
|
//# sourceMappingURL=OptionsContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"OptionsContext.js","names":[],"sources":["../../src/client/OptionsContext.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { TanstackStartClerkProviderProps as ClerkProviderProps } from './types';\n\ntype ClerkContextValue = Partial<Omit<ClerkProviderProps, 'children'>>;\n\nconst ClerkOptionsCtx = React.createContext<{ value: ClerkContextValue } | undefined>(undefined);\nClerkOptionsCtx.displayName = 'ClerkOptionsCtx';\n\nconst useClerkOptions = (): ClerkContextValue => {\n const ctx = React.useContext(ClerkOptionsCtx) as { value: ClerkContextValue };\n return ctx.value;\n};\n\nconst ClerkOptionsProvider = (props: React.PropsWithChildren<{ options: ClerkContextValue }>) => {\n const { children, options } = props;\n return <ClerkOptionsCtx.Provider value={{ value: options }}>{children}</ClerkOptionsCtx.Provider>;\n};\n\nexport { ClerkOptionsProvider, useClerkOptions };\n"],"mappings":";;;;AAMA,MAAM,kBAAkB,MAAM,cAAwD,MAAS;AAC/F,gBAAgB,cAAc;AAE9B,MAAM,wBAA2C;CAE/C,OADY,MAAM,WAAW,eACpB,CAAC,CAAC;AACb;AAEA,MAAM,wBAAwB,UAAmE;CAC/F,MAAM,EAAE,UAAU,YAAY;CAC9B,OAAO,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,OAAO,QAAQ;EAAI;CAAmC;AAClG"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export { UNSAFE_PortalProvider } from '@clerk/react';
|
|
5
|
-
import '@clerk/shared/getToken';
|
|
6
|
-
import '@clerk/react/internal';
|
|
7
|
-
import './types.js';
|
|
8
|
-
import '@clerk/shared/types';
|
|
9
|
-
import 'react';
|
|
10
|
-
import 'react/jsx-runtime';
|
|
1
|
+
import { t as ClerkProvider } from "../ClerkProvider-BgJPTole.js";
|
|
2
|
+
import { a as UserProfile, i as SignUp, n as OrganizationProfile, r as SignIn, t as OrganizationList } from "../uiComponents-Cle0hs-_.js";
|
|
3
|
+
export { ClerkProvider, OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile };
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { ClerkProvider } from "./ClerkProvider.js";
|
|
2
|
+
import { OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile } from "./uiComponents.js";
|
|
3
|
+
|
|
4
|
+
export { ClerkProvider, OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile };
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,34 +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
|
-
__afterSignInUrl: string | undefined;
|
|
17
|
-
__afterSignUpUrl: string | undefined;
|
|
18
|
-
__clerk_debug: any;
|
|
19
|
-
__clerkJSUrl: string | undefined;
|
|
20
|
-
__clerkJSVersion: string | undefined;
|
|
21
|
-
__clerkUIUrl: string | undefined;
|
|
22
|
-
__clerkUIVersion: string | undefined;
|
|
23
|
-
__prefetchUI: boolean | undefined;
|
|
24
|
-
__telemetryDisabled: boolean | undefined;
|
|
25
|
-
__telemetryDebug: boolean | undefined;
|
|
26
|
-
__unsafeDisableDevelopmentModeConsoleWarning: boolean | undefined;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type TanstackStartClerkProviderProps<TUi extends Ui = Ui> = Without<ClerkProviderProps<TUi>, 'publishableKey' | 'initialState'> & {
|
|
30
|
-
publishableKey?: string;
|
|
31
|
-
children: React.ReactNode;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type { ClerkState, TanstackStartClerkProviderProps };
|
|
1
|
+
import { n as TanstackStartClerkProviderProps, t as ClerkState } from "../types-DePBcrHU.js";
|
|
2
|
+
export { ClerkState, TanstackStartClerkProviderProps };
|
package/dist/client/types.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { SignInProps, SignUpProps } from '@clerk/shared/types';
|
|
4
|
-
|
|
5
|
-
declare const UserProfile: typeof UserProfile$1;
|
|
6
|
-
declare const OrganizationProfile: typeof OrganizationProfile$1;
|
|
7
|
-
declare const OrganizationList: typeof OrganizationList$1;
|
|
8
|
-
declare const SignIn: (props: SignInProps) => react_jsx_runtime.JSX.Element;
|
|
9
|
-
declare const SignUp: (props: SignUpProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
-
|
|
11
|
-
export { OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
1
|
+
import { a as UserProfile, i as SignUp, n as OrganizationProfile, r as SignIn, t as OrganizationList } from "../uiComponents-Cle0hs-_.js";
|
|
2
|
+
export { OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
@@ -1,51 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRoutingProps } from
|
|
3
|
-
import {
|
|
4
|
-
import { useRef } from
|
|
5
|
-
import { jsx } from
|
|
1
|
+
import { OrganizationList as OrganizationList$1, OrganizationProfile as OrganizationProfile$1, SignIn as SignIn$1, SignUp as SignUp$1, UserProfile as UserProfile$1 } from "@clerk/react";
|
|
2
|
+
import { useRoutingProps } from "@clerk/react/internal";
|
|
3
|
+
import { useLocation, useParams } from "@tanstack/react-router";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const splatRouteParam = _splat || "";
|
|
14
|
-
const path = pathname.replace(splatRouteParam, "").replace(/\/$/, "").replace(/^\//, "").trim();
|
|
15
|
-
const computedPath = `/${path}`;
|
|
16
|
-
const stablePath = useRef(computedPath);
|
|
17
|
-
return stablePath.current;
|
|
7
|
+
//#region src/client/uiComponents.tsx
|
|
8
|
+
const usePathnameWithoutSplatRouteParams = () => {
|
|
9
|
+
const { _splat } = useParams({ strict: false });
|
|
10
|
+
const { pathname } = useLocation();
|
|
11
|
+
const splatRouteParam = _splat || "";
|
|
12
|
+
return useRef(`/${pathname.replace(splatRouteParam, "").replace(/\/$/, "").replace(/^\//, "").trim()}`).current;
|
|
18
13
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
{ ...OrganizationProfile$1 }
|
|
32
|
-
);
|
|
33
|
-
var OrganizationList = Object.assign(
|
|
34
|
-
(props) => {
|
|
35
|
-
const path = usePathnameWithoutSplatRouteParams();
|
|
36
|
-
return /* @__PURE__ */ jsx(OrganizationList$1, { ...useRoutingProps("OrganizationList", props, { path }) });
|
|
37
|
-
},
|
|
38
|
-
{ ...OrganizationList$1 }
|
|
39
|
-
);
|
|
40
|
-
var SignIn = (props) => {
|
|
41
|
-
const path = usePathnameWithoutSplatRouteParams();
|
|
42
|
-
return /* @__PURE__ */ jsx(SignIn$1, { ...useRoutingProps("SignIn", props, { path }) });
|
|
14
|
+
const UserProfile = Object.assign((props) => {
|
|
15
|
+
return /* @__PURE__ */ jsx(UserProfile$1, { ...useRoutingProps("UserProfile", props, { path: usePathnameWithoutSplatRouteParams() }) });
|
|
16
|
+
}, { ...UserProfile$1 });
|
|
17
|
+
const OrganizationProfile = Object.assign((props) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(OrganizationProfile$1, { ...useRoutingProps("OrganizationProfile", props, { path: usePathnameWithoutSplatRouteParams() }) });
|
|
19
|
+
}, { ...OrganizationProfile$1 });
|
|
20
|
+
const OrganizationList = Object.assign((props) => {
|
|
21
|
+
return /* @__PURE__ */ jsx(OrganizationList$1, { ...useRoutingProps("OrganizationList", props, { path: usePathnameWithoutSplatRouteParams() }) });
|
|
22
|
+
}, { ...OrganizationList$1 });
|
|
23
|
+
const SignIn = (props) => {
|
|
24
|
+
return /* @__PURE__ */ jsx(SignIn$1, { ...useRoutingProps("SignIn", props, { path: usePathnameWithoutSplatRouteParams() }) });
|
|
43
25
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ jsx(SignUp$1, { ...useRoutingProps("SignUp", props, { path }) });
|
|
26
|
+
const SignUp = (props) => {
|
|
27
|
+
return /* @__PURE__ */ jsx(SignUp$1, { ...useRoutingProps("SignUp", props, { path: usePathnameWithoutSplatRouteParams() }) });
|
|
47
28
|
};
|
|
48
29
|
|
|
30
|
+
//#endregion
|
|
49
31
|
export { OrganizationList, OrganizationProfile, SignIn, SignUp, UserProfile };
|
|
50
|
-
//# sourceMappingURL=uiComponents.js.map
|
|
51
32
|
//# sourceMappingURL=uiComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"uiComponents.js","names":["BaseUserProfile","BaseOrganizationProfile","BaseOrganizationList","BaseSignIn","BaseSignUp"],"sources":["../../src/client/uiComponents.tsx"],"sourcesContent":["import {\n OrganizationList as BaseOrganizationList,\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 { useLocation, useParams } from '@tanstack/react-router';\nimport { useRef } from 'react';\n\nconst usePathnameWithoutSplatRouteParams = () => {\n const { _splat } = useParams({\n strict: false,\n });\n const { pathname } = useLocation();\n\n // Get the splat route params\n // TanStack Router uses _splat to represent the splat route params\n const splatRouteParam = _splat || '';\n\n // Remove the splat route param from the pathname\n // so we end up with the pathname where the components are mounted at\n // eg /user/123/profile/security will return /user/123/profile as the path\n const path = pathname.replace(splatRouteParam, '').replace(/\\/$/, '').replace(/^\\//, '').trim();\n\n const computedPath = `/${path}`;\n\n // Stabilize the base path to prevent race conditions during navigation away.\n // When TanStack Router navigates to a different route, useLocation() returns the\n // new pathname before this component unmounts. This causes the basePath to change,\n // which makes the SignIn/SignUp catch-all route fire RedirectToSignIn incorrectly.\n // Matches the pattern used in @clerk/nextjs usePathnameWithoutCatchAll.\n const stablePath = useRef(computedPath);\n return stablePath.current;\n};\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 OrganizationList: typeof BaseOrganizationList = Object.assign(\n (props: OrganizationProfileProps) => {\n const path = usePathnameWithoutSplatRouteParams();\n return <BaseOrganizationList {...useRoutingProps('OrganizationList', props, { path })} />;\n },\n { ...BaseOrganizationList },\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":";;;;;;;AAYA,MAAM,2CAA2C;CAC/C,MAAM,EAAE,WAAW,UAAU,EAC3B,QAAQ,MACV,CAAC;CACD,MAAM,EAAE,aAAa,YAAY;CAIjC,MAAM,kBAAkB,UAAU;CAelC,OADmB,OAAO,IATb,SAAS,QAAQ,iBAAiB,EAAE,CAAC,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAC,KAE7D,GAQZ,CAAC,CAAC;AACpB;AAMA,MAAa,cAAsC,OAAO,QACvD,UAA4B;CAE3B,OAAO,oBAACA,eAAD,EAAiB,GAAI,gBAAgB,eAAe,OAAO,EAAE,MADvD,mCAC0D,EAAE,CAAC,EAAI;AAChF,GACA,EAAE,GAAGA,cAAgB,CACvB;AAMA,MAAa,sBAAsD,OAAO,QACvE,UAAoC;CAEnC,OAAO,oBAACC,uBAAD,EAAyB,GAAI,gBAAgB,uBAAuB,OAAO,EAAE,MADvE,mCAC0E,EAAE,CAAC,EAAI;AAChG,GACA,EAAE,GAAGA,sBAAwB,CAC/B;AAEA,MAAa,mBAAgD,OAAO,QACjE,UAAoC;CAEnC,OAAO,oBAACC,oBAAD,EAAsB,GAAI,gBAAgB,oBAAoB,OAAO,EAAE,MADjE,mCACoE,EAAE,CAAC,EAAI;AAC1F,GACA,EAAE,GAAGA,mBAAqB,CAC5B;AAEA,MAAa,UAAU,UAAuB;CAE5C,OAAO,oBAACC,UAAD,EAAY,GAAI,gBAAgB,UAAU,OAAO,EAAE,MAD7C,mCACgD,EAAE,CAAC,EAAI;AACtE;AAEA,MAAa,UAAU,UAAuB;CAE5C,OAAO,oBAACC,UAAD,EAAY,GAAI,gBAAgB,UAAU,OAAO,EAAE,MAD7C,mCACgD,EAAE,CAAC,EAAI;AACtE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { NavigateOptions } from
|
|
1
|
+
import { NavigateOptions } from "@tanstack/react-router";
|
|
2
2
|
|
|
3
|
+
//#region src/client/useAwaitableNavigate.d.ts
|
|
3
4
|
declare const useAwaitableNavigate: () => (options: NavigateOptions) => Promise<unknown>;
|
|
4
|
-
|
|
5
|
+
//#endregion
|
|
5
6
|
export { useAwaitableNavigate };
|
|
7
|
+
//# sourceMappingURL=useAwaitableNavigate.d.ts.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useTransition } from
|
|
1
|
+
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
2
|
+
import React, { useTransition } from "react";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
//#region src/client/useAwaitableNavigate.ts
|
|
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
|
+
const [_, startTransition] = useTransition();
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
resolveAll();
|
|
16
|
+
}, [location]);
|
|
17
|
+
return (options) => {
|
|
18
|
+
return new Promise((res) => {
|
|
19
|
+
startTransition(() => {
|
|
20
|
+
resolveFunctionsRef.current.push(res);
|
|
21
|
+
res(navigate(options));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
//#endregion
|
|
27
28
|
export { useAwaitableNavigate };
|
|
28
|
-
//# sourceMappingURL=useAwaitableNavigate.js.map
|
|
29
29
|
//# sourceMappingURL=useAwaitableNavigate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"useAwaitableNavigate.js","names":[],"sources":["../../src/client/useAwaitableNavigate.ts"],"sourcesContent":["import type { NavigateOptions } from '@tanstack/react-router';\nimport { useLocation, useNavigate } from '@tanstack/react-router';\nimport React, { useTransition } from 'react';\n\ntype Resolve = (value?: unknown) => void;\n\nexport const useAwaitableNavigate = () => {\n const navigate = useNavigate();\n const location = useLocation();\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 const [_, startTransition] = useTransition();\n\n React.useEffect(() => {\n resolveAll();\n }, [location]);\n\n return (options: NavigateOptions) => {\n return new Promise(res => {\n startTransition(() => {\n resolveFunctionsRef.current.push(res);\n res(navigate(options));\n });\n });\n };\n};\n"],"mappings":";;;;AAMA,MAAa,6BAA6B;CACxC,MAAM,WAAW,YAAY;CAC7B,MAAM,WAAW,YAAY;CAC7B,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;CACA,MAAM,CAAC,GAAG,mBAAmB,cAAc;CAE3C,MAAM,gBAAgB;EACpB,WAAW;CACb,GAAG,CAAC,QAAQ,CAAC;CAEb,QAAQ,YAA6B;EACnC,OAAO,IAAI,SAAQ,QAAO;GACxB,sBAAsB;IACpB,oBAAoB,QAAQ,KAAK,GAAG;IACpC,IAAI,SAAS,OAAO,CAAC;GACvB,CAAC;EACH,CAAC;CACH;AACF"}
|
package/dist/client/utils.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '@clerk/react';
|
|
4
|
-
import '@clerk/react/internal';
|
|
5
|
-
import 'react';
|
|
1
|
+
import { n as TanstackStartClerkProviderProps } from "../types-DePBcrHU.js";
|
|
2
|
+
import { InternalClerkScriptProps } from "@clerk/shared/types";
|
|
6
3
|
|
|
4
|
+
//#region src/client/utils.d.ts
|
|
7
5
|
type TanStackProviderAndInitialProps = Omit<TanstackStartClerkProviderProps, 'children'>;
|
|
8
6
|
declare const pickFromClerkInitState: (clerkInitState: any) => TanStackProviderAndInitialProps & InternalClerkScriptProps & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
clerkSsrState: any;
|
|
8
|
+
__keylessClaimUrl?: string;
|
|
9
|
+
__keylessApiKeysUrl?: string;
|
|
12
10
|
};
|
|
13
11
|
declare const mergeWithPublicEnvs: (restInitState: any) => any;
|
|
14
12
|
type ParsedNavigationUrl = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
to: string;
|
|
14
|
+
search?: Record<string, string>;
|
|
15
|
+
hash?: string;
|
|
18
16
|
};
|
|
19
17
|
/**
|
|
20
18
|
* Parses a URL string into TanStack Router navigation options.
|
|
@@ -22,5 +20,6 @@ type ParsedNavigationUrl = {
|
|
|
22
20
|
* so we need to extract pathname, search params, and hash separately.
|
|
23
21
|
*/
|
|
24
22
|
declare function parseUrlForNavigation(to: string, baseUrl: string): ParsedNavigationUrl;
|
|
25
|
-
|
|
26
|
-
export {
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ParsedNavigationUrl, mergeWithPublicEnvs, parseUrlForNavigation, pickFromClerkInitState };
|
|
25
|
+
//# sourceMappingURL=utils.d.ts.map
|