@openfin/core 36.78.7 → 36.78.8

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.
Files changed (2) hide show
  1. package/out/mock.js +26 -7
  2. package/package.json +1 -1
package/out/mock.js CHANGED
@@ -11955,7 +11955,7 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11955
11955
  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");
11956
11956
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11957
11957
  };
11958
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11958
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11959
11959
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11960
11960
  Factory$2.LayoutModule = void 0;
11961
11961
  const base_1$5 = base;
@@ -12008,7 +12008,7 @@ class LayoutModule extends base_1$5.Base {
12008
12008
  * ```
12009
12009
  */
12010
12010
  this.init = async (options = {}) => {
12011
- this.wire.sendAction('layout-init').catch(() => {
12011
+ this.wire.sendAction('layout-init').catch((e) => {
12012
12012
  // don't expose
12013
12013
  });
12014
12014
  if (!this.fin.me.isWindow) {
@@ -12023,6 +12023,9 @@ class LayoutModule extends base_1$5.Base {
12023
12023
  const platformClient = await this.fin.Platform.getCurrentSync().getClient();
12024
12024
  const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
12025
12025
  await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
12026
+ if (!options.layoutManagerOverride) {
12027
+ return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
12028
+ }
12026
12029
  // warn user if they do not call create() in the next 30 seconds
12027
12030
  setTimeout(() => {
12028
12031
  if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
@@ -12032,6 +12035,22 @@ class LayoutModule extends base_1$5.Base {
12032
12035
  }, 30000);
12033
12036
  return this.wrapSync(this.fin.me.identity);
12034
12037
  };
12038
+ _LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
12039
+ let layoutManager;
12040
+ let resolve;
12041
+ const layoutResolved = new Promise((r) => {
12042
+ resolve = r;
12043
+ });
12044
+ // wait for a layout to be created
12045
+ await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
12046
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12047
+ layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
12048
+ // Backward compat - undocumented / not typed openfin-layout as layoutManager
12049
+ // TODO: eventually deprecate this
12050
+ resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
12051
+ });
12052
+ return layoutResolved;
12053
+ });
12035
12054
  /**
12036
12055
  * Returns the layout manager for the current window
12037
12056
  * @returns
@@ -12066,7 +12085,7 @@ class LayoutModule extends base_1$5.Base {
12066
12085
  * ```
12067
12086
  */
12068
12087
  async wrap(identity) {
12069
- this.wire.sendAction('layout-wrap').catch(() => {
12088
+ this.wire.sendAction('layout-wrap').catch((e) => {
12070
12089
  // don't expose
12071
12090
  });
12072
12091
  return new Instance_1$2.Layout(identity, this.wire);
@@ -12091,7 +12110,7 @@ class LayoutModule extends base_1$5.Base {
12091
12110
  * ```
12092
12111
  */
12093
12112
  wrapSync(identity) {
12094
- this.wire.sendAction('layout-wrap-sync').catch(() => {
12113
+ this.wire.sendAction('layout-wrap-sync').catch((e) => {
12095
12114
  // don't expose
12096
12115
  });
12097
12116
  return new Instance_1$2.Layout(identity, this.wire);
@@ -12107,7 +12126,7 @@ class LayoutModule extends base_1$5.Base {
12107
12126
  * ```
12108
12127
  */
12109
12128
  async getCurrent() {
12110
- this.wire.sendAction('layout-get-current').catch(() => {
12129
+ this.wire.sendAction('layout-get-current').catch((e) => {
12111
12130
  // don't expose
12112
12131
  });
12113
12132
  if (!this.fin.me.isWindow) {
@@ -12130,7 +12149,7 @@ class LayoutModule extends base_1$5.Base {
12130
12149
  * ```
12131
12150
  */
12132
12151
  getCurrentSync() {
12133
- this.wire.sendAction('layout-get-current-sync').catch(() => {
12152
+ this.wire.sendAction('layout-get-current-sync').catch((e) => {
12134
12153
  // don't expose
12135
12154
  });
12136
12155
  if (!this.fin.me.isWindow) {
@@ -12141,7 +12160,7 @@ class LayoutModule extends base_1$5.Base {
12141
12160
  }
12142
12161
  }
12143
12162
  Factory$2.LayoutModule = LayoutModule;
12144
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12163
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12145
12164
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
12146
12165
  throw new Error(`You must call init before using the API ${method}`);
12147
12166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "36.78.7",
3
+ "version": "36.78.8",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/mock.js",