@openfin/workspace-platform 14.1.0 → 14.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.
- package/README.md +6 -6
- package/client-api/src/dock.d.ts +1 -1
- package/client-api/src/internal/home/handlers/index.d.ts +2 -1
- package/client-api-platform/src/init/browser-base-url.d.ts +6 -0
- package/client-api-platform/src/init/browser-base-url.test.d.ts +1 -0
- package/client-api-platform/src/shapes.d.ts +2 -0
- package/common/src/api/overrides.d.ts +1 -0
- package/common/src/api/protocol/browser.d.ts +4 -2
- package/common/src/api/protocol/workspace.d.ts +2 -1
- package/common/src/api/search/common.d.ts +1 -1
- package/common/src/utils/channels.d.ts +4 -1
- package/common/src/utils/indicators/browser.d.ts +14 -3
- package/common/src/utils/performance.d.ts +18 -0
- package/index.js +132 -47
- package/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Run `npm i -E @openfin/workspace-platform`.
|
|
|
14
14
|
|
|
15
15
|
## Code examples
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### Initialize a Workspace Platform
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
@@ -23,10 +23,10 @@ const customThemes: WorkspacePlatform.CustomThemes = [
|
|
|
23
23
|
{
|
|
24
24
|
label: "OpenFin's Custom Theme",
|
|
25
25
|
palette: {
|
|
26
|
-
brandPrimary:
|
|
27
|
-
brandSecondary:
|
|
28
|
-
backgroundPrimary:
|
|
29
|
-
background2:
|
|
26
|
+
brandPrimary: '#F51F63', // required
|
|
27
|
+
brandSecondary: '#1FF58A', // required
|
|
28
|
+
backgroundPrimary: '#F8E71C', // required - hex, rgb/rgba, hsl/hsla only - no string colors: ‘red’
|
|
29
|
+
background2: '#7D808A' // any of the optional colors
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
];
|
|
@@ -42,7 +42,7 @@ const overrideCallback: WorkspacePlatform.WorkspacePlatformOverrideCallback = as
|
|
|
42
42
|
|
|
43
43
|
await WorkspacePlatform.init({
|
|
44
44
|
browser: {
|
|
45
|
-
title:
|
|
45
|
+
title: 'My Browser'
|
|
46
46
|
},
|
|
47
47
|
overrideCallback,
|
|
48
48
|
theme: customThemes
|
package/client-api/src/dock.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { withDisconnectListener } from '../../../../../common/src/utils/channels';
|
|
1
2
|
import { SearchAPIClientChannelClient } from '../../../../../common/src/api/protocol/shapes/search';
|
|
2
|
-
type HomeWorkspaceAPIClientChannelClient = SearchAPIClientChannelClient & {
|
|
3
|
+
type HomeWorkspaceAPIClientChannelClient = withDisconnectListener<SearchAPIClientChannelClient> & {
|
|
3
4
|
homeChannelActionsRegistered?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare function registerHomeChannelClientActions(channel: HomeWorkspaceAPIClientChannelClient): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1455,6 +1455,8 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1455
1455
|
/**
|
|
1456
1456
|
* Customize the Looks and Feel of the Workspace Platform by providing a custom palette.
|
|
1457
1457
|
*
|
|
1458
|
+
* The `backgroundPrimary` color **must** be either a hex, rgb, rgba, hsl, or hsla value.
|
|
1459
|
+
*
|
|
1458
1460
|
* Two palettes are provided by default: `light` and `dark`.
|
|
1459
1461
|
* The `dark` palette is used by default.
|
|
1460
1462
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
export declare const getWindowChannelId: (identity: OpenFin.Identity) => string;
|
|
3
3
|
export interface ChannelClient extends OpenFin.ChannelClient {
|
|
4
|
-
dispatch: (action: typeof BrowserChannelAction[keyof BrowserChannelAction], payload?: any) => Promise<any>;
|
|
4
|
+
dispatch: (action: (typeof BrowserChannelAction)[keyof BrowserChannelAction], payload?: any) => Promise<any>;
|
|
5
5
|
}
|
|
6
6
|
export declare const getChannelClient: (identity: OpenFin.Identity) => Promise<ChannelClient>;
|
|
7
7
|
/**
|
|
@@ -29,7 +29,8 @@ declare enum GeneralBrowserChannelActions {
|
|
|
29
29
|
RemoveFromChannel = "remove-from-channel",
|
|
30
30
|
OpenSaveModalInternal = "open-save-modal-internal",
|
|
31
31
|
DuplicatePage = "duplicate-page",
|
|
32
|
-
SetSelectedScheme = "set-selected-scheme"
|
|
32
|
+
SetSelectedScheme = "set-selected-scheme",
|
|
33
|
+
ShowBrowserIndicator = "show-browser-indicator"
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* All of the remote procedures that can be called in the
|
|
@@ -68,6 +69,7 @@ export declare const BrowserChannelAction: {
|
|
|
68
69
|
OpenSaveModalInternal: GeneralBrowserChannelActions.OpenSaveModalInternal;
|
|
69
70
|
DuplicatePage: GeneralBrowserChannelActions.DuplicatePage;
|
|
70
71
|
SetSelectedScheme: GeneralBrowserChannelActions.SetSelectedScheme;
|
|
72
|
+
ShowBrowserIndicator: GeneralBrowserChannelActions.ShowBrowserIndicator;
|
|
71
73
|
};
|
|
72
74
|
export type BrowserChannelAction = typeof BrowserChannelAction;
|
|
73
75
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withDisconnectListener } from '../../../../common/src/utils/channels';
|
|
1
2
|
import { SearchAPIClientChannelClient } from '../../../../common/src/api/protocol/shapes/search';
|
|
2
3
|
import type { WorkspaceAPIClientChannelClient, WorkspaceChannelProvider, WorkspaceComponentChannelClient } from './shapes/workspace';
|
|
3
4
|
export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient, WorkspaceChannelProvider };
|
|
@@ -5,7 +6,7 @@ export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient,
|
|
|
5
6
|
export declare const channelName: "__of_workspace_protocol__";
|
|
6
7
|
export declare const getChannelClient: () => Promise<WorkspaceComponentChannelClient>;
|
|
7
8
|
export declare const getClientAPIChannelClient: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
8
|
-
export declare const getSearchClientAPIChannelClient: () => Promise<SearchAPIClientChannelClient
|
|
9
|
+
export declare const getSearchClientAPIChannelClient: () => Promise<withDisconnectListener<SearchAPIClientChannelClient>>;
|
|
9
10
|
/**
|
|
10
11
|
* Launches the Workspace Provider.
|
|
11
12
|
* If the Workspace Provider is already running, does nothing.
|
|
@@ -6,7 +6,7 @@ export interface InternalSearchListenerResponse {
|
|
|
6
6
|
getRevokedBuffer(): string[];
|
|
7
7
|
setRevokedBuffer(resultIds: string[]): void;
|
|
8
8
|
getUpdatedContext(): any;
|
|
9
|
-
setUpdatedContext(context: any): void;
|
|
9
|
+
setUpdatedContext(context: any | null): void;
|
|
10
10
|
onChange(): void;
|
|
11
11
|
getStatus(): InternalSearchListenerResponseStatus;
|
|
12
12
|
res: HomeSearchListenerResponse;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
+
export type withDisconnectListener<T> = T & {
|
|
3
|
+
addDisconnectionListener: (listener: () => void) => void;
|
|
4
|
+
};
|
|
2
5
|
/**
|
|
3
6
|
* Make a function that connects to a channel.
|
|
4
7
|
* If already connected to the channel, will return the channel connection.
|
|
@@ -6,4 +9,4 @@ import type OpenFin from '@openfin/core';
|
|
|
6
9
|
* @param channelName the name of the channel to connect to.
|
|
7
10
|
* @returns the function to connect to the channel.
|
|
8
11
|
*/
|
|
9
|
-
export default function makeGetChannelClient(channelName: string): () => Promise<OpenFin.ChannelClient
|
|
12
|
+
export default function makeGetChannelClient(channelName: string): () => Promise<withDisconnectListener<OpenFin.ChannelClient>>;
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
+
import { IndicatorType } from '../../../../common/src/components/Indicator/Indicator.constants';
|
|
1
2
|
export declare enum BrowserIndicatorIcon {
|
|
2
3
|
Locked = "LockClosedIcon",
|
|
3
4
|
Unlocked = "LockOpen1Icon"
|
|
4
5
|
}
|
|
6
|
+
export interface ShowBrowserIndicatorPayload {
|
|
7
|
+
type: IndicatorType;
|
|
8
|
+
message: string;
|
|
9
|
+
parentBrowserName?: string;
|
|
10
|
+
icon?: BrowserIndicatorIcon;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates a window containing a visual indicator
|
|
14
|
+
*/
|
|
15
|
+
export declare function showBrowserIndicator(type: IndicatorType, message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
|
|
5
16
|
/**
|
|
6
17
|
* Creates a window containing an error indicator
|
|
7
18
|
*/
|
|
8
|
-
export declare function showBrowserError(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<
|
|
19
|
+
export declare function showBrowserError(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
|
|
9
20
|
/**
|
|
10
21
|
* Creates a window containing a success indicator
|
|
11
22
|
*/
|
|
12
|
-
export declare function showBrowserSuccess(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<
|
|
23
|
+
export declare function showBrowserSuccess(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
|
|
13
24
|
/**
|
|
14
25
|
* Creates a window containing an info indicator
|
|
15
26
|
*/
|
|
16
|
-
export declare function showBrowserInfo(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<
|
|
27
|
+
export declare function showBrowserInfo(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type WorkspacePerformanceMarks = 'home-registration' | 'dock-registration' | 'store-registration';
|
|
2
|
+
/**
|
|
3
|
+
* @classdesc
|
|
4
|
+
* WorkspacePerformance is a class that provides a set of methods to measure performance of workspace
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
declare class WorkspacePerformance {
|
|
8
|
+
markStart(markName: WorkspacePerformanceMarks): void;
|
|
9
|
+
markEnd(markName: WorkspacePerformanceMarks): void;
|
|
10
|
+
markEndAndMeasure(markName: WorkspacePerformanceMarks): void;
|
|
11
|
+
reportWorkspacePerformanceEntries(): PerformanceEntry[];
|
|
12
|
+
reportWorkspacePerformance(): {
|
|
13
|
+
name: string;
|
|
14
|
+
duration: number;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
declare const workspacePerformance: WorkspacePerformance;
|
|
18
|
+
export default workspacePerformance;
|