@robotical/webapp-types 3.25.8 → 3.25.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marty-web-app",
3
- "version": "3.25.8",
3
+ "version": "3.25.9",
4
4
  "private": true,
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -11,6 +11,7 @@ type SimpleButtonProps = {
11
11
  textColour?: string;
12
12
  ariaLabel?: string;
13
13
  buttonType?: "button" | "submit" | "reset";
14
+ className?: string;
14
15
  };
15
- export default function SimpleButton({ onClick, title, titleSize, disabled, colour, otherStyles, borderColour, textColour, ariaLabel, buttonType, }: SimpleButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ export default function SimpleButton({ onClick, title, titleSize, disabled, colour, otherStyles, borderColour, textColour, ariaLabel, buttonType, className, }: SimpleButtonProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -87,8 +87,8 @@ var getAccessibleTextColour = function (backgroundColour) {
87
87
  return blackContrast >= whiteContrast ? BLACK : WHITE;
88
88
  };
89
89
  export default function SimpleButton(_a) {
90
- var onClick = _a.onClick, title = _a.title, titleSize = _a.titleSize, disabled = _a.disabled, colour = _a.colour, otherStyles = _a.otherStyles, borderColour = _a.borderColour, textColour = _a.textColour, ariaLabel = _a.ariaLabel, _b = _a.buttonType, buttonType = _b === void 0 ? "button" : _b;
90
+ var onClick = _a.onClick, title = _a.title, titleSize = _a.titleSize, disabled = _a.disabled, colour = _a.colour, otherStyles = _a.otherStyles, borderColour = _a.borderColour, textColour = _a.textColour, ariaLabel = _a.ariaLabel, _b = _a.buttonType, buttonType = _b === void 0 ? "button" : _b, _c = _a.className, className = _c === void 0 ? "" : _c;
91
91
  var resolvedTextColour = textColour || getAccessibleTextColour(colour);
92
92
  return (_jsx("button", __assign({ type: buttonType, className: "simple-button-component " +
93
- (disabled ? "simple-button-component-disabled" : ""), disabled: disabled, "aria-label": ariaLabel, style: __assign(__assign({}, otherStyles), { fontSize: titleSize, backgroundColor: colour, border: borderColour && "1px solid ".concat(borderColour), color: resolvedTextColour }), onClick: onClick }, { children: title })));
93
+ (disabled ? "simple-button-component-disabled" : "") + " " + className, disabled: disabled, "aria-label": ariaLabel, style: __assign(__assign({}, otherStyles), { fontSize: titleSize, backgroundColor: colour, border: borderColour && "1px solid ".concat(borderColour), color: resolvedTextColour }), onClick: onClick }, { children: title })));
94
94
  }
@@ -6,13 +6,14 @@ declare const english: {
6
6
  readonly uploadPending: "Some calibration data is waiting to upload. It is saved on this device and will retry automatically when the connection is available.";
7
7
  readonly uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.";
8
8
  readonly phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.";
9
+ readonly phoneUploadsAutomatic: "Calibration readings upload automatically under this session ID. Keep the app open while calibrating.";
9
10
  readonly retryUpload: "Retry calibration upload";
10
11
  readonly introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.";
11
12
  readonly sensor: "Colour sensor";
12
13
  readonly selectSensor: "Select a colour sensor";
13
14
  readonly selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.";
14
15
  readonly step: "Step {{number}} of 2";
15
- readonly air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
16
+ readonly air: "Leave USB power connected. Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
16
17
  readonly white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.";
17
18
  readonly duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.";
18
19
  readonly preparing: "Preparing the sensor…";
@@ -30,8 +31,8 @@ declare const english: {
30
31
  readonly calibrationRequired: "Calibrate the colour sensor";
31
32
  readonly saved: "Calibration saved on Marty: {{count}} readings each for air and white.";
32
33
  readonly reconnectStep: "Final step: reconnect Marty";
33
- readonly reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
34
- readonly disconnectToFinish: "Disconnect Marty to finish calibration";
34
+ readonly reconnect: "Leave the USB cable plugged in. Use Disconnect in app below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
35
+ readonly disconnectToFinish: "Disconnect in app";
35
36
  readonly disconnecting: "Disconnecting Marty…";
36
37
  readonly loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…";
37
38
  readonly calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.";
@@ -46,6 +47,7 @@ declare const english: {
46
47
  readonly notInAir: "Lift Marty so both feet are clear of the surface, then try again.";
47
48
  readonly sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.";
48
49
  readonly unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.";
50
+ readonly sensorInitialising: "The colour sensor is still getting ready. Keep Marty connected, wait a few seconds and try this step again.";
49
51
  readonly readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.";
50
52
  readonly unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.";
51
53
  readonly saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.";
@@ -6,13 +6,14 @@ var english = {
6
6
  uploadPending: "Some calibration data is waiting to upload. It is saved on this device and will retry automatically when the connection is available.",
7
7
  uploadStorageWarning: "Some calibration data could not be saved on this device yet. Keep the app open and retry uploading before closing it.",
8
8
  phoneUploadPending: "Calibration data is waiting to upload. Keep the app open until uploading finishes so these readings are not lost.",
9
+ phoneUploadsAutomatic: "Calibration readings upload automatically under this session ID. Keep the app open while calibrating.",
9
10
  retryUpload: "Retry calibration upload",
10
11
  introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white, then save the calibration. Keep the lighting the same throughout.",
11
12
  sensor: "Colour sensor",
12
13
  selectSensor: "Select a colour sensor",
13
14
  selectReplacementSensor: "The sensor selected in diagnostics is no longer attached. Select the colour sensor you want to calibrate.",
14
15
  step: "Step {{number}} of 2",
15
- air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
16
+ air: "Leave USB power connected. Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
16
17
  white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.",
17
18
  duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.",
18
19
  preparing: "Preparing the sensor…",
@@ -30,8 +31,8 @@ var english = {
30
31
  calibrationRequired: "Calibrate the colour sensor",
31
32
  saved: "Calibration saved on Marty: {{count}} readings each for air and white.",
32
33
  reconnectStep: "Final step: reconnect Marty",
33
- reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
34
- disconnectToFinish: "Disconnect Marty to finish calibration",
34
+ reconnect: "Leave the USB cable plugged in. Use Disconnect in app below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
35
+ disconnectToFinish: "Disconnect in app",
35
36
  disconnecting: "Disconnecting Marty…",
36
37
  loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…",
37
38
  calibrationCheckDelayed: "Marty is connected, but the sensor check is taking longer than expected. The app is retrying automatically. Keep the sensor attached and Marty on USB power. If this continues, disconnect and reconnect Marty.",
@@ -46,6 +47,7 @@ var english = {
46
47
  notInAir: "Lift Marty so both feet are clear of the surface, then try again.",
47
48
  sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.",
48
49
  unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.",
50
+ sensorInitialising: "The colour sensor is still getting ready. Keep Marty connected, wait a few seconds and try this step again.",
49
51
  readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.",
50
52
  unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.",
51
53
  saturated: "The air readings reached the sensor's limit of 255. Lift Marty clear of the surface and keep it away from direct bright light, then retry. No new calibration was saved.",
@@ -250,9 +250,12 @@ export var readColourSensorReadiness = function (sensor, signal, checkActive) {
250
250
  var result = response;
251
251
  if ((result === null || result === void 0 ? void 0 : result.rslt) === "ok" && result.colourDiagnosticsProtocol === 1 && typeof result.ready === "boolean")
252
252
  ok(result.ready);
253
- else
253
+ // An older bridge forwards this local query to firmware and replies without the diagnostics protocol.
254
+ else if (((result === null || result === void 0 ? void 0 : result.rslt) === "ok" || (result === null || result === void 0 ? void 0 : result.rslt) === "fail") && result.colourDiagnosticsProtocol !== 1)
254
255
  unavailable("unsupported");
255
- }, function () { return unavailable("unsupported"); });
256
+ else
257
+ unavailable((result === null || result === void 0 ? void 0 : result.rslt) === "fail" ? "commandFailed" : "invalidResponse");
258
+ }, function () { return unavailable("commandFailed"); });
256
259
  });
257
260
  };
258
261
  export var collectColourSensorSetup = function (sensor, signal, checkActive) { return __awaiter(void 0, void 0, void 0, function () {
@@ -5,7 +5,7 @@
5
5
  "boundaries": [
6
6
  { "hue": [0, 15], "chroma": [50, 200], "clear": [40, 150], "name": "red" },
7
7
  { "hue": [20, 65], "chroma": [40, 300], "clear": [100, 255], "name": "yellow" },
8
- { "hue": [75, 160], "chroma": [5, 100], "clear": [25, 150], "name": "green" },
8
+ { "hue": [75, 170], "chroma": [5, 100], "clear": [25, 150], "name": "green" },
9
9
  { "hue": [180, 240], "chroma": [40, 260], "clear": [55, 255], "name": "blue" },
10
10
  { "hue": [240, 320], "chroma": [5, 100], "clear": [10, 150], "name": "purple" },
11
11
  { "hue": [345, 361], "chroma": [50, 200], "clear": [40, 150], "name": "red" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/webapp-types",
3
- "version": "3.25.8",
3
+ "version": "3.25.9",
4
4
  "description": "Type definitions for the Application Manager",
5
5
  "main": "dist/application-manager.d.ts",
6
6
  "types": "dist/application-manager.d.ts",