@openfin/remote-adapter 39.83.4 → 39.83.5

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.
@@ -15971,7 +15971,7 @@ var __classPrivateFieldGet$2 = (commonjsGlobal && commonjsGlobal.__classPrivateF
15971
15971
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
15972
15972
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15973
15973
  };
15974
- var _Layout_layoutClient;
15974
+ var _Layout_instances, _Layout_layoutClient, _Layout_forwardLayoutAction;
15975
15975
  Object.defineProperty(Instance$1, "__esModule", { value: true });
15976
15976
  Instance$1.Layout = void 0;
15977
15977
  const lazy_1 = lazy;
@@ -16125,6 +16125,7 @@ class Layout extends base_1$4.Base {
16125
16125
  // eslint-disable-next-line no-shadow
16126
16126
  constructor(identity, wire) {
16127
16127
  super(wire);
16128
+ _Layout_instances.add(this);
16128
16129
  /**
16129
16130
  * @internal
16130
16131
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
@@ -16364,9 +16365,50 @@ class Layout extends base_1$4.Base {
16364
16365
  }
16365
16366
  return layout_entities_1.LayoutNode.getEntity(stack, client);
16366
16367
  }
16368
+ /**
16369
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
16370
+ *
16371
+ * @param viewOptions - The options for creating the view.
16372
+ * @param options - Optional parameters for adding the view.
16373
+ * @param options.location - The location where the view should be added.
16374
+ * @param options.targetView - The target view to which the new view should be added.
16375
+ * @returns A promise that resolves to an object containing the identity of the added view.
16376
+ */
16377
+ async addView(viewOptions, { location, targetView } = {}) {
16378
+ this.wire.sendAction('layout-add-view').catch((e) => {
16379
+ // don't expose
16380
+ });
16381
+ const { identity } = await __classPrivateFieldGet$2(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-add-view', {
16382
+ viewOptions,
16383
+ location,
16384
+ targetView
16385
+ });
16386
+ return { identity };
16387
+ }
16388
+ /**
16389
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
16390
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
16391
+ *
16392
+ * @param viewIdentity - The identity of the view to close.
16393
+ * @returns A promise that resolves when the view is closed.
16394
+ */
16395
+ async closeView(viewIdentity) {
16396
+ this.wire.sendAction('layout-close-view').catch((e) => {
16397
+ // don't expose
16398
+ });
16399
+ await __classPrivateFieldGet$2(this, _Layout_instances, "m", _Layout_forwardLayoutAction).call(this, 'layout-close-view', { viewIdentity });
16400
+ }
16367
16401
  }
16368
16402
  Instance$1.Layout = Layout;
16369
- _Layout_layoutClient = new WeakMap();
16403
+ _Layout_layoutClient = new WeakMap(), _Layout_instances = new WeakSet(), _Layout_forwardLayoutAction =
16404
+ /**
16405
+ * @internal
16406
+ * Use to type-guard actions sent to the layout via the provider.
16407
+ */
16408
+ async function _Layout_forwardLayoutAction(action, payload) {
16409
+ const client = await this.platform.getClient();
16410
+ return client.dispatch(action, { target: this.identity, opts: payload });
16411
+ };
16370
16412
 
16371
16413
  var __classPrivateFieldGet$1 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
16372
16414
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/remote-adapter",
3
- "version": "39.83.4",
3
+ "version": "39.83.5",
4
4
  "description": "Establish intermachine runtime connections using webRTC.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,
@@ -19,6 +19,6 @@
19
19
  "author": "OpenFin",
20
20
  "dependencies": {
21
21
  "lodash": "^4.17.21",
22
- "@openfin/core": "39.83.4"
22
+ "@openfin/core": "39.83.5"
23
23
  }
24
24
  }