@openfin/core 35.79.1 → 35.79.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.
@@ -5014,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5014
5014
 
5015
5015
  declare interface Environment {
5016
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5017
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5018
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5019
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -8495,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8495
8496
  };
8496
8497
 
8497
8498
  /**
8498
- * Generated when the window is created, and all of its layout's views have either finished or failed
8499
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8500
8501
  * @interface
8501
8502
  */
8502
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8503
8504
  type: 'layout-initialized';
8504
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8505
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8506
8508
  entityType: 'view';
8507
- })[];
8509
+ }[];
8508
8510
  };
8509
8511
 
8510
8512
  /**
@@ -8872,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8872
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8873
8875
  type: 'layout-ready';
8874
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8875
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8876
8879
  success: boolean;
8877
- })[];
8880
+ error?: Error;
8881
+ }[];
8878
8882
  };
8879
8883
 
8880
8884
  /**
@@ -5014,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5014
5014
 
5015
5015
  declare interface Environment {
5016
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5017
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5018
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5019
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -8495,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8495
8496
  };
8496
8497
 
8497
8498
  /**
8498
- * Generated when the window is created, and all of its layout's views have either finished or failed
8499
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8500
8501
  * @interface
8501
8502
  */
8502
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8503
8504
  type: 'layout-initialized';
8504
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8505
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8506
8508
  entityType: 'view';
8507
- })[];
8509
+ }[];
8508
8510
  };
8509
8511
 
8510
8512
  /**
@@ -8872,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8872
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8873
8875
  type: 'layout-ready';
8874
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8875
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8876
8879
  success: boolean;
8877
- })[];
8880
+ error?: Error;
8881
+ }[];
8878
8882
  };
8879
8883
 
8880
8884
  /**
@@ -5014,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5014
5014
 
5015
5015
  declare interface Environment {
5016
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5017
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5018
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5019
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -8495,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8495
8496
  };
8496
8497
 
8497
8498
  /**
8498
- * Generated when the window is created, and all of its layout's views have either finished or failed
8499
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8500
8501
  * @interface
8501
8502
  */
8502
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8503
8504
  type: 'layout-initialized';
8504
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8505
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8506
8508
  entityType: 'view';
8507
- })[];
8509
+ }[];
8508
8510
  };
8509
8511
 
8510
8512
  /**
@@ -8872,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8872
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8873
8875
  type: 'layout-ready';
8874
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8875
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8876
8879
  success: boolean;
8877
- })[];
8880
+ error?: Error;
8881
+ }[];
8878
8882
  };
8879
8883
 
8880
8884
  /**
package/out/mock.d.ts CHANGED
@@ -5062,6 +5062,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5062
5062
 
5063
5063
  declare interface Environment {
5064
5064
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5065
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5065
5066
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5066
5067
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5067
5068
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -8602,16 +8603,17 @@ declare type LayoutIdentity = Identity_5 & {
8602
8603
  };
8603
8604
 
8604
8605
  /**
8605
- * Generated when the window is created, and all of its layout's views have either finished or failed
8606
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8606
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8607
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8607
8608
  * @interface
8608
8609
  */
8609
8610
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8610
8611
  type: 'layout-initialized';
8611
8612
  layoutIdentity: OpenFin_2.LayoutIdentity;
8612
- ofViews: (OpenFin_2.Identity & {
8613
+ ofViews: {
8614
+ identity: OpenFin_2.Identity;
8613
8615
  entityType: 'view';
8614
- })[];
8616
+ }[];
8615
8617
  };
8616
8618
 
8617
8619
  /**
@@ -9149,9 +9151,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9149
9151
  declare type LayoutReadyEvent = BaseEvent_5 & {
9150
9152
  type: 'layout-ready';
9151
9153
  layoutIdentity: OpenFin_2.LayoutIdentity;
9152
- views: (OpenFin_2.Identity & {
9154
+ views: {
9155
+ identity: OpenFin_2.Identity;
9153
9156
  success: boolean;
9154
- })[];
9157
+ error?: Error;
9158
+ }[];
9155
9159
  };
9156
9160
 
9157
9161
  /**
package/out/mock.js CHANGED
@@ -11507,7 +11507,7 @@ const validate_1 = validate;
11507
11507
  const base_1$6 = base;
11508
11508
  const common_utils_1 = commonUtils;
11509
11509
  const layout_entities_1 = layoutEntities;
11510
- const layout_constants_1 = layout_constants;
11510
+ const layout_constants_1$1 = layout_constants;
11511
11511
  /**
11512
11512
  *
11513
11513
  * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
@@ -11652,7 +11652,7 @@ class Layout extends base_1$6.Base {
11652
11652
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
11653
11653
  * The client is for {@link LayoutEntitiesController}
11654
11654
  */
11655
- _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)));
11655
+ _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)));
11656
11656
  /**
11657
11657
  * Replaces a Platform window's layout with a new layout.
11658
11658
  *
@@ -11880,11 +11880,12 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11880
11880
  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");
11881
11881
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11882
11882
  };
11883
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_waitForBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11883
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11884
11884
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11885
11885
  Factory$2.LayoutModule = void 0;
11886
11886
  const base_1$5 = base;
11887
11887
  const Instance_1$2 = Instance$1;
11888
+ const layout_constants_1 = layout_constants;
11888
11889
  /**
11889
11890
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
11890
11891
  */
@@ -11943,45 +11944,18 @@ class LayoutModule extends base_1$5.Base {
11943
11944
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
11944
11945
  }
11945
11946
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
11947
+ // preload the client
11948
+ await this.fin.Platform.getCurrentSync().getClient();
11946
11949
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
11947
- // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11948
- let backCompatLayoutPromise;
11950
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), options);
11949
11951
  if (!options.layoutManagerOverride) {
11950
- backCompatLayoutPromise = __classPrivateFieldGet$4(this, _LayoutModule_waitForBackCompatLayoutManager, "f").call(this, this.fin);
11951
- }
11952
- // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
11953
- const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11954
- const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11955
- await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11956
- if (backCompatLayoutPromise) {
11957
- return backCompatLayoutPromise;
11952
+ // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11953
+ const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
11954
+ const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11955
+ return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
11958
11956
  }
11959
- // warn user if they do not call create() in the next 30 seconds
11960
- setTimeout(() => {
11961
- if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
11962
- console.warn(`[Layout.init] Layout.init was called 30s ago, but no layouts have been created yet. Make sure you ` +
11963
- `override LayoutManager.applyLayoutSnapshot, and then call fin.Platform.Layout.create()`);
11964
- }
11965
- }, 30000);
11966
11957
  return this.wrapSync(this.fin.me.identity);
11967
11958
  };
11968
- // deprecate with CORE-1081
11969
- _LayoutModule_waitForBackCompatLayoutManager.set(this, async (fin) => {
11970
- let layoutManager;
11971
- let resolve;
11972
- const layoutResolved = new Promise((r) => {
11973
- resolve = r;
11974
- });
11975
- // wait for a layout to be created
11976
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
11977
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11978
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11979
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
11980
- // TODO: eventually deprecate this
11981
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
11982
- });
11983
- return layoutResolved;
11984
- });
11985
11959
  /**
11986
11960
  * Returns the layout manager for the current window
11987
11961
  * @returns
@@ -12091,7 +12065,7 @@ class LayoutModule extends base_1$5.Base {
12091
12065
  }
12092
12066
  }
12093
12067
  Factory$2.LayoutModule = LayoutModule;
12094
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_waitForBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12068
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12095
12069
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
12096
12070
  throw new Error(`You must call init before using the API ${method}`);
12097
12071
  }
@@ -15892,6 +15866,9 @@ class MockEnvironment {
15892
15866
  initLayoutManager() {
15893
15867
  throw new Error(me_1.environmentUnsupportedMessage);
15894
15868
  }
15869
+ applyLayoutSnapshot() {
15870
+ throw new Error(me_1.environmentUnsupportedMessage);
15871
+ }
15895
15872
  async createLayout() {
15896
15873
  throw new Error(me_1.environmentUnsupportedMessage);
15897
15874
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "35.79.1",
3
+ "version": "35.79.2",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/mock.js",