@openfin/workspace 22.4.0 → 22.4.2

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
  /**
@@ -2842,6 +2842,10 @@ export declare enum SaveModalType {
2842
2842
  RENAME_PAGE = "RENAME_PAGE",
2843
2843
  RENAME_WORKSPACE = "RENAME_WORKSPACE"
2844
2844
  }
2845
+ export type OpenSaveWorkspaceMenuRequest = {
2846
+ menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
2847
+ id?: never;
2848
+ };
2845
2849
  /**
2846
2850
  * Request to create a save modal.
2847
2851
  * @private
@@ -2849,10 +2853,7 @@ export declare enum SaveModalType {
2849
2853
  export type OpenSaveMenuRequest = {
2850
2854
  menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
2851
2855
  id: string;
2852
- } | {
2853
- menuType: SaveModalType.SAVE_WORKSPACE | SaveModalType.SAVE_WORKSPACE_AS | SaveModalType.RENAME_WORKSPACE;
2854
- id?: never;
2855
- };
2856
+ } | OpenSaveWorkspaceMenuRequest;
2856
2857
  export type TaskbarIcon = {
2857
2858
  dark: string;
2858
2859
  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
+ }
@@ -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'>>;
@@ -74,13 +74,13 @@
74
74
  "type": "root-implicit",
75
75
  "version": "^4.0.11",
76
76
  "packageName": "common/package.json",
77
- "issuer": "common/src/utils/create-and-migrate-ibd-store.ts"
77
+ "issuer": "common/src/api/pages/idb.ts"
78
78
  },
79
79
  {
80
80
  "type": "root-implicit",
81
81
  "version": "^4.0.11",
82
82
  "packageName": "common/package.json",
83
- "issuer": "common/src/api/pages/idb.ts"
83
+ "issuer": "common/src/utils/create-and-migrate-ibd-store.ts"
84
84
  }
85
85
  ]
86
86
  }