@openfin/core 33.77.5 → 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/mock-alpha.d.ts +185 -56
- package/out/mock-beta.d.ts +185 -56
- package/out/mock-public.d.ts +185 -56
- package/out/mock.d.ts +185 -53
- package/out/mock.js +160 -7
- package/package.json +1 -1
package/out/mock.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,
|
|
@@ -3043,9 +3043,9 @@ declare type ConstViewOptions = {
|
|
|
3043
3043
|
*/
|
|
3044
3044
|
processAffinity: string;
|
|
3045
3045
|
/**
|
|
3046
|
-
* Defines the hotkeys that will be emitted as a `hotkey` event on the view. For usage example see
|
|
3046
|
+
* Defines the hotkeys that will be emitted as a `hotkey` event on the view. For usage example, see {@link MutableWindowOptions hotkeys Example}.
|
|
3047
3047
|
* Within Platform, OpenFin also implements a set of pre-defined actions called
|
|
3048
|
-
*
|
|
3048
|
+
* {@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands keyboard commands}
|
|
3049
3049
|
* that can be assigned to a specific hotkey in the platform manifest.
|
|
3050
3050
|
*/
|
|
3051
3051
|
hotkeys: Hotkey[];
|
|
@@ -6426,6 +6426,64 @@ declare type JumpListTask = {
|
|
|
6426
6426
|
|
|
6427
6427
|
/**
|
|
6428
6428
|
* The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
|
|
6429
|
+
*
|
|
6430
|
+
*
|
|
6431
|
+
* ### Supported event types:
|
|
6432
|
+
*
|
|
6433
|
+
* * app-version-progress
|
|
6434
|
+
* * runtime-status
|
|
6435
|
+
* * app-version-complete
|
|
6436
|
+
* * app-version-error
|
|
6437
|
+
*
|
|
6438
|
+
* ### App version resolver events
|
|
6439
|
+
*
|
|
6440
|
+
* #### app-version-progress
|
|
6441
|
+
* Generated when RVM tries each manifest in the list of fallbackManifests, validate it and see if it's compatible with the system app.
|
|
6442
|
+
* ```js
|
|
6443
|
+
* //This response has the following shape:
|
|
6444
|
+
* {
|
|
6445
|
+
* type: 'app-version-progress',
|
|
6446
|
+
* manifest: 'https://cdn.openfin.co/release/system-apps/notifications/1.13.0/app.json', // A manifest in the fallbackManifest list
|
|
6447
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json' // To keep track of the original manifest url
|
|
6448
|
+
* }
|
|
6449
|
+
* ```
|
|
6450
|
+
*
|
|
6451
|
+
* #### runtime-status
|
|
6452
|
+
* Generated when RVM checks runtime availability.
|
|
6453
|
+
* ```js
|
|
6454
|
+
* //This response has the following shape:
|
|
6455
|
+
* {
|
|
6456
|
+
* type: 'runtime-status',
|
|
6457
|
+
* version: '29.105.71.32', // runtime version
|
|
6458
|
+
* exists: false, // check if the runtime already exists on the machine
|
|
6459
|
+
* writeAccess: true, // check if the runtime directory has write access
|
|
6460
|
+
* reachable: true, // check if the runtime asset location is reachable/downloadable
|
|
6461
|
+
* healthCheck: true, // check if there is runtime health check
|
|
6462
|
+
* error: 'Not able to resolve runtime version' // give an error message if runtime version cannot be resolved
|
|
6463
|
+
* }
|
|
6464
|
+
* ```
|
|
6465
|
+
*
|
|
6466
|
+
* #### app-version-complete
|
|
6467
|
+
* Generated when RVM has successfully found the target runtime version and (about to) delegate launch to the runtime.
|
|
6468
|
+
* ```js
|
|
6469
|
+
* //This response has the following shape:
|
|
6470
|
+
* {
|
|
6471
|
+
* type: 'app-version-complete',
|
|
6472
|
+
* manifest: 'https://cdn.openfin.co/release/system-apps/notifications/1.13.0/app.json', // A manifest in the fallbackManifest list
|
|
6473
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json' // To keep track of the original manifest url
|
|
6474
|
+
* }
|
|
6475
|
+
* ```
|
|
6476
|
+
*
|
|
6477
|
+
* #### app-version-error
|
|
6478
|
+
* Generated when RVM failed to find an available runtime version after trying each manifest in the list of fallbackManifests.
|
|
6479
|
+
* ```js
|
|
6480
|
+
* //This response has the following shape:
|
|
6481
|
+
* {
|
|
6482
|
+
* type: 'app-version-error',
|
|
6483
|
+
* srcManifest: 'https://cdn.openfin.co/myapp.json', // To keep track of the original manifest url
|
|
6484
|
+
* error: 'All fallback manifest URLs failed' // error message
|
|
6485
|
+
* }
|
|
6486
|
+
* ```
|
|
6429
6487
|
*/
|
|
6430
6488
|
declare type LaunchEmitter = TypedEventEmitter<AppVersionEvent>;
|
|
6431
6489
|
|
|
@@ -6445,41 +6503,7 @@ declare type LaunchIntoPlatformPayload = {
|
|
|
6445
6503
|
declare class Layout extends Base {
|
|
6446
6504
|
#private;
|
|
6447
6505
|
/**
|
|
6448
|
-
*
|
|
6449
|
-
*
|
|
6450
|
-
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window. If a containerId
|
|
6451
|
-
* is not provided, this method attempts to find an element with the id `layout-container`.
|
|
6452
|
-
*
|
|
6453
|
-
* A Layout will emit events locally on the DOM element representing the layout-container. In order to capture the relevant
|
|
6454
|
-
* events during Layout initiation, set up the listeners on the DOM element prior to calling init.
|
|
6455
|
-
*
|
|
6456
|
-
* @example
|
|
6457
|
-
* ```js
|
|
6458
|
-
* // if no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
|
6459
|
-
* const layout = await fin.Platform.Layout.init();
|
|
6460
|
-
* ```
|
|
6461
|
-
* <br /><br />
|
|
6462
|
-
* # Example
|
|
6463
|
-
* To target a different HTML element use the options object.
|
|
6464
|
-
* ```js
|
|
6465
|
-
* const containerId = 'my-custom-container-id';
|
|
6466
|
-
*
|
|
6467
|
-
* const myLayoutContainer = document.getElementById(containerId);
|
|
6468
|
-
*
|
|
6469
|
-
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
6470
|
-
* const { tabSelector } = event.detail;
|
|
6471
|
-
* const tabElement = document.getElementById(tabSelector);
|
|
6472
|
-
* const existingColor = tabElement.style.backgroundColor;
|
|
6473
|
-
* tabElement.style.backgroundColor = "red";
|
|
6474
|
-
* setTimeout(() => {
|
|
6475
|
-
* tabElement.style.backgroundColor = existingColor;
|
|
6476
|
-
* }, 2000);
|
|
6477
|
-
* });
|
|
6478
|
-
*
|
|
6479
|
-
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
|
6480
|
-
* // the window must have been created with a layout in its window options
|
|
6481
|
-
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
6482
|
-
* ```
|
|
6506
|
+
* @internal
|
|
6483
6507
|
*/
|
|
6484
6508
|
init: (options?: InitLayoutOptions_2) => Promise<Layout>;
|
|
6485
6509
|
identity: Identity_4;
|
|
@@ -6971,15 +6995,43 @@ declare class LayoutModule extends Base {
|
|
|
6971
6995
|
*/
|
|
6972
6996
|
getCurrentSync(): OpenFin_2.Layout;
|
|
6973
6997
|
/**
|
|
6974
|
-
* Initialize the window's Layout.
|
|
6998
|
+
* Initialize the window's Layout.
|
|
6999
|
+
*
|
|
7000
|
+
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
6975
7001
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
6976
|
-
* A Layout will
|
|
7002
|
+
* A Layout will emit events locally on the DOM element representing the layout-container.
|
|
6977
7003
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
6978
7004
|
* @param options - Layout init options.
|
|
6979
7005
|
*
|
|
6980
|
-
* @static
|
|
6981
7006
|
* @experimental
|
|
6982
|
-
*
|
|
7007
|
+
*
|
|
7008
|
+
* @example
|
|
7009
|
+
* ```js
|
|
7010
|
+
* // If no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
|
7011
|
+
* const layout = await fin.Platform.Layout.init();
|
|
7012
|
+
* ```
|
|
7013
|
+
* <br>
|
|
7014
|
+
*
|
|
7015
|
+
* ```js
|
|
7016
|
+
* const containerId = 'my-custom-container-id';
|
|
7017
|
+
*
|
|
7018
|
+
* const myLayoutContainer = document.getElementById(containerId);
|
|
7019
|
+
*
|
|
7020
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
7021
|
+
* const { tabSelector } = event.detail;
|
|
7022
|
+
* const tabElement = document.getElementById(tabSelector);
|
|
7023
|
+
* const existingColor = tabElement.style.backgroundColor;
|
|
7024
|
+
* tabElement.style.backgroundColor = "red";
|
|
7025
|
+
* setTimeout(() => {
|
|
7026
|
+
* tabElement.style.backgroundColor = existingColor;
|
|
7027
|
+
* }, 2000);
|
|
7028
|
+
* });
|
|
7029
|
+
*
|
|
7030
|
+
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
|
7031
|
+
* // the window must have been created with a layout in its window options
|
|
7032
|
+
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
7033
|
+
* ```
|
|
7034
|
+
* @static
|
|
6983
7035
|
*/
|
|
6984
7036
|
init: (options?: InitLayoutOptions) => Promise<OpenFin_2.Layout>;
|
|
6985
7037
|
}
|
|
@@ -7560,7 +7612,7 @@ declare type MutableViewOptions = {
|
|
|
7560
7612
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
|
7561
7613
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
|
7562
7614
|
* _When omitted, _inherits_ from the parent application._
|
|
7563
|
-
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
|
7615
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts. For usage example, see {@link MutableWindowOptions customContext Example}.
|
|
7564
7616
|
*/
|
|
7565
7617
|
customContext: any;
|
|
7566
7618
|
/**
|
|
@@ -7661,7 +7713,42 @@ declare type MutableWindowOptions = {
|
|
|
7661
7713
|
* is called. If a window in a Platform is trying to update or retrieve its own context, it can use the
|
|
7662
7714
|
* {@link Platform#setWindowContext Platform.setWindowContext} and {@link Platform#getWindowContext Platform.getWindowContext} calls.
|
|
7663
7715
|
* _When omitted, _inherits_ from the parent application._
|
|
7664
|
-
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
|
7716
|
+
* As opposed to customData, this is meant for frequent updates and sharing with other contexts.
|
|
7717
|
+
*
|
|
7718
|
+
* @example
|
|
7719
|
+
* This Example shows a window sharing context to all it's views.
|
|
7720
|
+
* By executing the code here in the correct context, the view will have global `broadcastContext` and `addContextListener` methods available.
|
|
7721
|
+
* 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.
|
|
7722
|
+
*
|
|
7723
|
+
* ### In Window (frame)
|
|
7724
|
+
* ```js
|
|
7725
|
+
* const me = fin.Window.getCurrentSync();
|
|
7726
|
+
* me.on('options-changed', async (event) => {
|
|
7727
|
+
* if (event.diff.customContext) {
|
|
7728
|
+
* const myViews = await me.getCurrentViews();
|
|
7729
|
+
* const customContext = event.diff.customContext.newVal;
|
|
7730
|
+
* myViews.forEach(v => {
|
|
7731
|
+
* v.updateOptions({customContext});
|
|
7732
|
+
* });
|
|
7733
|
+
* }
|
|
7734
|
+
* })
|
|
7735
|
+
*
|
|
7736
|
+
* ```
|
|
7737
|
+
* ### in View (content)
|
|
7738
|
+
* ```js
|
|
7739
|
+
* const me = fin.View.getCurrentSync();
|
|
7740
|
+
* const broadcastContext = async (customContext) => {
|
|
7741
|
+
* const myWindow = await me.getCurrentWindow()
|
|
7742
|
+
* await myWindow.updateOptions({customContext})
|
|
7743
|
+
* };
|
|
7744
|
+
* const addContextListener = async (listener) => {
|
|
7745
|
+
* await me.on('options-changed', (event) => {
|
|
7746
|
+
* if (event.diff.customContext) {
|
|
7747
|
+
* listener(event.diff.customContext.newVal);
|
|
7748
|
+
* }
|
|
7749
|
+
* });
|
|
7750
|
+
* }
|
|
7751
|
+
* ```
|
|
7665
7752
|
*/
|
|
7666
7753
|
customContext: any;
|
|
7667
7754
|
/**
|
|
@@ -7682,10 +7769,45 @@ declare type MutableWindowOptions = {
|
|
|
7682
7769
|
*/
|
|
7683
7770
|
hideOnClose: boolean;
|
|
7684
7771
|
/**
|
|
7685
|
-
* Defines the hotkeys that will be emitted as a `hotkey` event on the window.
|
|
7772
|
+
* Defines the hotkeys that will be emitted as a `hotkey` event on the window.
|
|
7686
7773
|
* Within Platform, OpenFin also implements a set of pre-defined actions called
|
|
7687
|
-
*
|
|
7774
|
+
* {@link https://developers.openfin.co/docs/platform-api#section-5-3-using-keyboard-commands keyboard commands}
|
|
7688
7775
|
* that can be assigned to a specific hotkey in the platform manifest.
|
|
7776
|
+
*
|
|
7777
|
+
* @example
|
|
7778
|
+
*
|
|
7779
|
+
* 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.
|
|
7780
|
+
* ### Defining the hotkey
|
|
7781
|
+
* ```js
|
|
7782
|
+
* const myMagicWindow = await fin.Window.create({
|
|
7783
|
+
* name: 'magicWin',
|
|
7784
|
+
* hotkeys: [
|
|
7785
|
+
* {
|
|
7786
|
+
* keys: 'Ctrl+M',
|
|
7787
|
+
* }
|
|
7788
|
+
* ]
|
|
7789
|
+
* });
|
|
7790
|
+
*
|
|
7791
|
+
* ```
|
|
7792
|
+
* ### Listening to the hotkey
|
|
7793
|
+
* ```js
|
|
7794
|
+
* myMagicWindow.on('hotkey', (hotkeyEvent) => {
|
|
7795
|
+
* console.log(`A hotkey was pressed in the magic window!: ${JSON.stringify(hotkeyEvent)}`);
|
|
7796
|
+
* });
|
|
7797
|
+
* ```
|
|
7798
|
+
*
|
|
7799
|
+
* ### Removing a hotkey
|
|
7800
|
+
* After the following change, the `hotkey` event will no longer be emitted when Ctrl+M is pressed:
|
|
7801
|
+
* ```js
|
|
7802
|
+
* const currentHotkeys = (await myMagicWindow.getOptions()).hotkeys;
|
|
7803
|
+
* const newHotkeys = currentHotkeys.filter(hotkey => hotkey.keys !== 'Ctrl+M');
|
|
7804
|
+
* myMagicWindow.updateOptions({
|
|
7805
|
+
* hotkeys: newHotkeys
|
|
7806
|
+
* });
|
|
7807
|
+
* ```
|
|
7808
|
+
*
|
|
7809
|
+
* @remarks The `hotkeys` option is configured per-instance and isn't passed down to the children of Window/View.
|
|
7810
|
+
* 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.
|
|
7689
7811
|
*/
|
|
7690
7812
|
hotkeys: Hotkey[];
|
|
7691
7813
|
/**
|
|
@@ -9567,6 +9689,15 @@ declare interface PlatformProvider {
|
|
|
9567
9689
|
*
|
|
9568
9690
|
*/
|
|
9569
9691
|
handleViewsAndWindowClose(windowId: OpenFin_2.Identity, userDecision: OpenFin_2.BeforeUnloadUserDecision): Promise<void>;
|
|
9692
|
+
/**
|
|
9693
|
+
* Handles subsequent launch attempts of the current platform.
|
|
9694
|
+
* Attempts to launch appManifestUrl passed as userAppConfigArgs.
|
|
9695
|
+
* If no appManifestUrl is present will attempt to launch using the requesting manifest snapshot.
|
|
9696
|
+
* If no appManifestUrl or snapshot is available nothing will be launched.
|
|
9697
|
+
* @param { RunRequestedEvent<'application', 'run-requested'> } payload
|
|
9698
|
+
* @returns {Promise<void>}
|
|
9699
|
+
*/
|
|
9700
|
+
handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
|
|
9570
9701
|
}
|
|
9571
9702
|
|
|
9572
9703
|
/**
|
|
@@ -10434,13 +10565,15 @@ declare interface RTCStrategyEndpointPayload {
|
|
|
10434
10565
|
rtc: RTCPacket;
|
|
10435
10566
|
}
|
|
10436
10567
|
|
|
10568
|
+
declare type RunRequestedEvent = OpenFin_2.ApplicationEvents.RunRequestedEvent;
|
|
10569
|
+
|
|
10437
10570
|
/**
|
|
10438
10571
|
* Generated when Application.run() is called for an already running application.
|
|
10439
10572
|
*/
|
|
10440
|
-
declare type
|
|
10573
|
+
declare type RunRequestedEvent_2 = IdentityEvent & {
|
|
10441
10574
|
type: 'run-requested';
|
|
10442
10575
|
userAppConfigArgs: Record<string, any>;
|
|
10443
|
-
manifest: OpenFin_2.
|
|
10576
|
+
manifest: OpenFin_2.Manifest;
|
|
10444
10577
|
};
|
|
10445
10578
|
|
|
10446
10579
|
declare type RuntimeConfig = {
|
|
@@ -13060,7 +13193,6 @@ declare class View_2 extends WebContents<ViewEvent> {
|
|
|
13060
13193
|
* Attaches the current view to the given window identity.
|
|
13061
13194
|
* Identity must be the identity of a window in the same application.
|
|
13062
13195
|
* This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
|
|
13063
|
-
* @param target {Identity}
|
|
13064
13196
|
*
|
|
13065
13197
|
* @example
|
|
13066
13198
|
* ```js
|
|
@@ -13181,7 +13313,6 @@ declare class View_2 extends WebContents<ViewEvent> {
|
|
|
13181
13313
|
hide: () => Promise<void>;
|
|
13182
13314
|
/**
|
|
13183
13315
|
* Sets the bounds (top, left, width, height) of the view relative to its window.
|
|
13184
|
-
* @param bounds {ViewBounds}
|
|
13185
13316
|
*
|
|
13186
13317
|
* @remarks View position is relative to the bounds of the window.
|
|
13187
13318
|
* ({top: 0, left: 0} represents the top left corner of the window)
|
|
@@ -14730,12 +14861,12 @@ declare type WillMoveOrResizeEvent = NamedEvent & {
|
|
|
14730
14861
|
/**
|
|
14731
14862
|
* An Application event that does propagate to (republish on) parent topics.
|
|
14732
14863
|
*/
|
|
14733
|
-
declare type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent |
|
|
14864
|
+
declare type WillPropagateApplicationEvent = ClosedEvent | ApplicationConnectedEvent | CrashedEvent | InitializedEvent | ManifestChangedEvent | NotRespondingEvent | RespondingEvent | RunRequestedEvent_2 | StartedEvent | TrayIconClickedEvent | FileDownloadLocationChangedEvent;
|
|
14734
14865
|
|
|
14735
14866
|
/**
|
|
14736
14867
|
* A View event that does propagate to (republish on) parent topics.
|
|
14737
14868
|
*/
|
|
14738
|
-
declare type WillPropagateViewEvent = WillPropagateWebContentsEvent | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent_2 | HotkeyEvent | ShownEvent | TargetChangedEvent;
|
|
14869
|
+
declare type WillPropagateViewEvent = (WillPropagateWebContentsEvent & BaseViewEvent) | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent_2 | HotkeyEvent | ShownEvent | TargetChangedEvent;
|
|
14739
14870
|
|
|
14740
14871
|
/**
|
|
14741
14872
|
* A WebContents event that does propagate to (republish on) parent topics.
|
|
@@ -14872,7 +15003,7 @@ declare type WillResizeEvent = WillMoveOrResizeEvent & {
|
|
|
14872
15003
|
* alphaMask turns anything of matching RGB value transparent.
|
|
14873
15004
|
* <br>
|
|
14874
15005
|
* Caveats:
|
|
14875
|
-
* *
|
|
15006
|
+
* * Runtime flags --disable-gpu and --allow-unsafe-compositing are required. Note: Unclear behavior on remote Desktop support
|
|
14876
15007
|
* * User cannot click-through transparent regions
|
|
14877
15008
|
* * Not supported on Mac
|
|
14878
15009
|
* * Windows Aero must be enabled
|
|
@@ -15060,6 +15191,7 @@ declare type WillResizeEvent = WillMoveOrResizeEvent & {
|
|
|
15060
15191
|
* A flag that specifies how transparent the window will be.
|
|
15061
15192
|
* Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there.
|
|
15062
15193
|
* This value is clamped between `0.0` and `1.0`.
|
|
15194
|
+
* * In software composition mode, the runtime flag --allow-unsafe-compositing is required.
|
|
15063
15195
|
*
|
|
15064
15196
|
* @property {preloadScript[]} [preloadScripts] - _Inheritable_
|
|
15065
15197
|
* A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
|
package/out/mock.js
CHANGED
|
@@ -3108,7 +3108,6 @@ function requireInstance$2 () {
|
|
|
3108
3108
|
* Attaches the current view to the given window identity.
|
|
3109
3109
|
* Identity must be the identity of a window in the same application.
|
|
3110
3110
|
* This detaches the view from its current window, and sets the view to be destroyed when its new window closes.
|
|
3111
|
-
* @param target {Identity}
|
|
3112
3111
|
*
|
|
3113
3112
|
* @example
|
|
3114
3113
|
* ```js
|
|
@@ -3237,7 +3236,6 @@ function requireInstance$2 () {
|
|
|
3237
3236
|
};
|
|
3238
3237
|
/**
|
|
3239
3238
|
* Sets the bounds (top, left, width, height) of the view relative to its window.
|
|
3240
|
-
* @param bounds {ViewBounds}
|
|
3241
3239
|
*
|
|
3242
3240
|
* @remarks View position is relative to the bounds of the window.
|
|
3243
3241
|
* ({top: 0, left: 0} represents the top left corner of the window)
|
|
@@ -4886,7 +4884,7 @@ function requireInstance () {
|
|
|
4886
4884
|
* alphaMask turns anything of matching RGB value transparent.
|
|
4887
4885
|
* <br>
|
|
4888
4886
|
* Caveats:
|
|
4889
|
-
* *
|
|
4887
|
+
* * Runtime flags --disable-gpu and --allow-unsafe-compositing are required. Note: Unclear behavior on remote Desktop support
|
|
4890
4888
|
* * User cannot click-through transparent regions
|
|
4891
4889
|
* * Not supported on Mac
|
|
4892
4890
|
* * Windows Aero must be enabled
|
|
@@ -5074,6 +5072,7 @@ function requireInstance () {
|
|
|
5074
5072
|
* A flag that specifies how transparent the window will be.
|
|
5075
5073
|
* Changing opacity doesn't work on Windows 7 without Aero so setting this value will have no effect there.
|
|
5076
5074
|
* This value is clamped between `0.0` and `1.0`.
|
|
5075
|
+
* * In software composition mode, the runtime flag --allow-unsafe-compositing is required.
|
|
5077
5076
|
*
|
|
5078
5077
|
* @property {preloadScript[]} [preloadScripts] - _Inheritable_
|
|
5079
5078
|
* A list of scripts that are eval'ed before other scripts in the page. When omitted, _inherits_
|
|
@@ -12982,15 +12981,43 @@ class LayoutModule extends base_1$5.Base {
|
|
|
12982
12981
|
super(...arguments);
|
|
12983
12982
|
_LayoutModule_layoutInitializationAttempted.set(this, false);
|
|
12984
12983
|
/**
|
|
12985
|
-
* Initialize the window's Layout.
|
|
12984
|
+
* Initialize the window's Layout.
|
|
12985
|
+
*
|
|
12986
|
+
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
12986
12987
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
12987
|
-
* A Layout will
|
|
12988
|
+
* A Layout will emit events locally on the DOM element representing the layout-container.
|
|
12988
12989
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
12989
12990
|
* @param options - Layout init options.
|
|
12990
12991
|
*
|
|
12991
|
-
* @static
|
|
12992
12992
|
* @experimental
|
|
12993
|
-
*
|
|
12993
|
+
*
|
|
12994
|
+
* @example
|
|
12995
|
+
* ```js
|
|
12996
|
+
* // If no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
|
12997
|
+
* const layout = await fin.Platform.Layout.init();
|
|
12998
|
+
* ```
|
|
12999
|
+
* <br>
|
|
13000
|
+
*
|
|
13001
|
+
* ```js
|
|
13002
|
+
* const containerId = 'my-custom-container-id';
|
|
13003
|
+
*
|
|
13004
|
+
* const myLayoutContainer = document.getElementById(containerId);
|
|
13005
|
+
*
|
|
13006
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
13007
|
+
* const { tabSelector } = event.detail;
|
|
13008
|
+
* const tabElement = document.getElementById(tabSelector);
|
|
13009
|
+
* const existingColor = tabElement.style.backgroundColor;
|
|
13010
|
+
* tabElement.style.backgroundColor = "red";
|
|
13011
|
+
* setTimeout(() => {
|
|
13012
|
+
* tabElement.style.backgroundColor = existingColor;
|
|
13013
|
+
* }, 2000);
|
|
13014
|
+
* });
|
|
13015
|
+
*
|
|
13016
|
+
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
|
13017
|
+
* // the window must have been created with a layout in its window options
|
|
13018
|
+
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
13019
|
+
* ```
|
|
13020
|
+
* @static
|
|
12994
13021
|
*/
|
|
12995
13022
|
this.init = async (options = {}) => {
|
|
12996
13023
|
this.wire.sendAction('layout-init').catch((e) => {
|
|
@@ -13120,6 +13147,132 @@ _LayoutModule_layoutInitializationAttempted = new WeakMap();
|
|
|
13120
13147
|
* instances of the OpenFin `Layout` class.
|
|
13121
13148
|
*
|
|
13122
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');
|
|
13168
|
+
*
|
|
13169
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
13170
|
+
* const { tabSelector } = event.detail;
|
|
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:
|
|
13196
|
+
*
|
|
13197
|
+
* * tab-created
|
|
13198
|
+
* * container-created
|
|
13199
|
+
* * layout-state-changed
|
|
13200
|
+
* * tab-closed
|
|
13201
|
+
* * tab-dropped
|
|
13202
|
+
*
|
|
13203
|
+
* ### Layout DOM Node Events
|
|
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
|
+
* ```
|
|
13261
|
+
*
|
|
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
|
+
* ```
|
|
13123
13276
|
*/
|
|
13124
13277
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13125
13278
|
if (k2 === undefined) k2 = k;
|