@openfin/workspace-platform 6.3.6 → 7.2.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/api/browser/browser-module.d.ts +3 -1
- package/client-api-platform/src/api/browser/index.d.ts +2 -0
- package/client-api-platform/src/api/context-menu/browser-savebutton-handler.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/index.d.ts +6 -3
- package/client-api-platform/src/api/protocol.d.ts +11 -1
- package/client-api-platform/src/api/storage.d.ts +7 -1
- package/client-api-platform/src/api/utils.d.ts +1 -0
- package/client-api-platform/src/api/workspaces/idb.d.ts +12 -0
- package/client-api-platform/src/api/workspaces/index.d.ts +32 -0
- package/client-api-platform/src/shapes.d.ts +242 -9
- package/common/src/api/browser-protocol.d.ts +6 -1
- package/common/src/components/Indicator/Indicator.constants.d.ts +18 -0
- package/common/src/utils/a11y/search.a11y.d.ts +31 -0
- package/common/src/utils/a11y/speak.d.ts +6 -0
- package/common/src/utils/context-menu.d.ts +4 -0
- package/common/src/utils/env.d.ts +1 -0
- package/common/src/utils/global-context-menu.d.ts +13 -1
- package/common/src/utils/indicators/browser.d.ts +16 -0
- package/common/src/utils/indicators/helper.d.ts +2 -0
- package/common/src/utils/local-storage-key.d.ts +1 -1
- package/common/src/utils/route.d.ts +2 -2
- package/common/src/utils/router/base.d.ts +61 -0
- package/common/src/utils/router/index.d.ts +2 -0
- package/common/src/utils/router/next.d.ts +43 -0
- package/common/src/utils/save-button-context-menu.d.ts +2 -0
- package/common/src/utils/usage-register.d.ts +11 -0
- package/index.js +2 -1
- package/index.js.LICENSE.txt +14 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/client-api-platform/src/api/workspace-module.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../../../common/src/api/pages/shapes';
|
|
3
3
|
import { OpenPageTabContextMenuRequest } from '../../../../client-api-platform/src/index';
|
|
4
|
-
import { OpenGlobalContextMenuRequest, OpenViewTabContextMenuRequest, ToolbarOptions, WindowStateButtonOptions } from '../../../../client-api-platform/src/shapes';
|
|
4
|
+
import { OpenGlobalContextMenuRequest, OpenSaveButtonContextMenuRequest, OpenSaveMenuRequest, OpenViewTabContextMenuRequest, ToolbarOptions, WindowStateButtonOptions } from '../../../../client-api-platform/src/shapes';
|
|
5
5
|
export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
6
6
|
identity: OpenFin.Identity;
|
|
7
7
|
openfinWindow: import("openfin-adapter").Window;
|
|
@@ -17,4 +17,6 @@ export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
|
17
17
|
replaceWindowStateButtonOptions: (options: WindowStateButtonOptions) => Promise<void>;
|
|
18
18
|
_openViewTabContextMenu: (req: OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
19
|
_openPageTabContextMenu: (req: OpenPageTabContextMenuRequest) => Promise<any>;
|
|
20
|
+
_openSaveModal: (req: OpenSaveMenuRequest) => Promise<any>;
|
|
21
|
+
_openSaveButtonContextMenu: (req: OpenSaveButtonContextMenuRequest) => Promise<any>;
|
|
20
22
|
};
|
|
@@ -17,6 +17,8 @@ export declare const getBrowserApi: (identity: OpenFin.ApplicationIdentity) => {
|
|
|
17
17
|
replaceWindowStateButtonOptions: (options: import("../../shapes").WindowStateButtonOptions) => Promise<void>;
|
|
18
18
|
_openViewTabContextMenu: (req: import("../../shapes").OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
19
|
_openPageTabContextMenu: (req: import("../../shapes").OpenPageTabContextMenuRequest) => Promise<any>;
|
|
20
|
+
_openSaveModal: (req: import("../../shapes").OpenSaveMenuRequest) => Promise<any>;
|
|
21
|
+
_openSaveButtonContextMenu: (req: import("../../shapes").OpenSaveButtonContextMenuRequest) => Promise<any>;
|
|
20
22
|
};
|
|
21
23
|
createWindow: (options: BrowserCreateWindowRequest) => Promise<BrowserWindowModule>;
|
|
22
24
|
getAllAttachedPages: () => Promise<AttachedPage[]>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OpenSaveButtonContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
2
|
+
import { SaveButtonContextMenuItemData } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare const saveButtonContextMenuItemHandler: (data: SaveButtonContextMenuItemData, payload: OpenSaveButtonContextMenuPayload) => Promise<void>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
-
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
3
|
-
import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest, OpenPageTabContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
2
|
+
import { OpenPageTabContextMenuPayload, OpenSaveButtonContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
3
|
+
import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest, OpenPageTabContextMenuRequest, OpenSaveButtonContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
4
4
|
export declare function openGlobalContextMenuInternal(payload: OpenGlobalContextMenuRequest & {
|
|
5
5
|
identity: NamedIdentity;
|
|
6
6
|
}, callerIdentity: any): Promise<void>;
|
|
7
|
-
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload, callerIdentity: any) => Promise<void>;
|
|
7
|
+
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload, callerIdentity: any) => Promise<void>;
|
|
8
8
|
export declare function openViewTabContextMenuInternal(payload: OpenViewTabContextMenuRequest & {
|
|
9
9
|
identity: NamedIdentity;
|
|
10
10
|
}, callerIdentity: any): Promise<void>;
|
|
11
11
|
export declare function openPageTabContextMenuInternal(payload: OpenPageTabContextMenuRequest & {
|
|
12
12
|
identity: NamedIdentity;
|
|
13
13
|
}, callerIdentity: any): Promise<void>;
|
|
14
|
+
export declare function openSaveButtonContextMenuInternal(payload: OpenSaveButtonContextMenuRequest & {
|
|
15
|
+
identity: NamedIdentity;
|
|
16
|
+
}, callerIdentity: any): Promise<void>;
|
|
@@ -36,7 +36,17 @@ export declare enum ChannelAction {
|
|
|
36
36
|
OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
|
|
37
37
|
OpenViewTabContextMenuInternal = "openViewTabContextMenuInternal",
|
|
38
38
|
OpenPageTabContextMenuInternal = "openPageTabContextMenuInternal",
|
|
39
|
-
|
|
39
|
+
OpenSaveButtonContextMenuInternal = "openSaveButtonContextMenuInternal",
|
|
40
|
+
InvokeCustomActionInternal = "invokeCustomActionInternal",
|
|
41
|
+
GetSavedWorkspace = "getSavedWorkspace",
|
|
42
|
+
CreateSavedWorkspace = "createSavedWorkspace",
|
|
43
|
+
UpdateSavedWorkspace = "updateSavedWorkspace",
|
|
44
|
+
DeleteSavedWorkspace = "deleteSavedWorkspace",
|
|
45
|
+
GetSavedWorkspaces = "getSavedWorkspaces",
|
|
46
|
+
SaveWorkspace = "saveWorkspace",
|
|
47
|
+
GetCurrentWorkspace = "getCurrentWorkspace",
|
|
48
|
+
ApplyWorkspace = "applyWorkspace",
|
|
49
|
+
SetActiveWorkspace = "setActiveWorkspace"
|
|
40
50
|
}
|
|
41
51
|
/**
|
|
42
52
|
* Get a channel client for a specific Workspace platform.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Page } from '../../../common/src/api/pages/shapes';
|
|
2
|
-
import type { CreateSavedPageRequest, UpdateSavedPageRequest } from '../shapes';
|
|
2
|
+
import type { CreateSavedPageRequest, CreateSavedWorkspaceRequest, UpdateSavedPageRequest, UpdateSavedWorkspaceRequest, Workspace } from '../shapes';
|
|
3
3
|
export declare const getStorageApi: (identity: any) => {
|
|
4
4
|
createPage: (req: CreateSavedPageRequest) => Promise<any>;
|
|
5
5
|
deletePage: (id: string) => Promise<any>;
|
|
@@ -7,4 +7,10 @@ export declare const getStorageApi: (identity: any) => {
|
|
|
7
7
|
getPage: (id: string) => Promise<any>;
|
|
8
8
|
getPages: (query?: string) => Promise<Page[]>;
|
|
9
9
|
savePage: (page: Page) => Promise<any>;
|
|
10
|
+
createWorkspace: (req: CreateSavedWorkspaceRequest) => Promise<any>;
|
|
11
|
+
deleteWorkspace: (id: string) => Promise<any>;
|
|
12
|
+
updateWorkspace: (req: UpdateSavedWorkspaceRequest) => Promise<any>;
|
|
13
|
+
getWorkspace: (id: string) => Promise<any>;
|
|
14
|
+
getWorkspaces: (query?: string) => Promise<Workspace[]>;
|
|
15
|
+
saveWorkspace: (workspace: Workspace) => Promise<any>;
|
|
10
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handleNameCollision: (initialName: string, existingNames: string[]) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Workspace } from '../../../../client-api/src/shapes';
|
|
2
|
+
export declare const store: import("idb-keyval").UseStore;
|
|
3
|
+
export declare function getWorkspace(id: string): Promise<Workspace>;
|
|
4
|
+
export declare function getWorkspaceList(filter?: string): Promise<Workspace[]>;
|
|
5
|
+
export declare function createWorkspace({ workspace }: {
|
|
6
|
+
workspace: any;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function deleteWorkspace(id: string): Promise<void>;
|
|
9
|
+
export declare function updateWorkspace({ workspaceId, workspace }: {
|
|
10
|
+
workspaceId: any;
|
|
11
|
+
workspace: any;
|
|
12
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CreateSavedWorkspaceRequest, Workspace } from '../../../../client-api-platform/src/shapes';
|
|
2
|
+
/**
|
|
3
|
+
* Apply the given workspace and set it as active.
|
|
4
|
+
*/
|
|
5
|
+
export declare function applyWorkspace(workspace: Workspace): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Set the current active workspace.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setActiveWorkspace(workspace: Workspace): void;
|
|
10
|
+
/**
|
|
11
|
+
* Get the initial workspace data structure that represents the an untitled empty workspace.
|
|
12
|
+
* @returns the current active workspace.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getInitialWorkspace(): Promise<Workspace>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a workspace data structure that represents the users current desktop.
|
|
17
|
+
* @returns the current active workspace.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCurrentWorkspace(): Promise<Workspace>;
|
|
20
|
+
export declare const createWorkspaceInStorage: (req: CreateSavedWorkspaceRequest) => Promise<any>;
|
|
21
|
+
export declare const getWorkspacesInStorage: () => Promise<Workspace[]>;
|
|
22
|
+
export declare const getWorkspaceInStorage: (id: string) => Promise<Workspace>;
|
|
23
|
+
export declare const deleteWorkspaceInStorage: (id: string) => Promise<any>;
|
|
24
|
+
export declare const updateWorkspaceInStorage: (req: any) => Promise<any>;
|
|
25
|
+
export declare const saveWorkspace: (workspace: Workspace) => Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a given workspace name is unique
|
|
28
|
+
* If not, add a progressive number to it
|
|
29
|
+
* @param initialName The initial name to test
|
|
30
|
+
* @returns string: a unique workspace name
|
|
31
|
+
*/
|
|
32
|
+
export declare function getUniqueWorkspaceTitle(initialName?: string): Promise<string>;
|
|
@@ -5,10 +5,10 @@ import { IconProps } from '@openfin/ui-library';
|
|
|
5
5
|
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
|
|
6
6
|
import type { CustomThemes } from '../../common/src/api/theming';
|
|
7
7
|
import type { App } from '../../client-api/src/shapes';
|
|
8
|
-
export type { CustomThemes } from '../../common/src/api/theming';
|
|
9
|
-
export type { App, Image, AppIntent } from '../../client-api/src/shapes';
|
|
10
8
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
11
|
-
export type {
|
|
9
|
+
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
10
|
+
export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
|
|
11
|
+
export type { CustomThemes } from '../../common/src/api/theming';
|
|
12
12
|
/**
|
|
13
13
|
* Request for creating a saved page in persistent storage.
|
|
14
14
|
*/
|
|
@@ -53,7 +53,14 @@ export interface ContextMenuItemData {
|
|
|
53
53
|
export declare enum GlobalContextMenuOptionType {
|
|
54
54
|
NewWindow = "NewWindow",
|
|
55
55
|
NewPage = "NewPage",
|
|
56
|
+
SaveWorkspace = "SaveWorkspace",
|
|
57
|
+
SavePage = "SavePage",
|
|
58
|
+
SavePageAs = "SavePageAs",
|
|
56
59
|
CloseWindow = "CloseWindow",
|
|
60
|
+
SaveWorkspaceAs = "SaveWorkspaceAs",
|
|
61
|
+
RenameWorkspace = "RenameWorkspace",
|
|
62
|
+
SwitchWorkspace = "SwitchWorkspace",
|
|
63
|
+
DeleteWorkspace = "DeleteWorkspace",
|
|
57
64
|
OpenStorefront = "OpenStorefront",
|
|
58
65
|
Quit = "Quit",
|
|
59
66
|
Custom = "Custom"
|
|
@@ -65,12 +72,16 @@ export declare enum PageTabContextMenuOptionType {
|
|
|
65
72
|
Duplicate = "Duplicate",
|
|
66
73
|
Rename = "Rename",
|
|
67
74
|
Save = "Save",
|
|
75
|
+
SaveAs = "Save As",
|
|
68
76
|
Custom = "Custom"
|
|
69
77
|
}
|
|
70
78
|
/**Shape of the data property of a global context menu template item */
|
|
71
79
|
export interface GlobalContextMenuItemData extends ContextMenuItemData {
|
|
72
80
|
type: GlobalContextMenuOptionType;
|
|
73
81
|
}
|
|
82
|
+
export interface WorkspaceContextMenuItemData extends GlobalContextMenuItemData {
|
|
83
|
+
workspaceId: string;
|
|
84
|
+
}
|
|
74
85
|
/**Configuration of an option in the global context menu */
|
|
75
86
|
export interface GlobalContextMenuItemTemplate extends OpenFin.MenuItemTemplate {
|
|
76
87
|
data: GlobalContextMenuItemData;
|
|
@@ -201,7 +212,7 @@ export declare enum BrowserButtonType {
|
|
|
201
212
|
ShowHideTabs = "ShowHideTabs",
|
|
202
213
|
ColorLinking = "ColorLinking",
|
|
203
214
|
PresetLayouts = "PresetLayouts",
|
|
204
|
-
|
|
215
|
+
SaveMenu = "SaveMenu",
|
|
205
216
|
Minimise = "Minimise",
|
|
206
217
|
Maximise = "Maximise",
|
|
207
218
|
Close = "Close",
|
|
@@ -268,6 +279,59 @@ export declare type WindowStateButton = CustomBrowserButtonConfig | PreDefinedBu
|
|
|
268
279
|
export interface WindowStateButtonOptions {
|
|
269
280
|
buttons: WindowStateButton[];
|
|
270
281
|
}
|
|
282
|
+
/**Types of context menu options for Save button, including pre-defined ones.
|
|
283
|
+
* User-defined context menu items should use the value `Custom` */
|
|
284
|
+
export declare enum SaveButtonContextMenuOptionType {
|
|
285
|
+
SavePage = "SavePage",
|
|
286
|
+
SaveWorkspace = "SaveWorkspace",
|
|
287
|
+
Custom = "Custom"
|
|
288
|
+
}
|
|
289
|
+
/**Shape of the data property of a save button context menu template item */
|
|
290
|
+
export interface SaveButtonContextMenuItemData extends ContextMenuItemData {
|
|
291
|
+
type: SaveButtonContextMenuOptionType;
|
|
292
|
+
}
|
|
293
|
+
/**Configuration of an option in the save button context menu */
|
|
294
|
+
export interface SaveButtonContextMenuItemTemplate extends OpenFin.MenuItemTemplate {
|
|
295
|
+
data: SaveButtonContextMenuItemData;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Request for opening a context menu from save button in Browser.
|
|
299
|
+
*/
|
|
300
|
+
export interface OpenSaveButtonContextMenuRequest {
|
|
301
|
+
/** Screen x-coordinate where context menu should be shown. */
|
|
302
|
+
x: number;
|
|
303
|
+
/** Screen y-coordinate where context menu should be shown. */
|
|
304
|
+
y: number;
|
|
305
|
+
/** Screen x-coordinate of save button */
|
|
306
|
+
buttonLeft: number;
|
|
307
|
+
/** width of save button */
|
|
308
|
+
buttonWidth: number;
|
|
309
|
+
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
310
|
+
customData?: any;
|
|
311
|
+
/** Id of the page on which the context menu is invoked */
|
|
312
|
+
pageId: string;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Payload received by the openSaveButtonContextMenu provider override.
|
|
316
|
+
*/
|
|
317
|
+
export declare type OpenSaveButtonContextMenuPayload = OpenSaveButtonContextMenuRequest & {
|
|
318
|
+
/** Identity of the Browser window where context menu should be shown. */
|
|
319
|
+
identity: NamedIdentity;
|
|
320
|
+
/** Template defining the options to show in the context menu. */
|
|
321
|
+
template: SaveButtonContextMenuItemTemplate[];
|
|
322
|
+
/** Default function that handles stock context menu options. */
|
|
323
|
+
callback: (data: SaveButtonContextMenuItemData, req: OpenSaveButtonContextMenuPayload) => any;
|
|
324
|
+
};
|
|
325
|
+
/**Payload received by a Custom Action that is invoked by a custom save button context menu option */
|
|
326
|
+
export interface OpenSaveContextMenuOptionActionPayload {
|
|
327
|
+
callerType: CustomActionCallerType.SaveButtonContextMenu;
|
|
328
|
+
/** Identity of the browser window where the context menu is invoked */
|
|
329
|
+
windowIdentity: OpenFin.Identity;
|
|
330
|
+
/** Any data necessary for the functioning of specified custom action*/
|
|
331
|
+
customData?: any;
|
|
332
|
+
/** Id of the page on which the context menu is invoked */
|
|
333
|
+
pageId: string;
|
|
334
|
+
}
|
|
271
335
|
/**
|
|
272
336
|
* Request for creating a browser window.
|
|
273
337
|
*/
|
|
@@ -529,6 +593,7 @@ export interface BrowserWindowModule {
|
|
|
529
593
|
replaceWindowStateButtonOptions(options: WindowStateButtonOptions): Promise<void>;
|
|
530
594
|
_openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise<void>;
|
|
531
595
|
_openPageTabContextMenu(req: OpenPageTabContextMenuRequest): Promise<void>;
|
|
596
|
+
_openSaveButtonContextMenu(req: OpenSaveButtonContextMenuRequest): Promise<void>;
|
|
532
597
|
}
|
|
533
598
|
/**
|
|
534
599
|
* Factory for wrapping browser windows and global operations.
|
|
@@ -592,7 +657,7 @@ export interface BrowserWindowFactory {
|
|
|
592
657
|
* layout
|
|
593
658
|
* };
|
|
594
659
|
* const options: BrowserCreateWindowRequest = {
|
|
595
|
-
* workspacePlatform {
|
|
660
|
+
* workspacePlatform: {
|
|
596
661
|
* pages: [page],
|
|
597
662
|
* title: 'My Window Title',
|
|
598
663
|
* favicon: 'https://google.com/favicon.ico',
|
|
@@ -622,11 +687,12 @@ export interface BrowserWindowFactory {
|
|
|
622
687
|
* type: BrowserButtonType.PresetLayouts
|
|
623
688
|
* },
|
|
624
689
|
* {
|
|
625
|
-
* type: BrowserButtonType.
|
|
690
|
+
* type: BrowserButtonType.SaveMenu
|
|
626
691
|
* }
|
|
627
692
|
* ]
|
|
628
693
|
* }
|
|
629
|
-
* windowStateButtonOptions: {
|
|
694
|
+
* windowStateButtonOptions: {
|
|
695
|
+
* //configure the set of icons for setting window states
|
|
630
696
|
* buttons: [
|
|
631
697
|
* { // adding a custom window state icon for the window
|
|
632
698
|
* id: 'windowState123',
|
|
@@ -836,6 +902,62 @@ export interface WorkspacePlatformStorage {
|
|
|
836
902
|
* @param page the page to save.
|
|
837
903
|
*/
|
|
838
904
|
savePage(page: Page): Promise<void>;
|
|
905
|
+
/**
|
|
906
|
+
* Get all workspaces that are saved in persistent storage.
|
|
907
|
+
*
|
|
908
|
+
* ```ts
|
|
909
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
910
|
+
*
|
|
911
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
912
|
+
* const workspaces = await workspacePlatform.Storage.getWorkspaces();
|
|
913
|
+
* ```
|
|
914
|
+
*/
|
|
915
|
+
getWorkspaces(): Promise<Workspace[]>;
|
|
916
|
+
/**
|
|
917
|
+
* Get a specific workspace in persistent storage.
|
|
918
|
+
*
|
|
919
|
+
* ```ts
|
|
920
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
921
|
+
*
|
|
922
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
923
|
+
* const myWorkspace = await workspacePlatform.Storage.getWorkspace('myWorkspaceId');
|
|
924
|
+
* ```
|
|
925
|
+
* @param id the id of the workspace to get.
|
|
926
|
+
*/
|
|
927
|
+
getWorkspace(id: string): Promise<Workspace>;
|
|
928
|
+
/**
|
|
929
|
+
* Create a workspace in persistent storage.
|
|
930
|
+
*
|
|
931
|
+
* @param workspace the workspace to create in persistent storage.
|
|
932
|
+
*/
|
|
933
|
+
createWorkspace(workspace: CreateSavedWorkspaceRequest): Promise<void>;
|
|
934
|
+
/**
|
|
935
|
+
* Update a workspace in persistent storage.
|
|
936
|
+
* @param req the update saved workspace request.
|
|
937
|
+
*/
|
|
938
|
+
updateWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
|
|
939
|
+
/**
|
|
940
|
+
* Delete a workspace from persistent storage.
|
|
941
|
+
*
|
|
942
|
+
* ```ts
|
|
943
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
944
|
+
*
|
|
945
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
946
|
+
* await workspacePlatform.Storage.deleteWorkspace('myWorkspaceId');
|
|
947
|
+
* ```
|
|
948
|
+
* @param id the id of the workspace to delete.
|
|
949
|
+
*/
|
|
950
|
+
deleteWorkspace(id: string): Promise<void>;
|
|
951
|
+
/**
|
|
952
|
+
* Save a workspace in persistent storage.
|
|
953
|
+
*
|
|
954
|
+
* This is a helper function that will call `getWorkspace` to determine if a workspace is already in storage.
|
|
955
|
+
* If the workspace is already in storage, it will call `updateWorkspace`.
|
|
956
|
+
* If it does not exist in storage, the function will call `createWorkspace` instead.
|
|
957
|
+
*
|
|
958
|
+
* @param workspace the workspace to save.
|
|
959
|
+
*/
|
|
960
|
+
saveWorkspace(workspace: Workspace): Promise<void>;
|
|
839
961
|
}
|
|
840
962
|
/**
|
|
841
963
|
* Request for launching an application.
|
|
@@ -891,6 +1013,21 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
891
1013
|
* @param req the launch app request.
|
|
892
1014
|
*/
|
|
893
1015
|
launchApp(req: LaunchAppRequest): Promise<void>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Gets a workspace data structure that represents the current state of the user's desktop.
|
|
1018
|
+
*/
|
|
1019
|
+
getCurrentWorkspace(): Promise<Workspace>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.
|
|
1022
|
+
* @param workspace the workspace to set as current active workspace.
|
|
1023
|
+
*/
|
|
1024
|
+
setActiveWorkspace(workspace: Workspace): Promise<void>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Closes content from the current workspace and applies the given workspace to the user's desktop. Makes that
|
|
1027
|
+
* workspace the active workspace.
|
|
1028
|
+
* @param workspace the workspace to apply to the desktop and set as the current active workspace.
|
|
1029
|
+
*/
|
|
1030
|
+
applyWorkspace(workspace: Workspace): Promise<void>;
|
|
894
1031
|
/**
|
|
895
1032
|
* The browser window factory for the Workspace Platform.
|
|
896
1033
|
*/
|
|
@@ -930,6 +1067,31 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
930
1067
|
* @param id of the id of the page to delete.
|
|
931
1068
|
*/
|
|
932
1069
|
deleteSavedPage(id: string): Promise<void>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Implementation for getting a list of saved workspaces from persistent storage.
|
|
1072
|
+
* @param query an optional query.
|
|
1073
|
+
*/
|
|
1074
|
+
getSavedWorkspaces(query?: string): Promise<Workspace[]>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Implementation for getting a single workspace in persistent storage.
|
|
1077
|
+
* @param id
|
|
1078
|
+
*/
|
|
1079
|
+
getSavedWorkspace(id: string): Promise<Workspace>;
|
|
1080
|
+
/**
|
|
1081
|
+
* Implementation for creating a saved workspace in persistent storage.
|
|
1082
|
+
* @param req the create saved workspace request.
|
|
1083
|
+
*/
|
|
1084
|
+
createSavedWorkspace(req: CreateSavedWorkspaceRequest): Promise<void>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Implementation for updating a saved workspace in persistent storage.
|
|
1087
|
+
* @param req the update saved workspace request.
|
|
1088
|
+
*/
|
|
1089
|
+
updateSavedWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Implementation for deleting a saved workspace in persistent storage.
|
|
1092
|
+
* @param id of the id of the workspace to delete.
|
|
1093
|
+
*/
|
|
1094
|
+
deleteSavedWorkspace(id: string): Promise<void>;
|
|
933
1095
|
/**
|
|
934
1096
|
* Implementation for showing a global context menu given a menu template,
|
|
935
1097
|
* handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
|
|
@@ -951,6 +1113,13 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
951
1113
|
* @param callerIdentity OF identity of the entity from which the request originated
|
|
952
1114
|
*/
|
|
953
1115
|
openPageTabContextMenu(req: OpenPageTabContextMenuPayload, callerIdentity: OpenFin.Identity): any;
|
|
1116
|
+
/**
|
|
1117
|
+
* Implementation for showing a context menu for save button given a menu template,
|
|
1118
|
+
* handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
|
|
1119
|
+
* @param req the payload received by the provider call
|
|
1120
|
+
* @param callerIdentity OF identity of the entity from which the request originated
|
|
1121
|
+
*/
|
|
1122
|
+
openSaveButtonContextMenu(req: OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity): any;
|
|
954
1123
|
}
|
|
955
1124
|
/**
|
|
956
1125
|
* The origins from which a custom action can be invoked
|
|
@@ -960,6 +1129,7 @@ export declare enum CustomActionCallerType {
|
|
|
960
1129
|
GlobalContextMenu = "GlobalContextMenu",
|
|
961
1130
|
ViewTabContextMenu = "ViewTabContextMenu",
|
|
962
1131
|
PageTabContextMenu = "PageTabContextMenu",
|
|
1132
|
+
SaveButtonContextMenu = "SaveButtonContextMenu",
|
|
963
1133
|
API = "API"
|
|
964
1134
|
}
|
|
965
1135
|
/**The payload received by a Custom Action.
|
|
@@ -967,7 +1137,7 @@ export declare enum CustomActionCallerType {
|
|
|
967
1137
|
* When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
|
|
968
1138
|
export declare type CustomActionPayload = {
|
|
969
1139
|
callerType: CustomActionCallerType.API;
|
|
970
|
-
} | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload;
|
|
1140
|
+
} | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
971
1141
|
/**
|
|
972
1142
|
* Configures a custom action when the control is invoked
|
|
973
1143
|
*/
|
|
@@ -1095,7 +1265,31 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1095
1265
|
* }, callerIdentity);
|
|
1096
1266
|
* };
|
|
1097
1267
|
*
|
|
1098
|
-
*
|
|
1268
|
+
* // add a custom menu item in Save Context Menu
|
|
1269
|
+
* openSaveButtonContextMenu = (req: WorkspacePlatform.OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity) => {
|
|
1270
|
+
* return super.openSaveButtonContextMenu(
|
|
1271
|
+
* {
|
|
1272
|
+
* ...req,
|
|
1273
|
+
* template: [
|
|
1274
|
+
* ...req.template,
|
|
1275
|
+
* {
|
|
1276
|
+
* label: 'Save custom option',
|
|
1277
|
+
* data: {
|
|
1278
|
+
* type: SaveButtonContextMenuOptionType.Custom,
|
|
1279
|
+
* action: {
|
|
1280
|
+
* id: 'sample-custom-action-name',
|
|
1281
|
+
* customData: {
|
|
1282
|
+
* someProp: 'Save Button task'
|
|
1283
|
+
* }
|
|
1284
|
+
* }
|
|
1285
|
+
* }
|
|
1286
|
+
* }
|
|
1287
|
+
* ]
|
|
1288
|
+
* },
|
|
1289
|
+
* callerIdentity
|
|
1290
|
+
* );
|
|
1291
|
+
* }
|
|
1292
|
+
* }
|
|
1099
1293
|
* }
|
|
1100
1294
|
* return new Override();
|
|
1101
1295
|
* };
|
|
@@ -1141,3 +1335,42 @@ export interface BrowserInitConfig {
|
|
|
1141
1335
|
*/
|
|
1142
1336
|
interopOverride?: OpenFin.OverrideCallback<InteropBroker, InteropBroker>;
|
|
1143
1337
|
}
|
|
1338
|
+
interface WorkspaceMetadata {
|
|
1339
|
+
APIVersion: string;
|
|
1340
|
+
}
|
|
1341
|
+
export interface Workspace {
|
|
1342
|
+
workspaceId: string;
|
|
1343
|
+
title: string;
|
|
1344
|
+
metadata: WorkspaceMetadata;
|
|
1345
|
+
snapshot: OpenFin.Snapshot;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Request for creating a saved workspace in persistent storage.
|
|
1349
|
+
*/
|
|
1350
|
+
export interface CreateSavedWorkspaceRequest {
|
|
1351
|
+
/** The workspace to create. */
|
|
1352
|
+
workspace: Workspace;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Request for updating a saved workspace in persistent storage.
|
|
1356
|
+
*/
|
|
1357
|
+
export interface UpdateSavedWorkspaceRequest {
|
|
1358
|
+
/** The ID of the workspace to update. */
|
|
1359
|
+
workspaceId: string;
|
|
1360
|
+
/** The updated workspace. */
|
|
1361
|
+
workspace: Workspace;
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Request to create a save modal.
|
|
1365
|
+
* @private
|
|
1366
|
+
*/
|
|
1367
|
+
export declare type OpenSaveMenuRequest = {
|
|
1368
|
+
x?: number;
|
|
1369
|
+
y?: number;
|
|
1370
|
+
} & ({
|
|
1371
|
+
menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
|
|
1372
|
+
id: string;
|
|
1373
|
+
} | {
|
|
1374
|
+
menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
|
|
1375
|
+
id?: never;
|
|
1376
|
+
});
|
|
@@ -12,12 +12,17 @@ export interface AddToChannelRequest {
|
|
|
12
12
|
newChannelId: string;
|
|
13
13
|
selectedViews: OpenFin.Identity[];
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* These actions are used to handle functionality activated by user in the UI (e.g. context menu)
|
|
17
|
+
* and hence show dialogs, indicators etc.
|
|
18
|
+
* Not to be confused with attached pages actions, which are for API use.
|
|
19
|
+
*/
|
|
15
20
|
export declare enum ChannelAction {
|
|
16
21
|
CloseBrowserWindow = "close-browser-window",
|
|
17
22
|
QuitPlatform = "quit-platform",
|
|
18
23
|
ClosePage = "close-page",
|
|
19
24
|
AddToChannel = "add-to-channel",
|
|
20
25
|
RemoveFromChannel = "remove-from-channel",
|
|
21
|
-
|
|
26
|
+
OpenSaveModalInternal = "open-save-modal-internal",
|
|
22
27
|
DuplicatePage = "duplicate-page"
|
|
23
28
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Here we define an Indicator only explicitly by needing an ID for reference over the wire.
|
|
3
|
+
* Type and message are meant to provide actual context and meaning to an indicator, but
|
|
4
|
+
* they are not required in the case of destroying an existing indicator.
|
|
5
|
+
*/
|
|
6
|
+
export interface Indicator {
|
|
7
|
+
id: string;
|
|
8
|
+
type?: IndicatorType;
|
|
9
|
+
message?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Indicator types are meant to provide additional context to the indicator.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum IndicatorType {
|
|
15
|
+
ERROR = "error",
|
|
16
|
+
SUCCESS = "success",
|
|
17
|
+
INFO = "info"
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare type Role = string;
|
|
2
|
+
export declare type AriaOwns = undefined | string;
|
|
3
|
+
export declare type AriaHaspopup = boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
4
|
+
export declare type AriaAutocomplete = 'none' | 'inline' | 'list' | 'both';
|
|
5
|
+
export declare type AriaControls = undefined | string;
|
|
6
|
+
export declare type AriaActivedescendant = undefined | string;
|
|
7
|
+
export declare type AriaExpanded = boolean | 'false' | 'true';
|
|
8
|
+
export declare type AriaLive = 'none' | 'polite' | 'assertive';
|
|
9
|
+
export declare type A11yBox = {
|
|
10
|
+
'role': Role;
|
|
11
|
+
'aria-expanded': AriaExpanded;
|
|
12
|
+
'aria-owns': AriaOwns;
|
|
13
|
+
'aria-haspopup': AriaHaspopup;
|
|
14
|
+
};
|
|
15
|
+
export declare type A11yInput = {
|
|
16
|
+
'aria-controls': AriaControls;
|
|
17
|
+
'aria-autocomplete': AriaAutocomplete;
|
|
18
|
+
'aria-activedescendant': AriaActivedescendant;
|
|
19
|
+
};
|
|
20
|
+
export interface AriaSearchInput {
|
|
21
|
+
role: Role;
|
|
22
|
+
controls: AriaControls;
|
|
23
|
+
autocomplete: AriaAutocomplete;
|
|
24
|
+
owns: AriaOwns;
|
|
25
|
+
haspopup: AriaHaspopup;
|
|
26
|
+
searchLabelID: string;
|
|
27
|
+
searchResultID: string;
|
|
28
|
+
searchInputID: string;
|
|
29
|
+
labelText: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const A11ySearch: AriaSearchInput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AriaLive } from './search.a11y';
|
|
2
|
+
/**
|
|
3
|
+
* Makes the screen reader speak the provided message.
|
|
4
|
+
* https://a11y-guidelines.orange.com/en/web/components-examples/make-a-screen-reader-talk/
|
|
5
|
+
*/
|
|
6
|
+
export declare const speak: (msg: string, priority?: AriaLive) => void;
|
|
@@ -10,3 +10,7 @@ export declare type ShowContextMenuResponse = OpenFin.MenuResult & {
|
|
|
10
10
|
data: string;
|
|
11
11
|
};
|
|
12
12
|
export default function showContextMenu(opts: OpenFin.ShowPopupMenuOptions, win?: _Window): Promise<ShowContextMenuResponse>;
|
|
13
|
+
export declare const DefaultSaveMenuBounds: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
@@ -23,3 +23,4 @@ export declare const workspaceCdnEnvUrl: string;
|
|
|
23
23
|
export declare const workspaceDocsPlatformUrl: string;
|
|
24
24
|
export declare const workspaceDocsClientUrl: string;
|
|
25
25
|
export declare const workspaceRuntimeVersion: string;
|
|
26
|
+
export declare const workspaceBuildVersion: string;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuItemType } from '../../../common/src/utils/context-menu';
|
|
3
|
+
import * as WP from '../../../client-api-platform/src/index';
|
|
4
|
+
import { GlobalContextMenuItemTemplate, GlobalContextMenuOptionType, Workspace } from '../../../client-api-platform/src/shapes';
|
|
5
|
+
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Workspace[], contextMenuOptionType: GlobalContextMenuOptionType) => {
|
|
6
|
+
label: string;
|
|
7
|
+
type: MenuItemType;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
checked: boolean;
|
|
10
|
+
data: {
|
|
11
|
+
type: WP.GlobalContextMenuOptionType;
|
|
12
|
+
workspaceId: string;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
3
15
|
export declare const getGlobalContextMenuTemplate: (winIdentity: NamedIdentity) => Promise<GlobalContextMenuItemTemplate[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum BrowserIndicatorIcon {
|
|
2
|
+
Locked = "LockClosedIcon",
|
|
3
|
+
Unlocked = "LockOpen1Icon"
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a window containing an error indicator
|
|
7
|
+
*/
|
|
8
|
+
export declare function showBrowserError(message: string, parentBrowserName: string, icon?: BrowserIndicatorIcon): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a window containing a success indicator
|
|
11
|
+
*/
|
|
12
|
+
export declare function showBrowserSuccess(message: string, parentBrowserName: string, icon?: BrowserIndicatorIcon): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a window containing an info indicator
|
|
15
|
+
*/
|
|
16
|
+
export declare function showBrowserInfo(message: string, parentBrowserName: string, icon?: BrowserIndicatorIcon): Promise<void>;
|