@openfin/workspace-platform 24.0.13 → 24.0.15
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/controllers/storage-proxies/channel-storage-proxy.d.ts +19 -0
- package/client-api-platform/src/api/controllers/storage-proxies/channel-storage-proxy.test.d.ts +1 -0
- package/client-api-platform/src/api/controllers/storage-proxies/local-storage-proxy.d.ts +12 -0
- package/client-api-platform/src/api/controllers/storage-proxies/local-storage-proxy.test.d.ts +1 -0
- package/client-api-platform/src/api/controllers/theme-storage-controller-store.d.ts +17 -0
- package/client-api-platform/src/api/controllers/theme-storage-controller.d.ts +28 -22
- package/client-api-platform/src/api/pages/index.d.ts +7 -2
- package/client-api-platform/src/api/theming.d.ts +8 -4
- package/client-api-platform/src/api/utils.d.ts +2 -7
- package/client-api-platform/src/init/index.d.ts +2 -1
- package/client-api-platform/src/init/override-callback/browser-defaults.d.ts +1 -1
- package/client-api-platform/src/init/override-callback/page-defaults.d.ts +1 -1
- package/client-api-platform/src/init/override-callback/snapshot.page-tab-groups.test.d.ts +1 -0
- package/client-api-platform/src/init/panels.d.ts +8 -1
- package/client-api-platform/src/init/theming.d.ts +2 -1
- package/client-api-platform/src/shapes.d.ts +39 -1
- package/common/src/api/pages/enterprise-shapes.d.ts +4 -0
- package/common/src/api/pages/shapes.d.ts +10 -2
- package/common/src/api/theme-migration.d.ts +46 -0
- package/common/src/api/theming.d.ts +16 -2
- package/common/src/utils/indicators/showIndicator.d.ts +8 -1
- package/common/src/utils/indicators/workspace-indicators.d.ts +13 -0
- package/common/src/utils/layout.d.ts +9 -6
- package/common/src/utils/popup-window.d.ts +23 -4
- package/externals.report.json +8 -8
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/workspace_platform.zip +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StorageProxy } from '../../../../../client-api-platform/src/api/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Channel Storage Proxy allows population of storage keys in a different origin, assuming that origin has set up
|
|
4
|
+
* a storage proxy on the specified URL.
|
|
5
|
+
*
|
|
6
|
+
* This is useful for writing to the localStorage of workspace when the provider is on a different origin.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ChannelStorageProxy implements StorageProxy {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(url: string);
|
|
11
|
+
get isDestroyed(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Sets a key in the proxied storage partition.
|
|
14
|
+
* @param key Key to set
|
|
15
|
+
* @param value Value.
|
|
16
|
+
*/
|
|
17
|
+
setItem(key: string, value: string): Promise<void>;
|
|
18
|
+
destroy(): Promise<void>;
|
|
19
|
+
}
|
package/client-api-platform/src/api/controllers/storage-proxies/channel-storage-proxy.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@common/test/fin-mocks';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StorageProxy } from '../../../../../client-api-platform/src/api/utils';
|
|
2
|
+
/**
|
|
3
|
+
* LocalStorage backed StorageProxy, for use in same origin scenarios (i.e. when the provider and workspace UI are guaranteed
|
|
4
|
+
* to share a storage partition).
|
|
5
|
+
*/
|
|
6
|
+
export declare class LocalStorageProxy implements StorageProxy {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(storage: Pick<Storage, 'setItem'>);
|
|
9
|
+
setItem(key: string, value: string): Promise<void>;
|
|
10
|
+
destroy(): Promise<void>;
|
|
11
|
+
get isDestroyed(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,3 +17,20 @@ export declare const initialiseStoragePalettes: (customThemes: CustomThemes | un
|
|
|
17
17
|
notificationIndicatorColors: NotificationIndicatorColorsParsed | null;
|
|
18
18
|
};
|
|
19
19
|
export declare const getThemeStorageController: () => ThemeStorageController;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves when the first theme sync completes. Use this to ensure that we do not launch UI such as browser until this has completed.
|
|
22
|
+
*
|
|
23
|
+
* @param allowFailure Whether to suppress rejections and continue anyway. Recommended for most use cases.
|
|
24
|
+
*/
|
|
25
|
+
export declare const waitForFirstThemeSync: (allowFailure?: boolean) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates and initialises the Theme Storage Controller singleton.
|
|
28
|
+
*
|
|
29
|
+
* Triggers the first theme sync, but does not await it. To ensure dependent UI can guarantee the theme palette is synced,
|
|
30
|
+
* you can call `await waitForFirstThemeSync` (e.g. in the createWindow provider override).
|
|
31
|
+
*
|
|
32
|
+
* @param isEnterprise Whether in enterprise mode (allows using local storage proxy directly).
|
|
33
|
+
* @param baseUrl Base url of the hosted workspace UI.
|
|
34
|
+
* @param syncTimeout How long `waitForFirstThemeSync` should wait before rejecting.
|
|
35
|
+
*/
|
|
36
|
+
export declare const initialiseThemeController: (isEnterprise: boolean, baseUrl: string, syncTimeout: number) => void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { GeneratedPalettes } from '../../../../common/src/api/theming';
|
|
2
1
|
import { StorageProxy } from '../../../../client-api-platform/src/api/utils';
|
|
3
2
|
import { ColorSchemeOptionType, CustomPaletteSet } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a string => (string | number) dictionary into a set of css vars.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getVars: (vars: Record<string, string | number>) => string;
|
|
4
7
|
/**
|
|
5
8
|
* Palette extensions can be used to add new variables to the palette set.
|
|
6
9
|
*
|
|
@@ -23,38 +26,38 @@ export type Palettes = {
|
|
|
23
26
|
light: string;
|
|
24
27
|
dark: string;
|
|
25
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Generates `--workspace-palette-*` CSS variable strings from a CustomPaletteSet.
|
|
31
|
+
* Used to produce legacy CSS vars for backwards compatibility with workspace apps
|
|
32
|
+
* that still consume the legacy theme system.
|
|
33
|
+
*/
|
|
34
|
+
export declare const generateLegacyCSSVars: (palettes: LegacyPalettes, isWindows: boolean) => {
|
|
35
|
+
light: string;
|
|
36
|
+
dark: string;
|
|
37
|
+
};
|
|
26
38
|
export declare class ThemeStorageController {
|
|
39
|
+
#private;
|
|
27
40
|
private providerStorage;
|
|
28
41
|
private darkPaletteVars?;
|
|
29
42
|
private lightPaletteVars?;
|
|
30
43
|
private themePaletteSheet?;
|
|
31
|
-
private generatedPalettes?;
|
|
32
44
|
private workspaceStorage?;
|
|
33
|
-
private
|
|
45
|
+
private storageFactory?;
|
|
34
46
|
private isLegacySinglePaletteTheme;
|
|
35
47
|
constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>);
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* Set a factory to recreate the storage proxy if it was destroyed (e.g. when a new browser
|
|
42
|
-
* window is opened after the last one closed with preventQuitOnLastWindowClosed true).
|
|
43
|
-
* Called once at platform init; avoids createWindow needing URL/env dependencies.
|
|
49
|
+
* Sets the storage factory. This can only be done once, and will throw for subsequent calls.
|
|
50
|
+
*
|
|
51
|
+
* All storage writes will be pending until the factory is created.
|
|
52
|
+
* @param factory
|
|
44
53
|
*/
|
|
45
|
-
|
|
54
|
+
setStorageFactory: (factory: () => StorageProxy) => void;
|
|
46
55
|
/**
|
|
47
56
|
* Close the storage proxy window and clear the reference. Called when the last browser window
|
|
48
57
|
* closes so the platform can quit (storage proxy would otherwise keep the process alive).
|
|
49
|
-
* Clears the reference before awaiting destroy() to avoid a race with
|
|
58
|
+
* Clears the reference before awaiting destroy() to avoid a race with getOrCreateStorageProxy.
|
|
50
59
|
*/
|
|
51
60
|
destroyWorkspaceStorageProxy: () => Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Ensure the workspace storage proxy exists, recreating via the factory set at init if it was
|
|
54
|
-
* previously destroyed. No-op if no factory was set (e.g. in tests). Call before using
|
|
55
|
-
* workspace storage (e.g. when creating a browser window).
|
|
56
|
-
*/
|
|
57
|
-
ensureWorkspaceStorageProxy: () => Promise<void>;
|
|
58
61
|
/**
|
|
59
62
|
* Check if there's an explicit user preference stored in localStorage.
|
|
60
63
|
* A user preference is indicated by the presence of a SelectedColorScheme key. Which is something assigned if you click on the Appearance dropdown.
|
|
@@ -63,11 +66,15 @@ export declare class ThemeStorageController {
|
|
|
63
66
|
private hasUserPreference;
|
|
64
67
|
/**
|
|
65
68
|
* Synchronize the current palette and scheme with workspace's storage instance if
|
|
66
|
-
* storage based theming is enabled.
|
|
69
|
+
* storage based theming is enabled.
|
|
67
70
|
*
|
|
68
|
-
*
|
|
71
|
+
* Workspace storage is consumed by workspace apps still on the legacy theme system
|
|
72
|
+
* whose theme-loader does NOT set `data-scheme` on the document. To maintain
|
|
73
|
+
* backwards compatibility the sheet written here uses the legacy format: for an
|
|
74
|
+
* explicit light/dark scheme only that scheme's vars are placed inside `:root{}`,
|
|
75
|
+
* while "system" uses `@media (prefers-color-scheme)` queries with `:root`.
|
|
69
76
|
*/
|
|
70
|
-
|
|
77
|
+
synchronizeWorkspaceStorage: () => Promise<void>;
|
|
71
78
|
/**
|
|
72
79
|
* Set the current Palette to be used by workspace. This palette will be converted into
|
|
73
80
|
* css vars and combined into a single stylesheet. This stylesheet is exposed in localstorage
|
|
@@ -97,7 +104,6 @@ export declare class ThemeStorageController {
|
|
|
97
104
|
* @param scheme The default scheme specified in the palette
|
|
98
105
|
*/
|
|
99
106
|
setThemeDefaultScheme(scheme: ColorSchemeOptionType): void;
|
|
100
|
-
setGeneratedPalettes(generatedPalettes: GeneratedPalettes): void;
|
|
101
107
|
/**
|
|
102
108
|
* Write the theme palette sheet to both in-memory state and providerStorage (namespaced localStorage)
|
|
103
109
|
* immediately. This ensures the theme is available for themeLoader on same-origin pages
|
|
@@ -26,10 +26,15 @@ export declare const getActivePageIdForWindow: (identity: OpenFin.Identity) => P
|
|
|
26
26
|
*
|
|
27
27
|
* If the name is not unique, it will append a number to the end of the name.
|
|
28
28
|
*
|
|
29
|
+
* When `BrowserInitConfig.allowDuplicatePageTitles` is `true`, this function
|
|
30
|
+
* short-circuits and returns the supplied name (or the default title) as-is,
|
|
31
|
+
* without appending a numeric suffix.
|
|
32
|
+
*
|
|
29
33
|
* @param initialName The initial name to test
|
|
30
|
-
* @
|
|
34
|
+
* @param allowDuplicatePageTitles Whether duplicate page titles are permitted
|
|
35
|
+
* @returns string: a unique page name (or the input unchanged when duplicates are allowed)
|
|
31
36
|
*/
|
|
32
|
-
export declare function getUniquePageTitle(initialName?: string): Promise<string>;
|
|
37
|
+
export declare function getUniquePageTitle(initialName?: string, allowDuplicatePageTitles?: boolean): Promise<string>;
|
|
33
38
|
export declare function handleSaveModalOnPageClose({ page }: HandleSaveModalOnPageClosePayload): Promise<SaveModalOnPageCloseResult>;
|
|
34
39
|
/**
|
|
35
40
|
* Default implementation of shouldPageClose. If enableBeforeUnload isn't set to true, always returns True (proceed with close).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type {
|
|
3
|
-
import { ColorSchemeOptionType, ThemeApi } from '../../../client-api-platform/src/shapes';
|
|
2
|
+
import type { GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../../common/src/api/theming';
|
|
3
|
+
import { ColorSchemeOptionType, LegacyNotificationsThemeSet, ThemeApi } from '../../../client-api-platform/src/shapes';
|
|
4
4
|
export declare const getThemingApi: (identity: OpenFin.ApplicationIdentity) => ThemeApi;
|
|
5
5
|
export declare const dispatchThemeToWorkspaceProvider: (themeData: {
|
|
6
6
|
themePaletteSheet: string;
|
|
@@ -13,5 +13,9 @@ export declare const dispatchThemeToWorkspaceProvider: (themeData: {
|
|
|
13
13
|
export declare const setSelectedScheme: (schemeType: ColorSchemeOptionType) => Promise<void>;
|
|
14
14
|
export declare const getSelectedScheme: () => ColorSchemeOptionType | null | undefined;
|
|
15
15
|
export declare const getThemePaletteSheet: () => string | undefined;
|
|
16
|
-
export
|
|
17
|
-
|
|
16
|
+
export { assignIfDefined, mapGeneratedPalettesToLegacyPalettes, mapLegacyBrandIcons, mapLegacyThemeToCustomTheme } from '../../../common/src/api/theme-migration';
|
|
17
|
+
/**
|
|
18
|
+
* Builds a legacy NotificationsThemeSet from generated palettes and indicator colors.
|
|
19
|
+
* Used by the provider-side handler to serve old Notification Center versions (<=2.13).
|
|
20
|
+
*/
|
|
21
|
+
export declare const buildLegacyNotificationsTheme: (generatedPalettes: GeneratedPalettes, notificationIndicatorColors: NotificationIndicatorColorsParsed | null) => Promise<LegacyNotificationsThemeSet | null>;
|
|
@@ -2,11 +2,6 @@ export declare const listenForStoreClose: () => void;
|
|
|
2
2
|
export type StorageProxy = {
|
|
3
3
|
setItem: (data: string, value: string) => Promise<void>;
|
|
4
4
|
destroy: () => Promise<void>;
|
|
5
|
+
isDestroyed: boolean;
|
|
5
6
|
};
|
|
6
|
-
export declare const
|
|
7
|
-
/**
|
|
8
|
-
* Ensure the workspace storage proxy window exists. Recreates it if it was previously destroyed
|
|
9
|
-
* (e.g. when the last browser window closed with preventQuitOnLastWindowClosed true and a new
|
|
10
|
-
* browser window is now being created). Uses the factory registered at init; no-op in tests.
|
|
11
|
-
*/
|
|
12
|
-
export declare const ensureWorkspaceStorageProxy: () => Promise<void>;
|
|
7
|
+
export declare const getStorageFactory: (isEnterprise: boolean, baseUrl: string) => (() => StorageProxy);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OpenFin from '@openfin/core';
|
|
2
2
|
import { WorkspacePlatformInitConfig } from '../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare const MAX_FIRST_THEME_SYNC_WAIT = 3000;
|
|
3
4
|
/**
|
|
4
5
|
* Initilaize a Workspace Platform.
|
|
5
6
|
*
|
|
@@ -35,4 +36,4 @@ import { WorkspacePlatformInitConfig } from '../../../client-api-platform/src/sh
|
|
|
35
36
|
* ```
|
|
36
37
|
* @param options options for configuring the platform.
|
|
37
38
|
*/
|
|
38
|
-
export declare const init: (
|
|
39
|
+
export declare const init: (config: WorkspacePlatformInitConfig) => Promise<OpenFin.Platform>;
|
|
@@ -4,4 +4,4 @@ import { BrowserInitConfig } from '../../../../client-api-platform/src/shapes';
|
|
|
4
4
|
/**
|
|
5
5
|
* Applies default options to the creation of browser windows.
|
|
6
6
|
*/
|
|
7
|
-
export declare function applyBrowserDefaults(options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions' | 'defaultViewOptions' | 'browserIconSize'> | undefined, themeData?: PreloadedThemeData): Promise<OpenFin.PlatformWindowCreationOptions>;
|
|
7
|
+
export declare function applyBrowserDefaults(options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions' | 'defaultViewOptions' | 'browserIconSize' | 'allowDuplicatePageTitles'> | undefined, themeData?: PreloadedThemeData): Promise<OpenFin.PlatformWindowCreationOptions>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import OpenFin from '@openfin/core';
|
|
2
2
|
import type { AttachedPage, AttachedPageInternal } from '../../../../common/src/api/pages/shapes';
|
|
3
3
|
import { BrowserInitConfig } from '../..';
|
|
4
|
-
export declare const applyPageDefaults: (pages: AttachedPage[], initOptions?: Pick<BrowserInitConfig, "defaultPageOptions" | "defaultViewOptions" | "defaultWindowOptions">, overrideOptions?: OpenFin.PlatformWindowCreationOptions) => Promise<AttachedPageInternal[]>;
|
|
4
|
+
export declare const applyPageDefaults: (pages: AttachedPage[], initOptions?: Pick<BrowserInitConfig, "defaultPageOptions" | "defaultViewOptions" | "defaultWindowOptions" | "allowDuplicatePageTitles">, overrideOptions?: OpenFin.PlatformWindowCreationOptions) => Promise<AttachedPageInternal[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,5 +4,12 @@ export declare function convertPanelViewOpts(panels: PanelConfig[], updatePageRe
|
|
|
4
4
|
identity: OpenFin.Identity;
|
|
5
5
|
pageId: string;
|
|
6
6
|
}): Promise<ExtendedPanelConfig[]>;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates panel views for all pages in parallel. Returns a promise that callers
|
|
9
|
+
* may optionally await. In the initial window creation path the return value is
|
|
10
|
+
* intentionally ignored (fire-and-forget) so panel creation doesn't block
|
|
11
|
+
* `super.createWindow`. In the `attachPagesToWindow` path the promise is awaited
|
|
12
|
+
* so views exist before the browser dispatches `attachPanelViews`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createPanelViewsForPages(pages: AttachedPage[]): Promise<PromiseSettledResult<unknown>[]> | undefined;
|
|
8
15
|
export declare function createPanelViews(panels: PanelConfig[]): Promise<(void | OpenFin.View)[]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../../common/src/api/theming';
|
|
2
|
-
import { CustomThemes } from '../shapes';
|
|
2
|
+
import { CustomThemes, LegacyNotificationsThemeSet } from '../shapes';
|
|
3
3
|
export declare const getThemes: () => CustomThemes | null;
|
|
4
4
|
export declare const getGeneratedPalettes: () => GeneratedPalettes;
|
|
5
5
|
export declare const getThemePaletteSheet: () => string;
|
|
6
6
|
export declare const getNotificationIndicatorColorsInternal: () => NotificationIndicatorColorsParsed;
|
|
7
|
+
export declare const getLegacyNotificationsThemeInternal: () => Promise<LegacyNotificationsThemeSet | null>;
|
|
7
8
|
export declare const isThemePreInitialised: () => boolean;
|
|
8
9
|
/**
|
|
9
10
|
* initTheming()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import type { IconProps, IconType, Languages } from '@openfin/ui-library';
|
|
3
|
+
import type { WorkspaceIndicatorConfig } from '../../common/src/utils/indicators/workspace-indicators';
|
|
3
4
|
import type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
4
5
|
import type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
5
6
|
import type { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageLayoutsWithSelectedViews, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
|
|
@@ -11,7 +12,7 @@ export * from '../../dock3/src/shapes';
|
|
|
11
12
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
12
13
|
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
13
14
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
14
|
-
export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig, CopyPagePayload, HandleSaveModalOnPageClosePayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
|
|
15
|
+
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';
|
|
15
16
|
export { PanelPosition } from '../../common/src/api/pages/shapes';
|
|
16
17
|
export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
|
|
17
18
|
export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
@@ -155,6 +156,10 @@ export declare enum PageTabContextMenuOptionType {
|
|
|
155
156
|
Save = "Save",
|
|
156
157
|
SaveAs = "Save As",
|
|
157
158
|
NewPage = "New Page",
|
|
159
|
+
/** Workspace Browser: pin a normal tab (sets `pinned: 'user'`). */
|
|
160
|
+
Pin = "Pin",
|
|
161
|
+
/** Workspace Browser: unpin a user-pinned tab (clears `pinned`). */
|
|
162
|
+
Unpin = "Unpin",// Enterprise
|
|
158
163
|
DeletePage = "Delete Page",// Enterprise
|
|
159
164
|
SaveWorkspaceAs = "SaveWorkspaceAs",// Enterprise
|
|
160
165
|
Refresh = "Refresh",// Enterprise
|
|
@@ -796,6 +801,13 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
796
801
|
* When true, disables the ability to close pages in the window. False by default.
|
|
797
802
|
*/
|
|
798
803
|
preventPageClose?: boolean;
|
|
804
|
+
/**
|
|
805
|
+
* When true, disables the find in page feature for the window.
|
|
806
|
+
* The find in page view will not be created and no find in page logic will run.
|
|
807
|
+
* This option must be set at window creation time and cannot be changed dynamically.
|
|
808
|
+
* False by default.
|
|
809
|
+
*/
|
|
810
|
+
disableFindInPage?: boolean;
|
|
799
811
|
/**
|
|
800
812
|
* Taskbar Icon for the Browser Window. If light and dark icon are defined, then the taskbar icon will change when the scheme changes.
|
|
801
813
|
*/
|
|
@@ -2456,6 +2468,32 @@ export interface BrowserInitConfig {
|
|
|
2456
2468
|
* https://developer.openfin.co/docs/javascript/stable/classes/OpenFin.InteropBroker.html
|
|
2457
2469
|
*/
|
|
2458
2470
|
interopOverride?: OpenFin.OverrideCallback<OpenFin.InteropBroker, OpenFin.InteropBroker>;
|
|
2471
|
+
/**
|
|
2472
|
+
* When true, allows multiple pages to share the same title across browser
|
|
2473
|
+
* windows. No numeric suffixes are appended and attach/add operations
|
|
2474
|
+
* will not reject on title collision. `pageId` remains the unique
|
|
2475
|
+
* identifier for all page operations.
|
|
2476
|
+
*
|
|
2477
|
+
* Defaults to `false` (current unique-title behavior preserved).
|
|
2478
|
+
*/
|
|
2479
|
+
allowDuplicatePageTitles?: boolean;
|
|
2480
|
+
/**
|
|
2481
|
+
* Opt-in suppression flags for workspace success indicators.
|
|
2482
|
+
* Both flags default to `false`; existing platforms see no behaviour change.
|
|
2483
|
+
*
|
|
2484
|
+
* @example
|
|
2485
|
+
* ```ts
|
|
2486
|
+
* await WorkspacePlatform.init({
|
|
2487
|
+
* browser: {
|
|
2488
|
+
* indicators: {
|
|
2489
|
+
* suppressWorkspaceSwitched: true,
|
|
2490
|
+
* suppressWorkspaceSaved: true,
|
|
2491
|
+
* },
|
|
2492
|
+
* },
|
|
2493
|
+
* });
|
|
2494
|
+
* ```
|
|
2495
|
+
*/
|
|
2496
|
+
indicators?: WorkspaceIndicatorConfig;
|
|
2459
2497
|
}
|
|
2460
2498
|
interface WorkspaceMetadata {
|
|
2461
2499
|
APIVersion: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OpenFin } from '@openfin/core';
|
|
2
2
|
import { ExtendedPanelConfig, PageLayout, PanelConfig } from '../../../../client-api-platform/src/index';
|
|
3
|
+
import type { PagePinnedState } from '../../../../common/src/api/pages/shapes';
|
|
3
4
|
export interface Page {
|
|
4
5
|
/** A UI friendly title for the page. */
|
|
5
6
|
title: string;
|
|
@@ -21,6 +22,9 @@ export interface Page {
|
|
|
21
22
|
layout: PageLayout;
|
|
22
23
|
/** True if the page is locked. */
|
|
23
24
|
isLocked?: boolean;
|
|
25
|
+
/** Not used by enterprise — page pinning is a workspace-only feature. Declared here because
|
|
26
|
+
* shared code (page-tab-context-menu.ts) casts to AttachedPageInternal and accesses this field. */
|
|
27
|
+
pinned?: PagePinnedState;
|
|
24
28
|
/** Used to manipulate behaviour of a close button on a page tab. If `undefined`, then close button is visible and actionable.
|
|
25
29
|
* If either property true, this page tab's context menu will disable its 'Close Page' option.
|
|
26
30
|
*/
|
|
@@ -12,6 +12,8 @@ export interface PageLayoutDetails {
|
|
|
12
12
|
export type PageLayout = OpenFin.LayoutOptions & {
|
|
13
13
|
layoutDetails?: PageLayoutDetails;
|
|
14
14
|
};
|
|
15
|
+
/** The pinned state of a page tab. `'platform'` = developer-locked; `'user'` = end-user pinned. */
|
|
16
|
+
export type PagePinnedState = 'platform' | 'user';
|
|
15
17
|
/**
|
|
16
18
|
* Provides configuration options for a set of Workspace Views. An array of Page objects is a required option of the {@link workspacePlatform}
|
|
17
19
|
* property of the {@link BrowserCreateWindowRequest} interface.
|
|
@@ -62,6 +64,8 @@ export interface Page {
|
|
|
62
64
|
layout: PageLayout;
|
|
63
65
|
/** True if the page is locked. */
|
|
64
66
|
isLocked?: boolean;
|
|
67
|
+
/** Pinned state: `'platform'` (developer-locked), `'user'` (end-user pinned), or omitted (normal). */
|
|
68
|
+
pinned?: PagePinnedState;
|
|
65
69
|
/** Used to manipulate behaviour of a close button on a page tab. If `undefined`, then close button is visible and actionable.
|
|
66
70
|
* If either property true, this page tab's context menu will disable its 'Close Page' option.
|
|
67
71
|
*/
|
|
@@ -124,17 +128,21 @@ export interface ReorderPagesForWindowPayload {
|
|
|
124
128
|
/** The ordered ids of the attached pages. */
|
|
125
129
|
pageIds: string[];
|
|
126
130
|
}
|
|
131
|
+
/** Page fields for update payloads. `null` signals "clear this field" over IPC (null survives JSON serialization, undefined does not). */
|
|
132
|
+
type PageUpdateNullableOverrides = {
|
|
133
|
+
pinned?: PagePinnedState | null;
|
|
134
|
+
};
|
|
127
135
|
export interface UpdatePageForWindowPayload {
|
|
128
136
|
/** The OF window identity the pages to change the order of. */
|
|
129
137
|
identity: OpenFin.Identity;
|
|
130
138
|
/** The id of the attached page to update. */
|
|
131
139
|
pageId: string;
|
|
132
140
|
/** The partial updated state of the page. */
|
|
133
|
-
page: Partial<PageWithUpdatableRuntimeAttribs
|
|
141
|
+
page: Omit<Partial<PageWithUpdatableRuntimeAttribs>, 'pinned'> & PageUpdateNullableOverrides;
|
|
134
142
|
}
|
|
135
143
|
export interface ExtendedUpdatePageForWindowPayload extends UpdatePageForWindowPayload {
|
|
136
144
|
/** The partial updated state of the page. */
|
|
137
|
-
page: Partial<AttachedPage
|
|
145
|
+
page: Omit<Partial<AttachedPage>, 'pinned'> & PageUpdateNullableOverrides;
|
|
138
146
|
}
|
|
139
147
|
export interface AttachPagesToWindowPayload {
|
|
140
148
|
/** The OF window identity to attach the pages to. */
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BaseThemeOptions, CustomPaletteSet, CustomTheme, CustomThemes, GeneratedPalettes, GenerateThemeParams } from './theming';
|
|
2
|
+
export declare const assignIfDefined: (target: Record<string, unknown>, key: string, value: unknown) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Maps a legacy palette-based theme to theme-engine seed + overrides.
|
|
5
|
+
*
|
|
6
|
+
* Legacy themes use `palette` (single scheme) or `palettes` (light/dark) with
|
|
7
|
+
* explicit color values. This function translates those values into the dotted
|
|
8
|
+
* token paths that `generateTheme` expects.
|
|
9
|
+
*
|
|
10
|
+
* Mapping reference: https://www.figma.com/design/bUbUpAHJl8xGEtFbpYZ5z3/Theme?node-id=0-1&p=f&m=dev
|
|
11
|
+
*/
|
|
12
|
+
export declare const mapLegacyThemeToCustomTheme: (legacyTheme: CustomTheme) => GenerateThemeParams;
|
|
13
|
+
/**
|
|
14
|
+
* Reverse of mapLegacyThemeToCustomTheme.
|
|
15
|
+
* Takes the resolved token maps from a generated theme and maps them back to the
|
|
16
|
+
* legacy CustomPaletteSet shape so that workspace apps still on the legacy theme
|
|
17
|
+
* system can consume them.
|
|
18
|
+
*/
|
|
19
|
+
export declare const mapGeneratedPalettesToLegacyPalettes: (generatedPalettes: GeneratedPalettes) => {
|
|
20
|
+
light: CustomPaletteSet;
|
|
21
|
+
dark: CustomPaletteSet;
|
|
22
|
+
};
|
|
23
|
+
export declare const mapLegacyBrandIcons: (legacyBrand: BaseThemeOptions["brand"]) => GenerateThemeParams[1];
|
|
24
|
+
/**
|
|
25
|
+
* Converts legacy CustomThemes (from old workspace platforms v23.0.22 and earlier)
|
|
26
|
+
* into GeneratedPalettes with toCSS() methods and a ready-to-inject palette sheet.
|
|
27
|
+
*
|
|
28
|
+
* This is the backward-compatibility bridge: when a new workspace app (home, dock,
|
|
29
|
+
* storefront) discovers it's running against a legacy platform — detected by
|
|
30
|
+
* `getGeneratedPalettes()` throwing because the channel action doesn't exist —
|
|
31
|
+
* it calls `getThemes()` to retrieve the old-format themes and runs them through
|
|
32
|
+
* this function to produce the same output the new pipeline expects.
|
|
33
|
+
*
|
|
34
|
+
* The conversion mirrors `initialiseStoragePalettes` in client-api-platform but
|
|
35
|
+
* omits storage controller side-effects (setPalettes, setThemePaletteSheet) since
|
|
36
|
+
* those belong to the platform init path, not the workspace app consumption path.
|
|
37
|
+
*
|
|
38
|
+
* Theme shape discrimination:
|
|
39
|
+
* - `palette`: single palette applied to both schemes (legacy single-scheme theme)
|
|
40
|
+
* - `palettes`: explicit light/dark palettes (legacy dual-scheme theme)
|
|
41
|
+
* - `seed`: already a token-based theme (should not reach this path, but handled for safety)
|
|
42
|
+
*/
|
|
43
|
+
export declare const convertLegacyThemesToGeneratedPalettes: (themes: CustomThemes | null | undefined) => {
|
|
44
|
+
generatedPalettes: GeneratedPalettes;
|
|
45
|
+
themePaletteSheet: string;
|
|
46
|
+
};
|
|
@@ -291,9 +291,23 @@ export declare const OpenFinDarkTheme: {
|
|
|
291
291
|
};
|
|
292
292
|
export declare const DefaultOpenFinTheme: CustomThemes;
|
|
293
293
|
export declare const parseNotificationIndicatorColors: (customTheme: CustomTheme) => NotificationIndicatorColorsParsed;
|
|
294
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Builds a CSS stylesheet that exposes theme tokens as custom properties.
|
|
296
|
+
*
|
|
297
|
+
* The sheet is written to provider storage and consumed by same-origin pages
|
|
298
|
+
* via an adopted stylesheet. It uses `data-scheme` selectors for dark/system
|
|
299
|
+
* switching, which the new theme-loader sets on the document element.
|
|
300
|
+
*
|
|
301
|
+
* @param legacyVars Optional `--workspace-palette-*` CSS variable strings to
|
|
302
|
+
* merge alongside the new `--color-role-*` variables. When provided, apps on
|
|
303
|
+
* the legacy theme system that read these variables will receive correct values.
|
|
304
|
+
*/
|
|
305
|
+
export declare const constructThemePaletteSheet: (themes: GeneratedPalettes, legacyVars?: {
|
|
306
|
+
light: string;
|
|
307
|
+
dark: string;
|
|
308
|
+
}) => string;
|
|
295
309
|
export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<{
|
|
296
|
-
theme:
|
|
310
|
+
theme: GeneratedPalettes | CustomThemes;
|
|
297
311
|
defaultScheme: ColorSchemeOptionType;
|
|
298
312
|
themePaletteSheet: string;
|
|
299
313
|
}>;
|
|
@@ -50,6 +50,13 @@ export declare function showSuccess(payload: ShowSuccessPayload): Promise<void>;
|
|
|
50
50
|
*/
|
|
51
51
|
export declare function showInfo(payload: ShowInfoPayload): Promise<void>;
|
|
52
52
|
/**
|
|
53
|
-
* Creates a window centered on monitor containing a success indicator for switching workspaces
|
|
53
|
+
* Creates a window centered on monitor containing a success indicator for switching workspaces.
|
|
54
|
+
* No-ops when `suppressWorkspaceSwitched` has been set via `BrowserInitConfig.indicators`.
|
|
54
55
|
*/
|
|
55
56
|
export declare function showSwitchWorkspaceSuccess(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a success indicator for workspace save and save-as operations.
|
|
59
|
+
* No-ops when `suppressWorkspaceSaved` has been set via `BrowserInitConfig.indicators`.
|
|
60
|
+
* Rename operations are intentionally unaffected — use `showSuccess` directly for those.
|
|
61
|
+
*/
|
|
62
|
+
export declare const showWorkspaceSavedSuccess: (payload: ShowSuccessPayload) => Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for suppressing workspace success indicators.
|
|
3
|
+
*/
|
|
4
|
+
export interface WorkspaceIndicatorConfig {
|
|
5
|
+
/** Suppress the "Workspace Switched" indicator on all applyWorkspace calls. @default false */
|
|
6
|
+
suppressWorkspaceSwitched?: boolean;
|
|
7
|
+
/** Suppress the "Workspace Saved" indicator on regular workspace save only. Save-as and rename are unaffected. @default false */
|
|
8
|
+
suppressWorkspaceSaved?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const initWorkspaceIndicators: (config?: WorkspaceIndicatorConfig) => void;
|
|
11
|
+
export declare const getSuppressWorkspaceSwitched: () => boolean;
|
|
12
|
+
/** Returns true when the "Workspace Saved" indicator should be suppressed (save only; save-as and rename are unaffected). */
|
|
13
|
+
export declare const getSuppressWorkspaceSaved: () => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
+
import type { PagePinnedState } from '../../../common/src/api/pages/shapes';
|
|
2
3
|
import { WindowIdentity } from '../../../common/src/utils/window';
|
|
3
4
|
import { AttachedPage, PageLayout } from '../../../client-api-platform/src/shapes';
|
|
4
5
|
export type LayoutDOMEventType =
|
|
@@ -91,12 +92,6 @@ export declare const generateViewNameAndIdentifierNameIfNotExists: <T extends {
|
|
|
91
92
|
*/
|
|
92
93
|
export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<OpenFin.ViewOptions>) => Promise<PageLayout>;
|
|
93
94
|
export declare const cloneViewComponentWithoutName: (componentState: any) => any;
|
|
94
|
-
/**
|
|
95
|
-
* Deep clones a layout and removes view names.
|
|
96
|
-
* @param layout The Layout to be cloned
|
|
97
|
-
* @returns A copy of the layout with names removed
|
|
98
|
-
*/
|
|
99
|
-
export declare const cloneLayoutAndRemoveNames: (layout: PageLayout) => any;
|
|
100
95
|
/**
|
|
101
96
|
* Deep clones a layout and removes generated view names.
|
|
102
97
|
* @param layout The Layout to be cloned
|
|
@@ -121,6 +116,14 @@ export declare const cleanupLayoutObservers: (layoutName: string) => void;
|
|
|
121
116
|
* Initialize the layout for the current OF window.
|
|
122
117
|
*/
|
|
123
118
|
export declare const initLayoutListeners: () => Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Returns true when a page's in-page layout should be locked.
|
|
121
|
+
* This applies for user-locked pages (`isLocked`) and platform-pinned pages (`pinned === 'platform'`).
|
|
122
|
+
*/
|
|
123
|
+
export declare const isPageLayoutLocked: (page: {
|
|
124
|
+
isLocked?: boolean;
|
|
125
|
+
pinned?: PagePinnedState;
|
|
126
|
+
}) => boolean;
|
|
124
127
|
/**
|
|
125
128
|
* Deep clones a layout and changes its settings to make it "locked".
|
|
126
129
|
* @param layout The Layout to be locked
|
|
@@ -113,12 +113,31 @@ export type RenameSupertabChannelMessage = BasePopupMenuChannelMessage & {
|
|
|
113
113
|
pageId: string;
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* A row in the tab search list. {@link showPin} / {@link showUnpin} are optional; when omitted, no row action.
|
|
118
|
+
*/
|
|
119
|
+
export type TabSearchListItem = {
|
|
120
|
+
id: string;
|
|
121
|
+
title: string;
|
|
122
|
+
/** When true, show a control to pin (move to the user page group). Core UI + ungrouped only. */
|
|
123
|
+
showPin?: boolean;
|
|
124
|
+
/** When true, show a control to unpin (leave the user page group). */
|
|
125
|
+
showUnpin?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* When true, show a non-interactive lock (workspace / platform locked); ungrouped pages only.
|
|
128
|
+
* Mutually exclusive with {@link showPin} in the browser; does not replace {@link showUnpin}.
|
|
129
|
+
*/
|
|
130
|
+
showPlatformLocked?: boolean;
|
|
131
|
+
};
|
|
116
132
|
export type TabSearchModalContent = {
|
|
117
133
|
variant: 'page' | 'view';
|
|
118
|
-
tabs:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
tabs: TabSearchListItem[];
|
|
135
|
+
};
|
|
136
|
+
/** Channel action: browser → tab-search popup; refreshes list rows after pin/unpin while open. */
|
|
137
|
+
export declare const TAB_SEARCH_CHANNEL_ACTION_UPDATE_TABS: "update-tabs";
|
|
138
|
+
export type TabSearchUpdateTabsMessage = {
|
|
139
|
+
requestId: string;
|
|
140
|
+
tabs: TabSearchListItem[];
|
|
122
141
|
};
|
|
123
142
|
export type TabSearchChannelMessage = BasePopupMenuChannelMessage & {
|
|
124
143
|
type: PopupWindowMenuType.TabSearch;
|
package/externals.report.json
CHANGED
|
@@ -21,28 +21,28 @@
|
|
|
21
21
|
"issuer": "common/src/utils/color-linking.ts"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"
|
|
24
|
+
"lodash.clonedeep": [
|
|
25
25
|
{
|
|
26
26
|
"type": "explicit",
|
|
27
|
-
"version": "
|
|
27
|
+
"version": "4.5.0",
|
|
28
28
|
"packageName": "common/package.json",
|
|
29
|
-
"issuer": "common/src/
|
|
29
|
+
"issuer": "common/src/utils/layout.ts"
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
|
-
"i18next": [
|
|
32
|
+
"react-i18next": [
|
|
33
33
|
{
|
|
34
34
|
"type": "explicit",
|
|
35
|
-
"version": "
|
|
35
|
+
"version": "15.4.0",
|
|
36
36
|
"packageName": "common/package.json",
|
|
37
37
|
"issuer": "common/src/api/i18next.ts"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
|
-
"
|
|
40
|
+
"i18next": [
|
|
41
41
|
{
|
|
42
42
|
"type": "explicit",
|
|
43
|
-
"version": "
|
|
43
|
+
"version": "^23.7.16",
|
|
44
44
|
"packageName": "common/package.json",
|
|
45
|
-
"issuer": "common/src/
|
|
45
|
+
"issuer": "common/src/api/i18next.ts"
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
"dexie": [
|