@openfin/core 28.72.6 → 28.72.9
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/package.json
CHANGED
|
@@ -9,17 +9,17 @@ 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
|
-
* @param
|
|
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
|
+
* @param draggingView The view which is currently being dragged
|
|
19
|
+
* @param containerBounds The bounds of the container of the view to be shown in the stack
|
|
20
|
+
* @param nextView The view which has become active after dragging the draggingView out.
|
|
21
21
|
*/
|
|
22
|
-
handleTabStackActiveView: (
|
|
22
|
+
handleTabStackActiveView: (draggingView: View, containerBounds?: OpenFin.Bounds, nextView?: View) => Promise<void>;
|
|
23
23
|
/**
|
|
24
24
|
* Extracts the border and backgroundColor css values from the drop zone preview,
|
|
25
25
|
* and sets the viewOverlay to match them.
|
|
@@ -38,6 +38,8 @@ export declare class TabDragController {
|
|
|
38
38
|
* Disables the click through setting on every view in the platform.
|
|
39
39
|
*/
|
|
40
40
|
endDrag: () => Promise<void>;
|
|
41
|
+
private disposeObserve?;
|
|
42
|
+
disposeOverlayObserver: () => void;
|
|
41
43
|
/**
|
|
42
44
|
* Observes a golden-layout drop zone preview in order to render a BrowserView
|
|
43
45
|
* overlay whenever a tab is dragged over a droppable region.
|
|
@@ -11,29 +11,28 @@ 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
|
-
* @param
|
|
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
|
+
* @param draggingView The view which is currently being dragged
|
|
21
|
+
* @param containerBounds The bounds of the container of the view to be shown in the stack
|
|
22
|
+
* @param nextView The view which has become active after dragging the draggingView out.
|
|
23
23
|
*/
|
|
24
|
-
this.handleTabStackActiveView = async (
|
|
24
|
+
this.handleTabStackActiveView = async (draggingView, containerBounds, nextView) => {
|
|
25
25
|
if (this.dropZonePreview) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
await Promise.all([hideMovingViewIfPossible(), showCurrentView()]);
|
|
26
|
+
if (nextView && containerBounds) {
|
|
27
|
+
// Due to https://github.com/electron/electron/issues/20064,
|
|
28
|
+
// setBounds does not work in certain scenarios.
|
|
29
|
+
// Therefore we call it twice before and after showing to ensure as much
|
|
30
|
+
// visual fidelity as possible (although flicker can still occur).
|
|
31
|
+
await (nextView === null || nextView === void 0 ? void 0 : nextView.setBounds(containerBounds));
|
|
32
|
+
await (nextView === null || nextView === void 0 ? void 0 : nextView.show());
|
|
33
|
+
await (nextView === null || nextView === void 0 ? void 0 : nextView.setBounds(containerBounds));
|
|
34
|
+
}
|
|
35
|
+
await draggingView.hide();
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
@@ -63,6 +62,12 @@ class TabDragController {
|
|
|
63
62
|
this.endDrag = async () => {
|
|
64
63
|
await this.viewOverlay.setIgnoreViewMouseEvents(false);
|
|
65
64
|
};
|
|
65
|
+
this.disposeOverlayObserver = () => {
|
|
66
|
+
if (this.disposeObserve) {
|
|
67
|
+
this.disposeObserve();
|
|
68
|
+
}
|
|
69
|
+
this.dropZonePreview = undefined;
|
|
70
|
+
};
|
|
66
71
|
/**
|
|
67
72
|
* Observes a golden-layout drop zone preview in order to render a BrowserView
|
|
68
73
|
* overlay whenever a tab is dragged over a droppable region.
|
|
@@ -74,7 +79,7 @@ class TabDragController {
|
|
|
74
79
|
this.dropZonePreview = dropZonePreview;
|
|
75
80
|
let lastBounds;
|
|
76
81
|
dropZonePreview.style.visibility = 'hidden';
|
|
77
|
-
|
|
82
|
+
const onDropAreaHighlighted = async (e) => {
|
|
78
83
|
try {
|
|
79
84
|
const { bounds } = e.detail;
|
|
80
85
|
if (!lastBounds || !bounds_observer_1.isDomRectEqual(lastBounds, bounds)) {
|
|
@@ -85,8 +90,8 @@ class TabDragController {
|
|
|
85
90
|
catch (error) {
|
|
86
91
|
console.warn('Unexpected error encountered rendering tab drag preview.', error);
|
|
87
92
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
93
|
+
};
|
|
94
|
+
const onDropAreaHidden = async () => {
|
|
90
95
|
try {
|
|
91
96
|
lastBounds = undefined;
|
|
92
97
|
await this.viewOverlay.detachOverlay();
|
|
@@ -94,7 +99,16 @@ class TabDragController {
|
|
|
94
99
|
catch (error) {
|
|
95
100
|
console.warn('Unexpected error encountered hiding tab drag preview.', error);
|
|
96
101
|
}
|
|
97
|
-
}
|
|
102
|
+
};
|
|
103
|
+
dropZonePreview.addEventListener('drop-area-highlighted', onDropAreaHighlighted);
|
|
104
|
+
dropZonePreview.addEventListener('drop-area-hidden', onDropAreaHidden);
|
|
105
|
+
this.disposeObserve = () => {
|
|
106
|
+
dropZonePreview.removeEventListener('drop-area-highlighted', onDropAreaHighlighted);
|
|
107
|
+
dropZonePreview.removeEventListener('drop-area-hidden', onDropAreaHidden);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.warn('Tried to observe a drop zone overlay without disposing the previous.');
|
|
98
112
|
}
|
|
99
113
|
};
|
|
100
114
|
}
|
|
@@ -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
|
*
|