@openfin/workspace-platform 23.0.2 → 23.0.4

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.
@@ -1,5 +1,4 @@
1
- import { GeneratedPalettes } from '../../../../common/src/api/theming';
2
1
  import { ThemeStorageController } from '../../../../client-api-platform/src/api/controllers/theme-storage-controller';
3
2
  import { CustomThemes } from '../../../../client-api-platform/src/shapes';
4
- export declare const initialiseStoragePalettes: (customThemes: CustomThemes | undefined, isWindows: boolean) => GeneratedPalettes;
3
+ export declare const initialiseStoragePalettes: (customThemes: CustomThemes | undefined, isWindows: boolean) => CustomThemes;
5
4
  export declare const getThemeStorageController: () => ThemeStorageController;
@@ -26,20 +26,15 @@ export declare const getPaletteExtensions: (palette: CustomPaletteSet, paletteSc
26
26
  'scrollbar-track-rgb': string;
27
27
  selectedTab: string;
28
28
  };
29
- export type LegacyPalettes = {
29
+ export type Palettes = {
30
30
  dark: CustomPaletteSet;
31
31
  light: CustomPaletteSet;
32
32
  };
33
- export type Palettes = {
34
- light: string;
35
- dark: string;
36
- };
37
33
  export declare class ThemeStorageController {
38
34
  private providerStorage;
39
35
  private darkPaletteVars?;
40
36
  private lightPaletteVars?;
41
37
  private workspaceStorage?;
42
- private themePaletteSheet?;
43
38
  constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>);
44
39
  private getVarsByScheme;
45
40
  /**
@@ -69,11 +64,7 @@ export declare class ThemeStorageController {
69
64
  * to allow workspace UI elements to load the palette before their first paint.
70
65
  * @param palettes Light and Dark Palette constants
71
66
  */
72
- setLegacyPalettes: ({ light, dark }: LegacyPalettes, isWindows: boolean) => Promise<void>;
73
- setPalettes: ({ light, dark }: {
74
- light: string;
75
- dark: string;
76
- }) => Promise<void>;
67
+ setPalettes: ({ light, dark }: Palettes, isWindows: boolean) => Promise<void>;
77
68
  /**
78
69
  * Set the current scheme of workspace. Specifically setting light or dark
79
70
  * will ignore the OS scheme, whereas 'system' will always respect it.
@@ -92,9 +83,4 @@ export declare class ThemeStorageController {
92
83
  * @returns 'light' | 'system' | 'dark'
93
84
  */
94
85
  getScheme(): ColorSchemeOptionType;
95
- getThemePaletteSheet(): string | undefined;
96
- getThemePalette(): {
97
- light: string;
98
- dark: string;
99
- };
100
86
  }
@@ -1,16 +1,5 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import type { GenerateThemeParams, LegacyPalettes } from '../../../common/src/api/theming';
3
2
  import { ColorSchemeOptionType, ThemeApi } from '../../../client-api-platform/src/shapes';
4
3
  export declare const getThemingApi: (identity: OpenFin.ApplicationIdentity) => ThemeApi;
5
- export declare const dispatchThemeToWorkspaceProvider: (themeData: {
6
- themePaletteSheet: string;
7
- selectedScheme: ColorSchemeOptionType;
8
- themePalette: {
9
- light: string;
10
- dark: string;
11
- };
12
- }) => Promise<void>;
13
4
  export declare const setSelectedScheme: (schemeType: ColorSchemeOptionType) => Promise<void>;
14
5
  export declare const getSelectedScheme: () => ColorSchemeOptionType | null | undefined;
15
- export declare const getThemePaletteSheet: () => string | undefined;
16
- export declare const mapLegacyThemeToCustomTheme: (legacyTheme: LegacyPalettes) => GenerateThemeParams;
@@ -1,6 +1,5 @@
1
- import { GeneratedPalettes } from '../../../common/src/api/theming';
2
1
  import { CustomThemes } from '../shapes';
3
- export declare const getThemes: () => GeneratedPalettes;
2
+ export declare const getThemes: () => CustomThemes;
4
3
  /**
5
4
  * initTheming()
6
5
  * @param customThemes array of theme objects
@@ -4,7 +4,7 @@ import type { AnalyticsEvent } from '../../common/src/utils/usage-register';
4
4
  import type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
5
5
  import type { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, HandlePagesAndWindowClosePayload, HandlePagesAndWindowCloseResult, HandleSaveModalOnPageClosePayload, Page, PageLayoutsWithSelectedViews, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
6
6
  import type { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
7
- import type { CustomThemes, GeneratedPalettes } from '../../common/src/api/theming';
7
+ import type { CustomThemes } from '../../common/src/api/theming';
8
8
  import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
9
9
  import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
10
10
  export * from '../../dock3/src/shapes';
@@ -1424,7 +1424,7 @@ export interface LaunchAppRequest {
1424
1424
  * Get Themes from API
1425
1425
  */
1426
1426
  export interface ThemeApi {
1427
- getThemes(): Promise<CustomThemes | GeneratedPalettes>;
1427
+ getThemes(): Promise<CustomThemes>;
1428
1428
  setSelectedScheme(newScheme: ColorSchemeOptionType): Promise<void>;
1429
1429
  getSelectedScheme(): Promise<ColorSchemeOptionType>;
1430
1430
  }
@@ -17,5 +17,6 @@ export type ManifestNotificationsConfig = {
17
17
  };
18
18
  };
19
19
  export declare function getNotificationCenterUuid(): Promise<string>;
20
+ export declare function getSyncChannelName(): Promise<string>;
20
21
  export declare const getNotificationsSyncChannelClient: () => Promise<NotificationsSyncChannelClient>;
21
22
  export {};
@@ -85,14 +85,6 @@ type WorkspaceChannelTypes = {
85
85
  'set-search-query': (payload: SearchQueryWithProviderID) => Promise<void>;
86
86
  'assign-home-search-context': (payload: Partial<HomeSearchListenerRequest['context']>) => Promise<void>;
87
87
  'set-selected-scheme': (ctx: ColorSchemeOptionType) => Promise<void>;
88
- 'initialize-theme': (themeData: {
89
- themePaletteSheet: string;
90
- selectedScheme: ColorSchemeOptionType;
91
- themePalette: {
92
- light: string;
93
- dark: string;
94
- };
95
- }) => Promise<void>;
96
88
  'get-legacy-pages': () => Promise<Page[]>;
97
89
  'get-legacy-workspaces': (payload: undefined) => Promise<LegacyWorkspace[]>;
98
90
  'register-storefront-provider': () => Promise<void>;
@@ -1,13 +1,8 @@
1
1
  import type { DefaultTheme } from 'styled-components';
2
2
  import type OpenFin from '@openfin/core';
3
3
  import type { ColorSchemeType, ThemeSet } from '@openfin/ui-library';
4
+ import { Palette } from '@openfin/ui-library/dist/theme';
4
5
  import { ColorSchemeOptionType } from '../../../client-api-platform/src/shapes';
5
- import type { generateTheme } from '@openfin/theme-engine';
6
- export declare const ColorScheme: {
7
- light: string;
8
- dark: string;
9
- system: string;
10
- };
11
6
  export type WorkspaceComponentSetSelectedSchemePayload = {
12
7
  newScheme: ColorSchemeOptionType;
13
8
  identity: OpenFin.Identity;
@@ -126,19 +121,10 @@ export type CustomThemeOptionsWithScheme = BaseThemeOptions & {
126
121
  */
127
122
  notificationIndicatorColors?: NotificationIndicatorColorsWithScheme;
128
123
  };
129
- export type ThemeOptions = BaseThemeOptions & {
130
- seed: Parameters<typeof generateTheme>[0];
131
- overrides?: Parameters<typeof generateTheme>[1];
132
- };
133
- type GenerateThemeReturn = ReturnType<typeof generateTheme>;
134
- export type GeneratedPalettes = Pick<GenerateThemeReturn, 'dark' | 'light'>;
135
- export type LegacyPalettes = CustomThemeOptions | CustomThemeOptionsWithScheme;
136
- export type GenerateThemeParams = Parameters<typeof generateTheme>;
137
- export type CustomThemes = (CustomThemeOptions | CustomThemeOptionsWithScheme | ThemeOptions)[];
124
+ export type CustomThemes = (CustomThemeOptions | CustomThemeOptionsWithScheme)[];
138
125
  export interface PreloadedThemeData {
139
- themes: CustomThemes | GeneratedPalettes;
126
+ themes: CustomThemes;
140
127
  selectedScheme: ColorSchemeOptionType;
141
- themePaletteSheet?: string;
142
128
  }
143
129
  export interface DefaultPaletteSet {
144
130
  brandPrimary: string;
@@ -280,11 +266,15 @@ export declare const OpenFinDarkTheme: {
280
266
  };
281
267
  export declare const DefaultOpenFinTheme: CustomThemes;
282
268
  export declare const getComputedPaletteSets: (customTheme: CustomThemeOptions | CustomThemeOptionsWithScheme) => WorkspaceThemeSet;
283
- export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<{
284
- theme: GeneratedPalettes | CustomThemes;
285
- defaultScheme: ColorSchemeOptionType;
286
- }>;
269
+ /**
270
+ * Transforms input {@link CustomThemes} to {@link ComputedThemes} used by Workspace Platform / Notifications Platform.
271
+ *
272
+ * @param customThemes array of themes to transform
273
+ * @param storedScheme sets the default scheme if provided
274
+ * @returns array of {@link ComputedThemes | computed themes}
275
+ */
276
+ export declare const computeThemes: (customThemes: CustomThemes, storedScheme?: ColorSchemeOptionType) => ComputedThemes;
277
+ export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<ComputedTheme>;
287
278
  export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
288
279
  export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType, "system">>;
289
- export declare const getComputedBackgroundColor: () => Promise<string>;
290
- export {};
280
+ export declare const getComputedBackgroundColor: (paletteKey: keyof typeof Palette, defaultColor?: string) => Promise<string>;
@@ -1,6 +1,6 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { EnterpriseMainContextMenuItemData, EnterpriseMainContextMenuItemTemplate, OpenGlobalContextMenuPayload } from '../../../client-api-platform/src/shapes';
3
- export declare const getEnterpriseContextMenuTemplate: ({ identity }: {
3
+ export declare const getEnterpriseContextMenuTemplate: ({ identity, selectedViews }: {
4
4
  identity: OpenFin.Identity;
5
5
  selectedViews: OpenFin.Identity[];
6
6
  }) => Promise<EnterpriseMainContextMenuItemTemplate[]>;