@openfin/core-web 0.38.42 → 0.38.44

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.
@@ -22,8 +22,8 @@ An HTML page, loaded as a hidden iframe by clients, must be hosted in the same o
22
22
 
23
23
  In order to build a Web Broker, the following requirements must be met:
24
24
 
25
- 1. You must host the `@openfin/core-web/shared-worker` bundle on a domain (for example https://www.example.com/mysharedworker.js).
26
- 2. You must host a web broker page on that same domain (for example, https://www.example.com/web-broker).
25
+ 1. You must host the `@openfin/core-web/shared-worker` bundle on a domain (for example <https://www.example.com/mysharedworker.js>).
26
+ 2. You must host a web broker page on that same domain (for example, <https://www.example.com/web-broker>).
27
27
  3. That page must call `init` from `@openfin/core-web/iframe-broker` with the URL of the shared worker hosted in step 1.
28
28
 
29
29
  ```typescript
@@ -132,7 +132,7 @@ Note that the `fin.Platform.Layout` API is exactly the same in web, so you can r
132
132
  In order to use layouts, specify the `platform` option to the `connect` call and pass in the `layoutSnapshot`.
133
133
 
134
134
  ```typescript
135
- import { connect, type WebLayoutSnapshot } from '@openfin/web-interop';
135
+ import { connect, type WebLayoutSnapshot } from '@openfin/core-web';
136
136
 
137
137
  const brokerUrl = 'http://example.com/web-broker';
138
138
 
@@ -146,20 +146,30 @@ const layoutSnapshot: WebLayoutSnapshot = {
146
146
  type: 'row',
147
147
  content: [
148
148
  {
149
- title: 'Bloomberg',
150
- type: 'component',
151
- componentName: 'view',
152
- componentState: {
153
- url: 'http://bloomberg.com/'
154
- }
149
+ type: 'stack',
150
+ content: [
151
+ {
152
+ title: 'Example',
153
+ type: 'component',
154
+ componentName: 'view',
155
+ componentState: {
156
+ url: 'http://example.com/'
157
+ }
158
+ }
159
+ ]
155
160
  },
156
161
  {
157
- title: 'OpenFin',
158
- type: 'component',
159
- componentName: 'view',
160
- componentState: {
161
- url: 'http://www.openfin.co/'
162
- }
162
+ type: 'stack',
163
+ content: [
164
+ {
165
+ title: 'Example',
166
+ type: 'component',
167
+ componentName: 'view',
168
+ componentState: {
169
+ url: 'http://example.com/'
170
+ }
171
+ }
172
+ ]
163
173
  }
164
174
  ]
165
175
  }
@@ -187,13 +197,19 @@ const layoutSnapshot: WebLayoutSnapshot = {
187
197
 
188
198
  (async () => {
189
199
  // Connect to the OpenFin Web Broker. Pass in the `platform` key with a layoutSnapshot.
190
- const fin = await connect({ options: { brokerUrl, platform: { layoutSnapshot } } });
200
+ const fin = await connect({
201
+ connectionInheritance: 'enabled',
202
+ options: { brokerUrl },
203
+ platform: { layoutSnapshot }
204
+ });
205
+
206
+ const container = document.getElementById('layout-container');
191
207
 
192
208
  // You may now use the `fin` object. In this case, we want to initialize and create layouts.
193
- await fin.Platform.Layout.init();
209
+ await fin.Platform.Layout.init({ container });
194
210
 
195
- // Then from the context of our Layout UI component, we create the layout (see https://developers.openfin.co/of-docs/docs/multi-layouts):
196
- await fin.Platform.Layout.create({ ... });
211
+ // For multi-layout information see https://developers.openfin.co/of-docs/docs/multi-layouts
212
+ // In the multi-layout case we would also call `fin.Platform.Layout.create()`.
197
213
  })();
198
214
  ```
199
215
 
@@ -109,17 +109,15 @@ Note that FDC3 support in web is currently limited to context sharing on system
109
109
 
110
110
  ## Context Aware Connections and Connection Inheritance
111
111
 
112
- `@openfin/core-web` has been designed to support inheritance of brokerUrls and interop configurations if your content is running as a view within an OpenFin Layout. This allows content developers to develop platform-agnostic experiences and ensure that they are able to interact with other content connected to the same Web Broker.
113
-
114
- However, as Web Layouts is not publicly available yet, the `connect` `connectionInheritance` setting will default to `'disabled'`.
112
+ `@openfin/core-web` has been designed to support inheritance of brokerUrls and interop configurations if your content is running as a View within an OpenFin Layout. This allows content developers to develop platform-agnostic experiences and ensure that they are able to interact with other content connected to the same Web Broker.
115
113
 
116
114
  ## API Reference
117
115
 
118
116
  (Please note, this link works in your IDE and not on npmjs.com, we will update this soon.)
119
117
 
120
- - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
118
+ - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
121
119
 
122
120
  ## See Also
123
121
 
124
- - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
125
- - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
122
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
123
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
@@ -1,8 +1,16 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
 
3
+ export declare type BaseConfig = {
4
+ /**
5
+ * Options used to initialize Web Layouts related features. If omitted, calling `fin.Platform.Layout.init()`
6
+ * will not work.
7
+ */
8
+ platform?: WebLayoutPlatformOptions;
9
+ };
10
+
3
11
  export declare type BaseConnectionOptions = {
4
12
  /**
5
- * The URL of the Web Interop broker to connect to. Can be inherited from a parent browsing context if using an <of-view>
13
+ * The URL of the Web Interop broker to connect to.
6
14
  */
7
15
  brokerUrl: string;
8
16
  /**
@@ -16,7 +24,7 @@ export declare type BaseConnectionOptions = {
16
24
  };
17
25
 
18
26
  /**
19
- * ## connect(connectionConfig: ConnectionConfig)
27
+ * ## connect(connectConfig: ConnectConfig)
20
28
  * Establishes a connection to an OpenFin Web Interop Broker, returning a fin object that supports a subset of APIS.
21
29
  *
22
30
  * ### Supported APIs
@@ -29,28 +37,32 @@ export declare type BaseConnectionOptions = {
29
37
  * * fin.Platform.Layout.destroy
30
38
  * * fin.Platform.Layout.getCurrentLayoutManagerSync
31
39
  *
32
- * @param connectionConfig Config used to initialise the connection
40
+ * @param connectConfig Config used to initialise the connection
33
41
  * @returns Fin api object
34
42
  * @throws If the connection to the broker fails.
35
43
  * @throws If the connection elapses the configured timeout
36
44
  * @throws If the provided {@link InheritModeConnectConfig.validateOptions} returns false
37
- * @throws If connection inheritance is enabled but the current browsing context is not rendered in an <of-view> element and no {@link ConnectionConfig.options} are provided.
45
+ * @throws If connection inheritance is enabled but the current browsing context is not rendered as a View within an OpenFin WebLayout and no {@link ConnectConfig.options} are provided.
38
46
  * @throws If a platform object is provided but the layoutSnapshot is invalid.
39
47
  */
40
- export declare const connect: (connectionConfig: ConnectionConfig) => Promise<OpenFin.Fin<'external connection'>>;
48
+ export declare const connect: (connectConfig: ConnectConfig) => Promise<OpenFin.Fin<'external connection'>>;
41
49
 
42
- export declare type ConnectionConfig = StandAloneConnectonConfig | InheritModeConnectConfig;
50
+ export declare type ConnectConfig = StandAloneConnectConfig | InheritModeConnectConfig;
43
51
 
44
- export declare type InheritModeConnectConfig = {
52
+ export declare type InheritModeConnectConfig = BaseConfig & {
45
53
  /**
46
- * If 'enabled', connection option inheritance is enabled if the current browsing context is
47
- * a nested browsing context within an <of-view> element. This means that the brokerUrl and Identity
48
- * of the connection will be determined by the parent browsing context. Specifying a value is mandatory.
54
+ * @defaultValue 'disabled'
55
+ *
56
+ * If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
57
+ * This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
58
+ * of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
59
+ *
60
+ * If 'disabled', the `options` property is required.
49
61
  */
50
62
  connectionInheritance: 'enabled';
51
63
  /**
52
- * Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connection inheritance
53
- * is enabled and supported for the current browsing context.
64
+ * Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connectionInheritance
65
+ * is 'enabled' and supported for the current browsing context.
54
66
  */
55
67
  options?: BaseConnectionOptions;
56
68
  /**
@@ -61,21 +73,21 @@ export declare type InheritModeConnectConfig = {
61
73
  validateOptions?: (inheritedOptions: Omit<BaseConnectionOptions, 'timeout'>) => boolean | Promise<boolean>;
62
74
  };
63
75
 
64
- export declare type StandAloneConnectonConfig = {
76
+ export declare type StandAloneConnectConfig = BaseConfig & {
65
77
  /**
66
- * If 'enabled', connection option inheritance is enabled if the current browsing context is
67
- * a nested browsing context within an <of-view> element. This means that the brokerUrl and Identity
68
- * of the connection will be determined by the parent browsing context. Specifying a value is mandatory.
78
+ * @defaultValue 'disabled'
79
+ *
80
+ * If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
81
+ * This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
82
+ * of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
83
+ *
84
+ * If 'disabled', the `options` property is required.
69
85
  */
70
86
  connectionInheritance?: 'disabled';
71
87
  /**
72
- * Options used to connect to an OpenFin Web Broker. Mandatory if {@link StandAloneConnectonConfig.connectionInheritance} is false.
88
+ * Options used to connect to an OpenFin Web Broker. Mandatory if {@link StandAloneConnectConfig.connectionInheritance} is 'disabled'.
73
89
  */
74
90
  options: BaseConnectionOptions;
75
- /**
76
- * Options used to initialize web-layouts related features.
77
- */
78
- platform?: WebLayoutPlatformOptions;
79
91
  };
80
92
 
81
93
  export declare type WebCreateLayoutOptions = Omit<OpenFin.CreateLayoutOptions, 'layout'> & {
package/out/api-client.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("./main-014f1c1a.js");require("buffer"),require("uuid"),require("events"),require("lodash"),exports.connect=e.connect;
1
+ "use strict";var e=require("./main-439f0e51.js");require("buffer"),require("uuid"),require("events"),require("lodash"),exports.connect=e.connect;
@@ -32,10 +32,11 @@ const fin = await connect({
32
32
 
33
33
  ### Type Aliases
34
34
 
35
+ - [BaseConfig](type-aliases/BaseConfig.md)
35
36
  - [BaseConnectionOptions](type-aliases/BaseConnectionOptions.md)
36
- - [ConnectionConfig](type-aliases/ConnectionConfig.md)
37
+ - [ConnectConfig](type-aliases/ConnectConfig.md)
37
38
  - [InheritModeConnectConfig](type-aliases/InheritModeConnectConfig.md)
38
- - [StandAloneConnectonConfig](type-aliases/StandAloneConnectonConfig.md)
39
+ - [StandAloneConnectConfig](type-aliases/StandAloneConnectConfig.md)
39
40
  - [WebCreateLayoutOptions](type-aliases/WebCreateLayoutOptions.md)
40
41
  - [WebLayoutComponent](type-aliases/WebLayoutComponent.md)
41
42
  - [WebLayoutInitOptions](type-aliases/WebLayoutInitOptions.md)
@@ -6,9 +6,9 @@
6
6
 
7
7
  # Function: connect()
8
8
 
9
- > **connect**(`connectionConfig`): `Promise`\<`Fin`\<`"external connection"`\>\>
9
+ > **connect**(`connectConfig`): `Promise`\<`Fin`\<`"external connection"`\>\>
10
10
 
11
- ## connect(connectionConfig: ConnectionConfig)
11
+ ## connect(connectConfig: ConnectConfig)
12
12
  Establishes a connection to an OpenFin Web Interop Broker, returning a fin object that supports a subset of APIS.
13
13
 
14
14
  ### Supported APIs
@@ -23,7 +23,7 @@ Establishes a connection to an OpenFin Web Interop Broker, returning a fin objec
23
23
 
24
24
  ## Parameters
25
25
 
26
- • **connectionConfig**: [`ConnectionConfig`](../type-aliases/ConnectionConfig.md)
26
+ • **connectConfig**: [`ConnectConfig`](../type-aliases/ConnectConfig.md)
27
27
 
28
28
  Config used to initialise the connection
29
29
 
@@ -47,7 +47,7 @@ If the provided InheritModeConnectConfig.validateOptions returns false
47
47
 
48
48
  ## Throws
49
49
 
50
- If connection inheritance is enabled but the current browsing context is not rendered in an `<of-view>` element and no ConnectionConfig.options are provided.
50
+ If connection inheritance is enabled but the current browsing context is not rendered as a View within an OpenFin WebLayout and no ConnectConfig.options are provided.
51
51
 
52
52
  ## Throws
53
53
 
@@ -0,0 +1,18 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / BaseConfig
6
+
7
+ # Type alias: BaseConfig
8
+
9
+ > **BaseConfig**: `object`
10
+
11
+ ## Type declaration
12
+
13
+ ### platform?
14
+
15
+ > **`optional`** **platform**: [`WebLayoutPlatformOptions`](WebLayoutPlatformOptions.md)
16
+
17
+ Options used to initialize Web Layouts related features. If omitted, calling `fin.Platform.Layout.init()`
18
+ will not work.
@@ -14,7 +14,7 @@
14
14
 
15
15
  > **brokerUrl**: `string`
16
16
 
17
- The URL of the Web Interop broker to connect to. Can be inherited from a parent browsing context if using an `<of-view>`
17
+ The URL of the Web Interop broker to connect to.
18
18
 
19
19
  ### interopConfig?
20
20
 
@@ -0,0 +1,9 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / ConnectConfig
6
+
7
+ # Type alias: ConnectConfig
8
+
9
+ > **ConnectConfig**: [`StandAloneConnectConfig`](StandAloneConnectConfig.md) \| [`InheritModeConnectConfig`](InheritModeConnectConfig.md)
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Type alias: InheritModeConnectConfig
8
8
 
9
- > **InheritModeConnectConfig**: `object`
9
+ > **InheritModeConnectConfig**: [`BaseConfig`](BaseConfig.md) & `object`
10
10
 
11
11
  ## Type declaration
12
12
 
@@ -14,16 +14,22 @@
14
14
 
15
15
  > **connectionInheritance**: `"enabled"`
16
16
 
17
- If 'enabled', connection option inheritance is enabled if the current browsing context is
18
- a nested browsing context within an `<of-view>` element. This means that the brokerUrl and Identity
19
- of the connection will be determined by the parent browsing context. Specifying a value is mandatory.
17
+ #### Default Value
18
+
19
+ 'disabled'
20
+
21
+ If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
22
+ This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
23
+ of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
24
+
25
+ If 'disabled', the `options` property is required.
20
26
 
21
27
  ### options?
22
28
 
23
29
  > **`optional`** **options**: [`BaseConnectionOptions`](BaseConnectionOptions.md)
24
30
 
25
- Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connection inheritance
26
- is enabled and supported for the current browsing context.
31
+ Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connectionInheritance
32
+ is 'enabled' and supported for the current browsing context.
27
33
 
28
34
  ### validateOptions()?
29
35
 
@@ -0,0 +1,31 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / StandAloneConnectConfig
6
+
7
+ # Type alias: StandAloneConnectConfig
8
+
9
+ > **StandAloneConnectConfig**: [`BaseConfig`](BaseConfig.md) & `object`
10
+
11
+ ## Type declaration
12
+
13
+ ### connectionInheritance?
14
+
15
+ > **`optional`** **connectionInheritance**: `"disabled"`
16
+
17
+ #### Default Value
18
+
19
+ 'disabled'
20
+
21
+ If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
22
+ This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
23
+ of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
24
+
25
+ If 'disabled', the `options` property is required.
26
+
27
+ ### options
28
+
29
+ > **options**: [`BaseConnectionOptions`](BaseConnectionOptions.md)
30
+
31
+ Options used to connect to an OpenFin Web Broker. Mandatory if StandAloneConnectConfig.connectionInheritance is 'disabled'.