@openfin/core 34.78.2 → 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 +870 -978
- 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
|
-
}
|
|
253
|
-
|
|
254
|
-
EventEmitter.prototype.once = function once(type, listener) {
|
|
255
|
-
checkListener(listener);
|
|
256
|
-
this.on(type, _onceWrap(this, type, listener));
|
|
257
|
-
return this;
|
|
258
|
-
};
|
|
16
|
+
var application$1 = {};
|
|
259
17
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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,15 +649,34 @@ 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 () {
|
|
889
669
|
if (hasRequiredFactory$3) return Factory$6;
|
|
890
670
|
hasRequiredFactory$3 = 1;
|
|
891
671
|
Object.defineProperty(Factory$6, "__esModule", { value: true });
|
|
672
|
+
Factory$6.ViewModule = void 0;
|
|
892
673
|
const base_1 = base;
|
|
893
674
|
const validate_1 = validate;
|
|
894
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
|
+
*/
|
|
895
680
|
class ViewModule extends base_1.Base {
|
|
896
681
|
/**
|
|
897
682
|
* Creates a new View.
|
|
@@ -920,13 +705,13 @@ function requireFactory$3 () {
|
|
|
920
705
|
* ```
|
|
921
706
|
* Note that created views needs to navigate somewhere for them to actually render a website.
|
|
922
707
|
* @experimental
|
|
923
|
-
* @static
|
|
924
708
|
*/
|
|
925
709
|
async create(options) {
|
|
926
710
|
const { uuid } = this.wire.me;
|
|
927
711
|
if (!options.name || typeof options.name !== 'string') {
|
|
928
712
|
throw new Error('Please provide a name property as a string in order to create a View.');
|
|
929
713
|
}
|
|
714
|
+
(0, warnings_1.handleDeprecatedWarnings)(options);
|
|
930
715
|
if (this.wire.environment.childViews) {
|
|
931
716
|
await this.wire.environment.createChildContent({
|
|
932
717
|
entityType: 'view',
|
|
@@ -940,7 +725,6 @@ function requireFactory$3 () {
|
|
|
940
725
|
}
|
|
941
726
|
/**
|
|
942
727
|
* Asynchronously returns a View object that represents an existing view.
|
|
943
|
-
* @param identity
|
|
944
728
|
*
|
|
945
729
|
* @example
|
|
946
730
|
* ```js
|
|
@@ -949,7 +733,6 @@ function requireFactory$3 () {
|
|
|
949
733
|
* .catch(err => console.log(err));
|
|
950
734
|
* ```
|
|
951
735
|
* @experimental
|
|
952
|
-
* @static
|
|
953
736
|
*/
|
|
954
737
|
async wrap(identity) {
|
|
955
738
|
this.wire.sendAction('view-wrap');
|
|
@@ -961,7 +744,6 @@ function requireFactory$3 () {
|
|
|
961
744
|
}
|
|
962
745
|
/**
|
|
963
746
|
* Synchronously returns a View object that represents an existing view.
|
|
964
|
-
* @param identity
|
|
965
747
|
*
|
|
966
748
|
* @example
|
|
967
749
|
* ```js
|
|
@@ -969,7 +751,6 @@ function requireFactory$3 () {
|
|
|
969
751
|
* await view.hide();
|
|
970
752
|
* ```
|
|
971
753
|
* @experimental
|
|
972
|
-
* @static
|
|
973
754
|
*/
|
|
974
755
|
wrapSync(identity) {
|
|
975
756
|
this.wire.sendAction('view-wrap-sync').catch((e) => {
|
|
@@ -992,7 +773,6 @@ function requireFactory$3 () {
|
|
|
992
773
|
*
|
|
993
774
|
* ```
|
|
994
775
|
* @experimental
|
|
995
|
-
* @static
|
|
996
776
|
*/
|
|
997
777
|
getCurrent() {
|
|
998
778
|
this.wire.sendAction('view-get-current').catch((e) => {
|
|
@@ -1014,7 +794,6 @@ function requireFactory$3 () {
|
|
|
1014
794
|
*
|
|
1015
795
|
* ```
|
|
1016
796
|
* @experimental
|
|
1017
|
-
* @static
|
|
1018
797
|
*/
|
|
1019
798
|
getCurrentSync() {
|
|
1020
799
|
this.wire.sendAction('view-get-current-sync').catch((e) => {
|
|
@@ -1027,7 +806,7 @@ function requireFactory$3 () {
|
|
|
1027
806
|
return this.wrapSync({ uuid, name });
|
|
1028
807
|
}
|
|
1029
808
|
}
|
|
1030
|
-
Factory$6.
|
|
809
|
+
Factory$6.ViewModule = ViewModule;
|
|
1031
810
|
return Factory$6;
|
|
1032
811
|
}
|
|
1033
812
|
|
|
@@ -1220,7 +999,7 @@ class ChannelsExposer {
|
|
|
1220
999
|
this.exposeFunction = async (target, config) => {
|
|
1221
1000
|
const { key, options, meta } = config;
|
|
1222
1001
|
const { id } = meta;
|
|
1223
|
-
const action = `${id}.${
|
|
1002
|
+
const action = `${id}.${options?.action || key}`;
|
|
1224
1003
|
await this.channelProviderOrClient.register(action, async ({ args }) => {
|
|
1225
1004
|
return target(...args);
|
|
1226
1005
|
});
|
|
@@ -1251,7 +1030,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1251
1030
|
};
|
|
1252
1031
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1253
1032
|
__exportStar(channelsConsumer, exports);
|
|
1254
|
-
__exportStar(channelsExposer, exports);
|
|
1033
|
+
__exportStar(channelsExposer, exports);
|
|
1255
1034
|
} (openfinChannels));
|
|
1256
1035
|
|
|
1257
1036
|
(function (exports) {
|
|
@@ -1270,7 +1049,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1270
1049
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1271
1050
|
};
|
|
1272
1051
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1273
|
-
__exportStar(openfinChannels, exports);
|
|
1052
|
+
__exportStar(openfinChannels, exports);
|
|
1274
1053
|
} (strategies));
|
|
1275
1054
|
|
|
1276
1055
|
(function (exports) {
|
|
@@ -1292,7 +1071,7 @@ channelsExposer.ChannelsExposer = ChannelsExposer;
|
|
|
1292
1071
|
__exportStar(apiConsumer, exports);
|
|
1293
1072
|
__exportStar(apiExposer, exports);
|
|
1294
1073
|
__exportStar(strategies, exports);
|
|
1295
|
-
__exportStar(decorators, exports);
|
|
1074
|
+
__exportStar(decorators, exports);
|
|
1296
1075
|
} (apiExposer$1));
|
|
1297
1076
|
|
|
1298
1077
|
var channelApiRelay = {};
|
|
@@ -1533,14 +1312,14 @@ _LayoutNode_client = new WeakMap();
|
|
|
1533
1312
|
/**
|
|
1534
1313
|
* @ignore
|
|
1535
1314
|
* @internal
|
|
1536
|
-
* Encapsulates Api consumption of {@link
|
|
1315
|
+
* Encapsulates Api consumption of {@link LayoutEntitiesClient} with a relayed dispatch
|
|
1537
1316
|
* @param client
|
|
1538
1317
|
* @param controllerId
|
|
1539
1318
|
* @param identity
|
|
1540
1319
|
* @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
|
|
1541
1320
|
*/
|
|
1542
1321
|
LayoutNode.newLayoutEntitiesClient = async (client, controllerId, identity) => {
|
|
1543
|
-
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.');
|
|
1544
1323
|
const consumer = new api_exposer_1.ApiConsumer(new api_exposer_1.ChannelsConsumer({ dispatch }));
|
|
1545
1324
|
return consumer.consume({ id: controllerId });
|
|
1546
1325
|
};
|
|
@@ -1850,8 +1629,9 @@ _ColumnOrRow_client = new WeakMap();
|
|
|
1850
1629
|
var layout_constants = {};
|
|
1851
1630
|
|
|
1852
1631
|
Object.defineProperty(layout_constants, "__esModule", { value: true });
|
|
1853
|
-
layout_constants.LAYOUT_CONTROLLER_ID = void 0;
|
|
1632
|
+
layout_constants.DEFAULT_LAYOUT_KEY = layout_constants.LAYOUT_CONTROLLER_ID = void 0;
|
|
1854
1633
|
layout_constants.LAYOUT_CONTROLLER_ID = 'layout-entities';
|
|
1634
|
+
layout_constants.DEFAULT_LAYOUT_KEY = 'default';
|
|
1855
1635
|
|
|
1856
1636
|
var main = {};
|
|
1857
1637
|
|
|
@@ -1859,6 +1639,10 @@ Object.defineProperty(main, "__esModule", { value: true });
|
|
|
1859
1639
|
main.WebContents = void 0;
|
|
1860
1640
|
const base_1$k = base;
|
|
1861
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
|
+
*/
|
|
1862
1646
|
constructor(wire, identity, entityType) {
|
|
1863
1647
|
super(wire, entityType, identity.uuid, identity.name);
|
|
1864
1648
|
this.identity = identity;
|
|
@@ -1866,10 +1650,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1866
1650
|
}
|
|
1867
1651
|
/**
|
|
1868
1652
|
* Gets a base64 encoded image of all or part of the WebContents.
|
|
1869
|
-
* @function capturePage
|
|
1870
1653
|
* @param options Options for the capturePage call.
|
|
1871
|
-
* @memberOf View
|
|
1872
|
-
* @instance
|
|
1873
1654
|
*
|
|
1874
1655
|
* @example
|
|
1875
1656
|
*
|
|
@@ -1914,6 +1695,11 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1914
1695
|
* }
|
|
1915
1696
|
* console.log(await wnd.capturePage(options));
|
|
1916
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}.
|
|
1917
1703
|
*/
|
|
1918
1704
|
capturePage(options) {
|
|
1919
1705
|
return this.wire.sendAction('capture-page', { options, ...this.identity }).then(({ payload }) => payload.data);
|
|
@@ -1922,9 +1708,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1922
1708
|
* Executes Javascript on the WebContents, restricted to contents you own or contents owned by
|
|
1923
1709
|
* applications you have created.
|
|
1924
1710
|
* @param code JavaScript code to be executed on the view.
|
|
1925
|
-
* @function executeJavaScript
|
|
1926
|
-
* @memberOf View
|
|
1927
|
-
* @instance
|
|
1928
1711
|
*
|
|
1929
1712
|
* @example
|
|
1930
1713
|
* View:
|
|
@@ -1952,6 +1735,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1952
1735
|
*
|
|
1953
1736
|
* executeJavaScript(`console.log('Hello, Openfin')`).then(() => console.log('Javascript excuted')).catch(err => console.log(err));
|
|
1954
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}.
|
|
1955
1742
|
*/
|
|
1956
1743
|
executeJavaScript(code) {
|
|
1957
1744
|
return this.wire
|
|
@@ -1960,9 +1747,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1960
1747
|
}
|
|
1961
1748
|
/**
|
|
1962
1749
|
* Returns the zoom level of the WebContents.
|
|
1963
|
-
* @function getZoomLevel
|
|
1964
|
-
* @memberOf View
|
|
1965
|
-
* @instance
|
|
1966
1750
|
*
|
|
1967
1751
|
* @example
|
|
1968
1752
|
* View:
|
|
@@ -1994,6 +1778,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
1994
1778
|
*
|
|
1995
1779
|
* getZoomLevel().then(zoomLevel => console.log(zoomLevel)).catch(err => console.log(err));
|
|
1996
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}.
|
|
1997
1785
|
*/
|
|
1998
1786
|
getZoomLevel() {
|
|
1999
1787
|
return this.wire.sendAction('get-zoom-level', this.identity).then(({ payload }) => payload.data);
|
|
@@ -2001,9 +1789,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2001
1789
|
/**
|
|
2002
1790
|
* Sets the zoom level of the WebContents.
|
|
2003
1791
|
* @param level The zoom level
|
|
2004
|
-
* @function setZoomLevel
|
|
2005
|
-
* @memberOf View
|
|
2006
|
-
* @instance
|
|
2007
1792
|
*
|
|
2008
1793
|
* @example
|
|
2009
1794
|
* View:
|
|
@@ -2035,6 +1820,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2035
1820
|
*
|
|
2036
1821
|
* setZoomLevel(4).then(() => console.log('Setting a zoom level')).catch(err => console.log(err));
|
|
2037
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}.
|
|
2038
1827
|
*/
|
|
2039
1828
|
setZoomLevel(level) {
|
|
2040
1829
|
return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
|
|
@@ -2042,12 +1831,9 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2042
1831
|
/**
|
|
2043
1832
|
* Navigates the WebContents to a specified URL.
|
|
2044
1833
|
*
|
|
2045
|
-
*
|
|
1834
|
+
* Note: The url must contain the protocol prefix such as http:// or https://.
|
|
2046
1835
|
* @param url - The URL to navigate the WebContents to.
|
|
2047
1836
|
*
|
|
2048
|
-
* @function navigate
|
|
2049
|
-
* @memberof View
|
|
2050
|
-
* @instance
|
|
2051
1837
|
* @example
|
|
2052
1838
|
* View:
|
|
2053
1839
|
* ```js
|
|
@@ -2075,15 +1861,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2075
1861
|
* navigate().then(() => console.log('Navigate to tutorial')).catch(err => console.log(err));
|
|
2076
1862
|
* ```
|
|
2077
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}.
|
|
2078
1868
|
*/
|
|
2079
1869
|
navigate(url) {
|
|
2080
1870
|
return this.wire.sendAction('navigate-window', { ...this.identity, url }).then(() => undefined);
|
|
2081
1871
|
}
|
|
2082
1872
|
/**
|
|
2083
1873
|
* Navigates the WebContents back one page.
|
|
2084
|
-
* @function navigateBack
|
|
2085
|
-
* @memberOf View
|
|
2086
|
-
* @instance
|
|
2087
1874
|
*
|
|
2088
1875
|
* @example
|
|
2089
1876
|
* View:
|
|
@@ -2105,15 +1892,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2105
1892
|
* }
|
|
2106
1893
|
* navigateBack().then(() => console.log('Navigated back')).catch(err => console.log(err));
|
|
2107
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}.
|
|
2108
1899
|
*/
|
|
2109
1900
|
navigateBack() {
|
|
2110
1901
|
return this.wire.sendAction('navigate-window-back', { ...this.identity }).then(() => undefined);
|
|
2111
1902
|
}
|
|
2112
1903
|
/**
|
|
2113
1904
|
* Navigates the WebContents forward one page.
|
|
2114
|
-
* @function navigateForward
|
|
2115
|
-
* @memberOf View
|
|
2116
|
-
* @instance
|
|
2117
1905
|
*
|
|
2118
1906
|
* @example
|
|
2119
1907
|
* View:
|
|
@@ -2137,15 +1925,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2137
1925
|
* }
|
|
2138
1926
|
* navigateForward().then(() => console.log('Navigated forward')).catch(err => console.log(err));
|
|
2139
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}.
|
|
2140
1932
|
*/
|
|
2141
1933
|
async navigateForward() {
|
|
2142
1934
|
await this.wire.sendAction('navigate-window-forward', { ...this.identity });
|
|
2143
1935
|
}
|
|
2144
1936
|
/**
|
|
2145
1937
|
* Stops any current navigation the WebContents is performing.
|
|
2146
|
-
* @function stopNavigation
|
|
2147
|
-
* @memberOf View
|
|
2148
|
-
* @instance
|
|
2149
1938
|
*
|
|
2150
1939
|
* @example
|
|
2151
1940
|
* View:
|
|
@@ -2167,15 +1956,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2167
1956
|
* }
|
|
2168
1957
|
* stopNavigation().then(() => console.log('you shall not navigate')).catch(err => console.log(err));
|
|
2169
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}.
|
|
2170
1963
|
*/
|
|
2171
1964
|
stopNavigation() {
|
|
2172
1965
|
return this.wire.sendAction('stop-window-navigation', { ...this.identity }).then(() => undefined);
|
|
2173
1966
|
}
|
|
2174
1967
|
/**
|
|
2175
1968
|
* Reloads the WebContents
|
|
2176
|
-
* @function reload
|
|
2177
|
-
* @memberOf View
|
|
2178
|
-
* @instance
|
|
2179
1969
|
*
|
|
2180
1970
|
* @example
|
|
2181
1971
|
* View:
|
|
@@ -2207,6 +1997,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2207
1997
|
* console.log('Reloaded window')
|
|
2208
1998
|
* }).catch(err => console.log(err));
|
|
2209
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}.
|
|
2210
2004
|
*/
|
|
2211
2005
|
reload(ignoreCache = false) {
|
|
2212
2006
|
return this.wire
|
|
@@ -2219,11 +2013,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2219
2013
|
/**
|
|
2220
2014
|
* Prints the WebContents.
|
|
2221
2015
|
* @param options Printer Options
|
|
2222
|
-
* @function print
|
|
2223
|
-
* @memberOf View
|
|
2224
|
-
* @instance
|
|
2225
2016
|
*
|
|
2226
|
-
*
|
|
2017
|
+
* Note: When `silent` is set to `true`, the API will pick the system's default printer if deviceName
|
|
2227
2018
|
* is empty and the default settings for printing.
|
|
2228
2019
|
*
|
|
2229
2020
|
* Use the CSS style `page-break-before: always;` to force print to a new page.
|
|
@@ -2236,6 +2027,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2236
2027
|
* console.log('print call has been sent to the system');
|
|
2237
2028
|
* });
|
|
2238
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}.
|
|
2239
2034
|
*/
|
|
2240
2035
|
print(options = {}) {
|
|
2241
2036
|
return this.wire.sendAction('print', { ...this.identity, options }).then(() => undefined);
|
|
@@ -2244,11 +2039,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2244
2039
|
* Find and highlight text on a page.
|
|
2245
2040
|
* @param searchTerm Term to find in page
|
|
2246
2041
|
* @param options Search options
|
|
2247
|
-
* @function findInPage
|
|
2248
|
-
* @memberOf View
|
|
2249
|
-
* @instance
|
|
2250
2042
|
*
|
|
2251
|
-
*
|
|
2043
|
+
* Note: By default, each subsequent call will highlight the next text that matches the search term.
|
|
2252
2044
|
*
|
|
2253
2045
|
* Returns a promise with the results for the request. By subscribing to the
|
|
2254
2046
|
* found-in-page event, you can get the results of this call as well.
|
|
@@ -2283,6 +2075,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2283
2075
|
* console.log(result)
|
|
2284
2076
|
* });
|
|
2285
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}.
|
|
2286
2082
|
*/
|
|
2287
2083
|
findInPage(searchTerm, options) {
|
|
2288
2084
|
return this.wire
|
|
@@ -2326,6 +2122,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2326
2122
|
* console.log(results);
|
|
2327
2123
|
* });
|
|
2328
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}.
|
|
2329
2129
|
*/
|
|
2330
2130
|
stopFindInPage(action) {
|
|
2331
2131
|
return this.wire.sendAction('stop-find-in-page', { ...this.identity, action }).then(() => undefined);
|
|
@@ -2333,9 +2133,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2333
2133
|
/**
|
|
2334
2134
|
* Returns an array with all system printers
|
|
2335
2135
|
* @deprecated use System.getPrinters instead
|
|
2336
|
-
* @function getPrinters
|
|
2337
|
-
* @memberOf View
|
|
2338
|
-
* @instance
|
|
2339
2136
|
*
|
|
2340
2137
|
* @example
|
|
2341
2138
|
* View:
|
|
@@ -2371,6 +2168,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2371
2168
|
* console.log(err);
|
|
2372
2169
|
* });
|
|
2373
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}.
|
|
2374
2175
|
*/
|
|
2375
2176
|
getPrinters() {
|
|
2376
2177
|
return this.wire.sendAction('get-printers', { ...this.identity }).then(({ payload }) => payload.data);
|
|
@@ -2378,10 +2179,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2378
2179
|
/**
|
|
2379
2180
|
* Gives focus to the WebContents.
|
|
2380
2181
|
*
|
|
2381
|
-
* @function focus
|
|
2382
|
-
* @emits focused
|
|
2383
|
-
* @memberOf Window
|
|
2384
|
-
* @instance
|
|
2385
2182
|
* @example
|
|
2386
2183
|
* ```js
|
|
2387
2184
|
* async function focusWindow() {
|
|
@@ -2397,15 +2194,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2397
2194
|
*
|
|
2398
2195
|
* focusWindow().then(() => console.log('Window focused')).catch(err => console.log(err));
|
|
2399
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}.
|
|
2400
2201
|
*/
|
|
2401
2202
|
async focus({ emitSynthFocused } = { emitSynthFocused: true }) {
|
|
2402
2203
|
await this.wire.sendAction('focus-window', { emitSynthFocused, ...this.identity });
|
|
2403
2204
|
}
|
|
2404
2205
|
/**
|
|
2405
2206
|
* Shows the Chromium Developer Tools
|
|
2406
|
-
* @function showDeveloperTools
|
|
2407
|
-
* @memberOf View
|
|
2408
|
-
* @instance
|
|
2409
2207
|
*
|
|
2410
2208
|
* @example
|
|
2411
2209
|
* View:
|
|
@@ -2431,6 +2229,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2431
2229
|
* .then(() => console.log('Showing dev tools'))
|
|
2432
2230
|
* .catch(err => console.error(err));
|
|
2433
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}.
|
|
2434
2236
|
*/
|
|
2435
2237
|
async showDeveloperTools() {
|
|
2436
2238
|
// Note this hits the system action map in core state for legacy reasons.
|
|
@@ -2439,11 +2241,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2439
2241
|
/**
|
|
2440
2242
|
* Retrieves the process information associated with a WebContents.
|
|
2441
2243
|
*
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2444
|
-
* @function getProcessInfo
|
|
2445
|
-
* @memberOf View
|
|
2446
|
-
* @instance
|
|
2244
|
+
* Note: This includes any iframes associated with the WebContents
|
|
2447
2245
|
*
|
|
2448
2246
|
* @example
|
|
2449
2247
|
* View:
|
|
@@ -2457,6 +2255,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2457
2255
|
* const win = await fin.Window.getCurrent();
|
|
2458
2256
|
* const processInfo = await win.getProcessInfo();
|
|
2459
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}.
|
|
2460
2262
|
*/
|
|
2461
2263
|
async getProcessInfo() {
|
|
2462
2264
|
const { payload: { data } } = await this.wire.sendAction('get-process-info', this.identity);
|
|
@@ -2464,9 +2266,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2464
2266
|
}
|
|
2465
2267
|
/**
|
|
2466
2268
|
* Retrieves information on all Shared Workers.
|
|
2467
|
-
* @function getSharedWorkers
|
|
2468
|
-
* @memberOf View
|
|
2469
|
-
* @instance
|
|
2470
2269
|
*
|
|
2471
2270
|
* @example
|
|
2472
2271
|
* View:
|
|
@@ -2495,15 +2294,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2495
2294
|
* const win = await fin.Window.create(winOption);
|
|
2496
2295
|
* const sharedWorkers = await win.getSharedWorkers();
|
|
2497
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}.
|
|
2498
2301
|
*/
|
|
2499
2302
|
async getSharedWorkers() {
|
|
2500
2303
|
return this.wire.sendAction('get-shared-workers', this.identity).then(({ payload }) => payload.data);
|
|
2501
2304
|
}
|
|
2502
2305
|
/**
|
|
2503
2306
|
* Opens the developer tools for the shared worker context.
|
|
2504
|
-
* @function inspectSharedWorker
|
|
2505
|
-
* @memberOf View
|
|
2506
|
-
* @instance
|
|
2507
2307
|
*
|
|
2508
2308
|
* @example
|
|
2509
2309
|
* View:
|
|
@@ -2532,6 +2332,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2532
2332
|
* const win = await fin.Window.create(winOption);
|
|
2533
2333
|
* await win.inspectSharedWorker();
|
|
2534
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}.
|
|
2535
2339
|
*/
|
|
2536
2340
|
async inspectSharedWorker() {
|
|
2537
2341
|
await this.wire.sendAction('inspect-shared-worker', { ...this.identity });
|
|
@@ -2539,9 +2343,6 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2539
2343
|
/**
|
|
2540
2344
|
* Inspects the shared worker based on its ID.
|
|
2541
2345
|
* @param workerId - The id of the shared worker.
|
|
2542
|
-
* @function inspectSharedWorkerById
|
|
2543
|
-
* @memberOf View
|
|
2544
|
-
* @instance
|
|
2545
2346
|
*
|
|
2546
2347
|
* @example
|
|
2547
2348
|
* View:
|
|
@@ -2572,15 +2373,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2572
2373
|
* const sharedWorkers = await win.getSharedWorkers();
|
|
2573
2374
|
* await win.inspectSharedWorkerById(sharedWorkers[0].id);
|
|
2574
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}.
|
|
2575
2380
|
*/
|
|
2576
2381
|
async inspectSharedWorkerById(workerId) {
|
|
2577
2382
|
await this.wire.sendAction('inspect-shared-worker-by-id', { ...this.identity, workerId });
|
|
2578
2383
|
}
|
|
2579
2384
|
/**
|
|
2580
2385
|
* Opens the developer tools for the service worker context.
|
|
2581
|
-
* @function inspectServiceWorker
|
|
2582
|
-
* @memberOf View
|
|
2583
|
-
* @instance
|
|
2584
2386
|
*
|
|
2585
2387
|
* @example
|
|
2586
2388
|
* View:
|
|
@@ -2609,6 +2411,10 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2609
2411
|
* const win = await fin.Window.create(winOption);
|
|
2610
2412
|
* await win.inspectServiceWorker();
|
|
2611
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}.
|
|
2612
2418
|
*/
|
|
2613
2419
|
async inspectServiceWorker() {
|
|
2614
2420
|
await this.wire.sendAction('inspect-service-worker', { ...this.identity });
|
|
@@ -2616,7 +2422,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2616
2422
|
/**
|
|
2617
2423
|
* Shows a popup window.
|
|
2618
2424
|
*
|
|
2619
|
-
*
|
|
2425
|
+
* Note: If this WebContents is a view and its attached window has a popup open, this will close it.
|
|
2620
2426
|
*
|
|
2621
2427
|
* Shows a popup window. Including a `name` in `options` will attempt to show an existing window as a popup, if
|
|
2622
2428
|
* that window doesn't exist or no `name` is included a window will be created. If the caller view or the caller
|
|
@@ -2624,7 +2430,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2624
2430
|
* open popup window before showing the new popup window. Also, if the caller view is destroyed or detached, the popup
|
|
2625
2431
|
* will be dismissed.
|
|
2626
2432
|
*
|
|
2627
|
-
*
|
|
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.
|
|
2628
2434
|
*
|
|
2629
2435
|
* @example
|
|
2630
2436
|
*
|
|
@@ -2819,17 +2625,16 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2819
2625
|
* onPopupReady: popupWindowCallback;
|
|
2820
2626
|
* });
|
|
2821
2627
|
* ```
|
|
2822
|
-
* @
|
|
2823
|
-
* @
|
|
2824
|
-
*
|
|
2825
|
-
* @
|
|
2826
|
-
*
|
|
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}.
|
|
2827
2632
|
*/
|
|
2828
2633
|
async showPopupWindow(options) {
|
|
2829
2634
|
this.wire.sendAction(`${this.entityType}-show-popup-window`, this.identity).catch(() => {
|
|
2830
2635
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
2831
2636
|
});
|
|
2832
|
-
if (options
|
|
2637
|
+
if (options?.onPopupReady) {
|
|
2833
2638
|
const readyListener = async ({ popupName }) => {
|
|
2834
2639
|
try {
|
|
2835
2640
|
const popupWindow = this.fin.Window.wrapSync({ uuid: this.fin.me.uuid, name: popupName });
|
|
@@ -2848,8 +2653,8 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2848
2653
|
...options,
|
|
2849
2654
|
// Internal use only.
|
|
2850
2655
|
// @ts-expect-error
|
|
2851
|
-
hasResultCallback: !!
|
|
2852
|
-
hasReadyCallback: !!
|
|
2656
|
+
hasResultCallback: !!options?.onPopupResult,
|
|
2657
|
+
hasReadyCallback: !!options?.onPopupReady
|
|
2853
2658
|
},
|
|
2854
2659
|
...this.identity
|
|
2855
2660
|
});
|
|
@@ -2874,7 +2679,7 @@ class WebContents extends base_1$k.EmitterBase {
|
|
|
2874
2679
|
}
|
|
2875
2680
|
return popupResult;
|
|
2876
2681
|
};
|
|
2877
|
-
if (options
|
|
2682
|
+
if (options?.onPopupResult) {
|
|
2878
2683
|
const dispatchResultListener = async (payload) => {
|
|
2879
2684
|
await options.onPopupResult(normalizePopupResult(payload));
|
|
2880
2685
|
};
|
|
@@ -3200,6 +3005,49 @@ function requireInstance$2 () {
|
|
|
3200
3005
|
this.show = async () => {
|
|
3201
3006
|
await this.wire.sendAction('show-view', { ...this.identity });
|
|
3202
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
|
+
};
|
|
3203
3051
|
/**
|
|
3204
3052
|
* Hides the current view if it is currently visible.
|
|
3205
3053
|
*
|
|
@@ -3359,8 +3207,11 @@ function requireInstance$2 () {
|
|
|
3359
3207
|
this.wire.sendAction('view-get-parent-layout', { ...this.identity }).catch(() => {
|
|
3360
3208
|
// don't expose
|
|
3361
3209
|
});
|
|
3362
|
-
const
|
|
3363
|
-
|
|
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);
|
|
3364
3215
|
};
|
|
3365
3216
|
/**
|
|
3366
3217
|
* Gets the View's options.
|
|
@@ -3400,7 +3251,6 @@ function requireInstance$2 () {
|
|
|
3400
3251
|
};
|
|
3401
3252
|
/**
|
|
3402
3253
|
* Updates the view's options.
|
|
3403
|
-
* @param options
|
|
3404
3254
|
*
|
|
3405
3255
|
* @example
|
|
3406
3256
|
* ```js
|
|
@@ -3441,7 +3291,6 @@ function requireInstance$2 () {
|
|
|
3441
3291
|
/**
|
|
3442
3292
|
* Retrieves the window the view is currently attached to.
|
|
3443
3293
|
*
|
|
3444
|
-
* @experimental
|
|
3445
3294
|
* @example
|
|
3446
3295
|
* ```js
|
|
3447
3296
|
* const view = fin.View.wrapSync({ uuid: 'viewUuid', name: 'viewName' });
|
|
@@ -3449,6 +3298,7 @@ function requireInstance$2 () {
|
|
|
3449
3298
|
* .then(win => console.log('current window', win))
|
|
3450
3299
|
* .catch(err => console.log(err));)
|
|
3451
3300
|
* ```
|
|
3301
|
+
* @experimental
|
|
3452
3302
|
*/
|
|
3453
3303
|
this.getCurrentWindow = async () => {
|
|
3454
3304
|
const { payload: { data } } = await this.wire.sendAction('get-view-window', { ...this.identity });
|
|
@@ -3554,10 +3404,6 @@ function requireInstance$2 () {
|
|
|
3554
3404
|
/**
|
|
3555
3405
|
* Focuses the view
|
|
3556
3406
|
*
|
|
3557
|
-
* @function focus
|
|
3558
|
-
* @memberof View
|
|
3559
|
-
* @emits focused
|
|
3560
|
-
* @instance
|
|
3561
3407
|
* @example
|
|
3562
3408
|
* ```js
|
|
3563
3409
|
* const view = fin.View.wrapSync({ uuid: 'viewUuid', name: 'viewName' });
|
|
@@ -3599,18 +3445,19 @@ function requireView () {
|
|
|
3599
3445
|
};
|
|
3600
3446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3601
3447
|
/**
|
|
3602
|
-
* Entry
|
|
3448
|
+
* Entry points for the OpenFin `View` API (`fin.View`).
|
|
3449
|
+
*
|
|
3450
|
+
* * {@link ViewModule} contains static members of the `View` API, accessible through `fin.View`.
|
|
3451
|
+
* * {@link View} describes an instance of an OpenFin View, e.g. as returned by `fin.View.getCurrent`.
|
|
3603
3452
|
*
|
|
3604
|
-
*
|
|
3605
|
-
*
|
|
3606
|
-
* instances of the OpenFin `View` class.
|
|
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.
|
|
3607
3455
|
*
|
|
3608
3456
|
* @packageDocumentation
|
|
3609
3457
|
*/
|
|
3610
|
-
|
|
3611
|
-
exports
|
|
3612
|
-
|
|
3613
|
-
} (view));
|
|
3458
|
+
__exportStar(requireFactory$3(), exports);
|
|
3459
|
+
__exportStar(requireInstance$2(), exports);
|
|
3460
|
+
} (view));
|
|
3614
3461
|
return view;
|
|
3615
3462
|
}
|
|
3616
3463
|
|
|
@@ -4097,6 +3944,7 @@ function requireInstance$1 () {
|
|
|
4097
3944
|
/**
|
|
4098
3945
|
* Sets or removes a custom JumpList for the application. Only applicable in Windows OS.
|
|
4099
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
|
+
*
|
|
4100
3948
|
* Note: If the "name" property is omitted it defaults to "tasks".
|
|
4101
3949
|
* @param jumpListCategories An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.
|
|
4102
3950
|
*
|
|
@@ -4397,6 +4245,7 @@ function requireInstance$1 () {
|
|
|
4397
4245
|
}
|
|
4398
4246
|
/**
|
|
4399
4247
|
* Sets file auto download location. It's only allowed in the same application.
|
|
4248
|
+
*
|
|
4400
4249
|
* Note: This method is restricted by default and must be enabled via
|
|
4401
4250
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4402
4251
|
* @param downloadLocation file auto download location
|
|
@@ -4422,6 +4271,7 @@ function requireInstance$1 () {
|
|
|
4422
4271
|
}
|
|
4423
4272
|
/**
|
|
4424
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
|
+
*
|
|
4425
4275
|
* Note: This method is restricted by default and must be enabled via
|
|
4426
4276
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
4427
4277
|
*
|
|
@@ -4448,13 +4298,16 @@ function requireFactory$2 () {
|
|
|
4448
4298
|
if (hasRequiredFactory$2) return Factory$7;
|
|
4449
4299
|
hasRequiredFactory$2 = 1;
|
|
4450
4300
|
Object.defineProperty(Factory$7, "__esModule", { value: true });
|
|
4301
|
+
Factory$7.ApplicationModule = void 0;
|
|
4451
4302
|
const base_1 = base;
|
|
4452
4303
|
const validate_1 = validate;
|
|
4453
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
|
+
*/
|
|
4454
4308
|
class ApplicationModule extends base_1.Base {
|
|
4455
4309
|
/**
|
|
4456
4310
|
* Asynchronously returns an Application object that represents an existing application.
|
|
4457
|
-
* @param identity
|
|
4458
4311
|
*
|
|
4459
4312
|
* @example
|
|
4460
4313
|
*
|
|
@@ -4465,7 +4318,6 @@ function requireFactory$2 () {
|
|
|
4465
4318
|
* .catch(err => console.log(err));
|
|
4466
4319
|
* ```
|
|
4467
4320
|
*
|
|
4468
|
-
* @static
|
|
4469
4321
|
*/
|
|
4470
4322
|
async wrap(identity) {
|
|
4471
4323
|
this.wire.sendAction('wrap-application').catch((e) => {
|
|
@@ -4479,7 +4331,6 @@ function requireFactory$2 () {
|
|
|
4479
4331
|
}
|
|
4480
4332
|
/**
|
|
4481
4333
|
* Synchronously returns an Application object that represents an existing application.
|
|
4482
|
-
* @param identity
|
|
4483
4334
|
*
|
|
4484
4335
|
* @example
|
|
4485
4336
|
*
|
|
@@ -4488,7 +4339,6 @@ function requireFactory$2 () {
|
|
|
4488
4339
|
* await app.close();
|
|
4489
4340
|
* ```
|
|
4490
4341
|
*
|
|
4491
|
-
* @static
|
|
4492
4342
|
*/
|
|
4493
4343
|
wrapSync(identity) {
|
|
4494
4344
|
this.wire.sendAction('wrap-application-sync').catch((e) => {
|
|
@@ -4513,8 +4363,6 @@ function requireFactory$2 () {
|
|
|
4513
4363
|
}
|
|
4514
4364
|
/**
|
|
4515
4365
|
* DEPRECATED method to create a new Application. Use {@link Application.ApplicationModule.start Application.start} instead.
|
|
4516
|
-
* @param appOptions
|
|
4517
|
-
*
|
|
4518
4366
|
*
|
|
4519
4367
|
* @example
|
|
4520
4368
|
*
|
|
@@ -4543,7 +4391,6 @@ function requireFactory$2 () {
|
|
|
4543
4391
|
}
|
|
4544
4392
|
/**
|
|
4545
4393
|
* Creates and starts a new Application.
|
|
4546
|
-
* @param appOptions
|
|
4547
4394
|
*
|
|
4548
4395
|
* @example
|
|
4549
4396
|
*
|
|
@@ -4559,8 +4406,6 @@ function requireFactory$2 () {
|
|
|
4559
4406
|
* start().then(() => console.log('Application is running')).catch(err => console.log(err));
|
|
4560
4407
|
* ```
|
|
4561
4408
|
*
|
|
4562
|
-
*
|
|
4563
|
-
* @static
|
|
4564
4409
|
*/
|
|
4565
4410
|
async start(appOptions) {
|
|
4566
4411
|
this.wire.sendAction('start-application').catch((e) => {
|
|
@@ -4573,10 +4418,8 @@ function requireFactory$2 () {
|
|
|
4573
4418
|
/**
|
|
4574
4419
|
* Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls.
|
|
4575
4420
|
* Returns once the RVM is finished attempting to launch the applications.
|
|
4576
|
-
* @param applications
|
|
4577
4421
|
* @param opts - Parameters that the RVM will use.
|
|
4578
4422
|
*
|
|
4579
|
-
* @static
|
|
4580
4423
|
* @example
|
|
4581
4424
|
*
|
|
4582
4425
|
* ```js
|
|
@@ -4628,8 +4471,6 @@ function requireFactory$2 () {
|
|
|
4628
4471
|
* });
|
|
4629
4472
|
*
|
|
4630
4473
|
* ```
|
|
4631
|
-
*
|
|
4632
|
-
* @static
|
|
4633
4474
|
*/
|
|
4634
4475
|
getCurrent() {
|
|
4635
4476
|
this.wire.sendAction('get-current-application').catch((e) => {
|
|
@@ -4655,8 +4496,6 @@ function requireFactory$2 () {
|
|
|
4655
4496
|
* });
|
|
4656
4497
|
*
|
|
4657
4498
|
* ```
|
|
4658
|
-
*
|
|
4659
|
-
* @static
|
|
4660
4499
|
*/
|
|
4661
4500
|
getCurrentSync() {
|
|
4662
4501
|
this.wire.sendAction('get-current-application-sync').catch((e) => {
|
|
@@ -4677,8 +4516,6 @@ function requireFactory$2 () {
|
|
|
4677
4516
|
* // For a local manifest file:
|
|
4678
4517
|
* fin.Application.startFromManifest('file:///C:/somefolder/app.json').then(app => console.log('App is running')).catch(err => console.log(err));
|
|
4679
4518
|
* ```
|
|
4680
|
-
*
|
|
4681
|
-
* @static
|
|
4682
4519
|
*/
|
|
4683
4520
|
async startFromManifest(manifestUrl, opts) {
|
|
4684
4521
|
this.wire.sendAction('application-start-from-manifest').catch((e) => {
|
|
@@ -4723,7 +4560,7 @@ function requireFactory$2 () {
|
|
|
4723
4560
|
});
|
|
4724
4561
|
}
|
|
4725
4562
|
}
|
|
4726
|
-
Factory$7.
|
|
4563
|
+
Factory$7.ApplicationModule = ApplicationModule;
|
|
4727
4564
|
return Factory$7;
|
|
4728
4565
|
}
|
|
4729
4566
|
|
|
@@ -4749,18 +4586,19 @@ function requireApplication () {
|
|
|
4749
4586
|
};
|
|
4750
4587
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4751
4588
|
/**
|
|
4752
|
-
* Entry
|
|
4589
|
+
* Entry points for the OpenFin `Application` API (`fin.Application`).
|
|
4753
4590
|
*
|
|
4754
|
-
*
|
|
4755
|
-
*
|
|
4756
|
-
*
|
|
4591
|
+
* * {@link ApplicationModule} contains static members of the `Application` API, accessible through `fin.Application`.
|
|
4592
|
+
* * {@link Application} describes an instance of an OpenFin Application, e.g. as returned by `fin.Application.getCurrent`.
|
|
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.
|
|
4757
4596
|
*
|
|
4758
4597
|
* @packageDocumentation
|
|
4759
4598
|
*/
|
|
4760
|
-
|
|
4761
|
-
__exportStar(requireInstance$1(), exports);
|
|
4762
|
-
|
|
4763
|
-
} (application));
|
|
4599
|
+
__exportStar(requireFactory$2(), exports);
|
|
4600
|
+
__exportStar(requireInstance$1(), exports);
|
|
4601
|
+
} (application));
|
|
4764
4602
|
return application;
|
|
4765
4603
|
}
|
|
4766
4604
|
|
|
@@ -4778,6 +4616,7 @@ function requireInstance () {
|
|
|
4778
4616
|
const application_1 = requireApplication();
|
|
4779
4617
|
const main_1 = main;
|
|
4780
4618
|
const view_1 = requireView();
|
|
4619
|
+
const warnings_1 = warnings;
|
|
4781
4620
|
/**
|
|
4782
4621
|
* @PORTED
|
|
4783
4622
|
* @typedef { object } Margins
|
|
@@ -5262,7 +5101,6 @@ function requireInstance () {
|
|
|
5262
5101
|
*/
|
|
5263
5102
|
constructor(wire, identity) {
|
|
5264
5103
|
super(wire, identity, 'window');
|
|
5265
|
-
this.identity = identity;
|
|
5266
5104
|
}
|
|
5267
5105
|
/**
|
|
5268
5106
|
* Adds a listener to the end of the listeners array for the specified event.
|
|
@@ -5388,6 +5226,7 @@ function requireInstance () {
|
|
|
5388
5226
|
if (options.autoShow === undefined) {
|
|
5389
5227
|
options.autoShow = true;
|
|
5390
5228
|
}
|
|
5229
|
+
(0, warnings_1.handleDeprecatedWarnings)(options);
|
|
5391
5230
|
const windowCreation = this.wire.environment.createChildContent({ entityType: 'window', options });
|
|
5392
5231
|
Promise.all([pageResponse, windowCreation])
|
|
5393
5232
|
.then((resolvedArr) => {
|
|
@@ -5804,15 +5643,15 @@ function requireInstance () {
|
|
|
5804
5643
|
* ```
|
|
5805
5644
|
* @experimental
|
|
5806
5645
|
*/
|
|
5807
|
-
async getLayout() {
|
|
5646
|
+
async getLayout(layoutIdentity) {
|
|
5808
5647
|
this.wire.sendAction('window-get-layout', this.identity).catch((e) => {
|
|
5809
5648
|
// don't expose
|
|
5810
5649
|
});
|
|
5811
5650
|
const opts = await this.getOptions();
|
|
5812
|
-
if (!opts.layout) {
|
|
5651
|
+
if (!opts.layout /* TODO || !opts.layoutSnapshot */) {
|
|
5813
5652
|
throw new Error('Window does not have a Layout');
|
|
5814
5653
|
}
|
|
5815
|
-
return this.fin.Platform.Layout.wrap(this.identity);
|
|
5654
|
+
return this.fin.Platform.Layout.wrap(layoutIdentity ?? this.identity);
|
|
5816
5655
|
}
|
|
5817
5656
|
/**
|
|
5818
5657
|
* Gets the current settings of the window.
|
|
@@ -6093,11 +5932,12 @@ function requireInstance () {
|
|
|
6093
5932
|
* moveBy(580, 300).then(() => console.log('Moved')).catch(err => console.log(err));
|
|
6094
5933
|
* ```
|
|
6095
5934
|
*/
|
|
6096
|
-
moveBy(deltaLeft, deltaTop) {
|
|
5935
|
+
moveBy(deltaLeft, deltaTop, positioningOptions) {
|
|
6097
5936
|
return this.wire
|
|
6098
5937
|
.sendAction('move-window-by', {
|
|
6099
5938
|
deltaLeft,
|
|
6100
5939
|
deltaTop,
|
|
5940
|
+
positioningOptions,
|
|
6101
5941
|
...this.identity
|
|
6102
5942
|
})
|
|
6103
5943
|
.then(() => undefined);
|
|
@@ -6127,11 +5967,12 @@ function requireInstance () {
|
|
|
6127
5967
|
* moveTo(580, 300).then(() => console.log('Moved')).catch(err => console.log(err))
|
|
6128
5968
|
* ```
|
|
6129
5969
|
*/
|
|
6130
|
-
moveTo(left, top) {
|
|
5970
|
+
moveTo(left, top, positioningOptions) {
|
|
6131
5971
|
return this.wire
|
|
6132
5972
|
.sendAction('move-window', {
|
|
6133
5973
|
left,
|
|
6134
5974
|
top,
|
|
5975
|
+
positioningOptions,
|
|
6135
5976
|
...this.identity
|
|
6136
5977
|
})
|
|
6137
5978
|
.then(() => undefined);
|
|
@@ -6164,12 +6005,13 @@ function requireInstance () {
|
|
|
6164
6005
|
* resizeBy(580, 300, 'top-right').then(() => console.log('Resized')).catch(err => console.log(err));
|
|
6165
6006
|
* ```
|
|
6166
6007
|
*/
|
|
6167
|
-
resizeBy(deltaWidth, deltaHeight, anchor) {
|
|
6008
|
+
resizeBy(deltaWidth, deltaHeight, anchor, positioningOptions) {
|
|
6168
6009
|
return this.wire
|
|
6169
6010
|
.sendAction('resize-window-by', {
|
|
6170
6011
|
deltaWidth: Math.floor(deltaWidth),
|
|
6171
6012
|
deltaHeight: Math.floor(deltaHeight),
|
|
6172
6013
|
anchor,
|
|
6014
|
+
positioningOptions,
|
|
6173
6015
|
...this.identity
|
|
6174
6016
|
})
|
|
6175
6017
|
.then(() => undefined);
|
|
@@ -6202,12 +6044,13 @@ function requireInstance () {
|
|
|
6202
6044
|
* resizeTo(580, 300, 'top-left').then(() => console.log('Resized')).catch(err => console.log(err));
|
|
6203
6045
|
* ```
|
|
6204
6046
|
*/
|
|
6205
|
-
resizeTo(width, height, anchor) {
|
|
6047
|
+
resizeTo(width, height, anchor, positioningOptions) {
|
|
6206
6048
|
return this.wire
|
|
6207
6049
|
.sendAction('resize-window', {
|
|
6208
6050
|
width: Math.floor(width),
|
|
6209
6051
|
height: Math.floor(height),
|
|
6210
6052
|
anchor,
|
|
6053
|
+
positioningOptions,
|
|
6211
6054
|
...this.identity
|
|
6212
6055
|
})
|
|
6213
6056
|
.then(() => undefined);
|
|
@@ -6266,7 +6109,6 @@ function requireInstance () {
|
|
|
6266
6109
|
}
|
|
6267
6110
|
/**
|
|
6268
6111
|
* Sets the window's size and position.
|
|
6269
|
-
* @property { Bounds } bounds This is a * @type {string} name - name of the window.object that holds the propertys of
|
|
6270
6112
|
*
|
|
6271
6113
|
* @example
|
|
6272
6114
|
* ```js
|
|
@@ -6293,8 +6135,10 @@ function requireInstance () {
|
|
|
6293
6135
|
* }).then(() => console.log('Bounds set to window')).catch(err => console.log(err));
|
|
6294
6136
|
* ```
|
|
6295
6137
|
*/
|
|
6296
|
-
setBounds(bounds) {
|
|
6297
|
-
return this.wire
|
|
6138
|
+
setBounds(bounds, positioningOptions) {
|
|
6139
|
+
return this.wire
|
|
6140
|
+
.sendAction('set-window-bounds', { ...bounds, ...this.identity, positioningOptions })
|
|
6141
|
+
.then(() => undefined);
|
|
6298
6142
|
}
|
|
6299
6143
|
/**
|
|
6300
6144
|
* Shows the window if it is hidden.
|
|
@@ -6436,7 +6280,10 @@ function requireInstance () {
|
|
|
6436
6280
|
* Calling this method will close previously opened menus.
|
|
6437
6281
|
* @experimental
|
|
6438
6282
|
* @param options
|
|
6439
|
-
*
|
|
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.
|
|
6440
6287
|
* @example
|
|
6441
6288
|
* This could be used to show a drop down menu over views in a platform window:
|
|
6442
6289
|
* ```js
|
|
@@ -6526,6 +6373,7 @@ function requireInstance () {
|
|
|
6526
6373
|
return this.wire.sendAction('close-popup-menu', { ...this.identity }).then(() => undefined);
|
|
6527
6374
|
}
|
|
6528
6375
|
/**
|
|
6376
|
+
* @PORTED
|
|
6529
6377
|
* @typedef {object} PopupOptions
|
|
6530
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.
|
|
6531
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`.
|
|
@@ -6543,6 +6391,7 @@ function requireInstance () {
|
|
|
6543
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.
|
|
6544
6392
|
*/
|
|
6545
6393
|
/**
|
|
6394
|
+
* @PORTED
|
|
6546
6395
|
* @typedef {object} PopupResult
|
|
6547
6396
|
* @property {Identity} identity - `name` and `uuid` of the popup window that called dispatched this result.
|
|
6548
6397
|
* @property {'clicked' | 'dismissed'} result - Result of the user interaction with the popup window.
|
|
@@ -6632,13 +6481,16 @@ function requireFactory$1 () {
|
|
|
6632
6481
|
if (hasRequiredFactory$1) return Factory$8;
|
|
6633
6482
|
hasRequiredFactory$1 = 1;
|
|
6634
6483
|
Object.defineProperty(Factory$8, "__esModule", { value: true });
|
|
6484
|
+
Factory$8._WindowModule = void 0;
|
|
6635
6485
|
const base_1 = base;
|
|
6636
6486
|
const validate_1 = validate;
|
|
6637
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
|
+
*/
|
|
6638
6491
|
class _WindowModule extends base_1.Base {
|
|
6639
6492
|
/**
|
|
6640
6493
|
* Asynchronously returns a Window object that represents an existing window.
|
|
6641
|
-
* @param identity
|
|
6642
6494
|
*
|
|
6643
6495
|
* @example
|
|
6644
6496
|
* ```js
|
|
@@ -6655,7 +6507,6 @@ function requireFactory$1 () {
|
|
|
6655
6507
|
* .then(win => console.log('wrapped window'))
|
|
6656
6508
|
* .catch(err => console.log(err));
|
|
6657
6509
|
* ```
|
|
6658
|
-
* @static
|
|
6659
6510
|
*/
|
|
6660
6511
|
async wrap(identity) {
|
|
6661
6512
|
this.wire.sendAction('window-wrap').catch((e) => {
|
|
@@ -6669,7 +6520,6 @@ function requireFactory$1 () {
|
|
|
6669
6520
|
}
|
|
6670
6521
|
/**
|
|
6671
6522
|
* Synchronously returns a Window object that represents an existing window.
|
|
6672
|
-
* @param identity
|
|
6673
6523
|
*
|
|
6674
6524
|
* @example
|
|
6675
6525
|
* ```js
|
|
@@ -6685,7 +6535,6 @@ function requireFactory$1 () {
|
|
|
6685
6535
|
* await createWin();
|
|
6686
6536
|
* let win = fin.Window.wrapSync({ uuid: 'app-1', name: 'myApp' });
|
|
6687
6537
|
* ```
|
|
6688
|
-
* @static
|
|
6689
6538
|
*/
|
|
6690
6539
|
wrapSync(identity) {
|
|
6691
6540
|
this.wire.sendAction('window-wrap-sync').catch((e) => {
|
|
@@ -6717,7 +6566,6 @@ function requireFactory$1 () {
|
|
|
6717
6566
|
*
|
|
6718
6567
|
* createWindow().then(() => console.log('Window is created')).catch(err => console.log(err));
|
|
6719
6568
|
* ```
|
|
6720
|
-
* @static
|
|
6721
6569
|
*/
|
|
6722
6570
|
create(options) {
|
|
6723
6571
|
this.wire.sendAction('create-window').catch((e) => {
|
|
@@ -6736,7 +6584,6 @@ function requireFactory$1 () {
|
|
|
6736
6584
|
* .catch(err => console.log(err));
|
|
6737
6585
|
*
|
|
6738
6586
|
* ```
|
|
6739
|
-
* @static
|
|
6740
6587
|
*/
|
|
6741
6588
|
getCurrent() {
|
|
6742
6589
|
this.wire.sendAction('get-current-window').catch((e) => {
|
|
@@ -6758,7 +6605,6 @@ function requireFactory$1 () {
|
|
|
6758
6605
|
* console.log(info);
|
|
6759
6606
|
*
|
|
6760
6607
|
* ```
|
|
6761
|
-
* @static
|
|
6762
6608
|
*/
|
|
6763
6609
|
getCurrentSync() {
|
|
6764
6610
|
this.wire.sendAction('get-current-window-sync').catch((e) => {
|
|
@@ -6771,7 +6617,7 @@ function requireFactory$1 () {
|
|
|
6771
6617
|
return this.wrapSync({ uuid, name });
|
|
6772
6618
|
}
|
|
6773
6619
|
}
|
|
6774
|
-
Factory$8.
|
|
6620
|
+
Factory$8._WindowModule = _WindowModule;
|
|
6775
6621
|
return Factory$8;
|
|
6776
6622
|
}
|
|
6777
6623
|
|
|
@@ -6797,28 +6643,37 @@ function requireWindow () {
|
|
|
6797
6643
|
};
|
|
6798
6644
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6799
6645
|
/**
|
|
6800
|
-
* Entry
|
|
6646
|
+
* Entry points for the OpenFin `Window` API (`fin.Window`).
|
|
6801
6647
|
*
|
|
6802
|
-
*
|
|
6803
|
-
*
|
|
6804
|
-
* instances of the OpenFin `Window` class.
|
|
6648
|
+
* * {@link _WindowModule} contains static members of the `Window` API, accessible through `fin.Window`.
|
|
6649
|
+
* * {@link _Window} describes an instance of an OpenFin Window, e.g. as returned by `fin.Window.getCurrent`.
|
|
6805
6650
|
*
|
|
6806
|
-
*
|
|
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
|
+
*
|
|
6654
|
+
* Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
|
|
6807
6655
|
*
|
|
6808
6656
|
* @packageDocumentation
|
|
6809
6657
|
*/
|
|
6810
|
-
|
|
6811
|
-
exports
|
|
6812
|
-
|
|
6813
|
-
} (window$1));
|
|
6658
|
+
__exportStar(requireFactory$1(), exports);
|
|
6659
|
+
__exportStar(requireInstance(), exports);
|
|
6660
|
+
} (window$1));
|
|
6814
6661
|
return window$1;
|
|
6815
6662
|
}
|
|
6816
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
|
+
*/
|
|
6817
6671
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
6672
|
+
system.System = void 0;
|
|
6818
6673
|
const base_1$j = base;
|
|
6819
6674
|
const transport_errors_1$1 = transportErrors;
|
|
6820
6675
|
const window_1 = requireWindow();
|
|
6821
|
-
const events_1$6 =
|
|
6676
|
+
const events_1$6 = require$$0;
|
|
6822
6677
|
/**
|
|
6823
6678
|
* An object representing the core of OpenFin Runtime. Allows the developer
|
|
6824
6679
|
* to perform system-level actions, such as accessing logs, viewing processes,
|
|
@@ -7130,7 +6985,6 @@ class System extends base_1$j.EmitterBase {
|
|
|
7130
6985
|
* ```js
|
|
7131
6986
|
* fin.System.getUniqueUserId().then(id => console.log(id)).catch(err => console.log(err));
|
|
7132
6987
|
* ```
|
|
7133
|
-
* @static
|
|
7134
6988
|
*/
|
|
7135
6989
|
getUniqueUserId() {
|
|
7136
6990
|
return this.wire.sendAction('get-unique-user-id').then(({ payload }) => payload.data);
|
|
@@ -7821,7 +7675,8 @@ class System extends base_1$j.EmitterBase {
|
|
|
7821
7675
|
}
|
|
7822
7676
|
/**
|
|
7823
7677
|
* Attempt to close an external process. The process will be terminated if it
|
|
7824
|
-
* has not closed after the elapsed timeout in milliseconds
|
|
7678
|
+
* has not closed after the elapsed timeout in milliseconds.
|
|
7679
|
+
*
|
|
7825
7680
|
* Note: This method is restricted by default and must be enabled via
|
|
7826
7681
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
7827
7682
|
* @param options A object defined in the TerminateExternalRequestType interface
|
|
@@ -7857,7 +7712,8 @@ class System extends base_1$j.EmitterBase {
|
|
|
7857
7712
|
return this.wire.sendAction('update-proxy', options).then(() => undefined);
|
|
7858
7713
|
}
|
|
7859
7714
|
/**
|
|
7860
|
-
* Downloads the given application asset
|
|
7715
|
+
* Downloads the given application asset.
|
|
7716
|
+
*
|
|
7861
7717
|
* Note: This method is restricted by default and must be enabled via
|
|
7862
7718
|
* <a href="https://developers.openfin.co/docs/api-security">API security settings</a>.
|
|
7863
7719
|
* @param appAsset App asset object
|
|
@@ -8401,7 +8257,6 @@ class System extends base_1$j.EmitterBase {
|
|
|
8401
8257
|
* }
|
|
8402
8258
|
* });
|
|
8403
8259
|
* ```
|
|
8404
|
-
* @static
|
|
8405
8260
|
*/
|
|
8406
8261
|
async launchManifest(manifestUrl, opts = {}) {
|
|
8407
8262
|
const { subscribe, ..._sendOpts } = opts;
|
|
@@ -8661,7 +8516,7 @@ class System extends base_1$j.EmitterBase {
|
|
|
8661
8516
|
await this.wire.sendAction('set-domain-settings', { domainSettings, ...this.identity });
|
|
8662
8517
|
}
|
|
8663
8518
|
}
|
|
8664
|
-
system.
|
|
8519
|
+
system.System = System;
|
|
8665
8520
|
|
|
8666
8521
|
var interappbus = {};
|
|
8667
8522
|
|
|
@@ -8752,7 +8607,7 @@ class ChannelBase {
|
|
|
8752
8607
|
try {
|
|
8753
8608
|
const mainAction = this.subscriptions.has(topic)
|
|
8754
8609
|
? this.subscriptions.get(topic)
|
|
8755
|
-
: (currentPayload, id) =>
|
|
8610
|
+
: (currentPayload, id) => (this.defaultAction ?? ChannelBase.defaultAction)(topic, currentPayload, id);
|
|
8756
8611
|
const preActionProcessed = this.preAction ? await this.preAction(topic, payload, senderIdentity) : payload;
|
|
8757
8612
|
const actionProcessed = await mainAction(preActionProcessed, senderIdentity);
|
|
8758
8613
|
return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
|
|
@@ -9072,6 +8927,7 @@ var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
9072
8927
|
};
|
|
9073
8928
|
var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
|
|
9074
8929
|
Object.defineProperty(client, "__esModule", { value: true });
|
|
8930
|
+
client.ChannelClient = void 0;
|
|
9075
8931
|
const channel_1$1 = channel;
|
|
9076
8932
|
const channelClientsByEndpointId = new Map();
|
|
9077
8933
|
/**
|
|
@@ -9080,17 +8936,17 @@ const channelClientsByEndpointId = new Map();
|
|
|
9080
8936
|
* provider via {@link ChannelClient#dispatch dispatch} and to listen for communication
|
|
9081
8937
|
* from the provider by registering an action via {@link ChannelClient#register register}.
|
|
9082
8938
|
*
|
|
9083
|
-
* Synchronous Methods:
|
|
8939
|
+
* ### Synchronous Methods:
|
|
9084
8940
|
* * {@link ChannelClient#onDisconnection onDisconnection(listener)}
|
|
9085
8941
|
* * {@link ChannelClient#register register(action, listener)}
|
|
9086
8942
|
* * {@link ChannelClient#remove remove(action)}
|
|
9087
8943
|
*
|
|
9088
|
-
* Asynchronous Methods:
|
|
8944
|
+
* ### Asynchronous Methods:
|
|
9089
8945
|
* * {@link ChannelClient#disconnect disconnect()}
|
|
9090
8946
|
* * {@link ChannelClient#dispatch dispatch(action, payload)}
|
|
9091
8947
|
*
|
|
9092
|
-
* Middleware:
|
|
9093
|
-
*
|
|
8948
|
+
* ### Middleware:
|
|
8949
|
+
* Middleware functions receive the following arguments: (action, payload, senderId).
|
|
9094
8950
|
* The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
|
|
9095
8951
|
* unless it is undefined, in which case the original payload is used. Middleware can be used for side effects.
|
|
9096
8952
|
* * {@link ChannelClient#setDefaultAction setDefaultAction(middleware)}
|
|
@@ -9237,7 +9093,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
|
9237
9093
|
});
|
|
9238
9094
|
}
|
|
9239
9095
|
}
|
|
9240
|
-
client.
|
|
9096
|
+
client.ChannelClient = ChannelClient;
|
|
9241
9097
|
_ChannelClient_protectedObj = new WeakMap(), _ChannelClient_strategy = new WeakMap(), _ChannelClient_close = new WeakMap();
|
|
9242
9098
|
|
|
9243
9099
|
var connectionManager = {};
|
|
@@ -9284,7 +9140,6 @@ class ClassicStrategy {
|
|
|
9284
9140
|
// connection problems occur
|
|
9285
9141
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
|
|
9286
9142
|
this.send = async (endpointId, action, payload) => {
|
|
9287
|
-
var _a;
|
|
9288
9143
|
const to = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
9289
9144
|
if (!to) {
|
|
9290
9145
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
|
@@ -9304,13 +9159,12 @@ class ClassicStrategy {
|
|
|
9304
9159
|
action,
|
|
9305
9160
|
payload
|
|
9306
9161
|
});
|
|
9307
|
-
|
|
9162
|
+
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
|
9308
9163
|
const raw = await p.catch((error) => {
|
|
9309
9164
|
throw new Error(error.message);
|
|
9310
9165
|
}).finally(() => {
|
|
9311
|
-
var _a;
|
|
9312
9166
|
// clean up the pending promise
|
|
9313
|
-
|
|
9167
|
+
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
|
9314
9168
|
});
|
|
9315
9169
|
return raw.payload.data.result;
|
|
9316
9170
|
};
|
|
@@ -9331,8 +9185,8 @@ class ClassicStrategy {
|
|
|
9331
9185
|
const id = __classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
|
9332
9186
|
__classPrivateFieldGet$c(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
|
9333
9187
|
const pendingSet = __classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
|
9334
|
-
pendingSet
|
|
9335
|
-
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.`;
|
|
9336
9190
|
p.cancel(new Error(errorMsg));
|
|
9337
9191
|
});
|
|
9338
9192
|
}
|
|
@@ -9344,9 +9198,8 @@ class ClassicStrategy {
|
|
|
9344
9198
|
__classPrivateFieldGet$c(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
|
9345
9199
|
}
|
|
9346
9200
|
isValidEndpointPayload(payload) {
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
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');
|
|
9350
9203
|
}
|
|
9351
9204
|
}
|
|
9352
9205
|
strategy$2.ClassicStrategy = ClassicStrategy;
|
|
@@ -9423,13 +9276,12 @@ class RTCEndpoint {
|
|
|
9423
9276
|
this.rtc.rtcClient.close();
|
|
9424
9277
|
};
|
|
9425
9278
|
this.rtc.channels.response.addEventListener('message', (e) => {
|
|
9426
|
-
var _a;
|
|
9427
9279
|
let { data } = e;
|
|
9428
9280
|
if (e.data instanceof ArrayBuffer) {
|
|
9429
9281
|
data = new TextDecoder().decode(e.data);
|
|
9430
9282
|
}
|
|
9431
9283
|
const { messageId, payload, success, error } = JSON.parse(data);
|
|
9432
|
-
const { resolve, reject } =
|
|
9284
|
+
const { resolve, reject } = this.responseMap.get(messageId) ?? {};
|
|
9433
9285
|
if (resolve && reject) {
|
|
9434
9286
|
this.responseMap.delete(messageId);
|
|
9435
9287
|
if (success) {
|
|
@@ -9678,9 +9530,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
|
|
|
9678
9530
|
const rtcConnectionId = Math.random().toString();
|
|
9679
9531
|
const rtcClient = this.createRtcPeer();
|
|
9680
9532
|
rtcClient.addEventListener('icecandidate', async (e) => {
|
|
9681
|
-
var _a;
|
|
9682
9533
|
if (e.candidate) {
|
|
9683
|
-
await this.raiseClientIce(rtcConnectionId, { candidate:
|
|
9534
|
+
await this.raiseClientIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
|
|
9684
9535
|
}
|
|
9685
9536
|
});
|
|
9686
9537
|
await this.listenForProviderIce(rtcConnectionId, async (payload) => {
|
|
@@ -9705,9 +9556,8 @@ class RTCICEManager extends base_1$i.EmitterBase {
|
|
|
9705
9556
|
const requestChannelPromise = RTCICEManager.createDataChannelPromise('request', rtcClient);
|
|
9706
9557
|
const responseChannelPromise = RTCICEManager.createDataChannelPromise('response', rtcClient);
|
|
9707
9558
|
rtcClient.addEventListener('icecandidate', async (e) => {
|
|
9708
|
-
var _a;
|
|
9709
9559
|
if (e.candidate) {
|
|
9710
|
-
await this.raiseProviderIce(rtcConnectionId, { candidate:
|
|
9560
|
+
await this.raiseProviderIce(rtcConnectionId, { candidate: e.candidate?.toJSON() });
|
|
9711
9561
|
}
|
|
9712
9562
|
});
|
|
9713
9563
|
await this.listenForClientIce(rtcConnectionId, async (payload) => {
|
|
@@ -9780,20 +9630,20 @@ const runtimeVersioning_1 = runtimeVersioning;
|
|
|
9780
9630
|
* a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
|
|
9781
9631
|
* and to listen for communication from clients by registering an action via {@link ChannelProvider#register register}.
|
|
9782
9632
|
*
|
|
9783
|
-
* Synchronous Methods:
|
|
9633
|
+
* ### Synchronous Methods:
|
|
9784
9634
|
* * {@link ChannelProvider#onConnection onConnection(listener)}
|
|
9785
9635
|
* * {@link ChannelProvider#onDisconnection onDisconnection(listener)}
|
|
9786
9636
|
* * {@link ChannelProvider#publish publish(action, payload)}
|
|
9787
9637
|
* * {@link ChannelProvider#register register(action, listener)}
|
|
9788
9638
|
* * {@link ChannelProvider#remove remove(action)}
|
|
9789
9639
|
*
|
|
9790
|
-
* Asynchronous Methods:
|
|
9640
|
+
* ### Asynchronous Methods:
|
|
9791
9641
|
* * {@link ChannelProvider#destroy destroy()}
|
|
9792
9642
|
* * {@link ChannelProvider#dispatch dispatch(to, action, payload)}
|
|
9793
9643
|
* * {@link ChannelProvider#getAllClientInfo getAllClientInfo()}
|
|
9794
9644
|
*
|
|
9795
|
-
* Middleware:
|
|
9796
|
-
*
|
|
9645
|
+
* ### Middleware:
|
|
9646
|
+
* Middleware functions receive the following arguments: (action, payload, senderId).
|
|
9797
9647
|
* The return value of the middleware function will be passed on as the payload from beforeAction, to the action listener, to afterAction
|
|
9798
9648
|
* unless it is undefined, in which case the most recently defined payload is used. Middleware can be used for side effects.
|
|
9799
9649
|
* * {@link ChannelProvider#setDefaultAction setDefaultAction(middleware)}
|
|
@@ -9889,8 +9739,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
9889
9739
|
* ```
|
|
9890
9740
|
*/
|
|
9891
9741
|
dispatch(to, action, payload) {
|
|
9892
|
-
|
|
9893
|
-
const endpointId = (_a = to.endpointId) !== null && _a !== void 0 ? _a : this.getEndpointIdForOpenFinId(to, action);
|
|
9742
|
+
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
|
9894
9743
|
if (endpointId && __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
|
9895
9744
|
return __classPrivateFieldGet$9(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
|
|
9896
9745
|
}
|
|
@@ -10066,13 +9915,12 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10066
9915
|
}
|
|
10067
9916
|
}
|
|
10068
9917
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
|
10069
|
-
var _a;
|
|
10070
9918
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
|
10071
9919
|
if (matchingConnections.length >= 2) {
|
|
10072
9920
|
const protectedObj = __classPrivateFieldGet$9(this, _ChannelProvider_protectedObj, "f");
|
|
10073
9921
|
const { uuid, name } = clientIdentity;
|
|
10074
|
-
const providerUuid = protectedObj
|
|
10075
|
-
const providerName = protectedObj
|
|
9922
|
+
const providerUuid = protectedObj?.providerIdentity.uuid;
|
|
9923
|
+
const providerName = protectedObj?.providerIdentity.name;
|
|
10076
9924
|
// eslint-disable-next-line no-console
|
|
10077
9925
|
console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the
|
|
10078
9926
|
"endpointId" parameter. The identity you are dispatching to ({uuid: ${uuid}, name: ${name}})
|
|
@@ -10080,7 +9928,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
|
10080
9928
|
({uuid: ${providerUuid}, name: ${providerName}}) will only be processed by the most recently-created client.`);
|
|
10081
9929
|
}
|
|
10082
9930
|
// Pop to return the most recently created endpointId.
|
|
10083
|
-
return
|
|
9931
|
+
return matchingConnections.pop()?.endpointId;
|
|
10084
9932
|
}
|
|
10085
9933
|
// eslint-disable-next-line class-methods-use-this
|
|
10086
9934
|
static clientIdentityIncludesEndpointId(subscriptionIdentity) {
|
|
@@ -10123,9 +9971,10 @@ class MessageReceiver extends base_1$h.Base {
|
|
|
10123
9971
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
|
10124
9972
|
}
|
|
10125
9973
|
async processChannelMessage(msg) {
|
|
10126
|
-
var _a, _b;
|
|
10127
9974
|
const { senderIdentity, providerIdentity, action, ackToSender, payload, intendedTargetIdentity } = msg.payload;
|
|
10128
|
-
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
|
|
10129
9978
|
const handler = this.endpointMap.get(key);
|
|
10130
9979
|
if (!handler) {
|
|
10131
9980
|
ackToSender.payload.success = false;
|
|
@@ -10162,7 +10011,7 @@ class MessageReceiver extends base_1$h.Base {
|
|
|
10162
10011
|
const endpointIdFromPreviousConnection = this.latestEndpointIdByChannelId.get(channelId);
|
|
10163
10012
|
if (endpointIdFromPreviousConnection) {
|
|
10164
10013
|
// Not convinced by this way of doing things, but pushing up for now.
|
|
10165
|
-
client_1$1.
|
|
10014
|
+
client_1$1.ChannelClient.closeChannelByEndpointId(endpointIdFromPreviousConnection);
|
|
10166
10015
|
// eslint-disable-next-line no-console
|
|
10167
10016
|
console.warn('You have created a second connection to an older provider. First connection has been removed from the clientMap');
|
|
10168
10017
|
// eslint-disable-next-line no-console
|
|
@@ -10205,12 +10054,9 @@ class ProtocolManager {
|
|
|
10205
10054
|
return supported;
|
|
10206
10055
|
};
|
|
10207
10056
|
this.getCompatibleProtocols = (providerProtocols, clientOffer) => {
|
|
10208
|
-
const supported = clientOffer.supportedProtocols.filter((clientProtocol) => providerProtocols.some((providerProtocol) =>
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
clientProtocol.version >= providerProtocol.minimumVersion &&
|
|
10212
|
-
providerProtocol.version >= ((_a = clientProtocol.minimumVersion) !== null && _a !== void 0 ? _a : 0);
|
|
10213
|
-
}));
|
|
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)));
|
|
10214
10060
|
return supported.slice(0, clientOffer.maxProtocols);
|
|
10215
10061
|
};
|
|
10216
10062
|
}
|
|
@@ -10335,7 +10181,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10335
10181
|
}
|
|
10336
10182
|
createProvider(options, providerIdentity) {
|
|
10337
10183
|
const opts = Object.assign(this.wire.environment.getDefaultChannelOptions().create, options || {});
|
|
10338
|
-
const protocols = this.protocolManager.getProviderProtocols(opts
|
|
10184
|
+
const protocols = this.protocolManager.getProviderProtocols(opts?.protocols);
|
|
10339
10185
|
const createSingleStrategy = (stratType) => {
|
|
10340
10186
|
switch (stratType) {
|
|
10341
10187
|
case 'rtc':
|
|
@@ -10372,7 +10218,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10372
10218
|
return channel;
|
|
10373
10219
|
}
|
|
10374
10220
|
async createClientOffer(options) {
|
|
10375
|
-
const protocols = this.protocolManager.getClientProtocols(options
|
|
10221
|
+
const protocols = this.protocolManager.getClientProtocols(options?.protocols);
|
|
10376
10222
|
let rtcPacket;
|
|
10377
10223
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
|
10378
10224
|
switch (type) {
|
|
@@ -10400,14 +10246,13 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10400
10246
|
};
|
|
10401
10247
|
}
|
|
10402
10248
|
async createClientStrategy(rtcPacket, routingInfo) {
|
|
10403
|
-
var _a;
|
|
10404
10249
|
if (!routingInfo.endpointId) {
|
|
10405
10250
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
|
10406
10251
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
|
10407
10252
|
// clients that are in the same context as the newly-connected client.
|
|
10408
10253
|
__classPrivateFieldGet$8(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
|
10409
10254
|
}
|
|
10410
|
-
const answer =
|
|
10255
|
+
const answer = routingInfo.answer ?? {
|
|
10411
10256
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
|
10412
10257
|
};
|
|
10413
10258
|
const createStrategyFromAnswer = async (protocol) => {
|
|
@@ -10465,7 +10310,7 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10465
10310
|
if (!(provider instanceof provider_1$1.ChannelProvider)) {
|
|
10466
10311
|
throw Error('Cannot connect to a channel client');
|
|
10467
10312
|
}
|
|
10468
|
-
const offer = clientOffer
|
|
10313
|
+
const offer = clientOffer ?? {
|
|
10469
10314
|
supportedProtocols: [{ type: 'classic', version: 1 }],
|
|
10470
10315
|
maxProtocols: 1
|
|
10471
10316
|
};
|
|
@@ -10523,6 +10368,15 @@ class ConnectionManager extends base_1$g.Base {
|
|
|
10523
10368
|
connectionManager.ConnectionManager = ConnectionManager;
|
|
10524
10369
|
_ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnectionManager = new WeakMap();
|
|
10525
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
|
+
*/
|
|
10526
10380
|
var __classPrivateFieldSet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
10527
10381
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
10528
10382
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -10538,7 +10392,7 @@ var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnec
|
|
|
10538
10392
|
Object.defineProperty(channel$1, "__esModule", { value: true });
|
|
10539
10393
|
channel$1.Channel = void 0;
|
|
10540
10394
|
/* eslint-disable no-console */
|
|
10541
|
-
const events_1$5 =
|
|
10395
|
+
const events_1$5 = require$$0;
|
|
10542
10396
|
const lazy_1$1 = lazy;
|
|
10543
10397
|
const base_1$f = base;
|
|
10544
10398
|
const client_1 = client;
|
|
@@ -10583,7 +10437,7 @@ class Channel extends base_1$f.EmitterBase {
|
|
|
10583
10437
|
_Channel_readyToConnect.set(this, new lazy_1$1.AsyncRetryableLazy(async () => {
|
|
10584
10438
|
await Promise.all([
|
|
10585
10439
|
this.on('disconnected', (eventPayload) => {
|
|
10586
|
-
client_1.
|
|
10440
|
+
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
|
10587
10441
|
}),
|
|
10588
10442
|
this.on('connected', (...args) => {
|
|
10589
10443
|
__classPrivateFieldGet$7(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
|
@@ -10774,7 +10628,7 @@ class Channel extends base_1$f.EmitterBase {
|
|
|
10774
10628
|
};
|
|
10775
10629
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
|
10776
10630
|
const strategy = await __classPrivateFieldGet$7(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
|
10777
|
-
const channel = new client_1.
|
|
10631
|
+
const channel = new client_1.ChannelClient(routingInfo, this.wire, strategy);
|
|
10778
10632
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
|
10779
10633
|
// If the endpoint dies, the client will force a disconnection through the core.
|
|
10780
10634
|
// The provider does not care about endpoint disconnection.
|
|
@@ -10786,7 +10640,7 @@ class Channel extends base_1$f.EmitterBase {
|
|
|
10786
10640
|
console.warn(`Something went wrong during disconnect for client with uuid: ${routingInfo.uuid} / name: ${routingInfo.name} / endpointId: ${routingInfo.endpointId}.`);
|
|
10787
10641
|
}
|
|
10788
10642
|
finally {
|
|
10789
|
-
client_1.
|
|
10643
|
+
client_1.ChannelClient.handleProviderDisconnect(routingInfo);
|
|
10790
10644
|
}
|
|
10791
10645
|
});
|
|
10792
10646
|
return channel;
|
|
@@ -10857,8 +10711,15 @@ channel$1.Channel = Channel;
|
|
|
10857
10711
|
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
10858
10712
|
|
|
10859
10713
|
Object.defineProperty(interappbus, "__esModule", { value: true });
|
|
10860
|
-
interappbus.InterAppPayload = void 0;
|
|
10861
|
-
|
|
10714
|
+
interappbus.InterAppPayload = interappbus.InterApplicationBus = void 0;
|
|
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;
|
|
10862
10723
|
const base_1$e = base;
|
|
10863
10724
|
const ref_counter_1 = refCounter;
|
|
10864
10725
|
const index_1$2 = channel$1;
|
|
@@ -11049,7 +10910,7 @@ class InterApplicationBus extends base_1$e.Base {
|
|
|
11049
10910
|
return true;
|
|
11050
10911
|
}
|
|
11051
10912
|
}
|
|
11052
|
-
interappbus.
|
|
10913
|
+
interappbus.InterApplicationBus = InterApplicationBus;
|
|
11053
10914
|
/**
|
|
11054
10915
|
* @internal
|
|
11055
10916
|
*/
|
|
@@ -11066,7 +10927,15 @@ function createKey(...toHash) {
|
|
|
11066
10927
|
|
|
11067
10928
|
var clipboard = {};
|
|
11068
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
|
+
*/
|
|
11069
10937
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
|
10938
|
+
clipboard.Clipboard = void 0;
|
|
11070
10939
|
const base_1$d = base;
|
|
11071
10940
|
/**
|
|
11072
10941
|
* @PORTED
|
|
@@ -11264,7 +11133,7 @@ class Clipboard extends base_1$d.Base {
|
|
|
11264
11133
|
return payload.data;
|
|
11265
11134
|
}
|
|
11266
11135
|
}
|
|
11267
|
-
clipboard.
|
|
11136
|
+
clipboard.Clipboard = Clipboard;
|
|
11268
11137
|
|
|
11269
11138
|
var externalApplication = {};
|
|
11270
11139
|
|
|
@@ -11279,7 +11148,7 @@ const base_1$c = base;
|
|
|
11279
11148
|
/**
|
|
11280
11149
|
* An ExternalApplication object representing native language adapter connections to the runtime. Allows
|
|
11281
11150
|
* the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
|
|
11282
|
-
* Discovery of connections is provided by
|
|
11151
|
+
* Discovery of connections is provided by {@link System.System.getAllExternalApplications getAllExternalApplications}.</a>
|
|
11283
11152
|
*
|
|
11284
11153
|
* Processes that can be wrapped as `ExternalApplication`s include the following:
|
|
11285
11154
|
* - Processes which have connected to an OpenFin runtime via an adapter
|
|
@@ -11390,8 +11259,12 @@ class ExternalApplication extends base_1$c.EmitterBase {
|
|
|
11390
11259
|
Instance$4.ExternalApplication = ExternalApplication;
|
|
11391
11260
|
|
|
11392
11261
|
Object.defineProperty(Factory$5, "__esModule", { value: true });
|
|
11262
|
+
Factory$5.ExternalApplicationModule = void 0;
|
|
11393
11263
|
const base_1$b = base;
|
|
11394
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
|
+
*/
|
|
11395
11268
|
class ExternalApplicationModule extends base_1$b.Base {
|
|
11396
11269
|
/**
|
|
11397
11270
|
* Asynchronously returns an External Application object that represents an external application.
|
|
@@ -11405,7 +11278,6 @@ class ExternalApplicationModule extends base_1$b.Base {
|
|
|
11405
11278
|
* .then(extApp => console.log('wrapped external application'))
|
|
11406
11279
|
* .catch(err => console.log(err));
|
|
11407
11280
|
* ```
|
|
11408
|
-
* @static
|
|
11409
11281
|
*/
|
|
11410
11282
|
wrap(uuid) {
|
|
11411
11283
|
this.wire.sendAction('external-application-wrap').catch((e) => {
|
|
@@ -11425,7 +11297,6 @@ class ExternalApplicationModule extends base_1$b.Base {
|
|
|
11425
11297
|
* const info = await extApp.getInfo();
|
|
11426
11298
|
* console.log(info);
|
|
11427
11299
|
* ```
|
|
11428
|
-
* @static
|
|
11429
11300
|
*/
|
|
11430
11301
|
wrapSync(uuid) {
|
|
11431
11302
|
this.wire.sendAction('external-application-wrap-sync').catch((e) => {
|
|
@@ -11434,18 +11305,9 @@ class ExternalApplicationModule extends base_1$b.Base {
|
|
|
11434
11305
|
return new Instance_1$4.ExternalApplication(this.wire, { uuid });
|
|
11435
11306
|
}
|
|
11436
11307
|
}
|
|
11437
|
-
Factory$5.
|
|
11308
|
+
Factory$5.ExternalApplicationModule = ExternalApplicationModule;
|
|
11438
11309
|
|
|
11439
11310
|
(function (exports) {
|
|
11440
|
-
/**
|
|
11441
|
-
* Entry point for the OpenFin ExternalApplication namespace.
|
|
11442
|
-
*
|
|
11443
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "ExternalApplicationModule" is used for
|
|
11444
|
-
* the module containing static members of the `ExternalApplication` namespace (available under `fin.ExternalApplication`), while `ExternalApplication`
|
|
11445
|
-
* documents instances of the OpenFin `ExternalApplication` class.
|
|
11446
|
-
*
|
|
11447
|
-
* @packageDocumentation
|
|
11448
|
-
*/
|
|
11449
11311
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11450
11312
|
if (k2 === undefined) k2 = k;
|
|
11451
11313
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -11461,9 +11323,19 @@ Factory$5.default = ExternalApplicationModule;
|
|
|
11461
11323
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11462
11324
|
};
|
|
11463
11325
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11326
|
+
/**
|
|
11327
|
+
* Entry points for the OpenFin `ExternalApplication` API (`fin.ExternalApplication`).
|
|
11328
|
+
*
|
|
11329
|
+
* * {@link ExternalApplicationModule} contains static members of the `ExternalApplication` type, accessible through `fin.ExternalApplication`.
|
|
11330
|
+
* * {@link ExternalApplication} describes an instance of an OpenFin ExternalApplication, e.g. as returned by `fin.ExternalApplication.getCurrent`.
|
|
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
|
+
*
|
|
11335
|
+
* @packageDocumentation
|
|
11336
|
+
*/
|
|
11337
|
+
__exportStar(Factory$5, exports);
|
|
11338
|
+
__exportStar(Instance$4, exports);
|
|
11467
11339
|
} (externalApplication));
|
|
11468
11340
|
|
|
11469
11341
|
var frame = {};
|
|
@@ -11616,9 +11488,13 @@ class _Frame extends base_1$a.EmitterBase {
|
|
|
11616
11488
|
Instance$3._Frame = _Frame;
|
|
11617
11489
|
|
|
11618
11490
|
Object.defineProperty(Factory$4, "__esModule", { value: true });
|
|
11491
|
+
Factory$4._FrameModule = void 0;
|
|
11619
11492
|
const base_1$9 = base;
|
|
11620
11493
|
const validate_1$2 = validate;
|
|
11621
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
|
+
*/
|
|
11622
11498
|
class _FrameModule extends base_1$9.Base {
|
|
11623
11499
|
/**
|
|
11624
11500
|
* Asynchronously returns a reference to the specified frame. The frame does not have to exist
|
|
@@ -11630,7 +11506,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11630
11506
|
* .then(frm => console.log('wrapped frame'))
|
|
11631
11507
|
* .catch(err => console.log(err));
|
|
11632
11508
|
* ```
|
|
11633
|
-
* @static
|
|
11634
11509
|
*/
|
|
11635
11510
|
async wrap(identity) {
|
|
11636
11511
|
this.wire.sendAction('frame-wrap').catch((e) => {
|
|
@@ -11652,7 +11527,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11652
11527
|
* const info = await frm.getInfo();
|
|
11653
11528
|
* console.log(info);
|
|
11654
11529
|
* ```
|
|
11655
|
-
* @static
|
|
11656
11530
|
*/
|
|
11657
11531
|
wrapSync(identity) {
|
|
11658
11532
|
this.wire.sendAction('frame-wrap-sync').catch((e) => {
|
|
@@ -11673,7 +11547,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11673
11547
|
* .then(frm => console.log('current frame'))
|
|
11674
11548
|
* .catch(err => console.log(err));
|
|
11675
11549
|
* ```
|
|
11676
|
-
* @static
|
|
11677
11550
|
*/
|
|
11678
11551
|
getCurrent() {
|
|
11679
11552
|
this.wire.sendAction('frame-get-current').catch((e) => {
|
|
@@ -11690,7 +11563,6 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11690
11563
|
* const info = await frm.getInfo();
|
|
11691
11564
|
* console.log(info);
|
|
11692
11565
|
* ```
|
|
11693
|
-
* @static
|
|
11694
11566
|
*/
|
|
11695
11567
|
getCurrentSync() {
|
|
11696
11568
|
this.wire.sendAction('frame-get-current-sync').catch((e) => {
|
|
@@ -11699,17 +11571,19 @@ class _FrameModule extends base_1$9.Base {
|
|
|
11699
11571
|
return new Instance_1$3._Frame(this.wire, this.wire.environment.getCurrentEntityIdentity());
|
|
11700
11572
|
}
|
|
11701
11573
|
}
|
|
11702
|
-
Factory$4.
|
|
11574
|
+
Factory$4._FrameModule = _FrameModule;
|
|
11703
11575
|
|
|
11704
11576
|
(function (exports) {
|
|
11705
11577
|
/**
|
|
11706
|
-
* Entry
|
|
11578
|
+
* Entry points for the OpenFin `Frame` API (`fin.Frame`).
|
|
11707
11579
|
*
|
|
11708
|
-
*
|
|
11709
|
-
*
|
|
11710
|
-
* instances of the OpenFin `Frame` class.
|
|
11580
|
+
* * {@link _FrameModule} contains static members of the `Frame` API, accessible through `fin.Frame`.
|
|
11581
|
+
* * {@link _Frame} describes an instance of an OpenFin Frame, e.g. as returned by `fin.Frame.getCurrent`.
|
|
11711
11582
|
*
|
|
11712
|
-
*
|
|
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
|
+
*
|
|
11586
|
+
* Underscore prefixing of OpenFin types that alias DOM entities will be fixed in a future version.
|
|
11713
11587
|
*
|
|
11714
11588
|
* @packageDocumentation
|
|
11715
11589
|
*/
|
|
@@ -11728,14 +11602,14 @@ Factory$4.default = _FrameModule;
|
|
|
11728
11602
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11729
11603
|
};
|
|
11730
11604
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11731
|
-
|
|
11732
|
-
exports
|
|
11733
|
-
__exportStar(Instance$3, exports);
|
|
11605
|
+
__exportStar(Factory$4, exports);
|
|
11606
|
+
__exportStar(Instance$3, exports);
|
|
11734
11607
|
} (frame));
|
|
11735
11608
|
|
|
11736
11609
|
var globalHotkey = {};
|
|
11737
11610
|
|
|
11738
11611
|
Object.defineProperty(globalHotkey, "__esModule", { value: true });
|
|
11612
|
+
globalHotkey.GlobalHotkey = void 0;
|
|
11739
11613
|
const base_1$8 = base;
|
|
11740
11614
|
/**
|
|
11741
11615
|
* The GlobalHotkey module can register/unregister a global hotkeys.
|
|
@@ -11865,7 +11739,7 @@ class GlobalHotkey extends base_1$8.EmitterBase {
|
|
|
11865
11739
|
return data;
|
|
11866
11740
|
}
|
|
11867
11741
|
}
|
|
11868
|
-
globalHotkey.
|
|
11742
|
+
globalHotkey.GlobalHotkey = GlobalHotkey;
|
|
11869
11743
|
|
|
11870
11744
|
var platform = {};
|
|
11871
11745
|
|
|
@@ -11888,10 +11762,8 @@ const validate_1$1 = validate;
|
|
|
11888
11762
|
const clientMap = new Map();
|
|
11889
11763
|
/** Manages the life cycle of windows and views in the application.
|
|
11890
11764
|
*
|
|
11891
|
-
* Enables taking snapshots of itself and
|
|
11892
|
-
* ng them to restore a previous configuration
|
|
11765
|
+
* Enables taking snapshots of itself and applying them to restore a previous configuration
|
|
11893
11766
|
* as well as listen to {@link OpenFin.PlatformEvents platform events}.
|
|
11894
|
-
*
|
|
11895
11767
|
*/
|
|
11896
11768
|
class Platform extends base_1$7.EmitterBase {
|
|
11897
11769
|
/**
|
|
@@ -12250,15 +12122,13 @@ class Platform extends base_1$7.EmitterBase {
|
|
|
12250
12122
|
});
|
|
12251
12123
|
}
|
|
12252
12124
|
/**
|
|
12253
|
-
* ***DEPRECATED - please use Platform.createView.***
|
|
12125
|
+
* ***DEPRECATED - please use {@link Platform.createView Platform.createView}.***
|
|
12254
12126
|
* Reparents a specified view in a new target window.
|
|
12255
12127
|
* @param viewIdentity View identity
|
|
12256
12128
|
* @param target new owner window identity
|
|
12257
12129
|
*
|
|
12258
|
-
* @tutorial Platform.createView
|
|
12259
12130
|
*/
|
|
12260
12131
|
async reparentView(viewIdentity, target) {
|
|
12261
|
-
var _a;
|
|
12262
12132
|
// eslint-disable-next-line no-console
|
|
12263
12133
|
console.warn('Platform.reparentView has been deprecated, please use Platform.createView');
|
|
12264
12134
|
this.wire.sendAction('platform-reparent-view', this.identity).catch((e) => {
|
|
@@ -12266,7 +12136,7 @@ class Platform extends base_1$7.EmitterBase {
|
|
|
12266
12136
|
});
|
|
12267
12137
|
const normalizedViewIdentity = {
|
|
12268
12138
|
...viewIdentity,
|
|
12269
|
-
uuid:
|
|
12139
|
+
uuid: viewIdentity.uuid ?? this.identity.uuid
|
|
12270
12140
|
};
|
|
12271
12141
|
const view = await this.fin.View.wrap(normalizedViewIdentity);
|
|
12272
12142
|
const viewOptions = await view.getOptions();
|
|
@@ -12749,6 +12619,138 @@ const base_1$6 = base;
|
|
|
12749
12619
|
const common_utils_1 = commonUtils;
|
|
12750
12620
|
const layout_entities_1 = layoutEntities;
|
|
12751
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
|
+
*/
|
|
12752
12754
|
class Layout extends base_1$6.Base {
|
|
12753
12755
|
/**
|
|
12754
12756
|
* @internal
|
|
@@ -12926,6 +12928,25 @@ class Layout extends base_1$6.Base {
|
|
|
12926
12928
|
target: this.identity
|
|
12927
12929
|
});
|
|
12928
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
|
+
}
|
|
12929
12950
|
/**
|
|
12930
12951
|
* Retrieves the top level content item of the layout.
|
|
12931
12952
|
*
|
|
@@ -12952,7 +12973,7 @@ class Layout extends base_1$6.Base {
|
|
|
12952
12973
|
// don't expose
|
|
12953
12974
|
});
|
|
12954
12975
|
const client = await __classPrivateFieldGet$5(this, _Layout_layoutClient, "f").getValue();
|
|
12955
|
-
const root = await client.getRoot();
|
|
12976
|
+
const root = await client.getRoot(this.identity);
|
|
12956
12977
|
return layout_entities_1.LayoutNode.getEntity(root, client);
|
|
12957
12978
|
}
|
|
12958
12979
|
}
|
|
@@ -12976,6 +12997,9 @@ Factory$2.LayoutModule = void 0;
|
|
|
12976
12997
|
/* eslint-disable no-undef, import/prefer-default-export */
|
|
12977
12998
|
const base_1$5 = base;
|
|
12978
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
|
+
*/
|
|
12979
13003
|
class LayoutModule extends base_1$5.Base {
|
|
12980
13004
|
constructor() {
|
|
12981
13005
|
super(...arguments);
|
|
@@ -13017,7 +13041,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13017
13041
|
* // the window must have been created with a layout in its window options
|
|
13018
13042
|
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
13019
13043
|
* ```
|
|
13020
|
-
* @static
|
|
13021
13044
|
*/
|
|
13022
13045
|
this.init = async (options = {}) => {
|
|
13023
13046
|
this.wire.sendAction('layout-init').catch((e) => {
|
|
@@ -13030,12 +13053,12 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13030
13053
|
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
13031
13054
|
}
|
|
13032
13055
|
__classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
|
|
13056
|
+
// TODO: remove this.wire and always use this.fin
|
|
13033
13057
|
return this.wire.environment.initLayout(this.fin, this.wire, options);
|
|
13034
13058
|
};
|
|
13035
13059
|
}
|
|
13036
13060
|
/**
|
|
13037
13061
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
13038
|
-
* @param identity
|
|
13039
13062
|
*
|
|
13040
13063
|
* @example
|
|
13041
13064
|
* ```js
|
|
@@ -13052,9 +13075,7 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13052
13075
|
* // Use wrapped instance to control layout, e.g.:
|
|
13053
13076
|
* const layoutConfig = await layout.getConfig();
|
|
13054
13077
|
* ```
|
|
13055
|
-
* @static
|
|
13056
13078
|
*/
|
|
13057
|
-
// eslint-disable-next-line class-methods-use-this
|
|
13058
13079
|
async wrap(identity) {
|
|
13059
13080
|
this.wire.sendAction('layout-wrap').catch((e) => {
|
|
13060
13081
|
// don't expose
|
|
@@ -13063,7 +13084,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13063
13084
|
}
|
|
13064
13085
|
/**
|
|
13065
13086
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
13066
|
-
* @param identity
|
|
13067
13087
|
*
|
|
13068
13088
|
* @example
|
|
13069
13089
|
* ```js
|
|
@@ -13080,9 +13100,7 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13080
13100
|
* // Use wrapped instance to control layout, e.g.:
|
|
13081
13101
|
* const layoutConfig = await layout.getConfig();
|
|
13082
13102
|
* ```
|
|
13083
|
-
* @static
|
|
13084
13103
|
*/
|
|
13085
|
-
// eslint-disable-next-line class-methods-use-this
|
|
13086
13104
|
wrapSync(identity) {
|
|
13087
13105
|
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
|
13088
13106
|
// don't expose
|
|
@@ -13098,7 +13116,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13098
13116
|
* // Use wrapped instance to control layout, e.g.:
|
|
13099
13117
|
* const layoutConfig = await layout.getConfig();
|
|
13100
13118
|
* ```
|
|
13101
|
-
* @static
|
|
13102
13119
|
*/
|
|
13103
13120
|
async getCurrent() {
|
|
13104
13121
|
this.wire.sendAction('layout-get-current').catch((e) => {
|
|
@@ -13122,7 +13139,6 @@ class LayoutModule extends base_1$5.Base {
|
|
|
13122
13139
|
* // Use wrapped instance to control layout, e.g.:
|
|
13123
13140
|
* const layoutConfig = await layout.getConfig();
|
|
13124
13141
|
* ```
|
|
13125
|
-
* @static
|
|
13126
13142
|
*/
|
|
13127
13143
|
getCurrentSync() {
|
|
13128
13144
|
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
|
@@ -13140,139 +13156,16 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
|
13140
13156
|
|
|
13141
13157
|
(function (exports) {
|
|
13142
13158
|
/**
|
|
13143
|
-
* Entry point for the OpenFin Layout
|
|
13144
|
-
*
|
|
13145
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "LayoutModule" is used for
|
|
13146
|
-
* the module containing static members of the `Layout` namespace (available under `fin.Platform.Layout`), while `Layout` documents
|
|
13147
|
-
* instances of the OpenFin `Layout` class.
|
|
13148
|
-
*
|
|
13149
|
-
* @packageDocumentation
|
|
13150
|
-
*
|
|
13151
|
-
*
|
|
13152
|
-
* ### Layout.DOMEvents
|
|
13153
|
-
*
|
|
13154
|
-
* When a Layout is created, it emits events onto the DOM element representing the Layout container.
|
|
13155
|
-
* This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
|
|
13156
|
-
* 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).
|
|
13157
|
-
* The events are emitted synchronously and only in the process where the Layout exists.
|
|
13158
|
-
* Any values returned by the called listeners are ignored and will be discarded.
|
|
13159
|
-
* If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
|
|
13160
|
-
*
|
|
13161
|
-
* @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
|
|
13162
|
-
*
|
|
13163
|
-
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
|
|
13164
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
13165
|
-
* @example
|
|
13166
|
-
* ```js
|
|
13167
|
-
* const myLayoutContainer = document.getElementById('layout-container');
|
|
13159
|
+
* Entry point for the OpenFin `Layout` subset of the `Platform` API (`fin.Platform.Layout`).
|
|
13168
13160
|
*
|
|
13169
|
-
*
|
|
13170
|
-
*
|
|
13171
|
-
* const tabElement = document.getElementById(tabSelector);
|
|
13172
|
-
* const existingColor = tabElement.style.backgroundColor;
|
|
13173
|
-
* tabElement.style.backgroundColor = "red";
|
|
13174
|
-
* setTimeout(() => {
|
|
13175
|
-
* tabElement.style.backgroundColor = existingColor;
|
|
13176
|
-
* }, 2000);
|
|
13177
|
-
* });
|
|
13178
|
-
* ```
|
|
13179
|
-
*
|
|
13180
|
-
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
|
|
13181
|
-
* Adds a listener to the end of the listeners array for the specified event.
|
|
13182
|
-
* @example
|
|
13183
|
-
* ```js
|
|
13184
|
-
* const myLayoutContainer = document.getElementById('layout-container');
|
|
13185
|
-
*
|
|
13186
|
-
* const listener = function(event) {
|
|
13187
|
-
* console.log(event.detail);
|
|
13188
|
-
* console.log('container-created event fired once, removing listener');
|
|
13189
|
-
* myLayoutContainer.removeEventListener('container-created', listener);
|
|
13190
|
-
* };
|
|
13191
|
-
*
|
|
13192
|
-
* myLayoutContainer.addEventListener('container-created', listener);
|
|
13193
|
-
* ```
|
|
13194
|
-
*
|
|
13195
|
-
* ### Supported event types are:
|
|
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`.
|
|
13196
13163
|
*
|
|
13197
|
-
*
|
|
13198
|
-
*
|
|
13199
|
-
* * layout-state-changed
|
|
13200
|
-
* * tab-closed
|
|
13201
|
-
* * tab-dropped
|
|
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.
|
|
13202
13166
|
*
|
|
13203
|
-
*
|
|
13204
|
-
*
|
|
13205
|
-
* #### tab-created
|
|
13206
|
-
* 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.
|
|
13207
|
-
* ```js
|
|
13208
|
-
* // The response has the following shape in event.detail:
|
|
13209
|
-
* {
|
|
13210
|
-
* containerSelector: "container-component_A",
|
|
13211
|
-
* name: "component_A",
|
|
13212
|
-
* tabSelector: "tab-component_A",
|
|
13213
|
-
* topic: "openfin-DOM-event",
|
|
13214
|
-
* type: "tab-created",
|
|
13215
|
-
* uuid: "OpenFin POC"
|
|
13216
|
-
* }
|
|
13217
|
-
* ```
|
|
13218
|
-
*
|
|
13219
|
-
* #### container-created
|
|
13220
|
-
* 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.
|
|
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: "container-created",
|
|
13229
|
-
* uuid: "OpenFin POC"
|
|
13230
|
-
* }
|
|
13231
|
-
* ```
|
|
13232
|
-
*
|
|
13233
|
-
* ### layout-state-changed
|
|
13234
|
-
* 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.
|
|
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: "layout-state-changed",
|
|
13243
|
-
* uuid: "OpenFin POC"
|
|
13244
|
-
* }
|
|
13245
|
-
* ```
|
|
13246
|
-
*
|
|
13247
|
-
* #### tab-closed
|
|
13248
|
-
* Generated when a tab is closed.
|
|
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: "tab-closed",
|
|
13257
|
-
* uuid: "OpenFin POC",
|
|
13258
|
-
* url: "http://openfin.co" // The url of the view that was closed.
|
|
13259
|
-
* }
|
|
13260
|
-
* ```
|
|
13167
|
+
* @packageDocumentation
|
|
13261
13168
|
*
|
|
13262
|
-
* #### tab-dropped
|
|
13263
|
-
* Generated when a tab is dropped.
|
|
13264
|
-
* ```js
|
|
13265
|
-
* // The response has the following shape in event.detail:
|
|
13266
|
-
* {
|
|
13267
|
-
* containerSelector: "container-component_A",
|
|
13268
|
-
* name: "component_A",
|
|
13269
|
-
* tabSelector: "tab-component_A",
|
|
13270
|
-
* topic: "openfin-DOM-event",
|
|
13271
|
-
* type: "tab-dropped",
|
|
13272
|
-
* uuid: "OpenFin POC",
|
|
13273
|
-
* url: "http://openfin.co" // The url of the view linked to the dropped tab.
|
|
13274
|
-
* }
|
|
13275
|
-
* ```
|
|
13276
13169
|
*/
|
|
13277
13170
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13278
13171
|
if (k2 === undefined) k2 = k;
|
|
@@ -13290,13 +13183,17 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
|
13290
13183
|
};
|
|
13291
13184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13292
13185
|
__exportStar(Factory$2, exports);
|
|
13293
|
-
__exportStar(Instance$1, exports);
|
|
13186
|
+
__exportStar(Instance$1, exports);
|
|
13294
13187
|
} (layout));
|
|
13295
13188
|
|
|
13296
13189
|
Object.defineProperty(Factory$3, "__esModule", { value: true });
|
|
13190
|
+
Factory$3.PlatformModule = void 0;
|
|
13297
13191
|
const base_1$4 = base;
|
|
13298
13192
|
const Instance_1$1 = Instance$2;
|
|
13299
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
|
+
*/
|
|
13300
13197
|
class PlatformModule extends base_1$4.Base {
|
|
13301
13198
|
/**
|
|
13302
13199
|
* @internal
|
|
@@ -13362,14 +13259,12 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13362
13259
|
* fin.Platform.init({overrideCallback});
|
|
13363
13260
|
* ```
|
|
13364
13261
|
* @experimental
|
|
13365
|
-
* @static
|
|
13366
13262
|
*/
|
|
13367
13263
|
async init(options) {
|
|
13368
13264
|
return this.wire.environment.initPlatform(this.fin, options);
|
|
13369
13265
|
}
|
|
13370
13266
|
/**
|
|
13371
13267
|
* Asynchronously returns a Platform object that represents an existing platform.
|
|
13372
|
-
* @param identity
|
|
13373
13268
|
*
|
|
13374
13269
|
* @example
|
|
13375
13270
|
* ```js
|
|
@@ -13378,7 +13273,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13378
13273
|
* // Use wrapped instance to control layout, e.g.:
|
|
13379
13274
|
* const snapshot = await platform.getSnapshot();
|
|
13380
13275
|
* ```
|
|
13381
|
-
* @static
|
|
13382
13276
|
*/
|
|
13383
13277
|
async wrap(identity) {
|
|
13384
13278
|
this.wire.sendAction('platform-wrap').catch((e) => {
|
|
@@ -13388,7 +13282,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13388
13282
|
}
|
|
13389
13283
|
/**
|
|
13390
13284
|
* Synchronously returns a Platform object that represents an existing platform.
|
|
13391
|
-
* @param identity
|
|
13392
13285
|
*
|
|
13393
13286
|
* @example
|
|
13394
13287
|
* ```js
|
|
@@ -13397,7 +13290,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13397
13290
|
* // Use wrapped instance to control layout, e.g.:
|
|
13398
13291
|
* const snapshot = await platform.getSnapshot();
|
|
13399
13292
|
* ```
|
|
13400
|
-
* @static
|
|
13401
13293
|
*/
|
|
13402
13294
|
wrapSync(identity) {
|
|
13403
13295
|
this.wire.sendAction('platform-wrap-sync').catch((e) => {
|
|
@@ -13414,7 +13306,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13414
13306
|
* // Use wrapped instance to control layout, e.g.:
|
|
13415
13307
|
* const snapshot = await platform.getSnapshot();
|
|
13416
13308
|
* ```
|
|
13417
|
-
* @static
|
|
13418
13309
|
*/
|
|
13419
13310
|
async getCurrent() {
|
|
13420
13311
|
this.wire.sendAction('platform-get-current').catch((e) => {
|
|
@@ -13431,7 +13322,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13431
13322
|
* // Use wrapped instance to control layout, e.g.:
|
|
13432
13323
|
* const snapshot = await platform.getSnapshot();
|
|
13433
13324
|
* ```
|
|
13434
|
-
* @static
|
|
13435
13325
|
*/
|
|
13436
13326
|
getCurrentSync() {
|
|
13437
13327
|
this.wire.sendAction('platform-get-current-sync').catch((e) => {
|
|
@@ -13442,7 +13332,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13442
13332
|
/**
|
|
13443
13333
|
* Creates and starts a Platform and returns a wrapped and running Platform instance. The wrapped Platform methods can
|
|
13444
13334
|
* be used to launch content into the platform. Promise will reject if the platform is already running.
|
|
13445
|
-
* @param platformOptions
|
|
13446
13335
|
*
|
|
13447
13336
|
* @example
|
|
13448
13337
|
* ```js
|
|
@@ -13463,7 +13352,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13463
13352
|
* console.error(e);
|
|
13464
13353
|
* }
|
|
13465
13354
|
* ```
|
|
13466
|
-
* @static
|
|
13467
13355
|
*/
|
|
13468
13356
|
start(platformOptions) {
|
|
13469
13357
|
this.wire.sendAction('platform-start').catch((e) => {
|
|
@@ -13508,7 +13396,6 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13508
13396
|
* console.error(e);
|
|
13509
13397
|
* }
|
|
13510
13398
|
* ```
|
|
13511
|
-
* @static
|
|
13512
13399
|
*/
|
|
13513
13400
|
startFromManifest(manifestUrl, opts) {
|
|
13514
13401
|
this.wire.sendAction('platform-start-from-manifest').catch((e) => {
|
|
@@ -13531,18 +13418,9 @@ class PlatformModule extends base_1$4.Base {
|
|
|
13531
13418
|
});
|
|
13532
13419
|
}
|
|
13533
13420
|
}
|
|
13534
|
-
Factory$3.
|
|
13421
|
+
Factory$3.PlatformModule = PlatformModule;
|
|
13535
13422
|
|
|
13536
13423
|
(function (exports) {
|
|
13537
|
-
/**
|
|
13538
|
-
* Entry point for the OpenFin Platform namespace.
|
|
13539
|
-
*
|
|
13540
|
-
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "PlatformModule" is used for
|
|
13541
|
-
* the module containing static members of the `Platform` namespace (available under `fin.Platform`), while `Platform` documents
|
|
13542
|
-
* instances of the OpenFin `Platform` class.
|
|
13543
|
-
*
|
|
13544
|
-
* @packageDocumentation
|
|
13545
|
-
*/
|
|
13546
13424
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13547
13425
|
if (k2 === undefined) k2 = k;
|
|
13548
13426
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -13558,9 +13436,19 @@ Factory$3.default = PlatformModule;
|
|
|
13558
13436
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
13559
13437
|
};
|
|
13560
13438
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13439
|
+
/**
|
|
13440
|
+
* Entry points for the OpenFin `Platform` API (`fin.Platform`)
|
|
13441
|
+
*
|
|
13442
|
+
* * {@link PlatformModule} contains static members of the `Platform` API, accessible through `fin.Platform`.
|
|
13443
|
+
* * {@link Platform} describes an instance of an OpenFin Platform, e.g. as returned by `fin.Platform.getCurrent`.
|
|
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
|
+
*
|
|
13448
|
+
* @packageDocumentation
|
|
13449
|
+
*/
|
|
13450
|
+
__exportStar(Factory$3, exports);
|
|
13451
|
+
__exportStar(Instance$2, exports);
|
|
13564
13452
|
} (platform));
|
|
13565
13453
|
|
|
13566
13454
|
var me = {};
|
|
@@ -13698,7 +13586,7 @@ var me = {};
|
|
|
13698
13586
|
};
|
|
13699
13587
|
}
|
|
13700
13588
|
}
|
|
13701
|
-
exports.getMe = getMe;
|
|
13589
|
+
exports.getMe = getMe;
|
|
13702
13590
|
} (me));
|
|
13703
13591
|
|
|
13704
13592
|
var interop = {};
|
|
@@ -13801,9 +13689,8 @@ function requireSessionContextGroupBroker () {
|
|
|
13801
13689
|
this.lastContext = context;
|
|
13802
13690
|
const clientSubscriptionStates = Array.from(this.clients.values());
|
|
13803
13691
|
clientSubscriptionStates.forEach((client) => {
|
|
13804
|
-
var _a;
|
|
13805
13692
|
// eslint-disable-next-line no-unused-expressions
|
|
13806
|
-
|
|
13693
|
+
client.contextHandlers.get(context.type)?.forEach((handlerId) => {
|
|
13807
13694
|
this.provider.dispatch(client.clientIdentity, handlerId, context);
|
|
13808
13695
|
});
|
|
13809
13696
|
if (client.globalHandler) {
|
|
@@ -13937,7 +13824,7 @@ var utils$1 = {};
|
|
|
13937
13824
|
}
|
|
13938
13825
|
};
|
|
13939
13826
|
};
|
|
13940
|
-
exports.wrapIntentHandler = wrapIntentHandler;
|
|
13827
|
+
exports.wrapIntentHandler = wrapIntentHandler;
|
|
13941
13828
|
} (utils$1));
|
|
13942
13829
|
|
|
13943
13830
|
var PrivateChannelProvider = {};
|
|
@@ -14410,10 +14297,10 @@ function requireInteropBroker () {
|
|
|
14410
14297
|
this.getProvider = getProvider;
|
|
14411
14298
|
this.interopClients = new Map();
|
|
14412
14299
|
this.contextGroupsById = new Map();
|
|
14413
|
-
if (options
|
|
14300
|
+
if (options?.contextGroups) {
|
|
14414
14301
|
contextGroups = options.contextGroups;
|
|
14415
14302
|
}
|
|
14416
|
-
if (options
|
|
14303
|
+
if (options?.logging) {
|
|
14417
14304
|
this.logging = options.logging;
|
|
14418
14305
|
}
|
|
14419
14306
|
this.intentClientMap = new Map();
|
|
@@ -14548,18 +14435,17 @@ function requireInteropBroker () {
|
|
|
14548
14435
|
*
|
|
14549
14436
|
*/
|
|
14550
14437
|
getCurrentContext(getCurrentContextOptions, clientIdentity) {
|
|
14551
|
-
var _a;
|
|
14552
14438
|
this.wire.sendAction('interop-broker-get-current-context').catch((e) => {
|
|
14553
14439
|
// don't expose, analytics-only call
|
|
14554
14440
|
});
|
|
14555
14441
|
const clientState = this.getClientState(clientIdentity);
|
|
14556
|
-
if (!
|
|
14442
|
+
if (!clientState?.contextGroupId) {
|
|
14557
14443
|
throw new Error('You must be a member of a context group to call getCurrentContext');
|
|
14558
14444
|
}
|
|
14559
14445
|
const { contextGroupId } = clientState;
|
|
14560
14446
|
const contextGroupState = this.contextGroupsById.get(contextGroupId);
|
|
14561
14447
|
const lastContextType = this.lastContextMap.get(contextGroupId);
|
|
14562
|
-
const contextType =
|
|
14448
|
+
const contextType = getCurrentContextOptions?.contextType ?? lastContextType;
|
|
14563
14449
|
return contextGroupState && contextType ? contextGroupState.get(contextType) : undefined;
|
|
14564
14450
|
}
|
|
14565
14451
|
/*
|
|
@@ -14807,7 +14693,8 @@ function requireInteropBroker () {
|
|
|
14807
14693
|
* ```
|
|
14808
14694
|
*/
|
|
14809
14695
|
// eslint-disable-next-line class-methods-use-this
|
|
14810
|
-
async handleFiredIntent(intent, clientIdentity)
|
|
14696
|
+
async handleFiredIntent(intent, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14697
|
+
) {
|
|
14811
14698
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.raiseIntent', 'InteropBroker.handleFiredIntent', clientIdentity, 'interopClient.fireIntent');
|
|
14812
14699
|
console.warn(warning);
|
|
14813
14700
|
throw new Error(utils_1.BROKER_ERRORS.fireIntent);
|
|
@@ -14874,7 +14761,7 @@ function requireInteropBroker () {
|
|
|
14874
14761
|
* More information on the AppIntent type can be found in the [FDC3 documentation](https://fdc3.finos.org/docs/api/ref/AppIntent).
|
|
14875
14762
|
*
|
|
14876
14763
|
* @param options
|
|
14877
|
-
* @param
|
|
14764
|
+
* @param clientIdentity Identity of the Client making the request.
|
|
14878
14765
|
*
|
|
14879
14766
|
* @example
|
|
14880
14767
|
* ```js
|
|
@@ -14891,7 +14778,8 @@ function requireInteropBroker () {
|
|
|
14891
14778
|
* ```
|
|
14892
14779
|
*/
|
|
14893
14780
|
// eslint-disable-next-line class-methods-use-this
|
|
14894
|
-
async handleInfoForIntent(options, clientIdentity)
|
|
14781
|
+
async handleInfoForIntent(options, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14782
|
+
) {
|
|
14895
14783
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntent', 'InteropBroker.handleInfoForIntent', clientIdentity, 'interopClient.getInfoForIntent');
|
|
14896
14784
|
console.warn(warning);
|
|
14897
14785
|
throw new Error(utils_1.BROKER_ERRORS.getInfoForIntent);
|
|
@@ -14937,7 +14825,8 @@ function requireInteropBroker () {
|
|
|
14937
14825
|
* ```
|
|
14938
14826
|
*/
|
|
14939
14827
|
// eslint-disable-next-line class-methods-use-this
|
|
14940
|
-
async handleInfoForIntentsByContext(context, clientIdentity)
|
|
14828
|
+
async handleInfoForIntentsByContext(context, clientIdentity // TODO(CORE-811): remove inline intersected type
|
|
14829
|
+
) {
|
|
14941
14830
|
const warning = (0, utils_1.generateOverrideWarning)('fdc3.findIntentsByContext', 'InteropBroker.handleInfoForIntentsByContext', clientIdentity, 'interopClient.getInfoForIntentsByContext');
|
|
14942
14831
|
console.warn(warning);
|
|
14943
14832
|
throw new Error(utils_1.BROKER_ERRORS.getInfoForIntentsByContext);
|
|
@@ -14963,7 +14852,7 @@ function requireInteropBroker () {
|
|
|
14963
14852
|
* More information on the IntentResolution type can be found in the [FDC3 documentation](https://fdc3.finos.org/docs/api/ref/IntentResolution).
|
|
14964
14853
|
*
|
|
14965
14854
|
* @param contextForIntent Data passed between entities and applications.
|
|
14966
|
-
* @param
|
|
14855
|
+
* @param clientIdentity Identity of the Client making the request.
|
|
14967
14856
|
*
|
|
14968
14857
|
* @example
|
|
14969
14858
|
* ```js
|
|
@@ -15024,7 +14913,7 @@ function requireInteropBroker () {
|
|
|
15024
14913
|
/**
|
|
15025
14914
|
* Responsible for resolving the fdc3.findInstances call.
|
|
15026
14915
|
* Must be overridden
|
|
15027
|
-
* @param
|
|
14916
|
+
* @param app AppIdentifier that was passed to fdc3.findInstances
|
|
15028
14917
|
* @param clientIdentity Identity of the Client making the request.
|
|
15029
14918
|
*/
|
|
15030
14919
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -15059,7 +14948,7 @@ function requireInteropBroker () {
|
|
|
15059
14948
|
* fin.Platform.init({
|
|
15060
14949
|
* interopOverride: async (InteropBroker) => {
|
|
15061
14950
|
* class Override extends InteropBroker {
|
|
15062
|
-
* async invokeContextHandler(
|
|
14951
|
+
* async invokeContextHandler(clientIdentity, handlerId, context) {
|
|
15063
14952
|
* return super.invokeContextHandler(clientIdentity, handlerId, {
|
|
15064
14953
|
* ...context,
|
|
15065
14954
|
* contextMetadata: {
|
|
@@ -15099,7 +14988,7 @@ function requireInteropBroker () {
|
|
|
15099
14988
|
* fin.Platform.init({
|
|
15100
14989
|
* interopOverride: async (InteropBroker) => {
|
|
15101
14990
|
* class Override extends InteropBroker {
|
|
15102
|
-
* async invokeIntentHandler(
|
|
14991
|
+
* async invokeIntentHandler(clientIdentity, handlerId, context) {
|
|
15103
14992
|
* const { context } = intent;
|
|
15104
14993
|
* return super.invokeIntentHandler(clientIdentity, handlerId, {
|
|
15105
14994
|
* ...intent,
|
|
@@ -15207,10 +15096,9 @@ function requireInteropBroker () {
|
|
|
15207
15096
|
}
|
|
15208
15097
|
// Used to restore interop broker state in snapshots.
|
|
15209
15098
|
applySnapshot(snapshot, options) {
|
|
15210
|
-
|
|
15211
|
-
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;
|
|
15212
15100
|
if (contextGroupStates) {
|
|
15213
|
-
if (!
|
|
15101
|
+
if (!options?.closeExistingWindows) {
|
|
15214
15102
|
this.updateExistingClients(contextGroupStates);
|
|
15215
15103
|
}
|
|
15216
15104
|
this.rehydrateContextGroupStates(contextGroupStates);
|
|
@@ -15261,7 +15149,7 @@ function requireInteropBroker () {
|
|
|
15261
15149
|
contextHandlerRegistered({ contextType, handlerId }, clientIdentity) {
|
|
15262
15150
|
const handlerInfo = { contextType, handlerId };
|
|
15263
15151
|
const clientState = this.getClientState(clientIdentity);
|
|
15264
|
-
clientState
|
|
15152
|
+
clientState?.contextHandlers.set(handlerId, handlerInfo);
|
|
15265
15153
|
if (clientState && clientState.contextGroupId) {
|
|
15266
15154
|
const { contextGroupId } = clientState;
|
|
15267
15155
|
const contextGroupMap = this.contextGroupsById.get(contextGroupId);
|
|
@@ -15283,7 +15171,7 @@ function requireInteropBroker () {
|
|
|
15283
15171
|
async intentHandlerRegistered(payload, clientIdentity) {
|
|
15284
15172
|
const { handlerId } = payload;
|
|
15285
15173
|
const clientIntentInfo = this.intentClientMap.get(clientIdentity.name);
|
|
15286
|
-
const handlerInfo = clientIntentInfo
|
|
15174
|
+
const handlerInfo = clientIntentInfo?.get(handlerId);
|
|
15287
15175
|
if (!clientIntentInfo) {
|
|
15288
15176
|
this.intentClientMap.set(clientIdentity.name, new Map());
|
|
15289
15177
|
const newHandlerInfoMap = this.intentClientMap.get(clientIdentity.name);
|
|
@@ -15438,7 +15326,8 @@ function requireInteropBroker () {
|
|
|
15438
15326
|
}
|
|
15439
15327
|
// Setup Channel Connection Logic
|
|
15440
15328
|
wireChannel(channel) {
|
|
15441
|
-
channel.onConnection(async (clientIdentity,
|
|
15329
|
+
channel.onConnection(async (clientIdentity, // TODO(CORE-811): remove inline intersected type
|
|
15330
|
+
payload) => {
|
|
15442
15331
|
if (!(await this.isConnectionAuthorized(clientIdentity, payload))) {
|
|
15443
15332
|
throw new Error(`Connection not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
|
|
15444
15333
|
}
|
|
@@ -15451,8 +15340,8 @@ function requireInteropBroker () {
|
|
|
15451
15340
|
clientIdentity
|
|
15452
15341
|
};
|
|
15453
15342
|
// Only allow the client to join a contextGroup that actually exists.
|
|
15454
|
-
if (
|
|
15455
|
-
clientSubscriptionState.contextGroupId = payload
|
|
15343
|
+
if (payload?.currentContextGroup && this.contextGroupsById.has(payload.currentContextGroup)) {
|
|
15344
|
+
clientSubscriptionState.contextGroupId = payload?.currentContextGroup;
|
|
15456
15345
|
}
|
|
15457
15346
|
this.interopClients.set(clientIdentity.endpointId, clientSubscriptionState);
|
|
15458
15347
|
});
|
|
@@ -15470,17 +15359,15 @@ function requireInteropBroker () {
|
|
|
15470
15359
|
this.clientDisconnected(clientIdentity);
|
|
15471
15360
|
});
|
|
15472
15361
|
channel.beforeAction(async (action, payload, clientIdentity) => {
|
|
15473
|
-
var _a, _b;
|
|
15474
15362
|
if (!(await this.isActionAuthorized(action, payload, clientIdentity))) {
|
|
15475
15363
|
throw new Error(`Action (${action}) not authorized for ${clientIdentity.uuid}, ${clientIdentity.name}`);
|
|
15476
15364
|
}
|
|
15477
|
-
if (
|
|
15365
|
+
if (this.logging?.beforeAction?.enabled) {
|
|
15478
15366
|
console.log(action, payload, clientIdentity);
|
|
15479
15367
|
}
|
|
15480
15368
|
});
|
|
15481
15369
|
channel.afterAction((action, payload, clientIdentity) => {
|
|
15482
|
-
|
|
15483
|
-
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) {
|
|
15484
15371
|
console.log(action, payload, clientIdentity);
|
|
15485
15372
|
}
|
|
15486
15373
|
});
|
|
@@ -16329,9 +16216,8 @@ function requireOverrideCheck () {
|
|
|
16329
16216
|
overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
|
|
16330
16217
|
const InteropBroker_1 = requireInteropBroker();
|
|
16331
16218
|
function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
|
|
16332
|
-
|
|
16333
|
-
|
|
16334
|
-
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;
|
|
16335
16221
|
}
|
|
16336
16222
|
overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
|
|
16337
16223
|
// TODO: Unit test this
|
|
@@ -16365,6 +16251,7 @@ function requireFactory () {
|
|
|
16365
16251
|
if (hasRequiredFactory) return Factory$1;
|
|
16366
16252
|
hasRequiredFactory = 1;
|
|
16367
16253
|
Object.defineProperty(Factory$1, "__esModule", { value: true });
|
|
16254
|
+
Factory$1.InteropModule = void 0;
|
|
16368
16255
|
const lodash_1 = require$$3;
|
|
16369
16256
|
const inaccessibleObject_1 = inaccessibleObject;
|
|
16370
16257
|
const base_1 = base;
|
|
@@ -16401,16 +16288,14 @@ function requireFactory () {
|
|
|
16401
16288
|
* const contextGroups = await interopBroker.getContextGroups();
|
|
16402
16289
|
* console.log(contextGroups);
|
|
16403
16290
|
* ```
|
|
16404
|
-
* @static
|
|
16405
16291
|
*/
|
|
16406
16292
|
async init(name, override = defaultOverride) {
|
|
16407
|
-
var _a;
|
|
16408
16293
|
this.wire.sendAction('interop-init').catch(() => {
|
|
16409
16294
|
// don't expose, analytics-only call
|
|
16410
16295
|
});
|
|
16411
16296
|
// Allows for manifest-level configuration, without having to override. (e.g. specifying custom context groups)
|
|
16412
16297
|
const options = await this.fin.Application.getCurrentSync().getInfo();
|
|
16413
|
-
const opts =
|
|
16298
|
+
const opts = options.initialOptions.interopBrokerConfiguration ?? {};
|
|
16414
16299
|
const objectThatThrows = (0, inaccessibleObject_1.createUnusableObject)(BrokerParamAccessError);
|
|
16415
16300
|
const warningOptsClone = (0, inaccessibleObject_1.createWarningObject)(BrokerParamAccessError, (0, lodash_1.cloneDeep)(opts));
|
|
16416
16301
|
let provider;
|
|
@@ -16459,7 +16344,6 @@ function requireFactory () {
|
|
|
16459
16344
|
* const contextGroupInfo = await client.getInfoForContextGroup();
|
|
16460
16345
|
* console.log(contextGroupInfo);
|
|
16461
16346
|
* ```
|
|
16462
|
-
* @static
|
|
16463
16347
|
*/
|
|
16464
16348
|
connectSync(name, interopConfig) {
|
|
16465
16349
|
this.wire.sendAction('interop-connect-sync').catch(() => {
|
|
@@ -16468,7 +16352,7 @@ function requireFactory () {
|
|
|
16468
16352
|
return new InteropClient_1.InteropClient(this.wire, name, interopConfig);
|
|
16469
16353
|
}
|
|
16470
16354
|
}
|
|
16471
|
-
Factory$1.
|
|
16355
|
+
Factory$1.InteropModule = InteropModule;
|
|
16472
16356
|
return Factory$1;
|
|
16473
16357
|
}
|
|
16474
16358
|
|
|
@@ -16479,10 +16363,10 @@ function requireInterop () {
|
|
|
16479
16363
|
hasRequiredInterop = 1;
|
|
16480
16364
|
(function (exports) {
|
|
16481
16365
|
/**
|
|
16482
|
-
* Entry point for the OpenFin Interop
|
|
16366
|
+
* Entry point for the OpenFin `Interop` API (`fin.Interop`).
|
|
16483
16367
|
*
|
|
16484
|
-
*
|
|
16485
|
-
*
|
|
16368
|
+
* * {@link InteropModule} contains static members of the `Interop` API (available under `fin.Interop`)
|
|
16369
|
+
* * {@link InteropClient} and {@link InteropBroker} document instances of their respective classes.
|
|
16486
16370
|
*
|
|
16487
16371
|
* @packageDocumentation
|
|
16488
16372
|
*/
|
|
@@ -16501,11 +16385,10 @@ function requireInterop () {
|
|
|
16501
16385
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16502
16386
|
};
|
|
16503
16387
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16504
|
-
|
|
16505
|
-
exports.default = Factory_1.default;
|
|
16388
|
+
__exportStar(requireFactory(), exports);
|
|
16506
16389
|
__exportStar(InteropClient$1, exports);
|
|
16507
|
-
__exportStar(requireInteropBroker(), exports);
|
|
16508
|
-
} (interop));
|
|
16390
|
+
__exportStar(requireInteropBroker(), exports);
|
|
16391
|
+
} (interop));
|
|
16509
16392
|
return interop;
|
|
16510
16393
|
}
|
|
16511
16394
|
|
|
@@ -16544,6 +16427,8 @@ const connectionMap = new Map();
|
|
|
16544
16427
|
/**
|
|
16545
16428
|
* Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.
|
|
16546
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.
|
|
16547
16432
|
*/
|
|
16548
16433
|
class SnapshotSource extends base_1$1.Base {
|
|
16549
16434
|
/**
|
|
@@ -16678,13 +16563,19 @@ Instance.SnapshotSource = SnapshotSource;
|
|
|
16678
16563
|
_SnapshotSource_identity = new WeakMap(), _SnapshotSource_getConnection = new WeakMap(), _SnapshotSource_getClient = new WeakMap(), _SnapshotSource_startConnection = new WeakMap(), _SnapshotSource_setUpConnectionListener = new WeakMap();
|
|
16679
16564
|
|
|
16680
16565
|
Object.defineProperty(Factory, "__esModule", { value: true });
|
|
16566
|
+
Factory.SnapshotSourceModule = void 0;
|
|
16681
16567
|
const base_1 = base;
|
|
16682
16568
|
const Instance_1 = Instance;
|
|
16683
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
|
+
*/
|
|
16684
16573
|
class SnapshotSourceModule extends base_1.Base {
|
|
16685
16574
|
/**
|
|
16686
16575
|
* Initializes a SnapshotSource with the getSnapshot and applySnapshot methods defined.
|
|
16687
|
-
*
|
|
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.
|
|
16688
16579
|
*
|
|
16689
16580
|
* @example
|
|
16690
16581
|
* ```js
|
|
@@ -16701,7 +16592,7 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16701
16592
|
*
|
|
16702
16593
|
* await fin.SnapshotSource.init(snapshotProvider);
|
|
16703
16594
|
* ```
|
|
16704
|
-
*
|
|
16595
|
+
*
|
|
16705
16596
|
*/
|
|
16706
16597
|
async init(provider) {
|
|
16707
16598
|
this.wire.sendAction('snapshot-source-init').catch((e) => {
|
|
@@ -16721,7 +16612,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16721
16612
|
}
|
|
16722
16613
|
/**
|
|
16723
16614
|
* Synchronously returns a SnapshotSource object that represents the current SnapshotSource.
|
|
16724
|
-
* @param identity
|
|
16725
16615
|
*
|
|
16726
16616
|
* @example
|
|
16727
16617
|
* ```js
|
|
@@ -16729,7 +16619,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16729
16619
|
* // Use wrapped instance's getSnapshot method, e.g.:
|
|
16730
16620
|
* const snapshot = await snapshotSource.getSnapshot();
|
|
16731
16621
|
* ```
|
|
16732
|
-
* @static
|
|
16733
16622
|
*/
|
|
16734
16623
|
wrapSync(identity) {
|
|
16735
16624
|
this.wire.sendAction('snapshot-source-wrap-sync').catch((e) => {
|
|
@@ -16739,7 +16628,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16739
16628
|
}
|
|
16740
16629
|
/**
|
|
16741
16630
|
* Asynchronously returns a SnapshotSource object that represents the current SnapshotSource.
|
|
16742
|
-
* @param identity
|
|
16743
16631
|
*
|
|
16744
16632
|
* @example
|
|
16745
16633
|
* ```js
|
|
@@ -16747,7 +16635,6 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16747
16635
|
* // Use wrapped instance's getSnapshot method, e.g.:
|
|
16748
16636
|
* const snapshot = await snapshotSource.getSnapshot();
|
|
16749
16637
|
* ```
|
|
16750
|
-
* @static
|
|
16751
16638
|
*/
|
|
16752
16639
|
async wrap(identity) {
|
|
16753
16640
|
this.wire.sendAction('snapshot-source-wrap').catch((e) => {
|
|
@@ -16756,15 +16643,17 @@ class SnapshotSourceModule extends base_1.Base {
|
|
|
16756
16643
|
return this.wrapSync(identity);
|
|
16757
16644
|
}
|
|
16758
16645
|
}
|
|
16759
|
-
Factory.
|
|
16646
|
+
Factory.SnapshotSourceModule = SnapshotSourceModule;
|
|
16760
16647
|
|
|
16761
16648
|
(function (exports) {
|
|
16762
16649
|
/**
|
|
16763
|
-
* Entry
|
|
16650
|
+
* Entry points for the OpenFin `SnapshotSource` API (`fin.SnapshotSource`).
|
|
16651
|
+
*
|
|
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`.
|
|
16764
16654
|
*
|
|
16765
|
-
*
|
|
16766
|
-
*
|
|
16767
|
-
* instances of the OpenFin `SnapshotSource` class.
|
|
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.
|
|
16768
16657
|
*
|
|
16769
16658
|
* @packageDocumentation
|
|
16770
16659
|
*/
|
|
@@ -16783,13 +16672,13 @@ Factory.default = SnapshotSourceModule;
|
|
|
16783
16672
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16784
16673
|
};
|
|
16785
16674
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16786
|
-
|
|
16787
|
-
exports
|
|
16788
|
-
__exportStar(Instance, exports);
|
|
16675
|
+
__exportStar(Factory, exports);
|
|
16676
|
+
__exportStar(Instance, exports);
|
|
16789
16677
|
} (snapshotSource));
|
|
16790
16678
|
|
|
16791
16679
|
Object.defineProperty(fin, "__esModule", { value: true });
|
|
16792
|
-
|
|
16680
|
+
fin.Fin = void 0;
|
|
16681
|
+
const events_1$3 = require$$0;
|
|
16793
16682
|
// Import from the file rather than the directory in case someone consuming types is using module resolution other than "node"
|
|
16794
16683
|
const index_1 = system;
|
|
16795
16684
|
const index_2 = requireWindow();
|
|
@@ -16804,6 +16693,9 @@ const index_10 = platform;
|
|
|
16804
16693
|
const me_1$2 = me;
|
|
16805
16694
|
const interop_1 = requireInterop();
|
|
16806
16695
|
const snapshot_source_1 = snapshotSource;
|
|
16696
|
+
/**
|
|
16697
|
+
* @internal
|
|
16698
|
+
*/
|
|
16807
16699
|
class Fin extends events_1$3.EventEmitter {
|
|
16808
16700
|
/**
|
|
16809
16701
|
* @internal
|
|
@@ -16811,18 +16703,18 @@ class Fin extends events_1$3.EventEmitter {
|
|
|
16811
16703
|
constructor(wire) {
|
|
16812
16704
|
super();
|
|
16813
16705
|
this.wire = wire;
|
|
16814
|
-
this.System = new index_1.
|
|
16815
|
-
this.Window = new index_2.
|
|
16816
|
-
this.Application = new index_3.
|
|
16817
|
-
this.InterApplicationBus = new index_4.
|
|
16818
|
-
this.Clipboard = new index_5.
|
|
16819
|
-
this.ExternalApplication = new index_6.
|
|
16820
|
-
this.Frame = new index_7.
|
|
16821
|
-
this.GlobalHotkey = new index_8.
|
|
16822
|
-
this.Platform = new index_10.
|
|
16823
|
-
this.View = new index_9.
|
|
16824
|
-
this.Interop = new interop_1.
|
|
16825
|
-
this.SnapshotSource = new snapshot_source_1.
|
|
16706
|
+
this.System = new index_1.System(wire);
|
|
16707
|
+
this.Window = new index_2._WindowModule(wire);
|
|
16708
|
+
this.Application = new index_3.ApplicationModule(wire);
|
|
16709
|
+
this.InterApplicationBus = new index_4.InterApplicationBus(wire);
|
|
16710
|
+
this.Clipboard = new index_5.Clipboard(wire);
|
|
16711
|
+
this.ExternalApplication = new index_6.ExternalApplicationModule(wire);
|
|
16712
|
+
this.Frame = new index_7._FrameModule(wire);
|
|
16713
|
+
this.GlobalHotkey = new index_8.GlobalHotkey(wire);
|
|
16714
|
+
this.Platform = new index_10.PlatformModule(wire, this.InterApplicationBus.Channel);
|
|
16715
|
+
this.View = new index_9.ViewModule(wire);
|
|
16716
|
+
this.Interop = new interop_1.InteropModule(wire);
|
|
16717
|
+
this.SnapshotSource = new snapshot_source_1.SnapshotSourceModule(wire);
|
|
16826
16718
|
wire.registerFin(this);
|
|
16827
16719
|
this.me = (0, me_1$2.getMe)(wire);
|
|
16828
16720
|
// Handle disconnect events
|
|
@@ -16831,7 +16723,7 @@ class Fin extends events_1$3.EventEmitter {
|
|
|
16831
16723
|
});
|
|
16832
16724
|
}
|
|
16833
16725
|
}
|
|
16834
|
-
fin.
|
|
16726
|
+
fin.Fin = Fin;
|
|
16835
16727
|
|
|
16836
16728
|
var transport = {};
|
|
16837
16729
|
|
|
@@ -16879,7 +16771,7 @@ var emitterMap = {};
|
|
|
16879
16771
|
|
|
16880
16772
|
Object.defineProperty(emitterMap, "__esModule", { value: true });
|
|
16881
16773
|
emitterMap.EmitterMap = void 0;
|
|
16882
|
-
const events_1$2 =
|
|
16774
|
+
const events_1$2 = require$$0;
|
|
16883
16775
|
class EmitterMap {
|
|
16884
16776
|
constructor() {
|
|
16885
16777
|
this.storage = new Map();
|
|
@@ -16961,7 +16853,7 @@ var __classPrivateFieldGet = (commonjsGlobal && commonjsGlobal.__classPrivateFie
|
|
|
16961
16853
|
var _Transport_wire, _Transport_fin;
|
|
16962
16854
|
Object.defineProperty(transport, "__esModule", { value: true });
|
|
16963
16855
|
transport.Transport = void 0;
|
|
16964
|
-
const events_1$1 =
|
|
16856
|
+
const events_1$1 = require$$0;
|
|
16965
16857
|
const wire_1 = wire;
|
|
16966
16858
|
const transport_errors_1 = transportErrors;
|
|
16967
16859
|
const eventAggregator_1 = eventAggregator;
|
|
@@ -17233,7 +17125,7 @@ var mockWire = {};
|
|
|
17233
17125
|
|
|
17234
17126
|
Object.defineProperty(mockWire, "__esModule", { value: true });
|
|
17235
17127
|
mockWire.MockWire = void 0;
|
|
17236
|
-
const events_1 =
|
|
17128
|
+
const events_1 = require$$0;
|
|
17237
17129
|
class MockWire extends events_1.EventEmitter {
|
|
17238
17130
|
connect(address) {
|
|
17239
17131
|
throw new Error('You are not running in OpenFin.');
|
|
@@ -17264,14 +17156,14 @@ const fin_1 = fin;
|
|
|
17264
17156
|
const transport_1 = transport;
|
|
17265
17157
|
const mockEnvironment_1 = mockEnvironment;
|
|
17266
17158
|
const mockWire_1 = mockWire;
|
|
17267
|
-
exports.fin = mock.fin = ((typeof window !== 'undefined' &&
|
|
17159
|
+
exports.fin = mock.fin = ((typeof window !== 'undefined' && window?.fin) ||
|
|
17268
17160
|
(() => {
|
|
17269
17161
|
const environment = new mockEnvironment_1.MockEnvironment();
|
|
17270
17162
|
const transport = new transport_1.Transport(mockWire_1.MockWire, environment, {
|
|
17271
17163
|
uuid: '',
|
|
17272
17164
|
name: ''
|
|
17273
17165
|
});
|
|
17274
|
-
return new fin_1.
|
|
17166
|
+
return new fin_1.Fin(transport);
|
|
17275
17167
|
})());
|
|
17276
17168
|
var _default = mock.default = OpenFin;
|
|
17277
17169
|
|