@openfin/core 30.73.9 → 30.73.11
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 +2 -0
- package/package.json +1 -1
- package/src/api/application/Factory.js +3 -3
- package/src/api/application/index.js +7 -3
- package/src/api/base.js +18 -20
- package/src/api/external-application/index.js +7 -3
- package/src/api/fin.js +2 -2
- package/src/api/frame/Factory.js +2 -2
- package/src/api/frame/index.js +7 -3
- package/src/api/interappbus/channel/client.js +24 -26
- package/src/api/interappbus/channel/connection-manager.js +24 -26
- package/src/api/interappbus/channel/index.js +16 -18
- package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +24 -26
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
- package/src/api/interappbus/channel/provider.js +134 -139
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/InteropBroker.js +9 -9
- package/src/api/interop/InteropClient.js +38 -40
- package/src/api/interop/SessionContextGroupClient.js +22 -24
- package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
- package/src/api/interop/fdc3/fdc3-1.2.js +1 -1
- package/src/api/interop/fdc3/fdc3-2.0.js +4 -4
- package/src/api/interop/fdc3/utils.js +12 -8
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.js +20 -14
- package/src/api/platform/Factory.js +5 -5
- package/src/api/platform/Instance.js +11 -12
- package/src/api/platform/index.js +7 -3
- package/src/api/platform/layout/Factory.js +18 -20
- package/src/api/platform/layout/Instance.js +2 -2
- package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
- package/src/api/platform/layout/index.js +7 -3
- package/src/api/platform/layout/utils/bounds-observer.js +5 -3
- package/src/api/snapshot-source/Factory.js +1 -1
- package/src/api/snapshot-source/Instance.js +33 -35
- package/src/api/snapshot-source/index.js +7 -3
- package/src/api/snapshot-source/utils.js +2 -1
- package/src/api/view/Factory.js +2 -2
- package/src/api/view/index.js +7 -3
- package/src/api/window/Factory.js +2 -2
- package/src/api/window/Instance.d.ts +3 -0
- package/src/api/window/Instance.js +3 -0
- package/src/api/window/index.js +7 -3
- package/src/environment/node-env.js +2 -2
- package/src/environment/openfin-env.js +15 -17
- package/src/fdc3.js +1 -1
- package/src/mock.js +1 -2
- package/src/transport/transport.js +26 -28
- package/src/transport/wire.d.ts +9 -7
- package/src/util/http.d.ts +1 -1
- package/src/util/http.js +16 -11
- package/src/util/normalize-config.js +5 -5
package/src/api/interop/utils.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
|
|
4
|
-
|
|
5
|
-
exports.
|
|
4
|
+
const generateId = () => `${Math.random()}${Date.now()}`;
|
|
5
|
+
exports.generateId = generateId;
|
|
6
|
+
const wrapInTryCatch = (f, prefix) => (...args) => {
|
|
6
7
|
try {
|
|
7
8
|
return f(...args);
|
|
8
9
|
}
|
|
@@ -10,7 +11,8 @@ exports.wrapInTryCatch = (f, prefix) => (...args) => {
|
|
|
10
11
|
throw new Error((prefix || '') + e);
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
|
-
exports.
|
|
14
|
+
exports.wrapInTryCatch = wrapInTryCatch;
|
|
15
|
+
const wrapContextHandler = (handler, handlerId) => {
|
|
14
16
|
return async (context) => {
|
|
15
17
|
try {
|
|
16
18
|
await handler(context);
|
|
@@ -21,28 +23,31 @@ exports.wrapContextHandler = (handler, handlerId) => {
|
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
25
|
};
|
|
24
|
-
exports.
|
|
26
|
+
exports.wrapContextHandler = wrapContextHandler;
|
|
27
|
+
const generateOverrideError = (clientApi, brokerApi) => {
|
|
25
28
|
return `You have tried to to use ${clientApi} but ${brokerApi} has not been overridden in the Interop Broker. Please override this function. Refer to our documentation for more info.`;
|
|
26
29
|
};
|
|
27
|
-
exports.
|
|
30
|
+
exports.generateOverrideError = generateOverrideError;
|
|
31
|
+
const generateOverrideWarning = (fdc3ClientApi, brokerApi, identity, interopClientApi) => {
|
|
28
32
|
const { uuid, name } = identity;
|
|
29
33
|
const message = interopClientApi
|
|
30
34
|
? `Entity with identity: ${uuid}/${name} has called ${interopClientApi} or ${fdc3ClientApi} but ${brokerApi} has not been overridden.`
|
|
31
35
|
: `Entity with identity: ${uuid}/${name} has called ${fdc3ClientApi} but ${brokerApi} has not been overridden.`;
|
|
32
36
|
return message;
|
|
33
37
|
};
|
|
38
|
+
exports.generateOverrideWarning = generateOverrideWarning;
|
|
34
39
|
exports.BROKER_ERRORS = {
|
|
35
|
-
fireIntent: exports.generateOverrideError('fireIntent', 'handleFiredIntent'),
|
|
36
|
-
fireIntentForContext: exports.generateOverrideError('fireIntentForContext', 'handleFiredIntentForContext'),
|
|
37
|
-
getInfoForIntent: exports.generateOverrideError('getInfoForIntent', 'handleInfoForIntent'),
|
|
38
|
-
getInfoForIntentsByContext: exports.generateOverrideError('getInfoForIntentsByContext', 'handleInfoForIntentsByContext'),
|
|
40
|
+
fireIntent: (0, exports.generateOverrideError)('fireIntent', 'handleFiredIntent'),
|
|
41
|
+
fireIntentForContext: (0, exports.generateOverrideError)('fireIntentForContext', 'handleFiredIntentForContext'),
|
|
42
|
+
getInfoForIntent: (0, exports.generateOverrideError)('getInfoForIntent', 'handleInfoForIntent'),
|
|
43
|
+
getInfoForIntentsByContext: (0, exports.generateOverrideError)('getInfoForIntentsByContext', 'handleInfoForIntentsByContext'),
|
|
39
44
|
joinSessionContextGroupWithJoinContextGroup: 'The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.',
|
|
40
|
-
fdc3Open: exports.generateOverrideError('fdc3.open', 'fdc3HandleOpen'),
|
|
41
|
-
fdc3FindInstances: exports.generateOverrideError('fdc3.findInstances', 'fdc3HandleFindInstances'),
|
|
42
|
-
fdc3GetAppMetadata: exports.generateOverrideError('fdc3.getAppMetadata', 'fdc3HandleGetAppMetadata'),
|
|
43
|
-
fdc3GetInfo: exports.generateOverrideError('fdc3.getInfo', 'fdc3HandleGetInfo')
|
|
45
|
+
fdc3Open: (0, exports.generateOverrideError)('fdc3.open', 'fdc3HandleOpen'),
|
|
46
|
+
fdc3FindInstances: (0, exports.generateOverrideError)('fdc3.findInstances', 'fdc3HandleFindInstances'),
|
|
47
|
+
fdc3GetAppMetadata: (0, exports.generateOverrideError)('fdc3.getAppMetadata', 'fdc3HandleGetAppMetadata'),
|
|
48
|
+
fdc3GetInfo: (0, exports.generateOverrideError)('fdc3.getInfo', 'fdc3HandleGetInfo')
|
|
44
49
|
};
|
|
45
|
-
|
|
50
|
+
const wrapIntentHandler = (handler, handlerId) => {
|
|
46
51
|
return async (intent) => {
|
|
47
52
|
try {
|
|
48
53
|
return handler(intent);
|
|
@@ -53,3 +58,4 @@ exports.wrapIntentHandler = (handler, handlerId) => {
|
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
60
|
};
|
|
61
|
+
exports.wrapIntentHandler = wrapIntentHandler;
|
|
@@ -71,7 +71,7 @@ class PlatformModule extends base_1.Base {
|
|
|
71
71
|
async init(options) {
|
|
72
72
|
const overrideCallback = options === null || options === void 0 ? void 0 : options.overrideCallback;
|
|
73
73
|
const interopBroker = await this.fin.Interop.init(this.fin.me.uuid, options === null || options === void 0 ? void 0 : options.interopOverride);
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
75
75
|
// @ts-ignore debugging purposes
|
|
76
76
|
window.interopBroker = interopBroker;
|
|
77
77
|
return this._initializer(overrideCallback, interopBroker);
|
|
@@ -142,11 +142,11 @@ class PlatformModule extends base_1.Base {
|
|
|
142
142
|
return new Promise(async (resolve, reject) => {
|
|
143
143
|
try {
|
|
144
144
|
const { uuid } = platformOptions;
|
|
145
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
146
146
|
// @ts-ignore using private variable.
|
|
147
147
|
const app = await this.fin.Application._create({ ...platformOptions, isPlatformController: true });
|
|
148
148
|
app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid })));
|
|
149
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
150
150
|
// @ts-ignore using private variable.
|
|
151
151
|
app._run({ uuid });
|
|
152
152
|
}
|
|
@@ -171,11 +171,11 @@ class PlatformModule extends base_1.Base {
|
|
|
171
171
|
// eslint-disable-next-line no-async-promise-executor
|
|
172
172
|
return new Promise(async (resolve, reject) => {
|
|
173
173
|
try {
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
175
175
|
// @ts-ignore using private variable.
|
|
176
176
|
const app = await this.fin.Application._createFromManifest(manifestUrl);
|
|
177
177
|
app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid: app.identity.uuid })));
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
179
179
|
// @ts-ignore using private method without warning.
|
|
180
180
|
app._run(opts);
|
|
181
181
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
3
|
-
if (!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return privateMap.get(receiver);
|
|
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);
|
|
7
6
|
};
|
|
8
|
-
var
|
|
7
|
+
var _Platform_connectToProvider;
|
|
9
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
9
|
exports.Platform = void 0;
|
|
11
10
|
const base_1 = require("../base");
|
|
@@ -30,14 +29,14 @@ class Platform extends base_1.EmitterBase {
|
|
|
30
29
|
const target = identity || this.identity;
|
|
31
30
|
const { uuid } = target;
|
|
32
31
|
if (!clientMap.has(uuid)) {
|
|
33
|
-
const clientPromise = __classPrivateFieldGet(this,
|
|
32
|
+
const clientPromise = __classPrivateFieldGet(this, _Platform_connectToProvider, "f").call(this, uuid);
|
|
34
33
|
clientMap.set(uuid, clientPromise);
|
|
35
34
|
}
|
|
36
35
|
// we set it above
|
|
37
36
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
38
37
|
return clientMap.get(uuid);
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
_Platform_connectToProvider.set(this, async (uuid) => {
|
|
41
40
|
try {
|
|
42
41
|
const channelName = `custom-frame-${uuid}`;
|
|
43
42
|
const client = await this._channel.connect(channelName, { wait: false });
|
|
@@ -53,7 +52,7 @@ class Platform extends base_1.EmitterBase {
|
|
|
53
52
|
});
|
|
54
53
|
// Deprecated (renamed)
|
|
55
54
|
this.launchLegacyManifest = this.launchContentManifest;
|
|
56
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
55
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
57
56
|
if (errorMsg) {
|
|
58
57
|
throw new Error(errorMsg);
|
|
59
58
|
}
|
|
@@ -80,7 +79,7 @@ class Platform extends base_1.EmitterBase {
|
|
|
80
79
|
opts: viewOptions,
|
|
81
80
|
targetView
|
|
82
81
|
});
|
|
83
|
-
if (!response || validate_1.validateIdentity(response.identity)) {
|
|
82
|
+
if (!response || (0, validate_1.validateIdentity)(response.identity)) {
|
|
84
83
|
throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
|
|
85
84
|
}
|
|
86
85
|
return this.fin.View.wrapSync(response.identity);
|
|
@@ -100,7 +99,7 @@ class Platform extends base_1.EmitterBase {
|
|
|
100
99
|
options.reason = 'api-call';
|
|
101
100
|
}
|
|
102
101
|
const response = await client.dispatch('create-view-container', options);
|
|
103
|
-
if (!response || validate_1.validateIdentity(response.identity)) {
|
|
102
|
+
if (!response || (0, validate_1.validateIdentity)(response.identity)) {
|
|
104
103
|
throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
|
|
105
104
|
}
|
|
106
105
|
const { identity } = response;
|
|
@@ -311,4 +310,4 @@ class Platform extends base_1.EmitterBase {
|
|
|
311
310
|
}
|
|
312
311
|
}
|
|
313
312
|
exports.Platform = Platform;
|
|
314
|
-
|
|
313
|
+
_Platform_connectToProvider = new WeakMap();
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
11
|
-
}
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
const Factory_1 = require("./Factory");
|
|
14
18
|
exports.default = Factory_1.default;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
3
|
-
if (!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return privateMap.get(receiver);
|
|
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);
|
|
7
6
|
};
|
|
8
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return value;
|
|
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;
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _LayoutModule_layoutManager;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
exports.LayoutModule = void 0;
|
|
18
16
|
/* eslint-disable no-undef, import/prefer-default-export */
|
|
@@ -84,7 +82,7 @@ const view_overlay_1 = require("./utils/view-overlay");
|
|
|
84
82
|
class LayoutModule extends base_1.Base {
|
|
85
83
|
constructor() {
|
|
86
84
|
super(...arguments);
|
|
87
|
-
|
|
85
|
+
_LayoutModule_layoutManager.set(this, void 0);
|
|
88
86
|
/**
|
|
89
87
|
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
90
88
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
@@ -103,7 +101,7 @@ class LayoutModule extends base_1.Base {
|
|
|
103
101
|
if (!this.fin.me.isWindow) {
|
|
104
102
|
throw new Error('Layout.init can only be called from a Window context.');
|
|
105
103
|
}
|
|
106
|
-
else if (__classPrivateFieldGet(this,
|
|
104
|
+
else if (__classPrivateFieldGet(this, _LayoutModule_layoutManager, "f")) {
|
|
107
105
|
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
108
106
|
}
|
|
109
107
|
// We need to go through environment to make sure it is only imported/bundled in OpenFin.
|
|
@@ -111,8 +109,8 @@ class LayoutModule extends base_1.Base {
|
|
|
111
109
|
const viewOverlay = new view_overlay_1.ViewOverlay(this.wire);
|
|
112
110
|
const splitterController = new splitter_controller_1.SplitterController(viewOverlay);
|
|
113
111
|
const tabDragController = new tab_drag_controller_1.TabDragController(viewOverlay);
|
|
114
|
-
__classPrivateFieldSet(this,
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-
|
|
112
|
+
__classPrivateFieldSet(this, _LayoutModule_layoutManager, new ManagerConstructor(splitterController, tabDragController), "f");
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
116
114
|
// @ts-ignore - layout warning here for backwards compatibility, can remove layout check in .52
|
|
117
115
|
let { layout, containerId } = options;
|
|
118
116
|
if (layout) {
|
|
@@ -125,10 +123,10 @@ class LayoutModule extends base_1.Base {
|
|
|
125
123
|
// Should we error here if there is no container? Getting a typescript complaint on createLayout
|
|
126
124
|
// override here
|
|
127
125
|
// pull createChannelConnection out of LayoutManager and setup channel connections here using layoutmanager instance methods?
|
|
128
|
-
await __classPrivateFieldGet(this,
|
|
129
|
-
await __classPrivateFieldGet(this,
|
|
126
|
+
await __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f").initManager();
|
|
127
|
+
await __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f").createLayout(layout, container);
|
|
130
128
|
// Adding this to the returned instance undocumented/typed for Browser.
|
|
131
|
-
return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this,
|
|
129
|
+
return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f") });
|
|
132
130
|
};
|
|
133
131
|
}
|
|
134
132
|
/**
|
|
@@ -193,4 +191,4 @@ class LayoutModule extends base_1.Base {
|
|
|
193
191
|
}
|
|
194
192
|
}
|
|
195
193
|
exports.LayoutModule = LayoutModule;
|
|
196
|
-
|
|
194
|
+
_LayoutModule_layoutManager = new WeakMap();
|
|
@@ -63,7 +63,7 @@ class Layout extends base_1.Base {
|
|
|
63
63
|
});
|
|
64
64
|
const client = await this.platform.getClient();
|
|
65
65
|
const { presetType } = options;
|
|
66
|
-
if (!presetType || !common_utils_1.isValidPresetType(presetType)) {
|
|
66
|
+
if (!presetType || !(0, common_utils_1.isValidPresetType)(presetType)) {
|
|
67
67
|
throw new Error('Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.');
|
|
68
68
|
}
|
|
69
69
|
await client.dispatch('apply-preset-layout', {
|
|
@@ -71,7 +71,7 @@ class Layout extends base_1.Base {
|
|
|
71
71
|
opts: { presetType }
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
74
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
75
75
|
if (errorMsg) {
|
|
76
76
|
throw new Error(errorMsg);
|
|
77
77
|
}
|
|
@@ -68,7 +68,7 @@ class SplitterController {
|
|
|
68
68
|
this.viewOverlay.renderOverlay(offsetBounds);
|
|
69
69
|
};
|
|
70
70
|
await this.viewOverlay.setStyle({ backgroundColor });
|
|
71
|
-
const teardownBoundsObserver = bounds_observer_1.observeBounds(splitterDiv, onBoundsChange);
|
|
71
|
+
const teardownBoundsObserver = (0, bounds_observer_1.observeBounds)(splitterDiv, onBoundsChange);
|
|
72
72
|
this.teardown = () => {
|
|
73
73
|
teardownBoundsObserver();
|
|
74
74
|
splitterDiv.style.visibility = initialVisibility;
|
|
@@ -90,7 +90,7 @@ class TabDragController {
|
|
|
90
90
|
const onDropAreaHighlighted = async (e) => {
|
|
91
91
|
try {
|
|
92
92
|
const { bounds } = e.detail;
|
|
93
|
-
if (!lastBounds || !bounds_observer_1.isDomRectEqual(lastBounds, bounds)) {
|
|
93
|
+
if (!lastBounds || !(0, bounds_observer_1.isDomRectEqual)(lastBounds, bounds)) {
|
|
94
94
|
lastBounds = bounds;
|
|
95
95
|
await this.viewOverlay.renderOverlay(bounds);
|
|
96
96
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
11
|
-
}
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./Factory"), exports);
|
|
14
18
|
__exportStar(require("./Instance"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.observeBounds = exports.isDomRectEqual = void 0;
|
|
4
|
-
|
|
4
|
+
const isDomRectEqual = (a, b) => {
|
|
5
5
|
if (a.top !== b.top ||
|
|
6
6
|
a.left !== b.left ||
|
|
7
7
|
a.width !== b.width ||
|
|
@@ -12,6 +12,7 @@ exports.isDomRectEqual = (a, b) => {
|
|
|
12
12
|
}
|
|
13
13
|
return true;
|
|
14
14
|
};
|
|
15
|
+
exports.isDomRectEqual = isDomRectEqual;
|
|
15
16
|
/**
|
|
16
17
|
* Observes the bounding client box rectangle of the given element for changes.
|
|
17
18
|
*
|
|
@@ -29,11 +30,11 @@ exports.isDomRectEqual = (a, b) => {
|
|
|
29
30
|
* @returns Function which disposes the observers when invoked.
|
|
30
31
|
* @ignore
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
const observeBounds = (element, onChange) => {
|
|
33
34
|
let lastBounds;
|
|
34
35
|
const checkBounds = () => {
|
|
35
36
|
const currentBounds = element.getBoundingClientRect();
|
|
36
|
-
if (!lastBounds || !exports.isDomRectEqual(lastBounds, currentBounds)) {
|
|
37
|
+
if (!lastBounds || !(0, exports.isDomRectEqual)(lastBounds, currentBounds)) {
|
|
37
38
|
lastBounds = currentBounds;
|
|
38
39
|
onChange(element.getBoundingClientRect());
|
|
39
40
|
}
|
|
@@ -48,3 +49,4 @@ exports.observeBounds = (element, onChange) => {
|
|
|
48
49
|
mutationObserver.disconnect();
|
|
49
50
|
};
|
|
50
51
|
};
|
|
52
|
+
exports.observeBounds = observeBounds;
|
|
@@ -28,7 +28,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
28
28
|
typeof provider.applySnapshot !== 'function') {
|
|
29
29
|
throw new Error('you must pass in a valid SnapshotProvider');
|
|
30
30
|
}
|
|
31
|
-
const channel = await this.fin.InterApplicationBus.Channel.create(utils_1.getSnapshotSourceChannelName(fin.me.identity));
|
|
31
|
+
const channel = await this.fin.InterApplicationBus.Channel.create((0, utils_1.getSnapshotSourceChannelName)(fin.me.identity));
|
|
32
32
|
channel.register('get-snapshot', async () => {
|
|
33
33
|
const snapshot = await provider.getSnapshot();
|
|
34
34
|
return { snapshot };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
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");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
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");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _SnapshotSource_identity, _SnapshotSource_getConnection, _SnapshotSource_getClient, _SnapshotSource_startConnection, _SnapshotSource_setUpConnectionListener;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
exports.SnapshotSource = void 0;
|
|
18
16
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
@@ -26,46 +24,46 @@ const connectionMap = new Map();
|
|
|
26
24
|
class SnapshotSource extends base_1.Base {
|
|
27
25
|
constructor(wire, id) {
|
|
28
26
|
super(wire);
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
_SnapshotSource_identity.set(this, void 0);
|
|
28
|
+
_SnapshotSource_getConnection.set(this, () => {
|
|
31
29
|
if (!connectionMap.has(this.identity.uuid)) {
|
|
32
30
|
connectionMap.set(this.identity.uuid, { eventFired: null, clientPromise: null });
|
|
33
31
|
}
|
|
34
32
|
return connectionMap.get(this.identity.uuid);
|
|
35
33
|
});
|
|
36
|
-
|
|
37
|
-
if (!__classPrivateFieldGet(this,
|
|
38
|
-
__classPrivateFieldGet(this,
|
|
34
|
+
_SnapshotSource_getClient.set(this, () => {
|
|
35
|
+
if (!__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise) {
|
|
36
|
+
__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = __classPrivateFieldGet(this, _SnapshotSource_startConnection, "f").call(this);
|
|
39
37
|
}
|
|
40
|
-
return __classPrivateFieldGet(this,
|
|
38
|
+
return __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise;
|
|
41
39
|
});
|
|
42
|
-
|
|
43
|
-
const channelName = utils_1.getSnapshotSourceChannelName(this.identity);
|
|
40
|
+
_SnapshotSource_startConnection.set(this, async () => {
|
|
41
|
+
const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
|
|
44
42
|
try {
|
|
45
|
-
if (!__classPrivateFieldGet(this,
|
|
46
|
-
await __classPrivateFieldGet(this,
|
|
43
|
+
if (!__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired) {
|
|
44
|
+
await __classPrivateFieldGet(this, _SnapshotSource_setUpConnectionListener, "f").call(this);
|
|
47
45
|
}
|
|
48
46
|
const client = await this.fin.InterApplicationBus.Channel.connect(channelName, { wait: false });
|
|
49
47
|
client.onDisconnection(() => {
|
|
50
|
-
__classPrivateFieldGet(this,
|
|
51
|
-
__classPrivateFieldGet(this,
|
|
48
|
+
__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
49
|
+
__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = null;
|
|
52
50
|
});
|
|
53
51
|
return client;
|
|
54
52
|
}
|
|
55
53
|
catch (e) {
|
|
56
|
-
__classPrivateFieldGet(this,
|
|
54
|
+
__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).clientPromise = null;
|
|
57
55
|
throw new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.");
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
|
-
|
|
61
|
-
const channelName = utils_1.getSnapshotSourceChannelName(this.identity);
|
|
58
|
+
_SnapshotSource_setUpConnectionListener.set(this, async () => {
|
|
59
|
+
const channelName = (0, utils_1.getSnapshotSourceChannelName)(this.identity);
|
|
62
60
|
let resolve;
|
|
63
61
|
let reject;
|
|
64
62
|
const eventFired = new Promise((y, n) => {
|
|
65
63
|
resolve = y;
|
|
66
64
|
reject = n;
|
|
67
65
|
});
|
|
68
|
-
__classPrivateFieldGet(this,
|
|
66
|
+
__classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired = eventFired;
|
|
69
67
|
const listener = async (e) => {
|
|
70
68
|
try {
|
|
71
69
|
if (e.channelName === channelName) {
|
|
@@ -79,10 +77,10 @@ class SnapshotSource extends base_1.Base {
|
|
|
79
77
|
};
|
|
80
78
|
await this.fin.InterApplicationBus.Channel.on('connected', listener);
|
|
81
79
|
});
|
|
82
|
-
__classPrivateFieldSet(this,
|
|
80
|
+
__classPrivateFieldSet(this, _SnapshotSource_identity, id, "f");
|
|
83
81
|
}
|
|
84
82
|
get identity() {
|
|
85
|
-
return __classPrivateFieldGet(this,
|
|
83
|
+
return __classPrivateFieldGet(this, _SnapshotSource_identity, "f");
|
|
86
84
|
}
|
|
87
85
|
/**
|
|
88
86
|
* Method to determine if the SnapshotSource has been initialized.
|
|
@@ -99,11 +97,11 @@ class SnapshotSource extends base_1.Base {
|
|
|
99
97
|
// eslint-disable-next-line no-async-promise-executor
|
|
100
98
|
try {
|
|
101
99
|
// If getClient was already called before this, do we have a timing issue where the channel might have been created but we missed the event but this still fails?
|
|
102
|
-
await __classPrivateFieldGet(this,
|
|
100
|
+
await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
|
|
103
101
|
}
|
|
104
102
|
catch (e) {
|
|
105
103
|
// it was not running.
|
|
106
|
-
await __classPrivateFieldGet(this,
|
|
104
|
+
await __classPrivateFieldGet(this, _SnapshotSource_getConnection, "f").call(this).eventFired;
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
107
|
/**
|
|
@@ -114,7 +112,7 @@ class SnapshotSource extends base_1.Base {
|
|
|
114
112
|
this.wire.sendAction('snapshot-source-get-snapshot').catch((e) => {
|
|
115
113
|
// don't expose, analytics-only call
|
|
116
114
|
});
|
|
117
|
-
const client = await __classPrivateFieldGet(this,
|
|
115
|
+
const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
|
|
118
116
|
const response = (await client.dispatch('get-snapshot'));
|
|
119
117
|
return (await response).snapshot;
|
|
120
118
|
}
|
|
@@ -126,9 +124,9 @@ class SnapshotSource extends base_1.Base {
|
|
|
126
124
|
this.wire.sendAction('snapshot-source-apply-snapshot').catch((e) => {
|
|
127
125
|
// don't expose, analytics-only call
|
|
128
126
|
});
|
|
129
|
-
const client = await __classPrivateFieldGet(this,
|
|
127
|
+
const client = await __classPrivateFieldGet(this, _SnapshotSource_getClient, "f").call(this);
|
|
130
128
|
return client.dispatch('apply-snapshot', { snapshot });
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
exports.SnapshotSource = SnapshotSource;
|
|
134
|
-
|
|
132
|
+
_SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new WeakMap(), _SnapshotSource_getClient = new WeakMap(), _SnapshotSource_startConnection = new WeakMap(), _SnapshotSource_setUpConnectionListener = new WeakMap();
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
11
|
-
}
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
const Factory_1 = require("./Factory");
|
|
14
18
|
exports.default = Factory_1.default;
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSnapshotSourceChannelName = void 0;
|
|
4
4
|
const channelPrefix = 'snapshot-source-provider-';
|
|
5
|
-
|
|
5
|
+
const getSnapshotSourceChannelName = (id) => `${channelPrefix}${id.uuid}`;
|
|
6
|
+
exports.getSnapshotSourceChannelName = getSnapshotSourceChannelName;
|
package/src/api/view/Factory.js
CHANGED
|
@@ -41,7 +41,7 @@ class ViewModule extends base_1.Base {
|
|
|
41
41
|
*/
|
|
42
42
|
async wrap(identity) {
|
|
43
43
|
this.wire.sendAction('view-wrap');
|
|
44
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
44
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
45
45
|
if (errorMsg) {
|
|
46
46
|
throw new Error(errorMsg);
|
|
47
47
|
}
|
|
@@ -59,7 +59,7 @@ class ViewModule extends base_1.Base {
|
|
|
59
59
|
this.wire.sendAction('view-wrap-sync').catch((e) => {
|
|
60
60
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
61
61
|
});
|
|
62
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
62
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
63
63
|
if (errorMsg) {
|
|
64
64
|
throw new Error(errorMsg);
|
|
65
65
|
}
|
package/src/api/view/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
11
|
-
}
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
const Factory_1 = require("./Factory");
|
|
14
18
|
exports.default = Factory_1.default;
|
|
@@ -18,7 +18,7 @@ class _WindowModule extends base_1.Base {
|
|
|
18
18
|
this.wire.sendAction('window-wrap').catch((e) => {
|
|
19
19
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
20
20
|
});
|
|
21
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
21
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
22
22
|
if (errorMsg) {
|
|
23
23
|
throw new Error(errorMsg);
|
|
24
24
|
}
|
|
@@ -35,7 +35,7 @@ class _WindowModule extends base_1.Base {
|
|
|
35
35
|
this.wire.sendAction('window-wrap-sync').catch((e) => {
|
|
36
36
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
37
37
|
});
|
|
38
|
-
const errorMsg = validate_1.validateIdentity(identity);
|
|
38
|
+
const errorMsg = (0, validate_1.validateIdentity)(identity);
|
|
39
39
|
if (errorMsg) {
|
|
40
40
|
throw new Error(errorMsg);
|
|
41
41
|
}
|
|
@@ -307,6 +307,9 @@ import WindowEvents = OpenFin.WindowEvents;
|
|
|
307
307
|
* A flag to cache the location of the window.
|
|
308
308
|
* ** note ** - This option is ignored in Platforms as it would cause inconsistent {@link Platform#applySnapshot applySnapshot} behavior.
|
|
309
309
|
*
|
|
310
|
+
* @property {boolean} [ignoreSavedWindowState]
|
|
311
|
+
* A flag to ignore previously cached state of the window. It defaults the opposite value of `saveWindowState` to maintain backwards compatibility.
|
|
312
|
+
*
|
|
310
313
|
* @property {boolean} [shadow=false]
|
|
311
314
|
* A flag to display a shadow on frameless windows.
|
|
312
315
|
* `shadow` and `cornerRounding` are mutually exclusive.
|