@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/index.cjs CHANGED
@@ -2719,12 +2719,13 @@ function useListenIframeAuthEvents() {
2719
2719
  const setIsIframeReady = useSession((state) => state.setIsIframeReady);
2720
2720
  const handleIframeMessage = (0, import_react6.useCallback)(
2721
2721
  (event) => {
2722
- if (event.data?.type === "IFRAME_MSG_IFRAME_READY") {
2722
+ const type = event.data?.type?.startsWith?.("LUMIA_PASSPORT_") ? event.data.type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_") : event.data?.type;
2723
+ if (type === "IFRAME_MSG_IFRAME_READY") {
2723
2724
  console.log("[ IFRAME MESSAGE CACTHED ] Iframe is ready");
2724
2725
  setIsIframeReady(true);
2725
- } else if (event.data?.type === "IFRAME_MSG_SHOW_IFRAME") {
2726
+ } else if (type === "IFRAME_MSG_SHOW_IFRAME") {
2726
2727
  console.log("[ IFRAME MESSAGE CACTHED ] Consent screen shown - hiding auth modal");
2727
- } else if (event.data?.type === "IFRAME_MSG_HIDE_IFRAME") {
2728
+ } else if (type === "IFRAME_MSG_HIDE_IFRAME") {
2728
2729
  console.log("[ IFRAME MESSAGE CACTHED ] Consent screen hidden");
2729
2730
  } else if (event.data?.type === "KEYSHARE_RECOVERY_NEEDED") {
2730
2731
  console.log("[ IFRAME MESSAGE CACTHED] recovery neede");
@@ -10575,6 +10576,12 @@ var init_useLinkTelegram = __esm({
10575
10576
  });
10576
10577
 
10577
10578
  // src/internal/components/ManageWalletMenu/ProviderCard.tsx
10579
+ function formatExternalId(provider, externalId) {
10580
+ if (provider === "wallet" && externalId.startsWith("0x") && externalId.length >= 14) {
10581
+ return `${externalId.slice(0, 10)}...${externalId.slice(-4)}`;
10582
+ }
10583
+ return externalId;
10584
+ }
10578
10585
  function ProviderCard(props) {
10579
10586
  const { t } = useT();
10580
10587
  const setPage = useLayoutDataStore((st) => st.setPage);
@@ -10601,7 +10608,8 @@ function ProviderCard(props) {
10601
10608
  {
10602
10609
  style: { maxWidth: 184 },
10603
10610
  className: "block w-full font-bold text-xs whitespace-nowrap text-ellipsis overflow-hidden",
10604
- children: props.externalId
10611
+ title: props.externalId,
10612
+ children: formatExternalId(props.provider, props.externalId)
10605
10613
  }
10606
10614
  )
10607
10615
  ] }),
@@ -15545,7 +15553,7 @@ var init_package = __esm({
15545
15553
  "package.json"() {
15546
15554
  package_default = {
15547
15555
  name: "@embarkai/ui-kit",
15548
- version: "0.2.6",
15556
+ version: "0.2.7",
15549
15557
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
15550
15558
  type: "module",
15551
15559
  main: "./dist/index.cjs",
@@ -17964,6 +17972,17 @@ var init_iframe_manager = __esm({
17964
17972
  });
17965
17973
  this.log("[IframeManager] Visibility handler setup");
17966
17974
  }
17975
+ /**
17976
+ * Normalize legacy message types from cached iframe versions.
17977
+ * Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
17978
+ * This ensures both work until all browser caches expire.
17979
+ */
17980
+ normalizeMessageType(type) {
17981
+ if (type.startsWith("LUMIA_PASSPORT_")) {
17982
+ return type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_");
17983
+ }
17984
+ return type;
17985
+ }
17967
17986
  /**
17968
17987
  * Handle incoming postMessage events
17969
17988
  */
@@ -17972,6 +17991,7 @@ var init_iframe_manager = __esm({
17972
17991
  if (!message || typeof message !== "object" || !message.type) {
17973
17992
  return;
17974
17993
  }
17994
+ message.type = this.normalizeMessageType(message.type);
17975
17995
  const validIframeTypes = [
17976
17996
  "IFRAME_MSG_IFRAME_READY",
17977
17997
  "IFRAME_MSG_WALLET_READY",