@openfin/core 34.78.43 → 34.78.47

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.
@@ -43,6 +43,23 @@ declare type Accelerator = {
43
43
  zoom: boolean;
44
44
  };
45
45
 
46
+ /**
47
+ * @interface
48
+ */
49
+ declare type AddLayoutInstanceOptions = {
50
+ container: HTMLDivElement;
51
+ layoutName: string;
52
+ layout: LayoutOptions;
53
+ };
54
+
55
+ /**
56
+ * @interface
57
+ */
58
+ declare type AddViewOptions = CreateViewTarget & {
59
+ options: ViewState;
60
+ targetView?: Identity_5;
61
+ };
62
+
46
63
  /**
47
64
  * @interface
48
65
  */
@@ -4277,6 +4294,18 @@ declare type CreatedEvent = BaseViewEvent & {
4277
4294
  type: 'created';
4278
4295
  };
4279
4296
 
4297
+ /**
4298
+ * @interface
4299
+ */
4300
+ declare type CreateLayoutOptions = {
4301
+ /**
4302
+ * @experimental
4303
+ *
4304
+ * @returns
4305
+ */
4306
+ layoutManagerOverride: () => any;
4307
+ };
4308
+
4280
4309
  /**
4281
4310
  * @interface
4282
4311
  */
@@ -4395,6 +4424,13 @@ declare type DestroyedEvent = BaseViewEvent & {
4395
4424
  type: 'destroyed';
4396
4425
  };
4397
4426
 
4427
+ /**
4428
+ * @interface
4429
+ */
4430
+ declare type DestroyLayoutOptions = {
4431
+ layoutName: string;
4432
+ };
4433
+
4398
4434
  /**
4399
4435
  * Generated when a page's theme color changes. This is usually due to encountering a meta tag.
4400
4436
  * @interface
@@ -8383,6 +8419,17 @@ declare type LayoutEntityDefinition<TLayoutEntityType extends LayoutEntityTypes
8383
8419
 
8384
8420
  declare type LayoutEntityTypes = Exclude<GoldenLayout.ItemType, 'component' | 'root'>;
8385
8421
 
8422
+ /**
8423
+ * @interface
8424
+ */
8425
+ declare type LayoutIdentity = Identity_5 & {
8426
+ /**
8427
+ * The name of the layout an action should be targeted to. When not provided,
8428
+ * OpenFin attempts to resolve the instance via visibility checks.
8429
+ */
8430
+ layoutName?: string;
8431
+ };
8432
+
8386
8433
  /**
8387
8434
  * Generated when a window and all of its layout's views have either finished or failed navigation.
8388
8435
  * @interface
@@ -8394,6 +8441,25 @@ declare type LayoutInitializedEvent = BaseWindowEvent & {
8394
8441
  })[];
8395
8442
  };
8396
8443
 
8444
+ /**
8445
+ * @interface @experimental
8446
+ *
8447
+ * Responsible for handling all layout management and renderering
8448
+ */
8449
+ declare type LayoutInstance = {
8450
+ getFrameSnapshot: () => Promise<LayoutOptions>;
8451
+ addView: (payload: AddViewOptions) => Promise<View_2>;
8452
+ closeView: (viewIdentity: Identity_5) => Promise<void>;
8453
+ removeView: (viewConfig: Identity_5 | ViewState) => Promise<View_2>;
8454
+ replaceView: (payload: ReplaceViewOptions) => Promise<View_2>;
8455
+ getViews: () => LayoutComponent[];
8456
+ getCurrentViews: () => Identity_5[];
8457
+ startReplaceLayout: (payload: ReplaceLayoutOptions) => Promise<void>;
8458
+ applyPreset: (payload: PresetLayoutOptions_3) => void;
8459
+ isVisible: () => boolean;
8460
+ destroy: () => void;
8461
+ };
8462
+
8397
8463
  /**
8398
8464
  * Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
8399
8465
  * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
@@ -8417,95 +8483,64 @@ declare type LayoutItemConfig = {
8417
8483
  title?: string;
8418
8484
  };
8419
8485
 
8420
- declare class LayoutManager {
8421
- #private;
8422
- private readonly splitterController;
8423
- private readonly tabDragController;
8424
- private readonly layoutContentCache;
8425
- private client;
8426
- private container;
8427
- private containerResizeObserver;
8428
- private viewsResizeObserver;
8429
- private dragProxy;
8430
- private isDragging;
8431
- private resizing;
8432
- layout: GoldenLayout.GoldenLayout;
8433
- private layoutConfigToRestore?;
8434
- readonly ofWindow: OpenFin_2.Window;
8435
- readonly platform: Platform_2;
8436
- private showBackgroundImages;
8437
- private showFavicons;
8438
- private defaultFaviconUrl;
8439
- private showViewsOnWindowResize?;
8440
- private showViewsOnSplitterDrag?;
8441
- private showViewsOnTabDrag?;
8442
- private dropzonePreview?;
8443
- private lastItemDestroyed?;
8444
- private viewsSubscribedTo;
8445
- constructor(splitterController: SplitterController, tabDragController: TabDragController, layoutContentCache: LayoutContentCache);
8446
- /* Excluded from this release type: getClient */
8447
- initManager: () => Promise<void>;
8448
- createLayout: (layout: GoldenLayout.Config, container: HTMLElement) => Promise<void>;
8449
- private setContainer;
8450
- private setupDragDropRegions;
8451
- private replaceLayout;
8452
- private onViewDetached;
8453
- private setupLayoutListeners;
8454
- private onLayoutInit;
8455
- private registerViewComponent;
8456
- private setupWindowListeners;
8457
- private setupResizeObservers;
8486
+ /**
8487
+ * @interface @experimental
8488
+ */
8489
+ declare interface LayoutManager<T extends LayoutSnapshot = LayoutSnapshot> {
8458
8490
  /**
8459
- * Shows/hides a view depending on use case (used by browser)
8460
- * @ignore
8491
+ * @experimental
8492
+ *
8493
+ * Must be overridden when working with multiple layouts
8494
+ *
8495
+ * Hook called during fin.Platform.Layout.init() call, to inform derived classes
8496
+ * when a snapshot is being applied to launch a platform window. Use this hook to set the
8497
+ * local state and ensure you call fin.Platform.Layout.create() on every layout in snapshot.layouts
8498
+ *
8499
+ * When using custom data to the app manifest snapshot.windows.layoutSnapshot key, this data will
8500
+ * be included in the snapshot type T and should align with your component state T.
8501
+ *
8502
+ * TODO: detect if layoutManager override was set and this was not overridden somehow to warn?
8503
+ * @param snapshot
8504
+ * @returns
8461
8505
  */
8462
- private updateViewVisibility;
8463
- private onStackCreated;
8464
- private onTabCreated;
8465
- private onTabMouseUp;
8466
- private replaceCloseTabButton;
8467
- onCloseTabButtonClick: (tab: GoldenLayout.Tab) => Promise<void>;
8468
- addFaviconToTab: (tab: GoldenLayout.Tab, eventIcons: string[]) => void;
8469
- onPopoutClick: (stack: GoldenLayout.ContentItem) => void;
8470
- onStackCloseClick: (stack: GoldenLayout.ContentItem) => void;
8471
- private updateButtonDisplay;
8472
- private onItemCreated;
8473
- private observeSplitters;
8474
- handleOutOfWindowDrop: (e: {
8475
- screenY: number;
8476
- screenX: number;
8477
- }, parentTab: GoldenLayout.Tab, dimensions: {
8478
- width: any;
8479
- height: any;
8480
- }) => Promise<void>;
8481
- private onTabDragStart;
8482
- private setBackgroundImage;
8483
- private setBackgroundImages;
8484
- private getFrameSnapshot;
8485
- private getCurrentViews;
8486
- private addView;
8487
- private replaceView;
8488
- private removeView;
8489
- private closeView;
8490
- private createChannelConnections;
8491
- getViewComponent: (identity: {
8492
- uuid?: string;
8493
- name: string;
8494
- }) => ViewComponent | undefined;
8495
- getViewComponents: () => ViewComponent[];
8496
- private hideHighlight;
8497
- getOfViewFromComponentState: (componentState: {
8498
- name: any;
8499
- }) => View_4;
8500
- private hideAllViews;
8501
- private showViews;
8502
- private initializeLayoutViews;
8503
- private createResizableView;
8504
- private attachView;
8505
- private createAndAttachView;
8506
- private setupViewEvents;
8507
- private dispatchLayoutEvent;
8508
- private setComponentState;
8506
+ applyLayoutSnapshot: (snapshot: T) => Promise<void>;
8507
+ /**
8508
+ * @experimental
8509
+ *
8510
+ * Must be overridden when working with multiple layouts
8511
+ *
8512
+ * Hook for allowing OpenFin to show a given layout. It's recommended to enumerate your layout containers
8513
+ * and find the one matching layoutIdentity.layoutName and show that container and hide the others.
8514
+ * @param layoutIdentity
8515
+ * @returns
8516
+ */
8517
+ showLayout: ({ layoutName }: LayoutIdentity) => Promise<void>;
8518
+ /**
8519
+ * @experimental
8520
+ *
8521
+ * @returns T
8522
+ */
8523
+ getLayoutSnapshot: () => Promise<T>;
8524
+ /**
8525
+ * @experimental
8526
+ *
8527
+ * @param param0
8528
+ * @returns
8529
+ */
8530
+ resolveLayout: ({ layoutName }: LayoutIdentity) => LayoutInstance;
8531
+ /**
8532
+ * @experimental
8533
+ *
8534
+ * Returns a LayoutInstance if one exists with the name layoutIdentity.layoutName.
8535
+ * Throws if it does not exist.
8536
+ * @param layoutIdentity
8537
+ * @returns
8538
+ */
8539
+ getLayoutByName: (layoutName: string) => LayoutInstance;
8540
+ /**
8541
+ * @experimental
8542
+ */
8543
+ getLayouts(): Record<string, LayoutInstance>;
8509
8544
  }
8510
8545
 
8511
8546
  /**
@@ -8739,6 +8774,13 @@ declare type LayoutRow = LayoutItemConfig & {
8739
8774
  type: 'row';
8740
8775
  };
8741
8776
 
8777
+ /**
8778
+ * @interface
8779
+ */
8780
+ declare type LayoutSnapshot = {
8781
+ layouts: Record<string, LayoutOptions>;
8782
+ };
8783
+
8742
8784
  /**
8743
8785
  * @interface
8744
8786
  */
@@ -9617,11 +9659,14 @@ declare namespace OpenFin_2 {
9617
9659
  AddViewToStackOptions,
9618
9660
  CreateViewTarget,
9619
9661
  CreateViewPayload,
9662
+ AddViewOptions,
9620
9663
  ReplaceViewPayload,
9664
+ ReplaceViewOptions,
9621
9665
  CloseViewPayload,
9622
9666
  FetchManifestPayload,
9623
9667
  ReplaceLayoutOpts,
9624
9668
  ReplaceLayoutPayload,
9669
+ ReplaceLayoutOptions,
9625
9670
  SetWindowContextPayload,
9626
9671
  LaunchIntoPlatformPayload,
9627
9672
  GetWindowContextPayload,
@@ -9778,8 +9823,15 @@ declare namespace OpenFin_2 {
9778
9823
  ApplicationWindowInfo_2 as ApplicationWindowInfo,
9779
9824
  WindowDetail,
9780
9825
  LayoutPresetType,
9826
+ LayoutIdentity,
9827
+ LayoutSnapshot,
9781
9828
  InitLayoutOptions_3 as InitLayoutOptions,
9782
- PresetLayoutOptions_2 as PresetLayoutOptions,
9829
+ LayoutInstance,
9830
+ LayoutManager,
9831
+ AddLayoutInstanceOptions,
9832
+ CreateLayoutOptions,
9833
+ DestroyLayoutOptions,
9834
+ PresetLayoutOptions_3 as PresetLayoutOptions,
9783
9835
  ResultBehavior,
9784
9836
  PopupBaseBehavior,
9785
9837
  PopupResultBehavior,
@@ -9833,6 +9885,103 @@ declare namespace OpenFin_2 {
9833
9885
  }
9834
9886
  export default OpenFin_2;
9835
9887
 
9888
+ declare class OpenFinLayout implements OpenFin_2.LayoutInstance {
9889
+ #private;
9890
+ private readonly splitterController;
9891
+ private readonly tabDragController;
9892
+ private readonly layoutContentCache;
9893
+ private client;
9894
+ private container;
9895
+ private containerResizeObserver;
9896
+ private viewsResizeObserver;
9897
+ private dragProxy;
9898
+ private isDragging;
9899
+ private resizing;
9900
+ layout: GoldenLayout.GoldenLayout;
9901
+ private layoutConfigToRestore?;
9902
+ readonly ofWindow: OpenFin_2.Window;
9903
+ readonly platform: Platform_2;
9904
+ private showBackgroundImages;
9905
+ private showFavicons;
9906
+ private defaultFaviconUrl;
9907
+ private showViewsOnWindowResize?;
9908
+ private showViewsOnSplitterDrag?;
9909
+ private showViewsOnTabDrag?;
9910
+ private dropzonePreview?;
9911
+ private lastItemDestroyed?;
9912
+ private viewsSubscribedTo;
9913
+ constructor(splitterController: SplitterController, tabDragController: TabDragController, layoutContentCache: LayoutContentCache);
9914
+ getViews: () => OpenFin_2.LayoutComponent[];
9915
+ startReplaceLayout: ({ layout }: {
9916
+ layout: GoldenLayout.Config;
9917
+ }) => Promise<void>;
9918
+ applyPreset: (payload: PresetLayoutOptions_2) => void;
9919
+ isVisible: () => boolean;
9920
+ destroy: () => void;
9921
+ /* Excluded from this release type: getClient */
9922
+ initManager: () => Promise<void>;
9923
+ createLayout: (layout: GoldenLayout.Config, container: HTMLElement) => Promise<void>;
9924
+ private setContainer;
9925
+ private setupDragDropRegions;
9926
+ private replaceLayout;
9927
+ private onViewDetached;
9928
+ private setupLayoutListeners;
9929
+ private onLayoutInit;
9930
+ private registerViewComponent;
9931
+ private setupWindowListeners;
9932
+ private setupResizeObservers;
9933
+ /**
9934
+ * Shows/hides a view depending on use case (used by browser)
9935
+ * @ignore
9936
+ */
9937
+ private updateViewVisibility;
9938
+ private onStackCreated;
9939
+ private onTabCreated;
9940
+ private onTabMouseUp;
9941
+ private replaceCloseTabButton;
9942
+ onCloseTabButtonClick: (tab: GoldenLayout.Tab) => Promise<void>;
9943
+ addFaviconToTab: (tab: GoldenLayout.Tab, eventIcons: string[]) => void;
9944
+ onPopoutClick: (stack: GoldenLayout.ContentItem) => void;
9945
+ onStackCloseClick: (stack: GoldenLayout.ContentItem) => void;
9946
+ private updateButtonDisplay;
9947
+ private onItemCreated;
9948
+ private observeSplitters;
9949
+ handleOutOfWindowDrop: (e: {
9950
+ screenY: number;
9951
+ screenX: number;
9952
+ }, parentTab: GoldenLayout.Tab, dimensions: {
9953
+ width: any;
9954
+ height: any;
9955
+ }) => Promise<void>;
9956
+ private onTabDragStart;
9957
+ private setBackgroundImage;
9958
+ private setBackgroundImages;
9959
+ getFrameSnapshot: () => Promise<GoldenLayout.Config>;
9960
+ getCurrentViews: () => OpenFin_2.Identity[];
9961
+ addView: ({ options: viewConfig, targetView, location }: OpenFin_2.AddViewOptions) => Promise<View_4>;
9962
+ replaceView: ({ viewToReplace, newView }: OpenFin_2.ReplaceViewOptions) => Promise<View_4>;
9963
+ removeView: (viewConfig: OpenFin_2.Identity | OpenFin_2.ViewState) => Promise<View_4>;
9964
+ closeView: (viewIdentity: OpenFin_2.Identity) => Promise<void>;
9965
+ private createChannelConnections;
9966
+ getViewComponent: ({ name }: {
9967
+ name: string;
9968
+ }) => ViewComponent | undefined;
9969
+ getViewComponents: () => ViewComponent[];
9970
+ private hideHighlight;
9971
+ getOfViewFromComponentState: ({ name }: {
9972
+ name: string;
9973
+ }) => View_4;
9974
+ private hideAllViews;
9975
+ private showViews;
9976
+ private initializeLayoutViews;
9977
+ private createResizableView;
9978
+ private attachView;
9979
+ private createAndAttachView;
9980
+ private setupViewEvents;
9981
+ private dispatchLayoutEvent;
9982
+ private setComponentState;
9983
+ }
9984
+
9836
9985
  declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
9837
9986
 
9838
9987
  declare type OverlapsOnlyIfMatching<T, U> = {
@@ -11561,10 +11710,12 @@ declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent &
11561
11710
 
11562
11711
  declare type PresetLayoutOptions = OpenFin_2.PresetLayoutOptions;
11563
11712
 
11713
+ declare type PresetLayoutOptions_2 = OpenFin_2.PresetLayoutOptions;
11714
+
11564
11715
  /**
11565
11716
  * @interface
11566
11717
  */
11567
- declare type PresetLayoutOptions_2 = {
11718
+ declare type PresetLayoutOptions_3 = {
11568
11719
  /**
11569
11720
  * Which preset layout arrangement to use.
11570
11721
  * The preset options are `columns`, `grid`, `rows`, and `tabs`.
@@ -12232,6 +12383,13 @@ declare interface RemoteConfig extends ExistingConnectConfig {
12232
12383
  /**
12233
12384
  * @interface
12234
12385
  */
12386
+ declare type ReplaceLayoutOptions = ReplaceLayoutOpts;
12387
+
12388
+ /**
12389
+ * @interface
12390
+ *
12391
+ * @deprecated use ReplaceLayoutOptions instead
12392
+ */
12235
12393
  declare type ReplaceLayoutOpts = {
12236
12394
  /**
12237
12395
  * Layout config to be applied.
@@ -12246,13 +12404,21 @@ declare type ReplaceLayoutPayload = {
12246
12404
  /**
12247
12405
  * Object containing the layout to be applied.
12248
12406
  */
12249
- opts: ReplaceLayoutOpts;
12407
+ opts: ReplaceLayoutOptions;
12250
12408
  /**
12251
12409
  * Identity of the window whose layout will be replace.
12252
12410
  */
12253
12411
  target: Identity_5;
12254
12412
  };
12255
12413
 
12414
+ /**
12415
+ * @interface
12416
+ */
12417
+ declare type ReplaceViewOptions = {
12418
+ viewToReplace: Identity_5;
12419
+ newView: ViewState;
12420
+ };
12421
+
12256
12422
  /**
12257
12423
  * @interface
12258
12424
  */