@openfin/node-adapter 40.82.15 → 40.82.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -2990,11 +2990,8 @@ function requireInstance$2 () {
2990
2990
  // don't expose
2991
2991
  });
2992
2992
  try {
2993
- const layoutWindow = await this.getCurrentWindow();
2994
- const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
2995
- const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
2996
- const stackDefinition = (await client.getStackByView(this.identity));
2997
- return layout_entities_1.LayoutNode.getEntity(stackDefinition, client);
2993
+ const layout = await this.getParentLayout();
2994
+ return layout.getStackByView(this.identity);
2998
2995
  }
2999
2996
  catch (error) {
3000
2997
  throw new transport_errors_1.RuntimeError({ reason: 'This view does not belong to a stack.', error });
@@ -11986,6 +11983,17 @@ class Layout extends base_1$5.Base {
11986
11983
  const root = await client.getRoot('layoutName' in this.identity ? this.identity : undefined);
11987
11984
  return layout_entities_1.LayoutNode.getEntity(root, client);
11988
11985
  }
11986
+ async getStackByView(identity) {
11987
+ this.wire.sendAction('layout-get-stack-by-view').catch(() => {
11988
+ // don't expose
11989
+ });
11990
+ const client = await __classPrivateFieldGet$4(this, _Layout_layoutClient, "f").getValue();
11991
+ const stack = await client.getStackByView(identity);
11992
+ if (!stack) {
11993
+ throw new Error(`No stack found for view: ${identity.uuid}/${identity.name}`);
11994
+ }
11995
+ return layout_entities_1.LayoutNode.getEntity(stack, client);
11996
+ }
11989
11997
  }
11990
11998
  Instance$1.Layout = Layout;
11991
11999
  _Layout_layoutClient = new WeakMap();
@@ -12179,7 +12187,7 @@ class LayoutModule extends base_1$4.Base {
12179
12187
  this.wire.sendAction('layout-get-current').catch((e) => {
12180
12188
  // don't expose
12181
12189
  });
12182
- if (!this.fin.me.isWindow) {
12190
+ if (this.wire.environment.type === 'openfin' && !this.fin.me.isWindow) {
12183
12191
  throw new Error('You are not in a Window context. Only Windows can have a Layout.');
12184
12192
  }
12185
12193
  const { uuid, name } = this.fin.me;
@@ -12202,7 +12210,7 @@ class LayoutModule extends base_1$4.Base {
12202
12210
  this.wire.sendAction('layout-get-current-sync').catch((e) => {
12203
12211
  // don't expose
12204
12212
  });
12205
- if (!this.fin.me.isWindow) {
12213
+ if (this.wire.environment.type === 'openfin' && !this.fin.me.isWindow) {
12206
12214
  throw new Error('You are not in a Window context. Only Windows can have a Layout.');
12207
12215
  }
12208
12216
  const { uuid, name } = this.fin.me;
@@ -17631,7 +17639,7 @@ class NodeEnvironment extends BaseEnvironment_1 {
17631
17639
  };
17632
17640
  }
17633
17641
  getAdapterVersionSync() {
17634
- return "40.82.15";
17642
+ return "40.82.17";
17635
17643
  }
17636
17644
  observeBounds(element, onChange) {
17637
17645
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "40.82.15",
3
+ "version": "40.82.17",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -23,7 +23,7 @@
23
23
  "author": "OpenFin",
24
24
  "dependencies": {
25
25
  "@types/node": "^20.14.2",
26
- "@openfin/core": "40.82.15",
26
+ "@openfin/core": "40.82.17",
27
27
  "lodash": "^4.17.21",
28
28
  "ws": "^7.3.0"
29
29
  }