@openfin/workspace-platform 23.0.1 → 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * WARNING: Do not export from './notifications' here. Not unless we move 'openfin-notifications' here.
2
+ * WARNING: Do not export from './notifications' here. Not unless we move '@here-io/notifications' here.
3
3
  */
4
4
  export * from './common';
5
5
  export * from './home';
@@ -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
  *
@@ -62,7 +63,7 @@ export declare class ThemeStorageController {
62
63
  * Synchronize the current palette and scheme with workspace's storage instance if
63
64
  * storage based theming is enabled. Only syncs when user has explicitly selected a scheme.
64
65
  */
65
- trySynchronizeWorkspaceStorage: () => void;
66
+ trySynchronizeWorkspaceStorage: () => Promise<void>;
66
67
  /**
67
68
  * Set the current Palette to be used by workspace. This palette will be converted into
68
69
  * css vars and combined into a single stylesheet. This stylesheet is exposed in localstorage
@@ -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
@@ -364,6 +364,7 @@ export declare enum BrowserButtonType {
364
364
  LockUnlockPage = "LockUnlockPage",
365
365
  SaveMenu = "SaveMenu",
366
366
  SavePage = "SavePage",
367
+ Download = "Download",
367
368
  Minimise = "Minimise",
368
369
  Maximise = "Maximise",
369
370
  Close = "Close",
@@ -1419,12 +1420,27 @@ export interface LaunchAppRequest {
1419
1420
  target?: OpenFin.EntityInfo;
1420
1421
  app: App;
1421
1422
  }
1422
- /**
1423
- * Get Themes from API
1424
- */
1425
1423
  export interface ThemeApi {
1426
- getThemes(): Promise<CustomThemes | GeneratedPalettes>;
1424
+ /**
1425
+ * @deprecated This method is deprecated. It is recommended to use {@link getGeneratedPalettes} instead.
1426
+ * Get the legacy themes from the platform provider.
1427
+ * @returns the legacy themes or null if the platform provider is using the new theme system.
1428
+ */
1429
+ getThemes(): Promise<CustomThemes | null>;
1430
+ /**
1431
+ * Get the generated palettes from the platform provider.
1432
+ * @returns the generated palettes.
1433
+ */
1434
+ getGeneratedPalettes(): Promise<GeneratedPalettes>;
1435
+ /**
1436
+ * Set the selected scheme for the platform provider.
1437
+ * @param newScheme the new scheme to set.
1438
+ */
1427
1439
  setSelectedScheme(newScheme: ColorSchemeOptionType): Promise<void>;
1440
+ /**
1441
+ * Get the selected scheme from the platform provider.
1442
+ * @returns the selected scheme.
1443
+ */
1428
1444
  getSelectedScheme(): Promise<ColorSchemeOptionType>;
1429
1445
  }
1430
1446
  /**
@@ -1592,6 +1608,7 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
1592
1608
  setLanguage(locale: Locale): Promise<void>;
1593
1609
  /**
1594
1610
  * Implementation for getting the notifications workspace platform configuration.
1611
+ * @deprecated Notifications config is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this method as it will not return the correct configuration.
1595
1612
  */
1596
1613
  getNotificationsConfig(): Promise<NotificationsCustomManifestOptions | undefined>;
1597
1614
  /**
@@ -2086,6 +2103,7 @@ export interface WorkspacePlatformInitConfig {
2086
2103
  /**
2087
2104
  * Config for overriding default notifications behaviour.
2088
2105
  * Leave undefined to use OpenFin hosted Notification Center.
2106
+ * @deprecated Notifications config is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this property as it will not have any effect.
2089
2107
  */
2090
2108
  notifications?: NotificationsCustomManifestOptions;
2091
2109
  /**
@@ -1,5 +1,6 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import { ColorSchemeOptionType } from '../../../../client-api-platform/src/shapes';
3
+ import { NotificationsCustomManifestOptions } from '../shapes/notifications';
3
4
  export declare const NOTIFICATIONS_SYNC_CHANNEL = "of-workspace-notifications-sync";
4
5
  export declare enum NotificationsChannelAction {
5
6
  UpdatePlatformThemeScheme = "update-platform-theme-scheme"
@@ -10,5 +11,11 @@ export interface UpdatePlatformSchemePayload {
10
11
  interface NotificationsSyncChannelClient extends OpenFin.ChannelClient {
11
12
  dispatch(action: NotificationsChannelAction.UpdatePlatformThemeScheme, payload: UpdatePlatformSchemePayload): Promise<void>;
12
13
  }
14
+ export type ManifestNotificationsConfig = {
15
+ notifications?: {
16
+ customManifest?: NotificationsCustomManifestOptions;
17
+ };
18
+ };
19
+ export declare function getNotificationCenterUuid(): Promise<string>;
13
20
  export declare const getNotificationsSyncChannelClient: () => Promise<NotificationsSyncChannelClient>;
14
21
  export {};
@@ -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",
@@ -78,7 +80,7 @@ export declare enum WorkspacePlatformChannelAction {
78
80
  HandleRequestNavigationInternal = "handleRequestNavigationInternal",// Enterprise
79
81
  RefreshBookmarksInternal = "refreshBookmarksInternal",// Enterprise
80
82
  LaunchBookmarkInternal = "launchBookmarkInternal",// Enterprise
81
- GetNotificationsConfig = "getNotificationsConfig",
83
+ GetNotificationsConfig = "getNotificationsConfig",// Deprecated
82
84
  UpdateDockFavoritesInternal = "updateDockFavoritesInternal",// Enterprise
83
85
  UpdateContentMenuInternal = "updateContentMenuInternal",// Enterprise
84
86
  LaunchDockEntryInternal = "launchDockEntryInternal",// Enterprise
@@ -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>;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Options for using privately hosted notification service.
3
+ * @deprecated Custom manifest is now part of the platform manifest and is automatically resolved by the notifications API. Do not use this type as it will be ignored.
3
4
  */
4
5
  export type NotificationsCustomManifestOptions = {
5
6
  /**
@@ -286,5 +286,6 @@ export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identi
286
286
  }>;
287
287
  export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
288
288
  export declare const getComputedScheme: (identity?: OpenFin.Identity) => Promise<Exclude<ColorSchemeType, "system">>;
289
- export declare const getComputedBackgroundColor: () => Promise<string>;
289
+ export declare const getComputedBackgroundColor: (platformIdentity: OpenFin.Identity) => Promise<string>;
290
+ export declare const constructThemePaletteSheet: (themes: GeneratedPalettes) => string;
290
291
  export {};