@vention/machine-logic-ui-sdk 0.0.2
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/README.md +7 -0
- package/index.esm.css +40 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +3686 -0
- package/package.json +23 -0
- package/src/index.d.ts +3 -0
- package/src/lib/components/virtual-keyboard/keyboard-layouts.d.ts +41 -0
- package/src/lib/components/virtual-keyboard/virtual-keyboard.d.ts +4 -0
- package/src/lib/mqtt-browser/mqtt-client.d.ts +13 -0
- package/src/lib/utils/machine-logic-ui-sdk-utils.d.ts +7 -0
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vention/machine-logic-ui-sdk",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/VentionCo/machine-cloud.git"
|
|
7
|
+
},
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"react-simple-keyboard": "3.7.124",
|
|
15
|
+
"mqtt": "4.3.7"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"react": "17.0.2"
|
|
19
|
+
},
|
|
20
|
+
"module": "./index.esm.js",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "./index.esm.js"
|
|
23
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { KeyboardLayoutObject } from "react-simple-keyboard";
|
|
2
|
+
export declare enum KeyboardLayoutName {
|
|
3
|
+
DEFAULT = "default",
|
|
4
|
+
SHIFT = "shift"
|
|
5
|
+
}
|
|
6
|
+
export declare enum KeyboardKey {
|
|
7
|
+
SHIFT = "{shift}",
|
|
8
|
+
CAPS_LOCK = "{lock}",
|
|
9
|
+
BACKSPACE = "{bksp}",
|
|
10
|
+
ENTER = "{enter}",
|
|
11
|
+
SUBMIT = "{submit}",
|
|
12
|
+
TAB = "{tab}",
|
|
13
|
+
SPACE = "{space}"
|
|
14
|
+
}
|
|
15
|
+
export declare const KeyboardLayout: {
|
|
16
|
+
readonly TEXT: KeyboardLayoutObject;
|
|
17
|
+
readonly NUMERIC: KeyboardLayoutObject;
|
|
18
|
+
};
|
|
19
|
+
export declare const KeyboardDisplay: {
|
|
20
|
+
readonly "{shift}": "shift ⇧";
|
|
21
|
+
readonly "{lock}": "caps lock ⇪";
|
|
22
|
+
readonly "{bksp}": "backspace ⌫";
|
|
23
|
+
readonly "{enter}": "enter ↵";
|
|
24
|
+
readonly "{submit}": "submit ✓";
|
|
25
|
+
readonly "{tab}": "tab ⇥";
|
|
26
|
+
readonly "{space}": "space";
|
|
27
|
+
};
|
|
28
|
+
export declare const KeyboardLayoutsByInputType: {
|
|
29
|
+
readonly tel: KeyboardLayoutObject;
|
|
30
|
+
readonly date: KeyboardLayoutObject;
|
|
31
|
+
readonly week: KeyboardLayoutObject;
|
|
32
|
+
readonly text: KeyboardLayoutObject;
|
|
33
|
+
readonly password: KeyboardLayoutObject;
|
|
34
|
+
readonly "datetime-local": KeyboardLayoutObject;
|
|
35
|
+
readonly month: KeyboardLayoutObject;
|
|
36
|
+
readonly time: KeyboardLayoutObject;
|
|
37
|
+
readonly email: KeyboardLayoutObject;
|
|
38
|
+
readonly search: KeyboardLayoutObject;
|
|
39
|
+
readonly url: KeyboardLayoutObject;
|
|
40
|
+
readonly textarea: KeyboardLayoutObject;
|
|
41
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Callback {
|
|
2
|
+
(topic: string, message: string): void;
|
|
3
|
+
}
|
|
4
|
+
declare class MqttClient {
|
|
5
|
+
private mqttClient?;
|
|
6
|
+
private subscriptions;
|
|
7
|
+
constructor(url: string, connectCallback?: () => void);
|
|
8
|
+
connect(url: string, connectCallback?: () => void): void;
|
|
9
|
+
subscribe(topic: string, regex: RegExp, cb: Callback): void;
|
|
10
|
+
unsubscribe(topic: string, regex: RegExp, cb: Callback): void;
|
|
11
|
+
publish(topic: string, message: string, retain?: boolean): void;
|
|
12
|
+
}
|
|
13
|
+
export { MqttClient };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MqttClient } from "../mqtt-browser/mqtt-client";
|
|
2
|
+
export declare const isTouchScreenDevice: () => boolean;
|
|
3
|
+
export declare const isOnEdge: () => boolean;
|
|
4
|
+
export declare const getExecutionEngineHttpUrl: () => string;
|
|
5
|
+
export declare const getMqttWsUrl: () => Promise<string>;
|
|
6
|
+
export declare const connectToMqttAndGetClient: () => Promise<MqttClient>;
|
|
7
|
+
export declare const getMachineCodeProcessHttpUrl: (processName: string) => string;
|