@openfin/workspace 45.2.1 → 45.2.3
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/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/init/override-callback/view-options.d.ts +11 -0
- package/client-api-platform/src/shapes.d.ts +45 -5
- package/common/src/api/protocol/browser.d.ts +2 -1
- 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/local-storage-key.d.ts +1 -0
- package/common/src/utils/view-options.d.ts +20 -0
- package/common/src/utils/view-tab-appearance.d.ts +51 -0
- package/externals.report.json +15 -15
- 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/package.json +3 -3
- package/store.js +1 -1
- package/store.js.map +1 -1
|
@@ -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.
|
|
10
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.View | OpenFin.Identity | OpenFin.Platform | OpenFin.Application>;
|
|
11
11
|
export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
|
|
12
12
|
export declare function getResults(payload: {
|
|
13
13
|
req: SearchSitesRequest;
|
|
@@ -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;
|
|
@@ -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';
|
|
@@ -304,7 +306,7 @@ export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate<ViewTabMenuDat
|
|
|
304
306
|
/**
|
|
305
307
|
* UI elements within a view tab that can be navigated to via keyboard.
|
|
306
308
|
*/
|
|
307
|
-
export type ViewTabElements = 'inactive-tab' | 'active-tab' | 'inactive-tab-close-button' | 'active-tab-close-button' | 'add-tab-button';
|
|
309
|
+
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';
|
|
308
310
|
/**
|
|
309
311
|
* Configuration options for view tab keyboard navigation behavior.
|
|
310
312
|
*/
|
|
@@ -314,7 +316,7 @@ export interface ViewTabOptions {
|
|
|
314
316
|
* arrow keys when an element in the view is selected.
|
|
315
317
|
* The order of the items in the array have no impact.
|
|
316
318
|
* Note: these are not mutually exclusive and can overlap.
|
|
317
|
-
* Default (when undefined): ["inactive-tab","active-tab","active-tab-close-button","inactive-tab-close-button","add-tab-button"]
|
|
319
|
+
* 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"]
|
|
318
320
|
*/
|
|
319
321
|
arrowNavigation?: ViewTabElements[];
|
|
320
322
|
/**
|
|
@@ -441,6 +443,19 @@ export interface ViewTabCustomActionPayload {
|
|
|
441
443
|
windowIdentity: OpenFin.Identity;
|
|
442
444
|
selectedViews: OpenFin.Identity[];
|
|
443
445
|
}
|
|
446
|
+
export interface ViewTabControlActionPayload {
|
|
447
|
+
callerType: CustomActionCallerType.ViewTabControl;
|
|
448
|
+
/** Identity of the Browser window containing the view tab. */
|
|
449
|
+
windowIdentity: OpenFin.Identity;
|
|
450
|
+
/** Identity of the view represented by the tab. */
|
|
451
|
+
viewIdentity: OpenFin.Identity;
|
|
452
|
+
/** Any data necessary for the functioning of the specified custom action. */
|
|
453
|
+
customData?: any;
|
|
454
|
+
/** Client x-coordinate where the control was invoked. */
|
|
455
|
+
x: number;
|
|
456
|
+
/** Client y-coordinate where the control was invoked. */
|
|
457
|
+
y: number;
|
|
458
|
+
}
|
|
444
459
|
/**
|
|
445
460
|
* Payload received by the openViewTabContextMenu provider override.
|
|
446
461
|
*/
|
|
@@ -688,12 +703,16 @@ export declare enum WindowType {
|
|
|
688
703
|
Browser = "browser",
|
|
689
704
|
Platform = "platform"
|
|
690
705
|
}
|
|
706
|
+
/** How view tab widths are calculated. `'uniform'` is today's equal-width behavior. */
|
|
707
|
+
export type ViewTabWidthMode = 'uniform' | 'content';
|
|
691
708
|
export interface BrowserWorkspacePlatformViewOptions {
|
|
692
709
|
browserNavigationButtons?: RequireAtLeastOne<{
|
|
693
710
|
back?: boolean;
|
|
694
711
|
forward?: boolean;
|
|
695
712
|
reload?: boolean;
|
|
696
713
|
}>;
|
|
714
|
+
/** Per-view tab appearance options. */
|
|
715
|
+
viewTab?: ViewTabAppearanceOptions;
|
|
697
716
|
}
|
|
698
717
|
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
699
718
|
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
@@ -771,16 +790,36 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
771
790
|
minWidth?: string;
|
|
772
791
|
maxWidth?: string;
|
|
773
792
|
};
|
|
774
|
-
/**
|
|
793
|
+
/**
|
|
794
|
+
* Specifies the min and max sizes for view tabs in a layout, and how those widths are calculated.
|
|
775
795
|
* View tabs will expand to take all available space up to the specified maximum size.
|
|
776
796
|
* Similarly, they will collapse down to the specified minimum size.
|
|
777
797
|
* When there is not enough room to fit the tabs, the tabstrip will become scrollable.
|
|
778
798
|
* Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%").
|
|
779
|
-
*
|
|
799
|
+
* Defaults depend on the width mode: `'uniform'` uses "120px" for both bounds, while `'content'` sizes a
|
|
800
|
+
* tab to its own chrome and so applies no minimum and a "200px" maximum.
|
|
801
|
+
* To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* ```ts
|
|
805
|
+
* workspacePlatform: {
|
|
806
|
+
* viewTabDimensions: {
|
|
807
|
+
* widthMode: 'content',
|
|
808
|
+
* minWidth: '50px',
|
|
809
|
+
* maxWidth: '200px'
|
|
810
|
+
* }
|
|
811
|
+
* }
|
|
812
|
+
* ```
|
|
780
813
|
*/
|
|
781
814
|
viewTabDimensions?: {
|
|
782
815
|
minWidth?: string;
|
|
783
816
|
maxWidth?: string;
|
|
817
|
+
/**
|
|
818
|
+
* Controls how view tab widths are calculated.
|
|
819
|
+
* - `'uniform'` (default): current equal-width tab behavior.
|
|
820
|
+
* - `'content'`: tab width is driven by tab chrome (label, favicon, spinner, controls) within min/max bounds.
|
|
821
|
+
*/
|
|
822
|
+
widthMode?: ViewTabWidthMode;
|
|
784
823
|
};
|
|
785
824
|
/**
|
|
786
825
|
* Controls whether tab-search chevron buttons are shown for page tabs and view tabs.
|
|
@@ -2572,6 +2611,7 @@ export declare enum CustomActionCallerType {
|
|
|
2572
2611
|
StoreCustomButton = "StoreCustomButton",
|
|
2573
2612
|
CustomDropdownItem = "CustomDropdownItem",
|
|
2574
2613
|
GlobalContextMenu = "GlobalContextMenu",
|
|
2614
|
+
ViewTabControl = "ViewTabControl",
|
|
2575
2615
|
ViewTabContextMenu = "ViewTabContextMenu",
|
|
2576
2616
|
PageTabContextMenu = "PageTabContextMenu",
|
|
2577
2617
|
SaveButtonContextMenu = "SaveButtonContextMenu",
|
|
@@ -2582,7 +2622,7 @@ export declare enum CustomActionCallerType {
|
|
|
2582
2622
|
* When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
|
|
2583
2623
|
export type CustomActionPayload = {
|
|
2584
2624
|
callerType: CustomActionCallerType.API;
|
|
2585
|
-
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
2625
|
+
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabControlActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
2586
2626
|
/**
|
|
2587
2627
|
* Payload received by invokeCustomActionInternal platform provider method
|
|
2588
2628
|
* @internal
|
|
@@ -61,7 +61,8 @@ 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"
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* @internal
|
|
@@ -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
|
+
};
|
|
@@ -7,6 +7,7 @@ declare enum LocalStorageKey {
|
|
|
7
7
|
DockPosition = "DockPosition",
|
|
8
8
|
SelectedColorScheme = "SelectedColorScheme",
|
|
9
9
|
SelectedLanguage = "SelectedLanguage",
|
|
10
|
+
DefaultLanguage = "DefaultLanguage",
|
|
10
11
|
ThemePaletteSheet = "ThemePaletteSheet",
|
|
11
12
|
HasMovedStore = "HasMovedStore",
|
|
12
13
|
PageDragState = "BrowserPageDragState",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
export type ViewOptionsConsumer = 'appearance' | 'controls' | 'shared';
|
|
3
|
+
/**
|
|
4
|
+
* Reads view options for the custom view-tab feature, optionally instrumented in debug builds.
|
|
5
|
+
*
|
|
6
|
+
* Collection is active only when the build-time `LOG_DEBUG` constant is true — set via
|
|
7
|
+
* `OF__WORKSPACE_LOG_DEBUG=true` at build time (including PR preview builds where that env is enabled).
|
|
8
|
+
* Tests may also enable collection with `globalThis.LOG_DEBUG = true` when the build constant is undefined.
|
|
9
|
+
* Production builds call `view.getOptions()` directly with no marks or logs.
|
|
10
|
+
*
|
|
11
|
+
* Baseline comparison before de-duplication should primarily use IPC / measure count: expect two `getOptions`
|
|
12
|
+
* calls and two Performance Timeline entries per view (appearance + controls). The de-duplicated path emits one
|
|
13
|
+
* entry with the `shared` consumer. Per-call baseline durations are secondary because two reads can overlap.
|
|
14
|
+
*
|
|
15
|
+
* Inspect entries in DevTools by filtering measures named `of-workspace-view-tab-get-options-*`. The Performance
|
|
16
|
+
* Timeline duration is authoritative; structured logs are the human-readable companion.
|
|
17
|
+
*
|
|
18
|
+
* Each debug invocation calls `view.getOptions()` exactly once — no caching or de-duplication on this branch.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getViewOptions: (view: OpenFin.View, consumer: ViewOptionsConsumer) => Promise<OpenFin.ViewOptions>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import type { ViewTabAppearanceOptions, ViewTabColorRole } from '../../../common/src/api/shapes/view-tab';
|
|
3
|
+
export declare const VIEW_TAB_STATES: readonly ["default", "hover", "active", "focus"];
|
|
4
|
+
export type ViewTabState = (typeof VIEW_TAB_STATES)[number];
|
|
5
|
+
/** A color that was discarded during sanitization, for the caller to log. */
|
|
6
|
+
export interface RejectedViewTabColor {
|
|
7
|
+
role: ViewTabColorRole;
|
|
8
|
+
/** Absent when the whole role was malformed rather than one of its states. */
|
|
9
|
+
state?: ViewTabState;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Drops every state whose value is not a supported CSS color, returning what survived alongside what was
|
|
14
|
+
* discarded. Tab color is decoration, so a malformed value degrades that state to its theme default instead
|
|
15
|
+
* of failing the operation that carried it.
|
|
16
|
+
*
|
|
17
|
+
* Only the two color roles are validated. Every other `viewTab` option — `controls`, and whatever follows it
|
|
18
|
+
* — is carried through untouched, so a bad color cannot take an unrelated tab option down with it. Appearance
|
|
19
|
+
* is omitted only when nothing at all is left, which keeps a wholly-invalid object out of persistence.
|
|
20
|
+
*/
|
|
21
|
+
export declare const sanitizeViewTabAppearance: (viewTab: unknown) => {
|
|
22
|
+
appearance?: ViewTabAppearanceOptions;
|
|
23
|
+
rejected: RejectedViewTabColor[];
|
|
24
|
+
};
|
|
25
|
+
/** Formats a rejected color for a log line, e.g. `viewTab.fontColor.default "##EDE8D0"`. */
|
|
26
|
+
export declare const describeRejectedViewTabColor: ({ role, state, value }: RejectedViewTabColor) => string;
|
|
27
|
+
type ViewOptionsWithWorkspacePlatform = {
|
|
28
|
+
workspacePlatform?: {
|
|
29
|
+
viewTab?: ViewTabAppearanceOptions;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* True when this `view-options-changed` diff touched `workspacePlatform.viewTab`, so that unrelated view
|
|
34
|
+
* option changes do not repaint tabs.
|
|
35
|
+
*
|
|
36
|
+
* `oldVal` is checked as well as `newVal` because clearing `viewTab` drops it from `newVal` entirely —
|
|
37
|
+
* that case only shows up on the old side, and it still needs a repaint.
|
|
38
|
+
*/
|
|
39
|
+
export declare const hasViewTabDiff: (diff: unknown) => boolean;
|
|
40
|
+
export declare const getViewTabAppearanceFromViewOptions: (options: ViewOptionsWithWorkspacePlatform) => ViewTabAppearanceOptions | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Reads view tab appearance from the view. Core persists `workspacePlatform` on view options across create,
|
|
43
|
+
* `updateOptions`, snapshot, and `getOptions`, so `getOptions` is the single source of truth.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getViewTabAppearanceFromView: (view: OpenFin.View) => Promise<ViewTabAppearanceOptions | undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* Writes the per-state custom properties for a single tab element. Values are set inline so that sibling tabs
|
|
48
|
+
* in the same tab strip are unaffected.
|
|
49
|
+
*/
|
|
50
|
+
export declare const applyViewTabAppearance: (tab: HTMLElement, appearance?: ViewTabAppearanceOptions) => void;
|
|
51
|
+
export {};
|
package/externals.report.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"@openfin/notifications": [
|
|
3
3
|
{
|
|
4
4
|
"type": "explicit",
|
|
5
|
-
"version": "45.2.0-alpha-
|
|
5
|
+
"version": "45.2.0-alpha-5087",
|
|
6
6
|
"packageName": "client-api/package.json",
|
|
7
7
|
"issuer": "client-api/src/notifications.ts"
|
|
8
8
|
}
|
|
@@ -67,13 +67,15 @@
|
|
|
67
67
|
"issuer": "common/src/api/i18next.ts"
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
|
-
"
|
|
70
|
+
"lodash.clonedeep": [
|
|
71
71
|
{
|
|
72
|
-
"type": "
|
|
73
|
-
"version": "
|
|
74
|
-
"packageName": "
|
|
75
|
-
"issuer": "
|
|
76
|
-
}
|
|
72
|
+
"type": "explicit",
|
|
73
|
+
"version": "4.5.0",
|
|
74
|
+
"packageName": "common/package.json",
|
|
75
|
+
"issuer": "common/src/utils/layout.ts"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"dexie": [
|
|
77
79
|
{
|
|
78
80
|
"type": "explicit",
|
|
79
81
|
"version": "^4.0.11",
|
|
@@ -81,24 +83,22 @@
|
|
|
81
83
|
"issuer": "common/src/api/pages/idb.ts"
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
|
-
"type": "
|
|
86
|
+
"type": "root-implicit",
|
|
85
87
|
"version": "^4.0.11",
|
|
86
|
-
"packageName": "
|
|
87
|
-
"issuer": "
|
|
88
|
+
"packageName": "dock3/package.json",
|
|
89
|
+
"issuer": "dock3/src/api/idb.ts"
|
|
88
90
|
},
|
|
89
91
|
{
|
|
90
92
|
"type": "explicit",
|
|
91
93
|
"version": "^4.0.11",
|
|
92
94
|
"packageName": "client-api-platform/package.json",
|
|
93
95
|
"issuer": "client-api-platform/src/api/dock/idb.ts"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"lodash.clonedeep": [
|
|
96
|
+
},
|
|
97
97
|
{
|
|
98
98
|
"type": "explicit",
|
|
99
|
-
"version": "4.
|
|
99
|
+
"version": "^4.0.11",
|
|
100
100
|
"packageName": "common/package.json",
|
|
101
|
-
"issuer": "common/src/utils/
|
|
101
|
+
"issuer": "common/src/utils/create-and-migrate-ibd-store.ts"
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
}
|