@openfin/node-adapter 36.78.7 → 36.78.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.
- package/out/node-adapter.js +26 -7
- package/package.json +1 -1
package/out/node-adapter.js
CHANGED
@@ -11735,7 +11735,7 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
11735
11735
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
11736
11736
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
11737
11737
|
};
|
11738
|
-
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
|
11738
|
+
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
|
11739
11739
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
11740
11740
|
Factory$2.LayoutModule = void 0;
|
11741
11741
|
const base_1$5 = base$1;
|
@@ -11788,7 +11788,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11788
11788
|
* ```
|
11789
11789
|
*/
|
11790
11790
|
this.init = async (options = {}) => {
|
11791
|
-
this.wire.sendAction('layout-init').catch(() => {
|
11791
|
+
this.wire.sendAction('layout-init').catch((e) => {
|
11792
11792
|
// don't expose
|
11793
11793
|
});
|
11794
11794
|
if (!this.fin.me.isWindow) {
|
@@ -11803,6 +11803,9 @@ class LayoutModule extends base_1$5.Base {
|
|
11803
11803
|
const platformClient = await this.fin.Platform.getCurrentSync().getClient();
|
11804
11804
|
const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
|
11805
11805
|
await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
|
11806
|
+
if (!options.layoutManagerOverride) {
|
11807
|
+
return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
|
11808
|
+
}
|
11806
11809
|
// warn user if they do not call create() in the next 30 seconds
|
11807
11810
|
setTimeout(() => {
|
11808
11811
|
if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
|
@@ -11812,6 +11815,22 @@ class LayoutModule extends base_1$5.Base {
|
|
11812
11815
|
}, 30000);
|
11813
11816
|
return this.wrapSync(this.fin.me.identity);
|
11814
11817
|
};
|
11818
|
+
_LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
|
11819
|
+
let layoutManager;
|
11820
|
+
let resolve;
|
11821
|
+
const layoutResolved = new Promise((r) => {
|
11822
|
+
resolve = r;
|
11823
|
+
});
|
11824
|
+
// wait for a layout to be created
|
11825
|
+
await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
|
11826
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
11827
|
+
layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
|
11828
|
+
// Backward compat - undocumented / not typed openfin-layout as layoutManager
|
11829
|
+
// TODO: eventually deprecate this
|
11830
|
+
resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
|
11831
|
+
});
|
11832
|
+
return layoutResolved;
|
11833
|
+
});
|
11815
11834
|
/**
|
11816
11835
|
* Returns the layout manager for the current window
|
11817
11836
|
* @returns
|
@@ -11846,7 +11865,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11846
11865
|
* ```
|
11847
11866
|
*/
|
11848
11867
|
async wrap(identity) {
|
11849
|
-
this.wire.sendAction('layout-wrap').catch(() => {
|
11868
|
+
this.wire.sendAction('layout-wrap').catch((e) => {
|
11850
11869
|
// don't expose
|
11851
11870
|
});
|
11852
11871
|
return new Instance_1$2.Layout(identity, this.wire);
|
@@ -11871,7 +11890,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11871
11890
|
* ```
|
11872
11891
|
*/
|
11873
11892
|
wrapSync(identity) {
|
11874
|
-
this.wire.sendAction('layout-wrap-sync').catch(() => {
|
11893
|
+
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
11875
11894
|
// don't expose
|
11876
11895
|
});
|
11877
11896
|
return new Instance_1$2.Layout(identity, this.wire);
|
@@ -11887,7 +11906,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11887
11906
|
* ```
|
11888
11907
|
*/
|
11889
11908
|
async getCurrent() {
|
11890
|
-
this.wire.sendAction('layout-get-current').catch(() => {
|
11909
|
+
this.wire.sendAction('layout-get-current').catch((e) => {
|
11891
11910
|
// don't expose
|
11892
11911
|
});
|
11893
11912
|
if (!this.fin.me.isWindow) {
|
@@ -11910,7 +11929,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11910
11929
|
* ```
|
11911
11930
|
*/
|
11912
11931
|
getCurrentSync() {
|
11913
|
-
this.wire.sendAction('layout-get-current-sync').catch(() => {
|
11932
|
+
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
11914
11933
|
// don't expose
|
11915
11934
|
});
|
11916
11935
|
if (!this.fin.me.isWindow) {
|
@@ -11921,7 +11940,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11921
11940
|
}
|
11922
11941
|
}
|
11923
11942
|
Factory$2.LayoutModule = LayoutModule;
|
11924
|
-
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
11943
|
+
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
11925
11944
|
if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
|
11926
11945
|
throw new Error(`You must call init before using the API ${method}`);
|
11927
11946
|
}
|