@openfin/workspace-platform 22.5.25 → 23.0.1-alpha.75ce533e
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/integrations/microsoft.utils.d.ts +6 -6
- package/client-api/src/shapes/index.d.ts +1 -1
- package/client-api-platform/src/api/controllers/theme-storage-controller-store.d.ts +16 -1
- package/client-api-platform/src/api/controllers/theme-storage-controller.d.ts +42 -25
- package/client-api-platform/src/api/dock.d.ts +5 -3
- package/client-api-platform/src/api/language.d.ts +1 -1
- package/client-api-platform/src/api/pages/open-pages.d.ts +2 -2
- package/client-api-platform/src/api/theming.d.ts +12 -0
- package/client-api-platform/src/api/theming.test.d.ts +1 -0
- package/client-api-platform/src/api/utils.d.ts +11 -0
- package/client-api-platform/src/init/override-callback/enterprise-page-required-layout-settings.d.ts +5 -0
- package/client-api-platform/src/init/override-callback/page-defaults.d.ts +1 -1
- package/client-api-platform/src/init/override-callback/view-components.d.ts +1 -1
- package/client-api-platform/src/init/override-callback/view-defaults.d.ts +2 -1
- package/client-api-platform/src/init/override-callback/view-options.d.ts +1 -1
- package/client-api-platform/src/init/theming.d.ts +5 -1
- package/client-api-platform/src/shapes.d.ts +124 -21
- package/common/src/api/pages/idb.d.ts +2 -4
- package/common/src/api/protocol/browser.d.ts +8 -6
- package/common/src/api/protocol/notifications.d.ts +8 -0
- package/common/src/api/protocol/shapes/workspace.d.ts +8 -0
- package/common/src/api/protocol/workspace-platform.d.ts +30 -25
- package/common/src/api/protocol/workspace.d.ts +2 -2
- package/common/src/api/provider.d.ts +1 -1
- package/common/src/api/shapes/notifications.d.ts +1 -0
- package/common/src/api/storefront.d.ts +5 -5
- package/common/src/api/theming.d.ts +40 -17
- package/common/src/utils/application.d.ts +7 -0
- package/common/src/utils/enterprise-menu.d.ts +1 -1
- package/common/src/utils/find-in-page/findInPageChannel.d.ts +37 -0
- package/common/src/utils/find-in-page/showFindInPageHandler.d.ts +2 -0
- package/common/src/utils/global-context-menu.d.ts +8 -1
- package/common/src/utils/layout.d.ts +38 -10
- package/common/src/utils/logger.d.ts +131 -0
- package/common/src/utils/menu-window-provider.d.ts +13 -9
- package/common/src/utils/merge-deep.d.ts +1 -0
- package/common/src/utils/modal-bounds.d.ts +1 -1
- package/common/src/utils/namespaced-local-storage.d.ts +5 -4
- package/common/src/utils/popup-window.d.ts +16 -0
- package/common/src/utils/route.d.ts +5 -1
- package/common/src/utils/shared-emitter.d.ts +4 -4
- package/common/src/utils/theming.d.ts +6 -0
- package/common/src/utils/types.d.ts +1 -1
- package/common/src/utils/window.d.ts +20 -9
- package/common/src/utils/workspace-modals.d.ts +1 -1
- package/dock3/src/api/utils.d.ts +11 -0
- package/dock3/src/shapes/shapes.d.ts +13 -1
- package/externals.report.json +19 -11
- package/index.js +2 -1
- package/index.js.LICENSE.txt +1 -0
- package/index.js.map +1 -1
- package/package.json +7 -3
- package/search-api/src/provider/remote/info.d.ts +1 -1
- package/search-api/src/shapes.d.ts +22 -1
- package/common/src/brand/default-brand.d.ts +0 -8
- package/workspace_platform.zip +0 -0
|
@@ -35,6 +35,8 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
35
35
|
GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
|
|
36
36
|
GetPageByViewIdentity = "getPageByViewIdentity",
|
|
37
37
|
GetThemes = "getThemes",
|
|
38
|
+
GetGeneratedPalettes = "getGeneratedPalettes",
|
|
39
|
+
GetThemePaletteSheet = "getThemePaletteSheet",
|
|
38
40
|
GetSelectedScheme = "getSelectedScheme",
|
|
39
41
|
SetSelectedScheme = "setSelectedScheme",
|
|
40
42
|
OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
|
|
@@ -67,31 +69,34 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
67
69
|
CopyPage = "copyPage",
|
|
68
70
|
HandlePageChanges = "handlePageChanges",
|
|
69
71
|
MarkUnsavedPagesAsSavedInternal = "markUnsavedPagesAsSavedInternal",
|
|
70
|
-
TrackRemovedTabInternal = "trackRemovedTabInternal"
|
|
71
|
-
RestoreRemovedTabInternal = "restoreRemovedTabInternal"
|
|
72
|
-
TrackVisitedSiteInternal = "trackVisitedSiteInternal"
|
|
73
|
-
GetRecentlyVisitedSitesInternal = "getRecentlyVisitedSitesInternal"
|
|
74
|
-
GetFrequentlyVisitedSitesInternal = "getFrequentlyVisitedSitesInternal"
|
|
75
|
-
SearchSitesInternal = "searchSitesInternal"
|
|
76
|
-
GetSearchProvidersInternal = "getSearchProvidersInternal"
|
|
77
|
-
GetCuratedContentInternal = "getCuratedContentInternal"
|
|
78
|
-
HandleRequestNavigationInternal = "handleRequestNavigationInternal"
|
|
79
|
-
RefreshBookmarksInternal = "refreshBookmarksInternal"
|
|
80
|
-
LaunchBookmarkInternal = "launchBookmarkInternal"
|
|
81
|
-
GetNotificationsConfig = "getNotificationsConfig"
|
|
82
|
-
UpdateDockFavoritesInternal = "updateDockFavoritesInternal"
|
|
83
|
-
UpdateContentMenuInternal = "updateContentMenuInternal"
|
|
84
|
-
LaunchDockEntryInternal = "launchDockEntryInternal"
|
|
85
|
-
SetDockFavoritesOrderInternal = "setDockFavoritesOrderInternal"
|
|
86
|
-
NavigateContentMenuInternal = "navigateContentMenuInternal"
|
|
87
|
-
SetDefaultDockButtonsOrderInternal = "setDefaultDockButtonsOrderInternal"
|
|
88
|
-
GetDockWorkspacesContextMenuInternal = "getDockWorkspacesContextMenuInternal"
|
|
89
|
-
HandleDockWorkspacesMenuResponseInternal = "handleDockWorkspacesMenuResponseInternal"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
72
|
+
TrackRemovedTabInternal = "trackRemovedTabInternal",// Enterprise
|
|
73
|
+
RestoreRemovedTabInternal = "restoreRemovedTabInternal",// Enterprise
|
|
74
|
+
TrackVisitedSiteInternal = "trackVisitedSiteInternal",// Enterprise
|
|
75
|
+
GetRecentlyVisitedSitesInternal = "getRecentlyVisitedSitesInternal",// Enterprise
|
|
76
|
+
GetFrequentlyVisitedSitesInternal = "getFrequentlyVisitedSitesInternal",// Enterprise
|
|
77
|
+
SearchSitesInternal = "searchSitesInternal",// Enterprise
|
|
78
|
+
GetSearchProvidersInternal = "getSearchProvidersInternal",// Enterprise
|
|
79
|
+
GetCuratedContentInternal = "getCuratedContentInternal",// Enterprise
|
|
80
|
+
HandleRequestNavigationInternal = "handleRequestNavigationInternal",// Enterprise
|
|
81
|
+
RefreshBookmarksInternal = "refreshBookmarksInternal",// Enterprise
|
|
82
|
+
LaunchBookmarkInternal = "launchBookmarkInternal",// Enterprise
|
|
83
|
+
GetNotificationsConfig = "getNotificationsConfig",// Deprecated
|
|
84
|
+
UpdateDockFavoritesInternal = "updateDockFavoritesInternal",// Enterprise
|
|
85
|
+
UpdateContentMenuInternal = "updateContentMenuInternal",// Enterprise
|
|
86
|
+
LaunchDockEntryInternal = "launchDockEntryInternal",// Enterprise
|
|
87
|
+
SetDockFavoritesOrderInternal = "setDockFavoritesOrderInternal",// Enterprise
|
|
88
|
+
NavigateContentMenuInternal = "navigateContentMenuInternal",// Enterprise
|
|
89
|
+
SetDefaultDockButtonsOrderInternal = "setDefaultDockButtonsOrderInternal",// Enterprise
|
|
90
|
+
GetDockWorkspacesContextMenuInternal = "getDockWorkspacesContextMenuInternal",// Enterprise
|
|
91
|
+
HandleDockWorkspacesMenuResponseInternal = "handleDockWorkspacesMenuResponseInternal",// Enterprise
|
|
92
|
+
RefreshDockCollectionMenuInternal = "refreshDockCollectionMenuInternal",// Enterprise
|
|
93
|
+
LaunchCollectionInternal = "launchCollectionInternal",//Enterprise
|
|
94
|
+
RemoveDockFavoriteInternal = "removeDockFavoriteInternal",// Enterprise
|
|
95
|
+
AddDockFavoriteInternal = "addDockFavoriteInternal",// Enterprise
|
|
96
|
+
FocusAndExpandSearchInternal = "focusAndExpandSearchInternal",// Enterprise
|
|
97
|
+
SendUpdateVersionModalResponseInternal = "sendUpdateVersionModalResponseInternal",// Enterprise
|
|
98
|
+
ShowUpdateVersionModalInternal = "showUpdateVersionModalInternal",// Enterprise
|
|
99
|
+
GetNotificationIndicatorColorsInternal = "getNotificationIndicatorColorsInternal"
|
|
95
100
|
}
|
|
96
101
|
export type PlatFormSupportedFeatures = boolean | {
|
|
97
102
|
isWorkspacePlatform: boolean;
|
|
@@ -19,8 +19,8 @@ export declare const launchProvider: () => Promise<void>;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getChannelClientAndLaunchProvider: () => Promise<WorkspaceComponentChannelClient>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Gets the theme data from the Platform provider, then launches the Workspace provider if it is not running, and then dispatches the theme data to the Workspace provider.
|
|
23
23
|
* Then gets a Channel Client that is connected to the Workspace Provider.
|
|
24
24
|
* @returns the Channel Client that is connected to the Workspace Provider.
|
|
25
25
|
*/
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const getChannelClientAndInitializeWorkspaceProvider: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
@@ -98,7 +98,7 @@ export interface ProviderUpdateEventPayload {
|
|
|
98
98
|
*
|
|
99
99
|
* This allows for different providers to be registered with the same id.
|
|
100
100
|
*/
|
|
101
|
-
export declare const getUniqueProviderIdentifier: ({ platformIdentity, id }: Pick<ProviderInfoInternal,
|
|
101
|
+
export declare const getUniqueProviderIdentifier: ({ platformIdentity, id }: Pick<ProviderInfoInternal, "platformIdentity" | "id">) => string;
|
|
102
102
|
/**
|
|
103
103
|
* Get a list of all providers that have registered with the provider API.
|
|
104
104
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Options for using privately hosted notification service.
|
|
3
|
+
* @deprecated Custom manifest is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this type as it will be ignored.
|
|
3
4
|
*/
|
|
4
5
|
export type NotificationsCustomManifestOptions = {
|
|
5
6
|
/**
|
|
@@ -30,29 +30,29 @@ export declare const launchStorefrontApp: (req: LaunchStorefrontProviderAppReque
|
|
|
30
30
|
* @param identity of the platform to get the apps from.
|
|
31
31
|
* @returns the list of Storefront apps for the platform.
|
|
32
32
|
*/
|
|
33
|
-
export declare const getStorefrontApps: (provider: ProviderInfoInternal<
|
|
33
|
+
export declare const getStorefrontApps: (provider: ProviderInfoInternal<"storefront">) => Promise<App[]>;
|
|
34
34
|
/**
|
|
35
35
|
* Get the platform's landing page for Storefront.
|
|
36
36
|
* @param identity of the platform to get the landing page of.
|
|
37
37
|
* @returns the platform's landing page.
|
|
38
38
|
*/
|
|
39
|
-
export declare const getStorefrontLandingPage: (provider: ProviderInfoInternal<
|
|
39
|
+
export declare const getStorefrontLandingPage: (provider: ProviderInfoInternal<"storefront">) => Promise<StorefrontLandingPage | undefined>;
|
|
40
40
|
/**
|
|
41
41
|
* Get the platform's footer for Storefront.
|
|
42
42
|
* @param identity of the platform to get the footer of.
|
|
43
43
|
* @returns the platform's footer.
|
|
44
44
|
*/
|
|
45
|
-
export declare const getStorefrontFooter: (provider: ProviderInfoInternal<
|
|
45
|
+
export declare const getStorefrontFooter: (provider: ProviderInfoInternal<"storefront">) => Promise<StorefrontFooter>;
|
|
46
46
|
/**
|
|
47
47
|
* Get the platform's navigation for Storefront.
|
|
48
48
|
* @param identity of the platform to get the navigation of.
|
|
49
49
|
* @returns the platform's navigation.
|
|
50
50
|
*/
|
|
51
|
-
export declare const getStorefrontNavigation: (provider: ProviderInfoInternal<
|
|
51
|
+
export declare const getStorefrontNavigation: (provider: ProviderInfoInternal<"storefront">) => Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
52
52
|
/**
|
|
53
53
|
* A helper method that gets a Storefront navigation item by ID.
|
|
54
54
|
* @param navigationItemId the id of the Storefront navigation item.
|
|
55
55
|
* @param identity of the platform.
|
|
56
56
|
* @returns the navigation item with the ID.
|
|
57
57
|
*/
|
|
58
|
-
export declare const getStorefrontNavigationItemAppGrid: (navigationItemId: string, provider: ProviderInfoInternal<
|
|
58
|
+
export declare const getStorefrontNavigationItemAppGrid: (navigationItemId: string, provider: ProviderInfoInternal<"storefront">) => Promise<StorefrontNavigationItemAppGrid | undefined>;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { DefaultTheme } from 'styled-components';
|
|
2
2
|
import type OpenFin from '@openfin/core';
|
|
3
|
-
import {
|
|
4
|
-
import { Palette } from '@openfin/ui-library/dist/theme';
|
|
3
|
+
import type { ColorSchemeType, ThemeSet } from '@openfin/ui-library';
|
|
5
4
|
import { ColorSchemeOptionType } from '../../../client-api-platform/src/shapes';
|
|
5
|
+
import type { generateTheme } from '@openfin/theme-engine';
|
|
6
|
+
export declare const ColorScheme: {
|
|
7
|
+
light: string;
|
|
8
|
+
dark: string;
|
|
9
|
+
system: string;
|
|
10
|
+
};
|
|
6
11
|
export type WorkspaceComponentSetSelectedSchemePayload = {
|
|
7
12
|
newScheme: ColorSchemeOptionType;
|
|
8
13
|
identity: OpenFin.Identity;
|
|
@@ -35,6 +40,13 @@ export interface NotificationIndicatorColorsSetLightScheme {
|
|
|
35
40
|
dark?: NotificationIndicatorColorsSet;
|
|
36
41
|
light: NotificationIndicatorColorsSet;
|
|
37
42
|
}
|
|
43
|
+
export type NotificationIndicatorColors = Record<string, Omit<NotificationIndicatorColorsSet, 'foreground'> & {
|
|
44
|
+
foreground: string;
|
|
45
|
+
}>;
|
|
46
|
+
export type NotificationIndicatorColorsParsed = {
|
|
47
|
+
dark: NotificationIndicatorColors;
|
|
48
|
+
light: NotificationIndicatorColors;
|
|
49
|
+
};
|
|
38
50
|
export type NotificationIndicatorColorsWithScheme = Record<string, NotificationIndicatorColorsSetDarkScheme | NotificationIndicatorColorsSetLightScheme>;
|
|
39
51
|
export interface BaseThemeOptions {
|
|
40
52
|
label: string;
|
|
@@ -65,7 +77,7 @@ export type CustomThemeOptions = BaseThemeOptions & {
|
|
|
65
77
|
* };
|
|
66
78
|
* ```
|
|
67
79
|
*/
|
|
68
|
-
notificationIndicatorColors?:
|
|
80
|
+
notificationIndicatorColors?: NotificationIndicatorColors;
|
|
69
81
|
};
|
|
70
82
|
export type CustomThemeOptionsWithScheme = BaseThemeOptions & {
|
|
71
83
|
/**
|
|
@@ -121,10 +133,23 @@ export type CustomThemeOptionsWithScheme = BaseThemeOptions & {
|
|
|
121
133
|
*/
|
|
122
134
|
notificationIndicatorColors?: NotificationIndicatorColorsWithScheme;
|
|
123
135
|
};
|
|
124
|
-
export type
|
|
136
|
+
export type ThemeOptions = BaseThemeOptions & {
|
|
137
|
+
seed: Parameters<typeof generateTheme>[0];
|
|
138
|
+
overrides?: Parameters<typeof generateTheme>[1];
|
|
139
|
+
default?: Exclude<ColorSchemeOptionType, 'system'>;
|
|
140
|
+
} & {
|
|
141
|
+
notificationIndicatorColors?: NotificationIndicatorColorsWithScheme | NotificationIndicatorColors;
|
|
142
|
+
};
|
|
143
|
+
type GenerateThemeReturn = ReturnType<typeof generateTheme>;
|
|
144
|
+
export type GeneratedPalettes = Pick<GenerateThemeReturn, 'dark' | 'light'>;
|
|
145
|
+
export type LegacyPalettes = CustomThemeOptions | CustomThemeOptionsWithScheme;
|
|
146
|
+
export type GenerateThemeParams = Parameters<typeof generateTheme>;
|
|
147
|
+
export type CustomTheme = CustomThemeOptions | CustomThemeOptionsWithScheme | ThemeOptions;
|
|
148
|
+
export type CustomThemes = CustomTheme[];
|
|
125
149
|
export interface PreloadedThemeData {
|
|
126
|
-
themes: CustomThemes;
|
|
150
|
+
themes: CustomThemes | GeneratedPalettes;
|
|
127
151
|
selectedScheme: ColorSchemeOptionType;
|
|
152
|
+
themePaletteSheet?: string;
|
|
128
153
|
}
|
|
129
154
|
export interface DefaultPaletteSet {
|
|
130
155
|
brandPrimary: string;
|
|
@@ -265,16 +290,14 @@ export declare const OpenFinDarkTheme: {
|
|
|
265
290
|
borderNeutral: "#C0C1C2";
|
|
266
291
|
};
|
|
267
292
|
export declare const DefaultOpenFinTheme: CustomThemes;
|
|
268
|
-
export declare const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
*/
|
|
276
|
-
export declare const computeThemes: (customThemes: CustomThemes, storedScheme?: ColorSchemeOptionType) => ComputedThemes;
|
|
277
|
-
export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<ComputedTheme>;
|
|
293
|
+
export declare const parseNotificationIndicatorColors: (customTheme: CustomTheme) => NotificationIndicatorColorsParsed;
|
|
294
|
+
export declare const constructThemePaletteSheet: (themes: GeneratedPalettes) => string;
|
|
295
|
+
export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<{
|
|
296
|
+
theme: CustomThemes | GeneratedPalettes;
|
|
297
|
+
defaultScheme: ColorSchemeOptionType;
|
|
298
|
+
themePaletteSheet: string;
|
|
299
|
+
}>;
|
|
278
300
|
export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
|
|
279
|
-
export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType,
|
|
280
|
-
export declare const getComputedBackgroundColor: (
|
|
301
|
+
export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType, "system">>;
|
|
302
|
+
export declare const getComputedBackgroundColor: (platformIdentity: OpenFin.Identity) => Promise<string>;
|
|
303
|
+
export {};
|
|
@@ -23,3 +23,10 @@ export type ApplicationInfoExtended = OpenFin.ApplicationInfo & {
|
|
|
23
23
|
};
|
|
24
24
|
export declare const getCurrentOFApplication: () => OpenFin.Application;
|
|
25
25
|
export declare const getWorkspaceOFApplication: () => OpenFin.Application;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the application manifest, caching the result after the first call.
|
|
28
|
+
* The manifest never changes during the application lifecycle, so this avoids redundant async calls.
|
|
29
|
+
* Uses promise-based caching to prevent race conditions when multiple calls occur before the first completes.
|
|
30
|
+
* @returns A Promise resolving to the application manifest
|
|
31
|
+
*/
|
|
32
|
+
export declare const getCachedManifest: () => Promise<OpenFin.Manifest>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { EnterpriseMainContextMenuItemData, EnterpriseMainContextMenuItemTemplate, OpenGlobalContextMenuPayload } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
export declare const getEnterpriseContextMenuTemplate: ({ identity
|
|
3
|
+
export declare const getEnterpriseContextMenuTemplate: ({ identity }: {
|
|
4
4
|
identity: OpenFin.Identity;
|
|
5
5
|
selectedViews: OpenFin.Identity[];
|
|
6
6
|
}) => Promise<EnterpriseMainContextMenuItemTemplate[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type FindInPageChannelMessagePayload = {
|
|
2
|
+
type: 'close';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'find-text-changed';
|
|
5
|
+
value: string;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'focus-input';
|
|
8
|
+
} | {
|
|
9
|
+
type: 'hide-from-search-menu';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'next-result';
|
|
12
|
+
} | {
|
|
13
|
+
type: 'previous-result';
|
|
14
|
+
} | {
|
|
15
|
+
type: 'show';
|
|
16
|
+
} | {
|
|
17
|
+
type: 'update-state';
|
|
18
|
+
currentResultIndex?: number | null;
|
|
19
|
+
totalResults?: number | null;
|
|
20
|
+
value?: string | null;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'view-ready';
|
|
23
|
+
} | {
|
|
24
|
+
type: 'window-ready';
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Closes the find in page channel
|
|
28
|
+
*/
|
|
29
|
+
export declare const closeFindInPageChannel: (channel: BroadcastChannel) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new find in page channel
|
|
32
|
+
*/
|
|
33
|
+
export declare const createFindInPageChannel: (windowName?: string) => Promise<BroadcastChannel>;
|
|
34
|
+
/**
|
|
35
|
+
* Sends a message via the find in page channel
|
|
36
|
+
*/
|
|
37
|
+
export declare const sendFindInPageMessage: (channel: BroadcastChannel, message: FindInPageChannelMessagePayload) => void;
|
|
@@ -74,6 +74,13 @@ export declare const manageDesktopSignals: () => {
|
|
|
74
74
|
type: WP.GlobalContextMenuOptionType;
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
+
export declare const findInPage: () => {
|
|
78
|
+
type: MenuItemType;
|
|
79
|
+
label: string;
|
|
80
|
+
data: {
|
|
81
|
+
type: WP.GlobalContextMenuOptionType;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
77
84
|
export declare const renameWorkspace: () => {
|
|
78
85
|
type: MenuItemType;
|
|
79
86
|
label: string;
|
|
@@ -93,7 +100,7 @@ export declare const downloads: () => {
|
|
|
93
100
|
export declare const appearance: () => {
|
|
94
101
|
label: string;
|
|
95
102
|
};
|
|
96
|
-
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Pick<Workspace,
|
|
103
|
+
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Pick<Workspace, "workspaceId" | "title">[], contextMenuOptionType: GlobalContextMenuOptionType) => {
|
|
97
104
|
label: string;
|
|
98
105
|
type: MenuItemType;
|
|
99
106
|
enabled: boolean;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import type OpenFin from '@openfin/core';
|
|
3
2
|
import { WindowIdentity } from '../../../common/src/utils/window';
|
|
4
|
-
import { AttachedPageInternal } from '../../../common/src/api/pages/shapes';
|
|
5
3
|
import { AttachedPage, PageLayout } from '../../../client-api-platform/src/shapes';
|
|
6
4
|
export type LayoutDOMEventType =
|
|
7
5
|
/**
|
|
@@ -12,12 +10,22 @@ export type LayoutDOMEventType =
|
|
|
12
10
|
* Fired when a tab is created in a container. (Emmitted by core)
|
|
13
11
|
*/
|
|
14
12
|
| 'tab-created'
|
|
13
|
+
/**
|
|
14
|
+
* Fired when a new container/stack is created. (Emitted by Golden Layout)
|
|
15
|
+
*/
|
|
16
|
+
| 'container-created'
|
|
15
17
|
/**
|
|
16
18
|
* Fired when the layout container is ready to be used. (Emitted by us)
|
|
17
19
|
*/
|
|
18
|
-
| 'container-resized'
|
|
20
|
+
| 'container-resized'
|
|
21
|
+
/**
|
|
22
|
+
* Fired when a view item container is resized (e.g., via separator drag). (Emitted by us)
|
|
23
|
+
*/
|
|
24
|
+
| 'view-container-resized' | 'tab-closed';
|
|
19
25
|
export type LayoutDOMEvent = {
|
|
20
26
|
type: Extract<LayoutDOMEventType, 'container-resized'>;
|
|
27
|
+
} | {
|
|
28
|
+
type: Extract<LayoutDOMEventType, 'view-container-resized'>;
|
|
21
29
|
} | {
|
|
22
30
|
type: Extract<LayoutDOMEventType, 'tab-created' | 'tab-closed'>;
|
|
23
31
|
detail: {
|
|
@@ -31,12 +39,21 @@ export type LayoutDOMEvent = {
|
|
|
31
39
|
};
|
|
32
40
|
isInitialized: boolean;
|
|
33
41
|
target: HTMLElement;
|
|
42
|
+
} | {
|
|
43
|
+
type: Extract<LayoutDOMEventType, 'container-created'>;
|
|
44
|
+
detail?: {
|
|
45
|
+
containerSelector?: string;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
target?: HTMLElement;
|
|
49
|
+
originalElement?: HTMLElement;
|
|
34
50
|
} | {
|
|
35
51
|
type: Extract<LayoutDOMEventType, 'tabs-list-resized'>;
|
|
36
52
|
};
|
|
37
53
|
export type LayoutDOMEventListener = (ev: LayoutDOMEvent) => void;
|
|
38
54
|
export declare const VIEW_NAME_PREFIX: "internal-generated-view-";
|
|
39
|
-
export declare const
|
|
55
|
+
export declare const getViewNameFromTabId: (tabId: string) => string;
|
|
56
|
+
export declare const getFirstActiveViewFromLayout: (identity: OpenFin.LayoutIdentity) => OpenFin.Identity | undefined;
|
|
40
57
|
/**
|
|
41
58
|
* Recursively clones a layout object, calling a passed callback on each `componentState` in the tree.
|
|
42
59
|
* @param node Either the layout object itself, or one of the items in its tree.
|
|
@@ -44,6 +61,13 @@ export declare const getFirstActiveViewFromLayout: (identity: OpenFin.LayoutIden
|
|
|
44
61
|
* @returns A mapped copy of the layout
|
|
45
62
|
*/
|
|
46
63
|
export declare const mapLayoutViewComponents: (node: any, callback: (arg0: any) => any) => any;
|
|
64
|
+
/**
|
|
65
|
+
* Recursively clones a layout object, calling a passed async callback on each `componentState` in the tree.
|
|
66
|
+
* @param node Either the layout object itself, or one of the items in its tree.
|
|
67
|
+
* @param callback Async callback to be called on each component's `componentState`
|
|
68
|
+
* @returns A Promise resolving to a mapped copy of the layout
|
|
69
|
+
*/
|
|
70
|
+
export declare const mapLayoutViewComponentsAsync: (node: any, callback: (arg0: any) => Promise<any>) => Promise<any>;
|
|
47
71
|
/**
|
|
48
72
|
* Copies the componentState and generates a name if it's not there
|
|
49
73
|
* @param componentState view's componentState in the layout object, corresponds to View options
|
|
@@ -63,9 +87,9 @@ export declare const generateViewNameAndIdentifierNameIfNotExists: <T extends {
|
|
|
63
87
|
/**
|
|
64
88
|
* Deep clones a layout and converts view options (add names if necessary, apply defaults).
|
|
65
89
|
* @param layout The Layout to be cloned
|
|
66
|
-
* @returns A copy of the layout with view options converted
|
|
90
|
+
* @returns A Promise resolving to a copy of the layout with view options converted
|
|
67
91
|
*/
|
|
68
|
-
export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<OpenFin.ViewOptions>) =>
|
|
92
|
+
export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<OpenFin.ViewOptions>) => Promise<PageLayout>;
|
|
69
93
|
export declare const cloneViewComponentWithoutName: (componentState: any) => any;
|
|
70
94
|
/**
|
|
71
95
|
* Deep clones a layout and removes view names.
|
|
@@ -79,13 +103,20 @@ export declare const cloneLayoutAndRemoveNames: (layout: PageLayout) => any;
|
|
|
79
103
|
* @returns A copy of the layout with generated names removed
|
|
80
104
|
*/
|
|
81
105
|
export declare const cloneLayoutAndRemoveGeneratedNames: (layout: PageLayout) => any;
|
|
82
|
-
export declare const mapContentComponentState: (content: OpenFin.LayoutContent) => OpenFin.LayoutComponent[
|
|
106
|
+
export declare const mapContentComponentState: (content: OpenFin.LayoutContent) => OpenFin.LayoutComponent["componentState"][];
|
|
83
107
|
export declare const getLayoutWithSingleView: (title: string, url: string, winIdentity?: OpenFin.Identity) => Promise<any>;
|
|
84
108
|
export declare const layoutNameInitializedMap: Map<string, boolean>;
|
|
85
109
|
export declare const isLayoutTabActive: (tabSelector: string) => boolean;
|
|
86
110
|
export declare const containerId = "layout_container";
|
|
87
111
|
export declare const viewTabslistSelectors = ".lm_tabs";
|
|
88
112
|
export declare const addLayoutEventListener: (event: LayoutDOMEventType, listener: LayoutDOMEventListener) => void;
|
|
113
|
+
export declare const removeLayoutEventListener: (event: LayoutDOMEventType, listener: LayoutDOMEventListener) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Cleans up ResizeObservers and event listeners for a specific layout.
|
|
116
|
+
* Should be called when a layout is destroyed to prevent memory leaks.
|
|
117
|
+
* @param layoutName The layoutName/layoutContainerKey to cleanup
|
|
118
|
+
*/
|
|
119
|
+
export declare const cleanupLayoutObservers: (layoutName: string) => void;
|
|
89
120
|
/**
|
|
90
121
|
* Initialize the layout for the current OF window.
|
|
91
122
|
*/
|
|
@@ -120,9 +151,6 @@ export declare const findViewInLayout: (node: any, viewId: OpenFin.Identity) =>
|
|
|
120
151
|
*/
|
|
121
152
|
export declare const countViews: (node: OpenFin.LayoutContent) => number;
|
|
122
153
|
export declare const getLayoutConfig: (layoutContainerKey: string) => Promise<any>;
|
|
123
|
-
export declare const updateTabStateBasedOnViewCount: (page: AttachedPageInternal, viewCount: number) => Promise<void>;
|
|
124
|
-
export declare const updatePageForViewCount: (activePage: AttachedPageInternal | undefined) => Promise<void>;
|
|
125
|
-
export declare const debouncedUpdatePageForViewCount: import("lodash").DebouncedFunc<(activePage: AttachedPageInternal | undefined) => Promise<void>>;
|
|
126
154
|
export declare const findPageForView: (viewName: string, browserWindowIdentity?: WindowIdentity) => Promise<AttachedPage | undefined>;
|
|
127
155
|
/**
|
|
128
156
|
* Only show the view tab icon when not on the landing page
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Utility for OpenFin Workspace Monorepo
|
|
3
|
+
*
|
|
4
|
+
* Provides structured, contextual logging with consistent formatting
|
|
5
|
+
* across all workspaces and modules.
|
|
6
|
+
*/
|
|
7
|
+
export interface LogData {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface Logger {
|
|
11
|
+
debug: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
12
|
+
info: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
13
|
+
warn: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
14
|
+
error: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for the logger
|
|
18
|
+
*/
|
|
19
|
+
export interface LoggerConfig {
|
|
20
|
+
/** Include timestamp in logs (default: true) */
|
|
21
|
+
includeTimestamp?: boolean;
|
|
22
|
+
/** Custom prefix for logs */
|
|
23
|
+
customPrefix?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Stringify log data before passing to console (default: true).
|
|
26
|
+
* When true, objects are serialized as JSON strings for safer logging.
|
|
27
|
+
* When false, raw objects are passed to console, allowing expandable/inspectable
|
|
28
|
+
* objects in browser dev tools.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* To disable safe stringify for local development, you can:
|
|
32
|
+
* 1. Set this option per-logger: createLogger('MyContext', { stringifyData: false })
|
|
33
|
+
* 2. Or call setGlobalStringifyEnabled(false) once at app startup
|
|
34
|
+
*/
|
|
35
|
+
stringifyData?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Enable or disable safe stringify globally for all loggers.
|
|
39
|
+
* Useful for local development when you want expandable objects in browser dev tools.
|
|
40
|
+
*
|
|
41
|
+
* This overrides the build-time LOG_STRINGIFY setting at runtime.
|
|
42
|
+
* Individual logger config (stringifyData option) takes precedence over this setting.
|
|
43
|
+
*
|
|
44
|
+
* @param enabled - Whether to stringify log data
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Override build-time setting at runtime:
|
|
49
|
+
* import { setGlobalStringifyEnabled } from 'common/src/utils/logger';
|
|
50
|
+
*
|
|
51
|
+
* // Disable stringify to get expandable objects in console
|
|
52
|
+
* setGlobalStringifyEnabled(false);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const setGlobalStringifyEnabled: (enabled: boolean) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Get the current global stringify setting.
|
|
58
|
+
*/
|
|
59
|
+
export declare const getGlobalStringifyEnabled: () => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Create a structured logger for a specific context
|
|
62
|
+
*
|
|
63
|
+
* @param context - The context identifier (workspace, module, or component name)
|
|
64
|
+
* @param config - Optional configuration for the logger
|
|
65
|
+
* @returns Enhanced logger instance
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const logger = createLogger('browser.TabList');
|
|
70
|
+
*
|
|
71
|
+
* logger.info('addTab', 'Adding new tab', { pageId: '123' });
|
|
72
|
+
* logger.error('addTab', 'Failed to add tab', { error: err.message });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare const createLogger: (context: string, config?: LoggerConfig) => Logger;
|
|
76
|
+
/**
|
|
77
|
+
* Create a logger with performance monitoring capabilities
|
|
78
|
+
* Useful for tracking execution times and performance metrics
|
|
79
|
+
*/
|
|
80
|
+
export declare const createPerformanceLogger: (context: string, config?: LoggerConfig) => {
|
|
81
|
+
/**
|
|
82
|
+
* Start a performance timer
|
|
83
|
+
*/
|
|
84
|
+
startTimer: (timerId: string, method: string, message: string, data?: LogData) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Clear a specific timer without logging
|
|
87
|
+
*/
|
|
88
|
+
clearTimer: (timerId: string) => void;
|
|
89
|
+
/**
|
|
90
|
+
* End a performance timer and log the duration
|
|
91
|
+
*/
|
|
92
|
+
endTimer: (timerId: string, method: string, message: string, data?: LogData) => void;
|
|
93
|
+
debug: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
94
|
+
info: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
95
|
+
warn: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
96
|
+
error: (method: string, message: string, data?: LogData | (() => LogData)) => void;
|
|
97
|
+
};
|
|
98
|
+
export type EnhancedLogger = ReturnType<typeof createPerformanceLogger>;
|
|
99
|
+
/**
|
|
100
|
+
* Middleware function for wrapping async operations with logging
|
|
101
|
+
*/
|
|
102
|
+
export declare const withLogging: <T extends any[], R>(logger: Logger, method: string, operation: (...args: T) => Promise<R> | R) => (...args: T) => Promise<R>;
|
|
103
|
+
/**
|
|
104
|
+
* Legacy logger instance for backwards compatibility.
|
|
105
|
+
* Use `createLogger` for new code to get structured, contextual logging.
|
|
106
|
+
*
|
|
107
|
+
* @deprecated Use createLogger() instead for new code
|
|
108
|
+
*/
|
|
109
|
+
export declare const log: {
|
|
110
|
+
/**
|
|
111
|
+
* Calls console.debug with provided parameters and stringifies JS objects prior to logging.
|
|
112
|
+
* Only logs when LOG_DEBUG is enabled.
|
|
113
|
+
*/
|
|
114
|
+
debug: (...args: unknown[]) => void;
|
|
115
|
+
/**
|
|
116
|
+
* Calls console.info with provided parameters and stringifies JS objects prior to logging
|
|
117
|
+
*/
|
|
118
|
+
info: (...args: unknown[]) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Calls console.warn with provided parameters and stringifies JS objects prior to logging
|
|
121
|
+
*/
|
|
122
|
+
warn: (...args: unknown[]) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Calls console.error with provided parameters and stringifies JS objects prior to logging
|
|
125
|
+
*/
|
|
126
|
+
error: (...args: unknown[]) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Calls console.trace with provided parameters and stringifies JS objects prior to logging
|
|
129
|
+
*/
|
|
130
|
+
trace: (...args: unknown[]) => void;
|
|
131
|
+
};
|
|
@@ -2,9 +2,13 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { ResponseModalContent } from '../../../common/src/utils/menu-config';
|
|
3
3
|
import type { OptionalExceptFor } from '../../../common/src/utils/types';
|
|
4
4
|
type MenuEventTypes = {
|
|
5
|
-
response: [ModalResponseEvent];
|
|
6
|
-
ready: [OpenFin.Identity];
|
|
7
|
-
update: [string, Partial<OpenFin.Bounds>, string];
|
|
5
|
+
'response': [ModalResponseEvent];
|
|
6
|
+
'ready': [OpenFin.Identity];
|
|
7
|
+
'update': [string, Partial<OpenFin.Bounds>, string];
|
|
8
|
+
'modal-opened': [string];
|
|
9
|
+
'modal-closed': [string];
|
|
10
|
+
'search-menu-opening': [string];
|
|
11
|
+
'search-menu-closed': [string];
|
|
8
12
|
};
|
|
9
13
|
export interface ModalResponseEvent {
|
|
10
14
|
data: {
|
|
@@ -17,12 +21,12 @@ export interface ModalResponseEvent {
|
|
|
17
21
|
}
|
|
18
22
|
export declare const menuEvents: {
|
|
19
23
|
emit: <EventKey extends keyof MenuEventTypes>(event: EventKey, ...payload: MenuEventTypes[EventKey]) => Promise<void>;
|
|
20
|
-
addListener: <
|
|
21
|
-
addListenerWithUUID: (uuid: string) => <
|
|
22
|
-
removeListener: <
|
|
23
|
-
once: <
|
|
24
|
+
addListener: <EventKey extends keyof MenuEventTypes>(event: EventKey, listener: (...payload: MenuEventTypes[EventKey]) => void) => void;
|
|
25
|
+
addListenerWithUUID: (uuid: string) => <EventKey extends keyof MenuEventTypes>(event: EventKey, listener: (...payload: MenuEventTypes[EventKey]) => void) => void;
|
|
26
|
+
removeListener: <EventKey extends keyof MenuEventTypes>(event: EventKey, listener: (...payload: MenuEventTypes[EventKey]) => void) => void;
|
|
27
|
+
once: <EventKey extends keyof MenuEventTypes>(event: EventKey, listener: (...payload: MenuEventTypes[EventKey]) => void) => void;
|
|
24
28
|
};
|
|
25
|
-
export declare const emitMenuResponse: (data: ModalResponseEvent[
|
|
29
|
+
export declare const emitMenuResponse: (data: ModalResponseEvent["data"]) => Promise<void>;
|
|
26
30
|
type WindowOptionsWithBounds = OptionalExceptFor<OpenFin.WindowOptions, 'name' | 'url'> & {
|
|
27
31
|
top: number;
|
|
28
32
|
left: number;
|
|
@@ -49,6 +53,6 @@ export declare function createMenuPosition(windowOptions: OptionalExceptFor<Open
|
|
|
49
53
|
}>;
|
|
50
54
|
export declare function showChildWindow({ options, parameters }: ShowChildOptions): Promise<OpenFin.Window>;
|
|
51
55
|
export declare const waitForModalResponse: ({ options, content, parameters }: ResponseModalOptions) => Promise<{
|
|
52
|
-
data: ModalResponseEvent[
|
|
56
|
+
data: ModalResponseEvent["data"];
|
|
53
57
|
}>;
|
|
54
58
|
export {};
|
|
@@ -16,7 +16,7 @@ export declare const getCenterOfParentWindowMonitor: (parentWindowIdentity?: Ope
|
|
|
16
16
|
* @param centerOnMonitor whether the modal should be centered on the monitor
|
|
17
17
|
* @returns the bounds for where the modal is to be displayed
|
|
18
18
|
*/
|
|
19
|
-
export declare const getResponseModalBounds: (modalOptions: Pick<ResponseModalConfig[
|
|
19
|
+
export declare const getResponseModalBounds: (modalOptions: Pick<ResponseModalConfig["windowOptions"], "defaultWidth" | "defaultHeight">, parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean) => Promise<OpenFin.Bounds>;
|
|
20
20
|
export declare function getResponseModalBoundsAndCenterParentIfModalOffScreen(modalOptions: Parameters<typeof getResponseModalBounds>[0], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean, relativeBounds?: boolean): Promise<OpenFin.Bounds>;
|
|
21
21
|
/**
|
|
22
22
|
* Adjusts the given bounds to be within the closest monitor's available bounds if they are offscreen.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const setItem: (key:
|
|
3
|
-
export declare const getItem: (key:
|
|
4
|
-
export declare const removeItem: (key:
|
|
1
|
+
import LocalStorageKey from './local-storage-key';
|
|
2
|
+
export declare const setItem: (key: LocalStorageKey, value: string) => void;
|
|
3
|
+
export declare const getItem: (key: LocalStorageKey) => string;
|
|
4
|
+
export declare const removeItem: (key: LocalStorageKey) => void;
|
|
5
|
+
export declare const createNamespacedLocalStorage: <TKey extends string>(namespace: string) => Pick<Storage, "setItem" | "getItem" | "removeItem">;
|