@embarkai/ui-kit 0.4.86 → 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.
@@ -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.86</title>
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>
@@ -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.86";
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
@@ -88,11 +88,6 @@ __export(initial_exports, {
88
88
  function getServiceUrls() {
89
89
  const config = DEFAULT_PROVIDER_CONFIG;
90
90
  const globalOverride = typeof window !== "undefined" && window.__EMBARK_SERVICES__ || {};
91
- const searchParams = typeof window !== "undefined" ? new URLSearchParams(window.location.search) : void 0;
92
- const paramAssetApi = searchParams?.get("assetApiUrl") || void 0;
93
- const paramTss = searchParams?.get("tssUrl") || void 0;
94
- const paramVault = searchParams?.get("shareVaultUrl") || void 0;
95
- const paramDashboard = searchParams?.get("dashboardApiUrl") || void 0;
96
91
  const buildAssetApi = "https://api.embarkai.io/on-ramp/api";
97
92
  const buildTss = "https://api.embarkai.io/tss";
98
93
  const buildVault = "https://api.embarkai.io/vault";
@@ -101,10 +96,14 @@ function getServiceUrls() {
101
96
  const defaultTss = "/tss";
102
97
  const defaultVault = "/vault";
103
98
  const result = {
104
- assetApiUrl: paramAssetApi || globalOverride.assetApiUrl || buildAssetApi || config.services.assetApiUrl,
105
- tssUrl: paramTss || globalOverride.tssUrl || buildTss || config.services.tssUrl || defaultTss,
106
- shareVaultUrl: paramVault || globalOverride.shareVaultUrl || buildVault || config.services.shareVaultUrl || defaultVault,
107
- dashboardApiUrl: paramDashboard || globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.embarkai.io/api",
99
+ assetApiUrl: globalOverride.assetApiUrl || buildAssetApi || config.services.assetApiUrl,
100
+ // paramAssetApi ||
101
+ tssUrl: globalOverride.tssUrl || buildTss || config.services.tssUrl || defaultTss,
102
+ //paramTss ||
103
+ shareVaultUrl: globalOverride.shareVaultUrl || buildVault || config.services.shareVaultUrl || defaultVault,
104
+ // paramVault ||
105
+ dashboardApiUrl: globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.embarkai.io/api",
106
+ // paramDashboard ||
108
107
  tssRequireWasm: globalOverride.tssRequireWasm ?? buildRequireWasm ?? config.services.tssRequireWasm ?? false,
109
108
  tssWasmDebug: globalOverride.tssWasmDebug ?? buildWasmDebug ?? config.services.tssWasmDebug ?? false
110
109
  };
@@ -112,8 +111,9 @@ function getServiceUrls() {
112
111
  }
113
112
  function getIframeUrl() {
114
113
  const config = DEFAULT_PROVIDER_CONFIG;
114
+ const globalServiceOverride = typeof window !== "undefined" && window.__EMBARK_SERVICES__ || {};
115
115
  const buildIframeUrl = "https://auth.embarkai.io";
116
- const iframeUrl = buildIframeUrl || config.services.iframeUrl || "https://auth.embarkai.io";
116
+ const iframeUrl = globalServiceOverride.iframeUrl || buildIframeUrl || config.services.iframeUrl || "https://auth.embarkai.io";
117
117
  return iframeUrl;
118
118
  }
119
119
  function getBlockscoutApiUrl(chainConfig) {
@@ -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) return setPage("auth" /* AUTH */);
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().setPage(null);
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
- setPage(null);
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.86",
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) setPage(null);
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.d.cts CHANGED
@@ -150,6 +150,7 @@ declare global {
150
150
  __EMBARK_SERVICES__?: Partial<{
151
151
  assetApiUrl: string;
152
152
  tssUrl: string;
153
+ iframeUrl: string;
153
154
  shareVaultUrl: string;
154
155
  dashboardApiUrl: string;
155
156
  tssRequireWasm: boolean;
package/dist/index.d.ts CHANGED
@@ -150,6 +150,7 @@ declare global {
150
150
  __EMBARK_SERVICES__?: Partial<{
151
151
  assetApiUrl: string;
152
152
  tssUrl: string;
153
+ iframeUrl: string;
153
154
  shareVaultUrl: string;
154
155
  dashboardApiUrl: string;
155
156
  tssRequireWasm: boolean;
package/dist/index.js CHANGED
@@ -79,11 +79,6 @@ import { LUMIA_MAINNET } from "@embarkai/core/read";
79
79
  function getServiceUrls() {
80
80
  const config = DEFAULT_PROVIDER_CONFIG;
81
81
  const globalOverride = typeof window !== "undefined" && window.__EMBARK_SERVICES__ || {};
82
- const searchParams = typeof window !== "undefined" ? new URLSearchParams(window.location.search) : void 0;
83
- const paramAssetApi = searchParams?.get("assetApiUrl") || void 0;
84
- const paramTss = searchParams?.get("tssUrl") || void 0;
85
- const paramVault = searchParams?.get("shareVaultUrl") || void 0;
86
- const paramDashboard = searchParams?.get("dashboardApiUrl") || void 0;
87
82
  const buildAssetApi = "https://api.embarkai.io/on-ramp/api";
88
83
  const buildTss = "https://api.embarkai.io/tss";
89
84
  const buildVault = "https://api.embarkai.io/vault";
@@ -92,10 +87,14 @@ function getServiceUrls() {
92
87
  const defaultTss = "/tss";
93
88
  const defaultVault = "/vault";
94
89
  const result = {
95
- assetApiUrl: paramAssetApi || globalOverride.assetApiUrl || buildAssetApi || config.services.assetApiUrl,
96
- tssUrl: paramTss || globalOverride.tssUrl || buildTss || config.services.tssUrl || defaultTss,
97
- shareVaultUrl: paramVault || globalOverride.shareVaultUrl || buildVault || config.services.shareVaultUrl || defaultVault,
98
- dashboardApiUrl: paramDashboard || globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.embarkai.io/api",
90
+ assetApiUrl: globalOverride.assetApiUrl || buildAssetApi || config.services.assetApiUrl,
91
+ // paramAssetApi ||
92
+ tssUrl: globalOverride.tssUrl || buildTss || config.services.tssUrl || defaultTss,
93
+ //paramTss ||
94
+ shareVaultUrl: globalOverride.shareVaultUrl || buildVault || config.services.shareVaultUrl || defaultVault,
95
+ // paramVault ||
96
+ dashboardApiUrl: globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.embarkai.io/api",
97
+ // paramDashboard ||
99
98
  tssRequireWasm: globalOverride.tssRequireWasm ?? buildRequireWasm ?? config.services.tssRequireWasm ?? false,
100
99
  tssWasmDebug: globalOverride.tssWasmDebug ?? buildWasmDebug ?? config.services.tssWasmDebug ?? false
101
100
  };
@@ -103,8 +102,9 @@ function getServiceUrls() {
103
102
  }
104
103
  function getIframeUrl() {
105
104
  const config = DEFAULT_PROVIDER_CONFIG;
105
+ const globalServiceOverride = typeof window !== "undefined" && window.__EMBARK_SERVICES__ || {};
106
106
  const buildIframeUrl = "https://auth.embarkai.io";
107
- const iframeUrl = buildIframeUrl || config.services.iframeUrl || "https://auth.embarkai.io";
107
+ const iframeUrl = globalServiceOverride.iframeUrl || buildIframeUrl || config.services.iframeUrl || "https://auth.embarkai.io";
108
108
  return iframeUrl;
109
109
  }
110
110
  function getBlockscoutApiUrl(chainConfig) {
@@ -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) return setPage("auth" /* AUTH */);
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().setPage(null);
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
- setPage(null);
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.86",
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) setPage(null);
29318
+ if (!open) {
29319
+ setPostAuthNavigation(null);
29320
+ setPage(null);
29321
+ }
29291
29322
  },
29292
29323
  children: /* @__PURE__ */ jsxs116(
29293
29324
  DialogContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.86",
3
+ "version": "0.4.88",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,7 +50,7 @@
50
50
  "viem": "^2.52.2",
51
51
  "wagmi": "^3.7.5",
52
52
  "zustand": "^5.0.14",
53
- "@embarkai/core": "0.4.13"
53
+ "@embarkai/core": "0.4.14"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@svgr/core": "^8.1.0",