@openfin/workspace 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.
@@ -1,9 +1,16 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest, OpenPageTabContextMenuPayload, OpenPageTabContextMenuRequest, OpenSaveButtonContextMenuPayload, OpenSaveButtonContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest, WorkspacePlatformProvider } from '../../../../client-api-platform/src/shapes';
3
- export declare function openGlobalContextMenuInternal(this: WorkspacePlatformProvider, payload: OpenGlobalContextMenuRequest & {
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>;
@@ -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>;
@@ -4,7 +4,7 @@ import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/ut
4
4
  import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
5
5
  import { Resource } from '../../common/src/api/i18next';
6
6
  import { TrackedSite } from '../../common/src/api/pages/idb';
7
- import type { AttachedPage, CopyPagePayload, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult } from '../../common/src/api/pages/shapes';
7
+ import type { AddDefaultPagePayload, AttachedPage, CopyPagePayload, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult } from '../../common/src/api/pages/shapes';
8
8
  import { SetActivePageForWindowPayload } from '../../common/src/api/pages/shapes';
9
9
  import { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
10
10
  import type { CustomThemes } from '../../common/src/api/theming';
@@ -87,9 +87,9 @@ export interface ReorderPagesRequest {
87
87
  * Request for opening a logo context menu in Browser.
88
88
  */
89
89
  export interface OpenGlobalContextMenuRequest {
90
- /** Screen x-coordinate where context menu should be shown. */
90
+ /** Client x-coordinate where context menu should be shown. */
91
91
  x: number;
92
- /** Screen y-coordinate where context menu should be shown. */
92
+ /** Client y-coordinate where context menu should be shown. */
93
93
  y: number;
94
94
  /** Miscellaneous options necessary for implementing custom logic in the provider override. */
95
95
  customData?: any;
@@ -154,6 +154,7 @@ export declare enum PageTabContextMenuOptionType {
154
154
  Rename = "Rename",
155
155
  Save = "Save",
156
156
  SaveAs = "Save As",
157
+ DeletePage = "Delete Page",
157
158
  SaveWorkspaceAs = "SaveWorkspaceAs",
158
159
  Refresh = "Refresh",
159
160
  CloseOthers = "Close others",
@@ -224,28 +225,37 @@ export type OpenGlobalContextMenuPayload = OpenGlobalContextMenuRequest & {
224
225
  /** Default function that handles stock context menu options. */
225
226
  callback: (data: GlobalContextMenuItemData, payload: OpenGlobalContextMenuPayload) => any;
226
227
  };
228
+ /**
229
+ * Request for opening the global context menu with custom context menu in Enterprise Browser.
230
+ * @internal
231
+ */
232
+ export type InternalOpenGlobalContextMenuRequest = OpenGlobalContextMenuRequest & {
233
+ /** Coordinates associated with a target element for a custom context menu request. */
234
+ rect?: DOMRect;
235
+ };
227
236
  export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate<ViewTabMenuData>;
228
237
  /**
229
238
  * Request for opening a view tab context menu in Browser.
230
239
  */
231
240
  export interface OpenViewTabContextMenuRequest {
232
- /** Screen x-coordinate where context menu should be shown. */
241
+ /** Client x-coordinate where context menu should be shown. */
233
242
  x: number;
234
- /** Screen y-coordinate where context menu should be shown. */
243
+ /** Client y-coordinate where context menu should be shown. */
235
244
  y: number;
236
245
  /** Miscellaneous options necessary for implementing custom logic in the provider override. */
237
246
  customData?: any;
238
247
  /** Template defining the options to show in the context menu. */
239
248
  template: ViewTabContextMenuTemplate[];
249
+ /** Ids of selected views */
240
250
  selectedViews: OpenFin.Identity[];
241
251
  }
242
252
  /**
243
253
  * Request for opening a page tab context menu in Browser.
244
254
  */
245
255
  export interface OpenPageTabContextMenuRequest {
246
- /** Screen x-coordinate where context menu should be shown. */
256
+ /** Client x-coordinate where context menu should be shown. */
247
257
  x: number;
248
- /** Screen y-coordinate where context menu should be shown. */
258
+ /** Client y-coordinate where context menu should be shown. */
249
259
  y: number;
250
260
  /** Miscellaneous options necessary for implementing custom logic in the provider override. */
251
261
  customData?: any;
@@ -522,9 +532,9 @@ export interface SaveButtonContextMenuItemTemplate extends OpenFin.MenuItemTempl
522
532
  * Request for opening a context menu from save button in Browser.
523
533
  */
524
534
  export interface OpenSaveButtonContextMenuRequest {
525
- /** Screen x-coordinate where context menu should be shown. */
535
+ /** Client x-coordinate where context menu should be shown. */
526
536
  x: number;
527
- /** Screen y-coordinate where context menu should be shown. */
537
+ /** Client y-coordinate where context menu should be shown. */
528
538
  y: number;
529
539
  /** Screen x-coordinate of save button */
530
540
  buttonLeft: number;
@@ -985,7 +995,7 @@ export interface BrowserWindowModule {
985
995
  * @param req the global context menu request.
986
996
  * @internal
987
997
  */
988
- _openGlobalContextMenu(req: OpenGlobalContextMenuRequest): Promise<void>;
998
+ _openGlobalContextMenu(req: InternalOpenGlobalContextMenuRequest): Promise<void>;
989
999
  /** @internal */
990
1000
  _openViewTabContextMenu(req: OpenViewTabContextMenuRequest): Promise<void>;
991
1001
  /** @internal */
@@ -1028,6 +1038,19 @@ export interface BrowserWindowModule {
1028
1038
  _reparentPage(req: ReparentPageRequest & {
1029
1039
  index?: number;
1030
1040
  }): Promise<void>;
1041
+ /**
1042
+ * ```ts
1043
+ *
1044
+ * const newPage = await makeNewLandingPage();
1045
+ * const { newPageUrl } = await getLandingPageUrls();
1046
+ * const browser = getCurrentSync().Browser.wrapSync(currentOFIdentity);
1047
+ * const actualNewPageUrl = newPageUrl ? newPageUrl : undefined;
1048
+ * await browser._addDefaultPage({ identity: currentOFIdentity, page: newPage, newPageUrl: actualNewPageUrl });
1049
+ * ```
1050
+ * @param req the default page request object
1051
+ * @internal
1052
+ */
1053
+ _addDefaultPage(req: AddDefaultPagePayload): Promise<void>;
1031
1054
  /** @internal */
1032
1055
  _trackRemovedTab(req: any): Promise<void>;
1033
1056
  /** @internal */
@@ -1053,6 +1076,7 @@ export type NavigationRequest = {
1053
1076
  viewIdentity: OpenFin.Identity;
1054
1077
  } & ({
1055
1078
  action: 'result-selected';
1079
+ trigger?: SiteAction;
1056
1080
  site: Site;
1057
1081
  } | (SearchSitesRequest & {
1058
1082
  action: 'search-input';
@@ -1066,29 +1090,53 @@ export type SearchSitesRequest = {
1066
1090
  /**
1067
1091
  * @internal
1068
1092
  */
1069
- export type SearchSitesResponse = {
1070
- suggestions?: Site[];
1071
- favorites?: Site[];
1072
- bookmarks?: Site[];
1073
- platformContent?: Site[];
1093
+ export type SearchSitesResponse = Record<string, Site[]>;
1094
+ /**
1095
+ * @internal
1096
+ */
1097
+ export type SiteAction = {
1098
+ id: string;
1099
+ title: string;
1100
+ altText?: string;
1101
+ lightIcon?: string;
1102
+ darkIcon?: string;
1074
1103
  };
1075
1104
  /**
1076
1105
  * @internal
1077
1106
  */
1078
- export type Site = {
1107
+ export type SiteInfo = {
1079
1108
  id: string;
1080
1109
  title: string;
1110
+ subTitle?: string;
1081
1111
  cta?: string;
1112
+ actions?: SiteAction[];
1113
+ };
1114
+ /**
1115
+ * @internal
1116
+ */
1117
+ export type AppSite = SiteInfo & {
1082
1118
  type: 'app' | 'website';
1083
- url: string;
1119
+ url?: string;
1084
1120
  icon: string;
1085
1121
  customData?: unknown;
1086
- } | {
1087
- id: string;
1088
- title: string;
1089
- cta?: string;
1122
+ };
1123
+ /**
1124
+ * @internal
1125
+ */
1126
+ export type WorkspaceSite = SiteInfo & {
1090
1127
  type: 'page' | 'workspace';
1091
1128
  };
1129
+ /**
1130
+ * @internal
1131
+ */
1132
+ export type Site = AppSite | WorkspaceSite;
1133
+ /**
1134
+ * @internal
1135
+ * action is undefined when the site is actioned with the default action.
1136
+ */
1137
+ export type ActionedSite = Site & {
1138
+ action?: SiteAction;
1139
+ };
1092
1140
  /**
1093
1141
  * Factory for wrapping browser windows and global operations.
1094
1142
  */
@@ -1820,6 +1868,11 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1820
1868
  * @param locale in ISO language code format
1821
1869
  */
1822
1870
  setLanguage(locale: Locale): Promise<void>;
1871
+ /**
1872
+ * Implementation for adding custom default page
1873
+ * @param payload {@link AddDefaultPagePayload}
1874
+ */
1875
+ addDefaultPage(payload: AddDefaultPagePayload): Promise<void>;
1823
1876
  /** @internal */
1824
1877
  restoreRemovedTabInternal(): Promise<void>;
1825
1878
  /** @internal */
@@ -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 default function showContextMenu(opts: OpenFin.ShowPopupMenuOptions, win?: OpenFin.Window): Promise<ShowContextMenuResponse>;
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>;