@openfin/core 33.76.31 → 33.76.38
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.
- package/OpenFin.d.ts +1 -1
- package/README.md +29 -4
- package/fin.d.ts +2 -2
- package/{src → out}/GlobalOpenFin.d.ts +1 -1
- package/out/mock-alpha.d.ts +16112 -0
- package/out/mock-beta.d.ts +16112 -0
- package/out/mock-public.d.ts +16112 -0
- package/out/mock.d.ts +16797 -0
- package/out/mock.js +17104 -0
- package/package.json +30 -23
- package/LICENSE +0 -13
- package/NOTICE +0 -16
- package/openfin-core-33.76.31.tgz +0 -0
- package/src/OpenFin.d.ts +0 -3080
- package/src/OpenFin.js +0 -2
- package/src/api/api-exposer/api-consumer.d.ts +0 -28
- package/src/api/api-exposer/api-consumer.js +0 -28
- package/src/api/api-exposer/api-exposer.d.ts +0 -35
- package/src/api/api-exposer/api-exposer.js +0 -38
- package/src/api/api-exposer/decorators.d.ts +0 -10
- package/src/api/api-exposer/decorators.js +0 -18
- package/src/api/api-exposer/index.d.ts +0 -4
- package/src/api/api-exposer/index.js +0 -20
- package/src/api/api-exposer/strategies/index.d.ts +0 -1
- package/src/api/api-exposer/strategies/index.js +0 -17
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
- package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
- package/src/api/application/Factory.d.ts +0 -148
- package/src/api/application/Factory.js +0 -230
- package/src/api/application/Instance.d.ts +0 -321
- package/src/api/application/Instance.js +0 -453
- package/src/api/application/index.d.ts +0 -3
- package/src/api/application/index.js +0 -19
- package/src/api/base.d.ts +0 -48
- package/src/api/base.js +0 -177
- package/src/api/clipboard/index.d.ts +0 -92
- package/src/api/clipboard/index.js +0 -120
- package/src/api/events/application.d.ts +0 -146
- package/src/api/events/application.js +0 -2
- package/src/api/events/base.d.ts +0 -42
- package/src/api/events/base.js +0 -2
- package/src/api/events/channel.d.ts +0 -30
- package/src/api/events/channel.js +0 -2
- package/src/api/events/emitterMap.d.ts +0 -11
- package/src/api/events/emitterMap.js +0 -35
- package/src/api/events/eventAggregator.d.ts +0 -5
- package/src/api/events/eventAggregator.js +0 -35
- package/src/api/events/externalApplication.d.ts +0 -19
- package/src/api/events/externalApplication.js +0 -2
- package/src/api/events/frame.d.ts +0 -30
- package/src/api/events/frame.js +0 -2
- package/src/api/events/globalHotkey.d.ts +0 -20
- package/src/api/events/globalHotkey.js +0 -2
- package/src/api/events/platform.d.ts +0 -26
- package/src/api/events/platform.js +0 -2
- package/src/api/events/system.d.ts +0 -113
- package/src/api/events/system.js +0 -2
- package/src/api/events/typedEventEmitter.d.ts +0 -20
- package/src/api/events/typedEventEmitter.js +0 -2
- package/src/api/events/view.d.ts +0 -82
- package/src/api/events/view.js +0 -2
- package/src/api/events/webcontents.d.ts +0 -266
- package/src/api/events/webcontents.js +0 -2
- package/src/api/events/window.d.ts +0 -352
- package/src/api/events/window.js +0 -2
- package/src/api/external-application/Factory.d.ts +0 -27
- package/src/api/external-application/Factory.js +0 -40
- package/src/api/external-application/Instance.d.ts +0 -102
- package/src/api/external-application/Instance.js +0 -109
- package/src/api/external-application/index.d.ts +0 -3
- package/src/api/external-application/index.js +0 -19
- package/src/api/fin.d.ts +0 -51
- package/src/api/fin.js +0 -42
- package/src/api/frame/Factory.d.ts +0 -37
- package/src/api/frame/Factory.js +0 -69
- package/src/api/frame/Instance.d.ts +0 -123
- package/src/api/frame/Instance.js +0 -130
- package/src/api/frame/index.d.ts +0 -3
- package/src/api/frame/index.js +0 -19
- package/src/api/global-hotkey/index.d.ts +0 -38
- package/src/api/global-hotkey/index.js +0 -64
- package/src/api/interappbus/channel/channel.d.ts +0 -28
- package/src/api/interappbus/channel/channel.js +0 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +0 -340
- package/src/api/interappbus/channel/channels-docs.js +0 -398
- package/src/api/interappbus/channel/client.d.ts +0 -24
- package/src/api/interappbus/channel/client.js +0 -89
- package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
- package/src/api/interappbus/channel/connection-manager.js +0 -246
- package/src/api/interappbus/channel/index.d.ts +0 -25
- package/src/api/interappbus/channel/index.js +0 -169
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
- package/src/api/interappbus/channel/protocols/index.js +0 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
- package/src/api/interappbus/channel/protocols/strategy.js +0 -2
- package/src/api/interappbus/channel/provider.d.ts +0 -34
- package/src/api/interappbus/channel/provider.js +0 -166
- package/src/api/interappbus/index.d.ts +0 -85
- package/src/api/interappbus/index.js +0 -175
- package/src/api/interop/Factory.d.ts +0 -37
- package/src/api/interop/Factory.js +0 -76
- package/src/api/interop/InteropBroker.d.ts +0 -437
- package/src/api/interop/InteropBroker.js +0 -1085
- package/src/api/interop/InteropClient.d.ts +0 -278
- package/src/api/interop/InteropClient.js +0 -459
- package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
- package/src/api/interop/SessionContextGroupBroker.js +0 -108
- package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
- package/src/api/interop/SessionContextGroupClient.js +0 -86
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
- package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
- package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -208
- package/src/api/interop/fdc3/fdc3-1.2.js +0 -438
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -301
- package/src/api/interop/fdc3/fdc3-2.0.js +0 -482
- package/src/api/interop/fdc3/fdc3.d.ts +0 -12
- package/src/api/interop/fdc3/fdc3.js +0 -35
- package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
- package/src/api/interop/fdc3/overrideCheck.js +0 -32
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
- package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
- package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
- package/src/api/interop/fdc3/utils.d.ts +0 -45
- package/src/api/interop/fdc3/utils.js +0 -239
- package/src/api/interop/fdc3/versions.d.ts +0 -1
- package/src/api/interop/fdc3/versions.js +0 -2
- package/src/api/interop/index.d.ts +0 -4
- package/src/api/interop/index.js +0 -20
- package/src/api/interop/utils.d.ts +0 -18
- package/src/api/interop/utils.js +0 -61
- package/src/api/me.d.ts +0 -40
- package/src/api/me.js +0 -134
- package/src/api/platform/Factory.d.ts +0 -115
- package/src/api/platform/Factory.js +0 -184
- package/src/api/platform/Instance.d.ts +0 -150
- package/src/api/platform/Instance.js +0 -332
- package/src/api/platform/common-utils.d.ts +0 -7
- package/src/api/platform/common-utils.js +0 -16
- package/src/api/platform/index.d.ts +0 -3
- package/src/api/platform/index.js +0 -19
- package/src/api/platform/layout/Factory.d.ts +0 -114
- package/src/api/platform/layout/Factory.js +0 -174
- package/src/api/platform/layout/Instance.d.ts +0 -57
- package/src/api/platform/layout/Instance.js +0 -126
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
- package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
- package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
- package/src/api/platform/layout/entities/layout-entities.d.ts +0 -235
- package/src/api/platform/layout/entities/layout-entities.js +0 -312
- package/src/api/platform/layout/entities/shapes.d.ts +0 -6
- package/src/api/platform/layout/entities/shapes.js +0 -2
- package/src/api/platform/layout/index.d.ts +0 -2
- package/src/api/platform/layout/index.js +0 -18
- package/src/api/platform/layout/layout.constants.d.ts +0 -1
- package/src/api/platform/layout/layout.constants.js +0 -4
- package/src/api/platform/layout/shapes.d.ts +0 -16
- package/src/api/platform/layout/shapes.js +0 -2
- package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
- package/src/api/platform/layout/utils/layout-traversal.js +0 -65
- package/src/api/platform/provider.d.ts +0 -163
- package/src/api/platform/provider.js +0 -2
- package/src/api/snapshot-source/Factory.d.ts +0 -38
- package/src/api/snapshot-source/Factory.js +0 -66
- package/src/api/snapshot-source/Instance.d.ts +0 -31
- package/src/api/snapshot-source/Instance.js +0 -132
- package/src/api/snapshot-source/index.d.ts +0 -3
- package/src/api/snapshot-source/index.js +0 -19
- package/src/api/snapshot-source/utils.d.ts +0 -2
- package/src/api/snapshot-source/utils.js +0 -6
- package/src/api/system/index.d.ts +0 -517
- package/src/api/system/index.js +0 -895
- package/src/api/view/Factory.d.ts +0 -50
- package/src/api/view/Factory.js +0 -103
- package/src/api/view/Instance.d.ts +0 -487
- package/src/api/view/Instance.js +0 -557
- package/src/api/view/index.d.ts +0 -3
- package/src/api/view/index.js +0 -19
- package/src/api/webcontents/main.d.ts +0 -32
- package/src/api/webcontents/main.js +0 -156
- package/src/api/window/Factory.d.ts +0 -45
- package/src/api/window/Factory.js +0 -91
- package/src/api/window/Instance.d.ts +0 -1090
- package/src/api/window/Instance.js +0 -1349
- package/src/api/window/index.d.ts +0 -3
- package/src/api/window/index.js +0 -19
- package/src/browser.d.ts +0 -10
- package/src/browser.js +0 -36
- package/src/environment/browser.d.ts +0 -29
- package/src/environment/browser.js +0 -60
- package/src/environment/environment.d.ts +0 -33
- package/src/environment/environment.js +0 -4
- package/src/environment/mockEnvironment.d.ts +0 -27
- package/src/environment/mockEnvironment.js +0 -61
- package/src/environment/node-env.d.ts +0 -29
- package/src/environment/node-env.js +0 -72
- package/src/fdc3.d.ts +0 -3
- package/src/fdc3.js +0 -9
- package/src/mock.d.ts +0 -3
- package/src/mock.js +0 -18
- package/src/namespaces.d.ts +0 -21
- package/src/namespaces.js +0 -24
- package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
- package/src/shapes/ERROR_BOX_TYPES.js +0 -2
- package/src/shapes/WebOptions.d.ts +0 -13
- package/src/shapes/WebOptions.js +0 -2
- package/src/shapes/WindowOptions.d.ts +0 -43
- package/src/shapes/WindowOptions.js +0 -2
- package/src/shapes/protocol.d.ts +0 -200
- package/src/shapes/protocol.js +0 -2
- package/src/transport/mockWire.d.ts +0 -11
- package/src/transport/mockWire.js +0 -26
- package/src/transport/transport-errors.d.ts +0 -31
- package/src/transport/transport-errors.js +0 -79
- package/src/transport/transport.d.ts +0 -73
- package/src/transport/transport.js +0 -219
- package/src/transport/wire.d.ts +0 -77
- package/src/transport/wire.js +0 -36
- package/src/util/asyncFilter.d.ts +0 -1
- package/src/util/asyncFilter.js +0 -7
- package/src/util/channel-api-relay.d.ts +0 -13
- package/src/util/channel-api-relay.js +0 -47
- package/src/util/errors.d.ts +0 -10
- package/src/util/errors.js +0 -12
- package/src/util/exhaustive.d.ts +0 -1
- package/src/util/exhaustive.js +0 -7
- package/src/util/http.d.ts +0 -11
- package/src/util/http.js +0 -90
- package/src/util/inaccessibleObject.d.ts +0 -2
- package/src/util/inaccessibleObject.js +0 -49
- package/src/util/lazy.d.ts +0 -34
- package/src/util/lazy.js +0 -54
- package/src/util/normalize-config.d.ts +0 -3
- package/src/util/normalize-config.js +0 -52
- package/src/util/promises.d.ts +0 -5
- package/src/util/promises.js +0 -27
- package/src/util/ref-counter.d.ts +0 -7
- package/src/util/ref-counter.js +0 -52
- package/src/util/reversible-map.d.ts +0 -11
- package/src/util/reversible-map.js +0 -49
- package/src/util/runtimeVersioning.d.ts +0 -3
- package/src/util/runtimeVersioning.js +0 -25
- package/src/util/utilTypes.d.ts +0 -8
- package/src/util/utilTypes.js +0 -2
- package/src/util/validate.d.ts +0 -3
- package/src/util/validate.js +0 -11
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _Platform_connectToProvider;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Platform = void 0;
|
|
10
|
-
/* eslint-disable import/prefer-default-export, no-undef */
|
|
11
|
-
const base_1 = require("../base");
|
|
12
|
-
const validate_1 = require("../../util/validate");
|
|
13
|
-
// Reuse clients to avoid overwriting already-registered client in provider
|
|
14
|
-
const clientMap = new Map();
|
|
15
|
-
/** Manages the life cycle of windows and views in the application.
|
|
16
|
-
*
|
|
17
|
-
* Enables taking snapshots of itself and applyi
|
|
18
|
-
* ng them to restore a previous configuration
|
|
19
|
-
* as well as listen to <a href="tutorial-Platform.EventEmitter.html">platform events</a>.
|
|
20
|
-
* @namespace
|
|
21
|
-
*/
|
|
22
|
-
class Platform extends base_1.EmitterBase {
|
|
23
|
-
// eslint-disable-next-line no-shadow
|
|
24
|
-
constructor(identity, channel) {
|
|
25
|
-
// we piggyback off of application event emitter because from the core's perspective platform is just an app.
|
|
26
|
-
super(channel.wire, 'application', identity.uuid);
|
|
27
|
-
this.getClient = (identity) => {
|
|
28
|
-
this.wire.sendAction('platform-get-client', this.identity).catch((e) => {
|
|
29
|
-
// don't expose
|
|
30
|
-
});
|
|
31
|
-
const target = identity || this.identity;
|
|
32
|
-
const { uuid } = target;
|
|
33
|
-
if (!clientMap.has(uuid)) {
|
|
34
|
-
const clientPromise = __classPrivateFieldGet(this, _Platform_connectToProvider, "f").call(this, uuid);
|
|
35
|
-
clientMap.set(uuid, clientPromise);
|
|
36
|
-
}
|
|
37
|
-
// we set it above
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
39
|
-
return clientMap.get(uuid);
|
|
40
|
-
};
|
|
41
|
-
_Platform_connectToProvider.set(this, async (uuid) => {
|
|
42
|
-
try {
|
|
43
|
-
const channelName = `custom-frame-${uuid}`;
|
|
44
|
-
const client = await this._channel.connect(channelName, { wait: false });
|
|
45
|
-
client.onDisconnection(() => {
|
|
46
|
-
clientMap.delete(uuid);
|
|
47
|
-
});
|
|
48
|
-
return client;
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
clientMap.delete(uuid);
|
|
52
|
-
throw new Error('The targeted Platform is not currently running. Listen for application-started event for the given Uuid.');
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
// Deprecated (renamed)
|
|
56
|
-
this.launchLegacyManifest = this.launchContentManifest;
|
|
57
|
-
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
58
|
-
if (errorMsg) {
|
|
59
|
-
throw new Error(errorMsg);
|
|
60
|
-
}
|
|
61
|
-
this._channel = channel;
|
|
62
|
-
this.identity = { uuid: identity.uuid };
|
|
63
|
-
this.Layout = this.fin.Platform.Layout;
|
|
64
|
-
this.Application = this.fin.Application.wrapSync(this.identity);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Creates a new view and attaches it to a specified target window.
|
|
68
|
-
* @param { View~options } viewOptions View creation options
|
|
69
|
-
* @param { Identity } [target] The window to which the new view is to be attached. If no target, create a view in a new window.
|
|
70
|
-
* @param { Identity } [targetView] If provided, the new view will be added to the same tabstrip as targetView.
|
|
71
|
-
* @return { Promise<View> }
|
|
72
|
-
* @tutorial Platform.createView
|
|
73
|
-
*/
|
|
74
|
-
async createView(viewOptions, target, targetView) {
|
|
75
|
-
this.wire.sendAction('platform-create-view', this.identity).catch((e) => {
|
|
76
|
-
// don't expose
|
|
77
|
-
});
|
|
78
|
-
const client = await this.getClient();
|
|
79
|
-
const response = await client.dispatch('create-view', {
|
|
80
|
-
target,
|
|
81
|
-
opts: viewOptions,
|
|
82
|
-
targetView
|
|
83
|
-
});
|
|
84
|
-
if (!response || (0, validate_1.validateIdentity)(response.identity)) {
|
|
85
|
-
throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
|
|
86
|
-
}
|
|
87
|
-
return this.fin.View.wrapSync(response.identity);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Creates a new Window.
|
|
91
|
-
* @param { Window~options } options Window creation options
|
|
92
|
-
* @return { Promise<_Window> }
|
|
93
|
-
* @tutorial Platform.createWindow
|
|
94
|
-
*/
|
|
95
|
-
async createWindow(options) {
|
|
96
|
-
this.wire.sendAction('platform-create-window', this.identity).catch((e) => {
|
|
97
|
-
// don't expose
|
|
98
|
-
});
|
|
99
|
-
const client = await this.getClient();
|
|
100
|
-
if (!options.reason) {
|
|
101
|
-
options.reason = 'api-call';
|
|
102
|
-
}
|
|
103
|
-
const response = await client.dispatch('create-view-container', options);
|
|
104
|
-
if (!response || (0, validate_1.validateIdentity)(response.identity)) {
|
|
105
|
-
throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
|
|
106
|
-
}
|
|
107
|
-
const { identity } = response;
|
|
108
|
-
const res = this.fin.Window.wrapSync(identity);
|
|
109
|
-
// we add the identity at the top level for backwards compatibility.
|
|
110
|
-
res.name = identity.name;
|
|
111
|
-
res.uuid = identity.uuid;
|
|
112
|
-
return res;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Closes current platform, all its windows, and their views.
|
|
116
|
-
* @return { Promise<void> }
|
|
117
|
-
* @tutorial Platform.quit
|
|
118
|
-
*/
|
|
119
|
-
async quit() {
|
|
120
|
-
this.wire.sendAction('platform-quit', this.identity).catch((e) => {
|
|
121
|
-
// don't expose
|
|
122
|
-
});
|
|
123
|
-
const client = await this.getClient();
|
|
124
|
-
return client.dispatch('quit');
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Closes a specified view in a target window.
|
|
128
|
-
* @param { Identity } viewIdentity View identity
|
|
129
|
-
* @return { Promise<void> }
|
|
130
|
-
* @tutorial Platform.closeView
|
|
131
|
-
*/
|
|
132
|
-
async closeView(viewIdentity) {
|
|
133
|
-
this.wire.sendAction('platform-close-view', this.identity).catch((e) => {
|
|
134
|
-
// don't expose
|
|
135
|
-
});
|
|
136
|
-
const client = await this.getClient();
|
|
137
|
-
await client.dispatch('close-view', {
|
|
138
|
-
view: viewIdentity
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* ***DEPRECATED - please use Platform.createView.***
|
|
143
|
-
* Reparents a specified view in a new target window.
|
|
144
|
-
* @param { Identity } viewIdentity View identity
|
|
145
|
-
* @param { Identity } target new owner window identity
|
|
146
|
-
* @return { Promise<View> }
|
|
147
|
-
* @tutorial Platform.createView
|
|
148
|
-
*/
|
|
149
|
-
async reparentView(viewIdentity, target) {
|
|
150
|
-
var _a;
|
|
151
|
-
// eslint-disable-next-line no-console
|
|
152
|
-
console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
|
|
153
|
-
this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
|
|
154
|
-
// don't expose
|
|
155
|
-
});
|
|
156
|
-
const normalizedViewIdentity = {
|
|
157
|
-
...viewIdentity,
|
|
158
|
-
uuid: (_a = viewIdentity.uuid) !== null && _a !== void 0 ? _a : this.identity.uuid
|
|
159
|
-
};
|
|
160
|
-
const view = await this.fin.View.wrap(normalizedViewIdentity);
|
|
161
|
-
const viewOptions = await view.getOptions();
|
|
162
|
-
return this.createView(viewOptions, target);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Returns a snapshot of the platform in its current state.
|
|
166
|
-
*
|
|
167
|
-
* Can be used to restore an application to a previous state.
|
|
168
|
-
* @return { Promise<Snapshot> }
|
|
169
|
-
* @tutorial Platform.getSnapshot
|
|
170
|
-
*/
|
|
171
|
-
async getSnapshot() {
|
|
172
|
-
this.wire.sendAction('platform-get-snapshot', this.identity).catch((e) => {
|
|
173
|
-
// don't expose
|
|
174
|
-
});
|
|
175
|
-
const client = await this.getClient();
|
|
176
|
-
return client.dispatch('get-snapshot');
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
|
|
180
|
-
*
|
|
181
|
-
* Returns a snapshot of a single view's options in its current state.
|
|
182
|
-
*
|
|
183
|
-
* Can be used to restore a view to a previous state.
|
|
184
|
-
*
|
|
185
|
-
* @param { Identity } viewIdentity View identity
|
|
186
|
-
* @returns { Promise<ViewState> }
|
|
187
|
-
* @internal
|
|
188
|
-
* @experimental
|
|
189
|
-
* @tutorial Platform.getViewSnapshot
|
|
190
|
-
*/
|
|
191
|
-
async getViewSnapshot(viewIdentity) {
|
|
192
|
-
const client = await this.getClient();
|
|
193
|
-
return client.dispatch('get-view-snapshot', { viewIdentity });
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Adds a snapshot to a running Platform.
|
|
197
|
-
* Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
|
|
198
|
-
*
|
|
199
|
-
* Can optionally close existing windows and overwrite current platform state with that of a snapshot.
|
|
200
|
-
*
|
|
201
|
-
* The function accepts either a snapshot taken using {@link Platform#getSnapshot getSnapshot},
|
|
202
|
-
* or a url or filepath to a snapshot JSON object.
|
|
203
|
-
* @param { Snapshot | string } requestedSnapshot Snapshot to apply, or a url or filepath.
|
|
204
|
-
* @param { ApplySnapshotOptions } [options] Optional parameters to specify whether existing windows should be closed.
|
|
205
|
-
* @return { Promise<Platform> }
|
|
206
|
-
* @tutorial Platform.applySnapshot
|
|
207
|
-
*/
|
|
208
|
-
async applySnapshot(requestedSnapshot, options) {
|
|
209
|
-
this.wire.sendAction('platform-apply-snapshot', this.identity).catch((e) => {
|
|
210
|
-
// don't expose
|
|
211
|
-
});
|
|
212
|
-
const errMsg = 'Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.';
|
|
213
|
-
let snapshot;
|
|
214
|
-
if (typeof requestedSnapshot === 'string') {
|
|
215
|
-
// Fetch and parse snapshot
|
|
216
|
-
try {
|
|
217
|
-
const response = await this._channel.wire.sendAction('get-application-manifest', {
|
|
218
|
-
manifestUrl: requestedSnapshot
|
|
219
|
-
});
|
|
220
|
-
snapshot = response.payload.data;
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
throw new Error(`${errMsg}: ${err}`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
snapshot = requestedSnapshot;
|
|
228
|
-
}
|
|
229
|
-
if (!snapshot.windows) {
|
|
230
|
-
throw new Error(errMsg);
|
|
231
|
-
}
|
|
232
|
-
const client = await this.getClient();
|
|
233
|
-
await client.dispatch('apply-snapshot', {
|
|
234
|
-
snapshot,
|
|
235
|
-
options
|
|
236
|
-
});
|
|
237
|
-
return this;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Fetches a JSON manifest using the browser process and returns a Javascript object.
|
|
241
|
-
* Can be overwritten using {@link Platform#init Platform.init}.
|
|
242
|
-
* @param { string } manifestUrl The URL of the manifest to fetch.
|
|
243
|
-
* @return { Promise<any> }
|
|
244
|
-
* @tutorial Platform.fetchManifest
|
|
245
|
-
*/
|
|
246
|
-
async fetchManifest(manifestUrl) {
|
|
247
|
-
const client = await this.getClient();
|
|
248
|
-
return client.dispatch('platform-fetch-manifest', { manifestUrl });
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Retrieves a manifest by url and launches a legacy application manifest or snapshot into the platform. Returns a promise that
|
|
252
|
-
* resolves to the wrapped Platform.
|
|
253
|
-
* @param {string} manifestUrl - The URL of the manifest that will be launched into the platform. If this app manifest
|
|
254
|
-
* contains a snapshot, that will be launched into the platform. If not, the application described in startup_app options
|
|
255
|
-
* will be launched into the platform. The applicable startup_app options will become {@link View~options View Options}.
|
|
256
|
-
* @return {Promise<Platform>}
|
|
257
|
-
* @tutorial Platform.launchContentManifest
|
|
258
|
-
* @experimental
|
|
259
|
-
*/
|
|
260
|
-
async launchContentManifest(manifestUrl) {
|
|
261
|
-
this.wire.sendAction('platform-launch-content-manifest', this.identity).catch((e) => {
|
|
262
|
-
// don't expose
|
|
263
|
-
});
|
|
264
|
-
const client = await this.getClient();
|
|
265
|
-
const manifest = await this.fetchManifest(manifestUrl);
|
|
266
|
-
client.dispatch('launch-into-platform', { manifest });
|
|
267
|
-
return this;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Set the context of a host window. The context will be available to the window itself, and to its child Views. It will be saved in any platform snapshots.
|
|
271
|
-
* It can be retrieved using {@link Platform#getWindowContext getWindowContext}.
|
|
272
|
-
* @param {any} context - A field where serializable context data can be stored to be saved in platform snapshots.
|
|
273
|
-
* @param {Identity} [target] - A target window or view may optionally be provided. If no target is provided, the update will be applied
|
|
274
|
-
* to the current window (if called from a Window) or the current host window (if called from a View).
|
|
275
|
-
* @return {Promise<void>}
|
|
276
|
-
* @tutorial Platform.setWindowContext
|
|
277
|
-
* @experimental
|
|
278
|
-
*/
|
|
279
|
-
async setWindowContext(context = {}, target) {
|
|
280
|
-
this.wire.sendAction('platform-set-window-context', this.identity).catch((e) => {
|
|
281
|
-
// don't expose
|
|
282
|
-
});
|
|
283
|
-
if (!context) {
|
|
284
|
-
throw new Error('Please provide a serializable object or string to set the context.');
|
|
285
|
-
}
|
|
286
|
-
const client = await this.getClient();
|
|
287
|
-
const { entityType } = target ? await this.fin.System.getEntityInfo(target.uuid, target.name) : this.fin.me;
|
|
288
|
-
await client.dispatch('set-window-context', {
|
|
289
|
-
context,
|
|
290
|
-
entityType,
|
|
291
|
-
target: target || { uuid: this.fin.me.uuid, name: this.fin.me.name }
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Get the context context of a host window that was previously set using {@link Platform#setWindowContext setWindowContext}.
|
|
296
|
-
* The context will be saved in any platform snapshots. Returns a promise that resolves to the context.
|
|
297
|
-
* @param {Identity} [target] - A target window or view may optionally be provided. If no target is provided, target will be
|
|
298
|
-
* the current window (if called from a Window) or the current host window (if called from a View).
|
|
299
|
-
* @return {Promise<any>}
|
|
300
|
-
* @tutorial Platform.getWindowContext
|
|
301
|
-
* @experimental
|
|
302
|
-
*/
|
|
303
|
-
async getWindowContext(target) {
|
|
304
|
-
this.wire.sendAction('platform-get-window-context', this.identity).catch((e) => {
|
|
305
|
-
// don't expose
|
|
306
|
-
});
|
|
307
|
-
const client = await this.getClient();
|
|
308
|
-
const { entityType } = target ? await this.fin.System.getEntityInfo(target.uuid, target.name) : this.fin.me;
|
|
309
|
-
return client.dispatch('get-window-context', {
|
|
310
|
-
target: target || { uuid: this.fin.me.uuid, name: this.fin.me.name },
|
|
311
|
-
entityType
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Closes a window. If enableBeforeUnload is enabled in the Platform options, any beforeunload handler set on Views will fire
|
|
316
|
-
* This behavior can be disabled by setting skipBeforeUnload to false in the options parameter.
|
|
317
|
-
* @param {Identity} winId
|
|
318
|
-
* @param {closeWindowoptions} [options]
|
|
319
|
-
* @returns {Promise<void>}
|
|
320
|
-
* @tutorial Platform.closeWindow
|
|
321
|
-
* @experimental
|
|
322
|
-
*/
|
|
323
|
-
async closeWindow(windowId, options = { skipBeforeUnload: false }) {
|
|
324
|
-
this.wire.sendAction('platform-close-window', this.identity).catch((e) => {
|
|
325
|
-
// don't expose
|
|
326
|
-
});
|
|
327
|
-
const client = await this.getClient();
|
|
328
|
-
return client.dispatch('close-window', { windowId, options });
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
exports.Platform = Platform;
|
|
332
|
-
_Platform_connectToProvider = new WeakMap();
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type * as OpenFin from '../../OpenFin';
|
|
2
|
-
type LayoutPresetType = OpenFin.LayoutPresetType;
|
|
3
|
-
export declare function isValidPresetType(type: LayoutPresetType): type is LayoutPresetType;
|
|
4
|
-
declare const _default: {
|
|
5
|
-
isValidPresetType: typeof isValidPresetType;
|
|
6
|
-
};
|
|
7
|
-
export default _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidPresetType = void 0;
|
|
4
|
-
function isValidPresetType(type) {
|
|
5
|
-
switch (type) {
|
|
6
|
-
case 'columns':
|
|
7
|
-
case 'grid':
|
|
8
|
-
case 'rows':
|
|
9
|
-
case 'tabs':
|
|
10
|
-
return true;
|
|
11
|
-
default:
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.isValidPresetType = isValidPresetType;
|
|
16
|
-
exports.default = { isValidPresetType };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const Factory_1 = require("./Factory");
|
|
18
|
-
exports.default = Factory_1.default;
|
|
19
|
-
__exportStar(require("./Instance"), exports);
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type * as OpenFin from '../../../OpenFin';
|
|
2
|
-
import { Base } from '../../base';
|
|
3
|
-
import { Layout } from './Instance';
|
|
4
|
-
type InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
5
|
-
/**
|
|
6
|
-
* @PORTED
|
|
7
|
-
* InitLayoutOptions interface
|
|
8
|
-
* @typedef { object } InitLayoutOptions
|
|
9
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
10
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @PORTED
|
|
14
|
-
* PresetLayoutOptions interface
|
|
15
|
-
* @typedef { object } PresetLayoutOptions
|
|
16
|
-
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
17
|
-
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* LayoutConfig interface
|
|
21
|
-
* @typedef { object } LayoutConfig
|
|
22
|
-
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
23
|
-
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
24
|
-
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
25
|
-
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* @PORTED
|
|
29
|
-
* LayoutItem Interface
|
|
30
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
31
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
32
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
33
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
34
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
35
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
36
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
37
|
-
* options of a given component.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* @PORTED
|
|
41
|
-
* LayoutSettings Interface
|
|
42
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
43
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
44
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
45
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
46
|
-
* If false, the layout will be displayed with splitters only.
|
|
47
|
-
* @property {object} [newTabButton]
|
|
48
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
49
|
-
* will be added to the tabstrip with the specified url.
|
|
50
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
51
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
52
|
-
* as opposed to only the active tab.
|
|
53
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
54
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
55
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
56
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
57
|
-
* dragging items by their tabs to the desired location.
|
|
58
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
59
|
-
* (not to be confused with close button on every tab).
|
|
60
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
61
|
-
* The button will maximize the current tab to fill the entire window.
|
|
62
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
63
|
-
* The button will create a new window with current tab as its content.
|
|
64
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* @lends Platform#Layout
|
|
68
|
-
*/
|
|
69
|
-
export declare class LayoutModule extends Base {
|
|
70
|
-
#private;
|
|
71
|
-
/**
|
|
72
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
73
|
-
* @param { Identity } identity
|
|
74
|
-
* @return {Promise.<Layout>}
|
|
75
|
-
* @tutorial Layout.wrap
|
|
76
|
-
* @static
|
|
77
|
-
*/
|
|
78
|
-
wrap(identity: OpenFin.Identity): Promise<OpenFin.Layout>;
|
|
79
|
-
/**
|
|
80
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
81
|
-
* @param { Identity } identity
|
|
82
|
-
* @return {Layout}
|
|
83
|
-
* @tutorial Layout.wrapSync
|
|
84
|
-
* @static
|
|
85
|
-
*/
|
|
86
|
-
wrapSync(identity: OpenFin.Identity): OpenFin.Layout;
|
|
87
|
-
/**
|
|
88
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
89
|
-
* @return {Promise.<Layout>}
|
|
90
|
-
* @tutorial Layout.getCurrent
|
|
91
|
-
* @static
|
|
92
|
-
*/
|
|
93
|
-
getCurrent(): Promise<OpenFin.Layout>;
|
|
94
|
-
/**
|
|
95
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
96
|
-
* @return {Layout}
|
|
97
|
-
* @tutorial Layout.getCurrentSync
|
|
98
|
-
* @static
|
|
99
|
-
*/
|
|
100
|
-
getCurrentSync(): OpenFin.Layout;
|
|
101
|
-
/**
|
|
102
|
-
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
103
|
-
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
104
|
-
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
105
|
-
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
106
|
-
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
107
|
-
* @return { Promise<Layout> }
|
|
108
|
-
* @static
|
|
109
|
-
* @experimental
|
|
110
|
-
* @tutorial Layout.init
|
|
111
|
-
*/
|
|
112
|
-
init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
|
|
113
|
-
}
|
|
114
|
-
export {};
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
|
-
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");
|
|
11
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
|
-
};
|
|
13
|
-
var _LayoutModule_layoutInitializationAttempted;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.LayoutModule = void 0;
|
|
16
|
-
/* eslint-disable no-undef, import/prefer-default-export */
|
|
17
|
-
const base_1 = require("../../base");
|
|
18
|
-
const Instance_1 = require("./Instance");
|
|
19
|
-
/**
|
|
20
|
-
* @PORTED
|
|
21
|
-
* InitLayoutOptions interface
|
|
22
|
-
* @typedef { object } InitLayoutOptions
|
|
23
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
24
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @PORTED
|
|
28
|
-
* PresetLayoutOptions interface
|
|
29
|
-
* @typedef { object } PresetLayoutOptions
|
|
30
|
-
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
31
|
-
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* LayoutConfig interface
|
|
35
|
-
* @typedef { object } LayoutConfig
|
|
36
|
-
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
37
|
-
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
38
|
-
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
39
|
-
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* @PORTED
|
|
43
|
-
* LayoutItem Interface
|
|
44
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
45
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
46
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
47
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
48
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
49
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
50
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
51
|
-
* options of a given component.
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
* @PORTED
|
|
55
|
-
* LayoutSettings Interface
|
|
56
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
57
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
58
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
59
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
60
|
-
* If false, the layout will be displayed with splitters only.
|
|
61
|
-
* @property {object} [newTabButton]
|
|
62
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
63
|
-
* will be added to the tabstrip with the specified url.
|
|
64
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
65
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
66
|
-
* as opposed to only the active tab.
|
|
67
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
68
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
69
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
70
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
71
|
-
* dragging items by their tabs to the desired location.
|
|
72
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
73
|
-
* (not to be confused with close button on every tab).
|
|
74
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
75
|
-
* The button will maximize the current tab to fill the entire window.
|
|
76
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
77
|
-
* The button will create a new window with current tab as its content.
|
|
78
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
79
|
-
*/
|
|
80
|
-
/**
|
|
81
|
-
* @lends Platform#Layout
|
|
82
|
-
*/
|
|
83
|
-
class LayoutModule extends base_1.Base {
|
|
84
|
-
constructor() {
|
|
85
|
-
super(...arguments);
|
|
86
|
-
_LayoutModule_layoutInitializationAttempted.set(this, false);
|
|
87
|
-
/**
|
|
88
|
-
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
89
|
-
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
90
|
-
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
91
|
-
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
92
|
-
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
93
|
-
* @return { Promise<Layout> }
|
|
94
|
-
* @static
|
|
95
|
-
* @experimental
|
|
96
|
-
* @tutorial Layout.init
|
|
97
|
-
*/
|
|
98
|
-
this.init = async (options = {}) => {
|
|
99
|
-
this.wire.sendAction('layout-init').catch((e) => {
|
|
100
|
-
// don't expose
|
|
101
|
-
});
|
|
102
|
-
if (!this.fin.me.isWindow) {
|
|
103
|
-
throw new Error('Layout.init can only be called from a Window context.');
|
|
104
|
-
}
|
|
105
|
-
else if (__classPrivateFieldGet(this, _LayoutModule_layoutInitializationAttempted, "f")) {
|
|
106
|
-
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
107
|
-
}
|
|
108
|
-
__classPrivateFieldSet(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
109
|
-
return this.wire.environment.initLayout(this.fin, this.wire, options);
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
114
|
-
* @param { Identity } identity
|
|
115
|
-
* @return {Promise.<Layout>}
|
|
116
|
-
* @tutorial Layout.wrap
|
|
117
|
-
* @static
|
|
118
|
-
*/
|
|
119
|
-
// eslint-disable-next-line class-methods-use-this
|
|
120
|
-
async wrap(identity) {
|
|
121
|
-
this.wire.sendAction('layout-wrap').catch((e) => {
|
|
122
|
-
// don't expose
|
|
123
|
-
});
|
|
124
|
-
return new Instance_1.Layout(identity, this.wire);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
128
|
-
* @param { Identity } identity
|
|
129
|
-
* @return {Layout}
|
|
130
|
-
* @tutorial Layout.wrapSync
|
|
131
|
-
* @static
|
|
132
|
-
*/
|
|
133
|
-
// eslint-disable-next-line class-methods-use-this
|
|
134
|
-
wrapSync(identity) {
|
|
135
|
-
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
|
136
|
-
// don't expose
|
|
137
|
-
});
|
|
138
|
-
return new Instance_1.Layout(identity, this.wire);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
142
|
-
* @return {Promise.<Layout>}
|
|
143
|
-
* @tutorial Layout.getCurrent
|
|
144
|
-
* @static
|
|
145
|
-
*/
|
|
146
|
-
async getCurrent() {
|
|
147
|
-
this.wire.sendAction('layout-get-current').catch((e) => {
|
|
148
|
-
// don't expose
|
|
149
|
-
});
|
|
150
|
-
if (!this.fin.me.isWindow) {
|
|
151
|
-
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
152
|
-
}
|
|
153
|
-
const { uuid, name } = this.fin.me;
|
|
154
|
-
return this.wrap({ uuid, name });
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
158
|
-
* @return {Layout}
|
|
159
|
-
* @tutorial Layout.getCurrentSync
|
|
160
|
-
* @static
|
|
161
|
-
*/
|
|
162
|
-
getCurrentSync() {
|
|
163
|
-
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
|
164
|
-
// don't expose
|
|
165
|
-
});
|
|
166
|
-
if (!this.fin.me.isWindow) {
|
|
167
|
-
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
168
|
-
}
|
|
169
|
-
const { uuid, name } = this.fin.me;
|
|
170
|
-
return this.wrapSync({ uuid, name });
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
exports.LayoutModule = LayoutModule;
|
|
174
|
-
_LayoutModule_layoutInitializationAttempted = new WeakMap();
|