@embarkai/ui-kit 0.1.2 → 0.1.4
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/README.md +1 -1
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/kyc/sumsub.html +1 -1
- package/dist/iframe/main.js +493 -497
- package/dist/iframe/main.js.map +1 -1
- package/dist/iframe/oauth/telegram.html +1 -1
- package/dist/iframe/oauth/x.html +1 -1
- package/dist/index.cjs +117 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -63
- package/dist/index.d.ts +59 -63
- package/dist/index.js +115 -120
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/iframe/oauth/x.html
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -160,15 +160,11 @@ var init_initial = __esm({
|
|
|
160
160
|
]
|
|
161
161
|
},
|
|
162
162
|
wallet: {
|
|
163
|
-
enabled:
|
|
163
|
+
enabled: false,
|
|
164
164
|
supportedChains: [1, 137, 56],
|
|
165
165
|
requireSignature: true,
|
|
166
166
|
walletConnectProjectId: void 0
|
|
167
167
|
},
|
|
168
|
-
development: {
|
|
169
|
-
enabled: true,
|
|
170
|
-
showOnProduction: false
|
|
171
|
-
},
|
|
172
168
|
// preferedColorMode: 'light', // undefined means 'auto'
|
|
173
169
|
ui: {
|
|
174
170
|
title: "Sign in",
|
|
@@ -813,12 +809,14 @@ var init_iframe_mpc_client = __esm({
|
|
|
813
809
|
});
|
|
814
810
|
|
|
815
811
|
// src/internal/constants.ts
|
|
816
|
-
var import_lucide_react, LOCAL_COLOR_MODE_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
|
|
812
|
+
var import_lucide_react, LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, LP_JWT_TOKENS_LS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
|
|
817
813
|
var init_constants = __esm({
|
|
818
814
|
"src/internal/constants.ts"() {
|
|
819
815
|
import_lucide_react = require("lucide-react");
|
|
820
816
|
init_assets();
|
|
821
|
-
LOCAL_COLOR_MODE_KEY = "
|
|
817
|
+
LOCAL_COLOR_MODE_KEY = "passport-theme-mode";
|
|
818
|
+
LOOCAL_BACKUP_STATUS_KEY = "passport-backup-status";
|
|
819
|
+
LP_JWT_TOKENS_LS_KEY = "lumia-passport-jwt-tokens";
|
|
822
820
|
DEFAULT_AUTH_MENU_HEIGHT = 253;
|
|
823
821
|
DEFAULT_MAIN_MENU_HEIGHT = 90;
|
|
824
822
|
MAX_CONTENT_HEIGHT = 640;
|
|
@@ -1283,7 +1281,7 @@ var init_package = __esm({
|
|
|
1283
1281
|
"package.json"() {
|
|
1284
1282
|
package_default = {
|
|
1285
1283
|
name: "@embarkai/ui-kit",
|
|
1286
|
-
version: "0.1.
|
|
1284
|
+
version: "0.1.4",
|
|
1287
1285
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
1288
1286
|
type: "module",
|
|
1289
1287
|
main: "./dist/index.cjs",
|
|
@@ -2198,31 +2196,31 @@ var init_zh = __esm({
|
|
|
2198
2196
|
backToSignIn: "\u8FD4\u56DE\u767B\u5F55",
|
|
2199
2197
|
orSeparator: "\u6216\u4F7F\u7528\u4EE5\u4E0B\u65B9\u5F0F\u767B\u5F55",
|
|
2200
2198
|
email: {
|
|
2201
|
-
placeholder:
|
|
2199
|
+
placeholder: "\u8F93\u5165\u60A8\u7684\u7535\u5B50\u90AE\u4EF6\u5730\u5740"
|
|
2202
2200
|
},
|
|
2203
2201
|
verification: {
|
|
2204
|
-
title:
|
|
2205
|
-
sentTo:
|
|
2206
|
-
codeExpires:
|
|
2207
|
-
didntReceive:
|
|
2208
|
-
resend:
|
|
2202
|
+
title: "\u9A8C\u8BC1\u7801",
|
|
2203
|
+
sentTo: "\u6211\u4EEC\u5DF2\u5411\u4EE5\u4E0B\u90AE\u7BB1\u53D1\u9001\u9A8C\u8BC1\u7801\uFF1A",
|
|
2204
|
+
codeExpires: "\u9A8C\u8BC1\u7801\u5C06\u5728 {{time}} \u540E\u8FC7\u671F",
|
|
2205
|
+
didntReceive: "\u6CA1\u6536\u5230\u9A8C\u8BC1\u7801\uFF1F",
|
|
2206
|
+
resend: "\u91CD\u65B0\u53D1\u9001"
|
|
2209
2207
|
},
|
|
2210
2208
|
social: {
|
|
2211
|
-
comingSoonMessage:
|
|
2209
|
+
comingSoonMessage: "{{provider}} \u8EAB\u4EFD\u9A8C\u8BC1\u5373\u5C06\u63A8\u51FA\uFF01"
|
|
2212
2210
|
},
|
|
2213
2211
|
wallet: {
|
|
2214
|
-
label:
|
|
2212
|
+
label: "\u94B1\u5305"
|
|
2215
2213
|
},
|
|
2216
2214
|
passkey: {
|
|
2217
|
-
label:
|
|
2218
|
-
title:
|
|
2219
|
-
signInExisting:
|
|
2220
|
-
dontHave:
|
|
2221
|
-
create:
|
|
2215
|
+
label: "\u5BC6\u7801\u5BC6\u94A5",
|
|
2216
|
+
title: "\u5BC6\u7801\u5BC6\u94A5",
|
|
2217
|
+
signInExisting: "\u4F7F\u7528\u73B0\u6709\u5BC6\u7801\u767B\u5F55",
|
|
2218
|
+
dontHave: "\u6CA1\u6709\u5BC6\u7801\uFF1F",
|
|
2219
|
+
create: "\u521B\u5EFA\u901A\u884C\u5BC6\u94A5"
|
|
2222
2220
|
},
|
|
2223
2221
|
terms: {
|
|
2224
|
-
text:
|
|
2225
|
-
action:
|
|
2222
|
+
text: "\u767B\u5F55\u5373\u8868\u793A\u60A8\u540C\u610F",
|
|
2223
|
+
action: "\u670D\u52A1\u6761\u6B3E"
|
|
2226
2224
|
}
|
|
2227
2225
|
},
|
|
2228
2226
|
main: {
|
|
@@ -2277,38 +2275,38 @@ var init_zh = __esm({
|
|
|
2277
2275
|
placeholder: "\u8F93\u5165\u65B0\u6635\u79F0",
|
|
2278
2276
|
hint: "\u4EC5\u9650 3-20 \u4E2A\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF\u5747\u53EF",
|
|
2279
2277
|
errors: {
|
|
2280
|
-
tooShort:
|
|
2281
|
-
tooLong:
|
|
2282
|
-
invalidChars:
|
|
2283
|
-
invalidUnderscore:
|
|
2284
|
-
invalidFormat:
|
|
2285
|
-
nicknameTaken:
|
|
2286
|
-
nicknameReserved:
|
|
2287
|
-
cooldownActive:
|
|
2288
|
-
nicknameNotFound:
|
|
2289
|
-
unknown:
|
|
2278
|
+
tooShort: "\u6635\u79F0\u5FC5\u987B\u81F3\u5C11\u5305\u542B 3 \u4E2A\u5B57\u7B26",
|
|
2279
|
+
tooLong: "\u6635\u79F0\u6700\u591A\u5305\u542B 20 \u4E2A\u5B57\u7B26",
|
|
2280
|
+
invalidChars: "\u6635\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF",
|
|
2281
|
+
invalidUnderscore: "\u6635\u79F0\u4E0D\u80FD\u4EE5\u4E0B\u5212\u7EBF\u5F00\u5934/\u7ED3\u5C3E\u6216\u5305\u542B\u53CC\u4E0B\u5212\u7EBF",
|
|
2282
|
+
invalidFormat: "\u6635\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u548C\u4E0B\u5212\u7EBF",
|
|
2283
|
+
nicknameTaken: "\u6B64\u6635\u79F0\u5DF2\u88AB\u5360\u7528",
|
|
2284
|
+
nicknameReserved: "\u6B64\u6635\u79F0\u5DF2\u88AB\u4FDD\u7559",
|
|
2285
|
+
cooldownActive: "\u60A8\u53EF\u4EE5\u5728 {days} \u5929\u540E\u518D\u6B21\u66F4\u6539\u6635\u79F0",
|
|
2286
|
+
nicknameNotFound: "\u672A\u627E\u5230\u4F7F\u7528\u6B64\u6635\u79F0\u7684\u7528\u6237",
|
|
2287
|
+
unknown: "\u53D1\u751F\u9519\u8BEF"
|
|
2290
2288
|
},
|
|
2291
2289
|
availability: {
|
|
2292
|
-
alreadyYourNickname:
|
|
2293
|
-
checkingAvailability:
|
|
2294
|
-
nicknameAvailable:
|
|
2295
|
-
nicknameNotAvailable:
|
|
2290
|
+
alreadyYourNickname: "\u6B64\u6635\u79F0\u5DF2\u662F\u60A8\u7684\u6635\u79F0",
|
|
2291
|
+
checkingAvailability: "\u6B63\u5728\u68C0\u67E5\u53EF\u7528\u6027...",
|
|
2292
|
+
nicknameAvailable: "\u6635\u79F0\u53EF\u7528",
|
|
2293
|
+
nicknameNotAvailable: "\u6B64\u6635\u79F0\u4E0D\u53EF\u7528"
|
|
2296
2294
|
}
|
|
2297
2295
|
},
|
|
2298
2296
|
profilesMenu: {
|
|
2299
2297
|
title: "\u4E2A\u4EBA\u8D44\u6599",
|
|
2300
2298
|
email: {
|
|
2301
|
-
placeholder:
|
|
2302
|
-
sentTo:
|
|
2303
|
-
warningTitle:
|
|
2304
|
-
warningMsg:
|
|
2299
|
+
placeholder: "\u63D0\u4F9B\u90AE\u7BB1\u4EE5\u8FDE\u63A5",
|
|
2300
|
+
sentTo: "\u6211\u4EEC\u5DF2\u5411\u60A8\u7684\u90AE\u7BB1\u53D1\u9001\u9A8C\u8BC1\u7801",
|
|
2301
|
+
warningTitle: "\u8FDE\u63A5\u90AE\u7BB1",
|
|
2302
|
+
warningMsg: "\u8FDE\u63A5\u60A8\u7684\u90AE\u7BB1\u4EE5\u4FBF\u66F4\u8F7B\u677E\u5730\u6062\u590D\u5E10\u6237\u5E76\u589E\u5F3A\u5B89\u5168\u6027\u3002"
|
|
2305
2303
|
},
|
|
2306
2304
|
passkey: {
|
|
2307
|
-
message:
|
|
2308
|
-
message2:
|
|
2309
|
-
linking:
|
|
2310
|
-
createOnDevice:
|
|
2311
|
-
createOnSecurityKey:
|
|
2305
|
+
message: "\u4F7F\u7528 WebAuth \u5C06\u901A\u884C\u5BC6\u94A5\u5173\u8054\u5230\u60A8\u7684\u5E10\u6237\u3002\u60A8\u7684\u8BBE\u5907\u53EF\u80FD\u5141\u8BB8\u60A8\u9009\u62E9\u73B0\u6709\u7684\u5BC6\u7801\u3002",
|
|
2306
|
+
message2: "\u5426\u5219\u5C06\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5BC6\u7801",
|
|
2307
|
+
linking: "\u6B63\u5728\u5173\u8054\u5BC6\u7801...",
|
|
2308
|
+
createOnDevice: "\u5728\u6B64\u8BBE\u5907\u4E0A\u521B\u5EFA\u5BC6\u7801",
|
|
2309
|
+
createOnSecurityKey: "\u6DFB\u52A0\u5BC6\u7801\u914D\u7F6E\u6587\u4EF6"
|
|
2312
2310
|
},
|
|
2313
2311
|
unlinkTitle: "\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500",
|
|
2314
2312
|
unlinkConfirm: "\u8F93\u5165\u63D0\u4F9B\u5546 ID \u4EE5\u786E\u8BA4\u79FB\u9664",
|
|
@@ -2317,21 +2315,21 @@ var init_zh = __esm({
|
|
|
2317
2315
|
securityMenu: {
|
|
2318
2316
|
title: "\u5B89\u5168",
|
|
2319
2317
|
trustedApps: {
|
|
2320
|
-
trustedApp:
|
|
2321
|
-
trustedApps:
|
|
2322
|
-
noTrustedApps:
|
|
2323
|
-
removalNoteTitle:
|
|
2324
|
-
removalNoteMsg1:
|
|
2325
|
-
removalNoteMsg2:
|
|
2318
|
+
trustedApp: "\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
|
|
2319
|
+
trustedApps: "\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
|
|
2320
|
+
noTrustedApps: "\u672A\u627E\u5230\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
|
|
2321
|
+
removalNoteTitle: "\u79FB\u9664\u6B64\u5E94\u7528\u7A0B\u5E8F\u540E\uFF1A",
|
|
2322
|
+
removalNoteMsg1: "\u6240\u6709\u4EA4\u6613\u90FD\u9700\u8981\u786E\u8BA4",
|
|
2323
|
+
removalNoteMsg2: "Trust this app""
|
|
2326
2324
|
},
|
|
2327
2325
|
keyshareStatus: {
|
|
2328
|
-
title:
|
|
2329
|
-
serverReady:
|
|
2330
|
-
serverMissing:
|
|
2331
|
-
localReady:
|
|
2332
|
-
localMissing:
|
|
2333
|
-
valutBackupCreated:
|
|
2334
|
-
valutBackupMissing:
|
|
2326
|
+
title: "\u5BC6\u94A5\u5171\u4EAB\u72B6\u6001",
|
|
2327
|
+
serverReady: "\u60A8\u7684\u670D\u52A1\u5668\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5B89\u5168\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
|
|
2328
|
+
serverMissing: "\u670D\u52A1\u5668\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u4E22\u5931",
|
|
2329
|
+
localReady: "\u60A8\u7684\u672C\u5730\u79C1\u94A5\u5171\u4EAB\u5B89\u5168\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
|
|
2330
|
+
localMissing: "\u672C\u5730\u79C1\u94A5\u5171\u4EAB\u7F3A\u5931",
|
|
2331
|
+
valutBackupCreated: "\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD\u5B58\u5728\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
|
|
2332
|
+
valutBackupMissing: "\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD\u7F3A\u5931\u3002\u8BF7\u521B\u5EFA\u4E00\u4E2A\u5907\u4EFD\u4EE5\u786E\u4FDD\u60A8\u7684\u6570\u636E\u5B89\u5168\u3002"
|
|
2335
2333
|
},
|
|
2336
2334
|
lastBackup: "\u6700\u540E\u4E00\u6B21\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD",
|
|
2337
2335
|
lastBackupMeta: "{{browser}} \u6D4F\u89C8\u5668\uFF0C\u4F4D\u4E8E {{deviceName}} \u8BBE\u5907\u4E0A\uFF0C\u64CD\u4F5C\u7CFB\u7EDF\u4E3A {{os}}\u3002"
|
|
@@ -2390,7 +2388,7 @@ var init_constants3 = __esm({
|
|
|
2390
2388
|
ru: { passport: ru_default }
|
|
2391
2389
|
};
|
|
2392
2390
|
PASSPORT_NAMESPACE = "passport";
|
|
2393
|
-
LOCAL_STORAGE_I18N_KEY = "
|
|
2391
|
+
LOCAL_STORAGE_I18N_KEY = "passport-language";
|
|
2394
2392
|
}
|
|
2395
2393
|
});
|
|
2396
2394
|
|
|
@@ -2576,16 +2574,16 @@ function getAccessToken() {
|
|
|
2576
2574
|
}
|
|
2577
2575
|
return null;
|
|
2578
2576
|
} catch (error) {
|
|
2579
|
-
console.error("Failed to parse
|
|
2577
|
+
console.error("Failed to parse EmbarkAI session:", error);
|
|
2580
2578
|
return null;
|
|
2581
2579
|
}
|
|
2582
2580
|
}
|
|
2583
|
-
var import_clsx, import_tailwind_merge
|
|
2581
|
+
var import_clsx, import_tailwind_merge;
|
|
2584
2582
|
var init_utils2 = __esm({
|
|
2585
2583
|
"src/internal/lib/utils.ts"() {
|
|
2586
2584
|
import_clsx = require("clsx");
|
|
2587
2585
|
import_tailwind_merge = require("tailwind-merge");
|
|
2588
|
-
|
|
2586
|
+
init_constants();
|
|
2589
2587
|
}
|
|
2590
2588
|
});
|
|
2591
2589
|
|
|
@@ -2858,21 +2856,16 @@ function createHttpClient(baseUrl) {
|
|
|
2858
2856
|
var import_error_tracking2, HttpClient, _tssClient, _vaultClient, tssClient, vaultClient;
|
|
2859
2857
|
var init_httpClient = __esm({
|
|
2860
2858
|
"src/internal/clients/httpClient.ts"() {
|
|
2859
|
+
import_error_tracking2 = require("@embarkai/core/internal/error-tracking");
|
|
2861
2860
|
init_auth();
|
|
2862
|
-
init_base();
|
|
2863
2861
|
init_projectId();
|
|
2864
|
-
|
|
2862
|
+
init_base();
|
|
2865
2863
|
HttpClient = class {
|
|
2866
2864
|
constructor(baseUrl) {
|
|
2867
2865
|
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
2868
2866
|
}
|
|
2869
2867
|
async makeRequest(endpoint, options = {}) {
|
|
2870
|
-
const {
|
|
2871
|
-
method = "GET",
|
|
2872
|
-
headers = {},
|
|
2873
|
-
body,
|
|
2874
|
-
requireAuth = true
|
|
2875
|
-
} = options;
|
|
2868
|
+
const { method = "GET", headers = {}, body, requireAuth = true } = options;
|
|
2876
2869
|
const url = addProjectIdToUrl(`${this.baseUrl}${endpoint}`);
|
|
2877
2870
|
const requestHeaders = {
|
|
2878
2871
|
"Content-Type": "application/json",
|
|
@@ -2915,11 +2908,7 @@ var init_httpClient = __esm({
|
|
|
2915
2908
|
}
|
|
2916
2909
|
return await this.processResponse(response);
|
|
2917
2910
|
} catch (error) {
|
|
2918
|
-
(0, import_error_tracking2.logSdkError)(
|
|
2919
|
-
error instanceof Error ? error : new Error("Network error"),
|
|
2920
|
-
{ url, method },
|
|
2921
|
-
"http-client"
|
|
2922
|
-
);
|
|
2911
|
+
(0, import_error_tracking2.logSdkError)(error instanceof Error ? error : new Error("Network error"), { url, method }, "http-client");
|
|
2923
2912
|
return {
|
|
2924
2913
|
success: false,
|
|
2925
2914
|
error: error instanceof Error ? error.message : "Network error",
|
|
@@ -4935,7 +4924,8 @@ function useAutoConnect() {
|
|
|
4935
4924
|
const finalHasKeyshare = verify?.hasKeyshare ?? hasKeyshare ?? false;
|
|
4936
4925
|
try {
|
|
4937
4926
|
callbacks?.onAccount?.({ userId, address: null, session: null, hasKeyshare: finalHasKeyshare });
|
|
4938
|
-
} catch {
|
|
4927
|
+
} catch (error) {
|
|
4928
|
+
console.warn("[UI-KIT][AutoConnect] Error due onAccount callback:", error);
|
|
4939
4929
|
}
|
|
4940
4930
|
try {
|
|
4941
4931
|
const jwt = await Promise.resolve().then(() => (init_auth(), auth_exports)).then((m) => m.jwtTokenManager.getTokens());
|
|
@@ -4950,7 +4940,8 @@ function useAutoConnect() {
|
|
|
4950
4940
|
setIsLoading(false);
|
|
4951
4941
|
try {
|
|
4952
4942
|
callbacks?.onConnect?.({ address: addr, session: sess });
|
|
4953
|
-
} catch {
|
|
4943
|
+
} catch (error) {
|
|
4944
|
+
console.warn("[UI-KIT][AutoConnect] Error due onConnect callback:", error);
|
|
4954
4945
|
}
|
|
4955
4946
|
try {
|
|
4956
4947
|
callbacks?.onAccount?.({
|
|
@@ -4959,7 +4950,8 @@ function useAutoConnect() {
|
|
|
4959
4950
|
session: sess,
|
|
4960
4951
|
hasKeyshare: finalHasKeyshare
|
|
4961
4952
|
});
|
|
4962
|
-
} catch {
|
|
4953
|
+
} catch (error) {
|
|
4954
|
+
console.warn("[UI-KIT][AutoConnect] Error due onAccount callback:", error);
|
|
4963
4955
|
}
|
|
4964
4956
|
if (config.projectId) {
|
|
4965
4957
|
try {
|
|
@@ -6435,11 +6427,6 @@ function useAuthMenuHandlers() {
|
|
|
6435
6427
|
);
|
|
6436
6428
|
setError(null);
|
|
6437
6429
|
setAlert(null);
|
|
6438
|
-
try {
|
|
6439
|
-
callbacks?.onConnect?.({ address: addr, session: sess });
|
|
6440
|
-
callbacks?.onAccount?.({ userId, address: addr, session: sess, hasKeyshare: hasServerKeyshare });
|
|
6441
|
-
} catch {
|
|
6442
|
-
}
|
|
6443
6430
|
let hasKeyshareVaultBackup = false;
|
|
6444
6431
|
try {
|
|
6445
6432
|
const { checkServerBackupAvailability: checkServerBackupAvailability2, updateBackupStatus: updateBackupStatus2, getShareRecoveryStats: getShareRecoveryStats2 } = await Promise.resolve().then(() => (init_vaultClient(), vaultClient_exports));
|
|
@@ -6459,6 +6446,16 @@ function useAuthMenuHandlers() {
|
|
|
6459
6446
|
setSession(sess);
|
|
6460
6447
|
setAddress(addr);
|
|
6461
6448
|
setStatus("ready");
|
|
6449
|
+
try {
|
|
6450
|
+
callbacks?.onConnect?.({ address: addr, session: sess });
|
|
6451
|
+
} catch (error) {
|
|
6452
|
+
console.warn("[UI-KIT][AuthMenu] Error due onConnect callback:", error);
|
|
6453
|
+
}
|
|
6454
|
+
try {
|
|
6455
|
+
callbacks?.onAccount?.({ userId, address: addr, session: sess, hasKeyshare: hasServerKeyshare });
|
|
6456
|
+
} catch (error) {
|
|
6457
|
+
console.warn("[UI-KIT][AuthMenu] Error due onAccount callback:", error);
|
|
6458
|
+
}
|
|
6462
6459
|
setTimeout(() => {
|
|
6463
6460
|
if (!!jwt?.isNewUser || !hasKeyshareVaultBackup) {
|
|
6464
6461
|
if (!!jwt?.isNewUser) console.log("[AuthMenu] New user detected - forcing backup flow");
|
|
@@ -7016,14 +7013,11 @@ function SelectContent({
|
|
|
7016
7013
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectPrimitive.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7017
7014
|
SelectPrimitive.Content,
|
|
7018
7015
|
{
|
|
7016
|
+
...props,
|
|
7019
7017
|
"data-slot": "select-content",
|
|
7018
|
+
position,
|
|
7019
|
+
align,
|
|
7020
7020
|
"data-current-theme-mode": colorMode,
|
|
7021
|
-
style: {
|
|
7022
|
-
// backgroundColor: 'var(--l-pass-bg)',
|
|
7023
|
-
// border: '1px solid var(--l-pass-bd)',
|
|
7024
|
-
// color: 'var(--l-pass-fg)',
|
|
7025
|
-
// borderRadius: 'var(--l-pass-el-bdrs)'
|
|
7026
|
-
},
|
|
7027
7021
|
className: cn(
|
|
7028
7022
|
"account-abstraction-ui-scope text-[var(--l-pass-fg)] bg-[var(--l-pass-bg)]",
|
|
7029
7023
|
"rounded-[var(--l-pass-el-bdrs)] border border-[var(--l-pass-bd)]",
|
|
@@ -7031,9 +7025,6 @@ function SelectContent({
|
|
|
7031
7025
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
7032
7026
|
className
|
|
7033
7027
|
),
|
|
7034
|
-
position,
|
|
7035
|
-
align,
|
|
7036
|
-
...props,
|
|
7037
7028
|
children: [
|
|
7038
7029
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectScrollUpButton, {}),
|
|
7039
7030
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -8565,22 +8556,6 @@ function useOnRestoreSuccess() {
|
|
|
8565
8556
|
setRecoveryUserId(null);
|
|
8566
8557
|
setSuccess(null);
|
|
8567
8558
|
setError(null);
|
|
8568
|
-
try {
|
|
8569
|
-
callbacks?.onConnect?.({
|
|
8570
|
-
address: addr,
|
|
8571
|
-
session: sess
|
|
8572
|
-
});
|
|
8573
|
-
} catch {
|
|
8574
|
-
}
|
|
8575
|
-
try {
|
|
8576
|
-
callbacks?.onAccount?.({
|
|
8577
|
-
userId: recoveryUserId,
|
|
8578
|
-
address: addr,
|
|
8579
|
-
session: sess,
|
|
8580
|
-
hasKeyshare: hasServerKeyshare
|
|
8581
|
-
});
|
|
8582
|
-
} catch {
|
|
8583
|
-
}
|
|
8584
8559
|
if (config.current?.projectId) {
|
|
8585
8560
|
try {
|
|
8586
8561
|
const { getIframeManager: getIframeManager2 } = await Promise.resolve().then(() => (init_iframe_manager(), iframe_manager_exports));
|
|
@@ -8599,6 +8574,21 @@ function useOnRestoreSuccess() {
|
|
|
8599
8574
|
setSession(sess);
|
|
8600
8575
|
setAddress(addr);
|
|
8601
8576
|
setStatus("ready");
|
|
8577
|
+
try {
|
|
8578
|
+
callbacks?.onConnect?.({ address: addr, session: sess });
|
|
8579
|
+
} catch (error) {
|
|
8580
|
+
console.warn("[UI-KIT][Restore] Error due onConnect callback:", error);
|
|
8581
|
+
}
|
|
8582
|
+
try {
|
|
8583
|
+
callbacks?.onAccount?.({
|
|
8584
|
+
userId: recoveryUserId,
|
|
8585
|
+
address: addr,
|
|
8586
|
+
session: sess,
|
|
8587
|
+
hasKeyshare: hasServerKeyshare
|
|
8588
|
+
});
|
|
8589
|
+
} catch (error) {
|
|
8590
|
+
console.warn("[UI-KIT][Restore] Error due onAccount callback:", error);
|
|
8591
|
+
}
|
|
8602
8592
|
setPage(null);
|
|
8603
8593
|
setTimeout(() => {
|
|
8604
8594
|
setIsDialogForced(false);
|
|
@@ -16554,7 +16544,7 @@ var init_SessionContext = __esm({
|
|
|
16554
16544
|
// }
|
|
16555
16545
|
}),
|
|
16556
16546
|
{
|
|
16557
|
-
name: "
|
|
16547
|
+
name: "passport-session-meta",
|
|
16558
16548
|
// Only persist activeChainId and isChainUserSelected (other session data is ephemeral)
|
|
16559
16549
|
partialize: (state) => ({
|
|
16560
16550
|
activeChainId: state.activeChainId
|
|
@@ -16876,7 +16866,11 @@ async function encryptKeyshare(data, password, encryptionMethod = "password", cr
|
|
|
16876
16866
|
);
|
|
16877
16867
|
const key = await crypto.subtle.importKey("raw", keyMaterial, "AES-GCM", false, ["encrypt"]);
|
|
16878
16868
|
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
16879
|
-
const encryptedData = await crypto.subtle.encrypt(
|
|
16869
|
+
const encryptedData = await crypto.subtle.encrypt(
|
|
16870
|
+
{ name: "AES-GCM", iv },
|
|
16871
|
+
key,
|
|
16872
|
+
encoder.encode(plaintext)
|
|
16873
|
+
);
|
|
16880
16874
|
const checksumData = `${data.userId}:${data.sessionId}:${encryptionMethod}`;
|
|
16881
16875
|
const checksumBuffer = await crypto.subtle.digest("SHA-256", encoder.encode(checksumData));
|
|
16882
16876
|
const checksum = bytesToBase64(new Uint8Array(checksumBuffer));
|
|
@@ -16915,7 +16909,11 @@ async function decryptKeyshare(encryptedBackup, password) {
|
|
|
16915
16909
|
256
|
|
16916
16910
|
);
|
|
16917
16911
|
const key = await crypto.subtle.importKey("raw", keyMaterial, "AES-GCM", false, ["decrypt"]);
|
|
16918
|
-
const decryptedData = await crypto.subtle.decrypt(
|
|
16912
|
+
const decryptedData = await crypto.subtle.decrypt(
|
|
16913
|
+
{ name: "AES-GCM", iv },
|
|
16914
|
+
key,
|
|
16915
|
+
encryptedData
|
|
16916
|
+
);
|
|
16919
16917
|
const plaintext = decoder.decode(decryptedData);
|
|
16920
16918
|
const backupData = JSON.parse(plaintext);
|
|
16921
16919
|
if (encryptedBackup.checksum) {
|
|
@@ -16979,7 +16977,7 @@ async function deriveBackupPasswordFromPasskey(userId, credentialId) {
|
|
|
16979
16977
|
}
|
|
16980
16978
|
function getBackupStatus(userId) {
|
|
16981
16979
|
const storage = typeof window !== "undefined" ? window.localStorage : void 0;
|
|
16982
|
-
const statusData = storage?.getItem(
|
|
16980
|
+
const statusData = storage?.getItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`);
|
|
16983
16981
|
if (statusData) {
|
|
16984
16982
|
try {
|
|
16985
16983
|
return JSON.parse(statusData);
|
|
@@ -16993,7 +16991,7 @@ function updateBackupStatus(userId, method, status) {
|
|
|
16993
16991
|
if (!storage) return;
|
|
16994
16992
|
const current = getBackupStatus(userId);
|
|
16995
16993
|
current[method] = { ...current[method], ...status };
|
|
16996
|
-
storage.setItem(
|
|
16994
|
+
storage.setItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`, JSON.stringify(current));
|
|
16997
16995
|
if (typeof window !== "undefined") {
|
|
16998
16996
|
window.dispatchEvent(
|
|
16999
16997
|
new CustomEvent("lumia-passport-backup-status-changed", { detail: { method, status, currentStatus: current } })
|
|
@@ -17002,7 +17000,7 @@ function updateBackupStatus(userId, method, status) {
|
|
|
17002
17000
|
}
|
|
17003
17001
|
function clearBackupStatus(userId) {
|
|
17004
17002
|
const storage = typeof window !== "undefined" ? window.localStorage : void 0;
|
|
17005
|
-
storage?.removeItem(
|
|
17003
|
+
storage?.removeItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`);
|
|
17006
17004
|
}
|
|
17007
17005
|
async function checkServerBackupAvailability() {
|
|
17008
17006
|
try {
|
|
@@ -17360,6 +17358,7 @@ var init_vaultClient = __esm({
|
|
|
17360
17358
|
init_passkey();
|
|
17361
17359
|
init_base();
|
|
17362
17360
|
init_httpClient();
|
|
17361
|
+
init_constants();
|
|
17363
17362
|
PasswordValidationError = class extends Error {
|
|
17364
17363
|
constructor(message) {
|
|
17365
17364
|
super(message);
|
|
@@ -17613,7 +17612,7 @@ function getIframeManager(config) {
|
|
|
17613
17612
|
}
|
|
17614
17613
|
if (!iframeManagerInstance) {
|
|
17615
17614
|
throw new Error(
|
|
17616
|
-
'IframeManager not initialized. This usually means projectId is not configured.\n\nTo fix this:\n1. Get your projectId from https://dashboard.lumiapassport.com/\n2. Add it to
|
|
17615
|
+
'IframeManager not initialized. This usually means projectId is not configured.\n\nTo fix this:\n1. Get your projectId from https://dashboard.lumiapassport.com/\n2. Add it to Provider:\n <Provider projectId="your-project-id">\n\nFor more details, see the documentation.'
|
|
17617
17616
|
);
|
|
17618
17617
|
}
|
|
17619
17618
|
return iframeManagerInstance;
|
|
@@ -18826,7 +18825,7 @@ function notifyNoProjetctId(projectId) {
|
|
|
18826
18825
|
return;
|
|
18827
18826
|
}
|
|
18828
18827
|
console.error(
|
|
18829
|
-
'\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u26A0\uFE0F
|
|
18828
|
+
'\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u26A0\uFE0F EmbarkAI WARNING \u26A0\uFE0F \u2551\n\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563\n\u2551 \u2551\n\u2551 projectId is NOT configured! \u2551\n\u2551 \u2551\n\u2551 Your integration will NOT work without a valid projectId. \u2551\n\u2551 Most features will be disabled and errors will occur. \u2551\n\u2551 \u2551\n\u2551 To fix this: \u2551\n\u2551 1. Get your projectId from: https://dashboard.lumiapassport.com/ \u2551\n\u2551 2. Add it to your Provider: \u2551\n\u2551 \u2551\n\u2551 <Provider projectId="your-project-id"> \u2551\n\u2551 {children} \u2551\n\u2551 </Provider> \u2551\n\u2551 \u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n'
|
|
18830
18829
|
);
|
|
18831
18830
|
}
|
|
18832
18831
|
var init_utils8 = __esm({
|
|
@@ -18902,7 +18901,6 @@ function Provider(props) {
|
|
|
18902
18901
|
next.social = { ...next.social, ...updates.social };
|
|
18903
18902
|
if (updates.social.providers) next.social.providers = updates.social.providers;
|
|
18904
18903
|
}
|
|
18905
|
-
if (updates.development) next.development = { ...next.development, ...updates.development };
|
|
18906
18904
|
if (updates.ui) next.ui = { ...next.ui, ...updates.ui };
|
|
18907
18905
|
if (updates.network) next.network = { ...next.network, ...updates.network };
|
|
18908
18906
|
if (updates.services) next.services = { ...next.services, ...updates.services };
|
|
@@ -19013,7 +19011,6 @@ function ConnectWalletButton(props) {
|
|
|
19013
19011
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
19014
19012
|
const settingsNotifications = useLayoutDataStore((st) => st.settingsNotifications);
|
|
19015
19013
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
19016
|
-
const { config } = useProviderConfig();
|
|
19017
19014
|
const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
|
|
19018
19015
|
const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
|
|
19019
19016
|
(0, import_react66.useEffect)(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
|
|
@@ -19178,7 +19175,6 @@ var init_ConnectWalletButton = __esm({
|
|
|
19178
19175
|
import_react_query42 = require("@tanstack/react-query");
|
|
19179
19176
|
import_lucide_react61 = require("lucide-react");
|
|
19180
19177
|
import_react66 = require("react");
|
|
19181
|
-
init_ProviderContext();
|
|
19182
19178
|
init_SessionContext();
|
|
19183
19179
|
init_auth();
|
|
19184
19180
|
init_profile();
|
|
@@ -20861,8 +20857,8 @@ var init_index = __esm({
|
|
|
20861
20857
|
init_built();
|
|
20862
20858
|
init_ProviderContext();
|
|
20863
20859
|
init_ConnectWalletButton();
|
|
20864
|
-
init_SessionContext();
|
|
20865
20860
|
init_RainbowKitContext();
|
|
20861
|
+
init_SessionContext();
|
|
20866
20862
|
init_childAppHooks();
|
|
20867
20863
|
init_useOpenPage();
|
|
20868
20864
|
init_useColorMode();
|