@interopio/widget 1.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/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@interopio/widget",
3
+ "version": "1.0.0",
4
+ "types": "./widget.d.ts",
5
+ "scripts": {
6
+ "start": "react-scripts start",
7
+ "build": "rollup -c",
8
+ "test": "echo no tests found",
9
+ "eject": "react-scripts eject"
10
+ },
11
+ "eslintConfig": {
12
+ "extends": [
13
+ "react-app",
14
+ "react-app/jest"
15
+ ]
16
+ },
17
+ "browserslist": {
18
+ "production": [
19
+ ">0.2%",
20
+ "not dead",
21
+ "not op_mini all"
22
+ ],
23
+ "development": [
24
+ "last 1 chrome version",
25
+ "last 1 firefox version",
26
+ "last 1 safari version"
27
+ ]
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "types": "./widget.d.ts",
32
+ "default": "./dist/io-browser-widget.umd.js"
33
+ },
34
+ "./react": {
35
+ "types": "./widget.d.ts",
36
+ "default": "./dist/io-browser-widget-react.umd.js"
37
+ },
38
+ "./styles": "./dist/styles.css"
39
+ },
40
+ "devDependencies": {
41
+ "@interopio/components-react": "^0.2.1"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
46
+ }
package/widget.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Factory function that appends a widget component to the html body of your IOConnectBrowser-enabled app
3
+ */
4
+ export type IOBrowserWidgetFactoryFunction = (config?: IOBrowserWidget.Config) => Promise<void>;
5
+
6
+ declare const IOBrowserWidgetFactory: IOBrowserWidgetFactoryFunction;
7
+
8
+ export default IOBrowserWidgetFactory;
9
+
10
+ export namespace IOBrowserWidget {
11
+ export interface Config {
12
+ channelSelector?: ChannelSelectorConfig;
13
+
14
+ /**
15
+ * Starting position
16
+ * @default bottom
17
+ */
18
+ position?: Position;
19
+
20
+ /**
21
+ * Widget mode
22
+ * @default default
23
+ */
24
+ mode?: Mode;
25
+ }
26
+
27
+ export interface ChannelSelectorConfig {
28
+ /**
29
+ * Configure whether Channel Selector will be added to the Widget component
30
+ * @default true
31
+ */
32
+ enable?: boolean;
33
+
34
+ type?: ChannelSelectorType;
35
+ }
36
+
37
+ export type ChannelSelectorType = "directional" | "default";
38
+
39
+ export type Position = "top" | "bottom" | "left" | "right";
40
+
41
+ export type Mode = "compact" | "default";
42
+ }