Skip to content

Commit 0f340a8

Browse files
committed
chore: add back internal methods
1 parent 5adabce commit 0f340a8

8 files changed

Lines changed: 55 additions & 22 deletions

File tree

packages/astro/src/astro-components/interactive/OAuthConsent.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import type { OAuthConsentProps } from '@clerk/shared/types';
3-
type Props = OAuthConsentProps;
2+
import type { __internal_OAuthConsentProps } from '@clerk/shared/types';
3+
type Props = __internal_OAuthConsentProps;
44
55
import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro';
66
---

packages/astro/src/internal/mount-clerk-astro-js-components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const mountAllClerkAstroJSComponents = () => {
2121
waitlist: 'mountWaitlist',
2222
'pricing-table': 'mountPricingTable',
2323
'api-keys': 'mountAPIKeys',
24-
'oauth-consent': 'mountOAuthConsent',
24+
'oauth-consent': '__internal_mountOAuthConsent',
2525
} as const satisfies Record<InternalUIComponentId, keyof Clerk>;
2626

2727
Object.entries(mountFns).forEach(([category, mountFn]) => {

packages/astro/src/react/uiComponents.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {
22
GoogleOneTapProps,
3-
OAuthConsentProps,
3+
__internal_OAuthConsentProps,
44
OrganizationListProps,
55
OrganizationProfileProps,
66
OrganizationSwitcherProps,
@@ -198,11 +198,11 @@ export const PricingTable = withClerk(({ clerk, ...props }: WithClerkProp<Pricin
198198
);
199199
}, 'PricingTable');
200200

201-
export const OAuthConsent = withClerk(({ clerk, ...props }: WithClerkProp<OAuthConsentProps>) => {
201+
export const OAuthConsent = withClerk(({ clerk, ...props }: WithClerkProp<__internal_OAuthConsentProps>) => {
202202
return (
203203
<Portal
204-
mount={clerk?.mountOAuthConsent}
205-
unmount={clerk?.unmountOAuthConsent}
204+
mount={clerk?.__internal_mountOAuthConsent}
205+
unmount={clerk?.__internal_unmountOAuthConsent}
206206
props={props}
207207
/>
208208
);

packages/clerk-js/src/core/clerk.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import type {
5757
__internal_AttemptToEnableEnvironmentSettingResult,
5858
__internal_CheckoutProps,
5959
__internal_EnableOrganizationsPromptProps,
60+
__internal_OAuthConsentProps,
6061
OAuthConsentProps,
6162
__internal_PlanDetailsProps,
6263
__internal_SubscriptionDetailsProps,
@@ -1376,6 +1377,20 @@ export class Clerk implements ClerkInterface {
13761377
void this.#clerkUI?.then(ui => ui.ensureMounted()).then(controls => controls.unmountComponent({ node }));
13771378
};
13781379

1380+
/**
1381+
* @deprecated Use mountOAuthConsent instead.
1382+
*/
1383+
public __internal_mountOAuthConsent = (node: HTMLDivElement, props?: __internal_OAuthConsentProps) => {
1384+
return this.mountOAuthConsent(node, props);
1385+
};
1386+
1387+
/**
1388+
* @deprecated Use unmountOAuthConsent instead.
1389+
*/
1390+
public __internal_unmountOAuthConsent = (node: HTMLDivElement) => {
1391+
return this.unmountOAuthConsent(node);
1392+
};
1393+
13791394
/**
13801395
* Mount an API keys component at the target element.
13811396
* @param targetNode Target to mount the APIKeys component.

packages/react/src/components/uiComponents.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
OAuthConsentProps,
2+
__internal_OAuthConsentProps,
33
APIKeysProps,
44
CreateOrganizationProps,
55
GoogleOneTapProps,
@@ -645,7 +645,7 @@ export const APIKeys = withClerk(
645645
);
646646

647647
export const OAuthConsent = withClerk(
648-
({ clerk, component, fallback, ...props }: WithClerkProp<OAuthConsentProps & FallbackProp>) => {
648+
({ clerk, component, fallback, ...props }: WithClerkProp<__internal_OAuthConsentProps & FallbackProp>) => {
649649
const mountingStatus = useWaitForComponentMount(component);
650650
const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;
651651

@@ -659,8 +659,8 @@ export const OAuthConsent = withClerk(
659659
{clerk.loaded && (
660660
<ClerkHostRenderer
661661
component={component}
662-
mount={clerk.mountOAuthConsent}
663-
unmount={clerk.unmountOAuthConsent}
662+
mount={clerk.__internal_mountOAuthConsent}
663+
unmount={clerk.__internal_unmountOAuthConsent}
664664
updateProps={(clerk as any).__internal_updateProps}
665665
props={props}
666666
rootProps={rendererRootProps}

packages/react/src/isomorphicClerk.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
__internal_AttemptToEnableEnvironmentSettingResult,
77
__internal_CheckoutProps,
88
__internal_EnableOrganizationsPromptProps,
9-
OAuthConsentProps,
9+
__internal_OAuthConsentProps,
1010
__internal_PlanDetailsProps,
1111
__internal_SubscriptionDetailsProps,
1212
__internal_UserVerificationModalProps,
@@ -158,7 +158,7 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
158158
private premountWaitlistNodes = new Map<HTMLDivElement, WaitlistProps | undefined>();
159159
private premountPricingTableNodes = new Map<HTMLDivElement, PricingTableProps | undefined>();
160160
private premountAPIKeysNodes = new Map<HTMLDivElement, APIKeysProps | undefined>();
161-
private premountOAuthConsentNodes = new Map<HTMLDivElement, OAuthConsentProps | undefined>();
161+
private premountOAuthConsentNodes = new Map<HTMLDivElement, __internal_OAuthConsentProps | undefined>();
162162
private premountTaskChooseOrganizationNodes = new Map<HTMLDivElement, TaskChooseOrganizationProps | undefined>();
163163
private premountTaskResetPasswordNodes = new Map<HTMLDivElement, TaskResetPasswordProps | undefined>();
164164
private premountTaskSetupMFANodes = new Map<HTMLDivElement, TaskSetupMFAProps | undefined>();
@@ -747,7 +747,7 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
747747
});
748748

749749
this.premountOAuthConsentNodes.forEach((props, node) => {
750-
clerkjs.mountOAuthConsent(node, props);
750+
clerkjs.__internal_mountOAuthConsent(node, props);
751751
});
752752

753753
this.premountTaskChooseOrganizationNodes.forEach((props, node) => {
@@ -1282,17 +1282,17 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
12821282
}
12831283
};
12841284

1285-
mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps) => {
1285+
__internal_mountOAuthConsent = (node: HTMLDivElement, props?: __internal_OAuthConsentProps) => {
12861286
if (this.clerkjs && this.loaded) {
1287-
this.clerkjs.mountOAuthConsent(node, props);
1287+
this.clerkjs.__internal_mountOAuthConsent(node, props);
12881288
} else {
12891289
this.premountOAuthConsentNodes.set(node, props);
12901290
}
12911291
};
12921292

1293-
unmountOAuthConsent = (node: HTMLDivElement) => {
1293+
__internal_unmountOAuthConsent = (node: HTMLDivElement) => {
12941294
if (this.clerkjs && this.loaded) {
1295-
this.clerkjs.unmountOAuthConsent(node);
1295+
this.clerkjs.__internal_unmountOAuthConsent(node);
12961296
} else {
12971297
this.premountOAuthConsentNodes.delete(node);
12981298
}

packages/shared/src/types/clerk.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,21 @@ export interface Clerk {
661661
*/
662662
unmountAPIKeys: (targetNode: HTMLDivElement) => void;
663663

664+
/**
665+
* Mounts a OAuth consent component at the target element.
666+
*
667+
* @param targetNode - Target node to mount the OAuth consent component.
668+
* @param oauthConsentProps - OAuth consent configuration parameters.
669+
*/
670+
__internal_mountOAuthConsent: (targetNode: HTMLDivElement, oauthConsentProps?: __internal_OAuthConsentProps) => void;
671+
672+
/**
673+
* Unmounts a OAuth consent component from the target element.
674+
*
675+
* @param targetNode - Target node to unmount the OAuth consent component from.
676+
*/
677+
__internal_unmountOAuthConsent: (targetNode: HTMLDivElement) => void;
678+
664679
/**
665680
* Mounts a OAuth consent component at the target element.
666681
*
@@ -2328,6 +2343,9 @@ export type OAuthConsentProps = {
23282343
onDeny?: () => void;
23292344
};
23302345

2346+
/** @deprecated Use OAuthConsentProps instead. */
2347+
export type __internal_OAuthConsentProps = OAuthConsentProps;
2348+
23312349
export interface HandleEmailLinkVerificationParams {
23322350
/**
23332351
* Full URL or path to navigate to after successful magic link verification

packages/vue/src/components/ui-components/OAuthConsent.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<script setup lang="ts">
22
import { ClerkHostRenderer } from '../ClerkHostRenderer';
3-
import type { OAuthConsentProps } from '@clerk/shared/types';
3+
import type { __internal_OAuthConsentProps } from '@clerk/shared/types';
44
import { useClerk } from '../../composables';
55
66
const clerk = useClerk();
7-
const props = defineProps<OAuthConsentProps>();
7+
const props = defineProps<__internal_OAuthConsentProps>();
88
</script>
99

1010
<template>
1111
<ClerkHostRenderer
12-
:mount="clerk?.mountOAuthConsent"
13-
:unmount="clerk?.unmountOAuthConsent"
12+
:mount="clerk?.__internal_mountOAuthConsent"
13+
:unmount="clerk?.__internal_unmountOAuthConsent"
1414
:update-props="(clerk as any)?.__internal_updateProps"
1515
:props="props"
1616
/>

0 commit comments

Comments
 (0)