@openfin/workspace-platform 6.3.5 → 7.1.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 +235 -5
- 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<any>;
|
|
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<any>;
|
|
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,11 @@ export interface ContextMenuItemData {
|
|
|
53
53
|
export declare enum GlobalContextMenuOptionType {
|
|
54
54
|
NewWindow = "NewWindow",
|
|
55
55
|
NewPage = "NewPage",
|
|
56
|
+
SavePage = "SavePage",
|
|
57
|
+
SavePageAs = "SavePageAs",
|
|
56
58
|
CloseWindow = "CloseWindow",
|
|
59
|
+
SwitchWorkspace = "SwitchWorkspace",
|
|
60
|
+
DeleteWorkspace = "DeleteWorkspace",
|
|
57
61
|
OpenStorefront = "OpenStorefront",
|
|
58
62
|
Quit = "Quit",
|
|
59
63
|
Custom = "Custom"
|
|
@@ -65,12 +69,16 @@ export declare enum PageTabContextMenuOptionType {
|
|
|
65
69
|
Duplicate = "Duplicate",
|
|
66
70
|
Rename = "Rename",
|
|
67
71
|
Save = "Save",
|
|
72
|
+
SaveAs = "Save As",
|
|
68
73
|
Custom = "Custom"
|
|
69
74
|
}
|
|
70
75
|
/**Shape of the data property of a global context menu template item */
|
|
71
76
|
export interface GlobalContextMenuItemData extends ContextMenuItemData {
|
|
72
77
|
type: GlobalContextMenuOptionType;
|
|
73
78
|
}
|
|
79
|
+
export interface WorkspaceContextMenuItemData extends GlobalContextMenuItemData {
|
|
80
|
+
workspaceId: string;
|
|
81
|
+
}
|
|
74
82
|
/**Configuration of an option in the global context menu */
|
|
75
83
|
export interface GlobalContextMenuItemTemplate extends OpenFin.MenuItemTemplate {
|
|
76
84
|
data: GlobalContextMenuItemData;
|
|
@@ -268,6 +276,59 @@ export declare type WindowStateButton = CustomBrowserButtonConfig | PreDefinedBu
|
|
|
268
276
|
export interface WindowStateButtonOptions {
|
|
269
277
|
buttons: WindowStateButton[];
|
|
270
278
|
}
|
|
279
|
+
/**Types of context menu options for Save button, including pre-defined ones.
|
|
280
|
+
* User-defined context menu items should use the value `Custom` */
|
|
281
|
+
export declare enum SaveButtonContextMenuOptionType {
|
|
282
|
+
SavePage = "SavePage",
|
|
283
|
+
SaveWorkspace = "SaveWorkspace",
|
|
284
|
+
Custom = "Custom"
|
|
285
|
+
}
|
|
286
|
+
/**Shape of the data property of a save button context menu template item */
|
|
287
|
+
export interface SaveButtonContextMenuItemData extends ContextMenuItemData {
|
|
288
|
+
type: SaveButtonContextMenuOptionType;
|
|
289
|
+
}
|
|
290
|
+
/**Configuration of an option in the save button context menu */
|
|
291
|
+
export interface SaveButtonContextMenuItemTemplate extends OpenFin.MenuItemTemplate {
|
|
292
|
+
data: SaveButtonContextMenuItemData;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Request for opening a context menu from save button in Browser.
|
|
296
|
+
*/
|
|
297
|
+
export interface OpenSaveButtonContextMenuRequest {
|
|
298
|
+
/** Screen x-coordinate where context menu should be shown. */
|
|
299
|
+
x: number;
|
|
300
|
+
/** Screen y-coordinate where context menu should be shown. */
|
|
301
|
+
y: number;
|
|
302
|
+
/** Screen x-coordinate of save button */
|
|
303
|
+
buttonLeft: number;
|
|
304
|
+
/** width of save button */
|
|
305
|
+
buttonWidth: number;
|
|
306
|
+
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
307
|
+
customData?: any;
|
|
308
|
+
/** Id of the page on which the context menu is invoked */
|
|
309
|
+
pageId: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Payload received by the openSaveButtonContextMenu provider override.
|
|
313
|
+
*/
|
|
314
|
+
export declare type OpenSaveButtonContextMenuPayload = OpenSaveButtonContextMenuRequest & {
|
|
315
|
+
/** Identity of the Browser window where context menu should be shown. */
|
|
316
|
+
identity: NamedIdentity;
|
|
317
|
+
/** Template defining the options to show in the context menu. */
|
|
318
|
+
template: SaveButtonContextMenuItemTemplate[];
|
|
319
|
+
/** Default function that handles stock context menu options. */
|
|
320
|
+
callback: (data: SaveButtonContextMenuItemData, req: OpenSaveButtonContextMenuPayload) => any;
|
|
321
|
+
};
|
|
322
|
+
/**Payload received by a Custom Action that is invoked by a custom save button context menu option */
|
|
323
|
+
export interface OpenSaveContextMenuOptionActionPayload {
|
|
324
|
+
callerType: CustomActionCallerType.SaveButtonContextMenu;
|
|
325
|
+
/** Identity of the browser window where the context menu is invoked */
|
|
326
|
+
windowIdentity: OpenFin.Identity;
|
|
327
|
+
/** Any data necessary for the functioning of specified custom action*/
|
|
328
|
+
customData?: any;
|
|
329
|
+
/** Id of the page on which the context menu is invoked */
|
|
330
|
+
pageId: string;
|
|
331
|
+
}
|
|
271
332
|
/**
|
|
272
333
|
* Request for creating a browser window.
|
|
273
334
|
*/
|
|
@@ -529,6 +590,7 @@ export interface BrowserWindowModule {
|
|
|
529
590
|
replaceWindowStateButtonOptions(options: WindowStateButtonOptions): Promise<void>;
|
|
530
591
|
_openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise<void>;
|
|
531
592
|
_openPageTabContextMenu(req: OpenPageTabContextMenuRequest): Promise<void>;
|
|
593
|
+
_openSaveButtonContextMenu(req: OpenSaveButtonContextMenuRequest): Promise<void>;
|
|
532
594
|
}
|
|
533
595
|
/**
|
|
534
596
|
* Factory for wrapping browser windows and global operations.
|
|
@@ -836,6 +898,62 @@ export interface WorkspacePlatformStorage {
|
|
|
836
898
|
* @param page the page to save.
|
|
837
899
|
*/
|
|
838
900
|
savePage(page: Page): Promise<void>;
|
|
901
|
+
/**
|
|
902
|
+
* Get all workspaces that are saved in persistent storage.
|
|
903
|
+
*
|
|
904
|
+
* ```ts
|
|
905
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
906
|
+
*
|
|
907
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
908
|
+
* const workspaces = await workspacePlatform.Storage.getWorkspaces();
|
|
909
|
+
* ```
|
|
910
|
+
*/
|
|
911
|
+
getWorkspaces(): Promise<Workspace[]>;
|
|
912
|
+
/**
|
|
913
|
+
* Get a specific workspace in persistent storage.
|
|
914
|
+
*
|
|
915
|
+
* ```ts
|
|
916
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
917
|
+
*
|
|
918
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
919
|
+
* const myWorkspace = await workspacePlatform.Storage.getWorkspace('myWorkspaceId');
|
|
920
|
+
* ```
|
|
921
|
+
* @param id the id of the workspace to get.
|
|
922
|
+
*/
|
|
923
|
+
getWorkspace(id: string): Promise<Workspace>;
|
|
924
|
+
/**
|
|
925
|
+
* Create a workspace in persistent storage.
|
|
926
|
+
*
|
|
927
|
+
* @param workspace the workspace to create in persistent storage.
|
|
928
|
+
*/
|
|
929
|
+
createWorkspace(workspace: CreateSavedWorkspaceRequest): Promise<void>;
|
|
930
|
+
/**
|
|
931
|
+
* Update a workspace in persistent storage.
|
|
932
|
+
* @param req the update saved workspace request.
|
|
933
|
+
*/
|
|
934
|
+
updateWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
|
|
935
|
+
/**
|
|
936
|
+
* Delete a workspace from persistent storage.
|
|
937
|
+
*
|
|
938
|
+
* ```ts
|
|
939
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
940
|
+
*
|
|
941
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
942
|
+
* await workspacePlatform.Storage.deleteWorkspace('myWorkspaceId');
|
|
943
|
+
* ```
|
|
944
|
+
* @param id the id of the workspace to delete.
|
|
945
|
+
*/
|
|
946
|
+
deleteWorkspace(id: string): Promise<void>;
|
|
947
|
+
/**
|
|
948
|
+
* Save a workspace in persistent storage.
|
|
949
|
+
*
|
|
950
|
+
* This is a helper function that will call `getWorkspace` to determine if a workspace is already in storage.
|
|
951
|
+
* If the workspace is already in storage, it will call `updateWorkspace`.
|
|
952
|
+
* If it does not exist in storage, the function will call `createWorkspace` instead.
|
|
953
|
+
*
|
|
954
|
+
* @param workspace the workspace to save.
|
|
955
|
+
*/
|
|
956
|
+
saveWorkspace(workspace: Workspace): Promise<void>;
|
|
839
957
|
}
|
|
840
958
|
/**
|
|
841
959
|
* Request for launching an application.
|
|
@@ -891,6 +1009,21 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
891
1009
|
* @param req the launch app request.
|
|
892
1010
|
*/
|
|
893
1011
|
launchApp(req: LaunchAppRequest): Promise<void>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Gets a workspace data structure that represents the current state of the user's desktop.
|
|
1014
|
+
*/
|
|
1015
|
+
getCurrentWorkspace(): Promise<Workspace>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.
|
|
1018
|
+
* @param workspace the workspace to set as current active workspace.
|
|
1019
|
+
*/
|
|
1020
|
+
setActiveWorkspace(workspace: Workspace): Promise<void>;
|
|
1021
|
+
/**
|
|
1022
|
+
* Closes content from the current workspace and applies the given workspace to the user's desktop. Makes that
|
|
1023
|
+
* workspace the active workspace.
|
|
1024
|
+
* @param workspace the workspace to apply to the desktop and set as the current active workspace.
|
|
1025
|
+
*/
|
|
1026
|
+
applyWorkspace(workspace: Workspace): Promise<void>;
|
|
894
1027
|
/**
|
|
895
1028
|
* The browser window factory for the Workspace Platform.
|
|
896
1029
|
*/
|
|
@@ -930,6 +1063,31 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
930
1063
|
* @param id of the id of the page to delete.
|
|
931
1064
|
*/
|
|
932
1065
|
deleteSavedPage(id: string): Promise<void>;
|
|
1066
|
+
/**
|
|
1067
|
+
* Implementation for getting a list of saved workspaces from persistent storage.
|
|
1068
|
+
* @param query an optional query.
|
|
1069
|
+
*/
|
|
1070
|
+
getSavedWorkspaces(query?: string): Promise<Workspace[]>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Implementation for getting a single workspace in persistent storage.
|
|
1073
|
+
* @param id
|
|
1074
|
+
*/
|
|
1075
|
+
getSavedWorkspace(id: string): Promise<Workspace>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Implementation for creating a saved workspace in persistent storage.
|
|
1078
|
+
* @param req the create saved workspace request.
|
|
1079
|
+
*/
|
|
1080
|
+
createSavedWorkspace(req: CreateSavedWorkspaceRequest): Promise<void>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Implementation for updating a saved workspace in persistent storage.
|
|
1083
|
+
* @param req the update saved workspace request.
|
|
1084
|
+
*/
|
|
1085
|
+
updateSavedWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
|
|
1086
|
+
/**
|
|
1087
|
+
* Implementation for deleting a saved workspace in persistent storage.
|
|
1088
|
+
* @param id of the id of the workspace to delete.
|
|
1089
|
+
*/
|
|
1090
|
+
deleteSavedWorkspace(id: string): Promise<void>;
|
|
933
1091
|
/**
|
|
934
1092
|
* Implementation for showing a global context menu given a menu template,
|
|
935
1093
|
* handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
|
|
@@ -951,6 +1109,13 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
951
1109
|
* @param callerIdentity OF identity of the entity from which the request originated
|
|
952
1110
|
*/
|
|
953
1111
|
openPageTabContextMenu(req: OpenPageTabContextMenuPayload, callerIdentity: OpenFin.Identity): any;
|
|
1112
|
+
/**
|
|
1113
|
+
* Implementation for showing a context menu for save button given a menu template,
|
|
1114
|
+
* handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
|
|
1115
|
+
* @param req the payload received by the provider call
|
|
1116
|
+
* @param callerIdentity OF identity of the entity from which the request originated
|
|
1117
|
+
*/
|
|
1118
|
+
openSaveButtonContextMenu(req: OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity): any;
|
|
954
1119
|
}
|
|
955
1120
|
/**
|
|
956
1121
|
* The origins from which a custom action can be invoked
|
|
@@ -960,6 +1125,7 @@ export declare enum CustomActionCallerType {
|
|
|
960
1125
|
GlobalContextMenu = "GlobalContextMenu",
|
|
961
1126
|
ViewTabContextMenu = "ViewTabContextMenu",
|
|
962
1127
|
PageTabContextMenu = "PageTabContextMenu",
|
|
1128
|
+
SaveButtonContextMenu = "SaveButtonContextMenu",
|
|
963
1129
|
API = "API"
|
|
964
1130
|
}
|
|
965
1131
|
/**The payload received by a Custom Action.
|
|
@@ -967,7 +1133,7 @@ export declare enum CustomActionCallerType {
|
|
|
967
1133
|
* When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
|
|
968
1134
|
export declare type CustomActionPayload = {
|
|
969
1135
|
callerType: CustomActionCallerType.API;
|
|
970
|
-
} | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload;
|
|
1136
|
+
} | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
971
1137
|
/**
|
|
972
1138
|
* Configures a custom action when the control is invoked
|
|
973
1139
|
*/
|
|
@@ -1095,7 +1261,31 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1095
1261
|
* }, callerIdentity);
|
|
1096
1262
|
* };
|
|
1097
1263
|
*
|
|
1098
|
-
*
|
|
1264
|
+
* // add a custom menu item in Save Context Menu
|
|
1265
|
+
* openSaveButtonContextMenu = (req: WorkspacePlatform.OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity) => {
|
|
1266
|
+
* return super.openSaveButtonContextMenu(
|
|
1267
|
+
* {
|
|
1268
|
+
* ...req,
|
|
1269
|
+
* template: [
|
|
1270
|
+
* ...req.template,
|
|
1271
|
+
* {
|
|
1272
|
+
* label: 'Save custom option',
|
|
1273
|
+
* data: {
|
|
1274
|
+
* type: SaveButtonContextMenuOptionType.Custom,
|
|
1275
|
+
* action: {
|
|
1276
|
+
* id: 'sample-custom-action-name',
|
|
1277
|
+
* customData: {
|
|
1278
|
+
* someProp: 'Save Button task'
|
|
1279
|
+
* }
|
|
1280
|
+
* }
|
|
1281
|
+
* }
|
|
1282
|
+
* }
|
|
1283
|
+
* ]
|
|
1284
|
+
* },
|
|
1285
|
+
* callerIdentity
|
|
1286
|
+
* );
|
|
1287
|
+
* }
|
|
1288
|
+
* }
|
|
1099
1289
|
* }
|
|
1100
1290
|
* return new Override();
|
|
1101
1291
|
* };
|
|
@@ -1141,3 +1331,43 @@ export interface BrowserInitConfig {
|
|
|
1141
1331
|
*/
|
|
1142
1332
|
interopOverride?: OpenFin.OverrideCallback<InteropBroker, InteropBroker>;
|
|
1143
1333
|
}
|
|
1334
|
+
interface WorkspaceMetadata {
|
|
1335
|
+
APIVersion: string;
|
|
1336
|
+
timestamp: string;
|
|
1337
|
+
}
|
|
1338
|
+
export interface Workspace {
|
|
1339
|
+
workspaceId: string;
|
|
1340
|
+
title: string;
|
|
1341
|
+
metadata: WorkspaceMetadata;
|
|
1342
|
+
snapshot: OpenFin.Snapshot;
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Request for creating a saved workspace in persistent storage.
|
|
1346
|
+
*/
|
|
1347
|
+
export interface CreateSavedWorkspaceRequest {
|
|
1348
|
+
/** The workspace to create. */
|
|
1349
|
+
workspace: Workspace;
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Request for updating a saved workspace in persistent storage.
|
|
1353
|
+
*/
|
|
1354
|
+
export interface UpdateSavedWorkspaceRequest {
|
|
1355
|
+
/** The ID of the workspace to update. */
|
|
1356
|
+
workspaceId: string;
|
|
1357
|
+
/** The updated workspace. */
|
|
1358
|
+
workspace: Workspace;
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Request to create a save modal.
|
|
1362
|
+
* @private
|
|
1363
|
+
*/
|
|
1364
|
+
export declare type OpenSaveMenuRequest = {
|
|
1365
|
+
x?: number;
|
|
1366
|
+
y?: number;
|
|
1367
|
+
} & ({
|
|
1368
|
+
menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
|
|
1369
|
+
id: string;
|
|
1370
|
+
} | {
|
|
1371
|
+
menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
|
|
1372
|
+
id?: never;
|
|
1373
|
+
});
|
|
@@ -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>;
|
|
@@ -14,7 +14,7 @@ export declare enum PageRoute {
|
|
|
14
14
|
BrowserPopupMenu = "/browser/popup-menu/",
|
|
15
15
|
Provider = "/provider/",
|
|
16
16
|
BrowserPopupMenuSharePage = "/browser/popup-menu/share-page/",
|
|
17
|
-
|
|
17
|
+
BrowserPopupMenuSaveModal = "/browser/popup-menu/save-modal/",
|
|
18
18
|
BrowserPopupMenuLayouts = "/browser/popup-menu/layouts/layouts/",
|
|
19
19
|
BrowserPopupMenuColorLinking = "/browser/popup-menu/color-linking/color-linking/",
|
|
20
20
|
BrowserIndicator = "/browser/indicator/",
|
|
@@ -41,7 +41,7 @@ declare const _default: {
|
|
|
41
41
|
BrowserPopupMenu: PageRoute.BrowserPopupMenu;
|
|
42
42
|
Provider: PageRoute.Provider;
|
|
43
43
|
BrowserPopupMenuSharePage: PageRoute.BrowserPopupMenuSharePage;
|
|
44
|
-
|
|
44
|
+
BrowserPopupMenuSaveModal: PageRoute.BrowserPopupMenuSaveModal;
|
|
45
45
|
BrowserPopupMenuLayouts: PageRoute.BrowserPopupMenuLayouts;
|
|
46
46
|
BrowserPopupMenuColorLinking: PageRoute.BrowserPopupMenuColorLinking;
|
|
47
47
|
BrowserIndicator: PageRoute.BrowserIndicator;
|