@openfin/workspace 24.1.3 → 24.1.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.
@@ -0,0 +1,19 @@
1
+ import { StorageProxy } from '../../../../../client-api-platform/src/api/utils';
2
+ /**
3
+ * Channel Storage Proxy allows population of storage keys in a different origin, assuming that origin has set up
4
+ * a storage proxy on the specified URL.
5
+ *
6
+ * This is useful for writing to the localStorage of workspace when the provider is on a different origin.
7
+ */
8
+ export declare class ChannelStorageProxy implements StorageProxy {
9
+ #private;
10
+ constructor(url: string);
11
+ get isDestroyed(): boolean;
12
+ /**
13
+ * Sets a key in the proxied storage partition.
14
+ * @param key Key to set
15
+ * @param value Value.
16
+ */
17
+ setItem(key: string, value: string): Promise<void>;
18
+ destroy(): Promise<void>;
19
+ }
@@ -0,0 +1,12 @@
1
+ import { StorageProxy } from '../../../../../client-api-platform/src/api/utils';
2
+ /**
3
+ * LocalStorage backed StorageProxy, for use in same origin scenarios (i.e. when the provider and workspace UI are guaranteed
4
+ * to share a storage partition).
5
+ */
6
+ export declare class LocalStorageProxy implements StorageProxy {
7
+ #private;
8
+ constructor(storage: Pick<Storage, 'setItem'>);
9
+ setItem(key: string, value: string): Promise<void>;
10
+ destroy(): Promise<void>;
11
+ get isDestroyed(): boolean;
12
+ }
@@ -17,3 +17,20 @@ export declare const initialiseStoragePalettes: (customThemes: CustomThemes | un
17
17
  notificationIndicatorColors: NotificationIndicatorColorsParsed | null;
18
18
  };
19
19
  export declare const getThemeStorageController: () => ThemeStorageController;
20
+ /**
21
+ * Resolves when the first theme sync completes. Use this to ensure that we do not launch UI such as browser until this has completed.
22
+ *
23
+ * @param allowFailure Whether to suppress rejections and continue anyway. Recommended for most use cases.
24
+ */
25
+ export declare const waitForFirstThemeSync: (allowFailure?: boolean) => Promise<void>;
26
+ /**
27
+ * Creates and initialises the Theme Storage Controller singleton.
28
+ *
29
+ * Triggers the first theme sync, but does not await it. To ensure dependent UI can guarantee the theme palette is synced,
30
+ * you can call `await waitForFirstThemeSync` (e.g. in the createWindow provider override).
31
+ *
32
+ * @param isEnterprise Whether in enterprise mode (allows using local storage proxy directly).
33
+ * @param baseUrl Base url of the hosted workspace UI.
34
+ * @param syncTimeout How long `waitForFirstThemeSync` should wait before rejecting.
35
+ */
36
+ export declare const initialiseThemeController: (isEnterprise: boolean, baseUrl: string, syncTimeout: number) => void;
@@ -24,37 +24,29 @@ export type Palettes = {
24
24
  dark: string;
25
25
  };
26
26
  export declare class ThemeStorageController {
27
+ #private;
27
28
  private providerStorage;
28
29
  private darkPaletteVars?;
29
30
  private lightPaletteVars?;
30
31
  private themePaletteSheet?;
31
32
  private generatedPalettes?;
32
33
  private workspaceStorage?;
33
- private recreateFactory?;
34
+ private storageFactory?;
34
35
  private isLegacySinglePaletteTheme;
35
36
  constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>);
36
37
  /**
37
- * Set the current Storage Proxy to enable Workspace Storage properties to be populated.
38
- */
39
- setWorkspaceStorageProxy: (proxy: StorageProxy) => void;
40
- /**
41
- * Set a factory to recreate the storage proxy if it was destroyed (e.g. when a new browser
42
- * window is opened after the last one closed with preventQuitOnLastWindowClosed true).
43
- * Called once at platform init; avoids createWindow needing URL/env dependencies.
38
+ * Sets the storage factory. This can only be done once, and will throw for subsequent calls.
39
+ *
40
+ * All storage writes will be pending until the factory is created.
41
+ * @param factory
44
42
  */
45
- setRecreateFactory: (factory: () => Promise<StorageProxy>) => void;
43
+ setStorageFactory: (factory: () => StorageProxy) => void;
46
44
  /**
47
45
  * Close the storage proxy window and clear the reference. Called when the last browser window
48
46
  * closes so the platform can quit (storage proxy would otherwise keep the process alive).
49
- * Clears the reference before awaiting destroy() to avoid a race with ensureWorkspaceStorageProxy.
47
+ * Clears the reference before awaiting destroy() to avoid a race with getOrCreateStorageProxy.
50
48
  */
51
49
  destroyWorkspaceStorageProxy: () => Promise<void>;
52
- /**
53
- * Ensure the workspace storage proxy exists, recreating via the factory set at init if it was
54
- * previously destroyed. No-op if no factory was set (e.g. in tests). Call before using
55
- * workspace storage (e.g. when creating a browser window).
56
- */
57
- ensureWorkspaceStorageProxy: () => Promise<void>;
58
50
  /**
59
51
  * Check if there's an explicit user preference stored in localStorage.
60
52
  * A user preference is indicated by the presence of a SelectedColorScheme key. Which is something assigned if you click on the Appearance dropdown.
@@ -63,11 +55,9 @@ export declare class ThemeStorageController {
63
55
  private hasUserPreference;
64
56
  /**
65
57
  * Synchronize the current palette and scheme with workspace's storage instance if
66
- * storage based theming is enabled. Only syncs when user has explicitly selected a scheme.
67
- *
68
- * Wrapped in try/catch so it does not throw
58
+ * storage based theming is enabled.
69
59
  */
70
- trySynchronizeWorkspaceStorage: () => Promise<void>;
60
+ synchronizeWorkspaceStorage: () => Promise<void>;
71
61
  /**
72
62
  * Set the current Palette to be used by workspace. This palette will be converted into
73
63
  * css vars and combined into a single stylesheet. This stylesheet is exposed in localstorage
@@ -2,11 +2,6 @@ export declare const listenForStoreClose: () => void;
2
2
  export type StorageProxy = {
3
3
  setItem: (data: string, value: string) => Promise<void>;
4
4
  destroy: () => Promise<void>;
5
+ isDestroyed: boolean;
5
6
  };
6
- export declare const createStorageProxy: (url: string, isEnterprise: boolean) => Promise<StorageProxy>;
7
- /**
8
- * Ensure the workspace storage proxy window exists. Recreates it if it was previously destroyed
9
- * (e.g. when the last browser window closed with preventQuitOnLastWindowClosed true and a new
10
- * browser window is now being created). Uses the factory registered at init; no-op in tests.
11
- */
12
- export declare const ensureWorkspaceStorageProxy: () => Promise<void>;
7
+ export declare const getStorageFactory: (isEnterprise: boolean, baseUrl: string) => (() => StorageProxy);
@@ -1,5 +1,6 @@
1
1
  import OpenFin from '@openfin/core';
2
2
  import { WorkspacePlatformInitConfig } from '../../../client-api-platform/src/shapes';
3
+ export declare const MAX_FIRST_THEME_SYNC_WAIT = 3000;
3
4
  /**
4
5
  * Initilaize a Workspace Platform.
5
6
  *
@@ -852,6 +852,13 @@ export interface BrowserWorkspacePlatformWindowOptions {
852
852
  * When true, disables the ability to close pages in the window. False by default.
853
853
  */
854
854
  preventPageClose?: boolean;
855
+ /**
856
+ * When true, disables the find in page feature for the window.
857
+ * The find in page view will not be created and no find in page logic will run.
858
+ * This option must be set at window creation time and cannot be changed dynamically.
859
+ * False by default.
860
+ */
861
+ disableFindInPage?: boolean;
855
862
  /**
856
863
  * Taskbar Icon for the Browser Window. If light and dark icon are defined, then the taskbar icon will change when the scheme changes.
857
864
  */
@@ -2,19 +2,11 @@
2
2
  "@openfin/notifications": [
3
3
  {
4
4
  "type": "explicit",
5
- "version": "2.14.0-alpha-4543",
5
+ "version": "2.14.0-alpha-4620",
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.1.0",
14
- "packageName": "client-api/package.json",
15
- "issuer": "client-api/src/integrations/microsoft.ts"
16
- }
17
- ],
18
10
  "title-case": [
19
11
  {
20
12
  "type": "explicit",
@@ -29,6 +21,14 @@
29
21
  "issuer": "common/src/utils/color-linking.ts"
30
22
  }
31
23
  ],
24
+ "@openfin/microsoft365": [
25
+ {
26
+ "type": "explicit",
27
+ "version": "^1.1.0",
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",