@openfin/core 29.72.17 → 29.73.1
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 +45 -27
- 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.d.ts +17 -0
- package/src/api/interop/fdc3/PrivateChannelClient.js +82 -0
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +40 -0
- package/src/api/interop/fdc3/PrivateChannelProvider.js +224 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -1
- package/src/api/interop/fdc3/fdc3-1.2.js +1 -27
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +22 -3
- package/src/api/interop/fdc3/fdc3-2.0.js +76 -11
- package/src/api/interop/fdc3/utils.d.ts +15 -0
- package/src/api/interop/fdc3/utils.js +162 -1
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.js +21 -15
- 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.d.ts +1 -1
- 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.d.ts +17 -8
- package/src/api/platform/layout/controllers/tab-drag-controller.js +44 -22
- 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/Instance.d.ts +31 -1
- package/src/api/view/Instance.js +31 -1
- 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
|
@@ -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;
|
|
@@ -9,17 +9,24 @@ export declare class TabDragController {
|
|
|
9
9
|
constructor(viewOverlay: ViewOverlay);
|
|
10
10
|
private dropZonePreview?;
|
|
11
11
|
/**
|
|
12
|
-
* When a tab is dragged from a stack greater than one, it's view will need to be hidden and the
|
|
13
|
-
* view next in the stack shown.
|
|
14
12
|
*
|
|
15
|
-
*
|
|
13
|
+
* When a tab is dragged out of a stack, it will need to be hidden from the stack.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* Additionally, if there is a new view to show in the stack, it will be shown at the position specified by
|
|
16
|
+
* containerBounds
|
|
17
|
+
*
|
|
18
|
+
* As drag interactions can under extreme circumstances complete before this chain of promises has completed,
|
|
19
|
+
* we need to pass in a isDragging() function which returns whether the drag is in progress.
|
|
20
|
+
* This allows us to cancel any layout affecting operations.
|
|
21
|
+
*
|
|
22
|
+
* @param draggingView The view which is currently being dragged
|
|
23
|
+
* @param isLastViewInWindow Whether the draggin view is the last view in a window or not. If false, the dragging view will not hide.
|
|
24
|
+
* @param isDragging A function which returns true if the drag is still in progress. As we chain some async calls here, we want to avoid
|
|
25
|
+
* modifying any views if the drag has completed (as the post drag procedure will have taken care of it.)
|
|
26
|
+
* @param containerBounds The bounds of the container of the view to be shown in the stack
|
|
27
|
+
* @param nextView The view which has become active after dragging the draggingView out.
|
|
21
28
|
*/
|
|
22
|
-
handleTabStackActiveView: (
|
|
29
|
+
handleTabStackActiveView: (draggingView: View, isLastViewInWindow: boolean, isDragging: () => boolean, containerBounds?: OpenFin.Bounds, nextView?: View) => Promise<void>;
|
|
23
30
|
/**
|
|
24
31
|
* Extracts the border and backgroundColor css values from the drop zone preview,
|
|
25
32
|
* and sets the viewOverlay to match them.
|
|
@@ -38,6 +45,8 @@ export declare class TabDragController {
|
|
|
38
45
|
* Disables the click through setting on every view in the platform.
|
|
39
46
|
*/
|
|
40
47
|
endDrag: () => Promise<void>;
|
|
48
|
+
private disposeObserve?;
|
|
49
|
+
disposeOverlayObserver: () => void;
|
|
41
50
|
/**
|
|
42
51
|
* Observes a golden-layout drop zone preview in order to render a BrowserView
|
|
43
52
|
* overlay whenever a tab is dragged over a droppable region.
|
|
@@ -11,29 +11,36 @@ class TabDragController {
|
|
|
11
11
|
constructor(viewOverlay) {
|
|
12
12
|
this.viewOverlay = viewOverlay;
|
|
13
13
|
/**
|
|
14
|
-
* When a tab is dragged from a stack greater than one, it's view will need to be hidden and the
|
|
15
|
-
* view next in the stack shown.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
15
|
+
* When a tab is dragged out of a stack, it will need to be hidden from the stack.
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* Additionally, if there is a new view to show in the stack, it will be shown at the position specified by
|
|
18
|
+
* containerBounds
|
|
19
|
+
*
|
|
20
|
+
* As drag interactions can under extreme circumstances complete before this chain of promises has completed,
|
|
21
|
+
* we need to pass in a isDragging() function which returns whether the drag is in progress.
|
|
22
|
+
* This allows us to cancel any layout affecting operations.
|
|
23
|
+
*
|
|
24
|
+
* @param draggingView The view which is currently being dragged
|
|
25
|
+
* @param isLastViewInWindow Whether the draggin view is the last view in a window or not. If false, the dragging view will not hide.
|
|
26
|
+
* @param isDragging A function which returns true if the drag is still in progress. As we chain some async calls here, we want to avoid
|
|
27
|
+
* modifying any views if the drag has completed (as the post drag procedure will have taken care of it.)
|
|
28
|
+
* @param containerBounds The bounds of the container of the view to be shown in the stack
|
|
29
|
+
* @param nextView The view which has become active after dragging the draggingView out.
|
|
23
30
|
*/
|
|
24
|
-
this.handleTabStackActiveView = async (
|
|
31
|
+
this.handleTabStackActiveView = async (draggingView, isLastViewInWindow, isDragging, containerBounds, nextView) => {
|
|
25
32
|
if (this.dropZonePreview) {
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
await
|
|
33
|
+
if (nextView && containerBounds) {
|
|
34
|
+
if (isDragging()) {
|
|
35
|
+
await (nextView === null || nextView === void 0 ? void 0 : nextView.show());
|
|
29
36
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (currentView.identity.name !== movingView.identity.name) {
|
|
33
|
-
await currentView.show();
|
|
37
|
+
if (isDragging()) {
|
|
38
|
+
await (nextView === null || nextView === void 0 ? void 0 : nextView.setBounds(containerBounds));
|
|
34
39
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
40
|
+
}
|
|
41
|
+
if (isDragging() && !isLastViewInWindow) {
|
|
42
|
+
await draggingView.hide();
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
45
|
};
|
|
39
46
|
/**
|
|
@@ -63,6 +70,12 @@ class TabDragController {
|
|
|
63
70
|
this.endDrag = async () => {
|
|
64
71
|
await this.viewOverlay.setIgnoreViewMouseEvents(false);
|
|
65
72
|
};
|
|
73
|
+
this.disposeOverlayObserver = () => {
|
|
74
|
+
if (this.disposeObserve) {
|
|
75
|
+
this.disposeObserve();
|
|
76
|
+
}
|
|
77
|
+
this.dropZonePreview = undefined;
|
|
78
|
+
};
|
|
66
79
|
/**
|
|
67
80
|
* Observes a golden-layout drop zone preview in order to render a BrowserView
|
|
68
81
|
* overlay whenever a tab is dragged over a droppable region.
|
|
@@ -74,10 +87,10 @@ class TabDragController {
|
|
|
74
87
|
this.dropZonePreview = dropZonePreview;
|
|
75
88
|
let lastBounds;
|
|
76
89
|
dropZonePreview.style.visibility = 'hidden';
|
|
77
|
-
|
|
90
|
+
const onDropAreaHighlighted = async (e) => {
|
|
78
91
|
try {
|
|
79
92
|
const { bounds } = e.detail;
|
|
80
|
-
if (!lastBounds || !bounds_observer_1.isDomRectEqual(lastBounds, bounds)) {
|
|
93
|
+
if (!lastBounds || !(0, bounds_observer_1.isDomRectEqual)(lastBounds, bounds)) {
|
|
81
94
|
lastBounds = bounds;
|
|
82
95
|
await this.viewOverlay.renderOverlay(bounds);
|
|
83
96
|
}
|
|
@@ -85,8 +98,8 @@ class TabDragController {
|
|
|
85
98
|
catch (error) {
|
|
86
99
|
console.warn('Unexpected error encountered rendering tab drag preview.', error);
|
|
87
100
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
101
|
+
};
|
|
102
|
+
const onDropAreaHidden = async () => {
|
|
90
103
|
try {
|
|
91
104
|
lastBounds = undefined;
|
|
92
105
|
await this.viewOverlay.detachOverlay();
|
|
@@ -94,7 +107,16 @@ class TabDragController {
|
|
|
94
107
|
catch (error) {
|
|
95
108
|
console.warn('Unexpected error encountered hiding tab drag preview.', error);
|
|
96
109
|
}
|
|
97
|
-
}
|
|
110
|
+
};
|
|
111
|
+
dropZonePreview.addEventListener('drop-area-highlighted', onDropAreaHighlighted);
|
|
112
|
+
dropZonePreview.addEventListener('drop-area-hidden', onDropAreaHidden);
|
|
113
|
+
this.disposeObserve = () => {
|
|
114
|
+
dropZonePreview.removeEventListener('drop-area-highlighted', onDropAreaHighlighted);
|
|
115
|
+
dropZonePreview.removeEventListener('drop-area-hidden', onDropAreaHidden);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.warn('Tried to observe a drop zone overlay without disposing the previous.');
|
|
98
120
|
}
|
|
99
121
|
};
|
|
100
122
|
}
|
|
@@ -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
|
}
|
|
@@ -16,6 +16,36 @@ import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
|
|
|
16
16
|
*
|
|
17
17
|
* @property {boolean} [experimental.childWindows] Configure if the runtime should enable child windows for views.
|
|
18
18
|
*
|
|
19
|
+
* @property {object} [accelerator]
|
|
20
|
+
* Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
|
|
21
|
+
*
|
|
22
|
+
* @property {boolean} [accelerator.devtools=false]
|
|
23
|
+
* If `true`, enables the devtools keyboard shortcut:<br>
|
|
24
|
+
* `Ctrl` + `Shift` + `I` _(Toggles Devtools)_
|
|
25
|
+
*
|
|
26
|
+
* @property {boolean} [accelerator.reload=false]
|
|
27
|
+
* If `true`, enables the reload keyboard shortcuts:<br>
|
|
28
|
+
* `Ctrl` + `R` _(Windows)_<br>
|
|
29
|
+
* `F5` _(Windows)_<br>
|
|
30
|
+
* `Command` + `R` _(Mac)_
|
|
31
|
+
*
|
|
32
|
+
* @property {boolean} [accelerator.reloadIgnoringCache=false]
|
|
33
|
+
* If `true`, enables the reload-from-source keyboard shortcuts:<br>
|
|
34
|
+
* `Ctrl` + `Shift` + `R` _(Windows)_<br>
|
|
35
|
+
* `Shift` + `F5` _(Windows)_<br>
|
|
36
|
+
* `Command` + `Shift` + `R` _(Mac)_
|
|
37
|
+
*
|
|
38
|
+
* @property {boolean} [accelerator.zoom=false]
|
|
39
|
+
* If `true`, enables the zoom keyboard shortcuts:<br>
|
|
40
|
+
* `Ctrl` + `+` _(Zoom In)_<br>
|
|
41
|
+
* `Ctrl` + `Shift` + `+` _(Zoom In)_<br>
|
|
42
|
+
* `Ctrl` + `NumPad+` _(Zoom In)_<br>
|
|
43
|
+
* `Ctrl` + `-` _(Zoom Out)_<br>
|
|
44
|
+
* `Ctrl` + `Shift` + `-` _(Zoom Out)_<br>
|
|
45
|
+
* `Ctrl` + `NumPad-` _(Zoom Out)_<br>
|
|
46
|
+
* `Ctrl` + `Scroll` _(Zoom In & Out)_<br>
|
|
47
|
+
* `Ctrl` + `0` _(Restore to 100%)_
|
|
48
|
+
*
|
|
19
49
|
* @property {object} [api]
|
|
20
50
|
* Configurations for API injection.
|
|
21
51
|
*
|
|
@@ -127,7 +157,7 @@ import UpdatableViewOptions = OpenFin.UpdatableViewOptions;
|
|
|
127
157
|
* really no need to provide it.
|
|
128
158
|
*/
|
|
129
159
|
/**
|
|
130
|
-
* @classdesc
|
|
160
|
+
* @classdesc A View can be used to embed additional web content into a Window.
|
|
131
161
|
* It is like a child window, except it is positioned relative to its owning window.
|
|
132
162
|
* It has the ability to listen for <a href="tutorial-View.EventEmitter.html">View-specific events</a>.
|
|
133
163
|
*
|
package/src/api/view/Instance.js
CHANGED
|
@@ -19,6 +19,36 @@ const window_1 = require("../window");
|
|
|
19
19
|
*
|
|
20
20
|
* @property {boolean} [experimental.childWindows] Configure if the runtime should enable child windows for views.
|
|
21
21
|
*
|
|
22
|
+
* @property {object} [accelerator]
|
|
23
|
+
* Enable keyboard shortcuts for devtools, zoom, reload, and reload ignoring cache.
|
|
24
|
+
*
|
|
25
|
+
* @property {boolean} [accelerator.devtools=false]
|
|
26
|
+
* If `true`, enables the devtools keyboard shortcut:<br>
|
|
27
|
+
* `Ctrl` + `Shift` + `I` _(Toggles Devtools)_
|
|
28
|
+
*
|
|
29
|
+
* @property {boolean} [accelerator.reload=false]
|
|
30
|
+
* If `true`, enables the reload keyboard shortcuts:<br>
|
|
31
|
+
* `Ctrl` + `R` _(Windows)_<br>
|
|
32
|
+
* `F5` _(Windows)_<br>
|
|
33
|
+
* `Command` + `R` _(Mac)_
|
|
34
|
+
*
|
|
35
|
+
* @property {boolean} [accelerator.reloadIgnoringCache=false]
|
|
36
|
+
* If `true`, enables the reload-from-source keyboard shortcuts:<br>
|
|
37
|
+
* `Ctrl` + `Shift` + `R` _(Windows)_<br>
|
|
38
|
+
* `Shift` + `F5` _(Windows)_<br>
|
|
39
|
+
* `Command` + `Shift` + `R` _(Mac)_
|
|
40
|
+
*
|
|
41
|
+
* @property {boolean} [accelerator.zoom=false]
|
|
42
|
+
* If `true`, enables the zoom keyboard shortcuts:<br>
|
|
43
|
+
* `Ctrl` + `+` _(Zoom In)_<br>
|
|
44
|
+
* `Ctrl` + `Shift` + `+` _(Zoom In)_<br>
|
|
45
|
+
* `Ctrl` + `NumPad+` _(Zoom In)_<br>
|
|
46
|
+
* `Ctrl` + `-` _(Zoom Out)_<br>
|
|
47
|
+
* `Ctrl` + `Shift` + `-` _(Zoom Out)_<br>
|
|
48
|
+
* `Ctrl` + `NumPad-` _(Zoom Out)_<br>
|
|
49
|
+
* `Ctrl` + `Scroll` _(Zoom In & Out)_<br>
|
|
50
|
+
* `Ctrl` + `0` _(Restore to 100%)_
|
|
51
|
+
*
|
|
22
52
|
* @property {object} [api]
|
|
23
53
|
* Configurations for API injection.
|
|
24
54
|
*
|
|
@@ -130,7 +160,7 @@ const window_1 = require("../window");
|
|
|
130
160
|
* really no need to provide it.
|
|
131
161
|
*/
|
|
132
162
|
/**
|
|
133
|
-
* @classdesc
|
|
163
|
+
* @classdesc A View can be used to embed additional web content into a Window.
|
|
134
164
|
* It is like a child window, except it is positioned relative to its owning window.
|
|
135
165
|
* It has the ability to listen for <a href="tutorial-View.EventEmitter.html">View-specific events</a>.
|
|
136
166
|
*
|
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.
|
|
@@ -314,6 +314,9 @@ const view_1 = require("../view");
|
|
|
314
314
|
* A flag to cache the location of the window.
|
|
315
315
|
* ** note ** - This option is ignored in Platforms as it would cause inconsistent {@link Platform#applySnapshot applySnapshot} behavior.
|
|
316
316
|
*
|
|
317
|
+
* @property {boolean} [ignoreSavedWindowState]
|
|
318
|
+
* A flag to ignore previously cached state of the window. It defaults the opposite value of `saveWindowState` to maintain backwards compatibility.
|
|
319
|
+
*
|
|
317
320
|
* @property {boolean} [shadow=false]
|
|
318
321
|
* A flag to display a shadow on frameless windows.
|
|
319
322
|
* `shadow` and `cornerRounding` are mutually exclusive.
|
package/src/api/window/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;
|
|
@@ -13,7 +13,7 @@ class NodeEnvironment {
|
|
|
13
13
|
this.childViews = false;
|
|
14
14
|
this.writeToken = (path, token) => {
|
|
15
15
|
return new Promise((resolve) => {
|
|
16
|
-
fs_1.writeFile(path, token, () => resolve(token));
|
|
16
|
+
(0, fs_1.writeFile)(path, token, () => resolve(token));
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
this.retrievePort = (config) => {
|
|
@@ -25,7 +25,7 @@ class NodeEnvironment {
|
|
|
25
25
|
return this.messageCounter++;
|
|
26
26
|
};
|
|
27
27
|
this.getRandomId = () => {
|
|
28
|
-
return crypto_1.randomBytes(16).toString('hex');
|
|
28
|
+
return (0, crypto_1.randomBytes)(16).toString('hex');
|
|
29
29
|
};
|
|
30
30
|
this.getWebWindow = (identity) => {
|
|
31
31
|
throw new transport_errors_1.NotSupportedError('Not supported outside of OpenFin web context');
|