@multiversx/sdk-web-wallet-cross-window-provider 0.3.0-alpha.1 → 0.3.0-alpha.2
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/IFrameManager/IFrameProviderContentWindow.d.ts +2 -5
- package/out/IFrameManager/IFrameProviderContentWindow.js +14 -72
- package/out/IFrameManager/IFrameProviderContentWindow.js.map +1 -1
- package/out/IFrameManager/IframeManager.d.ts +0 -4
- package/out/IFrameManager/IframeManager.js +4 -13
- package/out/IFrameManager/IframeManager.js.map +1 -1
- package/out/IFrameManager/iframeManager.styles.d.ts +1 -2
- package/out/IFrameManager/iframeManager.styles.js +4 -27
- package/out/IFrameManager/iframeManager.styles.js.map +1 -1
- package/out/IFrameProvider/IframeProvider.js +9 -6
- package/out/IFrameProvider/IframeProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,15 +5,14 @@ export declare class IFrameProviderContentWindow {
|
|
|
5
5
|
private readonly container;
|
|
6
6
|
private readonly header;
|
|
7
7
|
private readonly body;
|
|
8
|
-
private readonly onClose;
|
|
9
8
|
constructor(props: {
|
|
10
9
|
id: string;
|
|
11
10
|
url: string;
|
|
12
11
|
anchor?: HTMLElement;
|
|
13
|
-
onClose?: () => void;
|
|
14
12
|
});
|
|
15
13
|
private buildWindow;
|
|
16
|
-
private
|
|
14
|
+
private buildHeader;
|
|
15
|
+
private buildContainer;
|
|
17
16
|
private setupWindow;
|
|
18
17
|
getContainer(): HTMLDivElement;
|
|
19
18
|
getIframe(): HTMLIFrameElement;
|
|
@@ -22,6 +21,4 @@ export declare class IFrameProviderContentWindow {
|
|
|
22
21
|
remove(): void;
|
|
23
22
|
setWalletVisible(visible: boolean): void;
|
|
24
23
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject): void;
|
|
25
|
-
private setupResizable;
|
|
26
|
-
private setupDraggable;
|
|
27
24
|
}
|
|
@@ -7,9 +7,7 @@ class IFrameProviderContentWindow {
|
|
|
7
7
|
constructor(props) {
|
|
8
8
|
var _a, _b, _c, _d, _e, _f;
|
|
9
9
|
this.walletAddress = '';
|
|
10
|
-
|
|
11
|
-
const { id, url, anchor, onClose } = props;
|
|
12
|
-
this.onClose = onClose;
|
|
10
|
+
const { id, url, anchor } = props;
|
|
13
11
|
this.container = (_a = constants_1.safeDocument.createElement) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeDocument, 'div');
|
|
14
12
|
this.header = (_b = constants_1.safeDocument.createElement) === null || _b === void 0 ? void 0 : _b.call(constants_1.safeDocument, 'div');
|
|
15
13
|
this.body = (_c = constants_1.safeDocument.createElement) === null || _c === void 0 ? void 0 : _c.call(constants_1.safeDocument, 'div');
|
|
@@ -26,30 +24,22 @@ class IFrameProviderContentWindow {
|
|
|
26
24
|
}
|
|
27
25
|
buildWindow(id, url) {
|
|
28
26
|
this.container.id = `window-container-${id}`;
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.header.setAttribute('data-drag-handle', 'true');
|
|
27
|
+
this.iframe.id = id;
|
|
28
|
+
this.iframe.src = url;
|
|
32
29
|
this.container.style.cssText = iframeManager_styles_1.containerStyle;
|
|
33
30
|
this.header.style.cssText = iframeManager_styles_1.headerStyle;
|
|
34
31
|
this.body.style.cssText = iframeManager_styles_1.bodyStyle;
|
|
35
|
-
const { collapsibleButton, closeWalletButton } = this.getHeaderButtons();
|
|
36
|
-
this.header.appendChild(closeWalletButton);
|
|
37
|
-
this.header.appendChild(collapsibleButton);
|
|
38
|
-
this.container.appendChild(this.header);
|
|
39
|
-
this.container.appendChild(this.body);
|
|
40
|
-
this.iframe.id = id;
|
|
41
|
-
this.iframe.src = url;
|
|
42
32
|
this.iframe.style.cssText = iframeManager_styles_1.iframeStyle;
|
|
43
|
-
this.
|
|
33
|
+
this.buildContainer();
|
|
44
34
|
}
|
|
45
|
-
|
|
46
|
-
var _a, _b
|
|
35
|
+
buildHeader() {
|
|
36
|
+
var _a, _b;
|
|
47
37
|
const title = (_a = constants_1.safeDocument.createElement) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeDocument, 'span');
|
|
48
38
|
title.innerText = 'Wallet';
|
|
49
39
|
this.header.appendChild(title);
|
|
50
40
|
const collapsibleButton = (_b = constants_1.safeDocument.createElement) === null || _b === void 0 ? void 0 : _b.call(constants_1.safeDocument, 'span');
|
|
51
41
|
collapsibleButton.id = 'iframe-toggle-button';
|
|
52
|
-
collapsibleButton.innerText = '
|
|
42
|
+
collapsibleButton.innerText = '-';
|
|
53
43
|
collapsibleButton.style.cssText = iframeManager_styles_1.collapsibleButtonStyle;
|
|
54
44
|
collapsibleButton.onclick = () => {
|
|
55
45
|
this.body.style.visibility =
|
|
@@ -60,16 +50,13 @@ class IFrameProviderContentWindow {
|
|
|
60
50
|
this.body.style.visibility === 'hidden' ? '+' : '-';
|
|
61
51
|
this.container.style.setProperty('resize', this.body.style.visibility === 'hidden' ? 'none' : 'both');
|
|
62
52
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
(_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
71
|
-
};
|
|
72
|
-
return { collapsibleButton, closeWalletButton };
|
|
53
|
+
this.header.appendChild(collapsibleButton);
|
|
54
|
+
}
|
|
55
|
+
buildContainer() {
|
|
56
|
+
this.container.appendChild(this.header);
|
|
57
|
+
this.container.appendChild(this.body);
|
|
58
|
+
this.body.appendChild(this.iframe);
|
|
59
|
+
this.buildHeader();
|
|
73
60
|
}
|
|
74
61
|
setupWindow() {
|
|
75
62
|
this.iframe.onload = () => {
|
|
@@ -79,8 +66,6 @@ class IFrameProviderContentWindow {
|
|
|
79
66
|
});
|
|
80
67
|
this.iframe.dispatchEvent(event);
|
|
81
68
|
};
|
|
82
|
-
this.setupResizable();
|
|
83
|
-
this.setupDraggable();
|
|
84
69
|
}
|
|
85
70
|
getContainer() {
|
|
86
71
|
return this.container;
|
|
@@ -103,49 +88,6 @@ class IFrameProviderContentWindow {
|
|
|
103
88
|
addEventListener(type, listener) {
|
|
104
89
|
this.iframe.addEventListener(type, listener);
|
|
105
90
|
}
|
|
106
|
-
setupResizable() {
|
|
107
|
-
this.container.style.setProperty('resize', 'both');
|
|
108
|
-
this.container.style.setProperty('overflow', 'hidden');
|
|
109
|
-
}
|
|
110
|
-
setupDraggable() {
|
|
111
|
-
this.container.ondragstart = () => {
|
|
112
|
-
return false;
|
|
113
|
-
};
|
|
114
|
-
this.header.onmousedown = (event) => {
|
|
115
|
-
var _a;
|
|
116
|
-
const shiftX = event.clientX - this.container.getBoundingClientRect().left;
|
|
117
|
-
const shiftY = event.clientY - this.container.getBoundingClientRect().top;
|
|
118
|
-
// moves the window at (pageX, pageY) coordinates
|
|
119
|
-
// taking initial shifts into account
|
|
120
|
-
const moveAt = (pageX, pageY) => {
|
|
121
|
-
this.container.style.left = pageX - shiftX + 'px';
|
|
122
|
-
this.container.style.top = pageY - shiftY + 'px';
|
|
123
|
-
};
|
|
124
|
-
this.container.style.position = 'absolute';
|
|
125
|
-
this.container.style.zIndex = '1000';
|
|
126
|
-
moveAt(event.pageX, event.pageY);
|
|
127
|
-
const onMouseMove = (ev) => {
|
|
128
|
-
var _a, _b;
|
|
129
|
-
moveAt(ev.pageX, ev.pageY);
|
|
130
|
-
(_b = (_a = constants_1.safeWindow.getSelection) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeWindow)) === null || _b === void 0 ? void 0 : _b.removeAllRanges();
|
|
131
|
-
};
|
|
132
|
-
// move the container on mousemove
|
|
133
|
-
(_a = constants_1.safeDocument.addEventListener) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeDocument, 'mousemove', onMouseMove);
|
|
134
|
-
// drop the container, remove unneeded handlers
|
|
135
|
-
this.container.onmouseup = () => {
|
|
136
|
-
var _a;
|
|
137
|
-
(_a = constants_1.safeDocument.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeDocument, 'mousemove', onMouseMove);
|
|
138
|
-
this.container.onmouseup = null;
|
|
139
|
-
};
|
|
140
|
-
// drop the header, remove unneeded handlers
|
|
141
|
-
this.header.onmouseup = () => {
|
|
142
|
-
var _a;
|
|
143
|
-
(_a = constants_1.safeDocument.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(constants_1.safeDocument, 'mousemove', onMouseMove);
|
|
144
|
-
this.header.removeEventListener('mouseup', onMouseMove);
|
|
145
|
-
this.header.onmouseup = null;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
91
|
}
|
|
150
92
|
exports.IFrameProviderContentWindow = IFrameProviderContentWindow;
|
|
151
93
|
//# sourceMappingURL=IFrameProviderContentWindow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IFrameProviderContentWindow.js","sourceRoot":"","sources":["../../src/IFrameManager/IFrameProviderContentWindow.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"IFrameProviderContentWindow.js","sourceRoot":"","sources":["../../src/IFrameManager/IFrameProviderContentWindow.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,iEAMgC;AAEhC,MAAa,2BAA2B;IAStC,YAAmB,KAAwD;;QANpE,kBAAa,GAAG,EAAE,CAAC;QAOxB,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAElC,IAAI,CAAC,SAAS,GAAG,MAAA,wBAAY,CAAC,aAAa,yEAAG,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,GAAG,MAAA,wBAAY,CAAC,aAAa,yEAAG,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,MAAA,wBAAY,CAAC,aAAa,yEAAG,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,MAAA,wBAAY,CAAC,aAAa,yEAAG,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,WAAW,CAAC,EAA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,CAAC,MAAM,CAAC,aAAa,CAAC;YAE/C,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,mBAAmB,EAAE;gBACjD,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC;IACJ,CAAC;IAEM,YAAY;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,gBAAgB;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,GAAW;QACvB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;IAEM,gBAAgB,CAAC,OAAgB;QACtC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnE,CAAC;IAEM,gBAAgB,CACrB,IAAY,EACZ,QAA4C;QAE5C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF;AAlHD,kEAkHC"}
|
|
@@ -4,11 +4,7 @@ import { WindowManager } from '../WindowManager';
|
|
|
4
4
|
import { IFrameProviderContentWindow } from './IFrameProviderContentWindow';
|
|
5
5
|
export declare class IframeManager extends WindowManager {
|
|
6
6
|
private floatingWalletComponent;
|
|
7
|
-
private readonly onClose;
|
|
8
7
|
private readonly iframeId;
|
|
9
|
-
constructor(props?: {
|
|
10
|
-
onClose?: () => void;
|
|
11
|
-
});
|
|
12
8
|
get floatingWallet(): IFrameProviderContentWindow | null;
|
|
13
9
|
postMessage<T extends CrossWindowProviderRequestEnums>({ type, payload }: PostMessageParamsType<T>): Promise<PostMessageReturnType<T>>;
|
|
14
10
|
closeConnection(): Promise<boolean>;
|
|
@@ -15,12 +15,10 @@ const constants_1 = require("../constants");
|
|
|
15
15
|
const WindowManager_1 = require("../WindowManager");
|
|
16
16
|
const IFrameProviderContentWindow_1 = require("./IFrameProviderContentWindow");
|
|
17
17
|
class IframeManager extends WindowManager_1.WindowManager {
|
|
18
|
-
constructor(
|
|
19
|
-
super();
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
20
|
this.floatingWalletComponent = null;
|
|
21
|
-
this.onClose = undefined;
|
|
22
21
|
this.iframeId = 'floating-wallet';
|
|
23
|
-
this.onClose = props === null || props === void 0 ? void 0 : props.onClose;
|
|
24
22
|
}
|
|
25
23
|
get floatingWallet() {
|
|
26
24
|
return this.floatingWalletComponent;
|
|
@@ -41,12 +39,10 @@ class IframeManager extends WindowManager_1.WindowManager {
|
|
|
41
39
|
const _super = Object.create(null, {
|
|
42
40
|
closeConnection: { get: () => super.closeConnection }
|
|
43
41
|
});
|
|
44
|
-
var _a
|
|
42
|
+
var _a;
|
|
45
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
44
|
const result = yield _super.closeConnection.call(this);
|
|
47
45
|
(_a = this.floatingWalletComponent) === null || _a === void 0 ? void 0 : _a.remove();
|
|
48
|
-
const windowContainer = (_b = constants_1.safeDocument.getElementById) === null || _b === void 0 ? void 0 : _b.call(constants_1.safeDocument, `window-container-${this.iframeId}`);
|
|
49
|
-
windowContainer === null || windowContainer === void 0 ? void 0 : windowContainer.remove();
|
|
50
46
|
this.walletWindow = null;
|
|
51
47
|
return result;
|
|
52
48
|
});
|
|
@@ -72,12 +68,7 @@ class IframeManager extends WindowManager_1.WindowManager {
|
|
|
72
68
|
this.floatingWalletComponent = new IFrameProviderContentWindow_1.IFrameProviderContentWindow({
|
|
73
69
|
id: this.iframeId,
|
|
74
70
|
anchor,
|
|
75
|
-
url: this.walletUrl
|
|
76
|
-
onClose: () => {
|
|
77
|
-
var _a;
|
|
78
|
-
this.closeConnection();
|
|
79
|
-
(_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
80
|
-
}
|
|
71
|
+
url: this.walletUrl
|
|
81
72
|
});
|
|
82
73
|
this.floatingWalletComponent.walletAddress = this.walletUrl;
|
|
83
74
|
const iframe = yield new Promise((resolve) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeManager.js","sourceRoot":"","sources":["../../src/IFrameManager/IframeManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wHAAwG;AAMxG,4CAA4C;AAC5C,oDAAiD;AACjD,+EAA4E;AAE5E,MAAa,aAAc,SAAQ,6BAAa;
|
|
1
|
+
{"version":3,"file":"IframeManager.js","sourceRoot":"","sources":["../../src/IFrameManager/IframeManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wHAAwG;AAMxG,4CAA4C;AAC5C,oDAAiD;AACjD,+EAA4E;AAE5E,MAAa,aAAc,SAAQ,6BAAa;IAAhD;;QACU,4BAAuB,GAAuC,IAAI,CAAC;QAC1D,aAAQ,GAAG,iBAAiB,CAAC;IA+EhD,CAAC;IA7EC,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;IAEqB,WAAW,CAA4C,EAC3E,IAAI,EACJ,OAAO,EACkB;;;YACzB,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAE3B,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,CAC5B;gBACE,IAAI;gBACJ,OAAO;aACR,EACD,IAAI,CAAC,SAAS,CACf,CAAC;YAEF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,8CAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC;;KACb;IAEqB,eAAe;;;;;;YACnC,MAAM,MAAM,GAAG,M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CAAC,aAAa,CAAC;YACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;;KAC7B;IAEM,gBAAgB,CAAC,OAAgB;;QACtC,MAAA,IAAI,CAAC,uBAAuB,0CAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAjFD,sCAiFC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare const containerStyle = "\n width: 400px;\n height: 600px;\n border: 1px solid #0d0e10;\n border-radius: 5px;\n z-index: 9999;\n position:
|
|
1
|
+
export declare const containerStyle = "\n width: 400px;\n height: 600px;\n border: 1px solid #0d0e10;\n border-radius: 5px;\n z-index: 9999;\n position: fixed;\n bottom: 0;\n left: 2rem;\n visibility: hidden;\n padding-bottom: 10px;\n ";
|
|
2
2
|
export declare const headerStyle = "\n color: #fff;\n background-color: #0d0e10;\n padding: 10px 15px;\n cursor: pointer;\n height: 50px;\n ";
|
|
3
3
|
export declare const bodyStyle = "\n width: 100%;\n height: calc(100% - 40px);\n overflow: hidden;\n ";
|
|
4
4
|
export declare const iframeStyle = "\n width: 100%;\n height: 100%;\n border: none;\n border-radius: 0 0 5px 5px;\n ";
|
|
5
5
|
export declare const collapsibleButtonStyle = "\n width: 30px;\n height: 30px;\n cursor: pointer;\n margin: 0px;\n padding: 0px;\n box-sizing: content-box;\n font-family: sans-serif;\n text-align: center;\n font-size: 40px;\n line-height: 14px;\n border-width: 0px;\n border-radius: 2px;\n border-color: rgb(170, 170, 170);\n border-style: solid;\n background-color: transparent;\n color: gray;\n z-index: 50;\n user-select: none;\n float: right;\n ";
|
|
6
|
-
export declare const closeWalletButtonStyle = "\n width: 30px;\n height: 30px;\n cursor: pointer;\n margin-top: 0px; \n display: inline-block; \n cursor: pointer;\n margin-top: 5px;\n padding: 0px;\n box-sizing: content-box;\n font-family: sans-serif;\n text-align: center;\n font-size: 30px;\n line-height: 14px;\n border-width: 0px;\n border-radius: 2px;\n border-color: rgb(170, 170, 170);\n border-style: solid;\n background-color: transparent;\n color: gray;\n z-index: 50;\n user-select: none;\n float: right;\n ";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.collapsibleButtonStyle = exports.iframeStyle = exports.bodyStyle = exports.headerStyle = exports.containerStyle = void 0;
|
|
4
4
|
exports.containerStyle = `
|
|
5
5
|
width: 400px;
|
|
6
6
|
height: 600px;
|
|
7
7
|
border: 1px solid #0d0e10;
|
|
8
8
|
border-radius: 5px;
|
|
9
9
|
z-index: 9999;
|
|
10
|
-
position:
|
|
10
|
+
position: fixed;
|
|
11
11
|
bottom: 0;
|
|
12
|
-
|
|
12
|
+
left: 2rem;
|
|
13
13
|
visibility: hidden;
|
|
14
|
+
padding-bottom: 10px;
|
|
14
15
|
`;
|
|
15
16
|
exports.headerStyle = `
|
|
16
17
|
color: #fff;
|
|
@@ -51,28 +52,4 @@ exports.collapsibleButtonStyle = `
|
|
|
51
52
|
user-select: none;
|
|
52
53
|
float: right;
|
|
53
54
|
`;
|
|
54
|
-
exports.closeWalletButtonStyle = `
|
|
55
|
-
width: 30px;
|
|
56
|
-
height: 30px;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
margin-top: 0px;
|
|
59
|
-
display: inline-block;
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
margin-top: 5px;
|
|
62
|
-
padding: 0px;
|
|
63
|
-
box-sizing: content-box;
|
|
64
|
-
font-family: sans-serif;
|
|
65
|
-
text-align: center;
|
|
66
|
-
font-size: 30px;
|
|
67
|
-
line-height: 14px;
|
|
68
|
-
border-width: 0px;
|
|
69
|
-
border-radius: 2px;
|
|
70
|
-
border-color: rgb(170, 170, 170);
|
|
71
|
-
border-style: solid;
|
|
72
|
-
background-color: transparent;
|
|
73
|
-
color: gray;
|
|
74
|
-
z-index: 50;
|
|
75
|
-
user-select: none;
|
|
76
|
-
float: right;
|
|
77
|
-
`;
|
|
78
55
|
//# sourceMappingURL=iframeManager.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframeManager.styles.js","sourceRoot":"","sources":["../../src/IFrameManager/iframeManager.styles.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG
|
|
1
|
+
{"version":3,"file":"iframeManager.styles.js","sourceRoot":"","sources":["../../src/IFrameManager/iframeManager.styles.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;;;;;;;;;;;GAW3B,CAAC;AAES,QAAA,WAAW,GAAG;;;;;;GAMxB,CAAC;AAES,QAAA,SAAS,GAAG;;;;GAItB,CAAC;AAES,QAAA,WAAW,GAAG;;;;;GAKxB,CAAC;AAES,QAAA,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;GAoBnC,CAAC"}
|
|
@@ -16,10 +16,7 @@ const IframeManager_1 = require("../IFrameManager/IframeManager");
|
|
|
16
16
|
class IframeProvider extends CrossWindowProvider_1.CrossWindowProvider {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
|
-
this.windowManager = new IframeManager_1.IframeManager(
|
|
20
|
-
// TODO check why the logout is not sending logout request through postMessage
|
|
21
|
-
onClose: this.logout.bind(this)
|
|
22
|
-
});
|
|
19
|
+
this.windowManager = new IframeManager_1.IframeManager();
|
|
23
20
|
}
|
|
24
21
|
static getInstance() {
|
|
25
22
|
if (!IframeProvider._instance) {
|
|
@@ -53,10 +50,16 @@ class IframeProvider extends CrossWindowProvider_1.CrossWindowProvider {
|
|
|
53
50
|
if (!this.initialized) {
|
|
54
51
|
throw new errors_1.ErrProviderNotInitialized();
|
|
55
52
|
}
|
|
56
|
-
|
|
53
|
+
try {
|
|
54
|
+
this.ensureConnected();
|
|
55
|
+
yield this.windowManager.closeConnection();
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
console.error(e);
|
|
59
|
+
}
|
|
57
60
|
this.initialized = false;
|
|
58
61
|
this.disconnect();
|
|
59
|
-
return
|
|
62
|
+
return true;
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
openPopupConsent() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeProvider.js","sourceRoot":"","sources":["../../src/IFrameProvider/IframeProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAGgC;AAChC,sCAAsD;AACtD,kEAA+D;AAE/D,MAAa,cAAe,SAAQ,yCAAmB;IACrD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,
|
|
1
|
+
{"version":3,"file":"IframeProvider.js","sourceRoot":"","sources":["../../src/IFrameProvider/IframeProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAGgC;AAChC,sCAAsD;AACtD,kEAA+D;AAE/D,MAAa,cAAe,SAAQ,yCAAmB;IACrD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,EAAE,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE;YAC7B,cAAc,CAAC,SAAS,GAAG,IAAI,cAAc,EAAE,CAAC;YAChD,OAAO,cAAc,CAAC,SAAS,CAAC;SACjC;QAED,OAAO,cAAc,CAAC,SAAS,CAAC;IAClC,CAAC;IAEqB,IAAI;;;;;YACxB,MAAM,WAAW,GAAG,MAAM,OAAM,IAAI,WAAE,CAAC;YACvC,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YAE3C,OAAO,WAAW,CAAC;QACrB,CAAC;KAAA;IAEqB,KAAK,CACzB,UAEI,EAAE;;;;;YAEN,MAAM,OAAO,GAAG,MAAM,OAAM,KAAK,YAAC,OAAO,CAAC,CAAC;YAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YAE3C,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;IAEqB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