@openfin/workspace-platform 24.1.0-alpha.ad7de216 → 24.1.1

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,10 +1,36 @@
1
1
  import { ProviderType } from '../../../common/src/api/provider';
2
+ /**
3
+ * Error thrown when attempting to use a provider that is not registered.
4
+ * @example
5
+ * ```typescript
6
+ * throw new ProviderNotRegisteredError('dock', 'my-dock-id');
7
+ * // Error: Dock Provider. Dock Provider with id my-dock-id is not currently registered.
8
+ * ```
9
+ */
2
10
  export declare class ProviderNotRegisteredError extends Error {
3
11
  constructor(providerType: ProviderType, id?: string);
4
12
  }
13
+ /**
14
+ * Error thrown when attempting to register a provider that is already registered.
15
+ * Call `deregister` before registering again.
16
+ * @example
17
+ * ```typescript
18
+ * throw new ProviderAlreadyRegisteredError('home', 'my-home-id');
19
+ * // Error: Home Provider. Home Provider with id my-home-id is already registered.
20
+ * ```
21
+ */
5
22
  export declare class ProviderAlreadyRegisteredError extends Error {
6
23
  constructor(providerType: ProviderType, id?: string);
7
24
  }
25
+ /**
26
+ * Error thrown when failing to retrieve a provider by ID.
27
+ * Typically thrown by `getProviderOrFail` when the requested provider does not exist.
28
+ * @example
29
+ * ```typescript
30
+ * throw new FailedToGetProviderError('storefront', 'unknown-id');
31
+ * // Error: Failed to get Storefront Provider. Storefront Provider with id unknown-id is not currently registered.
32
+ * ```
33
+ */
8
34
  export declare class FailedToGetProviderError extends Error {
9
35
  constructor(providerType: ProviderType, id?: string);
10
36
  }
@@ -0,0 +1,2 @@
1
+ import '@common/test/fin-mocks';
2
+ import '@common/test/logger-mock';
@@ -31,7 +31,8 @@ export declare class ThemeStorageController {
31
31
  private generatedPalettes?;
32
32
  private workspaceStorage?;
33
33
  private recreateFactory?;
34
- constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem'>);
34
+ private isLegacySinglePaletteTheme;
35
+ constructor(providerStorage: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>);
35
36
  /**
36
37
  * Set the current Storage Proxy to enable Workspace Storage properties to be populated.
37
38
  */
@@ -63,6 +64,8 @@ export declare class ThemeStorageController {
63
64
  /**
64
65
  * Synchronize the current palette and scheme with workspace's storage instance if
65
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
66
69
  */
67
70
  trySynchronizeWorkspaceStorage: () => Promise<void>;
68
71
  /**
@@ -84,6 +87,11 @@ export declare class ThemeStorageController {
84
87
  * @param scheme 'light', 'dark' or 'system'.
85
88
  */
86
89
  setScheme(scheme: ColorSchemeOptionType): void;
90
+ /**
91
+ * Clears an explicit user scheme choice (e.g. from Appearance) so resolution falls back to theme default.
92
+ */
93
+ clearUserSelectedSchemePreference(): void;
94
+ setLegacySinglePaletteTheme(value: boolean): void;
87
95
  /**
88
96
  * Set the theme's default scheme from palette configuration
89
97
  * @param scheme The default scheme specified in the palette
@@ -26,10 +26,15 @@ export declare const getActivePageIdForWindow: (identity: OpenFin.Identity) => P
26
26
  *
27
27
  * If the name is not unique, it will append a number to the end of the name.
28
28
  *
29
+ * When `BrowserInitConfig.allowDuplicatePageTitles` is `true`, this function
30
+ * short-circuits and returns the supplied name (or the default title) as-is,
31
+ * without appending a numeric suffix.
32
+ *
29
33
  * @param initialName The initial name to test
30
- * @returns string: a unique page name
34
+ * @param allowDuplicatePageTitles Whether duplicate page titles are permitted
35
+ * @returns string: a unique page name (or the input unchanged when duplicates are allowed)
31
36
  */
32
- export declare function getUniquePageTitle(initialName?: string): Promise<string>;
37
+ export declare function getUniquePageTitle(initialName?: string, allowDuplicatePageTitles?: boolean): Promise<string>;
33
38
  export declare function handleSaveModalOnPageClose({ page }: HandleSaveModalOnPageClosePayload): Promise<SaveModalOnPageCloseResult>;
34
39
  /**
35
40
  * Default implementation of shouldPageClose. If enableBeforeUnload isn't set to true, always returns True (proceed with close).
@@ -0,0 +1 @@
1
+ import '@common/test/fin-mocks';
@@ -3,7 +3,7 @@ export type StorageProxy = {
3
3
  setItem: (data: string, value: string) => Promise<void>;
4
4
  destroy: () => Promise<void>;
5
5
  };
6
- export declare const createStorageProxy: (url: string) => Promise<StorageProxy>;
6
+ export declare const createStorageProxy: (url: string, isEnterprise: boolean) => Promise<StorageProxy>;
7
7
  /**
8
8
  * Ensure the workspace storage proxy window exists. Recreates it if it was previously destroyed
9
9
  * (e.g. when the last browser window closed with preventQuitOnLastWindowClosed true and a new
@@ -0,0 +1 @@
1
+ import '@common/test/fin-mocks';
@@ -4,4 +4,4 @@ import { BrowserInitConfig } from '../../../../client-api-platform/src/shapes';
4
4
  /**
5
5
  * Applies default options to the creation of browser windows.
6
6
  */
7
- export declare function applyBrowserDefaults(options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions' | 'defaultViewOptions' | 'browserIconSize'> | undefined, themeData?: PreloadedThemeData): Promise<OpenFin.PlatformWindowCreationOptions>;
7
+ export declare function applyBrowserDefaults(options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions' | 'defaultViewOptions' | 'browserIconSize' | 'allowDuplicatePageTitles'> | undefined, themeData?: PreloadedThemeData): Promise<OpenFin.PlatformWindowCreationOptions>;
@@ -1,4 +1,4 @@
1
1
  import OpenFin from '@openfin/core';
2
2
  import type { AttachedPage, AttachedPageInternal } from '../../../../common/src/api/pages/shapes';
3
3
  import { BrowserInitConfig } from '../..';
4
- export declare const applyPageDefaults: (pages: AttachedPage[], initOptions?: Pick<BrowserInitConfig, "defaultPageOptions" | "defaultViewOptions" | "defaultWindowOptions">, overrideOptions?: OpenFin.PlatformWindowCreationOptions) => Promise<AttachedPageInternal[]>;
4
+ export declare const applyPageDefaults: (pages: AttachedPage[], initOptions?: Pick<BrowserInitConfig, "defaultPageOptions" | "defaultViewOptions" | "defaultWindowOptions" | "allowDuplicatePageTitles">, overrideOptions?: OpenFin.PlatformWindowCreationOptions) => Promise<AttachedPageInternal[]>;
@@ -2456,6 +2456,15 @@ export interface BrowserInitConfig {
2456
2456
  * https://developer.openfin.co/docs/javascript/stable/classes/OpenFin.InteropBroker.html
2457
2457
  */
2458
2458
  interopOverride?: OpenFin.OverrideCallback<OpenFin.InteropBroker, OpenFin.InteropBroker>;
2459
+ /**
2460
+ * When true, allows multiple pages to share the same title across browser
2461
+ * windows. No numeric suffixes are appended and attach/add operations
2462
+ * will not reject on title collision. `pageId` remains the unique
2463
+ * identifier for all page operations.
2464
+ *
2465
+ * Defaults to `false` (current unique-title behavior preserved).
2466
+ */
2467
+ allowDuplicatePageTitles?: boolean;
2459
2468
  }
2460
2469
  interface WorkspaceMetadata {
2461
2470
  APIVersion: string;
@@ -61,11 +61,6 @@ export declare const updatePageForWindow: (payload: ExtendedUpdatePageForWindowP
61
61
  * @param identity the identity of the window to save the pages of in window options.
62
62
  */
63
63
  export declare const updatePagesWindowOptions: (identity: OpenFin.Identity) => Promise<void>;
64
- /**
65
- * Check if the window identity is currently detaching pages.
66
- * @param identity the OF window identity to check.
67
- */
68
- export declare const isDetachingPages: (identity: OpenFin.Identity) => Promise<boolean>;
69
64
  /**
70
65
  * Check if the window identity is in the middle of changing active pages.
71
66
  * @param identity the OF window identity to check.
@@ -34,6 +34,8 @@ export interface Page {
34
34
  contextGroup?: string;
35
35
  /** Optional property to attach custom metadata to the page object, such as version or timestamp. Must be serializable. */
36
36
  customData?: any;
37
+ /** True when this page is an admin-published supertab. */
38
+ isPublished?: boolean;
37
39
  }
38
40
  type AttachedPageMetadata = {
39
41
  /** The window the page is currently attached to. */
@@ -52,7 +52,6 @@ export declare enum PageChannelAction {
52
52
  ReorderPagesForWindow = "reorder-pages-for-window",
53
53
  UpdatePageForWindow = "update-page-for-window",
54
54
  UpdatePagesWindowOptions = "update-pages-window-options",
55
- IsDetachingPages = "is-detaching-pages",
56
55
  IsActivePageChanging = "is-active-page-changing"
57
56
  }
58
57
  export declare enum CompanionDockChannelAction {
@@ -77,7 +76,6 @@ export declare const BrowserChannelAction: {
77
76
  ReorderPagesForWindow: PageChannelAction.ReorderPagesForWindow;
78
77
  UpdatePageForWindow: PageChannelAction.UpdatePageForWindow;
79
78
  UpdatePagesWindowOptions: PageChannelAction.UpdatePagesWindowOptions;
80
- IsDetachingPages: PageChannelAction.IsDetachingPages;
81
79
  IsActivePageChanging: PageChannelAction.IsActivePageChanging;
82
80
  CloseBrowserWindow: GeneralBrowserChannelActions.CloseBrowserWindow;
83
81
  QuitPlatform: GeneralBrowserChannelActions.QuitPlatform;
@@ -0,0 +1,5 @@
1
+ export declare const mockLogger: {
2
+ debug: jest.Mock<any, any, any>;
3
+ warn: jest.Mock<any, any, any>;
4
+ error: jest.Mock<any, any, any>;
5
+ };
@@ -24,6 +24,7 @@ export declare enum WindowName {
24
24
  ZoomControlsDialog = "here-zoom-controls-dialog",
25
25
  UpdateVersionModal = "here-update-version-modal",
26
26
  ApplyAndPublishModal = "here-apply-and-publish-modal",
27
+ PublishOnCloseModal = "here-publish-on-close-modal",
27
28
  DesktopSignalsModal = "here-desktop-signals-modal",
28
29
  IntentsResolverModal = "here-intents-resolver-modal"
29
30
  }
@@ -35,6 +35,9 @@ export declare const showUpdateVersionModal: ({ identity, title, description }:
35
35
  description: string;
36
36
  }) => Promise<ModalResponseEvent["data"]>;
37
37
  export declare const showApplyAndPublishModal: (identity: OpenFin.Identity) => Promise<boolean>;
38
+ export declare const showPublishOnCloseModal: (windowIdentity: OpenFin.Identity) => Promise<{
39
+ data: ModalResponseEvent["data"];
40
+ }>;
38
41
  /**
39
42
  * Shows the intents resolver modal and returns the user's selection
40
43
  * @param request - The request containing modal configuration