@openfin/workspace 23.0.2 → 23.0.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.
@@ -7,7 +7,7 @@ import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site }
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.View | OpenFin.Identity | OpenFin.Platform | OpenFin.Application>;
10
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Platform | OpenFin.View | OpenFin.Application>;
11
11
  export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
12
12
  export declare function getResults(payload: {
13
13
  req: SearchSitesRequest;
@@ -1,5 +1,18 @@
1
1
  import { GeneratedPalettes } from '../../../../common/src/api/theming';
2
2
  import { ThemeStorageController } from '../../../../client-api-platform/src/api/controllers/theme-storage-controller';
3
3
  import { CustomThemes } from '../../../../client-api-platform/src/shapes';
4
- export declare const initialiseStoragePalettes: (customThemes: CustomThemes | undefined, isWindows: boolean) => GeneratedPalettes;
4
+ /**
5
+ * Initialises the storage palettes from the custom themes. This function is called on platform init.
6
+ * This function takes both the legacy themes and the new theme system tokens and
7
+ * passes them into the theme engine to generate the css variables.
8
+ *
9
+ * @param customThemes the custom themes to initialise the storage palettes from.
10
+ * @param isWindows whether the operating system is Windows.
11
+ * @returns the generated palettes fromt the theme engine, theme palette sheet which is injected into the DOM, and legacy theme object if it exists.
12
+ */
13
+ export declare const initialiseStoragePalettes: (customThemes: CustomThemes | undefined, isWindows: boolean) => {
14
+ generatedPalettes: GeneratedPalettes;
15
+ themePaletteSheet: string;
16
+ legacyTheme: CustomThemes | null;
17
+ };
5
18
  export declare const getThemeStorageController: () => ThemeStorageController;
@@ -1,3 +1,4 @@
1
+ import { GeneratedPalettes } from '../../../../common/src/api/theming';
1
2
  import { ColorSchemeOptionType, CustomPaletteSet } from '../../../../client-api-platform/src/shapes';
2
3
  /**
3
4
  * Palette extensions can be used to add new variables to the palette set.
@@ -40,8 +41,8 @@ export declare class ThemeStorageController {
40
41
  private lightPaletteVars?;
41
42
  private workspaceStorage?;
42
43
  private themePaletteSheet?;
44
+ private generatedPalettes?;
43
45
  constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>);
44
- private getVarsByScheme;
45
46
  /**
46
47
  * Set the current Storage Proxy to enable Workspace Storage properties to be populated.
47
48
  *
@@ -87,6 +88,7 @@ export declare class ThemeStorageController {
87
88
  * @param scheme The default scheme specified in the palette
88
89
  */
89
90
  setThemeDefaultScheme(scheme: ColorSchemeOptionType): void;
91
+ setGeneratedPalettes(generatedPalettes: GeneratedPalettes): void;
90
92
  /**
91
93
  * Returns the current scheme
92
94
  * @returns 'light' | 'system' | 'dark'
@@ -1,6 +1,8 @@
1
1
  import { GeneratedPalettes } from '../../../common/src/api/theming';
2
2
  import { CustomThemes } from '../shapes';
3
- export declare const getThemes: () => GeneratedPalettes;
3
+ export declare const getThemes: () => CustomThemes | null;
4
+ export declare const getGeneratedPalettes: () => GeneratedPalettes;
5
+ export declare const getThemePaletteSheet: () => string;
4
6
  /**
5
7
  * initTheming()
6
8
  * @param customThemes array of theme objects
@@ -1721,12 +1721,33 @@ export interface LaunchAppRequest {
1721
1721
  target?: OpenFin.EntityInfo;
1722
1722
  app: App;
1723
1723
  }
1724
- /**
1725
- * Get Themes from API
1726
- */
1727
1724
  export interface ThemeApi {
1728
- getThemes(): Promise<CustomThemes | GeneratedPalettes>;
1725
+ /**
1726
+ * @deprecated This method is deprecated. It is recommended to use {@link getGeneratedPalettes} instead.
1727
+ * Get the legacy themes from the platform provider.
1728
+ * @returns the legacy themes or null if the platform provider is using the new theme system.
1729
+ */
1730
+ getThemes(): Promise<CustomThemes | null>;
1731
+ /**
1732
+ * Get the generated palettes from the platform provider.
1733
+ * @returns the generated palettes.
1734
+ */
1735
+ getGeneratedPalettes(): Promise<GeneratedPalettes>;
1736
+ /**
1737
+ * @internal
1738
+ * Get the theme palette sheet from the platform provider.
1739
+ * @returns the theme palette sheet.
1740
+ */
1741
+ getThemePaletteSheet(): Promise<string>;
1742
+ /**
1743
+ * Set the selected scheme for the platform provider.
1744
+ * @param newScheme the new scheme to set.
1745
+ */
1729
1746
  setSelectedScheme(newScheme: ColorSchemeOptionType): Promise<void>;
1747
+ /**
1748
+ * Get the selected scheme from the platform provider.
1749
+ * @returns the selected scheme.
1750
+ */
1730
1751
  getSelectedScheme(): Promise<ColorSchemeOptionType>;
1731
1752
  }
1732
1753
  /**
@@ -35,6 +35,8 @@ export declare enum WorkspacePlatformChannelAction {
35
35
  GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
36
36
  GetPageByViewIdentity = "getPageByViewIdentity",
37
37
  GetThemes = "getThemes",
38
+ GetGeneratedPalettes = "getGeneratedPalettes",
39
+ GetThemePaletteSheet = "getThemePaletteSheet",
38
40
  GetSelectedScheme = "getSelectedScheme",
39
41
  SetSelectedScheme = "setSelectedScheme",
40
42
  OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
@@ -19,8 +19,8 @@ export declare const launchProvider: () => Promise<void>;
19
19
  */
20
20
  export declare const getChannelClientAndLaunchProvider: () => Promise<WorkspaceComponentChannelClient>;
21
21
  /**
22
- * Launches the Workspace provider if it is not running.
22
+ * Gets the theme data from the Platform provider, then launches the Workspace provider if it is not running, and then dispatches the theme data to the Workspace provider.
23
23
  * Then gets a Channel Client that is connected to the Workspace Provider.
24
24
  * @returns the Channel Client that is connected to the Workspace Provider.
25
25
  */
26
- export declare const getClientAPIChannelClientAndLaunchProvider: () => Promise<WorkspaceAPIClientChannelClient>;
26
+ export declare const getChannelClientAndInitializeWorkspaceProvider: () => Promise<WorkspaceAPIClientChannelClient>;
@@ -310,5 +310,6 @@ export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identi
310
310
  }>;
311
311
  export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
312
312
  export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType, "system">>;
313
- export declare const getComputedBackgroundColor: () => Promise<string>;
313
+ export declare const getComputedBackgroundColor: (platformIdentity: OpenFin.Identity) => Promise<string>;
314
+ export declare const constructThemePaletteSheet: (themes: GeneratedPalettes) => string;
314
315
  export {};
@@ -2,11 +2,19 @@
2
2
  "@here-io/notifications": [
3
3
  {
4
4
  "type": "explicit",
5
- "version": "npm:@openfin/notifications@2.13.0-alpha-4294",
5
+ "version": "npm:@openfin/notifications@2.13.0-alpha-4323",
6
6
  "packageName": "client-api/package.json",
7
7
  "issuer": "client-api/src/notifications.ts"
8
8
  }
9
9
  ],
10
+ "@openfin/microsoft365": [
11
+ {
12
+ "type": "explicit",
13
+ "version": "^1.0.1",
14
+ "packageName": "client-api/package.json",
15
+ "issuer": "client-api/src/integrations/microsoft.ts"
16
+ }
17
+ ],
10
18
  "title-case": [
11
19
  {
12
20
  "type": "explicit",
@@ -21,14 +29,6 @@
21
29
  "issuer": "common/src/utils/color-linking.ts"
22
30
  }
23
31
  ],
24
- "@openfin/microsoft365": [
25
- {
26
- "type": "explicit",
27
- "version": "^1.0.1",
28
- "packageName": "client-api/package.json",
29
- "issuer": "client-api/src/integrations/microsoft.ts"
30
- }
31
- ],
32
32
  "lodash.debounce": [
33
33
  {
34
34
  "type": "explicit",