@thx/controls 17.3.1 → 17.3.2-alpha.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/dist/esm/date/LocalDatePicker/LocalDatePicker.js.map +1 -1
- package/dist/esm/date/LocalDatePicker/MaskedDateInput.js.map +1 -1
- package/dist/esm/date/LocalMonthSelect/LocalMonthSelect.js.map +1 -1
- package/dist/esm/date/LocalTimePicker/MaskedTimeInput.js.map +1 -1
- package/dist/esm/date/MonthDayPicker/MonthDayPicker.js.map +1 -1
- package/dist/esm/date/MonthYearPicker/MonthYearPicker.js.map +1 -1
- package/dist/esm/date/YearSelect/YearSelect.js.map +1 -1
- package/dist/esm/form/TForm/TForm.js.map +1 -1
- package/dist/esm/form/TForm/useTForm.js.map +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardInput.js.map +1 -1
- package/dist/esm/inputs/CreditCardInput/CreditCardNumberInput.js.map +1 -1
- package/dist/esm/inputs/MaskedInput/MaskedInput.js.map +1 -1
- package/dist/esm/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/esm/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/inputs/SinInput/SinInput.js.map +1 -1
- package/dist/esm/inputs/TableInput/CheckboxEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/DropdownCell.js +1 -1
- package/dist/esm/inputs/TableInput/DropdownCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/NumberEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/StringEditCell.js.map +1 -1
- package/dist/esm/inputs/TableInput/TableInput.js.map +1 -1
- package/dist/esm/money/MoneyCurrencyInput/MoneyCurrencyInput.js.map +1 -1
- package/dist/esm/money/MoneyInput/MoneyInput.js.map +1 -1
- package/dist/esm/money/useMoneyInput.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/date/LocalDatePicker/LocalDatePicker.d.ts +1 -1
- package/dist/types/date/LocalDatePicker/MaskedDateInput.d.ts +1 -1
- package/dist/types/date/LocalMonthSelect/LocalMonthSelect.d.ts +1 -1
- package/dist/types/date/LocalTimePicker/MaskedTimeInput.d.ts +1 -1
- package/dist/types/date/MonthDayPicker/MonthDayPicker.d.ts +1 -1
- package/dist/types/date/MonthYearPicker/MonthYearPicker.d.ts +1 -1
- package/dist/types/date/YearSelect/YearSelect.d.ts +1 -1
- package/dist/types/form/TForm/TForm.d.ts +1 -1
- package/dist/types/form/TForm/useTForm.d.ts +2 -2
- package/dist/types/inputs/CreditCardInput/CreditCardInput.d.ts +1 -1
- package/dist/types/inputs/CreditCardInput/CreditCardNumberInput.d.ts +1 -1
- package/dist/types/inputs/MaskedInput/MaskedInput.d.ts +1 -1
- package/dist/types/inputs/PhoneInput/PhoneInput.d.ts +1 -1
- package/dist/types/inputs/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/inputs/TableInput/CheckboxEditCell.d.ts +1 -1
- package/dist/types/inputs/TableInput/NumberEditCell.d.ts +1 -1
- package/dist/types/inputs/TableInput/StringEditCell.d.ts +1 -1
- package/dist/types/inputs/TableInput/TableInput.d.ts +3 -3
- package/dist/types/money/MoneyCurrencyInput/MoneyCurrencyInput.d.ts +1 -1
- package/dist/types/money/MoneyInput/MoneyInput.d.ts +2 -2
- package/dist/types/money/useMoneyInput.d.ts +1 -1
- package/package.json +4 -4
- package/dist/esm/inputs/Scriptel/Scriptel.js +0 -52
- package/dist/esm/inputs/Scriptel/Scriptel.js.map +0 -1
- package/dist/esm/inputs/Scriptel/ScriptelContext.js +0 -6
- package/dist/esm/inputs/Scriptel/ScriptelContext.js.map +0 -1
- package/dist/esm/inputs/Scriptel/scriptel/enums.js +0 -21
- package/dist/esm/inputs/Scriptel/scriptel/enums.js.map +0 -1
- package/dist/esm/inputs/Scriptel/scriptel/index.js +0 -93
- package/dist/esm/inputs/Scriptel/scriptel/index.js.map +0 -1
- package/dist/esm/inputs/Scriptel/withScriptel.js +0 -15
- package/dist/esm/inputs/Scriptel/withScriptel.js.map +0 -1
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js +0 -67
- package/dist/esm/inputs/ScriptelInput/ScriptelInput.js.map +0 -1
- package/dist/stats.txt +0 -104
- package/dist/types/inputs/Scriptel/Scriptel.d.ts +0 -10
- package/dist/types/inputs/Scriptel/ScriptelContext.d.ts +0 -9
- package/dist/types/inputs/Scriptel/index.d.ts +0 -4
- package/dist/types/inputs/Scriptel/scriptel/classes.d.ts +0 -144
- package/dist/types/inputs/Scriptel/scriptel/enums.d.ts +0 -16
- package/dist/types/inputs/Scriptel/scriptel/index.d.ts +0 -17
- package/dist/types/inputs/Scriptel/scriptel/messages.d.ts +0 -52
- package/dist/types/inputs/Scriptel/withScriptel.d.ts +0 -8
- package/dist/types/inputs/ScriptelInput/ScriptelInput.d.ts +0 -7
- package/dist/types/inputs/ScriptelInput/index.d.ts +0 -2
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import debug from 'debug';
|
|
2
|
-
import EventEmitter from 'eventemitter3';
|
|
3
|
-
import { ScriptelMessageClass, ScriptelPenStyle } from './enums.js';
|
|
4
|
-
|
|
5
|
-
const d = debug("thx.controls.inputs.Scriptel.scriptel");
|
|
6
|
-
function serverConnected(msg, socket) {
|
|
7
|
-
d("Server connected");
|
|
8
|
-
if (msg.serverInfo.devices.length > 0) {
|
|
9
|
-
const device = msg.serverInfo.devices[0];
|
|
10
|
-
socket.send(JSON.stringify({
|
|
11
|
-
_class: "DeviceOpenRequest",
|
|
12
|
-
uuid: device.uuid
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function deviceConnected(msg, socket, args) {
|
|
17
|
-
d(`Device connected: ${msg.device.uuid}`);
|
|
18
|
-
const { imageType, scale, crop, penStyle } = args;
|
|
19
|
-
socket.send(JSON.stringify({
|
|
20
|
-
_class: "RenderSettingsUpdateRequest",
|
|
21
|
-
renderSettings: {
|
|
22
|
-
_class: "RenderSettings",
|
|
23
|
-
type: imageType || "image/svg+xml",
|
|
24
|
-
scale: scale || 1,
|
|
25
|
-
crop: crop || false,
|
|
26
|
-
penStyle: penStyle ? {
|
|
27
|
-
renderFunction: penStyle
|
|
28
|
-
} : {
|
|
29
|
-
renderFunction: ScriptelPenStyle.Plain
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
function render(msg, args, eventEmitter) {
|
|
35
|
-
d(`Rendered image: ${msg.type} ${msg.width}x${msg.height}`);
|
|
36
|
-
eventEmitter.emit("render", msg);
|
|
37
|
-
}
|
|
38
|
-
class ScriptelSocket extends EventEmitter {
|
|
39
|
-
constructor(args) {
|
|
40
|
-
super();
|
|
41
|
-
this.options = args;
|
|
42
|
-
this.socket = new WebSocket(args.omniscriptUrl || "ws://localhost:8080");
|
|
43
|
-
this.socket.onopen = () => {
|
|
44
|
-
d("Socket open");
|
|
45
|
-
};
|
|
46
|
-
this.socket.onclose = () => {
|
|
47
|
-
d("Socket closed");
|
|
48
|
-
};
|
|
49
|
-
this.socket.onmessage = (ev) => {
|
|
50
|
-
const msg = JSON.parse(ev.data);
|
|
51
|
-
if (!msg._class)
|
|
52
|
-
return;
|
|
53
|
-
switch (msg._class) {
|
|
54
|
-
case ScriptelMessageClass.ConnectionOpen:
|
|
55
|
-
serverConnected(msg, this.socket);
|
|
56
|
-
break;
|
|
57
|
-
case ScriptelMessageClass.DeviceOpenResponse:
|
|
58
|
-
deviceConnected(msg, this.socket, this.options);
|
|
59
|
-
break;
|
|
60
|
-
case ScriptelMessageClass.RenderedImage:
|
|
61
|
-
render(msg, this.options, this);
|
|
62
|
-
break;
|
|
63
|
-
case ScriptelMessageClass.ScriptelException:
|
|
64
|
-
d(`Scriptel Exception Error: ${msg.message}`);
|
|
65
|
-
break;
|
|
66
|
-
case ScriptelMessageClass.ButtonPress:
|
|
67
|
-
if (msg.label === "Cancel")
|
|
68
|
-
this.emit("cancel");
|
|
69
|
-
break;
|
|
70
|
-
case ScriptelMessageClass.ButtonDown:
|
|
71
|
-
if (msg.label === "OK")
|
|
72
|
-
this.emit("okButtonDown");
|
|
73
|
-
break;
|
|
74
|
-
case ScriptelMessageClass.PenMove:
|
|
75
|
-
this.emit("penMove");
|
|
76
|
-
break;
|
|
77
|
-
case ScriptelMessageClass.PenUp:
|
|
78
|
-
this.emit("penUp");
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
calibrate() {
|
|
84
|
-
d("calibrate");
|
|
85
|
-
this.socket.send(JSON.stringify({ _class: "ForceRecalibrate" }));
|
|
86
|
-
}
|
|
87
|
-
close() {
|
|
88
|
-
this.socket.close();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export { ScriptelSocket };
|
|
93
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/inputs/Scriptel/scriptel/index.ts"],"sourcesContent":["/* globals WebSocket: true */\nimport debug from 'debug';\nimport EventEmitter from 'eventemitter3';\nimport {ScriptelMessageClass, ScriptelPenStyle} from './enums';\nimport type {ConnectionOpen, DeviceOpenResponse, Message, RenderedImage} from './messages';\n\nconst d = debug('thx.controls.inputs.Scriptel.scriptel');\n\nexport interface ScriptelSocketArgs {\n\tomniscriptUrl?: string; // Defaults to 'ws://localhost:8080'\n\timageType?: string; // Defaults to 'image/svg+xml'.\n\tscale?: number; // Defaults to 1\n\tcrop?: boolean; // Defaults to false\n\tpenStyle?: ScriptelPenStyle; // Defaults to 'PlainPenStyle'\n\trender?: () => void;\n}\n\nfunction serverConnected(msg: ConnectionOpen, socket: WebSocket) {\n\td('Server connected');\n\tif (msg.serverInfo.devices.length > 0) {\n\t\t// Grab the first available device\n\t\tconst device = msg.serverInfo.devices[0];\n\t\tsocket.send(\n\t\t\tJSON.stringify({\n\t\t\t\t_class: 'DeviceOpenRequest',\n\t\t\t\tuuid: device.uuid,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nfunction deviceConnected(msg: DeviceOpenResponse, socket: WebSocket, args: ScriptelSocketArgs) {\n\td(`Device connected: ${msg.device.uuid}`);\n\tconst {imageType, scale, crop, penStyle} = args;\n\tsocket.send(\n\t\tJSON.stringify({\n\t\t\t_class: 'RenderSettingsUpdateRequest',\n\t\t\trenderSettings: {\n\t\t\t\t_class: 'RenderSettings',\n\t\t\t\ttype: imageType || 'image/svg+xml',\n\t\t\t\tscale: scale || 1,\n\t\t\t\tcrop: crop || false,\n\t\t\t\tpenStyle: penStyle\n\t\t\t\t\t? {\n\t\t\t\t\t\t\trenderFunction: penStyle,\n\t\t\t\t\t }\n\t\t\t\t\t: {\n\t\t\t\t\t\t\trenderFunction: ScriptelPenStyle.Plain,\n\t\t\t\t\t },\n\t\t\t},\n\t\t}),\n\t);\n}\n\nfunction render(msg: RenderedImage, args: ScriptelSocketArgs, eventEmitter: EventEmitter) {\n\td(`Rendered image: ${msg.type} ${msg.width}x${msg.height}`);\n\teventEmitter.emit('render', msg);\n}\n\nexport class ScriptelSocket extends EventEmitter {\n\tprivate socket: WebSocket;\n\tprivate options: ScriptelSocketArgs;\n\n\tconstructor(args: ScriptelSocketArgs) {\n\t\tsuper();\n\n\t\tthis.options = args;\n\n\t\tthis.socket = new WebSocket(args.omniscriptUrl || 'ws://localhost:8080');\n\n\t\tthis.socket.onopen = () => {\n\t\t\td('Socket open');\n\t\t};\n\n\t\tthis.socket.onclose = () => {\n\t\t\td('Socket closed');\n\t\t};\n\n\t\tthis.socket.onmessage = ev => {\n\t\t\tconst msg = JSON.parse(ev.data) as Message;\n\t\t\tif (!msg._class) return; // A message with no class.\n\n\t\t\tswitch (msg._class) {\n\t\t\t\tcase ScriptelMessageClass.ConnectionOpen:\n\t\t\t\t\tserverConnected(msg, this.socket);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.DeviceOpenResponse:\n\t\t\t\t\tdeviceConnected(msg, this.socket, this.options);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.RenderedImage:\n\t\t\t\t\trender(msg, this.options, this);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.ScriptelException:\n\t\t\t\t\td(`Scriptel Exception Error: ${msg.message}`);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ScriptelMessageClass.ButtonPress:\n\t\t\t\t\tif (msg.label === 'Cancel') this.emit('cancel');\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.ButtonDown:\n\t\t\t\t\tif (msg.label === 'OK') this.emit('okButtonDown');\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.PenMove:\n\t\t\t\t\tthis.emit('penMove');\n\t\t\t\t\tbreak;\n\t\t\t\tcase ScriptelMessageClass.PenUp:\n\t\t\t\t\tthis.emit('penUp');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\t\t};\n\t}\n\n\tcalibrate() {\n\t\td('calibrate');\n\t\tthis.socket.send(JSON.stringify({_class: 'ForceRecalibrate'}));\n\t}\n\n\tclose() {\n\t\tthis.socket.close();\n\t}\n}\n"],"names":[],"mappings":";;;;AAMA,MAAM,CAAA,GAAI,MAAM,uCAAuC,CAAA,CAAA;AAWvD,SAAA,eAAA,CAAyB,KAAqB,MAAmB,EAAA;AAChE,EAAA,CAAA,CAAE,kBAAkB,CAAA,CAAA;AACpB,EAAA,IAAI,GAAI,CAAA,UAAA,CAAW,OAAQ,CAAA,MAAA,GAAS,CAAG,EAAA;AAEtC,IAAM,MAAA,MAAA,GAAS,GAAI,CAAA,UAAA,CAAW,OAAQ,CAAA,CAAA,CAAA,CAAA;AACtC,IAAO,MAAA,CAAA,IAAA,CACN,KAAK,SAAU,CAAA;AAAA,MACd,MAAQ,EAAA,mBAAA;AAAA,MACR,MAAM,MAAO,CAAA,IAAA;AAAA,KACb,CACF,CAAA,CA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IAAA,CAAK,KAAK,cAAc,CAAA,CAAA;AAChD,UAAA,MAAA;AAAA,QAAA,KACI,oBAAqB,CAAA,OAAA;AACzB,UAAA,IAAA,CAAK,KAAK,SAAS,CAAA,CAAA;AACnB,UAAA,MAAA;AAAA,QAAA,KACI,oBAAqB,CAAA,KAAA;AACzB,UAAA,IAAA,CAAK,KAAK,OAAO,CAAA,CAAA;AACjB,UAAA,MAAA;AAAA,OAAA;AAAA,KAGH,CAAA;AAAA,GACD;AAAA,EAEA,SAAY,GAAA;AACX,IAAA,CAAA,CAAE,WAAW,CAAA,CAAA;AACb,IAAK,IAAA,CAAA,MAAA,CAAO,KAAK,IAAK,CAAA,SAAA,CAAU,EAAC,MAAQ,EAAA,kBAAA,EAAmB,CAAC,CAAA,CAAA;AAAA,GAC9D;AAAA,EAEA,KAAQ,GAAA;AACP,IAAA,IAAA,CAAK,OAAO,KAAM,EAAA,CAAA;AAAA,GACnB;AACD;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Scriptel } from './Scriptel.js';
|
|
3
|
-
|
|
4
|
-
function withScriptel(WrappedComponent, scriptelProps) {
|
|
5
|
-
return function withScriptelHoC(props) {
|
|
6
|
-
return /* @__PURE__ */ React.createElement(Scriptel, {
|
|
7
|
-
...scriptelProps
|
|
8
|
-
}, /* @__PURE__ */ React.createElement(WrappedComponent, {
|
|
9
|
-
...props
|
|
10
|
-
}));
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { withScriptel };
|
|
15
|
-
//# sourceMappingURL=withScriptel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withScriptel.js","sources":["../../../../src/inputs/Scriptel/withScriptel.tsx"],"sourcesContent":["import {Scriptel, ScriptelProps} from './Scriptel';\n\n/**\n * A HoC that provides a connection to a Scriptel Omniscript device.\n * You can only have a single connection open at a time.\n * @param WrappedComponent\n * @return {Object}\n */\nexport function withScriptel(WrappedComponent: any, scriptelProps: ScriptelProps) {\n\treturn function withScriptelHoC(props: any) {\n\t\treturn (\n\t\t\t<Scriptel {...scriptelProps}>\n\t\t\t\t<WrappedComponent {...props} />\n\t\t\t</Scriptel>\n\t\t);\n\t};\n}\n"],"names":[],"mappings":";;;AAQO,SAAA,YAAA,CAAsB,kBAAuB,aAA8B,EAAA;AACjF,EAAA,OAAO,yBAAyB,KAAY,EAAA;AAC3C,IAAA,uBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,MAAa,GAAA,aAAA;AAAA,KAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,MAAqB,GAAA,KAAA;AAAA,KAAO,CAC9B,CAAA,CAAA;AAAA,GAEF,CAAA;AACD;;;;"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useState, useEffect } from 'react';
|
|
2
|
-
import debug from 'debug';
|
|
3
|
-
import { Button, Image } from 'semantic-ui-react';
|
|
4
|
-
import { ScriptelContext } from '../Scriptel/ScriptelContext.js';
|
|
5
|
-
|
|
6
|
-
debug("thx.controls.inputs.ScriptelInput");
|
|
7
|
-
function ScriptelInput(props) {
|
|
8
|
-
const { value, onChange, buttonText = "Enter Signature" } = props;
|
|
9
|
-
const ctx = useContext(ScriptelContext);
|
|
10
|
-
const [enterSignature, setEnterSignature] = useState(false);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (enterSignature) {
|
|
13
|
-
if (onChange && ctx?.renderImage) {
|
|
14
|
-
setEnterSignature(false);
|
|
15
|
-
if (ctx.renderImage.type === "image/svg+xml" || ctx.renderImage.type === "image/png") {
|
|
16
|
-
onChange({
|
|
17
|
-
type: ctx.renderImage.type,
|
|
18
|
-
width: ctx.renderImage.width,
|
|
19
|
-
height: ctx.renderImage.height,
|
|
20
|
-
timestamp: new Date(),
|
|
21
|
-
data: ctx.renderImage.data
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (onChange && !ctx) {
|
|
26
|
-
onChange();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, [ctx]);
|
|
30
|
-
if (enterSignature) {
|
|
31
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", null, ctx?.isSigning ? "signing..." : "Enter a signature and click OK."), /* @__PURE__ */ React.createElement(Button, {
|
|
32
|
-
onClick: () => {
|
|
33
|
-
setEnterSignature(false);
|
|
34
|
-
},
|
|
35
|
-
color: "black",
|
|
36
|
-
loading: ctx?.loading,
|
|
37
|
-
disabled: ctx?.loading
|
|
38
|
-
}, "Cancel"), /* @__PURE__ */ React.createElement(Button, {
|
|
39
|
-
size: "mini",
|
|
40
|
-
as: "a",
|
|
41
|
-
basic: true,
|
|
42
|
-
onClick: () => ctx?.socket.current?.calibrate(),
|
|
43
|
-
disabled: ctx?.loading
|
|
44
|
-
}, "Calibrate"));
|
|
45
|
-
}
|
|
46
|
-
if (value && value.data) {
|
|
47
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Image, {
|
|
48
|
-
size: "medium",
|
|
49
|
-
src: value.data,
|
|
50
|
-
bordered: true
|
|
51
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
52
|
-
size: "mini",
|
|
53
|
-
compact: true,
|
|
54
|
-
onClick: () => {
|
|
55
|
-
setEnterSignature(false);
|
|
56
|
-
if (onChange)
|
|
57
|
-
onChange();
|
|
58
|
-
}
|
|
59
|
-
}, "Reset"));
|
|
60
|
-
}
|
|
61
|
-
return /* @__PURE__ */ React.createElement(Button, {
|
|
62
|
-
onClick: () => setEnterSignature(true)
|
|
63
|
-
}, buttonText);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { ScriptelInput };
|
|
67
|
-
//# sourceMappingURL=ScriptelInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptelInput.js","sources":["../../../../src/inputs/ScriptelInput/ScriptelInput.tsx"],"sourcesContent":["import type {ScriptelSchemaType} from '@thx/yup-types';\nimport debug from 'debug';\nimport {useContext, useEffect, useState} from 'react';\nimport {Button, Image} from 'semantic-ui-react';\nimport {ScriptelContext} from '../Scriptel/ScriptelContext';\n\nconst d = debug('thx.controls.inputs.ScriptelInput');\n\nexport interface ScriptelInputProps {\n\tvalue?: ScriptelSchemaType;\n\tonChange?: (value?: ScriptelSchemaType) => void;\n\tbuttonText?: string;\n}\n\nexport function ScriptelInput(props: ScriptelInputProps) {\n\tconst {value, onChange, buttonText = 'Enter Signature'} = props;\n\tconst ctx = useContext(ScriptelContext);\n\n\tconst [enterSignature, setEnterSignature] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (enterSignature) {\n\t\t\tif (onChange && ctx?.renderImage) {\n\t\t\t\tsetEnterSignature(false);\n\t\t\t\tif (ctx.renderImage.type === 'image/svg+xml' || ctx.renderImage.type === 'image/png') {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\ttype: ctx.renderImage.type,\n\t\t\t\t\t\twidth: ctx.renderImage.width,\n\t\t\t\t\t\theight: ctx.renderImage.height,\n\t\t\t\t\t\ttimestamp: new Date(),\n\t\t\t\t\t\tdata: ctx.renderImage.data,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (onChange && !ctx) {\n\t\t\t\tonChange();\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ctx]);\n\n\tif (enterSignature) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<div>{ctx?.isSigning ? 'signing...' : 'Enter a signature and click OK.'}</div>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t}}\n\t\t\t\t\tcolor=\"black\"\n\t\t\t\t\tloading={ctx?.loading}\n\t\t\t\t\tdisabled={ctx?.loading}\n\t\t\t\t>\n\t\t\t\t\tCancel\n\t\t\t\t</Button>\n\t\t\t\t<Button size=\"mini\" as=\"a\" basic onClick={() => ctx?.socket.current?.calibrate()} disabled={ctx?.loading}>\n\t\t\t\t\tCalibrate\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (value && value.data) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Image size=\"medium\" src={value.data} bordered />\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"mini\"\n\t\t\t\t\tcompact\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tsetEnterSignature(false);\n\t\t\t\t\t\tif (onChange) onChange();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\tReset\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <Button onClick={() => setEnterSignature(true)}>{buttonText}</Button>;\n}\n"],"names":[],"mappings":";;;;;AAMU,MAAM,mCAAmC,EAAA;AAQ5C,SAAA,aAAA,CAAuB,KAA2B,EAAA;AACxD,EAAA,MAAM,EAAC,KAAA,EAAO,QAAU,EAAA,UAAA,GAAa,iBAAqB,EAAA,GAAA,KAAA,CAAA;AAC1D,EAAM,MAAA,GAAA,GAAM,WAAW,eAAe,CAAA,CAAA;AAEtC,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAqB,CAAA,GAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAE1D,EAAA,SAAA,CAAU,MAAM;AACf,IAAA,IAAI,cAAgB,EAAA;AACnB,MAAI,IAAA,QAAA,IAAY,KAAK,WAAa,EAAA;AACjC,QAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AACvB,QAAA,IAAI,IAAI,WAAY,CAAA,IAAA,KAAS,mBAAmB,GAAI,CAAA,WAAA,CAAY,SAAS,WAAa,EAAA;AACrF,UAAS,QAAA,CAAA;AAAA,YACR,IAAA,EAAM,IAAI,WAAY,CAAA,IAAA;AAAA,YACtB,KAAA,EAAO,IAAI,WAAY,CAAA,KAAA;AAAA,YACvB,MAAA,E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AQ,EAAA,IAAA;AAAA,KAAC,mBAC9C,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,MACA,IAAK,EAAA,MAAA;AAAA,MACL,OAAO,EAAA,IAAA;AAAA,MACP,SAAS,MAAM;AACd,QAAA,iBAAA,CAAkB,KAAK,CAAA,CAAA;AACvB,QAAI,IAAA,QAAA;AAAU,UAAS,QAAA,EAAA,CAAA;AAAA,OACxB;AAAA,KAAA,EACA,OAED,CACD,CAAA,CAAA;AAAA,GAEF;AAEA,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,IAAO,OAAA,EAAS,MAAM,iBAAA,CAAkB,IAAI,CAAA;AAAA,GAAA,EAAI,UAAW,CAAA,CAAA;AACpE;;;;"}
|
package/dist/stats.txt
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
-----------------------------
|
|
2
|
-
Rollup File Analysis
|
|
3
|
-
-----------------------------
|
|
4
|
-
bundle size: 50.241 KB
|
|
5
|
-
original size: 72.582 KB
|
|
6
|
-
code reduction: 30.78 %
|
|
7
|
-
module count: 48
|
|
8
|
-
|
|
9
|
-
/src/step/StepProvider.tsx
|
|
10
|
-
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 7.02 % (3.529 KB)
|
|
11
|
-
/src/date/LocalDatePicker/LocalDatePicker.tsx
|
|
12
|
-
███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 6.29 % (3.161 KB)
|
|
13
|
-
/src/form/TForm/useTForm.tsx
|
|
14
|
-
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.83 % (2.93 KB)
|
|
15
|
-
/src/inputs/TableInput/TableInput.tsx
|
|
16
|
-
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.75 % (2.891 KB)
|
|
17
|
-
/src/inputs/Scriptel/scriptel/index.ts
|
|
18
|
-
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 5.04 % (2.53 KB)
|
|
19
|
-
/src/inputs/CreditCardInput/CreditCardInput.tsx
|
|
20
|
-
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.63 % (2.324 KB)
|
|
21
|
-
/src/money/useMoneyInput.ts
|
|
22
|
-
██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 4.29 % (2.155 KB)
|
|
23
|
-
/src/date/MonthDayPicker/MonthDayPicker.tsx
|
|
24
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.91 % (1.965 KB)
|
|
25
|
-
/src/inputs/ScriptelInput/ScriptelInput.tsx
|
|
26
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.91 % (1.963 KB)
|
|
27
|
-
/src/inputs/CreditCardInput/CreditCardNumberInput.tsx
|
|
28
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.41 % (1.713 KB)
|
|
29
|
-
/src/date/LocalTimePicker/LocalTimePicker.tsx
|
|
30
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.23 % (1.624 KB)
|
|
31
|
-
/src/money/MoneyCurrencyInput/MoneyCurrencyInput.tsx
|
|
32
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.13 % (1.575 KB)
|
|
33
|
-
/src/date/YearSelect/YearSelect.tsx
|
|
34
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 3.09 % (1.553 KB)
|
|
35
|
-
/src/inputs/MaskedInput/useMaskedInput.ts
|
|
36
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.96 % (1.487 KB)
|
|
37
|
-
/src/inputs/Scriptel/Scriptel.tsx
|
|
38
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.54 % (1.275 KB)
|
|
39
|
-
/src/date/MonthYearPicker/MonthYearPicker.tsx
|
|
40
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.45 % (1.229 KB)
|
|
41
|
-
/src/inputs/SinInput/SinInput.tsx
|
|
42
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.28 % (1.144 KB)
|
|
43
|
-
/src/date/LocalMonthSelect/LocalMonthSelect.tsx
|
|
44
|
-
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.26 % (1.135 KB)
|
|
45
|
-
/src/inputs/Scriptel/scriptel/enums.ts
|
|
46
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.87 % (937 Bytes)
|
|
47
|
-
/src/inputs/PhoneInput/PhoneInput.tsx
|
|
48
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.81 % (908 Bytes)
|
|
49
|
-
/src/inputs/TableInput/MoneyEditCell.tsx
|
|
50
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.63 % (820 Bytes)
|
|
51
|
-
/src/inputs/TableInput/NumberEditCell.tsx
|
|
52
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.56 % (782 Bytes)
|
|
53
|
-
/src/money/MoneyInput/MoneyInput.tsx
|
|
54
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.55 % (778 Bytes)
|
|
55
|
-
/src/inputs/TableInput/StringEditCell.tsx
|
|
56
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.43 % (717 Bytes)
|
|
57
|
-
/src/inputs/TableInput/CheckboxEditCell.tsx
|
|
58
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.4 % (702 Bytes)
|
|
59
|
-
/src/inputs/TableInput/LocalDateEditCell.tsx
|
|
60
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.38 % (695 Bytes)
|
|
61
|
-
/home/artemis/GitHub/thr-addons/node_modules/style-inject/dist/style-inject.es.js
|
|
62
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.27 % (636 Bytes)
|
|
63
|
-
/src/inputs/TableInput/LocalTimeEditCell.tsx
|
|
64
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.24 % (622 Bytes)
|
|
65
|
-
/src/form/TForm/TForm.tsx
|
|
66
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.19 % (600 Bytes)
|
|
67
|
-
/src/inputs/RadioGroup/RadioGroup.tsx
|
|
68
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.12 % (561 Bytes)
|
|
69
|
-
/src/date/DatePicker/styles.css
|
|
70
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.07 % (538 Bytes)
|
|
71
|
-
/src/inputs/MaskedInput/MaskedInput.tsx
|
|
72
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1.02 % (513 Bytes)
|
|
73
|
-
/src/inputs/TableInput/DropdownCell.tsx
|
|
74
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.98 % (493 Bytes)
|
|
75
|
-
/src/step/FormStep.tsx
|
|
76
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.88 % (440 Bytes)
|
|
77
|
-
/src/date/LocalDatePicker/MaskedDateInput.tsx
|
|
78
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.85 % (426 Bytes)
|
|
79
|
-
/src/date/LocalTimePicker/MaskedTimeInput.tsx
|
|
80
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.84 % (424 Bytes)
|
|
81
|
-
/src/inputs/TableInput/MoneySumFooter.tsx
|
|
82
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.82 % (414 Bytes)
|
|
83
|
-
/src/inputs/TableInput/HoverCell.tsx
|
|
84
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.8 % (403 Bytes)
|
|
85
|
-
/src/inputs/TableInput/addRowOnTab.ts
|
|
86
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.62 % (312 Bytes)
|
|
87
|
-
/src/inputs/TableInput/LocalDateCell.tsx
|
|
88
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.57 % (285 Bytes)
|
|
89
|
-
/src/inputs/Scriptel/withScriptel.tsx
|
|
90
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.55 % (275 Bytes)
|
|
91
|
-
/src/inputs/TableInput/MoneyCell.tsx
|
|
92
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.51 % (257 Bytes)
|
|
93
|
-
/src/step/Step.tsx
|
|
94
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.4 % (203 Bytes)
|
|
95
|
-
/src/step/useStep.ts
|
|
96
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.22 % (113 Bytes)
|
|
97
|
-
/src/step/stepContext.ts
|
|
98
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.16 % (80 Bytes)
|
|
99
|
-
/src/inputs/CreditCardInput/styles.css
|
|
100
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.16 % (78 Bytes)
|
|
101
|
-
/src/inputs/Scriptel/ScriptelContext.ts
|
|
102
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.09 % (46 Bytes)
|
|
103
|
-
/src/index.ts
|
|
104
|
-
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0 % (0 Byte)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ScriptelPenStyle } from './scriptel/enums';
|
|
2
|
-
export interface ScriptelProps {
|
|
3
|
-
omniscriptUrl?: string;
|
|
4
|
-
imageType?: string;
|
|
5
|
-
scale?: number;
|
|
6
|
-
crop?: boolean;
|
|
7
|
-
penStyle?: ScriptelPenStyle;
|
|
8
|
-
children: JSX.Element | JSX.Element[];
|
|
9
|
-
}
|
|
10
|
-
export declare function Scriptel({ omniscriptUrl, imageType, scale, crop, penStyle, children }: ScriptelProps): JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import type { ScriptelSocket } from './scriptel';
|
|
3
|
-
import type { RenderedImage } from './scriptel/messages';
|
|
4
|
-
export declare const ScriptelContext: import("react").Context<{
|
|
5
|
-
socket: MutableRefObject<ScriptelSocket | undefined>;
|
|
6
|
-
renderImage: RenderedImage | undefined;
|
|
7
|
-
loading: boolean;
|
|
8
|
-
isSigning: boolean;
|
|
9
|
-
} | undefined>;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
export interface DeviceEndpoint {
|
|
2
|
-
protocolDriver: {
|
|
3
|
-
features: string[];
|
|
4
|
-
};
|
|
5
|
-
devHandle: {
|
|
6
|
-
productId: number;
|
|
7
|
-
vendorId: number;
|
|
8
|
-
manufacturer: string;
|
|
9
|
-
model: string;
|
|
10
|
-
path: string;
|
|
11
|
-
};
|
|
12
|
-
manufacturer: string;
|
|
13
|
-
path: string;
|
|
14
|
-
product: string;
|
|
15
|
-
productId: string;
|
|
16
|
-
uuid: string;
|
|
17
|
-
vendorId: string;
|
|
18
|
-
}
|
|
19
|
-
export interface DisplayInfo {
|
|
20
|
-
captionLength: number;
|
|
21
|
-
characterHeight: number;
|
|
22
|
-
characterWidth: number;
|
|
23
|
-
colorDepth: number;
|
|
24
|
-
height: number;
|
|
25
|
-
regionCount: number;
|
|
26
|
-
width: number;
|
|
27
|
-
}
|
|
28
|
-
export interface SoftwareVersion {
|
|
29
|
-
asicSignature: number;
|
|
30
|
-
firmwareVersion: {
|
|
31
|
-
major: number;
|
|
32
|
-
minor: number;
|
|
33
|
-
release: number;
|
|
34
|
-
};
|
|
35
|
-
kernelVersion: {
|
|
36
|
-
major: number;
|
|
37
|
-
minor: number;
|
|
38
|
-
release: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export interface DisplaySettings {
|
|
42
|
-
blue: number;
|
|
43
|
-
brightness: number;
|
|
44
|
-
command: number;
|
|
45
|
-
contract: number;
|
|
46
|
-
green: number;
|
|
47
|
-
red: number;
|
|
48
|
-
}
|
|
49
|
-
export interface CalibrationMode {
|
|
50
|
-
calibrating: boolean;
|
|
51
|
-
calibrationPoint: string;
|
|
52
|
-
}
|
|
53
|
-
export interface RegionButtonFlags {
|
|
54
|
-
clearOnSelect: boolean;
|
|
55
|
-
confirmOnSelect: boolean;
|
|
56
|
-
enabled: boolean;
|
|
57
|
-
highlightOnSelect: boolean;
|
|
58
|
-
}
|
|
59
|
-
export interface RegionButton {
|
|
60
|
-
caption: string;
|
|
61
|
-
flags: RegionButtonFlags;
|
|
62
|
-
parentContainer: number;
|
|
63
|
-
}
|
|
64
|
-
export interface RegionContainerFlags {
|
|
65
|
-
inkEnabled: boolean;
|
|
66
|
-
}
|
|
67
|
-
export interface RegionContainer {
|
|
68
|
-
flags: RegionContainerFlags;
|
|
69
|
-
}
|
|
70
|
-
export interface RegionLine {
|
|
71
|
-
lineWidth: number;
|
|
72
|
-
parentContainer: number;
|
|
73
|
-
}
|
|
74
|
-
export interface RegionFlags {
|
|
75
|
-
acceptsTouch: boolean;
|
|
76
|
-
decodeRegion: boolean;
|
|
77
|
-
hasFrame: boolean;
|
|
78
|
-
inUse: boolean;
|
|
79
|
-
visible: boolean;
|
|
80
|
-
}
|
|
81
|
-
export interface Region {
|
|
82
|
-
backgroundColor: number[];
|
|
83
|
-
buttonType?: RegionButton;
|
|
84
|
-
containerType?: RegionContainer;
|
|
85
|
-
flags: RegionFlags;
|
|
86
|
-
foregroundColor: number[];
|
|
87
|
-
id: number;
|
|
88
|
-
lineType?: RegionLine;
|
|
89
|
-
x1: number;
|
|
90
|
-
x2: number;
|
|
91
|
-
y1: number;
|
|
92
|
-
y2: number;
|
|
93
|
-
}
|
|
94
|
-
export interface ScreenErrorCorrection {
|
|
95
|
-
boundX1: number;
|
|
96
|
-
boundX2: number;
|
|
97
|
-
boundY1: number;
|
|
98
|
-
boundY2: number;
|
|
99
|
-
correctionMap: number[][];
|
|
100
|
-
valid: boolean;
|
|
101
|
-
xDelta: number;
|
|
102
|
-
xMin: number;
|
|
103
|
-
xOffset: number;
|
|
104
|
-
yDelta: number;
|
|
105
|
-
yMin: number;
|
|
106
|
-
yOffset: number;
|
|
107
|
-
}
|
|
108
|
-
export interface CoordinateRange {
|
|
109
|
-
xMin: number;
|
|
110
|
-
xMax: number;
|
|
111
|
-
yMin: number;
|
|
112
|
-
yMax: number;
|
|
113
|
-
}
|
|
114
|
-
export interface Capabilities {
|
|
115
|
-
displayId: string;
|
|
116
|
-
}
|
|
117
|
-
export interface OperatingMode {
|
|
118
|
-
touch: boolean;
|
|
119
|
-
pen: boolean;
|
|
120
|
-
autoTouch: boolean;
|
|
121
|
-
securePen: boolean;
|
|
122
|
-
secureAutoTouch: boolean;
|
|
123
|
-
command: boolean;
|
|
124
|
-
acquisitionMode: string;
|
|
125
|
-
touchMode: string;
|
|
126
|
-
penMode: string;
|
|
127
|
-
}
|
|
128
|
-
export interface ScriptelDevice {
|
|
129
|
-
uuid: string;
|
|
130
|
-
serialNumber: string;
|
|
131
|
-
model: string;
|
|
132
|
-
manufacturer: string;
|
|
133
|
-
vendorId: number;
|
|
134
|
-
productId: number;
|
|
135
|
-
calibrationMode: CalibrationMode;
|
|
136
|
-
displayInfo: DisplayInfo;
|
|
137
|
-
displaySettings: DisplaySettings;
|
|
138
|
-
errorCorrection: ScreenErrorCorrection;
|
|
139
|
-
regions: Region[];
|
|
140
|
-
softwareVersion: SoftwareVersion;
|
|
141
|
-
coordinateRange: CoordinateRange;
|
|
142
|
-
capabilities: Capabilities;
|
|
143
|
-
operatingMode: OperatingMode;
|
|
144
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare enum ScriptelPenStyle {
|
|
2
|
-
Plain = "PlainPenStyle",
|
|
3
|
-
Chisel = "ChiselPenStyle",
|
|
4
|
-
Inkwell = "InkwellPenStyle"
|
|
5
|
-
}
|
|
6
|
-
export declare enum ScriptelMessageClass {
|
|
7
|
-
ConnectionOpen = "ConnectionOpen",
|
|
8
|
-
DeviceOpenRequest = "DeviceOpenRequest",
|
|
9
|
-
DeviceOpenResponse = "DeviceOpenResponse",
|
|
10
|
-
RenderedImage = "RenderedImage",
|
|
11
|
-
ScriptelException = "ScriptelException",
|
|
12
|
-
ButtonDown = "ButtonDown",
|
|
13
|
-
ButtonPress = "ButtonPress",
|
|
14
|
-
PenMove = "PenMove",
|
|
15
|
-
PenUp = "PenUp"
|
|
16
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { ScriptelPenStyle } from './enums';
|
|
3
|
-
export interface ScriptelSocketArgs {
|
|
4
|
-
omniscriptUrl?: string;
|
|
5
|
-
imageType?: string;
|
|
6
|
-
scale?: number;
|
|
7
|
-
crop?: boolean;
|
|
8
|
-
penStyle?: ScriptelPenStyle;
|
|
9
|
-
render?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare class ScriptelSocket extends EventEmitter {
|
|
12
|
-
private socket;
|
|
13
|
-
private options;
|
|
14
|
-
constructor(args: ScriptelSocketArgs);
|
|
15
|
-
calibrate(): void;
|
|
16
|
-
close(): void;
|
|
17
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { DeviceEndpoint, ScriptelDevice } from './classes';
|
|
2
|
-
import type { ScriptelMessageClass } from './enums';
|
|
3
|
-
export interface ConnectionOpen {
|
|
4
|
-
_class: ScriptelMessageClass.ConnectionOpen;
|
|
5
|
-
serverInfo: {
|
|
6
|
-
devices: DeviceEndpoint[];
|
|
7
|
-
hostname: string;
|
|
8
|
-
safe: boolean;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface DeviceOpenResponse {
|
|
12
|
-
_class: ScriptelMessageClass.DeviceOpenResponse;
|
|
13
|
-
device: ScriptelDevice;
|
|
14
|
-
}
|
|
15
|
-
export interface RenderedImage {
|
|
16
|
-
_class: ScriptelMessageClass.RenderedImage;
|
|
17
|
-
data: string;
|
|
18
|
-
height: number;
|
|
19
|
-
type: string;
|
|
20
|
-
width: number;
|
|
21
|
-
}
|
|
22
|
-
export interface ScriptelException {
|
|
23
|
-
_class: ScriptelMessageClass.ScriptelException;
|
|
24
|
-
message: string;
|
|
25
|
-
}
|
|
26
|
-
export interface ButtonPress {
|
|
27
|
-
_class: ScriptelMessageClass.ButtonPress;
|
|
28
|
-
accept: boolean;
|
|
29
|
-
clear: boolean;
|
|
30
|
-
id: number;
|
|
31
|
-
label: string;
|
|
32
|
-
}
|
|
33
|
-
export interface ButtonDown {
|
|
34
|
-
_class: ScriptelMessageClass.ButtonDown;
|
|
35
|
-
id: number;
|
|
36
|
-
label: string;
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
}
|
|
40
|
-
export interface PenMove {
|
|
41
|
-
_class: ScriptelMessageClass.PenMove;
|
|
42
|
-
time: number;
|
|
43
|
-
x: string;
|
|
44
|
-
y: string;
|
|
45
|
-
}
|
|
46
|
-
export interface PenUp {
|
|
47
|
-
_class: ScriptelMessageClass.PenUp;
|
|
48
|
-
time: number;
|
|
49
|
-
x: string;
|
|
50
|
-
y: string;
|
|
51
|
-
}
|
|
52
|
-
export type Message = ConnectionOpen | DeviceOpenResponse | RenderedImage | ScriptelException | ButtonPress | ButtonDown | PenMove | PenUp;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ScriptelProps } from './Scriptel';
|
|
2
|
-
/**
|
|
3
|
-
* A HoC that provides a connection to a Scriptel Omniscript device.
|
|
4
|
-
* You can only have a single connection open at a time.
|
|
5
|
-
* @param WrappedComponent
|
|
6
|
-
* @return {Object}
|
|
7
|
-
*/
|
|
8
|
-
export declare function withScriptel(WrappedComponent: any, scriptelProps: ScriptelProps): (props: any) => JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ScriptelSchemaType } from '@thx/yup-types';
|
|
2
|
-
export interface ScriptelInputProps {
|
|
3
|
-
value?: ScriptelSchemaType;
|
|
4
|
-
onChange?: (value?: ScriptelSchemaType) => void;
|
|
5
|
-
buttonText?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function ScriptelInput(props: ScriptelInputProps): JSX.Element;
|