@openfin/workspace-platform 16.0.9 → 16.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.
@@ -0,0 +1,4 @@
1
+ import type OpenFin from '@openfin/core';
2
+ type ComponentNames = 'home' | 'dock' | 'store';
3
+ export declare const setupComponentPerformance: (component: ComponentNames, componentWindowIdentity: OpenFin.Identity) => void;
4
+ export {};
@@ -204,12 +204,15 @@ string | {
204
204
  */
205
205
  dark: string;
206
206
  };
207
- export type ContactInfoButtons = {
208
- type: 'button';
207
+ export type SplitButtonOption = {
208
+ /**
209
+ * The label that appears on the button.
210
+ */
211
+ label?: string;
209
212
  /**
210
213
  * The icon to display on the button.
211
214
  */
212
- icon: ButtonIcon;
215
+ icon?: ButtonIcon;
213
216
  /**
214
217
  * The tooltip to display on the button.
215
218
  */
@@ -218,8 +221,12 @@ export type ContactInfoButtons = {
218
221
  * The action to execute when the button is clicked.
219
222
  */
220
223
  action: string;
221
- } | {
222
- type: 'dropdown';
224
+ };
225
+ export type SplitButton = {
226
+ /**
227
+ * The label that appears on the button.
228
+ */
229
+ label?: string;
223
230
  /**
224
231
  * The icon to display on the button.
225
232
  */
@@ -231,25 +238,29 @@ export type ContactInfoButtons = {
231
238
  /**
232
239
  * The action to execute when the button is clicked.
233
240
  */
234
- action?: string;
241
+ action: string;
235
242
  /**
236
243
  * The list of options to display in the dropdown.
237
244
  */
238
- options: {
239
- /**
240
- * The icon to display on the button.
241
- */
242
- icon?: ButtonIcon;
243
- /**
244
- * The tooltip to display on the button.
245
- */
246
- tooltip: string;
247
- /**
248
- * The action to execute when the button is clicked.
249
- */
250
- action: string;
251
- }[];
245
+ options: SplitButtonOption[];
252
246
  };
247
+ export type ContactInfoButtons = {
248
+ type: 'button';
249
+ /**
250
+ * The icon to display on the button.
251
+ */
252
+ icon: ButtonIcon;
253
+ /**
254
+ * The tooltip to display on the button.
255
+ */
256
+ tooltip: string;
257
+ /**
258
+ * The action to execute when the button is clicked.
259
+ */
260
+ action: string;
261
+ } | (SplitButton & {
262
+ type: 'dropdown';
263
+ });
253
264
  /**
254
265
  * Contact Info Search Result
255
266
  */
@@ -3,18 +3,20 @@
3
3
  *
4
4
  * @module Templates
5
5
  */
6
+ import { SplitButton as SplitButtonTemplateData } from './home';
6
7
  export type ListPairs = [string, string][];
7
- export type CustomTemplateData = Record<string, string | ListPairs>;
8
- export type ContainerFragmentTypes = PlainContainerTemplateFragment | ButtonTemplateFragment;
8
+ export type CustomTemplateData = Record<string, string | ListPairs | SplitButtonTemplateData>;
9
+ export type ContainerFragmentTypes = PlainContainerTemplateFragment | ButtonTemplateFragment | SplitButtonFragment;
9
10
  export type PresentationFragmentTypes = TextTemplateFragment | ImageTemplateFragment | ListTemplateFragment;
10
11
  export type InteractiveFragmentTypes = ButtonTemplateFragment | TextTemplateFragment | ImageTemplateFragment;
11
12
  /**
12
13
  * The options to build your custom template composition layout.
13
14
  */
14
- export type TemplateFragment = PlainContainerTemplateFragment | ButtonTemplateFragment | TextTemplateFragment | ListTemplateFragment | ImageTemplateFragment;
15
+ export type TemplateFragment = PlainContainerTemplateFragment | ButtonTemplateFragment | TextTemplateFragment | ListTemplateFragment | ImageTemplateFragment | SplitButtonFragment;
15
16
  export declare const ContainerTemplateFragmentNames: {
16
17
  readonly Container: "Container";
17
18
  readonly Button: "Button";
19
+ readonly SplitButton: "SplitButton";
18
20
  };
19
21
  export declare const PresentationTemplateFragmentNames: {
20
22
  readonly Text: "Text";
@@ -27,6 +29,7 @@ export declare const TemplateFragmentTypes: {
27
29
  readonly List: "List";
28
30
  readonly Container: "Container";
29
31
  readonly Button: "Button";
32
+ readonly SplitButton: "SplitButton";
30
33
  };
31
34
  export interface BaseTemplateFragment<T extends keyof typeof TemplateFragmentTypes> {
32
35
  /**
@@ -115,6 +118,55 @@ export type ButtonTemplateFragment = ContainerTemplateFragment<'Button'> & Fragm
115
118
  */
116
119
  buttonStyle?: ButtonStyle;
117
120
  };
121
+ export type SplitButtonFragment = ContainerTemplateFragment<'SplitButton'> & {
122
+ /**
123
+ * The type of button that determines styling.
124
+ */
125
+ buttonType: 'primary' | 'secondary';
126
+ /**
127
+ * Data key of the template fragment.
128
+ *
129
+ * The data associated with this fragment will be looked up in `templateData` map with this key.
130
+ *
131
+ * Example:
132
+ * ```ts
133
+ * const myTemplateLayout = {
134
+ * type: FragmentTypes.SplitButton,
135
+ * buttonType: 'primary',
136
+ * dataKey: 'splitButton1',
137
+ * }
138
+ *
139
+ * const searchResult: CLISearchResultCustom = {
140
+ * //...
141
+ * template: CLITemplate.Custom,
142
+ * templateContent: {
143
+ * layout: myTemplateLayout,
144
+ * data: {
145
+ * splitButton1: {
146
+ * label: 'Split Button 1',
147
+ * tooltip: 'Click me',
148
+ * icon: 'iconURL',
149
+ * action: 'primaryAction',
150
+ * options: [
151
+ * {
152
+ * label: 'Menu Option 1',
153
+ * tooltip: 'Click for optionAction1',
154
+ * action: 'optionAction1'
155
+ * },
156
+ * {
157
+ * label: 'Menu Option 2',
158
+ * tooltip: 'Click for optionAction2',
159
+ * action: 'optionAction1'
160
+ * }
161
+ * ]
162
+ * }
163
+ * }
164
+ * };
165
+ * ```
166
+ *
167
+ */
168
+ dataKey: string;
169
+ };
118
170
  export type TextTemplateFragment = PresentationTemplateFragment<'Text'> & FragmentAction;
119
171
  export type ImageTemplateFragment = PresentationTemplateFragment<'Image'> & FragmentAction & {
120
172
  /**
@@ -1,6 +1,6 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import type { AttachedPage, DetachPagesFromWindowPayload, ExtendedAttachPagesToWindowPayload, ReorderPagesForWindowPayload, SetActivePageForWindowPayload, UpdatePageForWindowPayload } from '../../../../common/src/api/pages/shapes';
3
- import type { CreateSavedPageRequest, Page, UpdateSavedPageRequest } from '../../../../client-api-platform/src/shapes';
2
+ import type { AttachedPage, CopyPagePayload, DetachPagesFromWindowPayload, ExtendedAttachPagesToWindowPayload, HandleSaveModalOnPageClosePayload, ReorderPagesForWindowPayload, SaveModalOnPageCloseResult, SetActivePageForWindowPayload, UpdatePageForWindowPayload } from '../../../../common/src/api/pages/shapes';
3
+ import type { CreateSavedPageRequest, HandlePageChangesPayload, ModifiedPageState, Page, UpdateSavedPageRequest } from '../../../../client-api-platform/src/shapes';
4
4
  /**
5
5
  * Get all open pages in which are attached to a window.
6
6
  * @returns the list of attached pages.
@@ -30,3 +30,6 @@ export declare const getActivePageIdForWindow: (identity: OpenFin.Identity) => P
30
30
  * @returns string: a unique page name
31
31
  */
32
32
  export declare function getUniquePageTitle(initialName?: string): Promise<string>;
33
+ export declare function handleSaveModalOnPageClose({ page }: HandleSaveModalOnPageClosePayload): Promise<SaveModalOnPageCloseResult>;
34
+ export declare function copyPageOverride({ page }: CopyPagePayload): Promise<Page>;
35
+ export declare function handlePageChanges(payload: HandlePageChangesPayload): Promise<ModifiedPageState>;
@@ -2,7 +2,8 @@ import type OpenFin from '@openfin/core';
2
2
  import { IconProps } from '@openfin/ui-library';
3
3
  import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
4
4
  import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
5
- import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
5
+ import type { AttachedPage, CopyPagePayload, HandleSaveModalOnPageClosePayload, Page, PageWithUpdatableRuntimeAttribs, SaveModalOnPageCloseResult } from '../../common/src/api/pages/shapes';
6
+ import { SetActivePageForWindowPayload } from '../../common/src/api/pages/shapes';
6
7
  import type { CustomThemes } from '../../common/src/api/theming';
7
8
  import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
8
9
  import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
@@ -11,7 +12,7 @@ export type { App, AppIntent, Image } from '../../client-api/src/shapes';
11
12
  export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
12
13
  export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig } from '../../common/src/api/pages/shapes';
13
14
  export { PanelPosition } from '../../common/src/api/pages/shapes';
14
- export type { CustomThemes, CustomThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet } from '../../common/src/api/theming';
15
+ export type { CustomThemes, CustomThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemePaletteSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
15
16
  export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
16
17
  export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
17
18
  /**
@@ -30,6 +31,15 @@ export interface UpdateSavedPageRequest {
30
31
  /** The updated page. */
31
32
  page: Page;
32
33
  }
34
+ export interface HandlePageChangesPayload {
35
+ /** The page with new changes. */
36
+ page: AttachedPage;
37
+ /** The OF window identity containing the page. */
38
+ identity: OpenFin.Identity;
39
+ }
40
+ export interface ModifiedPageState {
41
+ hasUnsavedChanges?: boolean;
42
+ }
33
43
  /**
34
44
  * Request for reordering the pages attached to a window.
35
45
  */
@@ -339,7 +349,7 @@ export interface CustomBrowserButtonConfig extends CustomButtonConfig {
339
349
  */
340
350
  export interface PreDefinedButtonConfig {
341
351
  /** Type of default browser button */
342
- type: BrowserButtonType;
352
+ type: Exclude<BrowserButtonType, BrowserButtonType.ShowHideTabs | BrowserButtonType.LockUnlockPage | BrowserButtonType.Custom>;
343
353
  /** Button name text when hovered over */
344
354
  tooltip?: string;
345
355
  /** icon URL for icon image */
@@ -361,6 +371,30 @@ export interface PreDefinedButtonConfig {
361
371
  export type ShowHideTabsConfig = {
362
372
  type: BrowserButtonType.ShowHideTabs;
363
373
  disabled?: boolean;
374
+ tabsShownIconUrl?: {
375
+ /**
376
+ * The URL of the icon to display when the button is disabled and tabs are hidden.
377
+ *
378
+ * The button is disabled when the page is locked.
379
+ */
380
+ disabled?: string;
381
+ /**
382
+ * The URL of the icon to display when the button is enabled and tabs are hidden.
383
+ */
384
+ enabled?: string;
385
+ };
386
+ tabsHiddenIconUrl?: {
387
+ /**
388
+ * The URL of the icon to display when the button is disabled and tabs are hidden.
389
+ *
390
+ * The button is disabled when the page is locked.
391
+ */
392
+ disabled?: string;
393
+ /**
394
+ * The URL of the icon to display when the button is enabled and tabs are hidden.
395
+ */
396
+ enabled?: string;
397
+ };
364
398
  };
365
399
  /**
366
400
  * Configuration Object for the page lock/unlock button within the browser toolbar
@@ -376,6 +410,8 @@ export type ShowHideTabsConfig = {
376
410
  export type LockUnlockPageConfig = {
377
411
  type: BrowserButtonType.LockUnlockPage;
378
412
  disabled?: boolean;
413
+ lockedIconUrl?: string;
414
+ unlockedIconUrl?: string;
379
415
  };
380
416
  /**
381
417
  * Buttons on the left of WindowStateButtonOptions
@@ -1261,6 +1297,11 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1261
1297
  * @param id of the id of the page to delete.
1262
1298
  */
1263
1299
  deleteSavedPage(id: string): Promise<void>;
1300
+ /**
1301
+ * Implementation for detecting if a page change qualifies as putting the page in an unsaved state.
1302
+ * @param payload the page with new changes and the identity of the OF window where the page change occured.
1303
+ */
1304
+ handlePageChanges(payload: HandlePageChangesPayload): Promise<ModifiedPageState>;
1264
1305
  /**
1265
1306
  * Implementation for getting a list of saved workspaces from persistent storage.
1266
1307
  * @param query an optional query.
@@ -1347,6 +1388,21 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
1347
1388
  * @param req the payload received by the provider
1348
1389
  */
1349
1390
  handleAnalytics(req: AnalyticsEvent[]): Promise<void>;
1391
+ /**
1392
+ * Implementation for deciding whether a modal informing about loss of unsaved changes will be displayed when closing a page.
1393
+ * The default implementation returns `{ shouldShowModal: true }` if the page has unsaved changes (`hasUnsavedChanges` page property)
1394
+ * and `false` otherwise.
1395
+ */
1396
+ handleSaveModalOnPageClose(payload: HandleSaveModalOnPageClosePayload): Promise<SaveModalOnPageCloseResult>;
1397
+ /**
1398
+ * Implementation for setting the active page in a browser window.
1399
+ * Called when the active page is changed and on browser window creation.
1400
+ */
1401
+ setActivePage(payload: SetActivePageForWindowPayload): Promise<void>;
1402
+ /**
1403
+ * Implementation for creating a copy of a page. Called when a page is Saved-As or Duplicated.
1404
+ */
1405
+ copyPage(payload: CopyPagePayload): Promise<Page>;
1350
1406
  }
1351
1407
  /**
1352
1408
  * The origins from which a custom action can be invoked
@@ -187,4 +187,22 @@ export type PanelConfig = (PanelConfigHorizontal | PanelConfigVertical) & {
187
187
  export type ExtendedPanelConfig = PanelConfig & {
188
188
  viewOptions: PanelConfig['viewOptions'] & OpenFin.Identity;
189
189
  };
190
+ export interface HandleSaveModalOnPageClosePayload {
191
+ /** The page that is closing. */
192
+ page: AttachedPage;
193
+ /** The OF window identity containing the page. */
194
+ identity: OpenFin.Identity;
195
+ }
196
+ export interface SaveModalOnPageCloseResult {
197
+ /** If false, a modal informing that unsaved changes will be lost will not be displayed. */
198
+ shouldShowModal: boolean;
199
+ }
200
+ export interface CopyPagePayload {
201
+ /** The OF browser identity containing the page to copy. */
202
+ identity: OpenFin.Identity;
203
+ /** The page to copy. */
204
+ page: Page;
205
+ /** Specifies the trigger for creating a copy. */
206
+ reason: 'save-as' | 'duplicate';
207
+ }
190
208
  export {};
@@ -53,7 +53,10 @@ export declare enum WorkspacePlatformChannelAction {
53
53
  IsBrowserInitialized = "isBrowserInitialized",
54
54
  Analytics = "analyticsInternal",
55
55
  GetDockProviderConfig = "getDockProviderConfig",
56
- SaveDockProviderConfig = "saveDockProviderConfig"
56
+ SaveDockProviderConfig = "saveDockProviderConfig",
57
+ HandleSaveModalOnPageClose = "handleSaveModalOnPageClose",
58
+ CopyPage = "copyPage",
59
+ HandlePageChanges = "handlePageChanges"
57
60
  }
58
61
  export type PlatFormSupportedFeatures = boolean | {
59
62
  isWorkspacePlatform: boolean;
@@ -1,3 +1,4 @@
1
+ import type { DefaultTheme } from 'styled-components';
1
2
  import type OpenFin from '@openfin/core';
2
3
  import type { ThemePaletteSet } from '@openfin/ui-library';
3
4
  import { ColorSchemeOptionType } from '../../../client-api-platform/src/shapes';
@@ -5,20 +6,65 @@ export type WorkspaceComponentSetSelectedSchemePayload = {
5
6
  newScheme: ColorSchemeOptionType;
6
7
  identity: OpenFin.Identity;
7
8
  };
8
- export type BrowserSetSelectedSchemePayload = string;
9
9
  export type ComputedThemes = ComputedTheme[];
10
10
  export interface ComputedTheme {
11
11
  label: string;
12
12
  logoUrl?: string;
13
- theme: ThemePaletteSet;
13
+ theme: WorkspaceThemePaletteSet;
14
14
  defaultScheme?: ColorSchemeOptionType;
15
15
  }
16
- interface BaseThemeOptions {
16
+ export interface WorkspaceThemePaletteSet extends ThemePaletteSet {
17
+ light: ThemeExtension;
18
+ dark: ThemeExtension;
19
+ }
20
+ export interface ThemeExtension extends DefaultTheme {
21
+ notificationIndicatorColors?: Record<string, Omit<NotificationIndicatorColorsSet, 'foreground'> & {
22
+ foreground: string;
23
+ }>;
24
+ }
25
+ export interface NotificationIndicatorColorsSet {
26
+ background: string;
27
+ foreground?: string;
28
+ }
29
+ export interface NotificationIndicatorColorsSetDarkScheme {
30
+ dark: NotificationIndicatorColorsSet;
31
+ light?: NotificationIndicatorColorsSet;
32
+ }
33
+ export interface NotificationIndicatorColorsSetLightScheme {
34
+ dark?: NotificationIndicatorColorsSet;
35
+ light: NotificationIndicatorColorsSet;
36
+ }
37
+ export type NotificationIndicatorColorsWithScheme = Record<string, NotificationIndicatorColorsSetDarkScheme | NotificationIndicatorColorsSetLightScheme>;
38
+ export interface BaseThemeOptions {
17
39
  label: string;
18
40
  logoUrl?: string;
19
41
  }
20
42
  export interface CustomThemeOptions extends BaseThemeOptions {
21
43
  palette: CustomPaletteSet;
44
+ /**
45
+ * NOTE: Only used in Notifications
46
+ *
47
+ * Used for providing color overrides of notification indicators or defining custom colors that clients could target.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const themeOptions = {
52
+ * default: 'light',
53
+ * palettes: {...}
54
+ * notificationIndicatorColors: {
55
+ * red: {
56
+ * background: '#FF0000',
57
+ * foreground: '#FFFFDD'
58
+ * },
59
+ * customred: {
60
+ * // If `foreground` is not defined it will default to `#FFFFFF`
61
+ * background: '#FF0011'
62
+ * }
63
+ * }
64
+ * };
65
+ * ```
66
+ */
67
+ notificationIndicatorColors?: Record<string, NotificationIndicatorColorsSet>;
22
68
  }
23
69
  export interface CustomThemeOptionsWithScheme extends BaseThemeOptions {
24
70
  /**
@@ -40,6 +86,39 @@ export interface CustomThemeOptionsWithScheme extends BaseThemeOptions {
40
86
  light: CustomPaletteSet;
41
87
  dark: CustomPaletteSet;
42
88
  };
89
+ /**
90
+ * NOTE: Only used in Notifications
91
+ *
92
+ * Used for providing color overrides of notification indicators or defining custom colors that clients could target.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const themeOptions = {
97
+ * default: 'light',
98
+ * palettes: {...}
99
+ * notificationIndicatorColors: {
100
+ * red: {
101
+ * dark: {
102
+ * background: '#FF0000',
103
+ * foreground: '#FFFFDD'
104
+ * },
105
+ * light: {
106
+ * // If `foreground` is not defined it will default to `#FFFFFF`
107
+ * background: '#FF1100',
108
+ * }
109
+ * },
110
+ * customred: {
111
+ * // If one of the schemes is not defined (in this case `light`) the values from the defined one will be copied to the other
112
+ * dark: {
113
+ * background: '#FF0011',
114
+ * foreground: '#FFDDDD'
115
+ * }
116
+ * }
117
+ * }
118
+ * };
119
+ * ```
120
+ */
121
+ notificationIndicatorColors?: NotificationIndicatorColorsWithScheme;
43
122
  }
44
123
  export type CustomThemes = (CustomThemeOptions | CustomThemeOptionsWithScheme)[];
45
124
  export interface DefaultPaletteSet {
@@ -97,16 +176,69 @@ export interface CustomPaletteSet extends DefaultPaletteSet {
97
176
  linkDefault?: string;
98
177
  linkHover?: string;
99
178
  }
179
+ export declare const OpenFinLightTheme: {
180
+ background1: "#FFFFFF";
181
+ background2: "#FAFBFE";
182
+ background3: "#F3F5F8";
183
+ background4: "#ECEEF1";
184
+ background5: "#DDDFE4";
185
+ background6: "#C9CBD2";
186
+ brandSecondary: "#1E1F23";
187
+ inputBackground: "#ECEEF1";
188
+ inputColor: "#1E1F23";
189
+ inputPlaceholder: "#383A40";
190
+ inputDisabled: "#7D808A";
191
+ inputFocused: "#C9CBD2";
192
+ inputBorder: "#7D808A";
193
+ textDefault: "#1E1F23";
194
+ textHelp: "#2F3136";
195
+ textInactive: "#7D808A";
196
+ brandPrimary: string;
197
+ statusSuccess: "#207735";
198
+ statusWarning: "#F48F00";
199
+ statusCritical: "#F31818";
200
+ statusActive: "#0A76D3";
201
+ contentBackground1: string;
202
+ contentBackground2: string;
203
+ contentBackground3: string;
204
+ contentBackground4: string;
205
+ contentBackground5: string;
206
+ };
207
+ export declare const OpenFinDarkTheme: {
208
+ background1: "#111214";
209
+ background2: "#1E1F23";
210
+ background3: "#24262B";
211
+ background4: "#2F3136";
212
+ background5: "#383A40";
213
+ background6: "#53565F";
214
+ brandSecondary: "#383A40";
215
+ inputBackground: "#53565F";
216
+ inputColor: "#FFFFFF";
217
+ inputPlaceholder: "#C9CBD2";
218
+ inputDisabled: "#7D808A";
219
+ inputFocused: "#C9CBD2";
220
+ inputBorder: "#7D808A";
221
+ textDefault: "#FFFFFF";
222
+ textHelp: "#C9CBD2";
223
+ textInactive: "#7D808A";
224
+ brandPrimary: string;
225
+ statusSuccess: "#207735";
226
+ statusWarning: "#F48F00";
227
+ statusCritical: "#F31818";
228
+ statusActive: "#0A76D3";
229
+ contentBackground1: string;
230
+ contentBackground2: string;
231
+ contentBackground3: string;
232
+ contentBackground4: string;
233
+ contentBackground5: string;
234
+ };
100
235
  /**
101
- * computeThemes()
102
- * Accepts the array of registered CustomThemes objects
103
- * Creates a light and dark palette from a tempalte overriding with custom options
104
- * Uses createTheme to build theme object
105
- * Creates a ThemePaletteSet
106
- * @param customPalettes
107
- * @returns theme object ready to be applied to the UI
236
+ * Transforms input {@link CustomThemes} to {@link ComputedThemes} used by Workspace Platform / Notifications Platform.
237
+ *
238
+ * @param customThemes array of themes to transform
239
+ * @param storedScheme sets the default scheme if provided
240
+ * @returns array of {@link ComputedThemes | computed themes}
108
241
  */
109
- export declare const computeThemes: (customPalettes: CustomThemes, storedScheme?: ColorSchemeOptionType) => ComputedThemes;
242
+ export declare const computeThemes: (customThemes: CustomThemes, storedScheme?: ColorSchemeOptionType) => ComputedThemes;
110
243
  export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<ComputedTheme>;
111
244
  export declare const setSelectedScheme: (ctx: ColorSchemeOptionType) => Promise<void>;
112
- export {};
@@ -1,22 +1,39 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  import type { OptionalExceptFor } from '../../../common/src/utils/types';
3
- export interface ModalResponseContent {
4
- title: string;
5
- body: string;
6
- affirmativeButton: string;
7
- negativeButton?: string;
8
- canceledButton?: string;
9
- }
10
3
  export interface MenuConfig {
11
4
  windowOptions: OptionalExceptFor<OpenFin.WindowOptions, 'url' | 'name' | 'defaultHeight' | 'defaultWidth'>;
12
5
  title: string;
13
6
  }
14
- export interface ResponseModalConfig extends MenuConfig {
15
- content: ModalResponseContent;
16
- }
17
7
  export interface RightMenuConfig extends MenuConfig {
18
8
  windowOffset?: {
19
9
  x?: number;
20
10
  y?: number;
21
11
  };
22
12
  }
13
+ export interface ResponseModalConfig extends MenuConfig {
14
+ content: ResponseModalContent;
15
+ }
16
+ export interface ResponseModalContent {
17
+ title: string;
18
+ body: string;
19
+ closeType?: 'page' | 'workspace';
20
+ buttons: ResponseModalButtons;
21
+ textInputOptions?: {
22
+ placeholder?: string;
23
+ defaultValue?: string;
24
+ };
25
+ invocationId?: string;
26
+ }
27
+ export type ResponseModalButtons = LeftButtonConfig | RightButtonConfig;
28
+ export interface LeftButtonConfig {
29
+ left: ButtonConfig[];
30
+ right?: ButtonConfig[];
31
+ }
32
+ export interface RightButtonConfig {
33
+ left?: ButtonConfig[];
34
+ right: ButtonConfig[];
35
+ }
36
+ export type ButtonConfig = {
37
+ label: string;
38
+ type: 'primary' | 'secondary';
39
+ };
@@ -1,5 +1,5 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import { ModalResponseContent } from '../../../common/src/utils/menu-config';
2
+ import { ResponseModalContent } from '../../../common/src/utils/menu-config';
3
3
  import type { OptionalExceptFor } from '../../../common/src/utils/types';
4
4
  type MenuEventTypes = {
5
5
  response: [ModalResponseEvent];
@@ -7,7 +7,12 @@ type MenuEventTypes = {
7
7
  update: [string, Partial<OpenFin.Bounds>, string];
8
8
  };
9
9
  export interface ModalResponseEvent {
10
- data: 'canceled' | 'negative' | 'affirmative';
10
+ data: {
11
+ actionName: string;
12
+ data?: {
13
+ textInputValue?: string;
14
+ };
15
+ };
11
16
  name: string;
12
17
  }
13
18
  export declare const menuEvents: {
@@ -28,7 +33,7 @@ export interface ShowChildOptions {
28
33
  }
29
34
  export interface ResponseModalOptions {
30
35
  options: WindowOptionsWithBounds;
31
- content: ModalResponseContent;
36
+ content: ResponseModalContent;
32
37
  }
33
38
  export declare function createMenuPosition(windowOptions: OptionalExceptFor<OpenFin.WindowOptions, 'x' | 'y' | 'defaultWidth'>): Promise<{
34
39
  top: number;
@@ -1,13 +1,16 @@
1
- type WorkspacePerformanceMarks = 'home-registration' | 'dock-registration' | 'store-registration';
1
+ export declare const workspacePerformancePrefix = "of-workspace-";
2
+ type WorkspacePerformanceMarks = 'home-registration' | 'dock-registration' | 'store-registration' | 'home-show' | 'dock-show' | 'store-show' | 'workspace-app-started' | 'home-window-initialized' | 'dock-window-initialized' | 'store-window-initialized';
2
3
  /**
3
4
  * @classdesc
4
5
  * WorkspacePerformance is a class that provides a set of methods to measure performance of workspace
5
6
  *
6
7
  */
7
8
  declare class WorkspacePerformance {
9
+ mark(markName: WorkspacePerformanceMarks): void;
8
10
  markStart(markName: WorkspacePerformanceMarks): void;
9
11
  markEnd(markName: WorkspacePerformanceMarks): void;
10
- markEndAndMeasure(markName: WorkspacePerformanceMarks): void;
12
+ markEndAndMeasure(markName: WorkspacePerformanceMarks): PerformanceMeasure;
13
+ markAndMeasure(markName: WorkspacePerformanceMarks, measureAgainst: WorkspacePerformanceMarks): PerformanceMeasure;
11
14
  reportWorkspacePerformanceEntries(): PerformanceEntry[];
12
15
  reportWorkspacePerformance(): {
13
16
  name: string;
@@ -17,6 +17,7 @@ export declare enum PageRoute {
17
17
  BrowserPopupMenuColorLinking = "/browser/popup-menu/color-linking/color-linking/",
18
18
  BrowserIndicator = "/browser/indicator/",
19
19
  ResponseModal = "/browser/popup-menu/response-modal/",
20
+ CloseConfirmationModal = "/browser/popup-menu/close-confirmation-modal/",
20
21
  Docs = "/provider/docs/",
21
22
  Storefront = "/storefront/",
22
23
  DeprecatedAlert = "/provider/deprecated-alert/",