@movmo_app/react-common 0.17.1 → 0.19.0
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/index.cjs +27 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +47 -0
- package/dist/index.es.js +5034 -4987
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { MovmoCodeFlow } from '@movmo_app/types';
|
|
|
8
8
|
import { MovmoLoginResponse } from '@movmo_app/types';
|
|
9
9
|
import { MovmoVerifyResponse } from '@movmo_app/types';
|
|
10
10
|
import { OTPAction } from '@movmo_app/types';
|
|
11
|
+
import { PasskeyListResponse } from '@movmo_app/types';
|
|
11
12
|
import { PasskeyOptionsResponse } from '@movmo_app/types';
|
|
12
13
|
import { PasskeyRegistrationStart } from '@movmo_app/types';
|
|
13
14
|
import { PasskeySummary } from '@movmo_app/types';
|
|
@@ -329,7 +330,9 @@ export declare interface ModalProps {
|
|
|
329
330
|
title: default_2.ReactNode;
|
|
330
331
|
children: default_2.ReactNode;
|
|
331
332
|
footer?: default_2.ReactNode;
|
|
333
|
+
/** Ignored when `placement="sheet"`. */
|
|
332
334
|
maxWidth?: string;
|
|
335
|
+
/** Ignored when `placement="sheet"`. */
|
|
333
336
|
maxWidthPx?: number;
|
|
334
337
|
footerHasBorder?: boolean;
|
|
335
338
|
/** Hides the X and disables backdrop click and Escape: the dialog can't be dismissed. */
|
|
@@ -341,6 +344,13 @@ export declare interface ModalProps {
|
|
|
341
344
|
* and the content supplies its own heading (the MOVMO-685 sign-in dialogs).
|
|
342
345
|
*/
|
|
343
346
|
header?: 'bar' | 'none';
|
|
347
|
+
/**
|
|
348
|
+
* `'center'` (default): a centered dialog. `'sheet'`: a right-hand side sheet
|
|
349
|
+
* from `md` up and a bottom sheet below it; the body scrolls and the footer
|
|
350
|
+
* stays pinned. It shares the open-stack, focus trap and Escape handling, and
|
|
351
|
+
* ignores `maxWidth`/`maxWidthPx`.
|
|
352
|
+
*/
|
|
353
|
+
placement?: 'center' | 'sheet';
|
|
344
354
|
}
|
|
345
355
|
|
|
346
356
|
/** Typed client for every Movmo sign-in and passkey-management call. */
|
|
@@ -362,6 +372,8 @@ export declare interface MovmoAuthApi {
|
|
|
362
372
|
verifyCode(flowId: string, code: string): Promise<MovmoVerifyResponse>;
|
|
363
373
|
verifyPasskey(flowId: string, credential: CredentialJSON): Promise<MovmoVerifyResponse>;
|
|
364
374
|
listPasskeys(): Promise<PasskeySummary[]>;
|
|
375
|
+
/** The raw list response, including the optional `user_handle`/`rp_id`/identity keys. */
|
|
376
|
+
fetchPasskeyList(): Promise<PasskeyListResponse>;
|
|
365
377
|
startRegistration(): Promise<PasskeyRegistrationStart>;
|
|
366
378
|
completeRegistration(flowId: string, credential: CredentialJSON): Promise<PasskeySummary>;
|
|
367
379
|
/** Rejects an id that isn't base64url (1–512 chars) with `invalid_request`, before any request. */
|
|
@@ -604,6 +616,12 @@ export declare interface PasskeyListProps {
|
|
|
604
616
|
recoveryUntil?: string | null;
|
|
605
617
|
}
|
|
606
618
|
|
|
619
|
+
/** The `user_handle`/`rp_id` cached from the last list that carried them. */
|
|
620
|
+
export declare interface PasskeySignalFallback {
|
|
621
|
+
user_handle: string;
|
|
622
|
+
rp_id: string;
|
|
623
|
+
}
|
|
624
|
+
|
|
607
625
|
export declare const PhoneInput: default_2.FC<PhoneInputProps>;
|
|
608
626
|
|
|
609
627
|
export declare interface PhoneInputProps {
|
|
@@ -772,6 +790,35 @@ export declare const ShieldTickIcon: (props: IconProps) => JSX_2.Element;
|
|
|
772
790
|
*/
|
|
773
791
|
export declare function shouldOfferPasskey(now?: number, s?: PromptState | null): boolean;
|
|
774
792
|
|
|
793
|
+
/**
|
|
794
|
+
* Tells the credential provider which passkeys the server still accepts and the
|
|
795
|
+
* account's current name (WebAuthn Signal API; MOVMO-738). Best effort:
|
|
796
|
+
* synchronous, returns nothing, never awaited (Safari's promise may never
|
|
797
|
+
* settle), never logs (the user handle is a stable per-user identifier).
|
|
798
|
+
*
|
|
799
|
+
* Always pass the SERVER's list, never a locally edited one: a passkey added on
|
|
800
|
+
* another device since the page loaded would otherwise be removed by the
|
|
801
|
+
* provider.
|
|
802
|
+
*
|
|
803
|
+
* `fallback` covers the last removal, where the server returns no handle or
|
|
804
|
+
* `rp_id`; it is used only for the accepted-credentials signal (an empty list
|
|
805
|
+
* carries no user details). Pass it only with proof that `list` is the cached
|
|
806
|
+
* handle's account (PasskeyList: a 204 removal of a passkey that handle's list
|
|
807
|
+
* held), never after a 404 or an add: an empty list from another account
|
|
808
|
+
* would hide every passkey of the cached one.
|
|
809
|
+
*/
|
|
810
|
+
export declare function signalPasskeyState(list: PasskeyListResponse, fallback?: PasskeySignalFallback): void;
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Tells the provider one credential is gone (`signalUnknownCredential`). Call it
|
|
814
|
+
* only after the server answered 204 to the DELETE: after the LAST removal the
|
|
815
|
+
* server forgets the user handle, so `signalAllAcceptedCredentials` could never
|
|
816
|
+
* hide it on a later page load. Needs no handle. Same rules as
|
|
817
|
+
* `signalPasskeyState`: best effort, synchronous, never awaited, never logged,
|
|
818
|
+
* no-op when framed.
|
|
819
|
+
*/
|
|
820
|
+
export declare function signalRemovedPasskey(rpId: string, credentialId: string): void;
|
|
821
|
+
|
|
775
822
|
/**
|
|
776
823
|
* User-facing copy for the sign-in state machine (`useMovmoSignIn`).
|
|
777
824
|
* English only (D3); strings are verbatim from the MOVMO-685/718 design
|