@multiversx/sdk-web-wallet-cross-window-provider 0.1.3 → 0.3.0-alpha.0
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/out/CrossWindowProvider/CrossWindowProvider.d.ts +11 -9
- package/out/CrossWindowProvider/CrossWindowProvider.js +48 -16
- package/out/CrossWindowProvider/CrossWindowProvider.js.map +1 -1
- package/out/CrossWindowProvider/PopupConsent/PopupConsent.d.ts +8 -11
- package/out/CrossWindowProvider/PopupConsent/PopupConsent.js +52 -76
- package/out/CrossWindowProvider/PopupConsent/PopupConsent.js.map +1 -1
- package/out/CrossWindowProvider/PopupConsent/constants.d.ts +1 -0
- package/out/CrossWindowProvider/PopupConsent/constants.js +5 -0
- package/out/CrossWindowProvider/PopupConsent/constants.js.map +1 -0
- package/out/CrossWindowProvider/PopupConsent/getStyles.js +13 -14
- package/out/CrossWindowProvider/PopupConsent/getStyles.js.map +1 -1
- package/out/CrossWindowProvider/tests/Cancel.test.js +6 -7
- package/out/CrossWindowProvider/tests/Cancel.test.js.map +1 -1
- package/out/CrossWindowProvider/tests/Init.test.js +0 -2
- package/out/CrossWindowProvider/tests/Init.test.js.map +1 -1
- package/out/CrossWindowProvider/tests/Login.test.js +1 -3
- package/out/CrossWindowProvider/tests/Login.test.js.map +1 -1
- package/out/CrossWindowProvider/tests/Logout.test.js +2 -4
- package/out/CrossWindowProvider/tests/Logout.test.js.map +1 -1
- package/out/CrossWindowProvider/tests/SignMessage.test.js +1 -3
- package/out/CrossWindowProvider/tests/SignMessage.test.js.map +1 -1
- package/out/CrossWindowProvider/tests/SignTransaction.test.js +1 -3
- package/out/CrossWindowProvider/tests/SignTransaction.test.js.map +1 -1
- package/out/IFrameManager/IFrameProviderContentWindow.d.ts +27 -0
- package/out/IFrameManager/IFrameProviderContentWindow.js +150 -0
- package/out/IFrameManager/IFrameProviderContentWindow.js.map +1 -0
- package/out/IFrameManager/IframeManager.d.ts +18 -0
- package/out/IFrameManager/IframeManager.js +98 -0
- package/out/IFrameManager/IframeManager.js.map +1 -0
- package/out/IFrameManager/iframeManager.styles.d.ts +6 -0
- package/out/IFrameManager/iframeManager.styles.js +78 -0
- package/out/IFrameManager/iframeManager.styles.js.map +1 -0
- package/out/IFrameProvider/IframeProvider.d.ts +11 -0
- package/out/IFrameProvider/IframeProvider.js +70 -0
- package/out/IFrameProvider/IframeProvider.js.map +1 -0
- package/out/WindowManager/WindowManager.d.ts +3 -3
- package/out/WindowManager/WindowManager.js +29 -22
- package/out/WindowManager/WindowManager.js.map +1 -1
- package/out/WindowManager/tests/windowManager.test.js +11 -12
- package/out/WindowManager/tests/windowManager.test.js.map +1 -1
- package/out/constants/index.d.ts +2 -0
- package/out/constants/index.js +6 -0
- package/out/constants/index.js.map +1 -0
- package/out/test-utils/index.d.ts +0 -1
- package/out/test-utils/index.js +0 -1
- package/out/test-utils/index.js.map +1 -1
- package/package.json +2 -3
- package/out/test-utils/mockWindowManager.d.ts +0 -2
- package/out/test-utils/mockWindowManager.js +0 -11
- package/out/test-utils/mockWindowManager.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SignableMessage, Transaction } from '@multiversx/sdk-core';
|
|
2
2
|
import { CrossWindowProviderRequestEnums } from '@multiversx/sdk-dapp-utils/out/enums/crossWindowProviderEnums';
|
|
3
|
-
|
|
3
|
+
import { WindowManager } from '../WindowManager';
|
|
4
|
+
export interface ICrossWindowWalletAccount {
|
|
4
5
|
address: string;
|
|
5
6
|
signature?: string;
|
|
6
7
|
multisig?: string;
|
|
@@ -8,18 +9,20 @@ interface ICrossWindowWalletAccount {
|
|
|
8
9
|
}
|
|
9
10
|
export declare class CrossWindowProvider {
|
|
10
11
|
account: ICrossWindowWalletAccount;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
protected initialized: boolean;
|
|
13
|
+
protected windowManager: WindowManager;
|
|
14
|
+
protected static _instance: CrossWindowProvider | null;
|
|
14
15
|
private accessToken;
|
|
15
16
|
protected _shouldShowConsentPopup: boolean;
|
|
16
|
-
|
|
17
|
+
constructor();
|
|
17
18
|
setShouldShowConsentPopup(shouldShow: boolean): void;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
protected ensureConnected(): void;
|
|
20
|
+
protected disconnect(): void;
|
|
20
21
|
static getInstance(): CrossWindowProvider;
|
|
22
|
+
getWindowManager(): WindowManager;
|
|
21
23
|
setAddress(address: string): CrossWindowProvider;
|
|
22
24
|
setWalletUrl(url: string): CrossWindowProvider;
|
|
25
|
+
setWalletWindow(): Promise<void>;
|
|
23
26
|
init(): Promise<boolean>;
|
|
24
27
|
login(options?: {
|
|
25
28
|
token?: string;
|
|
@@ -33,6 +36,5 @@ export declare class CrossWindowProvider {
|
|
|
33
36
|
guardTransactions(transactions: Transaction[]): Promise<Transaction[]>;
|
|
34
37
|
signMessage(message: SignableMessage): Promise<SignableMessage>;
|
|
35
38
|
cancelAction(): Promise<import("@multiversx/sdk-dapp-utils/out/types/crossWindowProviderTypes").PostMessageReturnType<CrossWindowProviderRequestEnums.cancelAction>> | undefined;
|
|
36
|
-
|
|
39
|
+
openPopupConsent(): Promise<boolean>;
|
|
37
40
|
}
|
|
38
|
-
export {};
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -11,22 +34,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
35
|
exports.CrossWindowProvider = void 0;
|
|
13
36
|
const sdk_core_1 = require("@multiversx/sdk-core");
|
|
14
|
-
const crossWindowProviderConstants_1 = require("@multiversx/sdk-dapp-utils/out/constants/crossWindowProviderConstants");
|
|
15
37
|
const crossWindowProviderEnums_1 = require("@multiversx/sdk-dapp-utils/out/enums/crossWindowProviderEnums");
|
|
38
|
+
const constants_1 = require("../constants");
|
|
16
39
|
const errors_1 = require("../errors");
|
|
17
40
|
const WindowManager_1 = require("../WindowManager");
|
|
18
|
-
const
|
|
41
|
+
const constants_2 = require("./PopupConsent/constants");
|
|
19
42
|
class CrossWindowProvider {
|
|
20
43
|
constructor() {
|
|
21
44
|
this.account = { address: '' };
|
|
22
45
|
this.initialized = false;
|
|
23
46
|
this.accessToken = undefined;
|
|
24
47
|
this._shouldShowConsentPopup = false;
|
|
25
|
-
|
|
26
|
-
throw new errors_1.ErrInstantiationFailed();
|
|
27
|
-
}
|
|
28
|
-
this.windowManager = WindowManager_1.WindowManager.getInstance();
|
|
29
|
-
CrossWindowProvider._instance = this;
|
|
48
|
+
this.windowManager = new WindowManager_1.WindowManager();
|
|
30
49
|
}
|
|
31
50
|
setShouldShowConsentPopup(shouldShow) {
|
|
32
51
|
this._shouldShowConsentPopup = shouldShow;
|
|
@@ -40,15 +59,28 @@ class CrossWindowProvider {
|
|
|
40
59
|
this.account = { address: '' };
|
|
41
60
|
}
|
|
42
61
|
static getInstance() {
|
|
62
|
+
if (!CrossWindowProvider._instance) {
|
|
63
|
+
CrossWindowProvider._instance = new CrossWindowProvider();
|
|
64
|
+
return CrossWindowProvider._instance;
|
|
65
|
+
}
|
|
43
66
|
return CrossWindowProvider._instance;
|
|
44
67
|
}
|
|
68
|
+
getWindowManager() {
|
|
69
|
+
return this.windowManager;
|
|
70
|
+
}
|
|
45
71
|
setAddress(address) {
|
|
72
|
+
if (!CrossWindowProvider._instance) {
|
|
73
|
+
throw new errors_1.ErrInstantiationFailed();
|
|
74
|
+
}
|
|
46
75
|
this.account.address = address;
|
|
47
76
|
return CrossWindowProvider._instance;
|
|
48
77
|
}
|
|
49
78
|
setWalletUrl(url) {
|
|
50
79
|
this.windowManager.setWalletUrl(url);
|
|
51
|
-
return
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
setWalletWindow() {
|
|
83
|
+
return this.windowManager.setWalletWindow();
|
|
52
84
|
}
|
|
53
85
|
init() {
|
|
54
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -223,25 +255,25 @@ class CrossWindowProvider {
|
|
|
223
255
|
openPopupConsent() {
|
|
224
256
|
var _a, _b, _c;
|
|
225
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
-
require('./PopupConsent');
|
|
227
|
-
const dialog = (_a =
|
|
228
|
-
const document =
|
|
258
|
+
yield Promise.resolve().then(() => __importStar(require('./PopupConsent/PopupConsent')));
|
|
259
|
+
const dialog = (_a = constants_1.safeWindow.document) === null || _a === void 0 ? void 0 : _a.createElement('div');
|
|
260
|
+
const document = constants_1.safeWindow.document;
|
|
229
261
|
if (!this._shouldShowConsentPopup || !document || !dialog) {
|
|
230
262
|
return true;
|
|
231
263
|
}
|
|
232
|
-
const popup = (_b =
|
|
264
|
+
const popup = (_b = constants_1.safeWindow.document) === null || _b === void 0 ? void 0 : _b.createElement(constants_2.confirmationDialogTag);
|
|
233
265
|
popup.walletUrl = this.windowManager.walletUrl;
|
|
234
|
-
(_c =
|
|
266
|
+
(_c = constants_1.safeWindow.document) === null || _c === void 0 ? void 0 : _c.body.appendChild(popup);
|
|
235
267
|
const popupConsentResponse = yield new Promise((resolve) => {
|
|
236
268
|
popup.onConfirm = () => {
|
|
237
269
|
var _a;
|
|
238
270
|
resolve(true);
|
|
239
|
-
(_a =
|
|
271
|
+
(_a = constants_1.safeWindow.document) === null || _a === void 0 ? void 0 : _a.body.removeChild(popup);
|
|
240
272
|
};
|
|
241
273
|
popup.onCancel = () => {
|
|
242
274
|
var _a;
|
|
243
275
|
resolve(false);
|
|
244
|
-
(_a =
|
|
276
|
+
(_a = constants_1.safeWindow.document) === null || _a === void 0 ? void 0 : _a.body.removeChild(popup);
|
|
245
277
|
};
|
|
246
278
|
});
|
|
247
279
|
this._shouldShowConsentPopup = false;
|
|
@@ -249,6 +281,6 @@ class CrossWindowProvider {
|
|
|
249
281
|
});
|
|
250
282
|
}
|
|
251
283
|
}
|
|
252
|
-
CrossWindowProvider._instance =
|
|
284
|
+
CrossWindowProvider._instance = null;
|
|
253
285
|
exports.CrossWindowProvider = CrossWindowProvider;
|
|
254
286
|
//# sourceMappingURL=CrossWindowProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossWindowProvider.js","sourceRoot":"","sources":["../../src/CrossWindowProvider/CrossWindowProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CrossWindowProvider.js","sourceRoot":"","sources":["../../src/CrossWindowProvider/Cross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AAG,sBAAU,CAAC,QAAQ,CAAC;YAErC,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE;gBACzD,OAAO,IAAI,CAAC;aACb;YAED,MAAM,KAAK,GAAG,MAAA,sBAAU,CAAC,QAAQ,0CAAE,aAAa,CAC9C,iCAAqB,CACN,CAAC;YAElB,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;YAE/C,MAAA,sBAAU,CAAC,QAAQ,0CAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAE7C,MAAM,oBAAoB,GAAY,MAAM,IAAI,OAAO,CACrD,CAAC,OAAO,EAAE,EAAE;gBACV,KAAK,CAAC,SAAS,GAAG,GAAG,EAAE;;oBACrB,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,MAAA,sBAAU,CAAC,QAAQ,0CAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;gBAC/C,CAAC,CAAC;gBACF,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;;oBACpB,OAAO,CAAC,KAAK,CAAC,CAAC;oBACf,MAAA,sBAAU,CAAC,QAAQ,0CAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;gBAC/C,CAAC,CAAC;YACJ,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC;YACrC,OAAO,oBAAoB,CAAC;;KAC7B;;AA/SgB,6BAAS,GAA+B,IAAI,AAAnC,CAAoC;AAJnD,kDAAmB"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const confirmationDialogTag = "mxcwp-confirmation-dialog";
|
|
3
|
-
export declare class PopupConsent extends LitElement {
|
|
4
|
-
id: string;
|
|
1
|
+
export declare class PopupConsent extends HTMLElement {
|
|
5
2
|
walletUrl: string;
|
|
6
|
-
|
|
3
|
+
identifier: string;
|
|
7
4
|
onCancel: () => void;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
constructor();
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
8
8
|
events: {
|
|
9
9
|
confirm: string;
|
|
10
10
|
cancel: string;
|
|
11
11
|
mounted: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
dispatchAction
|
|
15
|
-
|
|
16
|
-
createRenderRoot(): this;
|
|
17
|
-
getTemplate: () => import("lit-html").TemplateResult<1>;
|
|
18
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
private handleConfirmEvent;
|
|
14
|
+
private dispatchAction;
|
|
15
|
+
render(): void;
|
|
19
16
|
toggleEvents(action: 'removeEventListener' | 'addEventListener'): void;
|
|
20
17
|
connectedCallback(): void;
|
|
21
18
|
disconnectedCallback(): void;
|
|
@@ -1,32 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PopupConsent =
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const decorators_js_1 = require("lit/decorators.js");
|
|
3
|
+
exports.PopupConsent = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const constants_2 = require("./constants");
|
|
13
6
|
const getStyles_1 = require("./getStyles");
|
|
14
|
-
|
|
15
|
-
class PopupConsent extends lit_1.LitElement {
|
|
7
|
+
class PopupConsent extends HTMLElement {
|
|
16
8
|
constructor() {
|
|
17
|
-
super(
|
|
18
|
-
this.id = exports.confirmationDialogTag;
|
|
9
|
+
super();
|
|
19
10
|
this.walletUrl = '';
|
|
20
|
-
this.
|
|
21
|
-
console.log('onConfirm');
|
|
22
|
-
};
|
|
11
|
+
this.identifier = constants_2.confirmationDialogTag;
|
|
23
12
|
this.onCancel = () => {
|
|
24
13
|
console.log('onCancel');
|
|
25
14
|
};
|
|
15
|
+
this.onConfirm = () => {
|
|
16
|
+
console.log('onConfirm');
|
|
17
|
+
};
|
|
26
18
|
this.events = {
|
|
27
|
-
confirm: `${this.
|
|
28
|
-
cancel: `${this.
|
|
29
|
-
mounted: `${this.
|
|
19
|
+
confirm: `${this.identifier}-confirm`,
|
|
20
|
+
cancel: `${this.identifier}-cancel`,
|
|
21
|
+
mounted: `${this.identifier}-mounted`
|
|
30
22
|
};
|
|
31
23
|
this.dispatchAction = (type) => {
|
|
32
24
|
const event = new CustomEvent(type, {
|
|
@@ -35,38 +27,12 @@ class PopupConsent extends lit_1.LitElement {
|
|
|
35
27
|
});
|
|
36
28
|
this.dispatchEvent(event);
|
|
37
29
|
};
|
|
38
|
-
this.getTemplate = () => (0, lit_1.html) `<style>
|
|
39
|
-
${(0, getStyles_1.getStyles)(this.id)}
|
|
40
|
-
</style>
|
|
41
|
-
<div id="${this.id}">
|
|
42
|
-
<div class="content">
|
|
43
|
-
<div class="body">
|
|
44
|
-
<div class="title">Confirm on MultiversX Wallet</div>
|
|
45
|
-
<div class="subtitle">Continue to ${this.walletUrl}</div>
|
|
46
|
-
<div class="actions-container">
|
|
47
|
-
<button
|
|
48
|
-
@click="${() => this.dispatchAction(this.events.cancel)}"
|
|
49
|
-
class="button"
|
|
50
|
-
data-testid="${this.events.cancel}-btn"
|
|
51
|
-
id="${this.events.cancel}-btn"
|
|
52
|
-
>
|
|
53
|
-
Cancel
|
|
54
|
-
</button>
|
|
55
|
-
<button
|
|
56
|
-
@click="${() => this.dispatchAction(this.events.confirm)}"
|
|
57
|
-
class="button btn-proceed"
|
|
58
|
-
data-testid="${this.events.confirm}-btn"
|
|
59
|
-
id="${this.events.confirm}-btn"
|
|
60
|
-
>
|
|
61
|
-
Continue →
|
|
62
|
-
</button>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>`;
|
|
67
30
|
}
|
|
68
|
-
|
|
69
|
-
|
|
31
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
32
|
+
if (oldValue !== newValue) {
|
|
33
|
+
this[name.replace(/-./g, (x) => x[1].toUpperCase())] = newValue;
|
|
34
|
+
this.render();
|
|
35
|
+
}
|
|
70
36
|
}
|
|
71
37
|
handleConfirmEvent({ type }) {
|
|
72
38
|
switch (type) {
|
|
@@ -78,45 +44,55 @@ class PopupConsent extends lit_1.LitElement {
|
|
|
78
44
|
break;
|
|
79
45
|
}
|
|
80
46
|
}
|
|
81
|
-
// no shadow-root
|
|
82
|
-
createRenderRoot() {
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
47
|
render() {
|
|
86
|
-
|
|
48
|
+
this.innerHTML = `
|
|
49
|
+
<style>
|
|
50
|
+
${(0, getStyles_1.getStyles)(constants_2.confirmationDialogTag)}
|
|
51
|
+
</style>
|
|
52
|
+
<div id="${constants_2.confirmationDialogTag}">
|
|
53
|
+
<div class="content">
|
|
54
|
+
<div class="body">
|
|
55
|
+
<div class="title">Confirm on MultiversX Wallet</div>
|
|
56
|
+
<div class="subtitle">Continue to ${this.walletUrl}</div>
|
|
57
|
+
<div class="actions-container">
|
|
58
|
+
<button
|
|
59
|
+
class="button"
|
|
60
|
+
data-testid="${this.events.cancel}-btn"
|
|
61
|
+
id="${this.events.cancel}-btn"
|
|
62
|
+
>
|
|
63
|
+
Cancel
|
|
64
|
+
</button>
|
|
65
|
+
<button
|
|
66
|
+
class="button btn-proceed"
|
|
67
|
+
data-testid="${this.events.confirm}-btn"
|
|
68
|
+
id="${this.events.confirm}-btn"
|
|
69
|
+
>
|
|
70
|
+
Continue →
|
|
71
|
+
</button>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
87
77
|
}
|
|
88
78
|
toggleEvents(action) {
|
|
89
79
|
[this.events.cancel, this.events.confirm].forEach((event) => {
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = this.querySelector(`#${event}-btn`)) === null || _a === void 0 ? void 0 : _a[action]('click', () => this.dispatchAction(event));
|
|
90
82
|
this[action](event, this.handleConfirmEvent);
|
|
91
83
|
});
|
|
92
84
|
}
|
|
93
85
|
connectedCallback() {
|
|
94
|
-
|
|
86
|
+
this.render();
|
|
95
87
|
this.toggleEvents('addEventListener');
|
|
96
88
|
}
|
|
97
89
|
disconnectedCallback() {
|
|
98
|
-
super.disconnectedCallback();
|
|
99
90
|
this.toggleEvents('removeEventListener');
|
|
100
91
|
}
|
|
101
92
|
}
|
|
102
|
-
__decorate([
|
|
103
|
-
(0, decorators_js_1.property)({ type: String })
|
|
104
|
-
], PopupConsent.prototype, "id", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
(0, decorators_js_1.property)({ type: String })
|
|
107
|
-
], PopupConsent.prototype, "walletUrl", void 0);
|
|
108
|
-
__decorate([
|
|
109
|
-
(0, decorators_js_1.property)({ type: Function })
|
|
110
|
-
], PopupConsent.prototype, "onConfirm", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
(0, decorators_js_1.property)({ type: Function })
|
|
113
|
-
], PopupConsent.prototype, "onCancel", void 0);
|
|
114
|
-
__decorate([
|
|
115
|
-
(0, decorators_js_1.property)({ type: Function })
|
|
116
|
-
], PopupConsent.prototype, "getTemplate", void 0);
|
|
117
93
|
exports.PopupConsent = PopupConsent;
|
|
118
|
-
const customElements =
|
|
119
|
-
if (customElements && !customElements.get(
|
|
120
|
-
customElements.define(
|
|
94
|
+
const customElements = constants_1.safeWindow.customElements;
|
|
95
|
+
if (customElements && !customElements.get(constants_2.confirmationDialogTag)) {
|
|
96
|
+
customElements.define(constants_2.confirmationDialogTag, PopupConsent);
|
|
121
97
|
}
|
|
122
98
|
//# sourceMappingURL=PopupConsent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupConsent.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/PopupConsent/PopupConsent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PopupConsent.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/PopupConsent/PopupConsent.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAC7C,2CAAoD;AACpD,2CAAwC;AAExC,MAAa,YAAa,SAAQ,WAAW;IAU3C;QACE,KAAK,EAAE,CAAC;QAVH,cAAS,GAAG,EAAE,CAAC;QACf,eAAU,GAAW,iCAAqB,CAAC;QAC3C,aAAQ,GAAG,GAAG,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC,CAAC;QACK,cAAS,GAAG,GAAG,EAAE;YACtB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC,CAAC;QAaK,WAAM,GAAG;YACd,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU;YACrC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,SAAS;YACnC,OAAO,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU;SACtC,CAAC;QAaM,mBAAc,GAAG,CAAC,IAAY,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE;gBAClC,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI,CAAC,mDAAmD;aACnE,CAAC,CAAC;YACH,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAC;IAhCF,CAAC;IAED,wBAAwB,CAAC,IAAY,EAAE,QAAgB,EA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AAmC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC3C,CAAC;CACF;AA/FD,oCA+FC;AAED,MAAM,cAAc,GAAG,sBAAU,CAAC,cAAc,CAAC;AACjD,IAAI,cAAc,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iCAAqB,CAAC,EAAE;IAChE,cAAc,CAAC,MAAM,CAAC,iCAAqB,EAAE,YAAY,CAAC,CAAC;CAC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const confirmationDialogTag = "mxcwp-confirmation-dialog";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/PopupConsent/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,2BAA2B,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStyles = void 0;
|
|
4
|
-
const
|
|
5
|
-
const getStyles = (dialogId) => `#${(0, lit_1.unsafeCSS)(dialogId)} {
|
|
4
|
+
const getStyles = (dialogId) => `#${dialogId} {
|
|
6
5
|
position: fixed;
|
|
7
6
|
z-index: 9999;
|
|
8
7
|
padding-top: 100px;
|
|
@@ -17,14 +16,14 @@ const getStyles = (dialogId) => `#${(0, lit_1.unsafeCSS)(dialogId)} {
|
|
|
17
16
|
align-items: center;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
#${
|
|
19
|
+
#${dialogId}:modal {
|
|
21
20
|
max-width: 100vw;
|
|
22
21
|
width: 100vw;
|
|
23
22
|
max-height: 100vh;
|
|
24
23
|
height: 100vh;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
#${
|
|
26
|
+
#${dialogId} .content {
|
|
28
27
|
background: #fff;
|
|
29
28
|
border-radius: 20px;
|
|
30
29
|
z-index: 9999;
|
|
@@ -35,21 +34,21 @@ const getStyles = (dialogId) => `#${(0, lit_1.unsafeCSS)(dialogId)} {
|
|
|
35
34
|
width: 100%;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
#${
|
|
37
|
+
#${dialogId} .body {
|
|
39
38
|
padding: 50px 0;
|
|
40
39
|
color: #262525;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
#${
|
|
42
|
+
#${dialogId} .title {
|
|
44
43
|
text-align: center;
|
|
45
44
|
font-size: 1.5rem;
|
|
46
45
|
}
|
|
47
|
-
#${
|
|
46
|
+
#${dialogId} .subtitle {
|
|
48
47
|
margin-top: 10px;
|
|
49
48
|
text-align: center;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
#${
|
|
51
|
+
#${dialogId} .actions-container {
|
|
53
52
|
margin-top: 40px;
|
|
54
53
|
margin-bottom: 10px;
|
|
55
54
|
display: flex;
|
|
@@ -57,12 +56,12 @@ const getStyles = (dialogId) => `#${(0, lit_1.unsafeCSS)(dialogId)} {
|
|
|
57
56
|
gap: 20px;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
#${
|
|
59
|
+
#${dialogId} .button {
|
|
61
60
|
max-width: 200px;
|
|
62
61
|
margin-top: 10px;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
#${
|
|
64
|
+
#${dialogId} button {
|
|
66
65
|
border-radius: 8px;
|
|
67
66
|
border: 1px solid transparent;
|
|
68
67
|
padding: 0.6em 1.2em;
|
|
@@ -73,15 +72,15 @@ const getStyles = (dialogId) => `#${(0, lit_1.unsafeCSS)(dialogId)} {
|
|
|
73
72
|
cursor: pointer;
|
|
74
73
|
transition: border-color 0.25s;
|
|
75
74
|
}
|
|
76
|
-
#${
|
|
75
|
+
#${dialogId} button:hover {
|
|
77
76
|
border-color: #cacaca;
|
|
78
77
|
}
|
|
79
|
-
#${
|
|
80
|
-
#${
|
|
78
|
+
#${dialogId} button:focus,
|
|
79
|
+
#${dialogId} button:focus-visible {
|
|
81
80
|
outline: 4px auto -webkit-focus-ring-color;
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
#${
|
|
83
|
+
#${dialogId} .btn-proceed {
|
|
85
84
|
background-color: #262626;
|
|
86
85
|
color: #fff;
|
|
87
86
|
padding-left: 40px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/PopupConsent/getStyles.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/PopupConsent/getStyles.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,QAAQ;;;;;;;;;;;;;;;GAexD,QAAQ;;;;;;;GAOR,QAAQ;;;;;;;;;;;GAWR,QAAQ;;;;;GAKR,QAAQ;;;;GAIR,QAAQ;;;;;GAKR,QAAQ;;;;;;;;GAQR,QAAQ;;;;;GAKR,QAAQ;;;;;;;;;;;GAWR,QAAQ;;;GAGR,QAAQ;GACR,QAAQ;;;;GAIR,QAAQ;;;;;EAKT,CAAC;AApFU,QAAA,SAAS,aAoFnB"}
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const test_utils_1 = require("../../test-utils");
|
|
13
|
-
const WindowManager_1 = require("../../WindowManager/WindowManager");
|
|
14
13
|
const CrossWindowProvider_1 = require("../CrossWindowProvider");
|
|
15
14
|
describe('CrossWindowProvider Login', () => {
|
|
16
15
|
let crossWindowProvider;
|
|
@@ -18,20 +17,20 @@ describe('CrossWindowProvider Login', () => {
|
|
|
18
17
|
let windowOpenSpy;
|
|
19
18
|
beforeEach(() => {
|
|
20
19
|
walletWindowMock = (0, test_utils_1.getWalletWindowMock)();
|
|
21
|
-
|
|
20
|
+
CrossWindowProvider_1.CrossWindowProvider.getInstance().getWindowManager().postMessage = jest
|
|
22
21
|
.fn()
|
|
23
|
-
.mockImplementation(() =>
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
.mockImplementation(() => undefined);
|
|
23
|
+
CrossWindowProvider_1.CrossWindowProvider.getInstance().getWindowManager().isWalletOpened = jest
|
|
24
|
+
.fn()
|
|
25
|
+
.mockImplementation(() => true);
|
|
26
26
|
crossWindowProvider = CrossWindowProvider_1.CrossWindowProvider.getInstance();
|
|
27
|
-
(0, test_utils_1.mockWindoManager)();
|
|
28
27
|
windowOpenSpy = jest.spyOn(window, 'open');
|
|
29
28
|
windowOpenSpy.mockImplementation(() => walletWindowMock);
|
|
30
29
|
});
|
|
31
30
|
it('should cancel an action correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
31
|
yield crossWindowProvider.init();
|
|
33
32
|
const result = yield crossWindowProvider.cancelAction();
|
|
34
|
-
expect(result).
|
|
33
|
+
expect(result).toBe(undefined);
|
|
35
34
|
}));
|
|
36
35
|
});
|
|
37
36
|
//# sourceMappingURL=Cancel.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cancel.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Cancel.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Cancel.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Cancel.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iDAA6E;AAC7E,gEAA6D;AAE7D,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,mBAAwC,CAAC;IAC7C,IAAI,gBAAsC,CAAC;IAC3C,IAAI,aAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,IAAA,gCAAmB,GAAE,CAAC;QACzC,yCAAmB,CAAC,WAAW,EAAE,CAAC,gBAAgB,EAAE,CAAC,WAAW,GAAG,IAAI;aACpE,EAAE,EAAE;aACJ,kBAAkB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAEvC,yCAAmB,CAAC,WAAW,EAAE,CAAC,gBAAgB,EAAE,CAAC,cAAc,GAAG,IAAI;aACvE,EAAE,EAAE;aACJ,kBAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAElC,mBAAmB,GAAG,yCAAmB,CAAC,WAAW,EAAE,CAAC;QACxD,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,aAAa,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAS,EAAE;QACjD,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,YAAY,EAAE,CAAC;QACxD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -9,13 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("../../test-utils");
|
|
13
12
|
const CrossWindowProvider_1 = require("../CrossWindowProvider");
|
|
14
13
|
describe('CrossWindowProvider', () => {
|
|
15
14
|
let crossWindowProvider;
|
|
16
15
|
beforeEach(() => {
|
|
17
16
|
crossWindowProvider = CrossWindowProvider_1.CrossWindowProvider.getInstance();
|
|
18
|
-
(0, test_utils_1.mockWindoManager)();
|
|
19
17
|
});
|
|
20
18
|
it('should be a singleton instance', () => {
|
|
21
19
|
const anotherInstance = CrossWindowProvider_1.CrossWindowProvider.getInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Init.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Init.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Init.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Init.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,gEAA6D;AAE7D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,mBAAwC,CAAC;IAE7C,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,yCAAmB,CAAC,WAAW,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,eAAe,GAAG,yCAAmB,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAS,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;QAC5B,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAS,EAAE;QAC5C,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACjC,mBAAmB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,CAAC;QACvD,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const test_utils_1 = require("../../test-utils");
|
|
13
|
-
const WindowManager_1 = require("../../WindowManager/WindowManager");
|
|
14
13
|
const CrossWindowProvider_1 = require("../CrossWindowProvider");
|
|
15
14
|
describe('CrossWindowProvider Login', () => {
|
|
16
15
|
let crossWindowProvider;
|
|
@@ -18,7 +17,7 @@ describe('CrossWindowProvider Login', () => {
|
|
|
18
17
|
let windowOpenSpy;
|
|
19
18
|
beforeEach(() => {
|
|
20
19
|
walletWindowMock = (0, test_utils_1.getWalletWindowMock)();
|
|
21
|
-
|
|
20
|
+
CrossWindowProvider_1.CrossWindowProvider.getInstance().getWindowManager().postMessage = jest
|
|
22
21
|
.fn()
|
|
23
22
|
.mockImplementation(() => ({
|
|
24
23
|
payload: {
|
|
@@ -26,7 +25,6 @@ describe('CrossWindowProvider Login', () => {
|
|
|
26
25
|
}
|
|
27
26
|
}));
|
|
28
27
|
crossWindowProvider = CrossWindowProvider_1.CrossWindowProvider.getInstance();
|
|
29
|
-
(0, test_utils_1.mockWindoManager)();
|
|
30
28
|
windowOpenSpy = jest.spyOn(window, 'open');
|
|
31
29
|
windowOpenSpy.mockImplementation(() => walletWindowMock);
|
|
32
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Login.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Login.test.js","sourceRoot":"","sources":["../../../src/CrossWindowProvider/tests/Login.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iDAA6E;AAC7E,gEAA6D;AAE7D,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,mBAAwC,CAAC;IAC7C,IAAI,gBAAsC,CAAC;IAC3C,IAAI,aAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,IAAA,gCAAmB,GAAE,CAAC;QACzC,yCAAmB,CAAC,WAAW,EAAE,CAAC,gBAAgB,EAAE,CAAC,WAAW,GAAG,IAAI;aACpE,EAAE,EAAE;aACJ,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC;YACzB,OAAO,EAAE;gBACP,IAAI,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE;aAC7D;SACF,CAAC,CAAC,CAAC;QAEN,mBAAmB,GAAG,yCAAmB,CAAC,WAAW,EAAE,CAAC;QACxD,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,aAAa,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAS,EAAE;QAC7C,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,aAAa;YACtB,SAAS,EAAE,eAAe;SAC3B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|