@embarkai/ui-kit 0.4.87 → 0.4.88
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +38 -7
- package/dist/index.js +38 -7
- package/package.json +1 -1
package/dist/iframe/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
16
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
17
17
|
|
|
18
|
-
<title>EmbarkAI Secure Wallet - iframe version 0.4.
|
|
18
|
+
<title>EmbarkAI Secure Wallet - iframe version 0.4.88</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -6414,7 +6414,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6414
6414
|
};
|
|
6415
6415
|
|
|
6416
6416
|
// src/iframe/main.ts
|
|
6417
|
-
var IFRAME_VERSION = "0.4.
|
|
6417
|
+
var IFRAME_VERSION = "0.4.88";
|
|
6418
6418
|
var IframeWallet = class {
|
|
6419
6419
|
constructor() {
|
|
6420
6420
|
__publicField(this, "messenger");
|
package/dist/index.cjs
CHANGED
|
@@ -5453,6 +5453,7 @@ var init_useLayoutDataStore = __esm({
|
|
|
5453
5453
|
useLayoutDataStore = (0, import_zustand3.create)((set) => ({
|
|
5454
5454
|
page: null,
|
|
5455
5455
|
pageParams: null,
|
|
5456
|
+
postAuthNavigation: null,
|
|
5456
5457
|
langOpenedFromMenu: null,
|
|
5457
5458
|
walletMenuOpenedFrom: null,
|
|
5458
5459
|
chainMenuOpenedFrom: null,
|
|
@@ -5466,6 +5467,20 @@ var init_useLayoutDataStore = __esm({
|
|
|
5466
5467
|
pendingWalletLogin: null,
|
|
5467
5468
|
isOnboarding: false,
|
|
5468
5469
|
setPageParams: (pageOptions) => set({ pageParams: pageOptions }),
|
|
5470
|
+
setPostAuthNavigation: (postAuthNavigation) => set({ postAuthNavigation }),
|
|
5471
|
+
openPostAuthNavigation: () => {
|
|
5472
|
+
let navigation = null;
|
|
5473
|
+
set((state) => {
|
|
5474
|
+
navigation = state.postAuthNavigation;
|
|
5475
|
+
if (!navigation) return state;
|
|
5476
|
+
return {
|
|
5477
|
+
page: navigation.page,
|
|
5478
|
+
pageParams: navigation.params ?? null,
|
|
5479
|
+
postAuthNavigation: null
|
|
5480
|
+
};
|
|
5481
|
+
});
|
|
5482
|
+
return !!navigation;
|
|
5483
|
+
},
|
|
5469
5484
|
setPage: (page) => set((prev) => ({
|
|
5470
5485
|
page,
|
|
5471
5486
|
// Save the page from which specific menus were opened
|
|
@@ -7062,6 +7077,7 @@ function useAutoConnect() {
|
|
|
7062
7077
|
const stats = await getShareRecoveryStats2();
|
|
7063
7078
|
const hasRecoveryData = stats && (stats.created || stats.devices && stats.devices.length > 0);
|
|
7064
7079
|
setHasServerVault(!!hasRecoveryData);
|
|
7080
|
+
useLayoutDataStore.getState().openPostAuthNavigation();
|
|
7065
7081
|
} catch (e) {
|
|
7066
7082
|
console.warn("[UI-KIT][AutoConnect] Vault status check failed:", e);
|
|
7067
7083
|
}
|
|
@@ -7102,20 +7118,27 @@ function useOpenPage() {
|
|
|
7102
7118
|
const page = useLayoutDataStore((st) => st.page);
|
|
7103
7119
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
7104
7120
|
const setPageParams = useLayoutDataStore((st) => st.setPageParams);
|
|
7121
|
+
const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
|
|
7105
7122
|
const address = useSession((st) => st.address);
|
|
7106
7123
|
const open = (0, import_react8.useCallback)(
|
|
7107
7124
|
(passportPage, params) => {
|
|
7108
|
-
if (!address)
|
|
7125
|
+
if (!address) {
|
|
7126
|
+
if (passportPage !== "auth" /* AUTH */) {
|
|
7127
|
+
setPostAuthNavigation({ page: passportPage, params });
|
|
7128
|
+
}
|
|
7129
|
+
return setPage("auth" /* AUTH */);
|
|
7130
|
+
}
|
|
7109
7131
|
if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
|
|
7110
7132
|
setPage(passportPage);
|
|
7111
7133
|
if (!!params) setPageParams(params);
|
|
7112
7134
|
},
|
|
7113
|
-
[setPage, setPageParams, address]
|
|
7135
|
+
[setPage, setPageParams, setPostAuthNavigation, address]
|
|
7114
7136
|
);
|
|
7115
7137
|
const close = (0, import_react8.useCallback)(() => {
|
|
7116
7138
|
setPageParams(null);
|
|
7139
|
+
setPostAuthNavigation(null);
|
|
7117
7140
|
setPage(null);
|
|
7118
|
-
}, [setPage, setPageParams]);
|
|
7141
|
+
}, [setPage, setPageParams, setPostAuthNavigation]);
|
|
7119
7142
|
return { open, close, isOpen: page !== null };
|
|
7120
7143
|
}
|
|
7121
7144
|
function usePageParams() {
|
|
@@ -10599,7 +10622,8 @@ function useAuthMenuHandlers() {
|
|
|
10599
10622
|
useLayoutDataStore.getState().setPage("keysare-backup" /* KEYSARE_BACKUP */);
|
|
10600
10623
|
} else {
|
|
10601
10624
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
10602
|
-
useLayoutDataStore.getState().
|
|
10625
|
+
const didOpenPostAuthNavigation = useLayoutDataStore.getState().openPostAuthNavigation();
|
|
10626
|
+
if (!didOpenPostAuthNavigation) useLayoutDataStore.getState().setPage(null);
|
|
10603
10627
|
}
|
|
10604
10628
|
}, 100);
|
|
10605
10629
|
} catch (error) {
|
|
@@ -18519,7 +18543,8 @@ function useOnRestoreSuccess() {
|
|
|
18519
18543
|
} catch (error) {
|
|
18520
18544
|
console.warn("[UI-KIT][Restore] Error due onAccount callback:", error);
|
|
18521
18545
|
}
|
|
18522
|
-
|
|
18546
|
+
const didOpenPostAuthNavigation = useLayoutDataStore.getState().openPostAuthNavigation();
|
|
18547
|
+
if (!didOpenPostAuthNavigation) setPage(null);
|
|
18523
18548
|
setTimeout(() => {
|
|
18524
18549
|
setIsDialogForced(false);
|
|
18525
18550
|
}, 375);
|
|
@@ -18817,6 +18842,7 @@ function useCreateBackup() {
|
|
|
18817
18842
|
setError(response.error || "Server backup failed");
|
|
18818
18843
|
}
|
|
18819
18844
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
18845
|
+
useLayoutDataStore.getState().openPostAuthNavigation();
|
|
18820
18846
|
},
|
|
18821
18847
|
onError: async (error) => {
|
|
18822
18848
|
const { setError, setSuccess } = useRestoreStore.getState();
|
|
@@ -18948,6 +18974,7 @@ var init_useCreateBackup = __esm({
|
|
|
18948
18974
|
import_react_query27 = require("@tanstack/react-query");
|
|
18949
18975
|
import_react51 = require("react");
|
|
18950
18976
|
init_auth();
|
|
18977
|
+
init_useLayoutDataStore();
|
|
18951
18978
|
init_useLayoutStore();
|
|
18952
18979
|
init_iframe_manager();
|
|
18953
18980
|
init_constants5();
|
|
@@ -28707,7 +28734,7 @@ var init_package = __esm({
|
|
|
28707
28734
|
"package.json"() {
|
|
28708
28735
|
package_default = {
|
|
28709
28736
|
name: "@embarkai/ui-kit",
|
|
28710
|
-
version: "0.4.
|
|
28737
|
+
version: "0.4.88",
|
|
28711
28738
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
28712
28739
|
type: "module",
|
|
28713
28740
|
main: "./dist/index.cjs",
|
|
@@ -29372,6 +29399,7 @@ function Dialog2() {
|
|
|
29372
29399
|
const page = useLayoutDataStore((st) => st.page);
|
|
29373
29400
|
const transitionPageHeight = useLayoutDataStore((st) => st.transitionPageHeight);
|
|
29374
29401
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
29402
|
+
const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
|
|
29375
29403
|
const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
|
|
29376
29404
|
(0, import_react96.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
|
|
29377
29405
|
usePageMapper();
|
|
@@ -29387,7 +29415,10 @@ function Dialog2() {
|
|
|
29387
29415
|
open: isDialogOpen,
|
|
29388
29416
|
onOpenChange: (open) => {
|
|
29389
29417
|
if (isDialogForced) return;
|
|
29390
|
-
if (!open)
|
|
29418
|
+
if (!open) {
|
|
29419
|
+
setPostAuthNavigation(null);
|
|
29420
|
+
setPage(null);
|
|
29421
|
+
}
|
|
29391
29422
|
},
|
|
29392
29423
|
children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(
|
|
29393
29424
|
DialogContent,
|
package/dist/index.js
CHANGED
|
@@ -5438,6 +5438,7 @@ var init_useLayoutDataStore = __esm({
|
|
|
5438
5438
|
useLayoutDataStore = create3((set) => ({
|
|
5439
5439
|
page: null,
|
|
5440
5440
|
pageParams: null,
|
|
5441
|
+
postAuthNavigation: null,
|
|
5441
5442
|
langOpenedFromMenu: null,
|
|
5442
5443
|
walletMenuOpenedFrom: null,
|
|
5443
5444
|
chainMenuOpenedFrom: null,
|
|
@@ -5451,6 +5452,20 @@ var init_useLayoutDataStore = __esm({
|
|
|
5451
5452
|
pendingWalletLogin: null,
|
|
5452
5453
|
isOnboarding: false,
|
|
5453
5454
|
setPageParams: (pageOptions) => set({ pageParams: pageOptions }),
|
|
5455
|
+
setPostAuthNavigation: (postAuthNavigation) => set({ postAuthNavigation }),
|
|
5456
|
+
openPostAuthNavigation: () => {
|
|
5457
|
+
let navigation = null;
|
|
5458
|
+
set((state) => {
|
|
5459
|
+
navigation = state.postAuthNavigation;
|
|
5460
|
+
if (!navigation) return state;
|
|
5461
|
+
return {
|
|
5462
|
+
page: navigation.page,
|
|
5463
|
+
pageParams: navigation.params ?? null,
|
|
5464
|
+
postAuthNavigation: null
|
|
5465
|
+
};
|
|
5466
|
+
});
|
|
5467
|
+
return !!navigation;
|
|
5468
|
+
},
|
|
5454
5469
|
setPage: (page) => set((prev) => ({
|
|
5455
5470
|
page,
|
|
5456
5471
|
// Save the page from which specific menus were opened
|
|
@@ -7046,6 +7061,7 @@ function useAutoConnect() {
|
|
|
7046
7061
|
const stats = await getShareRecoveryStats2();
|
|
7047
7062
|
const hasRecoveryData = stats && (stats.created || stats.devices && stats.devices.length > 0);
|
|
7048
7063
|
setHasServerVault(!!hasRecoveryData);
|
|
7064
|
+
useLayoutDataStore.getState().openPostAuthNavigation();
|
|
7049
7065
|
} catch (e) {
|
|
7050
7066
|
console.warn("[UI-KIT][AutoConnect] Vault status check failed:", e);
|
|
7051
7067
|
}
|
|
@@ -7085,20 +7101,27 @@ function useOpenPage() {
|
|
|
7085
7101
|
const page = useLayoutDataStore((st) => st.page);
|
|
7086
7102
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
7087
7103
|
const setPageParams = useLayoutDataStore((st) => st.setPageParams);
|
|
7104
|
+
const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
|
|
7088
7105
|
const address = useSession((st) => st.address);
|
|
7089
7106
|
const open = useCallback4(
|
|
7090
7107
|
(passportPage, params) => {
|
|
7091
|
-
if (!address)
|
|
7108
|
+
if (!address) {
|
|
7109
|
+
if (passportPage !== "auth" /* AUTH */) {
|
|
7110
|
+
setPostAuthNavigation({ page: passportPage, params });
|
|
7111
|
+
}
|
|
7112
|
+
return setPage("auth" /* AUTH */);
|
|
7113
|
+
}
|
|
7092
7114
|
if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
|
|
7093
7115
|
setPage(passportPage);
|
|
7094
7116
|
if (!!params) setPageParams(params);
|
|
7095
7117
|
},
|
|
7096
|
-
[setPage, setPageParams, address]
|
|
7118
|
+
[setPage, setPageParams, setPostAuthNavigation, address]
|
|
7097
7119
|
);
|
|
7098
7120
|
const close = useCallback4(() => {
|
|
7099
7121
|
setPageParams(null);
|
|
7122
|
+
setPostAuthNavigation(null);
|
|
7100
7123
|
setPage(null);
|
|
7101
|
-
}, [setPage, setPageParams]);
|
|
7124
|
+
}, [setPage, setPageParams, setPostAuthNavigation]);
|
|
7102
7125
|
return { open, close, isOpen: page !== null };
|
|
7103
7126
|
}
|
|
7104
7127
|
function usePageParams() {
|
|
@@ -10571,7 +10594,8 @@ function useAuthMenuHandlers() {
|
|
|
10571
10594
|
useLayoutDataStore.getState().setPage("keysare-backup" /* KEYSARE_BACKUP */);
|
|
10572
10595
|
} else {
|
|
10573
10596
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
10574
|
-
useLayoutDataStore.getState().
|
|
10597
|
+
const didOpenPostAuthNavigation = useLayoutDataStore.getState().openPostAuthNavigation();
|
|
10598
|
+
if (!didOpenPostAuthNavigation) useLayoutDataStore.getState().setPage(null);
|
|
10575
10599
|
}
|
|
10576
10600
|
}, 100);
|
|
10577
10601
|
} catch (error) {
|
|
@@ -18466,7 +18490,8 @@ function useOnRestoreSuccess() {
|
|
|
18466
18490
|
} catch (error) {
|
|
18467
18491
|
console.warn("[UI-KIT][Restore] Error due onAccount callback:", error);
|
|
18468
18492
|
}
|
|
18469
|
-
|
|
18493
|
+
const didOpenPostAuthNavigation = useLayoutDataStore.getState().openPostAuthNavigation();
|
|
18494
|
+
if (!didOpenPostAuthNavigation) setPage(null);
|
|
18470
18495
|
setTimeout(() => {
|
|
18471
18496
|
setIsDialogForced(false);
|
|
18472
18497
|
}, 375);
|
|
@@ -18764,6 +18789,7 @@ function useCreateBackup() {
|
|
|
18764
18789
|
setError(response.error || "Server backup failed");
|
|
18765
18790
|
}
|
|
18766
18791
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
18792
|
+
useLayoutDataStore.getState().openPostAuthNavigation();
|
|
18767
18793
|
},
|
|
18768
18794
|
onError: async (error) => {
|
|
18769
18795
|
const { setError, setSuccess } = useRestoreStore.getState();
|
|
@@ -18892,6 +18918,7 @@ var init_useCreateBackup = __esm({
|
|
|
18892
18918
|
"src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts"() {
|
|
18893
18919
|
init_SessionContext();
|
|
18894
18920
|
init_auth();
|
|
18921
|
+
init_useLayoutDataStore();
|
|
18895
18922
|
init_useLayoutStore();
|
|
18896
18923
|
init_iframe_manager();
|
|
18897
18924
|
init_constants5();
|
|
@@ -28605,7 +28632,7 @@ var init_package = __esm({
|
|
|
28605
28632
|
"package.json"() {
|
|
28606
28633
|
package_default = {
|
|
28607
28634
|
name: "@embarkai/ui-kit",
|
|
28608
|
-
version: "0.4.
|
|
28635
|
+
version: "0.4.88",
|
|
28609
28636
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
28610
28637
|
type: "module",
|
|
28611
28638
|
main: "./dist/index.cjs",
|
|
@@ -29272,6 +29299,7 @@ function Dialog2() {
|
|
|
29272
29299
|
const page = useLayoutDataStore((st) => st.page);
|
|
29273
29300
|
const transitionPageHeight = useLayoutDataStore((st) => st.transitionPageHeight);
|
|
29274
29301
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
29302
|
+
const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
|
|
29275
29303
|
const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
|
|
29276
29304
|
useEffect51(() => setIsSettings(!!session), [session, setIsSettings]);
|
|
29277
29305
|
usePageMapper();
|
|
@@ -29287,7 +29315,10 @@ function Dialog2() {
|
|
|
29287
29315
|
open: isDialogOpen,
|
|
29288
29316
|
onOpenChange: (open) => {
|
|
29289
29317
|
if (isDialogForced) return;
|
|
29290
|
-
if (!open)
|
|
29318
|
+
if (!open) {
|
|
29319
|
+
setPostAuthNavigation(null);
|
|
29320
|
+
setPage(null);
|
|
29321
|
+
}
|
|
29291
29322
|
},
|
|
29292
29323
|
children: /* @__PURE__ */ jsxs116(
|
|
29293
29324
|
DialogContent,
|