@openfin/workspace-platform 5.7.1 → 6.1.0
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/client-api/src/shapes.d.ts +12 -2
- package/client-api/src/templates.d.ts +135 -0
- package/client-api-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/browser/browser-module.d.ts +5 -1
- package/client-api-platform/src/api/browser/index.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/browser-logo-handler.d.ts +2 -3
- package/client-api-platform/src/api/context-menu/browser-pagetab-handler.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/browser-viewtab-handler.d.ts +1 -2
- package/client-api-platform/src/api/context-menu/index.d.ts +6 -3
- package/client-api-platform/src/api/protocol.d.ts +3 -2
- package/client-api-platform/src/init/utils.d.ts +2 -15
- package/client-api-platform/src/shapes.d.ts +253 -13
- package/common/src/api/browser-protocol.d.ts +4 -2
- package/common/src/utils/defer-show.d.ts +46 -0
- package/common/src/utils/env.d.ts +2 -6
- package/common/src/utils/page-tab-context-menu.d.ts +2 -0
- package/common/src/utils/window.d.ts +3 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/search-api/src/common.d.ts +2 -2
- package/search-api/src/provider/internal.d.ts +1 -1
- package/search-api/src/provider/remote/registration.d.ts +2 -2
- package/search-api/src/shapes.d.ts +2 -2
- package/common/src/utils/defer-auto-show.d.ts +0 -18
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import type { Page } from '../../common/src/api/pages/shapes';
|
|
7
7
|
import type { Workspace } from '../../common/src/api/workspaces';
|
|
8
8
|
import type { Action, DispatchedSearchResult, SearchListenerRequest, SearchListenerResponse, SearchProvider, SearchResult } from '../../search-api/src/index';
|
|
9
|
+
import { CustomTemplate, ListPairs } from './templates';
|
|
10
|
+
export * from './templates';
|
|
9
11
|
export type { Action, DispatchedSearchResult, SearchListenerRequest, SearchListenerResponse, SearchProviderInfo, SearchResult, ScoreOrder, SearchTag, SearchProvider, UserInputListener, ResultDispatchListener, SearchResponse } from '../../search-api/src/index';
|
|
10
12
|
export type { Workspace } from '../../common/src/api/workspaces';
|
|
11
13
|
export type { LayoutExtended, LayoutContentExtended, LayoutSettingsExtended, LayoutContentItemExtended, LayoutComponentExtended, LayoutComponentStateExtended, LayoutStack } from '../../common/src/utils/layout';
|
|
@@ -573,6 +575,10 @@ export declare enum CLITemplate {
|
|
|
573
575
|
* Contact Information Template
|
|
574
576
|
*/
|
|
575
577
|
Contact = "Contact",
|
|
578
|
+
/**
|
|
579
|
+
* Custom Template
|
|
580
|
+
*/
|
|
581
|
+
Custom = "Custom",
|
|
576
582
|
/**
|
|
577
583
|
* Definition List Template
|
|
578
584
|
*/
|
|
@@ -593,7 +599,6 @@ export interface CLISearchResultWithTemplate<T extends keyof typeof CLITemplate,
|
|
|
593
599
|
template: T;
|
|
594
600
|
templateContent: C;
|
|
595
601
|
}
|
|
596
|
-
export declare type ListPairs = [string, string][];
|
|
597
602
|
/**
|
|
598
603
|
* Contact Data.
|
|
599
604
|
*/
|
|
@@ -624,6 +629,11 @@ export interface ContactInfo {
|
|
|
624
629
|
*/
|
|
625
630
|
export interface CLISearchResultContact<A extends Action = Action> extends CLISearchResultWithTemplate<CLITemplate.Contact, ContactInfo, A> {
|
|
626
631
|
}
|
|
632
|
+
/**
|
|
633
|
+
* A Search Result that renders custom templates.
|
|
634
|
+
*/
|
|
635
|
+
export interface CLISearchResultCustom<A extends Action = Action> extends CLISearchResultWithTemplate<CLITemplate.Custom, CustomTemplate, A> {
|
|
636
|
+
}
|
|
627
637
|
/**
|
|
628
638
|
* Definition List Search Result
|
|
629
639
|
*/
|
|
@@ -642,7 +652,7 @@ export interface CLISearchResultSimpleText<A extends Action = Action> extends CL
|
|
|
642
652
|
/**
|
|
643
653
|
* A search result that can be rendered by Home UI.
|
|
644
654
|
*/
|
|
645
|
-
export declare type HomeSearchResult = CLISearchResultContact<HomeAction> | CLISearchResultSimpleText<HomeAction> | CLISearchResultList<HomeAction> | CLISearchResultPlain<HomeAction>;
|
|
655
|
+
export declare type HomeSearchResult = CLISearchResultContact<HomeAction> | CLISearchResultSimpleText<HomeAction> | CLISearchResultList<HomeAction> | CLISearchResultPlain<HomeAction> | CLISearchResultCustom<HomeAction>;
|
|
646
656
|
export declare enum CLIFilterOptionType {
|
|
647
657
|
/**
|
|
648
658
|
* Display a multi-select drop down for the options
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenFin Workspace Custom Templates API
|
|
3
|
+
*
|
|
4
|
+
* @module Templates
|
|
5
|
+
*/
|
|
6
|
+
export declare type ListPairs = [string, string][];
|
|
7
|
+
export declare type CustomTemplateData = Record<string, string | ListPairs>;
|
|
8
|
+
export declare type ContainerFragmentTypes = PlainContainerTemplateFragment | ButtonTemplateFragment;
|
|
9
|
+
export declare type PresentationFragmentTypes = TextTemplateFragment | ImageTemplateFragment | ListTemplateFragment;
|
|
10
|
+
export declare type InteractiveFragmentTypes = ButtonTemplateFragment | TextTemplateFragment | ImageTemplateFragment;
|
|
11
|
+
/**
|
|
12
|
+
* The options to build your custom template composition layout.
|
|
13
|
+
*/
|
|
14
|
+
export declare type TemplateFragment = PlainContainerTemplateFragment | ButtonTemplateFragment | TextTemplateFragment | ListTemplateFragment | ImageTemplateFragment;
|
|
15
|
+
export declare const ContainerTemplateFragmentNames: {
|
|
16
|
+
readonly Container: "Container";
|
|
17
|
+
readonly Button: "Button";
|
|
18
|
+
};
|
|
19
|
+
export declare const PresentationTemplateFragmentNames: {
|
|
20
|
+
readonly Text: "Text";
|
|
21
|
+
readonly Image: "Image";
|
|
22
|
+
readonly List: "List";
|
|
23
|
+
};
|
|
24
|
+
export declare const TemplateFragmentTypes: {
|
|
25
|
+
readonly Text: "Text";
|
|
26
|
+
readonly Image: "Image";
|
|
27
|
+
readonly List: "List";
|
|
28
|
+
readonly Container: "Container";
|
|
29
|
+
readonly Button: "Button";
|
|
30
|
+
};
|
|
31
|
+
export interface BaseTemplateFragment<T extends keyof typeof TemplateFragmentTypes> {
|
|
32
|
+
/**
|
|
33
|
+
* Type of the template fragment.
|
|
34
|
+
*/
|
|
35
|
+
type: T;
|
|
36
|
+
/**
|
|
37
|
+
* CSS style properties of the fragment.
|
|
38
|
+
*
|
|
39
|
+
* All the available custom template fragments support all of the React's inline style properties (with camelCase keys)
|
|
40
|
+
*
|
|
41
|
+
* Note: "position: fixed" is disallowed as a fragment style.
|
|
42
|
+
*/
|
|
43
|
+
style?: Record<string, string | number>;
|
|
44
|
+
}
|
|
45
|
+
export interface FragmentAction {
|
|
46
|
+
/**
|
|
47
|
+
* The action that will be dispatched back to provider when this fragment is clicked.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
action?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The aria compliant description for this action.
|
|
53
|
+
* If you leave this blank, the renderer will generate a generic description of
|
|
54
|
+
* the fragment's type and its action.
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
actionDescription?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ContainerTemplateFragment<T extends keyof typeof ContainerTemplateFragmentNames> extends BaseTemplateFragment<T> {
|
|
60
|
+
/**
|
|
61
|
+
* Sub-fragments of the container.
|
|
62
|
+
*
|
|
63
|
+
* You can use container template fragment to create nested composition structures.
|
|
64
|
+
*/
|
|
65
|
+
children?: TemplateFragment[];
|
|
66
|
+
}
|
|
67
|
+
export interface PresentationTemplateFragment<T extends keyof typeof PresentationTemplateFragmentNames> extends BaseTemplateFragment<T> {
|
|
68
|
+
/**
|
|
69
|
+
* Optional flag.
|
|
70
|
+
*
|
|
71
|
+
* If a template fragment is flagged as optional, The service will not require
|
|
72
|
+
* the fragment's `dataKey` to exist in `templateData`. If a fragment is optional and its data
|
|
73
|
+
* is missing, the fragment will be omitted quietly by the renderer.
|
|
74
|
+
*/
|
|
75
|
+
optional?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Data key of the template fragment.
|
|
78
|
+
*
|
|
79
|
+
* The data associated with this fragment will be looked up in `templateData` map with this key.
|
|
80
|
+
*
|
|
81
|
+
* Example:
|
|
82
|
+
* ```ts
|
|
83
|
+
* const myTemplateLayout = {
|
|
84
|
+
* type: FragmentTypes.Text,
|
|
85
|
+
* dataKey: 'info',
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* const searchResult: CLISearchResultCustom = {
|
|
89
|
+
* //...
|
|
90
|
+
* template: CLITemplate.Custom,
|
|
91
|
+
* templateContent: {
|
|
92
|
+
* layout: myTemplateLayout,
|
|
93
|
+
* data: {
|
|
94
|
+
* info: 'My Custom Search Result Info',
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* };
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
dataKey: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Some common stylization options for the `Button` component.
|
|
105
|
+
*/
|
|
106
|
+
export declare enum ButtonStyle {
|
|
107
|
+
Primary = "primary",
|
|
108
|
+
Secondary = "secondary",
|
|
109
|
+
TextOnly = "textOnly"
|
|
110
|
+
}
|
|
111
|
+
export declare type PlainContainerTemplateFragment = ContainerTemplateFragment<'Container'>;
|
|
112
|
+
export declare type ButtonTemplateFragment = ContainerTemplateFragment<'Button'> & FragmentAction & {
|
|
113
|
+
/**
|
|
114
|
+
* Style of the button emitted by this fragment.
|
|
115
|
+
*/
|
|
116
|
+
buttonStyle?: ButtonStyle;
|
|
117
|
+
};
|
|
118
|
+
export declare type TextTemplateFragment = PresentationTemplateFragment<'Text'> & FragmentAction;
|
|
119
|
+
export declare type ImageTemplateFragment = PresentationTemplateFragment<'Image'> & FragmentAction & {
|
|
120
|
+
/**
|
|
121
|
+
* Alternative (accessibility) text for the image.
|
|
122
|
+
*/
|
|
123
|
+
alternativeText: string;
|
|
124
|
+
};
|
|
125
|
+
export declare type ListTemplateFragment = PresentationTemplateFragment<'List'>;
|
|
126
|
+
export interface CustomTemplate {
|
|
127
|
+
/**
|
|
128
|
+
* Root of the template composition tree. See {@link ContainerTemplateFragment} for nesting.
|
|
129
|
+
*/
|
|
130
|
+
layout: TemplateFragment;
|
|
131
|
+
/**
|
|
132
|
+
* Data associated with the custom search result template's presentation fragments.
|
|
133
|
+
*/
|
|
134
|
+
data: CustomTemplateData;
|
|
135
|
+
}
|
|
@@ -4,4 +4,4 @@ import type { LaunchAppRequest } from '../shapes';
|
|
|
4
4
|
* @param app the app directory entry.
|
|
5
5
|
* @param opts launch options.
|
|
6
6
|
*/
|
|
7
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | import("openfin-adapter
|
|
7
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | import("openfin-adapter").View | import("openfin-adapter").Application | import("openfin-adapter/src/api/platform").Platform | import("openfin-adapter").Identity>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../../../common/src/api/pages/shapes';
|
|
3
|
-
import {
|
|
3
|
+
import { OpenPageTabContextMenuRequest } from '../../../../client-api-platform/src/index';
|
|
4
|
+
import { OpenGlobalContextMenuRequest, OpenViewTabContextMenuRequest, ToolbarOptions, WindowStateButtonOptions } from '../../../../client-api-platform/src/shapes';
|
|
4
5
|
export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
5
6
|
identity: OpenFin.Identity;
|
|
6
7
|
openfinWindow: import("openfin-adapter").Window;
|
|
@@ -12,5 +13,8 @@ export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
|
12
13
|
updatePage: (req: any) => Promise<any>;
|
|
13
14
|
reorderPages: (req: any) => Promise<any>;
|
|
14
15
|
_openGlobalContextMenu: (req: OpenGlobalContextMenuRequest) => Promise<any>;
|
|
16
|
+
replaceToolbarOptions: (options: ToolbarOptions) => Promise<void>;
|
|
17
|
+
replaceWindowStateButtonOptions: (options: WindowStateButtonOptions) => Promise<void>;
|
|
15
18
|
_openViewTabContextMenu: (req: OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
|
+
_openPageTabContextMenu: (req: OpenPageTabContextMenuRequest) => Promise<any>;
|
|
16
20
|
};
|
|
@@ -13,7 +13,10 @@ export declare const getBrowserApi: (identity: OpenFin.ApplicationIdentity) => {
|
|
|
13
13
|
updatePage: (req: any) => Promise<any>;
|
|
14
14
|
reorderPages: (req: any) => Promise<any>;
|
|
15
15
|
_openGlobalContextMenu: (req: import("../../shapes").OpenGlobalContextMenuRequest) => Promise<any>;
|
|
16
|
+
replaceToolbarOptions: (options: import("../../shapes").ToolbarOptions) => Promise<void>;
|
|
17
|
+
replaceWindowStateButtonOptions: (options: import("../../shapes").WindowStateButtonOptions) => Promise<void>;
|
|
16
18
|
_openViewTabContextMenu: (req: import("../../shapes").OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
|
+
_openPageTabContextMenu: (req: import("../../shapes").OpenPageTabContextMenuRequest) => Promise<any>;
|
|
17
20
|
};
|
|
18
21
|
createWindow: (options: BrowserCreateWindowRequest) => Promise<BrowserWindowModule>;
|
|
19
22
|
getAllAttachedPages: () => Promise<AttachedPage[]>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const handler: (winIdentity: NamedIdentity, data: GlobalContextMenuItemData) => Promise<void>;
|
|
1
|
+
import { GlobalContextMenuItemData, OpenGlobalContextMenuPayload } from '../../shapes';
|
|
2
|
+
declare const handler: (data: GlobalContextMenuItemData, payload: OpenGlobalContextMenuPayload) => Promise<void>;
|
|
4
3
|
export default handler;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
2
|
+
import { PageTabContextMenuItemData } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare const pageTabContextMenuItemHandler: (data: PageTabContextMenuItemData, payload: OpenPageTabContextMenuPayload) => Promise<void>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
1
|
import { OpenViewTabContextMenuPayload, ViewTabMenuData } from '../../../../client-api-platform/src/index';
|
|
3
|
-
declare const handler: (
|
|
2
|
+
declare const handler: (data: ViewTabMenuData, payload: OpenViewTabContextMenuPayload) => Promise<void>;
|
|
4
3
|
export default handler;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
-
import {
|
|
2
|
+
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
3
|
+
import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest, OpenPageTabContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
3
4
|
export declare function openGlobalContextMenuInternal(payload: OpenGlobalContextMenuRequest & {
|
|
4
5
|
identity: NamedIdentity;
|
|
5
6
|
}, callerIdentity: any): Promise<void>;
|
|
6
|
-
export declare const
|
|
7
|
+
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload, callerIdentity: any) => Promise<void>;
|
|
7
8
|
export declare function openViewTabContextMenuInternal(payload: OpenViewTabContextMenuRequest & {
|
|
8
9
|
identity: NamedIdentity;
|
|
9
10
|
}, callerIdentity: any): Promise<void>;
|
|
10
|
-
export declare
|
|
11
|
+
export declare function openPageTabContextMenuInternal(payload: OpenPageTabContextMenuRequest & {
|
|
12
|
+
identity: NamedIdentity;
|
|
13
|
+
}, callerIdentity: any): Promise<void>;
|
|
@@ -34,8 +34,9 @@ export declare enum ChannelAction {
|
|
|
34
34
|
GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
|
|
35
35
|
GetThemes = "getThemes",
|
|
36
36
|
OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
OpenViewTabContextMenuInternal = "openViewTabContextMenuInternal",
|
|
38
|
+
OpenPageTabContextMenuInternal = "openPageTabContextMenuInternal",
|
|
39
|
+
InvokeCustomActionInternal = "invokeCustomActionInternal"
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Get a channel client for a specific Workspace platform.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import { Identity } from 'openfin-adapter';
|
|
3
3
|
import type { CustomThemeOptions } from '../../../common/src/api/theming';
|
|
4
|
-
import {
|
|
4
|
+
import type { BrowserInitConfig } from '..';
|
|
5
5
|
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): any;
|
|
6
6
|
export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl: string }: {
|
|
7
7
|
manifestUrl: any;
|
|
@@ -28,19 +28,6 @@ declare type LegacyWindowOptions = Omit<OpenFin.PlatformWindowCreationOptions, '
|
|
|
28
28
|
workstacks?: OpenFin.Page[];
|
|
29
29
|
};
|
|
30
30
|
export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions | OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
|
|
31
|
-
/**
|
|
32
|
-
* hasLayout()
|
|
33
|
-
* Function to force layout settings
|
|
34
|
-
* - Check if layout property exists if so process data, else return as is
|
|
35
|
-
* - Define behavior settings
|
|
36
|
-
* - Force dimension options
|
|
37
|
-
* - Validate icon
|
|
38
|
-
*
|
|
39
|
-
* Ticket: WRK-???
|
|
40
|
-
*
|
|
41
|
-
* @param options - options used to handle layout settings
|
|
42
|
-
* @returns processed or unprocesseed options
|
|
43
|
-
*/
|
|
44
|
-
export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: BrowserCreateWindowRequest, theme: CustomThemeOptions) => OpenFin.PlatformWindowCreationOptions;
|
|
45
31
|
export declare const applyPageDefaults: (pages: OpenFin.Page[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => OpenFin.Page[];
|
|
32
|
+
export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'defaultWindowOptions' | 'defaultPageOptions'>, theme: CustomThemeOptions) => OpenFin.PlatformWindowCreationOptions;
|
|
46
33
|
export {};
|