@openfin/remote-adapter 36.80.8 → 36.80.9
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.
|
@@ -17502,7 +17502,7 @@ declare type WillResizeEvent = WillMoveOrResizeEvent & {
|
|
|
17502
17502
|
*/
|
|
17503
17503
|
declare class _Window extends WebContents<OpenFin.WindowEvent> {
|
|
17504
17504
|
/* Excluded from this release type: __constructor */
|
|
17505
|
-
|
|
17505
|
+
createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
|
|
17506
17506
|
/**
|
|
17507
17507
|
* Retrieves an array of frame info objects representing the main frame and any
|
|
17508
17508
|
* iframes that are currently on the page.
|
|
@@ -17502,7 +17502,7 @@ declare type WillResizeEvent = WillMoveOrResizeEvent & {
|
|
|
17502
17502
|
*/
|
|
17503
17503
|
declare class _Window extends WebContents<OpenFin.WindowEvent> {
|
|
17504
17504
|
/* Excluded from this release type: __constructor */
|
|
17505
|
-
|
|
17505
|
+
createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
|
|
17506
17506
|
/**
|
|
17507
17507
|
* Retrieves an array of frame info objects representing the main frame and any
|
|
17508
17508
|
* iframes that are currently on the page.
|
|
@@ -17502,7 +17502,7 @@ declare type WillResizeEvent = WillMoveOrResizeEvent & {
|
|
|
17502
17502
|
*/
|
|
17503
17503
|
declare class _Window extends WebContents<OpenFin.WindowEvent> {
|
|
17504
17504
|
/* Excluded from this release type: __constructor */
|
|
17505
|
-
|
|
17505
|
+
createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
|
|
17506
17506
|
/**
|
|
17507
17507
|
* Retrieves an array of frame info objects representing the main frame and any
|
|
17508
17508
|
* iframes that are currently on the page.
|
package/out/remote-adapter.d.ts
CHANGED
|
@@ -17944,10 +17944,6 @@ declare class _Window extends WebContents<OpenFin.WindowEvent> {
|
|
|
17944
17944
|
* @internal
|
|
17945
17945
|
*/
|
|
17946
17946
|
constructor(wire: Transport, identity: OpenFin.Identity);
|
|
17947
|
-
/**
|
|
17948
|
-
* create a new window
|
|
17949
|
-
* @internal
|
|
17950
|
-
*/
|
|
17951
17947
|
createWindow(options: OpenFin.WindowCreationOptions): Promise<OpenFin.Window>;
|
|
17952
17948
|
/**
|
|
17953
17949
|
* Retrieves an array of frame info objects representing the main frame and any
|
package/out/remote-adapter.js
CHANGED
|
@@ -6414,6 +6414,37 @@ function requireApplication () {
|
|
|
6414
6414
|
return application;
|
|
6415
6415
|
}
|
|
6416
6416
|
|
|
6417
|
+
var promisifySubscription$1 = {};
|
|
6418
|
+
|
|
6419
|
+
Object.defineProperty(promisifySubscription$1, "__esModule", { value: true });
|
|
6420
|
+
promisifySubscription$1.promisifySubscription = void 0;
|
|
6421
|
+
const promisifySubscription = async (emitter, eventName, predicate = () => true, timeout) => {
|
|
6422
|
+
let resolve;
|
|
6423
|
+
let reject;
|
|
6424
|
+
let timer;
|
|
6425
|
+
const valuePromise = new Promise((y, n) => {
|
|
6426
|
+
resolve = y;
|
|
6427
|
+
reject = n;
|
|
6428
|
+
});
|
|
6429
|
+
const listener = (e) => {
|
|
6430
|
+
if (predicate(e)) {
|
|
6431
|
+
clearTimeout(timer);
|
|
6432
|
+
resolve(e);
|
|
6433
|
+
}
|
|
6434
|
+
};
|
|
6435
|
+
await emitter.on(eventName, listener);
|
|
6436
|
+
if (timeout) {
|
|
6437
|
+
timer = setTimeout(() => reject(new Error('event timed out')), timeout);
|
|
6438
|
+
}
|
|
6439
|
+
valuePromise.finally(() => {
|
|
6440
|
+
emitter.removeListener(eventName, listener).catch(() => null);
|
|
6441
|
+
});
|
|
6442
|
+
return {
|
|
6443
|
+
getValue: () => valuePromise
|
|
6444
|
+
};
|
|
6445
|
+
};
|
|
6446
|
+
promisifySubscription$1.promisifySubscription = promisifySubscription;
|
|
6447
|
+
|
|
6417
6448
|
var hasRequiredInstance$1;
|
|
6418
6449
|
|
|
6419
6450
|
function requireInstance$1 () {
|
|
@@ -6429,6 +6460,7 @@ function requireInstance$1 () {
|
|
|
6429
6460
|
const main_1 = main;
|
|
6430
6461
|
const view_1 = requireView();
|
|
6431
6462
|
const warnings_1 = warnings;
|
|
6463
|
+
const promisifySubscription_1 = promisifySubscription$1;
|
|
6432
6464
|
/**
|
|
6433
6465
|
* A basic window that wraps a native HTML window. Provides more fine-grained
|
|
6434
6466
|
* control over the window state such as the ability to minimize, maximize, restore, etc.
|
|
@@ -6444,79 +6476,60 @@ function requireInstance$1 () {
|
|
|
6444
6476
|
constructor(wire, identity) {
|
|
6445
6477
|
super(wire, identity, 'window');
|
|
6446
6478
|
}
|
|
6447
|
-
|
|
6448
|
-
* create a new window
|
|
6449
|
-
* @internal
|
|
6450
|
-
*/
|
|
6451
|
-
createWindow(options) {
|
|
6479
|
+
async createWindow(options) {
|
|
6452
6480
|
this.wire.sendAction('window-create-window', this.identity).catch((e) => {
|
|
6453
6481
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
6454
6482
|
});
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
try {
|
|
6506
|
-
// this is to enforce a 5.0 contract that the child's main function
|
|
6507
|
-
// will not fire before the parent's success callback on creation.
|
|
6508
|
-
// if the child window is not accessible (CORS) this contract does
|
|
6509
|
-
// not hold.
|
|
6510
|
-
const webWindow = this.getWebWindow();
|
|
6511
|
-
webWindow.fin.__internal_.openerSuccessCBCalled();
|
|
6512
|
-
}
|
|
6513
|
-
catch (e) {
|
|
6514
|
-
// common for main windows, we do not want to expose this error. here just to have a debug target.
|
|
6515
|
-
// console.error(e);
|
|
6516
|
-
}
|
|
6517
|
-
})
|
|
6518
|
-
.catch(reject);
|
|
6519
|
-
});
|
|
6483
|
+
const CONSTRUCTOR_CB_TOPIC = 'fire-constructor-callback';
|
|
6484
|
+
const responseSubscription = await (0, promisifySubscription_1.promisifySubscription)(this, CONSTRUCTOR_CB_TOPIC);
|
|
6485
|
+
// set defaults:
|
|
6486
|
+
if (options.waitForPageLoad === undefined) {
|
|
6487
|
+
options.waitForPageLoad = false;
|
|
6488
|
+
}
|
|
6489
|
+
if (options.autoShow === undefined) {
|
|
6490
|
+
options.autoShow = true;
|
|
6491
|
+
}
|
|
6492
|
+
(0, warnings_1.handleDeprecatedWarnings)(options);
|
|
6493
|
+
const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
|
|
6494
|
+
const [response] = await Promise.all([responseSubscription.getValue(), windowCreation]);
|
|
6495
|
+
let cbPayload;
|
|
6496
|
+
const { success } = response;
|
|
6497
|
+
const responseData = response.data;
|
|
6498
|
+
const { message } = responseData;
|
|
6499
|
+
if (success) {
|
|
6500
|
+
cbPayload = {
|
|
6501
|
+
httpResponseCode: responseData.httpResponseCode,
|
|
6502
|
+
apiInjected: responseData.apiInjected
|
|
6503
|
+
};
|
|
6504
|
+
}
|
|
6505
|
+
else {
|
|
6506
|
+
cbPayload = {
|
|
6507
|
+
message: responseData.message,
|
|
6508
|
+
networkErrorCode: responseData.networkErrorCode,
|
|
6509
|
+
stack: responseData.stack
|
|
6510
|
+
};
|
|
6511
|
+
}
|
|
6512
|
+
const pageResolve = {
|
|
6513
|
+
message,
|
|
6514
|
+
cbPayload,
|
|
6515
|
+
success
|
|
6516
|
+
};
|
|
6517
|
+
try {
|
|
6518
|
+
// this is to enforce a 5.0 contract that the child's main function
|
|
6519
|
+
// will not fire before the parent's success callback on creation.
|
|
6520
|
+
// if the child window is not accessible (CORS) this contract does
|
|
6521
|
+
// not hold.
|
|
6522
|
+
const webWindow = this.getWebWindow();
|
|
6523
|
+
webWindow.fin.__internal_.openerSuccessCBCalled();
|
|
6524
|
+
}
|
|
6525
|
+
catch (e) {
|
|
6526
|
+
// common for main windows, we do not want to expose this error. here just to have a debug target.
|
|
6527
|
+
// console.error(e);
|
|
6528
|
+
}
|
|
6529
|
+
if (pageResolve.success) {
|
|
6530
|
+
return this;
|
|
6531
|
+
}
|
|
6532
|
+
return Promise.reject(pageResolve);
|
|
6520
6533
|
}
|
|
6521
6534
|
/**
|
|
6522
6535
|
* Retrieves an array of frame info objects representing the main frame and any
|