@openfin/workspace-platform 20.3.5 → 20.3.7
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 +13 -3
- package/client-api-platform/src/api/controllers/__tests__/theme-storage-controller.test.d.ts +1 -0
- package/client-api-platform/src/api/controllers/theme-storage-controller-store.d.ts +4 -0
- package/client-api-platform/src/api/controllers/theme-storage-controller.d.ts +51 -0
- package/client-api-platform/src/api/utils.d.ts +5 -0
- package/client-api-platform/src/init/override-callback/browser-defaults.d.ts +0 -1
- package/client-api-platform/src/init/theming.d.ts +2 -2
- package/client-api-platform/src/shapes.d.ts +4 -0
- package/common/src/api/__test__/default-palette.d.ts +48 -0
- package/common/src/api/theming.d.ts +1 -1
- package/common/src/components/IndicatorContainer/helper.d.ts +30 -0
- package/common/src/utils/browser-base-url.d.ts +1 -0
- package/common/src/utils/context-menu.d.ts +7 -0
- package/common/src/utils/global-context-menu.d.ts +0 -1
- package/common/src/utils/local-storage-key.d.ts +1 -0
- package/common/src/utils/modal-bounds.d.ts +35 -0
- package/common/src/utils/os.d.ts +2 -0
- package/common/src/utils/popup-window.d.ts +2 -0
- package/common/src/utils/route.d.ts +2 -0
- package/common/src/utils/window.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +4 -3
- package/workspace_platform.zip +0 -0
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { ContextMenuType } from '../../../../common/src/utils/popup-window';
|
|
3
3
|
import { InternalOpenGlobalContextMenuRequest, InternalOpenPageTabContextMenuRequest, OpenGlobalContextMenuPayload, OpenPageTabContextMenuPayload, OpenSaveButtonContextMenuPayload, OpenSaveButtonContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest, WorkspacePlatformProvider } from '../../../../client-api-platform/src/shapes';
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the possible anchor behaviors for positioning context menus.
|
|
6
|
+
* These are relative to an element/cursor position (as opposed to a corner of the context menu window).
|
|
7
|
+
*
|
|
8
|
+
* e.g. AnchorBehavior.BottomRight implies a context menu will expand aligned with the bottom and right edge of an element.
|
|
9
|
+
*
|
|
10
|
+
* @enum {number}
|
|
11
|
+
*/
|
|
4
12
|
export declare enum AnchorBehavior {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
TopLeft = 0,
|
|
14
|
+
TopRight = 1,
|
|
15
|
+
BottomLeft = 2,
|
|
16
|
+
BottomRight = 3,
|
|
17
|
+
Center = 4
|
|
8
18
|
}
|
|
9
19
|
type ContextMenuPayload = OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload | OpenSaveButtonContextMenuPayload;
|
|
10
20
|
export declare const openCommonContextMenu: (payload: ContextMenuPayload, _callerIdentity: OpenFin.Identity, type?: ContextMenuType, anchorBehavior?: AnchorBehavior) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ThemeStorageController } from '../../../../client-api-platform/src/api/controllers/theme-storage-controller';
|
|
2
|
+
import { CustomThemes } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare const initialiseStoragePalettes: (customThemes: CustomThemes) => void;
|
|
4
|
+
export declare const getThemeStorageController: () => ThemeStorageController;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { StorageProxy } from '../../../../client-api-platform/src/api/utils';
|
|
2
|
+
import { ColorSchemeOptionType, CustomPaletteSet } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
/**
|
|
4
|
+
* Palette extensions can be used to add new variables to the palette set.
|
|
5
|
+
*
|
|
6
|
+
* This is particularly useful if a value uses a different palette constant depending on scheme.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getPaletteExtensions: (palette: CustomPaletteSet, paletteScheme: 'light' | 'dark') => {
|
|
9
|
+
selectedTab: string;
|
|
10
|
+
};
|
|
11
|
+
export type Palettes = {
|
|
12
|
+
dark: CustomPaletteSet;
|
|
13
|
+
light: CustomPaletteSet;
|
|
14
|
+
};
|
|
15
|
+
export declare class ThemeStorageController {
|
|
16
|
+
private providerStorage;
|
|
17
|
+
private darkPaletteVars?;
|
|
18
|
+
private lightPaletteVars?;
|
|
19
|
+
private workspaceStorage?;
|
|
20
|
+
constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>);
|
|
21
|
+
private getVarsByScheme;
|
|
22
|
+
/**
|
|
23
|
+
* Set the current Storage Proxy to enable Workspace Storage properties to be populated.
|
|
24
|
+
*/
|
|
25
|
+
setWorkspaceStorageProxy: (proxy: StorageProxy) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Synchronize the current palette and scheme with workspace's storage instance if
|
|
28
|
+
* storage based theming is enabled
|
|
29
|
+
*/
|
|
30
|
+
trySynchronizeWorkspaceStorage: () => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Set the current Palette to be used by workspace. This palette will be converted into
|
|
33
|
+
* css vars and combined into a single stylesheet. This stylesheet is exposed in localstorage
|
|
34
|
+
* to allow workspace UI elements to load the palette before their first paint.
|
|
35
|
+
* @param palettes Light and Dark Palette constants
|
|
36
|
+
*/
|
|
37
|
+
setPalettes: ({ light, dark }: Palettes) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Set the current scheme of workspace. Specifically setting light or dark
|
|
40
|
+
* will ignore the OS scheme, whereas 'system' will always respect it.
|
|
41
|
+
*
|
|
42
|
+
* This will also update the CSS vars to either support media queries in System mode or force a palette.
|
|
43
|
+
* @param scheme 'light', 'dark' or 'system'.
|
|
44
|
+
*/
|
|
45
|
+
setScheme(scheme: ColorSchemeOptionType): void;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the current scheme
|
|
48
|
+
* @returns 'light' | 'system' | 'dark'
|
|
49
|
+
*/
|
|
50
|
+
getScheme(): ColorSchemeOptionType;
|
|
51
|
+
}
|
|
@@ -2,7 +2,6 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { WindowName } from '../../../../common/src/utils/window';
|
|
3
3
|
import type { PreloadedThemeData } from '../../../../common/src/api/theming';
|
|
4
4
|
import { BrowserInitConfig } from '../../../../client-api-platform/src/shapes';
|
|
5
|
-
export declare const ENTERPRISE_LANDING_PAGE_URL: string;
|
|
6
5
|
export declare const searchMenuIdentityBase: {
|
|
7
6
|
uuid: string;
|
|
8
7
|
name: WindowName;
|
|
@@ -2,8 +2,8 @@ import { CustomThemes } from '../shapes';
|
|
|
2
2
|
export declare const getThemes: () => CustomThemes;
|
|
3
3
|
/**
|
|
4
4
|
* initTheming()
|
|
5
|
-
* Accepts an array of CustomThemes objects and stores it
|
|
6
5
|
* @param customThemes array of theme objects
|
|
6
|
+
* Accepts an array of CustomThemes objects and stores it
|
|
7
7
|
* @returns array of custom theme objects
|
|
8
8
|
*/
|
|
9
|
-
export default function initTheming(customThemes: CustomThemes): void
|
|
9
|
+
export default function initTheming(customThemes: CustomThemes): Promise<void>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const defaultDarkScheme: {
|
|
2
|
+
background1: string;
|
|
3
|
+
background2: string;
|
|
4
|
+
background3: string;
|
|
5
|
+
background4: string;
|
|
6
|
+
background5: string;
|
|
7
|
+
background6: string;
|
|
8
|
+
backgroundPrimary: string;
|
|
9
|
+
brandPrimary: string;
|
|
10
|
+
brandSecondary: string;
|
|
11
|
+
contentBackground1: string;
|
|
12
|
+
inputBackground: string;
|
|
13
|
+
inputColor: string;
|
|
14
|
+
inputDisabled: string;
|
|
15
|
+
inputFocused: string;
|
|
16
|
+
inputPlaceholder: string;
|
|
17
|
+
statusActive: string;
|
|
18
|
+
statusCritical: string;
|
|
19
|
+
statusSuccess: string;
|
|
20
|
+
statusWarning: string;
|
|
21
|
+
textDefault: string;
|
|
22
|
+
textHelp: string;
|
|
23
|
+
textInactive: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultLightScheme: {
|
|
26
|
+
background1: string;
|
|
27
|
+
background2: string;
|
|
28
|
+
background3: string;
|
|
29
|
+
background4: string;
|
|
30
|
+
background5: string;
|
|
31
|
+
background6: string;
|
|
32
|
+
backgroundPrimary: string;
|
|
33
|
+
brandPrimary: string;
|
|
34
|
+
brandSecondary: string;
|
|
35
|
+
contentBackground1: string;
|
|
36
|
+
inputBackground: string;
|
|
37
|
+
inputColor: string;
|
|
38
|
+
inputDisabled: string;
|
|
39
|
+
inputFocused: string;
|
|
40
|
+
inputPlaceholder: string;
|
|
41
|
+
statusActive: string;
|
|
42
|
+
statusCritical: string;
|
|
43
|
+
statusSuccess: string;
|
|
44
|
+
statusWarning: string;
|
|
45
|
+
textDefault: string;
|
|
46
|
+
textHelp: string;
|
|
47
|
+
textInactive: string;
|
|
48
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefaultTheme } from 'styled-components';
|
|
2
2
|
import type OpenFin from '@openfin/core';
|
|
3
|
-
import { ColorSchemeType, ThemeSet } from '@openfin/ui-library';
|
|
3
|
+
import { type ColorSchemeType, type ThemeSet } from '@openfin/ui-library';
|
|
4
4
|
import { Palette } from '@openfin/ui-library';
|
|
5
5
|
import { ColorSchemeOptionType } from '../../../client-api-platform/src/shapes';
|
|
6
6
|
export type WorkspaceComponentSetSelectedSchemePayload = {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
export declare enum ShowAtType {
|
|
3
|
+
Top = "top",
|
|
4
|
+
Below = "below"
|
|
5
|
+
}
|
|
6
|
+
export declare const getParentWindowBounds: (parentWindow: OpenFin.Window | false, parentWindowBounds?: OpenFin.WindowBounds) => Promise<OpenFin.WindowBounds>;
|
|
7
|
+
export declare const isWindowMaximized: (parentWindow: OpenFin.Window | false) => Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates the bounds for the indicator window based on the provided parameters.
|
|
10
|
+
* If isEnterprise is true indicator will show below, otherwise default will show at the top
|
|
11
|
+
* Indicator appears center of parent window
|
|
12
|
+
* If window is maximized, indicator will appear center of monitor bounds
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* @param identity identity of browser window.
|
|
16
|
+
* @param myWidth width of the window.
|
|
17
|
+
* @param myHeight height of the window.
|
|
18
|
+
* @param showAt showAt The position to show the window relative to its parent.
|
|
19
|
+
* @param parentWindowBounds The bounds of the parent window.
|
|
20
|
+
* @returns the bounds of where the indicator will be placed.
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateBounds(identity: OpenFin.Identity, myWidth: number, myHeight: number, showAt: ShowAtType, parentWindowBounds?: OpenFin.WindowBounds): Promise<{
|
|
23
|
+
left: number;
|
|
24
|
+
top: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}>;
|
|
28
|
+
declare function adjustWindowDimensions(identity: OpenFin.Identity, container: HTMLDivElement, showAt: ShowAtType, parentWindowBounds?: OpenFin.WindowBounds): Promise<void>;
|
|
29
|
+
declare const debouncedAdjustWindowDimension: typeof adjustWindowDimensions;
|
|
30
|
+
export default debouncedAdjustWindowDimension;
|
|
@@ -17,6 +17,7 @@ export declare function getBrowserBaseUrl(returnUrlWithATrailingSlash?: boolean)
|
|
|
17
17
|
* @returns The browser base url override if it exists, otherwise null
|
|
18
18
|
*/
|
|
19
19
|
export declare function getEnterpriseBaseUrl(returnUrlWithATrailingSlash?: boolean): Promise<string>;
|
|
20
|
+
export declare function getEnterpriseLandingUrl(): Promise<string>;
|
|
20
21
|
/**
|
|
21
22
|
* Get the enterprise browser or the workspace browser base url
|
|
22
23
|
* @param isEnterprise - if true, we are in enterprise browser
|
|
@@ -19,4 +19,11 @@ export declare const DefaultSaveMenuBounds: {
|
|
|
19
19
|
width: number;
|
|
20
20
|
height: number;
|
|
21
21
|
};
|
|
22
|
+
export declare const getBoundsBasedOnAnchorBehavior: (bounds: OpenFin.Bounds, anchorBehavior: AnchorBehavior) => OpenFin.Bounds | {
|
|
23
|
+
bottom: number;
|
|
24
|
+
top: number;
|
|
25
|
+
left: number;
|
|
26
|
+
height: number;
|
|
27
|
+
width: number;
|
|
28
|
+
};
|
|
22
29
|
export declare const getPrintOption: () => Promise<ViewTabContextMenuTemplate | PageTabContextMenuItemTemplate>;
|
|
@@ -2,7 +2,6 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { MenuItemType } from '../../../common/src/utils/context-menu';
|
|
3
3
|
import * as WP from '../../../client-api-platform/src/index';
|
|
4
4
|
import { GlobalContextMenuItemTemplate, GlobalContextMenuOptionType, Workspace } from '../../../client-api-platform/src/shapes';
|
|
5
|
-
export declare const isOSWindows: () => Promise<boolean>;
|
|
6
5
|
export declare const getCloseWindow: () => {
|
|
7
6
|
type: MenuItemType;
|
|
8
7
|
label: string;
|
|
@@ -6,6 +6,7 @@ declare enum LocalStorageKey {
|
|
|
6
6
|
NewTabPageSort = "NewTabPageSort",
|
|
7
7
|
DockPosition = "DockPosition",
|
|
8
8
|
SelectedColorScheme = "SelectedColorScheme",
|
|
9
|
+
ThemePaletteSheet = "ThemePaletteSheet",
|
|
9
10
|
HasMovedStore = "HasMovedStore",
|
|
10
11
|
PageDragState = "BrowserPageDragState"
|
|
11
12
|
}
|
|
@@ -18,3 +18,38 @@ export declare const getCenterOfParentWindowMonitor: (parentWindowIdentity?: Ope
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const getResponseModalBounds: (modalOptions: ResponseModalConfig['windowOptions'], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean) => Promise<OpenFin.Bounds>;
|
|
20
20
|
export declare function getResponseModalBoundsAndCenterParentIfModalOffScreen(modalOptions: ResponseModalConfig['windowOptions'], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean): Promise<OpenFin.Bounds>;
|
|
21
|
+
/**
|
|
22
|
+
* Adjusts the given bounds to be within the closest monitor's available bounds if they are offscreen.
|
|
23
|
+
*
|
|
24
|
+
* @param {OpenFin.Bounds} bounds - The bounds to be adjusted.
|
|
25
|
+
* @returns {Promise<OpenFin.Bounds>} - The adjusted bounds that are within the closest monitor's available bounds.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getClosestBoundsIfModalBoundsOffscreen(bounds: OpenFin.Bounds): Promise<OpenFin.Bounds>;
|
|
28
|
+
/**
|
|
29
|
+
* Adjusts the given bounds if they are offscreen to be within the closest monitor's available bounds.
|
|
30
|
+
* Returns bounds relative to the parent window's bounds (as opposed to bounds relative to the monitor).
|
|
31
|
+
*
|
|
32
|
+
* @param {OpenFin.WindowBounds} parentWindowBounds - The bounds of the parent window.
|
|
33
|
+
* @param {OpenFin.Bounds} bounds - The bounds to be adjusted.
|
|
34
|
+
* @returns {Promise<OpenFin.Bounds>} - The adjusted bounds that are within the closest monitor's available bounds relative to the parent window's bounds.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getClosestRelativeBoundsIfModalBoundsOffscreen: (parentWindowBounds: OpenFin.WindowBounds, bounds: OpenFin.Bounds) => Promise<OpenFin.Bounds>;
|
|
37
|
+
/**
|
|
38
|
+
* Returns whether a window is maximized and the OS is Windows 10 or 11.
|
|
39
|
+
* Relates to: https://github.com/electron/electron/issues/4045
|
|
40
|
+
*
|
|
41
|
+
* @param window - The OpenFin window.
|
|
42
|
+
* @returns A promise that resolves to a boolean indicating whether a window is maximized and the OS is Windows 10 or 11.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getIsWindowMaximizedOnWindows10Or11: (window: OpenFin.Window) => Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the current bounds of a window whether it's maximized or minimized.
|
|
47
|
+
* For maximized windows on Windows 10 and 11, it will return adjusted bounds to account for an Electron bug where a 7px
|
|
48
|
+
* shadow is included in the measurement of the window bounds.
|
|
49
|
+
*
|
|
50
|
+
* Relates to: https://github.com/electron/electron/issues/4045
|
|
51
|
+
*
|
|
52
|
+
* @param windowIdentity - The identity of the window.
|
|
53
|
+
* @returns A promise that resolves to the current window bounds.
|
|
54
|
+
*/
|
|
55
|
+
export declare const getCurrentBounds: (windowIdentity: OpenFin.Identity) => Promise<OpenFin.WindowBounds>;
|
|
@@ -68,6 +68,8 @@ export type SearchMenuChannelResponse = {
|
|
|
68
68
|
} | {
|
|
69
69
|
type: 'keyboard-event';
|
|
70
70
|
keyboardEvent: BrowserSearchMenuKeyboardEvent;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'search-provider-changed';
|
|
71
73
|
};
|
|
72
74
|
export declare function showPopupWin<T extends keyof UserMenuParams>(parentWindow: OpenFin.Window, params: UserMenuParams[T], windowOpts: OpenFin.PopupOptions): Promise<OpenFin.PopupResult>;
|
|
73
75
|
export {};
|
|
@@ -27,6 +27,7 @@ declare enum BrowserRoute {
|
|
|
27
27
|
EnterpriseBrowser = "/enterprise/",
|
|
28
28
|
EnterpriseContextMenu = "/context-menu/",
|
|
29
29
|
EnterpriseBookmarkDialog = "/bookmark-dialog/",
|
|
30
|
+
EnterpriseStorageProxy = "/enterprise/storage-proxy",
|
|
30
31
|
DropdownMenu = "/dropdown-menu/",
|
|
31
32
|
EnterpriseDock = "/dock/"
|
|
32
33
|
}
|
|
@@ -43,6 +44,7 @@ declare const PageRoute: {
|
|
|
43
44
|
EnterpriseBrowser: BrowserRoute.EnterpriseBrowser;
|
|
44
45
|
EnterpriseContextMenu: BrowserRoute.EnterpriseContextMenu;
|
|
45
46
|
EnterpriseBookmarkDialog: BrowserRoute.EnterpriseBookmarkDialog;
|
|
47
|
+
EnterpriseStorageProxy: BrowserRoute.EnterpriseStorageProxy;
|
|
46
48
|
DropdownMenu: BrowserRoute.DropdownMenu;
|
|
47
49
|
EnterpriseDock: BrowserRoute.EnterpriseDock;
|
|
48
50
|
Home: WorkspaceRoute.Home;
|
|
@@ -174,5 +174,5 @@ export declare const getWindowBounds: (window: OpenFin.Window) => Promise<OpenFi
|
|
|
174
174
|
* @param monitor the monitor to check against
|
|
175
175
|
*/
|
|
176
176
|
export declare function getPercentageOfBoundsInMonitor(bounds: OpenFin.Bounds, monitor: OpenFin.MonitorDetails): number;
|
|
177
|
-
export declare function getMonitorWindowMaximizedOn(parentWindowBounds: OpenFin.
|
|
177
|
+
export declare function getMonitorWindowMaximizedOn(parentWindowBounds: OpenFin.Bounds): Promise<OpenFin.MonitorDetails>;
|
|
178
178
|
export {};
|