@meshconnect/web-link-sdk 3.2.16 → 3.3.1

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/Link.js CHANGED
@@ -50,10 +50,12 @@ import { isLinkEventTypeKey } from './utils/event-types';
50
50
  import { isWalletBrowserEventTypeKey } from './utils/wallet-browser-event-types';
51
51
  import { sdkSpecs } from './utils/sdk-specs';
52
52
  import { WalletStrategyFactory } from './utils/wallet';
53
+ import { BridgeParent } from '@meshconnect/uwc-bridge-parent';
53
54
  var currentOptions;
54
55
  var targetOrigin;
55
56
  var linkTokenOrigin;
56
57
  var currentIframeId = iframeId;
58
+ var bridgeParent = null;
57
59
  var iframeElement = function () {
58
60
  return document.getElementById(currentIframeId);
59
61
  };
@@ -117,6 +119,7 @@ function handleLinkEvent(event) {
117
119
  case 'done': {
118
120
  payload = (_g = event.data) === null || _g === void 0 ? void 0 : _g.payload;
119
121
  (_h = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onExit) === null || _h === void 0 ? void 0 : _h.call(currentOptions, payload === null || payload === void 0 ? void 0 : payload.errorMessage, payload);
122
+ bridgeParent === null || bridgeParent === void 0 ? void 0 : bridgeParent.destroy();
120
123
  removePopup();
121
124
  break;
122
125
  }
@@ -491,10 +494,10 @@ export var createLink = function (options) {
491
494
  linkTokenOrigin = new URL(linkUrl).origin;
492
495
  window.removeEventListener('message', eventsListener);
493
496
  if (customIframeId) {
494
- var iframe = document.getElementById(customIframeId);
495
- if (iframe) {
496
- iframe.allow = 'clipboard-read *; clipboard-write *';
497
- iframe.src = linkUrl;
497
+ var iframe_1 = document.getElementById(customIframeId);
498
+ if (iframe_1) {
499
+ iframe_1.allow = 'clipboard-read *; clipboard-write *';
500
+ iframe_1.src = linkUrl;
498
501
  currentIframeId = customIframeId;
499
502
  }
500
503
  else {
@@ -507,9 +510,14 @@ export var createLink = function (options) {
507
510
  }
508
511
  window.addEventListener('message', eventsListener);
509
512
  targetOrigin = window.location.origin;
513
+ var iframe = iframeElement();
514
+ if (iframe) {
515
+ bridgeParent = new BridgeParent(iframe);
516
+ }
510
517
  };
511
518
  var closeLink = function () {
512
519
  var _a;
520
+ bridgeParent === null || bridgeParent === void 0 ? void 0 : bridgeParent.destroy();
513
521
  removePopup();
514
522
  window.removeEventListener('message', eventsListener);
515
523
  (_a = options.onExit) === null || _a === void 0 ? void 0 : _a.call(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshconnect/web-link-sdk",
3
- "version": "3.2.16",
3
+ "version": "3.3.1",
4
4
  "description": "A client-side JS library for integrating with Mesh Connect",
5
5
  "exports": "./index.js",
6
6
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@meshconnect/node-api": "^2.0.23",
26
26
  "@meshconnect/solana-web3.js": "^1.0.4",
27
+ "@meshconnect/uwc-bridge-parent": "0.0.3",
27
28
  "bs58": "^5.0.0",
28
29
  "buffer": "^6.0.3",
29
30
  "ethers": "^6.11.1"
@@ -1 +1 @@
1
- export declare const sdkVersion = "3.2.16";
1
+ export declare const sdkVersion = "3.3.1";
package/utils/version.js CHANGED
@@ -1 +1 @@
1
- export var sdkVersion = '3.2.16';
1
+ export var sdkVersion = '3.3.1';