@openfin/workspace-platform 17.2.13 → 17.4.0
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/client-api-platform/src/init/cleanup.d.ts +0 -1
- package/client-api-platform/src/shapes.d.ts +73 -3
- package/common/src/api/overrides.d.ts +1 -0
- package/common/src/api/pages/helper.d.ts +13 -0
- package/common/src/api/pages/shapes.d.ts +3 -0
- package/common/src/utils/layout.d.ts +1 -1
- package/common/src/utils/usage-register.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -97,6 +97,20 @@ export declare const enum ColorSchemeOptionType {
|
|
|
97
97
|
Dark = "dark",
|
|
98
98
|
System = "system"
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Defines the title used for the browser window.
|
|
102
|
+
* `custom` - uses the value of `value` property
|
|
103
|
+
* `page-title` - uses the title of the active page
|
|
104
|
+
* `view-title` - uses the title of the active view
|
|
105
|
+
*/
|
|
106
|
+
export type WindowTitle = {
|
|
107
|
+
type: 'custom';
|
|
108
|
+
value: string;
|
|
109
|
+
} | {
|
|
110
|
+
type: 'page-title';
|
|
111
|
+
} | {
|
|
112
|
+
type: 'view-title';
|
|
113
|
+
};
|
|
100
114
|
/**Types of page tab context menu options, including pre-defined ones.
|
|
101
115
|
* User-defined context menu items should use the value `Custom` */
|
|
102
116
|
export declare enum PageTabContextMenuOptionType {
|
|
@@ -283,6 +297,10 @@ export interface UpdateAttachedPageRequest {
|
|
|
283
297
|
/** The updated page. */
|
|
284
298
|
page: Partial<PageWithUpdatableRuntimeAttribs>;
|
|
285
299
|
}
|
|
300
|
+
export interface ReparentPageRequest {
|
|
301
|
+
/** The ID of the page to reparent. */
|
|
302
|
+
pageId: string;
|
|
303
|
+
}
|
|
286
304
|
/**
|
|
287
305
|
* Types of buttons on browser windows
|
|
288
306
|
*/
|
|
@@ -518,8 +536,11 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
518
536
|
pages: Page[];
|
|
519
537
|
/** The favicon to display on the top left of the created browser window. */
|
|
520
538
|
favicon?: string;
|
|
521
|
-
/**
|
|
522
|
-
|
|
539
|
+
/**
|
|
540
|
+
* A UI friendly title for the created browser window.
|
|
541
|
+
* Type string for window title is deprecated, please use WindowTitle type instead.
|
|
542
|
+
*/
|
|
543
|
+
title?: WindowTitle | string;
|
|
523
544
|
/**
|
|
524
545
|
* Landing page that shows up when you add a new tab from the plus button that exists in the tabstrip.
|
|
525
546
|
* If you do not provide a newTabUrl, then the plus button in the tabstrip will not be shown and users cannot create a new empty tab.
|
|
@@ -716,6 +737,28 @@ export interface BrowserWindowModule {
|
|
|
716
737
|
* @param page the attach page to a browser window.
|
|
717
738
|
*/
|
|
718
739
|
addPage(page: PageWithUpdatableRuntimeAttribs): Promise<void>;
|
|
740
|
+
/**
|
|
741
|
+
* Remove an existing page from an existing browser window and reparent it to another existing browser window.
|
|
742
|
+
* If `multiplePagesDisabled` is `true` an error will be thrown.
|
|
743
|
+
*
|
|
744
|
+
* ```ts
|
|
745
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
746
|
+
*
|
|
747
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
748
|
+
*
|
|
749
|
+
* // assume a page and multiple browser windows already exists
|
|
750
|
+
* const wrappedTargetWindow = workspacePlatform.Browser.wrapSync(identity)
|
|
751
|
+
* const reparentPageRequest = { pageId: 'my-target-page' }
|
|
752
|
+
* // wrap the window to which you wish to move the page and call reparentPage
|
|
753
|
+
* await wrappedTargetWindow.reparentPage(reparentPageRequest);
|
|
754
|
+
* // focus window
|
|
755
|
+
* await wrappedTargetWindow.openfinWindow.focus();
|
|
756
|
+
* // restore window if minimized
|
|
757
|
+
* await wrappedTargetWindow.openfinWindow.restore();
|
|
758
|
+
* ```
|
|
759
|
+
* @param req the reparent page request.
|
|
760
|
+
*/
|
|
761
|
+
reparentPage(req: ReparentPageRequest): Promise<void>;
|
|
719
762
|
/**
|
|
720
763
|
* Remove an attached page from the browser window.
|
|
721
764
|
*
|
|
@@ -842,6 +885,31 @@ export interface BrowserWindowModule {
|
|
|
842
885
|
* @param options new window state options.
|
|
843
886
|
*/
|
|
844
887
|
replaceWindowStateButtonOptions(options: WindowStateButtonOptions): Promise<void>;
|
|
888
|
+
/**
|
|
889
|
+
* Updates the browser window title based on the provided title object.
|
|
890
|
+
*
|
|
891
|
+
* @param title The new title object for the browser window.
|
|
892
|
+
*
|
|
893
|
+
* @example
|
|
894
|
+
* ```typescript
|
|
895
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
896
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
897
|
+
* workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'view-title'});
|
|
898
|
+
* ```
|
|
899
|
+
*
|
|
900
|
+
* @example
|
|
901
|
+
* ```typescript
|
|
902
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
903
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
904
|
+
* workspacePlatform.Browser.wrapSync(identity).updateBrowserWindowTitle({type: 'custom', value: 'My Custom Title'});
|
|
905
|
+
* ```
|
|
906
|
+
*
|
|
907
|
+
* @typedef WindowTitle
|
|
908
|
+
* @type {Object}
|
|
909
|
+
* @property {string} type - The type of the window title ('custom', 'page-title', or 'view-title').
|
|
910
|
+
* @property {string} [value] - The value associated with the 'custom' type.
|
|
911
|
+
*/
|
|
912
|
+
updateBrowserWindowTitle(title: WindowTitle): Promise<void>;
|
|
845
913
|
_openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise<void>;
|
|
846
914
|
_openPageTabContextMenu(req: OpenPageTabContextMenuRequest): Promise<void>;
|
|
847
915
|
_openSaveButtonContextMenu(req: OpenSaveButtonContextMenuRequest): Promise<void>;
|
|
@@ -1245,6 +1313,7 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
1245
1313
|
* Launch a browser snapshot that contains windows with pages.
|
|
1246
1314
|
*
|
|
1247
1315
|
* @param snapshot the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.
|
|
1316
|
+
* @param options options for launching the snapshot.
|
|
1248
1317
|
*/
|
|
1249
1318
|
applySnapshot(snapshot: BrowserSnapshot | string, options?: OpenFin.ApplySnapshotOptions): Promise<OpenFin.Platform>;
|
|
1250
1319
|
/**
|
|
@@ -1475,7 +1544,7 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
1475
1544
|
deleteSavedWorkspace(id: string): Promise<void>;
|
|
1476
1545
|
/**
|
|
1477
1546
|
* Applies a workspace to the user's desktop. Makes that workspace the active workspace.
|
|
1478
|
-
* @param
|
|
1547
|
+
* @param payload {@link ApplyWorkspacePayload}
|
|
1479
1548
|
*
|
|
1480
1549
|
* @returns true if the workspace was applied, false if the workspace was not applied.
|
|
1481
1550
|
*/
|
|
@@ -1950,6 +2019,7 @@ interface WorkspaceMetadata {
|
|
|
1950
2019
|
}
|
|
1951
2020
|
export interface Workspace {
|
|
1952
2021
|
workspaceId: string;
|
|
2022
|
+
/** While not required, it is suggested that Workspace titles be unique. */
|
|
1953
2023
|
title: string;
|
|
1954
2024
|
metadata?: WorkspaceMetadata;
|
|
1955
2025
|
snapshot: BrowserSnapshot;
|
|
@@ -19,6 +19,7 @@ export interface Overrides {
|
|
|
19
19
|
analyticsEndpoint: string;
|
|
20
20
|
translationOverridesUrl: string;
|
|
21
21
|
}
|
|
22
|
+
export declare function getManifestOverrides(): Promise<Partial<Overrides>>;
|
|
22
23
|
export declare function getOverrides(): Promise<Partial<Overrides>>;
|
|
23
24
|
export declare const useOverrides: () => Partial<Overrides>;
|
|
24
25
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import type { AttachedPage, Page } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export interface PagesLayoutSnapshot {
|
|
4
|
+
layouts: {
|
|
5
|
+
[pageId: string]: OpenFin.LayoutOptions;
|
|
6
|
+
};
|
|
7
|
+
pages: Page[];
|
|
8
|
+
}
|
|
9
|
+
export declare const convertPagesToLayoutSnapshot: (pages: Page[]) => {
|
|
10
|
+
layouts: Record<string, OpenFin.LayoutOptions>;
|
|
11
|
+
pages: Page[];
|
|
12
|
+
};
|
|
13
|
+
export declare const convertLayoutSnapshotToPages: ({ pages, layouts }: PagesLayoutSnapshot) => AttachedPage[];
|
|
@@ -85,6 +85,9 @@ type AttachedPageMetadata = {
|
|
|
85
85
|
panels?: ExtendedPanelConfig[];
|
|
86
86
|
};
|
|
87
87
|
export type AttachedPage = Page & AttachedPageMetadata;
|
|
88
|
+
export type ReparentAttachedPage = AttachedPage & {
|
|
89
|
+
multiInstanceViewBehavior?: 'reparent';
|
|
90
|
+
};
|
|
88
91
|
export type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
|
|
89
92
|
export interface DetachPagesFromWindowPayload {
|
|
90
93
|
/** The OF window identity to detach the pages from. */
|
|
@@ -63,7 +63,7 @@ export declare const addLayoutEventListener: (event: LayoutDOMEventType, listene
|
|
|
63
63
|
/**
|
|
64
64
|
* Initialize the layout for the current OF window.
|
|
65
65
|
*/
|
|
66
|
-
export declare const
|
|
66
|
+
export declare const initLayoutListeners: () => Promise<void>;
|
|
67
67
|
/**
|
|
68
68
|
* Deep clones a layout and changes its settings to make it "locked".
|
|
69
69
|
* @param layout The Layout to be locked
|