@openfin/workspace 46.0.7 → 46.0.9
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/src/dock.test.d.ts +1 -1
- package/client-api-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/context-menu/browser-pagetab-handler.d.ts +1 -1
- package/client-api-platform/src/api/context-menu/keyboard-shortcuts.d.ts +30 -0
- package/client-api-platform/src/api/context-menu/utils.d.ts +4 -1
- package/client-api-platform/src/api/controllers/language-storage-controller-store.d.ts +2 -0
- package/client-api-platform/src/api/controllers/language-storage-controller.d.ts +25 -0
- package/client-api-platform/src/api/controllers/theme-storage-controller.d.ts +3 -4
- package/client-api-platform/src/api/controllers/workspace-storage-proxy-store.d.ts +13 -0
- package/client-api-platform/src/api/language.d.ts +3 -1
- package/client-api-platform/src/init/override-callback/commands.d.ts +8 -4
- package/client-api-platform/src/init/override-callback/dialogs.d.ts +1 -0
- package/client-api-platform/src/init/override-callback/view-options.d.ts +11 -0
- package/client-api-platform/src/shapes.d.ts +82 -10
- package/common/src/api/i18next.d.ts +4 -1
- package/common/src/api/pages/shapes.d.ts +4 -0
- package/common/src/api/protocol/browser.d.ts +12 -1
- package/common/src/api/protocol/shapes/connectors.d.ts +28 -0
- package/common/src/api/shapes/view-tab.d.ts +86 -0
- package/common/src/test/logger-mock.d.ts +10 -0
- package/common/src/utils/color-channels.d.ts +50 -41
- package/common/src/utils/enterprise-channels.d.ts +3 -0
- package/common/src/utils/enterpriseBrowser.d.ts +0 -1
- package/common/src/utils/env.d.ts +1 -1
- package/common/src/utils/global-context-menu.d.ts +11 -0
- package/common/src/utils/interop.d.ts +30 -0
- package/common/src/utils/keyboard-commands.d.ts +47 -0
- package/common/src/utils/local-storage-key.d.ts +1 -0
- package/common/src/utils/manage-connectors-modal.d.ts +21 -0
- package/common/src/utils/os.d.ts +2 -0
- package/common/src/utils/popup-window.d.ts +1 -0
- package/common/src/utils/route.d.ts +7 -3
- package/common/src/utils/usage-register.d.ts +8 -1
- package/common/src/utils/view-options.d.ts +20 -0
- package/common/src/utils/view-tab-appearance.d.ts +51 -0
- package/common/src/utils/window.d.ts +2 -0
- package/common/src/utils/workspace-modals.d.ts +6 -0
- package/externals.report.json +22 -16
- package/home.js +1 -1
- package/home.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/notifications.js +1 -1
- package/notifications.js.map +1 -1
- package/package.json +3 -3
- package/store.js +1 -1
- package/store.js.map +1 -1
- package/storefront-vpw/src/api/register.d.ts +1 -1
- package/common/src/utils/color-linking.d.ts +0 -4
|
@@ -7,7 +7,7 @@ import type { ContentSortRequest, LaunchAppRequest, SearchSitesRequest, SearchSi
|
|
|
7
7
|
* @param app the app directory entry.
|
|
8
8
|
* @param opts launch options.
|
|
9
9
|
*/
|
|
10
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.
|
|
10
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.View | OpenFin.Platform | OpenFin.Application>;
|
|
11
11
|
export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
|
|
12
12
|
export declare function getResults(payload: {
|
|
13
13
|
req: SearchSitesRequest;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
2
2
|
import { PageTabContextMenuItemData } from '../../../../client-api-platform/src/shapes';
|
|
3
|
-
export declare const pageTabContextMenuItemHandler: (data: PageTabContextMenuItemData, payload: OpenPageTabContextMenuPayload
|
|
3
|
+
export declare const pageTabContextMenuItemHandler: (data: PageTabContextMenuItemData, payload: OpenPageTabContextMenuPayload) => Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { KeyboardCommand } from '../../../../common/src/utils/keyboard-commands';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a menu item's `data.type` to the keyboard command that performs the same action, or to a fixed
|
|
4
|
+
* `{ keys }` binding for shortcuts handled outside `getKeyboardCommands` (e.g. quit).
|
|
5
|
+
*/
|
|
6
|
+
type MenuShortcutCommands = Partial<Record<string, KeyboardCommand | {
|
|
7
|
+
keys: string;
|
|
8
|
+
}>>;
|
|
9
|
+
export declare const ENTERPRISE_GLOBAL_MENU_SHORTCUTS: MenuShortcutCommands;
|
|
10
|
+
export declare const ENTERPRISE_PAGE_TAB_MENU_SHORTCUTS: MenuShortcutCommands;
|
|
11
|
+
/**
|
|
12
|
+
* View tab New Tab / Close Tab act on the inner view, while Cmd/Ctrl+T and Cmd/Ctrl+W act on the whole
|
|
13
|
+
* page, so they are not labelled.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ENTERPRISE_VIEW_TAB_MENU_SHORTCUTS: MenuShortcutCommands;
|
|
16
|
+
type ShortcutMenuItem = {
|
|
17
|
+
data?: {
|
|
18
|
+
type?: string;
|
|
19
|
+
} | null;
|
|
20
|
+
submenu?: ShortcutMenuItem[];
|
|
21
|
+
shortcut?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Returns a copy of `template` with each item that has a registered hotkey labelled with it (as the
|
|
25
|
+
* `shortcut` the Enterprise popup menu renders), formatted for the current OS.
|
|
26
|
+
*/
|
|
27
|
+
export declare const addKeyboardShortcuts: <T extends ShortcutMenuItem>(template: T[], shortcutCommands: MenuShortcutCommands) => Promise<(T & {
|
|
28
|
+
shortcut?: string;
|
|
29
|
+
})[]>;
|
|
30
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { PositioningType } from '../../../../common/src/utils/positioning';
|
|
3
|
+
import type { PageCreationOrigin } from '../../../../common/src/api/pages/shapes';
|
|
3
4
|
import { WorkspaceContextMenuItemData } from '../../../../client-api-platform/src/shapes';
|
|
4
5
|
export declare const saveWorkspaceHandlerWithInjectables: ({ showModal, afterSuccessSave }: {
|
|
5
6
|
showModal?: () => Promise<void>;
|
|
@@ -9,8 +10,10 @@ export declare const saveWorkspaceHandler: (identity: OpenFin.Identity) => Promi
|
|
|
9
10
|
export declare const saveWorkspaceAsHandler: (identity: OpenFin.Identity) => void;
|
|
10
11
|
/**
|
|
11
12
|
* @param identity Identity of browser window to create a new page on.
|
|
13
|
+
* @param origin User interaction that requested the page. Menu callers omit this.
|
|
12
14
|
*/
|
|
13
|
-
export declare const createNewPageHandler: (identity: OpenFin.Identity) => Promise<void>;
|
|
15
|
+
export declare const createNewPageHandler: (identity: OpenFin.Identity, origin?: PageCreationOrigin) => Promise<void>;
|
|
16
|
+
export declare const createNewWindowHandler: (identity: OpenFin.Identity) => Promise<void>;
|
|
14
17
|
/**
|
|
15
18
|
* @param identity Identity of browser window to execute save on.
|
|
16
19
|
* @param pageId Id of a page to save. If omitted, active page is saved.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WorkspaceStorageProxyStore } from '../../../../client-api-platform/src/api/controllers/workspace-storage-proxy-store';
|
|
2
|
+
import { Locale } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
/**
|
|
4
|
+
* Stores the configured and user-selected languages on the platform origin and
|
|
5
|
+
* mirrors the effective preference into the Workspace UI origin.
|
|
6
|
+
*
|
|
7
|
+
* Twin of `ThemeStorageController`: `SelectedLanguage` is the user's explicit choice
|
|
8
|
+
* (Language menu), `DefaultLanguage` is the platform's init-time configuration, and
|
|
9
|
+
* resolution is `Selected ?? Default ?? en-US`.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LanguageStorageController {
|
|
12
|
+
private providerStorage;
|
|
13
|
+
private workspaceStorageProxyStore;
|
|
14
|
+
constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>, workspaceStorageProxyStore?: WorkspaceStorageProxyStore);
|
|
15
|
+
setSelectedLanguage(locale: Locale): void;
|
|
16
|
+
setDefaultLanguage(locale: Locale): void;
|
|
17
|
+
getSelectedLanguage(): Locale | undefined;
|
|
18
|
+
getDefaultLanguage(): Locale;
|
|
19
|
+
getLanguage(): Locale;
|
|
20
|
+
/**
|
|
21
|
+
* Mirrors the language preference into Workspace UI storage so every UI document on
|
|
22
|
+
* that origin can read it before first paint and react to `storage` events.
|
|
23
|
+
*/
|
|
24
|
+
synchronizeWorkspaceStorage: () => Promise<void>;
|
|
25
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WorkspaceStorageProxyStore } from '../../../../client-api-platform/src/api/controllers/workspace-storage-proxy-store';
|
|
1
2
|
import { StorageProxy } from '../../../../client-api-platform/src/api/utils';
|
|
2
3
|
import { ColorSchemeOptionType, CustomPaletteSet } from '../../../../client-api-platform/src/shapes';
|
|
3
4
|
/**
|
|
@@ -36,15 +37,13 @@ export declare const generateLegacyCSSVars: (palettes: LegacyPalettes, isWindows
|
|
|
36
37
|
dark: string;
|
|
37
38
|
};
|
|
38
39
|
export declare class ThemeStorageController {
|
|
39
|
-
#private;
|
|
40
40
|
private providerStorage;
|
|
41
|
+
private workspaceStorageProxyStore;
|
|
41
42
|
private darkPaletteVars?;
|
|
42
43
|
private lightPaletteVars?;
|
|
43
44
|
private themePaletteSheet?;
|
|
44
|
-
private workspaceStorage?;
|
|
45
|
-
private storageFactory?;
|
|
46
45
|
private isLegacySinglePaletteTheme;
|
|
47
|
-
constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'
|
|
46
|
+
constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>, workspaceStorageProxyStore?: WorkspaceStorageProxyStore);
|
|
48
47
|
/**
|
|
49
48
|
* Sets the storage factory. This can only be done once, and will throw for subsequent calls.
|
|
50
49
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StorageProxy } from '../../../../client-api-platform/src/api/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Owns the storage proxy shared by platform features that need to synchronize
|
|
4
|
+
* state into the Workspace UI origin.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WorkspaceStorageProxyStore {
|
|
7
|
+
private storageProxy?;
|
|
8
|
+
private storageFactory?;
|
|
9
|
+
setStorageFactory: (factory: () => StorageProxy) => void;
|
|
10
|
+
getOrCreateStorageProxy: () => Promise<StorageProxy>;
|
|
11
|
+
destroyStorageProxy: () => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const workspaceStorageProxyStore: WorkspaceStorageProxyStore;
|
|
@@ -19,5 +19,7 @@ export declare function getCapabilitiesInternal(): PlatformCapabilities;
|
|
|
19
19
|
* initLanguage()
|
|
20
20
|
* @param language - optional - ISO language code. Built-in languages are always accepted.
|
|
21
21
|
* Any language code defined in the external `translation-override.json` is also accepted.
|
|
22
|
+
* @param languagePacksApiUrl - optional i18next-http-backend loadPath. When set,
|
|
23
|
+
* HTTP language packs are used instead of the bundled locale JSON.
|
|
22
24
|
*/
|
|
23
|
-
export default function initLanguage(language?: Locale): Promise<void>;
|
|
25
|
+
export default function initLanguage(language?: Locale, languagePacksApiUrl?: string): Promise<void>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly FIND_IN_PAGE: "findInPage.show";
|
|
5
|
-
};
|
|
2
|
+
import { KEYBOARD_COMMANDS } from '../../../../common/src/utils/keyboard-commands';
|
|
3
|
+
export { KEYBOARD_COMMANDS };
|
|
6
4
|
export declare const getKeyboardCommands: (superGetKeyboardCommands: () => OpenFin.ShortcutOverride[]) => OpenFin.ShortcutOverride[];
|
|
5
|
+
/**
|
|
6
|
+
* The first key binding registered for `command`, or `undefined` if it has none (never registered, or
|
|
7
|
+
* disabled via empty `keys`). Commands with several bindings list their primary one first, e.g. reload's
|
|
8
|
+
* `CommandOrControl+R` before `F5`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getRegisteredShortcutKeys: (command: string) => string | undefined;
|
|
@@ -4,3 +4,4 @@ export declare const showQuitPlatformDialogInternal: (req: ShowQuitPlatformDialo
|
|
|
4
4
|
export declare const showUpdateVersionModalInternal: (req: ShowUpdateVersionModalRequest, identity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<void>;
|
|
5
5
|
export declare const showApplyAndPublishModalInternal: (_identity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<boolean>;
|
|
6
6
|
export declare const showIntentsResolverModalInternal: (req: ShowIntentsResolverModalRequest) => Promise<IntentResolverResponse>;
|
|
7
|
+
export declare const showManageConnectorsModalInternal: () => Promise<void>;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { BrowserCreateViewRequest, BrowserViewState, BrowserWorkspacePlatformViewOptions } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
/**
|
|
4
|
+
* Strips unusable `viewTab` colors instead of rejecting the request. A tab color is decoration, and this runs
|
|
5
|
+
* inside `createView`, so throwing here would abort view creation and leave the surrounding window
|
|
6
|
+
* half-built over a cosmetic typo. Discarded states fall back to their theme default in the stylesheet.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sanitizeViewWorkspacePlatform: (opts: BrowserCreateViewRequest) => BrowserCreateViewRequest;
|
|
3
9
|
export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl }: {
|
|
4
10
|
manifestUrl: string;
|
|
5
11
|
}, callerIdentity: OpenFin.Identity) => any, callerIdentity: OpenFin.Identity): Promise<any>;
|
|
6
12
|
type ViewStateBase = Pick<BrowserViewState, '_internalWorkspaceData' | 'workspacePlatform'>;
|
|
7
13
|
export declare const mapInternalWorkspaceDataToWorkspacePlatform: <T extends ViewStateBase>(viewState: T) => T;
|
|
14
|
+
/**
|
|
15
|
+
* Moves legacy workspace platform view options into `_internalWorkspaceData`, which Core round-trips through layout
|
|
16
|
+
* componentState. `viewTab` and newer options are exempt — Core now persists `workspacePlatform` on view options directly,
|
|
17
|
+
* so they stay put and the runtime becomes the single source of truth.
|
|
18
|
+
*/
|
|
8
19
|
export declare const mapWorkspacePlatformToInternalWorkspaceData: <T extends ViewStateBase>(viewState: T) => T;
|
|
9
20
|
export declare const setHotkeysIfNavigationButtonsEnabled: (options: BrowserCreateViewRequest) => Promise<BrowserCreateViewRequest>;
|
|
10
21
|
export declare const registerHotkeyListenersIfEnabled: (viewIdentity: OpenFin.Identity, buttonOptions?: BrowserWorkspacePlatformViewOptions["browserNavigationButtons"]) => void;
|
|
@@ -8,6 +8,7 @@ import type { Resource } from '../../common/src/api/i18next';
|
|
|
8
8
|
import type { TrackedSite } from '../../common/src/api/pages/idb';
|
|
9
9
|
import type { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, CreateBookmarkNodeRequest, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageLayoutsWithSelectedViews, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, UpdateBookmarkNodeRequest, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
|
|
10
10
|
import type { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
|
|
11
|
+
import type { ViewTabAppearanceOptions } from '../../common/src/api/shapes/view-tab';
|
|
11
12
|
import type { CustomThemes, GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../common/src/api/theming';
|
|
12
13
|
import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
|
|
13
14
|
import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
@@ -20,6 +21,7 @@ export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
|
20
21
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
21
22
|
export type { AttachedPage, Page, PagePinnedState, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig, CopyPagePayload, HandleSaveModalOnPageClosePayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
|
|
22
23
|
export { PanelPosition } from '../../common/src/api/pages/shapes';
|
|
24
|
+
export type { ThemedIcon, ViewTabAppearanceOptions, ViewTabColorRole, ViewTabControl, ViewTabControlPosition, ViewTabStateColorOptions } from '../../common/src/api/shapes/view-tab';
|
|
23
25
|
export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
|
|
24
26
|
export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
25
27
|
export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
@@ -39,6 +41,13 @@ export interface PlatformCapabilities {
|
|
|
39
41
|
* @internal
|
|
40
42
|
*/
|
|
41
43
|
httpLanguagePacks?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* i18next-http-backend loadPath advertised by the provider when HTTP packs
|
|
46
|
+
* were enabled at `WorkspacePlatform.init`. Windows must not read this from
|
|
47
|
+
* the shared manifest — Workspace and Enterprise can share one manifest.
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
languagePacksApiUrl?: string;
|
|
42
51
|
}
|
|
43
52
|
/**
|
|
44
53
|
* Request for creating a saved page in persistent storage.
|
|
@@ -142,6 +151,7 @@ export declare enum GlobalContextMenuOptionType {
|
|
|
142
151
|
DeleteWorkspace = "DeleteWorkspace",
|
|
143
152
|
Downloads = "Downloads",
|
|
144
153
|
OpenStorefront = "OpenStorefront",
|
|
154
|
+
ManageConnectors = "ManageConnectors",
|
|
145
155
|
ManageDesktopSignals = "ManageDesktopSignals",
|
|
146
156
|
FindInPage = "FindInPage",
|
|
147
157
|
Appearance = "Appearance",
|
|
@@ -203,6 +213,7 @@ export declare enum PageTabContextMenuOptionType {
|
|
|
203
213
|
export declare enum EnterpriseMainContextMenuOptionType {
|
|
204
214
|
Lock = "Lock",
|
|
205
215
|
AddToChanel = "AddToChannel",
|
|
216
|
+
ManageConnectors = "ManageConnectors",// Enterprise
|
|
206
217
|
ManageDesktopSignals = "ManageDesktopSignals",// Enterprise
|
|
207
218
|
FindInPage = "FindInPage",// Enterprise
|
|
208
219
|
Print = "Print",
|
|
@@ -297,7 +308,7 @@ export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate<ViewTabMenuDat
|
|
|
297
308
|
/**
|
|
298
309
|
* UI elements within a view tab that can be navigated to via keyboard.
|
|
299
310
|
*/
|
|
300
|
-
export type ViewTabElements = 'inactive-tab' | 'active-tab' | 'inactive-tab-close-button' | 'active-tab-close-button' | 'add-tab-button';
|
|
311
|
+
export type ViewTabElements = 'inactive-tab' | 'active-tab' | 'inactive-tab-close-button' | 'active-tab-close-button' | 'inactive-tab-custom-control' | 'active-tab-custom-control' | 'add-tab-button';
|
|
301
312
|
/**
|
|
302
313
|
* Configuration options for view tab keyboard navigation behavior.
|
|
303
314
|
*/
|
|
@@ -307,7 +318,7 @@ export interface ViewTabOptions {
|
|
|
307
318
|
* arrow keys when an element in the view is selected.
|
|
308
319
|
* The order of the items in the array have no impact.
|
|
309
320
|
* Note: these are not mutually exclusive and can overlap.
|
|
310
|
-
* Default (when undefined): ["inactive-tab","active-tab","active-tab-close-button","inactive-tab-close-button","add-tab-button"]
|
|
321
|
+
* Default (when undefined): ["inactive-tab","active-tab","active-tab-close-button","inactive-tab-close-button","active-tab-custom-control","inactive-tab-custom-control","add-tab-button"]
|
|
311
322
|
*/
|
|
312
323
|
arrowNavigation?: ViewTabElements[];
|
|
313
324
|
/**
|
|
@@ -434,6 +445,19 @@ export interface ViewTabCustomActionPayload {
|
|
|
434
445
|
windowIdentity: OpenFin.Identity;
|
|
435
446
|
selectedViews: OpenFin.Identity[];
|
|
436
447
|
}
|
|
448
|
+
export interface ViewTabControlActionPayload {
|
|
449
|
+
callerType: CustomActionCallerType.ViewTabControl;
|
|
450
|
+
/** Identity of the Browser window containing the view tab. */
|
|
451
|
+
windowIdentity: OpenFin.Identity;
|
|
452
|
+
/** Identity of the view represented by the tab. */
|
|
453
|
+
viewIdentity: OpenFin.Identity;
|
|
454
|
+
/** Any data necessary for the functioning of the specified custom action. */
|
|
455
|
+
customData?: any;
|
|
456
|
+
/** Client x-coordinate where the control was invoked. */
|
|
457
|
+
x: number;
|
|
458
|
+
/** Client y-coordinate where the control was invoked. */
|
|
459
|
+
y: number;
|
|
460
|
+
}
|
|
437
461
|
/**
|
|
438
462
|
* Payload received by the openViewTabContextMenu provider override.
|
|
439
463
|
*/
|
|
@@ -458,10 +482,7 @@ export type OpenPageTabContextMenuPayload = OpenPageTabContextMenuRequest & {
|
|
|
458
482
|
* Request for opening the global context menu with custom context menu in Enterprise Browser.
|
|
459
483
|
* @internal
|
|
460
484
|
*/
|
|
461
|
-
export type InternalOpenPageTabContextMenuRequest = OpenPageTabContextMenuRequest
|
|
462
|
-
/** Coordinates associated with a target element for a custom context menu request. */
|
|
463
|
-
rect?: DOMRect;
|
|
464
|
-
};
|
|
485
|
+
export type InternalOpenPageTabContextMenuRequest = OpenPageTabContextMenuRequest;
|
|
465
486
|
/**
|
|
466
487
|
* Request to update the attributes of a page in which is attached to a running browser window.
|
|
467
488
|
*/
|
|
@@ -681,12 +702,16 @@ export declare enum WindowType {
|
|
|
681
702
|
Browser = "browser",
|
|
682
703
|
Platform = "platform"
|
|
683
704
|
}
|
|
705
|
+
/** How view tab widths are calculated. `'uniform'` is today's equal-width behavior. */
|
|
706
|
+
export type ViewTabWidthMode = 'uniform' | 'content';
|
|
684
707
|
export interface BrowserWorkspacePlatformViewOptions {
|
|
685
708
|
browserNavigationButtons?: RequireAtLeastOne<{
|
|
686
709
|
back?: boolean;
|
|
687
710
|
forward?: boolean;
|
|
688
711
|
reload?: boolean;
|
|
689
712
|
}>;
|
|
713
|
+
/** Per-view tab appearance options. */
|
|
714
|
+
viewTab?: ViewTabAppearanceOptions;
|
|
690
715
|
}
|
|
691
716
|
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
692
717
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
@@ -764,16 +789,36 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
764
789
|
minWidth?: string;
|
|
765
790
|
maxWidth?: string;
|
|
766
791
|
};
|
|
767
|
-
/**
|
|
792
|
+
/**
|
|
793
|
+
* Specifies the min and max sizes for view tabs in a layout, and how those widths are calculated.
|
|
768
794
|
* View tabs will expand to take all available space up to the specified maximum size.
|
|
769
795
|
* Similarly, they will collapse down to the specified minimum size.
|
|
770
796
|
* When there is not enough room to fit the tabs, the tabstrip will become scrollable.
|
|
771
797
|
* Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%").
|
|
772
|
-
*
|
|
798
|
+
* Defaults depend on the width mode: `'uniform'` uses "120px" for both bounds, while `'content'` sizes a
|
|
799
|
+
* tab to its own chrome and so applies no minimum and a "200px" maximum.
|
|
800
|
+
* To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* ```ts
|
|
804
|
+
* workspacePlatform: {
|
|
805
|
+
* viewTabDimensions: {
|
|
806
|
+
* widthMode: 'content',
|
|
807
|
+
* minWidth: '50px',
|
|
808
|
+
* maxWidth: '200px'
|
|
809
|
+
* }
|
|
810
|
+
* }
|
|
811
|
+
* ```
|
|
773
812
|
*/
|
|
774
813
|
viewTabDimensions?: {
|
|
775
814
|
minWidth?: string;
|
|
776
815
|
maxWidth?: string;
|
|
816
|
+
/**
|
|
817
|
+
* Controls how view tab widths are calculated.
|
|
818
|
+
* - `'uniform'` (default): current equal-width tab behavior.
|
|
819
|
+
* - `'content'`: tab width is driven by tab chrome (label, favicon, spinner, controls) within min/max bounds.
|
|
820
|
+
*/
|
|
821
|
+
widthMode?: ViewTabWidthMode;
|
|
777
822
|
};
|
|
778
823
|
/**
|
|
779
824
|
* Controls whether tab-search chevron buttons are shown for page tabs and view tabs.
|
|
@@ -1255,6 +1300,13 @@ export interface BrowserWindowModule {
|
|
|
1255
1300
|
* @internal
|
|
1256
1301
|
*/
|
|
1257
1302
|
_openSaveModal(req: OpenSaveMenuRequest): Promise<OpenFin.Identity>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Activates the page and opens its rename UI: the inline rename input in Enterprise Browser,
|
|
1305
|
+
* or the rename page modal otherwise.
|
|
1306
|
+
* @param pageId id of the page to rename
|
|
1307
|
+
* @internal
|
|
1308
|
+
*/
|
|
1309
|
+
_openRenameModal(pageId: string): Promise<OpenFin.Identity | undefined>;
|
|
1258
1310
|
/**
|
|
1259
1311
|
* Internal implementation of addPage that supports adding at a specific index
|
|
1260
1312
|
* @internal
|
|
@@ -1446,6 +1498,15 @@ export type AppSite = SiteInfo & {
|
|
|
1446
1498
|
};
|
|
1447
1499
|
};
|
|
1448
1500
|
};
|
|
1501
|
+
/**
|
|
1502
|
+
* Enterprise Web Search result (e.g. Google).
|
|
1503
|
+
* @internal
|
|
1504
|
+
*/
|
|
1505
|
+
export type WebSearchSite = SiteInfo & {
|
|
1506
|
+
type: 'websearch';
|
|
1507
|
+
url: string;
|
|
1508
|
+
icon: string;
|
|
1509
|
+
};
|
|
1449
1510
|
/**
|
|
1450
1511
|
* @internal
|
|
1451
1512
|
*/
|
|
@@ -1466,7 +1527,7 @@ export type CollectionSite = SiteInfo & {
|
|
|
1466
1527
|
/**
|
|
1467
1528
|
* @internal
|
|
1468
1529
|
*/
|
|
1469
|
-
export type Site = AppSite | WorkspaceSite;
|
|
1530
|
+
export type Site = AppSite | WorkspaceSite | WebSearchSite;
|
|
1470
1531
|
/**
|
|
1471
1532
|
* @internal
|
|
1472
1533
|
*/
|
|
@@ -2565,6 +2626,7 @@ export declare enum CustomActionCallerType {
|
|
|
2565
2626
|
StoreCustomButton = "StoreCustomButton",
|
|
2566
2627
|
CustomDropdownItem = "CustomDropdownItem",
|
|
2567
2628
|
GlobalContextMenu = "GlobalContextMenu",
|
|
2629
|
+
ViewTabControl = "ViewTabControl",
|
|
2568
2630
|
ViewTabContextMenu = "ViewTabContextMenu",
|
|
2569
2631
|
PageTabContextMenu = "PageTabContextMenu",
|
|
2570
2632
|
SaveButtonContextMenu = "SaveButtonContextMenu",
|
|
@@ -2575,7 +2637,7 @@ export declare enum CustomActionCallerType {
|
|
|
2575
2637
|
* When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
|
|
2576
2638
|
export type CustomActionPayload = {
|
|
2577
2639
|
callerType: CustomActionCallerType.API;
|
|
2578
|
-
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
2640
|
+
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabControlActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
2579
2641
|
/**
|
|
2580
2642
|
* Payload received by invokeCustomActionInternal platform provider method
|
|
2581
2643
|
* @internal
|
|
@@ -2843,6 +2905,10 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2843
2905
|
* external `translation-override.json` (configured via `translationOverridesUrl`) is
|
|
2844
2906
|
* also accepted.
|
|
2845
2907
|
*
|
|
2908
|
+
* When `languagePacksApiUrl` is set, i18next loads packs over HTTP from that
|
|
2909
|
+
* i18next-http-backend `loadPath` (e.g. `${origin}/platform/api/localization/{{lng}}/{{ns}}.json`)
|
|
2910
|
+
* instead of the bundled locale JSON. Omit it to keep the built-in packs.
|
|
2911
|
+
*
|
|
2846
2912
|
* @example
|
|
2847
2913
|
* ```ts
|
|
2848
2914
|
* await WorkspacePlatform.init({
|
|
@@ -2859,6 +2925,11 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2859
2925
|
*/
|
|
2860
2926
|
language?: {
|
|
2861
2927
|
initialLanguage?: Locale;
|
|
2928
|
+
/**
|
|
2929
|
+
* i18next-http-backend loadPath. When provided, HTTP language packs are used
|
|
2930
|
+
* even if the manifest did not inject `languagePacksApiUrl`.
|
|
2931
|
+
*/
|
|
2932
|
+
languagePacksApiUrl?: string;
|
|
2862
2933
|
};
|
|
2863
2934
|
/**
|
|
2864
2935
|
* Override workspace platform behavior
|
|
@@ -3302,6 +3373,7 @@ export interface SearchProvider {
|
|
|
3302
3373
|
supportsQueryless?: boolean;
|
|
3303
3374
|
supportsPaging?: boolean;
|
|
3304
3375
|
filters?: SearchProviderFilter[];
|
|
3376
|
+
connected?: boolean;
|
|
3305
3377
|
}
|
|
3306
3378
|
/**
|
|
3307
3379
|
* @internal
|
|
@@ -12,7 +12,10 @@ export declare const getHttpBackendOptions: (loadPath: string) => {
|
|
|
12
12
|
* Fire-and-forget: first paint and the logo menu must not wait on this GET.
|
|
13
13
|
*/
|
|
14
14
|
export declare const overlayEnglishFromHttpBackend: () => void;
|
|
15
|
-
|
|
15
|
+
export type InitI18nextOptions = {
|
|
16
|
+
languagePacksApiUrl?: string;
|
|
17
|
+
};
|
|
18
|
+
declare function initI18next(language?: Locale, options?: InitI18nextOptions): Promise<void>;
|
|
16
19
|
export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
|
|
17
20
|
declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
|
|
18
21
|
export { initI18next, i18next, t, type Resource };
|
|
@@ -267,11 +267,15 @@ export interface CopyPagePayload {
|
|
|
267
267
|
/** Specifies the trigger for creating a copy. */
|
|
268
268
|
reason: 'save-as' | 'duplicate';
|
|
269
269
|
}
|
|
270
|
+
/** The user interaction that created a new page. Reported in the `Create Page` analytics event. */
|
|
271
|
+
export type PageCreationOrigin = 'new-tab-button' | 'menu' | 'hotkey' | 'dock' | 'new-window';
|
|
270
272
|
export type AddDefaultPagePayload = {
|
|
271
273
|
/** The OF window identity to attach the pages to. */
|
|
272
274
|
identity: OpenFin.Identity;
|
|
273
275
|
/** The page to attach. */
|
|
274
276
|
page: PageWithUpdatableRuntimeAttribs;
|
|
277
|
+
/** The user interaction that requested the page. */
|
|
278
|
+
origin?: PageCreationOrigin;
|
|
275
279
|
};
|
|
276
280
|
export type AddPagePayload = {
|
|
277
281
|
/** The OF window identity to attach the pages to. */
|
|
@@ -61,7 +61,18 @@ export declare enum EnterpriseAppDirectoryChannelAction {
|
|
|
61
61
|
GetApps = "get-apps",
|
|
62
62
|
GetCuratedContent = "get-curated-content",
|
|
63
63
|
GetRecentlyVisited = "get-recently-visited",
|
|
64
|
-
GetSearchProviders = "get-search-providers"
|
|
64
|
+
GetSearchProviders = "get-search-providers",
|
|
65
|
+
RecentsChanged = "recents-changed",
|
|
66
|
+
SearchProviderChanged = "search-provider-changed"
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export declare enum EnterpriseComponentBridgeChannelAction {
|
|
72
|
+
GetConnectors = "get-connectors",
|
|
73
|
+
ConnectConnector = "connect-connector",
|
|
74
|
+
DisconnectConnector = "disconnect-connector",
|
|
75
|
+
OnConnectorsChanged = "on-connectors-changed"
|
|
65
76
|
}
|
|
66
77
|
/**
|
|
67
78
|
* @internal
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Wire status for a Manage Connectors row. `connecting` wins over ready/not-ready while Connect is in flight. */
|
|
2
|
+
export type ConnectorStatus = 'disconnected' | 'connecting' | 'connected';
|
|
3
|
+
/** Full connector row returned by `get-connectors`. */
|
|
4
|
+
export type ConnectorPayload = {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
status: ConnectorStatus;
|
|
10
|
+
};
|
|
11
|
+
/** Status-only update payload published on `on-connectors-changed`. */
|
|
12
|
+
export type ConnectorChangedPayload = {
|
|
13
|
+
id: string;
|
|
14
|
+
status: ConnectorStatus;
|
|
15
|
+
};
|
|
16
|
+
/** Single-provider update published on `search-provider-changed`; merged into the matching `SearchProvider` by `id`. */
|
|
17
|
+
export type SearchProviderChangedPayload = {
|
|
18
|
+
id: string;
|
|
19
|
+
connected: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** `connect-connector` / `disconnect-connector` request payload. */
|
|
22
|
+
export type ConnectorIdPayload = {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
/** `customData` written onto the Manage Connectors popup window. */
|
|
26
|
+
export type ManageConnectorsCustomData = {
|
|
27
|
+
connectors: ConnectorPayload[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { CustomButtonConfig } from '../../../../common/src/api/action';
|
|
2
|
+
/**
|
|
3
|
+
* A CSS color value per view tab state. Any omitted state keeps its theme default, so a partial
|
|
4
|
+
* object overrides only the states it names.
|
|
5
|
+
*
|
|
6
|
+
* An empty string means inherit — that state is unset and falls back to its theme default. This is the only
|
|
7
|
+
* way to remove a color from a view that already has one: `updateOptions` merges, so omitting a state leaves
|
|
8
|
+
* its current color in place, and an empty `viewTab` object is treated as no change at all.
|
|
9
|
+
*/
|
|
10
|
+
export interface ViewTabStateColorOptions {
|
|
11
|
+
/** Color when the tab is inactive. */
|
|
12
|
+
default?: string;
|
|
13
|
+
/** Color when the tab is hovered (and not active). */
|
|
14
|
+
hover?: string;
|
|
15
|
+
/** Color when the tab is active. */
|
|
16
|
+
active?: string;
|
|
17
|
+
/** Color when the tab is active and its view is focused. */
|
|
18
|
+
focus?: string;
|
|
19
|
+
}
|
|
20
|
+
export type ViewTabControlPosition = {
|
|
21
|
+
/** Tab element used as the placement anchor. */
|
|
22
|
+
relativeTo: 'title' | 'favicon';
|
|
23
|
+
/** Side of the anchor on which the control is placed. */
|
|
24
|
+
placement: 'before' | 'after';
|
|
25
|
+
};
|
|
26
|
+
export type ThemedIcon = {
|
|
27
|
+
dark: string;
|
|
28
|
+
light: string;
|
|
29
|
+
};
|
|
30
|
+
export interface ViewTabControl extends Omit<CustomButtonConfig, 'iconUrl' | 'parentHover'> {
|
|
31
|
+
/** Icon URL, or URLs selected according to the current color scheme. */
|
|
32
|
+
iconUrl?: string | ThemedIcon;
|
|
33
|
+
/** Defaults to before the tab title. */
|
|
34
|
+
position?: ViewTabControlPosition;
|
|
35
|
+
}
|
|
36
|
+
export type ViewTabColorRole = 'backgroundColor' | 'fontColor';
|
|
37
|
+
/**
|
|
38
|
+
* Per-view view-tab appearance settings, nested under `workspacePlatform.viewTab` on view options.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
43
|
+
*
|
|
44
|
+
* const platform = WorkspacePlatform.getCurrentSync();
|
|
45
|
+
* await platform.Browser.createView({
|
|
46
|
+
* url: 'https://example.com',
|
|
47
|
+
* workspacePlatform: {
|
|
48
|
+
* viewTab: {
|
|
49
|
+
* backgroundColor: { default: '#1e3a5f', active: '#356aa3' },
|
|
50
|
+
* fontColor: { default: '#c9d8ea', active: '#ffffff' }
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* Returning a view to its theme defaults, naming every state that should be unset:
|
|
58
|
+
* ```ts
|
|
59
|
+
* await view.updateOptions({
|
|
60
|
+
* workspacePlatform: {
|
|
61
|
+
* viewTab: {
|
|
62
|
+
* backgroundColor: { default: '', hover: '', active: '', focus: '' },
|
|
63
|
+
* fontColor: { default: '', hover: '', active: '', focus: '' }
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export interface ViewTabAppearanceOptions {
|
|
70
|
+
/** Tab background color per state. */
|
|
71
|
+
backgroundColor?: ViewTabStateColorOptions;
|
|
72
|
+
/** Tab title text color per state. Does not affect the close or lock icons. */
|
|
73
|
+
fontColor?: ViewTabStateColorOptions;
|
|
74
|
+
/**
|
|
75
|
+
* Snapshot-safe controls rendered in this view's tab.
|
|
76
|
+
*
|
|
77
|
+
* Rendering requires the GoldenLayout 2 engine with scrolling tab overflow, which is how the
|
|
78
|
+
* Core UI Browser creates its layouts (`experimental.layoutEngine: 'v2'`, the Browser default).
|
|
79
|
+
* Windows that opt back in to the v1 engine render their tabs without custom controls, and this
|
|
80
|
+
* option is ignored rather than rejected.
|
|
81
|
+
*
|
|
82
|
+
* Controls render at a fixed size, so the right-most ones are clipped on tabs that are too
|
|
83
|
+
* narrow to fit them.
|
|
84
|
+
*/
|
|
85
|
+
controls?: ViewTabControl[];
|
|
86
|
+
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export declare const mockLogger: {
|
|
2
2
|
debug: jest.Mock<any, any, any>;
|
|
3
|
+
info: jest.Mock<any, any, any>;
|
|
3
4
|
warn: jest.Mock<any, any, any>;
|
|
4
5
|
error: jest.Mock<any, any, any>;
|
|
5
6
|
};
|
|
7
|
+
export declare const mockPerformanceLogger: {
|
|
8
|
+
debug: jest.Mock<any, any, any>;
|
|
9
|
+
info: jest.Mock<any, any, any>;
|
|
10
|
+
warn: jest.Mock<any, any, any>;
|
|
11
|
+
error: jest.Mock<any, any, any>;
|
|
12
|
+
startTimer: jest.Mock<any, any, any>;
|
|
13
|
+
endTimer: jest.Mock<any, any, any>;
|
|
14
|
+
clearTimer: jest.Mock<any, any, any>;
|
|
15
|
+
};
|