@openfin/workspace 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.
Files changed (35) hide show
  1. package/client-api-platform/src/api/browser/browser-module.d.ts +3 -1
  2. package/client-api-platform/src/api/browser/index.d.ts +2 -0
  3. package/client-api-platform/src/api/context-menu/browser-savebutton-handler.d.ts +3 -0
  4. package/client-api-platform/src/api/context-menu/index.d.ts +6 -3
  5. package/client-api-platform/src/api/protocol.d.ts +11 -1
  6. package/client-api-platform/src/api/storage.d.ts +7 -1
  7. package/client-api-platform/src/api/utils.d.ts +1 -0
  8. package/client-api-platform/src/api/workspaces/idb.d.ts +12 -0
  9. package/client-api-platform/src/api/workspaces/index.d.ts +32 -0
  10. package/client-api-platform/src/shapes.d.ts +269 -5
  11. package/common/src/api/browser-protocol.d.ts +6 -1
  12. package/common/src/components/Indicator/Indicator.constants.d.ts +18 -0
  13. package/common/src/utils/a11y/search.a11y.d.ts +31 -0
  14. package/common/src/utils/a11y/speak.d.ts +6 -0
  15. package/common/src/utils/context-menu.d.ts +4 -0
  16. package/common/src/utils/env.d.ts +1 -0
  17. package/common/src/utils/global-context-menu.d.ts +13 -1
  18. package/common/src/utils/indicators/browser.d.ts +16 -0
  19. package/common/src/utils/indicators/helper.d.ts +2 -0
  20. package/common/src/utils/local-storage-key.d.ts +1 -1
  21. package/common/src/utils/route.d.ts +2 -2
  22. package/common/src/utils/router/base.d.ts +61 -0
  23. package/common/src/utils/router/index.d.ts +2 -0
  24. package/common/src/utils/router/next.d.ts +43 -0
  25. package/common/src/utils/save-button-context-menu.d.ts +2 -0
  26. package/common/src/utils/usage-register.d.ts +11 -0
  27. package/home.js +1 -1
  28. package/home.js.map +1 -1
  29. package/index.js +1 -1
  30. package/index.js.map +1 -1
  31. package/notifications.js +3 -3
  32. package/notifications.js.map +1 -1
  33. package/package.json +1 -1
  34. package/store.js +1 -1
  35. package/store.js.map +1 -1
@@ -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
- InvokeCustomActionInternal = "invokeCustomActionInternal"
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 { AttachedPage, Page, PageWithUpdatableRuntimeAttribs, PageLayout, PageLayoutDetails } from '../../common/src/api/pages/shapes';
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
  */
@@ -550,6 +611,30 @@ export interface BrowserWindowModule {
550
611
  _openGlobalContextMenu(req: OpenGlobalContextMenuRequest): Promise<void>;
551
612
  _openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise<void>;
552
613
  _openPageTabContextMenu(req: OpenPageTabContextMenuRequest): Promise<void>;
614
+ _openSaveButtonContextMenu(req: OpenSaveButtonContextMenuRequest): Promise<void>;
615
+ /**
616
+ * ```ts
617
+ * import * as WorkspacePlatform from '@openfin/workspace-platform
618
+ *
619
+ * const browserIdentity = {
620
+ * name: 'example-browser-window-name',
621
+ * uuid:'my-app-id'
622
+ * };
623
+ *
624
+ * const wp = WorkspacePlatform.getCurrentSync();
625
+ *
626
+ * // eslint-disable-next-line no-underscore-dangle
627
+ * wp.Browser.wrapSync(browserIdentity)._openSaveModal({
628
+ * id: 'my-page-id',
629
+ * menuType: WorkspacePlatform.SaveModalType.SAVE_PAGE_AS,
630
+ * x: 50,
631
+ * y: 50
632
+ * });
633
+ * ```
634
+ * @param req the modal request object
635
+ * @internal
636
+ */
637
+ _openSaveModal(req: OpenSaveMenuRequest): Promise<NamedIdentity>;
553
638
  }
554
639
  /**
555
640
  * Factory for wrapping browser windows and global operations.
@@ -857,6 +942,62 @@ export interface WorkspacePlatformStorage {
857
942
  * @param page the page to save.
858
943
  */
859
944
  savePage(page: Page): Promise<void>;
945
+ /**
946
+ * Get all workspaces that are saved in persistent storage.
947
+ *
948
+ * ```ts
949
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
950
+ *
951
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
952
+ * const workspaces = await workspacePlatform.Storage.getWorkspaces();
953
+ * ```
954
+ */
955
+ getWorkspaces(): Promise<Workspace[]>;
956
+ /**
957
+ * Get a specific workspace in persistent storage.
958
+ *
959
+ * ```ts
960
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
961
+ *
962
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
963
+ * const myWorkspace = await workspacePlatform.Storage.getWorkspace('myWorkspaceId');
964
+ * ```
965
+ * @param id the id of the workspace to get.
966
+ */
967
+ getWorkspace(id: string): Promise<Workspace>;
968
+ /**
969
+ * Create a workspace in persistent storage.
970
+ *
971
+ * @param workspace the workspace to create in persistent storage.
972
+ */
973
+ createWorkspace(workspace: CreateSavedWorkspaceRequest): Promise<void>;
974
+ /**
975
+ * Update a workspace in persistent storage.
976
+ * @param req the update saved workspace request.
977
+ */
978
+ updateWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
979
+ /**
980
+ * Delete a workspace from persistent storage.
981
+ *
982
+ * ```ts
983
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
984
+ *
985
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
986
+ * await workspacePlatform.Storage.deleteWorkspace('myWorkspaceId');
987
+ * ```
988
+ * @param id the id of the workspace to delete.
989
+ */
990
+ deleteWorkspace(id: string): Promise<void>;
991
+ /**
992
+ * Save a workspace in persistent storage.
993
+ *
994
+ * This is a helper function that will call `getWorkspace` to determine if a workspace is already in storage.
995
+ * If the workspace is already in storage, it will call `updateWorkspace`.
996
+ * If it does not exist in storage, the function will call `createWorkspace` instead.
997
+ *
998
+ * @param workspace the workspace to save.
999
+ */
1000
+ saveWorkspace(workspace: Workspace): Promise<void>;
860
1001
  }
861
1002
  /**
862
1003
  * Request for launching an application.
@@ -917,6 +1058,21 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
917
1058
  * @param req the launch app request.
918
1059
  */
919
1060
  launchApp(req: LaunchAppRequest): Promise<void>;
1061
+ /**
1062
+ * Gets a workspace data structure that represents the current state of the user's desktop.
1063
+ */
1064
+ getCurrentWorkspace(): Promise<Workspace>;
1065
+ /**
1066
+ * Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.
1067
+ * @param workspace the workspace to set as current active workspace.
1068
+ */
1069
+ setActiveWorkspace(workspace: Workspace): Promise<void>;
1070
+ /**
1071
+ * Closes content from the current workspace and applies the given workspace to the user's desktop. Makes that
1072
+ * workspace the active workspace.
1073
+ * @param workspace the workspace to apply to the desktop and set as the current active workspace.
1074
+ */
1075
+ applyWorkspace(workspace: Workspace): Promise<void>;
920
1076
  /**
921
1077
  * The browser window factory for the Workspace Platform.
922
1078
  */
@@ -956,6 +1112,31 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
956
1112
  * @param id of the id of the page to delete.
957
1113
  */
958
1114
  deleteSavedPage(id: string): Promise<void>;
1115
+ /**
1116
+ * Implementation for getting a list of saved workspaces from persistent storage.
1117
+ * @param query an optional query.
1118
+ */
1119
+ getSavedWorkspaces(query?: string): Promise<Workspace[]>;
1120
+ /**
1121
+ * Implementation for getting a single workspace in persistent storage.
1122
+ * @param id
1123
+ */
1124
+ getSavedWorkspace(id: string): Promise<Workspace>;
1125
+ /**
1126
+ * Implementation for creating a saved workspace in persistent storage.
1127
+ * @param req the create saved workspace request.
1128
+ */
1129
+ createSavedWorkspace(req: CreateSavedWorkspaceRequest): Promise<void>;
1130
+ /**
1131
+ * Implementation for updating a saved workspace in persistent storage.
1132
+ * @param req the update saved workspace request.
1133
+ */
1134
+ updateSavedWorkspace(req: UpdateSavedWorkspaceRequest): Promise<void>;
1135
+ /**
1136
+ * Implementation for deleting a saved workspace in persistent storage.
1137
+ * @param id of the id of the workspace to delete.
1138
+ */
1139
+ deleteSavedWorkspace(id: string): Promise<void>;
959
1140
  /**
960
1141
  * Implementation for showing a global context menu given a menu template,
961
1142
  * handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
@@ -977,6 +1158,13 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
977
1158
  * @param callerIdentity OF identity of the entity from which the request originated
978
1159
  */
979
1160
  openPageTabContextMenu(req: OpenPageTabContextMenuPayload, callerIdentity: OpenFin.Identity): any;
1161
+ /**
1162
+ * Implementation for showing a context menu for save button given a menu template,
1163
+ * handler callback, and screen coordinates. For an example of overriding, see {@link BrowserOverrideCallback}.
1164
+ * @param req the payload received by the provider call
1165
+ * @param callerIdentity OF identity of the entity from which the request originated
1166
+ */
1167
+ openSaveButtonContextMenu(req: OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity): any;
980
1168
  }
981
1169
  /**
982
1170
  * The origins from which a custom action can be invoked
@@ -986,6 +1174,7 @@ export declare enum CustomActionCallerType {
986
1174
  GlobalContextMenu = "GlobalContextMenu",
987
1175
  ViewTabContextMenu = "ViewTabContextMenu",
988
1176
  PageTabContextMenu = "PageTabContextMenu",
1177
+ SaveButtonContextMenu = "SaveButtonContextMenu",
989
1178
  API = "API"
990
1179
  }
991
1180
  /**The payload received by a Custom Action.
@@ -993,7 +1182,7 @@ export declare enum CustomActionCallerType {
993
1182
  * When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
994
1183
  export declare type CustomActionPayload = {
995
1184
  callerType: CustomActionCallerType.API;
996
- } | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload;
1185
+ } | CustomButtonActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
997
1186
  /**
998
1187
  * Configures a custom action when the control is invoked
999
1188
  */
@@ -1129,7 +1318,31 @@ export interface WorkspacePlatformInitConfig {
1129
1318
  * }, callerIdentity);
1130
1319
  * };
1131
1320
  *
1132
- *
1321
+ * // add a custom menu item in Save Context Menu
1322
+ * openSaveButtonContextMenu = (req: WorkspacePlatform.OpenSaveButtonContextMenuPayload, callerIdentity: OpenFin.Identity) => {
1323
+ * return super.openSaveButtonContextMenu(
1324
+ * {
1325
+ * ...req,
1326
+ * template: [
1327
+ * ...req.template,
1328
+ * {
1329
+ * label: 'Save custom option',
1330
+ * data: {
1331
+ * type: SaveButtonContextMenuOptionType.Custom,
1332
+ * action: {
1333
+ * id: 'sample-custom-action-name',
1334
+ * customData: {
1335
+ * someProp: 'Save Button task'
1336
+ * }
1337
+ * }
1338
+ * }
1339
+ * }
1340
+ * ]
1341
+ * },
1342
+ * callerIdentity
1343
+ * );
1344
+ * }
1345
+ * }
1133
1346
  * }
1134
1347
  * return new Override();
1135
1348
  * };
@@ -1175,3 +1388,54 @@ export interface BrowserInitConfig {
1175
1388
  */
1176
1389
  interopOverride?: OpenFin.OverrideCallback<InteropBroker, InteropBroker>;
1177
1390
  }
1391
+ interface WorkspaceMetadata {
1392
+ APIVersion: string;
1393
+ timestamp: string;
1394
+ }
1395
+ export interface Workspace {
1396
+ workspaceId: string;
1397
+ title: string;
1398
+ metadata: WorkspaceMetadata;
1399
+ snapshot: OpenFin.Snapshot;
1400
+ }
1401
+ /**
1402
+ * Request for creating a saved workspace in persistent storage.
1403
+ */
1404
+ export interface CreateSavedWorkspaceRequest {
1405
+ /** The workspace to create. */
1406
+ workspace: Workspace;
1407
+ }
1408
+ /**
1409
+ * Request for updating a saved workspace in persistent storage.
1410
+ */
1411
+ export interface UpdateSavedWorkspaceRequest {
1412
+ /** The ID of the workspace to update. */
1413
+ workspaceId: string;
1414
+ /** The updated workspace. */
1415
+ workspace: Workspace;
1416
+ }
1417
+ /**
1418
+ * @internal
1419
+ */
1420
+ export declare enum SaveModalType {
1421
+ SAVE_PAGE = "SAVE_PAGE",
1422
+ SAVE_WORKSPACE = "SAVE_WORKSPACE",
1423
+ SAVE_PAGE_AS = "SAVE_PAGE_AS",
1424
+ SAVE_WORKSPACE_AS = "SAVE_WORKSPACE_AS",
1425
+ RENAME_PAGE = "RENAME_PAGE",
1426
+ RENAME_WORKSPACE = "RENAME_WORKSPACE"
1427
+ }
1428
+ /**
1429
+ * Request to create a save modal.
1430
+ * @private
1431
+ */
1432
+ export declare type OpenSaveMenuRequest = {
1433
+ x?: number;
1434
+ y?: number;
1435
+ } & ({
1436
+ menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
1437
+ id: string;
1438
+ } | {
1439
+ menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
1440
+ id?: never;
1441
+ });
@@ -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
- SavePage = "save-page",
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 { GlobalContextMenuItemTemplate } from '../../../client-api-platform/src/shapes';
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>;
@@ -0,0 +1,2 @@
1
+ /// <reference types="openfin-adapter/fin" />
2
+ export default function makeShowIndicator(opts?: OpenFin.PlatformWindowCreationOptions): (namespace: string, url: string, message: string, type: string) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  declare enum LocalStorageKey {
2
- LastLaunchedWorkspaceId = "activeWorkspaceId",
2
+ CurrentWorkspaceId = "currentWorkspaceId",
3
3
  LastFocusedBrowserWindow = "lastFocusedBrowserWindow",
4
4
  MachineName = "machineName",
5
5
  NewTabPageLayout = "NewTabPageLayout",