@embarkai/ui-kit 0.2.6 → 0.2.7
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 +3 -2
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +25 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -663,6 +663,12 @@ declare class IframeManager {
|
|
|
663
663
|
* Setup visibility change handler to check channel when tab becomes visible
|
|
664
664
|
*/
|
|
665
665
|
private setupVisibilityHandler;
|
|
666
|
+
/**
|
|
667
|
+
* Normalize legacy message types from cached iframe versions.
|
|
668
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
669
|
+
* This ensures both work until all browser caches expire.
|
|
670
|
+
*/
|
|
671
|
+
private normalizeMessageType;
|
|
666
672
|
/**
|
|
667
673
|
* Handle incoming postMessage events
|
|
668
674
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -663,6 +663,12 @@ declare class IframeManager {
|
|
|
663
663
|
* Setup visibility change handler to check channel when tab becomes visible
|
|
664
664
|
*/
|
|
665
665
|
private setupVisibilityHandler;
|
|
666
|
+
/**
|
|
667
|
+
* Normalize legacy message types from cached iframe versions.
|
|
668
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
669
|
+
* This ensures both work until all browser caches expire.
|
|
670
|
+
*/
|
|
671
|
+
private normalizeMessageType;
|
|
666
672
|
/**
|
|
667
673
|
* Handle incoming postMessage events
|
|
668
674
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2713,12 +2713,13 @@ function useListenIframeAuthEvents() {
|
|
|
2713
2713
|
const setIsIframeReady = useSession((state) => state.setIsIframeReady);
|
|
2714
2714
|
const handleIframeMessage = useCallback4(
|
|
2715
2715
|
(event) => {
|
|
2716
|
-
|
|
2716
|
+
const type = event.data?.type?.startsWith?.("LUMIA_PASSPORT_") ? event.data.type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_") : event.data?.type;
|
|
2717
|
+
if (type === "IFRAME_MSG_IFRAME_READY") {
|
|
2717
2718
|
console.log("[ IFRAME MESSAGE CACTHED ] Iframe is ready");
|
|
2718
2719
|
setIsIframeReady(true);
|
|
2719
|
-
} else if (
|
|
2720
|
+
} else if (type === "IFRAME_MSG_SHOW_IFRAME") {
|
|
2720
2721
|
console.log("[ IFRAME MESSAGE CACTHED ] Consent screen shown - hiding auth modal");
|
|
2721
|
-
} else if (
|
|
2722
|
+
} else if (type === "IFRAME_MSG_HIDE_IFRAME") {
|
|
2722
2723
|
console.log("[ IFRAME MESSAGE CACTHED ] Consent screen hidden");
|
|
2723
2724
|
} else if (event.data?.type === "KEYSHARE_RECOVERY_NEEDED") {
|
|
2724
2725
|
console.log("[ IFRAME MESSAGE CACTHED] recovery neede");
|
|
@@ -10524,6 +10525,12 @@ var init_useLinkTelegram = __esm({
|
|
|
10524
10525
|
// src/internal/components/ManageWalletMenu/ProviderCard.tsx
|
|
10525
10526
|
import { CheckCircle, Clock, Trash2 } from "lucide-react";
|
|
10526
10527
|
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10528
|
+
function formatExternalId(provider, externalId) {
|
|
10529
|
+
if (provider === "wallet" && externalId.startsWith("0x") && externalId.length >= 14) {
|
|
10530
|
+
return `${externalId.slice(0, 10)}...${externalId.slice(-4)}`;
|
|
10531
|
+
}
|
|
10532
|
+
return externalId;
|
|
10533
|
+
}
|
|
10527
10534
|
function ProviderCard(props) {
|
|
10528
10535
|
const { t } = useT();
|
|
10529
10536
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -10550,7 +10557,8 @@ function ProviderCard(props) {
|
|
|
10550
10557
|
{
|
|
10551
10558
|
style: { maxWidth: 184 },
|
|
10552
10559
|
className: "block w-full font-bold text-xs whitespace-nowrap text-ellipsis overflow-hidden",
|
|
10553
|
-
|
|
10560
|
+
title: props.externalId,
|
|
10561
|
+
children: formatExternalId(props.provider, props.externalId)
|
|
10554
10562
|
}
|
|
10555
10563
|
)
|
|
10556
10564
|
] }),
|
|
@@ -15471,7 +15479,7 @@ var init_package = __esm({
|
|
|
15471
15479
|
"package.json"() {
|
|
15472
15480
|
package_default = {
|
|
15473
15481
|
name: "@embarkai/ui-kit",
|
|
15474
|
-
version: "0.2.
|
|
15482
|
+
version: "0.2.7",
|
|
15475
15483
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
15476
15484
|
type: "module",
|
|
15477
15485
|
main: "./dist/index.cjs",
|
|
@@ -17905,6 +17913,17 @@ var init_iframe_manager = __esm({
|
|
|
17905
17913
|
});
|
|
17906
17914
|
this.log("[IframeManager] Visibility handler setup");
|
|
17907
17915
|
}
|
|
17916
|
+
/**
|
|
17917
|
+
* Normalize legacy message types from cached iframe versions.
|
|
17918
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
17919
|
+
* This ensures both work until all browser caches expire.
|
|
17920
|
+
*/
|
|
17921
|
+
normalizeMessageType(type) {
|
|
17922
|
+
if (type.startsWith("LUMIA_PASSPORT_")) {
|
|
17923
|
+
return type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_");
|
|
17924
|
+
}
|
|
17925
|
+
return type;
|
|
17926
|
+
}
|
|
17908
17927
|
/**
|
|
17909
17928
|
* Handle incoming postMessage events
|
|
17910
17929
|
*/
|
|
@@ -17913,6 +17932,7 @@ var init_iframe_manager = __esm({
|
|
|
17913
17932
|
if (!message || typeof message !== "object" || !message.type) {
|
|
17914
17933
|
return;
|
|
17915
17934
|
}
|
|
17935
|
+
message.type = this.normalizeMessageType(message.type);
|
|
17916
17936
|
const validIframeTypes = [
|
|
17917
17937
|
"IFRAME_MSG_IFRAME_READY",
|
|
17918
17938
|
"IFRAME_MSG_WALLET_READY",
|