@interopio/widget 3.2.3 → 3.3.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/LICENSE +1 -1
- package/README.md +77 -1
- package/changelog.md +2 -0
- package/dist/fonts.css +1 -1
- package/dist/io-browser-widget.es.js +213 -213
- package/dist/io-browser-widget.es.js.map +1 -1
- package/dist/io-browser-widget.umd.js +213 -213
- package/dist/io-browser-widget.umd.js.map +1 -1
- package/dist/styles.css +2 -4
- package/package.json +5 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
# @interopio/widget
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The [`@interopio/widget`](https://www.npmjs.com/package/@interopio/widget) library provides a floating io.Connect widget used in **io.Connect Browser** apps. The io.Connect widget offers out-of-the-box implementation of a Channel Selector and a way to quickly return floating windows to their original Workspaces.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To install the library, execute the following command:
|
|
10
|
+
|
|
11
|
+
```cmd
|
|
12
|
+
npm install @interopio/widget
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
In an **io.Connect Browser** project, the widget is configured and initialized in the Main app, which then provides the widget to all Browser Client apps that have enabled its usage.
|
|
18
|
+
|
|
19
|
+
> ℹ️ *For more details on using the `@interopio/widget` library, see the **io.Connect Browser** [official documentation](https://docs.interop.io/browser/capabilities/widget/index.html).*
|
|
20
|
+
|
|
21
|
+
Using the `@interopio/widget` library in the Main app of an **io.Connect Browser** project:
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
import IOBrowserPlatform from "@interopio/browser-platform"
|
|
25
|
+
|
|
26
|
+
const config = {
|
|
27
|
+
licenseKey: "my-license-key",
|
|
28
|
+
// Settings for the io.Connect widget.
|
|
29
|
+
widget: {
|
|
30
|
+
sources: {
|
|
31
|
+
// It's required to specify the locations of the bundle and styles for the widget.
|
|
32
|
+
bundle: "https://my-widget/widget-bundle.js",
|
|
33
|
+
styles: ["https://my-widget/styles.css", "https://example.com/custom-styles.css"]
|
|
34
|
+
// It's required to specify the locations of the fonts when using the default widget.
|
|
35
|
+
fonts: ["https://my-widget/fonts.css"]
|
|
36
|
+
},
|
|
37
|
+
// Default widget settings that will be used if the Browser Client doesn't provide any.
|
|
38
|
+
defaultConfig: {
|
|
39
|
+
position: "top-center",
|
|
40
|
+
channels: {
|
|
41
|
+
selector: {
|
|
42
|
+
enable: true,
|
|
43
|
+
type: "directional"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// Origins of Browser Clients to block from using the widget.
|
|
48
|
+
blockList: ["https://example.com/*", "https://another-example.com/*"]
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const { io } = await IOBrowserPlatform(config);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Enabling the widget in a Browser Client app of an **io.Connect Browser** project:
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import IOBrowser from "@interopio/browser";
|
|
59
|
+
|
|
60
|
+
const options = {
|
|
61
|
+
widget: {
|
|
62
|
+
// Enabling the widget for the current Browser Client app.
|
|
63
|
+
// It's required to specify this to be able to use the widget.
|
|
64
|
+
enable: true,
|
|
65
|
+
// Overriding the default widget settings from the Main app.
|
|
66
|
+
position: "top-center",
|
|
67
|
+
channels: {
|
|
68
|
+
selector: {
|
|
69
|
+
enable: true,
|
|
70
|
+
type: "default"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const io = await IOBrowser(options);
|
|
77
|
+
```
|