@openfin/workspace-platform 10.4.0 → 11.0.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-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/pages/index.d.ts +2 -2
- package/client-api-platform/src/init/panels.d.ts +4 -0
- package/client-api-platform/src/init/utils.d.ts +2 -16
- package/client-api-platform/src/shapes.d.ts +2 -1
- package/common/src/api/pages/attached.d.ts +3 -3
- package/common/src/api/pages/index.d.ts +2 -2
- package/common/src/api/pages/shapes.d.ts +43 -0
- package/common/src/utils/layout.d.ts +43 -2
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,4 +5,4 @@ import type { LaunchAppRequest } from '../shapes';
|
|
|
5
5
|
* @param app the app directory entry.
|
|
6
6
|
* @param opts launch options.
|
|
7
7
|
*/
|
|
8
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | import("@openfin/core/src/api/
|
|
8
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | import("@openfin/core/src/api/application").Application | OpenFin.Identity | import("@openfin/core/src/api/view").View | import("@openfin/core/src/api/platform").Platform>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { AttachedPage,
|
|
2
|
+
import type { AttachedPage, DetachPagesFromWindowPayload, ExtendedAttachPagesToWindowPayload, ReorderPagesForWindowPayload, SetActivePageForWindowPayload, UpdatePageForWindowPayload } from '../../../../common/src/api/pages/shapes';
|
|
3
3
|
import type { CreateSavedPageRequest, Page, UpdateSavedPageRequest } from '../../../../client-api-platform/src/shapes';
|
|
4
4
|
/**
|
|
5
5
|
* Get all open pages in which are attached to a window.
|
|
@@ -10,7 +10,7 @@ export declare const createSavedPageInternal: ({ page }: CreateSavedPageRequest)
|
|
|
10
10
|
export declare const deleteSavedPageInternal: (id: string) => Promise<void>;
|
|
11
11
|
export declare const updateSavedPageInternal: ({ pageId, page }: UpdateSavedPageRequest) => Promise<any>;
|
|
12
12
|
export declare const savePage: (page: Page) => Promise<any>;
|
|
13
|
-
export declare const attachPagesToWindow: (payload:
|
|
13
|
+
export declare const attachPagesToWindow: (payload: ExtendedAttachPagesToWindowPayload) => Promise<void>;
|
|
14
14
|
export declare const updatePageForWindow: (payload: UpdatePageForWindowPayload) => Promise<void>;
|
|
15
15
|
export declare const detachPagesFromWindow: (payload: DetachPagesFromWindowPayload) => Promise<void>;
|
|
16
16
|
export declare const setActivePage: (payload: SetActivePageForWindowPayload) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AttachedPage, ExtendedPanelConfig, PanelConfig } from '../../../common/src/api/pages/shapes';
|
|
2
|
+
export declare function convertPanelViewOpts(panels: PanelConfig[]): ExtendedPanelConfig[];
|
|
3
|
+
export declare function createPanelViewsForPages(pages: AttachedPage[]): Promise<import("@openfin/core/src/api/view").View[][]>;
|
|
4
|
+
export declare function createPanelViews(panels: PanelConfig[]): Promise<import("@openfin/core/src/api/view").View[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { Page } from '../../../common/src/api/pages/shapes';
|
|
2
|
+
import type { AttachedPage, Page } from '../../../common/src/api/pages/shapes';
|
|
3
3
|
import type { CustomThemeOptions, CustomThemeOptionsWithScheme } from '../../../common/src/api/theming';
|
|
4
4
|
import type { BrowserInitConfig, BrowserSnapshot } from '..';
|
|
5
5
|
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): any;
|
|
@@ -28,21 +28,7 @@ declare type LegacyWindowOptions = Omit<OpenFin.PlatformWindowCreationOptions, '
|
|
|
28
28
|
workstacks?: Page[];
|
|
29
29
|
};
|
|
30
30
|
export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions | OpenFin.PlatformWindowCreationOptions) => OpenFin.PlatformWindowCreationOptions;
|
|
31
|
-
export declare const applyPageDefaults: (pages: Page[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => Promise<
|
|
32
|
-
title: string;
|
|
33
|
-
layout: any;
|
|
34
|
-
pageId: string;
|
|
35
|
-
description?: string;
|
|
36
|
-
tooltip?: string;
|
|
37
|
-
isReadOnly?: boolean;
|
|
38
|
-
unsavedIconUrl?: string;
|
|
39
|
-
iconUrl?: string;
|
|
40
|
-
isLocked?: boolean;
|
|
41
|
-
closeButton?: {
|
|
42
|
-
hidden?: boolean;
|
|
43
|
-
disabled?: boolean;
|
|
44
|
-
};
|
|
45
|
-
}[]>;
|
|
31
|
+
export declare const applyPageDefaults: (pages: Page[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => Promise<AttachedPage[]>;
|
|
46
32
|
export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: Pick<BrowserInitConfig, 'title' | 'defaultWindowOptions' | 'defaultPageOptions'>, theme: CustomThemeOptions | CustomThemeOptionsWithScheme) => Promise<OpenFin.PlatformWindowCreationOptions>;
|
|
47
33
|
export declare enum WindowType {
|
|
48
34
|
Browser = "browser",
|
|
@@ -8,7 +8,8 @@ import type { App } from '../../client-api/src/shapes';
|
|
|
8
8
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
9
9
|
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
10
10
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
11
|
-
export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
|
|
11
|
+
export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatableRuntimeAttribs, PanelConfigHorizontal, PanelConfigVertical, PanelConfig, ExtendedPanelConfig } from '../../common/src/api/pages/shapes';
|
|
12
|
+
export { PanelPosition } from '../../common/src/api/pages/shapes';
|
|
12
13
|
export type { CustomThemes, CustomThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet } from '../../common/src/api/theming';
|
|
13
14
|
export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
14
15
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { AttachedPage,
|
|
2
|
+
import type { AttachedPage, DetachPagesFromWindowPayload, ExtendedAttachPagesToWindowPayload, ExtendedUpdatePageForWindowPayload, ReorderPagesForWindowPayload, SetActivePageForWindowPayload } from './shapes';
|
|
3
3
|
/**
|
|
4
4
|
* Get the pages attached to a window.
|
|
5
5
|
* @param identity the identity of the window to get the attached pages of.
|
|
@@ -23,7 +23,7 @@ export declare const setActivePageForWindow: (payload: SetActivePageForWindowPay
|
|
|
23
23
|
*
|
|
24
24
|
* @param payload the attach pages to window payload.
|
|
25
25
|
*/
|
|
26
|
-
export declare const attachPagesToWindow: (payload:
|
|
26
|
+
export declare const attachPagesToWindow: (payload: ExtendedAttachPagesToWindowPayload) => Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Detach pages from the window they are currently attached to.
|
|
29
29
|
* A detached page will not have its views cleaned up.
|
|
@@ -55,7 +55,7 @@ export declare const reorderPagesForWindow: (payload: ReorderPagesForWindowPaylo
|
|
|
55
55
|
* Update a page attached to a window.
|
|
56
56
|
* @param payload the update page for window payload.
|
|
57
57
|
*/
|
|
58
|
-
export declare const updatePageForWindow: (payload:
|
|
58
|
+
export declare const updatePageForWindow: (payload: ExtendedUpdatePageForWindowPayload) => Promise<void>;
|
|
59
59
|
/**
|
|
60
60
|
* Forces a window to save its attached page state to window options.
|
|
61
61
|
* @param identity the identity of the window to save the pages of in window options.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LayoutExtended } from '../../../../common/src/utils/layout';
|
|
2
2
|
import type { AttachedPage, Page, PageLayout, PageWithUpdatableRuntimeAttribs } from './shapes';
|
|
3
3
|
export declare function getLegacyPages(): Promise<Page[]>;
|
|
4
|
-
export declare function cleanPage(page:
|
|
4
|
+
export declare function cleanPage<T extends AttachedPage | Page>(page: T): T;
|
|
5
5
|
/**
|
|
6
6
|
* Get a page layout.
|
|
7
7
|
* @param layout the layout to add details to.
|
|
@@ -19,4 +19,4 @@ export declare const makePage: (title: string, layout: LayoutExtended) => Promis
|
|
|
19
19
|
* @param page the page to clone.
|
|
20
20
|
* @returns a clone of the given page.
|
|
21
21
|
*/
|
|
22
|
-
export declare const clonePage: (page:
|
|
22
|
+
export declare const clonePage: <T extends Page | AttachedPage>(page: T) => Promise<T>;
|
|
@@ -35,6 +35,8 @@ export interface Page {
|
|
|
35
35
|
hidden?: boolean;
|
|
36
36
|
disabled?: boolean;
|
|
37
37
|
};
|
|
38
|
+
/** Used to configure fixed views on the edges of the browser window. Only one panel per side is supported. */
|
|
39
|
+
panels?: PanelConfig[];
|
|
38
40
|
}
|
|
39
41
|
declare type AttachedPageMetadata = {
|
|
40
42
|
/** The window the page is currently attached to. */
|
|
@@ -43,6 +45,8 @@ declare type AttachedPageMetadata = {
|
|
|
43
45
|
isActive?: boolean;
|
|
44
46
|
/** True if the page has unsaved changes. */
|
|
45
47
|
hasUnsavedChanges?: boolean;
|
|
48
|
+
/** Panel config with all view identities in place */
|
|
49
|
+
panels?: ExtendedPanelConfig[];
|
|
46
50
|
};
|
|
47
51
|
export declare type AttachedPage = Page & AttachedPageMetadata;
|
|
48
52
|
export declare type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
|
|
@@ -75,16 +79,55 @@ export interface UpdatePageForWindowPayload {
|
|
|
75
79
|
/** The partial updated state of the page. */
|
|
76
80
|
page: Partial<PageWithUpdatableRuntimeAttribs>;
|
|
77
81
|
}
|
|
82
|
+
export interface ExtendedUpdatePageForWindowPayload extends UpdatePageForWindowPayload {
|
|
83
|
+
/** The partial updated state of the page. */
|
|
84
|
+
page: Partial<AttachedPage>;
|
|
85
|
+
}
|
|
78
86
|
export interface AttachPagesToWindowPayload {
|
|
79
87
|
/** The OF window identity to attach the pages to. */
|
|
80
88
|
identity: OpenFin.Identity;
|
|
81
89
|
/** The pages to attach. */
|
|
82
90
|
pages: PageWithUpdatableRuntimeAttribs[];
|
|
83
91
|
}
|
|
92
|
+
export interface ExtendedAttachPagesToWindowPayload extends AttachPagesToWindowPayload {
|
|
93
|
+
/** The pages to attach. */
|
|
94
|
+
pages: AttachedPage[];
|
|
95
|
+
}
|
|
84
96
|
export interface GetSavedPageMetadataPayload {
|
|
85
97
|
/** The OF window identity to attach the pages to. */
|
|
86
98
|
identity: OpenFin.Identity;
|
|
87
99
|
/** The id of the page to get the save state of. */
|
|
88
100
|
pageId: string;
|
|
89
101
|
}
|
|
102
|
+
export declare enum PanelPosition {
|
|
103
|
+
Left = "Left",
|
|
104
|
+
Right = "Right",
|
|
105
|
+
Top = "Top",
|
|
106
|
+
Bottom = "Bottom"
|
|
107
|
+
}
|
|
108
|
+
export interface PanelConfigHorizontal {
|
|
109
|
+
/** Position of the panel in the page. */
|
|
110
|
+
position: PanelPosition.Top | PanelPosition.Bottom;
|
|
111
|
+
/** Size of the top/bottom panel, formatted as CSS property value with units. E.g. "0px", "10%", "3rem". */
|
|
112
|
+
height: string;
|
|
113
|
+
}
|
|
114
|
+
export interface PanelConfigVertical {
|
|
115
|
+
/** Position of the panel in the page. */
|
|
116
|
+
position: PanelPosition.Left | PanelPosition.Right;
|
|
117
|
+
/** Size of the left/right panel, formatted as CSS property value with units. E.g. "0px", "10%", "3rem". */
|
|
118
|
+
width: string;
|
|
119
|
+
/** When true, the left/right panel extends all the way to the top of the window,
|
|
120
|
+
* thus taking priority over the top panel.*/
|
|
121
|
+
extendToTop?: boolean;
|
|
122
|
+
/** When true, the left/right panel extends all the way to the bottom of the window,
|
|
123
|
+
* thus taking priority over the bottom panel.*/
|
|
124
|
+
extendToBottom?: boolean;
|
|
125
|
+
}
|
|
126
|
+
export declare type PanelConfig = (PanelConfigHorizontal | PanelConfigVertical) & {
|
|
127
|
+
/** The options with which to initialize the panel view.*/
|
|
128
|
+
viewOptions: Omit<OpenFin.PlatformViewCreationOptions, 'bounds' | 'target'>;
|
|
129
|
+
};
|
|
130
|
+
export declare type ExtendedPanelConfig = PanelConfig & {
|
|
131
|
+
viewOptions: PanelConfig['viewOptions'] & OpenFin.Identity;
|
|
132
|
+
};
|
|
90
133
|
export {};
|
|
@@ -12,7 +12,7 @@ export declare type LayoutStack = {
|
|
|
12
12
|
type: 'stack';
|
|
13
13
|
content: OpenFin.LayoutContent;
|
|
14
14
|
};
|
|
15
|
-
export declare type LayoutContentItemExtended = OpenFin.LayoutRow | OpenFin.LayoutColumn | LayoutComponentExtended |
|
|
15
|
+
export declare type LayoutContentItemExtended = OpenFin.LayoutRow | OpenFin.LayoutColumn | LayoutStack | LayoutComponentExtended | OpenFin.LayoutItemConfig;
|
|
16
16
|
export declare type LayoutContentExtended = LayoutContentItemExtended[];
|
|
17
17
|
export declare type LayoutSettingsExtended = OpenFin.LayoutOptions['settings'] & {
|
|
18
18
|
reorderEnabled?: boolean;
|
|
@@ -43,12 +43,23 @@ export declare const getFirstViewFromLayout: (identity?: WindowIdentity) => Prom
|
|
|
43
43
|
name: any;
|
|
44
44
|
uuid: any;
|
|
45
45
|
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Copies the componentState and generates a name if it's not there
|
|
48
|
+
* @param componentState view's componentState in the layout object, corresponds to View options
|
|
49
|
+
* @returns A copy of the componentState with name filled in
|
|
50
|
+
*/
|
|
51
|
+
export declare const generateViewNameIfNotExists: <T extends {
|
|
52
|
+
name?: string;
|
|
53
|
+
}>(componentState: T) => T & {
|
|
54
|
+
name: string;
|
|
55
|
+
};
|
|
46
56
|
/**
|
|
47
57
|
* Deep clones a layout and adds view names if they don't exist.
|
|
48
58
|
* @param layout The Layout to be cloned
|
|
49
59
|
* @returns A copy of the layout with names added where necessary
|
|
50
60
|
*/
|
|
51
61
|
export declare const cloneLayoutAndFillInViewNames: (layout: PageLayout) => any;
|
|
62
|
+
export declare const cloneViewComponentWithoutName: (componentState: any) => any;
|
|
52
63
|
/**
|
|
53
64
|
* Deep clones a layout and removes view names.
|
|
54
65
|
* @param layout The Layout to be cloned
|
|
@@ -56,7 +67,37 @@ export declare const cloneLayoutAndFillInViewNames: (layout: PageLayout) => any;
|
|
|
56
67
|
*/
|
|
57
68
|
export declare const cloneLayoutAndRemoveNames: (layout: PageLayout) => any;
|
|
58
69
|
export declare const mapContentComponentState: (content: OpenFin.LayoutContent | LayoutContentExtended) => LayoutComponentStateExtended[];
|
|
59
|
-
export declare const getLayoutWithSingleView: (title: string, url: string, winIdentity?: OpenFin.Identity) => Promise<
|
|
70
|
+
export declare const getLayoutWithSingleView: (title: string, url: string, winIdentity?: OpenFin.Identity) => Promise<{
|
|
71
|
+
content: {
|
|
72
|
+
type: string;
|
|
73
|
+
content: {
|
|
74
|
+
type: string;
|
|
75
|
+
componentName: string;
|
|
76
|
+
componentState: {
|
|
77
|
+
title: string;
|
|
78
|
+
url: string;
|
|
79
|
+
};
|
|
80
|
+
}[];
|
|
81
|
+
}[];
|
|
82
|
+
settings?: {
|
|
83
|
+
popoutWholeStack?: boolean;
|
|
84
|
+
constrainDragToContainer?: boolean;
|
|
85
|
+
showPopoutIcon?: boolean;
|
|
86
|
+
showMaximiseIcon?: boolean;
|
|
87
|
+
showCloseIcon?: boolean;
|
|
88
|
+
constrainDragToHeaders?: boolean;
|
|
89
|
+
hasHeaders?: boolean;
|
|
90
|
+
reorderEnabled?: boolean;
|
|
91
|
+
preventDragOut?: boolean;
|
|
92
|
+
preventDragIn?: boolean;
|
|
93
|
+
};
|
|
94
|
+
dimensions?: {
|
|
95
|
+
borderWidth?: number;
|
|
96
|
+
minItemHeight?: number;
|
|
97
|
+
minItemWidth?: number;
|
|
98
|
+
headerHeight?: number;
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
60
101
|
export declare const isLayoutTabActive: (tabSelector: string) => boolean;
|
|
61
102
|
export declare const containerId = "layout_container";
|
|
62
103
|
export declare const getViewComponents: () => LayoutContentExtended;
|