@getpara/react-common 2.0.0-alpha.3 → 2.0.0-dev.1

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.
@@ -12,14 +12,11 @@ export declare class ParaInternal extends ParaWeb {
12
12
  setLoginEncryptionKeyPair: (keyPair?: import("node-forge").pki.rsa.KeyPair) => Promise<void>;
13
13
  getPortalURL: () => Promise<string>;
14
14
  isProviderModalDisabled: () => boolean;
15
- setAuth: (auth: import("@getpara/user-management-client").PrimaryAuth, { extras, userId }?: {
16
- extras?: import("@getpara/web-sdk").AuthExtras;
17
- userId?: string;
18
- }) => Promise<typeof this.authInfo>;
19
15
  supportedAuthMethods: (auth: import("@getpara/user-management-client").Auth<import("@getpara/user-management-client").PrimaryAuthType | "userId">) => Promise<Set<import("@getpara/web-sdk").AuthMethod>>;
20
- constructPortalUrl: (type: import("@getpara/core-sdk/dist/types/types").PortalUrlType, opts?: import("@getpara/core-sdk/dist/types/types").PortalUrlOptions) => Promise<string>;
21
- getNewCredentialAndUrl: ({ authMethod, isForNewDevice, portalTheme, shorten, }?: import("@getpara/core-sdk/dist/types/types").NewCredentialUrlParams) => Promise<{
22
- credentialId: string;
23
- url: string;
24
- }>;
16
+ getUserBiometricLocationHints: () => Promise<import("@getpara/user-management-client").BiometricLocationHint[]>;
17
+ exitLoops: () => void;
18
+ exitLogin: () => void;
19
+ exitAccountCreation: () => void;
20
+ exitOAuth: () => void;
21
+ exitFarcaster: () => void;
25
22
  }
@@ -1,4 +1,2 @@
1
- import { CoreAuthInfo } from '@getpara/web-sdk';
2
- export declare const UserIdentifier: ({ authInfo }: {
3
- authInfo?: CoreAuthInfo;
4
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { ModalAuthInfo } from '../types/index.js';
2
+ export declare const UserIdentifier: ({ identifier, authType, displayName, pfpUrl }: ModalAuthInfo) => import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -51,10 +51,13 @@ var ParaInternal = class extends ParaWeb {
51
51
  this.setLoginEncryptionKeyPair = super.setLoginEncryptionKeyPair;
52
52
  this.getPortalURL = super.getPortalURL;
53
53
  this.isProviderModalDisabled = super.isProviderModalDisabled;
54
- this.setAuth = super.setAuth;
55
54
  this.supportedAuthMethods = super.supportedAuthMethods;
56
- this.constructPortalUrl = super.constructPortalUrl;
57
- this.getNewCredentialAndUrl = super.getNewCredentialAndUrl;
55
+ this.getUserBiometricLocationHints = super.getUserBiometricLocationHints;
56
+ this.exitLoops = super.exitLoops;
57
+ this.exitLogin = super.exitLogin;
58
+ this.exitAccountCreation = super.exitAccountCreation;
59
+ this.exitOAuth = super.exitOAuth;
60
+ this.exitFarcaster = super.exitFarcaster;
58
61
  }
59
62
  };
60
63
 
@@ -1157,34 +1160,42 @@ var DeviceLogo = styled6(CpslIcon3)`
1157
1160
  // src/components/UserIdentifier.tsx
1158
1161
  import { CpslAvatar, CpslIcon as CpslIcon4, CpslText as CpslText5 } from "@getpara/react-components";
1159
1162
  import styled7 from "styled-components";
1160
- import { displayPhoneNumber } from "@getpara/web-sdk";
1163
+ import { formatPhoneNumber } from "@getpara/web-sdk";
1161
1164
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1162
- function defaultDisplay(authInfo) {
1163
- const { authType, identifier, externalWallet } = authInfo;
1165
+ function defaultDisplayName(authType, identifier) {
1164
1166
  switch (authType) {
1165
1167
  case "email":
1166
- return [identifier.toLowerCase(), "mail"];
1168
+ return identifier.toLowerCase();
1167
1169
  case "phone":
1168
- return [displayPhoneNumber(identifier), "phone"];
1170
+ return formatPhoneNumber(identifier);
1169
1171
  case "farcaster":
1170
- return [`@${identifier}`, "farcasterBrand"];
1172
+ return `@${identifier}`;
1171
1173
  case "telegram":
1172
- return [`Telegram User @${identifier}`, "telegramBrand"];
1173
- case "externalWallet":
1174
- return [getExternalWalletDisplayName(externalWallet), "wallet"];
1174
+ return `Telegram User @${identifier}`;
1175
1175
  default:
1176
- return [null, null];
1176
+ return null;
1177
1177
  }
1178
1178
  }
1179
- var UserIdentifier = ({ authInfo }) => {
1180
- if (!authInfo) {
1181
- return null;
1179
+ var UserIdentifier = ({ identifier, authType, displayName, pfpUrl }) => {
1180
+ const shouldHideAvatar = authType === "externalWallet";
1181
+ let icon;
1182
+ switch (authType) {
1183
+ case "email":
1184
+ icon = "mail";
1185
+ break;
1186
+ case "phone":
1187
+ icon = "phone";
1188
+ break;
1189
+ case "farcaster":
1190
+ icon = "farcasterBrand";
1191
+ break;
1192
+ case "telegram":
1193
+ icon = "telegramBrand";
1194
+ break;
1182
1195
  }
1183
- const { authType, displayName, pfpUrl } = authInfo;
1184
- const [defaultName, defaultIcon] = defaultDisplay(authInfo);
1185
1196
  return /* @__PURE__ */ jsxs5(Container4, { children: [
1186
- /* @__PURE__ */ jsx7(IconContainer, { children: pfpUrl ? /* @__PURE__ */ jsx7(Avatar, { src: pfpUrl, size: "20px", variant: "round" }) : /* @__PURE__ */ jsx7(Icon, { icon: defaultIcon, size: authType === "telegram" ? "20px" : "13px" }) }),
1187
- /* @__PURE__ */ jsx7(IdentifierText, { variant: "bodyS", weight: "medium", children: displayName || defaultName })
1197
+ !shouldHideAvatar && /* @__PURE__ */ jsx7(IconContainer, { children: pfpUrl ? /* @__PURE__ */ jsx7(Avatar, { src: pfpUrl, size: "20px" }) : /* @__PURE__ */ jsx7(Icon, { icon, size: authType === "telegram" ? "20px" : "13px" }) }),
1198
+ /* @__PURE__ */ jsx7(IdentifierText, { variant: "bodyS", weight: "medium", children: displayName || defaultDisplayName(authType, identifier) })
1188
1199
  ] });
1189
1200
  };
1190
1201
  var Container4 = styled7.div`
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- import { AuthStateLogin, AuthStateVerify, WalletType } from '@getpara/web-sdk';
1
+ import { WalletType } from '@getpara/web-sdk';
2
2
  export type WalletMetadata = {
3
3
  id: string;
4
4
  name: string;
@@ -32,13 +32,15 @@ export type CommonWallet = {
32
32
  address?: string;
33
33
  bufferAddress?: string;
34
34
  error?: string;
35
- authState?: AuthStateLogin | AuthStateVerify;
35
+ userExists: boolean;
36
+ isVerified: boolean;
36
37
  }>;
37
38
  connectMobile: (isManualWalletConnect?: boolean) => Promise<{
38
39
  address?: string;
39
40
  bufferAddress?: string;
40
41
  error?: string;
41
- authState?: AuthStateLogin | AuthStateVerify;
42
+ userExists: boolean;
43
+ isVerified: boolean;
42
44
  }>;
43
45
  type: WalletType;
44
46
  } & WalletMetadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-common",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-dev.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,8 +11,8 @@
11
11
  "*.css"
12
12
  ],
13
13
  "dependencies": {
14
- "@getpara/react-components": "2.0.0-alpha.3",
15
- "@getpara/web-sdk": "2.0.0-alpha.3",
14
+ "@getpara/react-components": "2.0.0-dev.1",
15
+ "@getpara/web-sdk": "2.0.0-dev.1",
16
16
  "@moonpay/moonpay-react": "^1.8.3",
17
17
  "@ramp-network/ramp-instant-sdk": "^4.0.5",
18
18
  "@stripe/crypto": "^0.0.4",
@@ -42,5 +42,5 @@
42
42
  "resolutions": {
43
43
  "styled-components": "^6"
44
44
  },
45
- "gitHead": "77a1e04b06258842ca9c81e3db2a2b0092517659"
45
+ "gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
46
46
  }