@openfin/core 28.72.8 → 28.72.10
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,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,7 +87,7 @@ 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
93
|
if (!lastBounds || !bounds_observer_1.isDomRectEqual(lastBounds, bounds)) {
|
|
@@ -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
|
}
|
|
@@ -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
|
*
|