@openfin/workspace-platform 45.2.0 → 45.2.2

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.
Files changed (26) hide show
  1. package/client-api-platform/src/api/app-directory.d.ts +1 -1
  2. package/client-api-platform/src/api/controllers/__tests__/language-storage-controller.test.d.ts +1 -0
  3. package/client-api-platform/src/api/controllers/__tests__/workspace-storage-proxy-store.test.d.ts +1 -0
  4. package/client-api-platform/src/api/controllers/language-storage-controller-store.d.ts +2 -0
  5. package/client-api-platform/src/api/controllers/language-storage-controller.d.ts +25 -0
  6. package/client-api-platform/src/api/controllers/theme-storage-controller.d.ts +3 -4
  7. package/client-api-platform/src/api/controllers/workspace-storage-proxy-store.d.ts +13 -0
  8. package/client-api-platform/src/api/language.d.ts +3 -1
  9. package/client-api-platform/src/init/override-callback/mock-snapshots.d.ts +83 -0
  10. package/client-api-platform/src/init/override-callback/view-options.d.ts +11 -0
  11. package/client-api-platform/src/init/override-callback/view-options.test.d.ts +1 -0
  12. package/client-api-platform/src/shapes.d.ts +54 -5
  13. package/common/src/api/i18next.d.ts +4 -1
  14. package/common/src/api/shapes/view-tab.d.ts +86 -0
  15. package/common/src/test/logger-mock.d.ts +10 -0
  16. package/common/src/utils/color-channels.d.ts +44 -41
  17. package/common/src/utils/enterpriseBrowser.d.ts +0 -1
  18. package/common/src/utils/local-storage-key.d.ts +1 -0
  19. package/common/src/utils/view-options.d.ts +20 -0
  20. package/common/src/utils/view-tab-appearance.d.ts +59 -0
  21. package/externals.report.json +13 -13
  22. package/index.js +1 -1
  23. package/index.js.map +1 -1
  24. package/package.json +2 -2
  25. package/workspace_platform.zip +0 -0
  26. package/common/src/utils/color-linking.d.ts +0 -4
@@ -7,7 +7,7 @@ import type { ContentSortRequest, LaunchAppRequest, SearchSitesRequest, SearchSi
7
7
  * @param app the app directory entry.
8
8
  * @param opts launch options.
9
9
  */
10
- export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.View | OpenFin.Platform | OpenFin.Application>;
10
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.View | OpenFin.Application | OpenFin.Platform>;
11
11
  export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
12
12
  export declare function getResults(payload: {
13
13
  req: SearchSitesRequest;
@@ -0,0 +1,2 @@
1
+ import { LanguageStorageController } from '../../../../client-api-platform/src/api/controllers/language-storage-controller';
2
+ export declare const getLanguageStorageController: () => LanguageStorageController;
@@ -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;
@@ -10,5 +10,7 @@ export declare function getLanguageResourcesInternal(): {
10
10
  * initLanguage()
11
11
  * @param language - optional - ISO language code. Built-in languages are always accepted.
12
12
  * Any language code defined in the external `translation-override.json` is also accepted.
13
+ * @param languagePacksApiUrl - optional i18next-http-backend loadPath. When set,
14
+ * HTTP language packs are used instead of the bundled locale JSON.
13
15
  */
14
- export default function initLanguage(language?: Locale): Promise<void>;
16
+ export default function initLanguage(language?: Locale, languagePacksApiUrl?: string): Promise<void>;
@@ -1,3 +1,86 @@
1
+ export declare const viewTabColors: {
2
+ backgroundColor: {
3
+ default: string;
4
+ hover: string;
5
+ active: string;
6
+ focus: string;
7
+ };
8
+ fontColor: {
9
+ default: string;
10
+ active: string;
11
+ };
12
+ };
13
+ /** `viewTab` stays on `workspacePlatform`; only its siblings move into `_internalWorkspaceData`. */
14
+ export declare const mockSnapshotWithViewTab: {
15
+ windows: {
16
+ layout: {
17
+ content: {
18
+ type: string;
19
+ content: {
20
+ type: string;
21
+ componentName: string;
22
+ componentState: {
23
+ _internalWorkspaceData: {
24
+ viewIdentifier: string;
25
+ };
26
+ workspacePlatform: {
27
+ browserNavigationButtons: {
28
+ reload: boolean;
29
+ };
30
+ viewTab: {
31
+ backgroundColor: {
32
+ default: string;
33
+ hover: string;
34
+ active: string;
35
+ focus: string;
36
+ };
37
+ fontColor: {
38
+ default: string;
39
+ active: string;
40
+ };
41
+ };
42
+ };
43
+ };
44
+ }[];
45
+ }[];
46
+ };
47
+ }[];
48
+ };
49
+ export declare const mockSnapshotWithViewTabMapped: {
50
+ windows: {
51
+ layout: {
52
+ content: {
53
+ type: string;
54
+ content: {
55
+ type: string;
56
+ componentName: string;
57
+ componentState: {
58
+ _internalWorkspaceData: {
59
+ viewIdentifier: string;
60
+ browserNavigationButtons: {
61
+ reload: boolean;
62
+ };
63
+ };
64
+ workspacePlatform: {
65
+ viewTab: {
66
+ backgroundColor: {
67
+ default: string;
68
+ hover: string;
69
+ active: string;
70
+ focus: string;
71
+ };
72
+ fontColor: {
73
+ default: string;
74
+ active: string;
75
+ };
76
+ };
77
+ };
78
+ };
79
+ }[];
80
+ }[];
81
+ };
82
+ }[];
83
+ };
1
84
  export declare const mockSnapshotWithInternalData1: {
2
85
  windows: {
3
86
  layout: {
@@ -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;
@@ -5,6 +5,7 @@ import type { AnalyticsEvent } from '../../common/src/utils/usage-register';
5
5
  import type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
6
6
  import type { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageLayoutsWithSelectedViews, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
7
7
  import type { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
8
+ import type { ViewTabAppearanceOptions } from '../../common/src/api/shapes/view-tab';
8
9
  import type { CustomThemes, GeneratedPalettes } from '../../common/src/api/theming';
9
10
  import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
10
11
  import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
@@ -15,6 +16,7 @@ export type { App, AppIntent, Image } from '../../client-api/src/shapes';
15
16
  export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
16
17
  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';
17
18
  export { PanelPosition } from '../../common/src/api/pages/shapes';
19
+ export type { ThemedIcon, ViewTabAppearanceOptions, ViewTabColorRole, ViewTabControl, ViewTabControlPosition, ViewTabStateColorOptions } from '../../common/src/api/shapes/view-tab';
18
20
  export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
19
21
  export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
20
22
  export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
@@ -232,7 +234,7 @@ export type ViewTabContextMenuTemplate = OpenFin.MenuItemTemplate<ViewTabMenuDat
232
234
  /**
233
235
  * UI elements within a view tab that can be navigated to via keyboard.
234
236
  */
235
- export type ViewTabElements = 'inactive-tab' | 'active-tab' | 'inactive-tab-close-button' | 'active-tab-close-button' | 'add-tab-button';
237
+ 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';
236
238
  /**
237
239
  * Configuration options for view tab keyboard navigation behavior.
238
240
  */
@@ -242,7 +244,7 @@ export interface ViewTabOptions {
242
244
  * arrow keys when an element in the view is selected.
243
245
  * The order of the items in the array have no impact.
244
246
  * Note: these are not mutually exclusive and can overlap.
245
- * Default (when undefined): ["inactive-tab","active-tab","active-tab-close-button","inactive-tab-close-button","add-tab-button"]
247
+ * 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"]
246
248
  */
247
249
  arrowNavigation?: ViewTabElements[];
248
250
  /**
@@ -369,6 +371,19 @@ export interface ViewTabCustomActionPayload {
369
371
  windowIdentity: OpenFin.Identity;
370
372
  selectedViews: OpenFin.Identity[];
371
373
  }
374
+ export interface ViewTabControlActionPayload {
375
+ callerType: CustomActionCallerType.ViewTabControl;
376
+ /** Identity of the Browser window containing the view tab. */
377
+ windowIdentity: OpenFin.Identity;
378
+ /** Identity of the view represented by the tab. */
379
+ viewIdentity: OpenFin.Identity;
380
+ /** Any data necessary for the functioning of the specified custom action. */
381
+ customData?: any;
382
+ /** Client x-coordinate where the control was invoked. */
383
+ x: number;
384
+ /** Client y-coordinate where the control was invoked. */
385
+ y: number;
386
+ }
372
387
  /**
373
388
  * Payload received by the openViewTabContextMenu provider override.
374
389
  */
@@ -608,12 +623,16 @@ export declare enum WindowType {
608
623
  Browser = "browser",
609
624
  Platform = "platform"
610
625
  }
626
+ /** How view tab widths are calculated. `'uniform'` is today's equal-width behavior. */
627
+ export type ViewTabWidthMode = 'uniform' | 'content';
611
628
  export interface BrowserWorkspacePlatformViewOptions {
612
629
  browserNavigationButtons?: RequireAtLeastOne<{
613
630
  back?: boolean;
614
631
  forward?: boolean;
615
632
  reload?: boolean;
616
633
  }>;
634
+ /** Per-view tab appearance options. */
635
+ viewTab?: ViewTabAppearanceOptions;
617
636
  }
618
637
  type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
619
638
  [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
@@ -690,16 +709,36 @@ export interface BrowserWorkspacePlatformWindowOptions {
690
709
  minWidth?: string;
691
710
  maxWidth?: string;
692
711
  };
693
- /** Specifies the min and max sizes for view tabs in a layout.
712
+ /**
713
+ * Specifies the min and max sizes for view tabs in a layout, and how those widths are calculated.
694
714
  * View tabs will expand to take all available space up to the specified maximum size.
695
715
  * Similarly, they will collapse down to the specified minimum size.
696
716
  * When there is not enough room to fit the tabs, the tabstrip will become scrollable.
697
717
  * Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%").
698
- * The default value for both min and max is "120px". To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
718
+ * Defaults depend on the width mode: `'uniform'` uses "120px" for both bounds, while `'content'` sizes a
719
+ * tab to its own chrome and so applies no minimum and a "200px" maximum.
720
+ * To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
721
+ *
722
+ * @example
723
+ * ```ts
724
+ * workspacePlatform: {
725
+ * viewTabDimensions: {
726
+ * widthMode: 'content',
727
+ * minWidth: '50px',
728
+ * maxWidth: '200px'
729
+ * }
730
+ * }
731
+ * ```
699
732
  */
700
733
  viewTabDimensions?: {
701
734
  minWidth?: string;
702
735
  maxWidth?: string;
736
+ /**
737
+ * Controls how view tab widths are calculated.
738
+ * - `'uniform'` (default): current equal-width tab behavior.
739
+ * - `'content'`: tab width is driven by tab chrome (label, favicon, spinner, controls) within min/max bounds.
740
+ */
741
+ widthMode?: ViewTabWidthMode;
703
742
  };
704
743
  /**
705
744
  * Controls whether tab-search chevron buttons are shown for page tabs and view tabs.
@@ -1989,6 +2028,7 @@ export declare enum CustomActionCallerType {
1989
2028
  StoreCustomButton = "StoreCustomButton",
1990
2029
  CustomDropdownItem = "CustomDropdownItem",
1991
2030
  GlobalContextMenu = "GlobalContextMenu",
2031
+ ViewTabControl = "ViewTabControl",
1992
2032
  ViewTabContextMenu = "ViewTabContextMenu",
1993
2033
  PageTabContextMenu = "PageTabContextMenu",
1994
2034
  SaveButtonContextMenu = "SaveButtonContextMenu",
@@ -1999,7 +2039,7 @@ export declare enum CustomActionCallerType {
1999
2039
  * When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
2000
2040
  export type CustomActionPayload = {
2001
2041
  callerType: CustomActionCallerType.API;
2002
- } | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
2042
+ } | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabControlActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
2003
2043
  export interface GetCurrentWorkspaceOptions {
2004
2044
  skipSnapshotUpdate?: boolean;
2005
2045
  }
@@ -2244,6 +2284,10 @@ export interface WorkspacePlatformInitConfig {
2244
2284
  * external `translation-override.json` (configured via `translationOverridesUrl`) is
2245
2285
  * also accepted.
2246
2286
  *
2287
+ * When `languagePacksApiUrl` is set, i18next loads packs over HTTP from that
2288
+ * i18next-http-backend `loadPath` (e.g. `${origin}/platform/api/localization/{{lng}}/{{ns}}.json`)
2289
+ * instead of the bundled locale JSON. Omit it to keep the built-in packs.
2290
+ *
2247
2291
  * @example
2248
2292
  * ```ts
2249
2293
  * await WorkspacePlatform.init({
@@ -2260,6 +2304,11 @@ export interface WorkspacePlatformInitConfig {
2260
2304
  */
2261
2305
  language?: {
2262
2306
  initialLanguage?: Locale;
2307
+ /**
2308
+ * i18next-http-backend loadPath. When provided, HTTP language packs are used
2309
+ * even if the manifest did not inject `languagePacksApiUrl`.
2310
+ */
2311
+ languagePacksApiUrl?: string;
2263
2312
  };
2264
2313
  /**
2265
2314
  * Override workspace platform behavior
@@ -12,7 +12,10 @@ export declare const getHttpBackendOptions: (loadPath: string) => {
12
12
  * Fire-and-forget: first paint and the logo menu must not wait on this GET.
13
13
  */
14
14
  export declare const overlayEnglishFromHttpBackend: () => void;
15
- declare function initI18next(language?: Locale): Promise<void>;
15
+ export type InitI18nextOptions = {
16
+ languagePacksApiUrl?: string;
17
+ };
18
+ declare function initI18next(language?: Locale, options?: InitI18nextOptions): Promise<void>;
16
19
  export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
17
20
  declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
18
21
  export { initI18next, i18next, t, type Resource };
@@ -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
+ };
@@ -1,44 +1,47 @@
1
- /**
2
- * Kept in a standalone module with type-only imports so consumers can pull it in
3
- * via the `@openfin/enterprise-api/color-channels` subpath without bundling the SDK.
4
- *
5
- * TODO: https://openfin.jira.com/browse/WRK-5704 - need to rewrite this to use color tokens
6
- */
1
+ import type OpenFin from '@openfin/core';
7
2
  export declare const ENTERPRISE_COLOR_CHANNELS: {
8
- readonly blue: {
9
- readonly name: "Blue";
10
- readonly color: "#0091EB";
11
- };
12
- readonly indigo: {
13
- readonly name: "Indigo";
14
- readonly color: "#6450FF";
15
- };
16
- readonly pink: {
17
- readonly name: "Pink";
18
- readonly color: "#E878CF";
19
- };
20
- readonly teal: {
21
- readonly name: "Teal";
22
- readonly color: "#24D1D1";
23
- };
24
- readonly green: {
25
- readonly name: "Green";
26
- readonly color: "#00AF78";
27
- };
28
- readonly orange: {
29
- readonly name: "Orange";
30
- readonly color: "#FF7D37";
31
- };
32
- readonly red: {
33
- readonly name: "Red";
34
- readonly color: "#F94144";
35
- };
36
- readonly yellow: {
37
- readonly name: "Yellow";
38
- readonly color: "#F9C74F";
39
- };
40
- readonly gray: {
41
- readonly name: "Gray";
42
- readonly color: "#828788";
3
+ readonly 'fdc3.channel.1': {
4
+ readonly name: "Channel 1";
5
+ readonly color: "red";
6
+ readonly glyph: "1";
7
+ };
8
+ readonly 'fdc3.channel.2': {
9
+ readonly name: "Channel 2";
10
+ readonly color: "orange";
11
+ readonly glyph: "2";
12
+ };
13
+ readonly 'fdc3.channel.3': {
14
+ readonly name: "Channel 3";
15
+ readonly color: "yellow";
16
+ readonly glyph: "3";
17
+ };
18
+ readonly 'fdc3.channel.4': {
19
+ readonly name: "Channel 4";
20
+ readonly color: "green";
21
+ readonly glyph: "4";
22
+ };
23
+ readonly 'fdc3.channel.5': {
24
+ readonly name: "Channel 5";
25
+ readonly color: "cyan";
26
+ readonly glyph: "5";
27
+ };
28
+ readonly 'fdc3.channel.6': {
29
+ readonly name: "Channel 6";
30
+ readonly color: "blue";
31
+ readonly glyph: "6";
32
+ };
33
+ readonly 'fdc3.channel.7': {
34
+ readonly name: "Channel 7";
35
+ readonly color: "magenta";
36
+ readonly glyph: "7";
37
+ };
38
+ readonly 'fdc3.channel.8': {
39
+ readonly name: "Channel 8";
40
+ readonly color: "purple";
41
+ readonly glyph: "8";
43
42
  };
44
43
  };
44
+ export declare const normalizeColorChannelId: (colorChannelId: string) => string | undefined;
45
+ export declare const areColorChannelIdsEqual: (firstColorChannelId: string, secondColorChannelId: string) => boolean;
46
+ export declare const getContextGroupDisplayName: (contextGroup: OpenFin.ContextGroupInfo) => string;
47
+ export declare const getContextGroupCssColor: (contextGroup: OpenFin.ContextGroupInfo) => string;
@@ -9,7 +9,6 @@ export declare const isEnterpriseBrowserPlatform: (browserInitOptions: BrowserIn
9
9
  export declare function formatUrl(url: string): string;
10
10
  export declare const getIsEnterpriseBrowser: (id?: OpenFin.Identity) => Promise<boolean>;
11
11
  export declare const isLandingPage: (url: string) => boolean;
12
- export declare const isLandingPageOrEmpty: (url: string) => boolean;
13
12
  export declare const isDefaultEnterpriseView: (viewIdentity: OpenFin.Identity) => boolean;
14
13
  export declare const getAICompanionViewIdentity: (browserIdentity?: OpenFin.Identity) => {
15
14
  uuid: string;
@@ -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';
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). After de-duplication, expect one.
13
+ * Per-call baseline durations are secondary because the two reads can overlap concurrently.
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>;