@openfin/node-adapter 33.77.7 → 34.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/node-adapter-alpha.d.ts +183 -56
- package/out/node-adapter-beta.d.ts +183 -56
- package/out/node-adapter-public.d.ts +183 -56
- package/out/node-adapter.d.ts +183 -53
- package/out/node-adapter.js +197 -38
- package/package.json +1 -1
package/out/node-adapter.d.ts
CHANGED
@@ -861,7 +861,7 @@ declare namespace ApplicationEvents {
|
|
861
861
|
export {
|
862
862
|
CrashedEvent,
|
863
863
|
FileDownloadLocationChangedEvent,
|
864
|
-
RunRequestedEvent,
|
864
|
+
RunRequestedEvent_2 as RunRequestedEvent,
|
865
865
|
TrayIconClickedEvent,
|
866
866
|
WindowAlertRequestedEvent,
|
867
867
|
WindowCreatedEvent,
|
@@ -3047,9 +3047,9 @@ declare type ConstViewOptions = {
|
|
3047
3047
|
*/
|
3048
3048
|
processAffinity: string;
|
3049
3049
|
/**
|
3050
|
-
* Defines the hotkeys that will be emitted as a `hotkey` event on the view. For usage example see
|
3050
|
+
* Defines the hotkeys that will be emitted as a `hotkey` event on the view. For usage example, see {@link MutableWindowOptions hotkeys Example}.
|
3051
3051
|
* Within Platform, OpenFin also implements a set of pre-defined actions called
|
3052
|
-
*
|
3052
|
+
* {@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands keyboard commands}
|
3053
3053
|
* that can be assigned to a specific hotkey in the platform manifest.
|
3054
3054
|
*/
|
3055
3055
|
hotkeys: Hotkey[];
|
@@ -6455,6 +6455,64 @@ export declare function launch(config: ConnectConfig): Promise<number>;
|
|
6455
6455
|
|
6456
6456
|
/**
|
6457
6457
|
* The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
|
6458
|
+
*
|
6459
|
+
*
|
6460
|
+
* ### Supported event types:
|
6461
|
+
*
|
6462
|
+
* * app-version-progress
|
6463
|
+
* * runtime-status
|
6464
|
+
* * app-version-complete
|
6465
|
+
* * app-version-error
|
6466
|
+
*
|
6467
|
+
* ### App version resolver events
|
6468
|
+
*
|
6469
|
+
* #### app-version-progress
|
6470
|
+
* Generated when RVM tries each manifest in the list of fallbackManifests, validate it and see if it's compatible with the system app.
|
6471
|
+
* ```js
|
6472
|
+
* //This response has the following shape:
|
6473
|
+
* {
|
6474
|
+
* type: 'app-version-progress',
|
6475
|
+
* manifest: 'https://cdn.openfin.co/release/system-apps/notifications/1.13.0/app.json', // A manifest in the fallbackManifest list
|
6476
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json' // To keep track of the original manifest url
|
6477
|
+
* }
|
6478
|
+
* ```
|
6479
|
+
*
|
6480
|
+
* #### runtime-status
|
6481
|
+
* Generated when RVM checks runtime availability.
|
6482
|
+
* ```js
|
6483
|
+
* //This response has the following shape:
|
6484
|
+
* {
|
6485
|
+
* type: 'runtime-status',
|
6486
|
+
* version: '29.105.71.32', // runtime version
|
6487
|
+
* exists: false, // check if the runtime already exists on the machine
|
6488
|
+
* writeAccess: true, // check if the runtime directory has write access
|
6489
|
+
* reachable: true, // check if the runtime asset location is reachable/downloadable
|
6490
|
+
* healthCheck: true, // check if there is runtime health check
|
6491
|
+
* error: 'Not able to resolve runtime version' // give an error message if runtime version cannot be resolved
|
6492
|
+
* }
|
6493
|
+
* ```
|
6494
|
+
*
|
6495
|
+
* #### app-version-complete
|
6496
|
+
* Generated when RVM has successfully found the target runtime version and (about to) delegate launch to the runtime.
|
6497
|
+
* ```js
|
6498
|
+
* //This response has the following shape:
|
6499
|
+
* {
|
6500
|
+
* type: 'app-version-complete',
|
6501
|
+
* manifest: 'https://cdn.openfin.co/release/system-apps/notifications/1.13.0/app.json', // A manifest in the fallbackManifest list
|
6502
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json' // To keep track of the original manifest url
|
6503
|
+
* }
|
6504
|
+
* ```
|
6505
|
+
*
|
6506
|
+
* #### app-version-error
|
6507
|
+
* Generated when RVM failed to find an available runtime version after trying each manifest in the list of fallbackManifests.
|
6508
|
+
* ```js
|
6509
|
+
* //This response has the following shape:
|
6510
|
+
* {
|
6511
|
+
* type: 'app-version-error',
|
6512
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json', // To keep track of the original manifest url
|
6513
|
+
* error: 'All fallback manifest URLs failed' // error message
|
6514
|
+
* }
|
6515
|
+
* ```
|
6458
6516
|
*/
|
6459
6517
|
declare type LaunchEmitter = TypedEventEmitter<AppVersionEvent>;
|
6460
6518
|
|
@@ -6474,41 +6532,7 @@ declare type LaunchIntoPlatformPayload = {
|
|
6474
6532
|
declare class Layout extends Base {
|
6475
6533
|
#private;
|
6476
6534
|
/**
|
6477
|
-
*
|
6478
|
-
*
|
6479
|
-
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window. If a containerId
|
6480
|
-
* is not provided, this method attempts to find an element with the id `layout-container`.
|
6481
|
-
*
|
6482
|
-
* A Layout will emit events locally on the DOM element representing the layout-container. In order to capture the relevant
|
6483
|
-
* events during Layout initiation, set up the listeners on the DOM element prior to calling init.
|
6484
|
-
*
|
6485
|
-
* @example
|
6486
|
-
* ```js
|
6487
|
-
* // if no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
6488
|
-
* const layout = await fin.Platform.Layout.init();
|
6489
|
-
* ```
|
6490
|
-
* <br /><br />
|
6491
|
-
* # Example
|
6492
|
-
* To target a different HTML element use the options object.
|
6493
|
-
* ```js
|
6494
|
-
* const containerId = 'my-custom-container-id';
|
6495
|
-
*
|
6496
|
-
* const myLayoutContainer = document.getElementById(containerId);
|
6497
|
-
*
|
6498
|
-
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
6499
|
-
* const { tabSelector } = event.detail;
|
6500
|
-
* const tabElement = document.getElementById(tabSelector);
|
6501
|
-
* const existingColor = tabElement.style.backgroundColor;
|
6502
|
-
* tabElement.style.backgroundColor = "red";
|
6503
|
-
* setTimeout(() => {
|
6504
|
-
* tabElement.style.backgroundColor = existingColor;
|
6505
|
-
* }, 2000);
|
6506
|
-
* });
|
6507
|
-
*
|
6508
|
-
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
6509
|
-
* // the window must have been created with a layout in its window options
|
6510
|
-
* const layout = await fin.Platform.Layout.init({ containerId });
|
6511
|
-
* ```
|
6535
|
+
* @internal
|
6512
6536
|
*/
|
6513
6537
|
init: (options?: InitLayoutOptions_2) => Promise<Layout>;
|
6514
6538
|
identity: Identity_4;
|
@@ -7000,15 +7024,43 @@ declare class LayoutModule extends Base {
|
|
7000
7024
|
*/
|
7001
7025
|
getCurrentSync(): OpenFin.Layout;
|
7002
7026
|
/**
|
7003
|
-
* Initialize the window's Layout.
|
7027
|
+
* Initialize the window's Layout.
|
7028
|
+
*
|
7029
|
+
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
7004
7030
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
7005
|
-
* A Layout will
|
7031
|
+
* A Layout will emit events locally on the DOM element representing the layout-container.
|
7006
7032
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
7007
7033
|
* @param options - Layout init options.
|
7008
7034
|
*
|
7009
|
-
* @static
|
7010
7035
|
* @experimental
|
7011
|
-
*
|
7036
|
+
*
|
7037
|
+
* @example
|
7038
|
+
* ```js
|
7039
|
+
* // If no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
7040
|
+
* const layout = await fin.Platform.Layout.init();
|
7041
|
+
* ```
|
7042
|
+
* <br>
|
7043
|
+
*
|
7044
|
+
* ```js
|
7045
|
+
* const containerId = 'my-custom-container-id';
|
7046
|
+
*
|
7047
|
+
* const myLayoutContainer = document.getElementById(containerId);
|
7048
|
+
*
|
7049
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
7050
|
+
* const { tabSelector } = event.detail;
|
7051
|
+
* const tabElement = document.getElementById(tabSelector);
|
7052
|
+
* const existingColor = tabElement.style.backgroundColor;
|
7053
|
+
* tabElement.style.backgroundColor = "red";
|
7054
|
+
* setTimeout(() => {
|
7055
|
+
* tabElement.style.backgroundColor = existingColor;
|
7056
|
+
* }, 2000);
|
7057
|
+
* });
|
7058
|
+
*
|
7059
|
+
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
7060
|
+
* // the window must have been created with a layout in its window options
|
7061
|
+
* const layout = await fin.Platform.Layout.init({ containerId });
|
7062
|
+
* ```
|
7063
|
+
* @static
|
7012
7064
|
*/
|
7013
7065
|
init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
|
7014
7066
|
}
|
@@ -7589,7 +7641,7 @@ declare type MutableViewOptions = {
|
|
7589
7641
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
7590
7642
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
7591
7643
|
* _When omitted, _inherits_ from the parent application._
|
7592
|
-
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
7644
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. For usage example, see {@link MutableWindowOptions customContext Example}.
|
7593
7645
|
*/
|
7594
7646
|
customContext: any;
|
7595
7647
|
/**
|
@@ -7640,7 +7692,7 @@ declare type MutableWindowOptions = {
|
|
7640
7692
|
* Turns anything of matching RGB value transparent.
|
7641
7693
|
*
|
7642
7694
|
* Caveats:
|
7643
|
-
* *
|
7695
|
+
* * runtime key --disable-gpu is required. Note: Unclear behavior on remote Desktop support
|
7644
7696
|
* * User cannot click-through transparent regions
|
7645
7697
|
* * Not supported on Mac
|
7646
7698
|
* * Windows Aero must be enabled
|
@@ -7690,7 +7742,42 @@ declare type MutableWindowOptions = {
|
|
7690
7742
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
7691
7743
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
7692
7744
|
* _When omitted, _inherits_ from the parent application._
|
7693
|
-
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
7745
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
7746
|
+
*
|
7747
|
+
* @example
|
7748
|
+
* This Example shows a window sharing context to all it's views.
|
7749
|
+
* By executing the code here in the correct context, the view will have global `broadcastContext` and `addContextListener` methods available.
|
7750
|
+
* The window will synchronize context between views such that calling `broadcastContext` in any of the views will invoke any listeners added with `addContextListener` in all attached views.
|
7751
|
+
*
|
7752
|
+
* ### In Window (frame)
|
7753
|
+
* ```js
|
7754
|
+
* const me = fin.Window.getCurrentSync();
|
7755
|
+
* me.on('options-changed', async (event) => {
|
7756
|
+
* if (event.diff.customContext) {
|
7757
|
+
* const myViews = await me.getCurrentViews();
|
7758
|
+
* const customContext = event.diff.customContext.newVal;
|
7759
|
+
* myViews.forEach(v => {
|
7760
|
+
* v.updateOptions({customContext});
|
7761
|
+
* });
|
7762
|
+
* }
|
7763
|
+
* })
|
7764
|
+
*
|
7765
|
+
* ```
|
7766
|
+
* ### in View (content)
|
7767
|
+
* ```js
|
7768
|
+
* const me = fin.View.getCurrentSync();
|
7769
|
+
* const broadcastContext = async (customContext) => {
|
7770
|
+
* const myWindow = await me.getCurrentWindow()
|
7771
|
+
* await myWindow.updateOptions({customContext})
|
7772
|
+
* };
|
7773
|
+
* const addContextListener = async (listener) => {
|
7774
|
+
* await me.on('options-changed', (event) => {
|
7775
|
+
* if (event.diff.customContext) {
|
7776
|
+
* listener(event.diff.customContext.newVal);
|
7777
|
+
* }
|
7778
|
+
* });
|
7779
|
+
* }
|
7780
|
+
* ```
|
7694
7781
|
*/
|
7695
7782
|
customContext: any;
|
7696
7783
|
/**
|
@@ -7711,10 +7798,45 @@ declare type MutableWindowOptions = {
|
|
7711
7798
|
*/
|
7712
7799
|
hideOnClose: boolean;
|
7713
7800
|
/**
|
7714
|
-
* Defines the hotkeys that will be emitted as a `hotkey` event on the window.
|
7801
|
+
* Defines the hotkeys that will be emitted as a `hotkey` event on the window.
|
7715
7802
|
* Within Platform, OpenFin also implements a set of pre-defined actions called
|
7716
|
-
*
|
7803
|
+
* {@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands keyboard commands}
|
7717
7804
|
* that can be assigned to a specific hotkey in the platform manifest.
|
7805
|
+
*
|
7806
|
+
* @example
|
7807
|
+
*
|
7808
|
+
* This example shows the example of using the `hotkeys` option on Windows/Views and the corresponding `hotkey` event emitted when a specified hotkey is pressed.
|
7809
|
+
* ### Defining the hotkey
|
7810
|
+
* ```js
|
7811
|
+
* const myMagicWindow = await fin.Window.create({
|
7812
|
+
* name: 'magicWin',
|
7813
|
+
* hotkeys: [
|
7814
|
+
* {
|
7815
|
+
* keys: 'Ctrl+M',
|
7816
|
+
* }
|
7817
|
+
* ]
|
7818
|
+
* });
|
7819
|
+
*
|
7820
|
+
* ```
|
7821
|
+
* ### Listening to the hotkey
|
7822
|
+
* ```js
|
7823
|
+
* myMagicWindow.on('hotkey', (hotkeyEvent) => {
|
7824
|
+
* console.log(`A hotkey was pressed in the magic window!: ${JSON.stringify(hotkeyEvent)}`);
|
7825
|
+
* });
|
7826
|
+
* ```
|
7827
|
+
*
|
7828
|
+
* ### Removing a hotkey
|
7829
|
+
* After the following change, the `hotkey` event will no longer be emitted when Ctrl+M is pressed:
|
7830
|
+
* ```js
|
7831
|
+
* const currentHotkeys = (await myMagicWindow.getOptions()).hotkeys;
|
7832
|
+
* const newHotkeys = currentHotkeys.filter(hotkey => hotkey.keys !== 'Ctrl+M');
|
7833
|
+
* myMagicWindow.updateOptions({
|
7834
|
+
* hotkeys: newHotkeys
|
7835
|
+
* });
|
7836
|
+
* ```
|
7837
|
+
*
|
7838
|
+
* @remarks The `hotkeys` option is configured per-instance and isn't passed down to the children of Window/View.
|
7839
|
+
* Therefore, if you want a Window/View *and* all of its children to support hotkeys, you must configure the `hotkeys` option for every created child.
|
7718
7840
|
*/
|
7719
7841
|
hotkeys: Hotkey[];
|
7720
7842
|
/**
|
@@ -7772,7 +7894,6 @@ declare type MutableWindowOptions = {
|
|
7772
7894
|
* A flag that specifies how transparent the window will be.
|
7773
7895
|
* Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there.
|
7774
7896
|
* This value is clamped between `0.0` and `1.0`.
|
7775
|
-
* In software composition mode, the runtime flag --allow-unsafe-compositing is required.
|
7776
7897
|
*/
|
7777
7898
|
opacity: number;
|
7778
7899
|
/**
|
@@ -9597,6 +9718,15 @@ declare interface PlatformProvider {
|
|
9597
9718
|
*
|
9598
9719
|
*/
|
9599
9720
|
handleViewsAndWindowClose(windowId: OpenFin.Identity, userDecision: OpenFin.BeforeUnloadUserDecision): Promise<void>;
|
9721
|
+
/**
|
9722
|
+
* Handles subsequent launch attempts of the current platform.
|
9723
|
+
* Attempts to launch appManifestUrl passed as userAppConfigArgs.
|
9724
|
+
* If no appManifestUrl is present will attempt to launch using the requesting manifest snapshot.
|
9725
|
+
* If no appManifestUrl or snapshot is available nothing will be launched.
|
9726
|
+
* @param { RunRequestedEvent<'application', 'run-requested'> } payload
|
9727
|
+
* @returns {Promise<void>}
|
9728
|
+
*/
|
9729
|
+
handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
|
9600
9730
|
}
|
9601
9731
|
|
9602
9732
|
/**
|
@@ -10464,13 +10594,15 @@ declare interface RTCStrategyEndpointPayload {
|
|
10464
10594
|
rtc: RTCPacket;
|
10465
10595
|
}
|
10466
10596
|
|
10597
|
+
declare type RunRequestedEvent = OpenFin.ApplicationEvents.RunRequestedEvent;
|
10598
|
+
|
10467
10599
|
/**
|
10468
10600
|
* Generated when Application.run() is called for an already running application.
|
10469
10601
|
*/
|
10470
|
-
declare type
|
10602
|
+
declare type RunRequestedEvent_2 = IdentityEvent & {
|
10471
10603
|
type: 'run-requested';
|
10472
10604
|
userAppConfigArgs: Record<string, any>;
|
10473
|
-
manifest: OpenFin.
|
10605
|
+
manifest: OpenFin.Manifest;
|
10474
10606
|
};
|
10475
10607
|
|
10476
10608
|
declare type RuntimeConfig = {
|
@@ -13090,7 +13222,6 @@ declare class View_2 extends WebContents<ViewEvent> {
|
|
13090
13222
|
* Attaches the current view to the given window identity.
|
13091
13223
|
* Identity must be the identity of a window in the same application.
|
13092
13224
|
* This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
|
13093
|
-
* @param target {Identity}
|
13094
13225
|
*
|
13095
13226
|
* @example
|
13096
13227
|
* ```js
|
@@ -13211,7 +13342,6 @@ declare class View_2 extends WebContents<ViewEvent> {
|
|
13211
13342
|
hide: () => Promise<void>;
|
13212
13343
|
/**
|
13213
13344
|
* Sets the bounds (top, left, width, height) of the view relative to its window.
|
13214
|
-
* @param bounds {ViewBounds}
|
13215
13345
|
*
|
13216
13346
|
* @remarks View position is relative to the bounds of the window.
|
13217
13347
|
* ({top: 0, left: 0} represents the top left corner of the window)
|
@@ -14760,7 +14890,7 @@ declare type WillMoveOrResizeEvent = NamedEvent & {
|
|
14760
14890
|
/**
|
14761
14891
|
* An Application event that does propagate to (republish on) parent topics.
|
14762
14892
|
*/
|
14763
|
-
declare type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent |
|
14893
|
+
declare type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent | RunRequestedEvent_2 | StartedEvent | TrayIconClickedEvent | FileDownloadLocationChangedEvent;
|
14764
14894
|
|
14765
14895
|
/**
|
14766
14896
|
* A View event that does propagate to (republish on) parent topics.
|
package/out/node-adapter.js
CHANGED
@@ -3128,7 +3128,6 @@ function requireInstance$2 () {
|
|
3128
3128
|
* Attaches the current view to the given window identity.
|
3129
3129
|
* Identity must be the identity of a window in the same application.
|
3130
3130
|
* This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
|
3131
|
-
* @param target {Identity}
|
3132
3131
|
*
|
3133
3132
|
* @example
|
3134
3133
|
* ```js
|
@@ -3257,7 +3256,6 @@ function requireInstance$2 () {
|
|
3257
3256
|
};
|
3258
3257
|
/**
|
3259
3258
|
* Sets the bounds (top, left, width, height) of the view relative to its window.
|
3260
|
-
* @param bounds {ViewBounds}
|
3261
3259
|
*
|
3262
3260
|
* @remarks View position is relative to the bounds of the window.
|
3263
3261
|
* ({top: 0, left: 0} represents the top left corner of the window)
|
@@ -13003,15 +13001,43 @@ class LayoutModule extends base_1$5.Base {
|
|
13003
13001
|
super(...arguments);
|
13004
13002
|
_LayoutModule_layoutInitializationAttempted.set(this, false);
|
13005
13003
|
/**
|
13006
|
-
* Initialize the window's Layout.
|
13004
|
+
* Initialize the window's Layout.
|
13005
|
+
*
|
13006
|
+
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
13007
13007
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
13008
|
-
* A Layout will
|
13008
|
+
* A Layout will emit events locally on the DOM element representing the layout-container.
|
13009
13009
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
13010
13010
|
* @param options - Layout init options.
|
13011
13011
|
*
|
13012
|
-
* @static
|
13013
13012
|
* @experimental
|
13014
|
-
*
|
13013
|
+
*
|
13014
|
+
* @example
|
13015
|
+
* ```js
|
13016
|
+
* // If no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
13017
|
+
* const layout = await fin.Platform.Layout.init();
|
13018
|
+
* ```
|
13019
|
+
* <br>
|
13020
|
+
*
|
13021
|
+
* ```js
|
13022
|
+
* const containerId = 'my-custom-container-id';
|
13023
|
+
*
|
13024
|
+
* const myLayoutContainer = document.getElementById(containerId);
|
13025
|
+
*
|
13026
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
13027
|
+
* const { tabSelector } = event.detail;
|
13028
|
+
* const tabElement = document.getElementById(tabSelector);
|
13029
|
+
* const existingColor = tabElement.style.backgroundColor;
|
13030
|
+
* tabElement.style.backgroundColor = "red";
|
13031
|
+
* setTimeout(() => {
|
13032
|
+
* tabElement.style.backgroundColor = existingColor;
|
13033
|
+
* }, 2000);
|
13034
|
+
* });
|
13035
|
+
*
|
13036
|
+
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
13037
|
+
* // the window must have been created with a layout in its window options
|
13038
|
+
* const layout = await fin.Platform.Layout.init({ containerId });
|
13039
|
+
* ```
|
13040
|
+
* @static
|
13015
13041
|
*/
|
13016
13042
|
this.init = async (options = {}) => {
|
13017
13043
|
this.wire.sendAction('layout-init').catch((e) => {
|
@@ -13141,6 +13167,132 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
13141
13167
|
* instances of the OpenFin `Layout` class.
|
13142
13168
|
*
|
13143
13169
|
* @packageDocumentation
|
13170
|
+
*
|
13171
|
+
*
|
13172
|
+
* ### Layout.DOMEvents
|
13173
|
+
*
|
13174
|
+
* When a Layout is created, it emits events onto the DOM element representing the Layout container.
|
13175
|
+
* This Layout container is the DOM element referenced by containerId in {@link Layout.LayoutModule#init Layout.init}.
|
13176
|
+
* 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).
|
13177
|
+
* The events are emitted synchronously and only in the process where the Layout exists.
|
13178
|
+
* Any values returned by the called listeners are ignored and will be discarded.
|
13179
|
+
* If the target DOM element is destroyed, any events that have been set up on that element will be destroyed.
|
13180
|
+
*
|
13181
|
+
* @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
|
13182
|
+
*
|
13183
|
+
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
|
13184
|
+
* Adds a listener to the end of the listeners array for the specified event.
|
13185
|
+
* @example
|
13186
|
+
* ```js
|
13187
|
+
* const myLayoutContainer = document.getElementById('layout-container');
|
13188
|
+
*
|
13189
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
13190
|
+
* const { tabSelector } = event.detail;
|
13191
|
+
* const tabElement = document.getElementById(tabSelector);
|
13192
|
+
* const existingColor = tabElement.style.backgroundColor;
|
13193
|
+
* tabElement.style.backgroundColor = "red";
|
13194
|
+
* setTimeout(() => {
|
13195
|
+
* tabElement.style.backgroundColor = existingColor;
|
13196
|
+
* }, 2000);
|
13197
|
+
* });
|
13198
|
+
* ```
|
13199
|
+
*
|
13200
|
+
* #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
|
13201
|
+
* Adds a listener to the end of the listeners array for the specified event.
|
13202
|
+
* @example
|
13203
|
+
* ```js
|
13204
|
+
* const myLayoutContainer = document.getElementById('layout-container');
|
13205
|
+
*
|
13206
|
+
* const listener = function(event) {
|
13207
|
+
* console.log(event.detail);
|
13208
|
+
* console.log('container-created event fired once, removing listener');
|
13209
|
+
* myLayoutContainer.removeEventListener('container-created', listener);
|
13210
|
+
* };
|
13211
|
+
*
|
13212
|
+
* myLayoutContainer.addEventListener('container-created', listener);
|
13213
|
+
* ```
|
13214
|
+
*
|
13215
|
+
* ### Supported event types are:
|
13216
|
+
*
|
13217
|
+
* * tab-created
|
13218
|
+
* * container-created
|
13219
|
+
* * layout-state-changed
|
13220
|
+
* * tab-closed
|
13221
|
+
* * tab-dropped
|
13222
|
+
*
|
13223
|
+
* ### Layout DOM Node Events
|
13224
|
+
*
|
13225
|
+
* #### tab-created
|
13226
|
+
* 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.
|
13227
|
+
* ```js
|
13228
|
+
* // The response has the following shape in event.detail:
|
13229
|
+
* {
|
13230
|
+
* containerSelector: "container-component_A",
|
13231
|
+
* name: "component_A",
|
13232
|
+
* tabSelector: "tab-component_A",
|
13233
|
+
* topic: "openfin-DOM-event",
|
13234
|
+
* type: "tab-created",
|
13235
|
+
* uuid: "OpenFin POC"
|
13236
|
+
* }
|
13237
|
+
* ```
|
13238
|
+
*
|
13239
|
+
* #### container-created
|
13240
|
+
* 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.
|
13241
|
+
* ```js
|
13242
|
+
* // The response has the following shape in event.detail:
|
13243
|
+
* {
|
13244
|
+
* containerSelector: "container-component_A",
|
13245
|
+
* name: "component_A",
|
13246
|
+
* tabSelector: "tab-component_A",
|
13247
|
+
* topic: "openfin-DOM-event",
|
13248
|
+
* type: "container-created",
|
13249
|
+
* uuid: "OpenFin POC"
|
13250
|
+
* }
|
13251
|
+
* ```
|
13252
|
+
*
|
13253
|
+
* ### layout-state-changed
|
13254
|
+
* 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.
|
13255
|
+
* ```js
|
13256
|
+
* // The response has the following shape in event.detail
|
13257
|
+
* {
|
13258
|
+
* containerSelector: "container-component_A",
|
13259
|
+
* name: "component_A",
|
13260
|
+
* tabSelector: "tab-component_A",
|
13261
|
+
* topic: "openfin-DOM-event",
|
13262
|
+
* type: "layout-state-changed",
|
13263
|
+
* uuid: "OpenFin POC"
|
13264
|
+
* }
|
13265
|
+
* ```
|
13266
|
+
*
|
13267
|
+
* #### tab-closed
|
13268
|
+
* Generated when a tab is closed.
|
13269
|
+
* ```js
|
13270
|
+
* // The response has the following shape in event.detail:
|
13271
|
+
* {
|
13272
|
+
* containerSelector: "container-component_A",
|
13273
|
+
* name: "component_A",
|
13274
|
+
* tabSelector: "tab-component_A",
|
13275
|
+
* topic: "openfin-DOM-event",
|
13276
|
+
* type: "tab-closed",
|
13277
|
+
* uuid: "OpenFin POC",
|
13278
|
+
* url: "http://openfin.co" // The url of the view that was closed.
|
13279
|
+
* }
|
13280
|
+
* ```
|
13281
|
+
*
|
13282
|
+
* #### tab-dropped
|
13283
|
+
* Generated when a tab is dropped.
|
13284
|
+
* ```js
|
13285
|
+
* // The response has the following shape in event.detail:
|
13286
|
+
* {
|
13287
|
+
* containerSelector: "container-component_A",
|
13288
|
+
* name: "component_A",
|
13289
|
+
* tabSelector: "tab-component_A",
|
13290
|
+
* topic: "openfin-DOM-event",
|
13291
|
+
* type: "tab-dropped",
|
13292
|
+
* uuid: "OpenFin POC",
|
13293
|
+
* url: "http://openfin.co" // The url of the view linked to the dropped tab.
|
13294
|
+
* }
|
13295
|
+
* ```
|
13144
13296
|
*/
|
13145
13297
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
13146
13298
|
if (k2 === undefined) k2 = k;
|
@@ -16186,39 +16338,46 @@ class InteropClient extends base_1$2.Base {
|
|
16186
16338
|
InteropClient$1.InteropClient = InteropClient;
|
16187
16339
|
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap();
|
16188
16340
|
|
16189
|
-
var overrideCheck
|
16341
|
+
var overrideCheck = {};
|
16190
16342
|
|
16191
|
-
|
16192
|
-
|
16193
|
-
|
16194
|
-
|
16195
|
-
|
16196
|
-
|
16197
|
-
|
16198
|
-
|
16199
|
-
|
16200
|
-
|
16201
|
-
|
16202
|
-
|
16203
|
-
|
16204
|
-
|
16205
|
-
|
16206
|
-
|
16207
|
-
|
16208
|
-
|
16209
|
-
|
16210
|
-
|
16211
|
-
|
16212
|
-
|
16213
|
-
|
16214
|
-
|
16215
|
-
|
16216
|
-
|
16217
|
-
|
16218
|
-
|
16219
|
-
|
16343
|
+
var hasRequiredOverrideCheck;
|
16344
|
+
|
16345
|
+
function requireOverrideCheck () {
|
16346
|
+
if (hasRequiredOverrideCheck) return overrideCheck;
|
16347
|
+
hasRequiredOverrideCheck = 1;
|
16348
|
+
Object.defineProperty(overrideCheck, "__esModule", { value: true });
|
16349
|
+
overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
|
16350
|
+
const InteropBroker_1 = requireInteropBroker();
|
16351
|
+
function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
|
16352
|
+
var _a, _b, _c, _d;
|
16353
|
+
const setVersion = (_c = (_b = (_a = manifest.platform) === null || _a === void 0 ? void 0 : _a.defaultViewOptions) === null || _b === void 0 ? void 0 : _b.fdc3InteropApi) !== null && _c !== void 0 ? _c : (_d = initialOptions.defaultViewOptions) === null || _d === void 0 ? void 0 : _d.fdc3InteropApi;
|
16354
|
+
return ['1.2', '2.0'].includes(setVersion !== null && setVersion !== void 0 ? setVersion : '') ? setVersion : undefined;
|
16355
|
+
}
|
16356
|
+
overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
|
16357
|
+
// TODO: Unit test this
|
16358
|
+
function overrideCheck$1(overriddenBroker, fdc3InteropApi) {
|
16359
|
+
if (fdc3InteropApi && fdc3InteropApi === '2.0') {
|
16360
|
+
const mustOverrideAPIs = [
|
16361
|
+
'fdc3HandleFindInstances',
|
16362
|
+
'handleInfoForIntent',
|
16363
|
+
'handleInfoForIntentsByContext',
|
16364
|
+
'fdc3HandleGetAppMetadata',
|
16365
|
+
'fdc3HandleGetInfo',
|
16366
|
+
'fdc3HandleOpen',
|
16367
|
+
'handleFiredIntent',
|
16368
|
+
'handleFiredIntentForContext'
|
16369
|
+
];
|
16370
|
+
const notOverridden = mustOverrideAPIs.filter((api) => {
|
16371
|
+
return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
|
16372
|
+
});
|
16373
|
+
if (notOverridden.length > 0) {
|
16374
|
+
console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
|
16375
|
+
}
|
16376
|
+
}
|
16377
|
+
}
|
16378
|
+
overrideCheck.overrideCheck = overrideCheck$1;
|
16379
|
+
return overrideCheck;
|
16220
16380
|
}
|
16221
|
-
overrideCheck$1.overrideCheck = overrideCheck;
|
16222
16381
|
|
16223
16382
|
var hasRequiredFactory;
|
16224
16383
|
|
@@ -16231,7 +16390,7 @@ function requireFactory () {
|
|
16231
16390
|
const base_1 = base;
|
16232
16391
|
const InteropBroker_1 = requireInteropBroker();
|
16233
16392
|
const InteropClient_1 = InteropClient$1;
|
16234
|
-
const overrideCheck_1 =
|
16393
|
+
const overrideCheck_1 = requireOverrideCheck();
|
16235
16394
|
const common_utils_1 = commonUtils;
|
16236
16395
|
const defaultOverride = (Class) => new Class();
|
16237
16396
|
const BrokerParamAccessError = 'You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.';
|