@openfin/core 31.74.30 → 31.75.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/package.json +1 -1
- package/src/OpenFin.d.ts +57 -13
- package/src/api/application/Instance.js +23 -5
- package/src/api/base.d.ts +1 -2
- package/src/api/base.js +1 -2
- package/src/api/events/system.d.ts +6 -3
- package/src/api/fin.js +1 -2
- package/src/api/interappbus/channel/index.d.ts +1 -0
- package/src/api/interappbus/channel/index.js +47 -47
- package/src/api/interappbus/channel/protocols/classic/strategy.js +24 -6
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/InteropClient.d.ts +1 -1
- package/src/api/interop/InteropClient.js +1 -1
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -1
- package/src/api/interop/SessionContextGroupBroker.js +5 -4
- package/src/api/interop/SessionContextGroupClient.js +1 -1
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -1
- package/src/api/interop/fdc3/PrivateChannelProvider.js +1 -8
- package/src/api/interop/fdc3/fdc3-1.2.js +34 -1
- package/src/api/interop/fdc3/utils.js +24 -4
- package/src/api/platform/Factory.d.ts +2 -1
- package/src/api/platform/Instance.d.ts +5 -4
- package/src/api/platform/Instance.js +2 -1
- package/src/api/platform/layout/Factory.js +6 -4
- package/src/api/platform/layout/Instance.js +3 -0
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +7 -4
- package/src/api/platform/layout/controllers/layout-entities-controller.js +42 -11
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +2 -1
- package/src/api/platform/layout/entities/layout-entities.d.ts +143 -42
- package/src/api/platform/layout/entities/layout-entities.js +151 -43
- package/src/api/platform/layout/utils/layout-traversal.d.ts +1 -0
- package/src/api/platform/layout/utils/layout-traversal.js +11 -11
- package/src/api/platform/provider.d.ts +2 -1
- package/src/api/system/index.d.ts +9 -0
- package/src/api/system/index.js +78 -40
- package/src/api/view/Instance.d.ts +6 -3
- package/src/api/view/Instance.js +9 -7
- package/src/api/webcontents/main.d.ts +2 -22
- package/src/api/webcontents/main.js +2 -1
- package/src/api/window/Instance.d.ts +10 -0
- package/src/api/window/Instance.js +22 -0
- package/src/environment/mockEnvironment.d.ts +27 -0
- package/src/environment/mockEnvironment.js +61 -0
- package/src/mock.js +4 -83
- package/src/shapes/protocol.d.ts +17 -0
- package/src/transport/mockWire.d.ts +11 -0
- package/src/transport/mockWire.js +26 -0
- package/src/transport/transport-errors.d.ts +9 -1
- package/src/transport/transport-errors.js +45 -2
- package/src/transport/transport.d.ts +15 -5
- package/src/transport/transport.js +48 -20
- package/src/util/channel-api-relay.js +11 -1
- package/src/util/errors.d.ts +1 -0
- package/src/util/errors.js +1 -0
- package/src/util/lazy.d.ts +18 -0
- package/src/util/lazy.js +29 -1
- package/src/util/ref-counter.d.ts +1 -1
- package/src/util/ref-counter.js +3 -2
- package/src/transport/fin_store.d.ts +0 -4
- package/src/transport/fin_store.js +0 -16
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../../OpenFin';
|
|
2
2
|
import { LayoutEntitiesClient } from '../shapes';
|
|
3
3
|
/**
|
|
4
|
+
* @ignore
|
|
4
5
|
* @internal
|
|
5
6
|
* Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
|
|
6
7
|
* for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
|
|
7
8
|
*/
|
|
8
9
|
export declare abstract class LayoutNode {
|
|
9
10
|
#private;
|
|
10
|
-
/** @internal */
|
|
11
|
-
protected constructor(client: LayoutEntitiesClient, entityId: string);
|
|
12
11
|
/**
|
|
13
12
|
* @internal
|
|
14
|
-
*
|
|
13
|
+
* @ignore
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
protected constructor(client: LayoutEntitiesClient, entityId: string);
|
|
16
|
+
abstract readonly type: OpenFin.LayoutEntityTypes;
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
|
+
* @ignore
|
|
19
20
|
* This instance's unique id used when calling the layout-entities-controller api client
|
|
20
21
|
*/
|
|
21
22
|
protected readonly entityId: string;
|
|
22
23
|
/**
|
|
24
|
+
* @ignore
|
|
23
25
|
* @internal
|
|
24
26
|
* Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
|
|
25
27
|
* @param client
|
|
@@ -29,51 +31,83 @@ export declare abstract class LayoutNode {
|
|
|
29
31
|
*/
|
|
30
32
|
static newLayoutEntitiesClient: (client: OpenFin.ChannelClient, controllerId: string, identity: OpenFin.Identity) => Promise<LayoutEntitiesClient>;
|
|
31
33
|
static getEntity: (definition: OpenFin.LayoutEntityDefinition, client: LayoutEntitiesClient) => ColumnOrRow | TabStack;
|
|
34
|
+
isRoot: () => Promise<boolean>;
|
|
35
|
+
exists: () => Promise<boolean>;
|
|
36
|
+
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
37
|
+
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
38
|
+
position?: OpenFin.LayoutPosition;
|
|
39
|
+
}) => Promise<TabStack>;
|
|
40
|
+
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {string} LayoutPosition
|
|
44
|
+
* @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {object} StackCreationOptions
|
|
48
|
+
* @summary Stack creation options.
|
|
49
|
+
* @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {object} TabStack~AddViewOptions
|
|
53
|
+
* @summary Options to use when adding a view to a {@link TabStack}
|
|
54
|
+
* @property {number} [index] - Insertion index when adding the view. Defaults to 0.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout.
|
|
58
|
+
*/
|
|
59
|
+
export declare class TabStack extends LayoutNode {
|
|
60
|
+
#private;
|
|
32
61
|
/**
|
|
33
|
-
* Determines if this {@link
|
|
34
|
-
* @
|
|
62
|
+
* Determines if this {@link TabStack} is the top level content item in the current layout.
|
|
63
|
+
* @function isRoot
|
|
64
|
+
* @memberof TabStack
|
|
65
|
+
* @instance
|
|
66
|
+
* @tutorial TabStack.isRoot
|
|
67
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
35
68
|
*/
|
|
36
|
-
isRoot: () => Promise<boolean>;
|
|
37
69
|
/**
|
|
38
|
-
* Determines if this
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
70
|
+
* Determines if this {@link TabStack} exists.
|
|
71
|
+
* @function exists
|
|
72
|
+
* @instance
|
|
73
|
+
* @memberof TabStack
|
|
74
|
+
* @tutorial TabStack.exists
|
|
75
|
+
* @return {Promise<boolean>} Resolves true if this is the TabStack exists, or false if it has been destroyed.
|
|
41
76
|
*/
|
|
42
|
-
exists: () => Promise<boolean>;
|
|
43
77
|
/**
|
|
44
|
-
* Retrieves the parent {@link ColumnOrRow}
|
|
45
|
-
* @
|
|
78
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
|
|
79
|
+
* @function getParent
|
|
80
|
+
* @instance
|
|
81
|
+
* @memberof TabStack
|
|
82
|
+
* @tutorial TabStack.getParent
|
|
83
|
+
* @return {Promise<ColumnOrRow | TabStack | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist.
|
|
46
84
|
*/
|
|
47
|
-
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
48
85
|
/**
|
|
49
|
-
*
|
|
86
|
+
* Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
|
|
87
|
+
* @function getAdjacentStacks
|
|
88
|
+
* @instance
|
|
89
|
+
* @memberof TabStack
|
|
90
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
91
|
+
* @returns {Promise<TabStack[]>}
|
|
92
|
+
* @tutorial TabStack.getAdjacentStacks
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack}
|
|
50
96
|
*
|
|
51
97
|
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
52
98
|
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
53
99
|
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
54
100
|
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
55
101
|
*
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
102
|
+
* @function createAdjacentStack
|
|
103
|
+
* @instance
|
|
104
|
+
* @memberof TabStack
|
|
105
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
106
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
107
|
+
* @returns {Promise<TabStack>} The created TabStack.
|
|
108
|
+
* @tutorial TabStack.createAdjacentStack
|
|
59
109
|
* @experimental
|
|
60
110
|
*/
|
|
61
|
-
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
62
|
-
position?: OpenFin.LayoutPosition;
|
|
63
|
-
}) => Promise<TabStack>;
|
|
64
|
-
/**
|
|
65
|
-
* Finds the immediate adjacent layout item given an edge Position
|
|
66
|
-
* @param edgePosition
|
|
67
|
-
* @returns either {@link TabStack} or {@link ColumnOrRow} that was found, or `undefined` if there is no item with that edgePosition
|
|
68
|
-
*/
|
|
69
|
-
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A {@link TabStack} is used to manage the state of a TabStack within an OpenFin Layout and
|
|
73
|
-
* traverse to its parent Content Item.
|
|
74
|
-
*/
|
|
75
|
-
export declare class TabStack extends LayoutNode {
|
|
76
|
-
#private;
|
|
77
111
|
/** @internal */
|
|
78
112
|
constructor(client: LayoutEntitiesClient, entityId: string);
|
|
79
113
|
/**
|
|
@@ -88,8 +122,9 @@ export declare class TabStack extends LayoutNode {
|
|
|
88
122
|
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
89
123
|
* than the currently rendered tab order.
|
|
90
124
|
*
|
|
91
|
-
* @returns Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
125
|
+
* @returns {Promise<Identity[]>} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
92
126
|
* @throws If the {@link TabStack} has been destroyed.
|
|
127
|
+
* @tutorial TabStack.getViews
|
|
93
128
|
* @experimental
|
|
94
129
|
*/
|
|
95
130
|
getViews: () => Promise<OpenFin.Identity[]>;
|
|
@@ -99,28 +134,93 @@ export declare class TabStack extends LayoutNode {
|
|
|
99
134
|
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
100
135
|
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
101
136
|
*
|
|
102
|
-
* @param view The identity of an existing view to add, or options to create a view.
|
|
103
|
-
* @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
104
|
-
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
137
|
+
* @param {View~options} view The identity of an existing view to add, or options to create a view.
|
|
138
|
+
* @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
139
|
+
* @returns {Promise<identity>} Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
105
140
|
* @throws If the view does not exist or fails to create.
|
|
106
141
|
* @throws If the {@link TabStack} has been destroyed.
|
|
142
|
+
* @tutorial TabStack.addView
|
|
107
143
|
* @experimental
|
|
108
144
|
*/
|
|
109
145
|
addView: (view: OpenFin.Identity | OpenFin.PlatformViewCreationOptions, options?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
|
|
110
146
|
/**
|
|
111
147
|
* Removes a view from this {@link TabStack}.
|
|
112
|
-
* @param view
|
|
148
|
+
* @param {Identity} view - Identity of the view to remove.
|
|
113
149
|
* @throws If the view does not exist or does not belong to the stack.
|
|
114
150
|
* @throws If the {@link TabStack} has been destroyed.
|
|
151
|
+
* @return {Promise<void>}
|
|
152
|
+
* @tutorial TabStack.removeView
|
|
115
153
|
*/
|
|
116
154
|
removeView: (view: OpenFin.Identity) => Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Sets the active view of the {@link TabStack} without focusing it.
|
|
157
|
+
* @param {Identity} view - Identity of the view to activate.
|
|
158
|
+
* @returns {Promise<void>} Promise which resolves with void once the view has been activated.
|
|
159
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
160
|
+
* @throws If the view does not exist.
|
|
161
|
+
* @tutorial TabStack.setActiveView
|
|
162
|
+
* @experimental
|
|
163
|
+
*/
|
|
164
|
+
setActiveView: (view: OpenFin.Identity) => Promise<void>;
|
|
117
165
|
}
|
|
118
166
|
/**
|
|
119
|
-
* A
|
|
167
|
+
* A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout.
|
|
120
168
|
*/
|
|
121
169
|
export declare class ColumnOrRow extends LayoutNode {
|
|
122
170
|
#private;
|
|
123
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Determines if this {@link ColumnOrRow} is the top level content item in the current layout.
|
|
173
|
+
* @function isRoot
|
|
174
|
+
* @memberof ColumnOrRow
|
|
175
|
+
* @instance
|
|
176
|
+
* @tutorial ColumnOrRow.isRoot
|
|
177
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Determines if this {@link ColumnOrRow} exists.
|
|
181
|
+
* @function exists
|
|
182
|
+
* @instance
|
|
183
|
+
* @memberof ColumnOrRow
|
|
184
|
+
* @tutorial ColumnOrRow.exists
|
|
185
|
+
* @return {Promise<boolean>} Resolves true if the TabStack exists, or false if it has been destroyed.
|
|
186
|
+
*/
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
|
|
189
|
+
* @function getParent
|
|
190
|
+
* @instance
|
|
191
|
+
* @memberof ColumnOrRow
|
|
192
|
+
* @tutorial ColumnOrRow.getParent
|
|
193
|
+
* @return {Promise<ColumnOrRow | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item.
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
|
|
197
|
+
* @function getAdjacentStacks
|
|
198
|
+
* @instance
|
|
199
|
+
* @memberof ColumnOrRow
|
|
200
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
201
|
+
* @returns {Promise<TabStack[]>}
|
|
202
|
+
* @tutorial ColumnOrRow.getAdjacentStacks
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow}
|
|
206
|
+
*
|
|
207
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
208
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
209
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
210
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
211
|
+
*
|
|
212
|
+
* @function createAdjacentStack
|
|
213
|
+
* @instance
|
|
214
|
+
* @memberof ColumnOrRow
|
|
215
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
216
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
217
|
+
* @returns {Promise<TabStack>} The created TabStack
|
|
218
|
+
* @tutorial ColumnOrRow.createAdjacentStack
|
|
219
|
+
* @experimental
|
|
220
|
+
*/
|
|
221
|
+
/**
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
124
224
|
constructor(client: LayoutEntitiesClient, entityId: string, type: 'row' | 'column');
|
|
125
225
|
/**
|
|
126
226
|
* The type of this {@link ColumnOrRow}. Either 'row' or 'column'.
|
|
@@ -128,7 +228,8 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
128
228
|
readonly type: 'column' | 'row';
|
|
129
229
|
/**
|
|
130
230
|
* Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
|
|
131
|
-
* @returns Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
231
|
+
* @returns {Promise<Array<ColumnOrRow | TabStack>>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
232
|
+
* @tutorial ColumnOrRow.getContent
|
|
132
233
|
*/
|
|
133
234
|
getContent: () => Promise<(ColumnOrRow | TabStack)[]>;
|
|
134
235
|
}
|
|
@@ -21,33 +21,25 @@ const channel_api_relay_1 = require("../../../../util/channel-api-relay");
|
|
|
21
21
|
refs, we define and export all the classes here.
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
|
+
* @ignore
|
|
24
25
|
* @internal
|
|
25
26
|
* Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
|
|
26
27
|
* for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
|
|
27
28
|
*/
|
|
28
29
|
class LayoutNode {
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
30
34
|
constructor(client, entityId) {
|
|
31
35
|
/**
|
|
36
|
+
* @ignore
|
|
32
37
|
* @internal
|
|
33
38
|
* ApiClient for {@link LayoutEntitiesController}
|
|
34
39
|
*/
|
|
35
40
|
_LayoutNode_client.set(this, void 0);
|
|
36
|
-
/**
|
|
37
|
-
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level content item in the current layout.
|
|
38
|
-
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
39
|
-
*/
|
|
40
41
|
this.isRoot = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
|
41
|
-
/**
|
|
42
|
-
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level
|
|
43
|
-
* content item in the current layout.
|
|
44
|
-
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
45
|
-
*/
|
|
46
42
|
this.exists = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").exists(this.entityId);
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves the parent {@link ColumnOrRow} or {@link TabStack} of this item, if one exists.
|
|
49
|
-
* @returns Promise resolving with the {@link ColumnOrRow} or {@link TabStack} that contains this item, or undefined if this is the root content item.
|
|
50
|
-
*/
|
|
51
43
|
this.getParent = async () => {
|
|
52
44
|
const parent = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getParent(this.entityId);
|
|
53
45
|
if (!parent) {
|
|
@@ -55,34 +47,16 @@ class LayoutNode {
|
|
|
55
47
|
}
|
|
56
48
|
return LayoutNode.getEntity(parent, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
|
|
57
49
|
};
|
|
58
|
-
/**
|
|
59
|
-
* Given a list of view creation options or references and a layout position, creates an adjacent {@link TabStack}
|
|
60
|
-
*
|
|
61
|
-
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
62
|
-
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
63
|
-
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
64
|
-
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
65
|
-
*
|
|
66
|
-
* @param views List of identities or view creation options of the views to include in the stack
|
|
67
|
-
* @param options Creation options, defaults to position: 'right'
|
|
68
|
-
* @returns an instance of {@link TabStack} containing the given views
|
|
69
|
-
* @experimental
|
|
70
|
-
*/
|
|
71
50
|
this.createAdjacentStack = async (views, options) => {
|
|
72
51
|
const entityId = await __classPrivateFieldGet(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
|
73
52
|
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
|
|
74
53
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Finds the immediate adjacent layout item given an edge Position
|
|
77
|
-
* @param edgePosition
|
|
78
|
-
* @returns either {@link TabStack} or {@link ColumnOrRow} that was found, or `undefined` if there is no item with that edgePosition
|
|
79
|
-
*/
|
|
80
54
|
this.getAdjacentStacks = async (edge) => {
|
|
81
55
|
const adjacentStacks = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getAdjacentStacks({
|
|
82
56
|
targetId: this.entityId,
|
|
83
57
|
edge
|
|
84
58
|
});
|
|
85
|
-
return adjacentStacks.map(stack => LayoutNode.getEntity({
|
|
59
|
+
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
|
86
60
|
type: 'stack',
|
|
87
61
|
entityId: stack.entityId
|
|
88
62
|
}, __classPrivateFieldGet(this, _LayoutNode_client, "f")));
|
|
@@ -94,6 +68,7 @@ class LayoutNode {
|
|
|
94
68
|
exports.LayoutNode = LayoutNode;
|
|
95
69
|
_a = LayoutNode, _LayoutNode_client = new WeakMap();
|
|
96
70
|
/**
|
|
71
|
+
* @ignore
|
|
97
72
|
* @internal
|
|
98
73
|
* Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
|
|
99
74
|
* @param client
|
|
@@ -119,10 +94,73 @@ LayoutNode.getEntity = (definition, client) => {
|
|
|
119
94
|
}
|
|
120
95
|
};
|
|
121
96
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
97
|
+
* @typedef {string} LayoutPosition
|
|
98
|
+
* @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* @typedef {object} StackCreationOptions
|
|
102
|
+
* @summary Stack creation options.
|
|
103
|
+
* @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'.
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* @typedef {object} TabStack~AddViewOptions
|
|
107
|
+
* @summary Options to use when adding a view to a {@link TabStack}
|
|
108
|
+
* @property {number} [index] - Insertion index when adding the view. Defaults to 0.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout.
|
|
124
112
|
*/
|
|
125
113
|
class TabStack extends LayoutNode {
|
|
114
|
+
/**
|
|
115
|
+
* Determines if this {@link TabStack} is the top level content item in the current layout.
|
|
116
|
+
* @function isRoot
|
|
117
|
+
* @memberof TabStack
|
|
118
|
+
* @instance
|
|
119
|
+
* @tutorial TabStack.isRoot
|
|
120
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Determines if this {@link TabStack} exists.
|
|
124
|
+
* @function exists
|
|
125
|
+
* @instance
|
|
126
|
+
* @memberof TabStack
|
|
127
|
+
* @tutorial TabStack.exists
|
|
128
|
+
* @return {Promise<boolean>} Resolves true if this is the TabStack exists, or false if it has been destroyed.
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
|
|
132
|
+
* @function getParent
|
|
133
|
+
* @instance
|
|
134
|
+
* @memberof TabStack
|
|
135
|
+
* @tutorial TabStack.getParent
|
|
136
|
+
* @return {Promise<ColumnOrRow | TabStack | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist.
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
|
|
140
|
+
* @function getAdjacentStacks
|
|
141
|
+
* @instance
|
|
142
|
+
* @memberof TabStack
|
|
143
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
144
|
+
* @returns {Promise<TabStack[]>}
|
|
145
|
+
* @tutorial TabStack.getAdjacentStacks
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack}
|
|
149
|
+
*
|
|
150
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
151
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
152
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
153
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
154
|
+
*
|
|
155
|
+
* @function createAdjacentStack
|
|
156
|
+
* @instance
|
|
157
|
+
* @memberof TabStack
|
|
158
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
159
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
160
|
+
* @returns {Promise<TabStack>} The created TabStack.
|
|
161
|
+
* @tutorial TabStack.createAdjacentStack
|
|
162
|
+
* @experimental
|
|
163
|
+
*/
|
|
126
164
|
/** @internal */
|
|
127
165
|
constructor(client, entityId) {
|
|
128
166
|
super(client, entityId);
|
|
@@ -143,8 +181,9 @@ class TabStack extends LayoutNode {
|
|
|
143
181
|
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
144
182
|
* than the currently rendered tab order.
|
|
145
183
|
*
|
|
146
|
-
* @returns Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
184
|
+
* @returns {Promise<Identity[]>} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
147
185
|
* @throws If the {@link TabStack} has been destroyed.
|
|
186
|
+
* @tutorial TabStack.getViews
|
|
148
187
|
* @experimental
|
|
149
188
|
*/
|
|
150
189
|
this.getViews = () => __classPrivateFieldGet(this, _TabStack_client, "f").getStackViews(this.entityId);
|
|
@@ -154,43 +193,112 @@ class TabStack extends LayoutNode {
|
|
|
154
193
|
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
155
194
|
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
156
195
|
*
|
|
157
|
-
* @param view The identity of an existing view to add, or options to create a view.
|
|
158
|
-
* @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
159
|
-
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
196
|
+
* @param {View~options} view The identity of an existing view to add, or options to create a view.
|
|
197
|
+
* @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
198
|
+
* @returns {Promise<identity>} Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
160
199
|
* @throws If the view does not exist or fails to create.
|
|
161
200
|
* @throws If the {@link TabStack} has been destroyed.
|
|
201
|
+
* @tutorial TabStack.addView
|
|
162
202
|
* @experimental
|
|
163
203
|
*/
|
|
164
204
|
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
|
165
205
|
/**
|
|
166
206
|
* Removes a view from this {@link TabStack}.
|
|
167
|
-
* @param view
|
|
207
|
+
* @param {Identity} view - Identity of the view to remove.
|
|
168
208
|
* @throws If the view does not exist or does not belong to the stack.
|
|
169
209
|
* @throws If the {@link TabStack} has been destroyed.
|
|
210
|
+
* @return {Promise<void>}
|
|
211
|
+
* @tutorial TabStack.removeView
|
|
170
212
|
*/
|
|
171
213
|
this.removeView = async (view) => {
|
|
172
214
|
await __classPrivateFieldGet(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
|
173
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* Sets the active view of the {@link TabStack} without focusing it.
|
|
218
|
+
* @param {Identity} view - Identity of the view to activate.
|
|
219
|
+
* @returns {Promise<void>} Promise which resolves with void once the view has been activated.
|
|
220
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
221
|
+
* @throws If the view does not exist.
|
|
222
|
+
* @tutorial TabStack.setActiveView
|
|
223
|
+
* @experimental
|
|
224
|
+
*/
|
|
225
|
+
this.setActiveView = async (view) => {
|
|
226
|
+
await __classPrivateFieldGet(this, _TabStack_client, "f").setStackActiveView(this.entityId, view);
|
|
227
|
+
};
|
|
174
228
|
__classPrivateFieldSet(this, _TabStack_client, client, "f");
|
|
175
229
|
}
|
|
176
230
|
}
|
|
177
231
|
exports.TabStack = TabStack;
|
|
178
232
|
_TabStack_client = new WeakMap();
|
|
179
233
|
/**
|
|
180
|
-
* A
|
|
234
|
+
* A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout.
|
|
181
235
|
*/
|
|
182
236
|
class ColumnOrRow extends LayoutNode {
|
|
183
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Determines if this {@link ColumnOrRow} is the top level content item in the current layout.
|
|
239
|
+
* @function isRoot
|
|
240
|
+
* @memberof ColumnOrRow
|
|
241
|
+
* @instance
|
|
242
|
+
* @tutorial ColumnOrRow.isRoot
|
|
243
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
244
|
+
*/
|
|
245
|
+
/**
|
|
246
|
+
* Determines if this {@link ColumnOrRow} exists.
|
|
247
|
+
* @function exists
|
|
248
|
+
* @instance
|
|
249
|
+
* @memberof ColumnOrRow
|
|
250
|
+
* @tutorial ColumnOrRow.exists
|
|
251
|
+
* @return {Promise<boolean>} Resolves true if the TabStack exists, or false if it has been destroyed.
|
|
252
|
+
*/
|
|
253
|
+
/**
|
|
254
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
|
|
255
|
+
* @function getParent
|
|
256
|
+
* @instance
|
|
257
|
+
* @memberof ColumnOrRow
|
|
258
|
+
* @tutorial ColumnOrRow.getParent
|
|
259
|
+
* @return {Promise<ColumnOrRow | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item.
|
|
260
|
+
*/
|
|
261
|
+
/**
|
|
262
|
+
* Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
|
|
263
|
+
* @function getAdjacentStacks
|
|
264
|
+
* @instance
|
|
265
|
+
* @memberof ColumnOrRow
|
|
266
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
267
|
+
* @returns {Promise<TabStack[]>}
|
|
268
|
+
* @tutorial ColumnOrRow.getAdjacentStacks
|
|
269
|
+
*/
|
|
270
|
+
/**
|
|
271
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow}
|
|
272
|
+
*
|
|
273
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
274
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
275
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
276
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
277
|
+
*
|
|
278
|
+
* @function createAdjacentStack
|
|
279
|
+
* @instance
|
|
280
|
+
* @memberof ColumnOrRow
|
|
281
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
282
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
283
|
+
* @returns {Promise<TabStack>} The created TabStack
|
|
284
|
+
* @tutorial ColumnOrRow.createAdjacentStack
|
|
285
|
+
* @experimental
|
|
286
|
+
*/
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
184
290
|
constructor(client, entityId, type) {
|
|
185
291
|
super(client, entityId);
|
|
186
292
|
/**
|
|
293
|
+
* @ignore
|
|
187
294
|
* @internal
|
|
188
295
|
* ApiClient for {@link LayoutEntitiesController}
|
|
189
296
|
*/
|
|
190
297
|
_ColumnOrRow_client.set(this, void 0);
|
|
191
298
|
/**
|
|
192
299
|
* Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
|
|
193
|
-
* @returns Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
300
|
+
* @returns {Promise<Array<ColumnOrRow | TabStack>>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
301
|
+
* @tutorial ColumnOrRow.getContent
|
|
194
302
|
*/
|
|
195
303
|
this.getContent = async () => {
|
|
196
304
|
const contentItemEntities = await __classPrivateFieldGet(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../../OpenFin';
|
|
2
2
|
export declare const getAdjacentItem: (component: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => GoldenLayout.ContentItem | undefined;
|
|
3
|
+
export declare const doShareEdge: (from: GoldenLayout.ContentItem, to: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => boolean;
|
|
3
4
|
export declare const getAdjacentStacks: (item: GoldenLayout.ContentItem, edge: OpenFin.LayoutPosition) => GoldenLayout.ContentItem[];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAdjacentStacks = exports.getAdjacentItem = void 0;
|
|
3
|
+
exports.getAdjacentStacks = exports.doShareEdge = exports.getAdjacentItem = void 0;
|
|
4
4
|
const getAdjacentItem = (component, edge) => {
|
|
5
5
|
const { parent } = component;
|
|
6
|
-
// need to handle the case where a stack is the parent content item
|
|
7
6
|
if (parent.isRoot) {
|
|
8
7
|
return undefined;
|
|
9
8
|
}
|
|
@@ -19,25 +18,26 @@ const getAdjacentItem = (component, edge) => {
|
|
|
19
18
|
return (0, exports.getAdjacentItem)(parent, edge);
|
|
20
19
|
};
|
|
21
20
|
exports.getAdjacentItem = getAdjacentItem;
|
|
22
|
-
const doShareEdge = (
|
|
21
|
+
const doShareEdge = (from, to, edge) => {
|
|
23
22
|
var _a, _b;
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
23
|
+
const boundsFrom = (_a = from.element.get(0)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
24
|
+
const boundsTo = (_b = to.element.get(0)) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
25
|
+
if (!boundsFrom || !boundsTo) {
|
|
27
26
|
return false;
|
|
28
27
|
}
|
|
29
28
|
if (['top', 'bottom'].includes(edge)) {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const horizontallyOutOfBounds = boundsFrom.right < boundsTo.left || boundsFrom.left > boundsTo.right;
|
|
30
|
+
return !horizontallyOutOfBounds;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const verticallyOutOfBounds = boundsFrom.bottom < boundsTo.top || boundsFrom.top > boundsTo.bottom;
|
|
33
|
+
return !verticallyOutOfBounds;
|
|
35
34
|
};
|
|
35
|
+
exports.doShareEdge = doShareEdge;
|
|
36
36
|
const getAdjacentStacks = (item, edge) => {
|
|
37
37
|
const targetContainer = ['top', 'bottom'].includes(edge) ? 'row' : 'column';
|
|
38
38
|
const findEdgeStacks = (component) => {
|
|
39
39
|
if (component.type === 'stack') {
|
|
40
|
-
if (doShareEdge(item, component, edge)) {
|
|
40
|
+
if ((0, exports.doShareEdge)(item, component, edge)) {
|
|
41
41
|
return [component];
|
|
42
42
|
}
|
|
43
43
|
return [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WindowOptionsChangedEvent } from '../events/window';
|
|
2
1
|
import * as OpenFin from '../../OpenFin';
|
|
2
|
+
type WindowOptionsChangedEvent = OpenFin.WindowEvents.WindowOptionsChangedEvent;
|
|
3
3
|
/**
|
|
4
4
|
* This class handles Platform actions. It does not need to be used directly by developers.
|
|
5
5
|
* However, its methods can be overriden by passing an `overrideCallback` to {@link Platform#init Platform.init}
|
|
@@ -160,3 +160,4 @@ export interface PlatformProvider {
|
|
|
160
160
|
*/
|
|
161
161
|
handleViewsAndWindowClose(windowId: OpenFin.Identity, userDecision: OpenFin.BeforeUnloadUserDecision): Promise<void>;
|
|
162
162
|
}
|
|
163
|
+
export {};
|
|
@@ -460,6 +460,15 @@ export default class System extends EmitterBase<OpenFin.SystemEvent> {
|
|
|
460
460
|
*/
|
|
461
461
|
getServiceConfiguration(serviceIdentifier: OpenFin.ServiceIdentifier): Promise<OpenFin.ServiceConfiguration>;
|
|
462
462
|
protected getSystemAppConfig(name: string): Promise<any>;
|
|
463
|
+
/**
|
|
464
|
+
* Registers a system shutdown handler so user can do some cleanup before system is shutting down.
|
|
465
|
+
* Note: Once system shutdown starts, you are unable to cancel it.
|
|
466
|
+
* @param { SystemShutdownHandler } handler system shutdown handler
|
|
467
|
+
* @return {Promise.<void>}
|
|
468
|
+
* @tutorial System.registerShutdownHandler
|
|
469
|
+
* @experimental
|
|
470
|
+
*/
|
|
471
|
+
registerShutdownHandler(handler: OpenFin.SystemShutdownHandler): Promise<void>;
|
|
463
472
|
/**
|
|
464
473
|
* Signals the RVM to perform a health check and returns the results as json.
|
|
465
474
|
* @return {Promise.<string[]>}
|