@openfin/workspace-platform 17.0.3 → 17.0.4
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/templates.d.ts +4 -3
- package/client-api-platform/src/init/browser-window-focus.d.ts +0 -4
- package/client-api-platform/src/init/{browser-defaults.d.ts → override-callback/browser-defaults.d.ts} +2 -2
- package/client-api-platform/src/init/{dialogs.d.ts → override-callback/dialogs.d.ts} +1 -1
- package/client-api-platform/src/init/{override-callback.d.ts → override-callback/index.d.ts} +1 -1
- package/client-api-platform/src/init/override-callback/index.test.d.ts +1 -0
- package/client-api-platform/src/init/override-callback/mock-snapshots.d.ts +234 -0
- package/client-api-platform/src/init/{page-defaults.d.ts → override-callback/page-defaults.d.ts} +2 -2
- package/client-api-platform/src/init/override-callback/snapshot.d.ts +3 -0
- package/client-api-platform/src/init/override-callback/view-options.d.ts +12 -0
- package/client-api-platform/src/init/utils.d.ts +1 -4
- package/client-api-platform/src/shapes.d.ts +112 -1
- package/common/src/api/protocol/workspace-platform.d.ts +1 -2
- package/common/src/utils/modal-bounds.d.ts +1 -1
- package/common/src/utils/route.d.ts +0 -1
- package/common/src/utils/snapshot.d.ts +1 -2
- package/common/src/utils/window.d.ts +2 -0
- package/common/src/utils/workspace-modals.d.ts +1 -0
- package/index.js +23 -22
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/client-api-platform/src/init/override-callback.test.d.ts +0 -1
- /package/client-api-platform/src/init/{browser-defaults.test.d.ts → override-callback/browser-defaults.test.d.ts} +0 -0
- /package/client-api-platform/src/init/{page-defaults.test.d.ts → override-callback/page-defaults.test.d.ts} +0 -0
- /package/{client-api-platform/src/init/browser-base-url.test.d.ts → common/src/test/platform-provider-mock.d.ts} +0 -0
- /package/{client-api-platform/src/init → common/src/utils}/browser-base-url.d.ts +0 -0
|
@@ -111,6 +111,7 @@ export declare enum ButtonStyle {
|
|
|
111
111
|
Secondary = "secondary",
|
|
112
112
|
TextOnly = "textOnly"
|
|
113
113
|
}
|
|
114
|
+
export type SplitButtonStyle = Extract<ButtonStyle, ButtonStyle.Primary | ButtonStyle.Secondary>;
|
|
114
115
|
export type PlainContainerTemplateFragment = ContainerTemplateFragment<'Container'>;
|
|
115
116
|
export type ButtonTemplateFragment = ContainerTemplateFragment<'Button'> & FragmentAction & {
|
|
116
117
|
/**
|
|
@@ -120,9 +121,9 @@ export type ButtonTemplateFragment = ContainerTemplateFragment<'Button'> & Fragm
|
|
|
120
121
|
};
|
|
121
122
|
export type SplitButtonFragment = ContainerTemplateFragment<'SplitButton'> & {
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
+
* Determines the styling of the split button.
|
|
124
125
|
*/
|
|
125
|
-
|
|
126
|
+
buttonStyle: SplitButtonStyle;
|
|
126
127
|
/**
|
|
127
128
|
* Data key of the template fragment.
|
|
128
129
|
*
|
|
@@ -132,7 +133,7 @@ export type SplitButtonFragment = ContainerTemplateFragment<'SplitButton'> & {
|
|
|
132
133
|
* ```ts
|
|
133
134
|
* const myTemplateLayout = {
|
|
134
135
|
* type: FragmentTypes.SplitButton,
|
|
135
|
-
*
|
|
136
|
+
* buttonStyle: ButtonStyle.Primary,
|
|
136
137
|
* dataKey: 'splitButton1',
|
|
137
138
|
* }
|
|
138
139
|
*
|
|
@@ -4,10 +4,6 @@ import type OpenFin from '@openfin/core';
|
|
|
4
4
|
* @returns the last focused browser window.
|
|
5
5
|
*/
|
|
6
6
|
export declare function getLastFocusedBrowserWindow(): Promise<OpenFin.Identity | undefined>;
|
|
7
|
-
/**
|
|
8
|
-
* Set the OpenFin identity of the last focused browser window.
|
|
9
|
-
*/
|
|
10
|
-
export declare function setLastFocusedBrowserWindow(identity?: OpenFin.Identity): Promise<void>;
|
|
11
7
|
/**
|
|
12
8
|
* Listen for a browser window to be focused.
|
|
13
9
|
* When a browser window is focused, store it in local storage as the last focused browser window.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { CustomThemeOptions, CustomThemeOptionsWithScheme } from '
|
|
3
|
-
import { BrowserInitConfig } from '
|
|
2
|
+
import type { CustomThemeOptions, CustomThemeOptionsWithScheme } from '../../../../common/src/api/theming';
|
|
3
|
+
import { BrowserInitConfig } from '../../../../client-api-platform/src/shapes';
|
|
4
4
|
/**
|
|
5
5
|
* Applies default options to the creation of browser windows.
|
|
6
6
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import { ShowQuitPlatformDialogRequest } from '
|
|
2
|
+
import { ShowQuitPlatformDialogRequest } from '../../../../client-api-platform/src/shapes';
|
|
3
3
|
export declare const showQuitPlatformDialogInternal: (req: ShowQuitPlatformDialogRequest, identity: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<void>;
|
package/client-api-platform/src/init/{override-callback.d.ts → override-callback/index.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import { BrowserInitConfig, WorkspacePlatformOverrideCallback, WorkspacePlatformProvider } from '
|
|
2
|
+
import { BrowserInitConfig, WorkspacePlatformOverrideCallback, WorkspacePlatformProvider } from '../../../../client-api-platform/src/shapes';
|
|
3
3
|
export declare const getOverrideCallback: (browserInitOptions: BrowserInitConfig | null, overrideCallback?: WorkspacePlatformOverrideCallback) => OpenFin.OverrideCallback<WorkspacePlatformProvider>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@common/test/fin-mocks';
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
export declare const mockSnapshotWithInternalData1: {
|
|
2
|
+
windows: {
|
|
3
|
+
layout: {
|
|
4
|
+
content: {
|
|
5
|
+
type: string;
|
|
6
|
+
content: ({
|
|
7
|
+
type: string;
|
|
8
|
+
content: {
|
|
9
|
+
type: string;
|
|
10
|
+
componentName: string;
|
|
11
|
+
componentState: {
|
|
12
|
+
_internalWorkspaceData: {
|
|
13
|
+
viewIdentifier: string;
|
|
14
|
+
browserNavigationButtons: {
|
|
15
|
+
back: boolean;
|
|
16
|
+
forward: boolean;
|
|
17
|
+
reload: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}[];
|
|
22
|
+
} | {
|
|
23
|
+
type: string;
|
|
24
|
+
content: ({
|
|
25
|
+
type: string;
|
|
26
|
+
content: {
|
|
27
|
+
type: string;
|
|
28
|
+
content: {
|
|
29
|
+
type: string;
|
|
30
|
+
componentName: string;
|
|
31
|
+
componentState: {
|
|
32
|
+
_internalWorkspaceData: {
|
|
33
|
+
viewIdentifier: string;
|
|
34
|
+
browserNavigationButtons: {
|
|
35
|
+
back: boolean;
|
|
36
|
+
forward: boolean;
|
|
37
|
+
reload: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}[];
|
|
42
|
+
}[];
|
|
43
|
+
} | {
|
|
44
|
+
type: string;
|
|
45
|
+
content: {
|
|
46
|
+
type: string;
|
|
47
|
+
componentName: string;
|
|
48
|
+
componentState: {
|
|
49
|
+
_internalWorkspaceData: {
|
|
50
|
+
viewIdentifier: string;
|
|
51
|
+
browserNavigationButtons: {
|
|
52
|
+
reload: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}[];
|
|
57
|
+
})[];
|
|
58
|
+
})[];
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
export declare const mockSnapshotWithWorkspacePlatform1: {
|
|
64
|
+
windows: {
|
|
65
|
+
layout: {
|
|
66
|
+
content: {
|
|
67
|
+
type: string;
|
|
68
|
+
content: ({
|
|
69
|
+
type: string;
|
|
70
|
+
content: {
|
|
71
|
+
type: string;
|
|
72
|
+
componentName: string;
|
|
73
|
+
componentState: {
|
|
74
|
+
_internalWorkspaceData: {
|
|
75
|
+
viewIdentifier: string;
|
|
76
|
+
};
|
|
77
|
+
workspacePlatform: {
|
|
78
|
+
browserNavigationButtons: {
|
|
79
|
+
back: boolean;
|
|
80
|
+
forward: boolean;
|
|
81
|
+
reload: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}[];
|
|
86
|
+
} | {
|
|
87
|
+
type: string;
|
|
88
|
+
content: ({
|
|
89
|
+
type: string;
|
|
90
|
+
content: {
|
|
91
|
+
type: string;
|
|
92
|
+
content: {
|
|
93
|
+
type: string;
|
|
94
|
+
componentName: string;
|
|
95
|
+
componentState: {
|
|
96
|
+
_internalWorkspaceData: {
|
|
97
|
+
viewIdentifier: string;
|
|
98
|
+
};
|
|
99
|
+
workspacePlatform: {
|
|
100
|
+
browserNavigationButtons: {
|
|
101
|
+
back: boolean;
|
|
102
|
+
forward: boolean;
|
|
103
|
+
reload: boolean;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}[];
|
|
108
|
+
}[];
|
|
109
|
+
} | {
|
|
110
|
+
type: string;
|
|
111
|
+
content: {
|
|
112
|
+
type: string;
|
|
113
|
+
componentName: string;
|
|
114
|
+
componentState: {
|
|
115
|
+
_internalWorkspaceData: {
|
|
116
|
+
viewIdentifier: string;
|
|
117
|
+
};
|
|
118
|
+
workspacePlatform: {
|
|
119
|
+
browserNavigationButtons: {
|
|
120
|
+
reload: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
}[];
|
|
125
|
+
})[];
|
|
126
|
+
})[];
|
|
127
|
+
}[];
|
|
128
|
+
};
|
|
129
|
+
}[];
|
|
130
|
+
};
|
|
131
|
+
export declare const mockSnapshotWithInternalData2: {
|
|
132
|
+
windows: {
|
|
133
|
+
workspacePlatform: {
|
|
134
|
+
pages: {
|
|
135
|
+
layout: {
|
|
136
|
+
content: {
|
|
137
|
+
type: string;
|
|
138
|
+
content: ({
|
|
139
|
+
type: string;
|
|
140
|
+
content: {
|
|
141
|
+
type: string;
|
|
142
|
+
content: {
|
|
143
|
+
type: string;
|
|
144
|
+
componentName: string;
|
|
145
|
+
componentState: {
|
|
146
|
+
_internalWorkspaceData: {
|
|
147
|
+
viewIdentifier: string;
|
|
148
|
+
browserNavigationButtons: {
|
|
149
|
+
back: boolean;
|
|
150
|
+
forward: boolean;
|
|
151
|
+
reload: boolean;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
}[];
|
|
156
|
+
}[];
|
|
157
|
+
} | {
|
|
158
|
+
type: string;
|
|
159
|
+
content: {
|
|
160
|
+
type: string;
|
|
161
|
+
content: {
|
|
162
|
+
type: string;
|
|
163
|
+
componentName: string;
|
|
164
|
+
componentState: {
|
|
165
|
+
_internalWorkspaceData: {
|
|
166
|
+
viewIdentifier: string;
|
|
167
|
+
browserNavigationButtons: {
|
|
168
|
+
reload: boolean;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
}[];
|
|
173
|
+
}[];
|
|
174
|
+
})[];
|
|
175
|
+
}[];
|
|
176
|
+
};
|
|
177
|
+
}[];
|
|
178
|
+
};
|
|
179
|
+
}[];
|
|
180
|
+
};
|
|
181
|
+
export declare const mockSnapshotWithWorkspacePlatform2: {
|
|
182
|
+
windows: {
|
|
183
|
+
workspacePlatform: {
|
|
184
|
+
pages: {
|
|
185
|
+
layout: {
|
|
186
|
+
content: {
|
|
187
|
+
type: string;
|
|
188
|
+
content: ({
|
|
189
|
+
type: string;
|
|
190
|
+
content: {
|
|
191
|
+
type: string;
|
|
192
|
+
content: {
|
|
193
|
+
type: string;
|
|
194
|
+
componentName: string;
|
|
195
|
+
componentState: {
|
|
196
|
+
_internalWorkspaceData: {
|
|
197
|
+
viewIdentifier: string;
|
|
198
|
+
};
|
|
199
|
+
workspacePlatform: {
|
|
200
|
+
browserNavigationButtons: {
|
|
201
|
+
back: boolean;
|
|
202
|
+
forward: boolean;
|
|
203
|
+
reload: boolean;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
}[];
|
|
208
|
+
}[];
|
|
209
|
+
} | {
|
|
210
|
+
type: string;
|
|
211
|
+
content: {
|
|
212
|
+
type: string;
|
|
213
|
+
content: {
|
|
214
|
+
type: string;
|
|
215
|
+
componentName: string;
|
|
216
|
+
componentState: {
|
|
217
|
+
_internalWorkspaceData: {
|
|
218
|
+
viewIdentifier: string;
|
|
219
|
+
};
|
|
220
|
+
workspacePlatform: {
|
|
221
|
+
browserNavigationButtons: {
|
|
222
|
+
reload: boolean;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
}[];
|
|
227
|
+
}[];
|
|
228
|
+
})[];
|
|
229
|
+
}[];
|
|
230
|
+
};
|
|
231
|
+
}[];
|
|
232
|
+
};
|
|
233
|
+
}[];
|
|
234
|
+
};
|
package/client-api-platform/src/init/{page-defaults.d.ts → override-callback/page-defaults.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AttachedPage } from '
|
|
2
|
-
import type { BrowserInitConfig } from '
|
|
1
|
+
import type { AttachedPage } from '../../../../common/src/api/pages/shapes';
|
|
2
|
+
import type { BrowserInitConfig } from '../..';
|
|
3
3
|
export declare const applyPageDefaults: (pages: AttachedPage[], defaultPageOptions?: BrowserInitConfig['defaultPageOptions']) => Promise<AttachedPage[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import { BrowserCreateViewRequest, BrowserViewState, BrowserWorkspacePlatformViewOptions } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: Partial<OpenFin.ViewOptions>): any;
|
|
4
|
+
export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl }: {
|
|
5
|
+
manifestUrl: string;
|
|
6
|
+
}, callerIdentity: OpenFin.Identity) => any, callerIdentity: OpenFin.Identity): Promise<any>;
|
|
7
|
+
type ViewStateBase = Pick<BrowserViewState, '_internalWorkspaceData' | 'workspacePlatform'>;
|
|
8
|
+
export declare const mapInternalWorkspaceDataToWorkspacePlatform: <T extends ViewStateBase>(viewState: T) => T;
|
|
9
|
+
export declare const mapWorkspacePlatformToInternalWorkspaceData: <T extends ViewStateBase>(viewState: T) => T;
|
|
10
|
+
export declare const setHotkeysIfNavigationButtonsEnabled: (options: BrowserCreateViewRequest) => Promise<BrowserCreateViewRequest>;
|
|
11
|
+
export declare const registerHotkeyListenersIfEnabled: (viewIdentity: OpenFin.Identity, buttonOptions?: BrowserWorkspacePlatformViewOptions['browserNavigationButtons']) => void;
|
|
12
|
+
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import type { Page } from '../../../common/src/api/pages/shapes';
|
|
3
3
|
import type { BrowserSnapshot } from '..';
|
|
4
|
-
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): any;
|
|
5
|
-
export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl }: {
|
|
6
|
-
manifestUrl: string;
|
|
7
|
-
}, callerIdentity: OpenFin.Identity) => any, callerIdentity: OpenFin.Identity): Promise<any>;
|
|
8
4
|
export declare const filterSnapshotWindows: (win: OpenFin.WindowOptions) => boolean;
|
|
9
5
|
/**
|
|
10
6
|
* fitToMonitor()
|
|
@@ -37,4 +33,5 @@ export type WindowType = 'browser' | 'platform' | 'classic' | 'mixed';
|
|
|
37
33
|
* @returns - Whether the snapshot has browser windows.
|
|
38
34
|
*/
|
|
39
35
|
export declare function checkHasBrowserWindows(snapshot: BrowserSnapshot): boolean;
|
|
36
|
+
export declare const copyObject: <T>(obj: T) => T;
|
|
40
37
|
export {};
|
|
@@ -486,6 +486,27 @@ export declare enum WindowType {
|
|
|
486
486
|
Browser = "browser",
|
|
487
487
|
Platform = "platform"
|
|
488
488
|
}
|
|
489
|
+
export interface BrowserWorkspacePlatformViewOptions {
|
|
490
|
+
browserNavigationButtons?: RequireAtLeastOne<{
|
|
491
|
+
back?: boolean;
|
|
492
|
+
forward?: boolean;
|
|
493
|
+
reload?: boolean;
|
|
494
|
+
}>;
|
|
495
|
+
}
|
|
496
|
+
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
497
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
498
|
+
}[Keys];
|
|
499
|
+
export interface BrowserCreateViewPayload {
|
|
500
|
+
opts: BrowserCreateViewRequest;
|
|
501
|
+
target?: OpenFin.CreateViewTarget;
|
|
502
|
+
targetView?: OpenFin.Identity;
|
|
503
|
+
}
|
|
504
|
+
export interface BrowserCreateViewRequest extends OpenFin.PlatformViewCreationOptions {
|
|
505
|
+
workspacePlatform?: BrowserWorkspacePlatformViewOptions;
|
|
506
|
+
}
|
|
507
|
+
export interface BrowserViewState extends OpenFin.ViewState {
|
|
508
|
+
workspacePlatform?: BrowserWorkspacePlatformViewOptions;
|
|
509
|
+
}
|
|
489
510
|
export interface BrowserWorkspacePlatformWindowOptions {
|
|
490
511
|
/** For internal usage. Defaults to 'browser' when Browser is enabled when the WorkspacePlatform is initialized. In order to use
|
|
491
512
|
* non-Browser layout windows ('platform' windows) in a Browser-enabled workspace platform, set windowType to `platform`. In that instance, the other properties
|
|
@@ -510,6 +531,46 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
510
531
|
newPageUrl?: string;
|
|
511
532
|
toolbarOptions?: ToolbarOptions;
|
|
512
533
|
windowStateButtonOptions?: WindowStateButtonOptions;
|
|
534
|
+
/**
|
|
535
|
+
* Use when you want to display navigation buttons in Browser toolbar. Disabled by default.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```
|
|
539
|
+
* import * as WP from "@openfin/workspace-platform";
|
|
540
|
+
*
|
|
541
|
+
* const platform = WP.getCurrentSync();
|
|
542
|
+
* const browserWin = platform.Browser.createWindow({
|
|
543
|
+
* ...,
|
|
544
|
+
* workspacePlatform: {
|
|
545
|
+
* ...,
|
|
546
|
+
* navigationButtons: {
|
|
547
|
+
* enabled: true;
|
|
548
|
+
* }
|
|
549
|
+
* }
|
|
550
|
+
* });
|
|
551
|
+
* ```
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```
|
|
555
|
+
* // With disabled default keyboard shortcuts
|
|
556
|
+
* const browserWin = platform.Browser.createWindow({
|
|
557
|
+
* ...,
|
|
558
|
+
* workspacePlatform: {
|
|
559
|
+
* ...,
|
|
560
|
+
* navigationButtons: {
|
|
561
|
+
* enabled: true;
|
|
562
|
+
* hotkeysDisabled: true;
|
|
563
|
+
* }
|
|
564
|
+
* }
|
|
565
|
+
* });
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
navigationButtons?: {
|
|
569
|
+
enabled: false;
|
|
570
|
+
} | {
|
|
571
|
+
enabled: true;
|
|
572
|
+
hotkeysDisabled?: boolean;
|
|
573
|
+
};
|
|
513
574
|
/**
|
|
514
575
|
* Remove the Page UI and only allow a single page in the browser window.
|
|
515
576
|
* Must be set to true for this behavior. If this is not set to false,
|
|
@@ -1189,6 +1250,49 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
1189
1250
|
* Get a snapshot that contains browser windows with pages.
|
|
1190
1251
|
*/
|
|
1191
1252
|
getSnapshot(): Promise<BrowserSnapshot>;
|
|
1253
|
+
/**
|
|
1254
|
+
* Preferred way of getting View options with Workspace Platform.
|
|
1255
|
+
*
|
|
1256
|
+
* @param viewIdentity
|
|
1257
|
+
*
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```
|
|
1260
|
+
* import * as WP from "@openfin/workspace-platform";
|
|
1261
|
+
*
|
|
1262
|
+
* const platform = WP.getCurrentSync();
|
|
1263
|
+
* const view = await platform.createView(options);
|
|
1264
|
+
* const viewOptions = await platform.getViewSnapshot(view.identity);
|
|
1265
|
+
*
|
|
1266
|
+
* console.log(viewOptions.workspacePlatform);
|
|
1267
|
+
* ```
|
|
1268
|
+
*/
|
|
1269
|
+
getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<BrowserViewState>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Use when you need to create a View into Browser window. In addition to what regular platfom `createView` offers, here you can specify `workspacePlatform` options for settings related to Workspace Platform.
|
|
1272
|
+
*
|
|
1273
|
+
* For general details about this method, see docs for `@openfin/core`.
|
|
1274
|
+
*
|
|
1275
|
+
*
|
|
1276
|
+
* @example
|
|
1277
|
+
* ```
|
|
1278
|
+
* import * as WP from "@openfin/workspace-platform";
|
|
1279
|
+
*
|
|
1280
|
+
* const platform = WP.getCurrentSync();
|
|
1281
|
+
*
|
|
1282
|
+
* platform.createView({
|
|
1283
|
+
* url: "https://url-to-your-app.com",
|
|
1284
|
+
* ...,
|
|
1285
|
+
* workspacePlatform: {
|
|
1286
|
+
* browserNavigationButtons: {
|
|
1287
|
+
* reload: false,
|
|
1288
|
+
* back: true,
|
|
1289
|
+
* forward: true
|
|
1290
|
+
* }
|
|
1291
|
+
* }
|
|
1292
|
+
* });
|
|
1293
|
+
* ```
|
|
1294
|
+
*/
|
|
1295
|
+
createView(viewOptions: Partial<OpenFin.ViewOptions> | BrowserCreateViewRequest, target?: OpenFin.CreateViewTarget, targetView?: OpenFin.Identity): Promise<OpenFin.View>;
|
|
1192
1296
|
/**
|
|
1193
1297
|
* Launch an application.
|
|
1194
1298
|
*
|
|
@@ -1388,6 +1492,13 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
1388
1492
|
* @param req the payload received by the provider
|
|
1389
1493
|
*/
|
|
1390
1494
|
handleAnalytics(req: AnalyticsEvent[]): Promise<void>;
|
|
1495
|
+
/**
|
|
1496
|
+
* Override when you need to add custom functionality when creating a view.
|
|
1497
|
+
*
|
|
1498
|
+
* @param payload creatin options for the new view
|
|
1499
|
+
* @param callerIdentity identity of the entity that called {@link WorkspacePlatformModule.createView}
|
|
1500
|
+
*/
|
|
1501
|
+
createView(payload: BrowserCreateViewPayload, callerIdentity: OpenFin.Identity): Promise<OpenFin.View>;
|
|
1391
1502
|
/**
|
|
1392
1503
|
* Implementation for deciding whether a modal informing about loss of unsaved changes will be displayed when closing a page.
|
|
1393
1504
|
* The default implementation returns `{ shouldShowModal: true }` if the page has unsaved changes (`hasUnsavedChanges` page property)
|
|
@@ -1743,7 +1854,7 @@ export interface BrowserInitConfig {
|
|
|
1743
1854
|
/**
|
|
1744
1855
|
* The default options when creating a new browser window. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
|
|
1745
1856
|
*/
|
|
1746
|
-
defaultViewOptions?: OpenFin.ViewOptions
|
|
1857
|
+
defaultViewOptions?: Partial<OpenFin.ViewOptions>;
|
|
1747
1858
|
/**
|
|
1748
1859
|
* The platform title. UI friendly title for the platform in browser.
|
|
1749
1860
|
*/
|
|
@@ -6,7 +6,7 @@ import type OpenFin from '@openfin/core';
|
|
|
6
6
|
* When adding a new channel action make sure to add a function that's name matches
|
|
7
7
|
* the value of the enum for the remote procedure in the Workspace Platform overrides and the override-callback.
|
|
8
8
|
* All of the registered channel action handlers can be found here in the platform's overrides:
|
|
9
|
-
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/client-api-platform/src/init/override-callback.ts)
|
|
9
|
+
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/client-api-platform/src/init/override-callback/index.ts)
|
|
10
10
|
*/
|
|
11
11
|
export declare enum WorkspacePlatformChannelAction {
|
|
12
12
|
LaunchApp = "launchApp",
|
|
@@ -19,7 +19,6 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
19
19
|
CreateSavedPageInternal = "createSavedPageInternal",
|
|
20
20
|
UpdateSavedPageInternal = "updateSavedPageInternal",
|
|
21
21
|
DeleteSavedPageInternal = "deleteSavedPageInternal",
|
|
22
|
-
SharePage = "sharePage",
|
|
23
22
|
UpdatePageForWindow = "updatePageForWindow",
|
|
24
23
|
AttachPagesToWindow = "attachPagesToWindow",
|
|
25
24
|
DetachPagesFromWindow = "detachPagesFromWindow",
|
|
@@ -7,7 +7,7 @@ import { ResponseModalConfig } from './menu-config';
|
|
|
7
7
|
* @param modalOptions window options including height/width so that we can calculate the correct bounds
|
|
8
8
|
* @param parentWindowIdentity the window to get the bounds from. If this is undefined, the primary monitor will be used
|
|
9
9
|
* @param centerOnMonitor whether the modal should be centered on the monitor
|
|
10
|
-
* @returns
|
|
10
|
+
* @returns the bounds for where the modal is to be displayed
|
|
11
11
|
*/
|
|
12
12
|
export declare const getResponseModalBounds: (modalOptions: ResponseModalConfig['windowOptions'], parentWindowIdentity?: OpenFin.Identity, centerOnMonitor?: boolean) => Promise<OpenFin.Bounds>;
|
|
13
13
|
/**
|
|
@@ -11,7 +11,6 @@ export declare enum PageRoute {
|
|
|
11
11
|
Browser = "/browser/",
|
|
12
12
|
BrowserPopupMenu = "/browser/popup-menu/",
|
|
13
13
|
Provider = "/provider/",
|
|
14
|
-
BrowserPopupMenuSharePage = "/browser/popup-menu/share-page/",
|
|
15
14
|
BrowserPopupMenuSaveModal = "/browser/popup-menu/save-modal/",
|
|
16
15
|
BrowserPopupMenuLayouts = "/browser/popup-menu/layouts/layouts/",
|
|
17
16
|
BrowserPopupMenuColorLinking = "/browser/popup-menu/color-linking/color-linking/",
|
|
@@ -3,9 +3,8 @@ export type SnapshotDetailsExtended = OpenFin.Snapshot['snapshotDetails'] & {
|
|
|
3
3
|
machineId: string;
|
|
4
4
|
machineName?: string;
|
|
5
5
|
};
|
|
6
|
-
export type SnapshotExtended = {
|
|
6
|
+
export type SnapshotExtended = OpenFin.Snapshot & {
|
|
7
7
|
snapshotDetails: SnapshotDetailsExtended;
|
|
8
|
-
windows: OpenFin.WindowOptions[];
|
|
9
8
|
};
|
|
10
9
|
export type ApplySnapshotOptionsExtended = OpenFin.ApplySnapshotOptions & {
|
|
11
10
|
attachToExistingWindow: boolean;
|
|
@@ -157,4 +157,6 @@ export declare const getComponentWindowStatus: () => Promise<{
|
|
|
157
157
|
storefrontRunning: boolean;
|
|
158
158
|
homeRunning: boolean;
|
|
159
159
|
}>;
|
|
160
|
+
export declare const deserializeWindowBounds: (serialized: string) => OpenFin.WindowBounds | null;
|
|
161
|
+
export declare const serializeWindowBounds: (bounds: OpenFin.WindowBounds) => string;
|
|
160
162
|
export {};
|
|
@@ -7,6 +7,7 @@ export declare const showDeleteWorkspaceModal: (windowIdentity: OpenFin.Identity
|
|
|
7
7
|
*
|
|
8
8
|
* @param windowIdentity Parent or Current OpenFin Window Identity
|
|
9
9
|
* @param workspaceTitle The platform label
|
|
10
|
+
* @param shouldCenterOnMonitor Boolean - determines if modal window is centered on the monitor.
|
|
10
11
|
* @returns Boolean - Affirmative or Negative response from user
|
|
11
12
|
*/
|
|
12
13
|
export declare const showPlatformQuitModal: (windowIdentity: OpenFin.Identity, workspaceTitle: string, shouldCenterOnMonitor?: boolean) => Promise<boolean>;
|