@interopio/intent-resolver-ui 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/LICENSE +21 -0
- package/README.md +1 -0
- package/changelog.md +2 -0
- package/dist/fonts.css +1 -0
- package/dist/io-browser-intent-resolver-ui.es.js +3388 -0
- package/dist/io-browser-intent-resolver-ui.es.js.map +1 -0
- package/dist/io-browser-intent-resolver-ui.umd.js +3396 -0
- package/dist/io-browser-intent-resolver-ui.umd.js.map +1 -0
- package/dist/styles.css +83 -0
- package/intent.resolver.ui.d.ts +116 -0
- package/package.json +50 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
export type IOBrowserIntentResolverUIFactoryFunction = (io: any, config: IOBrowserIntentResolverUI.Config) => Promise<IOBrowserIntentResolverUI.API>;
|
|
4
|
+
|
|
5
|
+
declare const IOBrowserIntentResolverUIFactory: IOBrowserIntentResolverUIFactoryFunction;
|
|
6
|
+
|
|
7
|
+
export default IOBrowserIntentResolverUIFactory;
|
|
8
|
+
|
|
9
|
+
export namespace IOBrowserIntentResolverUI {
|
|
10
|
+
export interface IntentResolverProps {
|
|
11
|
+
io: any;
|
|
12
|
+
config: (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { uiSettings?: UISettings };
|
|
13
|
+
onUserResponse: (response: IntentResolverResponse) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Config {
|
|
17
|
+
enable: boolean;
|
|
18
|
+
rootElement: HTMLDivElement;
|
|
19
|
+
CustomIntentResolver?: ComponentType<IntentResolverProps>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface API {
|
|
23
|
+
open: (config: OpenConfig) => OpenResult;
|
|
24
|
+
close: (config: CloseConfig) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface OpenConfigWithIntentRequest {
|
|
28
|
+
intentRequest: IntentRequest;
|
|
29
|
+
handlerFilter?: never;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface OpenConfigWithHandlerFilter {
|
|
33
|
+
handlerFilter: HandlerFilter;
|
|
34
|
+
intentRequest?: never;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface UISettings {
|
|
38
|
+
showCloseButton?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type OpenConfig = (OpenConfigWithIntentRequest | OpenConfigWithHandlerFilter) & { onUserResponse: (response: { response: IntentResolverResponse }) => void, uiSettings?: UISettings };
|
|
42
|
+
|
|
43
|
+
export interface UserSettings {
|
|
44
|
+
preserveChoice: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface UserChoiceResponse {
|
|
48
|
+
intent: string;
|
|
49
|
+
handler: IntentHandler;
|
|
50
|
+
userSettings: UserSettings;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IntentResolverResponse {
|
|
54
|
+
isExpired?: boolean;
|
|
55
|
+
isClosed?: boolean;
|
|
56
|
+
userChoice?: UserChoiceResponse;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface OpenResult {
|
|
60
|
+
id: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface CloseConfig {
|
|
64
|
+
id: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface ApplicationStartOptions {
|
|
68
|
+
top?: number;
|
|
69
|
+
left?: number;
|
|
70
|
+
width?: number;
|
|
71
|
+
height?: number;
|
|
72
|
+
relativeTo?: string;
|
|
73
|
+
relativeDirection?: "top" | "left" | "right" | "bottom";
|
|
74
|
+
waitForAGMReady?: boolean;
|
|
75
|
+
channelId?: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface IntentContext {
|
|
79
|
+
readonly type?: string;
|
|
80
|
+
readonly data?: { [key: string]: any };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface IntentHandler {
|
|
84
|
+
applicationName: string;
|
|
85
|
+
applicationTitle?: string;
|
|
86
|
+
applicationDescription?: string;
|
|
87
|
+
applicationIcon?: string;
|
|
88
|
+
type: "app" | "instance";
|
|
89
|
+
displayName?: string;
|
|
90
|
+
contextTypes?: string[];
|
|
91
|
+
instanceId?: string;
|
|
92
|
+
instanceTitle?: string;
|
|
93
|
+
resultType?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface IntentRequest {
|
|
97
|
+
readonly intent: string;
|
|
98
|
+
readonly target?: "startNew" | "reuse" | { app?: string; instance?: string };
|
|
99
|
+
readonly context?: IntentContext;
|
|
100
|
+
readonly options?: ApplicationStartOptions;
|
|
101
|
+
readonly handlers?: IntentHandler[];
|
|
102
|
+
readonly timeout?: number;
|
|
103
|
+
readonly waitUserResponseIndefinitely?: boolean;
|
|
104
|
+
readonly clearSavedHandler?: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface HandlerFilter {
|
|
108
|
+
title?: string;
|
|
109
|
+
openResolver?: boolean;
|
|
110
|
+
timeout?: number;
|
|
111
|
+
intent?: string;
|
|
112
|
+
contextTypes?: string[];
|
|
113
|
+
resultType?: string;
|
|
114
|
+
applicationNames?: string[];
|
|
115
|
+
}
|
|
116
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@interopio/intent-resolver-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"types": "./intent.resolver.ui.d.ts",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "vite",
|
|
7
|
+
"build": "rollup -c",
|
|
8
|
+
"postversion": "npm run build"
|
|
9
|
+
},
|
|
10
|
+
"eslintConfig": {
|
|
11
|
+
"extends": [
|
|
12
|
+
"react-app",
|
|
13
|
+
"react-app/jest"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"browserslist": {
|
|
17
|
+
"production": [
|
|
18
|
+
">0.2%",
|
|
19
|
+
"not dead",
|
|
20
|
+
"not op_mini all"
|
|
21
|
+
],
|
|
22
|
+
"development": [
|
|
23
|
+
"last 1 chrome version",
|
|
24
|
+
"last 1 firefox version",
|
|
25
|
+
"last 1 safari version"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./intent.resolver.ui.d.ts",
|
|
31
|
+
"default": "./dist/io-browser-intent-resolver-ui.es.js"
|
|
32
|
+
},
|
|
33
|
+
"./styles": "./dist/styles.css",
|
|
34
|
+
"./fonts": "./dist/fonts.css"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": ">=16.8.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@interopio/browser": "^4.0.0",
|
|
41
|
+
"@interopio/components-react": "^0.7.0",
|
|
42
|
+
"@interopio/theme": "^3.0.0",
|
|
43
|
+
"@interopio/utils": "^2.0.0"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"@interopio:registry": "https://registry.npmjs.org",
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "e0dbc07a7ba20967ef13768e508e301602cf73a1"
|
|
50
|
+
}
|