@openfin/workspace-platform 22.4.1 → 22.5.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.
@@ -1,5 +1,10 @@
1
1
  import type OpenFin from '@openfin/core';
2
+ import { PositioningType } from '../../../../common/src/utils/positioning';
2
3
  import { WorkspaceContextMenuItemData } from '../../../../client-api-platform/src/shapes';
4
+ export declare const saveWorkspaceHandlerWithInjectables: ({ showModal, afterSuccessSave }: {
5
+ showModal?: () => Promise<void>;
6
+ afterSuccessSave?: () => Promise<void>;
7
+ }) => Promise<void>;
3
8
  export declare const saveWorkspaceHandler: (identity: OpenFin.Identity) => Promise<void>;
4
9
  export declare const saveWorkspaceAsHandler: (identity: OpenFin.Identity) => void;
5
10
  /**
@@ -17,6 +22,11 @@ export declare const savePageHandler: (identity: OpenFin.Identity, pageId?: stri
17
22
  */
18
23
  export declare const savePageAsHandler: (identity: OpenFin.Identity, pageId?: string) => Promise<void>;
19
24
  export declare const switchWorkspaceHandler: (winIdentity: OpenFin.Identity, workspaceItemData: WorkspaceContextMenuItemData) => Promise<void>;
25
+ export declare const deleteWorkspaceHandlerWithPayload: ({ workspaceItemData, winIdentity, positioning }: {
26
+ workspaceItemData: WorkspaceContextMenuItemData;
27
+ winIdentity?: OpenFin.Identity;
28
+ positioning?: PositioningType;
29
+ }) => Promise<void>;
20
30
  export declare const deleteWorkspaceHandler: (winIdentity: OpenFin.Identity, workspaceItemData: WorkspaceContextMenuItemData) => Promise<void>;
21
31
  export declare const downloadsHandler: (identity: OpenFin.Identity) => Promise<void>;
22
32
  /**
@@ -2304,6 +2304,10 @@ export interface UpdateSavedWorkspaceRequest {
2304
2304
  /** The updated workspace. */
2305
2305
  workspace: Workspace;
2306
2306
  }
2307
+ export type OpenSaveWorkspaceMenuRequest = {
2308
+ menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
2309
+ id?: never;
2310
+ };
2307
2311
  /**
2308
2312
  * Request to create a save modal.
2309
2313
  * @private
@@ -2311,10 +2315,7 @@ export interface UpdateSavedWorkspaceRequest {
2311
2315
  export type OpenSaveMenuRequest = {
2312
2316
  menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
2313
2317
  id: string;
2314
- } | {
2315
- menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
2316
- id?: never;
2317
- };
2318
+ } | OpenSaveWorkspaceMenuRequest;
2318
2319
  export type TaskbarIcon = {
2319
2320
  dark: string;
2320
2321
  light: string;
@@ -0,0 +1,14 @@
1
+ import type OpenFin from '@openfin/core';
2
+ import { IndicatorBounds, IndicatorOptions, WindowSize } from './types';
3
+ /**
4
+ * Gets the bounds of the parent window, with fallback to provided bounds.
5
+ */
6
+ export declare const getParentWindowBounds: (parentWindow: OpenFin.Window | false, parentWindowBounds?: OpenFin.WindowBounds) => Promise<OpenFin.WindowBounds | undefined>;
7
+ /**
8
+ * Checks if a window is maximized.
9
+ */
10
+ export declare const isWindowMaximized: (parentWindow: OpenFin.Window | false) => Promise<boolean>;
11
+ /**
12
+ * Pure function – returns the final indicator rectangle, nothing else.
13
+ */
14
+ export declare function computeIndicatorBounds(identity: OpenFin.Identity | null | undefined, mySize: WindowSize, opts: IndicatorOptions): Promise<IndicatorBounds>;
@@ -0,0 +1,35 @@
1
+ import type OpenFin from '@openfin/core';
2
+ import { PositioningType } from '../../../../common/src/utils/positioning';
3
+ export declare enum ShowAtType {
4
+ Top = "top",
5
+ Below = "below"
6
+ }
7
+ export interface IndicatorOptions {
8
+ /**
9
+ * Where to place the indicator relative to its parent.
10
+ */
11
+ showAt: ShowAtType;
12
+ /**
13
+ * When `true`, we use the "enterprise" timing + vertical offset rules.
14
+ */
15
+ isEnterprise: boolean;
16
+ /**
17
+ * The bounds of the parent window if the parent is not available at
18
+ * runtime (e.g. the browser window launched the indicator and closed).
19
+ */
20
+ fallbackParentBounds?: OpenFin.WindowBounds;
21
+ /**
22
+ * Determines whether to position relative to parent window or monitor.
23
+ */
24
+ positioning?: PositioningType;
25
+ }
26
+ export interface IndicatorBounds {
27
+ left: number;
28
+ top: number;
29
+ width: number;
30
+ height: number;
31
+ }
32
+ export interface WindowSize {
33
+ width: number;
34
+ height: number;
35
+ }
@@ -0,0 +1,55 @@
1
+ import { IconType } from '@openfin/ui-library';
2
+ import { PositioningType } from '../../../../common/src/utils/positioning';
3
+ import { IndicatorType } from '../../../../common/src/components/Indicator/Indicator.constants';
4
+ export type IndicatorIcon = Extract<IconType, 'LockClosedIcon' | 'LockOpen1Icon' | 'PageIcon' | 'BlockedIcon' | 'SupertabIcon' | 'BookmarkFilled'>;
5
+ export interface ShowIndicatorPayload {
6
+ type: IndicatorType;
7
+ message: string;
8
+ parentBrowserName?: string;
9
+ secondaryMessage?: string;
10
+ icon?: IndicatorIcon;
11
+ isEnterprise?: boolean;
12
+ positioning?: PositioningType;
13
+ }
14
+ export interface ShowErrorPayload {
15
+ message: string;
16
+ parentBrowserName?: string;
17
+ icon?: IndicatorIcon;
18
+ isEnterprise?: boolean;
19
+ positioning?: PositioningType;
20
+ }
21
+ export interface ShowSuccessPayload {
22
+ message: string;
23
+ parentBrowserName?: string;
24
+ secondaryMessage?: string;
25
+ icon?: IndicatorIcon;
26
+ isEnterprise?: boolean;
27
+ positioning?: PositioningType;
28
+ }
29
+ export interface ShowInfoPayload {
30
+ message: string;
31
+ parentBrowserName?: string;
32
+ icon?: IndicatorIcon;
33
+ isEnterprise?: boolean;
34
+ }
35
+ /**
36
+ * Creates a window containing a visual indicator contained in a Browser Window
37
+ * This function decides whether to call browser function or direct function
38
+ */
39
+ export declare function showIndicator(payload: ShowIndicatorPayload): Promise<void>;
40
+ /**
41
+ * Creates a window containing an error indicator
42
+ */
43
+ export declare function showError(payload: ShowErrorPayload): Promise<void>;
44
+ /**
45
+ * Creates a window containing a success indicator
46
+ */
47
+ export declare function showSuccess(payload: ShowSuccessPayload): Promise<void>;
48
+ /**
49
+ * Creates a window containing an info indicator
50
+ */
51
+ export declare function showInfo(payload: ShowInfoPayload): Promise<void>;
52
+ /**
53
+ * Creates a window centered on monitor containing a success indicator for switching workspaces
54
+ */
55
+ export declare function showSwitchWorkspaceSuccess(): Promise<void>;
@@ -0,0 +1,4 @@
1
+ export declare enum PositioningType {
2
+ RelativeToParentWindow = "relative-to-parent-window",
3
+ RelativeToMonitor = "relative-to-monitor"
4
+ }
@@ -1,2 +1,2 @@
1
1
  import { SaveButtonContextMenuItemTemplate } from '../../../client-api-platform/src/shapes';
2
- export declare const getSaveButtonMenuTemplate: () => Promise<SaveButtonContextMenuItemTemplate[]>;
2
+ export declare const getSaveButtonMenuTemplate: (pageId: string) => Promise<SaveButtonContextMenuItemTemplate[]>;
@@ -54,5 +54,5 @@ type MissingKeys<T, U> = Exclude<keyof T, U>;
54
54
  * fooChecker(['bar', 'qux', 'baz']); // 'baz' is not assignable to type keyof Foo;
55
55
  * ```
56
56
  */
57
- export declare const makeKeyChecker: <T extends object>() => <const K extends (keyof T)[]>(arr: K & (Exclude<keyof T, K[number]> extends never ? unknown : `Error: Missing keys: ${string & Exclude<keyof T, K[number]>}`)) => K;
57
+ export declare const makeKeyChecker: <T extends object>() => <K extends (keyof T)[]>(arr: K & (Exclude<keyof T, K[number]> extends never ? unknown : `Error: Missing keys: ${string & Exclude<keyof T, K[number]>}`)) => K;
58
58
  export {};
@@ -7,6 +7,7 @@ export declare enum WindowName {
7
7
  HomeInternal = "openfin-home-internal",
8
8
  BrowserMenu = "openfin-browser-menu",
9
9
  BrowserSaveMenu = "openfin-browser-save-menu",
10
+ DockSaveWorkspaceMenu = "openfin-dock3-save-workspace-menu",
10
11
  BrowserIndicator = "openfin-browser-indicator",
11
12
  BrowserWindow = "internal-generated-window",
12
13
  ClassicWindow = "internal-generated-classic-window",
@@ -179,5 +180,5 @@ export declare const getWindowBounds: (window: OpenFin.Window) => Promise<OpenFi
179
180
  * @param monitor the monitor to check against
180
181
  */
181
182
  export declare function getPercentageOfBoundsInMonitor(bounds: OpenFin.Bounds, monitor: OpenFin.MonitorDetails): number;
182
- export declare function getMonitorWindowMaximizedOn(parentWindowBounds: OpenFin.Bounds): Promise<OpenFin.MonitorDetails>;
183
+ export declare function getMonitorWindowMostOn(parentWindowBounds: OpenFin.Bounds): Promise<OpenFin.MonitorDetails>;
183
184
  export {};
@@ -1,6 +1,10 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { ResponseModalConfig } from '../../../common/src/utils/menu-config';
3
3
  import { ModalResponseEvent } from './menu-window-provider';
4
+ export type DeleteWorkspaceMenuPayload = {
5
+ workspaceTitle: string;
6
+ windowIdentity?: OpenFin.Identity;
7
+ };
4
8
  export declare const restoreChangesMenu: (windowIdentity: OpenFin.Identity) => Promise<ResponseModalConfig>;
5
9
  export declare const deletePageMenu: (windowIdentity: OpenFin.Identity, pageTitle: string) => Promise<ResponseModalConfig>;
6
10
  /**
@@ -11,7 +15,7 @@ export declare const deletePageMenu: (windowIdentity: OpenFin.Identity, pageTitl
11
15
  * @returns Boolean - Affirmative or Negative response from user
12
16
  */
13
17
  export declare const showSwitchWorkspaceModal: (targetWindowIdentity: OpenFin.Identity | undefined, workspaceTitle: string, shouldCenterOnMonitor?: boolean) => Promise<boolean>;
14
- export declare const showDeleteWorkspaceModal: (windowIdentity: OpenFin.Identity, workspaceTitle: string) => Promise<boolean>;
18
+ export declare const showDeleteWorkspaceModal: ({ workspaceTitle, windowIdentity }: DeleteWorkspaceMenuPayload) => Promise<boolean>;
15
19
  /**
16
20
  *
17
21
  * @param windowIdentity Parent or Current OpenFin Window Identity
@@ -2,7 +2,7 @@ import type { OpenFin } from '@openfin/core';
2
2
  import { WorkspaceButton } from '../../../client-api/src/dock';
3
3
  import { ContentMenuEntry, DockEntry, TaskbarIcon } from '../../../client-api-platform/src/shapes';
4
4
  export type { Dock3Provider, Dock3ConstructorOverride } from '../api/provider';
5
- export type Dock3Button = WorkspaceButton | 'contentMenu';
5
+ export type Dock3Button = WorkspaceButton | 'contentMenu' | 'manageWorkspaces';
6
6
  /**
7
7
  * Configuration for the Dock 3.0 provider.
8
8
  */
@@ -58,6 +58,12 @@ export interface Dock3Config {
58
58
  skipDialog?: boolean;
59
59
  };
60
60
  };
61
+ manageWorkspaces?: {
62
+ newWindow?: {
63
+ behavior: 'view';
64
+ viewOptions: OpenFin.PlatformViewCreationOptions;
65
+ };
66
+ };
61
67
  };
62
68
  }
63
69
  export type DockAllowedWindowOptions = Partial<Pick<OpenFin.PlatformWindowOptions, 'defaultCentered' | 'saveWindowState' | 'taskbarIconGroup' | 'defaultTop' | 'defaultLeft'>>;