@vention/machine-logic-ui-sdk 0.27.7 → 0.28.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vention/machine-logic-ui-sdk",
3
- "version": "0.27.7",
3
+ "version": "0.28.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/VentionCo/machine-cloud.git"
@@ -23,5 +23,5 @@
23
23
  "module": "./index.esm.js",
24
24
  "type": "module",
25
25
  "main": "./index.esm.js",
26
- "types": "./index.esm.d.ts"
26
+ "types": "./index.d.ts"
27
27
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./lib/components/virtual-keyboard/virtual-keyboard";
2
+ export * from "./lib/utils/machine-logic-ui-sdk-utils";
3
+ export * from "./lib/mqtt-browser/mqtt-client";
4
+ export * from "./lib/mqtt/mqtt-context";
5
+ export * from "./lib/mqtt/use-mqtt-subscription";
6
+ export * from "./lib/mqtt/generic-mqtt-mapping";
@@ -0,0 +1,42 @@
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
+ };
42
+ export type InputType = keyof typeof KeyboardLayoutsByInputType;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import "react-simple-keyboard/build/css/index.css";
3
+ export declare const VirtualKeyboard: () => JSX.Element | null;
4
+ export declare const useStyles: import("tss-react").Tss.UseStyles<{
5
+ theme: import("@mui/material").Theme;
6
+ }, Record<never, unknown>, "virtualKeyboard", import("tss-react/mui").MuiThemeStyleOverridesPluginParams>;
@@ -0,0 +1 @@
1
+ export type MqttPayloadByTopic<TMapping extends Record<string, unknown>, T extends keyof TMapping> = TMapping[T];
@@ -0,0 +1,16 @@
1
+ import { MutableRefObject, ReactNode } from "react";
2
+ import { MqttClient } from "mqtt";
3
+ interface MqttContext {
4
+ client: MqttClient | null;
5
+ connectionStatus: "connected" | "disconnected" | "error";
6
+ subscribedTopics: MutableRefObject<Set<string>> | null;
7
+ addSubscribedTopic: (topic: string) => void;
8
+ removeSubscribedTopic: (topic: string) => void;
9
+ }
10
+ export declare const mqttContext: import("react").Context<MqttContext>;
11
+ interface Props {
12
+ children: ReactNode;
13
+ version?: "v2" | "v3";
14
+ }
15
+ export declare const MqttProvider: (props: Props) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ topic: string;
3
+ unsubscribeOnUnmount?: boolean;
4
+ }
5
+ export declare const useMqttSubscription: <TMessage>(props: Props) => TMessage;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface Callback {
2
+ (topic: string, message: string): void;
3
+ }
4
+ export 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
+ }
@@ -0,0 +1,10 @@
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: (version?: "v2" | "v3") => Promise<string>;
6
+ export declare const connectToMqttAndGetClient: () => Promise<MqttClient>;
7
+ export declare const getMachineCodeProcessHttpUrl: (processName: string) => string;
8
+ export declare const getMqttWsUrlGivenUiIframeUrl: (uiIframeUrl: string) => string;
9
+ export declare const closeCustomUi: () => void;
10
+ export declare const navigateControlCenter: (route: "remoteSupport" | "controlCenterHomepage") => void;
package/index.esm.css DELETED
@@ -1,22 +0,0 @@
1
- /*!
2
- *
3
- * react-simple-keyboard v3.8.196
4
- * https://github.com/hodgef/react-simple-keyboard
5
- *
6
- * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- *
11
- */
12
- /*!
13
- *
14
- * simple-keyboard v3.8.134
15
- * https://github.com/hodgef/simple-keyboard
16
- *
17
- * Copyright (c) Francisco Hodge (https://github.com/hodgef) and project contributors.
18
- *
19
- * This source code is licensed under the MIT license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- *
22
- */.hg-theme-default{background-color:#ececec;border-radius:5px;box-sizing:border-box;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;overflow:hidden;padding:5px;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.hg-theme-default .hg-button span,.hg-theme-default .hg-button span svg{pointer-events:none}.hg-theme-default button.hg-button{border-width:0;font-size:inherit}.hg-theme-default .hg-button{display:inline-block;flex-grow:1}.hg-theme-default .hg-row{display:flex}.hg-theme-default .hg-row:not(:last-child){margin-bottom:5px}.hg-theme-default .hg-row .hg-button-container,.hg-theme-default .hg-row .hg-button:not(:last-child){margin-right:5px}.hg-theme-default .hg-row>div:last-child{margin-right:0}.hg-theme-default .hg-row .hg-button-container{display:flex}.hg-theme-default .hg-button{align-items:center;background:#fff;border-bottom:1px solid #b5b5b5;border-radius:5px;box-shadow:0 0 3px -1px rgba(0,0,0,.3);box-sizing:border-box;cursor:pointer;display:flex;height:40px;justify-content:center;padding:5px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.hg-theme-default .hg-button.hg-standardBtn{width:20px}.hg-theme-default .hg-button.hg-activeButton{background:#efefef}.hg-theme-default.hg-layout-numeric .hg-button{align-items:center;display:flex;height:60px;justify-content:center;width:33.3%}.hg-theme-default .hg-button.hg-button-numpadadd,.hg-theme-default .hg-button.hg-button-numpadenter{height:85px}.hg-theme-default .hg-button.hg-button-numpad0{width:105px}.hg-theme-default .hg-button.hg-button-com{max-width:85px}.hg-theme-default .hg-button.hg-standardBtn.hg-button-at{max-width:45px}.hg-theme-default .hg-button.hg-selectedButton{background:rgba(5,25,70,.53);color:#fff}.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=".com"]{max-width:82px}.hg-theme-default .hg-button.hg-standardBtn[data-skbtn="@"]{max-width:60px}.hg-candidate-box{background:#ececec;border-bottom:2px solid #b5b5b5;border-radius:5px;display:inline-flex;margin-top:-10px;position:absolute;transform:translateY(-100%);-webkit-user-select:none;-moz-user-select:none;user-select:none}ul.hg-candidate-box-list{display:flex;flex:1;list-style:none;margin:0;padding:0}li.hg-candidate-box-list-item{align-items:center;display:flex;height:40px;justify-content:center;width:40px}li.hg-candidate-box-list-item:hover{background:rgba(0,0,0,.03);cursor:pointer}li.hg-candidate-box-list-item:active{background:rgba(0,0,0,.1)}.hg-candidate-box-prev:before{content:"◄"}.hg-candidate-box-next:before{content:"►"}.hg-candidate-box-next,.hg-candidate-box-prev{align-items:center;color:#969696;cursor:pointer;display:flex;padding:0 10px}.hg-candidate-box-next{border-bottom-right-radius:5px;border-top-right-radius:5px}.hg-candidate-box-prev{border-bottom-left-radius:5px;border-top-left-radius:5px}.hg-candidate-box-btn-active{color:#444}
File without changes