@openfin/workspace-platform 18.1.22 → 18.1.24
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/context-menu/index.d.ts +10 -3
- package/client-api-platform/src/api/context-menu/index.test.d.ts +1 -0
- package/client-api-platform/src/api/context-menu/utils.d.ts +1 -0
- package/client-api-platform/src/shapes.d.ts +16 -9
- package/common/src/api/pages/shapes.d.ts +14 -0
- package/common/src/api/protocol/workspace-platform.d.ts +2 -0
- package/common/src/utils/context-menu.d.ts +3 -1
- package/common/src/utils/route.d.ts +2 -1
- package/common/src/utils/window.d.ts +1 -0
- package/common/src/utils/workspace-modals.d.ts +2 -0
- package/index.js +118 -5
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
2
|
+
import { InternalOpenGlobalContextMenuRequest, OpenGlobalContextMenuPayload, OpenPageTabContextMenuPayload, OpenPageTabContextMenuRequest, OpenSaveButtonContextMenuPayload, OpenSaveButtonContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest, WorkspacePlatformProvider } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare enum AnchorBehavior {
|
|
4
|
+
BottomLeft = 0,
|
|
5
|
+
BottomRight = 1,
|
|
6
|
+
TopLeft = 2,
|
|
7
|
+
TopRight = 3,
|
|
8
|
+
Center = 4
|
|
9
|
+
}
|
|
10
|
+
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload, _callerIdentity: OpenFin.Identity, anchorBehavior?: AnchorBehavior) => Promise<void>;
|
|
11
|
+
export declare function openGlobalContextMenuInternal(this: WorkspacePlatformProvider, payload: InternalOpenGlobalContextMenuRequest & {
|
|
4
12
|
identity: OpenFin.Identity;
|
|
5
13
|
}, callerIdentity: OpenFin.Identity): Promise<void>;
|
|
6
|
-
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload, _callerIdentity: OpenFin.Identity) => Promise<void>;
|
|
7
14
|
export declare function openViewTabContextMenuInternal(this: WorkspacePlatformProvider, payload: OpenViewTabContextMenuRequest & {
|
|
8
15
|
identity: OpenFin.Identity;
|
|
9
16
|
}, callerIdentity: OpenFin.Identity): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@common/test/fin-mocks';
|
|
@@ -40,3 +40,4 @@ export declare const closeOtherPagesHandler: (identity: OpenFin.Identity, pageId
|
|
|
40
40
|
* @param viewIdentities Array of views to execute print on.
|
|
41
41
|
*/
|
|
42
42
|
export declare const printSelectedViews: (viewIdentities: OpenFin.Identity[]) => Promise<void>;
|
|
43
|
+
export declare const deletePageHandler: (identity: OpenFin.Identity, pageId?: string) => Promise<void>;
|
|
@@ -2,7 +2,7 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { IconProps, Languages } from '@openfin/ui-library';
|
|
3
3
|
import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
|
|
4
4
|
import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
5
|
-
import type { AttachedPage, CopyPagePayload, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult } from '../../common/src/api/pages/shapes';
|
|
5
|
+
import type { AddDefaultPagePayload, AttachedPage, CopyPagePayload, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult } from '../../common/src/api/pages/shapes';
|
|
6
6
|
import { SetActivePageForWindowPayload } from '../../common/src/api/pages/shapes';
|
|
7
7
|
import { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
|
|
8
8
|
import type { CustomThemes } from '../../common/src/api/theming';
|
|
@@ -85,9 +85,9 @@ export interface ReorderPagesRequest {
|
|
|
85
85
|
* Request for opening a logo context menu in Browser.
|
|
86
86
|
*/
|
|
87
87
|
export interface OpenGlobalContextMenuRequest {
|
|
88
|
-
/**
|
|
88
|
+
/** Client x-coordinate where context menu should be shown. */
|
|
89
89
|
x: number;
|
|
90
|
-
/**
|
|
90
|
+
/** Client y-coordinate where context menu should be shown. */
|
|
91
91
|
y: number;
|
|
92
92
|
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
93
93
|
customData?: any;
|
|
@@ -152,6 +152,7 @@ export declare enum PageTabContextMenuOptionType {
|
|
|
152
152
|
Rename = "Rename",
|
|
153
153
|
Save = "Save",
|
|
154
154
|
SaveAs = "Save As",
|
|
155
|
+
DeletePage = "Delete Page",
|
|
155
156
|
SaveWorkspaceAs = "SaveWorkspaceAs",
|
|
156
157
|
Refresh = "Refresh",
|
|
157
158
|
CloseOthers = "Close others",
|
|
@@ -212,23 +213,24 @@ export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate<ViewTabMenuDat
|
|
|
212
213
|
* Request for opening a view tab context menu in Browser.
|
|
213
214
|
*/
|
|
214
215
|
export interface OpenViewTabContextMenuRequest {
|
|
215
|
-
/**
|
|
216
|
+
/** Client x-coordinate where context menu should be shown. */
|
|
216
217
|
x: number;
|
|
217
|
-
/**
|
|
218
|
+
/** Client y-coordinate where context menu should be shown. */
|
|
218
219
|
y: number;
|
|
219
220
|
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
220
221
|
customData?: any;
|
|
221
222
|
/** Template defining the options to show in the context menu. */
|
|
222
223
|
template: ViewTabContextMenuTemplate[];
|
|
224
|
+
/** Ids of selected views */
|
|
223
225
|
selectedViews: OpenFin.Identity[];
|
|
224
226
|
}
|
|
225
227
|
/**
|
|
226
228
|
* Request for opening a page tab context menu in Browser.
|
|
227
229
|
*/
|
|
228
230
|
export interface OpenPageTabContextMenuRequest {
|
|
229
|
-
/**
|
|
231
|
+
/** Client x-coordinate where context menu should be shown. */
|
|
230
232
|
x: number;
|
|
231
|
-
/**
|
|
233
|
+
/** Client y-coordinate where context menu should be shown. */
|
|
232
234
|
y: number;
|
|
233
235
|
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
234
236
|
customData?: any;
|
|
@@ -505,9 +507,9 @@ export interface SaveButtonContextMenuItemTemplate extends OpenFin.MenuItemTempl
|
|
|
505
507
|
* Request for opening a context menu from save button in Browser.
|
|
506
508
|
*/
|
|
507
509
|
export interface OpenSaveButtonContextMenuRequest {
|
|
508
|
-
/**
|
|
510
|
+
/** Client x-coordinate where context menu should be shown. */
|
|
509
511
|
x: number;
|
|
510
|
-
/**
|
|
512
|
+
/** Client y-coordinate where context menu should be shown. */
|
|
511
513
|
y: number;
|
|
512
514
|
/** Screen x-coordinate of save button */
|
|
513
515
|
buttonLeft: number;
|
|
@@ -1662,6 +1664,11 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
1662
1664
|
* @param locale in ISO language code format
|
|
1663
1665
|
*/
|
|
1664
1666
|
setLanguage(locale: Locale): Promise<void>;
|
|
1667
|
+
/**
|
|
1668
|
+
* Implementation for adding custom default page
|
|
1669
|
+
* @param payload {@link AddDefaultPagePayload}
|
|
1670
|
+
*/
|
|
1671
|
+
addDefaultPage(payload: AddDefaultPagePayload): Promise<void>;
|
|
1665
1672
|
}
|
|
1666
1673
|
/**
|
|
1667
1674
|
* The origins from which a custom action can be invoked
|
|
@@ -213,4 +213,18 @@ export interface CopyPagePayload {
|
|
|
213
213
|
/** Specifies the trigger for creating a copy. */
|
|
214
214
|
reason: 'save-as' | 'duplicate';
|
|
215
215
|
}
|
|
216
|
+
export type AddDefaultPagePayload = {
|
|
217
|
+
/** The OF window identity to attach the pages to. */
|
|
218
|
+
identity: OpenFin.Identity;
|
|
219
|
+
/** The page to attach. */
|
|
220
|
+
page: PageWithUpdatableRuntimeAttribs;
|
|
221
|
+
/** The newPageUrl provided. */
|
|
222
|
+
newPageUrl: string;
|
|
223
|
+
};
|
|
224
|
+
export type AddPagePayload = {
|
|
225
|
+
/** The OF window identity to attach the pages to. */
|
|
226
|
+
identity: OpenFin.Identity;
|
|
227
|
+
/** The page to attach. */
|
|
228
|
+
page: PageWithUpdatableRuntimeAttribs;
|
|
229
|
+
};
|
|
216
230
|
export {};
|
|
@@ -24,6 +24,8 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
24
24
|
DetachPagesFromWindow = "detachPagesFromWindow",
|
|
25
25
|
ReorderPagesForWindow = "reorderPagesForWindow",
|
|
26
26
|
SetActivePage = "setActivePage",
|
|
27
|
+
AddPage = "addPage",
|
|
28
|
+
AddDefaultPage = "addDefaultPage",
|
|
27
29
|
GetAllAttachedPages = "getAllAttachedPages",
|
|
28
30
|
GetActivePageIdForWindow = "getActivePageIdForWindow",
|
|
29
31
|
GetPagesForWindow = "getPagesForWindow",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
+
import { AnchorBehavior } from '../../../client-api-platform/src/api/context-menu';
|
|
2
3
|
export declare enum MenuItemType {
|
|
3
4
|
Label = "normal",
|
|
4
5
|
Separator = "separator",
|
|
@@ -8,7 +9,8 @@ export declare enum MenuItemType {
|
|
|
8
9
|
export type ShowContextMenuResponse = OpenFin.MenuResult & {
|
|
9
10
|
data: any;
|
|
10
11
|
};
|
|
11
|
-
export
|
|
12
|
+
export declare function showContextMenu(opts: OpenFin.ShowPopupMenuOptions, win?: OpenFin.Window): Promise<ShowContextMenuResponse>;
|
|
13
|
+
export declare const showEnterpriseContextMenu: (opts: OpenFin.ShowPopupMenuOptions, win?: OpenFin.Window, anchorBehavior?: AnchorBehavior) => Promise<ShowContextMenuResponse>;
|
|
12
14
|
export declare const Separator: OpenFin.MenuItemTemplate;
|
|
13
15
|
export declare const EmptyContextMenuItem: OpenFin.MenuItemTemplate;
|
|
14
16
|
export declare const DefaultSaveMenuBounds: {
|
|
@@ -22,7 +22,8 @@ export declare enum PageRoute {
|
|
|
22
22
|
Storefront = "/storefront/",
|
|
23
23
|
DeprecatedAlert = "/provider/deprecated-alert/",
|
|
24
24
|
Analytics = "/provider/analytics/",
|
|
25
|
-
EnterpriseBrowser = "/browser/enterprise/"
|
|
25
|
+
EnterpriseBrowser = "/browser/enterprise/",
|
|
26
|
+
EnterpriseContextMenu = "/browser/enterprise/context-menu/"
|
|
26
27
|
}
|
|
27
28
|
export declare const Assets: {
|
|
28
29
|
readonly IconOpenFinLogo: "/icons/openfinlogo.svg";
|
|
@@ -10,6 +10,7 @@ export declare enum WindowName {
|
|
|
10
10
|
BrowserIndicator = "openfin-browser-indicator",
|
|
11
11
|
BrowserWindow = "internal-generated-window",
|
|
12
12
|
ClassicWindow = "internal-generated-classic-window",
|
|
13
|
+
EnterpriseContextMenu = "openfin-enterprise-context-menu",
|
|
13
14
|
BrowserAddressSearchPrefix = "openfin-browser-menu-address-search-"
|
|
14
15
|
}
|
|
15
16
|
export interface WindowIdentity {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { ResponseModalConfig } from '../../../common/src/utils/menu-config';
|
|
3
3
|
export declare const restoreChangesMenu: (windowIdentity: OpenFin.Identity) => Promise<ResponseModalConfig>;
|
|
4
|
+
export declare const deletePageMenu: (windowIdentity: OpenFin.Identity, pageTitle: string) => Promise<ResponseModalConfig>;
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
6
7
|
* @param targetWindowIdentity Parent or Current OpenFin Window Identity
|
|
@@ -21,3 +22,4 @@ export declare const showPlatformQuitModal: (windowIdentity: OpenFin.Identity, w
|
|
|
21
22
|
export declare const showQuitBrowserModal: (windowIdentity: OpenFin.Identity) => Promise<boolean>;
|
|
22
23
|
export declare const showRestoreChangesModal: (windowIdentity: OpenFin.Identity) => Promise<boolean>;
|
|
23
24
|
export declare const getOverwriteWorkspaceMenu: (workspaceTitle: string) => Promise<ResponseModalConfig>;
|
|
25
|
+
export declare const showDeletePageModal: (windowIdentity: OpenFin.Identity, pageTitle: string) => Promise<boolean>;
|