@tomo-inc/embedded-wallet-providers 0.0.18 → 0.0.20

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
@@ -267,7 +267,6 @@ var EmbeddedWallet = class _EmbeddedWallet {
267
267
  this.loginByX = loginByX;
268
268
  const { isAvailable, message, connectedInfo } = await this.login();
269
269
  this.isAvailable = isAvailable;
270
- console.log("embedded-wallet-providers connectedInfo::", connectedInfo);
271
270
  const { connected, address = [] } = (connectedInfo == null ? void 0 : connectedInfo.evmProvider) || {};
272
271
  if (connected && address.length > 0) {
273
272
  const evmConnector = this.connectors[walletUtils.ChainTypeEnum.EVM];
@@ -296,8 +295,9 @@ var EmbeddedWallet = class _EmbeddedWallet {
296
295
  let walletIframe = document.getElementById(EMBEDDED_WALLET_ID);
297
296
  if (!walletIframe) {
298
297
  walletIframe = document.createElement("iframe");
299
- walletIframe.style.cssText = ` width: 0; height: 0;`;
298
+ walletIframe.style.cssText = `width: 0; height: 0; background: transparent; background-color: transparent; border: none;`;
300
299
  walletIframe.id = EMBEDDED_WALLET_ID;
300
+ walletIframe.setAttribute("allowTransparency", "true");
301
301
  document.body.appendChild(walletIframe);
302
302
  }
303
303
  const searchParams = new URLSearchParams({
@@ -309,6 +309,7 @@ var EmbeddedWallet = class _EmbeddedWallet {
309
309
  name: name || ""
310
310
  });
311
311
  walletIframe.src = `${walletBaseUrl}#${searchParams.toString()}`;
312
+ walletIframe.setAttribute("allowTransparency", "true");
312
313
  walletIframe.allow = "publickey-credentials-get; publickey-credentials-create";
313
314
  this.walletIframe = walletIframe;
314
315
  } catch (error) {
@@ -347,9 +348,11 @@ var EmbeddedWallet = class _EmbeddedWallet {
347
348
  if (!this.walletIframe) {
348
349
  return;
349
350
  }
350
- const baseCssText = "position: fixed; top:0; left:0; border: none; width: 100%; height: 100%;";
351
+ const baseCssText = "position: fixed; top: 0; left: 0; border: none; width: 100%; height: 100%; background: transparent; background-color: transparent;";
351
352
  const maskZIndex = this.maskZIndex;
352
353
  this.walletIframe.style.cssText = `${baseCssText} z-index: ${maskZIndex};`;
354
+ this.walletIframe.setAttribute("allowTransparency", "true");
355
+ this.walletIframe.style.backgroundColor = "transparent";
353
356
  }
354
357
  close() {
355
358
  if (!this.walletIframe) {
package/dist/index.js CHANGED
@@ -265,7 +265,6 @@ var EmbeddedWallet = class _EmbeddedWallet {
265
265
  this.loginByX = loginByX;
266
266
  const { isAvailable, message, connectedInfo } = await this.login();
267
267
  this.isAvailable = isAvailable;
268
- console.log("embedded-wallet-providers connectedInfo::", connectedInfo);
269
268
  const { connected, address = [] } = (connectedInfo == null ? void 0 : connectedInfo.evmProvider) || {};
270
269
  if (connected && address.length > 0) {
271
270
  const evmConnector = this.connectors[ChainTypeEnum.EVM];
@@ -294,8 +293,9 @@ var EmbeddedWallet = class _EmbeddedWallet {
294
293
  let walletIframe = document.getElementById(EMBEDDED_WALLET_ID);
295
294
  if (!walletIframe) {
296
295
  walletIframe = document.createElement("iframe");
297
- walletIframe.style.cssText = ` width: 0; height: 0;`;
296
+ walletIframe.style.cssText = `width: 0; height: 0; background: transparent; background-color: transparent; border: none;`;
298
297
  walletIframe.id = EMBEDDED_WALLET_ID;
298
+ walletIframe.setAttribute("allowTransparency", "true");
299
299
  document.body.appendChild(walletIframe);
300
300
  }
301
301
  const searchParams = new URLSearchParams({
@@ -307,6 +307,7 @@ var EmbeddedWallet = class _EmbeddedWallet {
307
307
  name: name || ""
308
308
  });
309
309
  walletIframe.src = `${walletBaseUrl}#${searchParams.toString()}`;
310
+ walletIframe.setAttribute("allowTransparency", "true");
310
311
  walletIframe.allow = "publickey-credentials-get; publickey-credentials-create";
311
312
  this.walletIframe = walletIframe;
312
313
  } catch (error) {
@@ -345,9 +346,11 @@ var EmbeddedWallet = class _EmbeddedWallet {
345
346
  if (!this.walletIframe) {
346
347
  return;
347
348
  }
348
- const baseCssText = "position: fixed; top:0; left:0; border: none; width: 100%; height: 100%;";
349
+ const baseCssText = "position: fixed; top: 0; left: 0; border: none; width: 100%; height: 100%; background: transparent; background-color: transparent;";
349
350
  const maskZIndex = this.maskZIndex;
350
351
  this.walletIframe.style.cssText = `${baseCssText} z-index: ${maskZIndex};`;
352
+ this.walletIframe.setAttribute("allowTransparency", "true");
353
+ this.walletIframe.style.backgroundColor = "transparent";
351
354
  }
352
355
  close() {
353
356
  if (!this.walletIframe) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomo-inc/embedded-wallet-providers",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "author": "tomo.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -43,7 +43,7 @@ export class EmbeddedWallet {
43
43
  public loginByGoogle: (() => Promise<string>) | null = null;
44
44
  public loginByX: (() => Promise<string>) | null = null;
45
45
  public loginStatusCallback: (({ type }: { type: string }) => void) | null = null;
46
- public constructor() {}
46
+ public constructor() { }
47
47
 
48
48
  public static getInstance() {
49
49
  if (!EmbeddedWallet.instance) {
@@ -127,7 +127,7 @@ export class EmbeddedWallet {
127
127
  const { isAvailable, message, connectedInfo } = await this.login();
128
128
  this.isAvailable = isAvailable;
129
129
 
130
- console.log("embedded-wallet-providers connectedInfo::", connectedInfo);
130
+ // console.log("embedded-wallet-providers connectedInfo::", connectedInfo);
131
131
 
132
132
  const { connected, address = [] } = connectedInfo?.evmProvider || {};
133
133
  if (connected && address.length > 0) {
@@ -162,8 +162,9 @@ export class EmbeddedWallet {
162
162
  let walletIframe = document.getElementById(EMBEDDED_WALLET_ID) as HTMLIFrameElement | null;
163
163
  if (!walletIframe) {
164
164
  walletIframe = document.createElement("iframe");
165
- walletIframe.style.cssText = ` width: 0; height: 0;`;
165
+ walletIframe.style.cssText = `width: 0; height: 0; background: transparent; background-color: transparent; border: none;`;
166
166
  walletIframe.id = EMBEDDED_WALLET_ID;
167
+ walletIframe.setAttribute("allowTransparency", "true");
167
168
  document.body.appendChild(walletIframe);
168
169
  }
169
170
  const searchParams = new URLSearchParams({
@@ -175,6 +176,7 @@ export class EmbeddedWallet {
175
176
  name: name || "",
176
177
  });
177
178
  walletIframe.src = `${walletBaseUrl}#${searchParams.toString()}`;
179
+ walletIframe.setAttribute("allowTransparency", "true");
178
180
  walletIframe.allow = "publickey-credentials-get; publickey-credentials-create";
179
181
  this.walletIframe = walletIframe;
180
182
  } catch (error) {
@@ -188,7 +190,6 @@ export class EmbeddedWallet {
188
190
  this.isAvailable = data?.data?.isAvailable || false;
189
191
  // Apply persisted theme after wallet is ready
190
192
  if (this.themeConfig) {
191
- // Apply persisted theme asynchronously
192
193
  setTimeout(() => {
193
194
  this.request("theme-change", this.themeConfig);
194
195
  }, 0);
@@ -225,9 +226,11 @@ export class EmbeddedWallet {
225
226
  if (!this.walletIframe) {
226
227
  return;
227
228
  }
228
- const baseCssText = "position: fixed; top:0; left:0; border: none; width: 100%; height: 100%;";
229
+ const baseCssText = "position: fixed; top: 0; left: 0; border: none; width: 100%; height: 100%; background: transparent; background-color: transparent;";
229
230
  const maskZIndex = this.maskZIndex;
230
231
  this.walletIframe.style.cssText = `${baseCssText} z-index: ${maskZIndex};`;
232
+ this.walletIframe.setAttribute("allowTransparency", "true");
233
+ this.walletIframe.style.backgroundColor = "transparent";
231
234
  }
232
235
 
233
236
  public close() {