@openfin/node-adapter 35.79.1 → 35.79.3

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.
@@ -5018,6 +5018,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5018
5018
 
5019
5019
  declare interface Environment {
5020
5020
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5021
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5021
5022
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5022
5023
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5023
5024
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8505,16 +8506,17 @@ declare type LayoutIdentity = Identity_5 & {
8505
8506
  };
8506
8507
 
8507
8508
  /**
8508
- * Generated when the window is created, and all of its layout's views have either finished or failed
8509
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8509
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8510
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8510
8511
  * @interface
8511
8512
  */
8512
8513
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8513
8514
  type: 'layout-initialized';
8514
8515
  layoutIdentity: OpenFin.LayoutIdentity;
8515
- ofViews: (OpenFin.Identity & {
8516
+ ofViews: {
8517
+ identity: OpenFin.Identity;
8516
8518
  entityType: 'view';
8517
- })[];
8519
+ }[];
8518
8520
  };
8519
8521
 
8520
8522
  /**
@@ -8882,9 +8884,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8882
8884
  declare type LayoutReadyEvent = BaseEvent_5 & {
8883
8885
  type: 'layout-ready';
8884
8886
  layoutIdentity: OpenFin.LayoutIdentity;
8885
- views: (OpenFin.Identity & {
8887
+ views: {
8888
+ identity: OpenFin.Identity;
8886
8889
  success: boolean;
8887
- })[];
8890
+ error?: Error;
8891
+ }[];
8888
8892
  };
8889
8893
 
8890
8894
  /**
@@ -5018,6 +5018,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5018
5018
 
5019
5019
  declare interface Environment {
5020
5020
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5021
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5021
5022
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5022
5023
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5023
5024
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8505,16 +8506,17 @@ declare type LayoutIdentity = Identity_5 & {
8505
8506
  };
8506
8507
 
8507
8508
  /**
8508
- * Generated when the window is created, and all of its layout's views have either finished or failed
8509
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8509
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8510
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8510
8511
  * @interface
8511
8512
  */
8512
8513
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8513
8514
  type: 'layout-initialized';
8514
8515
  layoutIdentity: OpenFin.LayoutIdentity;
8515
- ofViews: (OpenFin.Identity & {
8516
+ ofViews: {
8517
+ identity: OpenFin.Identity;
8516
8518
  entityType: 'view';
8517
- })[];
8519
+ }[];
8518
8520
  };
8519
8521
 
8520
8522
  /**
@@ -8882,9 +8884,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8882
8884
  declare type LayoutReadyEvent = BaseEvent_5 & {
8883
8885
  type: 'layout-ready';
8884
8886
  layoutIdentity: OpenFin.LayoutIdentity;
8885
- views: (OpenFin.Identity & {
8887
+ views: {
8888
+ identity: OpenFin.Identity;
8886
8889
  success: boolean;
8887
- })[];
8890
+ error?: Error;
8891
+ }[];
8888
8892
  };
8889
8893
 
8890
8894
  /**
@@ -5018,6 +5018,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5018
5018
 
5019
5019
  declare interface Environment {
5020
5020
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5021
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5021
5022
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5022
5023
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5023
5024
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8505,16 +8506,17 @@ declare type LayoutIdentity = Identity_5 & {
8505
8506
  };
8506
8507
 
8507
8508
  /**
8508
- * Generated when the window is created, and all of its layout's views have either finished or failed
8509
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8509
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8510
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8510
8511
  * @interface
8511
8512
  */
8512
8513
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8513
8514
  type: 'layout-initialized';
8514
8515
  layoutIdentity: OpenFin.LayoutIdentity;
8515
- ofViews: (OpenFin.Identity & {
8516
+ ofViews: {
8517
+ identity: OpenFin.Identity;
8516
8518
  entityType: 'view';
8517
- })[];
8519
+ }[];
8518
8520
  };
8519
8521
 
8520
8522
  /**
@@ -8882,9 +8884,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8882
8884
  declare type LayoutReadyEvent = BaseEvent_5 & {
8883
8885
  type: 'layout-ready';
8884
8886
  layoutIdentity: OpenFin.LayoutIdentity;
8885
- views: (OpenFin.Identity & {
8887
+ views: {
8888
+ identity: OpenFin.Identity;
8886
8889
  success: boolean;
8887
- })[];
8890
+ error?: Error;
8891
+ }[];
8888
8892
  };
8889
8893
 
8890
8894
  /**
@@ -5066,6 +5066,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5066
5066
 
5067
5067
  declare interface Environment {
5068
5068
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5069
+ applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5069
5070
  createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5070
5071
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5071
5072
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
@@ -8634,16 +8635,17 @@ declare type LayoutIdentity = Identity_5 & {
8634
8635
  };
8635
8636
 
8636
8637
  /**
8637
- * Generated when the window is created, and all of its layout's views have either finished or failed
8638
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8638
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8639
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8639
8640
  * @interface
8640
8641
  */
8641
8642
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8642
8643
  type: 'layout-initialized';
8643
8644
  layoutIdentity: OpenFin.LayoutIdentity;
8644
- ofViews: (OpenFin.Identity & {
8645
+ ofViews: {
8646
+ identity: OpenFin.Identity;
8645
8647
  entityType: 'view';
8646
- })[];
8648
+ }[];
8647
8649
  };
8648
8650
 
8649
8651
  /**
@@ -9181,9 +9183,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9181
9183
  declare type LayoutReadyEvent = BaseEvent_5 & {
9182
9184
  type: 'layout-ready';
9183
9185
  layoutIdentity: OpenFin.LayoutIdentity;
9184
- views: (OpenFin.Identity & {
9186
+ views: {
9187
+ identity: OpenFin.Identity;
9185
9188
  success: boolean;
9186
- })[];
9189
+ error?: Error;
9190
+ }[];
9187
9191
  };
9188
9192
 
9189
9193
  /**
@@ -11287,7 +11287,7 @@ const validate_1 = validate;
11287
11287
  const base_1$6 = base$1;
11288
11288
  const common_utils_1 = commonUtils;
11289
11289
  const layout_entities_1 = layoutEntities;
11290
- const layout_constants_1 = layout_constants;
11290
+ const layout_constants_1$1 = layout_constants;
11291
11291
  /**
11292
11292
  *
11293
11293
  * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
@@ -11432,7 +11432,7 @@ class Layout extends base_1$6.Base {
11432
11432
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
11433
11433
  * The client is for {@link LayoutEntitiesController}
11434
11434
  */
11435
- _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1.LAYOUT_CONTROLLER_ID, this.identity)));
11435
+ _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1$1.LAYOUT_CONTROLLER_ID, this.identity)));
11436
11436
  /**
11437
11437
  * Replaces a Platform window's layout with a new layout.
11438
11438
  *
@@ -11660,11 +11660,12 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11660
11660
  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");
11661
11661
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11662
11662
  };
11663
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_waitForBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11663
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11664
11664
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11665
11665
  Factory$2.LayoutModule = void 0;
11666
11666
  const base_1$5 = base$1;
11667
11667
  const Instance_1$2 = Instance$1;
11668
+ const layout_constants_1 = layout_constants;
11668
11669
  /**
11669
11670
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
11670
11671
  */
@@ -11723,45 +11724,18 @@ class LayoutModule extends base_1$5.Base {
11723
11724
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
11724
11725
  }
11725
11726
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
11727
+ // preload the client
11728
+ await this.fin.Platform.getCurrentSync().getClient();
11726
11729
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
11727
- // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11728
- let backCompatLayoutPromise;
11730
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), options);
11729
11731
  if (!options.layoutManagerOverride) {
11730
- backCompatLayoutPromise = __classPrivateFieldGet$4(this, _LayoutModule_waitForBackCompatLayoutManager, "f").call(this, this.fin);
11731
- }
11732
- // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
11733
- const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11734
- const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11735
- await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11736
- if (backCompatLayoutPromise) {
11737
- return backCompatLayoutPromise;
11732
+ // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11733
+ const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
11734
+ const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11735
+ return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
11738
11736
  }
11739
- // warn user if they do not call create() in the next 30 seconds
11740
- setTimeout(() => {
11741
- if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
11742
- console.warn(`[Layout.init] Layout.init was called 30s ago, but no layouts have been created yet. Make sure you ` +
11743
- `override LayoutManager.applyLayoutSnapshot, and then call fin.Platform.Layout.create()`);
11744
- }
11745
- }, 30000);
11746
11737
  return this.wrapSync(this.fin.me.identity);
11747
11738
  };
11748
- // deprecate with CORE-1081
11749
- _LayoutModule_waitForBackCompatLayoutManager.set(this, async (fin) => {
11750
- let layoutManager;
11751
- let resolve;
11752
- const layoutResolved = new Promise((r) => {
11753
- resolve = r;
11754
- });
11755
- // wait for a layout to be created
11756
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
11757
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11758
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11759
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
11760
- // TODO: eventually deprecate this
11761
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
11762
- });
11763
- return layoutResolved;
11764
- });
11765
11739
  /**
11766
11740
  * Returns the layout manager for the current window
11767
11741
  * @returns
@@ -11871,7 +11845,7 @@ class LayoutModule extends base_1$5.Base {
11871
11845
  }
11872
11846
  }
11873
11847
  Factory$2.LayoutModule = LayoutModule;
11874
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_waitForBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11848
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11875
11849
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
11876
11850
  throw new Error(`You must call init before using the API ${method}`);
11877
11851
  }
@@ -16182,6 +16156,9 @@ function requireNodeEnv () {
16182
16156
  async initLayoutManager() {
16183
16157
  throw new Error('Method not implemented.');
16184
16158
  }
16159
+ async applyLayoutSnapshot() {
16160
+ throw new Error('Method not implemented.');
16161
+ }
16185
16162
  async createLayout() {
16186
16163
  throw new Error('Method not implemented.');
16187
16164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "35.79.1",
3
+ "version": "35.79.3",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",