@openfin/workspace-platform 45.0.2 → 45.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.Identity | OpenFin.Platform | OpenFin.Application | OpenFin.View>;
10
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Application | OpenFin.View | OpenFin.Platform>;
11
11
  export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
12
12
  export declare function getResults(payload: {
13
13
  req: SearchSitesRequest;
@@ -1,6 +1,6 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import type { BaseThemeOptions, CustomPaletteSet, CustomTheme, GeneratedPalettes, GenerateThemeParams } from '../../../common/src/api/theming';
3
- import { ColorSchemeOptionType, ThemeApi } from '../../../client-api-platform/src/shapes';
2
+ import type { GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../../common/src/api/theming';
3
+ import { ColorSchemeOptionType, LegacyNotificationsThemeSet, ThemeApi } from '../../../client-api-platform/src/shapes';
4
4
  export declare const getThemingApi: (identity: OpenFin.ApplicationIdentity) => ThemeApi;
5
5
  export declare const dispatchThemeToWorkspaceProvider: (themeData: {
6
6
  themePaletteSheet: string;
@@ -13,15 +13,9 @@ export declare const dispatchThemeToWorkspaceProvider: (themeData: {
13
13
  export declare const setSelectedScheme: (schemeType: ColorSchemeOptionType) => Promise<void>;
14
14
  export declare const getSelectedScheme: () => ColorSchemeOptionType | null | undefined;
15
15
  export declare const getThemePaletteSheet: () => string | undefined;
16
- export declare const mapLegacyThemeToCustomTheme: (legacyTheme: CustomTheme) => GenerateThemeParams;
16
+ export { assignIfDefined, mapGeneratedPalettesToLegacyPalettes, mapLegacyBrandIcons, mapLegacyThemeToCustomTheme } from '../../../common/src/api/theme-migration';
17
17
  /**
18
- * Reverse of mapLegacyThemeToCustomTheme.
19
- * Takes the resolved token maps from a generated theme and maps them back to the
20
- * legacy CustomPaletteSet shape so that workspace apps still on the legacy theme
21
- * system can consume them.
18
+ * Builds a legacy NotificationsThemeSet from generated palettes and indicator colors.
19
+ * Used by the provider-side handler to serve old Notification Center versions (<=2.13).
22
20
  */
23
- export declare const mapGeneratedPalettesToLegacyPalettes: (generatedPalettes: GeneratedPalettes) => {
24
- light: CustomPaletteSet;
25
- dark: CustomPaletteSet;
26
- };
27
- export declare const mapLegacyBrandIcons: (legacyBrand: BaseThemeOptions["brand"]) => GenerateThemeParams[1];
21
+ export declare const buildLegacyNotificationsTheme: (generatedPalettes: GeneratedPalettes, notificationIndicatorColors: NotificationIndicatorColorsParsed | null) => Promise<LegacyNotificationsThemeSet | null>;
@@ -4,5 +4,12 @@ export declare function convertPanelViewOpts(panels: PanelConfig[], updatePageRe
4
4
  identity: OpenFin.Identity;
5
5
  pageId: string;
6
6
  }): Promise<ExtendedPanelConfig[]>;
7
- export declare function createPanelViewsForPages(pages: AttachedPage[]): Promise<void>;
7
+ /**
8
+ * Creates panel views for all pages in parallel. Returns a promise that callers
9
+ * may optionally await. In the initial window creation path the return value is
10
+ * intentionally ignored (fire-and-forget) so panel creation doesn't block
11
+ * `super.createWindow`. In the `attachPagesToWindow` path the promise is awaited
12
+ * so views exist before the browser dispatches `attachPanelViews`.
13
+ */
14
+ export declare function createPanelViewsForPages(pages: AttachedPage[]): Promise<PromiseSettledResult<unknown>[]> | undefined;
8
15
  export declare function createPanelViews(panels: PanelConfig[]): Promise<(void | OpenFin.View)[]>;
@@ -1,9 +1,10 @@
1
1
  import { GeneratedPalettes, NotificationIndicatorColorsParsed } from '../../../common/src/api/theming';
2
- import { CustomThemes } from '../shapes';
2
+ import { CustomThemes, LegacyNotificationsThemeSet } from '../shapes';
3
3
  export declare const getThemes: () => CustomThemes | null;
4
4
  export declare const getGeneratedPalettes: () => GeneratedPalettes;
5
5
  export declare const getThemePaletteSheet: () => string;
6
6
  export declare const getNotificationIndicatorColorsInternal: () => NotificationIndicatorColorsParsed;
7
+ export declare const getLegacyNotificationsThemeInternal: () => Promise<LegacyNotificationsThemeSet | null>;
7
8
  export declare const isThemePreInitialised: () => boolean;
8
9
  /**
9
10
  * initTheming()
@@ -12,7 +12,7 @@ export * from '../../dock3/src/shapes';
12
12
  export { AppManifestType } from '../../client-api/src/shapes';
13
13
  export type { App, AppIntent, Image } from '../../client-api/src/shapes';
14
14
  export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
15
- export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig, CopyPagePayload, HandleSaveModalOnPageClosePayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
15
+ export type { AttachedPage, Page, PagePinnedState, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig, CopyPagePayload, HandleSaveModalOnPageClosePayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, ShouldPageClosePayload, ShouldPageCloseResult, ViewsPreventingUnloadPayload } from '../../common/src/api/pages/shapes';
16
16
  export { PanelPosition } from '../../common/src/api/pages/shapes';
17
17
  export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
18
18
  export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
@@ -155,7 +155,11 @@ export declare enum PageTabContextMenuOptionType {
155
155
  Rename = "Rename",
156
156
  Save = "Save",
157
157
  SaveAs = "Save As",
158
- NewPage = "New Page",// Enterprise
158
+ NewPage = "New Page",
159
+ /** Workspace Browser: pin a normal tab (sets `pinned: 'user'`). */
160
+ Pin = "Pin",
161
+ /** Workspace Browser: unpin a user-pinned tab (clears `pinned`). */
162
+ Unpin = "Unpin",// Enterprise
159
163
  DeletePage = "Delete Page",// Enterprise
160
164
  SaveWorkspaceAs = "SaveWorkspaceAs",// Enterprise
161
165
  Refresh = "Refresh",// Enterprise
@@ -1,5 +1,6 @@
1
1
  import { OpenFin } from '@openfin/core';
2
2
  import { ExtendedPanelConfig, PageLayout, PanelConfig } from '../../../../client-api-platform/src/index';
3
+ import type { PagePinnedState } from '../../../../common/src/api/pages/shapes';
3
4
  export interface Page {
4
5
  /** A UI friendly title for the page. */
5
6
  title: string;
@@ -21,6 +22,9 @@ export interface Page {
21
22
  layout: PageLayout;
22
23
  /** True if the page is locked. */
23
24
  isLocked?: boolean;
25
+ /** Not used by enterprise — page pinning is a workspace-only feature. Declared here because
26
+ * shared code (page-tab-context-menu.ts) casts to AttachedPageInternal and accesses this field. */
27
+ pinned?: PagePinnedState;
24
28
  /** Used to manipulate behaviour of a close button on a page tab. If `undefined`, then close button is visible and actionable.
25
29
  * If either property true, this page tab's context menu will disable its 'Close Page' option.
26
30
  */
@@ -12,6 +12,8 @@ export interface PageLayoutDetails {
12
12
  export type PageLayout = OpenFin.LayoutOptions & {
13
13
  layoutDetails?: PageLayoutDetails;
14
14
  };
15
+ /** The pinned state of a page tab. `'platform'` = developer-locked; `'user'` = end-user pinned. */
16
+ export type PagePinnedState = 'platform' | 'user';
15
17
  /**
16
18
  * Provides configuration options for a set of Workspace Views. An array of Page objects is a required option of the {@link workspacePlatform}
17
19
  * property of the {@link BrowserCreateWindowRequest} interface.
@@ -62,6 +64,8 @@ export interface Page {
62
64
  layout: PageLayout;
63
65
  /** True if the page is locked. */
64
66
  isLocked?: boolean;
67
+ /** Pinned state: `'platform'` (developer-locked), `'user'` (end-user pinned), or omitted (normal). */
68
+ pinned?: PagePinnedState;
65
69
  /** Used to manipulate behaviour of a close button on a page tab. If `undefined`, then close button is visible and actionable.
66
70
  * If either property true, this page tab's context menu will disable its 'Close Page' option.
67
71
  */
@@ -124,17 +128,21 @@ export interface ReorderPagesForWindowPayload {
124
128
  /** The ordered ids of the attached pages. */
125
129
  pageIds: string[];
126
130
  }
131
+ /** Page fields for update payloads. `null` signals "clear this field" over IPC (null survives JSON serialization, undefined does not). */
132
+ type PageUpdateNullableOverrides = {
133
+ pinned?: PagePinnedState | null;
134
+ };
127
135
  export interface UpdatePageForWindowPayload {
128
136
  /** The OF window identity the pages to change the order of. */
129
137
  identity: OpenFin.Identity;
130
138
  /** The id of the attached page to update. */
131
139
  pageId: string;
132
140
  /** The partial updated state of the page. */
133
- page: Partial<PageWithUpdatableRuntimeAttribs>;
141
+ page: Omit<Partial<PageWithUpdatableRuntimeAttribs>, 'pinned'> & PageUpdateNullableOverrides;
134
142
  }
135
143
  export interface ExtendedUpdatePageForWindowPayload extends UpdatePageForWindowPayload {
136
144
  /** The partial updated state of the page. */
137
- page: Partial<AttachedPage>;
145
+ page: Omit<Partial<AttachedPage>, 'pinned'> & PageUpdateNullableOverrides;
138
146
  }
139
147
  export interface AttachPagesToWindowPayload {
140
148
  /** The OF window identity to attach the pages to. */
@@ -0,0 +1,46 @@
1
+ import type { BaseThemeOptions, CustomPaletteSet, CustomTheme, CustomThemes, GeneratedPalettes, GenerateThemeParams } from './theming';
2
+ export declare const assignIfDefined: (target: Record<string, unknown>, key: string, value: unknown) => void;
3
+ /**
4
+ * Maps a legacy palette-based theme to theme-engine seed + overrides.
5
+ *
6
+ * Legacy themes use `palette` (single scheme) or `palettes` (light/dark) with
7
+ * explicit color values. This function translates those values into the dotted
8
+ * token paths that `generateTheme` expects.
9
+ *
10
+ * Mapping reference: https://www.figma.com/design/bUbUpAHJl8xGEtFbpYZ5z3/Theme?node-id=0-1&p=f&m=dev
11
+ */
12
+ export declare const mapLegacyThemeToCustomTheme: (legacyTheme: CustomTheme) => GenerateThemeParams;
13
+ /**
14
+ * Reverse of mapLegacyThemeToCustomTheme.
15
+ * Takes the resolved token maps from a generated theme and maps them back to the
16
+ * legacy CustomPaletteSet shape so that workspace apps still on the legacy theme
17
+ * system can consume them.
18
+ */
19
+ export declare const mapGeneratedPalettesToLegacyPalettes: (generatedPalettes: GeneratedPalettes) => {
20
+ light: CustomPaletteSet;
21
+ dark: CustomPaletteSet;
22
+ };
23
+ export declare const mapLegacyBrandIcons: (legacyBrand: BaseThemeOptions["brand"]) => GenerateThemeParams[1];
24
+ /**
25
+ * Converts legacy CustomThemes (from old workspace platforms v23.0.22 and earlier)
26
+ * into GeneratedPalettes with toCSS() methods and a ready-to-inject palette sheet.
27
+ *
28
+ * This is the backward-compatibility bridge: when a new workspace app (home, dock,
29
+ * storefront) discovers it's running against a legacy platform — detected by
30
+ * `getGeneratedPalettes()` throwing because the channel action doesn't exist —
31
+ * it calls `getThemes()` to retrieve the old-format themes and runs them through
32
+ * this function to produce the same output the new pipeline expects.
33
+ *
34
+ * The conversion mirrors `initialiseStoragePalettes` in client-api-platform but
35
+ * omits storage controller side-effects (setPalettes, setThemePaletteSheet) since
36
+ * those belong to the platform init path, not the workspace app consumption path.
37
+ *
38
+ * Theme shape discrimination:
39
+ * - `palette`: single palette applied to both schemes (legacy single-scheme theme)
40
+ * - `palettes`: explicit light/dark palettes (legacy dual-scheme theme)
41
+ * - `seed`: already a token-based theme (should not reach this path, but handled for safety)
42
+ */
43
+ export declare const convertLegacyThemesToGeneratedPalettes: (themes: CustomThemes | null | undefined) => {
44
+ generatedPalettes: GeneratedPalettes;
45
+ themePaletteSheet: string;
46
+ };
@@ -1,4 +1,5 @@
1
1
  import type OpenFin from '@openfin/core';
2
+ import type { PagePinnedState } from '../../../common/src/api/pages/shapes';
2
3
  import { WindowIdentity } from '../../../common/src/utils/window';
3
4
  import { AttachedPage, PageLayout } from '../../../client-api-platform/src/shapes';
4
5
  export type LayoutDOMEventType =
@@ -91,12 +92,6 @@ export declare const generateViewNameAndIdentifierNameIfNotExists: <T extends {
91
92
  */
92
93
  export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<OpenFin.ViewOptions>) => Promise<PageLayout>;
93
94
  export declare const cloneViewComponentWithoutName: (componentState: any) => any;
94
- /**
95
- * Deep clones a layout and removes view names.
96
- * @param layout The Layout to be cloned
97
- * @returns A copy of the layout with names removed
98
- */
99
- export declare const cloneLayoutAndRemoveNames: (layout: PageLayout) => any;
100
95
  /**
101
96
  * Deep clones a layout and removes generated view names.
102
97
  * @param layout The Layout to be cloned
@@ -121,6 +116,14 @@ export declare const cleanupLayoutObservers: (layoutName: string) => void;
121
116
  * Initialize the layout for the current OF window.
122
117
  */
123
118
  export declare const initLayoutListeners: () => Promise<void>;
119
+ /**
120
+ * Returns true when a page's in-page layout should be locked.
121
+ * This applies for user-locked pages (`isLocked`) and platform-pinned pages (`pinned === 'platform'`).
122
+ */
123
+ export declare const isPageLayoutLocked: (page: {
124
+ isLocked?: boolean;
125
+ pinned?: PagePinnedState;
126
+ }) => boolean;
124
127
  /**
125
128
  * Deep clones a layout and changes its settings to make it "locked".
126
129
  * @param layout The Layout to be locked
@@ -113,12 +113,31 @@ export type RenameSupertabChannelMessage = BasePopupMenuChannelMessage & {
113
113
  pageId: string;
114
114
  };
115
115
  };
116
+ /**
117
+ * A row in the tab search list. {@link showPin} / {@link showUnpin} are optional; when omitted, no row action.
118
+ */
119
+ export type TabSearchListItem = {
120
+ id: string;
121
+ title: string;
122
+ /** When true, show a control to pin (move to the user page group). Core UI + ungrouped only. */
123
+ showPin?: boolean;
124
+ /** When true, show a control to unpin (leave the user page group). */
125
+ showUnpin?: boolean;
126
+ /**
127
+ * When true, show a non-interactive lock (workspace / platform locked); ungrouped pages only.
128
+ * Mutually exclusive with {@link showPin} in the browser; does not replace {@link showUnpin}.
129
+ */
130
+ showPlatformLocked?: boolean;
131
+ };
116
132
  export type TabSearchModalContent = {
117
133
  variant: 'page' | 'view';
118
- tabs: {
119
- title: string;
120
- id: string;
121
- }[];
134
+ tabs: TabSearchListItem[];
135
+ };
136
+ /** Channel action: browser → tab-search popup; refreshes list rows after pin/unpin while open. */
137
+ export declare const TAB_SEARCH_CHANNEL_ACTION_UPDATE_TABS: "update-tabs";
138
+ export type TabSearchUpdateTabsMessage = {
139
+ requestId: string;
140
+ tabs: TabSearchListItem[];
122
141
  };
123
142
  export type TabSearchChannelMessage = BasePopupMenuChannelMessage & {
124
143
  type: PopupWindowMenuType.TabSearch;