@clerk/nextjs 7.0.0-snapshot.v20251224145055 → 7.0.0-snapshot.v20260105214115
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/cjs/app-router/server/__tests__/controlComponents.test-d.js +7 -0
- package/dist/cjs/app-router/server/__tests__/controlComponents.test-d.js.map +1 -0
- package/dist/cjs/app-router/server/controlComponents.js +16 -26
- package/dist/cjs/app-router/server/controlComponents.js.map +1 -1
- package/dist/cjs/client-boundary/controlComponents.js +2 -6
- package/dist/cjs/client-boundary/controlComponents.js.map +1 -1
- package/dist/cjs/components.client.js +2 -6
- package/dist/cjs/components.client.js.map +1 -1
- package/dist/cjs/components.server.js +2 -6
- package/dist/cjs/components.server.js.map +1 -1
- package/dist/cjs/index.js +3 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server/constants.js +1 -1
- package/dist/cjs/server/createClerkClient.js +1 -1
- package/dist/cjs/utils/debugLogger.js +1 -1
- package/dist/esm/app-router/server/__tests__/controlComponents.test-d.js +6 -0
- package/dist/esm/app-router/server/__tests__/controlComponents.test-d.js.map +1 -0
- package/dist/esm/app-router/server/controlComponents.js +15 -23
- package/dist/esm/app-router/server/controlComponents.js.map +1 -1
- package/dist/esm/client-boundary/controlComponents.js +7 -11
- package/dist/esm/client-boundary/controlComponents.js.map +1 -1
- package/dist/esm/components.client.js +2 -4
- package/dist/esm/components.client.js.map +1 -1
- package/dist/esm/components.server.js +2 -4
- package/dist/esm/components.server.js.map +1 -1
- package/dist/esm/index.js +2 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server/constants.js +1 -1
- package/dist/esm/server/createClerkClient.js +1 -1
- package/dist/esm/utils/debugLogger.js +1 -1
- package/dist/types/app-router/server/controlComponents.d.ts +31 -13
- package/dist/types/app-router/server/controlComponents.d.ts.map +1 -1
- package/dist/types/client-boundary/controlComponents.d.ts +1 -1
- package/dist/types/client-boundary/controlComponents.d.ts.map +1 -1
- package/dist/types/components.client.d.ts +1 -1
- package/dist/types/components.client.d.ts.map +1 -1
- package/dist/types/components.server.d.ts +3 -5
- package/dist/types/components.server.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/server/errorThrower.d.ts +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/app-router/server/__tests__/controlComponents.test-d.ts"],"sourcesContent":["import type { ShowWhenCondition } from '@clerk/shared/types';\nimport { test } from 'vitest';\n\ntest('ShowWhenCondition rejects empty authorization objects', () => {\n // @ts-expect-error - empty object must not satisfy ShowWhenCondition/ProtectParams\n const when: ShowWhenCondition = {};\n void when;\n});\n"],"mappings":";AACA,oBAAqB;AAAA,IAErB,oBAAK,yDAAyD,MAAM;AAElE,QAAM,OAA0B,CAAC;AACjC,OAAK;AACP,CAAC;","names":[]}
|
|
@@ -28,43 +28,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var controlComponents_exports = {};
|
|
30
30
|
__export(controlComponents_exports, {
|
|
31
|
-
|
|
32
|
-
SignedIn: () => SignedIn,
|
|
33
|
-
SignedOut: () => SignedOut
|
|
31
|
+
Show: () => Show
|
|
34
32
|
});
|
|
35
33
|
module.exports = __toCommonJS(controlComponents_exports);
|
|
36
34
|
var import_react = __toESM(require("react"));
|
|
37
35
|
var import_auth = require("./auth");
|
|
38
|
-
async function
|
|
39
|
-
const { children } = props;
|
|
40
|
-
const { userId } = await (0, import_auth.auth)({ treatPendingAsSignedOut
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
async function SignedOut(props) {
|
|
44
|
-
const { children } = props;
|
|
45
|
-
const { userId } = await (0, import_auth.auth)({ treatPendingAsSignedOut: props.treatPendingAsSignedOut });
|
|
46
|
-
return userId ? null : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
|
|
47
|
-
}
|
|
48
|
-
async function Protect(props) {
|
|
49
|
-
const { children, fallback, ...restAuthorizedParams } = props;
|
|
50
|
-
const { has, userId } = await (0, import_auth.auth)({ treatPendingAsSignedOut: props.treatPendingAsSignedOut });
|
|
51
|
-
const unauthorized = fallback ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, fallback) : null;
|
|
36
|
+
async function Show(props) {
|
|
37
|
+
const { children, fallback, treatPendingAsSignedOut, when } = props;
|
|
38
|
+
const { has, userId } = await (0, import_auth.auth)({ treatPendingAsSignedOut });
|
|
39
|
+
const resolvedWhen = when;
|
|
52
40
|
const authorized = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
|
|
41
|
+
const unauthorized = fallback ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, fallback) : null;
|
|
42
|
+
if (typeof resolvedWhen === "string") {
|
|
43
|
+
if (resolvedWhen === "signed-out") {
|
|
44
|
+
return userId ? unauthorized : authorized;
|
|
45
|
+
}
|
|
46
|
+
return userId ? authorized : unauthorized;
|
|
47
|
+
}
|
|
53
48
|
if (!userId) {
|
|
54
49
|
return unauthorized;
|
|
55
50
|
}
|
|
56
|
-
if (typeof
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
if (restAuthorizedParams.role || restAuthorizedParams.permission || restAuthorizedParams.feature || restAuthorizedParams.plan) {
|
|
60
|
-
return has(restAuthorizedParams) ? authorized : unauthorized;
|
|
51
|
+
if (typeof resolvedWhen === "function") {
|
|
52
|
+
return resolvedWhen(has) ? authorized : unauthorized;
|
|
61
53
|
}
|
|
62
|
-
return authorized;
|
|
54
|
+
return has(resolvedWhen) ? authorized : unauthorized;
|
|
63
55
|
}
|
|
64
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
57
|
0 && (module.exports = {
|
|
66
|
-
|
|
67
|
-
SignedIn,
|
|
68
|
-
SignedOut
|
|
58
|
+
Show
|
|
69
59
|
});
|
|
70
60
|
//# sourceMappingURL=controlComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/app-router/server/controlComponents.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/app-router/server/controlComponents.tsx"],"sourcesContent":["import type { PendingSessionOptions, ShowWhenCondition } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { auth } from './auth';\n\nexport type AppRouterShowProps = React.PropsWithChildren<\n PendingSessionOptions & {\n fallback?: React.ReactNode;\n when: ShowWhenCondition;\n }\n>;\n\n/**\n * Use `<Show/>` to render children when an authorization or sign-in condition passes.\n * When `treatPendingAsSignedOut` is true, pending sessions are treated as signed out.\n * Renders the provided `fallback` (or `null`) when the condition fails.\n *\n * The `when` prop supports:\n * - `\"signed-in\"` or `\"signed-out\"` shorthands\n * - Authorization objects such as `{ permission: \"...\" }`, `{ role: \"...\" }`, `{ feature: \"...\" }`, or `{ plan: \"...\" }`\n * - Predicate functions `(has) => boolean` that receive the `has` helper\n *\n * @example\n * ```tsx\n * <Show when={{ permission: \"org:billing:manage\" }} fallback={<p>Unauthorized</p>}>\n * <BillingSettings />\n * </Show>\n *\n * <Show when={{ role: \"admin\" }}>\n * <AdminPanel />\n * </Show>\n *\n * <Show when={(has) => has({ permission: \"org:read\" }) && isFeatureEnabled}>\n * <ProtectedFeature />\n * </Show>\n *\n * <Show when=\"signed-in\">\n * <Dashboard />\n * </Show>\n * ```\n */\nexport async function Show(props: AppRouterShowProps): Promise<React.JSX.Element | null> {\n const { children, fallback, treatPendingAsSignedOut, when } = props;\n const { has, userId } = await auth({ treatPendingAsSignedOut });\n\n const resolvedWhen = when;\n const authorized = <>{children}</>;\n const unauthorized = fallback ? <>{fallback}</> : null;\n\n if (typeof resolvedWhen === 'string') {\n if (resolvedWhen === 'signed-out') {\n return userId ? unauthorized : authorized;\n }\n return userId ? authorized : unauthorized;\n }\n\n if (!userId) {\n return unauthorized;\n }\n\n if (typeof resolvedWhen === 'function') {\n return resolvedWhen(has) ? authorized : unauthorized;\n }\n\n return has(resolvedWhen) ? authorized : unauthorized;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAElB,kBAAqB;AAsCrB,eAAsB,KAAK,OAA8D;AACvF,QAAM,EAAE,UAAU,UAAU,yBAAyB,KAAK,IAAI;AAC9D,QAAM,EAAE,KAAK,OAAO,IAAI,UAAM,kBAAK,EAAE,wBAAwB,CAAC;AAE9D,QAAM,eAAe;AACrB,QAAM,aAAa,6BAAAA,QAAA,2BAAAA,QAAA,gBAAG,QAAS;AAC/B,QAAM,eAAe,WAAW,6BAAAA,QAAA,2BAAAA,QAAA,gBAAG,QAAS,IAAM;AAElD,MAAI,OAAO,iBAAiB,UAAU;AACpC,QAAI,iBAAiB,cAAc;AACjC,aAAO,SAAS,eAAe;AAAA,IACjC;AACA,WAAO,SAAS,aAAa;AAAA,EAC/B;AAEA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,IAAI,aAAa;AAAA,EAC1C;AAEA,SAAO,IAAI,YAAY,IAAI,aAAa;AAC1C;","names":["React"]}
|
|
@@ -25,15 +25,13 @@ __export(controlComponents_exports, {
|
|
|
25
25
|
ClerkLoaded: () => import_react.ClerkLoaded,
|
|
26
26
|
ClerkLoading: () => import_react.ClerkLoading,
|
|
27
27
|
MultisessionAppSupport: () => import_internal.MultisessionAppSupport,
|
|
28
|
-
Protect: () => import_react.Protect,
|
|
29
28
|
RedirectToCreateOrganization: () => import_react.RedirectToCreateOrganization,
|
|
30
29
|
RedirectToOrganizationProfile: () => import_react.RedirectToOrganizationProfile,
|
|
31
30
|
RedirectToSignIn: () => import_react.RedirectToSignIn,
|
|
32
31
|
RedirectToSignUp: () => import_react.RedirectToSignUp,
|
|
33
32
|
RedirectToTasks: () => import_react.RedirectToTasks,
|
|
34
33
|
RedirectToUserProfile: () => import_react.RedirectToUserProfile,
|
|
35
|
-
|
|
36
|
-
SignedOut: () => import_react.SignedOut
|
|
34
|
+
Show: () => import_react.Show
|
|
37
35
|
});
|
|
38
36
|
module.exports = __toCommonJS(controlComponents_exports);
|
|
39
37
|
var import_react = require("@clerk/react");
|
|
@@ -46,14 +44,12 @@ var import_internal = require("@clerk/react/internal");
|
|
|
46
44
|
ClerkLoaded,
|
|
47
45
|
ClerkLoading,
|
|
48
46
|
MultisessionAppSupport,
|
|
49
|
-
Protect,
|
|
50
47
|
RedirectToCreateOrganization,
|
|
51
48
|
RedirectToOrganizationProfile,
|
|
52
49
|
RedirectToSignIn,
|
|
53
50
|
RedirectToSignUp,
|
|
54
51
|
RedirectToTasks,
|
|
55
52
|
RedirectToUserProfile,
|
|
56
|
-
|
|
57
|
-
SignedOut
|
|
53
|
+
Show
|
|
58
54
|
});
|
|
59
55
|
//# sourceMappingURL=controlComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client-boundary/controlComponents.ts"],"sourcesContent":["'use client';\n\nexport {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/client-boundary/controlComponents.ts"],"sourcesContent":["'use client';\n\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n Show,\n} from '@clerk/react';\n\nexport { MultisessionAppSupport } from '@clerk/react/internal';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAaO;AAEP,sBAAuC;","names":[]}
|
|
@@ -19,9 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var components_client_exports = {};
|
|
20
20
|
__export(components_client_exports, {
|
|
21
21
|
ClerkProvider: () => import_ClerkProvider.ClerkProvider,
|
|
22
|
-
|
|
23
|
-
SignedIn: () => import_controlComponents.SignedIn,
|
|
24
|
-
SignedOut: () => import_controlComponents.SignedOut
|
|
22
|
+
Show: () => import_controlComponents.Show
|
|
25
23
|
});
|
|
26
24
|
module.exports = __toCommonJS(components_client_exports);
|
|
27
25
|
var import_ClerkProvider = require("./client-boundary/ClerkProvider");
|
|
@@ -29,8 +27,6 @@ var import_controlComponents = require("./client-boundary/controlComponents");
|
|
|
29
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
28
|
0 && (module.exports = {
|
|
31
29
|
ClerkProvider,
|
|
32
|
-
|
|
33
|
-
SignedIn,
|
|
34
|
-
SignedOut
|
|
30
|
+
Show
|
|
35
31
|
});
|
|
36
32
|
//# sourceMappingURL=components.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components.client.ts"],"sourcesContent":["export { ClerkProvider } from './client-boundary/ClerkProvider';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../src/components.client.ts"],"sourcesContent":["export { ClerkProvider } from './client-boundary/ClerkProvider';\nexport { Show } from './client-boundary/controlComponents';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,+BAAqB;","names":[]}
|
|
@@ -19,9 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var components_server_exports = {};
|
|
20
20
|
__export(components_server_exports, {
|
|
21
21
|
ClerkProvider: () => import_ClerkProvider.ClerkProvider,
|
|
22
|
-
|
|
23
|
-
SignedIn: () => import_controlComponents.SignedIn,
|
|
24
|
-
SignedOut: () => import_controlComponents.SignedOut
|
|
22
|
+
Show: () => import_controlComponents.Show
|
|
25
23
|
});
|
|
26
24
|
module.exports = __toCommonJS(components_server_exports);
|
|
27
25
|
var import_ClerkProvider = require("./app-router/server/ClerkProvider");
|
|
@@ -29,8 +27,6 @@ var import_controlComponents = require("./app-router/server/controlComponents");
|
|
|
29
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
28
|
0 && (module.exports = {
|
|
31
29
|
ClerkProvider,
|
|
32
|
-
|
|
33
|
-
SignedIn,
|
|
34
|
-
SignedOut
|
|
30
|
+
Show
|
|
35
31
|
});
|
|
36
32
|
//# sourceMappingURL=components.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components.server.ts"],"sourcesContent":["import { ClerkProvider } from './app-router/server/ClerkProvider';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components.server.ts"],"sourcesContent":["import { ClerkProvider } from './app-router/server/ClerkProvider';\nimport { Show } from './app-router/server/controlComponents';\n\nexport { ClerkProvider, Show };\n\nexport type ServerComponentsServerModuleTypes = {\n ClerkProvider: typeof ClerkProvider;\n Show: typeof Show;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,+BAAqB;","names":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -41,21 +41,19 @@ __export(index_exports, {
|
|
|
41
41
|
OrganizationProfile: () => import_uiComponents.OrganizationProfile,
|
|
42
42
|
OrganizationSwitcher: () => import_uiComponents.OrganizationSwitcher,
|
|
43
43
|
PricingTable: () => import_uiComponents.PricingTable,
|
|
44
|
-
Protect: () => Protect,
|
|
45
44
|
RedirectToCreateOrganization: () => import_controlComponents.RedirectToCreateOrganization,
|
|
46
45
|
RedirectToOrganizationProfile: () => import_controlComponents.RedirectToOrganizationProfile,
|
|
47
46
|
RedirectToSignIn: () => import_controlComponents.RedirectToSignIn,
|
|
48
47
|
RedirectToSignUp: () => import_controlComponents.RedirectToSignUp,
|
|
49
48
|
RedirectToTasks: () => import_controlComponents.RedirectToTasks,
|
|
50
49
|
RedirectToUserProfile: () => import_controlComponents.RedirectToUserProfile,
|
|
50
|
+
Show: () => Show,
|
|
51
51
|
SignIn: () => import_uiComponents.SignIn,
|
|
52
52
|
SignInButton: () => import_uiComponents.SignInButton,
|
|
53
53
|
SignInWithMetamaskButton: () => import_uiComponents.SignInWithMetamaskButton,
|
|
54
54
|
SignOutButton: () => import_uiComponents.SignOutButton,
|
|
55
55
|
SignUp: () => import_uiComponents.SignUp,
|
|
56
56
|
SignUpButton: () => import_uiComponents.SignUpButton,
|
|
57
|
-
SignedIn: () => SignedIn,
|
|
58
|
-
SignedOut: () => SignedOut,
|
|
59
57
|
TaskChooseOrganization: () => import_uiComponents.TaskChooseOrganization,
|
|
60
58
|
TaskResetPassword: () => import_uiComponents.TaskResetPassword,
|
|
61
59
|
UserAvatar: () => import_uiComponents.UserAvatar,
|
|
@@ -80,9 +78,7 @@ var import_uiComponents = require("./client-boundary/uiComponents");
|
|
|
80
78
|
var import_hooks = require("./client-boundary/hooks");
|
|
81
79
|
var ComponentsModule = __toESM(require("#components"));
|
|
82
80
|
const ClerkProvider = ComponentsModule.ClerkProvider;
|
|
83
|
-
const
|
|
84
|
-
const SignedOut = ComponentsModule.SignedOut;
|
|
85
|
-
const Protect = ComponentsModule.Protect;
|
|
81
|
+
const Show = ComponentsModule.Show;
|
|
86
82
|
// Annotate the CommonJS export names for ESM import in node:
|
|
87
83
|
0 && (module.exports = {
|
|
88
84
|
APIKeys,
|
|
@@ -98,21 +94,19 @@ const Protect = ComponentsModule.Protect;
|
|
|
98
94
|
OrganizationProfile,
|
|
99
95
|
OrganizationSwitcher,
|
|
100
96
|
PricingTable,
|
|
101
|
-
Protect,
|
|
102
97
|
RedirectToCreateOrganization,
|
|
103
98
|
RedirectToOrganizationProfile,
|
|
104
99
|
RedirectToSignIn,
|
|
105
100
|
RedirectToSignUp,
|
|
106
101
|
RedirectToTasks,
|
|
107
102
|
RedirectToUserProfile,
|
|
103
|
+
Show,
|
|
108
104
|
SignIn,
|
|
109
105
|
SignInButton,
|
|
110
106
|
SignInWithMetamaskButton,
|
|
111
107
|
SignOutButton,
|
|
112
108
|
SignUp,
|
|
113
109
|
SignUpButton,
|
|
114
|
-
SignedIn,
|
|
115
|
-
SignedOut,
|
|
116
110
|
TaskChooseOrganization,
|
|
117
111
|
TaskResetPassword,
|
|
118
112
|
UserAvatar,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n} from './client-boundary/controlComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationProfile,\n OrganizationSwitcher,\n PricingTable,\n SignIn,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUp,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n UserAvatar,\n UserButton,\n UserProfile,\n Waitlist,\n} from './client-boundary/uiComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n} from './client-boundary/hooks';\n\n/**\n * Conditionally export components that exhibit different behavior\n * when used in /app vs /pages.\n * We defined the runtime and the type values explicitly,\n * because TS will not recognize the subpath import unless the HOST\n * application sets moduleResolution to 'NodeNext'.\n */\n// @ts-ignore\nimport * as ComponentsModule from '#components';\n\nimport type { ServerComponentsServerModuleTypes } from './components.server';\n\nexport const ClerkProvider = ComponentsModule.ClerkProvider as ServerComponentsServerModuleTypes['ClerkProvider'];\nexport const
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n} from './client-boundary/controlComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationProfile,\n OrganizationSwitcher,\n PricingTable,\n SignIn,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUp,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n UserAvatar,\n UserButton,\n UserProfile,\n Waitlist,\n} from './client-boundary/uiComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n} from './client-boundary/hooks';\n\n/**\n * Conditionally export components that exhibit different behavior\n * when used in /app vs /pages.\n * We defined the runtime and the type values explicitly,\n * because TS will not recognize the subpath import unless the HOST\n * application sets moduleResolution to 'NodeNext'.\n */\n// @ts-ignore\nimport * as ComponentsModule from '#components';\n\nimport type { ServerComponentsServerModuleTypes } from './components.server';\n\nexport const ClerkProvider = ComponentsModule.ClerkProvider as ServerComponentsServerModuleTypes['ClerkProvider'];\nexport const Show = ComponentsModule.Show as ServerComponentsServerModuleTypes['Show'];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,+BAYO;AAMP,0BAoBO;AAMP,mBAYO;AAUP,uBAAkC;AAI3B,MAAM,gBAAgB,iBAAiB;AACvC,MAAM,OAAO,iBAAiB;","names":[]}
|
|
@@ -56,7 +56,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
|
|
|
56
56
|
const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
|
|
57
57
|
const SDK_METADATA = {
|
|
58
58
|
name: "@clerk/nextjs",
|
|
59
|
-
version: "7.0.0-snapshot.
|
|
59
|
+
version: "7.0.0-snapshot.v20260105214115",
|
|
60
60
|
environment: process.env.NODE_ENV
|
|
61
61
|
};
|
|
62
62
|
const TELEMETRY_DISABLED = (0, import_underscore.isTruthy)(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
|
|
@@ -28,7 +28,7 @@ const clerkClientDefaultOptions = {
|
|
|
28
28
|
publishableKey: import_constants.PUBLISHABLE_KEY,
|
|
29
29
|
apiUrl: import_constants.API_URL,
|
|
30
30
|
apiVersion: import_constants.API_VERSION,
|
|
31
|
-
userAgent: `${"@clerk/nextjs"}@${"7.0.0-snapshot.
|
|
31
|
+
userAgent: `${"@clerk/nextjs"}@${"7.0.0-snapshot.v20260105214115"}`,
|
|
32
32
|
proxyUrl: import_constants.PROXY_URL,
|
|
33
33
|
domain: import_constants.DOMAIN,
|
|
34
34
|
isSatellite: import_constants.IS_SATELLITE,
|
|
@@ -90,7 +90,7 @@ function debugLogHeader(name) {
|
|
|
90
90
|
return `[clerk debug start: ${name}]`;
|
|
91
91
|
}
|
|
92
92
|
function debugLogFooter(name) {
|
|
93
|
-
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.0.0-snapshot.
|
|
93
|
+
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.0.0-snapshot.v20260105214115"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
|
|
94
94
|
}
|
|
95
95
|
function truncate(str, maxLength) {
|
|
96
96
|
const encoder = new TextEncoder();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/app-router/server/__tests__/controlComponents.test-d.ts"],"sourcesContent":["import type { ShowWhenCondition } from '@clerk/shared/types';\nimport { test } from 'vitest';\n\ntest('ShowWhenCondition rejects empty authorization objects', () => {\n // @ts-expect-error - empty object must not satisfy ShowWhenCondition/ProtectParams\n const when: ShowWhenCondition = {};\n void when;\n});\n"],"mappings":"AACA,SAAS,YAAY;AAErB,KAAK,yDAAyD,MAAM;AAElE,QAAM,OAA0B,CAAC;AACjC,OAAK;AACP,CAAC;","names":[]}
|
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
import "../../chunk-BUSYA2B4.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { auth } from "./auth";
|
|
4
|
-
async function
|
|
5
|
-
const { children } = props;
|
|
6
|
-
const { userId } = await auth({ treatPendingAsSignedOut
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
async function SignedOut(props) {
|
|
10
|
-
const { children } = props;
|
|
11
|
-
const { userId } = await auth({ treatPendingAsSignedOut: props.treatPendingAsSignedOut });
|
|
12
|
-
return userId ? null : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
13
|
-
}
|
|
14
|
-
async function Protect(props) {
|
|
15
|
-
const { children, fallback, ...restAuthorizedParams } = props;
|
|
16
|
-
const { has, userId } = await auth({ treatPendingAsSignedOut: props.treatPendingAsSignedOut });
|
|
17
|
-
const unauthorized = fallback ? /* @__PURE__ */ React.createElement(React.Fragment, null, fallback) : null;
|
|
4
|
+
async function Show(props) {
|
|
5
|
+
const { children, fallback, treatPendingAsSignedOut, when } = props;
|
|
6
|
+
const { has, userId } = await auth({ treatPendingAsSignedOut });
|
|
7
|
+
const resolvedWhen = when;
|
|
18
8
|
const authorized = /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
9
|
+
const unauthorized = fallback ? /* @__PURE__ */ React.createElement(React.Fragment, null, fallback) : null;
|
|
10
|
+
if (typeof resolvedWhen === "string") {
|
|
11
|
+
if (resolvedWhen === "signed-out") {
|
|
12
|
+
return userId ? unauthorized : authorized;
|
|
13
|
+
}
|
|
14
|
+
return userId ? authorized : unauthorized;
|
|
15
|
+
}
|
|
19
16
|
if (!userId) {
|
|
20
17
|
return unauthorized;
|
|
21
18
|
}
|
|
22
|
-
if (typeof
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
if (restAuthorizedParams.role || restAuthorizedParams.permission || restAuthorizedParams.feature || restAuthorizedParams.plan) {
|
|
26
|
-
return has(restAuthorizedParams) ? authorized : unauthorized;
|
|
19
|
+
if (typeof resolvedWhen === "function") {
|
|
20
|
+
return resolvedWhen(has) ? authorized : unauthorized;
|
|
27
21
|
}
|
|
28
|
-
return authorized;
|
|
22
|
+
return has(resolvedWhen) ? authorized : unauthorized;
|
|
29
23
|
}
|
|
30
24
|
export {
|
|
31
|
-
|
|
32
|
-
SignedIn,
|
|
33
|
-
SignedOut
|
|
25
|
+
Show
|
|
34
26
|
};
|
|
35
27
|
//# sourceMappingURL=controlComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/app-router/server/controlComponents.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/app-router/server/controlComponents.tsx"],"sourcesContent":["import type { PendingSessionOptions, ShowWhenCondition } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { auth } from './auth';\n\nexport type AppRouterShowProps = React.PropsWithChildren<\n PendingSessionOptions & {\n fallback?: React.ReactNode;\n when: ShowWhenCondition;\n }\n>;\n\n/**\n * Use `<Show/>` to render children when an authorization or sign-in condition passes.\n * When `treatPendingAsSignedOut` is true, pending sessions are treated as signed out.\n * Renders the provided `fallback` (or `null`) when the condition fails.\n *\n * The `when` prop supports:\n * - `\"signed-in\"` or `\"signed-out\"` shorthands\n * - Authorization objects such as `{ permission: \"...\" }`, `{ role: \"...\" }`, `{ feature: \"...\" }`, or `{ plan: \"...\" }`\n * - Predicate functions `(has) => boolean` that receive the `has` helper\n *\n * @example\n * ```tsx\n * <Show when={{ permission: \"org:billing:manage\" }} fallback={<p>Unauthorized</p>}>\n * <BillingSettings />\n * </Show>\n *\n * <Show when={{ role: \"admin\" }}>\n * <AdminPanel />\n * </Show>\n *\n * <Show when={(has) => has({ permission: \"org:read\" }) && isFeatureEnabled}>\n * <ProtectedFeature />\n * </Show>\n *\n * <Show when=\"signed-in\">\n * <Dashboard />\n * </Show>\n * ```\n */\nexport async function Show(props: AppRouterShowProps): Promise<React.JSX.Element | null> {\n const { children, fallback, treatPendingAsSignedOut, when } = props;\n const { has, userId } = await auth({ treatPendingAsSignedOut });\n\n const resolvedWhen = when;\n const authorized = <>{children}</>;\n const unauthorized = fallback ? <>{fallback}</> : null;\n\n if (typeof resolvedWhen === 'string') {\n if (resolvedWhen === 'signed-out') {\n return userId ? unauthorized : authorized;\n }\n return userId ? authorized : unauthorized;\n }\n\n if (!userId) {\n return unauthorized;\n }\n\n if (typeof resolvedWhen === 'function') {\n return resolvedWhen(has) ? authorized : unauthorized;\n }\n\n return has(resolvedWhen) ? authorized : unauthorized;\n}\n"],"mappings":";AACA,OAAO,WAAW;AAElB,SAAS,YAAY;AAsCrB,eAAsB,KAAK,OAA8D;AACvF,QAAM,EAAE,UAAU,UAAU,yBAAyB,KAAK,IAAI;AAC9D,QAAM,EAAE,KAAK,OAAO,IAAI,MAAM,KAAK,EAAE,wBAAwB,CAAC;AAE9D,QAAM,eAAe;AACrB,QAAM,aAAa,0DAAG,QAAS;AAC/B,QAAM,eAAe,WAAW,0DAAG,QAAS,IAAM;AAElD,MAAI,OAAO,iBAAiB,UAAU;AACpC,QAAI,iBAAiB,cAAc;AACjC,aAAO,SAAS,eAAe;AAAA,IACjC;AACA,WAAO,SAAS,aAAa;AAAA,EAC/B;AAEA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,iBAAiB,YAAY;AACtC,WAAO,aAAa,GAAG,IAAI,aAAa;AAAA,EAC1C;AAEA,SAAO,IAAI,YAAY,IAAI,aAAa;AAC1C;","names":[]}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-BUSYA2B4.js";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
ClerkLoading,
|
|
4
|
+
AuthenticateWithRedirectCallback,
|
|
6
5
|
ClerkDegraded,
|
|
7
6
|
ClerkFailed,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
ClerkLoaded,
|
|
8
|
+
ClerkLoading,
|
|
9
|
+
RedirectToCreateOrganization,
|
|
10
|
+
RedirectToOrganizationProfile,
|
|
11
11
|
RedirectToSignIn,
|
|
12
12
|
RedirectToSignUp,
|
|
13
13
|
RedirectToTasks,
|
|
14
14
|
RedirectToUserProfile,
|
|
15
|
-
|
|
16
|
-
RedirectToCreateOrganization,
|
|
17
|
-
RedirectToOrganizationProfile
|
|
15
|
+
Show
|
|
18
16
|
} from "@clerk/react";
|
|
19
17
|
import { MultisessionAppSupport } from "@clerk/react/internal";
|
|
20
18
|
export {
|
|
@@ -24,14 +22,12 @@ export {
|
|
|
24
22
|
ClerkLoaded,
|
|
25
23
|
ClerkLoading,
|
|
26
24
|
MultisessionAppSupport,
|
|
27
|
-
Protect,
|
|
28
25
|
RedirectToCreateOrganization,
|
|
29
26
|
RedirectToOrganizationProfile,
|
|
30
27
|
RedirectToSignIn,
|
|
31
28
|
RedirectToSignUp,
|
|
32
29
|
RedirectToTasks,
|
|
33
30
|
RedirectToUserProfile,
|
|
34
|
-
|
|
35
|
-
SignedOut
|
|
31
|
+
Show
|
|
36
32
|
};
|
|
37
33
|
//# sourceMappingURL=controlComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/client-boundary/controlComponents.ts"],"sourcesContent":["'use client';\n\nexport {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/client-boundary/controlComponents.ts"],"sourcesContent":["'use client';\n\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n Show,\n} from '@clerk/react';\n\nexport { MultisessionAppSupport } from '@clerk/react/internal';\n"],"mappings":";;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,8BAA8B;","names":[]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import "./chunk-BUSYA2B4.js";
|
|
2
2
|
import { ClerkProvider } from "./client-boundary/ClerkProvider";
|
|
3
|
-
import {
|
|
3
|
+
import { Show } from "./client-boundary/controlComponents";
|
|
4
4
|
export {
|
|
5
5
|
ClerkProvider,
|
|
6
|
-
|
|
7
|
-
SignedIn,
|
|
8
|
-
SignedOut
|
|
6
|
+
Show
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=components.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components.client.ts"],"sourcesContent":["export { ClerkProvider } from './client-boundary/ClerkProvider';\nexport {
|
|
1
|
+
{"version":3,"sources":["../../src/components.client.ts"],"sourcesContent":["export { ClerkProvider } from './client-boundary/ClerkProvider';\nexport { Show } from './client-boundary/controlComponents';\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,YAAY;","names":[]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import "./chunk-BUSYA2B4.js";
|
|
2
2
|
import { ClerkProvider } from "./app-router/server/ClerkProvider";
|
|
3
|
-
import {
|
|
3
|
+
import { Show } from "./app-router/server/controlComponents";
|
|
4
4
|
export {
|
|
5
5
|
ClerkProvider,
|
|
6
|
-
|
|
7
|
-
SignedIn,
|
|
8
|
-
SignedOut
|
|
6
|
+
Show
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=components.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components.server.ts"],"sourcesContent":["import { ClerkProvider } from './app-router/server/ClerkProvider';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components.server.ts"],"sourcesContent":["import { ClerkProvider } from './app-router/server/ClerkProvider';\nimport { Show } from './app-router/server/controlComponents';\n\nexport { ClerkProvider, Show };\n\nexport type ServerComponentsServerModuleTypes = {\n ClerkProvider: typeof ClerkProvider;\n Show: typeof Show;\n};\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,YAAY;","names":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -48,9 +48,7 @@ import {
|
|
|
48
48
|
} from "./client-boundary/hooks";
|
|
49
49
|
import * as ComponentsModule from "#components";
|
|
50
50
|
const ClerkProvider = ComponentsModule.ClerkProvider;
|
|
51
|
-
const
|
|
52
|
-
const SignedOut = ComponentsModule.SignedOut;
|
|
53
|
-
const Protect = ComponentsModule.Protect;
|
|
51
|
+
const Show = ComponentsModule.Show;
|
|
54
52
|
export {
|
|
55
53
|
APIKeys,
|
|
56
54
|
AuthenticateWithRedirectCallback,
|
|
@@ -65,21 +63,19 @@ export {
|
|
|
65
63
|
OrganizationProfile,
|
|
66
64
|
OrganizationSwitcher,
|
|
67
65
|
PricingTable,
|
|
68
|
-
Protect,
|
|
69
66
|
RedirectToCreateOrganization,
|
|
70
67
|
RedirectToOrganizationProfile,
|
|
71
68
|
RedirectToSignIn,
|
|
72
69
|
RedirectToSignUp,
|
|
73
70
|
RedirectToTasks,
|
|
74
71
|
RedirectToUserProfile,
|
|
72
|
+
Show,
|
|
75
73
|
SignIn,
|
|
76
74
|
SignInButton,
|
|
77
75
|
SignInWithMetamaskButton,
|
|
78
76
|
SignOutButton,
|
|
79
77
|
SignUp,
|
|
80
78
|
SignUpButton,
|
|
81
|
-
SignedIn,
|
|
82
|
-
SignedOut,
|
|
83
79
|
TaskChooseOrganization,
|
|
84
80
|
TaskResetPassword,
|
|
85
81
|
UserAvatar,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n} from './client-boundary/controlComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationProfile,\n OrganizationSwitcher,\n PricingTable,\n SignIn,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUp,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n UserAvatar,\n UserButton,\n UserProfile,\n Waitlist,\n} from './client-boundary/uiComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n} from './client-boundary/hooks';\n\n/**\n * Conditionally export components that exhibit different behavior\n * when used in /app vs /pages.\n * We defined the runtime and the type values explicitly,\n * because TS will not recognize the subpath import unless the HOST\n * application sets moduleResolution to 'NodeNext'.\n */\n// @ts-ignore\nimport * as ComponentsModule from '#components';\n\nimport type { ServerComponentsServerModuleTypes } from './components.server';\n\nexport const ClerkProvider = ComponentsModule.ClerkProvider as ServerComponentsServerModuleTypes['ClerkProvider'];\nexport const
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n AuthenticateWithRedirectCallback,\n ClerkDegraded,\n ClerkFailed,\n ClerkLoaded,\n ClerkLoading,\n RedirectToCreateOrganization,\n RedirectToOrganizationProfile,\n RedirectToSignIn,\n RedirectToSignUp,\n RedirectToTasks,\n RedirectToUserProfile,\n} from './client-boundary/controlComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n APIKeys,\n CreateOrganization,\n GoogleOneTap,\n OrganizationList,\n OrganizationProfile,\n OrganizationSwitcher,\n PricingTable,\n SignIn,\n SignInButton,\n SignInWithMetamaskButton,\n SignOutButton,\n SignUp,\n SignUpButton,\n TaskChooseOrganization,\n TaskResetPassword,\n UserAvatar,\n UserButton,\n UserProfile,\n Waitlist,\n} from './client-boundary/uiComponents';\n\n/**\n * These need to be explicitly listed. Do not use an * here.\n * If you do, app router will break.\n */\nexport {\n useAuth,\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useReverification,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n} from './client-boundary/hooks';\n\n/**\n * Conditionally export components that exhibit different behavior\n * when used in /app vs /pages.\n * We defined the runtime and the type values explicitly,\n * because TS will not recognize the subpath import unless the HOST\n * application sets moduleResolution to 'NodeNext'.\n */\n// @ts-ignore\nimport * as ComponentsModule from '#components';\n\nimport type { ServerComponentsServerModuleTypes } from './components.server';\n\nexport const ClerkProvider = ComponentsModule.ClerkProvider as ServerComponentsServerModuleTypes['ClerkProvider'];\nexport const Show = ComponentsModule.Show as ServerComponentsServerModuleTypes['Show'];\n"],"mappings":";AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,YAAY,sBAAsB;AAI3B,MAAM,gBAAgB,iBAAiB;AACvC,MAAM,OAAO,iBAAiB;","names":[]}
|
|
@@ -17,7 +17,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
|
|
|
17
17
|
const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
|
|
18
18
|
const SDK_METADATA = {
|
|
19
19
|
name: "@clerk/nextjs",
|
|
20
|
-
version: "7.0.0-snapshot.
|
|
20
|
+
version: "7.0.0-snapshot.v20260105214115",
|
|
21
21
|
environment: process.env.NODE_ENV
|
|
22
22
|
};
|
|
23
23
|
const TELEMETRY_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
|
|
@@ -18,7 +18,7 @@ const clerkClientDefaultOptions = {
|
|
|
18
18
|
publishableKey: PUBLISHABLE_KEY,
|
|
19
19
|
apiUrl: API_URL,
|
|
20
20
|
apiVersion: API_VERSION,
|
|
21
|
-
userAgent: `${"@clerk/nextjs"}@${"7.0.0-snapshot.
|
|
21
|
+
userAgent: `${"@clerk/nextjs"}@${"7.0.0-snapshot.v20260105214115"}`,
|
|
22
22
|
proxyUrl: PROXY_URL,
|
|
23
23
|
domain: DOMAIN,
|
|
24
24
|
isSatellite: IS_SATELLITE,
|
|
@@ -57,7 +57,7 @@ function debugLogHeader(name) {
|
|
|
57
57
|
return `[clerk debug start: ${name}]`;
|
|
58
58
|
}
|
|
59
59
|
function debugLogFooter(name) {
|
|
60
|
-
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.0.0-snapshot.
|
|
60
|
+
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.0.0-snapshot.v20260105214115"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
|
|
61
61
|
}
|
|
62
62
|
function truncate(str, maxLength) {
|
|
63
63
|
const encoder = new TextEncoder();
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PendingSessionOptions } from '@clerk/shared/types';
|
|
1
|
+
import type { PendingSessionOptions, ShowWhenCondition } from '@clerk/shared/types';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
export type AppRouterShowProps = React.PropsWithChildren<PendingSessionOptions & {
|
|
4
|
+
fallback?: React.ReactNode;
|
|
5
|
+
when: ShowWhenCondition;
|
|
6
|
+
}>;
|
|
6
7
|
/**
|
|
7
|
-
* Use `<
|
|
8
|
+
* Use `<Show/>` to render children when an authorization or sign-in condition passes.
|
|
9
|
+
* When `treatPendingAsSignedOut` is true, pending sessions are treated as signed out.
|
|
10
|
+
* Renders the provided `fallback` (or `null`) when the condition fails.
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* The `when` prop supports:
|
|
13
|
+
* - `"signed-in"` or `"signed-out"` shorthands
|
|
14
|
+
* - Authorization objects such as `{ permission: "..." }`, `{ role: "..." }`, `{ feature: "..." }`, or `{ plan: "..." }`
|
|
15
|
+
* - Predicate functions `(has) => boolean` that receive the `has` helper
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Show when={{ permission: "org:billing:manage" }} fallback={<p>Unauthorized</p>}>
|
|
20
|
+
* <BillingSettings />
|
|
21
|
+
* </Show>
|
|
22
|
+
*
|
|
23
|
+
* <Show when={{ role: "admin" }}>
|
|
24
|
+
* <AdminPanel />
|
|
25
|
+
* </Show>
|
|
26
|
+
*
|
|
27
|
+
* <Show when={(has) => has({ permission: "org:read" }) && isFeatureEnabled}>
|
|
28
|
+
* <ProtectedFeature />
|
|
29
|
+
* </Show>
|
|
30
|
+
*
|
|
31
|
+
* <Show when="signed-in">
|
|
32
|
+
* <Dashboard />
|
|
33
|
+
* </Show>
|
|
16
34
|
* ```
|
|
17
35
|
*/
|
|
18
|
-
export declare function
|
|
36
|
+
export declare function Show(props: AppRouterShowProps): Promise<React.JSX.Element | null>;
|
|
19
37
|
//# sourceMappingURL=controlComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlComponents.d.ts","sourceRoot":"","sources":["../../../../src/app-router/server/controlComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"controlComponents.d.ts","sourceRoot":"","sources":["../../../../src/app-router/server/controlComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CACtD,qBAAqB,GAAG;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,IAAI,EAAE,iBAAiB,CAAC;CACzB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,IAAI,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,CAwBvF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { AuthenticateWithRedirectCallback, ClerkDegraded, ClerkFailed, ClerkLoaded, ClerkLoading, RedirectToCreateOrganization, RedirectToOrganizationProfile, RedirectToSignIn, RedirectToSignUp, RedirectToTasks, RedirectToUserProfile, Show, } from '@clerk/react';
|
|
2
2
|
export { MultisessionAppSupport } from '@clerk/react/internal';
|
|
3
3
|
//# sourceMappingURL=controlComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlComponents.d.ts","sourceRoot":"","sources":["../../../src/client-boundary/controlComponents.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"controlComponents.d.ts","sourceRoot":"","sources":["../../../src/client-boundary/controlComponents.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,IAAI,GACL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.client.d.ts","sourceRoot":"","sources":["../../src/components.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"components.client.d.ts","sourceRoot":"","sources":["../../src/components.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ClerkProvider } from './app-router/server/ClerkProvider';
|
|
2
|
-
import {
|
|
3
|
-
export { ClerkProvider,
|
|
2
|
+
import { Show } from './app-router/server/controlComponents';
|
|
3
|
+
export { ClerkProvider, Show };
|
|
4
4
|
export type ServerComponentsServerModuleTypes = {
|
|
5
5
|
ClerkProvider: typeof ClerkProvider;
|
|
6
|
-
|
|
7
|
-
SignedOut: typeof SignedOut;
|
|
8
|
-
Protect: typeof Protect;
|
|
6
|
+
Show: typeof Show;
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=components.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.server.d.ts","sourceRoot":"","sources":["../../src/components.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"components.server.d.ts","sourceRoot":"","sources":["../../src/components.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAE/B,MAAM,MAAM,iCAAiC,GAAG;IAC9C,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,IAAI,EAAE,OAAO,IAAI,CAAC;CACnB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,7 +15,5 @@ export { APIKeys, CreateOrganization, GoogleOneTap, OrganizationList, Organizati
|
|
|
15
15
|
export { useAuth, useClerk, useEmailLink, useOrganization, useOrganizationList, useReverification, useSession, useSessionList, useSignIn, useSignUp, useUser, } from './client-boundary/hooks';
|
|
16
16
|
import type { ServerComponentsServerModuleTypes } from './components.server';
|
|
17
17
|
export declare const ClerkProvider: ServerComponentsServerModuleTypes["ClerkProvider"];
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const SignedOut: ServerComponentsServerModuleTypes["SignedOut"];
|
|
20
|
-
export declare const Protect: ServerComponentsServerModuleTypes["Protect"];
|
|
18
|
+
export declare const Show: ServerComponentsServerModuleTypes["Show"];
|
|
21
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,MAAM,EACN,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,OAAO,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,GACR,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,aAAa,EAAqC,iCAAiC,CAAC,eAAe,CAAC,CAAC;AAClH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAE7C;;;GAGG;AACH,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,MAAM,EACN,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,OAAO,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,GACR,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,aAAa,EAAqC,iCAAiC,CAAC,eAAe,CAAC,CAAC;AAClH,eAAO,MAAM,IAAI,EAA4B,iCAAiC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const errorThrower: import("@clerk/shared/error-
|
|
1
|
+
export declare const errorThrower: import("@clerk/shared/error-BswSPiAB")._;
|
|
2
2
|
//# sourceMappingURL=errorThrower.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/nextjs",
|
|
3
|
-
"version": "7.0.0-snapshot.
|
|
3
|
+
"version": "7.0.0-snapshot.v20260105214115",
|
|
4
4
|
"description": "Clerk SDK for NextJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clerk",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"server-only": "0.0.1",
|
|
73
73
|
"tslib": "2.8.1",
|
|
74
|
-
"@clerk/
|
|
75
|
-
"@clerk/
|
|
76
|
-
"@clerk/shared": "4.0.0-snapshot.
|
|
74
|
+
"@clerk/backend": "3.0.0-snapshot.v20260105214115",
|
|
75
|
+
"@clerk/react": "6.0.0-snapshot.v20260105214115",
|
|
76
|
+
"@clerk/shared": "4.0.0-snapshot.v20260105214115"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"crypto-es": "^2.1.0",
|