@openfin/core 34.78.3 → 34.78.4
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/out/mock-alpha.d.ts +3650 -833
- package/out/mock-beta.d.ts +3650 -833
- package/out/mock-public.d.ts +3650 -833
- package/out/mock.d.ts +3637 -903
- package/out/mock.js +797 -924
- package/package.json +11 -5
package/out/mock.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var require$$0 = require('events');
|
|
5
6
|
var require$$3 = require('lodash');
|
|
6
7
|
|
|
7
8
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -10,489 +11,253 @@ var mock = {};
|
|
|
10
11
|
|
|
11
12
|
var OpenFin$1 = {};
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
var events = {};
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var eventsExports = {};
|
|
18
|
-
var events = {
|
|
19
|
-
get exports(){ return eventsExports; },
|
|
20
|
-
set exports(v){ eventsExports = v; },
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var R = typeof Reflect === 'object' ? Reflect : null;
|
|
24
|
-
var ReflectApply = R && typeof R.apply === 'function'
|
|
25
|
-
? R.apply
|
|
26
|
-
: function ReflectApply(target, receiver, args) {
|
|
27
|
-
return Function.prototype.apply.call(target, receiver, args);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var ReflectOwnKeys;
|
|
31
|
-
if (R && typeof R.ownKeys === 'function') {
|
|
32
|
-
ReflectOwnKeys = R.ownKeys;
|
|
33
|
-
} else if (Object.getOwnPropertySymbols) {
|
|
34
|
-
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
35
|
-
return Object.getOwnPropertyNames(target)
|
|
36
|
-
.concat(Object.getOwnPropertySymbols(target));
|
|
37
|
-
};
|
|
38
|
-
} else {
|
|
39
|
-
ReflectOwnKeys = function ReflectOwnKeys(target) {
|
|
40
|
-
return Object.getOwnPropertyNames(target);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function ProcessEmitWarning(warning) {
|
|
45
|
-
if (console && console.warn) console.warn(warning);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
|
|
49
|
-
return value !== value;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function EventEmitter() {
|
|
53
|
-
EventEmitter.init.call(this);
|
|
54
|
-
}
|
|
55
|
-
events.exports = EventEmitter;
|
|
56
|
-
eventsExports.once = once;
|
|
57
|
-
|
|
58
|
-
// Backwards-compat with node 0.10.x
|
|
59
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
60
|
-
|
|
61
|
-
EventEmitter.prototype._events = undefined;
|
|
62
|
-
EventEmitter.prototype._eventsCount = 0;
|
|
63
|
-
EventEmitter.prototype._maxListeners = undefined;
|
|
64
|
-
|
|
65
|
-
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
66
|
-
// added to it. This is a useful default which helps finding memory leaks.
|
|
67
|
-
var defaultMaxListeners = 10;
|
|
68
|
-
|
|
69
|
-
function checkListener(listener) {
|
|
70
|
-
if (typeof listener !== 'function') {
|
|
71
|
-
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function() {
|
|
78
|
-
return defaultMaxListeners;
|
|
79
|
-
},
|
|
80
|
-
set: function(arg) {
|
|
81
|
-
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
|
|
82
|
-
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
|
|
83
|
-
}
|
|
84
|
-
defaultMaxListeners = arg;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
EventEmitter.init = function() {
|
|
89
|
-
|
|
90
|
-
if (this._events === undefined ||
|
|
91
|
-
this._events === Object.getPrototypeOf(this)._events) {
|
|
92
|
-
this._events = Object.create(null);
|
|
93
|
-
this._eventsCount = 0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
this._maxListeners = this._maxListeners || undefined;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// Obviously not all Emitters should be limited to 10. This function allows
|
|
100
|
-
// that to be increased. Set to zero for unlimited.
|
|
101
|
-
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
|
102
|
-
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
|
|
103
|
-
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
|
|
104
|
-
}
|
|
105
|
-
this._maxListeners = n;
|
|
106
|
-
return this;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
function _getMaxListeners(that) {
|
|
110
|
-
if (that._maxListeners === undefined)
|
|
111
|
-
return EventEmitter.defaultMaxListeners;
|
|
112
|
-
return that._maxListeners;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
|
116
|
-
return _getMaxListeners(this);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
EventEmitter.prototype.emit = function emit(type) {
|
|
120
|
-
var args = [];
|
|
121
|
-
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
|
|
122
|
-
var doError = (type === 'error');
|
|
123
|
-
|
|
124
|
-
var events = this._events;
|
|
125
|
-
if (events !== undefined)
|
|
126
|
-
doError = (doError && events.error === undefined);
|
|
127
|
-
else if (!doError)
|
|
128
|
-
return false;
|
|
129
|
-
|
|
130
|
-
// If there is no 'error' event listener then throw.
|
|
131
|
-
if (doError) {
|
|
132
|
-
var er;
|
|
133
|
-
if (args.length > 0)
|
|
134
|
-
er = args[0];
|
|
135
|
-
if (er instanceof Error) {
|
|
136
|
-
// Note: The comments on the `throw` lines are intentional, they show
|
|
137
|
-
// up in Node's output if this results in an unhandled exception.
|
|
138
|
-
throw er; // Unhandled 'error' event
|
|
139
|
-
}
|
|
140
|
-
// At least give some kind of context to the user
|
|
141
|
-
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
|
|
142
|
-
err.context = er;
|
|
143
|
-
throw err; // Unhandled 'error' event
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
var handler = events[type];
|
|
147
|
-
|
|
148
|
-
if (handler === undefined)
|
|
149
|
-
return false;
|
|
150
|
-
|
|
151
|
-
if (typeof handler === 'function') {
|
|
152
|
-
ReflectApply(handler, this, args);
|
|
153
|
-
} else {
|
|
154
|
-
var len = handler.length;
|
|
155
|
-
var listeners = arrayClone(handler, len);
|
|
156
|
-
for (var i = 0; i < len; ++i)
|
|
157
|
-
ReflectApply(listeners[i], this, args);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return true;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
function _addListener(target, type, listener, prepend) {
|
|
164
|
-
var m;
|
|
165
|
-
var events;
|
|
166
|
-
var existing;
|
|
167
|
-
|
|
168
|
-
checkListener(listener);
|
|
169
|
-
|
|
170
|
-
events = target._events;
|
|
171
|
-
if (events === undefined) {
|
|
172
|
-
events = target._events = Object.create(null);
|
|
173
|
-
target._eventsCount = 0;
|
|
174
|
-
} else {
|
|
175
|
-
// To avoid recursion in the case that type === "newListener"! Before
|
|
176
|
-
// adding it to the listeners, first emit "newListener".
|
|
177
|
-
if (events.newListener !== undefined) {
|
|
178
|
-
target.emit('newListener', type,
|
|
179
|
-
listener.listener ? listener.listener : listener);
|
|
180
|
-
|
|
181
|
-
// Re-assign `events` because a newListener handler could have caused the
|
|
182
|
-
// this._events to be assigned to a new object
|
|
183
|
-
events = target._events;
|
|
184
|
-
}
|
|
185
|
-
existing = events[type];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (existing === undefined) {
|
|
189
|
-
// Optimize the case of one listener. Don't need the extra array object.
|
|
190
|
-
existing = events[type] = listener;
|
|
191
|
-
++target._eventsCount;
|
|
192
|
-
} else {
|
|
193
|
-
if (typeof existing === 'function') {
|
|
194
|
-
// Adding the second element, need to change to array.
|
|
195
|
-
existing = events[type] =
|
|
196
|
-
prepend ? [listener, existing] : [existing, listener];
|
|
197
|
-
// If we've already got an array, just append.
|
|
198
|
-
} else if (prepend) {
|
|
199
|
-
existing.unshift(listener);
|
|
200
|
-
} else {
|
|
201
|
-
existing.push(listener);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Check for listener leak
|
|
205
|
-
m = _getMaxListeners(target);
|
|
206
|
-
if (m > 0 && existing.length > m && !existing.warned) {
|
|
207
|
-
existing.warned = true;
|
|
208
|
-
// No error code for this since it is a Warning
|
|
209
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
210
|
-
var w = new Error('Possible EventEmitter memory leak detected. ' +
|
|
211
|
-
existing.length + ' ' + String(type) + ' listeners ' +
|
|
212
|
-
'added. Use emitter.setMaxListeners() to ' +
|
|
213
|
-
'increase limit');
|
|
214
|
-
w.name = 'MaxListenersExceededWarning';
|
|
215
|
-
w.emitter = target;
|
|
216
|
-
w.type = type;
|
|
217
|
-
w.count = existing.length;
|
|
218
|
-
ProcessEmitWarning(w);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return target;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
|
226
|
-
return _addListener(this, type, listener, false);
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
230
|
-
|
|
231
|
-
EventEmitter.prototype.prependListener =
|
|
232
|
-
function prependListener(type, listener) {
|
|
233
|
-
return _addListener(this, type, listener, true);
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
function onceWrapper() {
|
|
237
|
-
if (!this.fired) {
|
|
238
|
-
this.target.removeListener(this.type, this.wrapFn);
|
|
239
|
-
this.fired = true;
|
|
240
|
-
if (arguments.length === 0)
|
|
241
|
-
return this.listener.call(this.target);
|
|
242
|
-
return this.listener.apply(this.target, arguments);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function _onceWrap(target, type, listener) {
|
|
247
|
-
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
|
|
248
|
-
var wrapped = onceWrapper.bind(state);
|
|
249
|
-
wrapped.listener = listener;
|
|
250
|
-
state.wrapFn = wrapped;
|
|
251
|
-
return wrapped;
|
|
252
|
-
}
|
|
16
|
+
var application$1 = {};
|
|
253
17
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (events === undefined)
|
|
276
|
-
return this;
|
|
277
|
-
|
|
278
|
-
list = events[type];
|
|
279
|
-
if (list === undefined)
|
|
280
|
-
return this;
|
|
281
|
-
|
|
282
|
-
if (list === listener || list.listener === listener) {
|
|
283
|
-
if (--this._eventsCount === 0)
|
|
284
|
-
this._events = Object.create(null);
|
|
285
|
-
else {
|
|
286
|
-
delete events[type];
|
|
287
|
-
if (events.removeListener)
|
|
288
|
-
this.emit('removeListener', type, list.listener || listener);
|
|
289
|
-
}
|
|
290
|
-
} else if (typeof list !== 'function') {
|
|
291
|
-
position = -1;
|
|
292
|
-
|
|
293
|
-
for (i = list.length - 1; i >= 0; i--) {
|
|
294
|
-
if (list[i] === listener || list[i].listener === listener) {
|
|
295
|
-
originalListener = list[i].listener;
|
|
296
|
-
position = i;
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (position < 0)
|
|
302
|
-
return this;
|
|
303
|
-
|
|
304
|
-
if (position === 0)
|
|
305
|
-
list.shift();
|
|
306
|
-
else {
|
|
307
|
-
spliceOne(list, position);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (list.length === 1)
|
|
311
|
-
events[type] = list[0];
|
|
312
|
-
|
|
313
|
-
if (events.removeListener !== undefined)
|
|
314
|
-
this.emit('removeListener', type, originalListener || listener);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return this;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
321
|
-
|
|
322
|
-
EventEmitter.prototype.removeAllListeners =
|
|
323
|
-
function removeAllListeners(type) {
|
|
324
|
-
var listeners, events, i;
|
|
325
|
-
|
|
326
|
-
events = this._events;
|
|
327
|
-
if (events === undefined)
|
|
328
|
-
return this;
|
|
329
|
-
|
|
330
|
-
// not listening for removeListener, no need to emit
|
|
331
|
-
if (events.removeListener === undefined) {
|
|
332
|
-
if (arguments.length === 0) {
|
|
333
|
-
this._events = Object.create(null);
|
|
334
|
-
this._eventsCount = 0;
|
|
335
|
-
} else if (events[type] !== undefined) {
|
|
336
|
-
if (--this._eventsCount === 0)
|
|
337
|
-
this._events = Object.create(null);
|
|
338
|
-
else
|
|
339
|
-
delete events[type];
|
|
340
|
-
}
|
|
341
|
-
return this;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// emit removeListener for all listeners on all events
|
|
345
|
-
if (arguments.length === 0) {
|
|
346
|
-
var keys = Object.keys(events);
|
|
347
|
-
var key;
|
|
348
|
-
for (i = 0; i < keys.length; ++i) {
|
|
349
|
-
key = keys[i];
|
|
350
|
-
if (key === 'removeListener') continue;
|
|
351
|
-
this.removeAllListeners(key);
|
|
352
|
-
}
|
|
353
|
-
this.removeAllListeners('removeListener');
|
|
354
|
-
this._events = Object.create(null);
|
|
355
|
-
this._eventsCount = 0;
|
|
356
|
-
return this;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
listeners = events[type];
|
|
360
|
-
|
|
361
|
-
if (typeof listeners === 'function') {
|
|
362
|
-
this.removeListener(type, listeners);
|
|
363
|
-
} else if (listeners !== undefined) {
|
|
364
|
-
// LIFO order
|
|
365
|
-
for (i = listeners.length - 1; i >= 0; i--) {
|
|
366
|
-
this.removeListener(type, listeners[i]);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
18
|
+
/**
|
|
19
|
+
* Namespace for events that can be emitted by an {@link OpenFin.Application}. Includes events
|
|
20
|
+
* re-propagated from the {@link OpenFin.Window} (and, transitively, {@link OpenFin.View}) level, prefixed with `window-` (and also, if applicable, `view-`).
|
|
21
|
+
* For example, a view's "attached" event will fire as 'window-view-attached' at the application level.
|
|
22
|
+
*
|
|
23
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
24
|
+
*
|
|
25
|
+
* This namespace contains only payload shapes for events that are unique to `Application`. Events that propagate to `Application` from
|
|
26
|
+
* child {@link OpenFin.Window windows} and {@link OpenFin.View views} are defined in the {@link OpenFin.WindowEvents} and
|
|
27
|
+
* {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all* application events, see {@link Application.on Application.on}.
|
|
28
|
+
*
|
|
29
|
+
* {@link NativeApplicationEvent Native application events} (i.e. those that have not propagated from {@link OpenFin.ViewEvents Views}
|
|
30
|
+
* or {@link OpenFin.WindowEvents Windows} re-propagate to {@link OpenFin.SystemEvents System} with their type string prefixed with `application-`.
|
|
31
|
+
* {@link OpenFin.ApplicationEvents.ApplicationWindowEvent Application events that are tied to Windows but do not propagate from them}
|
|
32
|
+
* are propagated to `System` without any type string prefixing.
|
|
33
|
+
*
|
|
34
|
+
* "Requested" events (e.g. {@link RunRequestedEvent}) do not propagate.
|
|
35
|
+
*
|
|
36
|
+
* @packageDocumentation
|
|
37
|
+
*/
|
|
38
|
+
Object.defineProperty(application$1, "__esModule", { value: true });
|
|
369
39
|
|
|
370
|
-
|
|
371
|
-
};
|
|
40
|
+
var base$1 = {};
|
|
372
41
|
|
|
373
|
-
|
|
374
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Namespace for shared event payloads and utility types common to all event emitters.
|
|
44
|
+
*
|
|
45
|
+
* @packageDocumentation
|
|
46
|
+
*/
|
|
47
|
+
Object.defineProperty(base$1, "__esModule", { value: true });
|
|
375
48
|
|
|
376
|
-
|
|
377
|
-
return [];
|
|
49
|
+
var externalApplication$1 = {};
|
|
378
50
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Namespace for events that can be transmitted by an {@link OpenFin.ExternalApplication}.
|
|
53
|
+
*
|
|
54
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
55
|
+
*
|
|
56
|
+
* For a list of valid string keys for external application events, see {@link ExternalApplication.on ExternalApplication.on}.
|
|
57
|
+
*
|
|
58
|
+
* @packageDocumentation
|
|
59
|
+
*/
|
|
60
|
+
Object.defineProperty(externalApplication$1, "__esModule", { value: true });
|
|
382
61
|
|
|
383
|
-
|
|
384
|
-
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
62
|
+
var frame$1 = {};
|
|
385
63
|
|
|
386
|
-
|
|
387
|
-
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
|
388
|
-
}
|
|
64
|
+
Object.defineProperty(frame$1, "__esModule", { value: true });
|
|
389
65
|
|
|
390
|
-
|
|
391
|
-
return _listeners(this, type, true);
|
|
392
|
-
};
|
|
66
|
+
var globalHotkey$1 = {};
|
|
393
67
|
|
|
394
|
-
|
|
395
|
-
return _listeners(this, type, false);
|
|
396
|
-
};
|
|
68
|
+
Object.defineProperty(globalHotkey$1, "__esModule", { value: true });
|
|
397
69
|
|
|
398
|
-
|
|
399
|
-
if (typeof emitter.listenerCount === 'function') {
|
|
400
|
-
return emitter.listenerCount(type);
|
|
401
|
-
} else {
|
|
402
|
-
return listenerCount.call(emitter, type);
|
|
403
|
-
}
|
|
404
|
-
};
|
|
70
|
+
var platform$1 = {};
|
|
405
71
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* Namespace for events that can emitted by a {@link OpenFin.Platform}.
|
|
75
|
+
*
|
|
76
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
77
|
+
*
|
|
78
|
+
* The Platform `EventEmitter` is a superset of the {@link OpenFin.Application} `EventEmitter`,
|
|
79
|
+
* meaning it can listen to all {@link OpenFin.ApplicationEvents Application events} in addition to the
|
|
80
|
+
* Platform-specific events listed here. For a list of valid string keys for *all* platform events, see
|
|
81
|
+
* {@link Platform.on Platform.on}.
|
|
82
|
+
*
|
|
83
|
+
* @packageDocumentation
|
|
84
|
+
*/
|
|
85
|
+
Object.defineProperty(platform$1, "__esModule", { value: true });
|
|
409
86
|
|
|
410
|
-
|
|
411
|
-
var evlistener = events[type];
|
|
87
|
+
var system$1 = {};
|
|
412
88
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Namespace for runtime-wide OpenFin events emitted by {@link System.System}. Includes events
|
|
91
|
+
* re-propagated from {@link OpenFin.Application}, {@link OpenFin.Window}, and {@link OpenFin.View} (prefixed with `application-`, `window-`, and `view-`). All
|
|
92
|
+
* event propagations are visible at the System level. Propagated events from WebContents (windows, views, frames) to the Application level will *not*
|
|
93
|
+
* transitively re-propagate to the System level, because they are already visible at the system level and contain the identity
|
|
94
|
+
* of the application. For example, an application's "closed" event will fire as 'application-closed' at the system level. A view's 'shown' event
|
|
95
|
+
* will be visible as 'view-shown' at the system level, but *not* as `application-window-view-shown`.
|
|
96
|
+
*
|
|
97
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
98
|
+
*
|
|
99
|
+
* This namespace contains only payload shapes for events that are unique to `System`. Events that propagate to `System` from
|
|
100
|
+
* child {@link OpenFin.Application applications}, {@link OpenFin.Window windows}, and {@link OpenFin.View views} are defined in the
|
|
101
|
+
* {@link OpenFin.ApplicationEvents}, {@link OpenFin.WindowEvents}, and {@link OpenFin.ViewEvents} namespaces. For a list of valid string keys for *all*
|
|
102
|
+
* system events, see {@link System.on System.on}.
|
|
103
|
+
*
|
|
104
|
+
* @packageDocumentation
|
|
105
|
+
*/
|
|
106
|
+
Object.defineProperty(system$1, "__esModule", { value: true });
|
|
419
107
|
|
|
420
|
-
|
|
421
|
-
}
|
|
108
|
+
var view$1 = {};
|
|
422
109
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Namespace for events that can be emitted by a {@link OpenFin.View}.
|
|
112
|
+
*
|
|
113
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
114
|
+
*
|
|
115
|
+
* This namespace contains only payload shapes for events that are unique to `View`. Events that are shared between all `WebContents`
|
|
116
|
+
* (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. For a list
|
|
117
|
+
* of valid string keys for *all* View events, see {@link View.on View.on}.
|
|
118
|
+
*
|
|
119
|
+
* View events propagate to their parent {@link OpenFin.WindowEvents Window}, {@link OpenFin.ApplicationEvents Application},
|
|
120
|
+
* and {@link OpenFin.SystemEvents System} with an added `viewIdentity` property and their event types prefixed with `'view-'`.
|
|
121
|
+
*
|
|
122
|
+
* @packageDocumentation
|
|
123
|
+
*/
|
|
124
|
+
Object.defineProperty(view$1, "__esModule", { value: true });
|
|
426
125
|
|
|
427
|
-
|
|
428
|
-
var copy = new Array(n);
|
|
429
|
-
for (var i = 0; i < n; ++i)
|
|
430
|
-
copy[i] = arr[i];
|
|
431
|
-
return copy;
|
|
432
|
-
}
|
|
126
|
+
var webcontents = {};
|
|
433
127
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}
|
|
128
|
+
/**
|
|
129
|
+
* Namespace for events shared by all OpenFin WebContents elements (i.e. {@link OpenFin.Window},
|
|
130
|
+
* {@link OpenFin.View}).
|
|
131
|
+
*
|
|
132
|
+
* WebContents events are divided into two groups: {@link WillPropagateWebContentsEvent} and {@link NonPropagatedWebContentsEvent}. Propagating events
|
|
133
|
+
* will re-emit on parent entities - e.g., a propagating event in a view will also be emitted on the view's
|
|
134
|
+
* parent window, and propagating events in a window will also be emitted on the window's parent {@link OpenFin.Application}.
|
|
135
|
+
*
|
|
136
|
+
* Non-propagating events will not re-emit on parent entities.
|
|
137
|
+
*
|
|
138
|
+
* @packageDocumentation
|
|
139
|
+
*/
|
|
140
|
+
Object.defineProperty(webcontents, "__esModule", { value: true });
|
|
439
141
|
|
|
440
|
-
|
|
441
|
-
var ret = new Array(arr.length);
|
|
442
|
-
for (var i = 0; i < ret.length; ++i) {
|
|
443
|
-
ret[i] = arr[i].listener || arr[i];
|
|
444
|
-
}
|
|
445
|
-
return ret;
|
|
446
|
-
}
|
|
142
|
+
var window$2 = {};
|
|
447
143
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Namespace for events that can be emitted by a {@link OpenFin.Window}.
|
|
146
|
+
*
|
|
147
|
+
* Event payloads are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
148
|
+
*
|
|
149
|
+
* This namespace contains only payload shapes for events that are unique to `Window`. Events that are shared between all `WebContents`
|
|
150
|
+
* (i.e. {@link OpenFin.Window}, {@link OpenFin.View}) are defined in {@link OpenFin.WebContentsEvents}. Events that
|
|
151
|
+
* propagate from `View` are defined in {@link OpenFin.ViewEvents}. For a list of valid string keys for *all* Window events, see
|
|
152
|
+
* {@link Window.on Window.on}
|
|
153
|
+
*
|
|
154
|
+
* {@link OpenFin.WindowEvents.NativeWindowEvent Native window events} (i.e. those that are not propagated from a
|
|
155
|
+
* {@link OpenFin.ViewEvents View}) propagate to their parent {@link OpenFin.ApplicationEvents Application} and
|
|
156
|
+
* {@link OpenFin.SystemEvents System} with their event types prefixed with `'window-'`).
|
|
157
|
+
*
|
|
158
|
+
* "Requested" events (e.g. {@link AuthRequestedEvent}) do not propagate to `System. The {@link OpenFin.WindowEvents.WindowCloseRequestedEvent}
|
|
159
|
+
* does not propagate at all.
|
|
160
|
+
*
|
|
161
|
+
* @packageDocumentation
|
|
162
|
+
*/
|
|
163
|
+
Object.defineProperty(window$2, "__esModule", { value: true });
|
|
454
164
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}
|
|
165
|
+
/**
|
|
166
|
+
* Namespace for OpenFin event types. Each entity that emits OpenFin events has its own sub-namespace. Event payloads
|
|
167
|
+
* themselves are documented as interfaces, while algebraic helper types and derived types are documented as type aliases.
|
|
168
|
+
*
|
|
169
|
+
* #### Event emitters
|
|
170
|
+
*
|
|
171
|
+
* The following entities emit OpenFin events, and have corresponding sub-namespaces:
|
|
172
|
+
*
|
|
173
|
+
* * {@link OpenFin.Application}: {@link OpenFin.ApplicationEvents}
|
|
174
|
+
* * {@link OpenFin.ExternalApplication}: {@link OpenFin.ExternalApplicationEvents}
|
|
175
|
+
* * {@link OpenFin.Frame}: {@link OpenFin.FrameEvents}
|
|
176
|
+
* * {@link OpenFin.GlobalHotkey}: {@link OpenFin.GlobalHotkeyEvents}
|
|
177
|
+
* * {@link OpenFin.Platform}: {@link OpenFin.PlatformEvents}
|
|
178
|
+
* * {@link OpenFin.System}: {@link OpenFin.SystemEvents}
|
|
179
|
+
* * {@link OpenFin.View}: {@link OpenFin.ViewEvents}
|
|
180
|
+
* * {@link OpenFin.Window}: {@link OpenFin.WindowEvents}
|
|
181
|
+
*
|
|
182
|
+
* These `EventEmitter` entities share a common set of methods for interacting with the OpenFin event bus, which can be
|
|
183
|
+
* seen on the individual documentation pages for each entity type.
|
|
184
|
+
*
|
|
185
|
+
* Registering event handlers is an asynchronous operation. It is important to ensure that the returned Promises are awaited to reduce the
|
|
186
|
+
* risk of race conditions.
|
|
187
|
+
*
|
|
188
|
+
* When the `EventEmitter` receives an event from the browser process and emits on the renderer, all of the functions attached to that
|
|
189
|
+
* specific event are called synchronously. Any values returned by the called listeners are ignored and will be discarded. If the window document
|
|
190
|
+
* is destroyed by page navigation or reload, its registered event listeners will be removed.
|
|
191
|
+
*
|
|
192
|
+
* We recommend using Arrow Functions for event listeners to ensure the this scope is consistent with the original function context.
|
|
193
|
+
*
|
|
194
|
+
* Events re-propagate from smaller/more-local scopes to larger/more-global scopes. For example, an event emitted on a specific
|
|
195
|
+
* view will propagate to the window in which the view is embedded, and then to the application in which the window is running, and
|
|
196
|
+
* finally to the OpenFin runtime itself at the "system" level. For details on propagation semantics, see the namespace for
|
|
197
|
+
* the propagating (or propagated-to) entity.
|
|
198
|
+
*
|
|
199
|
+
* If you need the payload type for a specific type of event (especially propagated events), use the emitting topic's `EventPayload`
|
|
200
|
+
* (e.g. {@link WindowEvents.WindowEventPayload}) generic with the event's `type` string. For example, the payload of
|
|
201
|
+
* a {@link ViewEvents.CreatedEvent} after it has propagated to its parent {@link WindowEvents Window} can be found with
|
|
202
|
+
* `WindowEventPayload<'view-created'>`.
|
|
203
|
+
*
|
|
204
|
+
* @packageDocumentation
|
|
205
|
+
*/
|
|
206
|
+
Object.defineProperty(events, "__esModule", { value: true });
|
|
207
|
+
events.WindowEvents = events.WebContentsEvents = events.ViewEvents = events.SystemEvents = events.PlatformEvents = events.GlobalHotkeyEvents = events.FrameEvents = events.ExternalApplicationEvents = events.BaseEvents = events.ApplicationEvents = void 0;
|
|
208
|
+
const ApplicationEvents = application$1;
|
|
209
|
+
events.ApplicationEvents = ApplicationEvents;
|
|
210
|
+
const BaseEvents = base$1;
|
|
211
|
+
events.BaseEvents = BaseEvents;
|
|
212
|
+
const ExternalApplicationEvents = externalApplication$1;
|
|
213
|
+
events.ExternalApplicationEvents = ExternalApplicationEvents;
|
|
214
|
+
const FrameEvents = frame$1;
|
|
215
|
+
events.FrameEvents = FrameEvents;
|
|
216
|
+
const GlobalHotkeyEvents = globalHotkey$1;
|
|
217
|
+
events.GlobalHotkeyEvents = GlobalHotkeyEvents;
|
|
218
|
+
const PlatformEvents = platform$1;
|
|
219
|
+
events.PlatformEvents = PlatformEvents;
|
|
220
|
+
const SystemEvents = system$1;
|
|
221
|
+
events.SystemEvents = SystemEvents;
|
|
222
|
+
const ViewEvents = view$1;
|
|
223
|
+
events.ViewEvents = ViewEvents;
|
|
224
|
+
const WebContentsEvents = webcontents;
|
|
225
|
+
events.WebContentsEvents = WebContentsEvents;
|
|
226
|
+
const WindowEvents = window$2;
|
|
227
|
+
events.WindowEvents = WindowEvents;
|
|
467
228
|
|
|
468
|
-
function
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
229
|
+
(function (exports) {
|
|
230
|
+
/**
|
|
231
|
+
* Top-level namespace for types referenced by the OpenFin API. Contains:
|
|
232
|
+
*
|
|
233
|
+
* * The type of the global `fin` entry point ({@link FinApi})
|
|
234
|
+
* * Classes that act as static namespaces returned from the `fin` global (e.g. {@link ApplicationModule}, accessible via `fin.Application`)
|
|
235
|
+
* * Instance classes that are returned from API calls (e.g. {@link Application}, accessible via `fin.Application.getCurrentSync()`)
|
|
236
|
+
* * Parameter shapes for API methods (e.g. {@link ApplicationOptions}, used in `fin.Application.start()`)
|
|
237
|
+
* * Event namespaces and payload union types (e.g. {@link ApplicationEvents} and {@link ApplicationEvent})
|
|
238
|
+
*
|
|
239
|
+
* @packageDocumentation
|
|
240
|
+
*/
|
|
241
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
242
|
+
if (k2 === undefined) k2 = k;
|
|
243
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
244
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
245
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
246
|
+
}
|
|
247
|
+
Object.defineProperty(o, k2, desc);
|
|
248
|
+
}) : (function(o, m, k, k2) {
|
|
249
|
+
if (k2 === undefined) k2 = k;
|
|
250
|
+
o[k2] = m[k];
|
|
251
|
+
}));
|
|
252
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
253
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
254
|
+
};
|
|
255
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
256
|
+
// Deprecated shim to preserve v30 namespace names
|
|
257
|
+
__exportStar(events, exports);
|
|
258
|
+
} (OpenFin$1));
|
|
473
259
|
|
|
474
|
-
|
|
475
|
-
if (typeof emitter.on === 'function') {
|
|
476
|
-
if (flags.once) {
|
|
477
|
-
emitter.once(name, listener);
|
|
478
|
-
} else {
|
|
479
|
-
emitter.on(name, listener);
|
|
480
|
-
}
|
|
481
|
-
} else if (typeof emitter.addEventListener === 'function') {
|
|
482
|
-
// EventTarget does not have `error` event semantics like Node
|
|
483
|
-
// EventEmitters, we do not listen for `error` events here.
|
|
484
|
-
emitter.addEventListener(name, function wrapListener(arg) {
|
|
485
|
-
// IE does not have builtin `{ once: true }` support so we
|
|
486
|
-
// have to do it manually.
|
|
487
|
-
if (flags.once) {
|
|
488
|
-
emitter.removeEventListener(name, wrapListener);
|
|
489
|
-
}
|
|
490
|
-
listener(arg);
|
|
491
|
-
});
|
|
492
|
-
} else {
|
|
493
|
-
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
260
|
+
var fin = {};
|
|
496
261
|
|
|
497
262
|
var system = {};
|
|
498
263
|
|
|
@@ -561,6 +326,13 @@ class Base {
|
|
|
561
326
|
get fin() {
|
|
562
327
|
return this.wire.getFin();
|
|
563
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Provides access to the OpenFin representation of the current code context (usually a document
|
|
331
|
+
* such as a {@link OpenFin.View} or {@link OpenFin.Window}), as well as to the current `Interop` context.
|
|
332
|
+
*
|
|
333
|
+
* Useful for debugging in the devtools console, where this will intelligently type itself based
|
|
334
|
+
* on the context in which the devtools panel was opened.
|
|
335
|
+
*/
|
|
564
336
|
get me() {
|
|
565
337
|
return this.wire.me;
|
|
566
338
|
}
|
|
@@ -595,6 +367,9 @@ class EmitterBase extends Base {
|
|
|
595
367
|
this.topic = topic;
|
|
596
368
|
_EmitterBase_emitterAccessor.set(this, void 0);
|
|
597
369
|
this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
|
|
370
|
+
/**
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
598
373
|
this.emit = (eventType, payload, ...args) => {
|
|
599
374
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
|
600
375
|
};
|
|
@@ -637,16 +412,13 @@ class EmitterBase extends Base {
|
|
|
637
412
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
|
638
413
|
return Promise.resolve();
|
|
639
414
|
};
|
|
640
|
-
this.addListener = this.on;
|
|
641
415
|
__classPrivateFieldSet$d(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
|
642
416
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
|
643
417
|
}
|
|
644
418
|
/**
|
|
645
419
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
646
420
|
*
|
|
647
|
-
* @
|
|
648
|
-
* @param listener
|
|
649
|
-
* @param options
|
|
421
|
+
* @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
|
|
650
422
|
*/
|
|
651
423
|
async on(eventType, listener, options) {
|
|
652
424
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
@@ -656,12 +428,16 @@ class EmitterBase extends Base {
|
|
|
656
428
|
});
|
|
657
429
|
return this;
|
|
658
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* Adds a listener to the end of the listeners array for the specified event.
|
|
433
|
+
*/
|
|
434
|
+
async addListener(eventType, listener, options) {
|
|
435
|
+
return this.on(eventType, listener, options);
|
|
436
|
+
}
|
|
659
437
|
/**
|
|
660
438
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.
|
|
661
439
|
*
|
|
662
|
-
* @
|
|
663
|
-
* @param listener
|
|
664
|
-
* @param options
|
|
440
|
+
* @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
|
|
665
441
|
*/
|
|
666
442
|
async once(eventType, listener, options) {
|
|
667
443
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
@@ -677,9 +453,7 @@ class EmitterBase extends Base {
|
|
|
677
453
|
/**
|
|
678
454
|
* Adds a listener to the beginning of the listeners array for the specified event.
|
|
679
455
|
*
|
|
680
|
-
* @
|
|
681
|
-
* @param listener
|
|
682
|
-
* @param options
|
|
456
|
+
* @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
|
|
683
457
|
*/
|
|
684
458
|
async prependListener(eventType, listener, options) {
|
|
685
459
|
await this.registerEventListener(eventType, options, (emitter) => {
|
|
@@ -693,9 +467,7 @@ class EmitterBase extends Base {
|
|
|
693
467
|
* Adds a one time listener for the event. The listener is invoked only the first time the event is fired,
|
|
694
468
|
* after which it is removed. The listener is added to the beginning of the listeners array.
|
|
695
469
|
*
|
|
696
|
-
* @
|
|
697
|
-
* @param listener
|
|
698
|
-
* @param options
|
|
470
|
+
* @remarks Event payloads are documented in the {@link OpenFin.Events} namespace.
|
|
699
471
|
*/
|
|
700
472
|
async prependOnceListener(eventType, listener, options) {
|
|
701
473
|
const deregister = () => this.deregisterEventListener(eventType);
|
|
@@ -712,10 +484,6 @@ class EmitterBase extends Base {
|
|
|
712
484
|
* Remove a listener from the listener array for the specified event.
|
|
713
485
|
*
|
|
714
486
|
* @remarks Caution: Calling this method changes the array indices in the listener array behind the listener.
|
|
715
|
-
*
|
|
716
|
-
* @param eventType
|
|
717
|
-
* @param listener
|
|
718
|
-
* @param options
|
|
719
487
|
*/
|
|
720
488
|
async removeListener(eventType, listener, options) {
|
|
721
489
|
const emitter = await this.deregisterEventListener(eventType, options);
|
|
@@ -742,7 +510,6 @@ class EmitterBase extends Base {
|
|
|
742
510
|
/**
|
|
743
511
|
* Removes all listeners, or those of the specified event.
|
|
744
512
|
*
|
|
745
|
-
* @param eventType
|
|
746
513
|
*/
|
|
747
514
|
async removeAllListeners(eventType) {
|
|
748
515
|
const removeByEvent = async (event) => {
|
|
@@ -804,7 +571,7 @@ class InternalError extends Error {
|
|
|
804
571
|
const { message, name, stack, ...rest } = err;
|
|
805
572
|
super(message);
|
|
806
573
|
this.name = name || 'Error';
|
|
807
|
-
this.stack = stack
|
|
574
|
+
this.stack = stack ?? this.toString();
|
|
808
575
|
Object.keys(rest).forEach(key => {
|
|
809
576
|
this[key] = rest[key];
|
|
810
577
|
});
|
|
@@ -813,7 +580,6 @@ class InternalError extends Error {
|
|
|
813
580
|
// For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
|
|
814
581
|
class RuntimeError extends Error {
|
|
815
582
|
static getCallSite(callsToRemove = 0) {
|
|
816
|
-
var _a, _b;
|
|
817
583
|
const length = Error.stackTraceLimit;
|
|
818
584
|
const realCallsToRemove = callsToRemove + 1; // remove this call;
|
|
819
585
|
Error.stackTraceLimit = length + realCallsToRemove;
|
|
@@ -822,7 +588,7 @@ class RuntimeError extends Error {
|
|
|
822
588
|
// This will be called when we access the `stack` property
|
|
823
589
|
Error.prepareStackTrace = (_, stack) => stack;
|
|
824
590
|
// stack is optional in non chromium contexts
|
|
825
|
-
const stack =
|
|
591
|
+
const stack = new Error().stack?.slice(realCallsToRemove) ?? [];
|
|
826
592
|
Error.prepareStackTrace = _prepareStackTrace;
|
|
827
593
|
Error.stackTraceLimit = length;
|
|
828
594
|
return stack;
|
|
@@ -844,7 +610,7 @@ class RuntimeError extends Error {
|
|
|
844
610
|
const { reason, error } = payload;
|
|
845
611
|
super(reason);
|
|
846
612
|
this.name = 'RuntimeError';
|
|
847
|
-
if (error
|
|
613
|
+
if (error?.stack) {
|
|
848
614
|
this.cause = new InternalError(error);
|
|
849
615
|
}
|
|
850
616
|
if (callSites) {
|
|
@@ -883,6 +649,20 @@ var view = {};
|
|
|
883
649
|
|
|
884
650
|
var Factory$6 = {};
|
|
885
651
|
|
|
652
|
+
var warnings = {};
|
|
653
|
+
|
|
654
|
+
Object.defineProperty(warnings, "__esModule", { value: true });
|
|
655
|
+
warnings.handleDeprecatedWarnings = void 0;
|
|
656
|
+
const handleDeprecatedWarnings = (options) => {
|
|
657
|
+
if (options.contentNavigation?.whitelist ||
|
|
658
|
+
options.contentNavigation?.blacklist ||
|
|
659
|
+
options.contentRedirect?.whitelist ||
|
|
660
|
+
options.contentRedirect?.blacklist) {
|
|
661
|
+
console.warn(`The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.`);
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
warnings.handleDeprecatedWarnings = handleDeprecatedWarnings;
|
|
665
|
+
|
|
886
666
|
var hasRequiredFactory$3;
|
|
887
667
|
|
|
888
668
|
function requireFactory$3 () {
|
|
@@ -893,6 +673,10 @@ function requireFactory$3 () {
|
|
|
893
673
|
const base_1 = base;
|
|
894
674
|
const validate_1 = validate;
|
|
895
675
|
const index_1 = requireView();
|
|
676
|
+
const warnings_1 = warnings;
|
|
677
|
+
/**
|
|
678
|
+
* Static namespace for OpenFin API methods that interact with the {@link View} class, available under `fin.View`.
|
|
679
|
+
*/
|
|
896
680
|
class ViewModule extends base_1.Base {
|
|
897
681
|
/**
|
|
898
682
|
* Creates a new View.
|
|
@@ -921,13 +705,13 @@ function requireFactory$3 () {
|
|
|
921
705
|
* ```
|
|
922
706
|
* Note that created views needs to navigate somewhere for them to actually render a website.
|
|
923
707
|
* @experimental
|
|
924
|
-
* @static
|
|
925
708
|
*/
|
|
926
709
|
async create(options) {
|
|
927
710
|
const { uuid } = this.wire.me;
|
|
928
711
|
if (!options.name || typeof options.name !== 'string') {
|
|
929
712
|
throw new Error('Please provide a name property as a string in order to create a View.');
|
|
930
713
|
}
|
|
714
|
+
(0, warnings_1.handleDeprecatedWarnings)(options);
|
|
931
715
|
if (this.wire.environment.childViews) {
|
|
932
716
|
await this.wire.environment.createChildContent({
|
|
933
717
|
entityType: 'view',
|
|
@@ -941,7 +725,6 @@ function requireFactory$3 () {
|
|
|
941
725
|
}
|
|
942
726
|
/**
|
|
943
727
|
* Asynchronously returns a View object that represents an existing view.
|
|
944
|
-
* @param identity
|
|
945
728
|
*
|
|
946
729
|
* @example
|
|
947
730
|
* ```js
|
|
@@ -950,7 +733,6 @@ function requireFactory$3 () {
|
|
|
950
733
|
* .catch(err => console.log(err));
|
|
951
734
|
* ```
|
|
952
735
|
* @experimental
|
|
953
|
-
* @static
|
|
954
736
|
*/
|
|
955
737
|
async wrap(identity) {
|
|
956
738
|
this.wire.sendAction('view-wrap');
|
|
@@ -962,7 +744,6 @@ function requireFactory$3 () {
|
|
|
962
744
|
}
|
|
963
745
|
/**
|
|
964
746
|
* Synchronously returns a View object that represents an existing view.
|
|
965
|
-
* @param identity
|
|
966
747
|
*
|
|
967
748
|
* @example
|
|
968
749
|
* ```js
|
|
@@ -970,7 +751,6 @@ function requireFactory$3 () {
|
|
|
970
751
|
* await view.hide();
|
|
971
752
|
* ```
|
|
972
753
|
* @experimental
|
|
973
|
-
* @static
|
|
974
754
|
*/
|
|
975
755
|
wrapSync(identity) {
|
|
976
756
|
this.wire.sendAction('view-wrap-sync').catch((e) => {
|
|
@@ -993,7 +773,6 @@ function requireFactory$3 () {
|
|
|
993
773
|
*
|
|
994
774
|
* ```
|
|
995
775
|
* @experimental
|
|
996
|
-
* @static
|
|
997
776
|
*/
|
|
998
777
|
getCurrent() {
|
|
999
778
|
this.wire.sendAction('view-get-current').catch((e) => {
|
|
@@ -1015,7 +794,6 @@ function requireFactory$3 () {
|
|
|
1015
794
|
*
|
|
1016
795
|
* ```
|
|
1017
796
|
* @experimental
|
|
1018
|
-
* @static
|
|
1019
797
|
*/
|
|
1020
798
|
getCurrentSync() {
|
|
1021
799
|
this.wire.sendAction('view-get-current-sync').catch((e) => {
|
|
@@ -1221,7 +999,7 @@ class ChannelsExposer {
|
|
|
1221
999
|
this.exposeFunction = async (target, config) => {
|
|
1222
1000
|
const { key, options, meta } = config;
|
|
1223
1001
|
const { id } = meta;
|
|
1224
|
-
const action = `${id}.${
|
|
1002
|
+
const action = `${id}.${options?.action || key}`;
|
|
1225
1003
|
await this.channelProviderOrClient.register(action, async ({ args }) => {
|
|
1226
1004
|
return target(...args);
|
|
1227
1005
|
});
|
|
@@ -1252,7 +1030,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1252
1030
|
};
|
|
1253
1031
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1254
1032
|
__exportStar(channelsConsumer, exports);
|
|
1255
|
-
__exportStar(channelsExposer, exports);
|
|
1033
|
+
__exportStar(channelsExposer, exports);
|
|
1256
1034
|
} (openfinChannels));
|
|
1257
1035
|
|
|
1258
1036
|
(function (exports) {
|
|
@@ -1271,7 +1049,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1271
1049
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1272
1050
|
};
|
|
1273
1051
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1274
|
-
__exportStar(openfinChannels, exports);
|
|
1052
|
+
__exportStar(openfinChannels, exports);
|
|
1275
1053
|
} (strategies));
|
|
1276
1054
|
|
|
1277
1055
|
(function (exports) {
|
|
@@ -1293,7 +1071,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1293
1071
|
__exportStar(apiConsumer, exports);
|
|
1294
1072
|
__exportStar(apiExposer, exports);
|
|
1295
1073
|
__exportStar(strategies, exports);
|
|
1296
|
-
__exportStar(decorators, exports);
|
|
1074
|
+
__exportStar(decorators, exports);
|
|
1297
1075
|
} (apiExposer$1));
|
|
1298
1076
|
|
|
1299
1077
|
var channelApiRelay = {};
|
|
@@ -1534,14 +1312,14 @@ _LayoutNode_client = new WeakMap();
|
|
|
1534
1312
|
/**
|
|
1535
1313
|
* @ignore
|
|
1536
1314
|
* @internal
|
|
1537
|
-
* Encapsulates Api consumption of {@link
|
|
1315
|
+
* Encapsulates Api consumption of {@link LayoutEntitiesClient} with a relayed dispatch
|
|
1538
1316
|
* @param client
|
|
1539
1317
|
* @param controllerId
|
|
1540
1318
|
* @param identity
|
|
1541
1319
|
* @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
|
|
1542
1320
|
*/
|
|
1543
1321
|
LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
|
|
1544
|
-
const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that has been destroyed.');
|
|
1322
|
+
const dispatch = (0, channel_api_relay_1.createRelayedDispatch)(client, identity, 'layout-relay', 'You are trying to interact with a layout component on a window that does not exist or has been destroyed.');
|
|
1545
1323
|
const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
|
|
1546
1324
|
return consumer.consume({ id: controllerId });
|
|
1547
1325
|
};
|
|
@@ -1851,8 +1629,9 @@ _ColumnOrRow_client = new WeakMap();
|
|
|
1851
1629
|
var layout_constants = {};
|
|
1852
1630
|
|
|
1853
1631
|
Object.defineProperty(layout_constants, "__esModule", { value: true });
|
|
1854
|
-
layout_constants.LAYOUT_CONTROLLER_ID = void 0;
|
|
1632
|
+
layout_constants.DEFAULT_LAYOUT_KEY = layout_constants.LAYOUT_CONTROLLER_ID = void 0;
|
|
1855
1633
|
layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
1634
|
+
layout_constants.DEFAULT_LAYOUT_KEY = 'default';
|
|
1856
1635
|
|
|
1857
1636
|
var main = {};
|
|
1858
1637
|
|
|
@@ -1860,6 +1639,10 @@ Object.defineProperty(main, "__esModule", { value: true });
|
|
|
1860
1639
|
main.WebContents = void 0;
|
|
1861
1640
|
const base_1$k = base;
|
|
1862
1641
|
class WebContents extends base_1$k.EmitterBase {
|
|
1642
|
+
/**
|
|
1643
|
+
* @param identity The identity of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
1644
|
+
* @param entityType The type of the {@link OpenFin.WebContentsEvents WebContents}.
|
|
1645
|
+
*/
|
|
1863
1646
|
constructor(wire, identity, entityType) {
|
|
1864
1647
|
super(wire, entityType, identity.uuid, identity.name);
|
|
1865
1648
|
this.identity = identity;
|
|
@@ -1867,10 +1650,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1867
1650
|
}
|
|
1868
1651
|
/**
|
|
1869
1652
|
* Gets a base64 encoded image of all or part of the WebContents.
|
|
1870
|
-
* @function capturePage
|
|
1871
1653
|
* @param options Options for the capturePage call.
|
|
1872
|
-
* @memberOf View
|
|
1873
|
-
* @instance
|
|
1874
1654
|
*
|
|
1875
1655
|
* @example
|
|
1876
1656
|
*
|
|
@@ -1915,6 +1695,11 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1915
1695
|
* }
|
|
1916
1696
|
* console.log(await wnd.capturePage(options));
|
|
1917
1697
|
* ```
|
|
1698
|
+
*
|
|
1699
|
+
* @remarks
|
|
1700
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1701
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1702
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
1918
1703
|
*/
|
|
1919
1704
|
capturePage(options) {
|
|
1920
1705
|
return this.wire.sendAction('capture-page', { options, ...this.identity }).then(({ payload }) => payload.data);
|
|
@@ -1923,9 +1708,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1923
1708
|
* Executes Javascript on the WebContents, restricted to contents you own or contents owned by
|
|
1924
1709
|
* applications you have created.
|
|
1925
1710
|
* @param code JavaScript code to be executed on the view.
|
|
1926
|
-
* @function executeJavaScript
|
|
1927
|
-
* @memberOf View
|
|
1928
|
-
* @instance
|
|
1929
1711
|
*
|
|
1930
1712
|
* @example
|
|
1931
1713
|
* View:
|
|
@@ -1953,6 +1735,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1953
1735
|
*
|
|
1954
1736
|
* executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
|
|
1955
1737
|
* ```
|
|
1738
|
+
* @remarks
|
|
1739
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1740
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1741
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
1956
1742
|
*/
|
|
1957
1743
|
executeJavaScript(code) {
|
|
1958
1744
|
return this.wire
|
|
@@ -1961,9 +1747,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1961
1747
|
}
|
|
1962
1748
|
/**
|
|
1963
1749
|
* Returns the zoom level of the WebContents.
|
|
1964
|
-
* @function getZoomLevel
|
|
1965
|
-
* @memberOf View
|
|
1966
|
-
* @instance
|
|
1967
1750
|
*
|
|
1968
1751
|
* @example
|
|
1969
1752
|
* View:
|
|
@@ -1995,6 +1778,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1995
1778
|
*
|
|
1996
1779
|
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
1997
1780
|
* ```
|
|
1781
|
+
* @remarks
|
|
1782
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1783
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1784
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
1998
1785
|
*/
|
|
1999
1786
|
getZoomLevel() {
|
|
2000
1787
|
return this.wire.sendAction('get-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
@@ -2002,9 +1789,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2002
1789
|
/**
|
|
2003
1790
|
* Sets the zoom level of the WebContents.
|
|
2004
1791
|
* @param level The zoom level
|
|
2005
|
-
* @function setZoomLevel
|
|
2006
|
-
* @memberOf View
|
|
2007
|
-
* @instance
|
|
2008
1792
|
*
|
|
2009
1793
|
* @example
|
|
2010
1794
|
* View:
|
|
@@ -2036,6 +1820,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2036
1820
|
*
|
|
2037
1821
|
* setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
2038
1822
|
* ```
|
|
1823
|
+
* @remarks
|
|
1824
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1825
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1826
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2039
1827
|
*/
|
|
2040
1828
|
setZoomLevel(level) {
|
|
2041
1829
|
return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
|
|
@@ -2043,12 +1831,9 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2043
1831
|
/**
|
|
2044
1832
|
* Navigates the WebContents to a specified URL.
|
|
2045
1833
|
*
|
|
2046
|
-
*
|
|
1834
|
+
* Note: The url must contain the protocol prefix such as http:// or https://.
|
|
2047
1835
|
* @param url - The URL to navigate the WebContents to.
|
|
2048
1836
|
*
|
|
2049
|
-
* @function navigate
|
|
2050
|
-
* @memberof View
|
|
2051
|
-
* @instance
|
|
2052
1837
|
* @example
|
|
2053
1838
|
* View:
|
|
2054
1839
|
* ```js
|
|
@@ -2076,15 +1861,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2076
1861
|
* navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
|
|
2077
1862
|
* ```
|
|
2078
1863
|
* @experimental
|
|
1864
|
+
* @remarks
|
|
1865
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1866
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1867
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2079
1868
|
*/
|
|
2080
1869
|
navigate(url) {
|
|
2081
1870
|
return this.wire.sendAction('navigate-window', { ...this.identity, url }).then(() => undefined);
|
|
2082
1871
|
}
|
|
2083
1872
|
/**
|
|
2084
1873
|
* Navigates the WebContents back one page.
|
|
2085
|
-
* @function navigateBack
|
|
2086
|
-
* @memberOf View
|
|
2087
|
-
* @instance
|
|
2088
1874
|
*
|
|
2089
1875
|
* @example
|
|
2090
1876
|
* View:
|
|
@@ -2106,15 +1892,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2106
1892
|
* }
|
|
2107
1893
|
* navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
|
|
2108
1894
|
* ```
|
|
1895
|
+
* @remarks
|
|
1896
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1897
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1898
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2109
1899
|
*/
|
|
2110
1900
|
navigateBack() {
|
|
2111
1901
|
return this.wire.sendAction('navigate-window-back', { ...this.identity }).then(() => undefined);
|
|
2112
1902
|
}
|
|
2113
1903
|
/**
|
|
2114
1904
|
* Navigates the WebContents forward one page.
|
|
2115
|
-
* @function navigateForward
|
|
2116
|
-
* @memberOf View
|
|
2117
|
-
* @instance
|
|
2118
1905
|
*
|
|
2119
1906
|
* @example
|
|
2120
1907
|
* View:
|
|
@@ -2138,15 +1925,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2138
1925
|
* }
|
|
2139
1926
|
* navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
|
|
2140
1927
|
* ```
|
|
1928
|
+
* @remarks
|
|
1929
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1930
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1931
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2141
1932
|
*/
|
|
2142
1933
|
async navigateForward() {
|
|
2143
1934
|
await this.wire.sendAction('navigate-window-forward', { ...this.identity });
|
|
2144
1935
|
}
|
|
2145
1936
|
/**
|
|
2146
1937
|
* Stops any current navigation the WebContents is performing.
|
|
2147
|
-
* @function stopNavigation
|
|
2148
|
-
* @memberOf View
|
|
2149
|
-
* @instance
|
|
2150
1938
|
*
|
|
2151
1939
|
* @example
|
|
2152
1940
|
* View:
|
|
@@ -2168,15 +1956,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2168
1956
|
* }
|
|
2169
1957
|
* stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
|
|
2170
1958
|
* ```
|
|
1959
|
+
* @remarks
|
|
1960
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
1961
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
1962
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2171
1963
|
*/
|
|
2172
1964
|
stopNavigation() {
|
|
2173
1965
|
return this.wire.sendAction('stop-window-navigation', { ...this.identity }).then(() => undefined);
|
|
2174
1966
|
}
|
|
2175
1967
|
/**
|
|
2176
1968
|
* Reloads the WebContents
|
|
2177
|
-
* @function reload
|
|
2178
|
-
* @memberOf View
|
|
2179
|
-
* @instance
|
|
2180
1969
|
*
|
|
2181
1970
|
* @example
|
|
2182
1971
|
* View:
|
|
@@ -2208,6 +1997,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2208
1997
|
* console.log('Reloaded window')
|
|
2209
1998
|
* }).catch(err => console.log(err));
|
|
2210
1999
|
* ```
|
|
2000
|
+
* @remarks
|
|
2001
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2002
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2003
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2211
2004
|
*/
|
|
2212
2005
|
reload(ignoreCache = false) {
|
|
2213
2006
|
return this.wire
|
|
@@ -2220,11 +2013,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2220
2013
|
/**
|
|
2221
2014
|
* Prints the WebContents.
|
|
2222
2015
|
* @param options Printer Options
|
|
2223
|
-
* @function print
|
|
2224
|
-
* @memberOf View
|
|
2225
|
-
* @instance
|
|
2226
2016
|
*
|
|
2227
|
-
*
|
|
2017
|
+
* Note: When `silent` is set to `true`, the API will pick the system's default printer if deviceName
|
|
2228
2018
|
* is empty and the default settings for printing.
|
|
2229
2019
|
*
|
|
2230
2020
|
* Use the CSS style `page-break-before: always;` to force print to a new page.
|
|
@@ -2237,6 +2027,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2237
2027
|
* console.log('print call has been sent to the system');
|
|
2238
2028
|
* });
|
|
2239
2029
|
* ```
|
|
2030
|
+
* @remarks
|
|
2031
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2032
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2033
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2240
2034
|
*/
|
|
2241
2035
|
print(options = {}) {
|
|
2242
2036
|
return this.wire.sendAction('print', { ...this.identity, options }).then(() => undefined);
|
|
@@ -2245,11 +2039,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2245
2039
|
* Find and highlight text on a page.
|
|
2246
2040
|
* @param searchTerm Term to find in page
|
|
2247
2041
|
* @param options Search options
|
|
2248
|
-
* @function findInPage
|
|
2249
|
-
* @memberOf View
|
|
2250
|
-
* @instance
|
|
2251
2042
|
*
|
|
2252
|
-
*
|
|
2043
|
+
* Note: By default, each subsequent call will highlight the next text that matches the search term.
|
|
2253
2044
|
*
|
|
2254
2045
|
* Returns a promise with the results for the request. By subscribing to the
|
|
2255
2046
|
* found-in-page event, you can get the results of this call as well.
|
|
@@ -2284,6 +2075,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2284
2075
|
* console.log(result)
|
|
2285
2076
|
* });
|
|
2286
2077
|
* ```
|
|
2078
|
+
* @remarks
|
|
2079
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2080
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2081
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2287
2082
|
*/
|
|
2288
2083
|
findInPage(searchTerm, options) {
|
|
2289
2084
|
return this.wire
|
|
@@ -2327,6 +2122,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2327
2122
|
* console.log(results);
|
|
2328
2123
|
* });
|
|
2329
2124
|
* ```
|
|
2125
|
+
* @remarks
|
|
2126
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2127
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2128
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2330
2129
|
*/
|
|
2331
2130
|
stopFindInPage(action) {
|
|
2332
2131
|
return this.wire.sendAction('stop-find-in-page', { ...this.identity, action }).then(() => undefined);
|
|
@@ -2334,9 +2133,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2334
2133
|
/**
|
|
2335
2134
|
* Returns an array with all system printers
|
|
2336
2135
|
* @deprecated use System.getPrinters instead
|
|
2337
|
-
* @function getPrinters
|
|
2338
|
-
* @memberOf View
|
|
2339
|
-
* @instance
|
|
2340
2136
|
*
|
|
2341
2137
|
* @example
|
|
2342
2138
|
* View:
|
|
@@ -2372,6 +2168,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2372
2168
|
* console.log(err);
|
|
2373
2169
|
* });
|
|
2374
2170
|
* ```
|
|
2171
|
+
* @remarks
|
|
2172
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2173
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2174
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2375
2175
|
*/
|
|
2376
2176
|
getPrinters() {
|
|
2377
2177
|
return this.wire.sendAction('get-printers', { ...this.identity }).then(({ payload }) => payload.data);
|
|
@@ -2379,10 +2179,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2379
2179
|
/**
|
|
2380
2180
|
* Gives focus to the WebContents.
|
|
2381
2181
|
*
|
|
2382
|
-
* @function focus
|
|
2383
|
-
* @emits focused
|
|
2384
|
-
* @memberOf Window
|
|
2385
|
-
* @instance
|
|
2386
2182
|
* @example
|
|
2387
2183
|
* ```js
|
|
2388
2184
|
* async function focusWindow() {
|
|
@@ -2398,15 +2194,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2398
2194
|
*
|
|
2399
2195
|
* focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
|
|
2400
2196
|
* ```
|
|
2197
|
+
* @remarks
|
|
2198
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2199
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2200
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2401
2201
|
*/
|
|
2402
2202
|
async focus({ emitSynthFocused } = { emitSynthFocused: true }) {
|
|
2403
2203
|
await this.wire.sendAction('focus-window', { emitSynthFocused, ...this.identity });
|
|
2404
2204
|
}
|
|
2405
2205
|
/**
|
|
2406
2206
|
* Shows the Chromium Developer Tools
|
|
2407
|
-
* @function showDeveloperTools
|
|
2408
|
-
* @memberOf View
|
|
2409
|
-
* @instance
|
|
2410
2207
|
*
|
|
2411
2208
|
* @example
|
|
2412
2209
|
* View:
|
|
@@ -2432,6 +2229,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2432
2229
|
* .then(() => console.log('Showing dev tools'))
|
|
2433
2230
|
* .catch(err => console.error(err));
|
|
2434
2231
|
* ```
|
|
2232
|
+
* @remarks
|
|
2233
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2234
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2235
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2435
2236
|
*/
|
|
2436
2237
|
async showDeveloperTools() {
|
|
2437
2238
|
// Note this hits the system action map in core state for legacy reasons.
|
|
@@ -2440,11 +2241,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2440
2241
|
/**
|
|
2441
2242
|
* Retrieves the process information associated with a WebContents.
|
|
2442
2243
|
*
|
|
2443
|
-
*
|
|
2444
|
-
*
|
|
2445
|
-
* @function getProcessInfo
|
|
2446
|
-
* @memberOf View
|
|
2447
|
-
* @instance
|
|
2244
|
+
* Note: This includes any iframes associated with the WebContents
|
|
2448
2245
|
*
|
|
2449
2246
|
* @example
|
|
2450
2247
|
* View:
|
|
@@ -2458,6 +2255,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2458
2255
|
* const win = await fin.Window.getCurrent();
|
|
2459
2256
|
* const processInfo = await win.getProcessInfo();
|
|
2460
2257
|
* ```
|
|
2258
|
+
* @remarks
|
|
2259
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2260
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2261
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2461
2262
|
*/
|
|
2462
2263
|
async getProcessInfo() {
|
|
2463
2264
|
const { payload: { data } } = await this.wire.sendAction('get-process-info', this.identity);
|
|
@@ -2465,9 +2266,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2465
2266
|
}
|
|
2466
2267
|
/**
|
|
2467
2268
|
* Retrieves information on all Shared Workers.
|
|
2468
|
-
* @function getSharedWorkers
|
|
2469
|
-
* @memberOf View
|
|
2470
|
-
* @instance
|
|
2471
2269
|
*
|
|
2472
2270
|
* @example
|
|
2473
2271
|
* View:
|
|
@@ -2496,15 +2294,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2496
2294
|
* const win = await fin.Window.create(winOption);
|
|
2497
2295
|
* const sharedWorkers = await win.getSharedWorkers();
|
|
2498
2296
|
* ```
|
|
2297
|
+
* @remarks
|
|
2298
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2299
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2300
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2499
2301
|
*/
|
|
2500
2302
|
async getSharedWorkers() {
|
|
2501
2303
|
return this.wire.sendAction('get-shared-workers', this.identity).then(({ payload }) => payload.data);
|
|
2502
2304
|
}
|
|
2503
2305
|
/**
|
|
2504
2306
|
* Opens the developer tools for the shared worker context.
|
|
2505
|
-
* @function inspectSharedWorker
|
|
2506
|
-
* @memberOf View
|
|
2507
|
-
* @instance
|
|
2508
2307
|
*
|
|
2509
2308
|
* @example
|
|
2510
2309
|
* View:
|
|
@@ -2533,6 +2332,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2533
2332
|
* const win = await fin.Window.create(winOption);
|
|
2534
2333
|
* await win.inspectSharedWorker();
|
|
2535
2334
|
* ```
|
|
2335
|
+
* @remarks
|
|
2336
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2337
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2338
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2536
2339
|
*/
|
|
2537
2340
|
async inspectSharedWorker() {
|
|
2538
2341
|
await this.wire.sendAction('inspect-shared-worker', { ...this.identity });
|
|
@@ -2540,9 +2343,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2540
2343
|
/**
|
|
2541
2344
|
* Inspects the shared worker based on its ID.
|
|
2542
2345
|
* @param workerId - The id of the shared worker.
|
|
2543
|
-
* @function inspectSharedWorkerById
|
|
2544
|
-
* @memberOf View
|
|
2545
|
-
* @instance
|
|
2546
2346
|
*
|
|
2547
2347
|
* @example
|
|
2548
2348
|
* View:
|
|
@@ -2573,15 +2373,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2573
2373
|
* const sharedWorkers = await win.getSharedWorkers();
|
|
2574
2374
|
* await win.inspectSharedWorkerById(sharedWorkers[0].id);
|
|
2575
2375
|
* ```
|
|
2376
|
+
* @remarks
|
|
2377
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2378
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2379
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2576
2380
|
*/
|
|
2577
2381
|
async inspectSharedWorkerById(workerId) {
|
|
2578
2382
|
await this.wire.sendAction('inspect-shared-worker-by-id', { ...this.identity, workerId });
|
|
2579
2383
|
}
|
|
2580
2384
|
/**
|
|
2581
2385
|
* Opens the developer tools for the service worker context.
|
|
2582
|
-
* @function inspectServiceWorker
|
|
2583
|
-
* @memberOf View
|
|
2584
|
-
* @instance
|
|
2585
2386
|
*
|
|
2586
2387
|
* @example
|
|
2587
2388
|
* View:
|
|
@@ -2610,6 +2411,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2610
2411
|
* const win = await fin.Window.create(winOption);
|
|
2611
2412
|
* await win.inspectServiceWorker();
|
|
2612
2413
|
* ```
|
|
2414
|
+
* @remarks
|
|
2415
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2416
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2417
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2613
2418
|
*/
|
|
2614
2419
|
async inspectServiceWorker() {
|
|
2615
2420
|
await this.wire.sendAction('inspect-service-worker', { ...this.identity });
|
|
@@ -2617,7 +2422,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2617
2422
|
/**
|
|
2618
2423
|
* Shows a popup window.
|
|
2619
2424
|
*
|
|
2620
|
-
*
|
|
2425
|
+
* Note: If this WebContents is a view and its attached window has a popup open, this will close it.
|
|
2621
2426
|
*
|
|
2622
2427
|
* Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
|
|
2623
2428
|
* that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
|
|
@@ -2625,7 +2430,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2625
2430
|
* open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
|
|
2626
2431
|
* will be dismissed.
|
|
2627
2432
|
*
|
|
2628
|
-
*
|
|
2433
|
+
* Note: in the case where the window being shown as a popup needs to be created, it is a child of the caller view's parent window.
|
|
2629
2434
|
*
|
|
2630
2435
|
* @example
|
|
2631
2436
|
*
|
|
@@ -2820,17 +2625,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2820
2625
|
* onPopupReady: popupWindowCallback;
|
|
2821
2626
|
* });
|
|
2822
2627
|
* ```
|
|
2823
|
-
* @
|
|
2824
|
-
* @
|
|
2825
|
-
*
|
|
2826
|
-
* @
|
|
2827
|
-
*
|
|
2628
|
+
* @remarks
|
|
2629
|
+
* `WebContents` refers to shared functionality between {@link OpenFin.Window} and {@link OpenFin.View}.
|
|
2630
|
+
* We do not expose an explicit superclass for this functionality, but it does have its own
|
|
2631
|
+
* {@link OpenFin.WebContentsEvents event namespace}.
|
|
2828
2632
|
*/
|
|
2829
2633
|
async showPopupWindow(options) {
|
|
2830
2634
|
this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
|
|
2831
2635
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2832
2636
|
});
|
|
2833
|
-
if (options
|
|
2637
|
+
if (options?.onPopupReady) {
|
|
2834
2638
|
const readyListener = async ({ popupName }) => {
|
|
2835
2639
|
try {
|
|
2836
2640
|
const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
|
|
@@ -2849,8 +2653,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2849
2653
|
...options,
|
|
2850
2654
|
// Internal use only.
|
|
2851
2655
|
// @ts-expect-error
|
|
2852
|
-
hasResultCallback: !!
|
|
2853
|
-
hasReadyCallback: !!
|
|
2656
|
+
hasResultCallback: !!options?.onPopupResult,
|
|
2657
|
+
hasReadyCallback: !!options?.onPopupReady
|
|
2854
2658
|
},
|
|
2855
2659
|
...this.identity
|
|
2856
2660
|
});
|
|
@@ -2875,7 +2679,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2875
2679
|
}
|
|
2876
2680
|
return popupResult;
|
|
2877
2681
|
};
|
|
2878
|
-
if (options
|
|
2682
|
+
if (options?.onPopupResult) {
|
|
2879
2683
|
const dispatchResultListener = async (payload) => {
|
|
2880
2684
|
await options.onPopupResult(normalizePopupResult(payload));
|
|
2881
2685
|
};
|
|
@@ -3201,6 +3005,49 @@ function requireInstance$2 () {
|
|
|
3201
3005
|
this.show = async () => {
|
|
3202
3006
|
await this.wire.sendAction('show-view', { ...this.identity });
|
|
3203
3007
|
};
|
|
3008
|
+
/**
|
|
3009
|
+
* Sets the bounds (top, left, width, height) of the view relative to its window and shows it if it is hidden.
|
|
3010
|
+
* This method ensures the view is both positioned and showing. It will reposition a visible view and both show and reposition a hidden view.
|
|
3011
|
+
*
|
|
3012
|
+
* @remarks View position is relative to the bounds of the window.
|
|
3013
|
+
* ({top: 0, left: 0} represents the top left corner of the window)
|
|
3014
|
+
*
|
|
3015
|
+
* @example
|
|
3016
|
+
* ```js
|
|
3017
|
+
* let view;
|
|
3018
|
+
* async function createView() {
|
|
3019
|
+
* const me = await fin.Window.getCurrent();
|
|
3020
|
+
* return fin.View.create({
|
|
3021
|
+
* name: 'viewNameSetBounds',
|
|
3022
|
+
* target: me.identity,
|
|
3023
|
+
* bounds: {top: 10, left: 10, width: 200, height: 200}
|
|
3024
|
+
* });
|
|
3025
|
+
* }
|
|
3026
|
+
*
|
|
3027
|
+
* async function showViewAt() {
|
|
3028
|
+
* view = await createView();
|
|
3029
|
+
* console.log('View created.');
|
|
3030
|
+
*
|
|
3031
|
+
* await view.navigate('https://google.com');
|
|
3032
|
+
* console.log('View navigated to given url.');
|
|
3033
|
+
*
|
|
3034
|
+
* await view.showAt({
|
|
3035
|
+
* top: 100,
|
|
3036
|
+
* left: 100,
|
|
3037
|
+
* width: 300,
|
|
3038
|
+
* height: 300
|
|
3039
|
+
* });
|
|
3040
|
+
* }
|
|
3041
|
+
*
|
|
3042
|
+
* showViewAt()
|
|
3043
|
+
* .then(() => console.log('View set to new bounds and shown.'))
|
|
3044
|
+
* .catch(err => console.log(err));
|
|
3045
|
+
* ```
|
|
3046
|
+
* @experimental
|
|
3047
|
+
*/
|
|
3048
|
+
this.showAt = async (bounds) => {
|
|
3049
|
+
await this.wire.sendAction('show-view-at', { bounds, ...this.identity });
|
|
3050
|
+
};
|
|
3204
3051
|
/**
|
|
3205
3052
|
* Hides the current view if it is currently visible.
|
|
3206
3053
|
*
|
|
@@ -3360,8 +3207,11 @@ function requireInstance$2 () {
|
|
|
3360
3207
|
this.wire.sendAction('view-get-parent-layout', { ...this.identity }).catch(() => {
|
|
3361
3208
|
// don't expose
|
|
3362
3209
|
});
|
|
3363
|
-
const
|
|
3364
|
-
|
|
3210
|
+
const layoutWindow = await this.getCurrentWindow();
|
|
3211
|
+
const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
|
|
3212
|
+
const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
|
|
3213
|
+
const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
|
|
3214
|
+
return this.fin.Platform.Layout.wrap(layoutIdentity);
|
|
3365
3215
|
};
|
|
3366
3216
|
/**
|
|
3367
3217
|
* Gets the View's options.
|
|
@@ -3401,7 +3251,6 @@ function requireInstance$2 () {
|
|
|
3401
3251
|
};
|
|
3402
3252
|
/**
|
|
3403
3253
|
* Updates the view's options.
|
|
3404
|
-
* @param options
|
|
3405
3254
|
*
|
|
3406
3255
|
* @example
|
|
3407
3256
|
* ```js
|
|
@@ -3442,7 +3291,6 @@ function requireInstance$2 () {
|
|
|
3442
3291
|
/**
|
|
3443
3292
|
* Retrieves the window the view is currently attached to.
|
|
3444
3293
|
*
|
|
3445
|
-
* @experimental
|
|
3446
3294
|
* @example
|
|
3447
3295
|
* ```js
|
|
3448
3296
|
* const view = fin.View.wrapSync({ uuid: 'viewUuid', name: 'viewName' });
|
|
@@ -3450,6 +3298,7 @@ function requireInstance$2 () {
|
|
|
3450
3298
|
* .then(win => console.log('current window', win))
|
|
3451
3299
|
* .catch(err => console.log(err));)
|
|
3452
3300
|
* ```
|
|
3301
|
+
* @experimental
|
|
3453
3302
|
*/
|
|
3454
3303
|
this.getCurrentWindow = async () => {
|
|
3455
3304
|
const { payload: { data } } = await this.wire.sendAction('get-view-window', { ...this.identity });
|
|
@@ -3555,10 +3404,6 @@ function requireInstance$2 () {
|
|
|
3555
3404
|
/**
|
|
3556
3405
|
* Focuses the view
|
|
3557
3406
|
*
|
|
3558
|
-
* @function focus
|
|
3559
|
-
* @memberof View
|
|
3560
|
-
* @emits focused
|
|
3561
|
-
* @instance
|
|
3562
3407
|
* @example
|
|
3563
3408
|
* ```js
|
|
3564
3409
|
* const view = fin.View.wrapSync({ uuid: 'viewUuid', name: 'viewName' });
|
|
@@ -3600,19 +3445,19 @@ function requireView () {
|
|
|
3600
3445
|
};
|
|
3601
3446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3602
3447
|
/**
|
|
3603
|
-
* Entry points for the OpenFin `View` API.
|
|
3604
|
-
*
|
|
3605
|
-
* In the previous version of the API documentation, both static methods involving `View` and instance properties of the
|
|
3606
|
-
* `View` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
3448
|
+
* Entry points for the OpenFin `View` API (`fin.View`).
|
|
3607
3449
|
*
|
|
3608
|
-
* * {@link ViewModule} contains static
|
|
3450
|
+
* * {@link ViewModule} contains static members of the `View` API, accessible through `fin.View`.
|
|
3609
3451
|
* * {@link View} describes an instance of an OpenFin View, e.g. as returned by `fin.View.getCurrent`.
|
|
3610
3452
|
*
|
|
3453
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
3454
|
+
* both of these were documented on the same page.
|
|
3455
|
+
*
|
|
3611
3456
|
* @packageDocumentation
|
|
3612
3457
|
*/
|
|
3613
3458
|
__exportStar(requireFactory$3(), exports);
|
|
3614
|
-
__exportStar(requireInstance$2(), exports);
|
|
3615
|
-
} (view));
|
|
3459
|
+
__exportStar(requireInstance$2(), exports);
|
|
3460
|
+
} (view));
|
|
3616
3461
|
return view;
|
|
3617
3462
|
}
|
|
3618
3463
|
|
|
@@ -4099,6 +3944,7 @@ function requireInstance$1 () {
|
|
|
4099
3944
|
/**
|
|
4100
3945
|
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
4101
3946
|
* If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows).
|
|
3947
|
+
*
|
|
4102
3948
|
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4103
3949
|
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
4104
3950
|
*
|
|
@@ -4399,6 +4245,7 @@ function requireInstance$1 () {
|
|
|
4399
4245
|
}
|
|
4400
4246
|
/**
|
|
4401
4247
|
* Sets file auto download location. It's only allowed in the same application.
|
|
4248
|
+
*
|
|
4402
4249
|
* Note: This method is restricted by default and must be enabled via
|
|
4403
4250
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4404
4251
|
* @param downloadLocation file auto download location
|
|
@@ -4424,6 +4271,7 @@ function requireInstance$1 () {
|
|
|
4424
4271
|
}
|
|
4425
4272
|
/**
|
|
4426
4273
|
* Gets file auto download location. It's only allowed in the same application. If file auto download location is not set, it will return the default location.
|
|
4274
|
+
*
|
|
4427
4275
|
* Note: This method is restricted by default and must be enabled via
|
|
4428
4276
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4429
4277
|
*
|
|
@@ -4454,10 +4302,12 @@ function requireFactory$2 () {
|
|
|
4454
4302
|
const base_1 = base;
|
|
4455
4303
|
const validate_1 = validate;
|
|
4456
4304
|
const Instance_1 = requireInstance$1();
|
|
4305
|
+
/**
|
|
4306
|
+
* Static namespace for OpenFin API methods that interact with the {@link Application} class, available under `fin.Application`.
|
|
4307
|
+
*/
|
|
4457
4308
|
class ApplicationModule extends base_1.Base {
|
|
4458
4309
|
/**
|
|
4459
4310
|
* Asynchronously returns an Application object that represents an existing application.
|
|
4460
|
-
* @param identity
|
|
4461
4311
|
*
|
|
4462
4312
|
* @example
|
|
4463
4313
|
*
|
|
@@ -4468,7 +4318,6 @@ function requireFactory$2 () {
|
|
|
4468
4318
|
* .catch(err => console.log(err));
|
|
4469
4319
|
* ```
|
|
4470
4320
|
*
|
|
4471
|
-
* @static
|
|
4472
4321
|
*/
|
|
4473
4322
|
async wrap(identity) {
|
|
4474
4323
|
this.wire.sendAction('wrap-application').catch((e) => {
|
|
@@ -4482,7 +4331,6 @@ function requireFactory$2 () {
|
|
|
4482
4331
|
}
|
|
4483
4332
|
/**
|
|
4484
4333
|
* Synchronously returns an Application object that represents an existing application.
|
|
4485
|
-
* @param identity
|
|
4486
4334
|
*
|
|
4487
4335
|
* @example
|
|
4488
4336
|
*
|
|
@@ -4491,7 +4339,6 @@ function requireFactory$2 () {
|
|
|
4491
4339
|
* await app.close();
|
|
4492
4340
|
* ```
|
|
4493
4341
|
*
|
|
4494
|
-
* @static
|
|
4495
4342
|
*/
|
|
4496
4343
|
wrapSync(identity) {
|
|
4497
4344
|
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
@@ -4516,8 +4363,6 @@ function requireFactory$2 () {
|
|
|
4516
4363
|
}
|
|
4517
4364
|
/**
|
|
4518
4365
|
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4519
|
-
* @param appOptions
|
|
4520
|
-
*
|
|
4521
4366
|
*
|
|
4522
4367
|
* @example
|
|
4523
4368
|
*
|
|
@@ -4546,7 +4391,6 @@ function requireFactory$2 () {
|
|
|
4546
4391
|
}
|
|
4547
4392
|
/**
|
|
4548
4393
|
* Creates and starts a new Application.
|
|
4549
|
-
* @param appOptions
|
|
4550
4394
|
*
|
|
4551
4395
|
* @example
|
|
4552
4396
|
*
|
|
@@ -4562,8 +4406,6 @@ function requireFactory$2 () {
|
|
|
4562
4406
|
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4563
4407
|
* ```
|
|
4564
4408
|
*
|
|
4565
|
-
*
|
|
4566
|
-
* @static
|
|
4567
4409
|
*/
|
|
4568
4410
|
async start(appOptions) {
|
|
4569
4411
|
this.wire.sendAction('start-application').catch((e) => {
|
|
@@ -4576,10 +4418,8 @@ function requireFactory$2 () {
|
|
|
4576
4418
|
/**
|
|
4577
4419
|
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4578
4420
|
* Returns once the RVM is finished attempting to launch the applications.
|
|
4579
|
-
* @param applications
|
|
4580
4421
|
* @param opts - Parameters that the RVM will use.
|
|
4581
4422
|
*
|
|
4582
|
-
* @static
|
|
4583
4423
|
* @example
|
|
4584
4424
|
*
|
|
4585
4425
|
* ```js
|
|
@@ -4631,8 +4471,6 @@ function requireFactory$2 () {
|
|
|
4631
4471
|
* });
|
|
4632
4472
|
*
|
|
4633
4473
|
* ```
|
|
4634
|
-
*
|
|
4635
|
-
* @static
|
|
4636
4474
|
*/
|
|
4637
4475
|
getCurrent() {
|
|
4638
4476
|
this.wire.sendAction('get-current-application').catch((e) => {
|
|
@@ -4658,8 +4496,6 @@ function requireFactory$2 () {
|
|
|
4658
4496
|
* });
|
|
4659
4497
|
*
|
|
4660
4498
|
* ```
|
|
4661
|
-
*
|
|
4662
|
-
* @static
|
|
4663
4499
|
*/
|
|
4664
4500
|
getCurrentSync() {
|
|
4665
4501
|
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
@@ -4680,8 +4516,6 @@ function requireFactory$2 () {
|
|
|
4680
4516
|
* // For a local manifest file:
|
|
4681
4517
|
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4682
4518
|
* ```
|
|
4683
|
-
*
|
|
4684
|
-
* @static
|
|
4685
4519
|
*/
|
|
4686
4520
|
async startFromManifest(manifestUrl, opts) {
|
|
4687
4521
|
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
@@ -4752,19 +4586,19 @@ function requireApplication () {
|
|
|
4752
4586
|
};
|
|
4753
4587
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4754
4588
|
/**
|
|
4755
|
-
* Entry points for the OpenFin `Application` API.
|
|
4589
|
+
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
4756
4590
|
*
|
|
4757
|
-
*
|
|
4758
|
-
* `Application` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
4759
|
-
*
|
|
4760
|
-
* * {@link ApplicationModule} contains static methods relating to the `Application` type, accessible through `fin.Application`.
|
|
4591
|
+
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
4761
4592
|
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
4762
4593
|
*
|
|
4594
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
4595
|
+
* both of these were documented on the same page.
|
|
4596
|
+
*
|
|
4763
4597
|
* @packageDocumentation
|
|
4764
4598
|
*/
|
|
4765
4599
|
__exportStar(requireFactory$2(), exports);
|
|
4766
|
-
__exportStar(requireInstance$1(), exports);
|
|
4767
|
-
} (application));
|
|
4600
|
+
__exportStar(requireInstance$1(), exports);
|
|
4601
|
+
} (application));
|
|
4768
4602
|
return application;
|
|
4769
4603
|
}
|
|
4770
4604
|
|
|
@@ -4782,6 +4616,7 @@ function requireInstance () {
|
|
|
4782
4616
|
const application_1 = requireApplication();
|
|
4783
4617
|
const main_1 = main;
|
|
4784
4618
|
const view_1 = requireView();
|
|
4619
|
+
const warnings_1 = warnings;
|
|
4785
4620
|
/**
|
|
4786
4621
|
* @PORTED
|
|
4787
4622
|
* @typedef { object } Margins
|
|
@@ -5266,7 +5101,6 @@ function requireInstance () {
|
|
|
5266
5101
|
*/
|
|
5267
5102
|
constructor(wire, identity) {
|
|
5268
5103
|
super(wire, identity, 'window');
|
|
5269
|
-
this.identity = identity;
|
|
5270
5104
|
}
|
|
5271
5105
|
/**
|
|
5272
5106
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -5392,6 +5226,7 @@ function requireInstance () {
|
|
|
5392
5226
|
if (options.autoShow === undefined) {
|
|
5393
5227
|
options.autoShow = true;
|
|
5394
5228
|
}
|
|
5229
|
+
(0, warnings_1.handleDeprecatedWarnings)(options);
|
|
5395
5230
|
const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
|
|
5396
5231
|
Promise.all([pageResponse, windowCreation])
|
|
5397
5232
|
.then((resolvedArr) => {
|
|
@@ -5808,15 +5643,15 @@ function requireInstance () {
|
|
|
5808
5643
|
* ```
|
|
5809
5644
|
* @experimental
|
|
5810
5645
|
*/
|
|
5811
|
-
async getLayout() {
|
|
5646
|
+
async getLayout(layoutIdentity) {
|
|
5812
5647
|
this.wire.sendAction('window-get-layout', this.identity).catch((e) => {
|
|
5813
5648
|
// don't expose
|
|
5814
5649
|
});
|
|
5815
5650
|
const opts = await this.getOptions();
|
|
5816
|
-
if (!opts.layout) {
|
|
5651
|
+
if (!opts.layout /* TODO || !opts.layoutSnapshot */) {
|
|
5817
5652
|
throw new Error('Window does not have a Layout');
|
|
5818
5653
|
}
|
|
5819
|
-
return this.fin.Platform.Layout.wrap(this.identity);
|
|
5654
|
+
return this.fin.Platform.Layout.wrap(layoutIdentity ?? this.identity);
|
|
5820
5655
|
}
|
|
5821
5656
|
/**
|
|
5822
5657
|
* Gets the current settings of the window.
|
|
@@ -6097,11 +5932,12 @@ function requireInstance () {
|
|
|
6097
5932
|
* moveBy(580, 300).then(() => console.log('Moved')).catch(err => console.log(err));
|
|
6098
5933
|
* ```
|
|
6099
5934
|
*/
|
|
6100
|
-
moveBy(deltaLeft, deltaTop) {
|
|
5935
|
+
moveBy(deltaLeft, deltaTop, positioningOptions) {
|
|
6101
5936
|
return this.wire
|
|
6102
5937
|
.sendAction('move-window-by', {
|
|
6103
5938
|
deltaLeft,
|
|
6104
5939
|
deltaTop,
|
|
5940
|
+
positioningOptions,
|
|
6105
5941
|
...this.identity
|
|
6106
5942
|
})
|
|
6107
5943
|
.then(() => undefined);
|
|
@@ -6131,11 +5967,12 @@ function requireInstance () {
|
|
|
6131
5967
|
* moveTo(580, 300).then(() => console.log('Moved')).catch(err => console.log(err))
|
|
6132
5968
|
* ```
|
|
6133
5969
|
*/
|
|
6134
|
-
moveTo(left, top) {
|
|
5970
|
+
moveTo(left, top, positioningOptions) {
|
|
6135
5971
|
return this.wire
|
|
6136
5972
|
.sendAction('move-window', {
|
|
6137
5973
|
left,
|
|
6138
5974
|
top,
|
|
5975
|
+
positioningOptions,
|
|
6139
5976
|
...this.identity
|
|
6140
5977
|
})
|
|
6141
5978
|
.then(() => undefined);
|
|
@@ -6168,12 +6005,13 @@ function requireInstance () {
|
|
|
6168
6005
|
* resizeBy(580, 300, 'top-right').then(() => console.log('Resized')).catch(err => console.log(err));
|
|
6169
6006
|
* ```
|
|
6170
6007
|
*/
|
|
6171
|
-
resizeBy(deltaWidth, deltaHeight, anchor) {
|
|
6008
|
+
resizeBy(deltaWidth, deltaHeight, anchor, positioningOptions) {
|
|
6172
6009
|
return this.wire
|
|
6173
6010
|
.sendAction('resize-window-by', {
|
|
6174
6011
|
deltaWidth: Math.floor(deltaWidth),
|
|
6175
6012
|
deltaHeight: Math.floor(deltaHeight),
|
|
6176
6013
|
anchor,
|
|
6014
|
+
positioningOptions,
|
|
6177
6015
|
...this.identity
|
|
6178
6016
|
})
|
|
6179
6017
|
.then(() => undefined);
|
|
@@ -6206,12 +6044,13 @@ function requireInstance () {
|
|
|
6206
6044
|
* resizeTo(580, 300, 'top-left').then(() => console.log('Resized')).catch(err => console.log(err));
|
|
6207
6045
|
* ```
|
|
6208
6046
|
*/
|
|
6209
|
-
resizeTo(width, height, anchor) {
|
|
6047
|
+
resizeTo(width, height, anchor, positioningOptions) {
|
|
6210
6048
|
return this.wire
|
|
6211
6049
|
.sendAction('resize-window', {
|
|
6212
6050
|
width: Math.floor(width),
|
|
6213
6051
|
height: Math.floor(height),
|
|
6214
6052
|
anchor,
|
|
6053
|
+
positioningOptions,
|
|
6215
6054
|
...this.identity
|
|
6216
6055
|
})
|
|
6217
6056
|
.then(() => undefined);
|
|
@@ -6270,7 +6109,6 @@ function requireInstance () {
|
|
|
6270
6109
|
}
|
|
6271
6110
|
/**
|
|
6272
6111
|
* Sets the window's size and position.
|
|
6273
|
-
* @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
|
|
6274
6112
|
*
|
|
6275
6113
|
* @example
|
|
6276
6114
|
* ```js
|
|
@@ -6297,8 +6135,10 @@ function requireInstance () {
|
|
|
6297
6135
|
* }).then(() => console.log('Bounds set to window')).catch(err => console.log(err));
|
|
6298
6136
|
* ```
|
|
6299
6137
|
*/
|
|
6300
|
-
setBounds(bounds) {
|
|
6301
|
-
return this.wire
|
|
6138
|
+
setBounds(bounds, positioningOptions) {
|
|
6139
|
+
return this.wire
|
|
6140
|
+
.sendAction('set-window-bounds', { ...bounds, ...this.identity, positioningOptions })
|
|
6141
|
+
.then(() => undefined);
|
|
6302
6142
|
}
|
|
6303
6143
|
/**
|
|
6304
6144
|
* Shows the window if it is hidden.
|
|
@@ -6440,7 +6280,10 @@ function requireInstance () {
|
|
|
6440
6280
|
* Calling this method will close previously opened menus.
|
|
6441
6281
|
* @experimental
|
|
6442
6282
|
* @param options
|
|
6443
|
-
*
|
|
6283
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
|
6284
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
|
6285
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
|
6286
|
+
* these with a "reducer" pattern.
|
|
6444
6287
|
* @example
|
|
6445
6288
|
* This could be used to show a drop down menu over views in a platform window:
|
|
6446
6289
|
* ```js
|
|
@@ -6530,6 +6373,7 @@ function requireInstance () {
|
|
|
6530
6373
|
return this.wire.sendAction('close-popup-menu', { ...this.identity }).then(() => undefined);
|
|
6531
6374
|
}
|
|
6532
6375
|
/**
|
|
6376
|
+
* @PORTED
|
|
6533
6377
|
* @typedef {object} PopupOptions
|
|
6534
6378
|
* @property {string} [name] - If a window with this `name` exists, it will be shown as a popup. Otherwise, a new window with this `name` will be created. If this `name` is undefined, `initialOptions.name` will be used. If this `name` and `intialOptions.name` are both undefined, a `name` will be generated.
|
|
6535
6379
|
* @property {string} [url] - Navigates to this `url` if showing an existing window as a popup, otherwise the newly created window will load this `url`.
|
|
@@ -6547,6 +6391,7 @@ function requireInstance () {
|
|
|
6547
6391
|
* @property {boolean} [hideOnClose] - Hide the popup window instead of closing whenever `close` is called on it. Note: if this is `true` and `blurBehavior` and/or `resultDispatchBehavior` are set to `close`, the window will be hidden.
|
|
6548
6392
|
*/
|
|
6549
6393
|
/**
|
|
6394
|
+
* @PORTED
|
|
6550
6395
|
* @typedef {object} PopupResult
|
|
6551
6396
|
* @property {Identity} identity - `name` and `uuid` of the popup window that called dispatched this result.
|
|
6552
6397
|
* @property {'clicked' | 'dismissed'} result - Result of the user interaction with the popup window.
|
|
@@ -6640,10 +6485,12 @@ function requireFactory$1 () {
|
|
|
6640
6485
|
const base_1 = base;
|
|
6641
6486
|
const validate_1 = validate;
|
|
6642
6487
|
const Instance_1 = requireInstance();
|
|
6488
|
+
/**
|
|
6489
|
+
* Static namespace for OpenFin API methods that interact with the {@link _Window} class, available under `fin.Window`.
|
|
6490
|
+
*/
|
|
6643
6491
|
class _WindowModule extends base_1.Base {
|
|
6644
6492
|
/**
|
|
6645
6493
|
* Asynchronously returns a Window object that represents an existing window.
|
|
6646
|
-
* @param identity
|
|
6647
6494
|
*
|
|
6648
6495
|
* @example
|
|
6649
6496
|
* ```js
|
|
@@ -6660,7 +6507,6 @@ function requireFactory$1 () {
|
|
|
6660
6507
|
* .then(win => console.log('wrapped window'))
|
|
6661
6508
|
* .catch(err => console.log(err));
|
|
6662
6509
|
* ```
|
|
6663
|
-
* @static
|
|
6664
6510
|
*/
|
|
6665
6511
|
async wrap(identity) {
|
|
6666
6512
|
this.wire.sendAction('window-wrap').catch((e) => {
|
|
@@ -6674,7 +6520,6 @@ function requireFactory$1 () {
|
|
|
6674
6520
|
}
|
|
6675
6521
|
/**
|
|
6676
6522
|
* Synchronously returns a Window object that represents an existing window.
|
|
6677
|
-
* @param identity
|
|
6678
6523
|
*
|
|
6679
6524
|
* @example
|
|
6680
6525
|
* ```js
|
|
@@ -6690,7 +6535,6 @@ function requireFactory$1 () {
|
|
|
6690
6535
|
* await createWin();
|
|
6691
6536
|
* let win = fin.Window.wrapSync({ uuid: 'app-1', name: 'myApp' });
|
|
6692
6537
|
* ```
|
|
6693
|
-
* @static
|
|
6694
6538
|
*/
|
|
6695
6539
|
wrapSync(identity) {
|
|
6696
6540
|
this.wire.sendAction('window-wrap-sync').catch((e) => {
|
|
@@ -6722,7 +6566,6 @@ function requireFactory$1 () {
|
|
|
6722
6566
|
*
|
|
6723
6567
|
* createWindow().then(() => console.log('Window is created')).catch(err => console.log(err));
|
|
6724
6568
|
* ```
|
|
6725
|
-
* @static
|
|
6726
6569
|
*/
|
|
6727
6570
|
create(options) {
|
|
6728
6571
|
this.wire.sendAction('create-window').catch((e) => {
|
|
@@ -6741,7 +6584,6 @@ function requireFactory$1 () {
|
|
|
6741
6584
|
* .catch(err => console.log(err));
|
|
6742
6585
|
*
|
|
6743
6586
|
* ```
|
|
6744
|
-
* @static
|
|
6745
6587
|
*/
|
|
6746
6588
|
getCurrent() {
|
|
6747
6589
|
this.wire.sendAction('get-current-window').catch((e) => {
|
|
@@ -6763,7 +6605,6 @@ function requireFactory$1 () {
|
|
|
6763
6605
|
* console.log(info);
|
|
6764
6606
|
*
|
|
6765
6607
|
* ```
|
|
6766
|
-
* @static
|
|
6767
6608
|
*/
|
|
6768
6609
|
getCurrentSync() {
|
|
6769
6610
|
this.wire.sendAction('get-current-window-sync').catch((e) => {
|
|
@@ -6802,30 +6643,37 @@ function requireWindow () {
|
|
|
6802
6643
|
};
|
|
6803
6644
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6804
6645
|
/**
|
|
6805
|
-
* Entry points for the OpenFin `Window` API.
|
|
6646
|
+
* Entry points for the OpenFin `Window` API (`fin.Window`).
|
|
6806
6647
|
*
|
|
6807
|
-
*
|
|
6808
|
-
* `Window` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
6809
|
-
*
|
|
6810
|
-
* * {@link _WindowModule} contains static methods relating to the `Window` type, accessible through `fin.Window`.
|
|
6648
|
+
* * {@link _WindowModule} contains static members of the `Window` API, accessible through `fin.Window`.
|
|
6811
6649
|
* * {@link _Window} describes an instance of an OpenFin Window, e.g. as returned by `fin.Window.getCurrent`.
|
|
6812
6650
|
*
|
|
6651
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
6652
|
+
* both of these were documented on the same page.
|
|
6653
|
+
*
|
|
6813
6654
|
* Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
|
|
6814
6655
|
*
|
|
6815
6656
|
* @packageDocumentation
|
|
6816
6657
|
*/
|
|
6817
6658
|
__exportStar(requireFactory$1(), exports);
|
|
6818
|
-
__exportStar(requireInstance(), exports);
|
|
6819
|
-
} (window$1));
|
|
6659
|
+
__exportStar(requireInstance(), exports);
|
|
6660
|
+
} (window$1));
|
|
6820
6661
|
return window$1;
|
|
6821
6662
|
}
|
|
6822
6663
|
|
|
6664
|
+
/**
|
|
6665
|
+
* Entry point for the OpenFin `System` API (`fin.System`).
|
|
6666
|
+
*
|
|
6667
|
+
* * {@link System} contains static members of the `System` API (available under `fin.System`)
|
|
6668
|
+
*
|
|
6669
|
+
* @packageDocumentation
|
|
6670
|
+
*/
|
|
6823
6671
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
6824
6672
|
system.System = void 0;
|
|
6825
6673
|
const base_1$j = base;
|
|
6826
6674
|
const transport_errors_1$1 = transportErrors;
|
|
6827
6675
|
const window_1 = requireWindow();
|
|
6828
|
-
const events_1$6 =
|
|
6676
|
+
const events_1$6 = require$$0;
|
|
6829
6677
|
/**
|
|
6830
6678
|
* An object representing the core of OpenFin Runtime. Allows the developer
|
|
6831
6679
|
* to perform system-level actions, such as accessing logs, viewing processes,
|
|
@@ -7137,7 +6985,6 @@ class System extends base_1$j.EmitterBase {
|
|
|
7137
6985
|
* ```js
|
|
7138
6986
|
* fin.System.getUniqueUserId().then(id => console.log(id)).catch(err => console.log(err));
|
|
7139
6987
|
* ```
|
|
7140
|
-
* @static
|
|
7141
6988
|
*/
|
|
7142
6989
|
getUniqueUserId() {
|
|
7143
6990
|
return this.wire.sendAction('get-unique-user-id').then(({ payload }) => payload.data);
|
|
@@ -7828,7 +7675,8 @@ class System extends base_1$j.EmitterBase {
|
|
|
7828
7675
|
}
|
|
7829
7676
|
/**
|
|
7830
7677
|
* Attempt to close an external process. The process will be terminated if it
|
|
7831
|
-
* has not closed after the elapsed timeout in milliseconds
|
|
7678
|
+
* has not closed after the elapsed timeout in milliseconds.
|
|
7679
|
+
*
|
|
7832
7680
|
* Note: This method is restricted by default and must be enabled via
|
|
7833
7681
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
7834
7682
|
* @param options A object defined in the TerminateExternalRequestType interface
|
|
@@ -7864,7 +7712,8 @@ class System extends base_1$j.EmitterBase {
|
|
|
7864
7712
|
return this.wire.sendAction('update-proxy', options).then(() => undefined);
|
|
7865
7713
|
}
|
|
7866
7714
|
/**
|
|
7867
|
-
* Downloads the given application asset
|
|
7715
|
+
* Downloads the given application asset.
|
|
7716
|
+
*
|
|
7868
7717
|
* Note: This method is restricted by default and must be enabled via
|
|
7869
7718
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
7870
7719
|
* @param appAsset App asset object
|
|
@@ -8408,7 +8257,6 @@ class System extends base_1$j.EmitterBase {
|
|
|
8408
8257
|
* }
|
|
8409
8258
|
* });
|
|
8410
8259
|
* ```
|
|
8411
|
-
* @static
|
|
8412
8260
|
*/
|
|
8413
8261
|
async launchManifest(manifestUrl, opts = {}) {
|
|
8414
8262
|
const { subscribe, ..._sendOpts } = opts;
|
|
@@ -8759,7 +8607,7 @@ class ChannelBase {
|
|
|
8759
8607
|
try {
|
|
8760
8608
|
const mainAction = this.subscriptions.has(topic)
|
|
8761
8609
|
? this.subscriptions.get(topic)
|
|
8762
|
-
: (currentPayload, id) =>
|
|
8610
|
+
: (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
|
|
8763
8611
|
const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
|
|
8764
8612
|
const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
|
|
8765
8613
|
return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
|
|
@@ -9088,17 +8936,17 @@ const channelClientsByEndpointId = new Map();
|
|
|
9088
8936
|
* provider via {@link ChannelClient#dispatch dispatch} and to listen for communication
|
|
9089
8937
|
* from the provider by registering an action via {@link ChannelClient#register register}.
|
|
9090
8938
|
*
|
|
9091
|
-
* Synchronous Methods:
|
|
8939
|
+
* ### Synchronous Methods:
|
|
9092
8940
|
* * {@link ChannelClient#onDisconnection onDisconnection(listener)}
|
|
9093
8941
|
* * {@link ChannelClient#register register(action, listener)}
|
|
9094
8942
|
* * {@link ChannelClient#remove remove(action)}
|
|
9095
8943
|
*
|
|
9096
|
-
* Asynchronous Methods:
|
|
8944
|
+
* ### Asynchronous Methods:
|
|
9097
8945
|
* * {@link ChannelClient#disconnect disconnect()}
|
|
9098
8946
|
* * {@link ChannelClient#dispatch dispatch(action, payload)}
|
|
9099
8947
|
*
|
|
9100
|
-
* Middleware:
|
|
9101
|
-
*
|
|
8948
|
+
* ### Middleware:
|
|
8949
|
+
* Middleware functions receive the following arguments: (action, payload, senderId).
|
|
9102
8950
|
* The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
|
|
9103
8951
|
* unless it is undefined, in which case the original payload is used. Middleware can be used for side effects.
|
|
9104
8952
|
* * {@link ChannelClient#setDefaultAction setDefaultAction(middleware)}
|
|
@@ -9292,7 +9140,6 @@ class ClassicStrategy {
|
|
|
9292
9140
|
// connection problems occur
|
|
9293
9141
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
|
|
9294
9142
|
this.send = async (endpointId, action, payload) => {
|
|
9295
|
-
var _a;
|
|
9296
9143
|
const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
9297
9144
|
if (!to) {
|
|
9298
9145
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
@@ -9312,13 +9159,12 @@ class ClassicStrategy {
|
|
|
9312
9159
|
action,
|
|
9313
9160
|
payload
|
|
9314
9161
|
});
|
|
9315
|
-
|
|
9162
|
+
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
9316
9163
|
const raw = await p.catch((error) => {
|
|
9317
9164
|
throw new Error(error.message);
|
|
9318
9165
|
}).finally(() => {
|
|
9319
|
-
var _a;
|
|
9320
9166
|
// clean up the pending promise
|
|
9321
|
-
|
|
9167
|
+
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
9322
9168
|
});
|
|
9323
9169
|
return raw.payload.data.result;
|
|
9324
9170
|
};
|
|
@@ -9339,8 +9185,8 @@ class ClassicStrategy {
|
|
|
9339
9185
|
const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
9340
9186
|
__classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
9341
9187
|
const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
9342
|
-
pendingSet
|
|
9343
|
-
const errorMsg = `Channel connection with identity uuid: ${id
|
|
9188
|
+
pendingSet?.forEach((p) => {
|
|
9189
|
+
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
|
9344
9190
|
p.cancel(new Error(errorMsg));
|
|
9345
9191
|
});
|
|
9346
9192
|
}
|
|
@@ -9352,9 +9198,8 @@ class ClassicStrategy {
|
|
|
9352
9198
|
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
9353
9199
|
}
|
|
9354
9200
|
isValidEndpointPayload(payload) {
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
typeof ((_b = payload === null || payload === void 0 ? void 0 : payload.endpointIdentity) === null || _b === void 0 ? void 0 : _b.channelId) === 'string');
|
|
9201
|
+
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
|
9202
|
+
typeof payload?.endpointIdentity?.channelId === 'string');
|
|
9358
9203
|
}
|
|
9359
9204
|
}
|
|
9360
9205
|
strategy$2.ClassicStrategy = ClassicStrategy;
|
|
@@ -9431,13 +9276,12 @@ class RTCEndpoint {
|
|
|
9431
9276
|
this.rtc.rtcClient.close();
|
|
9432
9277
|
};
|
|
9433
9278
|
this.rtc.channels.response.addEventListener('message', (e) => {
|
|
9434
|
-
var _a;
|
|
9435
9279
|
let { data } = e;
|
|
9436
9280
|
if (e.data instanceof ArrayBuffer) {
|
|
9437
9281
|
data = new TextDecoder().decode(e.data);
|
|
9438
9282
|
}
|
|
9439
9283
|
const { messageId, payload, success, error } = JSON.parse(data);
|
|
9440
|
-
const { resolve, reject } =
|
|
9284
|
+
const { resolve, reject } = this.responseMap.get(messageId) ?? {};
|
|
9441
9285
|
if (resolve && reject) {
|
|
9442
9286
|
this.responseMap.delete(messageId);
|
|
9443
9287
|
if (success) {
|
|
@@ -9686,9 +9530,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
|
|
|
9686
9530
|
const rtcConnectionId = Math.random().toString();
|
|
9687
9531
|
const rtcClient = this.createRtcPeer();
|
|
9688
9532
|
rtcClient.addEventListener('icecandidate', async (e) => {
|
|
9689
|
-
var _a;
|
|
9690
9533
|
if (e.candidate) {
|
|
9691
|
-
await this.raiseClientIce(rtcConnectionId, { candidate:
|
|
9534
|
+
await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
|
|
9692
9535
|
}
|
|
9693
9536
|
});
|
|
9694
9537
|
await this.listenForProviderIce(rtcConnectionId, async (payload) => {
|
|
@@ -9713,9 +9556,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
|
|
|
9713
9556
|
const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
|
|
9714
9557
|
const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
|
|
9715
9558
|
rtcClient.addEventListener('icecandidate', async (e) => {
|
|
9716
|
-
var _a;
|
|
9717
9559
|
if (e.candidate) {
|
|
9718
|
-
await this.raiseProviderIce(rtcConnectionId, { candidate:
|
|
9560
|
+
await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
|
|
9719
9561
|
}
|
|
9720
9562
|
});
|
|
9721
9563
|
await this.listenForClientIce(rtcConnectionId, async (payload) => {
|
|
@@ -9788,20 +9630,20 @@ const runtimeVersioning_1 = runtimeVersioning;
|
|
|
9788
9630
|
* a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
|
|
9789
9631
|
* and to listen for communication from clients by registering an action via {@link ChannelProvider#register register}.
|
|
9790
9632
|
*
|
|
9791
|
-
* Synchronous Methods:
|
|
9633
|
+
* ### Synchronous Methods:
|
|
9792
9634
|
* * {@link ChannelProvider#onConnection onConnection(listener)}
|
|
9793
9635
|
* * {@link ChannelProvider#onDisconnection onDisconnection(listener)}
|
|
9794
9636
|
* * {@link ChannelProvider#publish publish(action, payload)}
|
|
9795
9637
|
* * {@link ChannelProvider#register register(action, listener)}
|
|
9796
9638
|
* * {@link ChannelProvider#remove remove(action)}
|
|
9797
9639
|
*
|
|
9798
|
-
* Asynchronous Methods:
|
|
9640
|
+
* ### Asynchronous Methods:
|
|
9799
9641
|
* * {@link ChannelProvider#destroy destroy()}
|
|
9800
9642
|
* * {@link ChannelProvider#dispatch dispatch(to, action, payload)}
|
|
9801
9643
|
* * {@link ChannelProvider#getAllClientInfo getAllClientInfo()}
|
|
9802
9644
|
*
|
|
9803
|
-
* Middleware:
|
|
9804
|
-
*
|
|
9645
|
+
* ### Middleware:
|
|
9646
|
+
* Middleware functions receive the following arguments: (action, payload, senderId).
|
|
9805
9647
|
* The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
|
|
9806
9648
|
* unless it is undefined, in which case the most recently defined payload is used. Middleware can be used for side effects.
|
|
9807
9649
|
* * {@link ChannelProvider#setDefaultAction setDefaultAction(middleware)}
|
|
@@ -9897,8 +9739,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
9897
9739
|
* ```
|
|
9898
9740
|
*/
|
|
9899
9741
|
dispatch(to, action, payload) {
|
|
9900
|
-
|
|
9901
|
-
const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
|
|
9742
|
+
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
9902
9743
|
if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
9903
9744
|
return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
|
|
9904
9745
|
}
|
|
@@ -10074,13 +9915,12 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10074
9915
|
}
|
|
10075
9916
|
}
|
|
10076
9917
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
10077
|
-
var _a;
|
|
10078
9918
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
10079
9919
|
if (matchingConnections.length >= 2) {
|
|
10080
9920
|
const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
|
|
10081
9921
|
const { uuid, name } = clientIdentity;
|
|
10082
|
-
const providerUuid = protectedObj
|
|
10083
|
-
const providerName = protectedObj
|
|
9922
|
+
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
9923
|
+
const providerName = protectedObj?.providerIdentity.name;
|
|
10084
9924
|
// eslint-disable-next-line no-console
|
|
10085
9925
|
console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
|
|
10086
9926
|
"endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
|
|
@@ -10088,7 +9928,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10088
9928
|
({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
|
|
10089
9929
|
}
|
|
10090
9930
|
// Pop to return the most recently created endpointId.
|
|
10091
|
-
return
|
|
9931
|
+
return matchingConnections.pop()?.endpointId;
|
|
10092
9932
|
}
|
|
10093
9933
|
// eslint-disable-next-line class-methods-use-this
|
|
10094
9934
|
static clientIdentityIncludesEndpointId(subscriptionIdentity) {
|
|
@@ -10131,9 +9971,10 @@ class MessageReceiver extends base_1$h.Base {
|
|
|
10131
9971
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
10132
9972
|
}
|
|
10133
9973
|
async processChannelMessage(msg) {
|
|
10134
|
-
var _a, _b;
|
|
10135
9974
|
const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
|
|
10136
|
-
const key =
|
|
9975
|
+
const key = intendedTargetIdentity.channelId ?? // The recipient is a provider
|
|
9976
|
+
intendedTargetIdentity.endpointId ?? // The recipient is a client
|
|
9977
|
+
this.latestEndpointIdByChannelId.get(providerIdentity.channelId); // No endpointId was passed, make best attempt
|
|
10137
9978
|
const handler = this.endpointMap.get(key);
|
|
10138
9979
|
if (!handler) {
|
|
10139
9980
|
ackToSender.payload.success = false;
|
|
@@ -10213,12 +10054,9 @@ class ProtocolManager {
|
|
|
10213
10054
|
return supported;
|
|
10214
10055
|
};
|
|
10215
10056
|
this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
|
|
10216
|
-
const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) =>
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
clientProtocol.version >= providerProtocol.minimumVersion &&
|
|
10220
|
-
providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
|
|
10221
|
-
}));
|
|
10057
|
+
const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) => providerProtocol.type === clientProtocol.type &&
|
|
10058
|
+
clientProtocol.version >= providerProtocol.minimumVersion &&
|
|
10059
|
+
providerProtocol.version >= (clientProtocol.minimumVersion ?? 0)));
|
|
10222
10060
|
return supported.slice(0, clientOffer.maxProtocols);
|
|
10223
10061
|
};
|
|
10224
10062
|
}
|
|
@@ -10343,7 +10181,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10343
10181
|
}
|
|
10344
10182
|
createProvider(options, providerIdentity) {
|
|
10345
10183
|
const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
|
|
10346
|
-
const protocols = this.protocolManager.getProviderProtocols(opts
|
|
10184
|
+
const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
|
|
10347
10185
|
const createSingleStrategy = (stratType) => {
|
|
10348
10186
|
switch (stratType) {
|
|
10349
10187
|
case 'rtc':
|
|
@@ -10380,7 +10218,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10380
10218
|
return channel;
|
|
10381
10219
|
}
|
|
10382
10220
|
async createClientOffer(options) {
|
|
10383
|
-
const protocols = this.protocolManager.getClientProtocols(options
|
|
10221
|
+
const protocols = this.protocolManager.getClientProtocols(options?.protocols);
|
|
10384
10222
|
let rtcPacket;
|
|
10385
10223
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
10386
10224
|
switch (type) {
|
|
@@ -10408,14 +10246,13 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10408
10246
|
};
|
|
10409
10247
|
}
|
|
10410
10248
|
async createClientStrategy(rtcPacket, routingInfo) {
|
|
10411
|
-
var _a;
|
|
10412
10249
|
if (!routingInfo.endpointId) {
|
|
10413
10250
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
10414
10251
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
10415
10252
|
// clients that are in the same context as the newly-connected client.
|
|
10416
10253
|
__classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
10417
10254
|
}
|
|
10418
|
-
const answer =
|
|
10255
|
+
const answer = routingInfo.answer ?? {
|
|
10419
10256
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
10420
10257
|
};
|
|
10421
10258
|
const createStrategyFromAnswer = async (protocol) => {
|
|
@@ -10473,7 +10310,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10473
10310
|
if (!(provider instanceof provider_1$1.ChannelProvider)) {
|
|
10474
10311
|
throw Error('Cannot connect to a channel client');
|
|
10475
10312
|
}
|
|
10476
|
-
const offer = clientOffer
|
|
10313
|
+
const offer = clientOffer ?? {
|
|
10477
10314
|
supportedProtocols: [{ type: 'classic', version: 1 }],
|
|
10478
10315
|
maxProtocols: 1
|
|
10479
10316
|
};
|
|
@@ -10531,6 +10368,15 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10531
10368
|
connectionManager.ConnectionManager = ConnectionManager;
|
|
10532
10369
|
_ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
|
|
10533
10370
|
|
|
10371
|
+
/**
|
|
10372
|
+
* Entry points for the `Channel` subset of the `InterApplicationBus` API (`fin.InterApplicationBus.Channel`).
|
|
10373
|
+
*
|
|
10374
|
+
* * {@link Channel} contains static members of the `Channel` API, accessible through `fin.InterApplicationBus.Channel`.
|
|
10375
|
+
* * {@link OpenFin.ChannelClient} describes a client of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.connect`.
|
|
10376
|
+
* * {@link OpenFin.ChannelProvider} describes a provider of a channel, e.g. as returned by `fin.InterApplicationBus.Channel.create`.
|
|
10377
|
+
*
|
|
10378
|
+
* @packageDocumentation
|
|
10379
|
+
*/
|
|
10534
10380
|
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10535
10381
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10536
10382
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -10546,7 +10392,7 @@ var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnec
|
|
|
10546
10392
|
Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
10547
10393
|
channel$1.Channel = void 0;
|
|
10548
10394
|
/* eslint-disable no-console */
|
|
10549
|
-
const events_1$5 =
|
|
10395
|
+
const events_1$5 = require$$0;
|
|
10550
10396
|
const lazy_1$1 = lazy;
|
|
10551
10397
|
const base_1$f = base;
|
|
10552
10398
|
const client_1 = client;
|
|
@@ -10866,7 +10712,14 @@ _Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakM
|
|
|
10866
10712
|
|
|
10867
10713
|
Object.defineProperty(interappbus, "__esModule", { value: true });
|
|
10868
10714
|
interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
10869
|
-
|
|
10715
|
+
/**
|
|
10716
|
+
* Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
|
|
10717
|
+
*
|
|
10718
|
+
* * {@link InterApplicationBus} contains static members of the `InterApplicationBus` API, accessible through `fin.InterApplicationBus`.
|
|
10719
|
+
*
|
|
10720
|
+
* @packageDocumentation
|
|
10721
|
+
*/
|
|
10722
|
+
const events_1$4 = require$$0;
|
|
10870
10723
|
const base_1$e = base;
|
|
10871
10724
|
const ref_counter_1 = refCounter;
|
|
10872
10725
|
const index_1$2 = channel$1;
|
|
@@ -11074,6 +10927,13 @@ function createKey(...toHash) {
|
|
|
11074
10927
|
|
|
11075
10928
|
var clipboard = {};
|
|
11076
10929
|
|
|
10930
|
+
/**
|
|
10931
|
+
* Entry point for the OpenFin `Clipboard` API (`fin.Clipboard`).
|
|
10932
|
+
*
|
|
10933
|
+
* * {@link Clipboard} contains static members of the `Clipboard` API, accessible through `fin.Clipboard`.
|
|
10934
|
+
*
|
|
10935
|
+
* @packageDocumentation
|
|
10936
|
+
*/
|
|
11077
10937
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
11078
10938
|
clipboard.Clipboard = void 0;
|
|
11079
10939
|
const base_1$d = base;
|
|
@@ -11288,7 +11148,7 @@ const base_1$c = base;
|
|
|
11288
11148
|
/**
|
|
11289
11149
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
|
11290
11150
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
|
11291
|
-
* Discovery of connections is provided by
|
|
11151
|
+
* Discovery of connections is provided by {@link System.System.getAllExternalApplications getAllExternalApplications}.</a>
|
|
11292
11152
|
*
|
|
11293
11153
|
* Processes that can be wrapped as `ExternalApplication`s include the following:
|
|
11294
11154
|
* - Processes which have connected to an OpenFin runtime via an adapter
|
|
@@ -11402,6 +11262,9 @@ Object.defineProperty(Factory$5, "__esModule", { value: true });
|
|
|
11402
11262
|
Factory$5.ExternalApplicationModule = void 0;
|
|
11403
11263
|
const base_1$b = base;
|
|
11404
11264
|
const Instance_1$4 = Instance$4;
|
|
11265
|
+
/**
|
|
11266
|
+
* Static namespace for OpenFin API methods that interact with the {@link ExternalApplication} class, available under `fin.ExternalApplication`.
|
|
11267
|
+
*/
|
|
11405
11268
|
class ExternalApplicationModule extends base_1$b.Base {
|
|
11406
11269
|
/**
|
|
11407
11270
|
* Asynchronously returns an External Application object that represents an external application.
|
|
@@ -11415,7 +11278,6 @@ class ExternalApplicationModule extends base_1$b.Base {
|
|
|
11415
11278
|
* .then(extApp => console.log('wrapped external application'))
|
|
11416
11279
|
* .catch(err => console.log(err));
|
|
11417
11280
|
* ```
|
|
11418
|
-
* @static
|
|
11419
11281
|
*/
|
|
11420
11282
|
wrap(uuid) {
|
|
11421
11283
|
this.wire.sendAction('external-application-wrap').catch((e) => {
|
|
@@ -11435,7 +11297,6 @@ class ExternalApplicationModule extends base_1$b.Base {
|
|
|
11435
11297
|
* const info = await extApp.getInfo();
|
|
11436
11298
|
* console.log(info);
|
|
11437
11299
|
* ```
|
|
11438
|
-
* @static
|
|
11439
11300
|
*/
|
|
11440
11301
|
wrapSync(uuid) {
|
|
11441
11302
|
this.wire.sendAction('external-application-wrap-sync').catch((e) => {
|
|
@@ -11463,18 +11324,18 @@ Factory$5.ExternalApplicationModule = ExternalApplicationModule;
|
|
|
11463
11324
|
};
|
|
11464
11325
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11465
11326
|
/**
|
|
11466
|
-
* Entry points for the OpenFin `ExternalApplication` API.
|
|
11327
|
+
* Entry points for the OpenFin `ExternalApplication` API (`fin.ExternalApplication`).
|
|
11467
11328
|
*
|
|
11468
|
-
*
|
|
11469
|
-
* `ExternalApplication` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
11470
|
-
*
|
|
11471
|
-
* * {@link ExternalApplicationModule} contains static methods relating to the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
|
|
11329
|
+
* * {@link ExternalApplicationModule} contains static members of the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
|
|
11472
11330
|
* * {@link ExternalApplication} describes an instance of an OpenFin ExternalApplication, e.g. as returned by `fin.ExternalApplication.getCurrent`.
|
|
11473
11331
|
*
|
|
11332
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
11333
|
+
* both of these were documented on the same page.
|
|
11334
|
+
*
|
|
11474
11335
|
* @packageDocumentation
|
|
11475
11336
|
*/
|
|
11476
11337
|
__exportStar(Factory$5, exports);
|
|
11477
|
-
__exportStar(Instance$4, exports);
|
|
11338
|
+
__exportStar(Instance$4, exports);
|
|
11478
11339
|
} (externalApplication));
|
|
11479
11340
|
|
|
11480
11341
|
var frame = {};
|
|
@@ -11631,6 +11492,9 @@ Factory$4._FrameModule = void 0;
|
|
|
11631
11492
|
const base_1$9 = base;
|
|
11632
11493
|
const validate_1$2 = validate;
|
|
11633
11494
|
const Instance_1$3 = Instance$3;
|
|
11495
|
+
/**
|
|
11496
|
+
* Static namespace for OpenFin API methods that interact with the {@link _Frame} class, available under `fin.Frame`.
|
|
11497
|
+
*/
|
|
11634
11498
|
class _FrameModule extends base_1$9.Base {
|
|
11635
11499
|
/**
|
|
11636
11500
|
* Asynchronously returns a reference to the specified frame. The frame does not have to exist
|
|
@@ -11642,7 +11506,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11642
11506
|
* .then(frm => console.log('wrapped frame'))
|
|
11643
11507
|
* .catch(err => console.log(err));
|
|
11644
11508
|
* ```
|
|
11645
|
-
* @static
|
|
11646
11509
|
*/
|
|
11647
11510
|
async wrap(identity) {
|
|
11648
11511
|
this.wire.sendAction('frame-wrap').catch((e) => {
|
|
@@ -11664,7 +11527,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11664
11527
|
* const info = await frm.getInfo();
|
|
11665
11528
|
* console.log(info);
|
|
11666
11529
|
* ```
|
|
11667
|
-
* @static
|
|
11668
11530
|
*/
|
|
11669
11531
|
wrapSync(identity) {
|
|
11670
11532
|
this.wire.sendAction('frame-wrap-sync').catch((e) => {
|
|
@@ -11685,7 +11547,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11685
11547
|
* .then(frm => console.log('current frame'))
|
|
11686
11548
|
* .catch(err => console.log(err));
|
|
11687
11549
|
* ```
|
|
11688
|
-
* @static
|
|
11689
11550
|
*/
|
|
11690
11551
|
getCurrent() {
|
|
11691
11552
|
this.wire.sendAction('frame-get-current').catch((e) => {
|
|
@@ -11702,7 +11563,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11702
11563
|
* const info = await frm.getInfo();
|
|
11703
11564
|
* console.log(info);
|
|
11704
11565
|
* ```
|
|
11705
|
-
* @static
|
|
11706
11566
|
*/
|
|
11707
11567
|
getCurrentSync() {
|
|
11708
11568
|
this.wire.sendAction('frame-get-current-sync').catch((e) => {
|
|
@@ -11715,14 +11575,14 @@ Factory$4._FrameModule = _FrameModule;
|
|
|
11715
11575
|
|
|
11716
11576
|
(function (exports) {
|
|
11717
11577
|
/**
|
|
11718
|
-
* Entry points for the OpenFin `Frame` API.
|
|
11719
|
-
*
|
|
11720
|
-
* In the previous version of the API documentation, both static methods involving `Frame` and instance properties of the
|
|
11721
|
-
* `Frame` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
11578
|
+
* Entry points for the OpenFin `Frame` API (`fin.Frame`).
|
|
11722
11579
|
*
|
|
11723
|
-
* * {@link _FrameModule} contains static
|
|
11580
|
+
* * {@link _FrameModule} contains static members of the `Frame` API, accessible through `fin.Frame`.
|
|
11724
11581
|
* * {@link _Frame} describes an instance of an OpenFin Frame, e.g. as returned by `fin.Frame.getCurrent`.
|
|
11725
11582
|
*
|
|
11583
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
11584
|
+
* both of these were documented on the same page.
|
|
11585
|
+
*
|
|
11726
11586
|
* Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
|
|
11727
11587
|
*
|
|
11728
11588
|
* @packageDocumentation
|
|
@@ -11743,7 +11603,7 @@ Factory$4._FrameModule = _FrameModule;
|
|
|
11743
11603
|
};
|
|
11744
11604
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11745
11605
|
__exportStar(Factory$4, exports);
|
|
11746
|
-
__exportStar(Instance$3, exports);
|
|
11606
|
+
__exportStar(Instance$3, exports);
|
|
11747
11607
|
} (frame));
|
|
11748
11608
|
|
|
11749
11609
|
var globalHotkey = {};
|
|
@@ -11902,10 +11762,8 @@ const validate_1$1 = validate;
|
|
|
11902
11762
|
const clientMap = new Map();
|
|
11903
11763
|
/** Manages the life cycle of windows and views in the application.
|
|
11904
11764
|
*
|
|
11905
|
-
* Enables taking snapshots of itself and
|
|
11906
|
-
* ng them to restore a previous configuration
|
|
11765
|
+
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
|
11907
11766
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
|
11908
|
-
*
|
|
11909
11767
|
*/
|
|
11910
11768
|
class Platform extends base_1$7.EmitterBase {
|
|
11911
11769
|
/**
|
|
@@ -12264,15 +12122,13 @@ class Platform extends base_1$7.EmitterBase {
|
|
|
12264
12122
|
});
|
|
12265
12123
|
}
|
|
12266
12124
|
/**
|
|
12267
|
-
* ***DEPRECATED - please use Platform.createView.***
|
|
12125
|
+
* ***DEPRECATED - please use {@link Platform.createView Platform.createView}.***
|
|
12268
12126
|
* Reparents a specified view in a new target window.
|
|
12269
12127
|
* @param viewIdentity View identity
|
|
12270
12128
|
* @param target new owner window identity
|
|
12271
12129
|
*
|
|
12272
|
-
* @tutorial Platform.createView
|
|
12273
12130
|
*/
|
|
12274
12131
|
async reparentView(viewIdentity, target) {
|
|
12275
|
-
var _a;
|
|
12276
12132
|
// eslint-disable-next-line no-console
|
|
12277
12133
|
console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
|
|
12278
12134
|
this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
|
|
@@ -12280,7 +12136,7 @@ class Platform extends base_1$7.EmitterBase {
|
|
|
12280
12136
|
});
|
|
12281
12137
|
const normalizedViewIdentity = {
|
|
12282
12138
|
...viewIdentity,
|
|
12283
|
-
uuid:
|
|
12139
|
+
uuid: viewIdentity.uuid ?? this.identity.uuid
|
|
12284
12140
|
};
|
|
12285
12141
|
const view = await this.fin.View.wrap(normalizedViewIdentity);
|
|
12286
12142
|
const viewOptions = await view.getOptions();
|
|
@@ -12763,6 +12619,138 @@ const base_1$6 = base;
|
|
|
12763
12619
|
const common_utils_1 = commonUtils;
|
|
12764
12620
|
const layout_entities_1 = layoutEntities;
|
|
12765
12621
|
const layout_constants_1 = layout_constants;
|
|
12622
|
+
/**
|
|
12623
|
+
*
|
|
12624
|
+
* Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
|
|
12625
|
+
* enables the initialization and manipulation of a window's Layout. A Layout will
|
|
12626
|
+
* emit events locally on the DOM element representing the layout-container.
|
|
12627
|
+
*
|
|
12628
|
+
*
|
|
12629
|
+
* ### Layout.DOMEvents
|
|
12630
|
+
*
|
|
12631
|
+
* When a Layout is created, it emits events onto the DOM element representing the Layout container.
|
|
12632
|
+
* This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
|
|
12633
|
+
* You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
|
|
12634
|
+
* The events are emitted synchronously and only in the process where the Layout exists.
|
|
12635
|
+
* Any values returned by the called listeners are ignored and will be discarded.
|
|
12636
|
+
* If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
|
|
12637
|
+
*
|
|
12638
|
+
* @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
|
|
12639
|
+
*
|
|
12640
|
+
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
|
|
12641
|
+
* Adds a listener to the end of the listeners array for the specified event.
|
|
12642
|
+
* @example
|
|
12643
|
+
* ```js
|
|
12644
|
+
* const myLayoutContainer = document.getElementById('layout-container');
|
|
12645
|
+
*
|
|
12646
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
12647
|
+
* const { tabSelector } = event.detail;
|
|
12648
|
+
* const tabElement = document.getElementById(tabSelector);
|
|
12649
|
+
* const existingColor = tabElement.style.backgroundColor;
|
|
12650
|
+
* tabElement.style.backgroundColor = "red";
|
|
12651
|
+
* setTimeout(() => {
|
|
12652
|
+
* tabElement.style.backgroundColor = existingColor;
|
|
12653
|
+
* }, 2000);
|
|
12654
|
+
* });
|
|
12655
|
+
* ```
|
|
12656
|
+
*
|
|
12657
|
+
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
|
|
12658
|
+
* Adds a listener to the end of the listeners array for the specified event.
|
|
12659
|
+
* @example
|
|
12660
|
+
* ```js
|
|
12661
|
+
* const myLayoutContainer = document.getElementById('layout-container');
|
|
12662
|
+
*
|
|
12663
|
+
* const listener = function(event) {
|
|
12664
|
+
* console.log(event.detail);
|
|
12665
|
+
* console.log('container-created event fired once, removing listener');
|
|
12666
|
+
* myLayoutContainer.removeEventListener('container-created', listener);
|
|
12667
|
+
* };
|
|
12668
|
+
*
|
|
12669
|
+
* myLayoutContainer.addEventListener('container-created', listener);
|
|
12670
|
+
* ```
|
|
12671
|
+
*
|
|
12672
|
+
* ### Supported event types are:
|
|
12673
|
+
*
|
|
12674
|
+
* * tab-created
|
|
12675
|
+
* * container-created
|
|
12676
|
+
* * layout-state-changed
|
|
12677
|
+
* * tab-closed
|
|
12678
|
+
* * tab-dropped
|
|
12679
|
+
*
|
|
12680
|
+
* ### Layout DOM Node Events
|
|
12681
|
+
*
|
|
12682
|
+
* #### tab-created
|
|
12683
|
+
* Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
|
|
12684
|
+
* ```js
|
|
12685
|
+
* // The response has the following shape in event.detail:
|
|
12686
|
+
* {
|
|
12687
|
+
* containerSelector: "container-component_A",
|
|
12688
|
+
* name: "component_A",
|
|
12689
|
+
* tabSelector: "tab-component_A",
|
|
12690
|
+
* topic: "openfin-DOM-event",
|
|
12691
|
+
* type: "tab-created",
|
|
12692
|
+
* uuid: "OpenFin POC"
|
|
12693
|
+
* }
|
|
12694
|
+
* ```
|
|
12695
|
+
*
|
|
12696
|
+
* #### container-created
|
|
12697
|
+
* Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
|
|
12698
|
+
* ```js
|
|
12699
|
+
* // The response has the following shape in event.detail:
|
|
12700
|
+
* {
|
|
12701
|
+
* containerSelector: "container-component_A",
|
|
12702
|
+
* name: "component_A",
|
|
12703
|
+
* tabSelector: "tab-component_A",
|
|
12704
|
+
* topic: "openfin-DOM-event",
|
|
12705
|
+
* type: "container-created",
|
|
12706
|
+
* uuid: "OpenFin POC"
|
|
12707
|
+
* }
|
|
12708
|
+
* ```
|
|
12709
|
+
*
|
|
12710
|
+
* ### layout-state-changed
|
|
12711
|
+
* Generated when the state of the layout changes in any way, such as a view added/removed/replaced. Note that this event can fire frequently as the underlying layout can change multiple components from all kinds of changes (resizing for example). Given this, it is recommended to debounce this event and then you can use the {@link Layout#getConfig Layout.getConfig} API to retrieve the most up-to-date state.
|
|
12712
|
+
* ```js
|
|
12713
|
+
* // The response has the following shape in event.detail
|
|
12714
|
+
* {
|
|
12715
|
+
* containerSelector: "container-component_A",
|
|
12716
|
+
* name: "component_A",
|
|
12717
|
+
* tabSelector: "tab-component_A",
|
|
12718
|
+
* topic: "openfin-DOM-event",
|
|
12719
|
+
* type: "layout-state-changed",
|
|
12720
|
+
* uuid: "OpenFin POC"
|
|
12721
|
+
* }
|
|
12722
|
+
* ```
|
|
12723
|
+
*
|
|
12724
|
+
* #### tab-closed
|
|
12725
|
+
* Generated when a tab is closed.
|
|
12726
|
+
* ```js
|
|
12727
|
+
* // The response has the following shape in event.detail:
|
|
12728
|
+
* {
|
|
12729
|
+
* containerSelector: "container-component_A",
|
|
12730
|
+
* name: "component_A",
|
|
12731
|
+
* tabSelector: "tab-component_A",
|
|
12732
|
+
* topic: "openfin-DOM-event",
|
|
12733
|
+
* type: "tab-closed",
|
|
12734
|
+
* uuid: "OpenFin POC",
|
|
12735
|
+
* url: "http://openfin.co" // The url of the view that was closed.
|
|
12736
|
+
* }
|
|
12737
|
+
* ```
|
|
12738
|
+
*
|
|
12739
|
+
* #### tab-dropped
|
|
12740
|
+
* Generated when a tab is dropped.
|
|
12741
|
+
* ```js
|
|
12742
|
+
* // The response has the following shape in event.detail:
|
|
12743
|
+
* {
|
|
12744
|
+
* containerSelector: "container-component_A",
|
|
12745
|
+
* name: "component_A",
|
|
12746
|
+
* tabSelector: "tab-component_A",
|
|
12747
|
+
* topic: "openfin-DOM-event",
|
|
12748
|
+
* type: "tab-dropped",
|
|
12749
|
+
* uuid: "OpenFin POC",
|
|
12750
|
+
* url: "http://openfin.co" // The url of the view linked to the dropped tab.
|
|
12751
|
+
* }
|
|
12752
|
+
* ```
|
|
12753
|
+
*/
|
|
12766
12754
|
class Layout extends base_1$6.Base {
|
|
12767
12755
|
/**
|
|
12768
12756
|
* @internal
|
|
@@ -12940,6 +12928,25 @@ class Layout extends base_1$6.Base {
|
|
|
12940
12928
|
target: this.identity
|
|
12941
12929
|
});
|
|
12942
12930
|
}
|
|
12931
|
+
/**
|
|
12932
|
+
* Retrieves the attached views in current window layout.
|
|
12933
|
+
*
|
|
12934
|
+
* @example
|
|
12935
|
+
* ```js
|
|
12936
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
12937
|
+
* const views = await layout.getCurrentViews();
|
|
12938
|
+
* ```
|
|
12939
|
+
*/
|
|
12940
|
+
async getCurrentViews() {
|
|
12941
|
+
this.wire.sendAction('layout-get-views').catch((e) => {
|
|
12942
|
+
// don't expose
|
|
12943
|
+
});
|
|
12944
|
+
const client = await this.platform.getClient();
|
|
12945
|
+
const viewIdentities = await client.dispatch('get-layout-views', {
|
|
12946
|
+
target: this.identity
|
|
12947
|
+
});
|
|
12948
|
+
return viewIdentities.map((identity) => this.fin.View.wrapSync(identity));
|
|
12949
|
+
}
|
|
12943
12950
|
/**
|
|
12944
12951
|
* Retrieves the top level content item of the layout.
|
|
12945
12952
|
*
|
|
@@ -12966,7 +12973,7 @@ class Layout extends base_1$6.Base {
|
|
|
12966
12973
|
// don't expose
|
|
12967
12974
|
});
|
|
12968
12975
|
const client = await __classPrivateFieldGet$5(this, _Layout_layoutClient, "f").getValue();
|
|
12969
|
-
const root = await client.getRoot();
|
|
12976
|
+
const root = await client.getRoot(this.identity);
|
|
12970
12977
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
|
12971
12978
|
}
|
|
12972
12979
|
}
|
|
@@ -12990,6 +12997,9 @@ Factory$2.LayoutModule = void 0;
|
|
|
12990
12997
|
/* eslint-disable no-undef, import/prefer-default-export */
|
|
12991
12998
|
const base_1$5 = base;
|
|
12992
12999
|
const Instance_1$2 = Instance$1;
|
|
13000
|
+
/**
|
|
13001
|
+
* Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
|
|
13002
|
+
*/
|
|
12993
13003
|
class LayoutModule extends base_1$5.Base {
|
|
12994
13004
|
constructor() {
|
|
12995
13005
|
super(...arguments);
|
|
@@ -13031,7 +13041,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13031
13041
|
* // the window must have been created with a layout in its window options
|
|
13032
13042
|
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
13033
13043
|
* ```
|
|
13034
|
-
* @static
|
|
13035
13044
|
*/
|
|
13036
13045
|
this.init = async (options = {}) => {
|
|
13037
13046
|
this.wire.sendAction('layout-init').catch((e) => {
|
|
@@ -13044,12 +13053,12 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13044
13053
|
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
13045
13054
|
}
|
|
13046
13055
|
__classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
13056
|
+
// TODO: remove this.wire and always use this.fin
|
|
13047
13057
|
return this.wire.environment.initLayout(this.fin, this.wire, options);
|
|
13048
13058
|
};
|
|
13049
13059
|
}
|
|
13050
13060
|
/**
|
|
13051
13061
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
13052
|
-
* @param identity
|
|
13053
13062
|
*
|
|
13054
13063
|
* @example
|
|
13055
13064
|
* ```js
|
|
@@ -13066,9 +13075,7 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13066
13075
|
* // Use wrapped instance to control layout, e.g.:
|
|
13067
13076
|
* const layoutConfig = await layout.getConfig();
|
|
13068
13077
|
* ```
|
|
13069
|
-
* @static
|
|
13070
13078
|
*/
|
|
13071
|
-
// eslint-disable-next-line class-methods-use-this
|
|
13072
13079
|
async wrap(identity) {
|
|
13073
13080
|
this.wire.sendAction('layout-wrap').catch((e) => {
|
|
13074
13081
|
// don't expose
|
|
@@ -13077,7 +13084,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13077
13084
|
}
|
|
13078
13085
|
/**
|
|
13079
13086
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
13080
|
-
* @param identity
|
|
13081
13087
|
*
|
|
13082
13088
|
* @example
|
|
13083
13089
|
* ```js
|
|
@@ -13094,9 +13100,7 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13094
13100
|
* // Use wrapped instance to control layout, e.g.:
|
|
13095
13101
|
* const layoutConfig = await layout.getConfig();
|
|
13096
13102
|
* ```
|
|
13097
|
-
* @static
|
|
13098
13103
|
*/
|
|
13099
|
-
// eslint-disable-next-line class-methods-use-this
|
|
13100
13104
|
wrapSync(identity) {
|
|
13101
13105
|
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
|
13102
13106
|
// don't expose
|
|
@@ -13112,7 +13116,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13112
13116
|
* // Use wrapped instance to control layout, e.g.:
|
|
13113
13117
|
* const layoutConfig = await layout.getConfig();
|
|
13114
13118
|
* ```
|
|
13115
|
-
* @static
|
|
13116
13119
|
*/
|
|
13117
13120
|
async getCurrent() {
|
|
13118
13121
|
this.wire.sendAction('layout-get-current').catch((e) => {
|
|
@@ -13136,7 +13139,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13136
13139
|
* // Use wrapped instance to control layout, e.g.:
|
|
13137
13140
|
* const layoutConfig = await layout.getConfig();
|
|
13138
13141
|
* ```
|
|
13139
|
-
* @static
|
|
13140
13142
|
*/
|
|
13141
13143
|
getCurrentSync() {
|
|
13142
13144
|
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
|
@@ -13154,139 +13156,16 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
|
13154
13156
|
|
|
13155
13157
|
(function (exports) {
|
|
13156
13158
|
/**
|
|
13157
|
-
* Entry point for the OpenFin Layout
|
|
13158
|
-
*
|
|
13159
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "LayoutModule" is used for
|
|
13160
|
-
* the module containing static members of the `Layout` namespace (available under `fin.Platform.Layout`), while `Layout` documents
|
|
13161
|
-
* instances of the OpenFin `Layout` class.
|
|
13159
|
+
* Entry point for the OpenFin `Layout` subset of the `Platform` API (`fin.Platform.Layout`).
|
|
13162
13160
|
*
|
|
13163
|
-
* @
|
|
13164
|
-
*
|
|
13165
|
-
*
|
|
13166
|
-
* ### Layout.DOMEvents
|
|
13167
|
-
*
|
|
13168
|
-
* When a Layout is created, it emits events onto the DOM element representing the Layout container.
|
|
13169
|
-
* This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
|
|
13170
|
-
* You can use the built-in event emitter to listen to these events using [addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
|
|
13171
|
-
* The events are emitted synchronously and only in the process where the Layout exists.
|
|
13172
|
-
* Any values returned by the called listeners are ignored and will be discarded.
|
|
13173
|
-
* If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
|
|
13174
|
-
*
|
|
13175
|
-
* @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
|
|
13176
|
-
*
|
|
13177
|
-
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
|
|
13178
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
13179
|
-
* @example
|
|
13180
|
-
* ```js
|
|
13181
|
-
* const myLayoutContainer = document.getElementById('layout-container');
|
|
13182
|
-
*
|
|
13183
|
-
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
13184
|
-
* const { tabSelector } = event.detail;
|
|
13185
|
-
* const tabElement = document.getElementById(tabSelector);
|
|
13186
|
-
* const existingColor = tabElement.style.backgroundColor;
|
|
13187
|
-
* tabElement.style.backgroundColor = "red";
|
|
13188
|
-
* setTimeout(() => {
|
|
13189
|
-
* tabElement.style.backgroundColor = existingColor;
|
|
13190
|
-
* }, 2000);
|
|
13191
|
-
* });
|
|
13192
|
-
* ```
|
|
13193
|
-
*
|
|
13194
|
-
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
|
|
13195
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
13196
|
-
* @example
|
|
13197
|
-
* ```js
|
|
13198
|
-
* const myLayoutContainer = document.getElementById('layout-container');
|
|
13199
|
-
*
|
|
13200
|
-
* const listener = function(event) {
|
|
13201
|
-
* console.log(event.detail);
|
|
13202
|
-
* console.log('container-created event fired once, removing listener');
|
|
13203
|
-
* myLayoutContainer.removeEventListener('container-created', listener);
|
|
13204
|
-
* };
|
|
13205
|
-
*
|
|
13206
|
-
* myLayoutContainer.addEventListener('container-created', listener);
|
|
13207
|
-
* ```
|
|
13208
|
-
*
|
|
13209
|
-
* ### Supported event types are:
|
|
13210
|
-
*
|
|
13211
|
-
* * tab-created
|
|
13212
|
-
* * container-created
|
|
13213
|
-
* * layout-state-changed
|
|
13214
|
-
* * tab-closed
|
|
13215
|
-
* * tab-dropped
|
|
13216
|
-
*
|
|
13217
|
-
* ### Layout DOM Node Events
|
|
13218
|
-
*
|
|
13219
|
-
* #### tab-created
|
|
13220
|
-
* Generated when a tab is created. As a user drags and drops tabs within window, new tabs are created. A single view may have multiple tabs created and destroyed during its lifetime attached to a single window.
|
|
13221
|
-
* ```js
|
|
13222
|
-
* // The response has the following shape in event.detail:
|
|
13223
|
-
* {
|
|
13224
|
-
* containerSelector: "container-component_A",
|
|
13225
|
-
* name: "component_A",
|
|
13226
|
-
* tabSelector: "tab-component_A",
|
|
13227
|
-
* topic: "openfin-DOM-event",
|
|
13228
|
-
* type: "tab-created",
|
|
13229
|
-
* uuid: "OpenFin POC"
|
|
13230
|
-
* }
|
|
13231
|
-
* ```
|
|
13232
|
-
*
|
|
13233
|
-
* #### container-created
|
|
13234
|
-
* Generated when a container is created. A single view will have only one container during its lifetime attached to a single window and the container's lifecycle is tied to the view. To discover when the container is destroyed, please listen to view-detached event.
|
|
13235
|
-
* ```js
|
|
13236
|
-
* // The response has the following shape in event.detail:
|
|
13237
|
-
* {
|
|
13238
|
-
* containerSelector: "container-component_A",
|
|
13239
|
-
* name: "component_A",
|
|
13240
|
-
* tabSelector: "tab-component_A",
|
|
13241
|
-
* topic: "openfin-DOM-event",
|
|
13242
|
-
* type: "container-created",
|
|
13243
|
-
* uuid: "OpenFin POC"
|
|
13244
|
-
* }
|
|
13245
|
-
* ```
|
|
13161
|
+
* * {@link LayoutModule} contains static members of the `Layout` API, accessible through `fin.Platform.Layout`.
|
|
13162
|
+
* * {@link Layout} describes an instance of an OpenFin Layout, e.g. as returned by `fin.Platform.Layout.getCurrent`.
|
|
13246
13163
|
*
|
|
13247
|
-
*
|
|
13248
|
-
*
|
|
13249
|
-
* ```js
|
|
13250
|
-
* // The response has the following shape in event.detail
|
|
13251
|
-
* {
|
|
13252
|
-
* containerSelector: "container-component_A",
|
|
13253
|
-
* name: "component_A",
|
|
13254
|
-
* tabSelector: "tab-component_A",
|
|
13255
|
-
* topic: "openfin-DOM-event",
|
|
13256
|
-
* type: "layout-state-changed",
|
|
13257
|
-
* uuid: "OpenFin POC"
|
|
13258
|
-
* }
|
|
13259
|
-
* ```
|
|
13164
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
13165
|
+
* both of these were documented on the same page.
|
|
13260
13166
|
*
|
|
13261
|
-
*
|
|
13262
|
-
* Generated when a tab is closed.
|
|
13263
|
-
* ```js
|
|
13264
|
-
* // The response has the following shape in event.detail:
|
|
13265
|
-
* {
|
|
13266
|
-
* containerSelector: "container-component_A",
|
|
13267
|
-
* name: "component_A",
|
|
13268
|
-
* tabSelector: "tab-component_A",
|
|
13269
|
-
* topic: "openfin-DOM-event",
|
|
13270
|
-
* type: "tab-closed",
|
|
13271
|
-
* uuid: "OpenFin POC",
|
|
13272
|
-
* url: "http://openfin.co" // The url of the view that was closed.
|
|
13273
|
-
* }
|
|
13274
|
-
* ```
|
|
13167
|
+
* @packageDocumentation
|
|
13275
13168
|
*
|
|
13276
|
-
* #### tab-dropped
|
|
13277
|
-
* Generated when a tab is dropped.
|
|
13278
|
-
* ```js
|
|
13279
|
-
* // The response has the following shape in event.detail:
|
|
13280
|
-
* {
|
|
13281
|
-
* containerSelector: "container-component_A",
|
|
13282
|
-
* name: "component_A",
|
|
13283
|
-
* tabSelector: "tab-component_A",
|
|
13284
|
-
* topic: "openfin-DOM-event",
|
|
13285
|
-
* type: "tab-dropped",
|
|
13286
|
-
* uuid: "OpenFin POC",
|
|
13287
|
-
* url: "http://openfin.co" // The url of the view linked to the dropped tab.
|
|
13288
|
-
* }
|
|
13289
|
-
* ```
|
|
13290
13169
|
*/
|
|
13291
13170
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13292
13171
|
if (k2 === undefined) k2 = k;
|
|
@@ -13304,7 +13183,7 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
|
13304
13183
|
};
|
|
13305
13184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13306
13185
|
__exportStar(Factory$2, exports);
|
|
13307
|
-
__exportStar(Instance$1, exports);
|
|
13186
|
+
__exportStar(Instance$1, exports);
|
|
13308
13187
|
} (layout));
|
|
13309
13188
|
|
|
13310
13189
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
|
@@ -13312,6 +13191,9 @@ Factory$3.PlatformModule = void 0;
|
|
|
13312
13191
|
const base_1$4 = base;
|
|
13313
13192
|
const Instance_1$1 = Instance$2;
|
|
13314
13193
|
const index_1$1 = layout;
|
|
13194
|
+
/**
|
|
13195
|
+
* Static namespace for OpenFin API methods that interact with the {@link Platform} class, available under `fin.Platform`.
|
|
13196
|
+
*/
|
|
13315
13197
|
class PlatformModule extends base_1$4.Base {
|
|
13316
13198
|
/**
|
|
13317
13199
|
* @internal
|
|
@@ -13377,14 +13259,12 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13377
13259
|
* fin.Platform.init({overrideCallback});
|
|
13378
13260
|
* ```
|
|
13379
13261
|
* @experimental
|
|
13380
|
-
* @static
|
|
13381
13262
|
*/
|
|
13382
13263
|
async init(options) {
|
|
13383
13264
|
return this.wire.environment.initPlatform(this.fin, options);
|
|
13384
13265
|
}
|
|
13385
13266
|
/**
|
|
13386
13267
|
* Asynchronously returns a Platform object that represents an existing platform.
|
|
13387
|
-
* @param identity
|
|
13388
13268
|
*
|
|
13389
13269
|
* @example
|
|
13390
13270
|
* ```js
|
|
@@ -13393,7 +13273,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13393
13273
|
* // Use wrapped instance to control layout, e.g.:
|
|
13394
13274
|
* const snapshot = await platform.getSnapshot();
|
|
13395
13275
|
* ```
|
|
13396
|
-
* @static
|
|
13397
13276
|
*/
|
|
13398
13277
|
async wrap(identity) {
|
|
13399
13278
|
this.wire.sendAction('platform-wrap').catch((e) => {
|
|
@@ -13403,7 +13282,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13403
13282
|
}
|
|
13404
13283
|
/**
|
|
13405
13284
|
* Synchronously returns a Platform object that represents an existing platform.
|
|
13406
|
-
* @param identity
|
|
13407
13285
|
*
|
|
13408
13286
|
* @example
|
|
13409
13287
|
* ```js
|
|
@@ -13412,7 +13290,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13412
13290
|
* // Use wrapped instance to control layout, e.g.:
|
|
13413
13291
|
* const snapshot = await platform.getSnapshot();
|
|
13414
13292
|
* ```
|
|
13415
|
-
* @static
|
|
13416
13293
|
*/
|
|
13417
13294
|
wrapSync(identity) {
|
|
13418
13295
|
this.wire.sendAction('platform-wrap-sync').catch((e) => {
|
|
@@ -13429,7 +13306,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13429
13306
|
* // Use wrapped instance to control layout, e.g.:
|
|
13430
13307
|
* const snapshot = await platform.getSnapshot();
|
|
13431
13308
|
* ```
|
|
13432
|
-
* @static
|
|
13433
13309
|
*/
|
|
13434
13310
|
async getCurrent() {
|
|
13435
13311
|
this.wire.sendAction('platform-get-current').catch((e) => {
|
|
@@ -13446,7 +13322,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13446
13322
|
* // Use wrapped instance to control layout, e.g.:
|
|
13447
13323
|
* const snapshot = await platform.getSnapshot();
|
|
13448
13324
|
* ```
|
|
13449
|
-
* @static
|
|
13450
13325
|
*/
|
|
13451
13326
|
getCurrentSync() {
|
|
13452
13327
|
this.wire.sendAction('platform-get-current-sync').catch((e) => {
|
|
@@ -13457,7 +13332,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13457
13332
|
/**
|
|
13458
13333
|
* Creates and starts a Platform and returns a wrapped and running Platform instance. The wrapped Platform methods can
|
|
13459
13334
|
* be used to launch content into the platform. Promise will reject if the platform is already running.
|
|
13460
|
-
* @param platformOptions
|
|
13461
13335
|
*
|
|
13462
13336
|
* @example
|
|
13463
13337
|
* ```js
|
|
@@ -13478,7 +13352,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13478
13352
|
* console.error(e);
|
|
13479
13353
|
* }
|
|
13480
13354
|
* ```
|
|
13481
|
-
* @static
|
|
13482
13355
|
*/
|
|
13483
13356
|
start(platformOptions) {
|
|
13484
13357
|
this.wire.sendAction('platform-start').catch((e) => {
|
|
@@ -13523,7 +13396,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13523
13396
|
* console.error(e);
|
|
13524
13397
|
* }
|
|
13525
13398
|
* ```
|
|
13526
|
-
* @static
|
|
13527
13399
|
*/
|
|
13528
13400
|
startFromManifest(manifestUrl, opts) {
|
|
13529
13401
|
this.wire.sendAction('platform-start-from-manifest').catch((e) => {
|
|
@@ -13565,18 +13437,18 @@ Factory$3.PlatformModule = PlatformModule;
|
|
|
13565
13437
|
};
|
|
13566
13438
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13567
13439
|
/**
|
|
13568
|
-
* Entry points for the OpenFin `Platform` API.
|
|
13569
|
-
*
|
|
13570
|
-
* In the previous version of the API documentation, both static methods involving `Platform` and instance properties of the
|
|
13571
|
-
* `Platform` type itself were documented on the same page. These are separate code entities, and are now documented separately:
|
|
13440
|
+
* Entry points for the OpenFin `Platform` API (`fin.Platform`)
|
|
13572
13441
|
*
|
|
13573
|
-
* * {@link PlatformModule} contains static
|
|
13442
|
+
* * {@link PlatformModule} contains static members of the `Platform` API, accessible through `fin.Platform`.
|
|
13574
13443
|
* * {@link Platform} describes an instance of an OpenFin Platform, e.g. as returned by `fin.Platform.getCurrent`.
|
|
13575
13444
|
*
|
|
13445
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
13446
|
+
* both of these were documented on the same page.
|
|
13447
|
+
*
|
|
13576
13448
|
* @packageDocumentation
|
|
13577
13449
|
*/
|
|
13578
13450
|
__exportStar(Factory$3, exports);
|
|
13579
|
-
__exportStar(Instance$2, exports);
|
|
13451
|
+
__exportStar(Instance$2, exports);
|
|
13580
13452
|
} (platform));
|
|
13581
13453
|
|
|
13582
13454
|
var me = {};
|
|
@@ -13714,7 +13586,7 @@ var me = {};
|
|
|
13714
13586
|
};
|
|
13715
13587
|
}
|
|
13716
13588
|
}
|
|
13717
|
-
exports.getMe = getMe;
|
|
13589
|
+
exports.getMe = getMe;
|
|
13718
13590
|
} (me));
|
|
13719
13591
|
|
|
13720
13592
|
var interop = {};
|
|
@@ -13817,9 +13689,8 @@ function requireSessionContextGroupBroker () {
|
|
|
13817
13689
|
this.lastContext = context;
|
|
13818
13690
|
const clientSubscriptionStates = Array.from(this.clients.values());
|
|
13819
13691
|
clientSubscriptionStates.forEach((client) => {
|
|
13820
|
-
var _a;
|
|
13821
13692
|
// eslint-disable-next-line no-unused-expressions
|
|
13822
|
-
|
|
13693
|
+
client.contextHandlers.get(context.type)?.forEach((handlerId) => {
|
|
13823
13694
|
this.provider.dispatch(client.clientIdentity, handlerId, context);
|
|
13824
13695
|
});
|
|
13825
13696
|
if (client.globalHandler) {
|
|
@@ -13953,7 +13824,7 @@ var utils$1 = {};
|
|
|
13953
13824
|
}
|
|
13954
13825
|
};
|
|
13955
13826
|
};
|
|
13956
|
-
exports.wrapIntentHandler = wrapIntentHandler;
|
|
13827
|
+
exports.wrapIntentHandler = wrapIntentHandler;
|
|
13957
13828
|
} (utils$1));
|
|
13958
13829
|
|
|
13959
13830
|
var PrivateChannelProvider = {};
|
|
@@ -14426,10 +14297,10 @@ function requireInteropBroker () {
|
|
|
14426
14297
|
this.getProvider = getProvider;
|
|
14427
14298
|
this.interopClients = new Map();
|
|
14428
14299
|
this.contextGroupsById = new Map();
|
|
14429
|
-
if (options
|
|
14300
|
+
if (options?.contextGroups) {
|
|
14430
14301
|
contextGroups = options.contextGroups;
|
|
14431
14302
|
}
|
|
14432
|
-
if (options
|
|
14303
|
+
if (options?.logging) {
|
|
14433
14304
|
this.logging = options.logging;
|
|
14434
14305
|
}
|
|
14435
14306
|
this.intentClientMap = new Map();
|
|
@@ -14564,18 +14435,17 @@ function requireInteropBroker () {
|
|
|
14564
14435
|
*
|
|
14565
14436
|
*/
|
|
14566
14437
|
getCurrentContext(getCurrentContextOptions, clientIdentity) {
|
|
14567
|
-
var _a;
|
|
14568
14438
|
this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
|
|
14569
14439
|
// don't expose, analytics-only call
|
|
14570
14440
|
});
|
|
14571
14441
|
const clientState = this.getClientState(clientIdentity);
|
|
14572
|
-
if (!
|
|
14442
|
+
if (!clientState?.contextGroupId) {
|
|
14573
14443
|
throw new Error('You must be a member of a context group to call getCurrentContext');
|
|
14574
14444
|
}
|
|
14575
14445
|
const { contextGroupId } = clientState;
|
|
14576
14446
|
const contextGroupState = this.contextGroupsById.get(contextGroupId);
|
|
14577
14447
|
const lastContextType = this.lastContextMap.get(contextGroupId);
|
|
14578
|
-
const contextType =
|
|
14448
|
+
const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
|
|
14579
14449
|
return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
|
|
14580
14450
|
}
|
|
14581
14451
|
/*
|
|
@@ -14823,7 +14693,8 @@ function requireInteropBroker () {
|
|
|
14823
14693
|
* ```
|
|
14824
14694
|
*/
|
|
14825
14695
|
// eslint-disable-next-line class-methods-use-this
|
|
14826
|
-
async handleFiredIntent(intent, clientIdentity)
|
|
14696
|
+
async handleFiredIntent(intent, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14697
|
+
) {
|
|
14827
14698
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
|
|
14828
14699
|
console.warn(warning);
|
|
14829
14700
|
throw new Error(utils_1.BROKER_ERRORS.fireIntent);
|
|
@@ -14890,7 +14761,7 @@ function requireInteropBroker () {
|
|
|
14890
14761
|
* More information on the AppIntent type can be found in the [FDC3 documentation](https://fdc3.finos.org/docs/api/ref/AppIntent).
|
|
14891
14762
|
*
|
|
14892
14763
|
* @param options
|
|
14893
|
-
* @param
|
|
14764
|
+
* @param clientIdentity Identity of the Client making the request.
|
|
14894
14765
|
*
|
|
14895
14766
|
* @example
|
|
14896
14767
|
* ```js
|
|
@@ -14907,7 +14778,8 @@ function requireInteropBroker () {
|
|
|
14907
14778
|
* ```
|
|
14908
14779
|
*/
|
|
14909
14780
|
// eslint-disable-next-line class-methods-use-this
|
|
14910
|
-
async handleInfoForIntent(options, clientIdentity)
|
|
14781
|
+
async handleInfoForIntent(options, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14782
|
+
) {
|
|
14911
14783
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
|
|
14912
14784
|
console.warn(warning);
|
|
14913
14785
|
throw new Error(utils_1.BROKER_ERRORS.getInfoForIntent);
|
|
@@ -14953,7 +14825,8 @@ function requireInteropBroker () {
|
|
|
14953
14825
|
* ```
|
|
14954
14826
|
*/
|
|
14955
14827
|
// eslint-disable-next-line class-methods-use-this
|
|
14956
|
-
async handleInfoForIntentsByContext(context, clientIdentity)
|
|
14828
|
+
async handleInfoForIntentsByContext(context, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14829
|
+
) {
|
|
14957
14830
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
|
|
14958
14831
|
console.warn(warning);
|
|
14959
14832
|
throw new Error(utils_1.BROKER_ERRORS.getInfoForIntentsByContext);
|
|
@@ -14979,7 +14852,7 @@ function requireInteropBroker () {
|
|
|
14979
14852
|
* More information on the IntentResolution type can be found in the [FDC3 documentation](https://fdc3.finos.org/docs/api/ref/IntentResolution).
|
|
14980
14853
|
*
|
|
14981
14854
|
* @param contextForIntent Data passed between entities and applications.
|
|
14982
|
-
* @param
|
|
14855
|
+
* @param clientIdentity Identity of the Client making the request.
|
|
14983
14856
|
*
|
|
14984
14857
|
* @example
|
|
14985
14858
|
* ```js
|
|
@@ -15040,7 +14913,7 @@ function requireInteropBroker () {
|
|
|
15040
14913
|
/**
|
|
15041
14914
|
* Responsible for resolving the fdc3.findInstances call.
|
|
15042
14915
|
* Must be overridden
|
|
15043
|
-
* @param
|
|
14916
|
+
* @param app AppIdentifier that was passed to fdc3.findInstances
|
|
15044
14917
|
* @param clientIdentity Identity of the Client making the request.
|
|
15045
14918
|
*/
|
|
15046
14919
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -15075,7 +14948,7 @@ function requireInteropBroker () {
|
|
|
15075
14948
|
* fin.Platform.init({
|
|
15076
14949
|
* interopOverride: async (InteropBroker) => {
|
|
15077
14950
|
* class Override extends InteropBroker {
|
|
15078
|
-
* async invokeContextHandler(
|
|
14951
|
+
* async invokeContextHandler(clientIdentity, handlerId, context) {
|
|
15079
14952
|
* return super.invokeContextHandler(clientIdentity, handlerId, {
|
|
15080
14953
|
* ...context,
|
|
15081
14954
|
* contextMetadata: {
|
|
@@ -15115,7 +14988,7 @@ function requireInteropBroker () {
|
|
|
15115
14988
|
* fin.Platform.init({
|
|
15116
14989
|
* interopOverride: async (InteropBroker) => {
|
|
15117
14990
|
* class Override extends InteropBroker {
|
|
15118
|
-
* async invokeIntentHandler(
|
|
14991
|
+
* async invokeIntentHandler(clientIdentity, handlerId, context) {
|
|
15119
14992
|
* const { context } = intent;
|
|
15120
14993
|
* return super.invokeIntentHandler(clientIdentity, handlerId, {
|
|
15121
14994
|
* ...intent,
|
|
@@ -15223,10 +15096,9 @@ function requireInteropBroker () {
|
|
|
15223
15096
|
}
|
|
15224
15097
|
// Used to restore interop broker state in snapshots.
|
|
15225
15098
|
applySnapshot(snapshot, options) {
|
|
15226
|
-
|
|
15227
|
-
const contextGroupStates = (_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.interopSnapshotDetails) === null || _a === void 0 ? void 0 : _a.contextGroupStates;
|
|
15099
|
+
const contextGroupStates = snapshot?.interopSnapshotDetails?.contextGroupStates;
|
|
15228
15100
|
if (contextGroupStates) {
|
|
15229
|
-
if (!
|
|
15101
|
+
if (!options?.closeExistingWindows) {
|
|
15230
15102
|
this.updateExistingClients(contextGroupStates);
|
|
15231
15103
|
}
|
|
15232
15104
|
this.rehydrateContextGroupStates(contextGroupStates);
|
|
@@ -15277,7 +15149,7 @@ function requireInteropBroker () {
|
|
|
15277
15149
|
contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
|
|
15278
15150
|
const handlerInfo = { contextType, handlerId };
|
|
15279
15151
|
const clientState = this.getClientState(clientIdentity);
|
|
15280
|
-
clientState
|
|
15152
|
+
clientState?.contextHandlers.set(handlerId, handlerInfo);
|
|
15281
15153
|
if (clientState && clientState.contextGroupId) {
|
|
15282
15154
|
const { contextGroupId } = clientState;
|
|
15283
15155
|
const contextGroupMap = this.contextGroupsById.get(contextGroupId);
|
|
@@ -15299,7 +15171,7 @@ function requireInteropBroker () {
|
|
|
15299
15171
|
async intentHandlerRegistered(payload, clientIdentity) {
|
|
15300
15172
|
const { handlerId } = payload;
|
|
15301
15173
|
const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
|
|
15302
|
-
const handlerInfo = clientIntentInfo
|
|
15174
|
+
const handlerInfo = clientIntentInfo?.get(handlerId);
|
|
15303
15175
|
if (!clientIntentInfo) {
|
|
15304
15176
|
this.intentClientMap.set(clientIdentity.name, new Map());
|
|
15305
15177
|
const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
|
|
@@ -15454,7 +15326,8 @@ function requireInteropBroker () {
|
|
|
15454
15326
|
}
|
|
15455
15327
|
// Setup Channel Connection Logic
|
|
15456
15328
|
wireChannel(channel) {
|
|
15457
|
-
channel.onConnection(async (clientIdentity,
|
|
15329
|
+
channel.onConnection(async (clientIdentity, // TODO(CORE-811): remove inline intersected type
|
|
15330
|
+
payload) => {
|
|
15458
15331
|
if (!(await this.isConnectionAuthorized(clientIdentity, payload))) {
|
|
15459
15332
|
throw new Error(`Connection not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
|
|
15460
15333
|
}
|
|
@@ -15467,8 +15340,8 @@ function requireInteropBroker () {
|
|
|
15467
15340
|
clientIdentity
|
|
15468
15341
|
};
|
|
15469
15342
|
// Only allow the client to join a contextGroup that actually exists.
|
|
15470
|
-
if (
|
|
15471
|
-
clientSubscriptionState.contextGroupId = payload
|
|
15343
|
+
if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
|
|
15344
|
+
clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
|
|
15472
15345
|
}
|
|
15473
15346
|
this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
|
|
15474
15347
|
});
|
|
@@ -15486,17 +15359,15 @@ function requireInteropBroker () {
|
|
|
15486
15359
|
this.clientDisconnected(clientIdentity);
|
|
15487
15360
|
});
|
|
15488
15361
|
channel.beforeAction(async (action, payload, clientIdentity) => {
|
|
15489
|
-
var _a, _b;
|
|
15490
15362
|
if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
|
|
15491
15363
|
throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
|
|
15492
15364
|
}
|
|
15493
|
-
if (
|
|
15365
|
+
if (this.logging?.beforeAction?.enabled) {
|
|
15494
15366
|
console.log(action, payload, clientIdentity);
|
|
15495
15367
|
}
|
|
15496
15368
|
});
|
|
15497
15369
|
channel.afterAction((action, payload, clientIdentity) => {
|
|
15498
|
-
|
|
15499
|
-
if ((_b = (_a = this.logging) === null || _a === void 0 ? void 0 : _a.afterAction) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
15370
|
+
if (this.logging?.afterAction?.enabled) {
|
|
15500
15371
|
console.log(action, payload, clientIdentity);
|
|
15501
15372
|
}
|
|
15502
15373
|
});
|
|
@@ -16345,9 +16216,8 @@ function requireOverrideCheck () {
|
|
|
16345
16216
|
overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
|
|
16346
16217
|
const InteropBroker_1 = requireInteropBroker();
|
|
16347
16218
|
function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
|
|
16219
|
+
const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
|
|
16220
|
+
return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
|
|
16351
16221
|
}
|
|
16352
16222
|
overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
|
|
16353
16223
|
// TODO: Unit test this
|
|
@@ -16418,16 +16288,14 @@ function requireFactory () {
|
|
|
16418
16288
|
* const contextGroups = await interopBroker.getContextGroups();
|
|
16419
16289
|
* console.log(contextGroups);
|
|
16420
16290
|
* ```
|
|
16421
|
-
* @static
|
|
16422
16291
|
*/
|
|
16423
16292
|
async init(name, override = defaultOverride) {
|
|
16424
|
-
var _a;
|
|
16425
16293
|
this.wire.sendAction('interop-init').catch(() => {
|
|
16426
16294
|
// don't expose, analytics-only call
|
|
16427
16295
|
});
|
|
16428
16296
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
16429
16297
|
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
16430
|
-
const opts =
|
|
16298
|
+
const opts = options.initialOptions.interopBrokerConfiguration ?? {};
|
|
16431
16299
|
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
16432
16300
|
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
|
|
16433
16301
|
let provider;
|
|
@@ -16476,7 +16344,6 @@ function requireFactory () {
|
|
|
16476
16344
|
* const contextGroupInfo = await client.getInfoForContextGroup();
|
|
16477
16345
|
* console.log(contextGroupInfo);
|
|
16478
16346
|
* ```
|
|
16479
|
-
* @static
|
|
16480
16347
|
*/
|
|
16481
16348
|
connectSync(name, interopConfig) {
|
|
16482
16349
|
this.wire.sendAction('interop-connect-sync').catch(() => {
|
|
@@ -16496,9 +16363,9 @@ function requireInterop () {
|
|
|
16496
16363
|
hasRequiredInterop = 1;
|
|
16497
16364
|
(function (exports) {
|
|
16498
16365
|
/**
|
|
16499
|
-
* Entry point for the OpenFin Interop
|
|
16366
|
+
* Entry point for the OpenFin `Interop` API (`fin.Interop`).
|
|
16500
16367
|
*
|
|
16501
|
-
* * {@link InteropModule} contains static members of the `Interop`
|
|
16368
|
+
* * {@link InteropModule} contains static members of the `Interop` API (available under `fin.Interop`)
|
|
16502
16369
|
* * {@link InteropClient} and {@link InteropBroker} document instances of their respective classes.
|
|
16503
16370
|
*
|
|
16504
16371
|
* @packageDocumentation
|
|
@@ -16520,8 +16387,8 @@ function requireInterop () {
|
|
|
16520
16387
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16521
16388
|
__exportStar(requireFactory(), exports);
|
|
16522
16389
|
__exportStar(InteropClient$1, exports);
|
|
16523
|
-
__exportStar(requireInteropBroker(), exports);
|
|
16524
|
-
} (interop));
|
|
16390
|
+
__exportStar(requireInteropBroker(), exports);
|
|
16391
|
+
} (interop));
|
|
16525
16392
|
return interop;
|
|
16526
16393
|
}
|
|
16527
16394
|
|
|
@@ -16560,6 +16427,8 @@ const connectionMap = new Map();
|
|
|
16560
16427
|
/**
|
|
16561
16428
|
* Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
|
|
16562
16429
|
*
|
|
16430
|
+
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
|
16431
|
+
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
|
16563
16432
|
*/
|
|
16564
16433
|
class SnapshotSource extends base_1$1.Base {
|
|
16565
16434
|
/**
|
|
@@ -16698,10 +16567,15 @@ Factory.SnapshotSourceModule = void 0;
|
|
|
16698
16567
|
const base_1 = base;
|
|
16699
16568
|
const Instance_1 = Instance;
|
|
16700
16569
|
const utils_1 = utils;
|
|
16570
|
+
/**
|
|
16571
|
+
* Static namespace for OpenFin API methods that interact with the {@link SnapshotSource} class, available under `fin.SnapshotSource`.
|
|
16572
|
+
*/
|
|
16701
16573
|
class SnapshotSourceModule extends base_1.Base {
|
|
16702
16574
|
/**
|
|
16703
16575
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
|
16704
|
-
*
|
|
16576
|
+
*
|
|
16577
|
+
* @typeParam Snapshot Implementation-defined shape of an application snapshot. Allows
|
|
16578
|
+
* custom snapshot implementations for legacy applications to define their own snapshot format.
|
|
16705
16579
|
*
|
|
16706
16580
|
* @example
|
|
16707
16581
|
* ```js
|
|
@@ -16718,7 +16592,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16718
16592
|
*
|
|
16719
16593
|
* await fin.SnapshotSource.init(snapshotProvider);
|
|
16720
16594
|
* ```
|
|
16721
|
-
*
|
|
16595
|
+
*
|
|
16722
16596
|
*/
|
|
16723
16597
|
async init(provider) {
|
|
16724
16598
|
this.wire.sendAction('snapshot-source-init').catch((e) => {
|
|
@@ -16738,7 +16612,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16738
16612
|
}
|
|
16739
16613
|
/**
|
|
16740
16614
|
* Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
|
|
16741
|
-
* @param identity
|
|
16742
16615
|
*
|
|
16743
16616
|
* @example
|
|
16744
16617
|
* ```js
|
|
@@ -16746,7 +16619,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16746
16619
|
* // Use wrapped instance's getSnapshot method, e.g.:
|
|
16747
16620
|
* const snapshot = await snapshotSource.getSnapshot();
|
|
16748
16621
|
* ```
|
|
16749
|
-
* @static
|
|
16750
16622
|
*/
|
|
16751
16623
|
wrapSync(identity) {
|
|
16752
16624
|
this.wire.sendAction('snapshot-source-wrap-sync').catch((e) => {
|
|
@@ -16756,7 +16628,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16756
16628
|
}
|
|
16757
16629
|
/**
|
|
16758
16630
|
* Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
|
|
16759
|
-
* @param identity
|
|
16760
16631
|
*
|
|
16761
16632
|
* @example
|
|
16762
16633
|
* ```js
|
|
@@ -16764,7 +16635,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16764
16635
|
* // Use wrapped instance's getSnapshot method, e.g.:
|
|
16765
16636
|
* const snapshot = await snapshotSource.getSnapshot();
|
|
16766
16637
|
* ```
|
|
16767
|
-
* @static
|
|
16768
16638
|
*/
|
|
16769
16639
|
async wrap(identity) {
|
|
16770
16640
|
this.wire.sendAction('snapshot-source-wrap').catch((e) => {
|
|
@@ -16777,13 +16647,13 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
|
16777
16647
|
|
|
16778
16648
|
(function (exports) {
|
|
16779
16649
|
/**
|
|
16780
|
-
* Entry points for the OpenFin `SnapshotSource` API.
|
|
16650
|
+
* Entry points for the OpenFin `SnapshotSource` API (`fin.SnapshotSource`).
|
|
16781
16651
|
*
|
|
16782
|
-
*
|
|
16783
|
-
*
|
|
16652
|
+
* * {@link SnapshotSourceModule} contains static members of the `SnapshotSource` API, accessible through `fin.SnapshotSource`.
|
|
16653
|
+
* * {@link SnapshotSource} describes an instance of an OpenFin SnapshotSource, e.g. as returned by `fin.SnapshotSource.wrap`.
|
|
16784
16654
|
*
|
|
16785
|
-
*
|
|
16786
|
-
*
|
|
16655
|
+
* These are separate code entities, and are documented separately. In the [previous version of the API documentation](https://cdn.openfin.co/docs/javascript/canary/index.html),
|
|
16656
|
+
* both of these were documented on the same page.
|
|
16787
16657
|
*
|
|
16788
16658
|
* @packageDocumentation
|
|
16789
16659
|
*/
|
|
@@ -16803,12 +16673,12 @@ Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
|
16803
16673
|
};
|
|
16804
16674
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16805
16675
|
__exportStar(Factory, exports);
|
|
16806
|
-
__exportStar(Instance, exports);
|
|
16676
|
+
__exportStar(Instance, exports);
|
|
16807
16677
|
} (snapshotSource));
|
|
16808
16678
|
|
|
16809
16679
|
Object.defineProperty(fin, "__esModule", { value: true });
|
|
16810
16680
|
fin.Fin = void 0;
|
|
16811
|
-
const events_1$3 =
|
|
16681
|
+
const events_1$3 = require$$0;
|
|
16812
16682
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
16813
16683
|
const index_1 = system;
|
|
16814
16684
|
const index_2 = requireWindow();
|
|
@@ -16823,6 +16693,9 @@ const index_10 = platform;
|
|
|
16823
16693
|
const me_1$2 = me;
|
|
16824
16694
|
const interop_1 = requireInterop();
|
|
16825
16695
|
const snapshot_source_1 = snapshotSource;
|
|
16696
|
+
/**
|
|
16697
|
+
* @internal
|
|
16698
|
+
*/
|
|
16826
16699
|
class Fin extends events_1$3.EventEmitter {
|
|
16827
16700
|
/**
|
|
16828
16701
|
* @internal
|
|
@@ -16898,7 +16771,7 @@ var emitterMap = {};
|
|
|
16898
16771
|
|
|
16899
16772
|
Object.defineProperty(emitterMap, "__esModule", { value: true });
|
|
16900
16773
|
emitterMap.EmitterMap = void 0;
|
|
16901
|
-
const events_1$2 =
|
|
16774
|
+
const events_1$2 = require$$0;
|
|
16902
16775
|
class EmitterMap {
|
|
16903
16776
|
constructor() {
|
|
16904
16777
|
this.storage = new Map();
|
|
@@ -16980,7 +16853,7 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
|
|
|
16980
16853
|
var _Transport_wire, _Transport_fin;
|
|
16981
16854
|
Object.defineProperty(transport, "__esModule", { value: true });
|
|
16982
16855
|
transport.Transport = void 0;
|
|
16983
|
-
const events_1$1 =
|
|
16856
|
+
const events_1$1 = require$$0;
|
|
16984
16857
|
const wire_1 = wire;
|
|
16985
16858
|
const transport_errors_1 = transportErrors;
|
|
16986
16859
|
const eventAggregator_1 = eventAggregator;
|
|
@@ -17252,7 +17125,7 @@ var mockWire = {};
|
|
|
17252
17125
|
|
|
17253
17126
|
Object.defineProperty(mockWire, "__esModule", { value: true });
|
|
17254
17127
|
mockWire.MockWire = void 0;
|
|
17255
|
-
const events_1 =
|
|
17128
|
+
const events_1 = require$$0;
|
|
17256
17129
|
class MockWire extends events_1.EventEmitter {
|
|
17257
17130
|
connect(address) {
|
|
17258
17131
|
throw new Error('You are not running in OpenFin.');
|
|
@@ -17283,7 +17156,7 @@ const fin_1 = fin;
|
|
|
17283
17156
|
const transport_1 = transport;
|
|
17284
17157
|
const mockEnvironment_1 = mockEnvironment;
|
|
17285
17158
|
const mockWire_1 = mockWire;
|
|
17286
|
-
exports.fin = mock.fin = ((typeof window !== 'undefined' &&
|
|
17159
|
+
exports.fin = mock.fin = ((typeof window !== 'undefined' && window?.fin) ||
|
|
17287
17160
|
(() => {
|
|
17288
17161
|
const environment = new mockEnvironment_1.MockEnvironment();
|
|
17289
17162
|
const transport = new transport_1.Transport(mockWire_1.MockWire, environment, {
|